Changeset 88 for trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Context_State
- Timestamp:
- Dec 10, 2008, 7:31:39 PM (16 years ago)
- Location:
- trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Context_State
- Files:
-
- 16 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Context_State/SelfTest/Makefile
r83 r88 24 24 library_clean : Context_State_library_clean 25 25 26 local_clean : 27 26 28 include $(DIR_COMPONENT)/Makefile.deps 27 29 include $(DIR_MORPHEO)/Behavioural/Makefile.flags -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Context_State/SelfTest/config_min.cfg
r83 r88 2 2 1 1 +1 # nb_context 3 3 1 1 +1 # nb_decod_unit 4 1 1 +1 # nb_ooo_engine5 4 1 1 +1 # nb_inst_branch_complete 6 5 0 0 +1 # size_depth [0] [nb_context] 7 6 30 30 +1 # size_address 8 7 1 1 +1 # size_inst_decod [0] [nb_decod_unit] 9 1 1 +1 # size_inst_commit [0] [nb_ooo_engine]8 1 1 +1 # size_inst_commit 10 9 0 0 +1 # link_context_to_decod_unit [0] [nb_context] 11 0 0 +1 # link_decod_unit_to_ooo_engine [0] [nb_decod_unit] -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Context_State/SelfTest/config_mono_context.cfg
r83 r88 2 2 1 1 +1 # nb_context 3 3 1 1 *4 # nb_decod_unit 4 1 1 *4 # nb_ooo_engine5 4 1 4 *4 # nb_inst_branch_complete 6 5 0 2 +1 # size_depth [0] [nb_context] 7 6 30 30 +1 # size_address 8 7 1 4 *4 # size_inst_decod [0] [nb_decod_unit] 9 1 4 *4 # size_inst_commit [0] [nb_ooo_engine]8 1 4 *4 # size_inst_commit 10 9 0 0 +1 # link_context_to_decod_unit [0] [nb_context] 11 0 0 +1 # link_decod_unit_to_ooo_engine [0] [nb_decod_unit] -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Context_State/SelfTest/config_multi_context.cfg
r83 r88 2 2 8 8 +1 # nb_context 3 3 4 4 *4 # nb_decod_unit 4 2 2 *4 # nb_ooo_engine5 4 2 2 *4 # nb_inst_branch_complete 6 5 4 4 +1 # size_depth [0] [nb_context] … … 17 16 2 2 *4 # size_inst_decod [2] [nb_decod_unit] 18 17 4 4 *4 # size_inst_decod [3] [nb_decod_unit] 19 8 8 *4 # size_inst_commit [0] [nb_ooo_engine] 20 2 2 *4 # size_inst_commit [1] [nb_ooo_engine] 18 8 8 *4 # size_inst_commit 21 19 0 0 +1 # link_context_to_decod_unit [0] [nb_context] 22 20 1 1 +1 # link_context_to_decod_unit [1] [nb_context] … … 27 25 2 2 +1 # link_context_to_decod_unit [6] [nb_context] 28 26 3 3 +1 # link_context_to_decod_unit [7] [nb_context] 29 0 0 +1 # link_decod_unit_to_ooo_engine [0] [nb_decod_unit]30 1 1 +1 # link_decod_unit_to_ooo_engine [1] [nb_decod_unit]31 0 0 +1 # link_decod_unit_to_ooo_engine [2] [nb_decod_unit]32 1 1 +1 # link_decod_unit_to_ooo_engine [3] [nb_decod_unit] -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Context_State/SelfTest/src/main.cpp
r83 r88 16 16 err (_(" * nb_context (uint32_t)\n")); 17 17 err (_(" * nb_decod_unit (uint32_t)\n")); 18 err (_(" * nb_ooo_engine (uint32_t)\n"));19 18 err (_(" * nb_inst_branch_complete (uint32_t)\n")); 20 19 err (_(" * size_depth [nb_context] (uint32_t)\n")); 21 20 err (_(" * size_address (uint32_t)\n")); 22 21 err (_(" * size_inst_decod [nb_decod_unit] (uint32_t)\n")); 23 err (_(" * size_inst_commit [nb_ooo_engine](uint32_t)\n"));22 err (_(" * size_inst_commit (uint32_t)\n")); 24 23 err (_(" * link_context_to_decod_unit [nb_context] (uint32_t)\n")); 25 err (_(" * link_decod_unit_to_ooo_engine [nb_decod_unit] (uint32_t)\n"));26 24 27 25 exit (1); … … 45 43 uint32_t _nb_context = fromString<uint32_t>(argv[x++]); 46 44 uint32_t _nb_decod_unit = fromString<uint32_t>(argv[x++]); 47 uint32_t _nb_ooo_engine = fromString<uint32_t>(argv[x++]);48 45 uint32_t _nb_inst_branch_complete = fromString<uint32_t>(argv[x++]); 49 46 50 if (argc != static_cast<int>(2+NB_PARAMS+2*_nb_context+ 2*_nb_decod_unit+1*_nb_ooo_engine))47 if (argc != static_cast<int>(2+NB_PARAMS+2*_nb_context+1*_nb_decod_unit)) 51 48 usage (argc, argv); 52 49 … … 60 57 for (uint32_t i=0; i<_nb_decod_unit; i++) 61 58 _size_inst_decod [i] = fromString<uint32_t>(argv[x++]); 62 uint32_t * _size_inst_commit = new uint32_t [_nb_ooo_engine]; 63 for (uint32_t i=0; i<_nb_ooo_engine; i++) 64 _size_inst_commit [i] = fromString<uint32_t>(argv[x++]); 59 uint32_t _size_inst_commit = fromString<uint32_t>(argv[x++]); 65 60 uint32_t * _link_context_to_decod_unit = new uint32_t [_nb_context]; 66 61 for (uint32_t i=0; i<_nb_context; i++) 67 62 _link_context_to_decod_unit [i] = fromString<uint32_t>(argv[x++]); 68 uint32_t * _link_decod_unit_to_ooo_engine = new uint32_t [_nb_decod_unit];69 for (uint32_t i=0; i<_nb_decod_unit; i++)70 _link_decod_unit_to_ooo_engine [i] = fromString<uint32_t>(argv[x++]);71 63 72 64 int _return = EXIT_SUCCESS; … … 76 68 (_nb_context , 77 69 _nb_decod_unit , 78 _nb_ooo_engine ,79 70 _nb_inst_branch_complete , 80 71 _size_depth , … … 83 74 _size_inst_commit , 84 75 _link_context_to_decod_unit , 85 _link_decod_unit_to_ooo_engine76 true 86 77 ); 87 78 … … 98 89 delete [] _size_depth; 99 90 delete [] _size_inst_decod; 100 delete [] _size_inst_commit;101 91 delete [] _link_context_to_decod_unit; 102 delete [] _link_decod_unit_to_ooo_engine;103 92 104 93 try -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Context_State/SelfTest/src/test.cpp
r83 r88 48 48 sc_signal<Tcontrol_t> * in_NRESET = new sc_signal<Tcontrol_t> ("NRESET"); 49 49 50 ALLOC1_SC_SIGNAL( in_BRANCH_EVENT_VAL ," in_BRANCH_EVENT_VAL ",Tcontrol_t ,_param->_nb_context); 51 ALLOC1_SC_SIGNAL(out_BRANCH_EVENT_ACK ,"out_BRANCH_EVENT_ACK ",Tcontrol_t ,_param->_nb_context); 52 //ALLOC1_SC_SIGNAL( in_BRANCH_EVENT_CONTEXT_ID ," in_BRANCH_EVENT_CONTEXT_ID ",Tcontext_t ,_param->_nb_context); 53 //ALLOC1_SC_SIGNAL( in_BRANCH_EVENT_DEPTH ," in_BRANCH_EVENT_DEPTH ",Tdepth_t ,_param->_nb_context); 54 //ALLOC1_SC_SIGNAL( in_BRANCH_EVENT_MISS_PREDICTION ," in_BRANCH_EVENT_MISS_PREDICTION ",Tcontrol_t ,_param->_nb_context); 55 ALLOC1_SC_SIGNAL( in_BRANCH_EVENT_ADDRESS_SRC ," in_BRANCH_EVENT_ADDRESS_SRC ",Taddress_t ,_param->_nb_context); 56 ALLOC1_SC_SIGNAL( in_BRANCH_EVENT_ADDRESS_DEST ," in_BRANCH_EVENT_ADDRESS_DEST ",Taddress_t ,_param->_nb_context); 57 50 58 ALLOC1_SC_SIGNAL( in_DECOD_EVENT_VAL ," in_DECOD_EVENT_VAL ",Tcontrol_t ,_param->_nb_decod_unit); 51 59 ALLOC1_SC_SIGNAL(out_DECOD_EVENT_ACK ,"out_DECOD_EVENT_ACK ",Tcontrol_t ,_param->_nb_decod_unit); … … 57 65 ALLOC1_SC_SIGNAL( in_DECOD_EVENT_ADDRESS_EPCR ," in_DECOD_EVENT_ADDRESS_EPCR ",Taddress_t ,_param->_nb_decod_unit); 58 66 59 ALLOC 1_SC_SIGNAL( in_COMMIT_EVENT_VAL ," in_COMMIT_EVENT_VAL ",Tcontrol_t ,_param->_nb_ooo_engine);60 ALLOC 1_SC_SIGNAL(out_COMMIT_EVENT_ACK ,"out_COMMIT_EVENT_ACK ",Tcontrol_t ,_param->_nb_ooo_engine);61 ALLOC 1_SC_SIGNAL( in_COMMIT_EVENT_CONTEXT_ID ," in_COMMIT_EVENT_CONTEXT_ID ",Tcontext_t ,_param->_nb_ooo_engine);62 ALLOC 1_SC_SIGNAL( in_COMMIT_EVENT_DEPTH ," in_COMMIT_EVENT_DEPTH ",Tdepth_t ,_param->_nb_ooo_engine);63 ALLOC 1_SC_SIGNAL( in_COMMIT_EVENT_TYPE ," in_COMMIT_EVENT_TYPE ",Tevent_type_t,_param->_nb_ooo_engine);64 ALLOC 1_SC_SIGNAL( in_COMMIT_EVENT_IS_DELAY_SLOT ," in_COMMIT_EVENT_IS_DELAY_SLOT ",Tcontrol_t ,_param->_nb_ooo_engine);65 ALLOC 1_SC_SIGNAL( in_COMMIT_EVENT_ADDRESS ," in_COMMIT_EVENT_ADDRESS ",Taddress_t ,_param->_nb_ooo_engine);66 ALLOC 1_SC_SIGNAL( in_COMMIT_EVENT_ADDRESS_EPCR ," in_COMMIT_EVENT_ADDRESS_EPCR ",Taddress_t ,_param->_nb_ooo_engine);67 ALLOC 1_SC_SIGNAL( in_COMMIT_EVENT_ADDRESS_EEAR_VAL ," in_COMMIT_EVENT_ADDRESS_EEAR_VAL ",Tcontrol_t ,_param->_nb_ooo_engine);68 ALLOC 1_SC_SIGNAL( in_COMMIT_EVENT_ADDRESS_EEAR ," in_COMMIT_EVENT_ADDRESS_EEAR ",Taddress_t ,_param->_nb_ooo_engine);67 ALLOC_SC_SIGNAL ( in_COMMIT_EVENT_VAL ," in_COMMIT_EVENT_VAL ",Tcontrol_t ); 68 ALLOC_SC_SIGNAL (out_COMMIT_EVENT_ACK ,"out_COMMIT_EVENT_ACK ",Tcontrol_t ); 69 ALLOC_SC_SIGNAL ( in_COMMIT_EVENT_CONTEXT_ID ," in_COMMIT_EVENT_CONTEXT_ID ",Tcontext_t ); 70 ALLOC_SC_SIGNAL ( in_COMMIT_EVENT_DEPTH ," in_COMMIT_EVENT_DEPTH ",Tdepth_t ); 71 ALLOC_SC_SIGNAL ( in_COMMIT_EVENT_TYPE ," in_COMMIT_EVENT_TYPE ",Tevent_type_t); 72 ALLOC_SC_SIGNAL ( in_COMMIT_EVENT_IS_DELAY_SLOT ," in_COMMIT_EVENT_IS_DELAY_SLOT ",Tcontrol_t ); 73 ALLOC_SC_SIGNAL ( in_COMMIT_EVENT_ADDRESS ," in_COMMIT_EVENT_ADDRESS ",Taddress_t ); 74 ALLOC_SC_SIGNAL ( in_COMMIT_EVENT_ADDRESS_EPCR ," in_COMMIT_EVENT_ADDRESS_EPCR ",Taddress_t ); 75 ALLOC_SC_SIGNAL ( in_COMMIT_EVENT_ADDRESS_EEAR_VAL ," in_COMMIT_EVENT_ADDRESS_EEAR_VAL ",Tcontrol_t ); 76 ALLOC_SC_SIGNAL ( in_COMMIT_EVENT_ADDRESS_EEAR ," in_COMMIT_EVENT_ADDRESS_EEAR ",Taddress_t ); 69 77 70 78 ALLOC1_SC_SIGNAL( in_BRANCH_COMPLETE_VAL ," in_BRANCH_COMPLETE_VAL ",Tcontrol_t ,_param->_nb_inst_branch_complete); … … 78 86 79 87 80 ALLOC1_SC_SIGNAL( in_NB_INST_DECOD_ALL ," in_NB_INST_DECOD_ALL ",Tcounter_t ,_param->_nb_ decod_unit);81 ALLOC1_SC_SIGNAL( in_NB_INST_COMMIT_ALL ," in_NB_INST_COMMIT_ALL ",Tcounter_t ,_param->_nb_ ooo_engine);82 ALLOC1_SC_SIGNAL( in_NB_INST_COMMIT_MEM ," in_NB_INST_COMMIT_MEM ",Tcounter_t ,_param->_nb_ ooo_engine);88 ALLOC1_SC_SIGNAL( in_NB_INST_DECOD_ALL ," in_NB_INST_DECOD_ALL ",Tcounter_t ,_param->_nb_context ); 89 ALLOC1_SC_SIGNAL( in_NB_INST_COMMIT_ALL ," in_NB_INST_COMMIT_ALL ",Tcounter_t ,_param->_nb_context ); 90 ALLOC1_SC_SIGNAL( in_NB_INST_COMMIT_MEM ," in_NB_INST_COMMIT_MEM ",Tcounter_t ,_param->_nb_context ); 83 91 84 92 ALLOC1_SC_SIGNAL(out_EVENT_VAL ,"out_EVENT_VAL ",Tcontrol_t ,_param->_nb_context ); … … 89 97 ALLOC1_SC_SIGNAL(out_EVENT_IS_DS_TAKE ,"out_EVENT_IS_DS_TAKE ",Tcontrol_t ,_param->_nb_context ); 90 98 91 ALLOC1_SC_SIGNAL(out_SPR_ VAL ,"out_SPR_VAL",Tcontrol_t ,_param->_nb_context );92 ALLOC1_SC_SIGNAL( in_SPR_ ACK ," in_SPR_ACK",Tcontrol_t ,_param->_nb_context );93 ALLOC1_SC_SIGNAL(out_SPR_E PCR ,"out_SPR_EPCR",Taddress_t ,_param->_nb_context );94 ALLOC1_SC_SIGNAL(out_SPR_E EAR ,"out_SPR_EEAR",Taddress_t ,_param->_nb_context );95 ALLOC1_SC_SIGNAL(out_SPR_E EAR_WEN ,"out_SPR_EEAR_WEN",Tcontrol_t ,_param->_nb_context );96 ALLOC1_SC_SIGNAL(out_SPR_ SR_DSX ,"out_SPR_SR_DSX",Tcontrol_t ,_param->_nb_context );97 ALLOC1_SC_SIGNAL(out_SPR_ SR_TO_ESR ,"out_SPR_SR_TO_ESR",Tcontrol_t ,_param->_nb_context );99 ALLOC1_SC_SIGNAL(out_SPR_EVENT_VAL ,"out_SPR_EVENT_VAL ",Tcontrol_t ,_param->_nb_context ); 100 ALLOC1_SC_SIGNAL( in_SPR_EVENT_ACK ," in_SPR_EVENT_ACK ",Tcontrol_t ,_param->_nb_context ); 101 ALLOC1_SC_SIGNAL(out_SPR_EVENT_EPCR ,"out_SPR_EVENT_EPCR ",Taddress_t ,_param->_nb_context ); 102 ALLOC1_SC_SIGNAL(out_SPR_EVENT_EEAR ,"out_SPR_EVENT_EEAR ",Taddress_t ,_param->_nb_context ); 103 ALLOC1_SC_SIGNAL(out_SPR_EVENT_EEAR_WEN ,"out_SPR_EVENT_EEAR_WEN ",Tcontrol_t ,_param->_nb_context ); 104 ALLOC1_SC_SIGNAL(out_SPR_EVENT_SR_DSX ,"out_SPR_EVENT_SR_DSX ",Tcontrol_t ,_param->_nb_context ); 105 ALLOC1_SC_SIGNAL(out_SPR_EVENT_SR_TO_ESR ,"out_SPR_EVENT_SR_TO_ESR ",Tcontrol_t ,_param->_nb_context ); 98 106 99 107 ALLOC1_SC_SIGNAL(out_CONTEXT_DECOD_ENABLE ,"out_CONTEXT_DECOD_ENABLE ",Tcontrol_t ,_param->_nb_context ); 100 108 101 ALLOC1_SC_SIGNAL( in_DEPTH_ TAIL ," in_DEPTH_TAIL",Tdepth_t ,_param->_nb_context );109 ALLOC1_SC_SIGNAL( in_DEPTH_MIN ," in_DEPTH_MIN ",Tdepth_t ,_param->_nb_context ); 102 110 111 ALLOC1_SC_SIGNAL( in_SPR_SR_IEE ," in_SPR_SR_IEE ",Tcontrol_t ,_param->_nb_context ); 112 ALLOC1_SC_SIGNAL( in_SPR_SR_EPH ," in_SPR_SR_EPH ",Tcontrol_t ,_param->_nb_context ); 113 114 ALLOC1_SC_SIGNAL( in_INTERRUPT_ENABLE ," in_INTERRUPT_ENABLE ",Tcontrol_t ,_param->_nb_context ); 115 103 116 /******************************************************** 104 117 * Instanciation … … 110 123 (*(_Context_State->in_NRESET)) (*(in_NRESET)); 111 124 125 INSTANCE1_SC_SIGNAL(_Context_State, in_BRANCH_EVENT_VAL ,_param->_nb_context); 126 INSTANCE1_SC_SIGNAL(_Context_State,out_BRANCH_EVENT_ACK ,_param->_nb_context); 127 //INSTANCE1_SC_SIGNAL(_Context_State, in_BRANCH_EVENT_CONTEXT_ID ,_param->_nb_context); 128 //INSTANCE1_SC_SIGNAL(_Context_State, in_BRANCH_EVENT_DEPTH ,_param->_nb_context); 129 //INSTANCE1_SC_SIGNAL(_Context_State, in_BRANCH_EVENT_MISS_PREDICTION ,_param->_nb_context); 130 INSTANCE1_SC_SIGNAL(_Context_State, in_BRANCH_EVENT_ADDRESS_SRC ,_param->_nb_context); 131 INSTANCE1_SC_SIGNAL(_Context_State, in_BRANCH_EVENT_ADDRESS_DEST ,_param->_nb_context); 112 132 INSTANCE1_SC_SIGNAL(_Context_State, in_DECOD_EVENT_VAL ,_param->_nb_decod_unit); 113 133 INSTANCE1_SC_SIGNAL(_Context_State,out_DECOD_EVENT_ACK ,_param->_nb_decod_unit); 114 134 if (_param->_have_port_context_id) 115 135 INSTANCE1_SC_SIGNAL(_Context_State, in_DECOD_EVENT_CONTEXT_ID ,_param->_nb_decod_unit); 116 if (_param->_have_port_ max_depth)136 if (_param->_have_port_depth) 117 137 INSTANCE1_SC_SIGNAL(_Context_State, in_DECOD_EVENT_DEPTH ,_param->_nb_decod_unit); 118 138 INSTANCE1_SC_SIGNAL(_Context_State, in_DECOD_EVENT_TYPE ,_param->_nb_decod_unit); … … 121 141 INSTANCE1_SC_SIGNAL(_Context_State, in_DECOD_EVENT_ADDRESS_EPCR ,_param->_nb_decod_unit); 122 142 123 INSTANCE 1_SC_SIGNAL(_Context_State, in_COMMIT_EVENT_VAL ,_param->_nb_ooo_engine);124 INSTANCE 1_SC_SIGNAL(_Context_State,out_COMMIT_EVENT_ACK ,_param->_nb_ooo_engine);143 INSTANCE_SC_SIGNAL (_Context_State, in_COMMIT_EVENT_VAL ); 144 INSTANCE_SC_SIGNAL (_Context_State,out_COMMIT_EVENT_ACK ); 125 145 if (_param->_have_port_context_id) 126 INSTANCE 1_SC_SIGNAL(_Context_State, in_COMMIT_EVENT_CONTEXT_ID ,_param->_nb_ooo_engine);127 if (_param->_have_port_ max_depth)128 INSTANCE 1_SC_SIGNAL(_Context_State, in_COMMIT_EVENT_DEPTH ,_param->_nb_ooo_engine);129 INSTANCE 1_SC_SIGNAL(_Context_State, in_COMMIT_EVENT_TYPE ,_param->_nb_ooo_engine);130 INSTANCE 1_SC_SIGNAL(_Context_State, in_COMMIT_EVENT_IS_DELAY_SLOT ,_param->_nb_ooo_engine);131 INSTANCE 1_SC_SIGNAL(_Context_State, in_COMMIT_EVENT_ADDRESS ,_param->_nb_ooo_engine);132 INSTANCE 1_SC_SIGNAL(_Context_State, in_COMMIT_EVENT_ADDRESS_EPCR ,_param->_nb_ooo_engine);133 INSTANCE 1_SC_SIGNAL(_Context_State, in_COMMIT_EVENT_ADDRESS_EEAR_VAL ,_param->_nb_ooo_engine);134 INSTANCE 1_SC_SIGNAL(_Context_State, in_COMMIT_EVENT_ADDRESS_EEAR ,_param->_nb_ooo_engine);146 INSTANCE_SC_SIGNAL (_Context_State, in_COMMIT_EVENT_CONTEXT_ID ); 147 if (_param->_have_port_depth) 148 INSTANCE_SC_SIGNAL (_Context_State, in_COMMIT_EVENT_DEPTH ); 149 INSTANCE_SC_SIGNAL (_Context_State, in_COMMIT_EVENT_TYPE ); 150 INSTANCE_SC_SIGNAL (_Context_State, in_COMMIT_EVENT_IS_DELAY_SLOT ); 151 INSTANCE_SC_SIGNAL (_Context_State, in_COMMIT_EVENT_ADDRESS ); 152 INSTANCE_SC_SIGNAL (_Context_State, in_COMMIT_EVENT_ADDRESS_EPCR ); 153 INSTANCE_SC_SIGNAL (_Context_State, in_COMMIT_EVENT_ADDRESS_EEAR_VAL ); 154 INSTANCE_SC_SIGNAL (_Context_State, in_COMMIT_EVENT_ADDRESS_EEAR ); 135 155 136 156 INSTANCE1_SC_SIGNAL(_Context_State, in_BRANCH_COMPLETE_VAL ,_param->_nb_inst_branch_complete); … … 138 158 if (_param->_have_port_context_id) 139 159 INSTANCE1_SC_SIGNAL(_Context_State, in_BRANCH_COMPLETE_CONTEXT_ID ,_param->_nb_inst_branch_complete); 140 if (_param->_have_port_ max_depth)160 if (_param->_have_port_depth) 141 161 INSTANCE1_SC_SIGNAL(_Context_State, in_BRANCH_COMPLETE_DEPTH ,_param->_nb_inst_branch_complete); 142 162 INSTANCE1_SC_SIGNAL(_Context_State, in_BRANCH_COMPLETE_MISS_PREDICTION,_param->_nb_inst_branch_complete); … … 145 165 INSTANCE1_SC_SIGNAL(_Context_State, in_BRANCH_COMPLETE_ADDRESS_DEST ,_param->_nb_inst_branch_complete); 146 166 147 INSTANCE1_SC_SIGNAL(_Context_State, in_NB_INST_DECOD_ALL ,_param->_nb_ decod_unit);148 INSTANCE1_SC_SIGNAL(_Context_State, in_NB_INST_COMMIT_ALL ,_param->_nb_ ooo_engine);149 INSTANCE1_SC_SIGNAL(_Context_State, in_NB_INST_COMMIT_MEM ,_param->_nb_ ooo_engine);167 INSTANCE1_SC_SIGNAL(_Context_State, in_NB_INST_DECOD_ALL ,_param->_nb_context ); 168 INSTANCE1_SC_SIGNAL(_Context_State, in_NB_INST_COMMIT_ALL ,_param->_nb_context ); 169 INSTANCE1_SC_SIGNAL(_Context_State, in_NB_INST_COMMIT_MEM ,_param->_nb_context ); 150 170 151 171 INSTANCE1_SC_SIGNAL(_Context_State,out_EVENT_VAL ,_param->_nb_context ); … … 156 176 INSTANCE1_SC_SIGNAL(_Context_State,out_EVENT_IS_DS_TAKE ,_param->_nb_context ); 157 177 158 INSTANCE1_SC_SIGNAL(_Context_State,out_SPR_ VAL,_param->_nb_context );159 INSTANCE1_SC_SIGNAL(_Context_State, in_SPR_ ACK,_param->_nb_context );160 INSTANCE1_SC_SIGNAL(_Context_State,out_SPR_E PCR,_param->_nb_context );161 INSTANCE1_SC_SIGNAL(_Context_State,out_SPR_E EAR,_param->_nb_context );162 INSTANCE1_SC_SIGNAL(_Context_State,out_SPR_E EAR_WEN,_param->_nb_context );163 INSTANCE1_SC_SIGNAL(_Context_State,out_SPR_ SR_DSX,_param->_nb_context );164 INSTANCE1_SC_SIGNAL(_Context_State,out_SPR_ SR_TO_ESR,_param->_nb_context );178 INSTANCE1_SC_SIGNAL(_Context_State,out_SPR_EVENT_VAL ,_param->_nb_context ); 179 INSTANCE1_SC_SIGNAL(_Context_State, in_SPR_EVENT_ACK ,_param->_nb_context ); 180 INSTANCE1_SC_SIGNAL(_Context_State,out_SPR_EVENT_EPCR ,_param->_nb_context ); 181 INSTANCE1_SC_SIGNAL(_Context_State,out_SPR_EVENT_EEAR ,_param->_nb_context ); 182 INSTANCE1_SC_SIGNAL(_Context_State,out_SPR_EVENT_EEAR_WEN ,_param->_nb_context ); 183 INSTANCE1_SC_SIGNAL(_Context_State,out_SPR_EVENT_SR_DSX ,_param->_nb_context ); 184 INSTANCE1_SC_SIGNAL(_Context_State,out_SPR_EVENT_SR_TO_ESR ,_param->_nb_context ); 165 185 166 186 INSTANCE1_SC_SIGNAL(_Context_State,out_CONTEXT_DECOD_ENABLE ,_param->_nb_context ); 167 187 168 188 for (uint32_t i=0; i<_param->_nb_context; i++) 169 if (_param->_have_port_depth [i]) 170 INSTANCE_SC_SIGNAL(_Context_State, in_DEPTH_TAIL [i]); 189 if (_param->_have_port_depth) 190 INSTANCE_SC_SIGNAL(_Context_State, in_DEPTH_MIN [i]); 191 192 INSTANCE1_SC_SIGNAL(_Context_State, in_SPR_SR_IEE ,_param->_nb_context ); 193 INSTANCE1_SC_SIGNAL(_Context_State, in_SPR_SR_EPH ,_param->_nb_context ); 194 195 INSTANCE1_SC_SIGNAL(_Context_State, in_INTERRUPT_ENABLE ,_param->_nb_context ); 171 196 172 197 msg(_("<%s> : Start Simulation ............\n"),name.c_str()); … … 206 231 for (uint32_t i=0; i<_param->_nb_decod_unit; i++) 207 232 in_DECOD_EVENT_VAL [i]->write(0); 208 for (uint32_t i=0; i<_param->_nb_ooo_engine; i++) 209 in_COMMIT_EVENT_VAL [i]->write(0); 233 in_COMMIT_EVENT_VAL ->write(0); 210 234 for (uint32_t i=0; i<_param->_nb_inst_branch_complete; i++) 211 235 in_BRANCH_COMPLETE_VAL [i]->write(0); … … 213 237 for (uint32_t i=0; i<_param->_nb_context; i++) 214 238 { 215 in_EVENT_ACK [i]->write(0); 216 in_SPR_ACK [i]->write(0); 239 in_BRANCH_EVENT_VAL [i]->write(0); 240 in_EVENT_ACK [i]->write(0); 241 in_SPR_EVENT_ACK [i]->write(0); 242 in_SPR_SR_IEE [i]->write(0); 243 in_SPR_SR_EPH [i]->write(0); 244 in_INTERRUPT_ENABLE [i]->write(0); 217 245 218 246 TEST(Tcontrol_t, out_CONTEXT_DECOD_ENABLE[i]->read(), 1); … … 220 248 221 249 for (uint32_t i=0; i<_param->_nb_context; i++) 222 if (_param->_have_port_depth [i])223 in_DEPTH_ TAIL [i]->write(i%_param->_size_depth[i]);250 if (_param->_have_port_depth) 251 in_DEPTH_MIN [i]->write((_param->_array_size_depth[i]==0)?0:(i%_param->_array_size_depth[i])); 224 252 225 253 uint32_t context = rand()%_param->_nb_context; 226 uint32_t decod_unit = _param->_link_context_to_decod_unit [context];227 uint32_t ooo_engine = _param->_link_decod_unit_to_ooo_engine [decod_unit];228 254 229 255 if (1) … … 232 258 233 259 LABEL("msync (begin)"); 234 in_NB_INST_DECOD_ALL [ decod_unit]->write(1);235 in_NB_INST_COMMIT_ALL [ ooo_engine]->write(1);236 in_NB_INST_COMMIT_MEM [ ooo_engine]->write(1);260 in_NB_INST_DECOD_ALL [context]->write(1); 261 in_NB_INST_COMMIT_ALL [context]->write(1); 262 in_NB_INST_COMMIT_MEM [context]->write(1); 237 263 238 264 uint32_t port = rand()%_param->_nb_decod_unit; … … 242 268 in_DECOD_EVENT_ADDRESS [port]->write(0x100); 243 269 in_DECOD_EVENT_ADDRESS_EPCR [port]->write(0xdeadbeef); 244 if (_param->_have_port_depth [context])245 in_DECOD_EVENT_DEPTH [port]->write(( context+1)%_param->_size_depth[context]);270 if (_param->_have_port_depth) 271 in_DECOD_EVENT_DEPTH [port]->write((_param->_array_size_depth[context]==0)?0:((context+1)%_param->_array_size_depth[context])); 246 272 in_DECOD_EVENT_TYPE [port]->write(EVENT_TYPE_MSYNC); 247 273 … … 263 289 SC_START(3); 264 290 265 in_NB_INST_DECOD_ALL [ decod_unit]->write(0);266 in_NB_INST_COMMIT_ALL [ ooo_engine]->write(1);267 in_NB_INST_COMMIT_MEM [ ooo_engine]->write(0);291 in_NB_INST_DECOD_ALL [context]->write(0); 292 in_NB_INST_COMMIT_ALL [context]->write(1); 293 in_NB_INST_COMMIT_MEM [context]->write(0); 268 294 269 295 SC_START(1); … … 274 300 SC_START(3); 275 301 276 in_NB_INST_DECOD_ALL [ decod_unit]->write(1);302 in_NB_INST_DECOD_ALL [context]->write(1); 277 303 SC_START(1); 278 304 279 305 LABEL("msync (wait end)"); 280 306 TEST(Tcontrol_t, out_CONTEXT_DECOD_ENABLE[context]->read(), 0); 281 in_NB_INST_DECOD_ALL [ decod_unit]->write(0);282 in_NB_INST_COMMIT_MEM [ ooo_engine]->write(1);283 284 SC_START(3); 285 286 in_NB_INST_COMMIT_MEM [ ooo_engine]->write(0);307 in_NB_INST_DECOD_ALL [context]->write(0); 308 in_NB_INST_COMMIT_MEM [context]->write(1); 309 310 SC_START(3); 311 312 in_NB_INST_COMMIT_MEM [context]->write(0); 287 313 SC_START(1); 288 314 TEST(Tcontrol_t, out_CONTEXT_DECOD_ENABLE[context]->read(), 1); … … 294 320 295 321 LABEL("psync (begin)"); 296 in_NB_INST_DECOD_ALL [ decod_unit]->write(1);297 in_NB_INST_COMMIT_ALL [ ooo_engine]->write(1);298 in_NB_INST_COMMIT_MEM [ ooo_engine]->write(1);322 in_NB_INST_DECOD_ALL [context]->write(1); 323 in_NB_INST_COMMIT_ALL [context]->write(1); 324 in_NB_INST_COMMIT_MEM [context]->write(1); 299 325 300 326 uint32_t port = rand()%_param->_nb_decod_unit; … … 304 330 in_DECOD_EVENT_ADDRESS [port]->write(0x200); 305 331 in_DECOD_EVENT_ADDRESS_EPCR [port]->write(0xdeadbebe); 306 if (_param->_have_port_depth [context])307 in_DECOD_EVENT_DEPTH [port]->write((context+1)%_param->_size_depth[context]);332 if (_param->_have_port_depth) 333 in_DECOD_EVENT_DEPTH [port]->write((_param->_array_size_depth[context]==0)?0:((context+1)%_param->_array_size_depth[context])); 308 334 in_DECOD_EVENT_TYPE [port]->write(EVENT_TYPE_PSYNC); 309 335 … … 325 351 SC_START(3); 326 352 327 in_NB_INST_DECOD_ALL [ decod_unit]->write(0);328 in_NB_INST_COMMIT_ALL [ ooo_engine]->write(0);329 in_NB_INST_COMMIT_MEM [ ooo_engine]->write(0);353 in_NB_INST_DECOD_ALL [context]->write(0); 354 in_NB_INST_COMMIT_ALL [context]->write(0); 355 in_NB_INST_COMMIT_MEM [context]->write(0); 330 356 331 357 SC_START(1); … … 361 387 362 388 LABEL("csync (begin)"); 363 in_NB_INST_DECOD_ALL [ decod_unit]->write(1);364 in_NB_INST_COMMIT_ALL [ ooo_engine]->write(1);365 in_NB_INST_COMMIT_MEM [ ooo_engine]->write(1);389 in_NB_INST_DECOD_ALL [context]->write(1); 390 in_NB_INST_COMMIT_ALL [context]->write(1); 391 in_NB_INST_COMMIT_MEM [context]->write(1); 366 392 367 393 uint32_t port = rand()%_param->_nb_decod_unit; … … 371 397 in_DECOD_EVENT_ADDRESS [port]->write(0x200); 372 398 in_DECOD_EVENT_ADDRESS_EPCR [port]->write(0xdeadbebe); 373 if (_param->_have_port_depth [context])374 in_DECOD_EVENT_DEPTH [port]->write(( context+1)%_param->_size_depth[context]);399 if (_param->_have_port_depth) 400 in_DECOD_EVENT_DEPTH [port]->write((_param->_array_size_depth[context]==0)?0:((context+1)%_param->_array_size_depth[context])); 375 401 in_DECOD_EVENT_TYPE [port]->write(EVENT_TYPE_CSYNC); 376 402 … … 392 418 SC_START(3); 393 419 394 in_NB_INST_DECOD_ALL [ decod_unit]->write(0);395 in_NB_INST_COMMIT_ALL [ ooo_engine]->write(0);396 in_NB_INST_COMMIT_MEM [ ooo_engine]->write(0);420 in_NB_INST_DECOD_ALL [context]->write(0); 421 in_NB_INST_COMMIT_ALL [context]->write(0); 422 in_NB_INST_COMMIT_MEM [context]->write(0); 397 423 398 424 SC_START(1); … … 426 452 427 453 LABEL("spr (begin)"); 428 in_NB_INST_DECOD_ALL [ decod_unit]->write(1);429 in_NB_INST_COMMIT_ALL [ ooo_engine]->write(1);430 in_NB_INST_COMMIT_MEM [ ooo_engine]->write(1);454 in_NB_INST_DECOD_ALL [context]->write(1); 455 in_NB_INST_COMMIT_ALL [context]->write(1); 456 in_NB_INST_COMMIT_MEM [context]->write(1); 431 457 432 458 uint32_t port = rand()%_param->_nb_decod_unit; … … 436 462 in_DECOD_EVENT_ADDRESS [port]->write(0x100); 437 463 in_DECOD_EVENT_ADDRESS_EPCR [port]->write(0xdeadbeef); 438 if (_param->_have_port_depth [context])439 in_DECOD_EVENT_DEPTH [port]->write(( context+1)%_param->_size_depth[context]);464 if (_param->_have_port_depth) 465 in_DECOD_EVENT_DEPTH [port]->write((_param->_array_size_depth[context]==0)?0:((context+1)%_param->_array_size_depth[context])); 440 466 in_DECOD_EVENT_TYPE [port]->write(EVENT_TYPE_SPR_ACCESS); 441 467 … … 457 483 SC_START(3); 458 484 459 in_NB_INST_DECOD_ALL [ decod_unit]->write(0);460 in_NB_INST_COMMIT_ALL [ ooo_engine]->write(0);461 in_NB_INST_COMMIT_MEM [ ooo_engine]->write(0);485 in_NB_INST_DECOD_ALL [context]->write(0); 486 in_NB_INST_COMMIT_ALL [context]->write(0); 487 in_NB_INST_COMMIT_MEM [context]->write(0); 462 488 463 489 SC_START(1); … … 468 494 SC_START(3); 469 495 470 in_NB_INST_DECOD_ALL [ decod_unit]->write(1);496 in_NB_INST_DECOD_ALL [context]->write(1); 471 497 SC_START(1); 472 498 473 499 LABEL("spr (wait end)"); 474 500 TEST(Tcontrol_t, out_CONTEXT_DECOD_ENABLE[context]->read(), 0); 475 in_NB_INST_DECOD_ALL [ decod_unit]->write(0);476 in_NB_INST_COMMIT_ALL [ ooo_engine]->write(1);477 478 SC_START(3); 479 480 in_NB_INST_COMMIT_ALL [ ooo_engine]->write(0);501 in_NB_INST_DECOD_ALL [context]->write(0); 502 in_NB_INST_COMMIT_ALL [context]->write(1); 503 504 SC_START(3); 505 506 in_NB_INST_COMMIT_ALL [context]->write(0); 481 507 SC_START(1); 482 508 TEST(Tcontrol_t, out_CONTEXT_DECOD_ENABLE[context]->read(), 1); … … 488 514 489 515 LABEL("miss (begin)"); 490 in_NB_INST_DECOD_ALL [ decod_unit]->write(1);491 in_NB_INST_COMMIT_ALL [ ooo_engine]->write(1);492 in_NB_INST_COMMIT_MEM [ ooo_engine]->write(1);516 in_NB_INST_DECOD_ALL [context]->write(1); 517 in_NB_INST_COMMIT_ALL [context]->write(1); 518 in_NB_INST_COMMIT_MEM [context]->write(1); 493 519 494 520 uint32_t port = rand()%_param->_nb_inst_branch_complete; 495 521 496 522 in_BRANCH_COMPLETE_CONTEXT_ID [port]->write(context); 497 if (_param->_have_port_depth [context])498 in_BRANCH_COMPLETE_DEPTH [port]->write(( context+1)%_param->_size_depth[context]);523 if (_param->_have_port_depth) 524 in_BRANCH_COMPLETE_DEPTH [port]->write((_param->_array_size_depth[context]==0)?0:((context+1)%_param->_array_size_depth[context])); 499 525 in_BRANCH_COMPLETE_ADDRESS_SRC [port]->write(0x400); 500 526 in_BRANCH_COMPLETE_ADDRESS_DEST [port]->write(0x500); … … 519 545 SC_START(3); 520 546 521 in_NB_INST_DECOD_ALL [ decod_unit]->write(0);522 in_NB_INST_COMMIT_ALL [ ooo_engine]->write(0);523 in_NB_INST_COMMIT_MEM [ ooo_engine]->write(0);547 in_NB_INST_DECOD_ALL [context]->write(0); 548 in_NB_INST_COMMIT_ALL [context]->write(0); 549 in_NB_INST_COMMIT_MEM [context]->write(0); 524 550 525 551 SC_START(1); … … 558 584 559 585 LABEL("miss (begin)"); 560 in_NB_INST_DECOD_ALL [ decod_unit]->write(1);561 in_NB_INST_COMMIT_ALL [ ooo_engine]->write(1);562 in_NB_INST_COMMIT_MEM [ ooo_engine]->write(1);586 in_NB_INST_DECOD_ALL [context]->write(1); 587 in_NB_INST_COMMIT_ALL [context]->write(1); 588 in_NB_INST_COMMIT_MEM [context]->write(1); 563 589 564 590 uint32_t port = rand()%_param->_nb_inst_branch_complete; 565 591 566 592 in_BRANCH_COMPLETE_CONTEXT_ID [port]->write(context); 567 if (_param->_have_port_depth [context])568 in_BRANCH_COMPLETE_DEPTH [port]->write(( context+1)%_param->_size_depth[context]);593 if (_param->_have_port_depth) 594 in_BRANCH_COMPLETE_DEPTH [port]->write((_param->_array_size_depth[context]==0)?0:((context+1)%_param->_array_size_depth[context])); 569 595 in_BRANCH_COMPLETE_ADDRESS_SRC [port]->write(0x600); 570 596 in_BRANCH_COMPLETE_ADDRESS_DEST [port]->write(0x700); … … 589 615 SC_START(3); 590 616 591 in_NB_INST_DECOD_ALL [ decod_unit]->write(0);592 in_NB_INST_COMMIT_ALL [ ooo_engine]->write(0);593 in_NB_INST_COMMIT_MEM [ ooo_engine]->write(0);617 in_NB_INST_DECOD_ALL [context]->write(0); 618 in_NB_INST_COMMIT_ALL [context]->write(0); 619 in_NB_INST_COMMIT_MEM [context]->write(0); 594 620 595 621 SC_START(1); … … 626 652 627 653 LABEL("exception (begin)"); 628 in_NB_INST_DECOD_ALL [ decod_unit]->write(1);629 in_NB_INST_COMMIT_ALL [ ooo_engine]->write(1);630 in_NB_INST_COMMIT_MEM [ ooo_engine]->write(1);631 632 uint32_t port = rand()%_param->_nb_ ooo_engine;654 in_NB_INST_DECOD_ALL [context]->write(1); 655 in_NB_INST_COMMIT_ALL [context]->write(1); 656 in_NB_INST_COMMIT_MEM [context]->write(1); 657 658 uint32_t port = rand()%_param->_nb_decod_unit; 633 659 634 660 in_DECOD_EVENT_CONTEXT_ID [port]->write(context); 635 if (_param->_have_port_depth [context])636 in_DECOD_EVENT_DEPTH [port]->write(( context)%_param->_size_depth[context]);661 if (_param->_have_port_depth) 662 in_DECOD_EVENT_DEPTH [port]->write((_param->_array_size_depth[context]==0)?0:((context)%_param->_array_size_depth[context])); 637 663 in_DECOD_EVENT_TYPE [port]->write(EVENT_TYPE_EXCEPTION); 638 664 in_DECOD_EVENT_IS_DELAY_SLOT [port]->write(0); … … 657 683 SC_START(3); 658 684 659 in_NB_INST_DECOD_ALL [ decod_unit]->write(0);660 in_NB_INST_COMMIT_ALL [ ooo_engine]->write(0);661 in_NB_INST_COMMIT_MEM [ ooo_engine]->write(0);685 in_NB_INST_DECOD_ALL [context]->write(0); 686 in_NB_INST_COMMIT_ALL [context]->write(0); 687 in_NB_INST_COMMIT_MEM [context]->write(0); 662 688 663 689 SC_START(1); … … 693 719 do 694 720 { 695 in_SPR_ ACK [context]->write(rand()%percent_transaction_spr);696 697 SC_START(0); 698 699 if (out_SPR_ VAL [context]->read() and in_SPR_ACK [context]->read())700 { 701 TEST(Taddress_t,out_SPR_E PCR [context]->read(),0x900);702 //TEST(Taddress_t,out_SPR_E EAR [context]->read(),);703 TEST(Tcontrol_t,out_SPR_E EAR_WEN [context]->read(),0);704 TEST(Tcontrol_t,out_SPR_ SR_DSX [context]->read(),0);705 TEST(Tcontrol_t,out_SPR_ SR_TO_ESR [context]->read(),1);706 707 find = true; 708 } 709 710 SC_START(1); 711 } 712 while (not find); 713 714 in_SPR_ ACK [context]->write(0);721 in_SPR_EVENT_ACK [context]->write(rand()%percent_transaction_spr); 722 723 SC_START(0); 724 725 if (out_SPR_EVENT_VAL [context]->read() and in_SPR_EVENT_ACK [context]->read()) 726 { 727 TEST(Taddress_t,out_SPR_EVENT_EPCR [context]->read(),0x900); 728 //TEST(Taddress_t,out_SPR_EVENT_EEAR [context]->read(),); 729 TEST(Tcontrol_t,out_SPR_EVENT_EEAR_WEN [context]->read(),0); 730 TEST(Tcontrol_t,out_SPR_EVENT_SR_DSX [context]->read(),0); 731 TEST(Tcontrol_t,out_SPR_EVENT_SR_TO_ESR [context]->read(),1); 732 733 find = true; 734 } 735 736 SC_START(1); 737 } 738 while (not find); 739 740 in_SPR_EVENT_ACK [context]->write(0); 715 741 } 716 742 … … 720 746 721 747 LABEL("exception (begin)"); 722 in_NB_INST_DECOD_ALL [ decod_unit]->write(1);723 in_NB_INST_COMMIT_ALL [ ooo_engine]->write(1);724 in_NB_INST_COMMIT_MEM [ ooo_engine]->write(1);725 726 uint32_t port = rand()%_param->_nb_ ooo_engine;748 in_NB_INST_DECOD_ALL [context]->write(1); 749 in_NB_INST_COMMIT_ALL [context]->write(1); 750 in_NB_INST_COMMIT_MEM [context]->write(1); 751 752 uint32_t port = rand()%_param->_nb_decod_unit; 727 753 728 754 in_DECOD_EVENT_CONTEXT_ID [port]->write(context); 729 if (_param->_have_port_depth [context])730 in_DECOD_EVENT_DEPTH [port]->write(( context)%_param->_size_depth[context]);755 if (_param->_have_port_depth) 756 in_DECOD_EVENT_DEPTH [port]->write((_param->_array_size_depth[context]==0)?0:((context)%_param->_array_size_depth[context])); 731 757 in_DECOD_EVENT_TYPE [port]->write(EVENT_TYPE_EXCEPTION); 732 758 in_DECOD_EVENT_IS_DELAY_SLOT [port]->write(1); … … 751 777 SC_START(3); 752 778 753 in_NB_INST_DECOD_ALL [ decod_unit]->write(0);754 in_NB_INST_COMMIT_ALL [ ooo_engine]->write(0);755 in_NB_INST_COMMIT_MEM [ ooo_engine]->write(0);779 in_NB_INST_DECOD_ALL [context]->write(0); 780 in_NB_INST_COMMIT_ALL [context]->write(0); 781 in_NB_INST_COMMIT_MEM [context]->write(0); 756 782 757 783 SC_START(1); … … 787 813 do 788 814 { 789 in_SPR_ ACK [context]->write(rand()%percent_transaction_spr);790 791 SC_START(0); 792 793 if (out_SPR_ VAL [context]->read() and in_SPR_ACK [context]->read())794 { 795 TEST(Taddress_t,out_SPR_E PCR [context]->read(),0x900);796 //TEST(Taddress_t,out_SPR_E EAR [context]->read(),);797 TEST(Tcontrol_t,out_SPR_E EAR_WEN [context]->read(),0);798 TEST(Tcontrol_t,out_SPR_ SR_DSX [context]->read(),1);799 TEST(Tcontrol_t,out_SPR_ SR_TO_ESR [context]->read(),1);800 801 find = true; 802 } 803 804 SC_START(1); 805 } 806 while (not find); 807 808 in_SPR_ ACK [context]->write(0);815 in_SPR_EVENT_ACK [context]->write(rand()%percent_transaction_spr); 816 817 SC_START(0); 818 819 if (out_SPR_EVENT_VAL [context]->read() and in_SPR_EVENT_ACK [context]->read()) 820 { 821 TEST(Taddress_t,out_SPR_EVENT_EPCR [context]->read(),0x900); 822 //TEST(Taddress_t,out_SPR_EVENT_EEAR [context]->read(),); 823 TEST(Tcontrol_t,out_SPR_EVENT_EEAR_WEN [context]->read(),0); 824 TEST(Tcontrol_t,out_SPR_EVENT_SR_DSX [context]->read(),1); 825 TEST(Tcontrol_t,out_SPR_EVENT_SR_TO_ESR [context]->read(),1); 826 827 find = true; 828 } 829 830 SC_START(1); 831 } 832 while (not find); 833 834 in_SPR_EVENT_ACK [context]->write(0); 809 835 } 810 836 … … 814 840 815 841 LABEL("exception (begin)"); 816 in_NB_INST_DECOD_ALL [decod_unit]->write(1); 817 in_NB_INST_COMMIT_ALL [ooo_engine]->write(1); 818 in_NB_INST_COMMIT_MEM [ooo_engine]->write(1); 819 820 uint32_t port = rand()%_param->_nb_ooo_engine; 821 822 in_COMMIT_EVENT_CONTEXT_ID [port]->write(context); 823 if (_param->_have_port_depth [context]) 824 in_COMMIT_EVENT_DEPTH [port]->write((context)%_param->_size_depth[context]); 825 in_COMMIT_EVENT_TYPE [port]->write(EVENT_TYPE_EXCEPTION); 826 in_COMMIT_EVENT_IS_DELAY_SLOT [port]->write(0); 827 in_COMMIT_EVENT_ADDRESS [port]->write(0xa00); 828 in_COMMIT_EVENT_ADDRESS_EPCR [port]->write(0xb00); 829 in_COMMIT_EVENT_ADDRESS_EEAR [port]->write(0xc00); 830 in_COMMIT_EVENT_ADDRESS_EEAR_VAL [port]->write(0); 831 832 TEST(Tcontrol_t, out_CONTEXT_DECOD_ENABLE[context]->read(), 1); 833 834 do 835 { 836 in_COMMIT_EVENT_VAL [port]->write(rand()%percent_transaction_commit_event); 837 838 SC_START(1); 839 } 840 while (not ( in_COMMIT_EVENT_VAL [port]->read() and 841 out_COMMIT_EVENT_ACK [port]->read())); 842 in_COMMIT_EVENT_VAL [port]->write(0); 842 in_NB_INST_DECOD_ALL [context]->write(1); 843 in_NB_INST_COMMIT_ALL [context]->write(1); 844 in_NB_INST_COMMIT_MEM [context]->write(1); 845 846 in_COMMIT_EVENT_CONTEXT_ID ->write(context); 847 if (_param->_have_port_depth) 848 in_COMMIT_EVENT_DEPTH ->write((_param->_array_size_depth[context]==0)?0:((context)%_param->_array_size_depth[context])); 849 in_COMMIT_EVENT_TYPE ->write(EVENT_TYPE_EXCEPTION); 850 in_COMMIT_EVENT_IS_DELAY_SLOT ->write(0); 851 in_COMMIT_EVENT_ADDRESS ->write(0xa00); 852 in_COMMIT_EVENT_ADDRESS_EPCR ->write(0xb00); 853 in_COMMIT_EVENT_ADDRESS_EEAR ->write(0xc00); 854 in_COMMIT_EVENT_ADDRESS_EEAR_VAL ->write(0); 855 856 TEST(Tcontrol_t, out_CONTEXT_DECOD_ENABLE[context]->read(), 1); 857 858 do 859 { 860 in_COMMIT_EVENT_VAL ->write(rand()%percent_transaction_commit_event); 861 862 SC_START(1); 863 } 864 while (not ( in_COMMIT_EVENT_VAL ->read() and 865 out_COMMIT_EVENT_ACK ->read())); 866 in_COMMIT_EVENT_VAL ->write(0); 843 867 844 868 LABEL("exception (wait end)"); … … 847 871 SC_START(3); 848 872 849 in_NB_INST_DECOD_ALL [ decod_unit]->write(0);850 in_NB_INST_COMMIT_ALL [ ooo_engine]->write(0);851 in_NB_INST_COMMIT_MEM [ ooo_engine]->write(0);873 in_NB_INST_DECOD_ALL [context]->write(0); 874 in_NB_INST_COMMIT_ALL [context]->write(0); 875 in_NB_INST_COMMIT_MEM [context]->write(0); 852 876 853 877 SC_START(1); … … 883 907 do 884 908 { 885 in_SPR_ ACK [context]->write(rand()%percent_transaction_spr);886 887 SC_START(0); 888 889 if (out_SPR_ VAL [context]->read() and in_SPR_ACK [context]->read())890 { 891 TEST(Taddress_t,out_SPR_E PCR [context]->read(),0xb00);892 TEST(Taddress_t,out_SPR_E EAR [context]->read(),0xc00);893 TEST(Tcontrol_t,out_SPR_E EAR_WEN [context]->read(),0);894 TEST(Tcontrol_t,out_SPR_ SR_DSX [context]->read(),0);895 TEST(Tcontrol_t,out_SPR_ SR_TO_ESR [context]->read(),1);896 897 find = true; 898 } 899 900 SC_START(1); 901 } 902 while (not find); 903 904 in_SPR_ ACK [context]->write(0);909 in_SPR_EVENT_ACK [context]->write(rand()%percent_transaction_spr); 910 911 SC_START(0); 912 913 if (out_SPR_EVENT_VAL [context]->read() and in_SPR_EVENT_ACK [context]->read()) 914 { 915 TEST(Taddress_t,out_SPR_EVENT_EPCR [context]->read(),0xb00); 916 TEST(Taddress_t,out_SPR_EVENT_EEAR [context]->read(),0xc00); 917 TEST(Tcontrol_t,out_SPR_EVENT_EEAR_WEN [context]->read(),0); 918 TEST(Tcontrol_t,out_SPR_EVENT_SR_DSX [context]->read(),0); 919 TEST(Tcontrol_t,out_SPR_EVENT_SR_TO_ESR [context]->read(),1); 920 921 find = true; 922 } 923 924 SC_START(1); 925 } 926 while (not find); 927 928 in_SPR_EVENT_ACK [context]->write(0); 905 929 } 906 930 … … 910 934 911 935 LABEL("exception (begin)"); 912 in_NB_INST_DECOD_ALL [decod_unit]->write(1); 913 in_NB_INST_COMMIT_ALL [ooo_engine]->write(1); 914 in_NB_INST_COMMIT_MEM [ooo_engine]->write(1); 915 916 uint32_t port = rand()%_param->_nb_ooo_engine; 917 918 in_COMMIT_EVENT_CONTEXT_ID [port]->write(context); 919 if (_param->_have_port_depth [context]) 920 in_COMMIT_EVENT_DEPTH [port]->write((context)%_param->_size_depth[context]); 921 in_COMMIT_EVENT_TYPE [port]->write(EVENT_TYPE_EXCEPTION); 922 in_COMMIT_EVENT_IS_DELAY_SLOT [port]->write(1); 923 in_COMMIT_EVENT_ADDRESS [port]->write(0xd00); 924 in_COMMIT_EVENT_ADDRESS_EPCR [port]->write(0xe00); 925 in_COMMIT_EVENT_ADDRESS_EEAR [port]->write(0xf00); 926 in_COMMIT_EVENT_ADDRESS_EEAR_VAL [port]->write(0); 927 928 TEST(Tcontrol_t, out_CONTEXT_DECOD_ENABLE[context]->read(), 1); 929 930 do 931 { 932 in_COMMIT_EVENT_VAL [port]->write(rand()%percent_transaction_commit_event); 933 934 SC_START(1); 935 } 936 while (not ( in_COMMIT_EVENT_VAL [port]->read() and 937 out_COMMIT_EVENT_ACK [port]->read())); 938 in_COMMIT_EVENT_VAL [port]->write(0); 936 in_NB_INST_DECOD_ALL [context]->write(1); 937 in_NB_INST_COMMIT_ALL [context]->write(1); 938 in_NB_INST_COMMIT_MEM [context]->write(1); 939 940 in_COMMIT_EVENT_CONTEXT_ID ->write(context); 941 if (_param->_have_port_depth) 942 in_COMMIT_EVENT_DEPTH ->write((_param->_array_size_depth[context]==0)?0:((context)%_param->_array_size_depth[context])); 943 in_COMMIT_EVENT_TYPE ->write(EVENT_TYPE_EXCEPTION); 944 in_COMMIT_EVENT_IS_DELAY_SLOT ->write(1); 945 in_COMMIT_EVENT_ADDRESS ->write(0xd00); 946 in_COMMIT_EVENT_ADDRESS_EPCR ->write(0xe00); 947 in_COMMIT_EVENT_ADDRESS_EEAR ->write(0xf00); 948 in_COMMIT_EVENT_ADDRESS_EEAR_VAL ->write(0); 949 950 TEST(Tcontrol_t, out_CONTEXT_DECOD_ENABLE[context]->read(), 1); 951 952 do 953 { 954 in_COMMIT_EVENT_VAL ->write(rand()%percent_transaction_commit_event); 955 956 SC_START(1); 957 } 958 while (not ( in_COMMIT_EVENT_VAL ->read() and 959 out_COMMIT_EVENT_ACK ->read())); 960 in_COMMIT_EVENT_VAL ->write(0); 939 961 940 962 LABEL("exception (wait end)"); … … 943 965 SC_START(3); 944 966 945 in_NB_INST_DECOD_ALL [ decod_unit]->write(0);946 in_NB_INST_COMMIT_ALL [ ooo_engine]->write(0);947 in_NB_INST_COMMIT_MEM [ ooo_engine]->write(0);967 in_NB_INST_DECOD_ALL [context]->write(0); 968 in_NB_INST_COMMIT_ALL [context]->write(0); 969 in_NB_INST_COMMIT_MEM [context]->write(0); 948 970 949 971 SC_START(1); … … 979 1001 do 980 1002 { 981 in_SPR_ ACK [context]->write(rand()%percent_transaction_spr);982 983 SC_START(0); 984 985 if (out_SPR_ VAL [context]->read() and in_SPR_ACK [context]->read())986 { 987 TEST(Taddress_t,out_SPR_E PCR [context]->read(),0xe00);988 TEST(Taddress_t,out_SPR_E EAR [context]->read(),0xf00);989 TEST(Tcontrol_t,out_SPR_E EAR_WEN [context]->read(),0);990 TEST(Tcontrol_t,out_SPR_ SR_DSX [context]->read(),1);991 TEST(Tcontrol_t,out_SPR_ SR_TO_ESR [context]->read(),1);992 993 find = true; 994 } 995 996 SC_START(1); 997 } 998 while (not find); 999 1000 in_SPR_ ACK [context]->write(0);1003 in_SPR_EVENT_ACK [context]->write(rand()%percent_transaction_spr); 1004 1005 SC_START(0); 1006 1007 if (out_SPR_EVENT_VAL [context]->read() and in_SPR_EVENT_ACK [context]->read()) 1008 { 1009 TEST(Taddress_t,out_SPR_EVENT_EPCR [context]->read(),0xe00); 1010 TEST(Taddress_t,out_SPR_EVENT_EEAR [context]->read(),0xf00); 1011 TEST(Tcontrol_t,out_SPR_EVENT_EEAR_WEN [context]->read(),0); 1012 TEST(Tcontrol_t,out_SPR_EVENT_SR_DSX [context]->read(),1); 1013 TEST(Tcontrol_t,out_SPR_EVENT_SR_TO_ESR [context]->read(),1); 1014 1015 find = true; 1016 } 1017 1018 SC_START(1); 1019 } 1020 while (not find); 1021 1022 in_SPR_EVENT_ACK [context]->write(0); 1001 1023 } 1002 1024 … … 1006 1028 1007 1029 LABEL("exception (begin)"); 1008 in_NB_INST_DECOD_ALL [decod_unit]->write(1); 1009 in_NB_INST_COMMIT_ALL [ooo_engine]->write(1); 1010 in_NB_INST_COMMIT_MEM [ooo_engine]->write(1); 1011 1012 uint32_t port = rand()%_param->_nb_ooo_engine; 1013 1014 in_COMMIT_EVENT_CONTEXT_ID [port]->write(context); 1015 if (_param->_have_port_depth [context]) 1016 in_COMMIT_EVENT_DEPTH [port]->write((context)%_param->_size_depth[context]); 1017 in_COMMIT_EVENT_TYPE [port]->write(EVENT_TYPE_EXCEPTION); 1018 in_COMMIT_EVENT_IS_DELAY_SLOT [port]->write(0); 1019 in_COMMIT_EVENT_ADDRESS [port]->write(0xa00); 1020 in_COMMIT_EVENT_ADDRESS_EPCR [port]->write(0xb00); 1021 in_COMMIT_EVENT_ADDRESS_EEAR [port]->write(0xc00); 1022 in_COMMIT_EVENT_ADDRESS_EEAR_VAL [port]->write(1); 1023 1024 TEST(Tcontrol_t, out_CONTEXT_DECOD_ENABLE[context]->read(), 1); 1025 1026 do 1027 { 1028 in_COMMIT_EVENT_VAL [port]->write(rand()%percent_transaction_commit_event); 1029 1030 SC_START(1); 1031 } 1032 while (not ( in_COMMIT_EVENT_VAL [port]->read() and 1033 out_COMMIT_EVENT_ACK [port]->read())); 1034 in_COMMIT_EVENT_VAL [port]->write(0); 1030 in_NB_INST_DECOD_ALL [context]->write(1); 1031 in_NB_INST_COMMIT_ALL [context]->write(1); 1032 in_NB_INST_COMMIT_MEM [context]->write(1); 1033 1034 in_COMMIT_EVENT_CONTEXT_ID ->write(context); 1035 if (_param->_have_port_depth) 1036 in_COMMIT_EVENT_DEPTH ->write((_param->_array_size_depth[context]==0)?0:((context)%_param->_array_size_depth[context])); 1037 in_COMMIT_EVENT_TYPE ->write(EVENT_TYPE_EXCEPTION); 1038 in_COMMIT_EVENT_IS_DELAY_SLOT ->write(0); 1039 in_COMMIT_EVENT_ADDRESS ->write(0xa00); 1040 in_COMMIT_EVENT_ADDRESS_EPCR ->write(0xb00); 1041 in_COMMIT_EVENT_ADDRESS_EEAR ->write(0xc00); 1042 in_COMMIT_EVENT_ADDRESS_EEAR_VAL ->write(1); 1043 1044 TEST(Tcontrol_t, out_CONTEXT_DECOD_ENABLE[context]->read(), 1); 1045 1046 do 1047 { 1048 in_COMMIT_EVENT_VAL ->write(rand()%percent_transaction_commit_event); 1049 1050 SC_START(1); 1051 } 1052 while (not ( in_COMMIT_EVENT_VAL ->read() and 1053 out_COMMIT_EVENT_ACK ->read())); 1054 in_COMMIT_EVENT_VAL ->write(0); 1035 1055 1036 1056 LABEL("exception (wait end)"); … … 1039 1059 SC_START(3); 1040 1060 1041 in_NB_INST_DECOD_ALL [ decod_unit]->write(0);1042 in_NB_INST_COMMIT_ALL [ ooo_engine]->write(0);1043 in_NB_INST_COMMIT_MEM [ ooo_engine]->write(0);1061 in_NB_INST_DECOD_ALL [context]->write(0); 1062 in_NB_INST_COMMIT_ALL [context]->write(0); 1063 in_NB_INST_COMMIT_MEM [context]->write(0); 1044 1064 1045 1065 SC_START(1); … … 1075 1095 do 1076 1096 { 1077 in_SPR_ ACK [context]->write(rand()%percent_transaction_spr);1078 1079 SC_START(0); 1080 1081 if (out_SPR_ VAL [context]->read() and in_SPR_ACK [context]->read())1082 { 1083 TEST(Taddress_t,out_SPR_E PCR [context]->read(),0xb00);1084 TEST(Taddress_t,out_SPR_E EAR [context]->read(),0xc00);1085 TEST(Tcontrol_t,out_SPR_E EAR_WEN [context]->read(),1);1086 TEST(Tcontrol_t,out_SPR_ SR_DSX [context]->read(),0);1087 TEST(Tcontrol_t,out_SPR_ SR_TO_ESR [context]->read(),1);1088 1089 find = true; 1090 } 1091 1092 SC_START(1); 1093 } 1094 while (not find); 1095 1096 in_SPR_ ACK [context]->write(0);1097 in_SPR_EVENT_ACK [context]->write(rand()%percent_transaction_spr); 1098 1099 SC_START(0); 1100 1101 if (out_SPR_EVENT_VAL [context]->read() and in_SPR_EVENT_ACK [context]->read()) 1102 { 1103 TEST(Taddress_t,out_SPR_EVENT_EPCR [context]->read(),0xb00); 1104 TEST(Taddress_t,out_SPR_EVENT_EEAR [context]->read(),0xc00); 1105 TEST(Tcontrol_t,out_SPR_EVENT_EEAR_WEN [context]->read(),1); 1106 TEST(Tcontrol_t,out_SPR_EVENT_SR_DSX [context]->read(),0); 1107 TEST(Tcontrol_t,out_SPR_EVENT_SR_TO_ESR [context]->read(),1); 1108 1109 find = true; 1110 } 1111 1112 SC_START(1); 1113 } 1114 while (not find); 1115 1116 in_SPR_EVENT_ACK [context]->write(0); 1097 1117 } 1098 1118 … … 1102 1122 1103 1123 LABEL("exception (begin)"); 1104 in_NB_INST_DECOD_ALL [decod_unit]->write(1); 1105 in_NB_INST_COMMIT_ALL [ooo_engine]->write(1); 1106 in_NB_INST_COMMIT_MEM [ooo_engine]->write(1); 1107 1108 uint32_t port = rand()%_param->_nb_ooo_engine; 1109 1110 in_COMMIT_EVENT_CONTEXT_ID [port]->write(context); 1111 if (_param->_have_port_depth [context]) 1112 in_COMMIT_EVENT_DEPTH [port]->write((context)%_param->_size_depth[context]); 1113 in_COMMIT_EVENT_TYPE [port]->write(EVENT_TYPE_EXCEPTION); 1114 in_COMMIT_EVENT_IS_DELAY_SLOT [port]->write(1); 1115 in_COMMIT_EVENT_ADDRESS [port]->write(0xd00); 1116 in_COMMIT_EVENT_ADDRESS_EPCR [port]->write(0xe00); 1117 in_COMMIT_EVENT_ADDRESS_EEAR [port]->write(0xf00); 1118 in_COMMIT_EVENT_ADDRESS_EEAR_VAL [port]->write(1); 1119 1120 TEST(Tcontrol_t, out_CONTEXT_DECOD_ENABLE[context]->read(), 1); 1121 1122 do 1123 { 1124 in_COMMIT_EVENT_VAL [port]->write(rand()%percent_transaction_commit_event); 1125 1126 SC_START(1); 1127 } 1128 while (not ( in_COMMIT_EVENT_VAL [port]->read() and 1129 out_COMMIT_EVENT_ACK [port]->read())); 1130 in_COMMIT_EVENT_VAL [port]->write(0); 1124 in_NB_INST_DECOD_ALL [context]->write(1); 1125 in_NB_INST_COMMIT_ALL [context]->write(1); 1126 in_NB_INST_COMMIT_MEM [context]->write(1); 1127 1128 in_COMMIT_EVENT_CONTEXT_ID ->write(context); 1129 if (_param->_have_port_depth) 1130 in_COMMIT_EVENT_DEPTH ->write((_param->_array_size_depth[context]==0)?0:((context)%_param->_array_size_depth[context])); 1131 in_COMMIT_EVENT_TYPE ->write(EVENT_TYPE_EXCEPTION); 1132 in_COMMIT_EVENT_IS_DELAY_SLOT ->write(1); 1133 in_COMMIT_EVENT_ADDRESS ->write(0xd00); 1134 in_COMMIT_EVENT_ADDRESS_EPCR ->write(0xe00); 1135 in_COMMIT_EVENT_ADDRESS_EEAR ->write(0xf00); 1136 in_COMMIT_EVENT_ADDRESS_EEAR_VAL ->write(1); 1137 1138 TEST(Tcontrol_t, out_CONTEXT_DECOD_ENABLE[context]->read(), 1); 1139 1140 do 1141 { 1142 in_COMMIT_EVENT_VAL ->write(rand()%percent_transaction_commit_event); 1143 1144 SC_START(1); 1145 } 1146 while (not ( in_COMMIT_EVENT_VAL ->read() and 1147 out_COMMIT_EVENT_ACK ->read())); 1148 in_COMMIT_EVENT_VAL ->write(0); 1131 1149 1132 1150 LABEL("exception (wait end)"); … … 1135 1153 SC_START(3); 1136 1154 1137 in_NB_INST_DECOD_ALL [ decod_unit]->write(0);1138 in_NB_INST_COMMIT_ALL [ ooo_engine]->write(0);1139 in_NB_INST_COMMIT_MEM [ ooo_engine]->write(0);1155 in_NB_INST_DECOD_ALL [context]->write(0); 1156 in_NB_INST_COMMIT_ALL [context]->write(0); 1157 in_NB_INST_COMMIT_MEM [context]->write(0); 1140 1158 1141 1159 SC_START(1); … … 1171 1189 do 1172 1190 { 1173 in_SPR_ ACK [context]->write(rand()%percent_transaction_spr);1174 1175 SC_START(0); 1176 1177 if (out_SPR_ VAL [context]->read() and in_SPR_ACK [context]->read())1178 { 1179 TEST(Taddress_t,out_SPR_E PCR [context]->read(),0xe00);1180 TEST(Taddress_t,out_SPR_E EAR [context]->read(),0xf00);1181 TEST(Tcontrol_t,out_SPR_E EAR_WEN [context]->read(),1);1182 TEST(Tcontrol_t,out_SPR_ SR_DSX [context]->read(),1);1183 TEST(Tcontrol_t,out_SPR_ SR_TO_ESR [context]->read(),1);1184 1185 find = true; 1186 } 1187 1188 SC_START(1); 1189 } 1190 while (not find); 1191 1192 in_SPR_ ACK [context]->write(0);1191 in_SPR_EVENT_ACK [context]->write(rand()%percent_transaction_spr); 1192 1193 SC_START(0); 1194 1195 if (out_SPR_EVENT_VAL [context]->read() and in_SPR_EVENT_ACK [context]->read()) 1196 { 1197 TEST(Taddress_t,out_SPR_EVENT_EPCR [context]->read(),0xe00); 1198 TEST(Taddress_t,out_SPR_EVENT_EEAR [context]->read(),0xf00); 1199 TEST(Tcontrol_t,out_SPR_EVENT_EEAR_WEN [context]->read(),1); 1200 TEST(Tcontrol_t,out_SPR_EVENT_SR_DSX [context]->read(),1); 1201 TEST(Tcontrol_t,out_SPR_EVENT_SR_TO_ESR [context]->read(),1); 1202 1203 find = true; 1204 } 1205 1206 SC_START(1); 1207 } 1208 while (not find); 1209 1210 in_SPR_EVENT_ACK [context]->write(0); 1193 1211 } 1194 1212 … … 1210 1228 delete in_NRESET; 1211 1229 1230 DELETE1_SC_SIGNAL( in_BRANCH_EVENT_VAL ,_param->_nb_context); 1231 DELETE1_SC_SIGNAL(out_BRANCH_EVENT_ACK ,_param->_nb_context); 1232 //DELETE1_SC_SIGNAL( in_BRANCH_EVENT_CONTEXT_ID ,_param->_nb_context); 1233 //DELETE1_SC_SIGNAL( in_BRANCH_EVENT_DEPTH ,_param->_nb_context); 1234 //DELETE1_SC_SIGNAL( in_BRANCH_EVENT_MISS_PREDICTION ,_param->_nb_context); 1235 DELETE1_SC_SIGNAL( in_BRANCH_EVENT_ADDRESS_SRC ,_param->_nb_context); 1236 DELETE1_SC_SIGNAL( in_BRANCH_EVENT_ADDRESS_DEST ,_param->_nb_context); 1212 1237 DELETE1_SC_SIGNAL( in_DECOD_EVENT_VAL ,_param->_nb_decod_unit); 1213 1238 DELETE1_SC_SIGNAL(out_DECOD_EVENT_ACK ,_param->_nb_decod_unit); … … 1218 1243 DELETE1_SC_SIGNAL( in_DECOD_EVENT_ADDRESS ,_param->_nb_decod_unit); 1219 1244 DELETE1_SC_SIGNAL( in_DECOD_EVENT_ADDRESS_EPCR ,_param->_nb_decod_unit); 1220 DELETE 1_SC_SIGNAL( in_COMMIT_EVENT_VAL ,_param->_nb_ooo_engine);1221 DELETE 1_SC_SIGNAL(out_COMMIT_EVENT_ACK ,_param->_nb_ooo_engine);1222 DELETE 1_SC_SIGNAL( in_COMMIT_EVENT_CONTEXT_ID ,_param->_nb_ooo_engine);1223 DELETE 1_SC_SIGNAL( in_COMMIT_EVENT_DEPTH ,_param->_nb_ooo_engine);1224 DELETE 1_SC_SIGNAL( in_COMMIT_EVENT_TYPE ,_param->_nb_ooo_engine);1225 DELETE 1_SC_SIGNAL( in_COMMIT_EVENT_IS_DELAY_SLOT ,_param->_nb_ooo_engine);1226 DELETE 1_SC_SIGNAL( in_COMMIT_EVENT_ADDRESS ,_param->_nb_ooo_engine);1227 DELETE 1_SC_SIGNAL( in_COMMIT_EVENT_ADDRESS_EPCR ,_param->_nb_ooo_engine);1228 DELETE 1_SC_SIGNAL( in_COMMIT_EVENT_ADDRESS_EEAR_VAL ,_param->_nb_ooo_engine);1229 DELETE 1_SC_SIGNAL( in_COMMIT_EVENT_ADDRESS_EEAR ,_param->_nb_ooo_engine);1245 DELETE_SC_SIGNAL ( in_COMMIT_EVENT_VAL ); 1246 DELETE_SC_SIGNAL (out_COMMIT_EVENT_ACK ); 1247 DELETE_SC_SIGNAL ( in_COMMIT_EVENT_CONTEXT_ID ); 1248 DELETE_SC_SIGNAL ( in_COMMIT_EVENT_DEPTH ); 1249 DELETE_SC_SIGNAL ( in_COMMIT_EVENT_TYPE ); 1250 DELETE_SC_SIGNAL ( in_COMMIT_EVENT_IS_DELAY_SLOT ); 1251 DELETE_SC_SIGNAL ( in_COMMIT_EVENT_ADDRESS ); 1252 DELETE_SC_SIGNAL ( in_COMMIT_EVENT_ADDRESS_EPCR ); 1253 DELETE_SC_SIGNAL ( in_COMMIT_EVENT_ADDRESS_EEAR_VAL ); 1254 DELETE_SC_SIGNAL ( in_COMMIT_EVENT_ADDRESS_EEAR ); 1230 1255 DELETE1_SC_SIGNAL( in_BRANCH_COMPLETE_VAL ,_param->_nb_inst_branch_complete); 1231 1256 DELETE1_SC_SIGNAL(out_BRANCH_COMPLETE_ACK ,_param->_nb_inst_branch_complete); … … 1236 1261 DELETE1_SC_SIGNAL( in_BRANCH_COMPLETE_ADDRESS_SRC ,_param->_nb_inst_branch_complete); 1237 1262 DELETE1_SC_SIGNAL( in_BRANCH_COMPLETE_ADDRESS_DEST ,_param->_nb_inst_branch_complete); 1238 DELETE1_SC_SIGNAL( in_NB_INST_DECOD_ALL ,_param->_nb_ decod_unit);1239 DELETE1_SC_SIGNAL( in_NB_INST_COMMIT_ALL ,_param->_nb_ ooo_engine);1240 DELETE1_SC_SIGNAL( in_NB_INST_COMMIT_MEM ,_param->_nb_ ooo_engine);1263 DELETE1_SC_SIGNAL( in_NB_INST_DECOD_ALL ,_param->_nb_context ); 1264 DELETE1_SC_SIGNAL( in_NB_INST_COMMIT_ALL ,_param->_nb_context ); 1265 DELETE1_SC_SIGNAL( in_NB_INST_COMMIT_MEM ,_param->_nb_context ); 1241 1266 DELETE1_SC_SIGNAL(out_EVENT_VAL ,_param->_nb_context ); 1242 1267 DELETE1_SC_SIGNAL( in_EVENT_ACK ,_param->_nb_context ); … … 1245 1270 DELETE1_SC_SIGNAL(out_EVENT_ADDRESS_NEXT_VAL ,_param->_nb_context ); 1246 1271 DELETE1_SC_SIGNAL(out_EVENT_IS_DS_TAKE ,_param->_nb_context ); 1247 DELETE1_SC_SIGNAL(out_SPR_ VAL,_param->_nb_context );1248 DELETE1_SC_SIGNAL( in_SPR_ ACK,_param->_nb_context );1249 DELETE1_SC_SIGNAL(out_SPR_E PCR,_param->_nb_context );1250 DELETE1_SC_SIGNAL(out_SPR_E EAR,_param->_nb_context );1251 DELETE1_SC_SIGNAL(out_SPR_E EAR_WEN,_param->_nb_context );1252 DELETE1_SC_SIGNAL(out_SPR_ SR_DSX,_param->_nb_context );1253 DELETE1_SC_SIGNAL(out_SPR_ SR_TO_ESR,_param->_nb_context );1272 DELETE1_SC_SIGNAL(out_SPR_EVENT_VAL ,_param->_nb_context ); 1273 DELETE1_SC_SIGNAL( in_SPR_EVENT_ACK ,_param->_nb_context ); 1274 DELETE1_SC_SIGNAL(out_SPR_EVENT_EPCR ,_param->_nb_context ); 1275 DELETE1_SC_SIGNAL(out_SPR_EVENT_EEAR ,_param->_nb_context ); 1276 DELETE1_SC_SIGNAL(out_SPR_EVENT_EEAR_WEN ,_param->_nb_context ); 1277 DELETE1_SC_SIGNAL(out_SPR_EVENT_SR_DSX ,_param->_nb_context ); 1278 DELETE1_SC_SIGNAL(out_SPR_EVENT_SR_TO_ESR ,_param->_nb_context ); 1254 1279 DELETE1_SC_SIGNAL(out_CONTEXT_DECOD_ENABLE ,_param->_nb_context ); 1255 DELETE1_SC_SIGNAL( in_DEPTH_TAIL ,_param->_nb_context ); 1280 DELETE1_SC_SIGNAL( in_DEPTH_MIN ,_param->_nb_context ); 1281 DELETE1_SC_SIGNAL( in_SPR_SR_IEE ,_param->_nb_context ); 1282 DELETE1_SC_SIGNAL( in_SPR_SR_EPH ,_param->_nb_context ); 1283 1284 DELETE1_SC_SIGNAL( in_INTERRUPT_ENABLE ,_param->_nb_context ); 1256 1285 } 1257 1286 #endif -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Context_State/include/Context_State.h
r83 r88 62 62 public : SC_CLOCK * in_CLOCK ; 63 63 public : SC_IN (Tcontrol_t) * in_NRESET ; 64 65 // ~~~~~[ Interface : "branch_event" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 66 public : SC_IN (Tcontrol_t ) ** in_BRANCH_EVENT_VAL ;//[nb_context] 67 public : SC_OUT(Tcontrol_t ) ** out_BRANCH_EVENT_ACK ;//[nb_context] 68 //public : SC_IN (Tcontext_t ) ** in_BRANCH_EVENT_CONTEXT_ID ;//[nb_context] 69 //public : SC_IN (Tdepth_t ) ** in_BRANCH_EVENT_DEPTH ;//[nb_context] 70 //public : SC_IN (Tcontrol_t ) ** in_BRANCH_EVENT_MISS_PREDICTION ;//[nb_context] 71 public : SC_IN (Taddress_t ) ** in_BRANCH_EVENT_ADDRESS_SRC ;//[nb_context] 72 public : SC_IN (Taddress_t ) ** in_BRANCH_EVENT_ADDRESS_DEST ;//[nb_context] 64 73 65 74 // ~~~~~[ Interface : "decod_event" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ … … 74 83 75 84 // ~~~~~[ Interface : "commit_event" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 76 public : SC_IN (Tcontrol_t ) ** in_COMMIT_EVENT_VAL ;//[nb_ooo_engine]77 public : SC_OUT(Tcontrol_t ) ** out_COMMIT_EVENT_ACK ;//[nb_ooo_engine]78 public : SC_IN (Tcontext_t ) ** in_COMMIT_EVENT_CONTEXT_ID ;//[nb_ooo_engine]79 public : SC_IN (Tdepth_t ) ** in_COMMIT_EVENT_DEPTH ;//[nb_ooo_engine]80 public : SC_IN (Tevent_type_t ) ** in_COMMIT_EVENT_TYPE ;//[nb_ooo_engine]81 public : SC_IN (Tcontrol_t ) ** in_COMMIT_EVENT_IS_DELAY_SLOT ;//[nb_ooo_engine]82 public : SC_IN (Taddress_t ) ** in_COMMIT_EVENT_ADDRESS ;//[nb_ooo_engine]83 public : SC_IN (Taddress_t ) ** in_COMMIT_EVENT_ADDRESS_EPCR ;//[nb_ooo_engine]84 public : SC_IN (Tcontrol_t ) ** in_COMMIT_EVENT_ADDRESS_EEAR_VAL ;//[nb_ooo_engine]85 public : SC_IN (Taddress_t ) ** in_COMMIT_EVENT_ADDRESS_EEAR ;//[nb_ooo_engine]85 public : SC_IN (Tcontrol_t ) * in_COMMIT_EVENT_VAL ; 86 public : SC_OUT(Tcontrol_t ) * out_COMMIT_EVENT_ACK ; 87 public : SC_IN (Tcontext_t ) * in_COMMIT_EVENT_CONTEXT_ID ; 88 public : SC_IN (Tdepth_t ) * in_COMMIT_EVENT_DEPTH ; 89 public : SC_IN (Tevent_type_t ) * in_COMMIT_EVENT_TYPE ; 90 public : SC_IN (Tcontrol_t ) * in_COMMIT_EVENT_IS_DELAY_SLOT ; 91 public : SC_IN (Taddress_t ) * in_COMMIT_EVENT_ADDRESS ; 92 public : SC_IN (Taddress_t ) * in_COMMIT_EVENT_ADDRESS_EPCR ; 93 public : SC_IN (Tcontrol_t ) * in_COMMIT_EVENT_ADDRESS_EEAR_VAL ; 94 public : SC_IN (Taddress_t ) * in_COMMIT_EVENT_ADDRESS_EEAR ; 86 95 87 96 // ~~~~~[ Interface : "branch_complete" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ … … 96 105 97 106 // ~~~~~[ Interface : "nb_inst" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 98 public : SC_IN (Tcounter_t ) ** in_NB_INST_DECOD_ALL ;//[nb_ decod_unit]99 public : SC_IN (Tcounter_t ) ** in_NB_INST_COMMIT_ALL ;//[nb_ ooo_engine]100 public : SC_IN (Tcounter_t ) ** in_NB_INST_COMMIT_MEM ;//[nb_ ooo_engine]107 public : SC_IN (Tcounter_t ) ** in_NB_INST_DECOD_ALL ;//[nb_context] 108 public : SC_IN (Tcounter_t ) ** in_NB_INST_COMMIT_ALL ;//[nb_context] 109 public : SC_IN (Tcounter_t ) ** in_NB_INST_COMMIT_MEM ;//[nb_context] 101 110 102 111 // ~~~~~[ Interface "event" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ … … 108 117 public : SC_OUT(Tcontrol_t ) ** out_EVENT_IS_DS_TAKE ;//[nb_context] 109 118 110 // ~~~~~[ Interface "spr " ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~111 public : SC_OUT(Tcontrol_t ) ** out_SPR_ VAL;//[nb_context]112 public : SC_IN (Tcontrol_t ) ** in_SPR_ ACK;//[nb_context]113 public : SC_OUT(Taddress_t ) ** out_SPR_E PCR;//[nb_context]114 public : SC_OUT(Taddress_t ) ** out_SPR_E EAR;//[nb_context]115 public : SC_OUT(Tcontrol_t ) ** out_SPR_E EAR_WEN;//[nb_context]116 public : SC_OUT(Tcontrol_t ) ** out_SPR_ SR_DSX;//[nb_context]117 public : SC_OUT(Tcontrol_t ) ** out_SPR_ SR_TO_ESR;//[nb_context]119 // ~~~~~[ Interface "spr_event" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 120 public : SC_OUT(Tcontrol_t ) ** out_SPR_EVENT_VAL ;//[nb_context] 121 public : SC_IN (Tcontrol_t ) ** in_SPR_EVENT_ACK ;//[nb_context] 122 public : SC_OUT(Taddress_t ) ** out_SPR_EVENT_EPCR ;//[nb_context] 123 public : SC_OUT(Taddress_t ) ** out_SPR_EVENT_EEAR ;//[nb_context] 124 public : SC_OUT(Tcontrol_t ) ** out_SPR_EVENT_EEAR_WEN ;//[nb_context] 125 public : SC_OUT(Tcontrol_t ) ** out_SPR_EVENT_SR_DSX ;//[nb_context] 126 public : SC_OUT(Tcontrol_t ) ** out_SPR_EVENT_SR_TO_ESR ;//[nb_context] 118 127 119 128 // ~~~~~[ Interface : "context" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ … … 121 130 122 131 // ~~~~~[ Interface : "depth" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 123 public : SC_IN (Tdepth_t ) ** in_DEPTH_TAIL ;//[nb_context] 132 public : SC_IN (Tdepth_t ) ** in_DEPTH_MIN ;//[nb_context] 133 134 // ~~~~~[ Interface : "spr" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 135 public : SC_IN (Tcontrol_t ) ** in_SPR_SR_IEE ;//[nb_context] - Interrupt Exception Enabled 136 public : SC_IN (Tcontrol_t ) ** in_SPR_SR_EPH ;//[nb_context] - Exception Prefix High 137 138 // ~~~~~[ Interface : "interrupt" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 139 public : SC_IN (Tcontrol_t ) ** in_INTERRUPT_ENABLE ;//[nb_context] - Interrupt Exception 124 140 125 141 // ~~~~~[ Component ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ … … 135 151 private : Tcontrol_t * reg_EVENT_IS_DS_TAKE ;//[nb_context] 136 152 private : Tdepth_t * reg_EVENT_DEPTH ;//[nb_context] 153 private : Tcontrol_t * reg_INTERRUPT_ENABLE ;//[nb_context] 137 154 138 155 // ~~~~~[ Internal ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 156 private : Tcontrol_t * internal_BRANCH_EVENT_ACK ;//[nb_context] 139 157 private : Tcontrol_t * internal_DECOD_EVENT_ACK ;//[nb_decod_unit] 140 private : Tcontrol_t * internal_COMMIT_EVENT_ACK ;//[nb_ooo_engine]158 private : Tcontrol_t internal_COMMIT_EVENT_ACK ; 141 159 private : Tcontrol_t * internal_BRANCH_COMPLETE_ACK ;//[nb_inst_branch_complete] 142 160 private : Tcontrol_t * internal_EVENT_VAL ;//[nb_context] 143 private : Tcontrol_t * internal_SPR_ VAL;//[nb_context]161 private : Tcontrol_t * internal_SPR_EVENT_VAL ;//[nb_context] 144 162 #endif 145 163 -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Context_State/include/Parameters.h
r83 r88 26 26 public : uint32_t _nb_context ; 27 27 public : uint32_t _nb_decod_unit ; 28 public : uint32_t _nb_ooo_engine ;29 28 public : uint32_t _nb_inst_branch_complete ; 30 public : uint32_t * _size_depth ; //[nb_context] 31 public : uint32_t _size_address ; 32 public : uint32_t * _size_inst_decod ; //[nb_decod_unit] 33 public : uint32_t * _size_inst_commit ; //[nb_ooo_engine] 29 public : uint32_t * _array_size_depth ; //[nb_context] 30 //public : uint32_t * _size_depth ; //[nb_context] 31 //public : uint32_t _size_address ; 32 //public : uint32_t * _size_nb_inst_decod ; //[nb_decod_unit] 33 //public : uint32_t _size_nb_inst_commit ; 34 34 public : uint32_t * _link_context_to_decod_unit ; //[nb_context] 35 public : uint32_t * _link_decod_unit_to_ooo_engine; //[nb_decod_unit]36 37 public : uint32_t _size_context_id;38 public : uint32_t _size_max_depth ;39 40 public : bool _have_port_context_id;41 public : bool * _have_port_depth ;42 public : bool _have_port_max_depth ;43 35 44 36 //-----[ methods ]----------------------------------------------------------- 45 37 public : Parameters (uint32_t nb_context, 46 38 uint32_t nb_decod_unit, 47 uint32_t nb_ooo_engine,48 39 uint32_t nb_inst_branch_complete, 49 40 uint32_t * size_depth, 50 41 uint32_t size_address, 51 uint32_t * size_ inst_decod,52 uint32_t * size_inst_commit,42 uint32_t * size_nb_inst_decod, 43 uint32_t size_nb_inst_commit, 53 44 uint32_t * link_context_to_decod_unit, 54 uint32_t * link_decod_unit_to_ooo_engine);45 bool is_toplevel=false); 55 46 // public : Parameters (Parameters & param) ; 56 47 public : ~Parameters () ; 48 49 public : void copy (void); 57 50 58 51 public : Parameters_test msg_error (void); -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Context_State/src/Context_State.cpp
r83 r88 39 39 usage_environment(_usage); 40 40 41 #if DEBUG_Context_State == true 42 log_printf(INFO,Context_State,FUNCTION,_("<%s> Parameters"),_name.c_str()); 43 44 std::cout << *param << std::endl; 45 #endif 46 41 47 log_printf(INFO,Context_State,FUNCTION,_("Allocation")); 42 48 … … 69 75 if (usage_is_set(_usage,USE_SYSTEMC)) 70 76 { 71 // Constant 77 // Constant 78 for (uint32_t i=0; i<_param->_nb_context; i++) 79 { 80 internal_BRANCH_EVENT_ACK [i] = 1; 81 PORT_WRITE(out_BRANCH_EVENT_ACK [i], internal_BRANCH_EVENT_ACK [i]); 82 } 83 72 84 for (uint32_t i=0; i<_param->_nb_decod_unit; i++) 73 85 { … … 76 88 } 77 89 78 for (uint32_t i=0; i<_param->_nb_ooo_engine; i++) 79 { 80 internal_COMMIT_EVENT_ACK [i] = 1; 81 PORT_WRITE(out_COMMIT_EVENT_ACK [i], internal_COMMIT_EVENT_ACK [i]); 82 } 90 internal_COMMIT_EVENT_ACK = 1; 91 PORT_WRITE(out_COMMIT_EVENT_ACK, internal_COMMIT_EVENT_ACK); 83 92 84 93 for (uint32_t i=0; i<_param->_nb_inst_branch_complete; i++) -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Context_State/src/Context_State_allocation.cpp
r83 r88 56 56 } 57 57 58 // ~~~~~[ Interface : "branch_event" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 59 { 60 ALLOC1_INTERFACE("branch_event", IN,SOUTH, "branch_event", _param->_nb_context); 61 62 ALLOC1_VALACK_IN ( in_BRANCH_EVENT_VAL ,VAL); 63 ALLOC1_VALACK_OUT(out_BRANCH_EVENT_ACK ,ACK); 64 // ALLOC1_SIGNAL_IN ( in_BRANCH_EVENT_CONTEXT_ID ,"context_id" ,Tcontext_t ,_param->_size_context_id); 65 // ALLOC1_SIGNAL_IN ( in_BRANCH_EVENT_DEPTH ,"depth" ,Tdepth_t ,_param->_size_depth); 66 // ALLOC1_SIGNAL_IN ( in_BRANCH_EVENT_MISS_PREDICTION ,"miss_prediction" ,Tcontrol_t ,1); 67 ALLOC1_SIGNAL_IN ( in_BRANCH_EVENT_ADDRESS_SRC ,"address_src" ,Taddress_t ,_param->_size_instruction_address); 68 ALLOC1_SIGNAL_IN ( in_BRANCH_EVENT_ADDRESS_DEST ,"address_dest" ,Taddress_t ,_param->_size_instruction_address); 69 } 70 58 71 // ~~~~~[ Interface : "decod_event" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 59 72 { … … 63 76 ALLOC1_VALACK_OUT(out_DECOD_EVENT_ACK ,ACK); 64 77 ALLOC1_SIGNAL_IN ( in_DECOD_EVENT_CONTEXT_ID ,"context_id" ,Tcontext_t ,_param->_size_context_id); 65 ALLOC1_SIGNAL_IN ( in_DECOD_EVENT_DEPTH ,"depth" ,Tdepth_t ,_param->_size_ max_depth);78 ALLOC1_SIGNAL_IN ( in_DECOD_EVENT_DEPTH ,"depth" ,Tdepth_t ,_param->_size_depth); 66 79 ALLOC1_SIGNAL_IN ( in_DECOD_EVENT_TYPE ,"type" ,Tevent_type_t ,_param->_size_event_type); 67 80 ALLOC1_SIGNAL_IN ( in_DECOD_EVENT_IS_DELAY_SLOT ,"is_delay_slot" ,Tcontrol_t ,1); 68 ALLOC1_SIGNAL_IN ( in_DECOD_EVENT_ADDRESS ,"address" ,Taddress_t ,_param->_size_ address);69 ALLOC1_SIGNAL_IN ( in_DECOD_EVENT_ADDRESS_EPCR ,"address_epcr" ,Taddress_t ,_param->_size_ address);81 ALLOC1_SIGNAL_IN ( in_DECOD_EVENT_ADDRESS ,"address" ,Taddress_t ,_param->_size_instruction_address); 82 ALLOC1_SIGNAL_IN ( in_DECOD_EVENT_ADDRESS_EPCR ,"address_epcr" ,Taddress_t ,_param->_size_instruction_address); 70 83 } 71 84 72 85 // ~~~~~[ Interface : "commit_event" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 73 86 { 74 ALLOC 1_INTERFACE("commit_event",IN ,EAST, _("Interface with the Re Order Buffer"), _param->_nb_ooo_engine);75 76 ALLOC 1_VALACK_IN( in_COMMIT_EVENT_VAL ,VAL);77 ALLOC 1_VALACK_OUT(out_COMMIT_EVENT_ACK ,ACK);78 ALLOC 1_SIGNAL_IN( in_COMMIT_EVENT_CONTEXT_ID ,"context_id" ,Tcontext_t ,_param->_size_context_id);79 ALLOC 1_SIGNAL_IN ( in_COMMIT_EVENT_DEPTH ,"depth" ,Tdepth_t ,_param->_size_max_depth);80 ALLOC 1_SIGNAL_IN( in_COMMIT_EVENT_TYPE ,"type" ,Tevent_type_t ,_param->_size_event_type);81 ALLOC 1_SIGNAL_IN( in_COMMIT_EVENT_IS_DELAY_SLOT ,"is_delay_slot" ,Tcontrol_t ,1);82 ALLOC 1_SIGNAL_IN ( in_COMMIT_EVENT_ADDRESS ,"address" ,Taddress_t ,_param->_size_address);83 ALLOC 1_SIGNAL_IN ( in_COMMIT_EVENT_ADDRESS_EPCR ,"address_epcr" ,Taddress_t ,_param->_size_address);84 ALLOC 1_SIGNAL_IN( in_COMMIT_EVENT_ADDRESS_EEAR_VAL ,"address_eear_val",Tcontrol_t ,1);85 ALLOC 1_SIGNAL_IN ( in_COMMIT_EVENT_ADDRESS_EEAR ,"address_eear" ,Taddress_t ,_param->_size_address);87 ALLOC_INTERFACE("commit_event",IN ,EAST, _("Interface with the Re Order Buffer")); 88 89 ALLOC_VALACK_IN ( in_COMMIT_EVENT_VAL ,VAL); 90 ALLOC_VALACK_OUT (out_COMMIT_EVENT_ACK ,ACK); 91 ALLOC_SIGNAL_IN ( in_COMMIT_EVENT_CONTEXT_ID ,"context_id" ,Tcontext_t ,_param->_size_context_id); 92 ALLOC_SIGNAL_IN ( in_COMMIT_EVENT_DEPTH ,"depth" ,Tdepth_t ,_param->_size_depth); 93 ALLOC_SIGNAL_IN ( in_COMMIT_EVENT_TYPE ,"type" ,Tevent_type_t ,_param->_size_event_type); 94 ALLOC_SIGNAL_IN ( in_COMMIT_EVENT_IS_DELAY_SLOT ,"is_delay_slot" ,Tcontrol_t ,1); 95 ALLOC_SIGNAL_IN ( in_COMMIT_EVENT_ADDRESS ,"address" ,Taddress_t ,_param->_size_instruction_address); 96 ALLOC_SIGNAL_IN ( in_COMMIT_EVENT_ADDRESS_EPCR ,"address_epcr" ,Taddress_t ,_param->_size_instruction_address); 97 ALLOC_SIGNAL_IN ( in_COMMIT_EVENT_ADDRESS_EEAR_VAL ,"address_eear_val",Tcontrol_t ,1); 98 ALLOC_SIGNAL_IN ( in_COMMIT_EVENT_ADDRESS_EEAR ,"address_eear" ,Taddress_t ,_param->_size_instruction_address); 86 99 } 87 100 … … 93 106 ALLOC1_VALACK_OUT(out_BRANCH_COMPLETE_ACK ,ACK); 94 107 ALLOC1_SIGNAL_IN ( in_BRANCH_COMPLETE_CONTEXT_ID ,"context_id" ,Tcontext_t ,_param->_size_context_id); 95 ALLOC1_SIGNAL_IN ( in_BRANCH_COMPLETE_DEPTH ,"depth" ,Tdepth_t ,_param->_size_ max_depth);108 ALLOC1_SIGNAL_IN ( in_BRANCH_COMPLETE_DEPTH ,"depth" ,Tdepth_t ,_param->_size_depth); 96 109 ALLOC1_SIGNAL_IN ( in_BRANCH_COMPLETE_MISS_PREDICTION ,"miss_prediction",Tcontrol_t ,1); 97 110 ALLOC1_SIGNAL_IN ( in_BRANCH_COMPLETE_TAKE ,"take" ,Tcontrol_t ,1); 98 ALLOC1_SIGNAL_IN ( in_BRANCH_COMPLETE_ADDRESS_SRC ,"address_src" ,Taddress_t ,_param->_size_ address);99 ALLOC1_SIGNAL_IN ( in_BRANCH_COMPLETE_ADDRESS_DEST ,"address_dest" ,Taddress_t ,_param->_size_ address);111 ALLOC1_SIGNAL_IN ( in_BRANCH_COMPLETE_ADDRESS_SRC ,"address_src" ,Taddress_t ,_param->_size_instruction_address); 112 ALLOC1_SIGNAL_IN ( in_BRANCH_COMPLETE_ADDRESS_DEST ,"address_dest" ,Taddress_t ,_param->_size_instruction_address); 100 113 } 101 114 102 115 // ~~~~~[ Interface : "nb_inst" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 103 116 { 104 ALLOC1_INTERFACE("nb_inst",IN ,EAST, _("Interface to count in fligt present instruction."), _param->_nb_decod_unit); 105 106 ALLOC1_SIGNAL_IN ( in_NB_INST_DECOD_ALL ,"decod_all" ,Tcounter_t ,_param->_size_inst_decod [alloc_signal_it1]); 107 // ALLOC1_SIGNAL_IN ( in_NB_INST_COMMIT_ALL ,"commit_all",Tcounter_t ,_param->_size_inst_commit [alloc_signal_it1]); 108 // ALLOC1_SIGNAL_IN ( in_NB_INST_COMMIT_MEM ,"commit_mem",Tcounter_t ,_param->_size_inst_commit [alloc_signal_it1]); 109 } 110 { 111 ALLOC1_INTERFACE("nb_inst",IN ,EAST, _("Interface to count in fligt present instruction."), _param->_nb_ooo_engine); 112 113 // ALLOC1_SIGNAL_IN ( in_NB_INST_DECOD_ALL ,"decod_all" ,Tcounter_t ,_param->_size_inst_decod [alloc_signal_it1]); 114 ALLOC1_SIGNAL_IN ( in_NB_INST_COMMIT_ALL ,"commit_all",Tcounter_t ,_param->_size_inst_commit [alloc_signal_it1]); 115 ALLOC1_SIGNAL_IN ( in_NB_INST_COMMIT_MEM ,"commit_mem",Tcounter_t ,_param->_size_inst_commit [alloc_signal_it1]); 117 ALLOC1_INTERFACE("nb_inst",IN ,EAST, _("Interface to count in fligt present instruction."),_param->_nb_context); 118 119 ALLOC1_SIGNAL_IN ( in_NB_INST_DECOD_ALL ,"decod_all" ,Tcounter_t ,_param->_size_nb_inst_decod); 120 ALLOC1_SIGNAL_IN ( in_NB_INST_COMMIT_ALL ,"commit_all",Tcounter_t ,_param->_size_nb_inst_commit); 121 ALLOC1_SIGNAL_IN ( in_NB_INST_COMMIT_MEM ,"commit_mem",Tcounter_t ,_param->_size_nb_inst_commit); 116 122 } 117 123 … … 122 128 ALLOC1_VALACK_OUT(out_EVENT_VAL ,VAL); 123 129 ALLOC1_VALACK_IN ( in_EVENT_ACK ,ACK); 124 ALLOC1_SIGNAL_OUT(out_EVENT_ADDRESS ,"address" ,Taddress_t ,_param->_size_ address);125 ALLOC1_SIGNAL_OUT(out_EVENT_ADDRESS_NEXT ,"address_next" ,Taddress_t ,_param->_size_ address);130 ALLOC1_SIGNAL_OUT(out_EVENT_ADDRESS ,"address" ,Taddress_t ,_param->_size_instruction_address); 131 ALLOC1_SIGNAL_OUT(out_EVENT_ADDRESS_NEXT ,"address_next" ,Taddress_t ,_param->_size_instruction_address); 126 132 ALLOC1_SIGNAL_OUT(out_EVENT_ADDRESS_NEXT_VAL ,"address_next_val",Tcontrol_t ,1); 127 133 ALLOC1_SIGNAL_OUT(out_EVENT_IS_DS_TAKE ,"is_ds_take" ,Tcontrol_t ,1); 128 134 } 129 135 130 // ~~~~~[ Interface "spr " ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~131 { 132 ALLOC1_INTERFACE("spr ",OUT,WEST, _("An exception occure : write \"exception PC\"."), _param->_nb_context);133 134 ALLOC1_VALACK_OUT(out_SPR_ VAL,VAL);135 ALLOC1_VALACK_IN ( in_SPR_ ACK,ACK);136 ALLOC1_SIGNAL_OUT(out_SPR_E PCR ,"epcr" ,Taddress_t, _param->_size_address);137 ALLOC1_SIGNAL_OUT(out_SPR_E EAR ,"eear" ,Taddress_t, _param->_size_address);138 ALLOC1_SIGNAL_OUT(out_SPR_E EAR_WEN,"eear_wen" ,Tcontrol_t,1);139 ALLOC1_SIGNAL_OUT(out_SPR_ SR_DSX,"sr_dsx" ,Tcontrol_t,1);140 ALLOC1_SIGNAL_OUT(out_SPR_ SR_TO_ESR,"sr_to_esr",Tcontrol_t,1);136 // ~~~~~[ Interface "spr_event" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 137 { 138 ALLOC1_INTERFACE("spr_event",OUT,WEST, _("An exception occure : write \"exception PC\"."), _param->_nb_context); 139 140 ALLOC1_VALACK_OUT(out_SPR_EVENT_VAL ,VAL); 141 ALLOC1_VALACK_IN ( in_SPR_EVENT_ACK ,ACK); 142 ALLOC1_SIGNAL_OUT(out_SPR_EVENT_EPCR ,"epcr" ,Taddress_t, _param->_size_instruction_address); 143 ALLOC1_SIGNAL_OUT(out_SPR_EVENT_EEAR ,"eear" ,Taddress_t, _param->_size_instruction_address); 144 ALLOC1_SIGNAL_OUT(out_SPR_EVENT_EEAR_WEN ,"eear_wen" ,Tcontrol_t,1); 145 ALLOC1_SIGNAL_OUT(out_SPR_EVENT_SR_DSX ,"sr_dsx" ,Tcontrol_t,1); 146 ALLOC1_SIGNAL_OUT(out_SPR_EVENT_SR_TO_ESR ,"sr_to_esr",Tcontrol_t,1); 141 147 } 142 148 … … 152 158 ALLOC1_INTERFACE("depth",IN ,NORTH, _("From prediction_unit."), _param->_nb_context); 153 159 154 ALLOC1_SIGNAL_IN ( in_DEPTH_TAIL ,"tail",Tdepth_t,_param->_size_depth [alloc_signal_it1]); 155 } 156 157 // ~~~~~[ Register ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 158 159 reg_STATE = new context_state_t [_param->_nb_context]; 160 reg_EVENT_ADDRESS = new Taddress_t [_param->_nb_context]; 161 reg_EVENT_ADDRESS_EPCR = new Taddress_t [_param->_nb_context]; 162 reg_EVENT_ADDRESS_EPCR_VAL = new Tcontrol_t [_param->_nb_context]; 163 reg_EVENT_ADDRESS_EEAR = new Taddress_t [_param->_nb_context]; 164 reg_EVENT_ADDRESS_EEAR_VAL = new Tcontrol_t [_param->_nb_context]; 165 reg_EVENT_IS_DELAY_SLOT = new Tcontrol_t [_param->_nb_context]; 166 reg_EVENT_IS_DS_TAKE = new Tcontrol_t [_param->_nb_context]; 167 reg_EVENT_DEPTH = new Tdepth_t [_param->_nb_context]; 168 169 // ~~~~~[ Internal ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 170 internal_DECOD_EVENT_ACK = new Tcontrol_t [_param->_nb_decod_unit]; 171 internal_COMMIT_EVENT_ACK = new Tcontrol_t [_param->_nb_ooo_engine]; 172 internal_BRANCH_COMPLETE_ACK = new Tcontrol_t [_param->_nb_inst_branch_complete]; 173 internal_EVENT_VAL = new Tcontrol_t [_param->_nb_context]; 174 internal_SPR_VAL = new Tcontrol_t [_param->_nb_context]; 175 160 ALLOC1_SIGNAL_IN ( in_DEPTH_MIN ,"min" ,Tdepth_t,_param->_size_depth); 161 } 162 163 164 // ~~~~~[ Interface : "spr" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 165 { 166 ALLOC1_INTERFACE("spr",IN,EAST,_("Interface with the special registerFile"),_param->_nb_context); 167 168 ALLOC1_SIGNAL_IN ( in_SPR_SR_IEE ,"SR_IEE",Tcontrol_t,1); 169 ALLOC1_SIGNAL_IN ( in_SPR_SR_EPH ,"SR_EPH",Tcontrol_t,1); 170 } 171 172 // ~~~~~[ Interface : "interrupt" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 173 { 174 ALLOC1_INTERFACE("interrupt",IN,NORTH,_("Interrupt Exception"),_param->_nb_context); 175 176 ALLOC1_SIGNAL_IN ( in_INTERRUPT_ENABLE ,"ENABLE",Tcontrol_t,1); 177 } 178 179 if (usage_is_set(_usage,USE_SYSTEMC)) 180 { 181 // ~~~~~[ Register ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 182 183 reg_STATE = new context_state_t [_param->_nb_context]; 184 reg_EVENT_ADDRESS = new Taddress_t [_param->_nb_context]; 185 reg_EVENT_ADDRESS_EPCR = new Taddress_t [_param->_nb_context]; 186 reg_EVENT_ADDRESS_EPCR_VAL = new Tcontrol_t [_param->_nb_context]; 187 reg_EVENT_ADDRESS_EEAR = new Taddress_t [_param->_nb_context]; 188 reg_EVENT_ADDRESS_EEAR_VAL = new Tcontrol_t [_param->_nb_context]; 189 reg_EVENT_IS_DELAY_SLOT = new Tcontrol_t [_param->_nb_context]; 190 reg_EVENT_IS_DS_TAKE = new Tcontrol_t [_param->_nb_context]; 191 reg_EVENT_DEPTH = new Tdepth_t [_param->_nb_context]; 192 reg_INTERRUPT_ENABLE = new Tcontrol_t [_param->_nb_context]; 193 194 // ~~~~~[ Internal ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 195 internal_BRANCH_EVENT_ACK = new Tcontrol_t [_param->_nb_context]; 196 internal_DECOD_EVENT_ACK = new Tcontrol_t [_param->_nb_decod_unit]; 197 internal_BRANCH_COMPLETE_ACK = new Tcontrol_t [_param->_nb_inst_branch_complete]; 198 internal_EVENT_VAL = new Tcontrol_t [_param->_nb_context]; 199 internal_SPR_EVENT_VAL = new Tcontrol_t [_param->_nb_context]; 200 } 201 176 202 // ~~~~~[ Component ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 177 203 -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Context_State/src/Context_State_deallocation.cpp
r83 r88 28 28 delete in_NRESET; 29 29 30 DELETE1_SIGNAL( in_BRANCH_EVENT_VAL ,_param->_nb_context,1); 31 DELETE1_SIGNAL(out_BRANCH_EVENT_ACK ,_param->_nb_context,1); 32 // DELETE1_SIGNAL( in_BRANCH_EVENT_CONTEXT_ID ,_param->_nb_context,_param->_size_context_id); 33 // DELETE1_SIGNAL( in_BRANCH_EVENT_DEPTH ,_param->_nb_context,_param->_size_depth); 34 // DELETE1_SIGNAL( in_BRANCH_EVENT_MISS_PREDICTION ,_param->_nb_context,1); 35 DELETE1_SIGNAL( in_BRANCH_EVENT_ADDRESS_SRC ,_param->_nb_context,_param->_size_instruction_address); 36 DELETE1_SIGNAL( in_BRANCH_EVENT_ADDRESS_DEST ,_param->_nb_context,_param->_size_instruction_address); 37 30 38 DELETE1_SIGNAL( in_DECOD_EVENT_VAL ,_param->_nb_decod_unit,1); 31 39 DELETE1_SIGNAL(out_DECOD_EVENT_ACK ,_param->_nb_decod_unit,1); 32 40 DELETE1_SIGNAL( in_DECOD_EVENT_CONTEXT_ID ,_param->_nb_decod_unit,_param->_size_context_id); 33 DELETE1_SIGNAL( in_DECOD_EVENT_DEPTH ,_param->_nb_decod_unit,_param->_size_ max_depth);41 DELETE1_SIGNAL( in_DECOD_EVENT_DEPTH ,_param->_nb_decod_unit,_param->_size_depth); 34 42 DELETE1_SIGNAL( in_DECOD_EVENT_TYPE ,_param->_nb_decod_unit,_param->_size_event_type); 35 43 DELETE1_SIGNAL( in_DECOD_EVENT_IS_DELAY_SLOT ,_param->_nb_decod_unit,1); 36 DELETE1_SIGNAL( in_DECOD_EVENT_ADDRESS ,_param->_nb_decod_unit,_param->_size_ address);37 DELETE1_SIGNAL( in_DECOD_EVENT_ADDRESS_EPCR ,_param->_nb_decod_unit,_param->_size_ address);44 DELETE1_SIGNAL( in_DECOD_EVENT_ADDRESS ,_param->_nb_decod_unit,_param->_size_instruction_address); 45 DELETE1_SIGNAL( in_DECOD_EVENT_ADDRESS_EPCR ,_param->_nb_decod_unit,_param->_size_instruction_address); 38 46 39 DELETE 1_SIGNAL( in_COMMIT_EVENT_VAL ,_param->_nb_ooo_engine,1);40 DELETE 1_SIGNAL(out_COMMIT_EVENT_ACK ,_param->_nb_ooo_engine,1);41 DELETE 1_SIGNAL( in_COMMIT_EVENT_CONTEXT_ID ,_param->_nb_ooo_engine,_param->_size_context_id);42 DELETE 1_SIGNAL( in_COMMIT_EVENT_DEPTH ,_param->_nb_ooo_engine,_param->_size_max_depth);43 DELETE 1_SIGNAL( in_COMMIT_EVENT_TYPE ,_param->_nb_ooo_engine,_param->_size_event_type);44 DELETE 1_SIGNAL( in_COMMIT_EVENT_IS_DELAY_SLOT ,_param->_nb_ooo_engine,1);45 DELETE 1_SIGNAL( in_COMMIT_EVENT_ADDRESS ,_param->_nb_ooo_engine,_param->_size_address);46 DELETE 1_SIGNAL( in_COMMIT_EVENT_ADDRESS_EPCR ,_param->_nb_ooo_engine,_param->_size_address);47 DELETE 1_SIGNAL( in_COMMIT_EVENT_ADDRESS_EEAR_VAL ,_param->_nb_ooo_engine,_param->_size_address);48 DELETE 1_SIGNAL( in_COMMIT_EVENT_ADDRESS_EEAR ,_param->_nb_ooo_engine,1);47 DELETE_SIGNAL ( in_COMMIT_EVENT_VAL ,1); 48 DELETE_SIGNAL (out_COMMIT_EVENT_ACK ,1); 49 DELETE_SIGNAL ( in_COMMIT_EVENT_CONTEXT_ID ,_param->_size_context_id); 50 DELETE_SIGNAL ( in_COMMIT_EVENT_DEPTH ,_param->_size_depth); 51 DELETE_SIGNAL ( in_COMMIT_EVENT_TYPE ,_param->_size_event_type); 52 DELETE_SIGNAL ( in_COMMIT_EVENT_IS_DELAY_SLOT ,1); 53 DELETE_SIGNAL ( in_COMMIT_EVENT_ADDRESS ,_param->_size_instruction_address); 54 DELETE_SIGNAL ( in_COMMIT_EVENT_ADDRESS_EPCR ,_param->_size_instruction_address); 55 DELETE_SIGNAL ( in_COMMIT_EVENT_ADDRESS_EEAR_VAL ,_param->_size_instruction_address); 56 DELETE_SIGNAL ( in_COMMIT_EVENT_ADDRESS_EEAR ,1); 49 57 50 58 DELETE1_SIGNAL( in_BRANCH_COMPLETE_VAL ,_param->_nb_inst_branch_complete,1); 51 59 DELETE1_SIGNAL(out_BRANCH_COMPLETE_ACK ,_param->_nb_inst_branch_complete,1); 52 60 DELETE1_SIGNAL( in_BRANCH_COMPLETE_CONTEXT_ID ,_param->_nb_inst_branch_complete,_param->_size_context_id); 53 DELETE1_SIGNAL( in_BRANCH_COMPLETE_DEPTH ,_param->_nb_inst_branch_complete,_param->_size_ max_depth);61 DELETE1_SIGNAL( in_BRANCH_COMPLETE_DEPTH ,_param->_nb_inst_branch_complete,_param->_size_depth); 54 62 DELETE1_SIGNAL( in_BRANCH_COMPLETE_MISS_PREDICTION ,_param->_nb_inst_branch_complete,1); 55 63 DELETE1_SIGNAL( in_BRANCH_COMPLETE_TAKE ,_param->_nb_inst_branch_complete,1); 56 DELETE1_SIGNAL( in_BRANCH_COMPLETE_ADDRESS_SRC ,_param->_nb_inst_branch_complete,_param->_size_ address);57 DELETE1_SIGNAL( in_BRANCH_COMPLETE_ADDRESS_DEST ,_param->_nb_inst_branch_complete,_param->_size_ address);64 DELETE1_SIGNAL( in_BRANCH_COMPLETE_ADDRESS_SRC ,_param->_nb_inst_branch_complete,_param->_size_instruction_address); 65 DELETE1_SIGNAL( in_BRANCH_COMPLETE_ADDRESS_DEST ,_param->_nb_inst_branch_complete,_param->_size_instruction_address); 58 66 59 DELETE1_SIGNAL( in_NB_INST_DECOD_ALL ,_param->_nb_decod_unit,_param->_size_inst_decod [alloc_signal_it1]); 60 // DELETE1_SIGNAL( in_NB_INST_COMMIT_ALL ,_param->_nb_decod_unit,_param->_size_inst_commit [alloc_signal_it1]); 61 // DELETE1_SIGNAL( in_NB_INST_COMMIT_MEM ,_param->_nb_decod_unit,_param->_size_inst_commit [alloc_signal_it1]); 62 // DELETE1_SIGNAL( in_NB_INST_DECOD_ALL ,_param->_nb_ooo_engine,_param->_size_inst_decod [alloc_signal_it1]); 63 DELETE1_SIGNAL( in_NB_INST_COMMIT_ALL ,_param->_nb_ooo_engine,_param->_size_inst_commit [alloc_signal_it1]); 64 DELETE1_SIGNAL( in_NB_INST_COMMIT_MEM ,_param->_nb_ooo_engine,_param->_size_inst_commit [alloc_signal_it1]); 67 DELETE1_SIGNAL( in_NB_INST_DECOD_ALL ,_param->_nb_context,_param->_size_nb_inst_decod); 68 DELETE1_SIGNAL( in_NB_INST_COMMIT_ALL ,_param->_nb_context,_param->_size_nb_inst_commit); 69 DELETE1_SIGNAL( in_NB_INST_COMMIT_MEM ,_param->_nb_context,_param->_size_nb_inst_commit); 65 70 66 71 DELETE1_SIGNAL(out_EVENT_VAL ,_param->_nb_context,1); 67 72 DELETE1_SIGNAL( in_EVENT_ACK ,_param->_nb_context,1); 68 DELETE1_SIGNAL(out_EVENT_ADDRESS ,_param->_nb_context,_param->_size_ address);69 DELETE1_SIGNAL(out_EVENT_ADDRESS_NEXT ,_param->_nb_context,_param->_size_ address);73 DELETE1_SIGNAL(out_EVENT_ADDRESS ,_param->_nb_context,_param->_size_instruction_address); 74 DELETE1_SIGNAL(out_EVENT_ADDRESS_NEXT ,_param->_nb_context,_param->_size_instruction_address); 70 75 DELETE1_SIGNAL(out_EVENT_ADDRESS_NEXT_VAL ,_param->_nb_context,1); 71 76 DELETE1_SIGNAL(out_EVENT_IS_DS_TAKE ,_param->_nb_context,1); 72 77 73 DELETE1_SIGNAL(out_SPR_ VAL,_param->_nb_context,1);74 DELETE1_SIGNAL( in_SPR_ ACK,_param->_nb_context,1);75 DELETE1_SIGNAL(out_SPR_E PCR ,_param->_nb_context,_param->_size_address);76 DELETE1_SIGNAL(out_SPR_E EAR ,_param->_nb_context,_param->_size_address);77 DELETE1_SIGNAL(out_SPR_E EAR_WEN,_param->_nb_context,1);78 DELETE1_SIGNAL(out_SPR_ SR_DSX,_param->_nb_context,1);79 DELETE1_SIGNAL(out_SPR_ SR_TO_ESR,_param->_nb_context,1);78 DELETE1_SIGNAL(out_SPR_EVENT_VAL ,_param->_nb_context,1); 79 DELETE1_SIGNAL( in_SPR_EVENT_ACK ,_param->_nb_context,1); 80 DELETE1_SIGNAL(out_SPR_EVENT_EPCR ,_param->_nb_context,_param->_size_instruction_address); 81 DELETE1_SIGNAL(out_SPR_EVENT_EEAR ,_param->_nb_context,_param->_size_instruction_address); 82 DELETE1_SIGNAL(out_SPR_EVENT_EEAR_WEN ,_param->_nb_context,1); 83 DELETE1_SIGNAL(out_SPR_EVENT_SR_DSX ,_param->_nb_context,1); 84 DELETE1_SIGNAL(out_SPR_EVENT_SR_TO_ESR ,_param->_nb_context,1); 80 85 81 86 DELETE1_SIGNAL(out_CONTEXT_DECOD_ENABLE ,_param->_nb_context,1); 82 87 83 DELETE1_SIGNAL( in_DEPTH_TAIL ,_param->_nb_context,_param->_size_depth [alloc_signal_it1]); 88 DELETE1_SIGNAL( in_DEPTH_MIN ,_param->_nb_context,_param->_size_depth); 89 90 DELETE1_SIGNAL( in_SPR_SR_IEE ,_param->_nb_context,1); 91 DELETE1_SIGNAL( in_SPR_SR_EPH ,_param->_nb_context,1); 92 93 DELETE1_SIGNAL( in_INTERRUPT_ENABLE ,_param->_nb_context,1); 94 95 // ~~~~~[ Register ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 96 delete [] reg_STATE ; 97 delete [] reg_EVENT_ADDRESS ; 98 delete [] reg_EVENT_ADDRESS_EPCR ; 99 delete [] reg_EVENT_ADDRESS_EPCR_VAL; 100 delete [] reg_EVENT_ADDRESS_EEAR ; 101 delete [] reg_EVENT_ADDRESS_EEAR_VAL; 102 delete [] reg_EVENT_IS_DELAY_SLOT ; 103 delete [] reg_EVENT_IS_DS_TAKE ; 104 delete [] reg_EVENT_DEPTH ; 105 delete [] reg_INTERRUPT_ENABLE ; 106 107 // ~~~~~[ Internal ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 108 delete [] internal_BRANCH_EVENT_ACK ; 109 delete [] internal_DECOD_EVENT_ACK ; 110 delete [] internal_EVENT_VAL ; 111 delete [] internal_SPR_EVENT_VAL ; 84 112 } 85 86 // ~~~~~[ Register ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 87 delete [] reg_STATE ; 88 delete [] reg_EVENT_ADDRESS ; 89 delete [] reg_EVENT_ADDRESS_EPCR ; 90 delete [] reg_EVENT_ADDRESS_EPCR_VAL; 91 delete [] reg_EVENT_ADDRESS_EEAR ; 92 delete [] reg_EVENT_ADDRESS_EEAR_VAL; 93 delete [] reg_EVENT_IS_DELAY_SLOT ; 94 delete [] reg_EVENT_IS_DS_TAKE ; 95 delete [] reg_EVENT_DEPTH ; 96 97 // ~~~~~[ Internal ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 98 delete [] internal_DECOD_EVENT_ACK ; 99 delete [] internal_COMMIT_EVENT_ACK ; 100 delete [] internal_EVENT_VAL ; 101 delete [] internal_SPR_VAL ; 102 113 103 114 // ~~~~~[ Component ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 104 115 -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Context_State/src/Context_State_genMoore.cpp
r83 r88 22 22 { 23 23 log_begin(Context_State,FUNCTION); 24 log_function(Context_State,FUNCTION,_name.c_str()); 24 25 25 26 // ------------------------------------------------------------------- … … 30 31 context_state_t state = reg_STATE [i]; 31 32 32 internal_EVENT_VAL [i] = ((state == CONTEXT_STATE_KO_EXCEP_ADDR) or 33 (state == CONTEXT_STATE_KO_MISS_ADDR ) or 34 (state == CONTEXT_STATE_KO_PSYNC_ADDR) or 35 (state == CONTEXT_STATE_KO_CSYNC_ADDR)); 36 33 Tcontrol_t val = ((state == CONTEXT_STATE_KO_EXCEP_ADDR) or 34 (state == CONTEXT_STATE_KO_MISS_ADDR ) or 35 (state == CONTEXT_STATE_KO_PSYNC_ADDR) or 36 (state == CONTEXT_STATE_KO_CSYNC_ADDR)); 37 38 // SR can't change in this cycle 39 // Exception Prefix High 40 Taddress_t address = reg_EVENT_ADDRESS [i] | (((state == CONTEXT_STATE_KO_EXCEP_ADDR) and PORT_READ(in_SPR_SR_EPH [i]))?(0xF000000>>2):0); 41 Taddress_t address_next = reg_EVENT_ADDRESS_EPCR [i]; 42 Tcontrol_t address_next_val = (state == CONTEXT_STATE_KO_MISS_ADDR) and (reg_EVENT_ADDRESS_EPCR_VAL [i]); 43 Tcontrol_t is_ds_take = (state == CONTEXT_STATE_KO_MISS_ADDR) and (reg_EVENT_IS_DS_TAKE [i]); 37 44 // excep : address exception 38 45 // miss : address delay_slot, and address dest 39 46 // psync : address next 40 47 // csync : address next 41 PORT_WRITE(out_EVENT_VAL [i], internal_EVENT_VAL [i]); 42 PORT_WRITE(out_EVENT_ADDRESS [i], reg_EVENT_ADDRESS [i]); 43 PORT_WRITE(out_EVENT_ADDRESS_NEXT [i], reg_EVENT_ADDRESS_EPCR [i]); 44 PORT_WRITE(out_EVENT_ADDRESS_NEXT_VAL [i], (state == CONTEXT_STATE_KO_MISS_ADDR) and (reg_EVENT_ADDRESS_EPCR_VAL [i])); 45 PORT_WRITE(out_EVENT_IS_DS_TAKE [i], (state == CONTEXT_STATE_KO_MISS_ADDR) and (reg_EVENT_IS_DS_TAKE [i])); 48 internal_EVENT_VAL [i] = val; 49 PORT_WRITE(out_EVENT_VAL [i], val); 50 PORT_WRITE(out_EVENT_ADDRESS [i], address); 51 PORT_WRITE(out_EVENT_ADDRESS_NEXT [i], address_next); 52 PORT_WRITE(out_EVENT_ADDRESS_NEXT_VAL [i], address_next_val); 53 PORT_WRITE(out_EVENT_IS_DS_TAKE [i], is_ds_take); 54 55 log_printf(TRACE,Context_State,FUNCTION," * EVENT Context : %d", i); 56 log_printf(TRACE,Context_State,FUNCTION," * VAL : %d", val); 57 log_printf(TRACE,Context_State,FUNCTION," * ADDRESS : %.8x (%.8x)", address , address <<2); 58 log_printf(TRACE,Context_State,FUNCTION," * ADDRESS_NEXT : %.8x (%.8x)", address_next, address_next<<2); 59 log_printf(TRACE,Context_State,FUNCTION," * ADDRESS_NEXT_VAL : %d", address_next_val); 60 log_printf(TRACE,Context_State,FUNCTION," * IS_DS_TAKE : %d", is_ds_take); 46 61 } 47 62 48 63 // ------------------------------------------------------------------- 49 // -----[ SPR ]-------------------------------------------------------64 // -----[ SPR_EVENT ]------------------------------------------------- 50 65 // ------------------------------------------------------------------- 51 66 for (uint32_t i=0; i<_param->_nb_context; i++) … … 53 68 context_state_t state = reg_STATE [i]; 54 69 55 internal_SPR_ VAL [i] = (state == CONTEXT_STATE_KO_EXCEP_SPR );70 internal_SPR_EVENT_VAL [i] = (state == CONTEXT_STATE_KO_EXCEP_SPR ); 56 71 57 PORT_WRITE(out_SPR_ VAL [i], internal_SPR_VAL[i]);58 PORT_WRITE(out_SPR_E PCR [i], reg_EVENT_ADDRESS_EPCR [i]);59 PORT_WRITE(out_SPR_E EAR [i], reg_EVENT_ADDRESS_EEAR [i]);60 PORT_WRITE(out_SPR_E EAR_WEN [i], reg_EVENT_ADDRESS_EEAR_VAL [i]);61 PORT_WRITE(out_SPR_ SR_DSX [i], reg_EVENT_IS_DELAY_SLOT [i]);62 PORT_WRITE(out_SPR_ SR_TO_ESR [i], 1);72 PORT_WRITE(out_SPR_EVENT_VAL [i], internal_SPR_EVENT_VAL [i]); 73 PORT_WRITE(out_SPR_EVENT_EPCR [i], reg_EVENT_ADDRESS_EPCR [i]); 74 PORT_WRITE(out_SPR_EVENT_EEAR [i], reg_EVENT_ADDRESS_EEAR [i]); 75 PORT_WRITE(out_SPR_EVENT_EEAR_WEN [i], reg_EVENT_ADDRESS_EEAR_VAL [i]); 76 PORT_WRITE(out_SPR_EVENT_SR_DSX [i], reg_EVENT_IS_DELAY_SLOT [i]); 77 PORT_WRITE(out_SPR_EVENT_SR_TO_ESR [i], 1); 63 78 } 64 79 -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Context_State/src/Context_State_transition.cpp
r83 r88 22 22 { 23 23 log_begin(Context_State,FUNCTION); 24 log_function(Context_State,FUNCTION,_name.c_str()); 24 25 25 26 if (PORT_READ(in_NRESET) == 0) 26 27 { 27 for (uint32_t i=0; i<_param->_nb_context; i++) 28 reg_STATE [i] = CONTEXT_STATE_OK; 28 for (uint32_t i=0; i<_param->_nb_context; i++) 29 { 30 reg_STATE [i] = CONTEXT_STATE_OK; 31 reg_INTERRUPT_ENABLE [i] = 0; 32 } 29 33 } 30 34 else 31 35 { 32 // ------------------------------------------------------------------- 33 // -----[ DECOD_EVENT ]----------------------------------------------- 34 // ------------------------------------------------------------------- 35 36 for (uint32_t i=0; i<_param->_nb_decod_unit; i++) 37 if (PORT_READ(in_DECOD_EVENT_VAL [i]) and internal_DECOD_EVENT_ACK [i]) 38 { 39 Tcontext_t context = (_param->_have_port_context_id )?PORT_READ(in_DECOD_EVENT_CONTEXT_ID [i]):0; 40 Tdepth_t depth = (_param->_have_port_max_depth )?PORT_READ(in_DECOD_EVENT_DEPTH [i]):0; 41 Tdepth_t depth_cur = reg_EVENT_DEPTH [context]; 42 Tdepth_t depth_base = (_param->_have_port_depth [context])?PORT_READ(in_DEPTH_TAIL [context]):0; 43 Tdepth_t depth_max = _param->_size_depth [context]; 44 45 Tdepth_t depth0 = (depth_cur>=depth_base)?(depth_cur-depth_base):((depth_cur+depth_max-depth_base)); 46 Tdepth_t depth1 = (depth >=depth_base)?(depth -depth_base):((depth +depth_max-depth_base)); 47 48 context_state_t state = reg_STATE [context]; 49 Tevent_type_t type = PORT_READ(in_DECOD_EVENT_TYPE [i]); 50 51 // miss > excep > spr/sync 52 uint8_t priority0 = (state == CONTEXT_STATE_KO_MISS)?2:((state == CONTEXT_STATE_KO_EXCEP)?1:0); 53 uint8_t priority1 = (state == EVENT_TYPE_EXCEPTION)?1:0; 54 55 // is_valid = can modify local information 56 // if context_state_ok : yes 57 // if context_state_ko : test the depth, and the priority of envent 58 59 bool is_valid = ((state == CONTEXT_STATE_OK) or 60 (depth1< depth0) or 61 ((depth1==depth0) and (priority1>priority0))); 62 63 if (is_valid) 64 { 65 // decod : 66 // type : csync, psync, msync, spr_access (l.mac, l.maci, l.macrc, l.msb, l.mfspr, l.mtspr), exception (l.sys) 67 context_state_t state_next = state; 68 Taddress_t address = PORT_READ(in_DECOD_EVENT_ADDRESS [i]); 69 Tcontrol_t is_delay_slot = PORT_READ(in_DECOD_EVENT_IS_DELAY_SLOT [i]); 70 71 switch (type) 72 { 73 case EVENT_TYPE_EXCEPTION : 74 { 75 state_next = CONTEXT_STATE_KO_EXCEP; 76 break; 77 } 78 case EVENT_TYPE_SPR_ACCESS : 79 { 80 state_next = CONTEXT_STATE_KO_SPR ; 81 address++; // take next address 82 if (is_delay_slot) 83 throw ERRORMORPHEO(FUNCTION,"SPR access in delay slot, not supported.\n"); 84 break; 85 } 86 case EVENT_TYPE_MSYNC : 87 { 88 state_next = CONTEXT_STATE_KO_MSYNC; 89 address++; // take next address 90 if (is_delay_slot) 91 throw ERRORMORPHEO(FUNCTION,"SPR access in delay slot, not supported.\n"); 92 break; 93 } 94 case EVENT_TYPE_PSYNC : 95 { 96 state_next = CONTEXT_STATE_KO_PSYNC; 97 address++; // take next address 98 if (is_delay_slot) 99 throw ERRORMORPHEO(FUNCTION,"SPR access in delay slot, not supported.\n"); 100 break; 101 } 102 case EVENT_TYPE_CSYNC : 103 { 104 state_next = CONTEXT_STATE_KO_CSYNC; 105 address++; // take next address 106 if (is_delay_slot) 107 throw ERRORMORPHEO(FUNCTION,"SPR access in delay slot, not supported.\n"); 108 break; 109 } 110 case EVENT_TYPE_NONE : 111 case EVENT_TYPE_MISS_SPECULATION : 112 case EVENT_TYPE_BRANCH_NO_ACCURATE : 113 default : 114 { 115 throw ERRORMORPHEO(FUNCTION,toString(_("DECOD_EVENT [%d] : invalid event_type : %s.\n"),i,toString(type).c_str())); 116 } 117 } 118 119 reg_STATE [context] = state_next; 120 reg_EVENT_ADDRESS [context] = address; 121 reg_EVENT_ADDRESS_EPCR [context] = PORT_READ(in_DECOD_EVENT_ADDRESS_EPCR [i]); 122 reg_EVENT_ADDRESS_EPCR_VAL [context] = 1; 123 //reg_EVENT_ADDRESS_EEAR [context] 124 reg_EVENT_ADDRESS_EEAR_VAL [context] = 0; 125 reg_EVENT_IS_DELAY_SLOT [context] = is_delay_slot; 126 //reg_EVENT_IS_DS_TAKE [context] = 0; 127 reg_EVENT_DEPTH [context] = depth; 128 } 129 } 130 131 // ------------------------------------------------------------------- 132 // -----[ COMMIT_EVENT ]---------------------------------------------- 133 // ------------------------------------------------------------------- 134 135 for (uint32_t i=0; i<_param->_nb_ooo_engine; i++) 136 if (PORT_READ(in_COMMIT_EVENT_VAL [i]) and internal_COMMIT_EVENT_ACK [i]) 137 { 138 Tcontext_t context = (_param->_have_port_context_id )?PORT_READ(in_COMMIT_EVENT_CONTEXT_ID [i]):0; 139 Tdepth_t depth = (_param->_have_port_max_depth )?PORT_READ(in_COMMIT_EVENT_DEPTH [i]):0; 140 Tdepth_t depth_cur = reg_EVENT_DEPTH [context]; 141 Tdepth_t depth_base = (_param->_have_port_depth [context])?PORT_READ(in_DEPTH_TAIL [context]):0; 142 Tdepth_t depth_max = _param->_size_depth [context]; 143 144 Tdepth_t depth0 = (depth_cur>=depth_base)?(depth_cur-depth_base):((depth_cur+depth_max-depth_base)); 145 Tdepth_t depth1 = (depth >=depth_base)?(depth -depth_base):((depth +depth_max-depth_base)); 146 147 context_state_t state = reg_STATE [context]; 148 Tevent_type_t type = PORT_READ(in_COMMIT_EVENT_TYPE [i]); 149 150 // miss > excep > spr/sync 151 uint8_t priority0 = (state == CONTEXT_STATE_KO_MISS)?2:((state == CONTEXT_STATE_KO_EXCEP)?1:0); 152 uint8_t priority1 = 1; 153 154 // is_valid = can modify local information 155 // if context_state_ok : yes 156 // if context_state_ko : test the depth, and the priority of envent 157 158 bool is_valid = ((state == CONTEXT_STATE_OK) or 159 (depth1< depth0) or 160 ((depth1==depth0) and (priority1>priority0))); 161 162 if (is_valid) 163 { 164 // commit 165 // type : exception 166 context_state_t state_next = state; 167 switch (type) 168 { 169 case EVENT_TYPE_EXCEPTION : {state_next = CONTEXT_STATE_KO_EXCEP; break;} 170 case EVENT_TYPE_SPR_ACCESS : 171 case EVENT_TYPE_MSYNC : 172 case EVENT_TYPE_PSYNC : 173 case EVENT_TYPE_CSYNC : 174 case EVENT_TYPE_NONE : 175 case EVENT_TYPE_MISS_SPECULATION : 176 case EVENT_TYPE_BRANCH_NO_ACCURATE : 177 default : 178 { 179 throw ERRORMORPHEO(FUNCTION,toString(_("COMMIT_EVENT [%d] : invalid event_type : %s.\n"),i,toString(type).c_str())); 180 } 181 } 182 reg_STATE [context] = state_next; 183 reg_EVENT_ADDRESS [context] = PORT_READ(in_COMMIT_EVENT_ADDRESS [i]); 184 reg_EVENT_ADDRESS_EPCR [context] = PORT_READ(in_COMMIT_EVENT_ADDRESS_EPCR [i]); 185 reg_EVENT_ADDRESS_EPCR_VAL [context] = 1; 186 reg_EVENT_ADDRESS_EEAR [context] = PORT_READ(in_COMMIT_EVENT_ADDRESS_EEAR [i]); 187 reg_EVENT_ADDRESS_EEAR_VAL [context] = PORT_READ(in_COMMIT_EVENT_ADDRESS_EEAR_VAL [i]); 188 reg_EVENT_IS_DELAY_SLOT [context] = PORT_READ(in_COMMIT_EVENT_IS_DELAY_SLOT [i]); 189 //reg_EVENT_IS_DS_TAKE [context] = 0; 190 reg_EVENT_DEPTH [context] = depth; 191 } 192 } 193 194 // ------------------------------------------------------------------- 195 // -----[ BRANCH_COMPLETE ]------------------------------------------- 196 // ------------------------------------------------------------------- 197 198 for (uint32_t i=0; i<_param->_nb_inst_branch_complete; i++) 199 if (PORT_READ(in_BRANCH_COMPLETE_VAL [i]) and internal_BRANCH_COMPLETE_ACK [i]) 200 { 201 if (PORT_READ(in_BRANCH_COMPLETE_MISS_PREDICTION [i])) 202 { 203 Tcontext_t context = (_param->_have_port_context_id )?PORT_READ(in_BRANCH_COMPLETE_CONTEXT_ID [i]):0; 204 Tdepth_t depth = (_param->_have_port_max_depth )?PORT_READ(in_BRANCH_COMPLETE_DEPTH [i]):0; 205 Tdepth_t depth_cur = reg_EVENT_DEPTH [context]; 206 Tdepth_t depth_base = (_param->_have_port_depth [context])?PORT_READ(in_DEPTH_TAIL [context]):0; 207 Tdepth_t depth_max = _param->_size_depth [context]; 208 209 Tdepth_t depth0 = (depth_cur>=depth_base)?(depth_cur-depth_base):((depth_cur+depth_max-depth_base)); 210 Tdepth_t depth1 = (depth >=depth_base)?(depth -depth_base):((depth +depth_max-depth_base)); 211 212 context_state_t state = reg_STATE [context]; 213 214 // miss > excep > spr/sync 215 uint8_t priority0 = (state == CONTEXT_STATE_KO_MISS)?2:((state == CONTEXT_STATE_KO_EXCEP)?1:0); 216 uint8_t priority1 = 2; 217 218 // is_valid = can modify local information 219 // if context_state_ok : yes 220 // if context_state_ko : test the depth, and the priority of envent 221 222 bool is_valid = ((state == CONTEXT_STATE_OK) or 223 (depth1< depth0) or 224 ((depth1==depth0) and (priority1>priority0))); 225 226 if (is_valid) 227 { 228 // commit 229 Tcontrol_t take = PORT_READ(in_BRANCH_COMPLETE_TAKE [i]); 230 reg_STATE [context] = CONTEXT_STATE_KO_MISS; 231 reg_EVENT_ADDRESS [context] = PORT_READ(in_BRANCH_COMPLETE_ADDRESS_SRC [i])+1; //DELAY_SLOT 232 reg_EVENT_ADDRESS_EPCR [context] = PORT_READ(in_BRANCH_COMPLETE_ADDRESS_DEST [i]); 233 reg_EVENT_ADDRESS_EPCR_VAL [context] = take; // if not take : in sequence 234 //reg_EVENT_ADDRESS_EEAR [context]; 235 //reg_EVENT_ADDRESS_EEAR_VAL [context]; 236 reg_EVENT_IS_DELAY_SLOT [context] = take; 237 reg_EVENT_IS_DS_TAKE [context] = take; 238 reg_EVENT_DEPTH [context] = depth; 239 } 240 } 241 } 242 243 // ------------------------------------------------------------------- 244 // -----[ EVENT ]----------------------------------------------------- 245 // ------------------------------------------------------------------- 246 for (uint32_t i=0; i<_param->_nb_context; i++) 247 if (internal_EVENT_VAL [i] and PORT_READ(in_EVENT_ACK [i])) 248 { 249 // Write pc 250 context_state_t state = reg_STATE [i]; 251 252 switch (state) 253 { 254 case CONTEXT_STATE_KO_EXCEP_ADDR : 255 { 256 reg_STATE [i] = CONTEXT_STATE_KO_EXCEP_SPR; 257 break; 258 } 259 case CONTEXT_STATE_KO_MISS_ADDR : 260 case CONTEXT_STATE_KO_PSYNC_ADDR : 261 case CONTEXT_STATE_KO_CSYNC_ADDR : 262 { 263 reg_STATE [i] = CONTEXT_STATE_OK; 264 break; 265 } 266 default : 267 { 36 // ------------------------------------------------------------------- 37 // -----[ BRANCH_EVENT ]---------------------------------------------- 38 // ------------------------------------------------------------------- 39 for (uint32_t i=0; i<_param->_nb_context; ++i) 40 if (PORT_READ(in_BRANCH_EVENT_VAL [i]) and internal_BRANCH_EVENT_ACK [i]) 41 { 42 // throw ERRORMORPHEO(FUNCTION,_("Not yet implemented (Comming Soon).\n")); 43 44 context_state_t state = reg_STATE [i]; 45 46 Tdepth_t depth = // (_param->_have_port_depth)?PORT_READ(in_BRANCH_EVENT_DEPTH [i]): 47 0; 48 Tdepth_t depth_cur = reg_EVENT_DEPTH [i]; 49 Tdepth_t depth_min = (_param->_have_port_depth)?PORT_READ(in_DEPTH_MIN [i]):0; 50 Tdepth_t depth_max = _param->_array_size_depth [i]; 51 52 // Tdepth_t depth0 = (depth_cur>=depth_min)?(depth_cur-depth_min):((depth_cur+depth_max-depth_min)); 53 // Tdepth_t depth1 = (depth >=depth_min)?(depth -depth_min):((depth +depth_max-depth_min)); 54 Tdepth_t depth0 = (depth_cur>=depth_min)?(depth_cur):((depth_cur+depth_max)); 55 Tdepth_t depth1 = (depth >=depth_min)?(depth ):((depth +depth_max)); 56 57 // priority : miss > excep > spr/sync 58 uint8_t priority0 = (state == CONTEXT_STATE_KO_MISS)?2:((state == EVENT_TYPE_EXCEPTION)?1:0); 59 uint8_t priority1 = 2; // miss 60 61 // is_valid = can modify local information 62 // if context_state_ok : yes 63 // if context_state_ko : test the depth, and the priority of envent 64 65 bool is_valid = ((state == CONTEXT_STATE_OK) or 66 (depth1< depth0) or 67 ((depth1==depth0) and (priority1>priority0))); 68 69 if (is_valid) 70 { 71 reg_STATE [i] = CONTEXT_STATE_KO_MISS; 72 reg_EVENT_ADDRESS [i] = PORT_READ(in_BRANCH_EVENT_ADDRESS_SRC [i])+1; // address delay slot 73 reg_EVENT_ADDRESS_EPCR [i] = PORT_READ(in_BRANCH_EVENT_ADDRESS_DEST[i]); // address_next 74 reg_EVENT_ADDRESS_EPCR_VAL [i] = 1; // address_dest is valid 75 //reg_EVENT_ADDRESS_EEAR [i] = 0; 76 reg_EVENT_ADDRESS_EEAR_VAL [i] = 0; 77 reg_EVENT_IS_DELAY_SLOT [i] = 1; 78 reg_EVENT_IS_DS_TAKE [i] = 0;// ?? 79 reg_EVENT_DEPTH [i] = depth; 80 } 81 } 82 83 // ------------------------------------------------------------------- 84 // -----[ DECOD_EVENT ]----------------------------------------------- 85 // ------------------------------------------------------------------- 86 87 for (uint32_t i=0; i<_param->_nb_decod_unit; i++) 88 if (PORT_READ(in_DECOD_EVENT_VAL [i]) and internal_DECOD_EVENT_ACK [i]) 89 { 90 Tcontext_t context = (_param->_have_port_context_id )?PORT_READ(in_DECOD_EVENT_CONTEXT_ID [i]):0; 91 Tdepth_t depth = (_param->_have_port_depth )?PORT_READ(in_DECOD_EVENT_DEPTH [i]):0; 92 Tdepth_t depth_cur = reg_EVENT_DEPTH [context]; 93 Tdepth_t depth_min = (_param->_have_port_depth )?PORT_READ(in_DEPTH_MIN [context]):0; 94 Tdepth_t depth_max = _param->_array_size_depth [context]; 95 96 // Tdepth_t depth0 = (depth_cur>=depth_min)?(depth_cur-depth_min):((depth_cur+depth_max-depth_min)); 97 // Tdepth_t depth1 = (depth >=depth_min)?(depth -depth_min):((depth +depth_max-depth_min)); 98 Tdepth_t depth0 = (depth_cur>=depth_min)?(depth_cur):((depth_cur+depth_max)); 99 Tdepth_t depth1 = (depth >=depth_min)?(depth ):((depth +depth_max)); 100 101 context_state_t state = reg_STATE [context]; 102 Tevent_type_t type = PORT_READ(in_DECOD_EVENT_TYPE [i]); 103 104 // miss > excep > spr/sync 105 uint8_t priority0 = (state == CONTEXT_STATE_KO_MISS)?2:((state == CONTEXT_STATE_KO_EXCEP)?1:0); 106 uint8_t priority1 = (state == EVENT_TYPE_EXCEPTION)?1:0; 107 108 // is_valid = can modify local information 109 // if context_state_ok : yes 110 // if context_state_ko : test the depth, and the priority of envent 111 112 bool is_valid = ((state == CONTEXT_STATE_OK) or 113 (depth1< depth0) or 114 ((depth1==depth0) and (priority1>priority0))); 115 116 if (is_valid) 117 { 118 // decod : 119 // type : csync, psync, msync, spr_access (l.mac, l.maci, l.macrc, l.msb, l.mfspr, l.mtspr), exception (l.sys) 120 context_state_t state_next = state; 121 Taddress_t address = PORT_READ(in_DECOD_EVENT_ADDRESS [i]); 122 Tcontrol_t is_delay_slot = PORT_READ(in_DECOD_EVENT_IS_DELAY_SLOT [i]); 123 124 switch (type) 125 { 126 case EVENT_TYPE_EXCEPTION : 127 { 128 state_next = CONTEXT_STATE_KO_EXCEP; 129 130 break; 131 } 132 case EVENT_TYPE_SPR_ACCESS : 133 { 134 state_next = CONTEXT_STATE_KO_SPR ; 135 address++; // take next address 136 if (is_delay_slot) 137 throw ERRORMORPHEO(FUNCTION,"SPR access in delay slot, not supported.\n"); 138 break; 139 } 140 case EVENT_TYPE_MSYNC : 141 { 142 state_next = CONTEXT_STATE_KO_MSYNC; 143 address++; // take next address 144 if (is_delay_slot) 145 throw ERRORMORPHEO(FUNCTION,"SPR access in delay slot, not supported.\n"); 146 break; 147 } 148 case EVENT_TYPE_PSYNC : 149 { 150 state_next = CONTEXT_STATE_KO_PSYNC; 151 address++; // take next address 152 if (is_delay_slot) 153 throw ERRORMORPHEO(FUNCTION,"SPR access in delay slot, not supported.\n"); 154 break; 155 } 156 case EVENT_TYPE_CSYNC : 157 { 158 state_next = CONTEXT_STATE_KO_CSYNC; 159 address++; // take next address 160 if (is_delay_slot) 161 throw ERRORMORPHEO(FUNCTION,"SPR access in delay slot, not supported.\n"); 162 break; 163 } 164 case EVENT_TYPE_NONE : 165 case EVENT_TYPE_MISS_SPECULATION : 166 case EVENT_TYPE_BRANCH_NO_ACCURATE : 167 default : 168 { 169 throw ERRORMORPHEO(FUNCTION,toString(_("DECOD_EVENT [%d] : invalid event_type : %s.\n"),i,toString(type).c_str())); 170 } 171 } 172 173 reg_STATE [context] = state_next; 174 reg_EVENT_ADDRESS [context] = address; 175 reg_EVENT_ADDRESS_EPCR [context] = PORT_READ(in_DECOD_EVENT_ADDRESS_EPCR [i]); 176 reg_EVENT_ADDRESS_EPCR_VAL [context] = 1; 177 //reg_EVENT_ADDRESS_EEAR [context] 178 reg_EVENT_ADDRESS_EEAR_VAL [context] = 0; 179 reg_EVENT_IS_DELAY_SLOT [context] = is_delay_slot; 180 //reg_EVENT_IS_DS_TAKE [context] = 0; 181 reg_EVENT_DEPTH [context] = depth; 182 } 183 } 184 185 // ------------------------------------------------------------------- 186 // -----[ COMMIT_EVENT ]---------------------------------------------- 187 // ------------------------------------------------------------------- 188 189 if (PORT_READ(in_COMMIT_EVENT_VAL ) and internal_COMMIT_EVENT_ACK ) 190 { 191 Tcontext_t context = (_param->_have_port_context_id)?PORT_READ(in_COMMIT_EVENT_CONTEXT_ID ):0; 192 Tdepth_t depth = (_param->_have_port_depth )?PORT_READ(in_COMMIT_EVENT_DEPTH ):0; 193 Tdepth_t depth_cur = reg_EVENT_DEPTH [context]; 194 Tdepth_t depth_min = (_param->_have_port_depth )?PORT_READ(in_DEPTH_MIN [context]):0; 195 Tdepth_t depth_max = _param->_array_size_depth [context]; 196 197 // Tdepth_t depth0 = (depth_cur>=depth_min)?(depth_cur-depth_min):((depth_cur+depth_max-depth_min)); 198 // Tdepth_t depth1 = (depth >=depth_min)?(depth -depth_min):((depth +depth_max-depth_min)); 199 Tdepth_t depth0 = (depth_cur>=depth_min)?(depth_cur):((depth_cur+depth_max)); 200 Tdepth_t depth1 = (depth >=depth_min)?(depth ):((depth +depth_max)); 201 202 context_state_t state = reg_STATE [context]; 203 Tevent_type_t type = PORT_READ(in_COMMIT_EVENT_TYPE ); 204 205 // miss > excep > spr/sync 206 uint8_t priority0 = (state == CONTEXT_STATE_KO_MISS)?2:((state == CONTEXT_STATE_KO_EXCEP)?1:0); 207 uint8_t priority1 = 1; // exception 208 209 // is_valid = can modify local information 210 // if context_state_ok : yes 211 // if context_state_ko : test the depth, and the priority of envent 212 213 bool is_valid = ((state == CONTEXT_STATE_OK) or 214 (depth1< depth0) or 215 ((depth1==depth0) and (priority1>priority0))); 216 217 if (is_valid) 218 { 219 // commit 220 // type : exception 221 context_state_t state_next = state; 222 switch (type) 223 { 224 case EVENT_TYPE_EXCEPTION : {state_next = CONTEXT_STATE_KO_EXCEP; break;} 225 case EVENT_TYPE_SPR_ACCESS : 226 case EVENT_TYPE_MSYNC : 227 case EVENT_TYPE_PSYNC : 228 case EVENT_TYPE_CSYNC : 229 case EVENT_TYPE_NONE : 230 case EVENT_TYPE_MISS_SPECULATION : 231 case EVENT_TYPE_BRANCH_NO_ACCURATE : 232 default : 233 { 234 throw ERRORMORPHEO(FUNCTION,toString(_("COMMIT_EVENT : invalid event_type : %s.\n"),toString(type).c_str())); 235 } 236 } 237 reg_STATE [context] = state_next; 238 reg_EVENT_ADDRESS [context] = PORT_READ(in_COMMIT_EVENT_ADDRESS ); 239 reg_EVENT_ADDRESS_EPCR [context] = PORT_READ(in_COMMIT_EVENT_ADDRESS_EPCR ); 240 reg_EVENT_ADDRESS_EPCR_VAL [context] = 1; 241 reg_EVENT_ADDRESS_EEAR [context] = PORT_READ(in_COMMIT_EVENT_ADDRESS_EEAR ); 242 reg_EVENT_ADDRESS_EEAR_VAL [context] = PORT_READ(in_COMMIT_EVENT_ADDRESS_EEAR_VAL ); 243 reg_EVENT_IS_DELAY_SLOT [context] = PORT_READ(in_COMMIT_EVENT_IS_DELAY_SLOT ); 244 //reg_EVENT_IS_DS_TAKE [context] = 0; 245 reg_EVENT_DEPTH [context] = depth; 246 } 247 } 248 249 // ------------------------------------------------------------------- 250 // -----[ BRANCH_COMPLETE ]------------------------------------------- 251 // ------------------------------------------------------------------- 252 253 for (uint32_t i=0; i<_param->_nb_inst_branch_complete; i++) 254 if (PORT_READ(in_BRANCH_COMPLETE_VAL [i]) and internal_BRANCH_COMPLETE_ACK [i]) 255 { 256 if (PORT_READ(in_BRANCH_COMPLETE_MISS_PREDICTION [i])) 257 { 258 Tcontext_t context = (_param->_have_port_context_id)?PORT_READ(in_BRANCH_COMPLETE_CONTEXT_ID [i]):0; 259 Tdepth_t depth = (_param->_have_port_depth )?PORT_READ(in_BRANCH_COMPLETE_DEPTH [i]):0; 260 Tdepth_t depth_cur = reg_EVENT_DEPTH [context]; 261 Tdepth_t depth_min = (_param->_have_port_depth )?PORT_READ(in_DEPTH_MIN [context]):0; 262 Tdepth_t depth_max = _param->_array_size_depth [context]; 263 264 // Tdepth_t depth0 = (depth_cur>=depth_min)?(depth_cur-depth_min):((depth_cur+depth_max-depth_min)); 265 // Tdepth_t depth1 = (depth >=depth_min)?(depth -depth_min):((depth +depth_max-depth_min)); 266 Tdepth_t depth0 = (depth_cur>=depth_min)?(depth_cur):((depth_cur+depth_max)); 267 Tdepth_t depth1 = (depth >=depth_min)?(depth ):((depth +depth_max)); 268 269 context_state_t state = reg_STATE [context]; 270 271 // miss > excep > spr/sync 272 uint8_t priority0 = (state == CONTEXT_STATE_KO_MISS)?2:((state == CONTEXT_STATE_KO_EXCEP)?1:0); 273 uint8_t priority1 = 2; // miss 274 275 // is_valid = can modify local information 276 // if context_state_ok : yes 277 // if context_state_ko : test the depth, and the priority of envent 278 279 bool is_valid = ((state == CONTEXT_STATE_OK) or 280 (depth1< depth0) or 281 ((depth1==depth0) and (priority1>priority0))); 282 283 if (is_valid) 284 { 285 // commit 286 Tcontrol_t take = PORT_READ(in_BRANCH_COMPLETE_TAKE [i]); 287 reg_STATE [context] = CONTEXT_STATE_KO_MISS; 288 reg_EVENT_ADDRESS [context] = PORT_READ(in_BRANCH_COMPLETE_ADDRESS_SRC [i])+1; //DELAY_SLOT 289 reg_EVENT_ADDRESS_EPCR [context] = PORT_READ(in_BRANCH_COMPLETE_ADDRESS_DEST [i]); 290 reg_EVENT_ADDRESS_EPCR_VAL [context] = take; // if not take : in sequence 291 //reg_EVENT_ADDRESS_EEAR [context]; 292 reg_EVENT_ADDRESS_EEAR_VAL [context] = 0; 293 reg_EVENT_IS_DELAY_SLOT [context] = take; 294 reg_EVENT_IS_DS_TAKE [context] = take; 295 reg_EVENT_DEPTH [context] = depth; 296 } 297 } 298 } 299 300 // ------------------------------------------------------------------- 301 // -----[ EVENT ]----------------------------------------------------- 302 // ------------------------------------------------------------------- 303 for (uint32_t i=0; i<_param->_nb_context; i++) 304 if (internal_EVENT_VAL [i] and PORT_READ(in_EVENT_ACK [i])) 305 { 306 // Write pc 307 context_state_t state = reg_STATE [i]; 308 309 switch (state) 310 { 311 case CONTEXT_STATE_KO_EXCEP_ADDR : 312 { 313 reg_STATE [i] = CONTEXT_STATE_KO_EXCEP_SPR; 314 break; 315 } 316 case CONTEXT_STATE_KO_MISS_ADDR : 317 case CONTEXT_STATE_KO_PSYNC_ADDR : 318 case CONTEXT_STATE_KO_CSYNC_ADDR : 319 { 320 reg_STATE [i] = CONTEXT_STATE_OK; 321 break; 322 } 323 default : 324 { 268 325 #ifdef DEBUG_TEST 269 326 throw ERRORMORPHEO(FUNCTION,toString(_("SPR[%d], Invalid state : %s.\n"),i,toString(state).c_str())); 270 327 #endif 271 272 273 274 275 276 277 // -----[ SPR ]-------------------------------------------------------278 279 280 if (internal_SPR_VAL [i] and PORT_READ(in_SPR_ACK [i]))281 282 328 break; 329 } 330 } 331 } 332 333 // ------------------------------------------------------------------- 334 // -----[ SPR_EVENT ]------------------------------------------------- 335 // ------------------------------------------------------------------- 336 for (uint32_t i=0; i<_param->_nb_context; i++) 337 if (internal_SPR_EVENT_VAL [i] and PORT_READ(in_SPR_EVENT_ACK [i])) 338 { 339 // Write spr 283 340 #ifdef DEBUG_TEST 284 285 286 287 throw ERRORMORPHEO(FUNCTION,toString(_("SPR[%d], Invalid state : %s.\n"),i,toString(state).c_str()));341 context_state_t state = reg_STATE [i]; 342 343 if (state != CONTEXT_STATE_KO_EXCEP_SPR) 344 throw ERRORMORPHEO(FUNCTION,toString(_("SPR_EVENT[%d], Invalid state : %s.\n"),i,toString(state).c_str())); 288 345 #endif 289 290 reg_STATE [i] = CONTEXT_STATE_OK; 291 } 292 293 // ------------------------------------------------------------------- 294 // -----[ next state ]------------------------------------------------ 295 // ------------------------------------------------------------------- 296 for (uint32_t i=0; i<_param->_nb_context; i++) 297 { 298 uint32_t x = _param->_link_context_to_decod_unit [i]; 299 uint32_t y = _param->_link_decod_unit_to_ooo_engine [x]; 300 301 Tcounter_t inst_all = PORT_READ(in_NB_INST_COMMIT_ALL [y]) + PORT_READ(in_NB_INST_DECOD_ALL [x]); 302 Tcounter_t inst_mem = PORT_READ(in_NB_INST_COMMIT_MEM [y]) + PORT_READ(in_NB_INST_DECOD_ALL [x]); 303 304 context_state_t state = reg_STATE [i]; 305 306 switch (state) 307 { 308 case CONTEXT_STATE_OK : 309 { 310 // nothing, wait an event 311 break; 312 } 313 case CONTEXT_STATE_KO_EXCEP : 314 { 315 // Wait end of all instruction 316 if (inst_all == 0) 317 state = CONTEXT_STATE_KO_EXCEP_ADDR; 318 break; 319 } 320 case CONTEXT_STATE_KO_MISS : 321 { 322 // Wait end of all instruction 323 if (inst_all == 0) 324 state = CONTEXT_STATE_KO_MISS_ADDR; 325 break; 326 } 327 case CONTEXT_STATE_KO_EXCEP_ADDR : 328 { 329 // nothing, wait the update of internal register (pc) 330 break; 331 } 332 case CONTEXT_STATE_KO_EXCEP_SPR : 333 { 334 // nothing, wait the update of internal register (epcr, eear, sr, esr) 335 break; 336 } 337 case CONTEXT_STATE_KO_MISS_ADDR : 338 { 339 // nothing, wait the update of internal register (pc) 340 break; 341 } 342 case CONTEXT_STATE_KO_PSYNC : 343 { 344 // Wait end of all instruction 345 if (inst_all == 0) 346 // state = CONTEXT_STATE_KO_PSYNC_FLUSH; 347 state = CONTEXT_STATE_KO_PSYNC_ADDR ; 348 break; 349 } 350 // case CONTEXT_STATE_KO_PSYNC_FLUSH : 351 // { 352 // // nothing, wait end of flush (ifetch) 353 // break; 354 // } 355 case CONTEXT_STATE_KO_PSYNC_ADDR : 356 { 357 // nothing, wait the pc write 358 break; 359 } 360 case CONTEXT_STATE_KO_CSYNC : 361 { 362 // Wait end of all instruction 363 if (inst_all == 0) 364 state = CONTEXT_STATE_KO_CSYNC_ADDR ; 365 // state = CONTEXT_STATE_KO_CSYNC_FLUSH; 366 break; 367 } 368 // case CONTEXT_STATE_KO_CSYNC_FLUSH : 369 // { 370 // // nothing, wait end of flush (all internal structure) 371 // break; 372 // } 373 case CONTEXT_STATE_KO_CSYNC_ADDR : 374 { 375 // nothing, wait the pc write 376 break; 377 } 378 case CONTEXT_STATE_KO_MSYNC : 379 { 380 // Wait end of memory instruction 381 if (inst_mem == 0) 382 state = CONTEXT_STATE_KO_MSYNC_ISSUE; 383 break; 384 } 385 case CONTEXT_STATE_KO_MSYNC_ISSUE : 386 { 387 // Wait the msync issue 388 if (inst_mem != 0) 389 state = CONTEXT_STATE_KO_MSYNC_EXEC; 390 break; 391 } 392 case CONTEXT_STATE_KO_MSYNC_EXEC : 393 { 394 // Wait the end of msync 395 if (inst_mem == 0) 396 state = CONTEXT_STATE_OK; 397 break; 398 } 399 case CONTEXT_STATE_KO_SPR : 400 { 401 // Wait end of all instruction 402 if (inst_all == 0) 403 state = CONTEXT_STATE_KO_SPR_ISSUE; 404 break; 405 } 406 case CONTEXT_STATE_KO_SPR_ISSUE : 407 { 408 // Wait the spr_access issue 409 if (inst_all != 0) 410 state = CONTEXT_STATE_KO_SPR_EXEC; 411 break; 412 } 413 case CONTEXT_STATE_KO_SPR_EXEC : 414 { 415 // Wait the spr_access execution 416 if (inst_all == 0) 417 state = CONTEXT_STATE_OK; 418 break; 419 } 420 421 default : 422 { 423 throw ERRORMORPHEO(FUNCTION,toString(_("Context[%d], Unknow state : %s.\n"),i,toString(state).c_str())); 424 } 425 } 426 reg_STATE [i] = state; 427 } 346 347 reg_STATE [i] = CONTEXT_STATE_OK; 348 } 349 350 // ------------------------------------------------------------------- 351 // -----[ next state ]------------------------------------------------ 352 // ------------------------------------------------------------------- 353 for (uint32_t i=0; i<_param->_nb_context; i++) 354 { 355 // uint32_t x = _param->_link_context_to_decod_unit [i]; 356 357 Tcounter_t inst_all = PORT_READ(in_NB_INST_COMMIT_ALL[i]) + PORT_READ(in_NB_INST_DECOD_ALL [i]); 358 Tcounter_t inst_mem = PORT_READ(in_NB_INST_COMMIT_MEM[i]) + PORT_READ(in_NB_INST_DECOD_ALL [i]); 359 360 context_state_t state = reg_STATE [i]; 361 362 switch (state) 363 { 364 case CONTEXT_STATE_OK : 365 { 366 // nothing, wait an event 367 break; 368 } 369 case CONTEXT_STATE_KO_EXCEP : 370 { 371 // Wait end of all instruction 372 if (inst_all == 0) 373 state = CONTEXT_STATE_KO_EXCEP_ADDR; 374 break; 375 } 376 case CONTEXT_STATE_KO_MISS : 377 { 378 // Wait end of all instruction 379 if (inst_all == 0) 380 state = CONTEXT_STATE_KO_MISS_ADDR; 381 break; 382 } 383 case CONTEXT_STATE_KO_EXCEP_ADDR : 384 { 385 // nothing, wait the update of internal register (pc) 386 break; 387 } 388 case CONTEXT_STATE_KO_EXCEP_SPR : 389 { 390 // nothing, wait the update of internal register (epcr, eear, sr, esr) 391 break; 392 } 393 case CONTEXT_STATE_KO_MISS_ADDR : 394 { 395 // nothing, wait the update of internal register (pc) 396 break; 397 } 398 case CONTEXT_STATE_KO_PSYNC : 399 { 400 // Wait end of all instruction 401 if (inst_all == 0) 402 // state = CONTEXT_STATE_KO_PSYNC_FLUSH; 403 state = CONTEXT_STATE_KO_PSYNC_ADDR ; 404 break; 405 } 406 // case CONTEXT_STATE_KO_PSYNC_FLUSH : 407 // { 408 // // nothing, wait end of flush (ifetch) 409 // break; 410 // } 411 case CONTEXT_STATE_KO_PSYNC_ADDR : 412 { 413 // nothing, wait the pc write 414 break; 415 } 416 case CONTEXT_STATE_KO_CSYNC : 417 { 418 // Wait end of all instruction 419 if (inst_all == 0) 420 state = CONTEXT_STATE_KO_CSYNC_ADDR ; 421 // state = CONTEXT_STATE_KO_CSYNC_FLUSH; 422 break; 423 } 424 // case CONTEXT_STATE_KO_CSYNC_FLUSH : 425 // { 426 // // nothing, wait end of flush (all internal structure) 427 // break; 428 // } 429 case CONTEXT_STATE_KO_CSYNC_ADDR : 430 { 431 // nothing, wait the pc write 432 break; 433 } 434 case CONTEXT_STATE_KO_MSYNC : 435 { 436 // Wait end of memory instruction 437 if (inst_mem == 0) 438 state = CONTEXT_STATE_KO_MSYNC_ISSUE; 439 break; 440 } 441 case CONTEXT_STATE_KO_MSYNC_ISSUE : 442 { 443 // Wait the msync issue 444 if (inst_mem != 0) 445 state = CONTEXT_STATE_KO_MSYNC_EXEC; 446 break; 447 } 448 case CONTEXT_STATE_KO_MSYNC_EXEC : 449 { 450 // Wait the end of msync 451 if (inst_mem == 0) 452 state = CONTEXT_STATE_OK; 453 break; 454 } 455 case CONTEXT_STATE_KO_SPR : 456 { 457 // Wait end of all instruction 458 if (inst_all == 0) 459 state = CONTEXT_STATE_KO_SPR_ISSUE; 460 break; 461 } 462 case CONTEXT_STATE_KO_SPR_ISSUE : 463 { 464 // Wait the spr_access issue 465 if (inst_all != 0) 466 state = CONTEXT_STATE_KO_SPR_EXEC; 467 break; 468 } 469 case CONTEXT_STATE_KO_SPR_EXEC : 470 { 471 // Wait the spr_access execution 472 if (inst_all == 0) 473 state = CONTEXT_STATE_OK; 474 break; 475 } 476 477 default : 478 { 479 throw ERRORMORPHEO(FUNCTION,toString(_("Context[%d], Unknow state : %s.\n"),i,toString(state).c_str())); 480 } 481 } 482 reg_STATE [i] = state; 483 } 484 485 for (uint32_t i=0; i<_param->_nb_context; ++i) 486 { 487 reg_INTERRUPT_ENABLE [i] = PORT_READ(in_INTERRUPT_ENABLE [i]) and PORT_READ(in_SPR_SR_IEE [i]); 488 489 if (reg_INTERRUPT_ENABLE [i]) 490 throw ERRORMORPHEO(FUNCTION,toString(_("Context[%d], Have an interruption, Not yet supported (Comming Soon).\n"),i)); 491 } 428 492 } 429 493 … … 431 495 for (uint32_t i=0; i<_param->_nb_context; i++) 432 496 { 433 log_printf(TRACE,Context_State,FUNCTION,"Context State [%d]",i);434 log_printf(TRACE,Context_State,FUNCTION," * reg_STATE : %s",toString(reg_STATE [i]).c_str());435 log_printf(TRACE,Context_State,FUNCTION," * reg_EVENT_ADDRESS : 0x%x",reg_EVENT_ADDRESS [i]);436 log_printf(TRACE,Context_State,FUNCTION," * reg_EVENT_ADDRESS_EPCR : 0x%x",reg_EVENT_ADDRESS_EPCR [i]);437 log_printf(TRACE,Context_State,FUNCTION," * reg_EVENT_ADDRESS_EPCR_VAL : %d",reg_EVENT_ADDRESS_EPCR_VAL [i]);438 log_printf(TRACE,Context_State,FUNCTION," * reg_EVENT_ADDRESS_EEAR : 0x%x",reg_EVENT_ADDRESS_EEAR [i]);439 log_printf(TRACE,Context_State,FUNCTION," * reg_EVENT_ADDRESS_EEAR_VAL : %d",reg_EVENT_ADDRESS_EEAR_VAL [i]);440 log_printf(TRACE,Context_State,FUNCTION," * reg_EVENT_IS_DELAY_SLOT : %d",reg_EVENT_IS_DELAY_SLOT [i]);441 log_printf(TRACE,Context_State,FUNCTION," * reg_EVENT_IS_DS_TAKE : %d",reg_EVENT_IS_DS_TAKE [i]);442 log_printf(TRACE,Context_State,FUNCTION," * reg_EVENT_DEPTH : %d",reg_EVENT_DEPTH [i]);497 log_printf(TRACE,Context_State,FUNCTION," * Dump Context State [%d]",i); 498 log_printf(TRACE,Context_State,FUNCTION," * reg_STATE : %s" ,toString(reg_STATE [i]).c_str()); 499 log_printf(TRACE,Context_State,FUNCTION," * reg_EVENT_ADDRESS : 0x%x (0x%x)",reg_EVENT_ADDRESS [i],reg_EVENT_ADDRESS [i]<<2); 500 log_printf(TRACE,Context_State,FUNCTION," * reg_EVENT_ADDRESS_EPCR : 0x%x (0x%x)",reg_EVENT_ADDRESS_EPCR [i],reg_EVENT_ADDRESS_EPCR [i]<<2); 501 log_printf(TRACE,Context_State,FUNCTION," * reg_EVENT_ADDRESS_EPCR_VAL : %d" ,reg_EVENT_ADDRESS_EPCR_VAL [i]); 502 log_printf(TRACE,Context_State,FUNCTION," * reg_EVENT_ADDRESS_EEAR : 0x%x (0x%x)",reg_EVENT_ADDRESS_EEAR [i],reg_EVENT_ADDRESS_EEAR [i]<<2); 503 log_printf(TRACE,Context_State,FUNCTION," * reg_EVENT_ADDRESS_EEAR_VAL : %d" ,reg_EVENT_ADDRESS_EEAR_VAL [i]); 504 log_printf(TRACE,Context_State,FUNCTION," * reg_EVENT_IS_DELAY_SLOT : %d" ,reg_EVENT_IS_DELAY_SLOT [i]); 505 log_printf(TRACE,Context_State,FUNCTION," * reg_EVENT_IS_DS_TAKE : %d" ,reg_EVENT_IS_DS_TAKE [i]); 506 log_printf(TRACE,Context_State,FUNCTION," * reg_EVENT_DEPTH : %d" ,reg_EVENT_DEPTH [i]); 443 507 } 444 508 #endif -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Context_State/src/Parameters.cpp
r83 r88 21 21 Parameters::Parameters (uint32_t nb_context, 22 22 uint32_t nb_decod_unit, 23 uint32_t nb_ooo_engine,24 23 uint32_t nb_inst_branch_complete, 25 24 uint32_t * size_depth, 26 25 uint32_t size_address, 27 uint32_t * size_ inst_decod,28 uint32_t * size_inst_commit,26 uint32_t * size_nb_inst_decod, 27 uint32_t size_nb_inst_commit, 29 28 uint32_t * link_context_to_decod_unit, 30 uint32_t * link_decod_unit_to_ooo_engine)29 bool is_toplevel) 31 30 { 32 31 log_begin(Context_State,FUNCTION); … … 34 33 _nb_context = nb_context ; 35 34 _nb_decod_unit = nb_decod_unit ; 36 _nb_ooo_engine = nb_ooo_engine ;37 35 _nb_inst_branch_complete = nb_inst_branch_complete ; 38 _ size_depth= size_depth ;39 40 _size_inst_decod = size_inst_decod;41 _size_inst_commit = size_inst_commit;36 _array_size_depth = size_depth ; 37 // _size_address = size_address ; 38 // _size_nb_inst_decod = size_nb_inst_decod ; 39 // _size_nb_inst_commit = size_nb_inst_commit ; 42 40 _link_context_to_decod_unit = link_context_to_decod_unit ; 43 _link_decod_unit_to_ooo_engine = link_decod_unit_to_ooo_engine; 41 42 test(); 43 44 if (is_toplevel) 45 { 46 _size_context_id = log2(_nb_context); 47 _size_depth = log2(max<uint32_t>(size_depth,_nb_context)); 48 _size_instruction_address = size_address; 49 _size_nb_inst_decod = max<uint32_t>(size_nb_inst_decod,_nb_decod_unit); 50 _size_nb_inst_commit = size_nb_inst_commit; 51 52 _have_port_context_id = (_size_context_id>0); 53 _have_port_depth = (_size_depth > 0); 54 55 copy (); 56 } 44 57 45 _size_context_id = log2(_nb_context);46 _size_max_depth = max<uint32_t>(_size_depth,_nb_context);47 48 _have_port_context_id = (_size_context_id>0);49 _have_port_max_depth = (_size_max_depth >0);50 _have_port_depth = new bool [_nb_context];51 for (uint32_t i=0; i<_nb_context; i++)52 _have_port_depth [i] = (_size_depth [i] >0);53 54 test();55 58 log_end(Context_State,FUNCTION); 56 59 }; … … 70 73 { 71 74 log_begin(Context_State,FUNCTION); 72 delete [] _have_port_depth; 75 log_end(Context_State,FUNCTION); 76 }; 77 78 #undef FUNCTION 79 #define FUNCTION "Context_State::copy" 80 void Parameters::copy (void) 81 { 82 log_begin(Context_State,FUNCTION); 73 83 log_end(Context_State,FUNCTION); 74 84 }; -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Context_State/src/Parameters_msg_error.cpp
r83 r88 41 41 test.error(toString(_("The decod_unit [%d] have none context as source."),i)); 42 42 43 bool _is_link_ooo_engine_from_decod_unit [_nb_ooo_engine];44 for (uint32_t i=0; i<_nb_ooo_engine; i++)45 _is_link_ooo_engine_from_decod_unit [i] = false;46 47 for (uint32_t i=0; i<_nb_decod_unit; i++)48 {49 if (_link_decod_unit_to_ooo_engine [i] < _nb_ooo_engine)50 _is_link_ooo_engine_from_decod_unit [_link_decod_unit_to_ooo_engine[i]] = true;51 else52 test.error(toString(_("The decod_unit [%d] is linked with invalid ooo_engine."),i));53 }54 55 for (uint32_t i=0; i<_nb_ooo_engine; i++)56 if (_is_link_ooo_engine_from_decod_unit [i] == false)57 test.error(toString(_("The ooo_engine [%d] have none decod_unit as source."),i));58 59 43 log_end(Context_State,FUNCTION); 60 44 -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Context_State/src/Parameters_print.cpp
r83 r88 27 27 xml.balise_open("context_state"); 28 28 xml.singleton_begin("nb_context "); xml.attribut("value",toString(_nb_context )); xml.singleton_end(); 29 xml.singleton_begin("nb_decod_unit "); xml.attribut("value",toString(_nb_decod_unit )); xml.singleton_end(); 30 xml.singleton_begin("nb_ooo_engine "); xml.attribut("value",toString(_nb_ooo_engine )); xml.singleton_end(); 29 // xml.singleton_begin("nb_decod_unit "); xml.attribut("value",toString(_nb_decod_unit )); xml.singleton_end(); 31 30 xml.singleton_begin("nb_inst_branch_complete "); xml.attribut("value",toString(_nb_inst_branch_complete )); xml.singleton_end(); 32 xml.singleton_begin("size_address "); xml.attribut("value",toString(_size_address )); xml.singleton_end(); 31 // xml.singleton_begin("size_address "); xml.attribut("value",toString(_size_address )); xml.singleton_end(); 32 // xml.singleton_begin("size_inst_commit "); xml.attribut("value",toString(_size_inst_commit )); xml.singleton_end(); 33 33 34 34 for (uint32_t i=0;i<_nb_context; i++) … … 38 38 xml. attribut("id" ,toString(i)); 39 39 xml. balise_open_end(); 40 xml. singleton_begin("size_depth "); xml.attribut("value",toString(_size_depth [i])); xml.singleton_end();40 // xml. singleton_begin("size_depth "); xml.attribut("value",toString(_size_depth [i])); xml.singleton_end(); 41 41 xml. singleton_begin("link_context_to_decod_unit "); xml.attribut("value",toString(_link_context_to_decod_unit [i])); xml.singleton_end(); 42 42 xml. balise_close(); … … 49 49 xml. attribut("id" ,toString(i)); 50 50 xml. balise_open_end(); 51 xml. singleton_begin("size_inst_decod "); xml.attribut("value",toString(_size_inst_decod [i])); xml.singleton_end(); 52 xml. singleton_begin("link_decod_unit_to_ooo_engine"); xml.attribut("value",toString(_link_decod_unit_to_ooo_engine[i])); xml.singleton_end(); 53 xml. balise_close(); 54 } 55 56 for (uint32_t i=0;i<_nb_ooo_engine; i++) 57 { 58 xml. balise_open_begin("component"); 59 xml. attribut("type","ooo_engine"); 60 xml. attribut("id" ,toString(i)); 61 xml. balise_open_end(); 62 xml. singleton_begin("size_inst_commit "); xml.attribut("value",toString(_size_inst_commit [i])); xml.singleton_end(); 51 // xml. singleton_begin("size_inst_decod "); xml.attribut("value",toString(_size_inst_decod [i])); xml.singleton_end(); 63 52 xml. balise_close(); 64 53 }
Note: See TracChangeset
for help on using the changeset viewer.