[82] | 1 | /* |
---|
| 2 | * $Id: test.cpp 113 2009-04-14 18:39:12Z rosiere $ |
---|
| 3 | * |
---|
| 4 | * [ Description ] |
---|
| 5 | * |
---|
| 6 | * Test |
---|
| 7 | */ |
---|
| 8 | |
---|
[111] | 9 | #define NB_ITERATION 512 |
---|
[82] | 10 | #define CYCLE_MAX (128*NB_ITERATION) |
---|
| 11 | |
---|
| 12 | #include "Behavioural/Core/Multi_Front_end/Front_end/Decod_unit/Decod_queue/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::decod_queue::Parameters * _param) |
---|
| 18 | { |
---|
| 19 | msg(_("<%s> : Simulation SystemC.\n"),name.c_str()); |
---|
| 20 | |
---|
| 21 | #ifdef STATISTICS |
---|
[111] | 22 | morpheo::behavioural::Parameters_Statistics * _parameters_statistics = new morpheo::behavioural::Parameters_Statistics (5,CYCLE_MAX); |
---|
[82] | 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_queue * _Decod_queue = new Decod_queue |
---|
| 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 | |
---|
[113] | 54 | sc_signal<Tcontrol_t > ** in_DECOD_IN_VAL ;//[nb_inst_decod] |
---|
| 55 | sc_signal<Tcontrol_t > ** out_DECOD_IN_ACK ;//[nb_inst_decod] |
---|
| 56 | sc_signal<Tcontext_t > ** in_DECOD_IN_CONTEXT_ID ;//[nb_inst_decod] |
---|
| 57 | sc_signal<Tdepth_t > ** in_DECOD_IN_DEPTH ;//[nb_inst_decod] |
---|
| 58 | sc_signal<Ttype_t > ** in_DECOD_IN_TYPE ;//[nb_inst_decod] |
---|
| 59 | sc_signal<Toperation_t > ** in_DECOD_IN_OPERATION ;//[nb_inst_decod] |
---|
| 60 | sc_signal<Tcontrol_t > ** in_DECOD_IN_NO_EXECUTE ;//[nb_inst_decod] |
---|
| 61 | sc_signal<Tcontrol_t > ** in_DECOD_IN_IS_DELAY_SLOT ;//[nb_inst_decod] |
---|
| 62 | sc_signal<Tgeneral_data_t > ** in_DECOD_IN_ADDRESS ;//[nb_inst_decod] |
---|
| 63 | sc_signal<Tgeneral_data_t > ** in_DECOD_IN_ADDRESS_NEXT ;//[nb_inst_decod] |
---|
| 64 | sc_signal<Tcontrol_t > ** in_DECOD_IN_HAS_IMMEDIAT ;//[nb_inst_decod] |
---|
| 65 | sc_signal<Tgeneral_data_t > ** in_DECOD_IN_IMMEDIAT ;//[nb_inst_decod] |
---|
| 66 | sc_signal<Tcontrol_t > ** in_DECOD_IN_READ_RA ;//[nb_inst_decod] |
---|
| 67 | sc_signal<Tgeneral_address_t > ** in_DECOD_IN_NUM_REG_RA ;//[nb_inst_decod] |
---|
| 68 | sc_signal<Tcontrol_t > ** in_DECOD_IN_READ_RB ;//[nb_inst_decod] |
---|
| 69 | sc_signal<Tgeneral_address_t > ** in_DECOD_IN_NUM_REG_RB ;//[nb_inst_decod] |
---|
| 70 | sc_signal<Tcontrol_t > ** in_DECOD_IN_READ_RC ;//[nb_inst_decod] |
---|
| 71 | sc_signal<Tspecial_address_t > ** in_DECOD_IN_NUM_REG_RC ;//[nb_inst_decod] |
---|
| 72 | sc_signal<Tcontrol_t > ** in_DECOD_IN_WRITE_RD ;//[nb_inst_decod] |
---|
| 73 | sc_signal<Tgeneral_address_t > ** in_DECOD_IN_NUM_REG_RD ;//[nb_inst_decod] |
---|
| 74 | sc_signal<Tcontrol_t > ** in_DECOD_IN_WRITE_RE ;//[nb_inst_decod] |
---|
| 75 | sc_signal<Tspecial_address_t > ** in_DECOD_IN_NUM_REG_RE ;//[nb_inst_decod] |
---|
| 76 | sc_signal<Texception_t > ** in_DECOD_IN_EXCEPTION_USE ;//[nb_inst_decod] |
---|
| 77 | sc_signal<Texception_t > ** in_DECOD_IN_EXCEPTION ;//[nb_inst_decod] |
---|
| 78 | sc_signal<Tcontrol_t > ** out_DECOD_OUT_VAL ;//[nb_inst_decod] |
---|
| 79 | sc_signal<Tcontrol_t > ** in_DECOD_OUT_ACK ;//[nb_inst_decod] |
---|
| 80 | sc_signal<Tcontext_t > ** out_DECOD_OUT_CONTEXT_ID ;//[nb_inst_decod] |
---|
| 81 | sc_signal<Tdepth_t > ** out_DECOD_OUT_DEPTH ;//[nb_inst_decod] |
---|
| 82 | sc_signal<Ttype_t > ** out_DECOD_OUT_TYPE ;//[nb_inst_decod] |
---|
| 83 | sc_signal<Toperation_t > ** out_DECOD_OUT_OPERATION ;//[nb_inst_decod] |
---|
| 84 | sc_signal<Tcontrol_t > ** out_DECOD_OUT_NO_EXECUTE ;//[nb_inst_decod] |
---|
| 85 | sc_signal<Tcontrol_t > ** out_DECOD_OUT_IS_DELAY_SLOT ;//[nb_inst_decod] |
---|
| 86 | sc_signal<Tgeneral_data_t > ** out_DECOD_OUT_ADDRESS ;//[nb_inst_decod] |
---|
| 87 | sc_signal<Tgeneral_data_t > ** out_DECOD_OUT_ADDRESS_NEXT ;//[nb_inst_decod] |
---|
| 88 | sc_signal<Tcontrol_t > ** out_DECOD_OUT_HAS_IMMEDIAT ;//[nb_inst_decod] |
---|
| 89 | sc_signal<Tgeneral_data_t > ** out_DECOD_OUT_IMMEDIAT ;//[nb_inst_decod] |
---|
| 90 | sc_signal<Tcontrol_t > ** out_DECOD_OUT_READ_RA ;//[nb_inst_decod] |
---|
| 91 | sc_signal<Tgeneral_address_t > ** out_DECOD_OUT_NUM_REG_RA ;//[nb_inst_decod] |
---|
| 92 | sc_signal<Tcontrol_t > ** out_DECOD_OUT_READ_RB ;//[nb_inst_decod] |
---|
| 93 | sc_signal<Tgeneral_address_t > ** out_DECOD_OUT_NUM_REG_RB ;//[nb_inst_decod] |
---|
| 94 | sc_signal<Tcontrol_t > ** out_DECOD_OUT_READ_RC ;//[nb_inst_decod] |
---|
| 95 | sc_signal<Tspecial_address_t > ** out_DECOD_OUT_NUM_REG_RC ;//[nb_inst_decod] |
---|
| 96 | sc_signal<Tcontrol_t > ** out_DECOD_OUT_WRITE_RD ;//[nb_inst_decod] |
---|
| 97 | sc_signal<Tgeneral_address_t > ** out_DECOD_OUT_NUM_REG_RD ;//[nb_inst_decod] |
---|
| 98 | sc_signal<Tcontrol_t > ** out_DECOD_OUT_WRITE_RE ;//[nb_inst_decod] |
---|
| 99 | sc_signal<Tspecial_address_t > ** out_DECOD_OUT_NUM_REG_RE ;//[nb_inst_decod] |
---|
| 100 | sc_signal<Texception_t > ** out_DECOD_OUT_EXCEPTION_USE ;//[nb_inst_decod] |
---|
| 101 | sc_signal<Texception_t > ** out_DECOD_OUT_EXCEPTION ;//[nb_inst_decod] |
---|
| 102 | sc_signal<Tdepth_t > ** in_DEPTH_MIN ;//[nb_context] |
---|
| 103 | sc_signal<Tdepth_t > ** in_DEPTH_MAX ;//[nb_context] |
---|
| 104 | sc_signal<Tcontrol_t > ** in_DEPTH_FULL ;//[nb_context] |
---|
| 105 | sc_signal<Tcounter_t > ** out_NB_INST_ALL ;//[nb_context] |
---|
| 106 | |
---|
[82] | 107 | ALLOC1_SC_SIGNAL( in_DECOD_IN_VAL ," in_DECOD_IN_VAL ",Tcontrol_t ,_param->_nb_inst_decod); |
---|
| 108 | ALLOC1_SC_SIGNAL(out_DECOD_IN_ACK ,"out_DECOD_IN_ACK ",Tcontrol_t ,_param->_nb_inst_decod); |
---|
| 109 | ALLOC1_SC_SIGNAL( in_DECOD_IN_CONTEXT_ID ," in_DECOD_IN_CONTEXT_ID ",Tcontext_t ,_param->_nb_inst_decod); |
---|
| 110 | ALLOC1_SC_SIGNAL( in_DECOD_IN_DEPTH ," in_DECOD_IN_DEPTH ",Tdepth_t ,_param->_nb_inst_decod); |
---|
| 111 | ALLOC1_SC_SIGNAL( in_DECOD_IN_TYPE ," in_DECOD_IN_TYPE ",Ttype_t ,_param->_nb_inst_decod); |
---|
| 112 | ALLOC1_SC_SIGNAL( in_DECOD_IN_OPERATION ," in_DECOD_IN_OPERATION ",Toperation_t ,_param->_nb_inst_decod); |
---|
[88] | 113 | ALLOC1_SC_SIGNAL( in_DECOD_IN_NO_EXECUTE ," in_DECOD_IN_NO_EXECUTE ",Tcontrol_t ,_param->_nb_inst_decod); |
---|
[82] | 114 | ALLOC1_SC_SIGNAL( in_DECOD_IN_IS_DELAY_SLOT ," in_DECOD_IN_IS_DELAY_SLOT ",Tcontrol_t ,_param->_nb_inst_decod); |
---|
[108] | 115 | #ifdef DEBUG |
---|
| 116 | ALLOC1_SC_SIGNAL( in_DECOD_IN_ADDRESS ," in_DECOD_IN_ADDRESS ",Tgeneral_data_t ,_param->_nb_inst_decod); |
---|
| 117 | #endif |
---|
[105] | 118 | ALLOC1_SC_SIGNAL( in_DECOD_IN_ADDRESS_NEXT ," in_DECOD_IN_ADDRESS_NEXT ",Tgeneral_data_t ,_param->_nb_inst_decod); |
---|
[82] | 119 | ALLOC1_SC_SIGNAL( in_DECOD_IN_HAS_IMMEDIAT ," in_DECOD_IN_HAS_IMMEDIAT ",Tcontrol_t ,_param->_nb_inst_decod); |
---|
| 120 | ALLOC1_SC_SIGNAL( in_DECOD_IN_IMMEDIAT ," in_DECOD_IN_IMMEDIAT ",Tgeneral_data_t ,_param->_nb_inst_decod); |
---|
| 121 | ALLOC1_SC_SIGNAL( in_DECOD_IN_READ_RA ," in_DECOD_IN_READ_RA ",Tcontrol_t ,_param->_nb_inst_decod); |
---|
| 122 | ALLOC1_SC_SIGNAL( in_DECOD_IN_NUM_REG_RA ," in_DECOD_IN_NUM_REG_RA ",Tgeneral_address_t ,_param->_nb_inst_decod); |
---|
| 123 | ALLOC1_SC_SIGNAL( in_DECOD_IN_READ_RB ," in_DECOD_IN_READ_RB ",Tcontrol_t ,_param->_nb_inst_decod); |
---|
| 124 | ALLOC1_SC_SIGNAL( in_DECOD_IN_NUM_REG_RB ," in_DECOD_IN_NUM_REG_RB ",Tgeneral_address_t ,_param->_nb_inst_decod); |
---|
| 125 | ALLOC1_SC_SIGNAL( in_DECOD_IN_READ_RC ," in_DECOD_IN_READ_RC ",Tcontrol_t ,_param->_nb_inst_decod); |
---|
| 126 | ALLOC1_SC_SIGNAL( in_DECOD_IN_NUM_REG_RC ," in_DECOD_IN_NUM_REG_RC ",Tspecial_address_t ,_param->_nb_inst_decod); |
---|
| 127 | ALLOC1_SC_SIGNAL( in_DECOD_IN_WRITE_RD ," in_DECOD_IN_WRITE_RD ",Tcontrol_t ,_param->_nb_inst_decod); |
---|
| 128 | ALLOC1_SC_SIGNAL( in_DECOD_IN_NUM_REG_RD ," in_DECOD_IN_NUM_REG_RD ",Tgeneral_address_t ,_param->_nb_inst_decod); |
---|
| 129 | ALLOC1_SC_SIGNAL( in_DECOD_IN_WRITE_RE ," in_DECOD_IN_WRITE_RE ",Tcontrol_t ,_param->_nb_inst_decod); |
---|
| 130 | ALLOC1_SC_SIGNAL( in_DECOD_IN_NUM_REG_RE ," in_DECOD_IN_NUM_REG_RE ",Tspecial_address_t ,_param->_nb_inst_decod); |
---|
| 131 | ALLOC1_SC_SIGNAL( in_DECOD_IN_EXCEPTION_USE ," in_DECOD_IN_EXCEPTION_USE ",Texception_t ,_param->_nb_inst_decod); |
---|
[88] | 132 | ALLOC1_SC_SIGNAL( in_DECOD_IN_EXCEPTION ," in_DECOD_IN_EXCEPTION ",Texception_t ,_param->_nb_inst_decod); |
---|
[82] | 133 | |
---|
| 134 | ALLOC1_SC_SIGNAL(out_DECOD_OUT_VAL ,"out_DECOD_OUT_VAL ",Tcontrol_t ,_param->_nb_inst_decod); |
---|
| 135 | ALLOC1_SC_SIGNAL( in_DECOD_OUT_ACK ," in_DECOD_OUT_ACK ",Tcontrol_t ,_param->_nb_inst_decod); |
---|
| 136 | ALLOC1_SC_SIGNAL(out_DECOD_OUT_CONTEXT_ID ,"out_DECOD_OUT_CONTEXT_ID ",Tcontext_t ,_param->_nb_inst_decod); |
---|
| 137 | ALLOC1_SC_SIGNAL(out_DECOD_OUT_DEPTH ,"out_DECOD_OUT_DEPTH ",Tdepth_t ,_param->_nb_inst_decod); |
---|
| 138 | ALLOC1_SC_SIGNAL(out_DECOD_OUT_TYPE ,"out_DECOD_OUT_TYPE ",Ttype_t ,_param->_nb_inst_decod); |
---|
| 139 | ALLOC1_SC_SIGNAL(out_DECOD_OUT_OPERATION ,"out_DECOD_OUT_OPERATION ",Toperation_t ,_param->_nb_inst_decod); |
---|
[88] | 140 | ALLOC1_SC_SIGNAL(out_DECOD_OUT_NO_EXECUTE ,"out_DECOD_OUT_NO_EXECUTE ",Tcontrol_t ,_param->_nb_inst_decod); |
---|
[82] | 141 | ALLOC1_SC_SIGNAL(out_DECOD_OUT_IS_DELAY_SLOT ,"out_DECOD_OUT_IS_DELAY_SLOT",Tcontrol_t ,_param->_nb_inst_decod); |
---|
[108] | 142 | #ifdef DEBUG |
---|
| 143 | ALLOC1_SC_SIGNAL(out_DECOD_OUT_ADDRESS ,"out_DECOD_OUT_ADDRESS ",Tgeneral_data_t ,_param->_nb_inst_decod); |
---|
| 144 | #endif |
---|
[105] | 145 | ALLOC1_SC_SIGNAL(out_DECOD_OUT_ADDRESS_NEXT ,"out_DECOD_OUT_ADDRESS_NEXT ",Tgeneral_data_t ,_param->_nb_inst_decod); |
---|
[82] | 146 | ALLOC1_SC_SIGNAL(out_DECOD_OUT_HAS_IMMEDIAT ,"out_DECOD_OUT_HAS_IMMEDIAT ",Tcontrol_t ,_param->_nb_inst_decod); |
---|
| 147 | ALLOC1_SC_SIGNAL(out_DECOD_OUT_IMMEDIAT ,"out_DECOD_OUT_IMMEDIAT ",Tgeneral_data_t ,_param->_nb_inst_decod); |
---|
| 148 | ALLOC1_SC_SIGNAL(out_DECOD_OUT_READ_RA ,"out_DECOD_OUT_READ_RA ",Tcontrol_t ,_param->_nb_inst_decod); |
---|
| 149 | ALLOC1_SC_SIGNAL(out_DECOD_OUT_NUM_REG_RA ,"out_DECOD_OUT_NUM_REG_RA ",Tgeneral_address_t ,_param->_nb_inst_decod); |
---|
| 150 | ALLOC1_SC_SIGNAL(out_DECOD_OUT_READ_RB ,"out_DECOD_OUT_READ_RB ",Tcontrol_t ,_param->_nb_inst_decod); |
---|
| 151 | ALLOC1_SC_SIGNAL(out_DECOD_OUT_NUM_REG_RB ,"out_DECOD_OUT_NUM_REG_RB ",Tgeneral_address_t ,_param->_nb_inst_decod); |
---|
| 152 | ALLOC1_SC_SIGNAL(out_DECOD_OUT_READ_RC ,"out_DECOD_OUT_READ_RC ",Tcontrol_t ,_param->_nb_inst_decod); |
---|
| 153 | ALLOC1_SC_SIGNAL(out_DECOD_OUT_NUM_REG_RC ,"out_DECOD_OUT_NUM_REG_RC ",Tspecial_address_t ,_param->_nb_inst_decod); |
---|
| 154 | ALLOC1_SC_SIGNAL(out_DECOD_OUT_WRITE_RD ,"out_DECOD_OUT_WRITE_RD ",Tcontrol_t ,_param->_nb_inst_decod); |
---|
| 155 | ALLOC1_SC_SIGNAL(out_DECOD_OUT_NUM_REG_RD ,"out_DECOD_OUT_NUM_REG_RD ",Tgeneral_address_t ,_param->_nb_inst_decod); |
---|
| 156 | ALLOC1_SC_SIGNAL(out_DECOD_OUT_WRITE_RE ,"out_DECOD_OUT_WRITE_RE ",Tcontrol_t ,_param->_nb_inst_decod); |
---|
| 157 | ALLOC1_SC_SIGNAL(out_DECOD_OUT_NUM_REG_RE ,"out_DECOD_OUT_NUM_REG_RE ",Tspecial_address_t ,_param->_nb_inst_decod); |
---|
| 158 | ALLOC1_SC_SIGNAL(out_DECOD_OUT_EXCEPTION_USE ,"out_DECOD_OUT_EXCEPTION_USE",Texception_t ,_param->_nb_inst_decod); |
---|
[88] | 159 | ALLOC1_SC_SIGNAL(out_DECOD_OUT_EXCEPTION ,"out_DECOD_OUT_EXCEPTION ",Texception_t ,_param->_nb_inst_decod); |
---|
[82] | 160 | |
---|
[88] | 161 | ALLOC1_SC_SIGNAL( in_DEPTH_MIN ," in_DEPTH_MIN ",Tdepth_t ,_param->_nb_context); |
---|
| 162 | ALLOC1_SC_SIGNAL( in_DEPTH_MAX ," in_DEPTH_MAX ",Tdepth_t ,_param->_nb_context); |
---|
[101] | 163 | ALLOC1_SC_SIGNAL( in_DEPTH_FULL ," in_DEPTH_FULL ",Tcontrol_t ,_param->_nb_context); |
---|
[82] | 164 | |
---|
| 165 | ALLOC1_SC_SIGNAL(out_NB_INST_ALL ,"out_NB_INST_ALL ",Tcounter_t ,_param->_nb_context); |
---|
| 166 | |
---|
| 167 | /******************************************************** |
---|
| 168 | * Instanciation |
---|
| 169 | ********************************************************/ |
---|
| 170 | |
---|
| 171 | msg(_("<%s> : Instanciation of _Decod_queue.\n"),name.c_str()); |
---|
| 172 | |
---|
| 173 | (*(_Decod_queue->in_CLOCK)) (*(in_CLOCK)); |
---|
| 174 | (*(_Decod_queue->in_NRESET)) (*(in_NRESET)); |
---|
| 175 | |
---|
| 176 | INSTANCE1_SC_SIGNAL(_Decod_queue, in_DECOD_IN_VAL ,_param->_nb_inst_decod); |
---|
| 177 | INSTANCE1_SC_SIGNAL(_Decod_queue,out_DECOD_IN_ACK ,_param->_nb_inst_decod); |
---|
| 178 | if (_param->_have_port_context_id) |
---|
| 179 | INSTANCE1_SC_SIGNAL(_Decod_queue, in_DECOD_IN_CONTEXT_ID ,_param->_nb_inst_decod); |
---|
| 180 | if (_param->_have_port_depth) |
---|
| 181 | INSTANCE1_SC_SIGNAL(_Decod_queue, in_DECOD_IN_DEPTH ,_param->_nb_inst_decod); |
---|
| 182 | INSTANCE1_SC_SIGNAL(_Decod_queue, in_DECOD_IN_TYPE ,_param->_nb_inst_decod); |
---|
| 183 | INSTANCE1_SC_SIGNAL(_Decod_queue, in_DECOD_IN_OPERATION ,_param->_nb_inst_decod); |
---|
[88] | 184 | INSTANCE1_SC_SIGNAL(_Decod_queue, in_DECOD_IN_NO_EXECUTE ,_param->_nb_inst_decod); |
---|
[82] | 185 | INSTANCE1_SC_SIGNAL(_Decod_queue, in_DECOD_IN_IS_DELAY_SLOT ,_param->_nb_inst_decod); |
---|
[108] | 186 | #ifdef DEBUG |
---|
| 187 | INSTANCE1_SC_SIGNAL(_Decod_queue, in_DECOD_IN_ADDRESS ,_param->_nb_inst_decod); |
---|
| 188 | #endif |
---|
[105] | 189 | INSTANCE1_SC_SIGNAL(_Decod_queue, in_DECOD_IN_ADDRESS_NEXT ,_param->_nb_inst_decod); |
---|
[82] | 190 | INSTANCE1_SC_SIGNAL(_Decod_queue, in_DECOD_IN_HAS_IMMEDIAT ,_param->_nb_inst_decod); |
---|
| 191 | INSTANCE1_SC_SIGNAL(_Decod_queue, in_DECOD_IN_IMMEDIAT ,_param->_nb_inst_decod); |
---|
| 192 | INSTANCE1_SC_SIGNAL(_Decod_queue, in_DECOD_IN_READ_RA ,_param->_nb_inst_decod); |
---|
| 193 | INSTANCE1_SC_SIGNAL(_Decod_queue, in_DECOD_IN_NUM_REG_RA ,_param->_nb_inst_decod); |
---|
| 194 | INSTANCE1_SC_SIGNAL(_Decod_queue, in_DECOD_IN_READ_RB ,_param->_nb_inst_decod); |
---|
| 195 | INSTANCE1_SC_SIGNAL(_Decod_queue, in_DECOD_IN_NUM_REG_RB ,_param->_nb_inst_decod); |
---|
| 196 | INSTANCE1_SC_SIGNAL(_Decod_queue, in_DECOD_IN_READ_RC ,_param->_nb_inst_decod); |
---|
| 197 | INSTANCE1_SC_SIGNAL(_Decod_queue, in_DECOD_IN_NUM_REG_RC ,_param->_nb_inst_decod); |
---|
| 198 | INSTANCE1_SC_SIGNAL(_Decod_queue, in_DECOD_IN_WRITE_RD ,_param->_nb_inst_decod); |
---|
| 199 | INSTANCE1_SC_SIGNAL(_Decod_queue, in_DECOD_IN_NUM_REG_RD ,_param->_nb_inst_decod); |
---|
| 200 | INSTANCE1_SC_SIGNAL(_Decod_queue, in_DECOD_IN_WRITE_RE ,_param->_nb_inst_decod); |
---|
| 201 | INSTANCE1_SC_SIGNAL(_Decod_queue, in_DECOD_IN_NUM_REG_RE ,_param->_nb_inst_decod); |
---|
| 202 | INSTANCE1_SC_SIGNAL(_Decod_queue, in_DECOD_IN_EXCEPTION_USE ,_param->_nb_inst_decod); |
---|
[88] | 203 | INSTANCE1_SC_SIGNAL(_Decod_queue, in_DECOD_IN_EXCEPTION ,_param->_nb_inst_decod); |
---|
| 204 | |
---|
[82] | 205 | INSTANCE1_SC_SIGNAL(_Decod_queue,out_DECOD_OUT_VAL ,_param->_nb_inst_decod); |
---|
| 206 | INSTANCE1_SC_SIGNAL(_Decod_queue, in_DECOD_OUT_ACK ,_param->_nb_inst_decod); |
---|
| 207 | if (_param->_have_port_context_id) |
---|
| 208 | INSTANCE1_SC_SIGNAL(_Decod_queue,out_DECOD_OUT_CONTEXT_ID ,_param->_nb_inst_decod); |
---|
| 209 | if (_param->_have_port_depth) |
---|
| 210 | INSTANCE1_SC_SIGNAL(_Decod_queue,out_DECOD_OUT_DEPTH ,_param->_nb_inst_decod); |
---|
| 211 | INSTANCE1_SC_SIGNAL(_Decod_queue,out_DECOD_OUT_TYPE ,_param->_nb_inst_decod); |
---|
| 212 | INSTANCE1_SC_SIGNAL(_Decod_queue,out_DECOD_OUT_OPERATION ,_param->_nb_inst_decod); |
---|
[88] | 213 | INSTANCE1_SC_SIGNAL(_Decod_queue,out_DECOD_OUT_NO_EXECUTE ,_param->_nb_inst_decod); |
---|
[82] | 214 | INSTANCE1_SC_SIGNAL(_Decod_queue,out_DECOD_OUT_IS_DELAY_SLOT ,_param->_nb_inst_decod); |
---|
[108] | 215 | #ifdef DEBUG |
---|
| 216 | INSTANCE1_SC_SIGNAL(_Decod_queue,out_DECOD_OUT_ADDRESS ,_param->_nb_inst_decod); |
---|
| 217 | #endif |
---|
[105] | 218 | INSTANCE1_SC_SIGNAL(_Decod_queue,out_DECOD_OUT_ADDRESS_NEXT ,_param->_nb_inst_decod); |
---|
[82] | 219 | INSTANCE1_SC_SIGNAL(_Decod_queue,out_DECOD_OUT_HAS_IMMEDIAT ,_param->_nb_inst_decod); |
---|
| 220 | INSTANCE1_SC_SIGNAL(_Decod_queue,out_DECOD_OUT_IMMEDIAT ,_param->_nb_inst_decod); |
---|
| 221 | INSTANCE1_SC_SIGNAL(_Decod_queue,out_DECOD_OUT_READ_RA ,_param->_nb_inst_decod); |
---|
| 222 | INSTANCE1_SC_SIGNAL(_Decod_queue,out_DECOD_OUT_NUM_REG_RA ,_param->_nb_inst_decod); |
---|
| 223 | INSTANCE1_SC_SIGNAL(_Decod_queue,out_DECOD_OUT_READ_RB ,_param->_nb_inst_decod); |
---|
| 224 | INSTANCE1_SC_SIGNAL(_Decod_queue,out_DECOD_OUT_NUM_REG_RB ,_param->_nb_inst_decod); |
---|
| 225 | INSTANCE1_SC_SIGNAL(_Decod_queue,out_DECOD_OUT_READ_RC ,_param->_nb_inst_decod); |
---|
| 226 | INSTANCE1_SC_SIGNAL(_Decod_queue,out_DECOD_OUT_NUM_REG_RC ,_param->_nb_inst_decod); |
---|
| 227 | INSTANCE1_SC_SIGNAL(_Decod_queue,out_DECOD_OUT_WRITE_RD ,_param->_nb_inst_decod); |
---|
| 228 | INSTANCE1_SC_SIGNAL(_Decod_queue,out_DECOD_OUT_NUM_REG_RD ,_param->_nb_inst_decod); |
---|
| 229 | INSTANCE1_SC_SIGNAL(_Decod_queue,out_DECOD_OUT_WRITE_RE ,_param->_nb_inst_decod); |
---|
| 230 | INSTANCE1_SC_SIGNAL(_Decod_queue,out_DECOD_OUT_NUM_REG_RE ,_param->_nb_inst_decod); |
---|
| 231 | INSTANCE1_SC_SIGNAL(_Decod_queue,out_DECOD_OUT_EXCEPTION_USE ,_param->_nb_inst_decod); |
---|
[88] | 232 | INSTANCE1_SC_SIGNAL(_Decod_queue,out_DECOD_OUT_EXCEPTION ,_param->_nb_inst_decod); |
---|
| 233 | |
---|
[101] | 234 | if (_param->_have_port_depth) |
---|
| 235 | { |
---|
| 236 | INSTANCE1_SC_SIGNAL(_Decod_queue, in_DEPTH_MIN ,_param->_nb_context); |
---|
[88] | 237 | INSTANCE1_SC_SIGNAL(_Decod_queue, in_DEPTH_MAX ,_param->_nb_context); |
---|
[101] | 238 | } |
---|
| 239 | INSTANCE1_SC_SIGNAL(_Decod_queue, in_DEPTH_FULL ,_param->_nb_context); |
---|
[82] | 240 | INSTANCE1_SC_SIGNAL(_Decod_queue,out_NB_INST_ALL ,_param->_nb_context); |
---|
| 241 | msg(_("<%s> : Start Simulation ............\n"),name.c_str()); |
---|
| 242 | |
---|
| 243 | Time * _time = new Time(); |
---|
| 244 | |
---|
| 245 | /******************************************************** |
---|
| 246 | * Simulation - Begin |
---|
| 247 | ********************************************************/ |
---|
| 248 | |
---|
| 249 | // Initialisation |
---|
| 250 | |
---|
| 251 | const uint32_t seed = 0; |
---|
| 252 | //const uint32_t seed = static_cast<uint32_t>(time(NULL)); |
---|
| 253 | |
---|
| 254 | srand(seed); |
---|
| 255 | |
---|
| 256 | SC_START(0); |
---|
| 257 | LABEL("Initialisation"); |
---|
| 258 | |
---|
| 259 | LABEL("Reset"); |
---|
| 260 | in_NRESET->write(0); |
---|
| 261 | SC_START(5); |
---|
| 262 | in_NRESET->write(1); |
---|
| 263 | |
---|
| 264 | LABEL("Loop of Test"); |
---|
| 265 | |
---|
| 266 | Tcounter_t nb_inst [_param->_nb_context]; |
---|
| 267 | Tdepth_t depth [_param->_nb_context]; |
---|
| 268 | Taddress_t address_src [_param->_nb_context]; |
---|
| 269 | Taddress_t address_dest [_param->_nb_context]; |
---|
| 270 | |
---|
| 271 | for (uint32_t i=0; i<_param->_nb_context; i++) |
---|
| 272 | { |
---|
| 273 | nb_inst [i] = 0; |
---|
| 274 | depth [i] = 0; |
---|
| 275 | address_src [i] = 0; |
---|
| 276 | address_dest [i] = 0; |
---|
| 277 | } |
---|
| 278 | |
---|
| 279 | for (uint32_t iteration=0; iteration<NB_ITERATION; iteration ++) |
---|
| 280 | { |
---|
| 281 | LABEL("Iteration %d",iteration); |
---|
| 282 | |
---|
| 283 | { |
---|
| 284 | Taddress_t address_tmp [_param->_nb_context]; |
---|
| 285 | |
---|
| 286 | for (uint32_t i=0; i<_param->_nb_context; i++) |
---|
| 287 | address_tmp [i] = address_src [i]; |
---|
| 288 | |
---|
[111] | 289 | uint32_t x = rand()%_param->_nb_inst_decod; |
---|
| 290 | |
---|
[82] | 291 | for (uint32_t i=0; i<_param->_nb_inst_decod; i++) |
---|
| 292 | { |
---|
| 293 | Tcontext_t context = rand()%_param->_nb_context; |
---|
| 294 | |
---|
[105] | 295 | in_DECOD_IN_VAL [i]->write(i<=x); |
---|
| 296 | in_DECOD_IN_CONTEXT_ID [i]->write(context); |
---|
| 297 | in_DECOD_IN_DEPTH [i]->write(depth [context]); |
---|
[111] | 298 | #ifdef DEBUG |
---|
| 299 | in_DECOD_IN_ADDRESS [i]->write(address_tmp [context]); |
---|
| 300 | #endif |
---|
[105] | 301 | in_DECOD_IN_ADDRESS_NEXT [i]->write(address_tmp [context]); |
---|
[82] | 302 | |
---|
| 303 | address_tmp [context] ++; |
---|
| 304 | } |
---|
| 305 | } |
---|
| 306 | |
---|
| 307 | { |
---|
| 308 | uint32_t x = rand()%_param->_nb_inst_decod; |
---|
[111] | 309 | |
---|
[82] | 310 | for (uint32_t i=0; i<_param->_nb_inst_decod; i++) |
---|
| 311 | { |
---|
| 312 | in_DECOD_OUT_ACK [i]->write(i<=x); |
---|
| 313 | } |
---|
| 314 | } |
---|
| 315 | |
---|
| 316 | SC_START(0); |
---|
| 317 | |
---|
| 318 | for (uint32_t i=0; i<_param->_nb_inst_decod; i++) |
---|
| 319 | { |
---|
| 320 | LABEL("DECOD_IN [%d] - %d %d",i,in_DECOD_IN_VAL [i]->read(),out_DECOD_IN_ACK [i]->read()); |
---|
| 321 | |
---|
| 322 | if (in_DECOD_IN_VAL [i]->read() and out_DECOD_IN_ACK [i]->read()) |
---|
| 323 | { |
---|
| 324 | LABEL("DECOD_IN [%d] - Transaction Accepted",i); |
---|
| 325 | Tcontext_t context = in_DECOD_IN_CONTEXT_ID [i]->read(); |
---|
| 326 | LABEL(" * context : %d",context); |
---|
| 327 | |
---|
| 328 | nb_inst [context] ++; |
---|
| 329 | address_src [context] ++; |
---|
[111] | 330 | |
---|
| 331 | LABEL(" * nb_inst : %d",nb_inst [context]); |
---|
[82] | 332 | } |
---|
| 333 | } |
---|
| 334 | |
---|
| 335 | for (uint32_t i=0; i<_param->_nb_inst_decod; i++) |
---|
| 336 | { |
---|
| 337 | LABEL("DECOD_OUT [%d] - %d %d",i,out_DECOD_OUT_VAL [i]->read(),in_DECOD_OUT_ACK [i]->read()); |
---|
| 338 | if (out_DECOD_OUT_VAL [i]->read() and in_DECOD_OUT_ACK [i]->read()) |
---|
| 339 | { |
---|
| 340 | LABEL("DECOD_OUT [%d] - Transaction Accepted",i); |
---|
| 341 | Tcontext_t context = out_DECOD_OUT_CONTEXT_ID [i]->read(); |
---|
| 342 | LABEL(" * context : %d",context); |
---|
| 343 | |
---|
[105] | 344 | TEST(Tdepth_t ,out_DECOD_OUT_DEPTH [i]->read(),depth [context]); |
---|
| 345 | TEST(Taddress_t,out_DECOD_OUT_ADDRESS_NEXT [i]->read(),address_dest [context]); |
---|
[111] | 346 | #ifdef DEBUG |
---|
| 347 | TEST(Taddress_t,out_DECOD_OUT_ADDRESS [i]->read(),address_dest [context]); |
---|
| 348 | #endif |
---|
[82] | 349 | nb_inst [context] --; |
---|
| 350 | address_dest [context] ++; |
---|
[111] | 351 | |
---|
| 352 | LABEL(" * nb_inst : %d",nb_inst [context]); |
---|
[82] | 353 | } |
---|
| 354 | } |
---|
| 355 | |
---|
| 356 | SC_START(1); |
---|
| 357 | |
---|
| 358 | for (uint32_t i=0; i<_param->_nb_context; i++) |
---|
| 359 | TEST(Tcounter_t,out_NB_INST_ALL[i]->read(), nb_inst[i]); |
---|
| 360 | } |
---|
| 361 | |
---|
| 362 | /******************************************************** |
---|
| 363 | * Simulation - End |
---|
| 364 | ********************************************************/ |
---|
| 365 | |
---|
| 366 | TEST_OK ("End of Simulation"); |
---|
| 367 | delete _time; |
---|
| 368 | |
---|
| 369 | msg(_("<%s> : ............ Stop Simulation\n"),name.c_str()); |
---|
| 370 | |
---|
| 371 | delete in_CLOCK; |
---|
| 372 | delete in_NRESET; |
---|
| 373 | |
---|
| 374 | DELETE1_SC_SIGNAL( in_DECOD_IN_VAL ,_param->_nb_inst_decod); |
---|
| 375 | DELETE1_SC_SIGNAL(out_DECOD_IN_ACK ,_param->_nb_inst_decod); |
---|
| 376 | DELETE1_SC_SIGNAL( in_DECOD_IN_CONTEXT_ID ,_param->_nb_inst_decod); |
---|
| 377 | DELETE1_SC_SIGNAL( in_DECOD_IN_DEPTH ,_param->_nb_inst_decod); |
---|
| 378 | DELETE1_SC_SIGNAL( in_DECOD_IN_TYPE ,_param->_nb_inst_decod); |
---|
| 379 | DELETE1_SC_SIGNAL( in_DECOD_IN_OPERATION ,_param->_nb_inst_decod); |
---|
[88] | 380 | DELETE1_SC_SIGNAL( in_DECOD_IN_NO_EXECUTE ,_param->_nb_inst_decod); |
---|
[82] | 381 | DELETE1_SC_SIGNAL( in_DECOD_IN_IS_DELAY_SLOT ,_param->_nb_inst_decod); |
---|
[108] | 382 | #ifdef DEBUG |
---|
| 383 | DELETE1_SC_SIGNAL( in_DECOD_IN_ADDRESS ,_param->_nb_inst_decod); |
---|
| 384 | #endif |
---|
[105] | 385 | DELETE1_SC_SIGNAL( in_DECOD_IN_ADDRESS_NEXT ,_param->_nb_inst_decod); |
---|
[82] | 386 | DELETE1_SC_SIGNAL( in_DECOD_IN_HAS_IMMEDIAT ,_param->_nb_inst_decod); |
---|
| 387 | DELETE1_SC_SIGNAL( in_DECOD_IN_IMMEDIAT ,_param->_nb_inst_decod); |
---|
| 388 | DELETE1_SC_SIGNAL( in_DECOD_IN_READ_RA ,_param->_nb_inst_decod); |
---|
| 389 | DELETE1_SC_SIGNAL( in_DECOD_IN_NUM_REG_RA ,_param->_nb_inst_decod); |
---|
| 390 | DELETE1_SC_SIGNAL( in_DECOD_IN_READ_RB ,_param->_nb_inst_decod); |
---|
| 391 | DELETE1_SC_SIGNAL( in_DECOD_IN_NUM_REG_RB ,_param->_nb_inst_decod); |
---|
| 392 | DELETE1_SC_SIGNAL( in_DECOD_IN_READ_RC ,_param->_nb_inst_decod); |
---|
| 393 | DELETE1_SC_SIGNAL( in_DECOD_IN_NUM_REG_RC ,_param->_nb_inst_decod); |
---|
| 394 | DELETE1_SC_SIGNAL( in_DECOD_IN_WRITE_RD ,_param->_nb_inst_decod); |
---|
| 395 | DELETE1_SC_SIGNAL( in_DECOD_IN_NUM_REG_RD ,_param->_nb_inst_decod); |
---|
| 396 | DELETE1_SC_SIGNAL( in_DECOD_IN_WRITE_RE ,_param->_nb_inst_decod); |
---|
| 397 | DELETE1_SC_SIGNAL( in_DECOD_IN_NUM_REG_RE ,_param->_nb_inst_decod); |
---|
| 398 | DELETE1_SC_SIGNAL( in_DECOD_IN_EXCEPTION_USE ,_param->_nb_inst_decod); |
---|
[88] | 399 | DELETE1_SC_SIGNAL( in_DECOD_IN_EXCEPTION ,_param->_nb_inst_decod); |
---|
[82] | 400 | |
---|
| 401 | DELETE1_SC_SIGNAL(out_DECOD_OUT_VAL ,_param->_nb_inst_decod); |
---|
| 402 | DELETE1_SC_SIGNAL( in_DECOD_OUT_ACK ,_param->_nb_inst_decod); |
---|
| 403 | DELETE1_SC_SIGNAL(out_DECOD_OUT_CONTEXT_ID ,_param->_nb_inst_decod); |
---|
| 404 | DELETE1_SC_SIGNAL(out_DECOD_OUT_DEPTH ,_param->_nb_inst_decod); |
---|
| 405 | DELETE1_SC_SIGNAL(out_DECOD_OUT_TYPE ,_param->_nb_inst_decod); |
---|
| 406 | DELETE1_SC_SIGNAL(out_DECOD_OUT_OPERATION ,_param->_nb_inst_decod); |
---|
[88] | 407 | DELETE1_SC_SIGNAL(out_DECOD_OUT_NO_EXECUTE ,_param->_nb_inst_decod); |
---|
[82] | 408 | DELETE1_SC_SIGNAL(out_DECOD_OUT_IS_DELAY_SLOT ,_param->_nb_inst_decod); |
---|
[108] | 409 | #ifdef DEBUG |
---|
| 410 | DELETE1_SC_SIGNAL(out_DECOD_OUT_ADDRESS ,_param->_nb_inst_decod); |
---|
| 411 | #endif |
---|
[105] | 412 | DELETE1_SC_SIGNAL(out_DECOD_OUT_ADDRESS_NEXT ,_param->_nb_inst_decod); |
---|
[82] | 413 | DELETE1_SC_SIGNAL(out_DECOD_OUT_HAS_IMMEDIAT ,_param->_nb_inst_decod); |
---|
| 414 | DELETE1_SC_SIGNAL(out_DECOD_OUT_IMMEDIAT ,_param->_nb_inst_decod); |
---|
| 415 | DELETE1_SC_SIGNAL(out_DECOD_OUT_READ_RA ,_param->_nb_inst_decod); |
---|
| 416 | DELETE1_SC_SIGNAL(out_DECOD_OUT_NUM_REG_RA ,_param->_nb_inst_decod); |
---|
| 417 | DELETE1_SC_SIGNAL(out_DECOD_OUT_READ_RB ,_param->_nb_inst_decod); |
---|
| 418 | DELETE1_SC_SIGNAL(out_DECOD_OUT_NUM_REG_RB ,_param->_nb_inst_decod); |
---|
| 419 | DELETE1_SC_SIGNAL(out_DECOD_OUT_READ_RC ,_param->_nb_inst_decod); |
---|
| 420 | DELETE1_SC_SIGNAL(out_DECOD_OUT_NUM_REG_RC ,_param->_nb_inst_decod); |
---|
| 421 | DELETE1_SC_SIGNAL(out_DECOD_OUT_WRITE_RD ,_param->_nb_inst_decod); |
---|
| 422 | DELETE1_SC_SIGNAL(out_DECOD_OUT_NUM_REG_RD ,_param->_nb_inst_decod); |
---|
| 423 | DELETE1_SC_SIGNAL(out_DECOD_OUT_WRITE_RE ,_param->_nb_inst_decod); |
---|
| 424 | DELETE1_SC_SIGNAL(out_DECOD_OUT_NUM_REG_RE ,_param->_nb_inst_decod); |
---|
| 425 | DELETE1_SC_SIGNAL(out_DECOD_OUT_EXCEPTION_USE ,_param->_nb_inst_decod); |
---|
[88] | 426 | DELETE1_SC_SIGNAL(out_DECOD_OUT_EXCEPTION ,_param->_nb_inst_decod); |
---|
[82] | 427 | |
---|
[88] | 428 | DELETE1_SC_SIGNAL( in_DEPTH_MIN ,_param->_nb_context); |
---|
| 429 | DELETE1_SC_SIGNAL( in_DEPTH_MAX ,_param->_nb_context); |
---|
[101] | 430 | DELETE1_SC_SIGNAL( in_DEPTH_FULL ,_param->_nb_context); |
---|
[82] | 431 | |
---|
| 432 | DELETE1_SC_SIGNAL(out_NB_INST_ALL ,_param->_nb_context); |
---|
| 433 | } |
---|
| 434 | #endif |
---|
| 435 | |
---|
| 436 | delete _Decod_queue; |
---|
| 437 | #ifdef STATISTICS |
---|
| 438 | delete _parameters_statistics; |
---|
| 439 | #endif |
---|
| 440 | } |
---|