[60] | 1 | /* |
---|
| 2 | * $Id$ |
---|
| 3 | * |
---|
| 4 | * [ Description ] |
---|
| 5 | * |
---|
| 6 | * Test |
---|
| 7 | */ |
---|
| 8 | |
---|
| 9 | #include "Behavioural/Core/Multi_Execute_loop/Execute_loop/Register_unit/SelfTest/include/test.h" |
---|
| 10 | #include "Common/include/Test.h" |
---|
| 11 | |
---|
| 12 | #define NB_ITERATION 1 |
---|
| 13 | #define CYCLE_MAX (128*NB_ITERATION) |
---|
| 14 | |
---|
| 15 | #define LABEL(str) \ |
---|
| 16 | { \ |
---|
| 17 | cout << "{"+toString(static_cast<uint32_t>(sc_simulation_time()))+"} " << str << endl; \ |
---|
| 18 | } while(0) |
---|
| 19 | |
---|
| 20 | static uint32_t cycle = 0; |
---|
| 21 | |
---|
| 22 | #define SC_START(cycle_offset) \ |
---|
| 23 | do \ |
---|
| 24 | { \ |
---|
| 25 | /*cout << "SC_START (begin)" << endl;*/ \ |
---|
| 26 | \ |
---|
| 27 | uint32_t cycle_current = static_cast<uint32_t>(sc_simulation_time()); \ |
---|
| 28 | if (cycle_current != cycle) \ |
---|
| 29 | { \ |
---|
| 30 | cycle = cycle_current; \ |
---|
| 31 | cout << "##########[ cycle "<< cycle << " ]" << endl; \ |
---|
| 32 | } \ |
---|
| 33 | \ |
---|
| 34 | if (cycle_current > CYCLE_MAX) \ |
---|
| 35 | { \ |
---|
| 36 | TEST_KO("Maximal cycles Reached"); \ |
---|
| 37 | } \ |
---|
| 38 | sc_start(cycle_offset); \ |
---|
| 39 | /*cout << "SC_START (end )" << endl;*/ \ |
---|
| 40 | } while(0) |
---|
| 41 | |
---|
| 42 | void test (string name, |
---|
| 43 | morpheo::behavioural::core::multi_execute_loop::execute_loop::register_unit::Parameters * _param) |
---|
| 44 | { |
---|
| 45 | cout << "<" << name << "> : Simulation SystemC" << endl; |
---|
| 46 | |
---|
| 47 | #ifdef STATISTICS |
---|
| 48 | morpheo::behavioural::Parameters_Statistics * _parameters_statistics = new morpheo::behavioural::Parameters_Statistics (5,50); |
---|
| 49 | #endif |
---|
| 50 | |
---|
| 51 | Register_unit * _Register_unit = new Register_unit (name.c_str(), |
---|
| 52 | #ifdef STATISTICS |
---|
| 53 | _parameters_statistics, |
---|
| 54 | #endif |
---|
| 55 | _param); |
---|
| 56 | |
---|
| 57 | #ifdef SYSTEMC |
---|
| 58 | /********************************************************************* |
---|
| 59 | * Déclarations des signaux |
---|
| 60 | *********************************************************************/ |
---|
| 61 | sc_clock * in_CLOCK; |
---|
| 62 | sc_signal<Tcontrol_t> * in_NRESET; |
---|
| 63 | |
---|
| 64 | // ~~~~~[ Interface "gpr_read" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
---|
| 65 | sc_signal<Tcontrol_t > ** in_GPR_READ_VAL ; |
---|
| 66 | sc_signal<Tcontrol_t > ** out_GPR_READ_ACK ; |
---|
| 67 | sc_signal<Tcontext_t > ** in_GPR_READ_OOO_ENGINE_ID ; |
---|
| 68 | sc_signal<Tgeneral_address_t> ** in_GPR_READ_NUM_REG ; |
---|
| 69 | sc_signal<Tgeneral_data_t > ** out_GPR_READ_DATA ; |
---|
| 70 | sc_signal<Tcontrol_t > ** out_GPR_READ_DATA_VAL ; |
---|
| 71 | |
---|
| 72 | // ~~~~~[ Interface "gpr_write" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
---|
| 73 | sc_signal<Tcontrol_t > ** in_GPR_WRITE_VAL ; |
---|
| 74 | sc_signal<Tcontrol_t > ** out_GPR_WRITE_ACK ; |
---|
| 75 | sc_signal<Tcontext_t > ** in_GPR_WRITE_OOO_ENGINE_ID ; |
---|
| 76 | sc_signal<Tgeneral_address_t> ** in_GPR_WRITE_NUM_REG ; |
---|
| 77 | sc_signal<Tgeneral_data_t > ** in_GPR_WRITE_DATA ; |
---|
| 78 | |
---|
| 79 | // ~~~~~[ Interface "spr_read" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
---|
| 80 | sc_signal<Tcontrol_t > ** in_SPR_READ_VAL ; |
---|
| 81 | sc_signal<Tcontrol_t > ** out_SPR_READ_ACK ; |
---|
| 82 | sc_signal<Tcontext_t > ** in_SPR_READ_OOO_ENGINE_ID ; |
---|
| 83 | sc_signal<Tspecial_address_t> ** in_SPR_READ_NUM_REG ; |
---|
| 84 | sc_signal<Tspecial_data_t > ** out_SPR_READ_DATA ; |
---|
| 85 | sc_signal<Tcontrol_t > ** out_SPR_READ_DATA_VAL ; |
---|
| 86 | |
---|
| 87 | // ~~~~~[ Interface "spr_write" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
---|
| 88 | sc_signal<Tcontrol_t > ** in_SPR_WRITE_VAL ; |
---|
| 89 | sc_signal<Tcontrol_t > ** out_SPR_WRITE_ACK ; |
---|
| 90 | sc_signal<Tcontext_t > ** in_SPR_WRITE_OOO_ENGINE_ID ; |
---|
| 91 | sc_signal<Tspecial_address_t> ** in_SPR_WRITE_NUM_REG ; |
---|
| 92 | sc_signal<Tspecial_data_t > ** in_SPR_WRITE_DATA ; |
---|
| 93 | |
---|
| 94 | // ~~~~~[ Interface "insert_rob" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
---|
| 95 | sc_signal<Tcontrol_t > *** in_INSERT_ROB_VAL ; |
---|
| 96 | sc_signal<Tcontrol_t > *** out_INSERT_ROB_ACK ; |
---|
| 97 | sc_signal<Tcontrol_t > *** in_INSERT_ROB_RD_USE ; |
---|
| 98 | sc_signal<Tgeneral_address_t> *** in_INSERT_ROB_RD_NUM_REG ; // use=1 : status[num_reg]<- 0 |
---|
| 99 | sc_signal<Tcontrol_t > *** in_INSERT_ROB_RE_USE ; |
---|
| 100 | sc_signal<Tspecial_address_t> *** in_INSERT_ROB_RE_NUM_REG ; |
---|
| 101 | |
---|
| 102 | // ~~~~~[ Interface "retire_rob" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
---|
| 103 | sc_signal<Tcontrol_t > *** in_RETIRE_ROB_VAL ; |
---|
| 104 | sc_signal<Tcontrol_t > *** out_RETIRE_ROB_ACK ; |
---|
| 105 | sc_signal<Tcontrol_t > *** in_RETIRE_ROB_RD_OLD_USE ; |
---|
| 106 | sc_signal<Tgeneral_address_t> *** in_RETIRE_ROB_RD_OLD_NUM_REG ; // old_use=1 : status[old_num_reg]<- 0 |
---|
| 107 | sc_signal<Tcontrol_t > *** in_RETIRE_ROB_RD_NEW_USE ; |
---|
| 108 | sc_signal<Tgeneral_address_t> *** in_RETIRE_ROB_RD_NEW_NUM_REG ; // new_use=1 : status[new_num_reg]<- 1 |
---|
| 109 | sc_signal<Tcontrol_t > *** in_RETIRE_ROB_RE_OLD_USE ; |
---|
| 110 | sc_signal<Tspecial_address_t> *** in_RETIRE_ROB_RE_OLD_NUM_REG ; |
---|
| 111 | sc_signal<Tcontrol_t > *** in_RETIRE_ROB_RE_NEW_USE ; |
---|
| 112 | sc_signal<Tspecial_address_t> *** in_RETIRE_ROB_RE_NEW_NUM_REG ; |
---|
| 113 | |
---|
[62] | 114 | string rename = "signal"; |
---|
[60] | 115 | |
---|
| 116 | in_CLOCK = new sc_clock ("clock", 1.0, 0.5); |
---|
| 117 | in_NRESET = new sc_signal<Tcontrol_t> ("NRESET"); |
---|
| 118 | |
---|
| 119 | |
---|
| 120 | // ~~~~~[ Interface "gpr_read" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
---|
| 121 | in_GPR_READ_VAL = new sc_signal<Tcontrol_t > * [_param->_nb_gpr_read]; |
---|
| 122 | out_GPR_READ_ACK = new sc_signal<Tcontrol_t > * [_param->_nb_gpr_read]; |
---|
| 123 | in_GPR_READ_OOO_ENGINE_ID = new sc_signal<Tcontext_t > * [_param->_nb_gpr_read]; |
---|
| 124 | in_GPR_READ_NUM_REG = new sc_signal<Tgeneral_address_t> * [_param->_nb_gpr_read]; |
---|
| 125 | out_GPR_READ_DATA = new sc_signal<Tgeneral_data_t > * [_param->_nb_gpr_read]; |
---|
| 126 | out_GPR_READ_DATA_VAL = new sc_signal<Tcontrol_t > * [_param->_nb_gpr_read]; |
---|
| 127 | |
---|
| 128 | for (uint32_t i=0; i<_param->_nb_gpr_read; i++) |
---|
| 129 | { |
---|
| 130 | in_GPR_READ_VAL [i]= new sc_signal<Tcontrol_t > (rename.c_str()); |
---|
| 131 | out_GPR_READ_ACK [i]= new sc_signal<Tcontrol_t > (rename.c_str()); |
---|
| 132 | in_GPR_READ_OOO_ENGINE_ID [i]= new sc_signal<Tcontext_t > (rename.c_str()); |
---|
| 133 | in_GPR_READ_NUM_REG [i]= new sc_signal<Tgeneral_address_t> (rename.c_str()); |
---|
| 134 | out_GPR_READ_DATA [i]= new sc_signal<Tgeneral_data_t > (rename.c_str()); |
---|
| 135 | out_GPR_READ_DATA_VAL [i]= new sc_signal<Tcontrol_t > (rename.c_str()); |
---|
| 136 | } |
---|
| 137 | |
---|
| 138 | // ~~~~~[ Interface "gpr_write" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
---|
| 139 | in_GPR_WRITE_VAL = new sc_signal<Tcontrol_t > * [_param->_nb_gpr_write]; |
---|
| 140 | out_GPR_WRITE_ACK = new sc_signal<Tcontrol_t > * [_param->_nb_gpr_write]; |
---|
| 141 | in_GPR_WRITE_OOO_ENGINE_ID = new sc_signal<Tcontext_t > * [_param->_nb_gpr_write]; |
---|
| 142 | in_GPR_WRITE_NUM_REG = new sc_signal<Tgeneral_address_t> * [_param->_nb_gpr_write]; |
---|
| 143 | in_GPR_WRITE_DATA = new sc_signal<Tgeneral_data_t > * [_param->_nb_gpr_write]; |
---|
| 144 | |
---|
| 145 | for (uint32_t i=0; i<_param->_nb_gpr_write; i++) |
---|
| 146 | { |
---|
| 147 | in_GPR_WRITE_VAL [i]= new sc_signal<Tcontrol_t > (rename.c_str()); |
---|
| 148 | out_GPR_WRITE_ACK [i]= new sc_signal<Tcontrol_t > (rename.c_str()); |
---|
| 149 | in_GPR_WRITE_OOO_ENGINE_ID [i]= new sc_signal<Tcontext_t > (rename.c_str()); |
---|
| 150 | in_GPR_WRITE_NUM_REG [i]= new sc_signal<Tgeneral_address_t> (rename.c_str()); |
---|
| 151 | in_GPR_WRITE_DATA [i]= new sc_signal<Tgeneral_data_t > (rename.c_str()); |
---|
| 152 | } |
---|
| 153 | |
---|
| 154 | // ~~~~~[ Interface "spr_read" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
---|
| 155 | in_SPR_READ_VAL = new sc_signal<Tcontrol_t > * [_param->_nb_spr_read]; |
---|
| 156 | out_SPR_READ_ACK = new sc_signal<Tcontrol_t > * [_param->_nb_spr_read]; |
---|
| 157 | in_SPR_READ_OOO_ENGINE_ID = new sc_signal<Tcontext_t > * [_param->_nb_spr_read]; |
---|
| 158 | in_SPR_READ_NUM_REG = new sc_signal<Tspecial_address_t> * [_param->_nb_spr_read]; |
---|
| 159 | out_SPR_READ_DATA = new sc_signal<Tspecial_data_t > * [_param->_nb_spr_read]; |
---|
| 160 | out_SPR_READ_DATA_VAL = new sc_signal<Tcontrol_t > * [_param->_nb_spr_read]; |
---|
| 161 | |
---|
| 162 | for (uint32_t i=0; i<_param->_nb_spr_read; i++) |
---|
| 163 | { |
---|
| 164 | in_SPR_READ_VAL [i]= new sc_signal<Tcontrol_t > (rename.c_str()); |
---|
| 165 | out_SPR_READ_ACK [i]= new sc_signal<Tcontrol_t > (rename.c_str()); |
---|
| 166 | in_SPR_READ_OOO_ENGINE_ID [i]= new sc_signal<Tcontext_t > (rename.c_str()); |
---|
| 167 | in_SPR_READ_NUM_REG [i]= new sc_signal<Tspecial_address_t> (rename.c_str()); |
---|
| 168 | out_SPR_READ_DATA [i]= new sc_signal<Tspecial_data_t > (rename.c_str()); |
---|
| 169 | out_SPR_READ_DATA_VAL [i]= new sc_signal<Tcontrol_t > (rename.c_str()); |
---|
| 170 | } |
---|
| 171 | |
---|
| 172 | // ~~~~~[ Interface "spr_write" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
---|
| 173 | in_SPR_WRITE_VAL = new sc_signal<Tcontrol_t > * [_param->_nb_spr_write]; |
---|
| 174 | out_SPR_WRITE_ACK = new sc_signal<Tcontrol_t > * [_param->_nb_spr_write]; |
---|
| 175 | in_SPR_WRITE_OOO_ENGINE_ID = new sc_signal<Tcontext_t > * [_param->_nb_spr_write]; |
---|
| 176 | in_SPR_WRITE_NUM_REG = new sc_signal<Tspecial_address_t> * [_param->_nb_spr_write]; |
---|
| 177 | in_SPR_WRITE_DATA = new sc_signal<Tspecial_data_t > * [_param->_nb_spr_write]; |
---|
| 178 | |
---|
| 179 | for (uint32_t i=0; i<_param->_nb_spr_write; i++) |
---|
| 180 | { |
---|
| 181 | in_SPR_WRITE_VAL [i]= new sc_signal<Tcontrol_t > (rename.c_str()); |
---|
| 182 | out_SPR_WRITE_ACK [i]= new sc_signal<Tcontrol_t > (rename.c_str()); |
---|
| 183 | in_SPR_WRITE_OOO_ENGINE_ID [i]= new sc_signal<Tcontext_t > (rename.c_str()); |
---|
| 184 | in_SPR_WRITE_NUM_REG [i]= new sc_signal<Tspecial_address_t> (rename.c_str()); |
---|
| 185 | in_SPR_WRITE_DATA [i]= new sc_signal<Tspecial_data_t > (rename.c_str()); |
---|
| 186 | } |
---|
| 187 | |
---|
| 188 | // ~~~~~[ Interface "insert_rob" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
---|
| 189 | in_INSERT_ROB_VAL = new sc_signal<Tcontrol_t > ** [_param->_nb_ooo_engine]; |
---|
| 190 | out_INSERT_ROB_ACK = new sc_signal<Tcontrol_t > ** [_param->_nb_ooo_engine]; |
---|
| 191 | in_INSERT_ROB_RD_USE = new sc_signal<Tcontrol_t > ** [_param->_nb_ooo_engine]; |
---|
| 192 | in_INSERT_ROB_RD_NUM_REG = new sc_signal<Tgeneral_address_t> ** [_param->_nb_ooo_engine]; |
---|
| 193 | in_INSERT_ROB_RE_USE = new sc_signal<Tcontrol_t > ** [_param->_nb_ooo_engine]; |
---|
| 194 | in_INSERT_ROB_RE_NUM_REG = new sc_signal<Tspecial_address_t> ** [_param->_nb_ooo_engine]; |
---|
| 195 | |
---|
| 196 | for (uint32_t i=0; i<_param->_nb_ooo_engine; i++) |
---|
| 197 | { |
---|
| 198 | uint32_t x=_param->_nb_inst_insert_rob [i]; |
---|
| 199 | |
---|
| 200 | in_INSERT_ROB_VAL [i] = new sc_signal<Tcontrol_t > * [x]; |
---|
| 201 | out_INSERT_ROB_ACK [i] = new sc_signal<Tcontrol_t > * [x]; |
---|
| 202 | in_INSERT_ROB_RD_USE [i] = new sc_signal<Tcontrol_t > * [x]; |
---|
| 203 | in_INSERT_ROB_RD_NUM_REG [i] = new sc_signal<Tgeneral_address_t> * [x]; |
---|
| 204 | in_INSERT_ROB_RE_USE [i] = new sc_signal<Tcontrol_t > * [x]; |
---|
| 205 | in_INSERT_ROB_RE_NUM_REG [i] = new sc_signal<Tspecial_address_t> * [x]; |
---|
| 206 | |
---|
| 207 | for (uint32_t j=0; j<x; j++) |
---|
| 208 | { |
---|
| 209 | in_INSERT_ROB_VAL [i][j] = new sc_signal<Tcontrol_t > (rename.c_str()); |
---|
| 210 | out_INSERT_ROB_ACK [i][j] = new sc_signal<Tcontrol_t > (rename.c_str()); |
---|
| 211 | in_INSERT_ROB_RD_USE [i][j] = new sc_signal<Tcontrol_t > (rename.c_str()); |
---|
| 212 | in_INSERT_ROB_RD_NUM_REG [i][j] = new sc_signal<Tgeneral_address_t> (rename.c_str()); |
---|
| 213 | in_INSERT_ROB_RE_USE [i][j] = new sc_signal<Tcontrol_t > (rename.c_str()); |
---|
| 214 | in_INSERT_ROB_RE_NUM_REG [i][j] = new sc_signal<Tspecial_address_t> (rename.c_str()); |
---|
| 215 | |
---|
| 216 | } |
---|
| 217 | } |
---|
| 218 | |
---|
| 219 | // ~~~~~[ Interface "retire_rob" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
---|
| 220 | in_RETIRE_ROB_VAL = new sc_signal<Tcontrol_t > ** [_param->_nb_ooo_engine]; |
---|
| 221 | out_RETIRE_ROB_ACK = new sc_signal<Tcontrol_t > ** [_param->_nb_ooo_engine]; |
---|
| 222 | in_RETIRE_ROB_RD_OLD_USE = new sc_signal<Tcontrol_t > ** [_param->_nb_ooo_engine]; |
---|
| 223 | in_RETIRE_ROB_RD_OLD_NUM_REG = new sc_signal<Tgeneral_address_t> ** [_param->_nb_ooo_engine]; |
---|
| 224 | in_RETIRE_ROB_RE_OLD_USE = new sc_signal<Tcontrol_t > ** [_param->_nb_ooo_engine]; |
---|
| 225 | in_RETIRE_ROB_RE_OLD_NUM_REG = new sc_signal<Tspecial_address_t> ** [_param->_nb_ooo_engine]; |
---|
| 226 | in_RETIRE_ROB_RD_NEW_USE = new sc_signal<Tcontrol_t > ** [_param->_nb_ooo_engine]; |
---|
| 227 | in_RETIRE_ROB_RD_NEW_NUM_REG = new sc_signal<Tgeneral_address_t> ** [_param->_nb_ooo_engine]; |
---|
| 228 | in_RETIRE_ROB_RE_NEW_USE = new sc_signal<Tcontrol_t > ** [_param->_nb_ooo_engine]; |
---|
| 229 | in_RETIRE_ROB_RE_NEW_NUM_REG = new sc_signal<Tspecial_address_t> ** [_param->_nb_ooo_engine]; |
---|
| 230 | |
---|
| 231 | for (uint32_t i=0; i<_param->_nb_ooo_engine; i++) |
---|
| 232 | { |
---|
| 233 | uint32_t x=_param->_nb_inst_retire_rob [i]; |
---|
| 234 | |
---|
| 235 | in_RETIRE_ROB_VAL [i] = new sc_signal<Tcontrol_t > * [x]; |
---|
| 236 | out_RETIRE_ROB_ACK [i] = new sc_signal<Tcontrol_t > * [x]; |
---|
| 237 | in_RETIRE_ROB_RD_OLD_USE [i] = new sc_signal<Tcontrol_t > * [x]; |
---|
| 238 | in_RETIRE_ROB_RD_OLD_NUM_REG [i] = new sc_signal<Tgeneral_address_t> * [x]; |
---|
| 239 | in_RETIRE_ROB_RE_OLD_USE [i] = new sc_signal<Tcontrol_t > * [x]; |
---|
| 240 | in_RETIRE_ROB_RE_OLD_NUM_REG [i] = new sc_signal<Tspecial_address_t> * [x]; |
---|
| 241 | in_RETIRE_ROB_RD_NEW_USE [i] = new sc_signal<Tcontrol_t > * [x]; |
---|
| 242 | in_RETIRE_ROB_RD_NEW_NUM_REG [i] = new sc_signal<Tgeneral_address_t> * [x]; |
---|
| 243 | in_RETIRE_ROB_RE_NEW_USE [i] = new sc_signal<Tcontrol_t > * [x]; |
---|
| 244 | in_RETIRE_ROB_RE_NEW_NUM_REG [i] = new sc_signal<Tspecial_address_t> * [x]; |
---|
| 245 | |
---|
| 246 | for (uint32_t j=0; j<x; j++) |
---|
| 247 | { |
---|
| 248 | in_RETIRE_ROB_VAL [i][j] = new sc_signal<Tcontrol_t > (rename.c_str()); |
---|
| 249 | out_RETIRE_ROB_ACK [i][j] = new sc_signal<Tcontrol_t > (rename.c_str()); |
---|
| 250 | in_RETIRE_ROB_RD_OLD_USE [i][j] = new sc_signal<Tcontrol_t > (rename.c_str()); |
---|
| 251 | in_RETIRE_ROB_RD_OLD_NUM_REG [i][j] = new sc_signal<Tgeneral_address_t> (rename.c_str()); |
---|
| 252 | in_RETIRE_ROB_RE_OLD_USE [i][j] = new sc_signal<Tcontrol_t > (rename.c_str()); |
---|
| 253 | in_RETIRE_ROB_RE_OLD_NUM_REG [i][j] = new sc_signal<Tspecial_address_t> (rename.c_str()); |
---|
| 254 | in_RETIRE_ROB_RD_NEW_USE [i][j] = new sc_signal<Tcontrol_t > (rename.c_str()); |
---|
| 255 | in_RETIRE_ROB_RD_NEW_NUM_REG [i][j] = new sc_signal<Tgeneral_address_t> (rename.c_str()); |
---|
| 256 | in_RETIRE_ROB_RE_NEW_USE [i][j] = new sc_signal<Tcontrol_t > (rename.c_str()); |
---|
| 257 | in_RETIRE_ROB_RE_NEW_NUM_REG [i][j] = new sc_signal<Tspecial_address_t> (rename.c_str()); |
---|
| 258 | } |
---|
| 259 | } |
---|
| 260 | |
---|
| 261 | |
---|
| 262 | /******************************************************** |
---|
| 263 | * Instanciation |
---|
| 264 | ********************************************************/ |
---|
| 265 | |
---|
| 266 | cout << "<" << name << "> Instanciation of _Register_unit" << endl; |
---|
| 267 | |
---|
| 268 | (*(_Register_unit->in_CLOCK)) (*(in_CLOCK)); |
---|
| 269 | (*(_Register_unit->in_NRESET)) (*(in_NRESET)); |
---|
| 270 | |
---|
| 271 | for (uint32_t i=0; i<_param->_nb_gpr_read; i++) |
---|
| 272 | { |
---|
| 273 | (*(_Register_unit-> in_GPR_READ_VAL [i]))(*( in_GPR_READ_VAL [i])); |
---|
| 274 | (*(_Register_unit->out_GPR_READ_ACK [i]))(*(out_GPR_READ_ACK [i])); |
---|
| 275 | if (_param->_have_port_ooo_engine_id == true) |
---|
| 276 | (*(_Register_unit-> in_GPR_READ_OOO_ENGINE_ID [i]))(*( in_GPR_READ_OOO_ENGINE_ID [i])); |
---|
| 277 | (*(_Register_unit-> in_GPR_READ_NUM_REG [i]))(*( in_GPR_READ_NUM_REG [i])); |
---|
| 278 | (*(_Register_unit->out_GPR_READ_DATA [i]))(*(out_GPR_READ_DATA [i])); |
---|
| 279 | (*(_Register_unit->out_GPR_READ_DATA_VAL [i]))(*(out_GPR_READ_DATA_VAL [i])); |
---|
| 280 | } |
---|
| 281 | for (uint32_t i=0; i<_param->_nb_gpr_write; i++) |
---|
| 282 | { |
---|
| 283 | (*(_Register_unit-> in_GPR_WRITE_VAL [i]))(*( in_GPR_WRITE_VAL [i])); |
---|
| 284 | (*(_Register_unit->out_GPR_WRITE_ACK [i]))(*(out_GPR_WRITE_ACK [i])); |
---|
| 285 | if (_param->_have_port_ooo_engine_id == true) |
---|
| 286 | (*(_Register_unit-> in_GPR_WRITE_OOO_ENGINE_ID [i]))(*( in_GPR_WRITE_OOO_ENGINE_ID [i])); |
---|
| 287 | (*(_Register_unit-> in_GPR_WRITE_NUM_REG [i]))(*( in_GPR_WRITE_NUM_REG [i])); |
---|
| 288 | (*(_Register_unit-> in_GPR_WRITE_DATA [i]))(*( in_GPR_WRITE_DATA [i])); |
---|
| 289 | } |
---|
| 290 | for (uint32_t i=0; i<_param->_nb_spr_read; i++) |
---|
| 291 | { |
---|
| 292 | (*(_Register_unit-> in_SPR_READ_VAL [i]))(*( in_SPR_READ_VAL [i])); |
---|
| 293 | (*(_Register_unit->out_SPR_READ_ACK [i]))(*(out_SPR_READ_ACK [i])); |
---|
| 294 | if (_param->_have_port_ooo_engine_id == true) |
---|
| 295 | (*(_Register_unit-> in_SPR_READ_OOO_ENGINE_ID [i]))(*( in_SPR_READ_OOO_ENGINE_ID [i])); |
---|
| 296 | (*(_Register_unit-> in_SPR_READ_NUM_REG [i]))(*( in_SPR_READ_NUM_REG [i])); |
---|
| 297 | (*(_Register_unit->out_SPR_READ_DATA [i]))(*(out_SPR_READ_DATA [i])); |
---|
| 298 | (*(_Register_unit->out_SPR_READ_DATA_VAL [i]))(*(out_SPR_READ_DATA_VAL [i])); |
---|
| 299 | } |
---|
| 300 | for (uint32_t i=0; i<_param->_nb_spr_write; i++) |
---|
| 301 | { |
---|
| 302 | (*(_Register_unit-> in_SPR_WRITE_VAL [i]))(*( in_SPR_WRITE_VAL [i])); |
---|
| 303 | (*(_Register_unit->out_SPR_WRITE_ACK [i]))(*(out_SPR_WRITE_ACK [i])); |
---|
| 304 | if (_param->_have_port_ooo_engine_id == true) |
---|
| 305 | (*(_Register_unit-> in_SPR_WRITE_OOO_ENGINE_ID [i]))(*( in_SPR_WRITE_OOO_ENGINE_ID [i])); |
---|
| 306 | (*(_Register_unit-> in_SPR_WRITE_NUM_REG [i]))(*( in_SPR_WRITE_NUM_REG [i])); |
---|
| 307 | (*(_Register_unit-> in_SPR_WRITE_DATA [i]))(*( in_SPR_WRITE_DATA [i])); |
---|
| 308 | } |
---|
| 309 | for (uint32_t i=0; i<_param->_nb_ooo_engine; i++) |
---|
| 310 | for (uint32_t j=0; j<_param->_nb_inst_insert_rob [i]; j++) |
---|
| 311 | { |
---|
| 312 | (*(_Register_unit-> in_INSERT_ROB_VAL [i][j]))(*( in_INSERT_ROB_VAL [i][j])); |
---|
| 313 | (*(_Register_unit->out_INSERT_ROB_ACK [i][j]))(*(out_INSERT_ROB_ACK [i][j])); |
---|
| 314 | (*(_Register_unit-> in_INSERT_ROB_RD_USE [i][j]))(*( in_INSERT_ROB_RD_USE [i][j])); |
---|
| 315 | (*(_Register_unit-> in_INSERT_ROB_RD_NUM_REG [i][j]))(*( in_INSERT_ROB_RD_NUM_REG [i][j])); |
---|
| 316 | (*(_Register_unit-> in_INSERT_ROB_RE_USE [i][j]))(*( in_INSERT_ROB_RE_USE [i][j])); |
---|
| 317 | (*(_Register_unit-> in_INSERT_ROB_RE_NUM_REG [i][j]))(*( in_INSERT_ROB_RE_NUM_REG [i][j])); |
---|
| 318 | } |
---|
| 319 | for (uint32_t i=0; i<_param->_nb_ooo_engine; i++) |
---|
| 320 | for (uint32_t j=0; j<_param->_nb_inst_retire_rob [i]; j++) |
---|
| 321 | { |
---|
| 322 | (*(_Register_unit-> in_RETIRE_ROB_VAL [i][j]))(*( in_RETIRE_ROB_VAL [i][j])); |
---|
| 323 | (*(_Register_unit->out_RETIRE_ROB_ACK [i][j]))(*(out_RETIRE_ROB_ACK [i][j])); |
---|
| 324 | (*(_Register_unit-> in_RETIRE_ROB_RD_OLD_USE [i][j]))(*( in_RETIRE_ROB_RD_OLD_USE [i][j])); |
---|
| 325 | (*(_Register_unit-> in_RETIRE_ROB_RD_OLD_NUM_REG [i][j]))(*( in_RETIRE_ROB_RD_OLD_NUM_REG [i][j])); |
---|
| 326 | (*(_Register_unit-> in_RETIRE_ROB_RE_OLD_USE [i][j]))(*( in_RETIRE_ROB_RE_OLD_USE [i][j])); |
---|
| 327 | (*(_Register_unit-> in_RETIRE_ROB_RE_OLD_NUM_REG [i][j]))(*( in_RETIRE_ROB_RE_OLD_NUM_REG [i][j])); |
---|
| 328 | (*(_Register_unit-> in_RETIRE_ROB_RD_NEW_USE [i][j]))(*( in_RETIRE_ROB_RD_NEW_USE [i][j])); |
---|
| 329 | (*(_Register_unit-> in_RETIRE_ROB_RD_NEW_NUM_REG [i][j]))(*( in_RETIRE_ROB_RD_NEW_NUM_REG [i][j])); |
---|
| 330 | (*(_Register_unit-> in_RETIRE_ROB_RE_NEW_USE [i][j]))(*( in_RETIRE_ROB_RE_NEW_USE [i][j])); |
---|
| 331 | (*(_Register_unit-> in_RETIRE_ROB_RE_NEW_NUM_REG [i][j]))(*( in_RETIRE_ROB_RE_NEW_NUM_REG [i][j])); |
---|
| 332 | } |
---|
| 333 | |
---|
| 334 | cout << "<" << name << "> Start Simulation ............" << endl; |
---|
| 335 | Time * _time = new Time(); |
---|
| 336 | |
---|
| 337 | /******************************************************** |
---|
| 338 | * Simulation - Begin |
---|
| 339 | ********************************************************/ |
---|
| 340 | |
---|
| 341 | // Initialisation |
---|
| 342 | |
---|
| 343 | const uint32_t seed = 0; |
---|
| 344 | //const uint32_t seed = static_cast<uint32_t>(time(NULL)); |
---|
| 345 | |
---|
| 346 | srand(seed); |
---|
| 347 | |
---|
| 348 | SC_START(0); |
---|
| 349 | |
---|
| 350 | LABEL("Initialisation"); |
---|
| 351 | |
---|
| 352 | LABEL("Loop of Test"); |
---|
| 353 | |
---|
| 354 | for (uint32_t iteration=0; iteration<NB_ITERATION; iteration ++) |
---|
| 355 | { |
---|
| 356 | LABEL("Iteration "+toString(iteration)); |
---|
| 357 | |
---|
| 358 | SC_START(1); |
---|
| 359 | } |
---|
| 360 | |
---|
| 361 | /******************************************************** |
---|
| 362 | * Simulation - End |
---|
| 363 | ********************************************************/ |
---|
| 364 | |
---|
| 365 | TEST_OK ("End of Simulation"); |
---|
| 366 | delete _time; |
---|
| 367 | cout << "<" << name << "> ............ Stop Simulation" << endl; |
---|
| 368 | |
---|
| 369 | delete in_CLOCK; |
---|
| 370 | delete in_NRESET; |
---|
| 371 | |
---|
| 372 | delete [] in_GPR_READ_VAL ; |
---|
| 373 | delete [] out_GPR_READ_ACK ; |
---|
| 374 | delete [] in_GPR_READ_OOO_ENGINE_ID ; |
---|
| 375 | delete [] in_GPR_READ_NUM_REG ; |
---|
| 376 | delete [] out_GPR_READ_DATA ; |
---|
| 377 | delete [] out_GPR_READ_DATA_VAL ; |
---|
| 378 | delete [] in_GPR_WRITE_VAL ; |
---|
| 379 | delete [] out_GPR_WRITE_ACK ; |
---|
| 380 | delete [] in_GPR_WRITE_OOO_ENGINE_ID ; |
---|
| 381 | delete [] in_GPR_WRITE_NUM_REG ; |
---|
| 382 | delete [] in_GPR_WRITE_DATA ; |
---|
| 383 | delete [] in_SPR_READ_VAL ; |
---|
| 384 | delete [] out_SPR_READ_ACK ; |
---|
| 385 | delete [] in_SPR_READ_OOO_ENGINE_ID ; |
---|
| 386 | delete [] in_SPR_READ_NUM_REG ; |
---|
| 387 | delete [] out_SPR_READ_DATA ; |
---|
| 388 | delete [] out_SPR_READ_DATA_VAL ; |
---|
| 389 | delete [] in_SPR_WRITE_VAL ; |
---|
| 390 | delete [] out_SPR_WRITE_ACK ; |
---|
| 391 | delete [] in_SPR_WRITE_OOO_ENGINE_ID ; |
---|
| 392 | delete [] in_SPR_WRITE_NUM_REG ; |
---|
| 393 | delete [] in_SPR_WRITE_DATA ; |
---|
| 394 | delete [] in_INSERT_ROB_VAL ; |
---|
| 395 | delete [] out_INSERT_ROB_ACK ; |
---|
| 396 | delete [] in_INSERT_ROB_RD_USE ; |
---|
| 397 | delete [] in_INSERT_ROB_RD_NUM_REG ; |
---|
| 398 | delete [] in_INSERT_ROB_RE_USE ; |
---|
| 399 | delete [] in_INSERT_ROB_RE_NUM_REG ; |
---|
| 400 | delete [] in_RETIRE_ROB_VAL ; |
---|
| 401 | delete [] out_RETIRE_ROB_ACK ; |
---|
| 402 | delete [] in_RETIRE_ROB_RD_OLD_USE ; |
---|
| 403 | delete [] in_RETIRE_ROB_RD_OLD_NUM_REG ; |
---|
| 404 | delete [] in_RETIRE_ROB_RD_NEW_USE ; |
---|
| 405 | delete [] in_RETIRE_ROB_RD_NEW_NUM_REG ; |
---|
| 406 | delete [] in_RETIRE_ROB_RE_OLD_USE ; |
---|
| 407 | delete [] in_RETIRE_ROB_RE_OLD_NUM_REG ; |
---|
| 408 | delete [] in_RETIRE_ROB_RE_NEW_USE ; |
---|
| 409 | delete [] in_RETIRE_ROB_RE_NEW_NUM_REG ; |
---|
| 410 | #endif |
---|
| 411 | |
---|
| 412 | delete _Register_unit; |
---|
| 413 | #ifdef STATISTICS |
---|
| 414 | delete _parameters_statistics; |
---|
| 415 | #endif |
---|
| 416 | } |
---|