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