[83] | 1 | /* |
---|
| 2 | * $Id: test.cpp 83 2008-05-09 18:00:21Z rosiere $ |
---|
| 3 | * |
---|
| 4 | * [ Description ] |
---|
| 5 | * |
---|
| 6 | * Test |
---|
| 7 | */ |
---|
| 8 | |
---|
| 9 | #define NB_ITERATION 1 |
---|
| 10 | #define CYCLE_MAX (128*NB_ITERATION) |
---|
| 11 | |
---|
| 12 | #include "Behavioural/Core/Multi_Front_end/Front_end/Decod_unit/SelfTest/include/test.h" |
---|
| 13 | #include "Common/include/Test.h" |
---|
| 14 | #include "Behavioural/include/Allocation.h" |
---|
| 15 | |
---|
| 16 | void test (string name, |
---|
| 17 | morpheo::behavioural::core::multi_front_end::front_end::decod_unit::Parameters * _param) |
---|
| 18 | { |
---|
| 19 | msg(_("<%s> : Simulation SystemC.\n"),name.c_str()); |
---|
| 20 | |
---|
| 21 | #ifdef STATISTICS |
---|
| 22 | morpheo::behavioural::Parameters_Statistics * _parameters_statistics = new morpheo::behavioural::Parameters_Statistics (5,50); |
---|
| 23 | #endif |
---|
| 24 | |
---|
| 25 | Tusage_t _usage = USE_ALL; |
---|
| 26 | |
---|
| 27 | // _usage = usage_unset(_usage,USE_SYSTEMC ); |
---|
| 28 | // _usage = usage_unset(_usage,USE_VHDL ); |
---|
| 29 | // _usage = usage_unset(_usage,USE_VHDL_TESTBENCH ); |
---|
| 30 | // _usage = usage_unset(_usage,USE_VHDL_TESTBENCH_ASSERT); |
---|
| 31 | // _usage = usage_unset(_usage,USE_POSITION ); |
---|
| 32 | // _usage = usage_unset(_usage,USE_STATISTICS ); |
---|
| 33 | // _usage = usage_unset(_usage,USE_INFORMATION ); |
---|
| 34 | |
---|
| 35 | Decod_unit * _Decod_unit = new Decod_unit |
---|
| 36 | (name.c_str(), |
---|
| 37 | #ifdef STATISTICS |
---|
| 38 | _parameters_statistics, |
---|
| 39 | #endif |
---|
| 40 | _param, |
---|
| 41 | _usage); |
---|
| 42 | |
---|
| 43 | #ifdef SYSTEMC |
---|
| 44 | if (usage_is_set(_usage,USE_SYSTEMC)) |
---|
| 45 | { |
---|
| 46 | /********************************************************************* |
---|
| 47 | * Déclarations des signaux |
---|
| 48 | *********************************************************************/ |
---|
| 49 | string rename; |
---|
| 50 | |
---|
| 51 | sc_clock * in_CLOCK = new sc_clock ("clock", 1.0, 0.5); |
---|
| 52 | sc_signal<Tcontrol_t> * in_NRESET = new sc_signal<Tcontrol_t> ("NRESET"); |
---|
| 53 | |
---|
| 54 | ALLOC2_SC_SIGNAL( in_IFETCH_VAL ," in_IFETCH_VAL ",Tcontrol_t ,_param->_nb_context, _param->_nb_inst_fetch[alloc_signal_it1]); |
---|
| 55 | ALLOC2_SC_SIGNAL(out_IFETCH_ACK ,"out_IFETCH_ACK ",Tcontrol_t ,_param->_nb_context, _param->_nb_inst_fetch[alloc_signal_it1]); |
---|
| 56 | ALLOC2_SC_SIGNAL( in_IFETCH_INSTRUCTION ," in_IFETCH_INSTRUCTION ",Tinstruction_t ,_param->_nb_context, _param->_nb_inst_fetch[alloc_signal_it1]); |
---|
| 57 | |
---|
| 58 | ALLOC1_SC_SIGNAL(in_IFETCH_CONTEXT_ID ,"in_IFETCH_CONTEXT_ID ",Tcontext_t ,_param->_nb_context); |
---|
| 59 | ALLOC1_SC_SIGNAL(in_IFETCH_ADDRESS ,"in_IFETCH_ADDRESS ",Tgeneral_address_t ,_param->_nb_context); |
---|
| 60 | //ALLOC1_SC_SIGNAL(in_IFETCH_ADDRESS_NEXT ,"in_IFETCH_ADDRESS_NEXT ",Tgeneral_address_t ,_param->_nb_context); |
---|
| 61 | ALLOC1_SC_SIGNAL(in_IFETCH_INST_IFETCH_PTR ,"in_IFETCH_INST_IFETCH_PTR ",Tinst_ifetch_ptr_t ,_param->_nb_context); |
---|
| 62 | ALLOC1_SC_SIGNAL(in_IFETCH_BRANCH_STATE ,"in_IFETCH_BRANCH_STATE ",Tbranch_state_t ,_param->_nb_context); |
---|
| 63 | ALLOC1_SC_SIGNAL(in_IFETCH_BRANCH_UPDATE_PREDICTION_ID ,"in_IFETCH_BRANCH_UPDATE_PREDICTION_ID ",Tprediction_ptr_t ,_param->_nb_context); |
---|
| 64 | |
---|
| 65 | ALLOC1_SC_SIGNAL(out_DECOD_VAL ,"out_DECOD_VAL ",Tcontrol_t ,_param->_nb_inst_decod); |
---|
| 66 | ALLOC1_SC_SIGNAL( in_DECOD_ACK ," in_DECOD_ACK ",Tcontrol_t ,_param->_nb_inst_decod); |
---|
| 67 | ALLOC1_SC_SIGNAL(out_DECOD_CONTEXT_ID ,"out_DECOD_CONTEXT_ID ",Tcontext_t ,_param->_nb_inst_decod); |
---|
| 68 | ALLOC1_SC_SIGNAL(out_DECOD_DEPTH ,"out_DECOD_DEPTH ",Tdepth_t ,_param->_nb_inst_decod); |
---|
| 69 | ALLOC1_SC_SIGNAL(out_DECOD_TYPE ,"out_DECOD_TYPE ",Ttype_t ,_param->_nb_inst_decod); |
---|
| 70 | ALLOC1_SC_SIGNAL(out_DECOD_OPERATION ,"out_DECOD_OPERATION ",Toperation_t ,_param->_nb_inst_decod); |
---|
| 71 | ALLOC1_SC_SIGNAL(out_DECOD_IS_DELAY_SLOT ,"out_DECOD_IS_DELAY_SLOT ",Tcontrol_t ,_param->_nb_inst_decod); |
---|
| 72 | ALLOC1_SC_SIGNAL(out_DECOD_ADDRESS ,"out_DECOD_ADDRESS ",Tgeneral_data_t ,_param->_nb_inst_decod); |
---|
| 73 | ALLOC1_SC_SIGNAL(out_DECOD_HAS_IMMEDIAT ,"out_DECOD_HAS_IMMEDIAT ",Tcontrol_t ,_param->_nb_inst_decod); |
---|
| 74 | ALLOC1_SC_SIGNAL(out_DECOD_IMMEDIAT ,"out_DECOD_IMMEDIAT ",Tgeneral_data_t ,_param->_nb_inst_decod); |
---|
| 75 | ALLOC1_SC_SIGNAL(out_DECOD_READ_RA ,"out_DECOD_READ_RA ",Tcontrol_t ,_param->_nb_inst_decod); |
---|
| 76 | ALLOC1_SC_SIGNAL(out_DECOD_NUM_REG_RA ,"out_DECOD_NUM_REG_RA ",Tgeneral_address_t ,_param->_nb_inst_decod); |
---|
| 77 | ALLOC1_SC_SIGNAL(out_DECOD_READ_RB ,"out_DECOD_READ_RB ",Tcontrol_t ,_param->_nb_inst_decod); |
---|
| 78 | ALLOC1_SC_SIGNAL(out_DECOD_NUM_REG_RB ,"out_DECOD_NUM_REG_RB ",Tgeneral_address_t ,_param->_nb_inst_decod); |
---|
| 79 | ALLOC1_SC_SIGNAL(out_DECOD_READ_RC ,"out_DECOD_READ_RC ",Tcontrol_t ,_param->_nb_inst_decod); |
---|
| 80 | ALLOC1_SC_SIGNAL(out_DECOD_NUM_REG_RC ,"out_DECOD_NUM_REG_RC ",Tspecial_address_t ,_param->_nb_inst_decod); |
---|
| 81 | ALLOC1_SC_SIGNAL(out_DECOD_WRITE_RD ,"out_DECOD_WRITE_RD ",Tcontrol_t ,_param->_nb_inst_decod); |
---|
| 82 | ALLOC1_SC_SIGNAL(out_DECOD_NUM_REG_RD ,"out_DECOD_NUM_REG_RD ",Tgeneral_address_t ,_param->_nb_inst_decod); |
---|
| 83 | ALLOC1_SC_SIGNAL(out_DECOD_WRITE_RE ,"out_DECOD_WRITE_RE ",Tcontrol_t ,_param->_nb_inst_decod); |
---|
| 84 | ALLOC1_SC_SIGNAL(out_DECOD_NUM_REG_RE ,"out_DECOD_NUM_REG_RE ",Tspecial_address_t ,_param->_nb_inst_decod); |
---|
| 85 | ALLOC1_SC_SIGNAL(out_DECOD_EXCEPTION_USE ,"out_DECOD_EXCEPTION_USE ",Texception_t ,_param->_nb_inst_decod); |
---|
| 86 | |
---|
| 87 | ALLOC1_SC_SIGNAL(out_PREDICT_VAL ,"out_PREDICT_VAL ",Tcontrol_t ,_param->_nb_inst_decod); |
---|
| 88 | ALLOC1_SC_SIGNAL( in_PREDICT_ACK ," in_PREDICT_ACK ",Tcontrol_t ,_param->_nb_inst_decod); |
---|
| 89 | ALLOC1_SC_SIGNAL(out_PREDICT_CONTEXT_ID ,"out_PREDICT_CONTEXT_ID ",Tcontext_t ,_param->_nb_inst_decod); |
---|
| 90 | ALLOC1_SC_SIGNAL(out_PREDICT_MATCH_INST_IFETCH_PTR ,"out_PREDICT_MATCH_INST_IFETCH_PTR ",Tcontrol_t ,_param->_nb_inst_decod); |
---|
| 91 | ALLOC1_SC_SIGNAL(out_PREDICT_BRANCH_STATE ,"out_PREDICT_BRANCH_STATE ",Tbranch_state_t ,_param->_nb_inst_decod); |
---|
| 92 | ALLOC1_SC_SIGNAL(out_PREDICT_BRANCH_UPDATE_PREDICTION_ID,"out_PREDICT_BRANCH_UPDATE_PREDICTION_ID",Tprediction_ptr_t ,_param->_nb_inst_decod); |
---|
| 93 | ALLOC1_SC_SIGNAL(out_PREDICT_BRANCH_CONDITION ,"out_PREDICT_BRANCH_CONDITION ",Tbranch_condition_t,_param->_nb_inst_decod); |
---|
| 94 | //ALLOC1_SC_SIGNAL(out_PREDICT_BRANCH_STACK_WRITE ,"out_PREDICT_BRANCH_STACK_WRITE ",Tcontrol_t ,_param->_nb_inst_decod); |
---|
| 95 | ALLOC1_SC_SIGNAL(out_PREDICT_BRANCH_DIRECTION ,"out_PREDICT_BRANCH_DIRECTION ",Tcontrol_t ,_param->_nb_inst_decod); |
---|
| 96 | ALLOC1_SC_SIGNAL(out_PREDICT_ADDRESS_SRC ,"out_PREDICT_ADDRESS_SRC ",Tgeneral_data_t ,_param->_nb_inst_decod); |
---|
| 97 | ALLOC1_SC_SIGNAL(out_PREDICT_ADDRESS_DEST ,"out_PREDICT_ADDRESS_DEST ",Tgeneral_data_t ,_param->_nb_inst_decod); |
---|
| 98 | //ALLOC1_SC_SIGNAL( in_PREDICT_CAN_CONTINUE ," in_PREDICT_CAN_CONTINUE ",Tcontrol_t ,_param->_nb_inst_decod); |
---|
| 99 | |
---|
| 100 | ALLOC1_SC_SIGNAL( in_DEPTH_TAIL ," in_DEPTH_TAIL ",Tdepth_t ,_param->_nb_context); |
---|
| 101 | ALLOC1_SC_SIGNAL( in_DEPTH_NB_BRANCH ," in_DEPTH_NB_BRANCH ",Tdepth_t ,_param->_nb_context); |
---|
| 102 | |
---|
| 103 | ALLOC1_SC_SIGNAL(out_NB_INST_DECOD_ALL ,"out_NB_INST_DECOD_ALL ",Tcounter_t ,_param->_nb_context); |
---|
| 104 | |
---|
| 105 | ALLOC1_SC_SIGNAL( in_CONTEXT_DECOD_ENABLE ," in_CONTEXT_DECOD_ENABLE ",Tcontrol_t ,_param->_nb_context); |
---|
| 106 | ALLOC1_SC_SIGNAL( in_CONTEXT_DEPTH ," in_CONTEXT_DEPTH ",Tdepth_t ,_param->_nb_context); |
---|
| 107 | |
---|
| 108 | ALLOC_SC_SIGNAL( out_CONTEXT_EVENT_VAL ,"out_CONTEXT_EVENT_VAL ",Tcontrol_t ); |
---|
| 109 | ALLOC_SC_SIGNAL( in_CONTEXT_EVENT_ACK ," in_CONTEXT_EVENT_ACK ",Tcontrol_t ); |
---|
| 110 | ALLOC_SC_SIGNAL( out_CONTEXT_EVENT_CONTEXT_ID ,"out_CONTEXT_EVENT_CONTEXT_ID ",Tcontext_t ); |
---|
| 111 | ALLOC_SC_SIGNAL( out_CONTEXT_EVENT_TYPE ,"out_CONTEXT_EVENT_TYPE ",Tevent_type_t ); |
---|
| 112 | ALLOC_SC_SIGNAL( out_CONTEXT_EVENT_IS_DELAY_SLOT ,"out_CONTEXT_EVENT_IS_DELAY_SLOT ",Tcontrol_t ); |
---|
| 113 | ALLOC_SC_SIGNAL( out_CONTEXT_EVENT_ADDRESS ,"out_CONTEXT_EVENT_ADDRESS ",Tgeneral_data_t ); |
---|
| 114 | ALLOC_SC_SIGNAL( out_CONTEXT_EVENT_ADDRESS_EPCR ,"out_CONTEXT_EVENT_ADDRESS_EPCR ",Tgeneral_data_t ); |
---|
| 115 | |
---|
| 116 | /******************************************************** |
---|
| 117 | * Instanciation |
---|
| 118 | ********************************************************/ |
---|
| 119 | |
---|
| 120 | msg(_("<%s> : Instanciation of _Decod_unit.\n"),name.c_str()); |
---|
| 121 | |
---|
| 122 | (*(_Decod_unit->in_CLOCK)) (*(in_CLOCK)); |
---|
| 123 | (*(_Decod_unit->in_NRESET)) (*(in_NRESET)); |
---|
| 124 | |
---|
| 125 | INSTANCE2_SC_SIGNAL(_Decod_unit, in_IFETCH_VAL ,_param->_nb_context, _param->_nb_inst_fetch[alloc_signal_it1]); |
---|
| 126 | INSTANCE2_SC_SIGNAL(_Decod_unit,out_IFETCH_ACK ,_param->_nb_context, _param->_nb_inst_fetch[alloc_signal_it1]); |
---|
| 127 | INSTANCE2_SC_SIGNAL(_Decod_unit, in_IFETCH_INSTRUCTION ,_param->_nb_context, _param->_nb_inst_fetch[alloc_signal_it1]); |
---|
| 128 | if (_param->_have_port_context_id) |
---|
| 129 | INSTANCE1_SC_SIGNAL(_Decod_unit,in_IFETCH_CONTEXT_ID ,_param->_nb_context); |
---|
| 130 | INSTANCE1_SC_SIGNAL(_Decod_unit,in_IFETCH_ADDRESS ,_param->_nb_context); |
---|
| 131 | //INSTANCE1_SC_SIGNAL(_Decod_unit,in_IFETCH_ADDRESS_NEXT ,_param->_nb_context); |
---|
| 132 | if (_param->_have_port_inst_ifetch_ptr) |
---|
| 133 | INSTANCE1_SC_SIGNAL(_Decod_unit,in_IFETCH_INST_IFETCH_PTR ,_param->_nb_context); |
---|
| 134 | INSTANCE1_SC_SIGNAL(_Decod_unit,in_IFETCH_BRANCH_STATE ,_param->_nb_context); |
---|
| 135 | if (_param->_have_port_branch_update_prediction_id) |
---|
| 136 | INSTANCE1_SC_SIGNAL(_Decod_unit,in_IFETCH_BRANCH_UPDATE_PREDICTION_ID ,_param->_nb_context); |
---|
| 137 | |
---|
| 138 | INSTANCE1_SC_SIGNAL(_Decod_unit,out_DECOD_VAL ,_param->_nb_inst_decod); |
---|
| 139 | INSTANCE1_SC_SIGNAL(_Decod_unit, in_DECOD_ACK ,_param->_nb_inst_decod); |
---|
| 140 | if (_param->_have_port_context_id) |
---|
| 141 | INSTANCE1_SC_SIGNAL(_Decod_unit,out_DECOD_CONTEXT_ID ,_param->_nb_inst_decod); |
---|
| 142 | if (_param->_have_port_depth) |
---|
| 143 | INSTANCE1_SC_SIGNAL(_Decod_unit,out_DECOD_DEPTH ,_param->_nb_inst_decod); |
---|
| 144 | INSTANCE1_SC_SIGNAL(_Decod_unit,out_DECOD_TYPE ,_param->_nb_inst_decod); |
---|
| 145 | INSTANCE1_SC_SIGNAL(_Decod_unit,out_DECOD_OPERATION ,_param->_nb_inst_decod); |
---|
| 146 | INSTANCE1_SC_SIGNAL(_Decod_unit,out_DECOD_IS_DELAY_SLOT ,_param->_nb_inst_decod); |
---|
| 147 | INSTANCE1_SC_SIGNAL(_Decod_unit,out_DECOD_ADDRESS ,_param->_nb_inst_decod); |
---|
| 148 | INSTANCE1_SC_SIGNAL(_Decod_unit,out_DECOD_HAS_IMMEDIAT ,_param->_nb_inst_decod); |
---|
| 149 | INSTANCE1_SC_SIGNAL(_Decod_unit,out_DECOD_IMMEDIAT ,_param->_nb_inst_decod); |
---|
| 150 | INSTANCE1_SC_SIGNAL(_Decod_unit,out_DECOD_READ_RA ,_param->_nb_inst_decod); |
---|
| 151 | INSTANCE1_SC_SIGNAL(_Decod_unit,out_DECOD_NUM_REG_RA ,_param->_nb_inst_decod); |
---|
| 152 | INSTANCE1_SC_SIGNAL(_Decod_unit,out_DECOD_READ_RB ,_param->_nb_inst_decod); |
---|
| 153 | INSTANCE1_SC_SIGNAL(_Decod_unit,out_DECOD_NUM_REG_RB ,_param->_nb_inst_decod); |
---|
| 154 | INSTANCE1_SC_SIGNAL(_Decod_unit,out_DECOD_READ_RC ,_param->_nb_inst_decod); |
---|
| 155 | INSTANCE1_SC_SIGNAL(_Decod_unit,out_DECOD_NUM_REG_RC ,_param->_nb_inst_decod); |
---|
| 156 | INSTANCE1_SC_SIGNAL(_Decod_unit,out_DECOD_WRITE_RD ,_param->_nb_inst_decod); |
---|
| 157 | INSTANCE1_SC_SIGNAL(_Decod_unit,out_DECOD_NUM_REG_RD ,_param->_nb_inst_decod); |
---|
| 158 | INSTANCE1_SC_SIGNAL(_Decod_unit,out_DECOD_WRITE_RE ,_param->_nb_inst_decod); |
---|
| 159 | INSTANCE1_SC_SIGNAL(_Decod_unit,out_DECOD_NUM_REG_RE ,_param->_nb_inst_decod); |
---|
| 160 | INSTANCE1_SC_SIGNAL(_Decod_unit,out_DECOD_EXCEPTION_USE ,_param->_nb_inst_decod); |
---|
| 161 | |
---|
| 162 | INSTANCE1_SC_SIGNAL(_Decod_unit,out_PREDICT_VAL ,_param->_nb_inst_decod); |
---|
| 163 | INSTANCE1_SC_SIGNAL(_Decod_unit, in_PREDICT_ACK ,_param->_nb_inst_decod); |
---|
| 164 | if (_param->_have_port_context_id) |
---|
| 165 | INSTANCE1_SC_SIGNAL(_Decod_unit,out_PREDICT_CONTEXT_ID ,_param->_nb_inst_decod); |
---|
| 166 | INSTANCE1_SC_SIGNAL(_Decod_unit,out_PREDICT_MATCH_INST_IFETCH_PTR ,_param->_nb_inst_decod); |
---|
| 167 | INSTANCE1_SC_SIGNAL(_Decod_unit,out_PREDICT_BRANCH_STATE ,_param->_nb_inst_decod); |
---|
| 168 | if (_param->_have_port_branch_update_prediction_id) |
---|
| 169 | INSTANCE1_SC_SIGNAL(_Decod_unit,out_PREDICT_BRANCH_UPDATE_PREDICTION_ID,_param->_nb_inst_decod); |
---|
| 170 | INSTANCE1_SC_SIGNAL(_Decod_unit,out_PREDICT_BRANCH_CONDITION ,_param->_nb_inst_decod); |
---|
| 171 | //INSTANCE1_SC_SIGNAL(_Decod_unit,out_PREDICT_BRANCH_STACK_WRITE ,_param->_nb_inst_decod); |
---|
| 172 | INSTANCE1_SC_SIGNAL(_Decod_unit,out_PREDICT_BRANCH_DIRECTION ,_param->_nb_inst_decod); |
---|
| 173 | INSTANCE1_SC_SIGNAL(_Decod_unit,out_PREDICT_ADDRESS_SRC ,_param->_nb_inst_decod); |
---|
| 174 | INSTANCE1_SC_SIGNAL(_Decod_unit,out_PREDICT_ADDRESS_DEST ,_param->_nb_inst_decod); |
---|
| 175 | //INSTANCE1_SC_SIGNAL(_Decod_unit, in_PREDICT_CAN_CONTINUE ,_param->_nb_inst_decod); |
---|
| 176 | |
---|
| 177 | if (_param->_have_port_depth) |
---|
| 178 | { |
---|
| 179 | INSTANCE1_SC_SIGNAL(_Decod_unit, in_DEPTH_TAIL ,_param->_nb_context); |
---|
| 180 | INSTANCE1_SC_SIGNAL(_Decod_unit, in_DEPTH_NB_BRANCH ,_param->_nb_context); |
---|
| 181 | } |
---|
| 182 | |
---|
| 183 | INSTANCE1_SC_SIGNAL(_Decod_unit,out_NB_INST_DECOD_ALL ,_param->_nb_context); |
---|
| 184 | |
---|
| 185 | INSTANCE1_SC_SIGNAL(_Decod_unit, in_CONTEXT_DECOD_ENABLE ,_param->_nb_context); |
---|
| 186 | if (_param->_have_port_depth) |
---|
| 187 | INSTANCE1_SC_SIGNAL(_Decod_unit, in_CONTEXT_DEPTH ,_param->_nb_context); |
---|
| 188 | |
---|
| 189 | INSTANCE_SC_SIGNAL( _Decod_unit,out_CONTEXT_EVENT_VAL ); |
---|
| 190 | INSTANCE_SC_SIGNAL( _Decod_unit, in_CONTEXT_EVENT_ACK ); |
---|
| 191 | if (_param->_have_port_context_id) |
---|
| 192 | INSTANCE_SC_SIGNAL( _Decod_unit,out_CONTEXT_EVENT_CONTEXT_ID ); |
---|
| 193 | INSTANCE_SC_SIGNAL( _Decod_unit,out_CONTEXT_EVENT_TYPE ); |
---|
| 194 | INSTANCE_SC_SIGNAL( _Decod_unit,out_CONTEXT_EVENT_IS_DELAY_SLOT ); |
---|
| 195 | INSTANCE_SC_SIGNAL( _Decod_unit,out_CONTEXT_EVENT_ADDRESS ); |
---|
| 196 | INSTANCE_SC_SIGNAL( _Decod_unit,out_CONTEXT_EVENT_ADDRESS_EPCR ); |
---|
| 197 | |
---|
| 198 | |
---|
| 199 | msg(_("<%s> : Start Simulation ............\n"),name.c_str()); |
---|
| 200 | |
---|
| 201 | Time * _time = new Time(); |
---|
| 202 | |
---|
| 203 | /******************************************************** |
---|
| 204 | * Simulation - Begin |
---|
| 205 | ********************************************************/ |
---|
| 206 | |
---|
| 207 | // Initialisation |
---|
| 208 | |
---|
| 209 | const uint32_t seed = 0; |
---|
| 210 | //const uint32_t seed = static_cast<uint32_t>(time(NULL)); |
---|
| 211 | |
---|
| 212 | srand(seed); |
---|
| 213 | |
---|
| 214 | SC_START(0); |
---|
| 215 | LABEL("Initialisation"); |
---|
| 216 | |
---|
| 217 | LABEL("Reset"); |
---|
| 218 | in_NRESET->write(0); |
---|
| 219 | SC_START(5); |
---|
| 220 | in_NRESET->write(1); |
---|
| 221 | |
---|
| 222 | LABEL("Loop of Test"); |
---|
| 223 | |
---|
| 224 | for (uint32_t iteration=0; iteration<NB_ITERATION; iteration ++) |
---|
| 225 | { |
---|
| 226 | LABEL("Iteration %d",iteration); |
---|
| 227 | |
---|
| 228 | SC_START(1); |
---|
| 229 | } |
---|
| 230 | |
---|
| 231 | /******************************************************** |
---|
| 232 | * Simulation - End |
---|
| 233 | ********************************************************/ |
---|
| 234 | |
---|
| 235 | TEST_OK ("End of Simulation"); |
---|
| 236 | delete _time; |
---|
| 237 | |
---|
| 238 | msg(_("<%s> : ............ Stop Simulation\n"),name.c_str()); |
---|
| 239 | |
---|
| 240 | delete in_CLOCK; |
---|
| 241 | delete in_NRESET; |
---|
| 242 | |
---|
| 243 | DELETE2_SC_SIGNAL( in_IFETCH_VAL ,_param->_nb_context, _param->_nb_inst_fetch[alloc_signal_it1]); |
---|
| 244 | DELETE2_SC_SIGNAL(out_IFETCH_ACK ,_param->_nb_context, _param->_nb_inst_fetch[alloc_signal_it1]); |
---|
| 245 | DELETE2_SC_SIGNAL( in_IFETCH_INSTRUCTION ,_param->_nb_context, _param->_nb_inst_fetch[alloc_signal_it1]); |
---|
| 246 | DELETE1_SC_SIGNAL(in_IFETCH_CONTEXT_ID ,_param->_nb_context); |
---|
| 247 | DELETE1_SC_SIGNAL(in_IFETCH_ADDRESS ,_param->_nb_context); |
---|
| 248 | //DELETE1_SC_SIGNAL(in_IFETCH_ADDRESS_NEXT ,_param->_nb_context); |
---|
| 249 | DELETE1_SC_SIGNAL(in_IFETCH_INST_IFETCH_PTR ,_param->_nb_context); |
---|
| 250 | DELETE1_SC_SIGNAL(in_IFETCH_BRANCH_STATE ,_param->_nb_context); |
---|
| 251 | DELETE1_SC_SIGNAL(in_IFETCH_BRANCH_UPDATE_PREDICTION_ID ,_param->_nb_context); |
---|
| 252 | |
---|
| 253 | DELETE1_SC_SIGNAL(out_DECOD_VAL ,_param->_nb_inst_decod); |
---|
| 254 | DELETE1_SC_SIGNAL( in_DECOD_ACK ,_param->_nb_inst_decod); |
---|
| 255 | DELETE1_SC_SIGNAL(out_DECOD_CONTEXT_ID ,_param->_nb_inst_decod); |
---|
| 256 | DELETE1_SC_SIGNAL(out_DECOD_DEPTH ,_param->_nb_inst_decod); |
---|
| 257 | DELETE1_SC_SIGNAL(out_DECOD_TYPE ,_param->_nb_inst_decod); |
---|
| 258 | DELETE1_SC_SIGNAL(out_DECOD_OPERATION ,_param->_nb_inst_decod); |
---|
| 259 | DELETE1_SC_SIGNAL(out_DECOD_IS_DELAY_SLOT ,_param->_nb_inst_decod); |
---|
| 260 | DELETE1_SC_SIGNAL(out_DECOD_ADDRESS ,_param->_nb_inst_decod); |
---|
| 261 | DELETE1_SC_SIGNAL(out_DECOD_HAS_IMMEDIAT ,_param->_nb_inst_decod); |
---|
| 262 | DELETE1_SC_SIGNAL(out_DECOD_IMMEDIAT ,_param->_nb_inst_decod); |
---|
| 263 | DELETE1_SC_SIGNAL(out_DECOD_READ_RA ,_param->_nb_inst_decod); |
---|
| 264 | DELETE1_SC_SIGNAL(out_DECOD_NUM_REG_RA ,_param->_nb_inst_decod); |
---|
| 265 | DELETE1_SC_SIGNAL(out_DECOD_READ_RB ,_param->_nb_inst_decod); |
---|
| 266 | DELETE1_SC_SIGNAL(out_DECOD_NUM_REG_RB ,_param->_nb_inst_decod); |
---|
| 267 | DELETE1_SC_SIGNAL(out_DECOD_READ_RC ,_param->_nb_inst_decod); |
---|
| 268 | DELETE1_SC_SIGNAL(out_DECOD_NUM_REG_RC ,_param->_nb_inst_decod); |
---|
| 269 | DELETE1_SC_SIGNAL(out_DECOD_WRITE_RD ,_param->_nb_inst_decod); |
---|
| 270 | DELETE1_SC_SIGNAL(out_DECOD_NUM_REG_RD ,_param->_nb_inst_decod); |
---|
| 271 | DELETE1_SC_SIGNAL(out_DECOD_WRITE_RE ,_param->_nb_inst_decod); |
---|
| 272 | DELETE1_SC_SIGNAL(out_DECOD_NUM_REG_RE ,_param->_nb_inst_decod); |
---|
| 273 | DELETE1_SC_SIGNAL(out_DECOD_EXCEPTION_USE ,_param->_nb_inst_decod); |
---|
| 274 | |
---|
| 275 | DELETE1_SC_SIGNAL(out_PREDICT_VAL ,_param->_nb_inst_decod); |
---|
| 276 | DELETE1_SC_SIGNAL( in_PREDICT_ACK ,_param->_nb_inst_decod); |
---|
| 277 | DELETE1_SC_SIGNAL(out_PREDICT_CONTEXT_ID ,_param->_nb_inst_decod); |
---|
| 278 | DELETE1_SC_SIGNAL(out_PREDICT_MATCH_INST_IFETCH_PTR ,_param->_nb_inst_decod); |
---|
| 279 | DELETE1_SC_SIGNAL(out_PREDICT_BRANCH_STATE ,_param->_nb_inst_decod); |
---|
| 280 | DELETE1_SC_SIGNAL(out_PREDICT_BRANCH_UPDATE_PREDICTION_ID,_param->_nb_inst_decod); |
---|
| 281 | DELETE1_SC_SIGNAL(out_PREDICT_BRANCH_CONDITION ,_param->_nb_inst_decod); |
---|
| 282 | //DELETE1_SC_SIGNAL(out_PREDICT_BRANCH_STACK_WRITE ,_param->_nb_inst_decod); |
---|
| 283 | DELETE1_SC_SIGNAL(out_PREDICT_BRANCH_DIRECTION ,_param->_nb_inst_decod); |
---|
| 284 | DELETE1_SC_SIGNAL(out_PREDICT_ADDRESS_SRC ,_param->_nb_inst_decod); |
---|
| 285 | DELETE1_SC_SIGNAL(out_PREDICT_ADDRESS_DEST ,_param->_nb_inst_decod); |
---|
| 286 | //DELETE1_SC_SIGNAL( in_PREDICT_CAN_CONTINUE ,_param->_nb_inst_decod); |
---|
| 287 | |
---|
| 288 | DELETE1_SC_SIGNAL( in_DEPTH_TAIL ,_param->_nb_context); |
---|
| 289 | DELETE1_SC_SIGNAL( in_DEPTH_NB_BRANCH ,_param->_nb_context); |
---|
| 290 | |
---|
| 291 | DELETE1_SC_SIGNAL(out_NB_INST_DECOD_ALL ,_param->_nb_context); |
---|
| 292 | |
---|
| 293 | DELETE1_SC_SIGNAL( in_CONTEXT_DECOD_ENABLE ,_param->_nb_context); |
---|
| 294 | DELETE1_SC_SIGNAL( in_CONTEXT_DEPTH ,_param->_nb_context); |
---|
| 295 | |
---|
| 296 | DELETE_SC_SIGNAL( out_CONTEXT_EVENT_VAL ); |
---|
| 297 | DELETE_SC_SIGNAL( in_CONTEXT_EVENT_ACK ); |
---|
| 298 | DELETE_SC_SIGNAL( out_CONTEXT_EVENT_CONTEXT_ID ); |
---|
| 299 | DELETE_SC_SIGNAL( out_CONTEXT_EVENT_TYPE ); |
---|
| 300 | DELETE_SC_SIGNAL( out_CONTEXT_EVENT_IS_DELAY_SLOT ); |
---|
| 301 | DELETE_SC_SIGNAL( out_CONTEXT_EVENT_ADDRESS ); |
---|
| 302 | DELETE_SC_SIGNAL( out_CONTEXT_EVENT_ADDRESS_EPCR ); |
---|
| 303 | |
---|
| 304 | } |
---|
| 305 | #endif |
---|
| 306 | |
---|
| 307 | delete _Decod_unit; |
---|
| 308 | #ifdef STATISTICS |
---|
| 309 | delete _parameters_statistics; |
---|
| 310 | #endif |
---|
| 311 | } |
---|