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

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