[60] | 1 | #ifndef morpheo_behavioural_core_multi_execute_loop_execute_loop_register_unit_Register_unit_h |
---|
| 2 | #define morpheo_behavioural_core_multi_execute_loop_execute_loop_register_unit_Register_unit_h |
---|
| 3 | |
---|
| 4 | /* |
---|
| 5 | * $Id: Register_unit.h 82 2008-05-01 16:48:45Z rosiere $ |
---|
| 6 | * |
---|
[78] | 7 | * [ Description ] |
---|
[60] | 8 | * |
---|
| 9 | */ |
---|
| 10 | |
---|
| 11 | #ifdef SYSTEMC |
---|
| 12 | #include "systemc.h" |
---|
| 13 | #endif |
---|
| 14 | |
---|
| 15 | #include <iostream> |
---|
| 16 | #include "Common/include/ToString.h" |
---|
| 17 | #include "Common/include/Debug.h" |
---|
| 18 | #include "Behavioural/include/Types.h" |
---|
| 19 | |
---|
| 20 | // Internal Component |
---|
| 21 | #include "Behavioural/Generic/RegisterFile/include/RegisterFile.h" |
---|
| 22 | #include "Behavioural/Core/Multi_Execute_loop/Execute_loop/Register_unit/Register_unit_Glue/include/Register_unit_Glue.h" |
---|
| 23 | |
---|
| 24 | #include "Behavioural/Core/Multi_Execute_loop/Execute_loop/Register_unit/include/Parameters.h" |
---|
| 25 | #ifdef STATISTICS |
---|
[75] | 26 | #include "Behavioural/include/Stat.h" |
---|
[60] | 27 | #endif |
---|
| 28 | #include "Behavioural/include/Component.h" |
---|
| 29 | #ifdef VHDL |
---|
| 30 | #include "Behavioural/include/Vhdl.h" |
---|
| 31 | #endif |
---|
| 32 | #include "Behavioural/include/Usage.h" |
---|
| 33 | |
---|
| 34 | namespace morpheo { |
---|
| 35 | namespace behavioural { |
---|
| 36 | namespace core { |
---|
| 37 | namespace multi_execute_loop { |
---|
| 38 | namespace execute_loop { |
---|
| 39 | namespace register_unit { |
---|
| 40 | |
---|
| 41 | |
---|
| 42 | class Register_unit |
---|
| 43 | #if SYSTEMC |
---|
| 44 | : public sc_module |
---|
| 45 | #endif |
---|
| 46 | { |
---|
[78] | 47 | // -----[ fields ]---------------------------------------------------- |
---|
[60] | 48 | // Parameters |
---|
[75] | 49 | protected : const std::string _name; |
---|
[60] | 50 | protected : const Parameters * _param; |
---|
| 51 | private : const Tusage_t _usage; |
---|
| 52 | |
---|
| 53 | #ifdef STATISTICS |
---|
[75] | 54 | public : Stat * _stat; |
---|
[60] | 55 | #endif |
---|
| 56 | |
---|
| 57 | public : Component * _component; |
---|
| 58 | private : Interfaces * _interfaces; |
---|
| 59 | |
---|
| 60 | #ifdef SYSTEMC |
---|
[78] | 61 | // ~~~~~[ Interface ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
---|
[60] | 62 | // Interface |
---|
| 63 | public : SC_CLOCK * in_CLOCK ; |
---|
| 64 | public : SC_IN (Tcontrol_t) * in_NRESET ; |
---|
| 65 | |
---|
[78] | 66 | // ~~~~~[ Interface "gpr_read" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
---|
[60] | 67 | public : SC_IN (Tcontrol_t ) ** in_GPR_READ_VAL ; |
---|
| 68 | public : SC_OUT(Tcontrol_t ) ** out_GPR_READ_ACK ; |
---|
| 69 | public : SC_IN (Tcontext_t ) ** in_GPR_READ_OOO_ENGINE_ID ; |
---|
| 70 | public : SC_IN (Tgeneral_address_t) ** in_GPR_READ_NUM_REG ; |
---|
| 71 | public : SC_OUT(Tgeneral_data_t ) ** out_GPR_READ_DATA ; |
---|
| 72 | public : SC_OUT(Tcontrol_t ) ** out_GPR_READ_DATA_VAL ; |
---|
| 73 | |
---|
[78] | 74 | // ~~~~~[ Interface "gpr_write" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
---|
[60] | 75 | public : SC_IN (Tcontrol_t ) ** in_GPR_WRITE_VAL ; |
---|
| 76 | public : SC_OUT(Tcontrol_t ) ** out_GPR_WRITE_ACK ; |
---|
| 77 | public : SC_IN (Tcontext_t ) ** in_GPR_WRITE_OOO_ENGINE_ID ; |
---|
| 78 | public : SC_IN (Tgeneral_address_t) ** in_GPR_WRITE_NUM_REG ; |
---|
| 79 | public : SC_IN (Tgeneral_data_t ) ** in_GPR_WRITE_DATA ; |
---|
| 80 | |
---|
[78] | 81 | // ~~~~~[ Interface "spr_read" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
---|
[60] | 82 | public : SC_IN (Tcontrol_t ) ** in_SPR_READ_VAL ; |
---|
| 83 | public : SC_OUT(Tcontrol_t ) ** out_SPR_READ_ACK ; |
---|
| 84 | public : SC_IN (Tcontext_t ) ** in_SPR_READ_OOO_ENGINE_ID ; |
---|
| 85 | public : SC_IN (Tspecial_address_t) ** in_SPR_READ_NUM_REG ; |
---|
| 86 | public : SC_OUT(Tspecial_data_t ) ** out_SPR_READ_DATA ; |
---|
| 87 | public : SC_OUT(Tcontrol_t ) ** out_SPR_READ_DATA_VAL ; |
---|
| 88 | |
---|
[78] | 89 | // ~~~~~[ Interface "spr_write" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
---|
[60] | 90 | public : SC_IN (Tcontrol_t ) ** in_SPR_WRITE_VAL ; |
---|
| 91 | public : SC_OUT(Tcontrol_t ) ** out_SPR_WRITE_ACK ; |
---|
| 92 | public : SC_IN (Tcontext_t ) ** in_SPR_WRITE_OOO_ENGINE_ID ; |
---|
| 93 | public : SC_IN (Tspecial_address_t) ** in_SPR_WRITE_NUM_REG ; |
---|
| 94 | public : SC_IN (Tspecial_data_t ) ** in_SPR_WRITE_DATA ; |
---|
| 95 | |
---|
[78] | 96 | // ~~~~~[ Interface "insert_rob" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
---|
[60] | 97 | public : SC_IN (Tcontrol_t ) *** in_INSERT_ROB_VAL ; |
---|
| 98 | public : SC_OUT(Tcontrol_t ) *** out_INSERT_ROB_ACK ; |
---|
| 99 | public : SC_IN (Tcontrol_t ) *** in_INSERT_ROB_RD_USE ; |
---|
| 100 | public : SC_IN (Tgeneral_address_t) *** in_INSERT_ROB_RD_NUM_REG ; // use=1 : status[num_reg]<- 0 |
---|
| 101 | public : SC_IN (Tcontrol_t ) *** in_INSERT_ROB_RE_USE ; |
---|
| 102 | public : SC_IN (Tspecial_address_t) *** in_INSERT_ROB_RE_NUM_REG ; |
---|
| 103 | |
---|
[78] | 104 | // ~~~~~[ Interface "retire_rob" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
---|
[60] | 105 | public : SC_IN (Tcontrol_t ) *** in_RETIRE_ROB_VAL ; |
---|
| 106 | public : SC_OUT(Tcontrol_t ) *** out_RETIRE_ROB_ACK ; |
---|
| 107 | public : SC_IN (Tcontrol_t ) *** in_RETIRE_ROB_RD_OLD_USE ; |
---|
| 108 | public : SC_IN (Tgeneral_address_t) *** in_RETIRE_ROB_RD_OLD_NUM_REG ; // old_use=1 : status[old_num_reg]<- 0 |
---|
| 109 | public : SC_IN (Tcontrol_t ) *** in_RETIRE_ROB_RD_NEW_USE ; |
---|
| 110 | public : SC_IN (Tgeneral_address_t) *** in_RETIRE_ROB_RD_NEW_NUM_REG ; // new_use=1 : status[new_num_reg]<- 1 |
---|
| 111 | public : SC_IN (Tcontrol_t ) *** in_RETIRE_ROB_RE_OLD_USE ; |
---|
| 112 | public : SC_IN (Tspecial_address_t) *** in_RETIRE_ROB_RE_OLD_NUM_REG ; |
---|
| 113 | public : SC_IN (Tcontrol_t ) *** in_RETIRE_ROB_RE_NEW_USE ; |
---|
| 114 | public : SC_IN (Tspecial_address_t) *** in_RETIRE_ROB_RE_NEW_NUM_REG ; |
---|
| 115 | |
---|
[78] | 116 | // ~~~~~[ Component ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
---|
[60] | 117 | protected : morpheo::behavioural::generic::registerfile::RegisterFile::RegisterFile ** component_gpr ; |
---|
| 118 | protected : morpheo::behavioural::generic::registerfile::RegisterFile::RegisterFile ** component_gpr_status; |
---|
| 119 | protected : morpheo::behavioural::generic::registerfile::RegisterFile::RegisterFile ** component_spr ; |
---|
| 120 | protected : morpheo::behavioural::generic::registerfile::RegisterFile::RegisterFile ** component_spr_status; |
---|
| 121 | protected : morpheo::behavioural::core::multi_execute_loop::execute_loop::register_unit::register_unit_glue::Register_unit_Glue::Register_unit_Glue * component_glue ; |
---|
| 122 | |
---|
[78] | 123 | // ~~~~~[ Register ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
---|
[60] | 124 | |
---|
[78] | 125 | // ~~~~~[ Internal ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
---|
[60] | 126 | #endif |
---|
| 127 | |
---|
[78] | 128 | // -----[ methods ]--------------------------------------------------- |
---|
[60] | 129 | |
---|
| 130 | #ifdef SYSTEMC |
---|
| 131 | SC_HAS_PROCESS (Register_unit); |
---|
| 132 | #endif |
---|
| 133 | public : Register_unit |
---|
| 134 | ( |
---|
| 135 | #ifdef SYSTEMC |
---|
| 136 | sc_module_name name, |
---|
| 137 | #else |
---|
[75] | 138 | std::string name, |
---|
[60] | 139 | #endif |
---|
| 140 | #ifdef STATISTICS |
---|
| 141 | morpheo::behavioural::Parameters_Statistics * param_statistics, |
---|
| 142 | #endif |
---|
| 143 | Parameters * param, |
---|
[82] | 144 | morpheo::behavioural::Tusage_t usage |
---|
[60] | 145 | ); |
---|
| 146 | public : ~Register_unit (void); |
---|
| 147 | |
---|
[75] | 148 | private : void allocation ( |
---|
| 149 | #ifdef STATISTICS |
---|
| 150 | morpheo::behavioural::Parameters_Statistics * param_statistics |
---|
| 151 | #else |
---|
| 152 | void |
---|
| 153 | #endif |
---|
| 154 | ); |
---|
[60] | 155 | private : void deallocation (void); |
---|
| 156 | |
---|
| 157 | #ifdef SYSTEMC |
---|
| 158 | //#if defined(STATISTICS) or defined(VHDL_TESTBENCH) |
---|
| 159 | public : void transition (void); |
---|
| 160 | //#endif |
---|
| 161 | #endif |
---|
| 162 | |
---|
| 163 | #if VHDL |
---|
| 164 | public : void vhdl (void); |
---|
| 165 | private : void vhdl_declaration (Vhdl * & vhdl); |
---|
| 166 | private : void vhdl_body (Vhdl * & vhdl); |
---|
| 167 | #endif |
---|
| 168 | |
---|
[75] | 169 | #ifdef STATISTICS |
---|
| 170 | public : void statistics_declaration (morpheo::behavioural::Parameters_Statistics * param_statistics); |
---|
[60] | 171 | #endif |
---|
[75] | 172 | #if defined(STATISTICS) or defined(VHDL_TESTBENCH) |
---|
| 173 | private : void end_cycle (void); |
---|
| 174 | #endif |
---|
[60] | 175 | }; |
---|
| 176 | |
---|
[75] | 177 | |
---|
[60] | 178 | }; // end namespace register_unit |
---|
| 179 | }; // end namespace execute_loop |
---|
| 180 | }; // end namespace multi_execute_loop |
---|
| 181 | }; // end namespace core |
---|
| 182 | |
---|
| 183 | }; // end namespace behavioural |
---|
| 184 | }; // end namespace morpheo |
---|
| 185 | |
---|
| 186 | #endif |
---|