[78] | 1 | /* |
---|
| 2 | * $Id: test.cpp 81 2008-04-15 18:40:01Z rosiere $ |
---|
| 3 | * |
---|
| 4 | * [ Description ] |
---|
| 5 | * |
---|
| 6 | * Test |
---|
| 7 | */ |
---|
| 8 | |
---|
| 9 | #include "Behavioural/Core/Multi_Execute_loop/Execute_loop/SelfTest/include/test.h" |
---|
| 10 | #include "Common/include/Test.h" |
---|
| 11 | #include "Behavioural/include/Allocation.h" |
---|
| 12 | |
---|
| 13 | #define NB_ITERATION 1 |
---|
| 14 | #define CYCLE_MAX (128*NB_ITERATION) |
---|
| 15 | |
---|
| 16 | #define LABEL(str...) \ |
---|
| 17 | { \ |
---|
| 18 | msg (_("{%d} "),static_cast<uint32_t>(sc_simulation_time())); \ |
---|
| 19 | msg (str); \ |
---|
| 20 | msg (_("\n")); \ |
---|
| 21 | } while(0) |
---|
| 22 | |
---|
| 23 | #define SC_START(cycle_offset) \ |
---|
| 24 | do \ |
---|
| 25 | { \ |
---|
| 26 | /*cout << "SC_START (begin)" << endl;*/ \ |
---|
| 27 | \ |
---|
| 28 | uint32_t cycle_current = static_cast<uint32_t>(sc_simulation_time()); \ |
---|
| 29 | if (cycle_offset != 0) \ |
---|
| 30 | { \ |
---|
| 31 | cout << "##########[ cycle "<< cycle_current+cycle_offset << " ]" << endl; \ |
---|
| 32 | } \ |
---|
| 33 | \ |
---|
| 34 | if (cycle_current > CYCLE_MAX) \ |
---|
| 35 | { \ |
---|
| 36 | TEST_KO("Maximal cycles Reached"); \ |
---|
| 37 | } \ |
---|
| 38 | \ |
---|
| 39 | sc_start(cycle_offset); \ |
---|
| 40 | \ |
---|
| 41 | /*cout << "SC_START (end )" << endl;*/ \ |
---|
| 42 | } while(0) |
---|
| 43 | |
---|
| 44 | void test (string name, |
---|
| 45 | morpheo::behavioural::core::multi_execute_loop::execute_loop::Parameters * _param) |
---|
| 46 | { |
---|
| 47 | msg(_("<%s> : Simulation SystemC.\n"),name.c_str()); |
---|
| 48 | |
---|
| 49 | #ifdef STATISTICS |
---|
| 50 | morpheo::behavioural::Parameters_Statistics * _parameters_statistics = new morpheo::behavioural::Parameters_Statistics (5,50); |
---|
| 51 | #endif |
---|
| 52 | |
---|
| 53 | Execute_loop * _Execute_loop = new Execute_loop (name.c_str(), |
---|
| 54 | #ifdef STATISTICS |
---|
| 55 | _parameters_statistics, |
---|
| 56 | #endif |
---|
| 57 | _param); |
---|
| 58 | |
---|
| 59 | #ifdef SYSTEMC |
---|
| 60 | /********************************************************************* |
---|
| 61 | * Déclarations des signaux |
---|
| 62 | *********************************************************************/ |
---|
| 63 | string rename; |
---|
| 64 | |
---|
| 65 | sc_clock * in_CLOCK = new sc_clock ("clock", 1.0, 0.5); |
---|
| 66 | sc_signal<Tcontrol_t> * in_NRESET = new sc_signal<Tcontrol_t> ("NRESET"); |
---|
| 67 | |
---|
| 68 | ALLOC1_SC_SIGNAL( in_EXECUTE_LOOP_IN_VAL ," in_EXECUTE_LOOP_IN_VAL ",Tcontrol_t ,_param->_nb_read_unit); |
---|
| 69 | ALLOC1_SC_SIGNAL(out_EXECUTE_LOOP_IN_ACK ,"out_EXECUTE_LOOP_IN_ACK ",Tcontrol_t ,_param->_nb_read_unit); |
---|
| 70 | ALLOC1_SC_SIGNAL( in_EXECUTE_LOOP_IN_CONTEXT_ID ," in_EXECUTE_LOOP_IN_CONTEXT_ID ",Tcontext_t ,_param->_nb_read_unit); |
---|
| 71 | ALLOC1_SC_SIGNAL( in_EXECUTE_LOOP_IN_FRONT_END_ID ," in_EXECUTE_LOOP_IN_FRONT_END_ID ",Tcontext_t ,_param->_nb_read_unit); |
---|
| 72 | ALLOC1_SC_SIGNAL( in_EXECUTE_LOOP_IN_OOO_ENGINE_ID ," in_EXECUTE_LOOP_IN_OOO_ENGINE_ID ",Tcontext_t ,_param->_nb_read_unit); |
---|
| 73 | ALLOC1_SC_SIGNAL( in_EXECUTE_LOOP_IN_PACKET_ID ," in_EXECUTE_LOOP_IN_PACKET_ID ",Tpacket_t ,_param->_nb_read_unit); |
---|
| 74 | ALLOC1_SC_SIGNAL( in_EXECUTE_LOOP_IN_OPERATION ," in_EXECUTE_LOOP_IN_OPERATION ",Toperation_t ,_param->_nb_read_unit); |
---|
| 75 | ALLOC1_SC_SIGNAL( in_EXECUTE_LOOP_IN_TYPE ," in_EXECUTE_LOOP_IN_TYPE ",Ttype_t ,_param->_nb_read_unit); |
---|
| 76 | ALLOC1_SC_SIGNAL( in_EXECUTE_LOOP_IN_STORE_QUEUE_PTR_WRITE," in_EXECUTE_LOOP_IN_STORE_QUEUE_PTR_WRITE",Tlsq_ptr_t ,_param->_nb_read_unit); |
---|
| 77 | ALLOC1_SC_SIGNAL( in_EXECUTE_LOOP_IN_LOAD_QUEUE_PTR_WRITE ," in_EXECUTE_LOOP_IN_LOAD_QUEUE_PTR_WRITE ",Tlsq_ptr_t ,_param->_nb_read_unit); |
---|
| 78 | ALLOC1_SC_SIGNAL( in_EXECUTE_LOOP_IN_HAS_IMMEDIAT ," in_EXECUTE_LOOP_IN_HAS_IMMEDIAT ",Tcontrol_t ,_param->_nb_read_unit); |
---|
| 79 | ALLOC1_SC_SIGNAL( in_EXECUTE_LOOP_IN_IMMEDIAT ," in_EXECUTE_LOOP_IN_IMMEDIAT ",Tgeneral_data_t ,_param->_nb_read_unit); |
---|
| 80 | ALLOC1_SC_SIGNAL( in_EXECUTE_LOOP_IN_READ_RA ," in_EXECUTE_LOOP_IN_READ_RA ",Tcontrol_t ,_param->_nb_read_unit); |
---|
| 81 | ALLOC1_SC_SIGNAL( in_EXECUTE_LOOP_IN_NUM_REG_RA ," in_EXECUTE_LOOP_IN_NUM_REG_RA ",Tgeneral_address_t,_param->_nb_read_unit); |
---|
| 82 | ALLOC1_SC_SIGNAL( in_EXECUTE_LOOP_IN_READ_RB ," in_EXECUTE_LOOP_IN_READ_RB ",Tcontrol_t ,_param->_nb_read_unit); |
---|
| 83 | ALLOC1_SC_SIGNAL( in_EXECUTE_LOOP_IN_NUM_REG_RB ," in_EXECUTE_LOOP_IN_NUM_REG_RB ",Tgeneral_address_t,_param->_nb_read_unit); |
---|
| 84 | ALLOC1_SC_SIGNAL( in_EXECUTE_LOOP_IN_READ_RC ," in_EXECUTE_LOOP_IN_READ_RC ",Tcontrol_t ,_param->_nb_read_unit); |
---|
| 85 | ALLOC1_SC_SIGNAL( in_EXECUTE_LOOP_IN_NUM_REG_RC ," in_EXECUTE_LOOP_IN_NUM_REG_RC ",Tspecial_address_t,_param->_nb_read_unit); |
---|
| 86 | ALLOC1_SC_SIGNAL( in_EXECUTE_LOOP_IN_WRITE_RD ," in_EXECUTE_LOOP_IN_WRITE_RD ",Tcontrol_t ,_param->_nb_read_unit); |
---|
| 87 | ALLOC1_SC_SIGNAL( in_EXECUTE_LOOP_IN_NUM_REG_RD ," in_EXECUTE_LOOP_IN_NUM_REG_RD ",Tgeneral_address_t,_param->_nb_read_unit); |
---|
| 88 | ALLOC1_SC_SIGNAL( in_EXECUTE_LOOP_IN_WRITE_RE ," in_EXECUTE_LOOP_IN_WRITE_RE ",Tcontrol_t ,_param->_nb_read_unit); |
---|
| 89 | ALLOC1_SC_SIGNAL( in_EXECUTE_LOOP_IN_NUM_REG_RE ," in_EXECUTE_LOOP_IN_NUM_REG_RE ",Tspecial_address_t,_param->_nb_read_unit); |
---|
| 90 | ALLOC1_SC_SIGNAL(out_EXECUTE_LOOP_OUT_VAL ,"out_EXECUTE_LOOP_OUT_VAL ",Tcontrol_t ,_param->_nb_write_unit); |
---|
| 91 | ALLOC1_SC_SIGNAL( in_EXECUTE_LOOP_OUT_ACK ," in_EXECUTE_LOOP_OUT_ACK ",Tcontrol_t ,_param->_nb_write_unit); |
---|
| 92 | ALLOC1_SC_SIGNAL(out_EXECUTE_LOOP_OUT_CONTEXT_ID ,"out_EXECUTE_LOOP_OUT_CONTEXT_ID ",Tcontext_t ,_param->_nb_write_unit); |
---|
| 93 | ALLOC1_SC_SIGNAL(out_EXECUTE_LOOP_OUT_FRONT_END_ID ,"out_EXECUTE_LOOP_OUT_FRONT_END_ID ",Tcontext_t ,_param->_nb_write_unit); |
---|
| 94 | ALLOC1_SC_SIGNAL(out_EXECUTE_LOOP_OUT_OOO_ENGINE_ID ,"out_EXECUTE_LOOP_OUT_OOO_ENGINE_ID ",Tcontext_t ,_param->_nb_write_unit); |
---|
| 95 | ALLOC1_SC_SIGNAL(out_EXECUTE_LOOP_OUT_PACKET_ID ,"out_EXECUTE_LOOP_OUT_PACKET_ID ",Tpacket_t ,_param->_nb_write_unit); |
---|
| 96 | //ALLOC1_SC_SIGNAL(out_EXECUTE_LOOP_OUT_OPERATION ,"out_EXECUTE_LOOP_OUT_OPERATION ",Toperation_t ,_param->_nb_write_unit); |
---|
| 97 | //ALLOC1_SC_SIGNAL(out_EXECUTE_LOOP_OUT_TYPE ,"out_EXECUTE_LOOP_OUT_TYPE ",Ttype_t ,_param->_nb_write_unit); |
---|
| 98 | ALLOC1_SC_SIGNAL(out_EXECUTE_LOOP_OUT_FLAGS ,"out_EXECUTE_LOOP_OUT_FLAGS ",Tspecial_data_t ,_param->_nb_write_unit); |
---|
| 99 | ALLOC1_SC_SIGNAL(out_EXECUTE_LOOP_OUT_EXCEPTION ,"out_EXECUTE_LOOP_OUT_EXCEPTION ",Texception_t ,_param->_nb_write_unit); |
---|
| 100 | ALLOC1_SC_SIGNAL(out_EXECUTE_LOOP_OUT_NO_SEQUENCE ,"out_EXECUTE_LOOP_OUT_NO_SEQUENCE ",Tcontrol_t ,_param->_nb_write_unit); |
---|
| 101 | ALLOC1_SC_SIGNAL(out_EXECUTE_LOOP_OUT_ADDRESS ,"out_EXECUTE_LOOP_OUT_ADDRESS ",Tgeneral_data_t ,_param->_nb_write_unit); |
---|
| 102 | ALLOC1_SC_SIGNAL(out_DCACHE_REQ_VAL ,"out_DCACHE_REQ_VAL ",Tcontrol_t ,_param->_nb_load_store_unit); |
---|
| 103 | ALLOC1_SC_SIGNAL( in_DCACHE_REQ_ACK ," in_DCACHE_REQ_ACK ",Tcontrol_t ,_param->_nb_load_store_unit); |
---|
| 104 | ALLOC1_SC_SIGNAL(out_DCACHE_REQ_CONTEXT_ID ,"out_DCACHE_REQ_CONTEXT_ID ",Tcontext_t ,_param->_nb_load_store_unit); |
---|
| 105 | ALLOC1_SC_SIGNAL(out_DCACHE_REQ_PACKET_ID ,"out_DCACHE_REQ_PACKET_ID ",Tpacket_t ,_param->_nb_load_store_unit); |
---|
| 106 | ALLOC1_SC_SIGNAL(out_DCACHE_REQ_ADDRESS ,"out_DCACHE_REQ_ADDRESS ",Tdcache_address_t ,_param->_nb_load_store_unit); |
---|
| 107 | ALLOC1_SC_SIGNAL(out_DCACHE_REQ_TYPE ,"out_DCACHE_REQ_TYPE ",Tdcache_type_t ,_param->_nb_load_store_unit); |
---|
| 108 | ALLOC1_SC_SIGNAL(out_DCACHE_REQ_WDATA ,"out_DCACHE_REQ_WDATA ",Tdcache_data_t ,_param->_nb_load_store_unit); |
---|
| 109 | ALLOC1_SC_SIGNAL( in_DCACHE_RSP_VAL ," in_DCACHE_RSP_VAL ",Tcontrol_t ,_param->_nb_load_store_unit); |
---|
| 110 | ALLOC1_SC_SIGNAL(out_DCACHE_RSP_ACK ,"out_DCACHE_RSP_ACK ",Tcontrol_t ,_param->_nb_load_store_unit); |
---|
| 111 | ALLOC1_SC_SIGNAL( in_DCACHE_RSP_CONTEXT_ID ," in_DCACHE_RSP_CONTEXT_ID ",Tcontext_t ,_param->_nb_load_store_unit); |
---|
| 112 | ALLOC1_SC_SIGNAL( in_DCACHE_RSP_PACKET_ID ," in_DCACHE_RSP_PACKET_ID ",Tpacket_t ,_param->_nb_load_store_unit); |
---|
| 113 | ALLOC1_SC_SIGNAL( in_DCACHE_RSP_RDATA ," in_DCACHE_RSP_RDATA ",Tdcache_data_t ,_param->_nb_load_store_unit); |
---|
| 114 | ALLOC1_SC_SIGNAL( in_DCACHE_RSP_ERROR ," in_DCACHE_RSP_ERROR ",Tdcache_error_t ,_param->_nb_load_store_unit); |
---|
| 115 | ALLOC2_SC_SIGNAL( in_INSERT_ROB_VAL ," in_INSERT_ROB_VAL ",Tcontrol_t ,_param->_nb_ooo_engine,_param->_nb_inst_insert_rob[alloc_signal_it1]); |
---|
| 116 | ALLOC2_SC_SIGNAL(out_INSERT_ROB_ACK ,"out_INSERT_ROB_ACK ",Tcontrol_t ,_param->_nb_ooo_engine,_param->_nb_inst_insert_rob[alloc_signal_it1]); |
---|
| 117 | ALLOC2_SC_SIGNAL( in_INSERT_ROB_RD_USE ," in_INSERT_ROB_RD_USE ",Tcontrol_t ,_param->_nb_ooo_engine,_param->_nb_inst_insert_rob[alloc_signal_it1]); |
---|
| 118 | ALLOC2_SC_SIGNAL( in_INSERT_ROB_RD_NUM_REG ," in_INSERT_ROB_RD_NUM_REG ",Tgeneral_address_t,_param->_nb_ooo_engine,_param->_nb_inst_insert_rob[alloc_signal_it1]); |
---|
| 119 | ALLOC2_SC_SIGNAL( in_INSERT_ROB_RE_USE ," in_INSERT_ROB_RE_USE ",Tcontrol_t ,_param->_nb_ooo_engine,_param->_nb_inst_insert_rob[alloc_signal_it1]); |
---|
| 120 | ALLOC2_SC_SIGNAL( in_INSERT_ROB_RE_NUM_REG ," in_INSERT_ROB_RE_NUM_REG ",Tspecial_address_t,_param->_nb_ooo_engine,_param->_nb_inst_insert_rob[alloc_signal_it1]); |
---|
| 121 | ALLOC2_SC_SIGNAL( in_RETIRE_ROB_VAL ," in_RETIRE_ROB_VAL ",Tcontrol_t ,_param->_nb_ooo_engine,_param->_nb_inst_retire_rob[alloc_signal_it1]); |
---|
| 122 | ALLOC2_SC_SIGNAL(out_RETIRE_ROB_ACK ,"out_RETIRE_ROB_ACK ",Tcontrol_t ,_param->_nb_ooo_engine,_param->_nb_inst_retire_rob[alloc_signal_it1]); |
---|
| 123 | ALLOC2_SC_SIGNAL( in_RETIRE_ROB_RD_OLD_USE ," in_RETIRE_ROB_RD_OLD_USE ",Tcontrol_t ,_param->_nb_ooo_engine,_param->_nb_inst_retire_rob[alloc_signal_it1]); |
---|
| 124 | ALLOC2_SC_SIGNAL( in_RETIRE_ROB_RD_OLD_NUM_REG ," in_RETIRE_ROB_RD_OLD_NUM_REG ",Tgeneral_address_t,_param->_nb_ooo_engine,_param->_nb_inst_retire_rob[alloc_signal_it1]); |
---|
| 125 | ALLOC2_SC_SIGNAL( in_RETIRE_ROB_RD_NEW_USE ," in_RETIRE_ROB_RD_NEW_USE ",Tcontrol_t ,_param->_nb_ooo_engine,_param->_nb_inst_retire_rob[alloc_signal_it1]); |
---|
| 126 | ALLOC2_SC_SIGNAL( in_RETIRE_ROB_RD_NEW_NUM_REG ," in_RETIRE_ROB_RD_NEW_NUM_REG ",Tgeneral_address_t,_param->_nb_ooo_engine,_param->_nb_inst_retire_rob[alloc_signal_it1]); |
---|
| 127 | ALLOC2_SC_SIGNAL( in_RETIRE_ROB_RE_OLD_USE ," in_RETIRE_ROB_RE_OLD_USE ",Tcontrol_t ,_param->_nb_ooo_engine,_param->_nb_inst_retire_rob[alloc_signal_it1]); |
---|
| 128 | ALLOC2_SC_SIGNAL( in_RETIRE_ROB_RE_OLD_NUM_REG ," in_RETIRE_ROB_RE_OLD_NUM_REG ",Tspecial_address_t,_param->_nb_ooo_engine,_param->_nb_inst_retire_rob[alloc_signal_it1]); |
---|
| 129 | ALLOC2_SC_SIGNAL( in_RETIRE_ROB_RE_NEW_USE ," in_RETIRE_ROB_RE_NEW_USE ",Tcontrol_t ,_param->_nb_ooo_engine,_param->_nb_inst_retire_rob[alloc_signal_it1]); |
---|
| 130 | ALLOC2_SC_SIGNAL( in_RETIRE_ROB_RE_NEW_NUM_REG ," in_RETIRE_ROB_RE_NEW_NUM_REG ",Tspecial_address_t,_param->_nb_ooo_engine,_param->_nb_inst_retire_rob[alloc_signal_it1]); |
---|
| 131 | |
---|
| 132 | /******************************************************** |
---|
| 133 | * Instanciation |
---|
| 134 | ********************************************************/ |
---|
| 135 | |
---|
| 136 | msg(_("<%s> : Instanciation of _Execute_loop.\n"),name.c_str()); |
---|
| 137 | |
---|
| 138 | (*(_Execute_loop->in_CLOCK)) (*(in_CLOCK)); |
---|
| 139 | (*(_Execute_loop->in_NRESET)) (*(in_NRESET)); |
---|
| 140 | |
---|
| 141 | INSTANCE1_SC_SIGNAL(_Execute_loop, in_EXECUTE_LOOP_IN_VAL ,_param->_nb_read_unit); |
---|
| 142 | INSTANCE1_SC_SIGNAL(_Execute_loop,out_EXECUTE_LOOP_IN_ACK ,_param->_nb_read_unit); |
---|
| 143 | if (_param->_have_port_context_id) |
---|
| 144 | INSTANCE1_SC_SIGNAL(_Execute_loop, in_EXECUTE_LOOP_IN_CONTEXT_ID ,_param->_nb_read_unit); |
---|
| 145 | if (_param->_have_port_front_end_id) |
---|
| 146 | INSTANCE1_SC_SIGNAL(_Execute_loop, in_EXECUTE_LOOP_IN_FRONT_END_ID ,_param->_nb_read_unit); |
---|
| 147 | if (_param->_have_port_ooo_engine_id) |
---|
| 148 | INSTANCE1_SC_SIGNAL(_Execute_loop, in_EXECUTE_LOOP_IN_OOO_ENGINE_ID ,_param->_nb_read_unit); |
---|
| 149 | if (_param->_have_port_packet_id) |
---|
| 150 | INSTANCE1_SC_SIGNAL(_Execute_loop, in_EXECUTE_LOOP_IN_PACKET_ID ,_param->_nb_read_unit); |
---|
| 151 | INSTANCE1_SC_SIGNAL(_Execute_loop, in_EXECUTE_LOOP_IN_OPERATION ,_param->_nb_read_unit); |
---|
| 152 | INSTANCE1_SC_SIGNAL(_Execute_loop, in_EXECUTE_LOOP_IN_TYPE ,_param->_nb_read_unit); |
---|
| 153 | INSTANCE1_SC_SIGNAL(_Execute_loop, in_EXECUTE_LOOP_IN_STORE_QUEUE_PTR_WRITE,_param->_nb_read_unit); |
---|
| 154 | if (_param->_have_port_load_queue_ptr) |
---|
| 155 | INSTANCE1_SC_SIGNAL(_Execute_loop, in_EXECUTE_LOOP_IN_LOAD_QUEUE_PTR_WRITE ,_param->_nb_read_unit); |
---|
| 156 | INSTANCE1_SC_SIGNAL(_Execute_loop, in_EXECUTE_LOOP_IN_HAS_IMMEDIAT ,_param->_nb_read_unit); |
---|
| 157 | INSTANCE1_SC_SIGNAL(_Execute_loop, in_EXECUTE_LOOP_IN_IMMEDIAT ,_param->_nb_read_unit); |
---|
| 158 | INSTANCE1_SC_SIGNAL(_Execute_loop, in_EXECUTE_LOOP_IN_READ_RA ,_param->_nb_read_unit); |
---|
| 159 | INSTANCE1_SC_SIGNAL(_Execute_loop, in_EXECUTE_LOOP_IN_NUM_REG_RA ,_param->_nb_read_unit); |
---|
| 160 | INSTANCE1_SC_SIGNAL(_Execute_loop, in_EXECUTE_LOOP_IN_READ_RB ,_param->_nb_read_unit); |
---|
| 161 | INSTANCE1_SC_SIGNAL(_Execute_loop, in_EXECUTE_LOOP_IN_NUM_REG_RB ,_param->_nb_read_unit); |
---|
| 162 | INSTANCE1_SC_SIGNAL(_Execute_loop, in_EXECUTE_LOOP_IN_READ_RC ,_param->_nb_read_unit); |
---|
| 163 | INSTANCE1_SC_SIGNAL(_Execute_loop, in_EXECUTE_LOOP_IN_NUM_REG_RC ,_param->_nb_read_unit); |
---|
| 164 | INSTANCE1_SC_SIGNAL(_Execute_loop, in_EXECUTE_LOOP_IN_WRITE_RD ,_param->_nb_read_unit); |
---|
| 165 | INSTANCE1_SC_SIGNAL(_Execute_loop, in_EXECUTE_LOOP_IN_NUM_REG_RD ,_param->_nb_read_unit); |
---|
| 166 | INSTANCE1_SC_SIGNAL(_Execute_loop, in_EXECUTE_LOOP_IN_WRITE_RE ,_param->_nb_read_unit); |
---|
| 167 | INSTANCE1_SC_SIGNAL(_Execute_loop, in_EXECUTE_LOOP_IN_NUM_REG_RE ,_param->_nb_read_unit); |
---|
| 168 | INSTANCE1_SC_SIGNAL(_Execute_loop,out_EXECUTE_LOOP_OUT_VAL ,_param->_nb_write_unit); |
---|
| 169 | INSTANCE1_SC_SIGNAL(_Execute_loop, in_EXECUTE_LOOP_OUT_ACK ,_param->_nb_write_unit); |
---|
| 170 | if (_param->_have_port_context_id) |
---|
| 171 | INSTANCE1_SC_SIGNAL(_Execute_loop,out_EXECUTE_LOOP_OUT_CONTEXT_ID ,_param->_nb_write_unit); |
---|
| 172 | if (_param->_have_port_front_end_id) |
---|
| 173 | INSTANCE1_SC_SIGNAL(_Execute_loop,out_EXECUTE_LOOP_OUT_FRONT_END_ID ,_param->_nb_write_unit); |
---|
| 174 | if (_param->_have_port_ooo_engine_id) |
---|
| 175 | INSTANCE1_SC_SIGNAL(_Execute_loop,out_EXECUTE_LOOP_OUT_OOO_ENGINE_ID ,_param->_nb_write_unit); |
---|
| 176 | if (_param->_have_port_packet_id) |
---|
| 177 | INSTANCE1_SC_SIGNAL(_Execute_loop,out_EXECUTE_LOOP_OUT_PACKET_ID ,_param->_nb_write_unit); |
---|
| 178 | //INSTANCE1_SC_SIGNAL(_Execute_loop,out_EXECUTE_LOOP_OUT_OPERATION ,_param->_nb_write_unit); |
---|
| 179 | //INSTANCE1_SC_SIGNAL(_Execute_loop,out_EXECUTE_LOOP_OUT_TYPE ,_param->_nb_write_unit); |
---|
| 180 | INSTANCE1_SC_SIGNAL(_Execute_loop,out_EXECUTE_LOOP_OUT_FLAGS ,_param->_nb_write_unit); |
---|
| 181 | INSTANCE1_SC_SIGNAL(_Execute_loop,out_EXECUTE_LOOP_OUT_EXCEPTION ,_param->_nb_write_unit); |
---|
| 182 | INSTANCE1_SC_SIGNAL(_Execute_loop,out_EXECUTE_LOOP_OUT_NO_SEQUENCE ,_param->_nb_write_unit); |
---|
| 183 | INSTANCE1_SC_SIGNAL(_Execute_loop,out_EXECUTE_LOOP_OUT_ADDRESS ,_param->_nb_write_unit); |
---|
| 184 | INSTANCE1_SC_SIGNAL(_Execute_loop,out_DCACHE_REQ_VAL ,_param->_nb_load_store_unit); |
---|
| 185 | INSTANCE1_SC_SIGNAL(_Execute_loop, in_DCACHE_REQ_ACK ,_param->_nb_load_store_unit); |
---|
| 186 | if (_param->_have_port_dcache_context_id) |
---|
| 187 | INSTANCE1_SC_SIGNAL(_Execute_loop,out_DCACHE_REQ_CONTEXT_ID ,_param->_nb_load_store_unit); |
---|
| 188 | INSTANCE1_SC_SIGNAL(_Execute_loop,out_DCACHE_REQ_PACKET_ID ,_param->_nb_load_store_unit); |
---|
| 189 | INSTANCE1_SC_SIGNAL(_Execute_loop,out_DCACHE_REQ_ADDRESS ,_param->_nb_load_store_unit); |
---|
| 190 | INSTANCE1_SC_SIGNAL(_Execute_loop,out_DCACHE_REQ_TYPE ,_param->_nb_load_store_unit); |
---|
| 191 | INSTANCE1_SC_SIGNAL(_Execute_loop,out_DCACHE_REQ_WDATA ,_param->_nb_load_store_unit); |
---|
| 192 | INSTANCE1_SC_SIGNAL(_Execute_loop, in_DCACHE_RSP_VAL ,_param->_nb_load_store_unit); |
---|
| 193 | INSTANCE1_SC_SIGNAL(_Execute_loop,out_DCACHE_RSP_ACK ,_param->_nb_load_store_unit); |
---|
| 194 | if (_param->_have_port_dcache_context_id) |
---|
| 195 | INSTANCE1_SC_SIGNAL(_Execute_loop, in_DCACHE_RSP_CONTEXT_ID ,_param->_nb_load_store_unit); |
---|
| 196 | INSTANCE1_SC_SIGNAL(_Execute_loop, in_DCACHE_RSP_PACKET_ID ,_param->_nb_load_store_unit); |
---|
| 197 | INSTANCE1_SC_SIGNAL(_Execute_loop, in_DCACHE_RSP_RDATA ,_param->_nb_load_store_unit); |
---|
| 198 | INSTANCE1_SC_SIGNAL(_Execute_loop, in_DCACHE_RSP_ERROR ,_param->_nb_load_store_unit); |
---|
| 199 | INSTANCE2_SC_SIGNAL(_Execute_loop, in_INSERT_ROB_VAL ,_param->_nb_ooo_engine,_param->_nb_inst_insert_rob[alloc_signal_it1]); |
---|
| 200 | INSTANCE2_SC_SIGNAL(_Execute_loop,out_INSERT_ROB_ACK ,_param->_nb_ooo_engine,_param->_nb_inst_insert_rob[alloc_signal_it1]); |
---|
| 201 | INSTANCE2_SC_SIGNAL(_Execute_loop, in_INSERT_ROB_RD_USE ,_param->_nb_ooo_engine,_param->_nb_inst_insert_rob[alloc_signal_it1]); |
---|
| 202 | INSTANCE2_SC_SIGNAL(_Execute_loop, in_INSERT_ROB_RD_NUM_REG ,_param->_nb_ooo_engine,_param->_nb_inst_insert_rob[alloc_signal_it1]); |
---|
| 203 | INSTANCE2_SC_SIGNAL(_Execute_loop, in_INSERT_ROB_RE_USE ,_param->_nb_ooo_engine,_param->_nb_inst_insert_rob[alloc_signal_it1]); |
---|
| 204 | INSTANCE2_SC_SIGNAL(_Execute_loop, in_INSERT_ROB_RE_NUM_REG ,_param->_nb_ooo_engine,_param->_nb_inst_insert_rob[alloc_signal_it1]); |
---|
| 205 | INSTANCE2_SC_SIGNAL(_Execute_loop, in_RETIRE_ROB_VAL ,_param->_nb_ooo_engine,_param->_nb_inst_retire_rob[alloc_signal_it1]); |
---|
| 206 | INSTANCE2_SC_SIGNAL(_Execute_loop,out_RETIRE_ROB_ACK ,_param->_nb_ooo_engine,_param->_nb_inst_retire_rob[alloc_signal_it1]); |
---|
| 207 | INSTANCE2_SC_SIGNAL(_Execute_loop, in_RETIRE_ROB_RD_OLD_USE ,_param->_nb_ooo_engine,_param->_nb_inst_retire_rob[alloc_signal_it1]); |
---|
| 208 | INSTANCE2_SC_SIGNAL(_Execute_loop, in_RETIRE_ROB_RD_OLD_NUM_REG ,_param->_nb_ooo_engine,_param->_nb_inst_retire_rob[alloc_signal_it1]); |
---|
| 209 | INSTANCE2_SC_SIGNAL(_Execute_loop, in_RETIRE_ROB_RD_NEW_USE ,_param->_nb_ooo_engine,_param->_nb_inst_retire_rob[alloc_signal_it1]); |
---|
| 210 | INSTANCE2_SC_SIGNAL(_Execute_loop, in_RETIRE_ROB_RD_NEW_NUM_REG ,_param->_nb_ooo_engine,_param->_nb_inst_retire_rob[alloc_signal_it1]); |
---|
| 211 | INSTANCE2_SC_SIGNAL(_Execute_loop, in_RETIRE_ROB_RE_OLD_USE ,_param->_nb_ooo_engine,_param->_nb_inst_retire_rob[alloc_signal_it1]); |
---|
| 212 | INSTANCE2_SC_SIGNAL(_Execute_loop, in_RETIRE_ROB_RE_OLD_NUM_REG ,_param->_nb_ooo_engine,_param->_nb_inst_retire_rob[alloc_signal_it1]); |
---|
| 213 | INSTANCE2_SC_SIGNAL(_Execute_loop, in_RETIRE_ROB_RE_NEW_USE ,_param->_nb_ooo_engine,_param->_nb_inst_retire_rob[alloc_signal_it1]); |
---|
| 214 | INSTANCE2_SC_SIGNAL(_Execute_loop, in_RETIRE_ROB_RE_NEW_NUM_REG ,_param->_nb_ooo_engine,_param->_nb_inst_retire_rob[alloc_signal_it1]); |
---|
| 215 | |
---|
| 216 | msg(_("<%s> : Start Simulation ............\n"),name.c_str()); |
---|
| 217 | |
---|
| 218 | Time * _time = new Time(); |
---|
| 219 | |
---|
| 220 | /******************************************************** |
---|
| 221 | * Simulation - Begin |
---|
| 222 | ********************************************************/ |
---|
| 223 | |
---|
| 224 | // Initialisation |
---|
| 225 | |
---|
| 226 | const uint32_t seed = 0; |
---|
| 227 | //const uint32_t seed = static_cast<uint32_t>(time(NULL)); |
---|
| 228 | |
---|
| 229 | srand(seed); |
---|
| 230 | |
---|
| 231 | SC_START(0); |
---|
| 232 | LABEL("Initialisation"); |
---|
| 233 | |
---|
| 234 | LABEL("Reset"); |
---|
| 235 | in_NRESET->write(0); |
---|
| 236 | SC_START(5); |
---|
| 237 | in_NRESET->write(1); |
---|
| 238 | |
---|
| 239 | LABEL("Loop of Test"); |
---|
| 240 | |
---|
| 241 | for (uint32_t iteration=0; iteration<NB_ITERATION; iteration ++) |
---|
| 242 | { |
---|
| 243 | LABEL("Iteration %d",iteration); |
---|
| 244 | |
---|
| 245 | SC_START(1); |
---|
| 246 | } |
---|
| 247 | |
---|
| 248 | /******************************************************** |
---|
| 249 | * Simulation - End |
---|
| 250 | ********************************************************/ |
---|
| 251 | |
---|
| 252 | TEST_OK ("End of Simulation"); |
---|
| 253 | delete _time; |
---|
| 254 | |
---|
| 255 | msg(_("<%s> : ............ Stop Simulation\n"),name.c_str()); |
---|
| 256 | |
---|
| 257 | delete in_CLOCK; |
---|
| 258 | delete in_NRESET; |
---|
| 259 | |
---|
| 260 | delete [] in_EXECUTE_LOOP_IN_VAL ; |
---|
| 261 | delete [] out_EXECUTE_LOOP_IN_ACK ; |
---|
| 262 | delete [] in_EXECUTE_LOOP_IN_CONTEXT_ID ; |
---|
| 263 | delete [] in_EXECUTE_LOOP_IN_FRONT_END_ID ; |
---|
| 264 | delete [] in_EXECUTE_LOOP_IN_OOO_ENGINE_ID ; |
---|
| 265 | delete [] in_EXECUTE_LOOP_IN_PACKET_ID ; |
---|
| 266 | delete [] in_EXECUTE_LOOP_IN_OPERATION ; |
---|
| 267 | delete [] in_EXECUTE_LOOP_IN_TYPE ; |
---|
| 268 | delete [] in_EXECUTE_LOOP_IN_STORE_QUEUE_PTR_WRITE; |
---|
| 269 | delete [] in_EXECUTE_LOOP_IN_LOAD_QUEUE_PTR_WRITE ; |
---|
| 270 | delete [] in_EXECUTE_LOOP_IN_HAS_IMMEDIAT ; |
---|
| 271 | delete [] in_EXECUTE_LOOP_IN_IMMEDIAT ; |
---|
| 272 | delete [] in_EXECUTE_LOOP_IN_READ_RA ; |
---|
| 273 | delete [] in_EXECUTE_LOOP_IN_NUM_REG_RA ; |
---|
| 274 | delete [] in_EXECUTE_LOOP_IN_READ_RB ; |
---|
| 275 | delete [] in_EXECUTE_LOOP_IN_NUM_REG_RB ; |
---|
| 276 | delete [] in_EXECUTE_LOOP_IN_READ_RC ; |
---|
| 277 | delete [] in_EXECUTE_LOOP_IN_NUM_REG_RC ; |
---|
| 278 | delete [] in_EXECUTE_LOOP_IN_WRITE_RD ; |
---|
| 279 | delete [] in_EXECUTE_LOOP_IN_NUM_REG_RD ; |
---|
| 280 | delete [] in_EXECUTE_LOOP_IN_WRITE_RE ; |
---|
| 281 | delete [] in_EXECUTE_LOOP_IN_NUM_REG_RE ; |
---|
| 282 | delete [] out_EXECUTE_LOOP_OUT_VAL ; |
---|
| 283 | delete [] in_EXECUTE_LOOP_OUT_ACK ; |
---|
| 284 | delete [] out_EXECUTE_LOOP_OUT_CONTEXT_ID ; |
---|
| 285 | delete [] out_EXECUTE_LOOP_OUT_FRONT_END_ID ; |
---|
| 286 | delete [] out_EXECUTE_LOOP_OUT_OOO_ENGINE_ID ; |
---|
| 287 | delete [] out_EXECUTE_LOOP_OUT_PACKET_ID ; |
---|
| 288 | //delete [] out_EXECUTE_LOOP_OUT_OPERATION ; |
---|
| 289 | //delete [] out_EXECUTE_LOOP_OUT_TYPE ; |
---|
| 290 | delete [] out_EXECUTE_LOOP_OUT_FLAGS ; |
---|
| 291 | delete [] out_EXECUTE_LOOP_OUT_EXCEPTION ; |
---|
| 292 | delete [] out_EXECUTE_LOOP_OUT_NO_SEQUENCE ; |
---|
| 293 | delete [] out_EXECUTE_LOOP_OUT_ADDRESS ; |
---|
| 294 | delete [] out_DCACHE_REQ_VAL ; |
---|
| 295 | delete [] in_DCACHE_REQ_ACK ; |
---|
| 296 | delete [] out_DCACHE_REQ_CONTEXT_ID ; |
---|
| 297 | delete [] out_DCACHE_REQ_PACKET_ID ; |
---|
| 298 | delete [] out_DCACHE_REQ_ADDRESS ; |
---|
| 299 | delete [] out_DCACHE_REQ_TYPE ; |
---|
| 300 | delete [] out_DCACHE_REQ_WDATA ; |
---|
| 301 | delete [] in_DCACHE_RSP_VAL ; |
---|
| 302 | delete [] out_DCACHE_RSP_ACK ; |
---|
| 303 | delete [] in_DCACHE_RSP_CONTEXT_ID ; |
---|
| 304 | delete [] in_DCACHE_RSP_PACKET_ID ; |
---|
| 305 | delete [] in_DCACHE_RSP_RDATA ; |
---|
| 306 | delete [] in_DCACHE_RSP_ERROR ; |
---|
| 307 | delete [] in_INSERT_ROB_VAL ; |
---|
| 308 | delete [] out_INSERT_ROB_ACK ; |
---|
| 309 | delete [] in_INSERT_ROB_RD_USE ; |
---|
| 310 | delete [] in_INSERT_ROB_RD_NUM_REG ; |
---|
| 311 | delete [] in_INSERT_ROB_RE_USE ; |
---|
| 312 | delete [] in_INSERT_ROB_RE_NUM_REG ; |
---|
| 313 | delete [] in_RETIRE_ROB_VAL ; |
---|
| 314 | delete [] out_RETIRE_ROB_ACK ; |
---|
| 315 | delete [] in_RETIRE_ROB_RD_OLD_USE ; |
---|
| 316 | delete [] in_RETIRE_ROB_RD_OLD_NUM_REG ; |
---|
| 317 | delete [] in_RETIRE_ROB_RD_NEW_USE ; |
---|
| 318 | delete [] in_RETIRE_ROB_RD_NEW_NUM_REG ; |
---|
| 319 | delete [] in_RETIRE_ROB_RE_OLD_USE ; |
---|
| 320 | delete [] in_RETIRE_ROB_RE_OLD_NUM_REG ; |
---|
| 321 | delete [] in_RETIRE_ROB_RE_NEW_USE ; |
---|
| 322 | delete [] in_RETIRE_ROB_RE_NEW_NUM_REG ; |
---|
| 323 | |
---|
| 324 | #endif |
---|
| 325 | |
---|
| 326 | delete _Execute_loop; |
---|
| 327 | #ifdef STATISTICS |
---|
| 328 | delete _parameters_statistics; |
---|
| 329 | #endif |
---|
| 330 | } |
---|