[88] | 1 | #ifndef morpheo_behavioural_core_multi_ooo_engine_ooo_engine_rename_unit_Rename_unit_h |
---|
| 2 | #define morpheo_behavioural_core_multi_ooo_engine_ooo_engine_rename_unit_Rename_unit_h |
---|
| 3 | |
---|
| 4 | /* |
---|
| 5 | * $Id: Rename_unit.h 123 2009-06-08 20:43:30Z rosiere $ |
---|
| 6 | * |
---|
| 7 | * [ Description ] |
---|
| 8 | * |
---|
| 9 | */ |
---|
| 10 | |
---|
| 11 | #ifdef SYSTEMC |
---|
| 12 | #include "systemc.h" |
---|
| 13 | #endif |
---|
| 14 | |
---|
| 15 | #include "Behavioural/Core/Multi_OOO_Engine/OOO_Engine/Rename_unit/include/Parameters.h" |
---|
| 16 | #include "Behavioural/include/Types.h" |
---|
| 17 | |
---|
| 18 | #ifdef STATISTICS |
---|
| 19 | #include "Behavioural/include/Stat.h" |
---|
| 20 | #endif |
---|
| 21 | #include "Behavioural/include/Component.h" |
---|
| 22 | #ifdef VHDL |
---|
| 23 | #include "Behavioural/include/Vhdl.h" |
---|
| 24 | #endif |
---|
| 25 | #include "Behavioural/include/Usage.h" |
---|
| 26 | |
---|
| 27 | #include "Common/include/ToString.h" |
---|
| 28 | #include "Common/include/Debug.h" |
---|
| 29 | |
---|
| 30 | #include <iostream> |
---|
| 31 | |
---|
| 32 | #include "Behavioural/Core/Multi_OOO_Engine/OOO_Engine/Rename_unit/Rename_select/include/Rename_select.h" |
---|
| 33 | #include "Behavioural/Core/Multi_OOO_Engine/OOO_Engine/Rename_unit/Register_translation_unit/include/Register_translation_unit.h" |
---|
| 34 | #include "Behavioural/Core/Multi_OOO_Engine/OOO_Engine/Rename_unit/Load_Store_pointer_unit/include/Load_Store_pointer_unit.h" |
---|
| 35 | #include "Behavioural/Core/Multi_OOO_Engine/OOO_Engine/Rename_unit/Rename_unit_Glue/include/Rename_unit_Glue.h" |
---|
| 36 | |
---|
| 37 | namespace morpheo { |
---|
| 38 | namespace behavioural { |
---|
| 39 | |
---|
| 40 | namespace core { |
---|
| 41 | namespace multi_ooo_engine { |
---|
| 42 | namespace ooo_engine { |
---|
| 43 | namespace rename_unit { |
---|
| 44 | |
---|
| 45 | |
---|
| 46 | class Rename_unit |
---|
| 47 | #if SYSTEMC |
---|
| 48 | : public sc_module |
---|
| 49 | #endif |
---|
| 50 | { |
---|
| 51 | // -----[ fields ]---------------------------------------------------- |
---|
| 52 | // Parameters |
---|
| 53 | protected : const std::string _name; |
---|
| 54 | protected : const Parameters * _param; |
---|
| 55 | private : const Tusage_t _usage; |
---|
| 56 | |
---|
| 57 | #ifdef STATISTICS |
---|
| 58 | public : Stat * _stat; |
---|
| 59 | #endif |
---|
| 60 | |
---|
| 61 | public : Component * _component; |
---|
| 62 | private : Interfaces * _interfaces; |
---|
| 63 | |
---|
| 64 | #ifdef SYSTEMC |
---|
| 65 | // ~~~~~[ Interface ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
---|
| 66 | // ~~~~~[ Interface : "" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
---|
| 67 | public : SC_CLOCK * in_CLOCK ; |
---|
| 68 | public : SC_IN (Tcontrol_t) * in_NRESET ; |
---|
| 69 | |
---|
| 70 | // ~~~~~[ Interface : "rename_in" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
---|
| 71 | public : SC_IN (Tcontrol_t ) *** in_RENAME_IN_VAL ;//[nb_front_end][nb_inst_decod] |
---|
| 72 | public : SC_OUT(Tcontrol_t ) *** out_RENAME_IN_ACK ;//[nb_front_end][nb_inst_decod] |
---|
| 73 | public : SC_IN (Tcontext_t ) *** in_RENAME_IN_FRONT_END_ID ;//[nb_front_end][nb_inst_decod] |
---|
| 74 | public : SC_IN (Tcontext_t ) *** in_RENAME_IN_CONTEXT_ID ;//[nb_front_end][nb_inst_decod] |
---|
| 75 | public : SC_IN (Tdepth_t ) *** in_RENAME_IN_DEPTH ;//[nb_front_end][nb_inst_decod] |
---|
| 76 | public : SC_IN (Ttype_t ) *** in_RENAME_IN_TYPE ;//[nb_front_end][nb_inst_decod] |
---|
| 77 | public : SC_IN (Toperation_t ) *** in_RENAME_IN_OPERATION ;//[nb_front_end][nb_inst_decod] |
---|
| 78 | public : SC_IN (Tcontrol_t ) *** in_RENAME_IN_NO_EXECUTE ;//[nb_front_end][nb_inst_decod] |
---|
[123] | 79 | //public : SC_IN (Tcontrol_t ) *** in_RENAME_IN_HAVE_EVENT ;//[nb_front_end][nb_inst_decod] |
---|
| 80 | public : SC_IN (Tcontrol_t ) *** in_RENAME_IN_LAST_EVENT ;//[nb_front_end][nb_inst_decod] |
---|
[88] | 81 | public : SC_IN (Tcontrol_t ) *** in_RENAME_IN_IS_DELAY_SLOT ;//[nb_front_end][nb_inst_decod] |
---|
[108] | 82 | #ifdef DEBUG |
---|
| 83 | public : SC_IN (Taddress_t ) *** in_RENAME_IN_ADDRESS ;//[nb_front_end][nb_inst_decod] |
---|
| 84 | #endif |
---|
[105] | 85 | public : SC_IN (Taddress_t ) *** in_RENAME_IN_ADDRESS_NEXT ;//[nb_front_end][nb_inst_decod] |
---|
[88] | 86 | public : SC_IN (Tcontrol_t ) *** in_RENAME_IN_HAS_IMMEDIAT ;//[nb_front_end][nb_inst_decod] |
---|
| 87 | public : SC_IN (Tgeneral_data_t ) *** in_RENAME_IN_IMMEDIAT ;//[nb_front_end][nb_inst_decod] |
---|
| 88 | public : SC_IN (Tcontrol_t ) *** in_RENAME_IN_READ_RA ;//[nb_front_end][nb_inst_decod] |
---|
| 89 | public : SC_IN (Tgeneral_address_t) *** in_RENAME_IN_NUM_REG_RA ;//[nb_front_end][nb_inst_decod] |
---|
| 90 | public : SC_IN (Tcontrol_t ) *** in_RENAME_IN_READ_RB ;//[nb_front_end][nb_inst_decod] |
---|
| 91 | public : SC_IN (Tgeneral_address_t) *** in_RENAME_IN_NUM_REG_RB ;//[nb_front_end][nb_inst_decod] |
---|
| 92 | public : SC_IN (Tcontrol_t ) *** in_RENAME_IN_READ_RC ;//[nb_front_end][nb_inst_decod] |
---|
| 93 | public : SC_IN (Tspecial_address_t) *** in_RENAME_IN_NUM_REG_RC ;//[nb_front_end][nb_inst_decod] |
---|
| 94 | public : SC_IN (Tcontrol_t ) *** in_RENAME_IN_WRITE_RD ;//[nb_front_end][nb_inst_decod] |
---|
| 95 | public : SC_IN (Tgeneral_address_t) *** in_RENAME_IN_NUM_REG_RD ;//[nb_front_end][nb_inst_decod] |
---|
| 96 | public : SC_IN (Tcontrol_t ) *** in_RENAME_IN_WRITE_RE ;//[nb_front_end][nb_inst_decod] |
---|
| 97 | public : SC_IN (Tspecial_address_t) *** in_RENAME_IN_NUM_REG_RE ;//[nb_front_end][nb_inst_decod] |
---|
| 98 | public : SC_IN (Texception_t ) *** in_RENAME_IN_EXCEPTION_USE ;//[nb_front_end][nb_inst_decod] |
---|
| 99 | public : SC_IN (Texception_t ) *** in_RENAME_IN_EXCEPTION ;//[nb_front_end][nb_inst_decod] |
---|
| 100 | |
---|
| 101 | // ~~~~~[ Interface "insert" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
---|
| 102 | public : SC_OUT(Tcontrol_t ) ** out_INSERT_VAL ;//[nb_inst_insert] |
---|
| 103 | public : SC_IN (Tcontrol_t ) ** in_INSERT_ACK ;//[nb_inst_insert] |
---|
| 104 | public : SC_OUT(Tcontext_t ) ** out_INSERT_FRONT_END_ID ;//[nb_inst_insert] |
---|
| 105 | public : SC_OUT(Tcontext_t ) ** out_INSERT_CONTEXT_ID ;//[nb_inst_insert] |
---|
| 106 | public : SC_OUT(Tdepth_t ) ** out_INSERT_DEPTH ;//[nb_inst_insert] |
---|
| 107 | public : SC_OUT(Ttype_t ) ** out_INSERT_TYPE ;//[nb_inst_insert] |
---|
| 108 | public : SC_OUT(Toperation_t ) ** out_INSERT_OPERATION ;//[nb_inst_insert] |
---|
| 109 | public : SC_OUT(Tcontrol_t ) ** out_INSERT_NO_EXECUTE ;//[nb_inst_insert] |
---|
[123] | 110 | public : SC_OUT(Tcontrol_t ) ** out_INSERT_LAST_EVENT ;//[nb_inst_insert] |
---|
[88] | 111 | public : SC_OUT(Tcontrol_t ) ** out_INSERT_IS_DELAY_SLOT ;//[nb_inst_insert] |
---|
[108] | 112 | #ifdef DEBUG |
---|
| 113 | public : SC_OUT(Taddress_t ) ** out_INSERT_ADDRESS ;//[nb_inst_insert] |
---|
| 114 | #endif |
---|
[105] | 115 | public : SC_OUT(Taddress_t ) ** out_INSERT_ADDRESS_NEXT ;//[nb_inst_insert] |
---|
[88] | 116 | public : SC_OUT(Tcontrol_t ) ** out_INSERT_HAS_IMMEDIAT ;//[nb_inst_insert] |
---|
| 117 | public : SC_OUT(Tgeneral_data_t ) ** out_INSERT_IMMEDIAT ;//[nb_inst_insert] |
---|
| 118 | public : SC_OUT(Tlsq_ptr_t ) ** out_INSERT_STORE_QUEUE_PTR_WRITE;//[nb_inst_insert] |
---|
[122] | 119 | public : SC_OUT(Tlsq_ptr_t ) ** out_INSERT_STORE_QUEUE_PTR_READ ;//[nb_inst_insert] |
---|
| 120 | public : SC_OUT(Tcontrol_t ) ** out_INSERT_STORE_QUEUE_EMPTY ;//[nb_inst_insert] |
---|
[88] | 121 | public : SC_OUT(Tlsq_ptr_t ) ** out_INSERT_LOAD_QUEUE_PTR_WRITE ;//[nb_inst_insert] |
---|
| 122 | public : SC_OUT(Tcontrol_t ) ** out_INSERT_READ_RA ;//[nb_inst_insert] |
---|
[121] | 123 | #ifdef DEBUG |
---|
[88] | 124 | public : SC_OUT(Tgeneral_address_t) ** out_INSERT_NUM_REG_RA_LOG ;//[nb_inst_insert] |
---|
[121] | 125 | #endif |
---|
[88] | 126 | public : SC_OUT(Tgeneral_address_t) ** out_INSERT_NUM_REG_RA_PHY ;//[nb_inst_insert] |
---|
| 127 | public : SC_OUT(Tcontrol_t ) ** out_INSERT_READ_RB ;//[nb_inst_insert] |
---|
[121] | 128 | #ifdef DEBUG |
---|
[88] | 129 | public : SC_OUT(Tgeneral_address_t) ** out_INSERT_NUM_REG_RB_LOG ;//[nb_inst_insert] |
---|
[121] | 130 | #endif |
---|
[88] | 131 | public : SC_OUT(Tgeneral_address_t) ** out_INSERT_NUM_REG_RB_PHY ;//[nb_inst_insert] |
---|
| 132 | public : SC_OUT(Tcontrol_t ) ** out_INSERT_READ_RC ;//[nb_inst_insert] |
---|
[121] | 133 | #ifdef DEBUG |
---|
[88] | 134 | public : SC_OUT(Tspecial_address_t) ** out_INSERT_NUM_REG_RC_LOG ;//[nb_inst_insert] |
---|
[121] | 135 | #endif |
---|
[88] | 136 | public : SC_OUT(Tspecial_address_t) ** out_INSERT_NUM_REG_RC_PHY ;//[nb_inst_insert] |
---|
| 137 | public : SC_OUT(Tcontrol_t ) ** out_INSERT_WRITE_RD ;//[nb_inst_insert] |
---|
| 138 | public : SC_OUT(Tgeneral_address_t) ** out_INSERT_NUM_REG_RD_LOG ;//[nb_inst_insert] |
---|
| 139 | public : SC_OUT(Tgeneral_address_t) ** out_INSERT_NUM_REG_RD_PHY_OLD ;//[nb_inst_insert] |
---|
| 140 | public : SC_OUT(Tgeneral_address_t) ** out_INSERT_NUM_REG_RD_PHY_NEW ;//[nb_inst_insert] |
---|
| 141 | public : SC_OUT(Tcontrol_t ) ** out_INSERT_WRITE_RE ;//[nb_inst_insert] |
---|
| 142 | public : SC_OUT(Tspecial_address_t) ** out_INSERT_NUM_REG_RE_LOG ;//[nb_inst_insert] |
---|
| 143 | public : SC_OUT(Tspecial_address_t) ** out_INSERT_NUM_REG_RE_PHY_OLD ;//[nb_inst_insert] |
---|
| 144 | public : SC_OUT(Tspecial_address_t) ** out_INSERT_NUM_REG_RE_PHY_NEW ;//[nb_inst_insert] |
---|
| 145 | public : SC_OUT(Texception_t ) ** out_INSERT_EXCEPTION_USE ;//[nb_inst_insert] |
---|
| 146 | public : SC_OUT(Texception_t ) ** out_INSERT_EXCEPTION ;//[nb_inst_insert] |
---|
| 147 | |
---|
| 148 | // ~~~~~[ Interface "retire" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
---|
| 149 | public : SC_IN (Tcontrol_t ) ** in_RETIRE_VAL ;//[nb_inst_retire] |
---|
| 150 | public : SC_OUT(Tcontrol_t ) ** out_RETIRE_ACK ;//[nb_inst_retire] |
---|
| 151 | public : SC_IN (Tcontext_t ) ** in_RETIRE_FRONT_END_ID ;//[nb_inst_retire] |
---|
| 152 | public : SC_IN (Tcontext_t ) ** in_RETIRE_CONTEXT_ID ;//[nb_inst_retire] |
---|
| 153 | //public : SC_IN (Ttype_t ) ** in_RETIRE_TYPE ;//[nb_inst_retire] |
---|
| 154 | //public : SC_IN (Toperation_t ) ** in_RETIRE_OPERATION ;//[nb_inst_retire] |
---|
| 155 | public : SC_IN (Tcontrol_t ) ** in_RETIRE_USE_STORE_QUEUE ;//[nb_inst_retire] |
---|
| 156 | public : SC_IN (Tcontrol_t ) ** in_RETIRE_USE_LOAD_QUEUE ;//[nb_inst_retire] |
---|
| 157 | public : SC_IN (Tlsq_ptr_t ) ** in_RETIRE_STORE_QUEUE_PTR_WRITE;//[nb_inst_retire] |
---|
| 158 | public : SC_IN (Tlsq_ptr_t ) ** in_RETIRE_LOAD_QUEUE_PTR_WRITE ;//[nb_inst_retire] |
---|
[121] | 159 | // public : SC_IN (Tcontrol_t ) ** in_RETIRE_READ_RA ;//[nb_inst_retire] |
---|
| 160 | // public : SC_IN (Tgeneral_address_t) ** in_RETIRE_NUM_REG_RA_PHY ;//[nb_inst_retire] |
---|
| 161 | // public : SC_IN (Tcontrol_t ) ** in_RETIRE_READ_RB ;//[nb_inst_retire] |
---|
| 162 | // public : SC_IN (Tgeneral_address_t) ** in_RETIRE_NUM_REG_RB_PHY ;//[nb_inst_retire] |
---|
| 163 | // public : SC_IN (Tcontrol_t ) ** in_RETIRE_READ_RC ;//[nb_inst_retire] |
---|
| 164 | // public : SC_IN (Tspecial_address_t) ** in_RETIRE_NUM_REG_RC_PHY ;//[nb_inst_retire] |
---|
[88] | 165 | public : SC_IN (Tcontrol_t ) ** in_RETIRE_WRITE_RD ;//[nb_inst_retire] |
---|
| 166 | public : SC_IN (Tgeneral_address_t) ** in_RETIRE_NUM_REG_RD_LOG ;//[nb_inst_retire] |
---|
| 167 | public : SC_IN (Tgeneral_address_t) ** in_RETIRE_NUM_REG_RD_PHY_OLD ;//[nb_inst_retire] |
---|
| 168 | public : SC_IN (Tgeneral_address_t) ** in_RETIRE_NUM_REG_RD_PHY_NEW ;//[nb_inst_retire] |
---|
| 169 | public : SC_IN (Tcontrol_t ) ** in_RETIRE_WRITE_RE ;//[nb_inst_retire] |
---|
| 170 | public : SC_IN (Tspecial_address_t) ** in_RETIRE_NUM_REG_RE_LOG ;//[nb_inst_retire] |
---|
| 171 | public : SC_IN (Tspecial_address_t) ** in_RETIRE_NUM_REG_RE_PHY_OLD ;//[nb_inst_retire] |
---|
| 172 | public : SC_IN (Tspecial_address_t) ** in_RETIRE_NUM_REG_RE_PHY_NEW ;//[nb_inst_retire] |
---|
| 173 | |
---|
[104] | 174 | // ~~~~~[ Interface "retire_event" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
---|
| 175 | public : SC_IN (Tcontrol_t ) *** in_RETIRE_EVENT_VAL ;//[nb_front_end][nb_context] |
---|
| 176 | public : SC_OUT(Tcontrol_t ) *** out_RETIRE_EVENT_ACK ;//[nb_front_end][nb_context] |
---|
| 177 | public : SC_IN (Tevent_state_t ) *** in_RETIRE_EVENT_STATE ;//[nb_front_end][nb_context] |
---|
[123] | 178 | //public : SC_IN (Tcontrol_t ) *** in_RETIRE_EVENT_FLUSH ;//[nb_front_end][nb_context] |
---|
[122] | 179 | public : SC_IN (Tcontrol_t ) *** in_RETIRE_EVENT_STOP ;//[nb_front_end][nb_context] |
---|
[104] | 180 | |
---|
[88] | 181 | // ~~~~~[ Interface : "spr_read" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
---|
| 182 | public : SC_IN (Tspr_t ) *** in_SPR_READ_SR ;//[nb_front_end][nb_context] |
---|
| 183 | |
---|
[123] | 184 | // ~~~~~[ interface : "info" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
---|
| 185 | #ifdef DEBUG_TEST |
---|
| 186 | public : SC_IN (bool ) * in_INFO_ROB_EMPTY ; |
---|
| 187 | #endif |
---|
| 188 | |
---|
[88] | 189 | // ~~~~~[ Component ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
---|
| 190 | private : morpheo::behavioural::core::multi_ooo_engine::ooo_engine::rename_unit::rename_select ::Rename_select * _component_rename_select ; |
---|
| 191 | private : morpheo::behavioural::core::multi_ooo_engine::ooo_engine::rename_unit::register_translation_unit::Register_translation_unit * _component_register_translation_unit; |
---|
| 192 | private : morpheo::behavioural::core::multi_ooo_engine::ooo_engine::rename_unit::load_store_pointer_unit ::Load_Store_pointer_unit * _component_load_store_pointer_unit ; |
---|
| 193 | private : morpheo::behavioural::core::multi_ooo_engine::ooo_engine::rename_unit::rename_unit_glue ::Rename_unit_Glue * _component_glue ; |
---|
| 194 | |
---|
| 195 | // ~~~~~[ Register ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
---|
| 196 | |
---|
| 197 | // ~~~~~[ Internal ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
---|
| 198 | #endif |
---|
| 199 | |
---|
| 200 | // -----[ Methods ]--------------------------------------------------- |
---|
| 201 | |
---|
| 202 | #ifdef SYSTEMC |
---|
| 203 | SC_HAS_PROCESS (Rename_unit); |
---|
| 204 | #endif |
---|
| 205 | public : Rename_unit |
---|
| 206 | ( |
---|
| 207 | #ifdef SYSTEMC |
---|
| 208 | sc_module_name name, |
---|
| 209 | #else |
---|
| 210 | std::string name, |
---|
| 211 | #endif |
---|
| 212 | #ifdef STATISTICS |
---|
| 213 | morpheo::behavioural::Parameters_Statistics * param_statistics, |
---|
| 214 | #endif |
---|
| 215 | Parameters * param, |
---|
| 216 | morpheo::behavioural::Tusage_t usage |
---|
| 217 | ); |
---|
| 218 | public : ~Rename_unit (void); |
---|
| 219 | |
---|
| 220 | private : void allocation ( |
---|
| 221 | #ifdef STATISTICS |
---|
| 222 | morpheo::behavioural::Parameters_Statistics * param_statistics |
---|
| 223 | #else |
---|
| 224 | void |
---|
| 225 | #endif |
---|
| 226 | ); |
---|
| 227 | private : void deallocation (void); |
---|
| 228 | |
---|
| 229 | #ifdef SYSTEMC |
---|
| 230 | # if defined(STATISTICS) or defined(VHDL_TESTBENCH) |
---|
| 231 | public : void transition (void); |
---|
| 232 | # endif |
---|
| 233 | #endif |
---|
| 234 | |
---|
| 235 | #if VHDL |
---|
| 236 | public : void vhdl (void); |
---|
| 237 | #endif |
---|
| 238 | |
---|
| 239 | #ifdef STATISTICS |
---|
| 240 | public : void statistics_allocation (morpheo::behavioural::Parameters_Statistics * param_statistics); |
---|
| 241 | public : void statistics_deallocation (void); |
---|
| 242 | #endif |
---|
| 243 | #if defined(STATISTICS) or defined(VHDL_TESTBENCH) |
---|
| 244 | private : void end_cycle (void); |
---|
| 245 | #endif |
---|
| 246 | }; |
---|
| 247 | |
---|
| 248 | }; // end namespace rename_unit |
---|
| 249 | }; // end namespace ooo_engine |
---|
| 250 | }; // end namespace multi_ooo_engine |
---|
| 251 | }; // end namespace core |
---|
| 252 | |
---|
| 253 | }; // end namespace behavioural |
---|
| 254 | }; // end namespace morpheo |
---|
| 255 | |
---|
| 256 | #endif |
---|