source: trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_OOO_Engine/OOO_Engine/Rename_unit/Register_translation_unit/Register_Address_Translation_unit/src/Register_Address_Translation_unit_allocation.cpp @ 104

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

Fix Bug :
1) Load Store Unit : check big endian
2) Commit unit & RAT : add retire_event interface

  • Property svn:keywords set to Id
File size: 9.3 KB
Line 
1/*
2 * $Id: Register_Address_Translation_unit_allocation.cpp 104 2009-01-21 21:53:13Z rosiere $
3 *
4 * [ Description ]
5 *
6 */
7
8#include "Behavioural/Core/Multi_OOO_Engine/OOO_Engine/Rename_unit/Register_translation_unit/Register_Address_Translation_unit/include/Register_Address_Translation_unit.h"
9#include "Behavioural/include/Allocation.h"
10#include "Behavioural/include/Allocation.h"
11
12namespace morpheo                    {
13namespace behavioural {
14namespace core {
15namespace multi_ooo_engine {
16namespace ooo_engine {
17namespace rename_unit {
18namespace register_translation_unit {
19namespace register_address_translation_unit {
20
21#undef  FUNCTION
22#define FUNCTION "Register_Address_Translation_unit::allocation"
23  void Register_Address_Translation_unit::allocation
24  (
25#ifdef STATISTICS
26   morpheo::behavioural::Parameters_Statistics * param_statistics
27#else
28   void
29#endif
30   )
31  {
32    log_printf(FUNC,Register_Address_Translation_unit,FUNCTION,"Begin");
33   
34    _component   = new Component (_usage);
35   
36    Entity * entity = _component->set_entity (_name       
37                                              ,"Register_Address_Translation_unit"
38#ifdef POSITION
39                                              ,COMBINATORY
40#endif
41                                              );
42   
43    _interfaces = entity->set_interfaces();
44   
45    // ~~~~~[ Interface : "" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
46    {
47      Interface * interface = _interfaces->set_interface(""
48#ifdef POSITION
49                                                         ,IN
50                                                         ,SOUTH,
51                                                         "Generalist interface"
52#endif
53                                                         );
54     
55      in_CLOCK        = interface->set_signal_clk              ("clock" ,1, CLOCK_VHDL_YES);
56      in_NRESET       = interface->set_signal_in  <Tcontrol_t> ("nreset",1, RESET_VHDL_YES);
57    }
58   
59    // ~~~~~[ Interface "rename" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
60    {
61      ALLOC1_INTERFACE("rename",IN,EAST,"Input to rename source logical register", _param->_nb_inst_insert);
62
63      ALLOC1_VALACK_IN ( in_RENAME_VAL               , VAL);
64      ALLOC1_VALACK_OUT(out_RENAME_ACK               , ACK);
65      ALLOC1_SIGNAL_IN ( in_RENAME_FRONT_END_ID      ,"front_end_id"      ,Tcontext_t        ,_param->_size_front_end_id);
66      ALLOC1_SIGNAL_IN ( in_RENAME_CONTEXT_ID        ,"context_id"        ,Tcontext_t        ,_param->_size_context_id  );
67      ALLOC1_SIGNAL_IN ( in_RENAME_NUM_REG_RA_LOG    ,"num_reg_ra_log"    ,Tgeneral_address_t,_param->_size_general_register_logic);
68      ALLOC1_SIGNAL_IN ( in_RENAME_NUM_REG_RB_LOG    ,"num_reg_rb_log"    ,Tgeneral_address_t,_param->_size_general_register_logic);
69      ALLOC1_SIGNAL_IN ( in_RENAME_NUM_REG_RC_LOG    ,"num_reg_rc_log"    ,Tspecial_address_t,_param->_size_special_register_logic);
70      ALLOC1_SIGNAL_IN ( in_RENAME_NUM_REG_RD_LOG    ,"num_reg_rd_log"    ,Tgeneral_address_t,_param->_size_general_register_logic);
71      ALLOC1_SIGNAL_IN ( in_RENAME_NUM_REG_RE_LOG    ,"num_reg_re_log"    ,Tspecial_address_t,_param->_size_special_register_logic);
72      ALLOC1_SIGNAL_OUT(out_RENAME_NUM_REG_RA_PHY    ,"num_reg_ra_phy"    ,Tgeneral_address_t,_param->_size_general_register);
73      ALLOC1_SIGNAL_OUT(out_RENAME_NUM_REG_RB_PHY    ,"num_reg_rb_phy"    ,Tgeneral_address_t,_param->_size_general_register);
74      ALLOC1_SIGNAL_OUT(out_RENAME_NUM_REG_RC_PHY    ,"num_reg_rc_phy"    ,Tspecial_address_t,_param->_size_special_register);
75      ALLOC1_SIGNAL_OUT(out_RENAME_NUM_REG_RD_PHY_OLD,"num_reg_rd_phy_old",Tgeneral_address_t,_param->_size_general_register);
76      ALLOC1_SIGNAL_OUT(out_RENAME_NUM_REG_RE_PHY_OLD,"num_reg_re_phy_old",Tspecial_address_t,_param->_size_special_register);
77    }
78   
79    // ~~~~~[ Interface "insert" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
80    {
81      ALLOC1_INTERFACE("insert",IN,NORTH,"Input to rename destination logical register", _param->_nb_inst_insert);
82     
83      ALLOC1_VALACK_IN ( in_INSERT_VAL           ,VAL);
84      ALLOC1_VALACK_OUT(out_INSERT_ACK           ,ACK);
85//    ALLOC1_SIGNAL_IN ( in_INSERT_FRONT_END_ID  ,"front_end_id"  ,Tcontext_t        ,_param->_size_front_end_id);
86//    ALLOC1_SIGNAL_IN ( in_INSERT_CONTEXT_ID    ,"context_id"    ,Tcontext_t        ,_param->_size_context_id  );
87      ALLOC1_SIGNAL_IN ( in_INSERT_WRITE_RD      ,"write_rd"      ,Tcontrol_t        ,1);
88      ALLOC1_SIGNAL_IN ( in_INSERT_WRITE_RE      ,"write_re"      ,Tcontrol_t        ,1);
89      ALLOC1_SIGNAL_IN ( in_INSERT_NUM_REG_RD_LOG,"num_reg_rd_log",Tgeneral_address_t,_param->_size_general_register_logic);
90      ALLOC1_SIGNAL_IN ( in_INSERT_NUM_REG_RE_LOG,"num_reg_re_log",Tspecial_address_t,_param->_size_special_register_logic);
91      ALLOC1_SIGNAL_IN ( in_INSERT_NUM_REG_RD_PHY,"num_reg_rd_phy",Tgeneral_address_t,_param->_size_general_register);
92      ALLOC1_SIGNAL_IN ( in_INSERT_NUM_REG_RE_PHY,"num_reg_re_phy",Tspecial_address_t,_param->_size_special_register);
93    }
94   
95    // ~~~~~[ Interface "retire" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
96    {
97      ALLOC1_INTERFACE("retire",IN,NORTH,"Input to update on event", _param->_nb_inst_retire);
98
99      ALLOC1_VALACK_IN ( in_RETIRE_VAL               ,VAL);
100      ALLOC1_VALACK_OUT(out_RETIRE_ACK               ,ACK);
101      ALLOC1_SIGNAL_IN ( in_RETIRE_FRONT_END_ID      ,"front_end_id"      ,Tcontext_t        ,_param->_size_front_end_id);
102      ALLOC1_SIGNAL_IN ( in_RETIRE_CONTEXT_ID        ,"context_id"        ,Tcontext_t        ,_param->_size_context_id  );
103      ALLOC1_SIGNAL_IN ( in_RETIRE_WRITE_RD          ,"write_rd"          ,Tcontrol_t        ,1);
104      ALLOC1_SIGNAL_IN ( in_RETIRE_WRITE_RE          ,"write_re"          ,Tcontrol_t        ,1);
105      ALLOC1_SIGNAL_IN ( in_RETIRE_NUM_REG_RD_LOG    ,"num_reg_rd_log"    ,Tgeneral_address_t,_param->_size_general_register_logic);
106      ALLOC1_SIGNAL_IN ( in_RETIRE_NUM_REG_RE_LOG    ,"num_reg_re_log"    ,Tspecial_address_t,_param->_size_special_register_logic);
107      ALLOC1_SIGNAL_IN ( in_RETIRE_NUM_REG_RD_PHY_OLD,"num_reg_rd_phy_old",Tgeneral_address_t,_param->_size_general_register);
108      ALLOC1_SIGNAL_IN ( in_RETIRE_NUM_REG_RE_PHY_OLD,"num_reg_re_phy_old",Tspecial_address_t,_param->_size_special_register);
109      ALLOC1_SIGNAL_OUT(out_RETIRE_RESTORE_RD_PHY_OLD,"restore_rd_phy_old",Tcontrol_t        ,1);
110      ALLOC1_SIGNAL_OUT(out_RETIRE_RESTORE_RE_PHY_OLD,"restore_re_phy_old",Tcontrol_t        ,1);
111    }
112
113    // ~~~~~[ Interface : "retire_event" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
114    {
115      ALLOC2_INTERFACE("retire_event", IN,NORTH, _("Retire event"), _param->_nb_front_end, _param->_nb_context[it1]);
116
117      _ALLOC2_VALACK_IN ( in_RETIRE_EVENT_VAL        ,VAL,_param->_nb_front_end, _param->_nb_context[it1]);
118      _ALLOC2_VALACK_OUT(out_RETIRE_EVENT_ACK        ,ACK,_param->_nb_front_end, _param->_nb_context[it1]);
119      _ALLOC2_SIGNAL_IN ( in_RETIRE_EVENT_STATE      ,"state"             ,Tevent_state_t    ,_param->_size_event_state, _param->_nb_front_end, _param->_nb_context[it1]);
120    }
121
122    if (usage_is_set(_usage,USE_SYSTEMC))
123      {
124    ALLOC1(internal_RENAME_ACK       ,Tcontrol_t,_param->_nb_inst_insert);
125    ALLOC1(internal_INSERT_ACK       ,Tcontrol_t,_param->_nb_inst_insert);
126    ALLOC1(internal_RETIRE_ACK       ,Tcontrol_t,_param->_nb_inst_retire);
127    ALLOC2(internal_RETIRE_EVENT_ACK ,Tcontrol_t,_param->_nb_front_end,_param->_nb_context[it1]);
128
129    rat_gpr                       = new Tgeneral_address_t ** [_param->_nb_front_end];
130    rat_spr                       = new Tspecial_address_t ** [_param->_nb_front_end];
131    rat_gpr_update_table          = new bool               ** [_param->_nb_front_end];
132    rat_spr_update_table          = new bool               ** [_param->_nb_front_end];
133    internal_rat_gpr_update_table = new bool               ** [_param->_nb_front_end];
134    internal_rat_spr_update_table = new bool               ** [_param->_nb_front_end];
135
136    for (uint32_t i=0; i<_param->_nb_front_end; i++)
137      {
138        rat_gpr                       [i] = new Tgeneral_address_t * [_param->_nb_context[i]];
139        rat_spr                       [i] = new Tspecial_address_t * [_param->_nb_context[i]];
140        rat_gpr_update_table          [i] = new bool               * [_param->_nb_context[i]];
141        rat_spr_update_table          [i] = new bool               * [_param->_nb_context[i]];
142        internal_rat_gpr_update_table [i] = new bool               * [_param->_nb_context[i]];
143        internal_rat_spr_update_table [i] = new bool               * [_param->_nb_context[i]];
144
145        for (uint32_t j=0; j<_param->_nb_context[i]; j++)
146          {
147            rat_gpr                       [i][j] = new Tgeneral_address_t [_param->_nb_general_register_logic];
148            rat_spr                       [i][j] = new Tspecial_address_t [_param->_nb_special_register_logic];
149            rat_gpr_update_table          [i][j] = new bool               [_param->_nb_general_register_logic];
150            rat_spr_update_table          [i][j] = new bool               [_param->_nb_special_register_logic];
151            internal_rat_gpr_update_table [i][j] = new bool               [_param->_nb_general_register_logic];
152            internal_rat_spr_update_table [i][j] = new bool               [_param->_nb_special_register_logic];
153          }
154      }
155      }
156
157    // ~~~~~[ Component ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~   
158
159#ifdef POSITION
160    if (usage_is_set(_usage,USE_POSITION))
161      _component->generate_file();
162#endif
163
164    log_printf(FUNC,Register_Address_Translation_unit,FUNCTION,"End");
165  };
166
167}; // end namespace register_address_translation_unit
168}; // end namespace register_translation_unit
169}; // end namespace rename_unit
170}; // end namespace ooo_engine
171}; // end namespace multi_ooo_engine
172}; // end namespace core
173
174}; // end namespace behavioural
175}; // end namespace morpheo             
Note: See TracBrowser for help on using the repository browser.