[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 136 2009-10-20 18:52:15Z 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 ; |
---|
[136] | 95 | |
---|
| 96 | // ~~~~~[ Interface "issue" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
---|
| 97 | public : SC_IN (Tcontrol_t ) ** in_ISSUE_VAL ; |
---|
| 98 | public : SC_OUT(Tcontrol_t ) ** out_ISSUE_ACK ; |
---|
| 99 | public : SC_IN (Tcontext_t ) ** in_ISSUE_OOO_ENGINE_ID ; |
---|
| 100 | public : SC_IN (Tcontrol_t ) ** in_ISSUE_RD_USE ; |
---|
| 101 | public : SC_IN (Tgeneral_address_t) ** in_ISSUE_RD_NUM_REG ; // use=1 : status[num_reg]<- 0 |
---|
| 102 | public : SC_IN (Tcontrol_t ) ** in_ISSUE_RE_USE ; |
---|
| 103 | public : SC_IN (Tspecial_address_t) ** in_ISSUE_RE_NUM_REG ; |
---|
[60] | 104 | |
---|
[136] | 105 | // // ~~~~~[ Interface "insert_rob" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
---|
| 106 | // public : SC_IN (Tcontrol_t ) *** in_INSERT_ROB_VAL ; |
---|
| 107 | // public : SC_OUT(Tcontrol_t ) *** out_INSERT_ROB_ACK ; |
---|
| 108 | // public : SC_IN (Tcontrol_t ) *** in_INSERT_ROB_RD_USE ; |
---|
| 109 | // public : SC_IN (Tgeneral_address_t) *** in_INSERT_ROB_RD_NUM_REG ; // use=1 : status[num_reg]<- 0 |
---|
| 110 | // public : SC_IN (Tcontrol_t ) *** in_INSERT_ROB_RE_USE ; |
---|
| 111 | // public : SC_IN (Tspecial_address_t) *** in_INSERT_ROB_RE_NUM_REG ; |
---|
[60] | 112 | |
---|
[88] | 113 | // // ~~~~~[ Interface "retire_rob" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
---|
| 114 | // public : SC_IN (Tcontrol_t ) *** in_RETIRE_ROB_VAL ; |
---|
| 115 | // public : SC_OUT(Tcontrol_t ) *** out_RETIRE_ROB_ACK ; |
---|
| 116 | // public : SC_IN (Tcontrol_t ) *** in_RETIRE_ROB_RD_OLD_USE ; |
---|
| 117 | // public : SC_IN (Tgeneral_address_t) *** in_RETIRE_ROB_RD_OLD_NUM_REG ; // old_use=1 : status[old_num_reg]<- 0 |
---|
| 118 | // public : SC_IN (Tcontrol_t ) *** in_RETIRE_ROB_RD_NEW_USE ; |
---|
| 119 | // public : SC_IN (Tgeneral_address_t) *** in_RETIRE_ROB_RD_NEW_NUM_REG ; // new_use=1 : status[new_num_reg]<- 1 |
---|
| 120 | // public : SC_IN (Tcontrol_t ) *** in_RETIRE_ROB_RE_OLD_USE ; |
---|
| 121 | // public : SC_IN (Tspecial_address_t) *** in_RETIRE_ROB_RE_OLD_NUM_REG ; |
---|
| 122 | // public : SC_IN (Tcontrol_t ) *** in_RETIRE_ROB_RE_NEW_USE ; |
---|
| 123 | // public : SC_IN (Tspecial_address_t) *** in_RETIRE_ROB_RE_NEW_NUM_REG ; |
---|
[60] | 124 | |
---|
[78] | 125 | // ~~~~~[ Component ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
---|
[60] | 126 | protected : morpheo::behavioural::generic::registerfile::RegisterFile::RegisterFile ** component_gpr ; |
---|
| 127 | protected : morpheo::behavioural::generic::registerfile::RegisterFile::RegisterFile ** component_gpr_status; |
---|
| 128 | protected : morpheo::behavioural::generic::registerfile::RegisterFile::RegisterFile ** component_spr ; |
---|
| 129 | protected : morpheo::behavioural::generic::registerfile::RegisterFile::RegisterFile ** component_spr_status; |
---|
[131] | 130 | |
---|
| 131 | // protected : morpheo::behavioural::generic::registerfile::registerfile_multi_banked::RegisterFile_Multi_Banked::RegisterFile_Multi_Banked ** component_gpr ; |
---|
| 132 | // protected : morpheo::behavioural::generic::registerfile::registerfile_monolithic ::RegisterFile_Monolithic ::RegisterFile_Monolithic ** component_gpr_status; |
---|
| 133 | // protected : morpheo::behavioural::generic::registerfile::registerfile_multi_banked::RegisterFile_Multi_Banked::RegisterFile_Multi_Banked ** component_spr ; |
---|
| 134 | // protected : morpheo::behavioural::generic::registerfile::registerfile_monolithic ::RegisterFile_Monolithic ::RegisterFile_Monolithic ** component_spr_status; |
---|
| 135 | |
---|
[60] | 136 | protected : morpheo::behavioural::core::multi_execute_loop::execute_loop::register_unit::register_unit_glue::Register_unit_Glue::Register_unit_Glue * component_glue ; |
---|
| 137 | |
---|
[78] | 138 | // ~~~~~[ Register ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
---|
[60] | 139 | |
---|
[78] | 140 | // ~~~~~[ Internal ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
---|
[60] | 141 | #endif |
---|
| 142 | |
---|
[78] | 143 | // -----[ methods ]--------------------------------------------------- |
---|
[60] | 144 | |
---|
| 145 | #ifdef SYSTEMC |
---|
| 146 | SC_HAS_PROCESS (Register_unit); |
---|
| 147 | #endif |
---|
| 148 | public : Register_unit |
---|
| 149 | ( |
---|
| 150 | #ifdef SYSTEMC |
---|
| 151 | sc_module_name name, |
---|
| 152 | #else |
---|
[75] | 153 | std::string name, |
---|
[60] | 154 | #endif |
---|
| 155 | #ifdef STATISTICS |
---|
| 156 | morpheo::behavioural::Parameters_Statistics * param_statistics, |
---|
| 157 | #endif |
---|
| 158 | Parameters * param, |
---|
[82] | 159 | morpheo::behavioural::Tusage_t usage |
---|
[60] | 160 | ); |
---|
| 161 | public : ~Register_unit (void); |
---|
| 162 | |
---|
[75] | 163 | private : void allocation ( |
---|
| 164 | #ifdef STATISTICS |
---|
| 165 | morpheo::behavioural::Parameters_Statistics * param_statistics |
---|
| 166 | #else |
---|
| 167 | void |
---|
| 168 | #endif |
---|
| 169 | ); |
---|
[60] | 170 | private : void deallocation (void); |
---|
| 171 | |
---|
| 172 | #ifdef SYSTEMC |
---|
| 173 | //#if defined(STATISTICS) or defined(VHDL_TESTBENCH) |
---|
| 174 | public : void transition (void); |
---|
| 175 | //#endif |
---|
| 176 | #endif |
---|
| 177 | |
---|
| 178 | #if VHDL |
---|
| 179 | public : void vhdl (void); |
---|
| 180 | private : void vhdl_declaration (Vhdl * & vhdl); |
---|
| 181 | private : void vhdl_body (Vhdl * & vhdl); |
---|
| 182 | #endif |
---|
| 183 | |
---|
[75] | 184 | #ifdef STATISTICS |
---|
| 185 | public : void statistics_declaration (morpheo::behavioural::Parameters_Statistics * param_statistics); |
---|
[60] | 186 | #endif |
---|
[75] | 187 | #if defined(STATISTICS) or defined(VHDL_TESTBENCH) |
---|
| 188 | private : void end_cycle (void); |
---|
| 189 | #endif |
---|
[60] | 190 | }; |
---|
| 191 | |
---|
[75] | 192 | |
---|
[60] | 193 | }; // end namespace register_unit |
---|
| 194 | }; // end namespace execute_loop |
---|
| 195 | }; // end namespace multi_execute_loop |
---|
| 196 | }; // end namespace core |
---|
| 197 | |
---|
| 198 | }; // end namespace behavioural |
---|
| 199 | }; // end namespace morpheo |
---|
| 200 | |
---|
| 201 | #endif |
---|