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

Last change on this file since 60 was 60, checked in by rosiere, 17 years ago
File size: 2.0 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_spr_write"
23  void Register_unit_Glue::genMealy_spr_write (void)
24  {
25    log_printf(FUNC,Register_unit_Glue,FUNCTION,"Begin");
26
27    for (uint32_t j=0; j<_param->_nb_spr_write; j++)
28      {
29        Tcontext_t ooo_engine_id;
30        if (_param->_have_port_ooo_engine_id == true)
31          ooo_engine_id = PORT_READ(in_SPR_WRITE_OOO_ENGINE_ID        [j]);
32        else
33          ooo_engine_id = 0;
34
35        Tcontrol_t registerfile_ack = PORT_READ(in_SPR_WRITE_REGISTERFILE_ACK [ooo_engine_id][j]);
36        Tcontrol_t status_ack       = PORT_READ(in_SPR_WRITE_STATUS_ACK       [ooo_engine_id][j]);
37
38        // multiplexor
39        PORT_WRITE(out_SPR_WRITE_ACK      [j],registerfile_ack and status_ack);
40
41        for (uint32_t i=0; i<_param->_nb_ooo_engine; i++)
42          {
43            Tcontrol_t registerfile_val;
44            Tcontrol_t status_val;
45            if (i == ooo_engine_id)
46              {
47                registerfile_val = PORT_READ(in_SPR_WRITE_VAL [j]);
48                status_val       = PORT_READ(in_SPR_WRITE_VAL [j]);
49              }
50            else
51              {
52                registerfile_val = 0;
53                status_val       = 0;
54              }
55           
56            PORT_WRITE(out_SPR_WRITE_REGISTERFILE_VAL  [i][j], registerfile_val and status_ack      );
57            PORT_WRITE(out_SPR_WRITE_STATUS_VAL        [i][j], status_val       and registerfile_ack);
58          }
59      }
60
61    log_printf(FUNC,Register_unit_Glue,FUNCTION,"End");
62  };
63
64}; // end namespace register_unit_glue
65}; // end namespace register_unit
66}; // end namespace execute_loop
67}; // end namespace multi_execute_loop
68}; // end namespace core
69
70}; // end namespace behavioural
71}; // end namespace morpheo             
72#endif
73//#endif
Note: See TracBrowser for help on using the repository browser.