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_status.cpp

Last change on this file was 128, checked in by rosiere, 15 years ago

1) Correct bug in link two signal
2) Fix error detected with valgrind
3) modif distexe script

  • Property svn:keywords set to Id
File size: 2.0 KB
Line 
1#ifdef SYSTEMC
2//#if defined(STATISTICS) or defined(VHDL_TESTBENCH)
3/*
4 * $Id: Register_unit_Glue_genMealy_gpr_write_status.cpp 128 2009-06-26 08:43:23Z rosiere $
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_status"
23  void Register_unit_Glue::genMealy_gpr_write_status (void)
24  {
25    log_begin(Register_unit_Glue,FUNCTION);
26    log_function(Register_unit_Glue,FUNCTION,_name.c_str());
27
28    if (PORT_READ(in_NRESET))
29      {
30        for (uint32_t j=0; j<_param->_nb_gpr_write; j++)
31          {
32            Tcontext_t ooo_engine_id    = (_param->_have_port_ooo_engine_id == true)?PORT_READ(in_GPR_WRITE_OOO_ENGINE_ID[j]):0;
33            Tcontrol_t val              = PORT_READ(in_GPR_WRITE_VAL [j]);
34            Tcontrol_t registerfile_ack = PORT_READ(in_GPR_WRITE_REGISTERFILE_ACK [ooo_engine_id][j]);
35            Tcontrol_t status_val       = val and registerfile_ack;
36           
37            for (uint32_t i=0; i<_param->_nb_ooo_engine; i++)
38              {
39                Tcontrol_t id = (i == ooo_engine_id)?1:0;
40
41                log_printf(TRACE,Register_unit_Glue,FUNCTION,"  * GPR_WRITE_STATUS_VAL [%d (%d)][%d] : %d (%d and %d)",i, ooo_engine_id,j,id and status_val, id, status_val);
42
43                PORT_WRITE(out_GPR_WRITE_STATUS_VAL       [i][j], (id and status_val));
44              }
45          }
46      }
47    else
48      {
49        for (uint32_t j=0; j<_param->_nb_gpr_write; j++)
50          for (uint32_t i=0; i<_param->_nb_ooo_engine; i++)
51            PORT_WRITE(out_GPR_WRITE_STATUS_VAL       [i][j], 0);
52      }
53
54
55    log_end(Register_unit_Glue,FUNCTION);
56  };
57
58}; // end namespace register_unit_glue
59}; // end namespace register_unit
60}; // end namespace execute_loop
61}; // end namespace multi_execute_loop
62}; // end namespace core
63
64}; // end namespace behavioural
65}; // end namespace morpheo             
66#endif
67//#endif
Note: See TracBrowser for help on using the repository browser.