source: trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Execute_loop/Execute_loop/Register_unit/Register_unit_Glue/src/Register_unit_Glue_genMealy_gpr_write.cpp @ 60

Last change on this file since 60 was 60, checked in by rosiere, 17 years ago
File size: 1.8 KB
Line 
1#ifdef SYSTEMC
2//#if defined(STATISTICS) or defined(VHDL_TESTBENCH)
3/*
4 * $Id$
5 *
6 * [ Description ]
7 *
8 */
9
10#include "Behavioural/Core/Multi_Execute_loop/Execute_loop/Register_unit/Register_unit_Glue/include/Register_unit_Glue.h"
11
12namespace morpheo                    {
13namespace behavioural {
14namespace core {
15namespace multi_execute_loop {
16namespace execute_loop {
17namespace register_unit {
18namespace register_unit_glue {
19
20
21#undef  FUNCTION
22#define FUNCTION "Register_unit_Glue::genMealy_gpr_write"
23  void Register_unit_Glue::genMealy_gpr_write (void)
24  {
25    log_printf(FUNC,Register_unit_Glue,FUNCTION,"Begin");
26
27    for (uint32_t j=0; j<_param->_nb_gpr_write; j++)
28      {
29        Tcontext_t ooo_engine_id    = (_param->_have_port_ooo_engine_id == true)?PORT_READ(in_GPR_WRITE_OOO_ENGINE_ID[j]):0;
30        Tcontrol_t val              = PORT_READ(in_GPR_WRITE_VAL [j]);
31        Tcontrol_t registerfile_ack = PORT_READ(in_GPR_WRITE_REGISTERFILE_ACK [ooo_engine_id][j]);
32        Tcontrol_t status_ack       = PORT_READ(in_GPR_WRITE_STATUS_ACK       [ooo_engine_id][j]);
33
34        // multiplexor
35        PORT_WRITE(out_GPR_WRITE_ACK [j],registerfile_ack and status_ack);
36
37        Tcontrol_t registerfile_val = val and registerfile_ack;
38        Tcontrol_t status_val       = val and status_ack;
39       
40        for (uint32_t i=0; i<_param->_nb_ooo_engine; i++)
41          {
42            Tcontrol_t id = (i == ooo_engine_id)?1:0;
43            PORT_WRITE(out_GPR_WRITE_REGISTERFILE_VAL [i][j], (id and status_val));
44            PORT_WRITE(out_GPR_WRITE_STATUS_VAL       [i][j], (id and registerfile_val));
45          }
46      }
47
48    log_printf(FUNC,Register_unit_Glue,FUNCTION,"End");
49  };
50
51}; // end namespace register_unit_glue
52}; // end namespace register_unit
53}; // end namespace execute_loop
54}; // end namespace multi_execute_loop
55}; // end namespace core
56
57}; // end namespace behavioural
58}; // end namespace morpheo             
59#endif
60//#endif
Note: See TracBrowser for help on using the repository browser.