Changeset 122 for trunk/IPs/systemC
- Timestamp:
- Jun 3, 2009, 10:15:51 AM (16 years ago)
- Location:
- trunk/IPs/systemC
- Files:
-
- 2 added
- 119 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/IPs/systemC/Environment/Common/include/Debug.h
r117 r122 3 3 4 4 #define DEBUG_true true 5 #define DEBUG_ENVIRONMENT true6 #define DEBUG_CACHE true7 #define DEBUG_DATA true8 #define DEBUG_ENDIANNESS true9 #define DEBUG_QUEUE true10 #define DEBUG_RAMLOCK true11 #define DEBUG_SIM2OS true12 #define DEBUG_TTY true5 #define DEBUG_ENVIRONMENT false 6 #define DEBUG_CACHE false 7 #define DEBUG_DATA false 8 #define DEBUG_ENDIANNESS false 9 #define DEBUG_QUEUE false 10 #define DEBUG_RAMLOCK false 11 #define DEBUG_SIM2OS false 12 #define DEBUG_TTY false 13 13 14 14 #define MSG_ENVIRONMENT "[ENVIRONMENT]" … … 17 17 do \ 18 18 { \ 19 fprintf(stdout,str); \ 20 } \ 19 if (DEBUG_ ## component == true ) \ 20 { \ 21 fprintf(stdout,str); \ 22 } \ 23 } \ 21 24 while(0) 22 25 -
trunk/IPs/systemC/Environment/Data/src/loadexec.c
r117 r122 102 102 bfd *exec; 103 103 static int x; 104 int i;105 104 raminfo ringo; 106 105 -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Core_Glue/include/Core_Glue.h
r120 r122 121 121 public : SC_IN (Toperation_t ) *** in_ISSUE_OOO_ENGINE_OPERATION ;//[nb_ooo_engine][nb_inst_issue] 122 122 public : SC_IN (Tlsq_ptr_t ) *** in_ISSUE_OOO_ENGINE_STORE_QUEUE_PTR_WRITE ;//[nb_ooo_engine][nb_inst_issue] 123 public : SC_IN (Tlsq_ptr_t ) *** in_ISSUE_OOO_ENGINE_STORE_QUEUE_PTR_READ ;//[nb_ooo_engine][nb_inst_issue] 124 public : SC_IN (Tcontrol_t ) *** in_ISSUE_OOO_ENGINE_STORE_QUEUE_EMPTY ;//[nb_ooo_engine][nb_inst_issue] 123 125 public : SC_IN (Tlsq_ptr_t ) *** in_ISSUE_OOO_ENGINE_LOAD_QUEUE_PTR_WRITE ;//[nb_ooo_engine][nb_inst_issue] 124 126 public : SC_IN (Tcontrol_t ) *** in_ISSUE_OOO_ENGINE_HAS_IMMEDIAT ;//[nb_ooo_engine][nb_inst_issue] … … 144 146 public : SC_OUT(Ttype_t ) *** out_ISSUE_EXECUTE_LOOP_TYPE ;//[nb_execute_loop][nb_read_unit] 145 147 public : SC_OUT(Tlsq_ptr_t ) *** out_ISSUE_EXECUTE_LOOP_STORE_QUEUE_PTR_WRITE ;//[nb_execute_loop][nb_read_unit] 148 public : SC_OUT(Tlsq_ptr_t ) *** out_ISSUE_EXECUTE_LOOP_STORE_QUEUE_PTR_READ ;//[nb_execute_loop][nb_read_unit] 149 public : SC_OUT(Tcontrol_t ) *** out_ISSUE_EXECUTE_LOOP_STORE_QUEUE_EMPTY ;//[nb_execute_loop][nb_read_unit] 146 150 public : SC_OUT(Tlsq_ptr_t ) *** out_ISSUE_EXECUTE_LOOP_LOAD_QUEUE_PTR_WRITE ;//[nb_execute_loop][nb_read_unit] 147 151 public : SC_OUT(Tcontrol_t ) *** out_ISSUE_EXECUTE_LOOP_HAS_IMMEDIAT ;//[nb_execute_loop][nb_read_unit] -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Core_Glue/src/Core_Glue.cpp
r120 r122 168 168 << (*(in_ISSUE_OOO_ENGINE_OPERATION [i][j])) 169 169 << (*(in_ISSUE_OOO_ENGINE_STORE_QUEUE_PTR_WRITE [i][j])) 170 << (*(in_ISSUE_OOO_ENGINE_STORE_QUEUE_PTR_READ [i][j])) 171 << (*(in_ISSUE_OOO_ENGINE_STORE_QUEUE_EMPTY [i][j])) 170 172 << (*(in_ISSUE_OOO_ENGINE_HAS_IMMEDIAT [i][j])) 171 173 << (*(in_ISSUE_OOO_ENGINE_IMMEDIAT [i][j])) -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Core_Glue/src/Core_Glue_allocation.cpp
r120 r122 143 143 _ALLOC2_SIGNAL_IN ( in_ISSUE_OOO_ENGINE_OPERATION ,"OPERATION" ,Toperation_t ,_param->_size_operation ,_param->_nb_ooo_engine,_param->_nb_inst_issue_queue[it1]); 144 144 _ALLOC2_SIGNAL_IN ( in_ISSUE_OOO_ENGINE_STORE_QUEUE_PTR_WRITE ,"STORE_QUEUE_PTR_WRITE",Tlsq_ptr_t ,_param->_size_store_queue_ptr ,_param->_nb_ooo_engine,_param->_nb_inst_issue_queue[it1]); 145 _ALLOC2_SIGNAL_IN ( in_ISSUE_OOO_ENGINE_STORE_QUEUE_PTR_READ ,"STORE_QUEUE_PTR_READ" ,Tlsq_ptr_t ,_param->_size_store_queue_ptr ,_param->_nb_ooo_engine,_param->_nb_inst_issue_queue[it1]); 146 _ALLOC2_SIGNAL_IN ( in_ISSUE_OOO_ENGINE_STORE_QUEUE_EMPTY ,"STORE_QUEUE_EMPTY" ,Tcontrol_t ,1 ,_param->_nb_ooo_engine,_param->_nb_inst_issue_queue[it1]); 145 147 _ALLOC2_SIGNAL_IN ( in_ISSUE_OOO_ENGINE_LOAD_QUEUE_PTR_WRITE ,"LOAD_QUEUE_PTR_WRITE" ,Tlsq_ptr_t ,_param->_size_load_queue_ptr ,_param->_nb_ooo_engine,_param->_nb_inst_issue_queue[it1]); 146 148 _ALLOC2_SIGNAL_IN ( in_ISSUE_OOO_ENGINE_HAS_IMMEDIAT ,"HAS_IMMEDIAT" ,Tcontrol_t ,1 ,_param->_nb_ooo_engine,_param->_nb_inst_issue_queue[it1]); … … 172 174 _ALLOC2_SIGNAL_OUT(out_ISSUE_EXECUTE_LOOP_TYPE ,"TYPE" ,Ttype_t ,_param->_size_type ,_param->_nb_execute_loop,_param->_nb_read_unit[it1]); 173 175 _ALLOC2_SIGNAL_OUT(out_ISSUE_EXECUTE_LOOP_STORE_QUEUE_PTR_WRITE ,"STORE_QUEUE_PTR_WRITE",Tlsq_ptr_t ,_param->_size_store_queue_ptr ,_param->_nb_execute_loop,_param->_nb_read_unit[it1]); 176 _ALLOC2_SIGNAL_OUT(out_ISSUE_EXECUTE_LOOP_STORE_QUEUE_PTR_READ ,"STORE_QUEUE_PTR_READ" ,Tlsq_ptr_t ,_param->_size_store_queue_ptr ,_param->_nb_execute_loop,_param->_nb_read_unit[it1]); 177 _ALLOC2_SIGNAL_OUT(out_ISSUE_EXECUTE_LOOP_STORE_QUEUE_EMPTY ,"STORE_QUEUE_EMPTY" ,Tcontrol_t ,1 ,_param->_nb_execute_loop,_param->_nb_read_unit[it1]); 174 178 _ALLOC2_SIGNAL_OUT(out_ISSUE_EXECUTE_LOOP_LOAD_QUEUE_PTR_WRITE ,"LOAD_QUEUE_PTR_WRITE" ,Tlsq_ptr_t ,_param->_size_load_queue_ptr ,_param->_nb_execute_loop,_param->_nb_read_unit[it1]); 175 179 _ALLOC2_SIGNAL_OUT(out_ISSUE_EXECUTE_LOOP_HAS_IMMEDIAT ,"HAS_IMMEDIAT" ,Tcontrol_t ,1 ,_param->_nb_execute_loop,_param->_nb_read_unit[it1]); -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Core_Glue/src/Core_Glue_deallocation.cpp
r120 r122 78 78 DELETE2_SIGNAL( in_ISSUE_OOO_ENGINE_OPERATION ,_param->_nb_ooo_engine,_param->_nb_inst_issue_queue[it1],_param->_size_operation); 79 79 DELETE2_SIGNAL( in_ISSUE_OOO_ENGINE_STORE_QUEUE_PTR_WRITE ,_param->_nb_ooo_engine,_param->_nb_inst_issue_queue[it1],_param->_size_store_queue_ptr); 80 DELETE2_SIGNAL( in_ISSUE_OOO_ENGINE_STORE_QUEUE_PTR_READ ,_param->_nb_ooo_engine,_param->_nb_inst_issue_queue[it1],_param->_size_store_queue_ptr); 81 DELETE2_SIGNAL( in_ISSUE_OOO_ENGINE_STORE_QUEUE_EMPTY ,_param->_nb_ooo_engine,_param->_nb_inst_issue_queue[it1],1); 80 82 DELETE2_SIGNAL( in_ISSUE_OOO_ENGINE_LOAD_QUEUE_PTR_WRITE ,_param->_nb_ooo_engine,_param->_nb_inst_issue_queue[it1],_param->_size_load_queue_ptr); 81 83 DELETE2_SIGNAL( in_ISSUE_OOO_ENGINE_HAS_IMMEDIAT ,_param->_nb_ooo_engine,_param->_nb_inst_issue_queue[it1],1); … … 101 103 DELETE2_SIGNAL(out_ISSUE_EXECUTE_LOOP_TYPE ,_param->_nb_execute_loop,_param->_nb_read_unit[it1],_param->_size_type); 102 104 DELETE2_SIGNAL(out_ISSUE_EXECUTE_LOOP_STORE_QUEUE_PTR_WRITE ,_param->_nb_execute_loop,_param->_nb_read_unit[it1],_param->_size_store_queue_ptr); 105 DELETE2_SIGNAL(out_ISSUE_EXECUTE_LOOP_STORE_QUEUE_PTR_READ ,_param->_nb_execute_loop,_param->_nb_read_unit[it1],_param->_size_store_queue_ptr); 106 DELETE2_SIGNAL(out_ISSUE_EXECUTE_LOOP_STORE_QUEUE_EMPTY ,_param->_nb_execute_loop,_param->_nb_read_unit[it1],1); 103 107 DELETE2_SIGNAL(out_ISSUE_EXECUTE_LOOP_LOAD_QUEUE_PTR_WRITE ,_param->_nb_execute_loop,_param->_nb_read_unit[it1],_param->_size_load_queue_ptr); 104 108 DELETE2_SIGNAL(out_ISSUE_EXECUTE_LOOP_HAS_IMMEDIAT ,_param->_nb_execute_loop,_param->_nb_read_unit[it1],1); -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Core_Glue/src/Core_Glue_genMealy_issue.cpp
r120 r122 194 194 PORT_WRITE(out_ISSUE_EXECUTE_LOOP_TYPE [num_execute_loop][num_read_unit],type); 195 195 PORT_WRITE(out_ISSUE_EXECUTE_LOOP_STORE_QUEUE_PTR_WRITE [num_execute_loop][num_read_unit],PORT_READ(in_ISSUE_OOO_ENGINE_STORE_QUEUE_PTR_WRITE [num_ooo_engine][num_inst_issue_queue])); 196 PORT_WRITE(out_ISSUE_EXECUTE_LOOP_STORE_QUEUE_PTR_READ [num_execute_loop][num_read_unit],PORT_READ(in_ISSUE_OOO_ENGINE_STORE_QUEUE_PTR_READ [num_ooo_engine][num_inst_issue_queue])); 197 PORT_WRITE(out_ISSUE_EXECUTE_LOOP_STORE_QUEUE_EMPTY [num_execute_loop][num_read_unit],PORT_READ(in_ISSUE_OOO_ENGINE_STORE_QUEUE_EMPTY [num_ooo_engine][num_inst_issue_queue])); 196 198 if (_param->_have_port_load_queue_ptr) 197 199 PORT_WRITE(out_ISSUE_EXECUTE_LOOP_LOAD_QUEUE_PTR_WRITE [num_execute_loop][num_read_unit],PORT_READ(in_ISSUE_OOO_ENGINE_LOAD_QUEUE_PTR_WRITE [num_ooo_engine][num_inst_issue_queue])); -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Execute_loop/Execute_loop/Multi_Execute_unit/Execute_unit/Functionnal_unit/include/Functionnal_unit.h
r118 r122 85 85 public : SC_IN (Ttype_t ) * in_EXECUTE_IN_TYPE ; 86 86 public : SC_IN (Tlsq_ptr_t ) * in_EXECUTE_IN_STORE_QUEUE_PTR_WRITE; 87 public : SC_IN (Tlsq_ptr_t ) * in_EXECUTE_IN_STORE_QUEUE_PTR_READ ; 88 public : SC_IN (Tcontrol_t ) * in_EXECUTE_IN_STORE_QUEUE_EMPTY ; 87 89 public : SC_IN (Tlsq_ptr_t ) * in_EXECUTE_IN_LOAD_QUEUE_PTR_WRITE; 88 90 public : SC_IN (Tcontrol_t ) * in_EXECUTE_IN_HAS_IMMEDIAT ; -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Execute_loop/Execute_loop/Multi_Execute_unit/Execute_unit/Functionnal_unit/src/Functionnal_unit_allocation.cpp
r118 r122 63 63 ALLOC0_SIGNAL_IN ( in_EXECUTE_IN_TYPE ,"type" ,Ttype_t , _param->_size_type ); 64 64 ALLOC0_SIGNAL_IN ( in_EXECUTE_IN_STORE_QUEUE_PTR_WRITE ,"store_queue_ptr_write",Tlsq_ptr_t ,_param->_size_store_queue_ptr); 65 ALLOC0_SIGNAL_IN ( in_EXECUTE_IN_STORE_QUEUE_PTR_READ ,"store_queue_ptr_read" ,Tlsq_ptr_t ,_param->_size_store_queue_ptr); 66 ALLOC0_SIGNAL_IN ( in_EXECUTE_IN_STORE_QUEUE_EMPTY ,"store_queue_empty" ,Tcontrol_t , 1); 65 67 ALLOC0_SIGNAL_IN ( in_EXECUTE_IN_LOAD_QUEUE_PTR_WRITE ,"load_queue_ptr_write" ,Tlsq_ptr_t ,_param->_size_load_queue_ptr); 66 68 ALLOC0_SIGNAL_IN ( in_EXECUTE_IN_HAS_IMMEDIAT ,"has_immediat" ,Tcontrol_t , 1); -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Execute_loop/Execute_loop/Multi_Execute_unit/Execute_unit/Functionnal_unit/src/Functionnal_unit_deallocation.cpp
r118 r122 39 39 DELETE0_SIGNAL( in_EXECUTE_IN_TYPE , _param->_size_type ); 40 40 DELETE0_SIGNAL( in_EXECUTE_IN_STORE_QUEUE_PTR_WRITE ,_param->_size_store_queue_ptr); 41 DELETE0_SIGNAL( in_EXECUTE_IN_STORE_QUEUE_PTR_READ ,_param->_size_store_queue_ptr); 42 DELETE0_SIGNAL( in_EXECUTE_IN_STORE_QUEUE_EMPTY , 1); 41 43 DELETE0_SIGNAL( in_EXECUTE_IN_LOAD_QUEUE_PTR_WRITE ,_param->_size_load_queue_ptr); 42 44 DELETE0_SIGNAL( in_EXECUTE_IN_HAS_IMMEDIAT , 1); -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Execute_loop/Execute_loop/Multi_Execute_unit/Execute_unit/Load_store_unit/include/Load_store_unit.h
r117 r122 103 103 public : SC_IN (Ttype_t ) ** in_MEMORY_IN_TYPE ;//[nb_inst_memory] 104 104 public : SC_IN (Tlsq_ptr_t ) ** in_MEMORY_IN_STORE_QUEUE_PTR_WRITE;//[nb_inst_memory] 105 public : SC_IN (Tlsq_ptr_t ) ** in_MEMORY_IN_STORE_QUEUE_PTR_READ ;//[nb_inst_memory] 106 public : SC_IN (Tcontrol_t ) ** in_MEMORY_IN_STORE_QUEUE_EMPTY ;//[nb_inst_memory] 105 107 public : SC_IN (Tlsq_ptr_t ) ** in_MEMORY_IN_LOAD_QUEUE_PTR_WRITE ;//[nb_inst_memory] 106 108 public : SC_IN (Tcontrol_t ) ** in_MEMORY_IN_HAS_IMMEDIAT ;//[nb_inst_memory] -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Execute_loop/Execute_loop/Multi_Execute_unit/Execute_unit/Load_store_unit/include/Types.h
r119 r122 73 73 //public : Tgeneral_address_t _num_reg_rd ; 74 74 public : Texception_t _exception ; 75 public : bool _send_commit ; 75 76 76 77 friend std::ostream & operator << (std::ostream& os, const Tstore_queue_entry_t & x) … … 112 113 public : Tlsq_ptr_t _load_queue_ptr_write ; 113 114 public : Tlsq_ptr_t _store_queue_ptr_write; 115 public : Tlsq_ptr_t _store_queue_ptr_read ; 116 public : Tcontrol_t _store_queue_empty ; 114 117 public : Tdcache_address_t _address ; 115 118 public : Tcontrol_t _write_rd ; … … 123 126 << " * context, front_end, ooo_engine_id : " << toString(x._context_id) << " - " << toString(x._front_end_id) << " - " << toString(x._ooo_engine_id) << std::endl 124 127 << " * operation : " << toString(x._operation) << std::endl 125 << " * load, store ptr_ write : " << toString(x._load_queue_ptr_write) << " - " << toString(x._store_queue_ptr_write) << std::endl128 << " * load, store ptr_(write/read) empty: " << toString(x._load_queue_ptr_write) << " - " << toString(x._store_queue_ptr_write) << " - " << toString(x._store_queue_ptr_read) << " - " << toString(x._store_queue_empty) << std::endl 126 129 << " * exception : " << toString(x._exception) << std::endl 127 130 << std::hex … … 166 169 public : Toperation_t _operation ; 167 170 public : Tlsq_ptr_t _store_queue_ptr_write; 171 public : Tlsq_ptr_t _store_queue_ptr_read ; 172 public : Tcontrol_t _store_queue_empty ; 168 173 public : Tdcache_address_t _address ; 169 174 public : Tdcache_address_t _check_hit_byte ; … … 183 188 << " * context, front_end, ooo_engine_id : " << toString(x._context_id) << " - " << toString(x._front_end_id) << " - " << toString(x._ooo_engine_id) << std::endl 184 189 << " * operation : " << toString(x._operation) << std::endl 185 << " * store_queue _ptr_write : " << toString(x._store_queue_ptr_write) <<std::endl190 << " * store_queue ptr_(write,read) empty: " << toString(x._store_queue_ptr_write) << " - " << toString(x._store_queue_ptr_read) << " - " << toString(x._store_queue_empty) <<std::endl 186 191 << " * exception : " << toString(x._exception) << std::endl 187 192 << " * check_hit, check_hit_byte : " << toString(x._check_hit) << " - " << toString(x._check_hit_byte) << std::endl -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Execute_loop/Execute_loop/Multi_Execute_unit/Execute_unit/Load_store_unit/src/Load_store_unit_allocation.cpp
r117 r122 65 65 ALLOC1_SIGNAL_IN ( in_MEMORY_IN_TYPE ,"type" ,Ttype_t ,_param->_size_type ); 66 66 ALLOC1_SIGNAL_IN ( in_MEMORY_IN_STORE_QUEUE_PTR_WRITE,"store_queue_ptr_write",Tlsq_ptr_t ,_param->_size_store_queue_ptr ); 67 ALLOC1_SIGNAL_IN ( in_MEMORY_IN_STORE_QUEUE_PTR_READ ,"store_queue_ptr_read" ,Tlsq_ptr_t ,_param->_size_store_queue_ptr ); 68 ALLOC1_SIGNAL_IN ( in_MEMORY_IN_STORE_QUEUE_EMPTY ,"store_queue_empty" ,Tcontrol_t ,1); 67 69 ALLOC1_SIGNAL_IN ( in_MEMORY_IN_LOAD_QUEUE_PTR_WRITE ,"load_queue_ptr_write" ,Tlsq_ptr_t ,_param->_size_load_queue_ptr ); 68 70 ALLOC1_SIGNAL_IN ( in_MEMORY_IN_HAS_IMMEDIAT ,"has_immediat" ,Tcontrol_t ,1 ); -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Execute_loop/Execute_loop/Multi_Execute_unit/Execute_unit/Load_store_unit/src/Load_store_unit_deallocation.cpp
r117 r122 45 45 DELETE1_SIGNAL( in_MEMORY_IN_TYPE ,_param->_nb_inst_memory,_param->_size_type ); 46 46 DELETE1_SIGNAL( in_MEMORY_IN_STORE_QUEUE_PTR_WRITE,_param->_nb_inst_memory,_param->_size_store_queue_ptr ); 47 DELETE1_SIGNAL( in_MEMORY_IN_STORE_QUEUE_PTR_READ ,_param->_nb_inst_memory,_param->_size_store_queue_ptr ); 48 DELETE1_SIGNAL( in_MEMORY_IN_STORE_QUEUE_EMPTY ,_param->_nb_inst_memory,1); 47 49 DELETE1_SIGNAL( in_MEMORY_IN_LOAD_QUEUE_PTR_WRITE ,_param->_nb_inst_memory,_param->_size_load_queue_ptr ); 48 50 DELETE1_SIGNAL( in_MEMORY_IN_HAS_IMMEDIAT ,_param->_nb_inst_memory,1 ); -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Execute_loop/Execute_loop/Multi_Execute_unit/Execute_unit/Load_store_unit/src/Load_store_unit_function_speculative_load_commit_genMoore.cpp
r117 r122 39 39 // Tspecial_address_t memory_out_num_reg_re = 0; 40 40 // Tspecial_data_t memory_out_data_re = 0; 41 Tcontrol_t memory_out_no_sequence = 0; 41 42 Texception_t memory_out_exception = 0; 42 43 … … 98 99 { 99 100 log_printf(TRACE,Load_store_unit,FUNCTION," * Store queue"); 100 // Can retire an store instruction if : 101 // * state is commit 102 // * none load must check this store 103 if ((_store_queue [reg_STORE_QUEUE_PTR_READ]._state == STORE_QUEUE_COMMIT) and 104 (reg_STORE_QUEUE_NB_CHECK [reg_STORE_QUEUE_PTR_READ] == 0)) 105 { 106 log_printf(TRACE,Load_store_unit,FUNCTION," * find : %d",reg_STORE_QUEUE_PTR_READ); 107 108 internal_MEMORY_OUT_VAL = 1; 109 internal_MEMORY_OUT_SELECT_QUEUE = SELECT_STORE_QUEUE; 110 111 memory_out_context_id = _store_queue [reg_STORE_QUEUE_PTR_READ]._context_id; 112 memory_out_front_end_id = _store_queue [reg_STORE_QUEUE_PTR_READ]._front_end_id; 113 memory_out_ooo_engine_id = _store_queue [reg_STORE_QUEUE_PTR_READ]._ooo_engine_id; 114 memory_out_packet_id = _store_queue [reg_STORE_QUEUE_PTR_READ]._packet_id ; 115 // memory_out_write_rd 116 // memory_out_num_reg_rd 117 memory_out_data_rd = _store_queue [reg_STORE_QUEUE_PTR_READ]._address; // to the exception 118 memory_out_exception = _store_queue [reg_STORE_QUEUE_PTR_READ]._exception; 119 } 120 } 101 102 for (uint32_t i=0; i<_param->_size_store_queue; ++i) 103 { 104 internal_MEMORY_OUT_PTR = (reg_STORE_QUEUE_PTR_READ+i)%_param->_size_store_queue; 105 // Can retire an store instruction if : 106 // * state is commit 107 // * none load must check this store 108 109 110 bool val_head = ((i==0) and 111 (_store_queue [internal_MEMORY_OUT_PTR]._state == STORE_QUEUE_COMMIT) and 112 (_store_queue [internal_MEMORY_OUT_PTR]._send_commit == true) and 113 (reg_STORE_QUEUE_NB_CHECK [internal_MEMORY_OUT_PTR] == 0) 114 ); 115 116 bool val_commit = ((_store_queue [internal_MEMORY_OUT_PTR]._state != STORE_QUEUE_EMPTY) and 117 (_store_queue [internal_MEMORY_OUT_PTR]._send_commit == false)); 118 119 if (val_head or val_commit) 120 { 121 log_printf(TRACE,Load_store_unit,FUNCTION," * find : %d",internal_MEMORY_OUT_PTR); 122 123 internal_MEMORY_OUT_VAL = 1; 124 internal_MEMORY_OUT_SELECT_QUEUE = SELECT_STORE_QUEUE; 125 126 memory_out_context_id = _store_queue [internal_MEMORY_OUT_PTR]._context_id; 127 memory_out_front_end_id = _store_queue [internal_MEMORY_OUT_PTR]._front_end_id; 128 memory_out_ooo_engine_id = _store_queue [internal_MEMORY_OUT_PTR]._ooo_engine_id; 129 memory_out_packet_id = _store_queue [internal_MEMORY_OUT_PTR]._packet_id ; 130 // memory_out_write_rd 131 // memory_out_num_reg_rd 132 memory_out_data_rd = _store_queue [internal_MEMORY_OUT_PTR]._address; // to the exception 133 memory_out_exception = _store_queue [internal_MEMORY_OUT_PTR]._exception; 134 memory_out_no_sequence = val_commit; 135 break; // find an entry 136 } 137 138 } 139 } 140 121 141 // write output 122 142 PORT_WRITE(out_MEMORY_OUT_VAL [0], internal_MEMORY_OUT_VAL); … … 142 162 PORT_WRITE(out_MEMORY_OUT_DATA_RE [0], 0); 143 163 PORT_WRITE(out_MEMORY_OUT_EXCEPTION [0], memory_out_exception ); 144 PORT_WRITE(out_MEMORY_OUT_NO_SEQUENCE [0], 0); 164 PORT_WRITE(out_MEMORY_OUT_NO_SEQUENCE [0], memory_out_no_sequence );// hack 165 #ifdef DEBUG 166 PORT_WRITE(out_MEMORY_OUT_ADDRESS [0], memory_out_data_rd); 167 #else 145 168 PORT_WRITE(out_MEMORY_OUT_ADDRESS [0], 0); 169 #endif 146 170 147 171 // ~~~~~[ Interface "dache_req" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Execute_loop/Execute_loop/Multi_Execute_unit/Execute_unit/Load_store_unit/src/Load_store_unit_function_speculative_load_commit_transition.cpp
r119 r122 275 275 // ======================= 276 276 277 log_printf(TRACE,Load_store_unit,FUNCTION," * store_queue [%d]", reg_STORE_QUEUE_PTR_READ);277 log_printf(TRACE,Load_store_unit,FUNCTION," * store_queue [%d]",internal_MEMORY_OUT_PTR); 278 278 279 279 // Entry flush and increase the read pointer 280 _store_queue [reg_STORE_QUEUE_PTR_READ]._state = STORE_QUEUE_EMPTY; 281 282 reg_STORE_QUEUE_PTR_READ = (reg_STORE_QUEUE_PTR_READ+1)%_param->_size_store_queue; 280 if (_store_queue [internal_MEMORY_OUT_PTR]._send_commit) 281 { 282 _store_queue [internal_MEMORY_OUT_PTR]._state = STORE_QUEUE_EMPTY; 283 reg_STORE_QUEUE_PTR_READ = (reg_STORE_QUEUE_PTR_READ+1)%_param->_size_store_queue; 284 } 285 else 286 _store_queue [internal_MEMORY_OUT_PTR]._send_commit = true; 283 287 284 288 break; … … 339 343 { 340 344 // Get an index from load queue 341 uint32_t index_load = (i + reg_LOAD_QUEUE_CHECK_PRIORITY)%_param->_size_load_queue;345 uint32_t index_load_queue = (i + reg_LOAD_QUEUE_CHECK_PRIORITY)%_param->_size_load_queue; 342 346 343 347 // Test if this load must ckecked store queue 344 if (((_load_queue[index_load ]._state == LOAD_QUEUE_WAIT_CHECK) or345 (_load_queue[index_load ]._state == LOAD_QUEUE_COMMIT_CHECK) or346 (_load_queue[index_load ]._state == LOAD_QUEUE_CHECK)) and347 is_operation_memory_load(_load_queue[index_load ]._operation))348 if (((_load_queue[index_load_queue]._state == LOAD_QUEUE_WAIT_CHECK) or 349 (_load_queue[index_load_queue]._state == LOAD_QUEUE_COMMIT_CHECK) or 350 (_load_queue[index_load_queue]._state == LOAD_QUEUE_CHECK)) and 351 is_operation_memory_load(_load_queue[index_load_queue]._operation)) 348 352 { 349 log_printf(TRACE,Load_store_unit,FUNCTION," * Find a load : %d",index_load );353 log_printf(TRACE,Load_store_unit,FUNCTION," * Find a load : %d",index_load_queue); 350 354 351 355 nb_check++; // use one port 352 356 353 357 // find a entry that it need a check 354 Tlsq_ptr_t index_store = _load_queue[index_load]._store_queue_ptr_write; 355 // Tlsq_ptr_t index_store_old = index_store; 358 Tlsq_ptr_t store_queue_ptr_write = _load_queue[index_load_queue]._store_queue_ptr_write; 359 Tlsq_ptr_t store_queue_ptr_read = _load_queue[index_load_queue]._store_queue_ptr_read ; 360 Tlsq_ptr_t store_queue_empty = _load_queue[index_load_queue]._store_queue_empty ; 361 // Tlsq_ptr_t store_queue_ptr_write_old = store_queue_ptr_write; 356 362 357 363 // Init variable … … 365 371 // * when a store is out of store queue, also it was in head of re order buffer. Also, they are none previous load. 366 372 367 log_printf(TRACE,Load_store_unit,FUNCTION," * index_store : %d",index_store); 368 log_printf(TRACE,Load_store_unit,FUNCTION," * ptr_read : %d",reg_STORE_QUEUE_PTR_READ); 369 370 if (index_store == reg_STORE_QUEUE_PTR_READ) 373 log_printf(TRACE,Load_store_unit,FUNCTION," * store_queue_ptr_write : %d",store_queue_ptr_write); 374 log_printf(TRACE,Load_store_unit,FUNCTION," * store_queue_ptr_read : %d",store_queue_ptr_read ); 375 // log_printf(TRACE,Load_store_unit,FUNCTION," * store_queue_empty : %d",store_queue_empty ); 376 log_printf(TRACE,Load_store_unit,FUNCTION," * reg_STORE_QUEUE_PTR_READ : %d",reg_STORE_QUEUE_PTR_READ); 377 378 if ((store_queue_ptr_write == store_queue_ptr_read) or 379 (store_queue_ptr_write == reg_STORE_QUEUE_PTR_READ)) 380 // if (store_queue_empty) 371 381 { 372 log_printf(TRACE,Load_store_unit,FUNCTION," * index_store == reg_STORE_QUEUE_PTR_READ");382 log_printf(TRACE,Load_store_unit,FUNCTION," * store_queue_ptr_write == store_queue_ptr_read"); 373 383 end_check = true; 374 384 change_state = true; … … 376 386 else 377 387 { 378 log_printf(TRACE,Load_store_unit,FUNCTION," * index_store != reg_STORE_QUEUE_PTR_READ");379 380 index_store = (index_store-1)%(_param->_size_store_queue); // store_queue_ptr_write target the next slot to write, also the slot is not significatif when the load is renaming381 382 log_printf(TRACE,Load_store_unit,FUNCTION," * index_store : %d",index_store);388 log_printf(TRACE,Load_store_unit,FUNCTION," * store_queue_ptr_write != store_queue_ptr_read"); 389 390 store_queue_ptr_write = (store_queue_ptr_write-1)%(_param->_size_store_queue); // store_queue_ptr_write target the next slot to write, also the slot is not significatif when the load is renaming 391 392 log_printf(TRACE,Load_store_unit,FUNCTION," * store_queue_ptr_write : %d",store_queue_ptr_write); 383 393 384 394 // switch on store_queue state 385 switch (_store_queue[ index_store]._state)395 switch (_store_queue[store_queue_ptr_write]._state) 386 396 { 387 397 case STORE_QUEUE_VALID_NO_SPECULATIVE : … … 397 407 // Test thread id 398 408 if (_param->_have_port_context_id) 399 test_thread_id &= (_load_queue[index_load ]._context_id == _store_queue[index_store]._context_id);409 test_thread_id &= (_load_queue[index_load_queue]._context_id == _store_queue[store_queue_ptr_write]._context_id); 400 410 if (_param->_have_port_front_end_id) 401 test_thread_id &= (_load_queue[index_load ]._front_end_id == _store_queue[index_store]._front_end_id);411 test_thread_id &= (_load_queue[index_load_queue]._front_end_id == _store_queue[store_queue_ptr_write]._front_end_id); 402 412 if (_param->_have_port_ooo_engine_id) 403 test_thread_id &= (_load_queue[index_load ]._ooo_engine_id == _store_queue[index_store]._ooo_engine_id);413 test_thread_id &= (_load_queue[index_load_queue]._ooo_engine_id == _store_queue[store_queue_ptr_write]._ooo_engine_id); 404 414 405 415 if (test_thread_id) … … 408 418 409 419 log_printf(TRACE,Load_store_unit,FUNCTION," * load and store is the same thread."); 410 Tdcache_address_t load_addr = _load_queue [index_load ]._address;411 Tdcache_address_t store_addr = _store_queue[ index_store]._address;420 Tdcache_address_t load_addr = _load_queue [index_load_queue ]._address; 421 Tdcache_address_t store_addr = _store_queue[store_queue_ptr_write]._address; 412 422 413 423 log_printf(TRACE,Load_store_unit,FUNCTION," * load_addr : %.8x.",load_addr ); … … 435 445 bool is_big_endian = true; 436 446 437 Tgeneral_data_t load_data = _load_queue [index_load ]._rdata ;438 Tgeneral_data_t store_data = _store_queue[ index_store]._wdata ;439 Tdcache_address_t check_hit_byte = _load_queue [index_load ]._check_hit_byte;440 Tcontrol_t check_hit = _load_queue [index_load ]._check_hit;441 uint32_t load_size_access = memory_size(_load_queue [index_load ]._operation)>>3;442 uint32_t store_size_access = memory_size(_store_queue[ index_store]._operation)>>3;447 Tgeneral_data_t load_data = _load_queue [index_load_queue ]._rdata ; 448 Tgeneral_data_t store_data = _store_queue[store_queue_ptr_write]._wdata ; 449 Tdcache_address_t check_hit_byte = _load_queue [index_load_queue ]._check_hit_byte; 450 Tcontrol_t check_hit = _load_queue [index_load_queue ]._check_hit; 451 uint32_t load_size_access = memory_size(_load_queue [index_load_queue ]._operation)>>3; 452 uint32_t store_size_access = memory_size(_store_queue[store_queue_ptr_write]._operation)>>3; 443 453 444 454 log_printf(TRACE,Load_store_unit,FUNCTION," * is_big_endian : %d",is_big_endian); … … 464 474 } 465 475 466 uint32_t store_nb_byte = (1<<memory_access(_store_queue[ index_store]._operation));476 uint32_t store_nb_byte = (1<<memory_access(_store_queue[store_queue_ptr_write]._operation)); 467 477 468 478 // Take interval to the store … … 473 483 log_printf(TRACE,Load_store_unit,FUNCTION," * store_num_byte_max : %d",store_num_byte_max); 474 484 475 // uint32_t load_nb_byte = (1<<memory_access(_load_queue[index_load ]._operation));485 // uint32_t load_nb_byte = (1<<memory_access(_load_queue[index_load_queue]._operation)); 476 486 477 487 // uint32_t load_num_byte_min = (load_addr & _param->_mask_address_lsb); … … 517 527 518 528 // // store duplicate = all store access can be see as full size_data store 519 // // uint32_t load_nb_byte = (1<<memory_access(_load_queue [index_load ]._operation));529 // // uint32_t load_nb_byte = (1<<memory_access(_load_queue [index_load_queue ]._operation)); 520 530 521 531 // // int32_t diff = ((_param->_size_general_data>>3)+load_nb_byte-2*load_nb_byte*((num_store_byte/load_nb_byte)+1)); … … 597 607 } 598 608 599 _load_queue[index_load ]._rdata = load_data;600 _load_queue[index_load ]._check_hit_byte = check_hit_byte;601 _load_queue[index_load ]._check_hit = check_hit;609 _load_queue[index_load_queue]._rdata = load_data; 610 _load_queue[index_load_queue]._check_hit_byte = check_hit_byte; 611 _load_queue[index_load_queue]._check_hit = check_hit; 602 612 603 613 log_printf(TRACE,Load_store_unit,FUNCTION," * load_data (after) : 0x%.8x",load_data); … … 609 619 log_printf(TRACE,Load_store_unit,FUNCTION," * mask_check_hit_byte: %x",_param->_mask_check_hit_byte); 610 620 // The check is finish if all bit is set 611 end_check = (_load_queue[index_load ]._check_hit_byte == _param->_mask_check_hit_byte);621 end_check = (_load_queue[index_load_queue]._check_hit_byte == _param->_mask_check_hit_byte); 612 622 613 623 } … … 629 639 { 630 640 log_printf(TRACE,Load_store_unit,FUNCTION," * next"); 631 log_printf(TRACE,Load_store_unit,FUNCTION," * new store_queue_ptr_write : %d", index_store);641 log_printf(TRACE,Load_store_unit,FUNCTION," * new store_queue_ptr_write : %d",store_queue_ptr_write); 632 642 633 643 log_printf(TRACE,Load_store_unit,FUNCTION," * update reg_STORE_QUEUE_NB_CHECK"); 634 644 #ifdef DEBUG 635 if (reg_STORE_QUEUE_NB_CHECK [ index_store] == 0)645 if (reg_STORE_QUEUE_NB_CHECK [store_queue_ptr_write] == 0) 636 646 throw ERRORMORPHEO(FUNCTION,_("reg_STORE_QUEUE_NB_CHECK must be > 0\n")); 637 647 #endif 638 reg_STORE_QUEUE_NB_CHECK [index_store] --; 639 640 // if (_load_queue[index_load]._store_queue_ptr_write == 0) 641 // _load_queue[index_load]._store_queue_ptr_write = _param->_size_store_queue-1; 648 649 reg_STORE_QUEUE_NB_CHECK [store_queue_ptr_write] --; 650 651 log_printf(TRACE,Load_store_unit,FUNCTION," * reg_STORE_QUEUE_NB_CHECK 1 [%d] <- %d", store_queue_ptr_write,reg_STORE_QUEUE_NB_CHECK [store_queue_ptr_write]); 652 653 if ((store_queue_ptr_write == store_queue_ptr_read) or 654 (store_queue_ptr_write == reg_STORE_QUEUE_PTR_READ)) 655 { 656 // store_queue_empty = true; 657 end_check = true; 658 change_state = true; 659 } 660 661 // if (_load_queue[index_load_queue]._store_queue_ptr_write == 0) 662 // _load_queue[index_load_queue]._store_queue_ptr_write = _param->_size_store_queue-1; 642 663 // else 643 // _load_queue[index_load]._store_queue_ptr_write --; 644 _load_queue[index_load]._store_queue_ptr_write = index_store; // because the index store have be decrease 645 646 // FIXME : peut n'est pas obliger de faire cette comparaison. Au prochain cycle on le détectera que les pointeur sont égaux. Ceci évitera d'avoir deux comparateurs avec le registre "reg_STORE_QUEUE_PTR_READ" 647 if (index_store == reg_STORE_QUEUE_PTR_READ) 648 { 649 end_check = true; 650 change_state = true; 651 } 664 // _load_queue[index_load_queue]._store_queue_ptr_write --; 665 _load_queue[index_load_queue]._store_queue_ptr_write = store_queue_ptr_write; // because the index store have be decrease 666 _load_queue[index_load_queue]._store_queue_empty = store_queue_empty; // because the index store have be decrease 667 668 // FIXME : peut n'est pas obliger de faire cette comparaison. Au prochain cycle on le détectera que les pointeur sont égaux. Ceci évitera d'avoir deux comparateurs avec le registre "store_queue_ptr_read" 652 669 } 653 670 … … 657 674 log_printf(TRACE,Load_store_unit,FUNCTION," * end_check : %d",end_check); 658 675 659 log_printf(TRACE,Load_store_unit,FUNCTION," * state old : %s",toString(_load_queue[index_load ]._state).c_str());660 661 switch (_load_queue[index_load ]._state)676 log_printf(TRACE,Load_store_unit,FUNCTION," * state old : %s",toString(_load_queue[index_load_queue]._state).c_str()); 677 678 switch (_load_queue[index_load_queue]._state) 662 679 { 663 680 case LOAD_QUEUE_WAIT_CHECK : 664 681 { 665 682 if (end_check) 666 _load_queue[index_load ]._state = LOAD_QUEUE_WAIT ;683 _load_queue[index_load_queue]._state = LOAD_QUEUE_WAIT ; 667 684 break; 668 685 } … … 670 687 { 671 688 if (end_check) 672 _load_queue[index_load ]._state = LOAD_QUEUE_COMMIT;689 _load_queue[index_load_queue]._state = LOAD_QUEUE_COMMIT; 673 690 else 674 _load_queue[index_load ]._state = LOAD_QUEUE_CHECK; // No commit : check hit and no end691 _load_queue[index_load_queue]._state = LOAD_QUEUE_CHECK; // No commit : check hit and no end 675 692 break; 676 693 } … … 678 695 { 679 696 if (end_check) 680 _load_queue[index_load ]._state = LOAD_QUEUE_COMMIT;697 _load_queue[index_load_queue]._state = LOAD_QUEUE_COMMIT; 681 698 682 699 // check find a bypass. A speculative load have been committed : report a speculation miss. 683 if ((_load_queue[index_load ]._check_hit != 0) and684 (_load_queue[index_load ]._write_rd == 0) // is commit700 if ((_load_queue[index_load_queue]._check_hit != 0) and 701 (_load_queue[index_load_queue]._write_rd == 0) // is commit 685 702 ) 686 703 { 687 _load_queue[index_load ]._exception = EXCEPTION_MEMORY_MISS_SPECULATION;688 _load_queue[index_load ]._write_rd = 1; // write the good result704 _load_queue[index_load_queue]._exception = EXCEPTION_MEMORY_MISS_SPECULATION; 705 _load_queue[index_load_queue]._write_rd = 1; // write the good result 689 706 690 707 #ifdef STATISTICS … … 698 715 default : break; 699 716 } 700 log_printf(TRACE,Load_store_unit,FUNCTION," * state new : %s",toString(_load_queue[index_load]._state).c_str()); 701 log_printf(TRACE,Load_store_unit,FUNCTION," * exception : %d",_load_queue[index_load]._exception); 702 703 if (end_check) 717 log_printf(TRACE,Load_store_unit,FUNCTION," * state new : %s",toString(_load_queue[index_load_queue]._state).c_str()); 718 log_printf(TRACE,Load_store_unit,FUNCTION," * exception : %d",_load_queue[index_load_queue]._exception); 719 720 if (end_check// and not store_queue_empty 721 ) 704 722 { 705 723 log_printf(TRACE,Load_store_unit,FUNCTION," * end check, decrease all nb_check"); 706 724 707 uint32_t i= index_store;708 while (i!= reg_STORE_QUEUE_PTR_READ)725 uint32_t i=store_queue_ptr_write; 726 while (i!=store_queue_ptr_read) 709 727 { 710 728 i=((i==0)?_param->_size_store_queue:i)-1; … … 714 732 throw ERRORMORPHEO(FUNCTION,_("reg_STORE_QUEUE_NB_CHECK must be > 0\n")); 715 733 #endif 716 734 717 735 reg_STORE_QUEUE_NB_CHECK [i] --; 736 737 log_printf(TRACE,Load_store_unit,FUNCTION," * reg_STORE_QUEUE_NB_CHECK 2 [%d] <- %d", i,reg_STORE_QUEUE_NB_CHECK [i]); 738 718 739 //i=(i+1)%_param->_size_store_queue; 719 740 } 741 742 _load_queue[index_load_queue]._store_queue_empty = true; // end of check 720 743 } 721 744 } … … 856 879 _store_queue [index]._load_queue_ptr_write = (not _param->_have_port_load_queue_ptr)?0:PORT_READ(in_MEMORY_IN_LOAD_QUEUE_PTR_WRITE[internal_MEMORY_IN_PORT]); 857 880 _store_queue [index]._address = address; 881 _store_queue [index]._send_commit = false; 858 882 859 883 // reordering data … … 895 919 _speculative_access_queue [index]._load_queue_ptr_write = (not _param->_have_port_load_queue_ptr)?0:PORT_READ(in_MEMORY_IN_LOAD_QUEUE_PTR_WRITE[internal_MEMORY_IN_PORT]); 896 920 _speculative_access_queue [index]._store_queue_ptr_write= PORT_READ(in_MEMORY_IN_STORE_QUEUE_PTR_WRITE[internal_MEMORY_IN_PORT]); 921 _speculative_access_queue [index]._store_queue_ptr_read = PORT_READ(in_MEMORY_IN_STORE_QUEUE_PTR_READ [internal_MEMORY_IN_PORT]); 922 _speculative_access_queue [index]._store_queue_empty = PORT_READ(in_MEMORY_IN_STORE_QUEUE_EMPTY [internal_MEMORY_IN_PORT]); 897 923 _speculative_access_queue [index]._address = address; 898 924 // NOTE : is operation is a load, then they are a result and must write in the register file … … 954 980 bool have_exception = (exception != EXCEPTION_MEMORY_NONE); 955 981 bool need_check= false; 982 Tlsq_ptr_t store_queue_ptr_write = _speculative_access_queue [internal_SPECULATIVE_ACCESS_QUEUE_PTR_READ]._store_queue_ptr_write; 983 Tlsq_ptr_t store_queue_ptr_read = _speculative_access_queue [internal_SPECULATIVE_ACCESS_QUEUE_PTR_READ]._store_queue_ptr_read ; 984 Tcontrol_t store_queue_empty = _speculative_access_queue [internal_SPECULATIVE_ACCESS_QUEUE_PTR_READ]._store_queue_empty ; 956 985 957 986 if (have_exception) … … 962 991 { 963 992 // load and synchronisation 964 if (must_check(operation) )993 if (must_check(operation) and not store_queue_empty) 965 994 { 966 995 // load 967 996 need_check = true; 997 968 998 _load_queue [ptr_write]._state = LOAD_QUEUE_WAIT_CHECK; 969 999 } … … 984 1014 Tdcache_address_t address_lsb = (address & _param->_mask_address_lsb); 985 1015 Tdcache_address_t check_hit_byte = gen_mask_not<Tdcache_address_t>(address_lsb+(memory_size(operation)>>3)-1,address_lsb) & _param->_mask_check_hit_byte; 986 Tlsq_ptr_t store_queue_ptr_write = _speculative_access_queue [internal_SPECULATIVE_ACCESS_QUEUE_PTR_READ]._store_queue_ptr_write;987 1016 988 1017 log_printf(TRACE,Load_store_unit,FUNCTION," * address : 0x%.8x", address); … … 998 1027 _load_queue [ptr_write]._operation = operation; 999 1028 _load_queue [ptr_write]._store_queue_ptr_write = store_queue_ptr_write; 1029 _load_queue [ptr_write]._store_queue_ptr_read = store_queue_ptr_read ; 1030 _load_queue [ptr_write]._store_queue_empty = store_queue_empty ; 1000 1031 _load_queue [ptr_write]._address = address; 1001 1032 _load_queue [ptr_write]._check_hit_byte = check_hit_byte; … … 1023 1054 1024 1055 // Only load need check 1025 if (need_check) 1056 if (need_check// and not store_queue_empty 1057 ) 1026 1058 // if (is_operation_memory_load(_load_queue [ptr_write]._operation)) 1027 1059 { 1028 1060 log_printf(TRACE,Load_store_unit,FUNCTION," * update nb_check"); 1029 1061 log_printf(TRACE,Load_store_unit,FUNCTION," * store_queue_ptr_write : %d",store_queue_ptr_write); 1062 log_printf(TRACE,Load_store_unit,FUNCTION," * store_queue_ptr_read : %d",store_queue_ptr_read ); 1063 log_printf(TRACE,Load_store_unit,FUNCTION," * store_queue_empty : %d",store_queue_empty ); 1030 1064 log_printf(TRACE,Load_store_unit,FUNCTION," * reg_STORE_QUEUE_PTR_READ : %d",reg_STORE_QUEUE_PTR_READ); 1031 1065 1032 1066 uint32_t i=store_queue_ptr_write; 1033 while (i!= reg_STORE_QUEUE_PTR_READ)1067 while (i!=store_queue_ptr_read) 1034 1068 { 1035 1069 i=((i==0)?_param->_size_store_queue:i)-1; … … 1038 1072 1039 1073 reg_STORE_QUEUE_NB_CHECK [i] ++; 1074 1075 log_printf(TRACE,Load_store_unit,FUNCTION," * reg_STORE_QUEUE_NB_CHECK 3 [%d] <- %d", i,reg_STORE_QUEUE_NB_CHECK [i]); 1040 1076 } 1041 1077 } … … 1097 1133 1098 1134 1099 uint32_t i=_load_queue[packet_id]._store_queue_ptr_write; 1100 while (i!=reg_STORE_QUEUE_PTR_READ) 1101 { 1102 i=((i==0)?_param->_size_store_queue:i)-1; 1103 1135 log_printf(TRACE,Load_store_unit,FUNCTION," * store_queue_ptr_write : %d", _load_queue[packet_id]._store_queue_ptr_write); 1136 log_printf(TRACE,Load_store_unit,FUNCTION," * store_queue_ptr_read : %d", _load_queue[packet_id]._store_queue_ptr_read ); 1137 log_printf(TRACE,Load_store_unit,FUNCTION," * store_queue_empty : %d", _load_queue[packet_id]._store_queue_empty ); 1138 1139 if (not _load_queue[packet_id]._store_queue_empty) 1140 { 1141 uint32_t i=_load_queue[packet_id]._store_queue_ptr_write; 1142 1143 while (i!=_load_queue[packet_id]._store_queue_ptr_read) 1144 { 1145 i=((i==0)?_param->_size_store_queue:i)-1; 1146 1104 1147 #ifdef DEBUG 1105 1106 1148 if (reg_STORE_QUEUE_NB_CHECK [i] == 0) 1149 throw ERRORMORPHEO(FUNCTION,_("reg_STORE_QUEUE_NB_CHECK must be > 0\n")); 1107 1150 #endif 1108 1109 reg_STORE_QUEUE_NB_CHECK [i] --; 1110 //i=(i+1)%_param->_size_store_queue; 1111 } 1151 1152 reg_STORE_QUEUE_NB_CHECK [i] --; 1153 1154 log_printf(TRACE,Load_store_unit,FUNCTION," * reg_STORE_QUEUE_NB_CHECK 4 [%d] <- %d", i,reg_STORE_QUEUE_NB_CHECK [i]); 1155 1156 //i=(i+1)%_param->_size_store_queue; 1157 } 1158 _load_queue[packet_id]._store_queue_empty = true; // end of check 1159 1160 } 1112 1161 } 1113 1162 else … … 1150 1199 uint32_t j = (reg_STORE_QUEUE_PTR_READ+i)%_param->_size_store_queue; 1151 1200 1152 log_printf(TRACE,Load_store_unit,FUNCTION," [%.4d] %.4d %.4d %.4d, %.4d, %.4d, %.4d, %.8x %.8x, %.2d , %.2d %s",1201 log_printf(TRACE,Load_store_unit,FUNCTION," [%.4d] %.4d %.4d %.4d, %.4d, %.4d, %.4d, %.8x %.8x, %.2d %.1d, %.2d %s", 1153 1202 j, 1154 1203 _store_queue[j]._context_id , … … 1163 1212 //_store_queue[j]._num_reg_rd , 1164 1213 _store_queue[j]._exception , 1214 _store_queue[j]._send_commit , 1165 1215 reg_STORE_QUEUE_NB_CHECK [j] , 1166 1216 toString(_store_queue[j]._state).c_str()); … … 1174 1224 uint32_t j = (*_speculative_access_queue_control)[i]; 1175 1225 1176 log_printf(TRACE,Load_store_unit,FUNCTION," [%.4d] %.4d %.4d %.4d, %.4d, %.4d, %.4d %.4d , %.8x, %.1d %.4d, %.2d, %s",1226 log_printf(TRACE,Load_store_unit,FUNCTION," [%.4d] %.4d %.4d %.4d, %.4d, %.4d, %.4d %.4d %.4d %.1d, %.8x, %.1d %.4d, %.2d, %s", 1177 1227 j, 1178 1228 _speculative_access_queue[j]._context_id , … … 1183 1233 _speculative_access_queue[j]._load_queue_ptr_write, 1184 1234 _speculative_access_queue[j]._store_queue_ptr_write, 1235 _speculative_access_queue[j]._store_queue_ptr_read , 1236 _speculative_access_queue[j]._store_queue_empty , 1185 1237 _speculative_access_queue[j]._address , 1186 1238 _speculative_access_queue[j]._write_rd , … … 1198 1250 uint32_t j = i; 1199 1251 1200 log_printf(TRACE,Load_store_unit,FUNCTION," [%.4d] %.4d %.4d %.4d, %.4d, %.4d, %.4d , %.8x %.1x %.1d %.2d %.1d %.2d, %.8x, %.1d %.4d, %.2d, %s",1252 log_printf(TRACE,Load_store_unit,FUNCTION," [%.4d] %.4d %.4d %.4d, %.4d, %.4d, %.4d %.4d %.1d, %.8x %.1x %.1d %.2d %.1d %.2d, %.8x, %.1d %.4d, %.2d, %s", 1201 1253 j, 1202 1254 _load_queue[j]._context_id , … … 1206 1258 _load_queue[j]._operation , 1207 1259 _load_queue[j]._store_queue_ptr_write, 1260 _load_queue[j]._store_queue_ptr_read , 1261 _load_queue[j]._store_queue_empty , 1208 1262 _load_queue[j]._address , 1209 1263 _load_queue[j]._check_hit_byte , -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Execute_loop/Execute_loop/Multi_Read_unit/Read_unit/Read_queue/include/Read_queue.h
r88 r122 73 73 public : SC_IN (Ttype_t ) * in_READ_QUEUE_IN_TYPE ; 74 74 public : SC_IN (Tlsq_ptr_t ) * in_READ_QUEUE_IN_STORE_QUEUE_PTR_WRITE; 75 public : SC_IN (Tlsq_ptr_t ) * in_READ_QUEUE_IN_STORE_QUEUE_PTR_READ ; 76 public : SC_IN (Tcontrol_t ) * in_READ_QUEUE_IN_STORE_QUEUE_EMPTY ; 75 77 public : SC_IN (Tlsq_ptr_t ) * in_READ_QUEUE_IN_LOAD_QUEUE_PTR_WRITE ; 76 78 public : SC_IN (Tcontrol_t ) * in_READ_QUEUE_IN_HAS_IMMEDIAT ; … … 98 100 public : SC_OUT(Ttype_t ) * out_READ_QUEUE_OUT_TYPE ; 99 101 public : SC_OUT(Tlsq_ptr_t ) * out_READ_QUEUE_OUT_STORE_QUEUE_PTR_WRITE; 102 public : SC_OUT(Tlsq_ptr_t ) * out_READ_QUEUE_OUT_STORE_QUEUE_PTR_READ ; 103 public : SC_OUT(Tcontrol_t ) * out_READ_QUEUE_OUT_STORE_QUEUE_EMPTY ; 100 104 public : SC_OUT(Tlsq_ptr_t ) * out_READ_QUEUE_OUT_LOAD_QUEUE_PTR_WRITE ; 101 105 public : SC_OUT(Tcontrol_t ) * out_READ_QUEUE_OUT_HAS_IMMEDIAT ; -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Execute_loop/Execute_loop/Multi_Read_unit/Read_unit/Read_queue/include/Types.h
r117 r122 29 29 public : Ttype_t _type ; 30 30 public : Tlsq_ptr_t _store_queue_ptr_write; 31 public : Tlsq_ptr_t _store_queue_ptr_read ; 32 public : Tcontrol_t _store_queue_empty ; 31 33 public : Tlsq_ptr_t _load_queue_ptr_write; 32 34 public : Tcontrol_t _has_immediat ; … … 53 55 << " * _type : " << toString(x._type ) << std::endl 54 56 << " * _store_queue_ptr_write : " << toString(x._store_queue_ptr_write) << std::endl 57 << " * _store_queue_ptr_read : " << toString(x._store_queue_ptr_read ) << std::endl 58 << " * _store_queue_empty : " << toString(x._store_queue_empty ) << std::endl 55 59 << " * _load_queue_ptr_write : " << toString(x._load_queue_ptr_write ) << std::endl 56 60 << " * _has_immediat : " << toString(x._has_immediat ) << std::endl … … 81 85 public : Ttype_t _type ; 82 86 public : Tlsq_ptr_t _store_queue_ptr_write; 87 public : Tlsq_ptr_t _store_queue_ptr_read ; 88 public : Tcontrol_t _store_queue_empty ; 83 89 public : Tlsq_ptr_t _load_queue_ptr_write; 84 90 public : Tcontrol_t _has_immediat ; … … 117 123 _type = x._type ; 118 124 _store_queue_ptr_write = x._store_queue_ptr_write; 125 _store_queue_ptr_read = x._store_queue_ptr_read ; 126 _store_queue_empty = x._store_queue_empty ; 119 127 _load_queue_ptr_write = x._load_queue_ptr_write ; 120 128 _has_immediat = x._has_immediat ; … … 157 165 << " * _type : " << x._type << std::endl 158 166 << " * _store_queue_ptr_write : " << toString(x._store_queue_ptr_write) << std::endl 167 << " * _store_queue_ptr_read : " << toString(x._store_queue_ptr_read ) << std::endl 168 << " * _store_queue_empty : " << toString(x._store_queue_empty ) << std::endl 159 169 << " * _load_queue_ptr_write : " << toString(x._load_queue_ptr_write ) << std::endl 160 170 << " * _has_immediat : " << x._has_immediat << std::endl -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Execute_loop/Execute_loop/Multi_Read_unit/Read_unit/Read_queue/src/Read_queue_allocation.cpp
r112 r122 62 62 ALLOC0_SIGNAL_IN ( in_READ_QUEUE_IN_TYPE ,"type" ,Ttype_t ,_param->_size_type ); 63 63 ALLOC0_SIGNAL_IN ( in_READ_QUEUE_IN_STORE_QUEUE_PTR_WRITE,"store_queue_ptr_write",Tlsq_ptr_t ,_param->_size_store_queue_ptr); 64 ALLOC0_SIGNAL_IN ( in_READ_QUEUE_IN_STORE_QUEUE_PTR_READ ,"store_queue_ptr_read" ,Tlsq_ptr_t ,_param->_size_store_queue_ptr); 65 ALLOC0_SIGNAL_IN ( in_READ_QUEUE_IN_STORE_QUEUE_EMPTY ,"store_queue_empty" ,Tcontrol_t ,1); 64 66 ALLOC0_SIGNAL_IN ( in_READ_QUEUE_IN_LOAD_QUEUE_PTR_WRITE ,"load_queue_ptr_write" ,Tlsq_ptr_t ,_param->_size_load_queue_ptr); 65 67 ALLOC0_SIGNAL_IN ( in_READ_QUEUE_IN_HAS_IMMEDIAT ,"has_immediat" ,Tcontrol_t ,1 ); … … 92 94 ALLOC0_SIGNAL_OUT(out_READ_QUEUE_OUT_TYPE ,"type" ,Ttype_t ,_param->_size_type ); 93 95 ALLOC0_SIGNAL_OUT(out_READ_QUEUE_OUT_STORE_QUEUE_PTR_WRITE ,"store_queue_ptr_write",Tlsq_ptr_t , _param->_size_store_queue_ptr ); 96 ALLOC0_SIGNAL_OUT(out_READ_QUEUE_OUT_STORE_QUEUE_PTR_READ ,"store_queue_ptr_read" ,Tlsq_ptr_t , _param->_size_store_queue_ptr ); 97 ALLOC0_SIGNAL_OUT(out_READ_QUEUE_OUT_STORE_QUEUE_EMPTY ,"store_queue_empty" ,Tcontrol_t ,1 ); 94 98 ALLOC0_SIGNAL_OUT(out_READ_QUEUE_OUT_LOAD_QUEUE_PTR_WRITE ,"load_queue_ptr_write" ,Tlsq_ptr_t , _param->_size_load_queue_ptr ); 95 99 ALLOC0_SIGNAL_OUT(out_READ_QUEUE_OUT_HAS_IMMEDIAT ,"has_immediat" ,Tcontrol_t ,1 ); -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Execute_loop/Execute_loop/Multi_Read_unit/Read_unit/Read_queue/src/Read_queue_deallocation.cpp
r112 r122 38 38 DELETE0_SIGNAL( in_READ_QUEUE_IN_TYPE ,_param->_size_type ); 39 39 DELETE0_SIGNAL( in_READ_QUEUE_IN_STORE_QUEUE_PTR_WRITE ,_param->_size_store_queue_ptr ); 40 DELETE0_SIGNAL( in_READ_QUEUE_IN_STORE_QUEUE_PTR_READ ,_param->_size_store_queue_ptr ); 41 DELETE0_SIGNAL( in_READ_QUEUE_IN_STORE_QUEUE_EMPTY ,1 ); 40 42 DELETE0_SIGNAL( in_READ_QUEUE_IN_LOAD_QUEUE_PTR_WRITE ,_param->_size_load_queue_ptr ); 41 43 DELETE0_SIGNAL( in_READ_QUEUE_IN_HAS_IMMEDIAT ,1 ); -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Execute_loop/Execute_loop/Multi_Read_unit/Read_unit/Read_queue/src/Read_queue_genMoore.cpp
r111 r122 45 45 PORT_WRITE (out_READ_QUEUE_OUT_TYPE , _queue_head->_type ); 46 46 PORT_WRITE (out_READ_QUEUE_OUT_STORE_QUEUE_PTR_WRITE, _queue_head->_store_queue_ptr_write); 47 PORT_WRITE (out_READ_QUEUE_OUT_STORE_QUEUE_PTR_READ , _queue_head->_store_queue_ptr_read ); 48 PORT_WRITE (out_READ_QUEUE_OUT_STORE_QUEUE_EMPTY , _queue_head->_store_queue_empty ); 47 49 if (_param->_have_port_load_queue_ptr) 48 50 PORT_WRITE (out_READ_QUEUE_OUT_LOAD_QUEUE_PTR_WRITE , _queue_head->_load_queue_ptr_write ); -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Execute_loop/Execute_loop/Multi_Read_unit/Read_unit/Read_queue/src/Read_queue_transition.cpp
r117 r122 75 75 entry->_type = PORT_READ(in_READ_QUEUE_IN_TYPE ); 76 76 entry->_store_queue_ptr_write = PORT_READ(in_READ_QUEUE_IN_STORE_QUEUE_PTR_WRITE); 77 entry->_store_queue_ptr_read = PORT_READ(in_READ_QUEUE_IN_STORE_QUEUE_PTR_READ ); 78 entry->_store_queue_empty = PORT_READ(in_READ_QUEUE_IN_STORE_QUEUE_EMPTY ); 77 79 if (_param->_have_port_load_queue_ptr) 78 80 entry->_load_queue_ptr_write = PORT_READ(in_READ_QUEUE_IN_LOAD_QUEUE_PTR_WRITE ); … … 151 153 if (_queue->size()>0) 152 154 { 153 log_printf(TRACE,Read_queue,FUNCTION," * [%.4d] %.2d %.2d %.2d %.4d, %.2d %.3d, %.2d %.2d , %.1d %.8x, %.1d %.1d %.4d %.1d %.8x, %.1d %.1d %.4d %.1d %.8x, %.1d %.1d %.4d %.1d %.2x, %.1d %.4d, %.1d %.4d (%s)",155 log_printf(TRACE,Read_queue,FUNCTION," * [%.4d] %.2d %.2d %.2d %.4d, %.2d %.3d, %.2d %.2d %.1d %.2d, %.1d %.8x, %.1d %.1d %.4d %.1d %.8x, %.1d %.1d %.4d %.1d %.8x, %.1d %.1d %.4d %.1d %.2x, %.1d %.4d, %.1d %.4d (%s)", 154 156 0, 155 157 … … 163 165 164 166 _queue_head->_store_queue_ptr_write, 167 _queue_head->_store_queue_ptr_read , 168 _queue_head->_store_queue_empty , 165 169 _queue_head->_load_queue_ptr_write , 166 170 … … 201 205 for (;it!=_queue->end(); ++it) 202 206 { 203 log_printf(TRACE,Read_queue,FUNCTION," * [%.4d] %.2d %.2d %.2d %.4d, %.2d %.3d, %.2d %.2d , %.1d %.8x, %.1d %.4d , %.1d %.4d , %.1d %.4d , %.1d %.4d, %.1d %.4d (%s)",207 log_printf(TRACE,Read_queue,FUNCTION," * [%.4d] %.2d %.2d %.2d %.4d, %.2d %.3d, %.2d %.2d %.1d %.2d, %.1d %.8x, %.1d %.4d , %.1d %.4d , %.1d %.4d , %.1d %.4d, %.1d %.4d (%s)", 204 208 i, 205 209 … … 213 217 214 218 (*it)->_store_queue_ptr_write, 219 (*it)->_store_queue_ptr_read , 220 (*it)->_store_queue_empty , 215 221 (*it)->_load_queue_ptr_write , 216 222 -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Execute_loop/Execute_loop/Multi_Read_unit/Read_unit/Reservation_station/include/Reservation_station.h
r82 r122 74 74 public : SC_IN (Ttype_t ) * in_INSERT_TYPE ; 75 75 public : SC_IN (Tlsq_ptr_t ) * in_INSERT_STORE_QUEUE_PTR_WRITE; 76 public : SC_IN (Tlsq_ptr_t ) * in_INSERT_STORE_QUEUE_PTR_READ ; 77 public : SC_IN (Tcontrol_t ) * in_INSERT_STORE_QUEUE_EMPTY ; 76 78 public : SC_IN (Tlsq_ptr_t ) * in_INSERT_LOAD_QUEUE_PTR_WRITE ; 77 79 public : SC_IN (Tcontrol_t ) * in_INSERT_HAS_IMMEDIAT ; … … 104 106 public : SC_OUT(Ttype_t ) ** out_RETIRE_TYPE ; 105 107 public : SC_OUT(Tlsq_ptr_t ) ** out_RETIRE_STORE_QUEUE_PTR_WRITE; 108 public : SC_OUT(Tlsq_ptr_t ) ** out_RETIRE_STORE_QUEUE_PTR_READ ; 109 public : SC_OUT(Tcontrol_t ) ** out_RETIRE_STORE_QUEUE_EMPTY ; 106 110 public : SC_OUT(Tlsq_ptr_t ) ** out_RETIRE_LOAD_QUEUE_PTR_WRITE ; 107 111 public : SC_OUT(Tcontrol_t ) ** out_RETIRE_HAS_IMMEDIAT ; -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Execute_loop/Execute_loop/Multi_Read_unit/Read_unit/Reservation_station/include/Types.h
r82 r122 29 29 public : Ttype_t _type ; 30 30 public : Tlsq_ptr_t _store_queue_ptr_write; 31 public : Tlsq_ptr_t _store_queue_ptr_read ; 32 public : Tcontrol_t _store_queue_empty ; 31 33 public : Tlsq_ptr_t _load_queue_ptr_write ; 32 34 public : Tcontrol_t _has_immediat; … … 59 61 << " * _type : " << toString(x._type ) << std::endl 60 62 << " * _store_queue_ptr_write : " << toString(x._store_queue_ptr_write) << std::endl 63 << " * _store_queue_ptr_read : " << toString(x._store_queue_ptr_read ) << std::endl 64 << " * _store_queue_empty : " << toString(x._store_queue_empty ) << std::endl 61 65 << " * _load_queue_ptr_write : " << toString(x._load_queue_ptr_write ) << std::endl 62 66 << " * _has_immediat : " << toString(x._has_immediat ) << std::endl -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Execute_loop/Execute_loop/Multi_Read_unit/Read_unit/Reservation_station/src/Reservation_station_allocation.cpp
r112 r122 64 64 ALLOC0_SIGNAL_IN ( in_INSERT_TYPE ,"type" ,Ttype_t ,_param->_size_type ); 65 65 ALLOC0_SIGNAL_IN ( in_INSERT_STORE_QUEUE_PTR_WRITE,"store_queue_ptr_write",Tlsq_ptr_t ,_param->_size_store_queue_ptr ); 66 ALLOC0_SIGNAL_IN ( in_INSERT_STORE_QUEUE_PTR_READ ,"store_queue_ptr_read" ,Tlsq_ptr_t ,_param->_size_store_queue_ptr ); 67 ALLOC0_SIGNAL_IN ( in_INSERT_STORE_QUEUE_EMPTY ,"store_queue_empty" ,Tcontrol_t ,1 ); 66 68 ALLOC0_SIGNAL_IN ( in_INSERT_LOAD_QUEUE_PTR_WRITE ,"load_queue_ptr_write" ,Tlsq_ptr_t ,_param->_size_load_queue_ptr ); 67 69 ALLOC0_SIGNAL_IN ( in_INSERT_HAS_IMMEDIAT ,"has_immediat" ,Tcontrol_t ,1 ); … … 100 102 ALLOC1_SIGNAL_OUT(out_RETIRE_TYPE ,"type" ,Ttype_t ,_param->_size_type); 101 103 ALLOC1_SIGNAL_OUT(out_RETIRE_STORE_QUEUE_PTR_WRITE,"store_queue_ptr_write",Tlsq_ptr_t ,_param->_size_store_queue_ptr); 104 ALLOC1_SIGNAL_OUT(out_RETIRE_STORE_QUEUE_PTR_READ ,"store_queue_ptr_read" ,Tlsq_ptr_t ,_param->_size_store_queue_ptr); 105 ALLOC1_SIGNAL_OUT(out_RETIRE_STORE_QUEUE_EMPTY ,"store_queue_empty" ,Tcontrol_t ,1); 102 106 ALLOC1_SIGNAL_OUT(out_RETIRE_LOAD_QUEUE_PTR_WRITE ,"load_queue_ptr_write" ,Tlsq_ptr_t ,_param->_size_load_queue_ptr ); 103 107 ALLOC1_SIGNAL_OUT(out_RETIRE_HAS_IMMEDIAT ,"has_immediat" ,Tcontrol_t ,1); -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Execute_loop/Execute_loop/Multi_Read_unit/Read_unit/Reservation_station/src/Reservation_station_deallocation.cpp
r112 r122 43 43 DELETE0_SIGNAL( in_INSERT_TYPE ,_param->_size_type ); 44 44 DELETE0_SIGNAL( in_INSERT_STORE_QUEUE_PTR_WRITE,_param->_size_store_queue_ptr ); 45 DELETE0_SIGNAL( in_INSERT_STORE_QUEUE_PTR_READ ,_param->_size_store_queue_ptr ); 46 DELETE0_SIGNAL( in_INSERT_STORE_QUEUE_EMPTY ,1); 45 47 DELETE0_SIGNAL( in_INSERT_LOAD_QUEUE_PTR_WRITE ,_param->_size_load_queue_ptr ); 46 48 DELETE0_SIGNAL( in_INSERT_HAS_IMMEDIAT ,1 ); … … 72 74 DELETE1_SIGNAL(out_RETIRE_TYPE ,_param->_nb_inst_retire,_param->_size_type); 73 75 DELETE1_SIGNAL(out_RETIRE_STORE_QUEUE_PTR_WRITE,_param->_nb_inst_retire,_param->_size_store_queue_ptr); 76 DELETE1_SIGNAL(out_RETIRE_STORE_QUEUE_PTR_READ ,_param->_nb_inst_retire,_param->_size_store_queue_ptr); 77 DELETE1_SIGNAL(out_RETIRE_STORE_QUEUE_EMPTY ,_param->_nb_inst_retire,1); 74 78 DELETE1_SIGNAL(out_RETIRE_LOAD_QUEUE_PTR_WRITE ,_param->_nb_inst_retire,_param->_size_load_queue_ptr ); 75 79 DELETE1_SIGNAL(out_RETIRE_HAS_IMMEDIAT ,_param->_nb_inst_retire,1); -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Execute_loop/Execute_loop/Multi_Read_unit/Read_unit/Reservation_station/src/Reservation_station_genMoore.cpp
r110 r122 113 113 PORT_WRITE(out_RETIRE_TYPE [i],_queue[index_find]._type); 114 114 PORT_WRITE(out_RETIRE_STORE_QUEUE_PTR_WRITE [i],_queue[index_find]._store_queue_ptr_write); 115 PORT_WRITE(out_RETIRE_STORE_QUEUE_PTR_READ [i],_queue[index_find]._store_queue_ptr_read ); 116 PORT_WRITE(out_RETIRE_STORE_QUEUE_EMPTY [i],_queue[index_find]._store_queue_empty ); 115 117 if (_param->_have_port_load_queue_ptr) 116 118 PORT_WRITE(out_RETIRE_LOAD_QUEUE_PTR_WRITE [i],_queue[index_find]._load_queue_ptr_write ); -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Execute_loop/Execute_loop/Multi_Read_unit/Read_unit/Reservation_station/src/Reservation_station_transition.cpp
r118 r122 26 26 for (uint32_t it_dump=0;it_dump<_param->_size_queue; it_dump++) \ 27 27 if (_queue_valid [it_dump]) \ 28 log_printf(TRACE,Reservation_station,FUNCTION," * [%.4d] %.2d %.2d %.2d %.4d, %.2d %.3d, %.2d %.2d , %.1d %.8x, %.4d %.1d %.8x, %.4d %.1d %.8x, %.4d %.1d %.2x, %.1d %.4d, %.1d %.4d (%s)", \28 log_printf(TRACE,Reservation_station,FUNCTION," * [%.4d] %.2d %.2d %.2d %.4d, %.2d %.3d, %.2d %.2d %.1d %.2d, %.1d %.8x, %.4d %.1d %.8x, %.4d %.1d %.8x, %.4d %.1d %.2x, %.1d %.4d, %.1d %.4d (%s)", \ 29 29 it_dump, \ 30 30 _queue[it_dump]._context_id , \ … … 35 35 _queue[it_dump]._operation , \ 36 36 _queue[it_dump]._store_queue_ptr_write, \ 37 _queue[it_dump]._store_queue_ptr_read , \ 38 _queue[it_dump]._store_queue_empty , \ 37 39 _queue[it_dump]._load_queue_ptr_write , \ 38 40 _queue[it_dump]._has_immediat , \ … … 61 63 for (uint32_t it_dump=0;it_dump<_param->_size_queue; it_dump++) \ 62 64 if (it_dump < _queue_control->nb_elt()) \ 63 log_printf(TRACE,Reservation_station,FUNCTION," * [%.4d] %.2d %.2d %.2d %.4d, %.2d %.3d, %.2d %.2d , %.1d %.8x, %.4d %.1d %.8x, %.4d %.1d %.8x, %.4d %.1d %.2x, %.1d %.4d, %.1d %.4d (%s)", \65 log_printf(TRACE,Reservation_station,FUNCTION," * [%.4d] %.2d %.2d %.2d %.4d, %.2d %.3d, %.2d %.2d %.1d %.2d, %.1d %.8x, %.4d %.1d %.8x, %.4d %.1d %.8x, %.4d %.1d %.2x, %.1d %.4d, %.1d %.4d (%s)", \ 64 66 (*_queue_control)[it_dump], \ 65 67 _queue[(*_queue_control)[it_dump]]._context_id , \ … … 70 72 _queue[(*_queue_control)[it_dump]]._operation , \ 71 73 _queue[(*_queue_control)[it_dump]]._store_queue_ptr_write, \ 74 _queue[(*_queue_control)[it_dump]]._store_queue_ptr_read , \ 75 _queue[(*_queue_control)[it_dump]]._store_queue_empty , \ 72 76 _queue[(*_queue_control)[it_dump]]._load_queue_ptr_write , \ 73 77 _queue[(*_queue_control)[it_dump]]._has_immediat , \ … … 292 296 _queue[index]._type = PORT_READ(in_INSERT_TYPE ); 293 297 _queue[index]._store_queue_ptr_write = PORT_READ(in_INSERT_STORE_QUEUE_PTR_WRITE); 298 _queue[index]._store_queue_ptr_read = PORT_READ(in_INSERT_STORE_QUEUE_PTR_READ ); 299 _queue[index]._store_queue_empty = PORT_READ(in_INSERT_STORE_QUEUE_EMPTY ); 294 300 if (_param->_have_port_load_queue_ptr) 295 301 _queue[index]._load_queue_ptr_write = PORT_READ(in_INSERT_LOAD_QUEUE_PTR_WRITE ); -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Execute_loop/Execute_loop/Multi_Read_unit/Read_unit/include/Read_unit.h
r82 r122 74 74 public : SC_IN (Ttype_t ) * in_READ_UNIT_IN_TYPE ; 75 75 public : SC_IN (Tlsq_ptr_t ) * in_READ_UNIT_IN_STORE_QUEUE_PTR_WRITE; 76 public : SC_IN (Tlsq_ptr_t ) * in_READ_UNIT_IN_STORE_QUEUE_PTR_READ ; 77 public : SC_IN (Tcontrol_t ) * in_READ_UNIT_IN_STORE_QUEUE_EMPTY ; 76 78 public : SC_IN (Tlsq_ptr_t ) * in_READ_UNIT_IN_LOAD_QUEUE_PTR_WRITE ; 77 79 public : SC_IN (Tcontrol_t ) * in_READ_UNIT_IN_HAS_IMMEDIAT ; … … 98 100 public : SC_OUT(Ttype_t ) ** out_READ_UNIT_OUT_TYPE ; 99 101 public : SC_OUT(Tlsq_ptr_t ) ** out_READ_UNIT_OUT_STORE_QUEUE_PTR_WRITE; 102 public : SC_OUT(Tlsq_ptr_t ) ** out_READ_UNIT_OUT_STORE_QUEUE_PTR_READ ; 103 public : SC_OUT(Tcontrol_t ) ** out_READ_UNIT_OUT_STORE_QUEUE_EMPTY ; 100 104 public : SC_OUT(Tlsq_ptr_t ) ** out_READ_UNIT_OUT_LOAD_QUEUE_PTR_WRITE ; 101 105 public : SC_OUT(Tcontrol_t ) ** out_READ_UNIT_OUT_HAS_IMMEDIAT ; -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Execute_loop/Execute_loop/Multi_Read_unit/Read_unit/src/Read_unit_allocation.cpp
r112 r122 68 68 ALLOC0_SIGNAL_IN ( in_READ_UNIT_IN_TYPE ,"type" ,Ttype_t ,_param->_size_type ); 69 69 ALLOC0_SIGNAL_IN ( in_READ_UNIT_IN_STORE_QUEUE_PTR_WRITE,"store_queue_ptr_write",Tlsq_ptr_t ,_param->_size_store_queue_ptr); 70 ALLOC0_SIGNAL_IN ( in_READ_UNIT_IN_STORE_QUEUE_PTR_READ ,"store_queue_ptr_read" ,Tlsq_ptr_t ,_param->_size_store_queue_ptr); 71 ALLOC0_SIGNAL_IN ( in_READ_UNIT_IN_STORE_QUEUE_EMPTY ,"store_queue_empty" ,Tcontrol_t ,1); 70 72 ALLOC0_SIGNAL_IN ( in_READ_UNIT_IN_LOAD_QUEUE_PTR_WRITE ,"load_queue_ptr_write" ,Tlsq_ptr_t ,_param->_size_load_queue_ptr); 71 73 ALLOC0_SIGNAL_IN ( in_READ_UNIT_IN_HAS_IMMEDIAT ,"has_immediat" ,Tcontrol_t ,1); … … 98 100 ALLOC1_SIGNAL_OUT(out_READ_UNIT_OUT_TYPE ,"type" ,Ttype_t ,_param->_size_type ); 99 101 ALLOC1_SIGNAL_OUT(out_READ_UNIT_OUT_STORE_QUEUE_PTR_WRITE,"store_queue_ptr_write",Tlsq_ptr_t ,_param->_size_store_queue_ptr); 102 ALLOC1_SIGNAL_OUT(out_READ_UNIT_OUT_STORE_QUEUE_PTR_READ ,"store_queue_ptr_read" ,Tlsq_ptr_t ,_param->_size_store_queue_ptr); 103 ALLOC1_SIGNAL_OUT(out_READ_UNIT_OUT_STORE_QUEUE_EMPTY ,"store_queue_empty" ,Tcontrol_t ,1); 100 104 ALLOC1_SIGNAL_OUT(out_READ_UNIT_OUT_LOAD_QUEUE_PTR_WRITE ,"load_queue_ptr_write" ,Tlsq_ptr_t ,_param->_size_load_queue_ptr); 101 105 ALLOC1_SIGNAL_OUT(out_READ_UNIT_OUT_HAS_IMMEDIAT ,"has_immediat" ,Tcontrol_t ,1 ); … … 268 272 _component->port_map(name, "in_READ_QUEUE_IN_TYPE" ,dest, "in_READ_UNIT_IN_TYPE" ); 269 273 _component->port_map(name, "in_READ_QUEUE_IN_STORE_QUEUE_PTR_WRITE",dest, "in_READ_UNIT_IN_STORE_QUEUE_PTR_WRITE"); 274 _component->port_map(name, "in_READ_QUEUE_IN_STORE_QUEUE_PTR_READ" ,dest, "in_READ_UNIT_IN_STORE_QUEUE_PTR_READ" ); 275 _component->port_map(name, "in_READ_QUEUE_IN_STORE_QUEUE_EMPTY" ,dest, "in_READ_UNIT_IN_STORE_QUEUE_EMPTY" ); 270 276 if (_param->_have_port_load_queue_ptr) 271 277 _component->port_map(name, "in_READ_QUEUE_IN_LOAD_QUEUE_PTR_WRITE" ,dest, "in_READ_UNIT_IN_LOAD_QUEUE_PTR_WRITE" ); … … 305 311 _component->port_map(name,"out_READ_QUEUE_OUT_TYPE" ,dest, "in_INSERT_TYPE" ); 306 312 _component->port_map(name,"out_READ_QUEUE_OUT_STORE_QUEUE_PTR_WRITE",dest, "in_INSERT_STORE_QUEUE_PTR_WRITE"); 313 _component->port_map(name,"out_READ_QUEUE_OUT_STORE_QUEUE_PTR_READ" ,dest, "in_INSERT_STORE_QUEUE_PTR_READ" ); 314 _component->port_map(name,"out_READ_QUEUE_OUT_STORE_QUEUE_EMPTY" ,dest, "in_INSERT_STORE_QUEUE_EMPTY" ); 307 315 if (_param->_have_port_load_queue_ptr) 308 316 _component->port_map(name,"out_READ_QUEUE_OUT_LOAD_QUEUE_PTR_WRITE" ,dest, "in_INSERT_LOAD_QUEUE_PTR_WRITE" ); … … 429 437 _component->port_map(name, "in_INSERT_TYPE" ,dest,"out_READ_QUEUE_OUT_TYPE" ); 430 438 _component->port_map(name, "in_INSERT_STORE_QUEUE_PTR_WRITE",dest,"out_READ_QUEUE_OUT_STORE_QUEUE_PTR_WRITE"); 439 _component->port_map(name, "in_INSERT_STORE_QUEUE_PTR_READ" ,dest,"out_READ_QUEUE_OUT_STORE_QUEUE_PTR_READ" ); 440 _component->port_map(name, "in_INSERT_STORE_QUEUE_EMPTY" ,dest,"out_READ_QUEUE_OUT_STORE_QUEUE_EMPTY" ); 431 441 if (_param->_have_port_load_queue_ptr) 432 442 _component->port_map(name, "in_INSERT_LOAD_QUEUE_PTR_WRITE" ,dest,"out_READ_QUEUE_OUT_LOAD_QUEUE_PTR_WRITE" ); … … 474 484 _component->port_map(name,"out_RETIRE_"+toString(i)+"_TYPE" ,dest,"out_READ_UNIT_OUT_"+toString(i)+"_TYPE" ); 475 485 _component->port_map(name,"out_RETIRE_"+toString(i)+"_STORE_QUEUE_PTR_WRITE",dest,"out_READ_UNIT_OUT_"+toString(i)+"_STORE_QUEUE_PTR_WRITE"); 486 _component->port_map(name,"out_RETIRE_"+toString(i)+"_STORE_QUEUE_PTR_READ" ,dest,"out_READ_UNIT_OUT_"+toString(i)+"_STORE_QUEUE_PTR_READ" ); 487 _component->port_map(name,"out_RETIRE_"+toString(i)+"_STORE_QUEUE_EMPTY" ,dest,"out_READ_UNIT_OUT_"+toString(i)+"_STORE_QUEUE_EMPTY" ); 476 488 if (_param->_have_port_load_queue_ptr) 477 489 _component->port_map(name,"out_RETIRE_"+toString(i)+"_LOAD_QUEUE_PTR_WRITE" ,dest,"out_READ_UNIT_OUT_"+toString(i)+"_LOAD_QUEUE_PTR_WRITE" ); -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Execute_loop/Execute_loop/Network/Read_unit_to_Execution_unit/include/Read_unit_to_Execution_unit.h
r88 r122 85 85 public : SC_IN (Ttype_t ) *** in_READ_UNIT_OUT_TYPE ;//[nb_read_unit][nb_read_unit_port] 86 86 public : SC_IN (Tlsq_ptr_t ) *** in_READ_UNIT_OUT_STORE_QUEUE_PTR_WRITE ;//[nb_read_unit][nb_read_unit_port] 87 public : SC_IN (Tlsq_ptr_t ) *** in_READ_UNIT_OUT_STORE_QUEUE_PTR_READ ;//[nb_read_unit][nb_read_unit_port] 88 public : SC_IN (Tcontrol_t ) *** in_READ_UNIT_OUT_STORE_QUEUE_EMPTY ;//[nb_read_unit][nb_read_unit_port] 87 89 public : SC_IN (Tlsq_ptr_t ) *** in_READ_UNIT_OUT_LOAD_QUEUE_PTR_WRITE ;//[nb_read_unit][nb_read_unit_port] 88 90 public : SC_IN (Tcontrol_t ) *** in_READ_UNIT_OUT_HAS_IMMEDIAT ;//[nb_read_unit][nb_read_unit_port] … … 106 108 public : SC_OUT(Ttype_t ) *** out_EXECUTE_UNIT_IN_TYPE ;//[nb_execute_unit][nb_execute_unit_port] 107 109 public : SC_OUT(Tlsq_ptr_t ) *** out_EXECUTE_UNIT_IN_STORE_QUEUE_PTR_WRITE;//[nb_execute_unit][nb_execute_unit_port] 110 public : SC_OUT(Tlsq_ptr_t ) *** out_EXECUTE_UNIT_IN_STORE_QUEUE_PTR_READ ;//[nb_execute_unit][nb_execute_unit_port] 111 public : SC_OUT(Tcontrol_t ) *** out_EXECUTE_UNIT_IN_STORE_QUEUE_EMPTY ;//[nb_execute_unit][nb_execute_unit_port] 108 112 public : SC_OUT(Tlsq_ptr_t ) *** out_EXECUTE_UNIT_IN_LOAD_QUEUE_PTR_WRITE ;//[nb_execute_unit][nb_execute_unit_port] 109 113 public : SC_OUT(Tcontrol_t ) *** out_EXECUTE_UNIT_IN_HAS_IMMEDIAT ;//[nb_execute_unit][nb_execute_unit_port] -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Execute_loop/Execute_loop/Network/Read_unit_to_Execution_unit/src/Parameters.cpp
r120 r122 59 59 _num_thread_valid = num_thread_valid ; 60 60 61 _nb_thread = get_nb_thread (nb_context, nb_front_end, nb_ooo_engine); 62 61 63 log_printf(TRACE,Read_unit_to_Execution_unit,FUNCTION," * table_routing [nb_read_unit][nb_execute_unit][nb_execute_unit_port]"); 62 64 for (uint32_t i=0; i<_nb_read_unit; ++i) … … 81 83 _max_nb_execute_unit_port= max<uint32_t>(_nb_execute_unit_port, _nb_execute_unit); 82 84 83 _nb_thread = get_nb_thread (nb_context, nb_front_end, nb_ooo_engine);84 85 _nb_load_store_unit = 0; 85 86 -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Execute_loop/Execute_loop/Network/Read_unit_to_Execution_unit/src/Parameters_msg_error.cpp
r120 r122 66 66 if (not is_type_valid(j)) 67 67 for (uint32_t i=0; i<_nb_thread; i++) 68 if (_num_thread_valid [ j] and68 if (_num_thread_valid [i] and 69 69 (type_present [i][j])) 70 70 test.error(toString(_("The thread '%d' can execute the type's operation '%s' but this type is invalid.\n"),i,toString(j).c_str())); -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Execute_loop/Execute_loop/Network/Read_unit_to_Execution_unit/src/Read_unit_to_Execution_unit_allocation.cpp
r115 r122 68 68 _ALLOC2_SIGNAL_IN ( in_READ_UNIT_OUT_TYPE ,"TYPE" ,Ttype_t ,_param->_size_type ,_param->_nb_read_unit,_param->_nb_read_unit_port[it1]); 69 69 _ALLOC2_SIGNAL_IN ( in_READ_UNIT_OUT_STORE_QUEUE_PTR_WRITE,"STORE_QUEUE_PTR_WRITE",Tlsq_ptr_t ,_param->_size_store_queue_ptr ,_param->_nb_read_unit,_param->_nb_read_unit_port[it1]); 70 _ALLOC2_SIGNAL_IN ( in_READ_UNIT_OUT_STORE_QUEUE_PTR_READ ,"STORE_QUEUE_PTR_READ" ,Tlsq_ptr_t ,_param->_size_store_queue_ptr ,_param->_nb_read_unit,_param->_nb_read_unit_port[it1]); 71 _ALLOC2_SIGNAL_IN ( in_READ_UNIT_OUT_STORE_QUEUE_EMPTY ,"STORE_QUEUE_EMPTY" ,Tcontrol_t ,1 ,_param->_nb_read_unit,_param->_nb_read_unit_port[it1]); 70 72 _ALLOC2_SIGNAL_IN ( in_READ_UNIT_OUT_LOAD_QUEUE_PTR_WRITE ,"LOAD_QUEUE_PTR_WRITE" ,Tlsq_ptr_t ,_param->_size_load_queue_ptr ,_param->_nb_read_unit,_param->_nb_read_unit_port[it1]); 71 73 _ALLOC2_SIGNAL_IN ( in_READ_UNIT_OUT_HAS_IMMEDIAT ,"HAS_IMMEDIAT" ,Tcontrol_t ,1 ,_param->_nb_read_unit,_param->_nb_read_unit_port[it1]); … … 99 101 _ALLOC2_SIGNAL_OUT(out_EXECUTE_UNIT_IN_NUM_REG_RE ,"NUM_REG_RE" ,Tspecial_address_t,_param->_size_special_register , _param->_nb_execute_unit, _param->_nb_execute_unit_port [it1]); 100 102 _ALLOC2_SIGNAL_OUT(out_EXECUTE_UNIT_IN_STORE_QUEUE_PTR_WRITE,"STORE_QUEUE_PTR_WRITE",Tlsq_ptr_t ,_param->_size_store_queue_ptr , _param->_nb_execute_unit, _param->_nb_execute_unit_port [it1]); 103 _ALLOC2_SIGNAL_OUT(out_EXECUTE_UNIT_IN_STORE_QUEUE_PTR_READ ,"STORE_QUEUE_PTR_READ" ,Tlsq_ptr_t ,_param->_size_store_queue_ptr , _param->_nb_execute_unit, _param->_nb_execute_unit_port [it1]); 104 _ALLOC2_SIGNAL_OUT(out_EXECUTE_UNIT_IN_STORE_QUEUE_EMPTY ,"STORE_QUEUE_EMPTY" ,Tcontrol_t ,1 , _param->_nb_execute_unit, _param->_nb_execute_unit_port [it1]); 101 105 _ALLOC2_SIGNAL_OUT(out_EXECUTE_UNIT_IN_LOAD_QUEUE_PTR_WRITE ,"LOAD_QUEUE_PTR_WRITE" ,Tlsq_ptr_t ,_param->_size_load_queue_ptr , _param->_nb_execute_unit, _param->_nb_execute_unit_port [it1]); 102 106 _ALLOC2_SIGNAL_OUT(out_EXECUTE_UNIT_IN_IMMEDIAT ,"IMMEDIAT" ,Tgeneral_data_t ,_param->_size_general_data , _param->_nb_execute_unit, _param->_nb_execute_unit_port [it1]); -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Execute_loop/Execute_loop/Network/Read_unit_to_Execution_unit/src/Read_unit_to_Execution_unit_genMealy.cpp
r117 r122 89 89 PORT_WRITE(out_EXECUTE_UNIT_IN_NUM_REG_RE [dest][port], PORT_READ(in_READ_UNIT_OUT_NUM_REG_RE [i][j])); 90 90 PORT_WRITE(out_EXECUTE_UNIT_IN_STORE_QUEUE_PTR_WRITE [dest][port], PORT_READ(in_READ_UNIT_OUT_STORE_QUEUE_PTR_WRITE [i][j])); 91 PORT_WRITE(out_EXECUTE_UNIT_IN_STORE_QUEUE_PTR_READ [dest][port], PORT_READ(in_READ_UNIT_OUT_STORE_QUEUE_PTR_READ [i][j])); 92 PORT_WRITE(out_EXECUTE_UNIT_IN_STORE_QUEUE_EMPTY [dest][port], PORT_READ(in_READ_UNIT_OUT_STORE_QUEUE_EMPTY [i][j])); 91 93 if (_param->_have_port_load_queue_ptr) 92 94 PORT_WRITE(out_EXECUTE_UNIT_IN_LOAD_QUEUE_PTR_WRITE [dest][port], PORT_READ(in_READ_UNIT_OUT_LOAD_QUEUE_PTR_WRITE [i][j])); -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Execute_loop/Execute_loop/include/Execute_loop.h
r97 r122 81 81 public : SC_IN (Ttype_t ) ** in_EXECUTE_LOOP_IN_TYPE ;//[nb_read_unit] 82 82 public : SC_IN (Tlsq_ptr_t ) ** in_EXECUTE_LOOP_IN_STORE_QUEUE_PTR_WRITE;//[nb_read_unit] 83 public : SC_IN (Tlsq_ptr_t ) ** in_EXECUTE_LOOP_IN_STORE_QUEUE_PTR_READ ;//[nb_read_unit] 84 public : SC_IN (Tcontrol_t ) ** in_EXECUTE_LOOP_IN_STORE_QUEUE_EMPTY ;//[nb_read_unit] 83 85 public : SC_IN (Tlsq_ptr_t ) ** in_EXECUTE_LOOP_IN_LOAD_QUEUE_PTR_WRITE ;//[nb_read_unit] 84 86 public : SC_IN (Tcontrol_t ) ** in_EXECUTE_LOOP_IN_HAS_IMMEDIAT ;//[nb_read_unit] -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Execute_loop/Execute_loop/src/Execute_loop_allocation.cpp
r112 r122 66 66 ALLOC1_SIGNAL_IN ( in_EXECUTE_LOOP_IN_TYPE ,"type" ,Ttype_t ,_param->_size_type); 67 67 ALLOC1_SIGNAL_IN ( in_EXECUTE_LOOP_IN_STORE_QUEUE_PTR_WRITE,"store_queue_ptr_write",Tlsq_ptr_t ,_param->_size_store_queue_ptr); 68 ALLOC1_SIGNAL_IN ( in_EXECUTE_LOOP_IN_STORE_QUEUE_PTR_READ ,"store_queue_ptr_read" ,Tlsq_ptr_t ,_param->_size_store_queue_ptr); 69 ALLOC1_SIGNAL_IN ( in_EXECUTE_LOOP_IN_STORE_QUEUE_EMPTY ,"store_queue_empty" ,Tcontrol_t ,1); 68 70 ALLOC1_SIGNAL_IN ( in_EXECUTE_LOOP_IN_LOAD_QUEUE_PTR_WRITE ,"load_queue_ptr_write" ,Tlsq_ptr_t ,_param->_size_load_queue_ptr); 69 71 ALLOC1_SIGNAL_IN ( in_EXECUTE_LOOP_IN_HAS_IMMEDIAT ,"has_immediat" ,Tcontrol_t ,1); … … 483 485 PORT_MAP(_component ,src , "in_READ_UNIT_IN_TYPE" ,dest , "in_EXECUTE_LOOP_IN_"+toString(i)+"_TYPE" ); 484 486 PORT_MAP(_component ,src , "in_READ_UNIT_IN_STORE_QUEUE_PTR_WRITE",dest , "in_EXECUTE_LOOP_IN_"+toString(i)+"_STORE_QUEUE_PTR_WRITE"); 487 PORT_MAP(_component ,src , "in_READ_UNIT_IN_STORE_QUEUE_PTR_READ" ,dest , "in_EXECUTE_LOOP_IN_"+toString(i)+"_STORE_QUEUE_PTR_READ" ); 488 PORT_MAP(_component ,src , "in_READ_UNIT_IN_STORE_QUEUE_EMPTY" ,dest , "in_EXECUTE_LOOP_IN_"+toString(i)+"_STORE_QUEUE_EMPTY" ); 485 489 if (_param->_have_port_load_queue_ptr) 486 490 PORT_MAP(_component ,src , "in_READ_UNIT_IN_LOAD_QUEUE_PTR_WRITE" ,dest , "in_EXECUTE_LOOP_IN_"+toString(i)+"_LOAD_QUEUE_PTR_WRITE" ); … … 531 535 COMPONENT_MAP(_component ,src ,"out_READ_UNIT_OUT_"+toString(j )+"_STORE_QUEUE_PTR_WRITE", 532 536 dest, "in_READ_UNIT_OUT_"+toString(it_read_unit_out)+"_"+toString(j)+"_STORE_QUEUE_PTR_WRITE"); 537 COMPONENT_MAP(_component ,src ,"out_READ_UNIT_OUT_"+toString(j )+"_STORE_QUEUE_PTR_READ" , 538 dest, "in_READ_UNIT_OUT_"+toString(it_read_unit_out)+"_"+toString(j)+"_STORE_QUEUE_PTR_READ" ); 539 COMPONENT_MAP(_component ,src ,"out_READ_UNIT_OUT_"+toString(j )+"_STORE_QUEUE_EMPTY" , 540 dest, "in_READ_UNIT_OUT_"+toString(it_read_unit_out)+"_"+toString(j)+"_STORE_QUEUE_EMPTY" ); 533 541 if (_param->_have_port_load_queue_ptr) 534 542 COMPONENT_MAP(_component ,src ,"out_READ_UNIT_OUT_"+toString(j )+"_LOAD_QUEUE_PTR_WRITE" , … … 812 820 COMPONENT_MAP(_component ,src , "in_EXECUTE_IN_STORE_QUEUE_PTR_WRITE", 813 821 dest,"out_EXECUTE_UNIT_IN_"+toString(i)+"_0_STORE_QUEUE_PTR_WRITE"); 822 COMPONENT_MAP(_component ,src , "in_EXECUTE_IN_STORE_QUEUE_PTR_READ" , 823 dest,"out_EXECUTE_UNIT_IN_"+toString(i)+"_0_STORE_QUEUE_PTR_READ" ); 824 COMPONENT_MAP(_component ,src , "in_EXECUTE_IN_STORE_QUEUE_EMPTY" , 825 dest,"out_EXECUTE_UNIT_IN_"+toString(i)+"_0_STORE_QUEUE_EMPTY" ); 814 826 if (_param->_have_port_load_queue_ptr) 815 827 COMPONENT_MAP(_component ,src , "in_EXECUTE_IN_LOAD_QUEUE_PTR_WRITE" , … … 936 948 COMPONENT_MAP(_component ,src , "in_MEMORY_IN_"+toString(j)+"_STORE_QUEUE_PTR_WRITE", 937 949 dest,"out_EXECUTE_UNIT_IN_"+toString(i)+"_"+toString(j)+"_STORE_QUEUE_PTR_WRITE"); 950 COMPONENT_MAP(_component ,src , "in_MEMORY_IN_"+toString(j)+"_STORE_QUEUE_PTR_READ", 951 dest,"out_EXECUTE_UNIT_IN_"+toString(i)+"_"+toString(j)+"_STORE_QUEUE_PTR_READ" ); 952 COMPONENT_MAP(_component ,src , "in_MEMORY_IN_"+toString(j)+"_STORE_QUEUE_EMPTY" , 953 dest,"out_EXECUTE_UNIT_IN_"+toString(i)+"_"+toString(j)+"_STORE_QUEUE_EMPTY" ); 938 954 if (_param->_have_port_load_queue_ptr) 939 955 COMPONENT_MAP(_component ,src , "in_MEMORY_IN_"+toString(j)+"_LOAD_QUEUE_PTR_WRITE" , -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Execute_loop/Execute_loop/src/Execute_loop_deallocation.cpp
r88 r122 36 36 DELETE1_SIGNAL( in_EXECUTE_LOOP_IN_TYPE ,_param->_nb_read_unit,_param->_size_type); 37 37 DELETE1_SIGNAL( in_EXECUTE_LOOP_IN_STORE_QUEUE_PTR_WRITE,_param->_nb_read_unit,_param->_size_store_queue_ptr); 38 DELETE1_SIGNAL( in_EXECUTE_LOOP_IN_STORE_QUEUE_PTR_READ ,_param->_nb_read_unit,_param->_size_store_queue_ptr); 39 DELETE1_SIGNAL( in_EXECUTE_LOOP_IN_STORE_QUEUE_EMPTY ,_param->_nb_read_unit,1); 38 40 DELETE1_SIGNAL( in_EXECUTE_LOOP_IN_LOAD_QUEUE_PTR_WRITE ,_param->_nb_read_unit,_param->_size_load_queue_ptr); 39 41 DELETE1_SIGNAL( in_EXECUTE_LOOP_IN_HAS_IMMEDIAT ,_param->_nb_read_unit,1); … … 99 101 100 102 // ~~~~~[ Component ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 101 delete _component;102 103 delete _component_glue ; 104 for (uint32_t i=0; i<_param->_nb_read_unit; i++) 105 delete _component_read_unit [i] ; 103 106 delete [] _component_read_unit ; 107 for (uint32_t i=0; i<_param->_nb_functionnal_unit; i++) 108 delete _component_functionnal_unit [i] ; 104 109 delete [] _component_functionnal_unit ; 110 for (uint32_t i=0; i<_param->_nb_load_store_unit; i++) 111 delete _component_load_store_unit [i] ; 105 112 delete [] _component_load_store_unit ; 113 for (uint32_t i=0; i<_param->_nb_write_unit; i++) 114 delete _component_write_unit [i] ; 106 115 delete [] _component_write_unit ; 107 116 delete _component_read_unit_to_execution_unit ; 108 117 delete _component_execution_unit_to_write_unit; 109 118 delete _component_register_unit ; 119 120 delete _component; 110 121 111 122 log_printf(FUNC,Execute_loop,FUNCTION,"End"); -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Execute_loop/Execute_loop/src/Parameters.cpp
r120 r122 590 590 delete _param_glue; 591 591 for (uint32_t i=0; i<_nb_read_unit; i++) 592 delete_param_read_unit [i];592 delete _param_read_unit [i]; 593 593 delete [] _param_read_unit; 594 594 … … 605 605 delete [] _param_load_store_unit; 606 606 for (uint32_t i=0; i<_nb_write_unit; i++) 607 delete_param_write_unit [i];607 delete _param_write_unit [i]; 608 608 delete [] _param_write_unit; 609 609 delete _param_read_unit_to_execution_unit; -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Context_State/src/Context_State_transition.cpp
r120 r122 16 16 namespace context_state { 17 17 18 #define MISS_FAST 18 19 19 20 #define get_priority(x) \ … … 53 54 // uint32_t x = _param->_link_context_to_decod_unit [i]; 54 55 55 Tcounter_t inst_all = PORT_READ(in_NB_INST_COMMIT_ALL[i]) + PORT_READ(in_NB_INST_DECOD_ALL [i]); 56 // Tcounter_t inst_mem = PORT_READ(in_NB_INST_COMMIT_MEM[i]) + PORT_READ(in_NB_INST_DECOD_ALL [i]); 56 Tcounter_t inst_commit_all = PORT_READ(in_NB_INST_COMMIT_ALL[i]); 57 // Tcounter_t inst_commit_mem = PORT_READ(in_NB_INST_COMMIT_MEM[i]); 58 Tcounter_t inst_decod_all = PORT_READ(in_NB_INST_DECOD_ALL [i]); 59 Tcounter_t inst_all = inst_commit_all + inst_decod_all; 60 // Tcounter_t inst_mem = inst_commit_mem + inst_decod_all; 57 61 58 62 context_state_t state = reg_STATE [i]; … … 69 73 // Wait end of all instruction 70 74 if (inst_all == 0) 75 // if (inst_decod_all == 0) 71 76 state = CONTEXT_STATE_KO_EXCEP_ADDR; 72 77 break; … … 85 90 { 86 91 // Wait end of all instruction 87 if (inst_all == 0) 92 // if (inst_all == 0) 93 if ( 94 #ifdef MISS_FAST 95 inst_decod_all == 96 #else 97 inst_all == 98 #endif 99 0) 88 100 89 // state = CONTEXT_STATE_OK; // @@@ TODO : make MISS fast (miss decod)101 // state = CONTEXT_STATE_OK; 90 102 state = CONTEXT_STATE_KO_MISS_BRANCH_ADDR; 91 103 break; … … 94 106 { 95 107 // Wait end of all instruction 96 if (inst_all == 0) 108 // if (inst_all == 0) 109 if ( 110 #ifdef MISS_FAST 111 inst_decod_all == 112 #else 113 inst_all == 114 #endif 115 0) 97 116 state = CONTEXT_STATE_KO_MISS_LOAD_ADDR; 98 117 … … 127 146 { 128 147 // Wait end of all instruction 129 if (inst_all == 0) 130 148 // if (inst_all == 0) 149 if ( 150 #ifdef MISS_FAST 151 inst_decod_all == 152 #else 153 inst_all == 154 #endif 155 0) 131 156 // state = CONTEXT_STATE_OK; // @@@ TODO : make MISS fast (miss decod) 132 157 state = CONTEXT_STATE_KO_MISS_LOAD_AND_BRANCH_ADDR; -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Update_Prediction_Table/include/Parameters.h
r120 r122 36 36 public : uint32_t _nb_thread ; 37 37 public : uint32_t * _translate_num_context_to_num_thread;//[nb_context] 38 public : const bool _accurate_block_predict ; 39 public : const bool _accurate_block_decod ; 38 public : const bool _always_accurate_predict ; 39 public : const bool _always_accurate_decod ; 40 public : const bool _can_accurate_predict ; 41 public : const bool _can_accurate_decod ; 40 42 41 43 //public : uint32_t _size_context_id ; -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Update_Prediction_Table/include/Types.h
r119 r122 25 25 } event_source_t; 26 26 27 typedef enum 28 { 29 EVENT_STATE_OK , // Can predict 30 EVENT_STATE_MISS_FLUSH_UFPT , // in decod stage, detect a miss , continue to execute but flush ufpt 31 EVENT_STATE_MISS_FLUSH_UFPT_AND_UPT , // in commit stage, detect a miss , stop context and flush ufpt and upt 32 EVENT_STATE_MISS_FLUSH_UPT , // in commit stage, detect a miss , context is stop and ufpt is flush, update RAS 33 EVENT_STATE_EVENT_FLUSH_UFPT , // in commit stage, detect an event, continue to execute but flush ufpt 34 EVENT_STATE_EVENT_FLUSH_UFPT_AND_UPT, // in commit stage, detect an event, stop context and flush ufpt and upt 35 EVENT_STATE_EVENT_FLUSH_UPT , // in commit stage, detect an event, context is stop and ufpt is flush, update RAS 36 EVENT_STATE_UPDATE_CONTEXT , // prediction unit is update, send signal to context manager 37 EVENT_STATE_WAIT_END_EVENT // prediction unit is ok, wait the end of event (send by Context State) 38 } event_state_t; 27 // typedef enum 28 // { 29 // EVENT_STATE_OK , // Can predict 30 // EVENT_STATE_MISS_FLUSH_UFPT , // in decod stage, detect a miss , continue to execute but flush ufpt 31 // EVENT_STATE_MISS_FLUSH_UFPT_AND_UPT , // in commit stage, detect a miss , stop context and flush ufpt and upt 32 // EVENT_STATE_MISS_FLUSH_UPT , // in commit stage, detect a miss , context is stop and ufpt is flush, update RAS 33 // EVENT_STATE_EVENT_FLUSH_UFPT , // in commit stage, detect an event, continue to execute but flush ufpt 34 // EVENT_STATE_EVENT_FLUSH_UFPT_AND_UPT, // in commit stage, detect an event, stop context and flush ufpt and upt 35 // EVENT_STATE_EVENT_FLUSH_UPT , // in commit stage, detect an event, context is stop and ufpt is flush, update RAS 36 // EVENT_STATE_UPDATE_CONTEXT , // prediction unit is update, send signal to context manager 37 // EVENT_STATE_WAIT_END_EVENT // prediction unit is ok, wait the end of event (send by Context State) 38 // } event_state_t; 39 40 typedef enum 41 { 42 UFPT_EVENT_STATE_OK , // Can predict 43 UFPT_EVENT_STATE_KO_FLUSH // Can't predict, flush ufpt 44 } ufpt_event_state_t; 45 46 typedef enum 47 { 48 UPT_EVENT_STATE_OK , // Can predict 49 UPT_EVENT_STATE_KO_MISS_WAIT_UFPT , // in decod stage, detect a miss , continue to execute but flush ufpt 50 UPT_EVENT_STATE_KO_MISS_FLUSH_UPT , // in commit stage, detect a miss , context is stop and ufpt is flush, update RAS 51 UPT_EVENT_STATE_KO_EVENT_WAIT_UFPT , // in commit stage, detect an event, continue to execute but flush ufpt 52 UPT_EVENT_STATE_KO_EVENT_FLUSH_UPT , // in commit stage, detect an event, context is stop and ufpt is flush, update RAS 53 UPT_EVENT_STATE_KO_DECODE_UPDATE_CONTEXT , // prediction unit is update, send signal to context manager 54 UPT_EVENT_STATE_KO_DECODE_WAIT_END_EVENT , // prediction unit is ok, wait the end of event (send by Context State) 55 UPT_EVENT_STATE_KO_COMMIT_UPDATE_CONTEXT , // prediction unit is update, send signal to context manager 56 UPT_EVENT_STATE_KO_COMMIT_WAIT_END_EVENT // prediction unit is ok, wait the end of event (send by Context State) 57 } upt_event_state_t; 39 58 40 59 typedef enum … … 138 157 }; 139 158 140 141 142 template<> inline std::string toString<morpheo::behavioural::core::multi_front_end::front_end::prediction_unit::update_prediction_table::event_state_t>(const morpheo::behavioural::core::multi_front_end::front_end::prediction_unit::update_prediction_table::event_state_t& x) 143 { 144 switch (x) 145 { 146 case morpheo::behavioural::core::multi_front_end::front_end::prediction_unit::update_prediction_table::EVENT_STATE_OK : return "ok" ; break; 147 case morpheo::behavioural::core::multi_front_end::front_end::prediction_unit::update_prediction_table::EVENT_STATE_MISS_FLUSH_UFPT : return "miss_flush_ufpt" ; break; 148 case morpheo::behavioural::core::multi_front_end::front_end::prediction_unit::update_prediction_table::EVENT_STATE_MISS_FLUSH_UFPT_AND_UPT : return "miss_flush_ufpt_and_upt" ; break; 149 case morpheo::behavioural::core::multi_front_end::front_end::prediction_unit::update_prediction_table::EVENT_STATE_MISS_FLUSH_UPT : return "miss_flush_upt" ; break; 150 case morpheo::behavioural::core::multi_front_end::front_end::prediction_unit::update_prediction_table::EVENT_STATE_EVENT_FLUSH_UPT : return "event_flush_upt" ; break; 151 case morpheo::behavioural::core::multi_front_end::front_end::prediction_unit::update_prediction_table::EVENT_STATE_EVENT_FLUSH_UFPT : return "event_flush_ufpt" ; break; 152 case morpheo::behavioural::core::multi_front_end::front_end::prediction_unit::update_prediction_table::EVENT_STATE_EVENT_FLUSH_UFPT_AND_UPT: return "event_flush_ufpt_and_upt"; break; 153 case morpheo::behavioural::core::multi_front_end::front_end::prediction_unit::update_prediction_table::EVENT_STATE_UPDATE_CONTEXT : return "update_context" ; break; 154 case morpheo::behavioural::core::multi_front_end::front_end::prediction_unit::update_prediction_table::EVENT_STATE_WAIT_END_EVENT : return "wait_end_event" ; break; 155 default : return ""; break; 156 } 157 }; 159 // template<> inline std::string toString<morpheo::behavioural::core::multi_front_end::front_end::prediction_unit::update_prediction_table::event_state_t>(const morpheo::behavioural::core::multi_front_end::front_end::prediction_unit::update_prediction_table::event_state_t& x) 160 // { 161 // switch (x) 162 // { 163 // case morpheo::behavioural::core::multi_front_end::front_end::prediction_unit::update_prediction_table::EVENT_STATE_OK : return "ok" ; break; 164 // case morpheo::behavioural::core::multi_front_end::front_end::prediction_unit::update_prediction_table::EVENT_STATE_MISS_FLUSH_UFPT : return "miss_flush_ufpt" ; break; 165 // case morpheo::behavioural::core::multi_front_end::front_end::prediction_unit::update_prediction_table::EVENT_STATE_MISS_FLUSH_UFPT_AND_UPT : return "miss_flush_ufpt_and_upt" ; break; 166 // case morpheo::behavioural::core::multi_front_end::front_end::prediction_unit::update_prediction_table::EVENT_STATE_MISS_FLUSH_UPT : return "miss_flush_upt" ; break; 167 // case morpheo::behavioural::core::multi_front_end::front_end::prediction_unit::update_prediction_table::EVENT_STATE_EVENT_FLUSH_UPT : return "event_flush_upt" ; break; 168 // case morpheo::behavioural::core::multi_front_end::front_end::prediction_unit::update_prediction_table::EVENT_STATE_EVENT_FLUSH_UFPT : return "event_flush_ufpt" ; break; 169 // case morpheo::behavioural::core::multi_front_end::front_end::prediction_unit::update_prediction_table::EVENT_STATE_EVENT_FLUSH_UFPT_AND_UPT: return "event_flush_ufpt_and_upt"; break; 170 // case morpheo::behavioural::core::multi_front_end::front_end::prediction_unit::update_prediction_table::EVENT_STATE_UPDATE_CONTEXT : return "update_context" ; break; 171 // case morpheo::behavioural::core::multi_front_end::front_end::prediction_unit::update_prediction_table::EVENT_STATE_WAIT_END_EVENT : return "wait_end_event" ; break; 172 // default : return ""; break; 173 // } 174 // }; 158 175 159 176 template<> inline std::string toString<morpheo::behavioural::core::multi_front_end::front_end::prediction_unit::update_prediction_table::ufpt_state_t>(const morpheo::behavioural::core::multi_front_end::front_end::prediction_unit::update_prediction_table::ufpt_state_t& x) … … 186 203 }; 187 204 205 template<> inline std::string toString<morpheo::behavioural::core::multi_front_end::front_end::prediction_unit::update_prediction_table::ufpt_event_state_t>(const morpheo::behavioural::core::multi_front_end::front_end::prediction_unit::update_prediction_table::ufpt_event_state_t& x) 206 { 207 switch (x) 208 { 209 case morpheo::behavioural::core::multi_front_end::front_end::prediction_unit::update_prediction_table::UFPT_EVENT_STATE_OK : return "UFPT_EVENT_STATE_OK" ; break; 210 case morpheo::behavioural::core::multi_front_end::front_end::prediction_unit::update_prediction_table::UFPT_EVENT_STATE_KO_FLUSH : return "UFPT_EVENT_STATE_KO_FLUSH" ; break; 211 default : return ""; break; 212 } 213 }; 214 215 template<> inline std::string toString<morpheo::behavioural::core::multi_front_end::front_end::prediction_unit::update_prediction_table::upt_event_state_t>(const morpheo::behavioural::core::multi_front_end::front_end::prediction_unit::update_prediction_table::upt_event_state_t& x) 216 { 217 switch (x) 218 { 219 case morpheo::behavioural::core::multi_front_end::front_end::prediction_unit::update_prediction_table::UPT_EVENT_STATE_OK : return "UPT_EVENT_STATE_OK" ; break; 220 case morpheo::behavioural::core::multi_front_end::front_end::prediction_unit::update_prediction_table::UPT_EVENT_STATE_KO_MISS_WAIT_UFPT : return "UPT_EVENT_STATE_KO_MISS_WAIT_UFPT" ; break; 221 case morpheo::behavioural::core::multi_front_end::front_end::prediction_unit::update_prediction_table::UPT_EVENT_STATE_KO_MISS_FLUSH_UPT : return "UPT_EVENT_STATE_KO_MISS_FLUSH_UPT" ; break; 222 case morpheo::behavioural::core::multi_front_end::front_end::prediction_unit::update_prediction_table::UPT_EVENT_STATE_KO_EVENT_WAIT_UFPT : return "UPT_EVENT_STATE_KO_EVENT_WAIT_UFPT" ; break; 223 case morpheo::behavioural::core::multi_front_end::front_end::prediction_unit::update_prediction_table::UPT_EVENT_STATE_KO_EVENT_FLUSH_UPT : return "UPT_EVENT_STATE_KO_EVENT_FLUSH_UPT" ; break; 224 case morpheo::behavioural::core::multi_front_end::front_end::prediction_unit::update_prediction_table::UPT_EVENT_STATE_KO_DECODE_UPDATE_CONTEXT : return "UPT_EVENT_STATE_KO_DECODE_UPDATE_CONTEXT" ; break; 225 case morpheo::behavioural::core::multi_front_end::front_end::prediction_unit::update_prediction_table::UPT_EVENT_STATE_KO_DECODE_WAIT_END_EVENT : return "UPT_EVENT_STATE_KO_DECODE_WAIT_END_EVENT" ; break; 226 case morpheo::behavioural::core::multi_front_end::front_end::prediction_unit::update_prediction_table::UPT_EVENT_STATE_KO_COMMIT_UPDATE_CONTEXT : return "UPT_EVENT_STATE_KO_COMMIT_UPDATE_CONTEXT" ; break; 227 case morpheo::behavioural::core::multi_front_end::front_end::prediction_unit::update_prediction_table::UPT_EVENT_STATE_KO_COMMIT_WAIT_END_EVENT : return "UPT_EVENT_STATE_KO_COMMIT_WAIT_END_EVENT" ; break; 228 default : return ""; break; 229 } 230 }; 231 188 232 }; // end namespace morpheo 189 233 -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Update_Prediction_Table/include/Update_Prediction_Table.h
r119 r122 184 184 private : bool * reg_IS_ACCURATE ; //[nb_context] 185 185 186 private : bool * reg_EVENT_VAL ; //[nb_context] 186 private : ufpt_event_state_t * reg_UFPT_EVENT_STATE ; //[nb_context] 187 private : upt_event_state_t * reg_UPT_EVENT_STATE ; //[nb_context] 188 189 // private : bool * reg_EVENT_VAL ; //[nb_context] 187 190 private : uint32_t * reg_EVENT_UPT_PTR ; //[nb_context] 188 191 private : bool * reg_EVENT_UPT_FULL ; //[nb_context] 189 192 190 private : event_state_t * reg_EVENT_STATE ; //[nb_context]191 private : bool * reg_EVENT_IS_BRANCH ; //[nb_context]193 // private : event_state_t * reg_EVENT_STATE ; //[nb_context] 194 // private : bool * reg_EVENT_IS_BRANCH ; //[nb_context] 192 195 private : Tdepth_t * reg_EVENT_DEPTH ; //[nb_context] 193 196 private : Taddress_t * reg_EVENT_ADDRESS_SRC ; //[nb_context] // Address branch -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Update_Prediction_Table/src/Parameters.cpp
r120 r122 34 34 uint32_t * translate_num_context_to_num_thread ,//[nb_context] 35 35 bool is_toplevel): 36 _accurate_block_predict (false), 37 _accurate_block_decod (false) 36 _always_accurate_predict (false), 37 _always_accurate_decod (false), 38 _can_accurate_predict (true ), 39 _can_accurate_decod (true ) 38 40 { 39 41 log_printf(FUNC,Update_Prediction_Table,FUNCTION,"Begin"); -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Update_Prediction_Table/src/Update_Prediction_Table_allocation.cpp
r120 r122 224 224 ALLOC1(reg_UPT_EMPTY ,bool ,_param->_nb_context); 225 225 226 ALLOC1(reg_EVENT_VAL ,bool ,_param->_nb_context); 226 ALLOC1(reg_UFPT_EVENT_STATE ,ufpt_event_state_t,_param->_nb_context); 227 ALLOC1(reg_UPT_EVENT_STATE ,upt_event_state_t ,_param->_nb_context); 228 229 // ALLOC1(reg_EVENT_VAL ,bool ,_param->_nb_context); 227 230 ALLOC1(reg_EVENT_UPT_PTR ,uint32_t ,_param->_nb_context); 228 231 ALLOC1(reg_EVENT_UPT_FULL ,bool ,_param->_nb_context); 229 232 230 ALLOC1(reg_EVENT_STATE ,event_state_t ,_param->_nb_context);231 ALLOC1(reg_EVENT_IS_BRANCH ,bool ,_param->_nb_context);233 // ALLOC1(reg_EVENT_STATE ,event_state_t ,_param->_nb_context); 234 // ALLOC1(reg_EVENT_IS_BRANCH ,bool ,_param->_nb_context); 232 235 ALLOC1(reg_EVENT_DEPTH ,Tdepth_t ,_param->_nb_context); 233 236 ALLOC1(reg_EVENT_ADDRESS_SRC ,Taddress_t ,_param->_nb_context); … … 257 260 false, 258 261 log_with_pid, 259 false);262 true); 260 263 261 264 branchement_log_file [i] .open(filename.c_str() ,std::ios::out | std::ios::trunc); -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Update_Prediction_Table/src/Update_Prediction_Table_deallocation.cpp
r119 r122 151 151 DELETE1(reg_UPT_EMPTY ,_param->_nb_context); 152 152 153 DELETE1(reg_EVENT_VAL ,_param->_nb_context); 153 DELETE1(reg_UFPT_EVENT_STATE ,_param->_nb_context); 154 DELETE1(reg_UPT_EVENT_STATE ,_param->_nb_context); 155 156 // DELETE1(reg_EVENT_VAL ,_param->_nb_context); 154 157 DELETE1(reg_EVENT_UPT_PTR ,_param->_nb_context); 155 158 DELETE1(reg_EVENT_UPT_FULL ,_param->_nb_context); 156 159 157 DELETE1(reg_EVENT_STATE ,_param->_nb_context);158 DELETE1(reg_EVENT_IS_BRANCH ,_param->_nb_context);160 // DELETE1(reg_EVENT_STATE ,_param->_nb_context); 161 // DELETE1(reg_EVENT_IS_BRANCH ,_param->_nb_context); 159 162 DELETE1(reg_EVENT_DEPTH ,_param->_nb_context); 160 163 DELETE1(reg_EVENT_ADDRESS_SRC ,_param->_nb_context); -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Update_Prediction_Table/src/Update_Prediction_Table_genMealy_branch_complete.cpp
r111 r122 33 33 log_printf(TRACE,Update_Prediction_Table,FUNCTION," * BRANCH_COMPLETE [%d]",i); 34 34 35 Tcontext_t context = (_param->_have_port_context_id)?PORT_READ(in_BRANCH_COMPLETE_CONTEXT_ID [i]):0; 36 Tdepth_t depth = (_param->_have_port_depth )?PORT_READ(in_BRANCH_COMPLETE_DEPTH [i]):0; 37 Tcontrol_t miss = false; 38 Tcontrol_t take = reg_UPDATE_PREDICTION_TABLE [context][depth]._last_take ; 39 Taddress_t addr_dest = reg_UPDATE_PREDICTION_TABLE [context][depth]._address_dest; 40 Tbranch_condition_t condition = reg_UPDATE_PREDICTION_TABLE [context][depth]._condition ; 35 // Read information 36 Tcontext_t context = (_param->_have_port_context_id)?PORT_READ(in_BRANCH_COMPLETE_CONTEXT_ID [i]):0; 37 Tdepth_t depth = (_param->_have_port_depth )?PORT_READ(in_BRANCH_COMPLETE_DEPTH [i]):0; 38 Tcontrol_t miss = false; // init 39 Tcontrol_t take = reg_UPDATE_PREDICTION_TABLE [context][depth]._last_take ; 40 Taddress_t addr_dest = reg_UPDATE_PREDICTION_TABLE [context][depth]._address_dest; 41 Tbranch_condition_t condition = reg_UPDATE_PREDICTION_TABLE [context][depth]._condition ; 41 42 42 43 Tcontrol_t no_sequence = PORT_READ(in_BRANCH_COMPLETE_NO_SEQUENCE [i]); 43 Taddress_t addr_good = PORT_READ(in_BRANCH_COMPLETE_ADDRESS [i]);44 Taddress_t addr_good = PORT_READ(in_BRANCH_COMPLETE_ADDRESS [i]); 44 45 45 46 log_printf(TRACE,Update_Prediction_Table,FUNCTION," * context : %d",context); … … 54 55 log_printf(TRACE,Update_Prediction_Table,FUNCTION," * address_dest : %.8x",addr_dest); 55 56 57 // Test branch condition 56 58 switch (condition) 57 59 { … … 80 82 log_printf(TRACE,Update_Prediction_Table,FUNCTION," * BRANCH_CONDITION_FLAG"); 81 83 82 // Tcontrol_t take_good = not flag; // flag set = not take83 // Tcontrol_t take_good = flag; // flag set = take84 84 Tcontrol_t take_good = no_sequence; 85 85 -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Update_Prediction_Table/src/Update_Prediction_Table_genMealy_decod.cpp
r120 r122 28 28 if (PORT_READ(in_NRESET) != 0) 29 29 { 30 // for each decod instruction 30 31 for (uint32_t i=0; i<_param->_nb_inst_decod; i++) 31 32 { 32 33 log_printf(TRACE,Update_Prediction_Table,FUNCTION," * DECOD [%d]",i); 33 34 34 Tcontext_t context = (_param->_have_port_context_id)?PORT_READ(in_DECOD_CONTEXT_ID [i]):0; 35 bool is_accurate = _param->_accurate_block_decod or reg_IS_ACCURATE [context]; 36 event_state_t event_state = reg_EVENT_STATE [context]; 37 uint32_t ptr_write = reg_UPT_TOP [context]; 38 // can continue if next slot is empty 39 Tcontrol_t can_continue= ((reg_UPDATE_PREDICTION_TABLE [context][(reg_UPT_TOP [context]+1)%_param->_size_upt_queue[context]]._state == UPDATE_PREDICTION_STATE_EMPTY) and 40 (reg_EVENT_STATE [context] == EVENT_STATE_OK)); 35 // Read information 36 Tcontext_t context = (_param->_have_port_context_id)?PORT_READ(in_DECOD_CONTEXT_ID [i]):0; 37 bool is_accurate = (_param->_always_accurate_decod or 38 (_param->_can_accurate_decod and reg_IS_ACCURATE [context])); 39 upt_event_state_t upt_event_state = reg_UPT_EVENT_STATE [context]; 40 ufpt_event_state_t ufpt_event_state = reg_UFPT_EVENT_STATE [context]; 41 uint32_t ptr_write = reg_UPT_TOP [context]; // One branch per context per cycle 42 uint32_t ptr_write_next = (ptr_write+1)%_param->_size_upt_queue[context]; 43 // Decod can continue until the next branch if next slot is empty, and no event 44 Tcontrol_t can_continue = (reg_UPDATE_PREDICTION_TABLE [context][ptr_write_next]._state == UPDATE_PREDICTION_STATE_EMPTY); 41 45 42 log_printf(TRACE,Update_Prediction_Table,FUNCTION," * context : %d",context ); 43 log_printf(TRACE,Update_Prediction_Table,FUNCTION," * is_accurate : %d",is_accurate); 44 log_printf(TRACE,Update_Prediction_Table,FUNCTION," * event_state : %s",toString(event_state).c_str()); 45 log_printf(TRACE,Update_Prediction_Table,FUNCTION," * ptr_write : %d",ptr_write ); 46 log_printf(TRACE,Update_Prediction_Table,FUNCTION," * upt_state : %s",toString(reg_UPDATE_PREDICTION_TABLE [context][ptr_write]._state).c_str()); 47 log_printf(TRACE,Update_Prediction_Table,FUNCTION," * can_continue: %d",can_continue); 46 log_printf(TRACE,Update_Prediction_Table,FUNCTION," * context : %d",context); 47 log_printf(TRACE,Update_Prediction_Table,FUNCTION," * is_accurate : %d",is_accurate); 48 log_printf(TRACE,Update_Prediction_Table,FUNCTION," * ufpt_event_state : %s",toString(ufpt_event_state).c_str()); 49 log_printf(TRACE,Update_Prediction_Table,FUNCTION," * upt_event_state : %s",toString(upt_event_state).c_str()); 50 log_printf(TRACE,Update_Prediction_Table,FUNCTION," * ptr_write : %d - %d",ptr_write,ptr_write_next); 51 log_printf(TRACE,Update_Prediction_Table,FUNCTION," * upt_state : %s",toString(reg_UPDATE_PREDICTION_TABLE [context][ptr_write]._state).c_str()); 52 log_printf(TRACE,Update_Prediction_Table,FUNCTION," * can_continue : %d",can_continue); 48 53 49 // ack:54 // can decod (ack) if : 50 55 // * in all case (miss or hit), need empty slot 56 // * not previous event (state = ok) 51 57 // * is_accurate 52 // * event_state : don't update upt53 58 internal_DECOD_ACK [i] = ((reg_UPDATE_PREDICTION_TABLE [context][ptr_write]._state == UPDATE_PREDICTION_STATE_EMPTY) and 54 is_accurate and 55 // ( 56 (event_state == EVENT_STATE_OK)// or 57 // (event_state == EVENT_STATE_MISS_FLUSH_UFPT ) or 58 // (event_state == EVENT_STATE_UPDATE_CONTEXT)) 59 ); 59 (ufpt_event_state == UFPT_EVENT_STATE_OK) and 60 (upt_event_state == UPT_EVENT_STATE_OK ) and 61 is_accurate); 60 62 internal_DECOD_UPT_PTR_WRITE [i] = ptr_write; 61 63 62 log_printf(TRACE,Update_Prediction_Table,FUNCTION," * ack : %d",internal_DECOD_ACK [i]);64 log_printf(TRACE,Update_Prediction_Table,FUNCTION," * ack : %d",internal_DECOD_ACK [i]); 63 65 64 66 PORT_WRITE(out_DECOD_ACK [i], internal_DECOD_ACK [i]); -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Update_Prediction_Table/src/Update_Prediction_Table_genMealy_predict.cpp
r120 r122 27 27 if (PORT_READ(in_NRESET) != 0) 28 28 { 29 29 // For each prediction 30 30 for (uint32_t i=0; i<_param->_nb_inst_predict; i++) 31 31 { 32 // Read information 32 33 Tcontext_t context = (_param->_have_port_context_id)?PORT_READ(in_PREDICT_CONTEXT_ID [i]):0; 33 uint32_t top = reg_UFPT_TOP[context]; 34 uint32_t top = reg_UFPT_TOP[context]; // not multi branch prediction 34 35 35 36 log_printf(TRACE,Update_Prediction_Table,FUNCTION,"PREDICT [%d] (genMealy)",i); … … 40 41 // log_printf(TRACE,Update_Prediction_Table,FUNCTION," * need update : %d",reg_NB_ELT_NEED_UPDATE [context]); 41 42 43 bool is_accurate = (_param->_always_accurate_predict or 44 (_param->_can_accurate_predict and reg_IS_ACCURATE [context])); 45 46 // Ack if : 47 // * no previous event (ufpt and upt is ok) 48 // * top slot is empty 49 // * is_accurate 50 internal_PREDICT_ACK [i] = ((reg_UFPT_EVENT_STATE [context] == UFPT_EVENT_STATE_OK) and 51 (reg_UPT_EVENT_STATE [context] == UPT_EVENT_STATE_OK ) and 52 (reg_UPDATE_FETCH_PREDICTION_TABLE [context][top]._state == UPDATE_FETCH_PREDICTION_STATE_EMPTY) and 53 is_accurate); 54 42 55 internal_PREDICT_UPDATE_PREDICTION_ID [i] = top; 43 56 57 log_printf(TRACE,Update_Prediction_Table,FUNCTION," * ACK : %d",internal_PREDICT_ACK [i]); 58 59 PORT_WRITE(out_PREDICT_ACK [i], internal_PREDICT_ACK [i]); 44 60 if (_param->_have_port_depth) 45 61 PORT_WRITE(out_PREDICT_UPDATE_PREDICTION_ID [i], internal_PREDICT_UPDATE_PREDICTION_ID [i]); 46 47 bool is_accurate = _param->_accurate_block_predict or reg_IS_ACCURATE[context];48 49 // Ack if :50 // * slot is empty51 // * no previous miss52 // * is_accurate53 internal_PREDICT_ACK [i] = ((reg_UPDATE_FETCH_PREDICTION_TABLE [context][top]._state == UPDATE_FETCH_PREDICTION_STATE_EMPTY) and54 (reg_EVENT_STATE [context] == EVENT_STATE_OK) and55 // (reg_UFPT_NB_UPDATE [context] == 0) and56 is_accurate);57 58 59 log_printf(TRACE,Update_Prediction_Table,FUNCTION," * ACK : %d",internal_PREDICT_ACK [i]);60 PORT_WRITE(out_PREDICT_ACK [i], internal_PREDICT_ACK [i]);61 62 } 62 63 -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Update_Prediction_Table/src/Update_Prediction_Table_genMoore.cpp
r119 r122 40 40 // include ]DEPTH_MIN:DEPTH_MAX] -> speculative 41 41 42 PORT_WRITE(out_DEPTH_VAL [i],((reg_UPDATE_PREDICTION_TABLE [i][reg_UPT_TOP [i]]._state == UPDATE_PREDICTION_STATE_EMPTY) 43 and (reg_EVENT_STATE [i] == EVENT_STATE_OK) 42 uint32_t bottom = reg_UPT_BOTTOM [i]; 43 uint32_t top = reg_UPT_TOP [i]; 44 bool empty = reg_UPT_EMPTY [i]; 45 46 // Depth_val is set when state is ok and the UPT[top] is empty 47 PORT_WRITE(out_DEPTH_VAL [i],((reg_UPDATE_PREDICTION_TABLE [i][top]._state == UPDATE_PREDICTION_STATE_EMPTY) 48 and (reg_UFPT_EVENT_STATE [i] == UFPT_EVENT_STATE_OK) 49 and (reg_UPT_EVENT_STATE [i] == UPT_EVENT_STATE_OK) 44 50 )); 45 51 if (_param->_have_port_depth) 46 52 { 47 PORT_WRITE(out_DEPTH_CURRENT [i], reg_UPT_TOP [i]); 48 PORT_WRITE(out_DEPTH_MIN [i], reg_UPT_BOTTOM [i]); 49 PORT_WRITE(out_DEPTH_MAX [i], reg_UPT_TOP [i]); 50 } 51 PORT_WRITE(out_DEPTH_FULL [i], not reg_UPT_EMPTY [i] and (reg_UPT_TOP [i] == reg_UPT_BOTTOM [i])); 52 53 // bool empty = reg_UPT_EMPTY [i]; 54 // PORT_WRITE(out_DEPTH_MAX [i], ((empty)?reg_UPT_BOTTOM [i]:((reg_UPT_TOP [i]==0)?(_param->_size_upt_queue[i]-1):(reg_UPT_TOP [i]-1)))); 53 PORT_WRITE(out_DEPTH_CURRENT [i], top); 54 PORT_WRITE(out_DEPTH_MIN [i], bottom); 55 PORT_WRITE(out_DEPTH_MAX [i], top); 56 } 57 PORT_WRITE(out_DEPTH_FULL [i], not empty and (top == bottom)); 55 58 } 56 59 … … 58 61 // =====[ UPDATE ]==================================================== 59 62 // =================================================================== 60 61 bool retire_ras_from_ufpt [_param->_nb_context]; // event ufpt -> restore RAS, else update upt 62 bool retire_ras_from_upt [_param->_nb_context]; // event upt -> restore RAS, else restore others structure 63 // bool have_event [_param->_nb_context]; 64 bool ufpt_update [_param->_nb_context]; 65 bool upt_update [_param->_nb_context]; 66 Tdepth_t tab_ufpt_depth [_param->_nb_context]; 67 Tdepth_t tab_upt_depth [_param->_nb_context]; 68 69 for (uint32_t i=0; i<_param->_nb_context; i++) 70 { 71 event_state_t event_state = reg_EVENT_STATE [i]; 72 73 retire_ras_from_ufpt [i] = ((event_state == EVENT_STATE_MISS_FLUSH_UFPT ) or 74 (event_state == EVENT_STATE_MISS_FLUSH_UFPT_AND_UPT ) or 75 (event_state == EVENT_STATE_EVENT_FLUSH_UFPT ) or 76 (event_state == EVENT_STATE_EVENT_FLUSH_UFPT_AND_UPT)); 77 retire_ras_from_upt [i] = ((event_state == EVENT_STATE_MISS_FLUSH_UPT) or 78 (event_state == EVENT_STATE_EVENT_FLUSH_UPT)); 79 80 // have_event [i] = (event_state == EVENT_STATE_EVENT_FLUSH_UPT); 81 82 ufpt_update [i] = true; 83 upt_update [i] = true; 84 tab_ufpt_depth [i] = reg_UFPT_UPDATE [i]; 85 tab_upt_depth [i] = reg_UPT_UPDATE [i]; 86 } 63 { 64 bool flush_ufpt [_param->_nb_context]; // event ufpt -> restore RAS, else update upt 65 bool flush_upt [_param->_nb_context]; // event upt -> restore RAS, else restore others structure 66 bool ufpt_can_update [_param->_nb_context]; 67 bool upt_can_update [_param->_nb_context]; 68 Tdepth_t tab_ufpt_depth [_param->_nb_context]; 69 Tdepth_t tab_upt_depth [_param->_nb_context]; 70 71 // Init 72 for (uint32_t i=0; i<_param->_nb_context; i++) 73 { 74 ufpt_event_state_t ufpt_event_state = reg_UFPT_EVENT_STATE [i]; 75 upt_event_state_t upt_event_state = reg_UPT_EVENT_STATE [i]; 76 77 flush_ufpt [i] = (ufpt_event_state == UFPT_EVENT_STATE_KO_FLUSH); 78 flush_upt [i] = ((upt_event_state == UPT_EVENT_STATE_KO_MISS_FLUSH_UPT) or 79 (upt_event_state == UPT_EVENT_STATE_KO_EVENT_FLUSH_UPT)); 80 ufpt_can_update [i] = true; 81 upt_can_update [i] = true; 82 tab_ufpt_depth [i] = reg_UFPT_UPDATE [i]; 83 tab_upt_depth [i] = reg_UPT_UPDATE [i]; 84 } 87 85 88 86 for (uint32_t i=0; i<_param->_nb_inst_update; i++) 89 87 { 90 Tcontext_t context = (reg_UPDATE_PRIORITY+i)%_param->_nb_context;88 Tcontext_t context = (reg_UPDATE_PRIORITY+i)%_param->_nb_context; 91 89 92 90 log_printf(TRACE,Update_Prediction_Table,FUNCTION," * UPDATE [%d] (genMoore)",i); 93 91 log_printf(TRACE,Update_Prediction_Table,FUNCTION," * context : %d",context); 94 log_printf(TRACE,Update_Prediction_Table,FUNCTION," * event_state : %s",toString(reg_EVENT_STATE [context]).c_str()); 92 log_printf(TRACE,Update_Prediction_Table,FUNCTION," * flush_ufpt : %d",flush_ufpt[context]); 93 log_printf(TRACE,Update_Prediction_Table,FUNCTION," * flush_upt : %d",flush_upt [context]); 95 94 96 95 Tcontrol_t val = false; 97 96 Tcontrol_t val_without_ack = false; 98 Tcontrol_t miss_prediction ;99 Tcontrol_t direction_good ;100 Tcontrol_t prediction_ifetch ;101 Tcontrol_t btb_val ;102 Taddress_t btb_address_src ;103 Taddress_t btb_address_dest ;104 Tbranch_condition_t btb_condition ;105 Tcontrol_t dir_val ;106 Thistory_t dir_history ;107 Tcontrol_t ras_val ;108 Tcontrol_t ras_flush ;109 Tcontrol_t ras_push ;110 Taddress_t ras_address ;111 Tptr_t ras_index ;97 Tcontrol_t miss_prediction = 0; // not necessary init 98 Tcontrol_t direction_good = 0; // not necessary init 99 Tcontrol_t prediction_ifetch = 0; // not necessary init 100 Tcontrol_t btb_val = 0; // not necessary init 101 Taddress_t btb_address_src = 0; // not necessary init 102 Taddress_t btb_address_dest = 0; // not necessary init 103 Tbranch_condition_t btb_condition = 0; // not necessary init 104 Tcontrol_t dir_val = 0; // not necessary init 105 Thistory_t dir_history = 0; // not necessary init 106 Tcontrol_t ras_val = 0; // not necessary init 107 Tcontrol_t ras_flush = 0; // not necessary init 108 Tcontrol_t ras_push = 0; // not necessary init 109 Taddress_t ras_address = 0; // not necessary init 110 Tptr_t ras_index = 0; // not necessary init 112 111 113 112 // Test if update fetch prediction table need update port 114 if ( retire_ras_from_ufpt [context])115 { 116 if (ufpt_ update [context])113 if (flush_ufpt [context]) 114 { 115 if (ufpt_can_update [context]) 117 116 { 118 117 // Update Fetch Prediction Table 119 // An update of ufpt is to previous miss. Just restore Return Address Stack 120 118 // An update of ufpt is to previous miss. Just restore Prediction_unit 119 120 // Read information 121 121 Tdepth_t depth = tab_ufpt_depth[context]; 122 122 ufpt_state_t state = reg_UPDATE_FETCH_PREDICTION_TABLE [context][depth]._state; … … 131 131 // val_without_ack = not update_ras(condition); 132 132 133 miss_prediction = 1; 133 miss_prediction = 1; // need update, also previous miss 134 134 // direction_good = ; 135 135 prediction_ifetch = 1; … … 138 138 // btb_address_dest = reg_UPDATE_PREDICTION_TABLE [context][depth]._address_dest; 139 139 // btb_condition = condition; 140 dir_val = update_ ras(condition);140 dir_val = update_dir(condition); 141 141 dir_history = reg_UPDATE_PREDICTION_TABLE [context][depth]._history; 142 // repop/ repush data -> don't corrupt ras 143 ras_val = update_ras(condition); 144 ras_flush = 0; 142 ras_val = update_ras(condition); // repop/ repush data -> don't corrupt ras 143 ras_flush = 0; // no ras corruption 145 144 ras_push = push_ras(condition); 146 145 ras_address = reg_UPDATE_FETCH_PREDICTION_TABLE [context][depth]._address_ras; … … 153 152 // Warning : don't update same entry 154 153 if (depth == reg_UFPT_BOTTOM[context]) 155 ufpt_update [context] = false; 156 157 tab_ufpt_depth[context] = ((depth==0)?_param->_size_ufpt_queue[context]:depth)-1; 154 ufpt_can_update [context] = false; 155 else 156 // update pointer 157 tab_ufpt_depth[context] = ((depth==0)?_param->_size_ufpt_queue[context]:depth)-1; 158 158 } 159 159 } 160 160 else 161 161 { 162 if (upt_ update [context])162 if (upt_can_update [context]) 163 163 { 164 164 // Update Prediction Table 165 165 166 // Read information 166 167 Tdepth_t depth = tab_upt_depth[context]; 167 168 upt_state_t state = reg_UPDATE_PREDICTION_TABLE [context][depth]._state; … … 174 175 log_printf(TRACE,Update_Prediction_Table,FUNCTION," * condition : %s",toString(condition).c_str()); 175 176 176 Tcontrol_t state_is_ok_ko = ((state == UPDATE_PREDICTION_STATE_OK ) or 177 (state == UPDATE_PREDICTION_STATE_KO )); 178 // Tcontrol_t state_is_event = ((state == UPDATE_PREDICTION_STATE_KO ) or 179 // (state == UPDATE_PREDICTION_STATE_EVENT)// or 180 // ((have_event[context])?(state == UPDATE_PREDICTION_STATE_OK):false) 181 // ); 182 183 // Tcontrol_t state_is_event_update = state_is_event and need_update(condition); 184 // Tcontrol_t state_is_event_no_update = state_is_event and not need_update(condition); 185 186 if (retire_ras_from_upt [context]) 177 // is the valid branch (valid branch hit, or valid branch miss) 178 Tcontrol_t state_is_ok_ko = ((state == UPDATE_PREDICTION_STATE_OK ) or 179 (state == UPDATE_PREDICTION_STATE_KO )); 180 181 if (not flush_upt [context]) 187 182 { 188 // val = state_is_event_update; 189 // val_without_ack = state_is_event_no_update; 190 val = ((state == UPDATE_PREDICTION_STATE_KO ) or 191 ((state == UPDATE_PREDICTION_STATE_EVENT) and need_update(condition))); 192 val_without_ack = ((state == UPDATE_PREDICTION_STATE_EVENT) and not need_update(condition)); 183 // no event, just update predictor 184 val = (state == UPDATE_PREDICTION_STATE_OK); 185 val_without_ack = false; 193 186 } 194 187 else 195 188 { 196 val = (state == UPDATE_PREDICTION_STATE_OK); 197 val_without_ack = false; 189 // event, restore event (if need update) 190 val = ( (state == UPDATE_PREDICTION_STATE_KO ) or 191 ((state == UPDATE_PREDICTION_STATE_EVENT) and need_update(condition))); 192 val_without_ack = ( (state == UPDATE_PREDICTION_STATE_EVENT) and not need_update(condition)); 198 193 } 199 194 … … 205 200 btb_address_dest = reg_UPDATE_PREDICTION_TABLE [context][depth]._address_dest; 206 201 btb_condition = condition; 207 dir_val = // state_is_ok_ko and 208 update_dir(condition); // if not ifetch, then static prediction 202 dir_val = ifetch and update_dir(condition); // if not ifetch, then static prediction -> history is wrong 209 203 dir_history = reg_UPDATE_PREDICTION_TABLE [context][depth]._history ; 210 204 ras_val = update_ras(condition); // repop/ repush data -> don't corrupt ras 211 ras_flush = (state == UPDATE_PREDICTION_STATE_KO); // miss prediction ,RAS is corrupted205 ras_flush = (state == UPDATE_PREDICTION_STATE_KO); // miss prediction on RAS -> RAS is corrupted 212 206 ras_push = push_ras(condition); 213 207 // If corrupt, RAS must be flushed. … … 218 212 internal_UPDATE_FROM_UFPT [i] = false; 219 213 internal_UPDATE_DEPTH [i] = depth; 220 internal_UPDATE_RAS [i] = retire_ras_from_upt [context];214 internal_UPDATE_RAS [i] = flush_upt [context]; 221 215 222 216 // Warning : don't update same entry 223 if ( retire_ras_from_upt [context])217 if (flush_upt [context]) 224 218 { 225 // Restore RAS.219 // Stop condition 226 220 if ((depth == reg_UPT_BOTTOM[context]) or not (val or val_without_ack)) 227 upt_ update [context] = false;221 upt_can_update [context] = false; 228 222 223 // flush -> ptr is decrease 229 224 tab_upt_depth[context] = (depth==0)?(_param->_size_upt_queue[context]-1):(depth-1); 230 225 } 231 226 else 232 227 { 228 // Stop condition 233 229 if ((depth == reg_UPT_TOP [context]) or not (val or val_without_ack)) 234 upt_ update [context] = false;230 upt_can_update [context] = false; 235 231 232 // flush -> ptr is increase 236 233 tab_upt_depth[context] = (depth+1)%_param->_size_upt_queue[context]; 237 234 } … … 273 270 } 274 271 } 275 272 } 273 276 274 // =================================================================== 277 275 // =====[ BRANCH_EVENT ]============================================== 278 276 // =================================================================== 277 278 // For all context ... 279 279 for (uint32_t i=0; i<_param->_nb_context; i++) 280 280 { 281 Tcontrol_t val = (reg_EVENT_STATE [i] == EVENT_STATE_UPDATE_CONTEXT); 282 281 // ... send an event if upt must be update the context 282 Tcontrol_t val = ((reg_UPT_EVENT_STATE [i] == UPT_EVENT_STATE_KO_DECODE_UPDATE_CONTEXT) or 283 (reg_UPT_EVENT_STATE [i] == UPT_EVENT_STATE_KO_COMMIT_UPDATE_CONTEXT)); 283 284 PORT_WRITE(out_BRANCH_EVENT_VAL [i],val); 284 285 if (_param->_have_port_depth) … … 291 292 internal_BRANCH_EVENT_VAL [i] = val; 292 293 } 294 293 295 } 294 296 else 295 297 { 298 // Reset 296 299 for (uint32_t i=0; i<_param->_nb_inst_update; i++) 297 300 { -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Update_Prediction_Table/src/Update_Prediction_Table_transition.cpp
r120 r122 51 51 reg_IS_ACCURATE [i] = true; 52 52 53 reg_EVENT_VAL [i] = false; 54 reg_EVENT_STATE [i] = EVENT_STATE_OK; 55 reg_EVENT_IS_BRANCH [i] = true; 53 reg_UFPT_EVENT_STATE [i] = UFPT_EVENT_STATE_OK; 54 reg_UPT_EVENT_STATE [i] = UPT_EVENT_STATE_OK; 55 56 // reg_EVENT_VAL [i] = false; 57 // reg_EVENT_STATE [i] = EVENT_STATE_OK; 58 // reg_EVENT_IS_BRANCH [i] = true; 56 59 } 57 60 } … … 74 77 for (uint32_t i=0; i<_param->_nb_context; i++) 75 78 { 79 // ----------------------------- 76 80 // UPDATE_FETCH_PREDICTION_TABLE 81 // ----------------------------- 77 82 { 78 83 uint32_t bottom = reg_UFPT_BOTTOM [i]; 79 80 // Test if state is end 81 if (reg_UPDATE_FETCH_PREDICTION_TABLE [i][bottom]._state == UPDATE_FETCH_PREDICTION_STATE_END) 84 bool end = (reg_UPDATE_FETCH_PREDICTION_TABLE [i][bottom]._state == UPDATE_FETCH_PREDICTION_STATE_END); 85 86 // Test if bottom slot can be remove 87 if (end) 82 88 { 83 89 log_printf(TRACE,Update_Prediction_Table,FUNCTION," * UFPT [%d][%d]",i,bottom); 84 90 log_printf(TRACE,Update_Prediction_Table,FUNCTION," * UFPT [%d][%d].state = UPDATE_FETCH_PREDICTION_STATE_EMPTY",i,bottom); 85 91 86 92 // Free slot 87 93 reg_UPDATE_FETCH_PREDICTION_TABLE [i][bottom]._state = UPDATE_FETCH_PREDICTION_STATE_EMPTY; 88 94 // Update pointer 89 reg_UFPT_BOTTOM [i] = (bottom+1)%_param->_size_ufpt_queue[i]; 95 bottom = (bottom+1)%_param->_size_ufpt_queue[i]; 96 97 reg_UFPT_BOTTOM [i] = bottom; 90 98 } 91 99 } 92 100 101 // ----------------------- 93 102 // UPDATE_PREDICTION_TABLE 103 // ----------------------- 94 104 { 95 uint32_t bottom = reg_UPT_BOTTOM [i]; 96 bool end = (reg_UPDATE_PREDICTION_TABLE [i][bottom]._state == UPDATE_PREDICTION_STATE_END); 97 // bool end_ok = (reg_UPDATE_PREDICTION_TABLE [i][bottom]._state == UPDATE_PREDICTION_STATE_END_OK); 98 // bool end_ko = (reg_UPDATE_PREDICTION_TABLE [i][bottom]._state == UPDATE_PREDICTION_STATE_END_KO); 99 // event_state_t event_state = reg_EVENT_STATE [i]; 100 101 // Test if state is end 102 // if (end_ok or end_ko) 103 104 log_printf(TRACE,Update_Prediction_Table,FUNCTION," * state is STATE_END : %d",end); 105 log_printf(TRACE,Update_Prediction_Table,FUNCTION," * reg_UPT_BOTTOM (before) : %d",reg_UPT_BOTTOM [i]); 106 107 if (end) 105 uint32_t bottom = reg_UPT_BOTTOM [i]; 106 107 // if (reg_UPT_EVENT_STATE [i] == UPT_EVENT_STATE_OK) 108 108 { 109 bool end = (reg_UPDATE_PREDICTION_TABLE [i][bottom]._state == UPDATE_PREDICTION_STATE_END); 110 111 log_printf(TRACE,Update_Prediction_Table,FUNCTION," * reg_UPT_BOTTOM (before) : %d",bottom); 112 log_printf(TRACE,Update_Prediction_Table,FUNCTION," * state is STATE_END : %d",end); 113 114 if (end) 115 { 109 116 #if defined(DEBUG) and defined(DEBUG_Update_Prediction_Table) and (DEBUG_Update_Prediction_Table == true) 110 if (reg_UPDATE_PREDICTION_TABLE [i][bottom]._retire_ok) 111 { 112 uint32_t num_thread = _param->_translate_num_context_to_num_thread [i]; 113 branchement_log_file [num_thread] 114 << std::hex 115 << "0x" << reg_UPDATE_PREDICTION_TABLE [i][bottom]._address_src << " " 116 << "0x" << reg_UPDATE_PREDICTION_TABLE [i][bottom]._address_dest << " " 117 << std::dec 118 << reg_UPDATE_PREDICTION_TABLE [i][bottom]._good_take << " - " 119 << "[" << simulation_cycle() << "] " << " " 120 << reg_UPDATE_PREDICTION_TABLE [i][bottom]._miss_prediction << " " 121 << reg_UPDATE_PREDICTION_TABLE [i][bottom]._ifetch_prediction << " " 122 << "(" << (uint32_t)reg_UPDATE_PREDICTION_TABLE [i][bottom]._condition << ")" 123 << std::endl; 117 if (reg_UPDATE_PREDICTION_TABLE [i][bottom]._retire_ok) 118 { 119 uint32_t num_thread = _param->_translate_num_context_to_num_thread [i]; 120 branchement_log_file [num_thread] 121 << std::hex 122 << "0x" << reg_UPDATE_PREDICTION_TABLE [i][bottom]._address_src << " " 123 << "0x" << reg_UPDATE_PREDICTION_TABLE [i][bottom]._address_dest << " " 124 << std::dec 125 << reg_UPDATE_PREDICTION_TABLE [i][bottom]._good_take << " - " 126 << "[" << simulation_cycle() << "] " << " " 127 << reg_UPDATE_PREDICTION_TABLE [i][bottom]._miss_prediction << " " 128 << reg_UPDATE_PREDICTION_TABLE [i][bottom]._ifetch_prediction << " " 129 << "(" << (uint32_t)reg_UPDATE_PREDICTION_TABLE [i][bottom]._condition << ")" 130 << std::endl; 131 } 132 #endif 133 134 log_printf(TRACE,Update_Prediction_Table,FUNCTION," * UPT [%d][%d]",i,bottom); 135 log_printf(TRACE,Update_Prediction_Table,FUNCTION," * UPT [%d][%d]._state = UPDATE_PREDICTION_STATE_EMPTY",i,bottom); 136 // Free slot 137 reg_UPDATE_PREDICTION_TABLE [i][bottom]._state = UPDATE_PREDICTION_STATE_EMPTY; 138 139 // Update pointer 140 reg_UPT_BOTTOM [i] = (bottom+1)%_param->_size_upt_queue[i]; 141 142 // Free a slot, test if bottom pointer overtake the top pointer 143 if (reg_UPT_BOTTOM [i] == reg_UPT_TOP [i]) 144 reg_UPT_EMPTY [i] = true; // free a slot 145 146 reg_EVENT_UPT_FULL [i] = false; 124 147 } 125 #endif126 log_printf(TRACE,Update_Prediction_Table,FUNCTION," * UPT [%d][%d]",i,bottom);127 log_printf(TRACE,Update_Prediction_Table,FUNCTION," * UPT [%d][%d]._state = UPDATE_PREDICTION_STATE_EMPTY",i,bottom);128 // Free slot129 reg_UPDATE_PREDICTION_TABLE [i][bottom]._state = UPDATE_PREDICTION_STATE_EMPTY;130 131 // Update pointer132 reg_UPT_BOTTOM [i] = (bottom+1)%_param->_size_upt_queue[i];133 148 134 if (reg_UPT_BOTTOM [i] == reg_UPT_TOP [i]) 135 reg_UPT_EMPTY [i] = true; // free a slot 136 137 // if (bottom = reg_UPT_UPDATE [i]) 138 // reg_UPT_UPDATE [i] = reg_UPT_BOTTOM [i]; 139 }// @@@ 140 141 log_printf(TRACE,Update_Prediction_Table,FUNCTION," * reg_UPT_BOTTOM (after ) : %d",reg_UPT_BOTTOM [i]); 142 log_printf(TRACE,Update_Prediction_Table,FUNCTION," * reg_EVENT_VAL : %d",reg_EVENT_VAL [i]); 143 log_printf(TRACE,Update_Prediction_Table,FUNCTION," * reg_EVENT_UPT_PTR : %d",reg_EVENT_UPT_PTR [i]); 144 log_printf(TRACE,Update_Prediction_Table,FUNCTION," * reg_EVENT_UPT_FULL : %d",reg_EVENT_UPT_FULL[i]); 145 146 if (reg_EVENT_VAL [i] and (reg_EVENT_UPT_PTR [i] == bottom)) 147 { 148 log_printf(TRACE,Update_Prediction_Table,FUNCTION," * END EVENT"); 149 150 if ((reg_EVENT_IS_BRANCH [i] == false) and (reg_EVENT_UPT_FULL [i] == false)) 151 reg_EVENT_STATE[i] = EVENT_STATE_OK; 152 153 if ((reg_EVENT_IS_BRANCH [i] == true) or (reg_EVENT_UPT_FULL [i] == false)) 154 { 155 reg_EVENT_VAL [i] = false; 156 // reg_EVENT_IS_BRANCH [i] = true; 157 reg_UPT_TOP [i] = reg_UPT_TOP_EVENT [i]; 158 reg_UPT_UPDATE [i] = reg_UPT_TOP_EVENT [i]; 159 160 if (reg_UPT_BOTTOM [i] != reg_UPT_TOP [i]) 161 reg_UPT_EMPTY [i] = false; 162 } 163 164 log_printf(TRACE,Update_Prediction_Table,FUNCTION," * reg_UPT_TOP : %d",reg_UPT_TOP [i]); 165 log_printf(TRACE,Update_Prediction_Table,FUNCTION," * reg_UPT_TOP_EVENT : %d",reg_UPT_TOP_EVENT [i]); 166 log_printf(TRACE,Update_Prediction_Table,FUNCTION," * reg_UPT_UPDATE : %d",reg_UPT_UPDATE [i]); 167 log_printf(TRACE,Update_Prediction_Table,FUNCTION," * reg_UPT_EMPTY : %d",reg_UPT_EMPTY [i]); 168 149 log_printf(TRACE,Update_Prediction_Table,FUNCTION," * reg_UPT_BOTTOM (after ) : %d",reg_UPT_BOTTOM [i]); 169 150 } 170 171 if (end)172 reg_EVENT_UPT_FULL [i] = false;173 151 } 174 152 } … … 186 164 187 165 for (uint32_t i=0; i<_param->_nb_inst_predict; i++) 166 // Test if have a transaction 188 167 if (PORT_READ(in_PREDICT_VAL[i]) and internal_PREDICT_ACK [i]) 189 168 { 190 Tcontext_t context = (_param->_have_port_context_id)?PORT_READ(in_PREDICT_CONTEXT_ID [i]):0; 191 uint32_t top = internal_PREDICT_UPDATE_PREDICTION_ID [i]; 169 // get transaction information 170 Tcontext_t context = (_param->_have_port_context_id)?PORT_READ(in_PREDICT_CONTEXT_ID [i]):0; 171 uint32_t top = internal_PREDICT_UPDATE_PREDICTION_ID [i]; 172 Tbranch_condition_t condition = PORT_READ(in_PREDICT_BTB_CONDITION [i]); 173 bool is_accurate = (_param->_always_accurate_predict or 174 (_param->_can_accurate_predict and PORT_READ(in_PREDICT_BTB_IS_ACCURATE [i]))); 175 192 176 193 177 log_printf(TRACE,Update_Prediction_Table,FUNCTION," * PREDICT[%d] - Accepted",i); 194 log_printf(TRACE,Update_Prediction_Table,FUNCTION," * context : %d",context); 195 log_printf(TRACE,Update_Prediction_Table,FUNCTION," * top : %d",top); 178 log_printf(TRACE,Update_Prediction_Table,FUNCTION," * context : %d",context); 179 log_printf(TRACE,Update_Prediction_Table,FUNCTION," * top : %d",top); 180 log_printf(TRACE,Update_Prediction_Table,FUNCTION," * condition : %d",condition); 181 log_printf(TRACE,Update_Prediction_Table,FUNCTION," * is_accurate : %d",is_accurate); 196 182 197 183 #ifdef DEBUG_TEST … … 200 186 #endif 201 187 188 // Ifetch unit have fetch an instruction bundle with a branchement. 189 // Insert in UFPT 202 190 log_printf(TRACE,Update_Prediction_Table,FUNCTION," * UFPT [%d][%d].state <- UPDATE_FETCH_PREDICTION_STATE_WAIT_DECOD (predict)",context,top); 203 191 reg_UPDATE_FETCH_PREDICTION_TABLE [context][top]._state = UPDATE_FETCH_PREDICTION_STATE_WAIT_DECOD; 204 192 205 Tbranch_condition_t condition = PORT_READ(in_PREDICT_BTB_CONDITION [i]); 206 bool is_accurate = _param->_accurate_block_predict or PORT_READ(in_PREDICT_BTB_IS_ACCURATE [i]); 193 // Write information 207 194 reg_UPDATE_FETCH_PREDICTION_TABLE [context][top]._condition = condition; 208 195 reg_UPDATE_FETCH_PREDICTION_TABLE [context][top]._address_src = PORT_READ(in_PREDICT_BTB_ADDRESS_SRC [i]); … … 214 201 reg_UPDATE_FETCH_PREDICTION_TABLE [context][top]._index_ras = PORT_READ(in_PREDICT_RAS_INDEX [i]); 215 202 203 // Update pointer 216 204 reg_UFPT_TOP [context] = (top+1)%_param->_size_ufpt_queue [context]; 217 // reg_UFPT_UPDATE [context] = reg_UFPT_TOP [context]; 205 206 // Test if this branchement need update 218 207 if (need_update(condition)) 219 208 { 220 209 reg_UFPT_NB_NEED_UPDATE [context] ++; 221 210 log_printf(TRACE,Update_Prediction_Table,FUNCTION," * reg_UFPT_NB_NEED_UPDATE (after) : %d",reg_UFPT_NB_NEED_UPDATE [context]); 222 223 211 } 224 212 } … … 239 227 240 228 for (uint32_t i=0; i<_param->_nb_inst_decod; i++) 229 // Test if have a decod transaction 241 230 if (PORT_READ(in_DECOD_VAL[i]) and internal_DECOD_ACK [i]) 242 231 { 232 // Read information 243 233 Tcontext_t context = (_param->_have_port_context_id)?PORT_READ(in_DECOD_CONTEXT_ID [i]):0; 244 234 Tcontrol_t miss_ifetch = PORT_READ(in_DECOD_MISS_IFETCH [i]); 245 235 Tcontrol_t miss_decod = PORT_READ(in_DECOD_MISS_DECOD [i]); 246 236 uint32_t upt_ptr_write = internal_DECOD_UPT_PTR_WRITE [i]; 237 uint32_t top_next = (upt_ptr_write+1)%_param->_size_upt_queue [context]; 247 238 Tbranch_condition_t condition ; 248 239 Tcontrol_t is_accurate; … … 257 248 log_printf(TRACE,Update_Prediction_Table,FUNCTION," * upt_ptr_write : %d",upt_ptr_write); 258 249 259 if (miss_ifetch or miss_decod) 250 // In decod step, two miss type : 251 // miss_ifetch = branch is previously predict (predict interface), but it's not the good 252 // miss_decod = branch was not detected 253 if (not (miss_ifetch or miss_decod)) 260 254 { 255 // Normal case : branch is previous predicted, change state of branch 256 257 // Read ufpt_ptr (send in predic step) 258 uint32_t ufpt_ptr_read = (_param->_have_port_depth)?PORT_READ(in_DECOD_UPDATE_PREDICTION_ID [i]):0; 259 260 log_printf(TRACE,Update_Prediction_Table,FUNCTION," * ufpt_ptr_read : %d",ufpt_ptr_read); 261 262 #ifdef DEBUG_TEST 263 if (reg_UPDATE_FETCH_PREDICTION_TABLE [context][ufpt_ptr_read]._state != UPDATE_FETCH_PREDICTION_STATE_WAIT_DECOD) 264 throw ERRORMORPHEO(FUNCTION,_("Decod : invalid ufpt state.")); 265 #endif 266 // Change state 267 log_printf(TRACE,Update_Prediction_Table,FUNCTION," * UFPT [%d][%d].state <- UPDATE_FETCH_PREDICTION_STATE_END (decod - hit)",context,ufpt_ptr_read); 268 reg_UPDATE_FETCH_PREDICTION_TABLE [context][ufpt_ptr_read]._state = UPDATE_FETCH_PREDICTION_STATE_END; 269 270 // Push upt (from Pop ufpt) 271 condition = reg_UPDATE_FETCH_PREDICTION_TABLE [context][ufpt_ptr_read]._condition; 272 is_accurate = reg_UPDATE_FETCH_PREDICTION_TABLE [context][ufpt_ptr_read]._is_accurate; 273 274 reg_UPDATE_PREDICTION_TABLE [context][upt_ptr_write]._condition = condition; 275 reg_UPDATE_PREDICTION_TABLE [context][upt_ptr_write]._address_src = reg_UPDATE_FETCH_PREDICTION_TABLE [context][ufpt_ptr_read]._address_src ; 276 reg_UPDATE_PREDICTION_TABLE [context][upt_ptr_write]._address_dest = reg_UPDATE_FETCH_PREDICTION_TABLE [context][ufpt_ptr_read]._address_dest; 277 reg_UPDATE_PREDICTION_TABLE [context][upt_ptr_write]._last_take = reg_UPDATE_FETCH_PREDICTION_TABLE [context][ufpt_ptr_read]._last_take ; 278 // reg_UPDATE_PREDICTION_TABLE [context][upt_ptr_write]._good_take; 279 reg_UPDATE_PREDICTION_TABLE [context][upt_ptr_write]._is_accurate = is_accurate; 280 reg_UPDATE_PREDICTION_TABLE [context][upt_ptr_write]._history = reg_UPDATE_FETCH_PREDICTION_TABLE [context][ufpt_ptr_read]._history ; 281 reg_UPDATE_PREDICTION_TABLE [context][upt_ptr_write]._address_ras = reg_UPDATE_FETCH_PREDICTION_TABLE [context][ufpt_ptr_read]._address_ras ; 282 reg_UPDATE_PREDICTION_TABLE [context][upt_ptr_write]._index_ras = reg_UPDATE_FETCH_PREDICTION_TABLE [context][ufpt_ptr_read]._index_ras ; 283 reg_UPDATE_PREDICTION_TABLE [context][upt_ptr_write]._ifetch_prediction = true ; // prediction from ifetch 284 285 // Update pointer (now, this instruction is not in ufpt) 286 if (need_update(condition)) 287 { 288 reg_UFPT_NB_NEED_UPDATE [context] --; 289 log_printf(TRACE,Update_Prediction_Table,FUNCTION," * reg_UFPT_NB_NEED_UPDATE (after) : %d",reg_UFPT_NB_NEED_UPDATE [context]); 290 } 291 } 292 else 293 { 294 // Have a miss !!! 261 295 log_printf(TRACE,Update_Prediction_Table,FUNCTION," * miss !!!"); 262 296 263 // Have a miss !!!264 297 condition = PORT_READ(in_DECOD_BTB_CONDITION [i]); 265 is_accurate = _param->_accurate_block_decod or PORT_READ(in_DECOD_IS_ACCURATE [i]); 266 267 // if can_continue else don't wait the end of all instruction 268 // can_continue = not miss_commit and the destination is accurate (know) 298 is_accurate = (_param->_always_accurate_decod or 299 (_param->_can_accurate_decod and PORT_READ(in_DECOD_IS_ACCURATE [i]))); 300 301 // if can_continue, don't wait the end of all instruction 302 // (can_continue = not miss_commit and the destination is accurate (know)) 269 303 Tcontrol_t can_continue = is_accurate; 270 304 271 305 #ifdef DEBUG_TEST 272 if (reg_EVENT_STATE [context] != EVENT_STATE_OK) 273 throw ERRORMORPHEO(FUNCTION,_("Decod : invalid event state.")); 274 #endif 275 276 // miss_ifetch = branch is previously predict, but it's not the good 277 // * need flush ufpt 278 // miss_decod = branch was not detected 279 // * not necessary 306 if (reg_UPT_EVENT_STATE [context] != UPT_EVENT_STATE_OK) 307 throw ERRORMORPHEO(FUNCTION,_("Decod : invalid upt event state.")); 308 if (reg_UFPT_EVENT_STATE [context] != UFPT_EVENT_STATE_OK) 309 throw ERRORMORPHEO(FUNCTION,_("Decod : invalid ufpt event state.")); 310 #endif 311 312 // miss_ifetch -> need flush ufpt 313 // miss_decod -> not necessary 314 // if can_continue (destination is know) and direction is not take (instruction in ifetch_queue can be valid) 315 bool flush_ufpt = (not (can_continue and not direction and not miss_ifetch)); 280 316 281 317 log_printf(TRACE,Update_Prediction_Table,FUNCTION," * can_continue: %d",can_continue); 282 318 log_printf(TRACE,Update_Prediction_Table,FUNCTION," * direction : %d",direction ); 283 319 log_printf(TRACE,Update_Prediction_Table,FUNCTION," * miss_ifetch : %d",miss_ifetch ); 284 log_printf(TRACE,Update_Prediction_Table,FUNCTION," * change : %d",(not (can_continue and not direction and not miss_ifetch)));285 286 // if can_continue (destination is know) and direction is not take, don't need flush fetch_unit.287 if ( not (can_continue and not direction and not miss_ifetch))320 log_printf(TRACE,Update_Prediction_Table,FUNCTION," * flush_ufpt: %d",flush_ufpt ); 321 322 // Test if can continue without flushing the ufpt (and ifetch_queue) 323 if (flush_ufpt) 288 324 { 289 if (reg_UFPT_NB_NEED_UPDATE [context] == 0) 290 { 291 // Change state 292 log_printf(TRACE,Update_Prediction_Table,FUNCTION," * EVENT [%d] <- EVENT_STATE_UPDATE_CONTEXT (decod - miss - no flush ufpt)",context); 293 reg_EVENT_STATE [context] = EVENT_STATE_UPDATE_CONTEXT; 294 // reg_EVENT_SOURCE[context] = EVENT_SOURCE_UFPT; 295 } 296 else 297 { 298 log_printf(TRACE,Update_Prediction_Table,FUNCTION," * EVENT [%d] <- EVENT_STATE_MISS_FLUSH_UFPT (decod - miss - flush ufpt)",context); 299 reg_EVENT_STATE [context] = EVENT_STATE_MISS_FLUSH_UFPT; 300 } 301 302 // Flush UPFT 325 // // Optimisation : Test if ufpt have entry that need update prediction struction (as Return Address Stack) 326 // if (reg_UFPT_NB_NEED_UPDATE [context] == 0) 327 // { 328 // // Change state 329 // log_printf(TRACE,Update_Prediction_Table,FUNCTION," * UPT_EVENT [%d] <- UPT_EVENT_STATE_KO_COMMIT_UPDATE_CONTEXT (decod - miss - no flush ufpt)",context); 330 // reg_UPT_EVENT_STATE [context] = UPT_EVENT_STATE_KO_COMMIT_UPDATE_CONTEXT; 331 332 // // @@@ 333 // // // Have an actual event ? 334 // // if (not reg_EVENT_VAL [context]) 335 // // reg_EVENT_UPT_PTR [context] = upt_ptr_write; 336 // } 337 // else 338 // { 339 // log_printf(TRACE,Update_Prediction_Table,FUNCTION," * EVENT [%d] <- UPT_EVENT_STATE_KO_MISS_WAIT_UFPT (decod - miss - flush ufpt)",context); 340 // // just wait ufpt, don't flush upt 341 // reg_UPT_EVENT_STATE [context] = UPT_EVENT_STATE_KO_MISS_WAIT_UFPT; 342 // } 343 344 reg_UPT_EVENT_STATE [context] = UPT_EVENT_STATE_KO_DECODE_UPDATE_CONTEXT; 345 log_printf(TRACE,Update_Prediction_Table,FUNCTION," * UPT_EVENT_STATE [%d] <- %s (decod, miss)",context,toString(reg_UPT_EVENT_STATE [context]).c_str()); 346 347 // Need Flush UPFT 303 348 flush_UFPT [context] = true; 304 349 305 reg_EVENT_IS_BRANCH [context] = true; 350 // Write information 351 // reg_EVENT_IS_BRANCH [context] = true; 306 352 reg_EVENT_DEPTH [context] = upt_ptr_write; 307 353 reg_EVENT_ADDRESS_SRC [context] = address_src; // delay_slot is compute in Context_State … … 310 356 reg_EVENT_CAN_CONTINUE [context] = can_continue; 311 357 } 312 358 // else can continue 359 313 360 // Push upt (from decod interface) 314 361 reg_UPDATE_PREDICTION_TABLE [context][upt_ptr_write]._condition = condition; … … 323 370 reg_UPDATE_PREDICTION_TABLE [context][upt_ptr_write]._ifetch_prediction = false; // static prediction 324 371 } 325 else 326 { 327 // Normal case : branch is previous predicated, change state of branch 328 uint32_t ufpt_ptr_read = (_param->_have_port_depth)?PORT_READ(in_DECOD_UPDATE_PREDICTION_ID [i]):0; 329 330 log_printf(TRACE,Update_Prediction_Table,FUNCTION," * ufpt_ptr_read : %d",ufpt_ptr_read); 331 332 #ifdef DEBUG_TEST 333 if (reg_UPDATE_FETCH_PREDICTION_TABLE [context][ufpt_ptr_read]._state != UPDATE_FETCH_PREDICTION_STATE_WAIT_DECOD) 334 throw ERRORMORPHEO(FUNCTION,_("Decod : invalid ufpt state.")); 335 #endif 336 // Change state 337 log_printf(TRACE,Update_Prediction_Table,FUNCTION," * UFPT [%d][%d].state <- UPDATE_FETCH_PREDICTION_STATE_END (decod - hit)",context,ufpt_ptr_read); 338 reg_UPDATE_FETCH_PREDICTION_TABLE [context][ufpt_ptr_read]._state = UPDATE_FETCH_PREDICTION_STATE_END; 339 340 // Push upt (from Pop ufpt) 341 condition = reg_UPDATE_FETCH_PREDICTION_TABLE [context][ufpt_ptr_read]._condition; 342 is_accurate = reg_UPDATE_FETCH_PREDICTION_TABLE [context][ufpt_ptr_read]._is_accurate; 343 344 reg_UPDATE_PREDICTION_TABLE [context][upt_ptr_write]._condition = condition; 345 reg_UPDATE_PREDICTION_TABLE [context][upt_ptr_write]._address_src = reg_UPDATE_FETCH_PREDICTION_TABLE [context][ufpt_ptr_read]._address_src ; 346 reg_UPDATE_PREDICTION_TABLE [context][upt_ptr_write]._address_dest = reg_UPDATE_FETCH_PREDICTION_TABLE [context][ufpt_ptr_read]._address_dest; 347 reg_UPDATE_PREDICTION_TABLE [context][upt_ptr_write]._last_take = reg_UPDATE_FETCH_PREDICTION_TABLE [context][ufpt_ptr_read]._last_take ; 348 // reg_UPDATE_PREDICTION_TABLE [context][upt_ptr_write]._good_take; 349 reg_UPDATE_PREDICTION_TABLE [context][upt_ptr_write]._is_accurate = is_accurate; 350 reg_UPDATE_PREDICTION_TABLE [context][upt_ptr_write]._history = reg_UPDATE_FETCH_PREDICTION_TABLE [context][ufpt_ptr_read]._history ; 351 reg_UPDATE_PREDICTION_TABLE [context][upt_ptr_write]._address_ras = reg_UPDATE_FETCH_PREDICTION_TABLE [context][ufpt_ptr_read]._address_ras ; 352 reg_UPDATE_PREDICTION_TABLE [context][upt_ptr_write]._index_ras = reg_UPDATE_FETCH_PREDICTION_TABLE [context][ufpt_ptr_read]._index_ras ; 353 reg_UPDATE_PREDICTION_TABLE [context][upt_ptr_write]._ifetch_prediction = true ; // prediction from ifetch 354 355 // Update pointer 356 if (need_update(condition)) 357 { 358 reg_UFPT_NB_NEED_UPDATE [context] --; 359 log_printf(TRACE,Update_Prediction_Table,FUNCTION," * reg_UFPT_NB_NEED_UPDATE (after) : %d",reg_UFPT_NB_NEED_UPDATE [context]); 360 } 361 } 362 363 // All case !!! 372 373 // In all case !!! 364 374 #ifdef DEBUG_TEST 365 375 if (reg_UPDATE_PREDICTION_TABLE [context][upt_ptr_write]._state != UPDATE_PREDICTION_STATE_EMPTY) … … 369 379 // Change state 370 380 log_printf(TRACE,Update_Prediction_Table,FUNCTION," * UPT [%d][%d].state <- UPDATE_PREDICTION_STATE_WAIT_END (decod - hit)",context,upt_ptr_write); 371 reg_UPDATE_PREDICTION_TABLE [context][upt_ptr_write]._state = UPDATE_PREDICTION_STATE_WAIT_END;381 reg_UPDATE_PREDICTION_TABLE [context][upt_ptr_write]._state = UPDATE_PREDICTION_STATE_WAIT_END; 372 382 reg_UPDATE_PREDICTION_TABLE [context][upt_ptr_write]._retire_ok = false; 373 383 reg_UPDATE_PREDICTION_TABLE [context][upt_ptr_write]._miss_commit = false; … … 384 394 385 395 // Update pointer 386 reg_UPT_TOP [context] = (upt_ptr_write+1)%_param->_size_upt_queue [context]; 387 reg_UPT_EMPTY [context] = false; 388 // reg_UPT_UPDATE [context] = reg_UPT_TOP [context]; 389 390 // if (miss_ifetch or miss_decod) 391 // reg_UPT_TOP_EVENT [context] = reg_UPT_TOP [context]; 396 reg_UPT_TOP [context] = top_next; 397 reg_UPT_EMPTY [context] = false; // new instruction 392 398 } 393 399 … … 400 406 can_continue [i] = true; 401 407 408 // For each updated instruction 402 409 for (uint32_t i=0; i<_param->_nb_inst_update; i++) 403 410 { 404 411 Tcontext_t context = internal_UPDATE_CONTEXT_ID [i]; 405 412 413 // Test if transaction 414 // (an val_with_out is an update and don't need update prediction structure 406 415 if ((internal_UPDATE_VAL[i] and PORT_READ(in_UPDATE_ACK [i])) or 407 416 (internal_UPDATE_VAL_WITHOUT_ACK [i] and can_continue [context])) … … 413 422 log_printf(TRACE,Update_Prediction_Table,FUNCTION," * depth : %d",depth); 414 423 424 upt_event_state_t upt_event_state = reg_UPT_EVENT_STATE [context]; 425 426 // One interface to two source : 427 // * from ufpt -> newest prediction 428 // * from upt -> oldest prediction 415 429 if (internal_UPDATE_FROM_UFPT [i]) 416 430 { 417 431 // if free a slot, also all queue is updated 418 432 // Last slot ? 419 // if (reg_UFPT_UPDATE [context] == reg_UFPT_BOTTOM [context])420 433 if ((--reg_UFPT_NB_UPDATE [context])==0) 421 434 { 422 switch (reg_EVENT_STATE [context])423 {424 case EVENT_STATE_MISS_FLUSH_UFPT :425 { 426 reg_EVENT_STATE [context] = EVENT_STATE_UPDATE_CONTEXT; 427 // reg_EVENT_SOURCE[context] = EVENT_SOURCE_UFPT;428 429 break; 430 } 431 // impossible to have an update on ufpt and reg_upt_update>reg_upt_top 432 case EVENT_STATE_MISS_FLUSH_UFPT_AND_UPT : reg_EVENT_STATE [context] = EVENT_STATE_MISS_FLUSH_UPT; break;433 case EVENT_STATE_EVENT_FLUSH_UFPT : reg_EVENT_STATE [context] = EVENT_STATE_OK ;break;434 case EVENT_STATE_EVENT_FLUSH_UFPT_AND_UPT: reg_EVENT_STATE [context] = EVENT_STATE_EVENT_FLUSH_UPT; break; 435 default : break; 436 } 435 log_printf(TRACE,Update_Prediction_Table,FUNCTION," * UFPT_EVENT [%d] <- UFPT_EVENT_STATE_OK (update - end flush ufpt)",context); 436 reg_UFPT_EVENT_STATE [context] = UFPT_EVENT_STATE_OK; 437 reg_UFPT_NB_NEED_UPDATE [context] = 0; 438 439 // // Test upt event to change state 440 // // test if upt wait ufpt 441 // switch (upt_event_state) 442 // { 443 // // this case when don't need flush upt (miss decod and can continue) 444 // case UPT_EVENT_STATE_KO_MISS_WAIT_UFPT : upt_event_state = UPT_EVENT_STATE_KO_COMMIT_UPDATE_CONTEXT; break; 445 // case UPT_EVENT_STATE_KO_EVENT_WAIT_UFPT : upt_event_state = UPT_EVENT_STATE_OK ; break; 446 // default : break; 447 // } 448 449 // reg_UPT_EVENT_STATE [context] = upt_event_state; 437 450 } 438 451 … … 453 466 reg_UFPT_UPDATE [context] = ((depth==0)?_param->_size_ufpt_queue[context]:depth)-1; 454 467 log_printf(TRACE,Update_Prediction_Table,FUNCTION," * reg_UFPT_UPDATE (after ) : %d",reg_UFPT_UPDATE [context]); 455 // Free a register that need update ?456 if (need_update(reg_UPDATE_FETCH_PREDICTION_TABLE [context][depth]._condition))457 {458 reg_UFPT_NB_NEED_UPDATE [context] --;459 log_printf(TRACE,Update_Prediction_Table,FUNCTION," * reg_UFPT_NB_NEED_UPDATE (after) : %d",reg_UFPT_NB_NEED_UPDATE [context]);460 }461 468 } 462 469 else … … 464 471 log_printf(TRACE,Update_Prediction_Table,FUNCTION," * Update Prediction Table"); 465 472 log_printf(TRACE,Update_Prediction_Table,FUNCTION," * reg_UPT_UPDATE (before) : %d",reg_UPT_UPDATE [context]); 466 log_printf(TRACE,Update_Prediction_Table,FUNCTION," * reg_ EVENT_STATE : %s",toString(reg_EVENT_STATE [context]).c_str());473 log_printf(TRACE,Update_Prediction_Table,FUNCTION," * reg_UPT_EVENT_STATE : %s",toString(upt_event_state).c_str()); 467 474 468 475 // Change state … … 481 488 #endif 482 489 483 // bool have_event = ((reg_UPDATE_PREDICTION_TABLE [context][depth]._state == UPDATE_PREDICTION_STATE_KO) or484 // (reg_UPDATE_PREDICTION_TABLE [context][depth]._state == UPDATE_PREDICTION_STATE_EVENT));485 490 #ifdef STATISTICS 486 491 Tbranch_condition_t condition = reg_UPDATE_PREDICTION_TABLE [context][depth]._condition; 487 492 #endif 488 bool ok = (reg_UPDATE_PREDICTION_TABLE [context][depth]._state == UPDATE_PREDICTION_STATE_OK); 489 bool ko = (reg_UPDATE_PREDICTION_TABLE [context][depth]._state == UPDATE_PREDICTION_STATE_KO); 490 493 bool ok = (reg_UPDATE_PREDICTION_TABLE [context][depth]._state == UPDATE_PREDICTION_STATE_OK); 494 bool ko = (reg_UPDATE_PREDICTION_TABLE [context][depth]._state == UPDATE_PREDICTION_STATE_KO); 495 496 // Test if branch is valid (prediction can be incorrect) 491 497 if (ok or ko) 492 498 { … … 508 514 if (ko) 509 515 { 510 // Ko : wait end of all instruction 511 // log_printf(TRACE,Update_Prediction_Table,FUNCTION," * UPT [%d][%d].state <- UPDATE_PREDICTION_STATE_END_KO_WAIT_END (update)",context,depth); 512 513 // reg_UPDATE_PREDICTION_TABLE [context][depth]._state = UPDATE_PREDICTION_STATE_END_KO_WAIT_END; 514 516 // Ko 515 517 log_printf(TRACE,Update_Prediction_Table,FUNCTION," * UPT [%d][%d].state <- UPDATE_PREDICTION_STATE_END_KO (update)",context,depth); 516 518 519 // Wait update of context_state 517 520 reg_UPDATE_PREDICTION_TABLE [context][depth]._state = UPDATE_PREDICTION_STATE_END_KO; 518 521 519 reg_EVENT_VAL [context] = true;520 522 reg_EVENT_UPT_PTR [context] = depth; 521 // reg_EVENT_UPT_FULL [context] = 0;522 // reg_EVENT_UPT_FULL [i] = (not reg_UPT_EMPTY [i] and (bottom == reg_UPT_TOP [i]));523 524 523 525 524 #ifdef STATISTICS … … 530 529 else 531 530 { 532 // log_printf(TRACE,Update_Prediction_Table,FUNCTION," * UPT [%d][%d].state <- UPDATE_PREDICTION_STATE_END_OK (update)",context,depth); 533 // reg_UPDATE_PREDICTION_TABLE [context][depth]._state = UPDATE_PREDICTION_STATE_END_OK; 531 // ok or event 534 532 535 533 log_printf(TRACE,Update_Prediction_Table,FUNCTION," * UPT [%d][%d].state <- UPDATE_PREDICTION_STATE_END (update)",context,depth); … … 564 562 // reg_UPT_UPDATE [context] = reg_UPT_BOTTOM[context]; 565 563 566 if (reg_EVENT_STATE [context] == EVENT_STATE_EVENT_FLUSH_UPT)564 switch (upt_event_state) 567 565 { 568 reg_EVENT_STATE [context] = EVENT_STATE_OK; 566 // this case when don't need flush upt (miss decod and can continue) 567 case UPT_EVENT_STATE_KO_MISS_FLUSH_UPT : upt_event_state = UPT_EVENT_STATE_KO_COMMIT_UPDATE_CONTEXT; break; 568 case UPT_EVENT_STATE_KO_EVENT_FLUSH_UPT : 569 { 570 upt_event_state = UPT_EVENT_STATE_OK; 571 reg_UPT_TOP [context] = reg_UPT_TOP_EVENT [context]; 572 reg_UPT_UPDATE [context] = reg_UPT_TOP_EVENT [context]; 573 574 break; 575 } 576 default : break; 569 577 } 570 else 571 { 572 reg_EVENT_STATE [context] = EVENT_STATE_UPDATE_CONTEXT; 573 // reg_EVENT_SOURCE[context] = EVENT_SOURCE_UPT; 574 } 578 579 reg_UPT_EVENT_STATE [context] = upt_event_state; 575 580 } 576 581 else 577 582 { 583 // else, decrease update pointer 578 584 reg_UPT_UPDATE [context] = (((depth==0)?_param->_size_upt_queue[context]:depth)-1); 579 585 } … … 587 593 } 588 594 589 // Freethe branch with no accurate ?595 // Test if freeing the branch with no accurate ? 590 596 if ((reg_UPDATE_PREDICTION_TABLE [context][depth]._is_accurate == false) and not ko) 591 597 reg_IS_ACCURATE [context] = true; 592 598 593 599 log_printf(TRACE,Update_Prediction_Table,FUNCTION," * reg_UPT_UPDATE (after ) : %d",reg_UPT_UPDATE[context]); 594 log_printf(TRACE,Update_Prediction_Table,FUNCTION," * reg_ EVENT_STATE : %s",toString(reg_EVENT_STATE [context]).c_str());600 log_printf(TRACE,Update_Prediction_Table,FUNCTION," * reg_UPT_EVENT_STATE : %s",toString(reg_UPT_EVENT_STATE [context]).c_str()); 595 601 } 596 602 } … … 611 617 // * update status 612 618 // * Miss prediction : 613 for (uint32_t i=0; i<_param->_nb_inst_branch_complete; i++) 614 if (PORT_READ(in_BRANCH_COMPLETE_VAL[i]) and internal_BRANCH_COMPLETE_ACK [i]) 615 { 616 Tcontext_t context = (_param->_have_port_context_id)?PORT_READ(in_BRANCH_COMPLETE_CONTEXT_ID [i]):0; 617 Tdepth_t depth = (_param->_have_port_depth )?PORT_READ(in_BRANCH_COMPLETE_DEPTH [i]):0; 618 Tcontrol_t miss = internal_BRANCH_COMPLETE_MISS_PREDICTION [i]; 619 Tcontrol_t good_take = internal_BRANCH_COMPLETE_TAKE [i]; 620 Taddress_t good_addr = internal_BRANCH_COMPLETE_ADDRESS_DEST [i]; 621 622 log_printf(TRACE,Update_Prediction_Table,FUNCTION," * BRANCH_COMPLETE[%d] - Accepted",i); 623 log_printf(TRACE,Update_Prediction_Table,FUNCTION," * context : %d",context); 624 log_printf(TRACE,Update_Prediction_Table,FUNCTION," * depth : %d",depth); 625 log_printf(TRACE,Update_Prediction_Table,FUNCTION," * miss : %d",miss); 626 log_printf(TRACE,Update_Prediction_Table,FUNCTION," * reg_EVENT_STATE : %s",toString(reg_EVENT_STATE [context]).c_str()); 627 628 if (miss) 629 { 630 // Flush UPT 631 uint32_t top = reg_UPT_TOP [context]; 632 uint32_t new_update = ((top==0)?_param->_size_upt_queue[context]:top)-1; 633 634 Taddress_t address_src = reg_UPDATE_PREDICTION_TABLE [context][depth]._address_src; 635 event_state_t event_state = reg_EVENT_STATE [context]; 636 upt_state_t event_top = reg_UPDATE_PREDICTION_TABLE [context][top]._state; 637 638 log_printf(TRACE,Update_Prediction_Table,FUNCTION," * event_top : %s",toString(event_top).c_str()); 639 640 bool previous_ufpt_event = ((event_state == EVENT_STATE_MISS_FLUSH_UFPT_AND_UPT ) or 641 (event_state == EVENT_STATE_MISS_FLUSH_UFPT ) or 642 (event_state == EVENT_STATE_EVENT_FLUSH_UFPT_AND_UPT) or 643 (event_state == EVENT_STATE_EVENT_FLUSH_UFPT )); 644 645 bool previous_upt_event = (false 646 or (event_state == EVENT_STATE_MISS_FLUSH_UFPT_AND_UPT ) 647 or (event_state == EVENT_STATE_MISS_FLUSH_UPT ) 648 or (event_state == EVENT_STATE_EVENT_FLUSH_UFPT_AND_UPT) 649 or (event_state == EVENT_STATE_EVENT_FLUSH_UPT ) 650 or (event_top == UPDATE_PREDICTION_STATE_END_KO ) 651 or (event_top == UPDATE_PREDICTION_STATE_KO ) 652 // or (event_state == EVENT_STATE_WAIT_END_EVENT ) 653 // or ((event_state == EVENT_STATE_UPDATE_CONTEXT ) 654 // and (reg_EVENT_SOURCE [context] == EVENT_SOURCE_UPT)) 655 ); 656 // bool update_ras = (new_update != depth); 657 658 log_printf(TRACE,Update_Prediction_Table,FUNCTION," * top : %d",top); 659 log_printf(TRACE,Update_Prediction_Table,FUNCTION," * new_update : %d",new_update); 660 // log_printf(TRACE,Update_Prediction_Table,FUNCTION," * update_ras : %d",update_ras); 661 log_printf(TRACE,Update_Prediction_Table,FUNCTION," * previous_upt_event : %d",previous_upt_event); 662 log_printf(TRACE,Update_Prediction_Table,FUNCTION," * previous_ufpt_event : %d",previous_ufpt_event); 663 log_printf(TRACE,Update_Prediction_Table,FUNCTION," * reg_UPT_UPDATE : %d",reg_UPT_UPDATE [context]); 664 665 // Have a miss !!! 666 // Flush UPFT 667 flush_UFPT [context] |= not previous_ufpt_event; 668 669 if (reg_UPDATE_PREDICTION_TABLE [context][depth]._state == UPDATE_PREDICTION_STATE_WAIT_END) 670 { 671 for (uint32_t j=(depth+1)%_param->_size_upt_queue[context]; 672 j!=top; 673 j=(j+1)%_param->_size_upt_queue[context]) 674 { 675 reg_UPDATE_PREDICTION_TABLE [context][j]._state = UPDATE_PREDICTION_STATE_EVENT; 676 reg_UPDATE_PREDICTION_TABLE [context][j]._retire_ok = false; 677 } 678 679 680 // reg_UPT_BOTTOM [context]; 681 reg_UPT_TOP [context] = depth; 682 // reg_UPT_TOP_EVENT [context] = top; 683 684 if (not previous_upt_event) 685 { 686 reg_UPT_TOP_EVENT [context] = top; 687 reg_UPT_UPDATE [context] = new_update; 688 } 689 else 690 { 691 // Have event. Top index this slot 692 reg_UPDATE_PREDICTION_TABLE [context][top]._retire_ok = false; 693 694 switch (event_top) 695 { 696 case UPDATE_PREDICTION_STATE_END_KO : 619 { 620 bool branch_complete_miss [_param->_nb_context]; 621 for (uint32_t i=0; i<_param->_nb_context; ++i) 622 branch_complete_miss [i] = false; 623 624 for (uint32_t i=0; i<_param->_nb_inst_branch_complete; i++) 625 if (PORT_READ(in_BRANCH_COMPLETE_VAL[i]) and internal_BRANCH_COMPLETE_ACK [i]) 626 { 627 // Read information 628 Tcontext_t context = (_param->_have_port_context_id)?PORT_READ(in_BRANCH_COMPLETE_CONTEXT_ID [i]):0; 629 Tdepth_t depth = (_param->_have_port_depth )?PORT_READ(in_BRANCH_COMPLETE_DEPTH [i]):0; 630 Tcontrol_t miss = internal_BRANCH_COMPLETE_MISS_PREDICTION [i]; 631 Tcontrol_t good_take = internal_BRANCH_COMPLETE_TAKE [i]; 632 Taddress_t good_addr = internal_BRANCH_COMPLETE_ADDRESS_DEST [i]; 633 634 upt_event_state_t upt_event_state = reg_UPT_EVENT_STATE [context]; 635 636 log_printf(TRACE,Update_Prediction_Table,FUNCTION," * BRANCH_COMPLETE[%d] - Accepted",i); 637 log_printf(TRACE,Update_Prediction_Table,FUNCTION," * context : %d",context); 638 log_printf(TRACE,Update_Prediction_Table,FUNCTION," * depth : %d",depth); 639 log_printf(TRACE,Update_Prediction_Table,FUNCTION," * miss : %d",miss); 640 log_printf(TRACE,Update_Prediction_Table,FUNCTION," * reg_UPT_EVENT_STATE : %s",toString(upt_event_state).c_str()); 641 642 // Test if the completed branch is a speculation miss 643 if (miss) 644 { 645 // special case : two branch complete on the same context. 646 // when the re order keep the order, the branch complete j is most speculative that the branch comple i if i < j 647 if (not branch_complete_miss [context]) 648 { 649 branch_complete_miss [context] = true; 650 // Flush UPT 651 // get information 652 uint32_t top = reg_UPT_TOP [context]; 653 uint32_t new_update = ((top==0)?_param->_size_upt_queue[context]:top)-1; 654 655 Taddress_t address_src = reg_UPDATE_PREDICTION_TABLE [context][depth]._address_src; 656 upt_state_t event_top = reg_UPDATE_PREDICTION_TABLE [context][top]._state; 657 658 log_printf(TRACE,Update_Prediction_Table,FUNCTION," * upt_event_state : %s",toString(upt_event_state).c_str()); 659 log_printf(TRACE,Update_Prediction_Table,FUNCTION," * event_top : %s",toString(event_top).c_str()); 660 661 bool previous_ufpt_event = (reg_UFPT_EVENT_STATE [i] == UFPT_EVENT_STATE_KO_FLUSH); 662 663 664 bool previous_upt_event = (false 665 or (upt_event_state == UPT_EVENT_STATE_KO_MISS_WAIT_UFPT ) 666 or (upt_event_state == UPT_EVENT_STATE_KO_MISS_FLUSH_UPT ) 667 or (upt_event_state == UPT_EVENT_STATE_KO_EVENT_WAIT_UFPT) 668 or (upt_event_state == UPT_EVENT_STATE_KO_EVENT_FLUSH_UPT) 669 or (event_top == UPDATE_PREDICTION_STATE_END_KO ) 670 or (event_top == UPDATE_PREDICTION_STATE_KO ) 671 ); 672 673 log_printf(TRACE,Update_Prediction_Table,FUNCTION," * top : %d",top); 674 log_printf(TRACE,Update_Prediction_Table,FUNCTION," * new_update : %d",new_update); 675 log_printf(TRACE,Update_Prediction_Table,FUNCTION," * previous_upt_event : %d",previous_upt_event); 676 log_printf(TRACE,Update_Prediction_Table,FUNCTION," * previous_ufpt_event : %d",previous_ufpt_event); 677 log_printf(TRACE,Update_Prediction_Table,FUNCTION," * reg_UPT_UPDATE : %d",reg_UPT_UPDATE [context]); 678 679 // Have a miss !!! 680 // Flush UPFT 681 flush_UFPT [context] |= not previous_ufpt_event; 682 683 // Test if the entry wait the branchment (else, they have a previous event) 684 if (reg_UPDATE_PREDICTION_TABLE [context][depth]._state == UPDATE_PREDICTION_STATE_WAIT_END) 685 { 686 // All instruction between the instruction and the top is disable 687 for (uint32_t j=(depth+1)%_param->_size_upt_queue[context]; 688 j!=top; 689 j=(j+1)%_param->_size_upt_queue[context]) 697 690 { 698 // Have already update predictor 699 reg_UPDATE_PREDICTION_TABLE [context][top]._state = UPDATE_PREDICTION_STATE_END; 700 reg_UPT_UPDATE [context] = new_update; 701 break; 691 reg_UPDATE_PREDICTION_TABLE [context][j]._state = UPDATE_PREDICTION_STATE_EVENT; 692 reg_UPDATE_PREDICTION_TABLE [context][j]._retire_ok = false; // event 702 693 } 703 case UPDATE_PREDICTION_STATE_KO : 694 695 // New top 696 reg_UPT_TOP [context] = depth; 697 698 if (not previous_upt_event) 704 699 { 705 // Doesn't have update predictor 706 reg_UPDATE_PREDICTION_TABLE [context][top]._state = UPDATE_PREDICTION_STATE_EVENT; 707 break; 700 reg_UPT_TOP_EVENT [context] = top; 701 reg_UPT_UPDATE [context] = new_update; 708 702 } 709 default :703 else 710 704 { 711 // reg_UPDATE_PREDICTION_TABLE [context][top]._state = UPDATE_PREDICTION_STATE_EVENT; 705 // Have event. Top index this slot 706 reg_UPDATE_PREDICTION_TABLE [context][top]._retire_ok = false; 707 708 switch (event_top) 709 { 710 case UPDATE_PREDICTION_STATE_END_KO : 711 { 712 // Have already update predictor 713 reg_UPDATE_PREDICTION_TABLE [context][top]._state = UPDATE_PREDICTION_STATE_END; 714 reg_UPT_UPDATE [context] = new_update; 715 break; 716 } 717 case UPDATE_PREDICTION_STATE_KO : 718 { 719 // Doesn't have update predictor 720 reg_UPDATE_PREDICTION_TABLE [context][top]._state = UPDATE_PREDICTION_STATE_EVENT; 721 break; 722 } 723 default : 724 { 725 // reg_UPDATE_PREDICTION_TABLE [context][top]._state = UPDATE_PREDICTION_STATE_EVENT; 712 726 // break; 713 727 714 728 #ifdef DEBUG_TEST 715 throw ERRORMORPHEO(FUNCTION,_("Branch complete : invalid upt state.")); 716 #endif 729 throw ERRORMORPHEO(FUNCTION,_("Branch complete : invalid upt state.")); 730 #endif 731 } 732 } 717 733 } 718 }719 }720 721 if (reg_UPT_BOTTOM [context] == reg_UPT_TOP [context])722 reg_UPT_EMPTY [context] = true;723 724 log_printf(TRACE,Update_Prediction_Table,FUNCTION," * UPT [%d][%d].state <- UPDATE_PREDICTION_STATE_KO (branch_complete, ifetch hit)",context,depth);725 reg_UPDATE_PREDICTION_TABLE [context][depth]._state = UPDATE_PREDICTION_STATE_KO;726 727 log_printf(TRACE,Update_Prediction_Table,FUNCTION," * reg_UFPT_NB_NEED_UPDATE [%d] : %d",context,reg_UFPT_NB_NEED_UPDATE [context]);728 729 if ( (reg_UFPT_NB_NEED_UPDATE [context] > 0) or730 (reg_UFPT_NB_UPDATE [context] > 0))731 {732 log_printf(TRACE,Update_Prediction_Table,FUNCTION," * EVENT [%d] <- EVENT_STATE_MISS_FLUSH_UFPT_AND_UPT (branch_complete - miss)",context);733 reg_EVENT_STATE [context] = EVENT_STATE_MISS_FLUSH_UFPT_AND_UPT;734 }735 else736 {737 // if (not previous_update_ras)738 {739 // have ras prediction ?740 log_printf(TRACE,Update_Prediction_Table,FUNCTION," * EVENT [%d] <- EVENT_STATE_MISS_FLUSH_UPT (branch_complete - miss)",context);741 734 742 reg_EVENT_STATE [context] = EVENT_STATE_MISS_FLUSH_UPT; 735 if (reg_UPT_BOTTOM [context] == reg_UPT_TOP [context]) 736 reg_UPT_EMPTY [context] = true; 737 738 log_printf(TRACE,Update_Prediction_Table,FUNCTION," * UPT [%d][%d].state <- UPDATE_PREDICTION_STATE_KO (branch_complete, ifetch hit)",context,depth); 739 reg_UPDATE_PREDICTION_TABLE [context][depth]._state = UPDATE_PREDICTION_STATE_KO; 740 741 log_printf(TRACE,Update_Prediction_Table,FUNCTION," * reg_UFPT_NB_NEED_UPDATE [%d] : %d",context,reg_UFPT_NB_NEED_UPDATE [context]); 742 743 // if ( (reg_UFPT_NB_NEED_UPDATE [context] > 0) or 744 // (reg_UFPT_NB_UPDATE [context] > 0)) 745 // { 746 // log_printf(TRACE,Update_Prediction_Table,FUNCTION," * EVENT [%d] <- EVENT_STATE_MISS_FLUSH_UFPT_AND_UPT (branch_complete - miss)",context); 747 // reg_EVENT_STATE [context] = EVENT_STATE_MISS_FLUSH_UFPT_AND_UPT; 748 // } 749 // else 750 // { 751 // // if (not previous_update_ras) 752 // { 753 // // have ras prediction ? 754 // log_printf(TRACE,Update_Prediction_Table,FUNCTION," * EVENT [%d] <- EVENT_STATE_MISS_FLUSH_UPT (branch_complete - miss)",context); 755 756 // reg_EVENT_STATE [context] = EVENT_STATE_MISS_FLUSH_UPT; 757 758 // } 759 // } 760 761 reg_UPT_EVENT_STATE [context] = UPT_EVENT_STATE_KO_MISS_FLUSH_UPT; 762 log_printf(TRACE,Update_Prediction_Table,FUNCTION," * UPT_EVENT_STATE [%d] <- %s (branch_complete, ifetch hit)",context,toString(reg_UPT_EVENT_STATE [context]).c_str()); 763 764 // reg_EVENT_SOURCE [context] = EVENT_SOURCE_UPT; 765 766 // else no update 767 768 // reg_EVENT_IS_BRANCH [context] = true; 769 reg_EVENT_DEPTH [context] = depth; 770 reg_EVENT_ADDRESS_SRC [context] = address_src; // delay_slot is compute in Context_State 771 reg_EVENT_ADDRESS_DEST_VAL[context] = good_take; 772 reg_EVENT_ADDRESS_DEST [context] = good_addr; 773 reg_EVENT_CAN_CONTINUE [context] = false; 743 774 744 775 } 745 } 746 // reg_EVENT_SOURCE [context] = EVENT_SOURCE_UPT; 747 748 // else no update 749 750 reg_EVENT_IS_BRANCH [context] = true; 751 reg_EVENT_DEPTH [context] = depth; 752 reg_EVENT_ADDRESS_SRC [context] = address_src; // delay_slot is compute in Context_State 753 reg_EVENT_ADDRESS_DEST_VAL[context] = good_take; 754 reg_EVENT_ADDRESS_DEST [context] = good_addr; 755 reg_EVENT_CAN_CONTINUE [context] = false; 756 757 } 758 reg_UPDATE_PREDICTION_TABLE [context][depth]._miss_commit = true; 759 } 760 else 761 { 776 777 reg_UPDATE_PREDICTION_TABLE [context][depth]._miss_commit = true; 778 } 779 } 780 else 781 { 762 782 // Hit case 763 783 … … 767 787 // #endif 768 788 769 if (reg_UPDATE_PREDICTION_TABLE [context][depth]._state == UPDATE_PREDICTION_STATE_WAIT_END) 770 { 771 log_printf(TRACE,Update_Prediction_Table,FUNCTION," * UPT [%d][%d].state <- UPDATE_PREDICTION_STATE_OK (branch_complete, ifetch hit)",context,depth); 772 reg_UPDATE_PREDICTION_TABLE [context][depth]._state = UPDATE_PREDICTION_STATE_OK; 773 } 774 } 775 776 log_printf(TRACE,Update_Prediction_Table,FUNCTION," * reg_EVENT_STATE : %s",toString(reg_EVENT_STATE [context]).c_str()); 777 778 // In all case : update good_take 779 reg_UPDATE_PREDICTION_TABLE [context][depth]._good_take = good_take; 780 781 // Write address_dest if need read register 782 Tbranch_condition_t condition = reg_UPDATE_PREDICTION_TABLE [context][depth]._condition; 783 784 if ((condition == BRANCH_CONDITION_READ_REGISTER_WITHOUT_WRITE_STACK) or 785 (condition == BRANCH_CONDITION_READ_REGISTER_WITH_WRITE_STACK ) or 786 (condition == BRANCH_CONDITION_READ_STACK ) ) 787 reg_UPDATE_PREDICTION_TABLE [context][depth]._address_dest = good_addr; 788 } 789 789 // In same cycle, can have a previous branch_complete 790 if (reg_UPDATE_PREDICTION_TABLE [context][depth]._state == UPDATE_PREDICTION_STATE_WAIT_END) 791 { 792 log_printf(TRACE,Update_Prediction_Table,FUNCTION," * UPT [%d][%d].state <- UPDATE_PREDICTION_STATE_OK (branch_complete, ifetch hit)",context,depth); 793 reg_UPDATE_PREDICTION_TABLE [context][depth]._state = UPDATE_PREDICTION_STATE_OK; 794 } 795 } 796 797 log_printf(TRACE,Update_Prediction_Table,FUNCTION," * reg_UPT_EVENT_STATE : %s",toString(reg_UPT_EVENT_STATE [context]).c_str()); 798 799 // In all case : update good_take 800 reg_UPDATE_PREDICTION_TABLE [context][depth]._good_take = good_take; 801 802 // Write address_dest if need read register 803 Tbranch_condition_t condition = reg_UPDATE_PREDICTION_TABLE [context][depth]._condition; 804 805 if ((condition == BRANCH_CONDITION_READ_REGISTER_WITHOUT_WRITE_STACK) or 806 (condition == BRANCH_CONDITION_READ_REGISTER_WITH_WRITE_STACK ) or 807 (condition == BRANCH_CONDITION_READ_STACK ) ) 808 reg_UPDATE_PREDICTION_TABLE [context][depth]._address_dest = good_addr; 809 } 810 } 790 811 791 812 // =================================================================== … … 797 818 log_printf(TRACE,Update_Prediction_Table,FUNCTION," * BRANCH_EVENT [%d] - Accepted",i); 798 819 799 // if different : an other branch is occured 800 if (reg_EVENT_STATE [i] == EVENT_STATE_UPDATE_CONTEXT) 820 upt_event_state_t upt_event_state = reg_UPT_EVENT_STATE [i]; 821 822 switch (upt_event_state) 801 823 { 802 // Change state803 log_printf(TRACE,Update_Prediction_Table,FUNCTION," * EVENT [%d] <- EVENT_STATE_WAIT_END_EVENT (branch_event)",i);804 reg_EVENT_STATE [i] = EVENT_STATE_WAIT_END_EVENT;824 case UPT_EVENT_STATE_KO_DECODE_UPDATE_CONTEXT : upt_event_state = UPT_EVENT_STATE_KO_DECODE_WAIT_END_EVENT; break; 825 case UPT_EVENT_STATE_KO_COMMIT_UPDATE_CONTEXT : upt_event_state = UPT_EVENT_STATE_KO_COMMIT_WAIT_END_EVENT; break; 826 default : break; // an other branch is occured 805 827 } 828 829 reg_UPT_EVENT_STATE [i] = upt_event_state; 830 log_printf(TRACE,Update_Prediction_Table,FUNCTION," * reg_UPT_EVENT_STATE : %s (branch_event)",toString(upt_event_state).c_str()); 806 831 } 807 832 … … 826 851 // * EVENT_TYPE_CSYNC - nothing 827 852 828 Tevent_type_t event_type = PORT_READ(in_EVENT_TYPE [i]); 853 Tevent_type_t event_type = PORT_READ(in_EVENT_TYPE [i]); 854 upt_event_state_t upt_event_state = reg_UPT_EVENT_STATE [i]; 829 855 830 856 // Test if end of miss -> all previous branch is complete … … 837 863 log_printf(TRACE,Update_Prediction_Table,FUNCTION," * type : EVENT_TYPE_BRANCH_MISS_SPECULATION"); 838 864 839 // #ifdef DEBUG_TEST 840 // if (reg_EVENT_STATE [i] != EVENT_STATE_WAIT_END_EVENT) 841 // throw ERRORMORPHEO(FUNCTION,_("Event : invalid event state.")); 842 // #endif 843 // Special case : test if event and branch_complete ! 844 if (reg_EVENT_STATE [i] == EVENT_STATE_WAIT_END_EVENT) 865 switch (upt_event_state) 845 866 { 846 847 // Change state 848 log_printf(TRACE,Update_Prediction_Table,FUNCTION," * EVENT [%d] <- EVENT_STATE_OK (event)",i); 849 850 reg_EVENT_STATE [i] = EVENT_STATE_OK; 851 reg_IS_ACCURATE [i] = true; 852 853 Tdepth_t depth = reg_EVENT_UPT_PTR [i]; 854 855 if (reg_UPDATE_PREDICTION_TABLE [i][depth]._state == UPDATE_PREDICTION_STATE_END_KO) 856 { 857 log_printf(TRACE,Update_Prediction_Table,FUNCTION," * UPT [%d][%d].state <- UPDATE_PREDICTION_STATE_END (event)",i,depth); 858 859 reg_UPDATE_PREDICTION_TABLE [i][depth]._state = UPDATE_PREDICTION_STATE_END; 860 } 861 862 #ifdef DEBUG_TEST 863 // if (reg_UPDATE_PREDICTION_TABLE [i][depth]._state != UPDATE_PREDICTION_STATE_END_KO_WAIT_END) 864 // throw ERRORMORPHEO(FUNCTION,_("Event : invalid upt event state.")); 865 // if (reg_UPDATE_PREDICTION_TABLE [i][depth]._state != UPDATE_PREDICTION_STATE_END_KO) 866 // throw ERRORMORPHEO(FUNCTION,_("Event : invalid upt event state.")); 867 #endif 868 869 // log_printf(TRACE,Update_Prediction_Table,FUNCTION," * UPT [%d][%d].state <- UPDATE_PREDICTION_STATE_END_KO (update)",i,depth); 870 871 // reg_UPDATE_PREDICTION_TABLE [i][depth]._state = UPDATE_PREDICTION_STATE_END_KO; 867 case UPT_EVENT_STATE_KO_COMMIT_WAIT_END_EVENT : 868 { 869 Tdepth_t depth = reg_EVENT_UPT_PTR [i]; 870 871 log_printf(TRACE,Update_Prediction_Table,FUNCTION," * depth : %d",depth); 872 873 if (reg_UPDATE_PREDICTION_TABLE [i][depth]._state == UPDATE_PREDICTION_STATE_END_KO) 874 { 875 log_printf(TRACE,Update_Prediction_Table,FUNCTION," * UPT [%d][%d].state <- UPDATE_PREDICTION_STATE_END (event)",i,depth); 876 877 reg_UPDATE_PREDICTION_TABLE [i][depth]._state = UPDATE_PREDICTION_STATE_END; 878 } 879 880 reg_UPT_TOP [i] = reg_UPT_TOP_EVENT [i]; 881 reg_UPT_UPDATE [i] = reg_UPT_TOP_EVENT [i]; 882 883 // break; continue 884 } 885 case UPT_EVENT_STATE_KO_DECODE_WAIT_END_EVENT : 886 { 887 // Change state 888 log_printf(TRACE,Update_Prediction_Table,FUNCTION," * EVENT [%d] <- EVENT_STATE_OK (event)",i); 889 890 upt_event_state = UPT_EVENT_STATE_OK; 891 reg_IS_ACCURATE [i] = true; 892 893 break; 894 } 895 default : break; // an other branch is occured 872 896 } 897 873 898 break; 874 899 } … … 893 918 // (event_state == EVENT_STATE_EVENT_FLUSH_UPT)); 894 919 895 bool find = false; // have slot to update ??? 896 Tdepth_t top = bottom; 897 Tdepth_t update = bottom; 898 bool empty = reg_UPT_EMPTY [i]; 920 bool find = false; // have slot to update ??? 921 bool find_top = false; 922 Tdepth_t top = bottom; 923 Tdepth_t update = bottom; 924 bool empty = reg_UPT_EMPTY [i]; 899 925 900 926 // flush all slot, because this event is in head of rob … … 902 928 { 903 929 Tdepth_t x = (bottom+j)%_param->_size_upt_queue[i]; 930 931 log_printf(TRACE,Update_Prediction_Table,FUNCTION," * UPT [%d] : %s",x,toString(reg_UPDATE_PREDICTION_TABLE [i][x]._state).c_str()); 904 932 905 933 if ((reg_UPDATE_PREDICTION_TABLE [i][x]._state != UPDATE_PREDICTION_STATE_END) and 906 934 (reg_UPDATE_PREDICTION_TABLE [i][x]._state != UPDATE_PREDICTION_STATE_EMPTY)) 907 935 { 936 log_printf(TRACE,Update_Prediction_Table,FUNCTION," * find at UPT[%d]",x); 937 908 938 find = true; // find a not empty slot 909 reg_UPDATE_PREDICTION_TABLE [i][x]._state = UPDATE_PREDICTION_STATE_EVENT;939 reg_UPDATE_PREDICTION_TABLE [i][x]._state = UPDATE_PREDICTION_STATE_EVENT; 910 940 reg_UPDATE_PREDICTION_TABLE [i][x]._retire_ok = false; 911 941 update = x; … … 913 943 914 944 if (reg_UPDATE_PREDICTION_TABLE [i][x]._state != UPDATE_PREDICTION_STATE_EMPTY) 915 top = x+1; 945 if (not find_top) 946 { 947 top = x; 948 find_top = true; 949 } 916 950 } 917 918 top = top%_param->_size_upt_queue[i];919 951 920 952 log_printf(TRACE,Update_Prediction_Table,FUNCTION," * find : %d",find); 921 953 log_printf(TRACE,Update_Prediction_Table,FUNCTION," * top : %d",top); 954 log_printf(TRACE,Update_Prediction_Table,FUNCTION," * update : %d",update); 922 955 923 956 // Test if have update slot 957 reg_UPT_TOP_EVENT [i] = reg_UPT_TOP[i]; 924 958 if (find) 925 959 { 926 960 // TODO : special case : event is an exception on branch, also depth is not valid 927 961 reg_UPT_TOP [i] = top; // depth is again valid 928 reg_UPT_TOP_EVENT [i] = top;929 962 930 963 if (bottom == reg_UPT_TOP [i]) 931 964 reg_UPT_EMPTY [i] = true; 965 966 reg_UPT_UPDATE [i] = update; 932 967 } 933 reg_UPT_UPDATE [i] = update;934 968 935 969 // new state : … … 939 973 // * ok : nothing 940 974 // * ko : flush upt 941 reg_EVENT_VAL [i] = find; 942 reg_EVENT_IS_BRANCH [i] = false; 975 // reg_EVENT_VAL [i] = find; 976 // reg_EVENT_IS_BRANCH [i] = false; 977 // reg_EVENT_UPT_PTR [i] = ((top==0)?_param->_size_upt_queue[i]:top)-1; ///// ZE MODIF 943 978 reg_EVENT_UPT_PTR [i] = top; 944 979 reg_EVENT_UPT_FULL [i] = (not empty and (bottom == reg_UPT_TOP [i])); … … 952 987 log_printf(TRACE,Update_Prediction_Table,FUNCTION," * reg_UPT_EMPTY : %d",reg_UPT_EMPTY [i]); 953 988 954 log_printf(TRACE,Update_Prediction_Table,FUNCTION," * reg_EVENT_VAL : %d",reg_EVENT_VAL [i]);989 // log_printf(TRACE,Update_Prediction_Table,FUNCTION," * reg_EVENT_VAL : %d",reg_EVENT_VAL [i]); 955 990 log_printf(TRACE,Update_Prediction_Table,FUNCTION," * reg_EVENT_UPT_PTR : %d",reg_EVENT_UPT_PTR [i]); 956 991 log_printf(TRACE,Update_Prediction_Table,FUNCTION," * reg_EVENT_UPT_FULL : %d",reg_EVENT_UPT_FULL [i]); … … 958 993 log_printf(TRACE,Update_Prediction_Table,FUNCTION," * reg_UFPT_NB_UPDATE : %d",reg_UFPT_NB_UPDATE [i]); 959 994 960 if ( (reg_UFPT_NB_NEED_UPDATE [i] > 0) or 961 (reg_UFPT_NB_UPDATE [i] > 0)) 995 if (find) 962 996 { 963 if (find) 964 { 965 log_printf(TRACE,Update_Prediction_Table,FUNCTION," * EVENT [%d] <- EVENT_STATE_EVENT_FLUSH_UFPT_AND_UPT (event - find)",i); 966 reg_EVENT_STATE [i] = EVENT_STATE_EVENT_FLUSH_UFPT_AND_UPT; 967 } 968 else 969 { 970 log_printf(TRACE,Update_Prediction_Table,FUNCTION," * EVENT [%d] <- EVENT_STATE_EVENT_FLUSH_UFPT (event - not find)",i); 971 // reg_EVENT_VAL [i] = false; 972 973 reg_EVENT_STATE [i] = EVENT_STATE_EVENT_FLUSH_UFPT; 974 } 997 // have ras prediction ? 998 log_printf(TRACE,Update_Prediction_Table,FUNCTION," * UPT_EVENT [%d] <- UPT_EVENT_STATE_KO_EVENT_FLUSH_UPT (event - find)",i); 999 1000 upt_event_state = UPT_EVENT_STATE_KO_EVENT_FLUSH_UPT; 975 1001 } 976 1002 else 977 1003 { 978 if (find) 979 { 980 // have ras prediction ? 981 log_printf(TRACE,Update_Prediction_Table,FUNCTION," * EVENT [%d] <- EVENT_STATE_EVENT_FLUSH_UPT (event - find)",i); 982 983 reg_EVENT_STATE [i] = EVENT_STATE_EVENT_FLUSH_UPT; 984 } 985 else 986 { 987 // special case : nothing 988 log_printf(TRACE,Update_Prediction_Table,FUNCTION," * EVENT [%d] <- EVENT_STATE_EVENT_FLUSH_UPT (event - not find)",i); 989 990 // reg_EVENT_VAL [i] = false; 991 992 reg_EVENT_STATE [i] = EVENT_STATE_OK; 993 } 1004 // special case : nothing 1005 log_printf(TRACE,Update_Prediction_Table,FUNCTION," * UPT_EVENT [%d] <- UPT_EVENT_STATE_KO_EVENT_WAIT_UFPT (event - not find)",i); 1006 1007 // reg_EVENT_VAL [i] = false; 1008 1009 upt_event_state = UPT_EVENT_STATE_KO_EVENT_WAIT_UFPT; 994 1010 } 995 996 // else no update997 998 // Tdepth_t depth = (_param->_have_port_depth)?PORT_READ(in_EVENT_DEPTH [i]):0;999 // uint32_t top = reg_UPT_TOP [i];1000 // uint32_t bottom = reg_UPT_BOTTOM [i];1001 // uint32_t new_update = ((top==0)?_param->_size_upt_queue[i]:top)-1;1002 // // bool empty = reg_UPT_EMPTY [i];1003 1004 // log_printf(TRACE,Update_Prediction_Table,FUNCTION," * top : %d",top);1005 // log_printf(TRACE,Update_Prediction_Table,FUNCTION," * depth : %d",depth);1006 // log_printf(TRACE,Update_Prediction_Table,FUNCTION," * new_update : %d",new_update);1007 1008 // event_state_t event_state = reg_EVENT_STATE [i];1009 // bool previous_update_ras = ((event_state == EVENT_STATE_MISS_FLUSH_UFPT_AND_UPT ) or1010 // (event_state == EVENT_STATE_MISS_FLUSH_UPT ) or1011 // (event_state == EVENT_STATE_EVENT_FLUSH_UFPT_AND_UPT) or1012 // (event_state == EVENT_STATE_EVENT_FLUSH_UPT));1013 1014 // bool find = false; // have slot to update ???1015 // Tdepth_t depth_new = depth;1016 1017 // // flush all slot, because this event is in head of rob1018 // for (uint32_t j=(depth+1)%_param->_size_upt_queue[i];1019 // //uint32_t j=bottom;1020 // j!=top;1021 // j=(j+1)%_param->_size_upt_queue[i])1022 // if ((reg_UPDATE_PREDICTION_TABLE [i][j]._state != UPDATE_PREDICTION_STATE_END) and1023 // (reg_UPDATE_PREDICTION_TABLE [i][j]._state != UPDATE_PREDICTION_STATE_EMPTY))1024 // {1025 // find = true;1026 // reg_UPDATE_PREDICTION_TABLE [i][j]._state = UPDATE_PREDICTION_STATE_EVENT;1027 // reg_UPDATE_PREDICTION_TABLE [i][j]._retire_ok = false;1028 // }1029 // else1030 // if (not find) // while state == end or empty1031 // depth_new ++;1032 1033 // if ((reg_UPDATE_PREDICTION_TABLE [i][depth]._state != UPDATE_PREDICTION_STATE_END) and1034 // (reg_UPDATE_PREDICTION_TABLE [i][depth]._state != UPDATE_PREDICTION_STATE_EMPTY))1035 // {1036 // find = true;1037 // reg_UPDATE_PREDICTION_TABLE [i][depth]._state = UPDATE_PREDICTION_STATE_EVENT;1038 // reg_UPDATE_PREDICTION_TABLE [i][depth]._retire_ok = false;1039 1040 // }1041 // else1042 // // while state == end or empty1043 // depth = (depth_new+1)%_param->_size_upt_queue[i];1044 1045 // log_printf(TRACE,Update_Prediction_Table,FUNCTION," * find : %d",find);1046 // log_printf(TRACE,Update_Prediction_Table,FUNCTION," * depth_new : %d",depth_new);1047 1048 // // Test if have update slot1049 // if (find)1050 // {1051 // // // flush all slot after the event1052 // // for (uint32_t j=(depth+1)%_param->_size_upt_queue[i];1053 // // j!=top;1054 // // j=(j+1)%_param->_size_upt_queue[i])1055 // // reg_UPDATE_PREDICTION_TABLE [i][j]._state = UPDATE_PREDICTION_STATE_EVENT;1056 1057 // // reg_UPDATE_PREDICTION_TABLE [i][depth]._state = UPDATE_PREDICTION_STATE_EVENT;1058 1059 // // reg_UPT_BOTTOM [i];1060 // // TODO : special case : event is an exception on branch, also depth is not valid1061 // reg_UPT_TOP [i] = depth; // depth is again valid1062 // reg_UPT_TOP_EVENT [i] = top;1063 1064 // if (bottom == reg_UPT_TOP [i])1065 // reg_UPT_EMPTY [i] = true;1066 // }1067 1068 // bool full = ((depth == top) and (top == bottom) and not reg_UPT_EMPTY [i]);1069 // bool update_ras = find and ((top != depth) or full);1070 1071 // log_printf(TRACE,Update_Prediction_Table,FUNCTION," * update_ras : %d",update_ras);1072 1073 // if (not previous_update_ras and update_ras)1074 // reg_UPT_UPDATE [i] = new_update;1075 1076 // // new state :1077 // // * test if ufpt is empty1078 // // * ok : flush upft and upt1079 // // * ko : test if have previous flush upt1080 // // * ok : nothing1081 // // * ko : flush upt1082 // reg_EVENT_VAL [i] = update_ras;1083 // reg_EVENT_UPT_PTR [i] = depth;1084 1085 // log_printf(TRACE,Update_Prediction_Table,FUNCTION," * reg_UFPT_NB_NEED_UPDATE : %d",reg_UFPT_NB_NEED_UPDATE [i]);1086 // // if (reg_UFPT_NB_NEED_UPDATE [i] > 0)1087 // if ( (reg_UFPT_NB_NEED_UPDATE [i] > 0) or1088 // (reg_UFPT_NB_UPDATE [i] > 0))1089 // {1090 // if (update_ras)1091 // {1092 // log_printf(TRACE,Update_Prediction_Table,FUNCTION," * EVENT [%d] <- EVENT_STATE_EVENT_FLUSH_UFPT_AND_UPT (branch_complete - miss)",i);1093 // reg_EVENT_STATE [i] = EVENT_STATE_EVENT_FLUSH_UFPT_AND_UPT;1094 // }1095 // else1096 // {1097 // log_printf(TRACE,Update_Prediction_Table,FUNCTION," * EVENT [%d] <- EVENT_STATE_EVENT_FLUSH_UFPT (branch_complete - miss)",i);1098 // // reg_EVENT_VAL [i] = false;1099 1100 // reg_EVENT_STATE [i] = EVENT_STATE_EVENT_FLUSH_UFPT;1101 // }1102 // }1103 // else1104 // {1105 // // if (not previous_update_ras)1106 // if (update_ras)1107 // {1108 // // have ras prediction ?1109 // log_printf(TRACE,Update_Prediction_Table,FUNCTION," * EVENT [%d] <- EVENT_STATE_EVENT_FLUSH_UPT (branch_complete - miss)",i);1110 1111 // reg_EVENT_STATE [i] = EVENT_STATE_EVENT_FLUSH_UPT;1112 // }1113 // else1114 // {1115 // // special case : nothing1116 // // reg_EVENT_VAL [i] = false;1117 1118 // reg_EVENT_STATE [i] = EVENT_STATE_OK;1119 // }1120 // }1121 1122 // // else no update1123 1124 // reg_EVENT_DEPTH [i] = depth;1125 // // reg_EVENT_ADDRESS_SRC [i] = address_src; // delay_slot is compute in I_State1126 // // reg_EVENT_ADDRESS_DEST_VAL[i] = good_take;1127 // // reg_EVENT_ADDRESS_DEST [i] = good_addr;1128 1011 1129 1012 break; … … 1135 1018 } 1136 1019 } 1020 1021 reg_UPT_EVENT_STATE [i] = upt_event_state; 1022 log_printf(TRACE,Update_Prediction_Table,FUNCTION," * reg_UPT_EVENT_STATE : %s (branch_event)",toString(upt_event_state).c_str()); 1137 1023 } 1138 1024 … … 1149 1035 log_printf(TRACE,Update_Prediction_Table,FUNCTION," * reg_UFPT_NB_NEED_UPDATE : %d",reg_UFPT_NB_NEED_UPDATE [i]); 1150 1036 1151 // It's to accelerate miss speculation 1037 // It's to accelerate miss speculation -> associative access 1152 1038 if (reg_UFPT_NB_NEED_UPDATE [i] == 0) 1153 1039 { … … 1157 1043 reg_UFPT_BOTTOM [i] = 0; 1158 1044 reg_UFPT_TOP [i] = 0; 1159 // reg_UFPT_UPDATE [i];1160 1045 } 1161 1046 else … … 1176 1061 } 1177 1062 1178 // // TOP is next write slot : last slot is TOP-1 1179 // uint32_t top = reg_UFPT_TOP [i]; 1180 // reg_UFPT_UPDATE [i] = ((top==0)?_param->_size_ufpt_queue[i]:top)-1; 1181 1182 // reg_UFPT_BOTTOM [i]; 1183 // reg_UFPT_TOP [i]; 1063 // Change state 1064 reg_UFPT_EVENT_STATE [i] = UFPT_EVENT_STATE_KO_FLUSH; 1184 1065 } 1185 1066 … … 1187 1068 1188 1069 } 1070 1071 // Change state on UPT 1072 { 1073 upt_event_state_t upt_event_state = reg_UPT_EVENT_STATE [i]; 1074 ufpt_event_state_t ufpt_event_state = reg_UFPT_EVENT_STATE [i]; 1075 1076 // Test upt event to change state 1077 // test if upt wait ufpt 1078 if (ufpt_event_state == UFPT_EVENT_STATE_OK) 1079 switch (upt_event_state) 1080 { 1081 // this case when don't need flush upt (miss decod and can continue) 1082 case UPT_EVENT_STATE_KO_MISS_WAIT_UFPT : upt_event_state = UPT_EVENT_STATE_KO_COMMIT_UPDATE_CONTEXT; break; 1083 case UPT_EVENT_STATE_KO_EVENT_WAIT_UFPT : upt_event_state = UPT_EVENT_STATE_OK ; break; 1084 default : break; 1085 } 1086 1087 reg_UPT_EVENT_STATE [i] = upt_event_state; 1088 } 1189 1089 } 1190 1090 … … 1212 1112 { 1213 1113 log_printf(TRACE,Update_Prediction_Table,FUNCTION," * reg_IS_ACCURATE : %d",reg_IS_ACCURATE [i]); 1214 log_printf(TRACE,Update_Prediction_Table,FUNCTION," * reg_EVENT_VAL : %d" ,reg_EVENT_VAL [i]); 1114 log_printf(TRACE,Update_Prediction_Table,FUNCTION," * reg_EVENT_UFPT_STATE : %s" ,toString(reg_UFPT_EVENT_STATE [i]).c_str()); 1115 log_printf(TRACE,Update_Prediction_Table,FUNCTION," * reg_EVENT_UPT_STATE : %s" ,toString(reg_UPT_EVENT_STATE [i]).c_str()); 1116 // log_printf(TRACE,Update_Prediction_Table,FUNCTION," * reg_EVENT_VAL : %d" ,reg_EVENT_VAL [i]); 1215 1117 log_printf(TRACE,Update_Prediction_Table,FUNCTION," * reg_EVENT_UPT_PTR : %d" ,reg_EVENT_UPT_PTR [i]); 1216 1118 log_printf(TRACE,Update_Prediction_Table,FUNCTION," * reg_EVENT_UPT_FULL : %d" ,reg_EVENT_UPT_FULL [i]); 1217 log_printf(TRACE,Update_Prediction_Table,FUNCTION," * reg_EVENT_STATE : %s" ,toString(reg_EVENT_STATE [i]).c_str()); 1218 log_printf(TRACE,Update_Prediction_Table,FUNCTION," * reg_EVENT_IS_BRANCH : %d" ,reg_EVENT_IS_BRANCH [i]); 1119 // log_printf(TRACE,Update_Prediction_Table,FUNCTION," * reg_EVENT_IS_BRANCH : %d" ,reg_EVENT_IS_BRANCH [i]); 1219 1120 log_printf(TRACE,Update_Prediction_Table,FUNCTION," * reg_EVENT_DEPTH : %d" ,reg_EVENT_DEPTH [i]); 1220 1121 log_printf(TRACE,Update_Prediction_Table,FUNCTION," * reg_EVENT_ADDRESS_SRC : %.8x (%.8x)",reg_EVENT_ADDRESS_SRC [i],reg_EVENT_ADDRESS_SRC [i]<<2); … … 1223 1124 log_printf(TRACE,Update_Prediction_Table,FUNCTION," * reg_EVENT_CAN_CONTINUE : %d" ,reg_EVENT_CAN_CONTINUE [i]); 1224 1125 1225 log_printf(TRACE,Update_Prediction_Table,FUNCTION," * Update_Fetch_Prediction_Table [%d]",i);1126 log_printf(TRACE,Update_Prediction_Table,FUNCTION," * Dump UFPT [%d] (Update_Fetch_Prediction_Table)",i); 1226 1127 log_printf(TRACE,Update_Prediction_Table,FUNCTION," * reg_UFPT_BOTTOM : %d",reg_UFPT_BOTTOM [i]); 1227 1128 log_printf(TRACE,Update_Prediction_Table,FUNCTION," * reg_UFPT_TOP : %d",reg_UFPT_TOP [i]); … … 1246 1147 ); 1247 1148 1248 log_printf(TRACE,Update_Prediction_Table,FUNCTION," * Update_Prediction_Table [%d]",i);1149 log_printf(TRACE,Update_Prediction_Table,FUNCTION," * Dump UPT [%d] (Update_Prediction_Table)",i); 1249 1150 log_printf(TRACE,Update_Prediction_Table,FUNCTION," * reg_UPT_BOTTOM : %d",reg_UPT_BOTTOM [i]); 1250 1151 log_printf(TRACE,Update_Prediction_Table,FUNCTION," * reg_UPT_TOP : %d",reg_UPT_TOP [i]); -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/src/Front_end_deallocation.cpp
r112 r122 120 120 delete _component_glue ; 121 121 delete _component_context_state ; 122 for (uint32_t i=0; i<_param->_nb_decod_unit; i++) 123 delete _component_decod_unit [i]; 122 124 delete [] _component_decod_unit ; 123 125 delete _component_prediction_unit; 126 for (uint32_t i=0; i<_param->_nb_context; i++) 127 delete _component_ifetch_unit [i]; 124 128 delete [] _component_ifetch_unit ; 125 129 -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/src/Parameters.cpp
r111 r122 292 292 log_begin(Front_end,FUNCTION); 293 293 294 delete []_param_glue ;295 delete []_param_context_state ;294 delete _param_glue ; 295 delete _param_context_state ; 296 296 for (uint32_t i=0; i<_nb_decod_unit; i++) 297 delete []_param_decod_unit [i];297 delete _param_decod_unit [i]; 298 298 delete [] _param_decod_unit ; 299 delete []_param_prediction_unit;299 delete _param_prediction_unit; 300 300 for (uint32_t i=0; i<_nb_context; i++) 301 delete []_param_ifetch_unit [i];301 delete _param_ifetch_unit [i]; 302 302 delete [] _param_ifetch_unit ; 303 303 -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_OOO_Engine/OOO_Engine/Commit_unit/include/Commit_unit.h
r121 r122 143 143 public : SC_IN (Tcontrol_t ) *** in_RETIRE_EVENT_ACK ;//[nb_front_end][nb_context] 144 144 public : SC_OUT(Tevent_state_t ) *** out_RETIRE_EVENT_STATE ;//[nb_front_end][nb_context] 145 public : SC_OUT(Tcontrol_t ) *** out_RETIRE_EVENT_FLUSH ;//[nb_front_end][nb_context] 146 public : SC_OUT(Tcontrol_t ) *** out_RETIRE_EVENT_STOP ;//[nb_front_end][nb_context] 145 147 146 148 // ~~~~~[ Interface : "commit" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ … … 233 235 private : uint32_t reg_NUM_BANK_HEAD ; 234 236 private : uint32_t reg_NUM_BANK_TAIL ; 237 private : uint32_t reg_NUM_PTR_TAIL ; 235 238 private : uint32_t * reg_BANK_PTR ;//[nb_bank] 236 239 … … 238 241 private : Tcounter_t ** reg_NB_INST_COMMIT_MEM ;//[nb_front_end][nb_context] 239 242 240 private : T event_state_t** reg_EVENT_STATE ;//[nb_front_end][nb_context]241 243 private : Tcommit_event_state_t ** reg_EVENT_STATE ;//[nb_front_end][nb_context] 244 //private : bool ** reg_EVENT_FLUSH ;//[nb_front_end][nb_context] 242 245 private : bool ** reg_EVENT_STOP ;//[nb_front_end][nb_context] 246 private : uint32_t ** reg_EVENT_NUM_BANK ;//[nb_front_end][nb_context] 247 private : uint32_t ** reg_EVENT_NUM_PTR ;//[nb_front_end][nb_context] 248 private : bool ** reg_EVENT_CAN_RESTART ;//[nb_front_end][nb_context] 249 private : uint32_t ** reg_EVENT_PACKET ;//[nb_front_end][nb_context] 250 private : bool ** reg_EVENT_LAST ;//[nb_front_end][nb_context] 251 private : uint32_t ** reg_EVENT_LAST_NUM_BANK ;//[nb_front_end][nb_context] 252 private : uint32_t ** reg_EVENT_LAST_NUM_PTR ;//[nb_front_end][nb_context] 243 253 244 254 //private : Taddress_t ** reg_PC_PREVIOUS ;//[nb_front_end][nb_context] -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_OOO_Engine/OOO_Engine/Commit_unit/include/Types.h
r121 r122 28 28 { 29 29 ROB_EMPTY , // 30 30 31 ROB_BRANCH_WAIT_END , // 31 32 ROB_BRANCH_COMPLETE , // 32 ROB_STORE_WAIT_HEAD_OK , // 33 // ROB_STORE_WAIT_HEAD_KO , // 34 ROB_STORE_HEAD_OK , // 35 ROB_STORE_HEAD_KO , // 33 34 ROB_STORE_WAIT_END_OK , // 35 ROB_STORE_WAIT_END_KO , // 36 ROB_STORE_OK , // 37 ROB_STORE_KO , // 38 ROB_STORE_OK_WAIT_END , // 39 ROB_STORE_KO_WAIT_END , // 40 ROB_STORE_EVENT , // 41 36 42 ROB_OTHER_WAIT_END , // 37 43 … … 50 56 ROB_END_EXCEPTION_WAIT_HEAD , // 51 57 ROB_END_EXCEPTION_UPDATE , // 52 ROB_END_EXCEPTION // 58 ROB_END_EXCEPTION , // 59 ROB_END 60 } rob_state_t; 53 61 54 } rob_state_t; 62 typedef enum 63 { 64 COMMIT_EVENT_STATE_NO_EVENT , 65 COMMIT_EVENT_STATE_EVENT , 66 COMMIT_EVENT_STATE_WAIT_DECOD, 67 COMMIT_EVENT_STATE_WAIT_END , 68 COMMIT_EVENT_STATE_END 69 } Tcommit_event_state_t; 70 71 #define commit_event_state_to_event_state(x) ((x==COMMIT_EVENT_STATE_EVENT)?EVENT_STATE_EVENT:((x==COMMIT_EVENT_STATE_WAIT_DECOD)?EVENT_STATE_WAITEND:((x==COMMIT_EVENT_STATE_WAIT_END)?EVENT_STATE_WAITEND:((x==COMMIT_EVENT_STATE_END)?EVENT_STATE_END:EVENT_STATE_NO_EVENT)))) 72 55 73 56 74 class entry_t 57 75 { 58 76 public : rob_state_t state ; 77 public : rob_state_t state_old ; 59 78 public : uint32_t ptr ; 60 79 public : Tcontext_t front_end_id ; … … 98 117 //public : Tgeneral_data_t data_commit ; // branch's destination 99 118 #ifdef DEBUG 119 public : Tgeneral_data_t load_data ; 100 120 public : Taddress_t address ; 101 121 #endif … … 121 141 case morpheo::behavioural::core::multi_ooo_engine::ooo_engine::commit_unit::ROB_BRANCH_WAIT_END : return "ROB_BRANCH_WAIT_END" ; break; 122 142 case morpheo::behavioural::core::multi_ooo_engine::ooo_engine::commit_unit::ROB_BRANCH_COMPLETE : return "ROB_BRANCH_COMPLETE" ; break; 123 case morpheo::behavioural::core::multi_ooo_engine::ooo_engine::commit_unit::ROB_STORE_WAIT_HEAD_OK : return "ROB_STORE_WAIT_HEAD_OK" ; break; 124 // case morpheo::behavioural::core::multi_ooo_engine::ooo_engine::commit_unit::ROB_STORE_WAIT_HEAD_KO : return "ROB_STORE_WAIT_HEAD_KO" ; break; 125 case morpheo::behavioural::core::multi_ooo_engine::ooo_engine::commit_unit::ROB_STORE_HEAD_OK : return "ROB_STORE_HEAD_OK" ; break; 126 case morpheo::behavioural::core::multi_ooo_engine::ooo_engine::commit_unit::ROB_STORE_HEAD_KO : return "ROB_STORE_HEAD_KO" ; break; 143 case morpheo::behavioural::core::multi_ooo_engine::ooo_engine::commit_unit::ROB_STORE_WAIT_END_OK : return "ROB_STORE_WAIT_END_OK" ; break; 144 case morpheo::behavioural::core::multi_ooo_engine::ooo_engine::commit_unit::ROB_STORE_WAIT_END_KO : return "ROB_STORE_WAIT_END_KO" ; break; 145 case morpheo::behavioural::core::multi_ooo_engine::ooo_engine::commit_unit::ROB_STORE_OK : return "ROB_STORE_OK" ; break; 146 case morpheo::behavioural::core::multi_ooo_engine::ooo_engine::commit_unit::ROB_STORE_KO : return "ROB_STORE_KO" ; break; 147 case morpheo::behavioural::core::multi_ooo_engine::ooo_engine::commit_unit::ROB_STORE_OK_WAIT_END : return "ROB_STORE_OK_WAIT_END" ; break; 148 case morpheo::behavioural::core::multi_ooo_engine::ooo_engine::commit_unit::ROB_STORE_KO_WAIT_END : return "ROB_STORE_KO_WAIT_END" ; break; 127 149 case morpheo::behavioural::core::multi_ooo_engine::ooo_engine::commit_unit::ROB_OTHER_WAIT_END : return "ROB_OTHER_WAIT_END" ; break; 128 150 case morpheo::behavioural::core::multi_ooo_engine::ooo_engine::commit_unit::ROB_EVENT_WAIT_END : return "ROB_EVENT_WAIT_END" ; break; … … 140 162 case morpheo::behavioural::core::multi_ooo_engine::ooo_engine::commit_unit::ROB_END_EXCEPTION_UPDATE : return "ROB_END_EXCEPTION_UPDATE" ; break; 141 163 case morpheo::behavioural::core::multi_ooo_engine::ooo_engine::commit_unit::ROB_END_EXCEPTION : return "ROB_END_EXCEPTION" ; break; 164 case morpheo::behavioural::core::multi_ooo_engine::ooo_engine::commit_unit::ROB_END : return "ROB_END" ; break; 142 165 143 166 default : return "" ; break; -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_OOO_Engine/OOO_Engine/Commit_unit/src/Commit_unit_allocation.cpp
r121 r122 141 141 _ALLOC2_VALACK_IN ( in_RETIRE_EVENT_ACK ,ACK,_param->_nb_front_end,_param->_nb_context[it1]); 142 142 _ALLOC2_SIGNAL_OUT(out_RETIRE_EVENT_STATE ,"state" ,Tevent_state_t ,_param->_size_event_state ,_param->_nb_front_end,_param->_nb_context[it1]); 143 _ALLOC2_SIGNAL_OUT(out_RETIRE_EVENT_FLUSH ,"flush" ,Tcontrol_t ,1 ,_param->_nb_front_end,_param->_nb_context[it1]); 144 _ALLOC2_SIGNAL_OUT(out_RETIRE_EVENT_STOP ,"stop" ,Tcontrol_t ,1 ,_param->_nb_front_end,_param->_nb_context[it1]); 143 145 144 146 ALLOC2_INTERFACE_END(_param->_nb_front_end,_param->_nb_context[it1]); … … 306 308 307 309 // ~~~~~[ Register ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 308 ALLOC2(_nb_cycle_idle ,double ,_param->_nb_front_end,_param->_nb_context [it1]);309 ALLOC1(_rob ,std::list<entry_t*> ,_param->_nb_bank);310 ALLOC2(_nb_cycle_idle ,double ,_param->_nb_front_end,_param->_nb_context [it1]); 311 ALLOC1(_rob ,std::list<entry_t*> ,_param->_nb_bank); 310 312 311 ALLOC1(reg_BANK_PTR ,uint32_t ,_param->_nb_bank);312 313 ALLOC2(reg_NB_INST_COMMIT_ALL ,Tcounter_t ,_param->_nb_front_end,_param->_nb_context [it1]);314 ALLOC2(reg_NB_INST_COMMIT_MEM ,Tcounter_t ,_param->_nb_front_end,_param->_nb_context [it1]);313 ALLOC1(reg_BANK_PTR ,uint32_t ,_param->_nb_bank); 314 315 ALLOC2(reg_NB_INST_COMMIT_ALL ,Tcounter_t ,_param->_nb_front_end,_param->_nb_context [it1]); 316 ALLOC2(reg_NB_INST_COMMIT_MEM ,Tcounter_t ,_param->_nb_front_end,_param->_nb_context [it1]); 315 317 316 ALLOC2(reg_EVENT_STATE ,Tevent_state_t,_param->_nb_front_end,_param->_nb_context [it1]); 317 ALLOC2(reg_EVENT_FLUSH ,bool ,_param->_nb_front_end,_param->_nb_context [it1]); 318 ALLOC2(reg_EVENT_STOP ,bool ,_param->_nb_front_end,_param->_nb_context [it1]); 319 320 // ALLOC2(reg_PC_PREVIOUS ,Taddress_t ,_param->_nb_front_end,_param->_nb_context [it1]); 321 ALLOC2(reg_PC_CURRENT ,Taddress_t ,_param->_nb_front_end,_param->_nb_context [it1]); 322 ALLOC2(reg_PC_CURRENT_IS_DS ,Taddress_t ,_param->_nb_front_end,_param->_nb_context [it1]); 323 ALLOC2(reg_PC_CURRENT_IS_DS_TAKE,Taddress_t ,_param->_nb_front_end,_param->_nb_context [it1]); 324 ALLOC2(reg_PC_NEXT ,Taddress_t ,_param->_nb_front_end,_param->_nb_context [it1]); 318 ALLOC2(reg_EVENT_STATE ,Tcommit_event_state_t,_param->_nb_front_end,_param->_nb_context [it1]); 319 // ALLOC2(reg_EVENT_FLUSH ,bool ,_param->_nb_front_end,_param->_nb_context [it1]); 320 ALLOC2(reg_EVENT_STOP ,bool ,_param->_nb_front_end,_param->_nb_context [it1]); 321 ALLOC2(reg_EVENT_NUM_BANK ,uint32_t ,_param->_nb_front_end,_param->_nb_context [it1]); 322 ALLOC2(reg_EVENT_NUM_PTR ,uint32_t ,_param->_nb_front_end,_param->_nb_context [it1]); 323 ALLOC2(reg_EVENT_CAN_RESTART ,bool ,_param->_nb_front_end,_param->_nb_context [it1]); 324 ALLOC2(reg_EVENT_PACKET ,uint32_t ,_param->_nb_front_end,_param->_nb_context [it1]); 325 ALLOC2(reg_EVENT_LAST ,bool ,_param->_nb_front_end,_param->_nb_context [it1]); 326 ALLOC2(reg_EVENT_LAST_NUM_BANK ,uint32_t ,_param->_nb_front_end,_param->_nb_context [it1]); 327 ALLOC2(reg_EVENT_LAST_NUM_PTR ,uint32_t ,_param->_nb_front_end,_param->_nb_context [it1]); 328 329 // ALLOC2(reg_PC_PREVIOUS ,Taddress_t ,_param->_nb_front_end,_param->_nb_context [it1]); 330 ALLOC2(reg_PC_CURRENT ,Taddress_t ,_param->_nb_front_end,_param->_nb_context [it1]); 331 ALLOC2(reg_PC_CURRENT_IS_DS ,Taddress_t ,_param->_nb_front_end,_param->_nb_context [it1]); 332 ALLOC2(reg_PC_CURRENT_IS_DS_TAKE,Taddress_t ,_param->_nb_front_end,_param->_nb_context [it1]); 333 ALLOC2(reg_PC_NEXT ,Taddress_t ,_param->_nb_front_end,_param->_nb_context [it1]); 325 334 } 326 335 … … 345 354 if (_param->_have_thread [i]) 346 355 { 356 347 357 std::string filename = morpheo::filename(MORPHEO_LOG, 348 358 "Instruction_flow-thread_"+toString(i), … … 351 361 false, 352 362 log_with_pid, 353 false); 363 true); 364 365 log_printf(TRACE,Commit_unit,FUNCTION,"KANE : %s",filename.c_str()); 354 366 355 instruction_log_file [i] 367 instruction_log_file [i].open(filename.c_str() ,std::ios::out | std::ios::trunc); 356 368 } 357 369 #endif -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_OOO_Engine/OOO_Engine/Commit_unit/src/Commit_unit_deallocation.cpp
r121 r122 94 94 DELETE2_SIGNAL( in_RETIRE_EVENT_ACK ,_param->_nb_front_end,_param->_nb_context[it1],1); 95 95 DELETE2_SIGNAL(out_RETIRE_EVENT_STATE ,_param->_nb_front_end,_param->_nb_context[it1],_param->_size_event_state); 96 DELETE2_SIGNAL(out_RETIRE_EVENT_FLUSH ,_param->_nb_front_end,_param->_nb_context[it1],1); 97 DELETE2_SIGNAL(out_RETIRE_EVENT_STOP ,_param->_nb_front_end,_param->_nb_context[it1],1); 96 98 97 99 DELETE1_SIGNAL( in_COMMIT_VAL ,_param->_nb_inst_commit,1 ); … … 202 204 DELETE2(reg_NB_INST_COMMIT_ALL ,_param->_nb_front_end,_param->_nb_context [it1]); 203 205 DELETE2(reg_NB_INST_COMMIT_MEM ,_param->_nb_front_end,_param->_nb_context [it1]); 206 204 207 DELETE2(reg_EVENT_STATE ,_param->_nb_front_end,_param->_nb_context [it1]); 205 208 // DELETE2(reg_EVENT_FLUSH ,_param->_nb_front_end,_param->_nb_context [it1]); 206 209 DELETE2(reg_EVENT_STOP ,_param->_nb_front_end,_param->_nb_context [it1]); 210 DELETE2(reg_EVENT_NUM_BANK ,_param->_nb_front_end,_param->_nb_context [it1]); 211 DELETE2(reg_EVENT_NUM_PTR ,_param->_nb_front_end,_param->_nb_context [it1]); 212 DELETE2(reg_EVENT_CAN_RESTART ,_param->_nb_front_end,_param->_nb_context [it1]); 213 DELETE2(reg_EVENT_PACKET ,_param->_nb_front_end,_param->_nb_context [it1]); 214 DELETE2(reg_EVENT_LAST ,_param->_nb_front_end,_param->_nb_context [it1]); 215 DELETE2(reg_EVENT_LAST_NUM_BANK ,_param->_nb_front_end,_param->_nb_context [it1]); 216 DELETE2(reg_EVENT_LAST_NUM_PTR ,_param->_nb_front_end,_param->_nb_context [it1]); 217 207 218 // DELETE2(reg_PC_PREVIOUS ,_param->_nb_front_end,_param->_nb_context [it1]); 208 219 DELETE2(reg_PC_CURRENT ,_param->_nb_front_end,_param->_nb_context [it1]); -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_OOO_Engine/OOO_Engine/Commit_unit/src/Commit_unit_genMealy_insert.cpp
r117 r122 30 30 #endif 31 31 bool can_rename_select [_param->_nb_rename_unit]; 32 bool event_stop; 33 32 // bool event_stop; 33 34 // // Initialisation 35 // event_stop = false; // one signal for all context. 36 // for (uint32_t i=0; i<_param->_nb_front_end; ++i) 37 // for (uint32_t j=0; j<_param->_nb_context[i]; ++j) 38 // event_stop |= reg_EVENT_STOP [i][j]; 39 34 40 // Initialisation 35 event_stop = false; // one signal for all context.36 for (uint32_t i=0; i<_param->_nb_front_end; ++i)37 for (uint32_t j=0; j<_param->_nb_context[i]; ++j)38 event_stop |= reg_EVENT_STOP [i][j];39 41 for (uint32_t i=0; i<_param->_nb_bank; i++) 40 42 { … … 57 59 // log_printf(TRACE,Commit_unit,FUNCTION," * reg_NUM_BANK_TAIL : %d",reg_NUM_BANK_TAIL); 58 60 59 if (not event_stop)61 // if (not event_stop) 60 62 { 61 63 std::list<generic::priority::select_t> * select_insert = _priority_insert ->select(); // same select for all insert -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_OOO_Engine/OOO_Engine/Commit_unit/src/Commit_unit_genMealy_retire.cpp
r121 r122 56 56 57 57 } 58 58 59 // Scan Top of each bank 59 60 internal_BANK_RETIRE_HEAD = reg_NUM_BANK_HEAD; … … 62 63 uint32_t num_bank = (internal_BANK_RETIRE_HEAD+i)%_param->_nb_bank; 63 64 65 // Test if have instruction 64 66 if (not _rob[num_bank].empty()) 65 67 { … … 68 70 uint32_t x = entry->rename_unit_id; 69 71 uint32_t y = num_inst_retire [x]; 70 72 bool bypass= false; 71 73 // test if : 72 74 // * can retire (all previous instruction is retired) … … 77 79 { 78 80 rob_state_t state = entry->state; 81 Tcontext_t front_end_id = entry->front_end_id; 82 Tcontext_t context_id = entry->context_id; 83 79 84 if ((state == ROB_END_OK ) or 80 85 (state == ROB_END_KO ) or … … 87 92 Tcontrol_t write_re = entry->write_re; 88 93 Tspecial_address_t num_reg_re_log = entry->num_reg_re_log; 89 Tcontext_t front_end_id = entry->front_end_id;90 Tcontext_t context_id = entry->context_id;91 94 92 95 // if state is ok, when write flags in the SR regsiters … … 173 176 can_retire [x] = false; 174 177 } 178 179 bypass = ((state == ROB_END ) or 180 (state == ROB_STORE_OK ) or 181 (state == ROB_STORE_KO ) or 182 (state == ROB_STORE_OK_WAIT_END) or 183 (state == ROB_STORE_KO_WAIT_END)); 184 185 uint32_t packet = ((entry->ptr << _param->_shift_num_slot) | num_bank); 186 187 // if future event, don't update after this event 188 if (reg_EVENT_STOP [front_end_id][context_id] and 189 (reg_EVENT_PACKET [entry->front_end_id][entry->context_id] == packet)) 190 bypass = false; 175 191 } 176 192 177 193 // Retire "in-order" 178 can_retire [x] &= retire_val [x][y];194 can_retire [x] &= (retire_val [x][y] or bypass); 179 195 } 180 196 } -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_OOO_Engine/OOO_Engine/Commit_unit/src/Commit_unit_genMoore.cpp
r118 r122 28 28 // =================================================================== 29 29 { 30 log_printf(TRACE,Commit_unit,FUNCTION," * REEXECUTE [0]"); 31 32 // Store instruction comming Out Of Order in Load Store Unit. 33 // Must be executed in no speculative mode. Also, send a signal when an Store is in head of ROB 34 35 Tcontrol_t val = false; 36 uint32_t num_bank = reg_NUM_BANK_HEAD; 37 38 if (not _rob[num_bank].empty()) 30 uint32_t nb_scan_bank = 0; // last scan bank 31 bool can_continue = true; 32 33 // for each reexecute_port 34 for (uint32_t i=0; i<_param->_nb_inst_reexecute; ++i) 39 35 { 40 log_printf(TRACE,Commit_unit,FUNCTION," * ROB is not empty"); 41 log_printf(TRACE,Commit_unit,FUNCTION," * num_bank : %d",num_bank); 42 43 entry_t * entry = _rob [num_bank].front(); 44 rob_state_t state = entry->state; 45 46 // Test state 47 val = ((state == ROB_STORE_HEAD_OK) or 48 (state == ROB_STORE_HEAD_KO)); 49 50 log_printf(TRACE,Commit_unit,FUNCTION," * val : %d",val); 51 if (val) 36 log_printf(TRACE,Commit_unit,FUNCTION," * REEXECUTE [%d]",i); 37 38 // Store instruction comming Out Of Order in Load Store Unit. 39 // Must be executed in no speculative mode. Also, send a signal when an Store is in head of ROB 40 41 Tcontrol_t val = false; 42 43 for (uint32_t j=nb_scan_bank; j<_param->_nb_bank; j++) 52 44 { 53 Tpacket_t packet_id = ((entry->ptr << _param->_shift_num_slot) | num_bank); 54 55 log_printf(TRACE,Commit_unit,FUNCTION," * packet_id : %d",packet_id); 56 57 // Reexecute store 58 if (_param->_have_port_context_id) 59 PORT_WRITE(out_REEXECUTE_CONTEXT_ID [0], entry->context_id ); 60 if (_param->_have_port_front_end_id) 61 PORT_WRITE(out_REEXECUTE_FRONT_END_ID [0], entry->front_end_id ); 62 if (_param->_have_port_rob_ptr ) 63 PORT_WRITE(out_REEXECUTE_PACKET_ID [0], packet_id ); 64 PORT_WRITE(out_REEXECUTE_TYPE [0], entry->type ); 65 PORT_WRITE(out_REEXECUTE_STORE_QUEUE_PTR_WRITE [0], entry->store_queue_ptr_write); 66 PORT_WRITE(out_REEXECUTE_OPERATION [0], (state == ROB_STORE_HEAD_OK)?OPERATION_MEMORY_STORE_HEAD_OK:OPERATION_MEMORY_STORE_HEAD_KO); 67 } 45 nb_scan_bank ++; 46 47 // translate bank number 48 uint32_t num_bank = (reg_NUM_BANK_HEAD+j)%_param->_nb_bank; 49 50 log_printf(TRACE,Commit_unit,FUNCTION," * num_bank : %d",num_bank); 51 52 // Test if the head of rob is not empty 53 if (not _rob[num_bank].empty()) 54 { 55 log_printf(TRACE,Commit_unit,FUNCTION," * ROB is not empty"); 56 57 // Read state 58 entry_t * entry = _rob [num_bank].front(); 59 rob_state_t state = entry->state; 60 61 // Test state 62 // * store is ko, send signal at store_queue 63 // * store_is ok, test if in head 64 // val = (((state == ROB_STORE_OK) and (num_bank == (reg_NUM_BANK_HEAD))) or 65 // (state == ROB_STORE_KO) or 66 // (state == ROB_STORE_EVENT) 67 // ); 68 val = (((state == ROB_STORE_OK) and can_continue) or 69 (state == ROB_STORE_KO) or 70 (state == ROB_STORE_EVENT) 71 ); 72 73 can_continue &= ((state == ROB_STORE_OK ) or 74 (state == ROB_STORE_OK_WAIT_END ) or 75 (state == ROB_END_OK_SPECULATIVE) or 76 (state == ROB_END_OK ) or 77 (state == ROB_END ) 78 ); 79 80 log_printf(TRACE,Commit_unit,FUNCTION," * val : %d",val); 81 82 if (val) 83 { 84 internal_REEXECUTE_NUM_BANK [i] = num_bank; 85 86 Tpacket_t packet_id = ((entry->ptr << _param->_shift_num_slot) | num_bank); 87 88 log_printf(TRACE,Commit_unit,FUNCTION," * packet_id : %d",packet_id); 89 90 // Reexecute store 91 if (_param->_have_port_context_id) 92 PORT_WRITE(out_REEXECUTE_CONTEXT_ID [i], entry->context_id ); 93 if (_param->_have_port_front_end_id) 94 PORT_WRITE(out_REEXECUTE_FRONT_END_ID [i], entry->front_end_id ); 95 if (_param->_have_port_rob_ptr ) 96 PORT_WRITE(out_REEXECUTE_PACKET_ID [i], packet_id ); 97 PORT_WRITE(out_REEXECUTE_TYPE [i], entry->type ); 98 PORT_WRITE(out_REEXECUTE_STORE_QUEUE_PTR_WRITE [i], entry->store_queue_ptr_write); 99 PORT_WRITE(out_REEXECUTE_OPERATION [i], (state == ROB_STORE_OK)?OPERATION_MEMORY_STORE_HEAD_OK:OPERATION_MEMORY_STORE_HEAD_KO); 100 101 break; // Stop scan 102 } 103 } 104 } 105 106 internal_REEXECUTE_VAL [i] = val; 107 PORT_WRITE(out_REEXECUTE_VAL[i], internal_REEXECUTE_VAL [i]); 68 108 } 69 70 internal_REEXECUTE_VAL [0] = val;71 internal_REEXECUTE_NUM_BANK [0] = num_bank;72 73 PORT_WRITE(out_REEXECUTE_VAL[0], internal_REEXECUTE_VAL [0]);74 109 } 75 110 … … 79 114 { 80 115 // Branchement must be send at the prediction unit 81 uint32_t nb_scan_bank = 0; 116 117 uint32_t nb_scan_bank = 0; // last scan bank 82 118 83 119 // for each port, find a valid branchement. 84 120 for (uint32_t i=0; i<_param->_nb_inst_branch_complete; i++) 85 121 { 122 log_printf(TRACE,Commit_unit,FUNCTION," * BRANCH_COMPLETE [%d]",i); 123 86 124 Tcontrol_t val = false; 87 125 … … 92 130 // translate bank number 93 131 uint32_t num_bank = (reg_NUM_BANK_HEAD+j)%_param->_nb_bank; 132 133 log_printf(TRACE,Commit_unit,FUNCTION," * num_bank : %d",num_bank); 94 134 135 // Test if in this bank, they have an instruction 95 136 if (not _rob [num_bank].empty()) 96 137 { 138 log_printf(TRACE,Commit_unit,FUNCTION," * not empty"); 139 140 // Read information 97 141 entry_t * entry = _rob [num_bank].front(); 98 142 rob_state_t state = entry->state; 99 100 if (state == ROB_BRANCH_COMPLETE) 143 Tcontext_t front_end_id = entry->front_end_id; 144 Tcontext_t context_id = entry->context_id ; 145 146 log_printf(TRACE,Commit_unit,FUNCTION," * front_end_id : %d",front_end_id); 147 log_printf(TRACE,Commit_unit,FUNCTION," * context_id : %d",context_id ); 148 149 // don't complete a branch when rob manage an present event 150 if ((reg_EVENT_STATE [front_end_id][context_id] == COMMIT_EVENT_STATE_NO_EVENT) and 151 (state == ROB_BRANCH_COMPLETE)) 101 152 { 102 val = true; 103 153 log_printf(TRACE,Commit_unit,FUNCTION," * find !!!"); 154 155 // test if have a future event (stop is set) 156 log_printf(TRACE,Commit_unit,FUNCTION," * reg_EVENT_STOP : %d",reg_EVENT_STOP [front_end_id][context_id]); 157 158 if (reg_EVENT_STOP [front_end_id][context_id]) 159 { 160 // Have future event, can complete the branch if the event is most speculative than this branchement 161 // Also, need compare packet_id (is order) 162 163 uint32_t _top = ((_rob[reg_NUM_BANK_HEAD].front()->ptr << _param->_shift_num_slot) | reg_NUM_BANK_HEAD); 164 uint32_t _old = reg_EVENT_PACKET [front_end_id][context_id]; 165 uint32_t _new = ((entry->ptr << _param->_shift_num_slot) | num_bank); 166 167 // log_printf(TRACE,Commit_unit,FUNCTION," * _top : %d",_top); 168 // log_printf(TRACE,Commit_unit,FUNCTION," * _old (before) : %d",_old); 169 // log_printf(TRACE,Commit_unit,FUNCTION," * _new (before) : %d",_new); 170 171 if (_old < _top) _old = _old+_param->_size_queue; 172 if (_new < _top) _new = _new+_param->_size_queue; 173 if (_new < _old) val = true; 174 175 // log_printf(TRACE,Commit_unit,FUNCTION," * _old (after ) : %d",_old); 176 // log_printf(TRACE,Commit_unit,FUNCTION," * _new (after ) : %d",_new); 177 178 } 179 else 180 val = true; 181 182 log_printf(TRACE,Commit_unit,FUNCTION," * val : %d",val); 183 184 if (val) 185 { 186 // Have an valid branchement to complete 104 187 internal_BRANCH_COMPLETE_NUM_BANK [i] = num_bank; 105 188 189 if (_param->_have_port_front_end_id) 190 PORT_WRITE(out_BRANCH_COMPLETE_FRONT_END_ID [i], front_end_id ); 106 191 if (_param->_have_port_context_id) 107 PORT_WRITE(out_BRANCH_COMPLETE_CONTEXT_ID [i], entry->context_id ); 108 if (_param->_have_port_front_end_id) 109 PORT_WRITE(out_BRANCH_COMPLETE_FRONT_END_ID [i], entry->front_end_id ); 192 PORT_WRITE(out_BRANCH_COMPLETE_CONTEXT_ID [i], context_id ); 110 193 if (_param->_have_port_depth) 111 194 PORT_WRITE(out_BRANCH_COMPLETE_DEPTH [i], entry->depth ); … … 114 197 PORT_WRITE(out_BRANCH_COMPLETE_NO_SEQUENCE [i], entry->no_sequence ); 115 198 116 break; 199 break; // Stop scan 200 } 117 201 } 118 202 } … … 131 215 internal_UPDATE_NUM_BANK = reg_NUM_BANK_HEAD; 132 216 217 // Test if have an instruction 133 218 if (not _rob[internal_UPDATE_NUM_BANK].empty()) 134 219 { … … 138 223 entry_t * entry = _rob [internal_UPDATE_NUM_BANK].front(); 139 224 225 // Test state 226 // Update if exception or load miss 140 227 switch (entry->state) 141 228 { … … 208 295 for (uint32_t i=0; i<_param->_nb_front_end; i++) 209 296 for (uint32_t j=0; j<_param->_nb_context [i]; j++) 210 PORT_WRITE(out_RETIRE_EVENT_STATE [i][j], reg_EVENT_STATE[i][j]); 297 { 298 // bool flush = reg_EVENT_FLUSH [i][j]; 299 bool flush = (((reg_EVENT_STATE [i][j] == COMMIT_EVENT_STATE_EVENT) or 300 (reg_EVENT_STATE [i][j] == COMMIT_EVENT_STATE_WAIT_DECOD)) and 301 not reg_EVENT_CAN_RESTART[i][j]); 302 303 PORT_WRITE(out_RETIRE_EVENT_STATE [i][j], commit_event_state_to_event_state(reg_EVENT_STATE[i][j])); 304 PORT_WRITE(out_RETIRE_EVENT_FLUSH [i][j], flush); 305 PORT_WRITE(out_RETIRE_EVENT_STOP [i][j], reg_EVENT_STOP [i][j]); 306 } 211 307 212 308 log_end(Commit_unit,FUNCTION); -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_OOO_Engine/OOO_Engine/Commit_unit/src/Commit_unit_transition.cpp
r121 r122 16 16 namespace ooo_engine { 17 17 namespace commit_unit { 18 19 18 20 19 #undef FUNCTION … … 41 40 reg_NUM_BANK_HEAD = 0; 42 41 reg_NUM_BANK_TAIL = 0; 42 reg_NUM_PTR_TAIL = 0; 43 43 44 44 // Reset counter … … 51 51 reg_NB_INST_COMMIT_MEM [i][j] = 0; 52 52 53 reg_EVENT_STATE [i][j] = EVENT_STATE_NO_EVENT;54 53 reg_EVENT_STATE [i][j] = COMMIT_EVENT_STATE_NO_EVENT; 54 // reg_EVENT_FLUSH [i][j] = false; 55 55 reg_EVENT_STOP [i][j] = false; 56 reg_EVENT_LAST [i][j] = false; 56 57 57 58 // reg_PC_PREVIOUS [i][j] = (0x100-4)>>2; … … 80 81 for (uint32_t i=0; i<_param->_nb_front_end; i++) 81 82 for (uint32_t j=0; j<_param->_nb_context [i]; j++) 82 switch (reg_EVENT_STATE [i][j]) 83 { 84 case EVENT_STATE_EVENT : 83 { 84 // Test if can_restart : (can_restart is to signal at the state than the decod_queue is empty) 85 // * no previous can_restart (trap for one) 86 // * and decod_queue is empty 87 // * and have an event or have a futur event 88 if (not reg_EVENT_CAN_RESTART [i][j] and 89 (PORT_READ(in_NB_INST_DECOD_ALL [i][j]) == 0) and 90 (reg_EVENT_STOP [i][j] or (reg_EVENT_STATE [i][j] != COMMIT_EVENT_STATE_NO_EVENT))) 91 reg_EVENT_CAN_RESTART [i][j] = true; 92 93 // Test event state 94 switch (reg_EVENT_STATE [i][j]) 85 95 { 86 if (internal_RETIRE_EVENT_VAL [i][j] and in_RETIRE_EVENT_ACK [i][j]) 87 reg_EVENT_STATE [i][j] = EVENT_STATE_WAITEND ; 88 break; 96 case COMMIT_EVENT_STATE_EVENT : 97 { 98 // Have an event, test if all composant have ack 99 if (internal_RETIRE_EVENT_VAL [i][j] and in_RETIRE_EVENT_ACK [i][j]) 100 { 101 // A minor optimisation : test if wait_decod is previously empty. 102 if (not reg_EVENT_CAN_RESTART [i][j]) 103 reg_EVENT_STATE [i][j] = COMMIT_EVENT_STATE_WAIT_DECOD; 104 else 105 reg_EVENT_STATE [i][j] = COMMIT_EVENT_STATE_WAIT_END; 106 } 107 108 break; 109 } 110 case COMMIT_EVENT_STATE_WAIT_DECOD : 111 { 112 // Wait flush of decod_queue. 113 // Test if can restart now 114 if (reg_EVENT_CAN_RESTART [i][j]) 115 { 116 //reg_EVENT_FLUSH [i][j] = false; 117 118 // A minor optimisation : test if the last element is already retire 119 if (not reg_EVENT_LAST [i][j]) 120 reg_EVENT_STATE [i][j] = COMMIT_EVENT_STATE_WAIT_END; 121 else 122 reg_EVENT_STATE [i][j] = COMMIT_EVENT_STATE_END; 123 } 124 break; 125 } 126 case COMMIT_EVENT_STATE_WAIT_END : 127 { 128 // Wait the flush of Re Order Buffer. 129 // Test if the last element is retire 130 if (reg_EVENT_LAST [i][j]) 131 reg_EVENT_STATE [i][j] = COMMIT_EVENT_STATE_END ; 132 133 break; 134 } 135 case COMMIT_EVENT_STATE_END : 136 { 137 // Just one cycle 138 139 // flush of re order buffer is finish 140 reg_EVENT_STATE [i][j] = COMMIT_EVENT_STATE_NO_EVENT; 141 reg_EVENT_LAST [i][j] = false; 142 break; 143 } 144 //case COMMIT_EVENT_STATE_NO_EVENT : 145 default : break; 89 146 } 90 case EVENT_STATE_WAITEND : 147 } 148 149 // =================================================================== 150 // =====[ INSERT ]==================================================== 151 // =================================================================== 152 { 153 // variable to count instruction insert 154 uint32_t nb_insert = 0; 155 156 for (uint32_t i=0; i<_param->_nb_bank; i++) 157 { 158 // compute first bank number 159 uint32_t num_bank = (reg_NUM_BANK_TAIL+i)%_param->_nb_bank; 160 161 if (internal_BANK_INSERT_VAL [num_bank]) 91 162 { 92 Tcounter_t nb_inst_all = PORT_READ(in_NB_INST_DECOD_ALL [i][j]) + reg_NB_INST_COMMIT_ALL [i][j]; 93 if (nb_inst_all == 0) 163 // get rename unit source and instruction. 164 uint32_t x = internal_BANK_INSERT_NUM_RENAME_UNIT [num_bank]; 165 uint32_t y = internal_BANK_INSERT_NUM_INST [num_bank]; 166 167 // Test if an instruction is valid 168 // (all in_order insert combinatory is in rename_unit ) 169 if (PORT_READ(in_INSERT_VAL [x][y])) 94 170 { 95 reg_EVENT_STATE [i][j] = EVENT_STATE_END; 96 reg_EVENT_FLUSH [i][j] = false; 97 //reg_EVENT_STOP [i][j] = false; 171 log_printf(TRACE,Commit_unit,FUNCTION," * INSERT [%d][%d]",x,y); 172 173 // get information 174 Tcontext_t front_end_id = (_param->_have_port_front_end_id)?PORT_READ(in_INSERT_FRONT_END_ID [x][y]):0; 175 Tcontext_t context_id = (_param->_have_port_context_id )?PORT_READ(in_INSERT_CONTEXT_ID [x][y]):0; 176 Ttype_t type = PORT_READ(in_INSERT_TYPE [x][y]); 177 Toperation_t operation = PORT_READ(in_INSERT_OPERATION [x][y]); 178 bool is_store = is_operation_memory_store(operation); 179 180 Texception_t exception = PORT_READ(in_INSERT_EXCEPTION [x][y]); 181 Tcontrol_t no_execute = PORT_READ(in_INSERT_NO_EXECUTE [x][y]); 182 183 log_printf(TRACE,Commit_unit,FUNCTION," * front_end_id : %d",front_end_id); 184 log_printf(TRACE,Commit_unit,FUNCTION," * context_id : %d",context_id); 185 log_printf(TRACE,Commit_unit,FUNCTION," * type : %s",toString(type).c_str()); 186 log_printf(TRACE,Commit_unit,FUNCTION," * operation : %d",operation ); 187 log_printf(TRACE,Commit_unit,FUNCTION," * exception : %d",exception ); 188 189 // Create new entry and write information 190 entry_t * entry = new entry_t; 191 uint32_t ptr = reg_BANK_PTR [num_bank]; 192 193 entry->ptr = ptr; 194 entry->front_end_id = front_end_id; 195 entry->context_id = context_id ; 196 entry->rename_unit_id = x; 197 entry->depth = (_param->_have_port_depth)?PORT_READ(in_INSERT_DEPTH [x][y]):0; 198 entry->type = type; 199 entry->operation = operation; 200 entry->is_delay_slot = PORT_READ(in_INSERT_IS_DELAY_SLOT [x][y]); 201 // entry->address = PORT_READ(in_INSERT_ADDRESS [x][y]); 202 entry->exception = exception; 203 entry->exception_use = PORT_READ(in_INSERT_EXCEPTION_USE [x][y]); 204 entry->use_store_queue = (type == TYPE_MEMORY) and ( is_store) and (not no_execute); 205 entry->use_load_queue = (type == TYPE_MEMORY) and (not is_store) and (not no_execute); 206 entry->store_queue_ptr_write = PORT_READ(in_INSERT_STORE_QUEUE_PTR_WRITE [x][y]); 207 entry->load_queue_ptr_write = (_param->_have_port_load_queue_ptr)?PORT_READ(in_INSERT_LOAD_QUEUE_PTR_WRITE [x][y]):0; 208 #ifdef DEBUG 209 entry->read_ra = PORT_READ(in_INSERT_READ_RA [x][y]); 210 entry->num_reg_ra_log = PORT_READ(in_INSERT_NUM_REG_RA_LOG [x][y]); 211 entry->num_reg_ra_phy = PORT_READ(in_INSERT_NUM_REG_RA_PHY [x][y]); 212 entry->read_rb = PORT_READ(in_INSERT_READ_RB [x][y]); 213 entry->num_reg_rb_log = PORT_READ(in_INSERT_NUM_REG_RB_LOG [x][y]); 214 entry->num_reg_rb_phy = PORT_READ(in_INSERT_NUM_REG_RB_PHY [x][y]); 215 entry->read_rc = PORT_READ(in_INSERT_READ_RC [x][y]); 216 entry->num_reg_rc_log = PORT_READ(in_INSERT_NUM_REG_RC_LOG [x][y]); 217 entry->num_reg_rc_phy = PORT_READ(in_INSERT_NUM_REG_RC_PHY [x][y]); 218 #endif 219 entry->write_rd = PORT_READ(in_INSERT_WRITE_RD [x][y]); 220 entry->num_reg_rd_log = PORT_READ(in_INSERT_NUM_REG_RD_LOG [x][y]); 221 entry->num_reg_rd_phy_old = PORT_READ(in_INSERT_NUM_REG_RD_PHY_OLD [x][y]); 222 entry->num_reg_rd_phy_new = PORT_READ(in_INSERT_NUM_REG_RD_PHY_NEW [x][y]); 223 entry->write_re = PORT_READ(in_INSERT_WRITE_RE [x][y]); 224 entry->num_reg_re_log = PORT_READ(in_INSERT_NUM_REG_RE_LOG [x][y]); 225 entry->num_reg_re_phy_old = PORT_READ(in_INSERT_NUM_REG_RE_PHY_OLD [x][y]); 226 entry->num_reg_re_phy_new = PORT_READ(in_INSERT_NUM_REG_RE_PHY_NEW [x][y]); 227 entry->no_sequence = type == TYPE_BRANCH; 228 entry->speculative = true; 229 #ifdef DEBUG 230 entry->address = PORT_READ(in_INSERT_ADDRESS [x][y]); 231 #endif 232 entry->address_next = PORT_READ(in_INSERT_ADDRESS_NEXT [x][y]); 233 #ifdef DEBUG 234 entry->cycle_rob_in = simulation_cycle(); 235 entry->cycle_commit = simulation_cycle(); 236 #endif 237 238 // Test if exception : 239 // * yes : no execute instruction, wait ROB Head 240 // * no : test if no_execute (== instruction is flushed) 241 // else test type 242 // * BRANCH : l.j -> branch is ended 243 // other -> wait the execution end of branchment 244 // * MEMORY : store -> wait store is at head of ROB 245 // other -> wait end of instruction 246 // * OTHER 247 248 { 249 if (exception == EXCEPTION_NONE) 250 { 251 // no_execute : l.j, l.nop, l.rfe 252 253 log_printf(TRACE,Commit_unit,FUNCTION," * no_execute : %d",no_execute); 254 255 switch (type) 256 { 257 case TYPE_BRANCH : {entry->state=(no_execute==1)?ROB_BRANCH_COMPLETE:ROB_BRANCH_WAIT_END ; break;} 258 case TYPE_MEMORY : {entry->state=(no_execute==1)?ROB_END_OK_SPECULATIVE:(entry->state=(is_store ==1)?ROB_STORE_WAIT_END_OK:ROB_OTHER_WAIT_END); break;} 259 default : {entry->state=(no_execute==1)?ROB_END_OK_SPECULATIVE:ROB_OTHER_WAIT_END; break;} 260 } 261 } 262 else 263 { 264 // Have an exception : wait head of ROB 265 // in_INSERT_NO_EXECUTE [x][y] : l.sys, l.trap 266 267 entry->state = ROB_END_EXCEPTION_WAIT_HEAD; 268 } 269 } 270 271 #ifdef STATISTICS 272 if (usage_is_set(_usage,USE_STATISTICS)) 273 (*_stat_nb_inst_insert [x]) ++; 274 #endif 275 276 // Push entry in rob 277 _rob[num_bank].push_back(entry); 278 279 // Update counter and pointer 280 reg_NB_INST_COMMIT_ALL [front_end_id][context_id] ++; 281 if (type == TYPE_MEMORY) 282 reg_NB_INST_COMMIT_MEM [front_end_id][context_id] ++; 283 284 285 // flush = present event or future event. 286 // * present event = don't can restart 287 288 // bool flush = reg_EVENT_FLUSH [front_end_id][context_id]; 289 290 // bool flush = (((reg_EVENT_STATE [front_end_id][context_id] == COMMIT_EVENT_STATE_EVENT) or 291 // (reg_EVENT_STATE [front_end_id][context_id] == COMMIT_EVENT_STATE_WAIT_DECOD)) or 292 // (reg_EVENT_STOP [front_end_id][context_id])); 293 294 // New instruction from decod_queue. Flush if : 295 // * future event (instruction don't need execute because they are a previous event (miss load/branch or exception)) 296 // * or present_event 297 // * and not can_restart (previous empty decod queue), because between the event_stop (branch_complete) and the state event (miss in head), many cycle is occured. 298 bool flush = ((// present event 299 ((reg_EVENT_STATE [front_end_id][context_id] == COMMIT_EVENT_STATE_EVENT) or 300 (reg_EVENT_STATE [front_end_id][context_id] == COMMIT_EVENT_STATE_WAIT_DECOD)) or 301 // futur event 302 reg_EVENT_STOP [front_end_id][context_id]) 303 // can't restart 304 and not reg_EVENT_CAN_RESTART[front_end_id][context_id] 305 ); 306 307 if (flush) 308 { 309 // A new invalid instruction is push in rob -> new last instruction 310 reg_EVENT_LAST [front_end_id][context_id] = false; 311 reg_EVENT_LAST_NUM_BANK [front_end_id][context_id] = num_bank; 312 reg_EVENT_LAST_NUM_PTR [front_end_id][context_id] = ptr; 313 } 314 315 // Update pointer 316 reg_NUM_PTR_TAIL = ptr; 317 reg_BANK_PTR [num_bank] = (reg_BANK_PTR [num_bank]+1)%_param->_size_bank; 318 nb_insert ++; 98 319 } 99 break;100 320 } 101 case EVENT_STATE_END : 102 { 103 reg_EVENT_STATE [i][j] = EVENT_STATE_NO_EVENT; 104 break; 105 } 106 // case EVENT_STATE_NO_EVENT : 107 default : break; 108 } 109 110 // =================================================================== 111 // =====[ INSERT ]==================================================== 112 // =================================================================== 113 for (uint32_t i=0; i<_param->_nb_bank; i++) 114 if (internal_BANK_INSERT_VAL [i]) 115 { 116 // get rename unit source and instruction. 117 uint32_t x = internal_BANK_INSERT_NUM_RENAME_UNIT [i]; 118 uint32_t y = internal_BANK_INSERT_NUM_INST [i]; 119 120 if (PORT_READ(in_INSERT_VAL [x][y])) 121 { 122 log_printf(TRACE,Commit_unit,FUNCTION," * INSERT [%d][%d]",x,y); 123 124 // get information 125 Tcontext_t front_end_id = (_param->_have_port_front_end_id)?PORT_READ(in_INSERT_FRONT_END_ID [x][y]):0; 126 Tcontext_t context_id = (_param->_have_port_context_id )?PORT_READ(in_INSERT_CONTEXT_ID [x][y]):0; 127 Ttype_t type = PORT_READ(in_INSERT_TYPE [x][y]); 128 Toperation_t operation = PORT_READ(in_INSERT_OPERATION [x][y]); 129 bool is_store = is_operation_memory_store(operation); 130 131 Texception_t exception = PORT_READ(in_INSERT_EXCEPTION [x][y]); 132 Tcontrol_t no_execute = PORT_READ(in_INSERT_NO_EXECUTE [x][y]); 133 134 log_printf(TRACE,Commit_unit,FUNCTION," * front_end_id : %d",front_end_id); 135 log_printf(TRACE,Commit_unit,FUNCTION," * context_id : %d",context_id); 136 log_printf(TRACE,Commit_unit,FUNCTION," * type : %s",toString(type).c_str()); 137 log_printf(TRACE,Commit_unit,FUNCTION," * operation : %d",operation ); 138 log_printf(TRACE,Commit_unit,FUNCTION," * exception : %d",exception ); 139 140 // Create new entry. 141 entry_t * entry = new entry_t; 142 143 entry->ptr = reg_BANK_PTR [i]; 144 entry->front_end_id = front_end_id; 145 entry->context_id = context_id ; 146 entry->rename_unit_id = x; 147 entry->depth = (_param->_have_port_depth)?PORT_READ(in_INSERT_DEPTH [x][y]):0; 148 entry->type = type; 149 entry->operation = operation; 150 entry->is_delay_slot = PORT_READ(in_INSERT_IS_DELAY_SLOT [x][y]); 151 // entry->address = PORT_READ(in_INSERT_ADDRESS [x][y]); 152 entry->exception = exception; 153 entry->exception_use = PORT_READ(in_INSERT_EXCEPTION_USE [x][y]); 154 entry->use_store_queue = (type == TYPE_MEMORY) and ( is_store) and (not no_execute); 155 entry->use_load_queue = (type == TYPE_MEMORY) and (not is_store) and (not no_execute); 156 entry->store_queue_ptr_write = PORT_READ(in_INSERT_STORE_QUEUE_PTR_WRITE [x][y]); 157 entry->load_queue_ptr_write = (_param->_have_port_load_queue_ptr)?PORT_READ(in_INSERT_LOAD_QUEUE_PTR_WRITE [x][y]):0; 158 #ifdef DEBUG 159 entry->read_ra = PORT_READ(in_INSERT_READ_RA [x][y]); 160 entry->num_reg_ra_log = PORT_READ(in_INSERT_NUM_REG_RA_LOG [x][y]); 161 entry->num_reg_ra_phy = PORT_READ(in_INSERT_NUM_REG_RA_PHY [x][y]); 162 entry->read_rb = PORT_READ(in_INSERT_READ_RB [x][y]); 163 entry->num_reg_rb_log = PORT_READ(in_INSERT_NUM_REG_RB_LOG [x][y]); 164 entry->num_reg_rb_phy = PORT_READ(in_INSERT_NUM_REG_RB_PHY [x][y]); 165 entry->read_rc = PORT_READ(in_INSERT_READ_RC [x][y]); 166 entry->num_reg_rc_log = PORT_READ(in_INSERT_NUM_REG_RC_LOG [x][y]); 167 entry->num_reg_rc_phy = PORT_READ(in_INSERT_NUM_REG_RC_PHY [x][y]); 168 #endif 169 entry->write_rd = PORT_READ(in_INSERT_WRITE_RD [x][y]); 170 entry->num_reg_rd_log = PORT_READ(in_INSERT_NUM_REG_RD_LOG [x][y]); 171 entry->num_reg_rd_phy_old = PORT_READ(in_INSERT_NUM_REG_RD_PHY_OLD [x][y]); 172 entry->num_reg_rd_phy_new = PORT_READ(in_INSERT_NUM_REG_RD_PHY_NEW [x][y]); 173 entry->write_re = PORT_READ(in_INSERT_WRITE_RE [x][y]); 174 entry->num_reg_re_log = PORT_READ(in_INSERT_NUM_REG_RE_LOG [x][y]); 175 entry->num_reg_re_phy_old = PORT_READ(in_INSERT_NUM_REG_RE_PHY_OLD [x][y]); 176 entry->num_reg_re_phy_new = PORT_READ(in_INSERT_NUM_REG_RE_PHY_NEW [x][y]); 177 entry->no_sequence = type == TYPE_BRANCH; 178 entry->speculative = true; 179 #ifdef DEBUG 180 entry->address = PORT_READ(in_INSERT_ADDRESS [x][y]); 181 #endif 182 entry->address_next = PORT_READ(in_INSERT_ADDRESS_NEXT [x][y]); 183 #ifdef DEBUG 184 entry->cycle_rob_in = simulation_cycle(); 185 entry->cycle_commit = simulation_cycle(); 186 #endif 187 188 // Test if exception : 189 // * yes : no execute instruction, wait ROB Head 190 // * no : test type 191 // * BRANCH : l.j -> branch is ended 192 // other -> wait the execution end of branchment 193 // * MEMORY : store -> wait store is at head of ROB 194 // other -> wait end of instruction 195 // * OTHER 196 197 // bool flush = reg_EVENT_FLUSH [front_end_id][context_id]; 198 199 // log_printf(TRACE,Commit_unit,FUNCTION," * flush : %d",flush); 200 201 // if (flush) 202 // { 203 // entry->state = ROB_END_MISS; // All type (branch, memory and others), because, is not execute 204 // } 205 // else 206 { 207 if (exception == EXCEPTION_NONE) 208 { 209 // no_execute : l.j, l.nop, l.rfe 210 211 log_printf(TRACE,Commit_unit,FUNCTION," * no_execute : %d",no_execute); 212 213 switch (type) 214 { 215 case TYPE_BRANCH : {entry->state=(no_execute==1)?ROB_BRANCH_COMPLETE:ROB_BRANCH_WAIT_END ; break;} 216 case TYPE_MEMORY : {entry->state=(no_execute==1)?ROB_END_OK_SPECULATIVE:(entry->state=(is_store ==1)?ROB_STORE_WAIT_HEAD_OK:ROB_OTHER_WAIT_END); break;} 217 default : {entry->state=(no_execute==1)?ROB_END_OK_SPECULATIVE:ROB_OTHER_WAIT_END; break;} 218 } 219 } 220 else 221 { 222 // Have an exception : wait head of ROB 223 224 // in_INSERT_NO_EXECUTE [x][y] : l.sys, l.trap 225 226 entry->state = ROB_END_EXCEPTION_WAIT_HEAD; 227 } 228 } 229 230 #ifdef STATISTICS 231 if (usage_is_set(_usage,USE_STATISTICS)) 232 (*_stat_nb_inst_insert [x]) ++; 233 #endif 234 235 // Push in rob 236 _rob[i].push_back(entry); 237 238 // Update counter and pointer 239 reg_NB_INST_COMMIT_ALL [front_end_id][context_id] ++; 240 if (type == TYPE_MEMORY) 241 reg_NB_INST_COMMIT_MEM [front_end_id][context_id] ++; 242 243 reg_NUM_BANK_TAIL = (reg_NUM_BANK_TAIL+1)%_param->_nb_bank; 244 reg_BANK_PTR [i] = (reg_BANK_PTR [i]+1)%_param->_size_bank; 245 } 246 } 321 } 322 // Update pointer 323 reg_NUM_BANK_TAIL = (reg_NUM_BANK_TAIL+nb_insert)%_param->_nb_bank; 324 } 247 325 248 326 // =================================================================== … … 255 333 #endif 256 334 335 // For each commit instruction ... 257 336 for (uint32_t i=0; i<_param->_nb_bank; i++) 258 337 for (uint32_t j=0; j<_param->_nb_bank_access_commit; j++) 338 // ... test if an instruction have finish this execution 259 339 if (internal_BANK_COMMIT_VAL [i][j]) 260 340 { 261 // An instruction is executed. Change state of this instruction 262 341 // An instruction is executed -> Change state of this instruction 342 343 // Get information 263 344 uint32_t x = internal_BANK_COMMIT_NUM_INST [i][j]; 264 345 346 // Test if instruction is valid and is enable 347 // (can be disable if this instruction is reexecute) 265 348 if (PORT_READ(in_COMMIT_VAL [x]) and PORT_READ(in_COMMIT_WEN [x])) 266 349 { … … 278 361 279 362 //Toperation_t operation = PORT_READ(in_COMMIT_OPERATION [x]); 280 //Ttype_t type = PORT_READ(in_COMMIT_TYPE [x]); 363 Ttype_t type = entry->type; 364 Tcontrol_t no_sequence = PORT_READ(in_COMMIT_NO_SEQUENCE [x]); 365 366 #if 0 367 if ((type == TYPE_MEMORY) and no_sequence) 368 continue; 369 #endif 370 281 371 Texception_t exception = PORT_READ(in_COMMIT_EXCEPTION [x]); 282 372 … … 286 376 287 377 // change state : test exception_use 288 // * test if exception : exception and mask289 378 290 379 bool have_exception = false; 291 380 bool have_miss_speculation = false; 292 381 382 // Test if have an exception ... 293 383 if (exception != EXCEPTION_NONE) 294 384 { 295 // Test if the instruction is a load and is a miss speculation (load is commit, but they have an dependence with a previous store) 385 // Test if the instruction is a load and is a miss speculation 386 // (load is commit, but they have an dependence with a previous store -> need restart pipeline) 387 296 388 have_miss_speculation = (exception == EXCEPTION_MEMORY_MISS_SPECULATION); 297 389 390 // * Test if the exception generated can be trap by this exception 298 391 switch (entry->exception_use) 299 392 { … … 327 420 } 328 421 422 // Next state depends of previous state 329 423 switch (state) 330 424 { 331 // Branch ... 332 case ROB_BRANCH_WAIT_END : {state = (have_exception)?ROB_END_EXCEPTION_WAIT_HEAD:ROB_BRANCH_COMPLETE; break;} 333 // Store KO 334 case ROB_EVENT_WAIT_END : {state = ROB_END_KO_SPECULATIVE; break;} 335 // Store OK, Load and other instruction 336 case ROB_OTHER_WAIT_END : {state = (have_exception)?ROB_END_EXCEPTION_WAIT_HEAD:((have_miss_speculation)?ROB_END_LOAD_MISS_SPECULATIVE:ROB_END_OK_SPECULATIVE); break;} 425 // Branch : if no exception, the branchement can be completed 426 case ROB_BRANCH_WAIT_END : 427 { 428 if (not have_exception) 429 state = ROB_BRANCH_COMPLETE; 430 else 431 state = ROB_END_EXCEPTION_WAIT_HEAD; 432 break; 433 } 434 // Previous event -> set state as execute 435 case ROB_STORE_KO_WAIT_END : 436 case ROB_EVENT_WAIT_END : 437 { 438 state = ROB_END_KO_SPECULATIVE; 439 break; 440 } 441 // No previous event - Load and other instruction 442 case ROB_STORE_OK_WAIT_END : 443 case ROB_OTHER_WAIT_END : 444 { 445 if (not have_exception) 446 { 447 if (not have_miss_speculation) 448 state = ROB_END_OK_SPECULATIVE; 449 else 450 state = ROB_END_LOAD_MISS_SPECULATIVE; 451 } 452 else 453 state = ROB_END_EXCEPTION_WAIT_HEAD; 454 break; 455 } 456 case ROB_STORE_WAIT_END_OK : 457 { 458 if (not have_exception) 459 state = ROB_STORE_OK; 460 else 461 state = ROB_STORE_EVENT; 462 break; 463 } 464 case ROB_STORE_WAIT_END_KO : 465 { 466 // if (not have_exception) 467 state = ROB_STORE_KO; 468 // else 469 // state = ROB_END_EXCEPTION_WAIT_HEAD; 470 break; 471 } 472 473 337 474 default : 338 475 { … … 342 479 } 343 480 344 if ((have_exception or have_miss_speculation) and 345 (reg_EVENT_FLUSH [entry->front_end_id][entry->context_id] == 0)) 346 reg_EVENT_STOP [entry->front_end_id][entry->context_id] = true; 347 348 // update Re Order Buffer 481 // Commit an instruction ... 482 // Test if have an event (miss_speculation or exception) and not manage a previous event 483 // if yes, this instruction would modify state machine. Also stop Re Order Buffer 484 485 // bool flush = reg_EVENT_FLUSH [entry->front_end_id][entry->context_id]; 486 bool flush = ((reg_EVENT_STATE [entry->front_end_id][entry->context_id] == COMMIT_EVENT_STATE_EVENT) or 487 (reg_EVENT_STATE [entry->front_end_id][entry->context_id] == COMMIT_EVENT_STATE_WAIT_DECOD) or 488 (reg_EVENT_STATE [entry->front_end_id][entry->context_id] == COMMIT_EVENT_STATE_WAIT_END)); 489 490 if ((have_exception or have_miss_speculation) and (not flush)) 491 { 492 uint32_t packet = ((entry->ptr << _param->_shift_num_slot) | i); 493 494 // test have a previous event detected (event_stop = 1) 495 // if yes, test if the actual event if "before (in order)" that the previous event 496 if (reg_EVENT_STOP [entry->front_end_id][entry->context_id]) 497 { 498 // Compare packet_id (by construction instruction is insert in order by increase packet_id) 499 500 uint32_t _top = ((_rob[ reg_NUM_BANK_HEAD].front()->ptr << _param->_shift_num_slot) | reg_NUM_BANK_HEAD); 501 uint32_t _old = reg_EVENT_PACKET [entry->front_end_id][entry->context_id]; 502 uint32_t _new = packet; 503 if (_old < _top) _old = _old+_param->_size_queue; 504 if (_new < _top) _new = _new+_param->_size_queue; 505 if (_new < _old) reg_EVENT_PACKET [entry->front_end_id][entry->context_id] = packet; 506 } 507 else 508 reg_EVENT_PACKET [entry->front_end_id][entry->context_id] = packet; 509 510 // have an error, stop issue instruction 511 reg_EVENT_STOP [entry->front_end_id][entry->context_id] = true; 512 // reg_EVENT_NUM_BANK [entry->front_end_id][entry->context_id] = i; 513 // reg_EVENT_NUM_PTR [entry->front_end_id][entry->context_id] = entry->ptr; 514 515 // reg_EVENT_CAN_RESTART [entry->front_end_id][entry->context_id] = false; 516 reg_EVENT_LAST_NUM_BANK [entry->front_end_id][entry->context_id] = ((reg_NUM_BANK_TAIL==0)?_param->_nb_bank:reg_NUM_BANK_TAIL)-1; 517 reg_EVENT_LAST_NUM_PTR [entry->front_end_id][entry->context_id] = reg_NUM_PTR_TAIL; 518 } 519 520 // Update Re Order Buffer 349 521 entry->state = state; 350 522 entry->exception = exception; 351 523 entry->flags = PORT_READ(in_COMMIT_FLAGS [x]); 352 entry->no_sequence = PORT_READ(in_COMMIT_NO_SEQUENCE [x]);524 entry->no_sequence = no_sequence; 353 525 // jalr, jr : address_dest is in register 354 if (( entry->type == TYPE_BRANCH) and526 if (( type == TYPE_BRANCH) and 355 527 (entry->operation == OPERATION_BRANCH_L_JALR) and 356 528 (entry->read_rb)) … … 358 530 359 531 #ifdef DEBUG 360 entry->cycle_commit = simulation_cycle(); 532 entry->load_data = PORT_READ(in_COMMIT_ADDRESS [x]); 533 entry->cycle_commit = simulation_cycle(); 361 534 #endif 362 535 } … … 368 541 for (uint32_t i=0; i<_param->_nb_bank; i++) 369 542 { 543 // Compute bank number 370 544 uint32_t num_bank = (internal_BANK_RETIRE_HEAD+i)%_param->_nb_bank; 371 545 546 // Test if have an request 372 547 if (internal_BANK_RETIRE_VAL [num_bank]) 373 548 { 549 // Take num instruction 374 550 uint32_t x = internal_BANK_RETIRE_NUM_RENAME_UNIT [num_bank]; 375 551 uint32_t y = internal_BANK_RETIRE_NUM_INST [num_bank]; … … 382 558 throw ERRORMORPHEO(FUNCTION,_("Retire : retire_ack must be set.\n")); 383 559 #endif 560 561 562 #ifdef STATISTICS 563 if (usage_is_set(_usage,USE_STATISTICS)) 564 (*_stat_nb_inst_retire [x]) ++; 384 565 385 entry_t * entry = _rob [num_bank].front(); 386 rob_state_t state = entry->state; 566 #endif 387 567 388 Tcontext_t front_end_id = entry->front_end_id; 389 Tcontext_t context_id = entry->context_id ; 390 uint32_t num_thread = _param->_translate_num_context_to_num_thread [front_end_id][context_id]; 391 Ttype_t type = entry->type ; 392 bool retire_ok = false; 393 394 log_printf(TRACE,Commit_unit,FUNCTION," * front_end_id : %d",front_end_id ); 395 log_printf(TRACE,Commit_unit,FUNCTION," * context_id : %d",context_id ); 396 log_printf(TRACE,Commit_unit,FUNCTION," * rob_ptr : %d",((entry->ptr << _param->_shift_num_slot) | num_bank)); 397 log_printf(TRACE,Commit_unit,FUNCTION," * num_thread : %d",num_thread ); 398 log_printf(TRACE,Commit_unit,FUNCTION," * type : %s",toString(type).c_str()); 399 log_printf(TRACE,Commit_unit,FUNCTION," * state : %s",toString(state).c_str()); 400 401 if ((state == ROB_END_OK ) or 402 // (state == ROB_END_KO ) or 403 (state == ROB_END_BRANCH_MISS) or 404 (state == ROB_END_LOAD_MISS )// or 405 // (state == ROB_END_MISS ) or 406 // (state == ROB_END_EXCEPTION ) 407 ) 408 { 409 log_printf(TRACE,Commit_unit,FUNCTION," * retire_ok"); 410 411 retire_ok = true; 412 413 // reg_PC_PREVIOUS [front_end_id][context_id] = reg_PC_CURRENT [front_end_id][context_id]; 414 reg_PC_CURRENT [front_end_id][context_id] = reg_PC_NEXT [front_end_id][context_id]; 415 reg_PC_CURRENT_IS_DS [front_end_id][context_id] = entry->type == TYPE_BRANCH; 416 reg_PC_CURRENT_IS_DS_TAKE [front_end_id][context_id] = entry->no_sequence; 417 reg_PC_NEXT [front_end_id][context_id] = (entry->no_sequence)?(entry->address_next):(reg_PC_CURRENT [front_end_id][context_id]+1); 418 419 // if (entry->address_next != reg_PC_NEXT [front_end_id][context_id]) 420 // throw ERRORMORPHEO(FUNCTION,toString(_("Retire : Instruction's address_next (%.8x) is different of commit_unit's address_next (%.8x)"),entry->address_next,reg_PC_NEXT [front_end_id][context_id])); 421 } 422 423 if ((state == ROB_END_BRANCH_MISS) or 424 (state == ROB_END_LOAD_MISS)) 425 { 426 reg_EVENT_STATE [front_end_id][context_id] = EVENT_STATE_EVENT; 427 reg_EVENT_FLUSH [front_end_id][context_id] = true; 428 reg_EVENT_STOP [front_end_id][context_id] = false; 429 } 430 431 #if defined(DEBUG) and defined(DEBUG_Commit_unit) and (DEBUG_Commit_unit == true) 432 // log file 433 instruction_log_file [num_thread] 434 << "[" << simulation_cycle() << "] " 435 << std::hex 436 << (entry->address<<2) << " (" << (entry->address) << ") " 437 << std::dec 438 << "[" << entry->cycle_rob_in << ", " << entry->cycle_commit << "] " 439 << "{" << ((retire_ok)?" OK ":"!KO!") << "} " 440 << std::endl; 441 #endif 442 443 // Update nb_inst 444 reg_NB_INST_COMMIT_ALL [front_end_id][context_id] --; 445 if (type == TYPE_MEMORY) 446 reg_NB_INST_COMMIT_MEM [front_end_id][context_id] --; 447 448 reg_NUM_BANK_HEAD = (reg_NUM_BANK_HEAD+1)%_param->_nb_bank; 449 450 delete entry; 451 _rob [num_bank].pop_front(); 452 453 // Transaction on retire interface : reset watch dog timer. 454 _nb_cycle_idle [front_end_id][context_id] = 0; 455 456 // Increase stop condition 457 if (retire_ok) 458 _simulation_nb_instruction_commited [num_thread] ++; 459 460 #ifdef STATISTICS 461 if (usage_is_set(_usage,USE_STATISTICS)) 462 { 463 (*_stat_nb_inst_retire [x]) ++; 464 465 if (retire_ok) 466 { 467 (*_stat_nb_inst_retire_ok [num_thread]) ++; 468 (*_stat_nb_inst_type [type] ) ++; 469 } 470 else 471 (*_stat_nb_inst_retire_ko [num_thread]) ++; 472 } 473 #endif 568 // Read information 569 entry_t * entry = _rob [num_bank].front(); 570 571 entry->state_old = entry->state; 572 entry->state = ROB_END; 474 573 } 475 574 } 476 575 576 for (uint32_t i=0; i<_param->_nb_bank; i++) 577 { 578 // Compute bank number 579 bool can_continue = false; 580 uint32_t num_bank = reg_NUM_BANK_HEAD; 581 582 if (not _rob [num_bank].empty ()) 583 { 584 entry_t * entry = _rob [num_bank].front(); 585 586 if (entry->state == ROB_END) 587 { 588 log_printf(TRACE,Commit_unit,FUNCTION," * RETIRE_ROB [%d]",num_bank); 589 590 can_continue = true; 591 592 Tcontext_t front_end_id = entry->front_end_id; 593 Tcontext_t context_id = entry->context_id ; 594 uint32_t num_thread = _param->_translate_num_context_to_num_thread [front_end_id][context_id]; 595 rob_state_t state = entry->state_old; 596 Ttype_t type = entry->type ; 597 bool retire_ok = false; 598 uint32_t packet_id = ((entry->ptr << _param->_shift_num_slot) | num_bank); 599 600 log_printf(TRACE,Commit_unit,FUNCTION," * front_end_id : %d",front_end_id ); 601 log_printf(TRACE,Commit_unit,FUNCTION," * context_id : %d",context_id ); 602 log_printf(TRACE,Commit_unit,FUNCTION," * rob_ptr : %d",packet_id ); 603 log_printf(TRACE,Commit_unit,FUNCTION," * num_thread : %d",num_thread ); 604 log_printf(TRACE,Commit_unit,FUNCTION," * type : %s",toString(type).c_str()); 605 log_printf(TRACE,Commit_unit,FUNCTION," * state : %s",toString(state).c_str()); 606 607 // Test if the instruction is valid 608 // (BRANCH_MISS = instruction branch is valid, but have make an invalid prediction) 609 // (LOAD_MISS = instruction load is valid, but have make an invalid result) 610 if ((state == ROB_END_OK ) or 611 // (state == ROB_END_KO ) or 612 (state == ROB_END_BRANCH_MISS) or 613 (state == ROB_END_LOAD_MISS )// or 614 // (state == ROB_END_MISS ) or 615 // (state == ROB_END_EXCEPTION ) 616 ) 617 { 618 log_printf(TRACE,Commit_unit,FUNCTION," * retire_ok"); 619 620 retire_ok = true; 621 622 // Update PC information 623 // reg_PC_PREVIOUS [front_end_id][context_id] = reg_PC_CURRENT [front_end_id][context_id]; 624 reg_PC_CURRENT [front_end_id][context_id] = reg_PC_NEXT [front_end_id][context_id]; 625 reg_PC_CURRENT_IS_DS [front_end_id][context_id] = type == TYPE_BRANCH; 626 reg_PC_CURRENT_IS_DS_TAKE [front_end_id][context_id] = entry->no_sequence; 627 reg_PC_NEXT [front_end_id][context_id] = (entry->no_sequence)?(entry->address_next):(reg_PC_CURRENT [front_end_id][context_id]+1); 628 } 629 630 // Test if have an event 631 if ((state == ROB_END_BRANCH_MISS) or 632 (state == ROB_END_LOAD_MISS)) 633 { 634 reg_EVENT_STATE [front_end_id][context_id] = COMMIT_EVENT_STATE_EVENT; 635 // reg_EVENT_FLUSH [front_end_id][context_id] = true; 636 reg_EVENT_STOP [front_end_id][context_id] = false; // instruction flow can continue 637 // reg_EVENT_CAN_RESTART [front_end_id][context_id] = false; 638 reg_EVENT_LAST [front_end_id][context_id] = false; 639 // it the head ! 640 reg_EVENT_PACKET [front_end_id][context_id] = packet_id; 641 642 // If event is an load_miss, many instruction can be inserted. 643 // -> new last instruction 644 if (state == ROB_END_LOAD_MISS) 645 { 646 reg_EVENT_CAN_RESTART [front_end_id][context_id] = false; 647 648 reg_EVENT_LAST_NUM_BANK [front_end_id][context_id] = ((reg_NUM_BANK_TAIL==0)?_param->_nb_bank:reg_NUM_BANK_TAIL)-1; 649 reg_EVENT_LAST_NUM_PTR [front_end_id][context_id] = reg_NUM_PTR_TAIL; 650 } 651 } 652 653 // Test if this instruction is the last instruction of an event 654 // * need event 655 // * packet id = last packet id 656 if ((reg_EVENT_STATE [front_end_id][context_id] != COMMIT_EVENT_STATE_NO_EVENT) and 657 (reg_EVENT_LAST_NUM_BANK [front_end_id][context_id] == num_bank ) and 658 (reg_EVENT_LAST_NUM_PTR [front_end_id][context_id] == entry->ptr )) 659 reg_EVENT_LAST [front_end_id][context_id] = true; 660 661 // Update nb_inst 662 reg_NB_INST_COMMIT_ALL [front_end_id][context_id] --; 663 if (type == TYPE_MEMORY) 664 reg_NB_INST_COMMIT_MEM [front_end_id][context_id] --; 665 666 // Update pointer 667 reg_NUM_BANK_HEAD = (num_bank+1)%_param->_nb_bank; 668 669 // Remove entry 670 delete entry; 671 _rob [num_bank].pop_front(); 672 673 // Reset watch dog timer because have transaction on retire interface 674 _nb_cycle_idle [front_end_id][context_id] = 0; 675 676 // Increase stop condition 677 if (retire_ok) 678 _simulation_nb_instruction_commited [num_thread] ++; 679 680 #ifdef STATISTICS 681 if (usage_is_set(_usage,USE_STATISTICS)) 682 { 683 if (retire_ok) 684 { 685 (*_stat_nb_inst_retire_ok [num_thread]) ++; 686 (*_stat_nb_inst_type [type] ) ++; 687 } 688 else 689 (*_stat_nb_inst_retire_ko [num_thread]) ++; 690 } 691 #endif 692 693 #if defined(DEBUG) and defined(DEBUG_Commit_unit) and (DEBUG_Commit_unit == true) 694 { 695 // log file 696 instruction_log_file [num_thread] 697 << "[" << simulation_cycle() << "] " 698 << std::hex 699 << (entry->address<<2) << " (" << (entry->address) << ") " 700 << std::dec 701 << "[" << entry->cycle_rob_in << ", " << entry->cycle_commit << "] " 702 << "{" << ((retire_ok)?"OK":"KO") << "} "; 703 704 if ((type == TYPE_MEMORY) and is_operation_memory_load(entry->operation)) 705 instruction_log_file [num_thread] << std::hex << entry->load_data << std::dec; 706 707 instruction_log_file [num_thread] << std::endl; 708 } 709 #endif 710 } 711 } 712 713 if (not can_continue) 714 break; // stop scan 715 } 716 477 717 // =================================================================== 478 718 // =====[ REEXECUTE ]================================================= 479 719 // =================================================================== 480 if (internal_REEXECUTE_VAL [0] and PORT_READ(in_REEXECUTE_ACK [0])) 481 { 482 log_printf(TRACE,Commit_unit,FUNCTION," * REEXECUTE [0]"); 483 484 uint32_t num_bank = internal_REEXECUTE_NUM_BANK [0]; 485 486 entry_t * entry = _rob [num_bank].front(); 487 rob_state_t state = entry->state; 488 489 switch (state) 490 { 491 case ROB_STORE_HEAD_OK : {state = ROB_OTHER_WAIT_END; break; } 492 case ROB_STORE_HEAD_KO : {state = ROB_EVENT_WAIT_END; break; } 493 default : {throw ERRORMORPHEO(FUNCTION,_("Reexecute : invalid state value.\n"));} 494 } 495 496 entry->state = state; 497 } 498 720 // Test if have an reexecute instruction (an store in head of rob) 721 for (uint32_t i=0; i<_param->_nb_inst_reexecute; ++i) 722 if (internal_REEXECUTE_VAL [i] and PORT_READ(in_REEXECUTE_ACK [i])) 723 { 724 log_printf(TRACE,Commit_unit,FUNCTION," * REEXECUTE [%d]",i); 725 726 uint32_t num_bank = internal_REEXECUTE_NUM_BANK [i]; 727 728 entry_t * entry = _rob [num_bank].front(); 729 rob_state_t state = entry->state; 730 731 // Change state 732 switch (state) 733 { 734 case ROB_STORE_OK : {state = ROB_STORE_OK_WAIT_END; break; } 735 case ROB_STORE_KO : {state = ROB_STORE_KO_WAIT_END; break; } 736 case ROB_STORE_EVENT : {state = ROB_EVENT_WAIT_END; break; } 737 default : {throw ERRORMORPHEO(FUNCTION,_("Reexecute : invalid state value.\n"));} 738 } 739 740 entry->state = state; 741 } 742 499 743 // =================================================================== 500 744 // =====[ BRANCH_COMPLETE ]=========================================== 501 745 // =================================================================== 502 746 for (uint32_t i=0; i<_param->_nb_inst_branch_complete; i++) 747 // Test if the prediction_unit have accept the branch complete transaction 503 748 if (internal_BRANCH_COMPLETE_VAL [i] and PORT_READ(in_BRANCH_COMPLETE_ACK [i])) 504 749 { 505 750 log_printf(TRACE,Commit_unit,FUNCTION," * BRANCH_COMPLETE [%d]",i); 506 log_printf(TRACE,Commit_unit,FUNCTION," * miss_prediction : %d",PORT_READ(in_BRANCH_COMPLETE_MISS_PREDICTION [i])); 507 751 752 // Read information 508 753 uint32_t num_bank = internal_BRANCH_COMPLETE_NUM_BANK [i]; 509 754 … … 516 761 #endif 517 762 Tcontrol_t miss = PORT_READ(in_BRANCH_COMPLETE_MISS_PREDICTION [i]); 763 764 log_printf(TRACE,Commit_unit,FUNCTION," * miss_prediction : %d",miss); 518 765 519 766 entry->state = (miss)?ROB_END_BRANCH_MISS_SPECULATIVE:ROB_END_OK_SPECULATIVE; 520 521 if (miss and (reg_EVENT_FLUSH [entry->front_end_id][entry->context_id] == 0)) 522 reg_EVENT_STOP [entry->front_end_id][entry->context_id] = true; 523 524 525 // entry->state = ROB_END_OK_SPECULATIVE; 767 768 // bool flush = reg_EVENT_FLUSH [entry->front_end_id][entry->context_id]; 769 770 // Branch_complete can be execute if 771 // * no present event 772 // * futur event and most not speculative that the event 773 774 // Also, test if in this cycle, they have not an most recently event !!! 775 if (miss) 776 { 777 uint32_t packet = ((entry->ptr << _param->_shift_num_slot) | num_bank); 778 779 // test if this packet is before previous event 780 if (reg_EVENT_STOP [entry->front_end_id][entry->context_id]) 781 { 782 uint32_t _top = ((_rob[ reg_NUM_BANK_HEAD].front()->ptr << _param->_shift_num_slot) | reg_NUM_BANK_HEAD); 783 uint32_t _old = reg_EVENT_PACKET [entry->front_end_id][entry->context_id]; 784 uint32_t _new = packet; 785 if (_old < _top) _old = _old+_param->_size_queue; 786 if (_new < _top) _new = _new+_param->_size_queue; 787 if (_new < _old) reg_EVENT_PACKET [entry->front_end_id][entry->context_id] = packet; 788 } 789 else 790 reg_EVENT_PACKET [entry->front_end_id][entry->context_id] = packet; 791 792 // In all case, stop instruction flow 793 reg_EVENT_STOP [entry->front_end_id][entry->context_id] = true; 794 // reg_EVENT_NUM_BANK [entry->front_end_id][entry->context_id] = num_bank; 795 // reg_EVENT_NUM_PTR [entry->front_end_id][entry->context_id] = entry->ptr; 796 797 reg_EVENT_CAN_RESTART [entry->front_end_id][entry->context_id] = false; 798 799 reg_EVENT_LAST_NUM_BANK [entry->front_end_id][entry->context_id] = ((reg_NUM_BANK_TAIL==0)?_param->_nb_bank:reg_NUM_BANK_TAIL)-1; 800 reg_EVENT_LAST_NUM_PTR [entry->front_end_id][entry->context_id] = reg_NUM_PTR_TAIL; 801 } 526 802 } 527 803 … … 529 805 // =====[ UPDATE ]==================================================== 530 806 // =================================================================== 807 // Update when exception or load_miss 531 808 if (internal_UPDATE_VAL and PORT_READ(in_UPDATE_ACK)) 532 809 { 533 810 log_printf(TRACE,Commit_unit,FUNCTION," * UPDATE"); 534 811 812 // Change state 535 813 entry_t * entry = _rob [internal_UPDATE_NUM_BANK].front(); 536 814 … … 556 834 } 557 835 } 558 559 836 } 560 837 … … 578 855 // =====[ DEPTH - HEAD ]============================================== 579 856 // =================================================================== 580 for (uint32_t i=0; i<_param->_nb_bank; i++) 581 if (not _rob[i].empty()) 582 { 583 // Scan all instruction in windows and test if instruction is speculative 584 entry_t * entry = _rob [i].front(); 585 586 Tcontext_t front_end_id = entry->front_end_id; 587 Tcontext_t context_id = entry->context_id ; 588 rob_state_t state = entry->state; 589 Tdepth_t depth = entry->depth; 590 591 Tdepth_t depth_min = (_param->_have_port_depth)?PORT_READ(in_DEPTH_MIN[front_end_id][context_id]):0; 592 Tdepth_t depth_max = (_param->_have_port_depth)?PORT_READ(in_DEPTH_MAX[front_end_id][context_id]):0; 593 Tcontrol_t depth_full = PORT_READ(in_DEPTH_FULL [front_end_id][context_id]); 857 858 { 859 bool EVENT_LAST [_param->_nb_front_end][_param->_max_nb_context]; 860 for (uint32_t i=0; i<_param->_nb_front_end; i++) 861 for (uint32_t j=0; j<_param->_nb_context [i]; j++) 862 EVENT_LAST [i][j] = reg_EVENT_LAST [i][j]; 863 864 // Read all instruction of all top bank 865 for (uint32_t i=0; i<_param->_nb_bank; i++) 866 { 867 uint32_t num_bank = (reg_NUM_BANK_HEAD+i)%_param->_nb_bank; 594 868 595 // is a valid instruction ? 596 // If DEPTH_CURRENT : 597 // equal at DEPTH_MIN -> not speculative 598 // not include ]DEPTH_MIN:DEPTH_MAX] -> previous branch miss 599 // include ]DEPTH_MIN:DEPTH_MAX] -> speculative 600 601 // All case 602 // ....... min ...X... max ....... OK 603 // ....... min ....... max ...X... KO 604 // ...X... min ....... max ....... KO 605 // ....... max ....... min ...X... OK 606 // ...X... max ....... min ....... OK 607 // ....... max ...X... min ....... KO 608 609 bool flush = reg_EVENT_FLUSH [front_end_id][context_id]; 610 bool speculative = entry->speculative and not (depth == depth_min); 611 Tcontrol_t is_valid = ((not speculative or 612 (speculative and (depth_full or // all is valid 613 ((depth_min <= depth_max)? // test if depth is overflow 614 ((depth >= depth_min) and (depth <=depth_max)): 615 ((depth >= depth_min) or (depth <=depth_max)))))) 616 and not flush); 617 618 // Tcontrol_t is_valid = ((depth == depth_min) and not flush); 619 620 log_printf(TRACE,Commit_unit,FUNCTION," * HEAD [%d]",i); 621 log_printf(TRACE,Commit_unit,FUNCTION," * is_valid : %d ((depth == depth_min) and not flush)",is_valid); 622 log_printf(TRACE,Commit_unit,FUNCTION," * depth : %d",depth ); 623 log_printf(TRACE,Commit_unit,FUNCTION," * depth_min : %d",depth_min); 624 log_printf(TRACE,Commit_unit,FUNCTION," * depth_max : %d",depth_max); 625 log_printf(TRACE,Commit_unit,FUNCTION," * depth_full : %d",depth_full); 626 log_printf(TRACE,Commit_unit,FUNCTION," * flush : %d",flush); 627 628 //------------------------------------------------------ 629 // test if instruction is miss speculative 630 //------------------------------------------------------ 631 if (not is_valid) 632 { 633 switch (state) 634 { 635 case ROB_BRANCH_WAIT_END : {state = ROB_EVENT_WAIT_END; break;} 636 case ROB_BRANCH_COMPLETE : {state = ROB_END_MISS ; break;} 637 case ROB_END_BRANCH_MISS : 638 case ROB_END_BRANCH_MISS_SPECULATIVE : {state = ROB_END_MISS ; break;} 639 case ROB_END_LOAD_MISS_UPDATE : 640 case ROB_END_LOAD_MISS : 641 case ROB_END_LOAD_MISS_SPECULATIVE : {state = ROB_END_MISS ; break;} 642 case ROB_STORE_WAIT_HEAD_OK : {state = ROB_STORE_HEAD_KO ; break;} 643 //case ROB_STORE_WAIT_HEAD_KO : {state = ; break;} 644 case ROB_OTHER_WAIT_END : {state = ROB_EVENT_WAIT_END; break;} 645 case ROB_END_OK : 646 case ROB_END_OK_SPECULATIVE : {state = ROB_END_MISS ; break;} 647 case ROB_END_KO : 648 case ROB_END_KO_SPECULATIVE : {state = ROB_END_MISS ; break;} 649 case ROB_END_EXCEPTION_UPDATE : 650 case ROB_END_EXCEPTION : 651 case ROB_END_EXCEPTION_WAIT_HEAD : {state = ROB_END_MISS ; break;} 652 653 // don't change 654 case ROB_STORE_HEAD_KO : {break;} 655 case ROB_EVENT_WAIT_END : {break;} 656 case ROB_END_MISS : {break;} 657 658 // can't have miss speculation 659 case ROB_STORE_HEAD_OK : 660 default : 661 { 662 throw ERRORMORPHEO(FUNCTION,toString(_("Miss Speculation : Invalide state : %s.\n"),toString(state).c_str())); 663 break; 664 } 665 } 666 } 667 668 //------------------------------------------------------ 669 // test if instruction is not speculative 670 //------------------------------------------------------ 671 entry->speculative = speculative; 672 // if (entry->depth == depth_min) 673 if (not speculative) 674 { 675 switch (state) 676 { 677 case ROB_END_OK_SPECULATIVE : {state = ROB_END_OK ; break;} 678 case ROB_END_KO_SPECULATIVE : {state = ROB_END_KO ; break;} 679 case ROB_END_BRANCH_MISS_SPECULATIVE : {state = ROB_END_BRANCH_MISS ; break;} 680 case ROB_END_LOAD_MISS_SPECULATIVE : {state = ROB_END_LOAD_MISS_UPDATE ; break;} 681 default : {break;} // else, no change 682 } 683 } 684 685 //------------------------------------------------------ 686 // test if instruction is store and head 687 //------------------------------------------------------ 688 if (i == reg_NUM_BANK_HEAD) 689 { 690 switch (state) 691 { 692 case ROB_STORE_WAIT_HEAD_OK : {state = ROB_STORE_HEAD_OK; break;} 693 case ROB_END_EXCEPTION_WAIT_HEAD : {state = ROB_END_EXCEPTION_UPDATE; break;} 694 default : {break;} // else, no change 695 } 696 } 697 698 entry->state = state; 699 } 700 } 701 702 // =================================================================== 703 // =====[ OTHER ]===================================================== 704 // =================================================================== 869 // Test if have an instruction 870 if (not _rob[num_bank].empty()) 871 { 872 // Scan all instruction in windows and test if instruction is speculative 873 entry_t * entry = _rob [num_bank].front(); 874 875 Tcontext_t front_end_id = entry->front_end_id; 876 Tcontext_t context_id = entry->context_id ; 877 878 // scan while last event instruction is not retire 879 if (EVENT_LAST [front_end_id][context_id] == false) 880 { 881 // Read information 882 rob_state_t state = entry->state; 883 Tdepth_t depth = entry->depth; 884 885 Tdepth_t depth_min = (_param->_have_port_depth)?PORT_READ(in_DEPTH_MIN[front_end_id][context_id]):0; 886 Tdepth_t depth_max = (_param->_have_port_depth)?PORT_READ(in_DEPTH_MAX[front_end_id][context_id]):0; 887 Tcontrol_t depth_full = PORT_READ(in_DEPTH_FULL [front_end_id][context_id]); 888 889 // is a valid instruction ? 890 // If DEPTH_CURRENT : 891 // equal at DEPTH_MIN -> not speculative 892 // not include ]DEPTH_MIN:DEPTH_MAX] -> previous branch miss 893 // include ]DEPTH_MIN:DEPTH_MAX] -> speculative 894 895 // All case 896 // ....... min ...X... max ....... OK 897 // ....... min ....... max ...X... KO 898 // ...X... min ....... max ....... KO 899 // ....... max ....... min ...X... OK 900 // ...X... max ....... min ....... OK 901 // ....... max ...X... min ....... KO 902 903 bool flush = ((reg_EVENT_STATE [front_end_id][context_id] == COMMIT_EVENT_STATE_EVENT) or 904 (reg_EVENT_STATE [front_end_id][context_id] == COMMIT_EVENT_STATE_WAIT_DECOD) or 905 (reg_EVENT_STATE [front_end_id][context_id] == COMMIT_EVENT_STATE_WAIT_END)); 906 bool speculative = entry->speculative and not (depth == depth_min); 907 Tcontrol_t is_valid = ((not speculative or 908 (speculative and (depth_full or // all is valid 909 ((depth_min <= depth_max)? // test if depth is overflow 910 ((depth >= depth_min) and (depth <=depth_max)): 911 ((depth >= depth_min) or (depth <=depth_max)))))) 912 and not flush); // no event 913 914 //Tcontrol_t is_valid = ((depth == depth_min) and not flush); 915 916 log_printf(TRACE,Commit_unit,FUNCTION," * HEAD [%d] - %d",num_bank,((entry->ptr << _param->_shift_num_slot) | num_bank)); 917 918 log_printf(TRACE,Commit_unit,FUNCTION," * is_valid : %d ((depth == depth_min) and not flush)",is_valid); 919 log_printf(TRACE,Commit_unit,FUNCTION," * depth : %d",depth ); 920 log_printf(TRACE,Commit_unit,FUNCTION," * depth_min : %d",depth_min); 921 log_printf(TRACE,Commit_unit,FUNCTION," * depth_max : %d",depth_max); 922 log_printf(TRACE,Commit_unit,FUNCTION," * depth_full : %d",depth_full); 923 log_printf(TRACE,Commit_unit,FUNCTION," * speculative : %d",speculative); 924 log_printf(TRACE,Commit_unit,FUNCTION," * flush : %d",flush); 925 926 //------------------------------------------------------ 927 // test if instruction is miss speculative 928 //------------------------------------------------------ 929 if (not is_valid) 930 { 931 // Change state 932 switch (state) 933 { 934 case ROB_BRANCH_WAIT_END : {state = ROB_EVENT_WAIT_END; break;} 935 case ROB_BRANCH_COMPLETE : {state = ROB_END_MISS ; break;} 936 case ROB_END_BRANCH_MISS : 937 case ROB_END_BRANCH_MISS_SPECULATIVE : {state = ROB_END_MISS ; break;} 938 case ROB_END_LOAD_MISS_UPDATE : 939 case ROB_END_LOAD_MISS : 940 case ROB_END_LOAD_MISS_SPECULATIVE : {state = ROB_END_MISS ; break;} 941 case ROB_STORE_OK : {state = ROB_STORE_KO ; break;} 942 case ROB_STORE_WAIT_END_OK : {state = ROB_STORE_WAIT_END_KO; break;} 943 case ROB_STORE_OK_WAIT_END : {state = ROB_STORE_KO_WAIT_END; break;} 944 case ROB_OTHER_WAIT_END : {state = ROB_EVENT_WAIT_END; break;} 945 case ROB_END_OK : 946 case ROB_END_OK_SPECULATIVE : {state = ROB_END_MISS ; break;} 947 case ROB_END_KO : 948 case ROB_END_KO_SPECULATIVE : {state = ROB_END_MISS ; break;} 949 case ROB_END_EXCEPTION_UPDATE : 950 case ROB_END_EXCEPTION : 951 case ROB_END_EXCEPTION_WAIT_HEAD : {state = ROB_END_MISS ; break;} 952 953 // don't change state -> wait 954 case ROB_STORE_WAIT_END_KO : {break;} 955 case ROB_STORE_KO : {break;} 956 case ROB_STORE_KO_WAIT_END : {break;} 957 case ROB_STORE_EVENT : {break;} 958 case ROB_EVENT_WAIT_END : {break;} 959 case ROB_END_MISS : {break;} 960 case ROB_END : {break;} 961 962 // can't have miss speculation -> invalid state 963 default : 964 { 965 throw ERRORMORPHEO(FUNCTION,toString(_("Miss Speculation : Invalide state : %s.\n"),toString(state).c_str())); 966 break; 967 } 968 } 969 } 970 971 //------------------------------------------------------ 972 // test if instruction is not speculative 973 //------------------------------------------------------ 974 entry->speculative = speculative; 975 // if (entry->depth == depth_min) 976 // test if instruction is speculative (depth != depth_min) 977 if (not speculative) 978 { 979 switch (state) 980 { 981 case ROB_END_OK_SPECULATIVE : {state = ROB_END_OK ; break;} 982 case ROB_END_KO_SPECULATIVE : {state = ROB_END_KO ; break;} 983 case ROB_END_BRANCH_MISS_SPECULATIVE : {state = ROB_END_BRANCH_MISS ; break;} 984 case ROB_END_LOAD_MISS_SPECULATIVE : {state = ROB_END_LOAD_MISS_UPDATE ; break;} 985 default : {break;} // else, no change 986 } 987 } 988 989 //------------------------------------------------------ 990 // test if instruction wait head and is the top of rob 991 //------------------------------------------------------ 992 // TODO : retire OOO 993 if (i == 0) 994 { 995 switch (state) 996 { 997 // case ROB_STORE_WAIT_HEAD_OK : {state = ROB_STORE_HEAD_OK; break;} 998 case ROB_END_EXCEPTION_WAIT_HEAD : {state = ROB_END_EXCEPTION_UPDATE; break;} 999 default : {break;} // else, no change 1000 } 1001 } 1002 1003 // Write new state 1004 entry->state = state; 1005 1006 // Test if this instruction is the last of event 1007 if ((reg_EVENT_STATE [front_end_id][context_id] != COMMIT_EVENT_STATE_NO_EVENT) and 1008 (reg_EVENT_LAST_NUM_BANK [front_end_id][context_id] == num_bank ) and 1009 (reg_EVENT_LAST_NUM_PTR [front_end_id][context_id] == entry->ptr )) 1010 { 1011 log_printf(TRACE,Commit_unit,FUNCTION," * Stop Scan !!!"); 1012 1013 EVENT_LAST [front_end_id][context_id] = true; 1014 } 1015 } 1016 } 1017 } 1018 } 1019 1020 705 1021 706 1022 #ifdef STATISTICS … … 709 1025 *(_stat_bank_nb_inst [i]) += _rob[i].size(); 710 1026 #endif 1027 } 1028 1029 // =================================================================== 1030 // =====[ OTHER ]===================================================== 1031 // =================================================================== 711 1032 712 1033 #if (DEBUG >= DEBUG_TRACE) and (DEBUG_Commit_unit == true) … … 715 1036 log_printf(TRACE,Commit_unit,FUNCTION," * num_bank_head : %d",reg_NUM_BANK_HEAD); 716 1037 log_printf(TRACE,Commit_unit,FUNCTION," * num_bank_tail : %d",reg_NUM_BANK_TAIL); 1038 log_printf(TRACE,Commit_unit,FUNCTION," * num_ptr_tail : %d",reg_NUM_PTR_TAIL ); 717 1039 718 1040 for (uint32_t i=0; i<_param->_nb_front_end; i++) … … 720 1042 { 721 1043 log_printf(TRACE,Commit_unit,FUNCTION," * [%d][%d] - %d",i,j,_param->_translate_num_context_to_num_thread [i][j]); 722 log_printf(TRACE,Commit_unit,FUNCTION," * EVENT_STATE : %s",toString(reg_EVENT_STATE [i][j]).c_str()); 723 log_printf(TRACE,Commit_unit,FUNCTION," * EVENT_FLUSH : %d",reg_EVENT_FLUSH [i][j]); 724 log_printf(TRACE,Commit_unit,FUNCTION," * EVENT_STOP : %d",reg_EVENT_STOP [i][j]); 725 log_printf(TRACE,Commit_unit,FUNCTION," * NB_INST_ALL : %d",reg_NB_INST_COMMIT_ALL[i][j]); 726 log_printf(TRACE,Commit_unit,FUNCTION," * NB_INST_MEM : %d",reg_NB_INST_COMMIT_MEM[i][j]); 727 log_printf(TRACE,Commit_unit,FUNCTION," * PC_CURRENT : %.8x (%.8x) - %d %d",reg_PC_CURRENT [i][j],reg_PC_CURRENT [i][j]<<2, reg_PC_CURRENT_IS_DS [i][j], reg_PC_CURRENT_IS_DS_TAKE [i][j]); 728 log_printf(TRACE,Commit_unit,FUNCTION," * PC_NEXT : %.8x (%.8x)",reg_PC_NEXT [i][j],reg_PC_NEXT [i][j]<<2); 1044 log_printf(TRACE,Commit_unit,FUNCTION," * EVENT_STATE : %s - %s",toString(reg_EVENT_STATE [i][j]).c_str(),toString(commit_event_state_to_event_state(reg_EVENT_STATE [i][j])).c_str()); 1045 // log_printf(TRACE,Commit_unit,FUNCTION," * EVENT_FLUSH : %d",reg_EVENT_FLUSH [i][j]); 1046 log_printf(TRACE,Commit_unit,FUNCTION," * EVENT_STOP : %d",reg_EVENT_STOP [i][j]); 1047 // log_printf(TRACE,Commit_unit,FUNCTION," * EVENT : %d (bank %d, ptr %d)",((reg_EVENT_NUM_PTR [i][j] << _param->_shift_num_slot) | reg_EVENT_NUM_BANK [i][j]), reg_EVENT_NUM_BANK [i][j],reg_EVENT_NUM_PTR [i][j]); 1048 log_printf(TRACE,Commit_unit,FUNCTION," * EVENT_CAN_RESTART : %d",reg_EVENT_CAN_RESTART [i][j]); 1049 log_printf(TRACE,Commit_unit,FUNCTION," * EVENT_PACKET : %d",reg_EVENT_PACKET[i][j]); 1050 log_printf(TRACE,Commit_unit,FUNCTION," * EVENT_LAST : %d",reg_EVENT_LAST [i][j]); 1051 log_printf(TRACE,Commit_unit,FUNCTION," * EVENT_LAST : %d (bank %d, ptr %d)",((reg_EVENT_LAST_NUM_PTR [i][j] << _param->_shift_num_slot) | reg_EVENT_LAST_NUM_BANK [i][j]), reg_EVENT_LAST_NUM_BANK [i][j],reg_EVENT_LAST_NUM_PTR [i][j]); 1052 log_printf(TRACE,Commit_unit,FUNCTION," * NB_INST_ALL : %d",reg_NB_INST_COMMIT_ALL[i][j]); 1053 log_printf(TRACE,Commit_unit,FUNCTION," * NB_INST_MEM : %d",reg_NB_INST_COMMIT_MEM[i][j]); 1054 log_printf(TRACE,Commit_unit,FUNCTION," * PC_CURRENT : %.8x (%.8x) - %d %d",reg_PC_CURRENT [i][j],reg_PC_CURRENT [i][j]<<2, reg_PC_CURRENT_IS_DS [i][j], reg_PC_CURRENT_IS_DS_TAKE [i][j]); 1055 log_printf(TRACE,Commit_unit,FUNCTION," * PC_NEXT : %.8x (%.8x)",reg_PC_NEXT [i][j],reg_PC_NEXT [i][j]<<2); 729 1056 } 730 1057 1058 std::list<entry_t*>::iterator iter [_param->_nb_bank]; 731 1059 for (uint32_t i=0; i<_param->_nb_bank; i++) 732 1060 { 733 1061 uint32_t num_bank = (reg_NUM_BANK_HEAD+i)%_param->_nb_bank; 734 735 log_printf(TRACE,Commit_unit,FUNCTION," * Bank [%d] size : %d, ptr : %d",num_bank,(int)_rob[num_bank].size(), reg_BANK_PTR [i]); 1062 // log_printf(TRACE,Commit_unit,FUNCTION," * Bank [%d] size : %d, ptr : %d",num_bank,(int)_rob[num_bank].size(), reg_BANK_PTR [i]); 1063 1064 iter [num_bank] = _rob[num_bank].begin(); 1065 } 1066 1067 bool all_empty = false; 1068 while (not all_empty) 1069 { 1070 all_empty = true; 736 1071 737 for (std::list<entry_t*>::iterator it=_rob[num_bank].begin(); 738 it!=_rob[num_bank].end(); 739 it++) 1072 for (uint32_t i=0; i<_param->_nb_bank; i++) 740 1073 { 741 log_printf(TRACE,Commit_unit,FUNCTION," [%.4d][%.4d] (%.4d) %.4d %.4d %.4d %.4d, %.3d %.3d, %.1d, %.1d %.4d, %.1d %.4d, %s", 742 num_bank , 743 (*it)->ptr , 744 (((*it)->ptr << _param->_shift_num_slot) | num_bank), 745 (*it)->front_end_id , 746 (*it)->context_id , 747 (*it)->rename_unit_id , 748 (*it)->depth , 749 (*it)->type , 750 (*it)->operation , 751 (*it)->is_delay_slot , 752 (*it)->use_store_queue , 753 (*it)->store_queue_ptr_write , 754 (*it)->use_load_queue , 755 (*it)->load_queue_ptr_write , 756 toString((*it)->state).c_str() ); 757 log_printf(TRACE,Commit_unit,FUNCTION," %.1d %.2d %.6d, %.1d %.2d %.6d, %.1d %.1d %.6d, %.1d %.2d %.6d %.6d, %.1d %.1d %.6d %.6d ", 758 (*it)->read_ra , 759 (*it)->num_reg_ra_log , 760 (*it)->num_reg_ra_phy , 761 (*it)->read_rb , 762 (*it)->num_reg_rb_log , 763 (*it)->num_reg_rb_phy , 764 (*it)->read_rc , 765 (*it)->num_reg_rc_log , 766 (*it)->num_reg_rc_phy , 767 (*it)->write_rd , 768 (*it)->num_reg_rd_log , 769 (*it)->num_reg_rd_phy_old , 770 (*it)->num_reg_rd_phy_new , 771 (*it)->write_re , 772 (*it)->num_reg_re_log , 773 (*it)->num_reg_re_phy_old , 774 (*it)->num_reg_re_phy_new ); 775 776 log_printf(TRACE,Commit_unit,FUNCTION," %.2d %.2d %.1d %.1d %.1d - %.8x (%.8x) %.8x (%.8x)", 777 (*it)->exception_use , 778 (*it)->exception , 779 (*it)->flags , 780 (*it)->no_sequence , 781 (*it)->speculative , 782 (*it)->address , 783 (*it)->address<<2 , 784 (*it)->address_next , 785 (*it)->address_next<<2 786 ); 1074 uint32_t num_bank = (reg_NUM_BANK_HEAD+i)%_param->_nb_bank; 1075 1076 std::list<entry_t*>::iterator it = iter[num_bank]; 1077 if (it != _rob[num_bank].end()) 1078 { 1079 all_empty = false; 1080 1081 log_printf(TRACE,Commit_unit,FUNCTION," [%.4d][%.4d] (%.4d) %.4d %.4d %.4d %.4d, %.3d %.3d, %.1d, %.1d %.4d, %.1d %.4d, %s", 1082 num_bank , 1083 (*it)->ptr , 1084 (((*it)->ptr << _param->_shift_num_slot) | num_bank), 1085 (*it)->front_end_id , 1086 (*it)->context_id , 1087 (*it)->rename_unit_id , 1088 (*it)->depth , 1089 (*it)->type , 1090 (*it)->operation , 1091 (*it)->is_delay_slot , 1092 (*it)->use_store_queue , 1093 (*it)->store_queue_ptr_write , 1094 (*it)->use_load_queue , 1095 (*it)->load_queue_ptr_write , 1096 toString((*it)->state).c_str() ); 1097 log_printf(TRACE,Commit_unit,FUNCTION," %.1d %.2d %.6d, %.1d %.2d %.6d, %.1d %.1d %.6d, %.1d %.2d %.6d %.6d, %.1d %.1d %.6d %.6d ", 1098 (*it)->read_ra , 1099 (*it)->num_reg_ra_log , 1100 (*it)->num_reg_ra_phy , 1101 (*it)->read_rb , 1102 (*it)->num_reg_rb_log , 1103 (*it)->num_reg_rb_phy , 1104 (*it)->read_rc , 1105 (*it)->num_reg_rc_log , 1106 (*it)->num_reg_rc_phy , 1107 (*it)->write_rd , 1108 (*it)->num_reg_rd_log , 1109 (*it)->num_reg_rd_phy_old , 1110 (*it)->num_reg_rd_phy_new , 1111 (*it)->write_re , 1112 (*it)->num_reg_re_log , 1113 (*it)->num_reg_re_phy_old , 1114 (*it)->num_reg_re_phy_new ); 1115 1116 log_printf(TRACE,Commit_unit,FUNCTION," %.2d %.2d %.1d %.1d %.1d - %.8x (%.8x) %.8x (%.8x)", 1117 (*it)->exception_use , 1118 (*it)->exception , 1119 (*it)->flags , 1120 (*it)->no_sequence , 1121 (*it)->speculative , 1122 (*it)->address , 1123 (*it)->address<<2 , 1124 (*it)->address_next , 1125 (*it)->address_next<<2 1126 ); 1127 1128 iter [num_bank] ++; 1129 } 787 1130 } 788 1131 } … … 822 1165 ) 823 1166 if (entry->address != reg_PC_CURRENT[entry->front_end_id][entry->context_id]) 824 throw ERRORMORPHEO(FUNCTION,toString(_("Rob top address ( %x) is different of reg_PC_CURRENT[%d][%d] (%x).\n"),1167 throw ERRORMORPHEO(FUNCTION,toString(_("Rob top address (0x%x) is different of reg_PC_CURRENT[%d][%d] (0x%x).\n"), 825 1168 entry->address, 826 1169 entry->front_end_id, -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_OOO_Engine/OOO_Engine/Commit_unit/src/Parameters_msg_error.cpp
r110 r122 40 40 test.error(_("nb_bank must be a multiple of size_queue.\n")); 41 41 42 if (_nb_inst_reexecute != 1)43 test.error(_("nb_inst_reexecute must be set at 1. Anothers value is unsupported.\n"));42 // if (_nb_inst_reexecute != 1) 43 // test.error(_("nb_inst_reexecute must be set at 1. Anothers value is unsupported.\n")); 44 44 45 45 for (uint32_t i=0; i<_nb_front_end; ++i) -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_OOO_Engine/OOO_Engine/Issue_queue/include/Issue_queue.h
r111 r122 77 77 public : SC_IN (Ttype_t ) *** in_ISSUE_IN_TYPE ;//[nb_rename_unit][nb_inst_rename] 78 78 public : SC_IN (Tlsq_ptr_t ) *** in_ISSUE_IN_STORE_QUEUE_PTR_WRITE ;//[nb_rename_unit][nb_inst_rename] 79 public : SC_IN (Tlsq_ptr_t ) *** in_ISSUE_IN_STORE_QUEUE_PTR_READ ;//[nb_rename_unit][nb_inst_rename] 80 public : SC_IN (Tcontrol_t ) *** in_ISSUE_IN_STORE_QUEUE_EMPTY ;//[nb_rename_unit][nb_inst_rename] 79 81 public : SC_IN (Tlsq_ptr_t ) *** in_ISSUE_IN_LOAD_QUEUE_PTR_WRITE ;//[nb_rename_unit][nb_inst_rename] 80 82 public : SC_IN (Tcontrol_t ) *** in_ISSUE_IN_HAS_IMMEDIAT ;//[nb_rename_unit][nb_inst_rename] … … 100 102 public : SC_IN (Ttype_t ) ** in_REEXECUTE_TYPE ;//[nb_inst_reexecute] 101 103 public : SC_IN (Tlsq_ptr_t ) ** in_REEXECUTE_STORE_QUEUE_PTR_WRITE;//[nb_inst_reexecute] 104 public : SC_IN (Tlsq_ptr_t ) ** in_REEXECUTE_STORE_QUEUE_PTR_READ ;//[nb_inst_reexecute] 105 public : SC_IN (Tcontrol_t ) ** in_REEXECUTE_STORE_QUEUE_EMPTY ;//[nb_inst_reexecute] 102 106 public : SC_IN (Tlsq_ptr_t ) ** in_REEXECUTE_LOAD_QUEUE_PTR_WRITE ;//[nb_inst_reexecute] 103 107 public : SC_IN (Tcontrol_t ) ** in_REEXECUTE_HAS_IMMEDIAT ;//[nb_inst_reexecute] … … 123 127 public : SC_OUT(Ttype_t ) ** out_ISSUE_OUT_TYPE ;//[nb_inst_issue] 124 128 public : SC_OUT(Tlsq_ptr_t ) ** out_ISSUE_OUT_STORE_QUEUE_PTR_WRITE;//[nb_inst_issue] 129 public : SC_OUT(Tlsq_ptr_t ) ** out_ISSUE_OUT_STORE_QUEUE_PTR_READ ;//[nb_inst_issue] 130 public : SC_OUT(Tcontrol_t ) ** out_ISSUE_OUT_STORE_QUEUE_EMPTY ;//[nb_inst_issue] 125 131 public : SC_OUT(Tlsq_ptr_t ) ** out_ISSUE_OUT_LOAD_QUEUE_PTR_WRITE ;//[nb_inst_issue] 126 132 public : SC_OUT(Tcontrol_t ) ** out_ISSUE_OUT_HAS_IMMEDIAT ;//[nb_inst_issue] -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_OOO_Engine/OOO_Engine/Issue_queue/include/Types.h
r111 r122 33 33 public : Ttype_t _type ; 34 34 public : Tlsq_ptr_t _store_queue_ptr_write ; 35 public : Tlsq_ptr_t _store_queue_ptr_read ; 36 public : Tcontrol_t _store_queue_empty ; 35 37 public : Tlsq_ptr_t _load_queue_ptr_write ; 36 38 public : Tcontrol_t _has_immediat ; … … 53 55 Ttype_t type , 54 56 Tlsq_ptr_t store_queue_ptr_write , 57 Tlsq_ptr_t store_queue_ptr_read , 58 Tcontrol_t store_queue_empty , 55 59 Tlsq_ptr_t load_queue_ptr_write , 56 60 Tcontrol_t has_immediat , … … 73 77 _type = type ; 74 78 _store_queue_ptr_write = store_queue_ptr_write; 79 _store_queue_ptr_read = store_queue_ptr_read ; 80 _store_queue_empty = store_queue_empty ; 75 81 _load_queue_ptr_write = load_queue_ptr_write ; 76 82 _has_immediat = has_immediat ; -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_OOO_Engine/OOO_Engine/Issue_queue/src/Issue_queue_allocation.cpp
r112 r122 69 69 _ALLOC2_SIGNAL_IN ( in_ISSUE_IN_TYPE ,"type" ,Ttype_t ,_param->_size_type ,_param->_nb_rename_unit, _param->_nb_inst_rename[it1]); 70 70 _ALLOC2_SIGNAL_IN ( in_ISSUE_IN_STORE_QUEUE_PTR_WRITE,"store_queue_ptr_write",Tlsq_ptr_t ,_param->_size_store_queue_ptr ,_param->_nb_rename_unit, _param->_nb_inst_rename[it1]); 71 _ALLOC2_SIGNAL_IN ( in_ISSUE_IN_STORE_QUEUE_PTR_READ ,"store_queue_ptr_read" ,Tlsq_ptr_t ,_param->_size_store_queue_ptr ,_param->_nb_rename_unit, _param->_nb_inst_rename[it1]); 72 _ALLOC2_SIGNAL_IN ( in_ISSUE_IN_STORE_QUEUE_EMPTY ,"store_queue_empty" ,Tcontrol_t ,1 ,_param->_nb_rename_unit, _param->_nb_inst_rename[it1]); 71 73 _ALLOC2_SIGNAL_IN ( in_ISSUE_IN_LOAD_QUEUE_PTR_WRITE ,"load_queue_ptr_write" ,Tlsq_ptr_t ,_param->_size_load_queue_ptr ,_param->_nb_rename_unit, _param->_nb_inst_rename[it1]); 72 74 _ALLOC2_SIGNAL_IN ( in_ISSUE_IN_HAS_IMMEDIAT ,"has_immediat" ,Tcontrol_t ,1 ,_param->_nb_rename_unit, _param->_nb_inst_rename[it1]); … … 98 100 ALLOC1_SIGNAL_IN ( in_REEXECUTE_TYPE ,"type" ,Ttype_t ,_param->_size_type ); 99 101 ALLOC1_SIGNAL_IN ( in_REEXECUTE_STORE_QUEUE_PTR_WRITE,"store_queue_ptr_write",Tlsq_ptr_t ,_param->_size_store_queue_ptr ); 102 ALLOC1_SIGNAL_IN ( in_REEXECUTE_STORE_QUEUE_PTR_READ ,"store_queue_ptr_read" ,Tlsq_ptr_t ,_param->_size_store_queue_ptr ); 103 ALLOC1_SIGNAL_IN ( in_REEXECUTE_STORE_QUEUE_EMPTY ,"store_queue_empty" ,Tcontrol_t ,1); 100 104 ALLOC1_SIGNAL_IN ( in_REEXECUTE_LOAD_QUEUE_PTR_WRITE ,"load_queue_ptr_write" ,Tlsq_ptr_t ,_param->_size_load_queue_ptr ); 101 105 ALLOC1_SIGNAL_IN ( in_REEXECUTE_HAS_IMMEDIAT ,"has_immediat" ,Tcontrol_t ,1 ); … … 127 131 ALLOC1_SIGNAL_OUT(out_ISSUE_OUT_TYPE ,"type" ,Ttype_t ,_param->_size_type ); 128 132 ALLOC1_SIGNAL_OUT(out_ISSUE_OUT_STORE_QUEUE_PTR_WRITE,"store_queue_ptr_write",Tlsq_ptr_t ,_param->_size_store_queue_ptr ); 133 ALLOC1_SIGNAL_OUT(out_ISSUE_OUT_STORE_QUEUE_PTR_READ ,"store_queue_ptr_read" ,Tlsq_ptr_t ,_param->_size_store_queue_ptr ); 134 ALLOC1_SIGNAL_OUT(out_ISSUE_OUT_STORE_QUEUE_EMPTY ,"store_queue_empty" ,Tcontrol_t ,1); 129 135 ALLOC1_SIGNAL_OUT(out_ISSUE_OUT_LOAD_QUEUE_PTR_WRITE ,"load_queue_ptr_write" ,Tlsq_ptr_t ,_param->_size_load_queue_ptr ); 130 136 ALLOC1_SIGNAL_OUT(out_ISSUE_OUT_HAS_IMMEDIAT ,"has_immediat" ,Tcontrol_t ,1 ); -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_OOO_Engine/OOO_Engine/Issue_queue/src/Issue_queue_deallocation.cpp
r112 r122 36 36 DELETE2_SIGNAL( in_ISSUE_IN_TYPE ,_param->_nb_rename_unit, _param->_nb_inst_rename[it1],_param->_size_type ); 37 37 DELETE2_SIGNAL( in_ISSUE_IN_STORE_QUEUE_PTR_WRITE,_param->_nb_rename_unit, _param->_nb_inst_rename[it1],_param->_size_store_queue_ptr ); 38 DELETE2_SIGNAL( in_ISSUE_IN_STORE_QUEUE_PTR_READ ,_param->_nb_rename_unit, _param->_nb_inst_rename[it1],_param->_size_store_queue_ptr ); 39 DELETE2_SIGNAL( in_ISSUE_IN_STORE_QUEUE_EMPTY ,_param->_nb_rename_unit, _param->_nb_inst_rename[it1],1); 38 40 DELETE2_SIGNAL( in_ISSUE_IN_LOAD_QUEUE_PTR_WRITE ,_param->_nb_rename_unit, _param->_nb_inst_rename[it1],_param->_size_load_queue_ptr ); 39 41 DELETE2_SIGNAL( in_ISSUE_IN_HAS_IMMEDIAT ,_param->_nb_rename_unit, _param->_nb_inst_rename[it1],1 ); … … 58 60 DELETE1_SIGNAL( in_REEXECUTE_TYPE ,_param->_nb_inst_reexecute,_param->_size_type ); 59 61 DELETE1_SIGNAL( in_REEXECUTE_STORE_QUEUE_PTR_WRITE,_param->_nb_inst_reexecute,_param->_size_store_queue_ptr ); 62 DELETE1_SIGNAL( in_REEXECUTE_STORE_QUEUE_PTR_READ ,_param->_nb_inst_reexecute,_param->_size_store_queue_ptr ); 63 DELETE1_SIGNAL( in_REEXECUTE_STORE_QUEUE_EMPTY ,_param->_nb_inst_reexecute,1); 60 64 DELETE1_SIGNAL( in_REEXECUTE_LOAD_QUEUE_PTR_WRITE ,_param->_nb_inst_reexecute,_param->_size_load_queue_ptr ); 61 65 DELETE1_SIGNAL( in_REEXECUTE_HAS_IMMEDIAT ,_param->_nb_inst_reexecute,1 ); … … 80 84 DELETE1_SIGNAL(out_ISSUE_OUT_TYPE ,_param->_nb_inst_issue,_param->_size_type ); 81 85 DELETE1_SIGNAL(out_ISSUE_OUT_STORE_QUEUE_PTR_WRITE,_param->_nb_inst_issue,_param->_size_store_queue_ptr ); 86 DELETE1_SIGNAL(out_ISSUE_OUT_STORE_QUEUE_PTR_READ ,_param->_nb_inst_issue,_param->_size_store_queue_ptr ); 87 DELETE1_SIGNAL(out_ISSUE_OUT_STORE_QUEUE_EMPTY ,_param->_nb_inst_issue,1); 82 88 DELETE1_SIGNAL(out_ISSUE_OUT_LOAD_QUEUE_PTR_WRITE ,_param->_nb_inst_issue,_param->_size_load_queue_ptr ); 83 89 DELETE1_SIGNAL(out_ISSUE_OUT_HAS_IMMEDIAT ,_param->_nb_inst_issue,1 ); -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_OOO_Engine/OOO_Engine/Issue_queue/src/Issue_queue_function_in_order_genMealy_issue_out.cpp
r117 r122 57 57 PORT_WRITE(out_ISSUE_OUT_TYPE [index], entry->_type ); 58 58 PORT_WRITE(out_ISSUE_OUT_STORE_QUEUE_PTR_WRITE [index], entry->_store_queue_ptr_write); 59 PORT_WRITE(out_ISSUE_OUT_STORE_QUEUE_PTR_READ [index], entry->_store_queue_ptr_read ); 60 PORT_WRITE(out_ISSUE_OUT_STORE_QUEUE_EMPTY [index], entry->_store_queue_empty ); 59 61 if (_param->_have_port_load_queue_ptr) 60 62 PORT_WRITE(out_ISSUE_OUT_LOAD_QUEUE_PTR_WRITE [index], entry->_load_queue_ptr_write ); … … 130 132 PORT_WRITE(out_ISSUE_OUT_TYPE [index], entry->_type ); 131 133 PORT_WRITE(out_ISSUE_OUT_STORE_QUEUE_PTR_WRITE [index], entry->_store_queue_ptr_write); 134 PORT_WRITE(out_ISSUE_OUT_STORE_QUEUE_PTR_READ [index], entry->_store_queue_ptr_read ); 135 PORT_WRITE(out_ISSUE_OUT_STORE_QUEUE_EMPTY [index], entry->_store_queue_empty ); 132 136 if (_param->_have_port_load_queue_ptr) 133 137 PORT_WRITE(out_ISSUE_OUT_LOAD_QUEUE_PTR_WRITE [index], entry->_load_queue_ptr_write ); -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_OOO_Engine/OOO_Engine/Issue_queue/src/Issue_queue_function_in_order_transition.cpp
r111 r122 66 66 PORT_READ(in_ISSUE_IN_TYPE [i][j]), 67 67 PORT_READ(in_ISSUE_IN_STORE_QUEUE_PTR_WRITE [i][j]), 68 PORT_READ(in_ISSUE_IN_STORE_QUEUE_PTR_READ [i][j]), 69 PORT_READ(in_ISSUE_IN_STORE_QUEUE_EMPTY [i][j]), 68 70 (_param->_have_port_load_queue_ptr)?PORT_READ(in_ISSUE_IN_LOAD_QUEUE_PTR_WRITE [i][j]):0, 69 71 PORT_READ(in_ISSUE_IN_HAS_IMMEDIAT [i][j]), -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_OOO_Engine/OOO_Engine/Issue_queue/src/Issue_queue_function_out_of_order_genMoore.cpp
r117 r122 125 125 PORT_WRITE(out_ISSUE_OUT_TYPE [i], entry->_type ); 126 126 PORT_WRITE(out_ISSUE_OUT_STORE_QUEUE_PTR_WRITE [i], entry->_store_queue_ptr_write); 127 PORT_WRITE(out_ISSUE_OUT_STORE_QUEUE_PTR_READ [i], entry->_store_queue_ptr_read ); 128 PORT_WRITE(out_ISSUE_OUT_STORE_QUEUE_EMPTY [i], entry->_store_queue_empty ); 127 129 if (_param->_have_port_load_queue_ptr) 128 130 PORT_WRITE(out_ISSUE_OUT_LOAD_QUEUE_PTR_WRITE [i], entry->_load_queue_ptr_write ); … … 186 188 PORT_WRITE(out_ISSUE_OUT_TYPE [i], entry->_type ); 187 189 PORT_WRITE(out_ISSUE_OUT_STORE_QUEUE_PTR_WRITE [i], entry->_store_queue_ptr_write); 190 PORT_WRITE(out_ISSUE_OUT_STORE_QUEUE_PTR_READ [i], entry->_store_queue_ptr_read ); 191 PORT_WRITE(out_ISSUE_OUT_STORE_QUEUE_EMPTY [i], entry->_store_queue_empty ); 188 192 if (_param->_have_port_load_queue_ptr) 189 193 PORT_WRITE(out_ISSUE_OUT_LOAD_QUEUE_PTR_WRITE [i], entry->_load_queue_ptr_write ); -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_OOO_Engine/OOO_Engine/Issue_queue/src/Issue_queue_function_out_of_order_transition.cpp
r111 r122 65 65 PORT_READ(in_ISSUE_IN_TYPE [x][y]), 66 66 PORT_READ(in_ISSUE_IN_STORE_QUEUE_PTR_WRITE [x][y]), 67 PORT_READ(in_ISSUE_IN_STORE_QUEUE_PTR_READ [x][y]), 68 PORT_READ(in_ISSUE_IN_STORE_QUEUE_EMPTY [x][y]), 67 69 (_param->_have_port_load_queue_ptr)?PORT_READ(in_ISSUE_IN_LOAD_QUEUE_PTR_WRITE [x][y]):0, 68 70 PORT_READ(in_ISSUE_IN_HAS_IMMEDIAT [x][y]), -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_OOO_Engine/OOO_Engine/Issue_queue/src/Issue_queue_transition.cpp
r117 r122 53 53 PORT_READ(in_REEXECUTE_TYPE [i]), 54 54 PORT_READ(in_REEXECUTE_STORE_QUEUE_PTR_WRITE [i]), 55 PORT_READ(in_REEXECUTE_STORE_QUEUE_PTR_READ [i]), 56 PORT_READ(in_REEXECUTE_STORE_QUEUE_EMPTY [i]), 55 57 (_param->_have_port_load_queue_ptr)?PORT_READ(in_REEXECUTE_LOAD_QUEUE_PTR_WRITE [i]):0, 56 58 PORT_READ(in_REEXECUTE_HAS_IMMEDIAT [i]), … … 119 121 for (std::list<entry_t*>::iterator it=_issue_queue[i].begin();it!=_issue_queue[i].end(); ++it) 120 122 { 121 log_printf(TRACE,Issue_queue,FUNCTION," [%.4d] %.2d %.2d %.4d, %.2d %.3d, %.2d %.2d , %.1d %.8x, %.1d %.4d, %.1d %.4d, %.1d %.4d, %.1d %.4d, %.1d %.4d",123 log_printf(TRACE,Issue_queue,FUNCTION," [%.4d] %.2d %.2d %.4d, %.2d %.3d, %.2d %.2d %.1d %.2d, %.1d %.8x, %.1d %.4d, %.1d %.4d, %.1d %.4d, %.1d %.4d, %.1d %.4d", 122 124 j, 123 125 … … 130 132 131 133 (*it)->_store_queue_ptr_write, 134 (*it)->_store_queue_ptr_read , 135 (*it)->_store_queue_empty , 132 136 (*it)->_load_queue_ptr_write , 133 137 … … 161 165 for (std::list<entry_t*>::iterator it=_reexecute_queue.begin();it!=_reexecute_queue.end(); ++it) 162 166 { 163 log_printf(TRACE,Issue_queue,FUNCTION," [%.4d] %.2d %.2d %.4d, %.2d %.3d, %.2d %.2d , %.1d %.8x, %.1d %.4d, %.1d %.4d, %.1d %.4d, %.1d %.4d, %.1d %.4d",167 log_printf(TRACE,Issue_queue,FUNCTION," [%.4d] %.2d %.2d %.4d, %.2d %.3d, %.2d %.2d %.1d %.2d, %.1d %.8x, %.1d %.4d, %.1d %.4d, %.1d %.4d, %.1d %.4d, %.1d %.4d", 164 168 i, 165 169 … … 172 176 173 177 (*it)->_store_queue_ptr_write, 178 (*it)->_store_queue_ptr_read , 179 (*it)->_store_queue_empty , 174 180 (*it)->_load_queue_ptr_write , 175 181 -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_OOO_Engine/OOO_Engine/OOO_Engine_Glue/include/OOO_Engine_Glue.h
r121 r122 90 90 public : SC_IN (Tgeneral_data_t ) *** in_INSERT_RENAME_UNIT_IMMEDIAT ;//[nb_rename_unit][nb_inst_insert] 91 91 public : SC_IN (Tlsq_ptr_t ) *** in_INSERT_RENAME_UNIT_STORE_QUEUE_PTR_WRITE ;//[nb_rename_unit][nb_inst_insert] 92 public : SC_IN (Tlsq_ptr_t ) *** in_INSERT_RENAME_UNIT_STORE_QUEUE_PTR_READ ;//[nb_rename_unit][nb_inst_insert] 93 public : SC_IN (Tcontrol_t ) *** in_INSERT_RENAME_UNIT_STORE_QUEUE_EMPTY ;//[nb_rename_unit][nb_inst_insert] 92 94 public : SC_IN (Tlsq_ptr_t ) *** in_INSERT_RENAME_UNIT_LOAD_QUEUE_PTR_WRITE ;//[nb_rename_unit][nb_inst_insert] 93 95 public : SC_IN (Tcontrol_t ) *** in_INSERT_RENAME_UNIT_READ_RA ;//[nb_rename_unit][nb_inst_insert] … … 136 138 public : SC_OUT(Ttype_t ) *** out_INSERT_ISSUE_QUEUE_TYPE ;//[nb_rename_unit][nb_inst_insert] 137 139 public : SC_OUT(Tlsq_ptr_t ) *** out_INSERT_ISSUE_QUEUE_STORE_QUEUE_PTR_WRITE ;//[nb_rename_unit][nb_inst_insert] 140 public : SC_OUT(Tlsq_ptr_t ) *** out_INSERT_ISSUE_QUEUE_STORE_QUEUE_PTR_READ ;//[nb_rename_unit][nb_inst_insert] 141 public : SC_OUT(Tcontrol_t ) *** out_INSERT_ISSUE_QUEUE_STORE_QUEUE_EMPTY ;//[nb_rename_unit][nb_inst_insert] 138 142 public : SC_OUT(Tlsq_ptr_t ) *** out_INSERT_ISSUE_QUEUE_LOAD_QUEUE_PTR_WRITE ;//[nb_rename_unit][nb_inst_insert] 139 143 public : SC_OUT(Tcontrol_t ) *** out_INSERT_ISSUE_QUEUE_HAS_IMMEDIAT ;//[nb_rename_unit][nb_inst_insert] -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_OOO_Engine/OOO_Engine/OOO_Engine_Glue/src/OOO_Engine_Glue.cpp
r88 r122 152 152 << (*(in_INSERT_RENAME_UNIT_IMMEDIAT [i][j])) 153 153 << (*(in_INSERT_RENAME_UNIT_STORE_QUEUE_PTR_WRITE [i][j])) 154 << (*(in_INSERT_RENAME_UNIT_STORE_QUEUE_PTR_READ [i][j])) 155 << (*(in_INSERT_RENAME_UNIT_STORE_QUEUE_EMPTY [i][j])) 154 156 << (*(in_INSERT_RENAME_UNIT_READ_RA [i][j])) 155 157 << (*(in_INSERT_RENAME_UNIT_NUM_REG_RA_PHY [i][j])) -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_OOO_Engine/OOO_Engine/OOO_Engine_Glue/src/OOO_Engine_Glue_allocation.cpp
r121 r122 93 93 _ALLOC2_SIGNAL_IN ( in_INSERT_RENAME_UNIT_IMMEDIAT ,"RENAME_UNIT_IMMEDIAT" ,Tgeneral_data_t ,_param->_size_general_data ,_param->_nb_rename_unit,_param->_nb_inst_insert[it1]); 94 94 _ALLOC2_SIGNAL_IN ( in_INSERT_RENAME_UNIT_STORE_QUEUE_PTR_WRITE ,"RENAME_UNIT_STORE_QUEUE_PTR_WRITE" ,Tlsq_ptr_t ,_param->_size_store_queue_ptr ,_param->_nb_rename_unit,_param->_nb_inst_insert[it1]); 95 _ALLOC2_SIGNAL_IN ( in_INSERT_RENAME_UNIT_STORE_QUEUE_PTR_READ ,"RENAME_UNIT_STORE_QUEUE_PTR_READ" ,Tlsq_ptr_t ,_param->_size_store_queue_ptr ,_param->_nb_rename_unit,_param->_nb_inst_insert[it1]); 96 _ALLOC2_SIGNAL_IN ( in_INSERT_RENAME_UNIT_STORE_QUEUE_EMPTY ,"RENAME_UNIT_STORE_QUEUE_EMPTY" ,Tcontrol_t ,1 ,_param->_nb_rename_unit,_param->_nb_inst_insert[it1]); 95 97 _ALLOC2_SIGNAL_IN ( in_INSERT_RENAME_UNIT_LOAD_QUEUE_PTR_WRITE ,"RENAME_UNIT_LOAD_QUEUE_PTR_WRITE" ,Tlsq_ptr_t ,_param->_size_load_queue_ptr ,_param->_nb_rename_unit,_param->_nb_inst_insert[it1]); 96 98 _ALLOC2_SIGNAL_IN ( in_INSERT_RENAME_UNIT_READ_RA ,"RENAME_UNIT_READ_RA" ,Tcontrol_t ,1 ,_param->_nb_rename_unit,_param->_nb_inst_insert[it1]); … … 139 141 _ALLOC2_SIGNAL_OUT(out_INSERT_ISSUE_QUEUE_TYPE ,"ISSUE_QUEUE_TYPE" ,Ttype_t ,_param->_size_type ,_param->_nb_rename_unit,_param->_nb_inst_insert[it1]); 140 142 _ALLOC2_SIGNAL_OUT(out_INSERT_ISSUE_QUEUE_STORE_QUEUE_PTR_WRITE ,"ISSUE_QUEUE_STORE_QUEUE_PTR_WRITE" ,Tlsq_ptr_t ,_param->_size_store_queue_ptr ,_param->_nb_rename_unit,_param->_nb_inst_insert[it1]); 143 _ALLOC2_SIGNAL_OUT(out_INSERT_ISSUE_QUEUE_STORE_QUEUE_PTR_READ ,"ISSUE_QUEUE_STORE_QUEUE_PTR_READ" ,Tlsq_ptr_t ,_param->_size_store_queue_ptr ,_param->_nb_rename_unit,_param->_nb_inst_insert[it1]); 144 _ALLOC2_SIGNAL_OUT(out_INSERT_ISSUE_QUEUE_STORE_QUEUE_EMPTY ,"ISSUE_QUEUE_STORE_QUEUE_EMPTY" ,Tcontrol_t ,1 ,_param->_nb_rename_unit,_param->_nb_inst_insert[it1]); 141 145 _ALLOC2_SIGNAL_OUT(out_INSERT_ISSUE_QUEUE_LOAD_QUEUE_PTR_WRITE ,"ISSUE_QUEUE_LOAD_QUEUE_PTR_WRITE" ,Tlsq_ptr_t ,_param->_size_load_queue_ptr ,_param->_nb_rename_unit,_param->_nb_inst_insert[it1]); 142 146 _ALLOC2_SIGNAL_OUT(out_INSERT_ISSUE_QUEUE_HAS_IMMEDIAT ,"ISSUE_QUEUE_HAS_IMMEDIAT" ,Tcontrol_t ,1 ,_param->_nb_rename_unit,_param->_nb_inst_insert[it1]); -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_OOO_Engine/OOO_Engine/OOO_Engine_Glue/src/OOO_Engine_Glue_deallocation.cpp
r121 r122 48 48 DELETE2_SIGNAL( in_INSERT_RENAME_UNIT_IMMEDIAT ,_param->_nb_rename_unit,_param->_nb_inst_insert[it1],_param->_size_general_data ); 49 49 DELETE2_SIGNAL( in_INSERT_RENAME_UNIT_STORE_QUEUE_PTR_WRITE ,_param->_nb_rename_unit,_param->_nb_inst_insert[it1],_param->_size_store_queue_ptr ); 50 DELETE2_SIGNAL( in_INSERT_RENAME_UNIT_STORE_QUEUE_PTR_READ ,_param->_nb_rename_unit,_param->_nb_inst_insert[it1],_param->_size_store_queue_ptr ); 51 DELETE2_SIGNAL( in_INSERT_RENAME_UNIT_STORE_QUEUE_EMPTY ,_param->_nb_rename_unit,_param->_nb_inst_insert[it1],1 ); 50 52 DELETE2_SIGNAL( in_INSERT_RENAME_UNIT_LOAD_QUEUE_PTR_WRITE ,_param->_nb_rename_unit,_param->_nb_inst_insert[it1],_param->_size_load_queue_ptr ); 51 53 DELETE2_SIGNAL( in_INSERT_RENAME_UNIT_READ_RA ,_param->_nb_rename_unit,_param->_nb_inst_insert[it1],1 ); -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_OOO_Engine/OOO_Engine/OOO_Engine_Glue/src/OOO_Engine_Glue_genMealy_insert.cpp
r121 r122 36 36 Tgeneral_data_t IMMEDIAT = PORT_READ(in_INSERT_RENAME_UNIT_IMMEDIAT [i][j]); 37 37 Tlsq_ptr_t STORE_QUEUE_PTR_WRITE = PORT_READ(in_INSERT_RENAME_UNIT_STORE_QUEUE_PTR_WRITE [i][j]); 38 Tlsq_ptr_t STORE_QUEUE_PTR_READ = PORT_READ(in_INSERT_RENAME_UNIT_STORE_QUEUE_PTR_READ [i][j]); 39 Tcontrol_t STORE_QUEUE_EMPTY = PORT_READ(in_INSERT_RENAME_UNIT_STORE_QUEUE_EMPTY [i][j]); 38 40 Tlsq_ptr_t LOAD_QUEUE_PTR_WRITE = (_param->_have_port_load_queue_ptr)?PORT_READ(in_INSERT_RENAME_UNIT_LOAD_QUEUE_PTR_WRITE [i][j]):0; 39 41 Tcontrol_t READ_RA = PORT_READ(in_INSERT_RENAME_UNIT_READ_RA [i][j]); … … 91 93 PORT_WRITE(out_INSERT_ISSUE_QUEUE_OPERATION [i][j],OPERATION ); 92 94 PORT_WRITE(out_INSERT_ISSUE_QUEUE_STORE_QUEUE_PTR_WRITE [i][j],STORE_QUEUE_PTR_WRITE); 95 PORT_WRITE(out_INSERT_ISSUE_QUEUE_STORE_QUEUE_PTR_READ [i][j],STORE_QUEUE_PTR_READ ); 96 PORT_WRITE(out_INSERT_ISSUE_QUEUE_STORE_QUEUE_EMPTY [i][j],STORE_QUEUE_EMPTY ); 93 97 if (_param->_have_port_load_queue_ptr) 94 98 PORT_WRITE(out_INSERT_ISSUE_QUEUE_LOAD_QUEUE_PTR_WRITE [i][j],LOAD_QUEUE_PTR_WRITE ); -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_OOO_Engine/OOO_Engine/Reexecute_unit/include/Reexecute_unit.h
r117 r122 129 129 public : SC_OUT(Ttype_t ) ** out_REEXECUTE_TYPE ;//[nb_inst_reexecute] 130 130 public : SC_OUT(Tlsq_ptr_t ) ** out_REEXECUTE_STORE_QUEUE_PTR_WRITE ;//[nb_inst_reexecute] 131 public : SC_OUT(Tlsq_ptr_t ) ** out_REEXECUTE_STORE_QUEUE_PTR_READ ;//[nb_inst_reexecute] //* 132 public : SC_OUT(Tcontrol_t ) ** out_REEXECUTE_STORE_QUEUE_EMPTY ;//[nb_inst_reexecute] //* 131 133 public : SC_OUT(Tlsq_ptr_t ) ** out_REEXECUTE_LOAD_QUEUE_PTR_WRITE ;//[nb_inst_reexecute] //* 132 134 public : SC_OUT(Tcontrol_t ) ** out_REEXECUTE_HAS_IMMEDIAT ;//[nb_inst_reexecute] -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_OOO_Engine/OOO_Engine/Reexecute_unit/src/Reexecute_unit_allocation.cpp
r117 r122 143 143 ALLOC1_SIGNAL_OUT(out_REEXECUTE_TYPE ,"type" ,Ttype_t ,_param->_size_type ); 144 144 ALLOC1_SIGNAL_OUT(out_REEXECUTE_STORE_QUEUE_PTR_WRITE,"store_queue_ptr_write",Tlsq_ptr_t ,_param->_size_store_queue_ptr ); 145 ALLOC1_SIGNAL_OUT(out_REEXECUTE_STORE_QUEUE_PTR_READ ,"store_queue_ptr_read" ,Tlsq_ptr_t ,_param->_size_store_queue_ptr ); 146 ALLOC1_SIGNAL_OUT(out_REEXECUTE_STORE_QUEUE_EMPTY ,"store_queue_empty" ,Tcontrol_t ,1); 145 147 ALLOC1_SIGNAL_OUT(out_REEXECUTE_LOAD_QUEUE_PTR_WRITE ,"load_queue_ptr_write" ,Tlsq_ptr_t ,_param->_size_load_queue_ptr ); 146 148 ALLOC1_SIGNAL_OUT(out_REEXECUTE_HAS_IMMEDIAT ,"has_immediat" ,Tcontrol_t ,1 ); -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_OOO_Engine/OOO_Engine/Reexecute_unit/src/Reexecute_unit_deallocation.cpp
r117 r122 83 83 DELETE1_SIGNAL(out_REEXECUTE_TYPE , _param->_nb_inst_reexecute,_param->_size_type ); 84 84 DELETE1_SIGNAL(out_REEXECUTE_STORE_QUEUE_PTR_WRITE , _param->_nb_inst_reexecute,_param->_size_store_queue_ptr ); 85 DELETE1_SIGNAL(out_REEXECUTE_STORE_QUEUE_PTR_READ , _param->_nb_inst_reexecute,_param->_size_store_queue_ptr ); 86 DELETE1_SIGNAL(out_REEXECUTE_STORE_QUEUE_EMPTY , _param->_nb_inst_reexecute,1); 85 87 DELETE1_SIGNAL(out_REEXECUTE_LOAD_QUEUE_PTR_WRITE , _param->_nb_inst_reexecute,_param->_size_load_queue_ptr ); 86 88 DELETE1_SIGNAL(out_REEXECUTE_HAS_IMMEDIAT , _param->_nb_inst_reexecute,1 ); -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_OOO_Engine/OOO_Engine/Reexecute_unit/src/Reexecute_unit_genMealy_reexecute.cpp
r118 r122 56 56 PORT_WRITE(out_REEXECUTE_TYPE [i],entry->type ); 57 57 PORT_WRITE(out_REEXECUTE_STORE_QUEUE_PTR_WRITE [i],0); 58 // PORT_WRITE(out_REEXECUTE_STORE_QUEUE_PTR_READ [i], 0); 59 // PORT_WRITE(out_REEXECUTE_STORE_QUEUE_EMPTY [i], 0); 58 60 PORT_WRITE(out_REEXECUTE_HAS_IMMEDIAT [i],1); 59 61 PORT_WRITE(out_REEXECUTE_IMMEDIAT [i],entry->data ); … … 82 84 PORT_WRITE(out_REEXECUTE_TYPE [i], PORT_READ(in_REEXECUTE_ROB_TYPE [i])); 83 85 PORT_WRITE(out_REEXECUTE_STORE_QUEUE_PTR_WRITE [i], PORT_READ(in_REEXECUTE_ROB_STORE_QUEUE_PTR_WRITE [i])); 86 // PORT_WRITE(out_REEXECUTE_STORE_QUEUE_PTR_READ [i], 0); 87 // PORT_WRITE(out_REEXECUTE_STORE_QUEUE_EMPTY [i], 0); 84 88 PORT_WRITE(out_REEXECUTE_HAS_IMMEDIAT [i], 0); 85 89 PORT_WRITE(out_REEXECUTE_IMMEDIAT [i], 0); -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_OOO_Engine/OOO_Engine/Rename_unit/Load_Store_pointer_unit/include/Load_Store_pointer_unit.h
r88 r122 70 70 public : SC_IN (Toperation_t ) ** in_INSERT_OPERATION ; // [nb_inst_insert] 71 71 public : SC_OUT(Tlsq_ptr_t ) ** out_INSERT_STORE_QUEUE_PTR_WRITE; // [nb_inst_insert] 72 public : SC_OUT(Tlsq_ptr_t ) ** out_INSERT_STORE_QUEUE_PTR_READ ; // [nb_inst_insert] 73 public : SC_OUT(Tcontrol_t ) ** out_INSERT_STORE_QUEUE_EMPTY ; // [nb_inst_insert] 72 74 public : SC_OUT(Tlsq_ptr_t ) ** out_INSERT_LOAD_QUEUE_PTR_WRITE ; // [nb_inst_insert] 73 75 … … 84 86 public : SC_IN (Tlsq_ptr_t ) ** in_RETIRE_LOAD_QUEUE_PTR_WRITE ; // [nb_inst_retire] 85 87 88 // ~~~~~[ Interface "retire_event" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 89 public : SC_IN (Tcontrol_t ) *** in_RETIRE_EVENT_VAL ;//[nb_front_end][nb_context] 90 public : SC_OUT(Tcontrol_t ) *** out_RETIRE_EVENT_ACK ;//[nb_front_end][nb_context] 91 public : SC_IN (Tevent_state_t ) *** in_RETIRE_EVENT_STATE ;//[nb_front_end][nb_context] 92 86 93 // ~~~~~[ Component ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 87 94 88 95 // ~~~~~[ Register ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 89 public : Tlsq_ptr_t * reg_STORE_QUEUE_PTR_WRITE; // [nb_load_store_queue] 90 public : bool ** reg_STORE_QUEUE_USE ; // [nb_load_store_queue][size_store_queue] 91 public : Tlsq_ptr_t * reg_STORE_QUEUE_NB_USE ; // [nb_load_store_queue] 92 public : Tlsq_ptr_t * reg_LOAD_QUEUE_PTR_WRITE ; // [nb_load_store_queue] 93 public : bool ** reg_LOAD_QUEUE_USE ; // [nb_load_store_queue][size_load_queue] 96 private : Tlsq_ptr_t * reg_STORE_QUEUE_PTR_WRITE; // [nb_load_store_queue] 97 private : Tlsq_ptr_t ** reg_STORE_QUEUE_PTR_READ ; // [nb_front_end][nb_context] 98 private : bool ** reg_STORE_QUEUE_EMPTY ; // [nb_front_end][nb_context] 99 private : bool ** reg_STORE_QUEUE_USE ; // [nb_load_store_queue][size_store_queue] 100 private : Tlsq_ptr_t * reg_STORE_QUEUE_NB_USE ; // [nb_load_store_queue] 101 private : Tlsq_ptr_t * reg_LOAD_QUEUE_PTR_WRITE ; // [nb_load_store_queue] 102 private : bool ** reg_LOAD_QUEUE_USE ; // [nb_load_store_queue][size_load_queue] 94 103 95 104 // ~~~~~[ Internal ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 96 p ublic: Tcontrol_t * internal_INSERT_ACK ; // [nb_inst_insert]97 p ublic: operation_use_t * internal_INSERT_OPERATION_USE; // [nb_inst_insert]98 p ublic: uint32_t * internal_INSERT_LSQ ; // [nb_inst_insert]99 p ublic: Tlsq_ptr_t * internal_INSERT_PTR ; // [nb_inst_insert]105 private : Tcontrol_t * internal_INSERT_ACK ; // [nb_inst_insert] 106 private : operation_use_t * internal_INSERT_OPERATION_USE; // [nb_inst_insert] 107 private : uint32_t * internal_INSERT_LSQ ; // [nb_inst_insert] 108 private : Tlsq_ptr_t * internal_INSERT_PTR ; // [nb_inst_insert] 100 109 101 public : Tcontrol_t * internal_RETIRE_ACK ; // [nb_inst_retire] 102 public : operation_use_t * internal_RETIRE_OPERATION_USE; // [nb_inst_retire] 103 public : uint32_t * internal_RETIRE_LSQ ; // [nb_inst_retire] 104 public : Tlsq_ptr_t * internal_RETIRE_PTR ; // [nb_inst_retire] 110 private : Tcontrol_t * internal_RETIRE_ACK ; // [nb_inst_retire] 111 private : operation_use_t * internal_RETIRE_OPERATION_USE; // [nb_inst_retire] 112 private : uint32_t * internal_RETIRE_LSQ ; // [nb_inst_retire] 113 private : Tlsq_ptr_t * internal_RETIRE_PTR ; // [nb_inst_retire] 114 private : Tcontrol_t ** internal_RETIRE_EVENT_ACK ;//[nb_front_end][nb_context] 105 115 106 116 #endif -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_OOO_Engine/OOO_Engine/Rename_unit/Load_Store_pointer_unit/src/Load_Store_pointer_unit.cpp
r88 r122 74 74 if (usage_is_set(_usage,USE_SYSTEMC)) 75 75 { 76 77 // Constant : accepted already transaction 78 for (uint32_t i=0; i<_param->_nb_front_end; ++i) 79 for (uint32_t j=0; j<_param->_nb_context[i]; ++j) 80 { 81 internal_RETIRE_EVENT_ACK [i][j] = 1; 82 83 PORT_WRITE(out_RETIRE_EVENT_ACK[i][j],internal_RETIRE_EVENT_ACK [i][j]); 84 } 85 76 86 log_printf(INFO,Load_Store_pointer_unit,FUNCTION,"Method - transition"); 77 87 … … 101 111 102 112 # ifdef SYSTEMCASS_SPECIFIC 103 // List dependency information104 for (uint32_t i=0; i<_param->_nb_inst_insert; i++)105 {106 (*(out_INSERT_ACK [i])) (*( in_INSERT_VAL [i]));107 if (_param->_have_port_front_end_id)108 (*(out_INSERT_ACK [i])) (*( in_INSERT_FRONT_END_ID [i]));109 if (_param->_have_port_context_id)110 (*(out_INSERT_ACK [i])) (*( in_INSERT_CONTEXT_ID [i]));111 (*(out_INSERT_ACK [i])) (*( in_INSERT_TYPE [i]));112 (*(out_INSERT_ACK [i])) (*( in_INSERT_OPERATION [i]));113 // // List dependency information 114 // for (uint32_t i=0; i<_param->_nb_inst_insert; i++) 115 // { 116 // (*(out_INSERT_ACK [i])) (*( in_INSERT_VAL [i])); 117 // if (_param->_have_port_front_end_id) 118 // (*(out_INSERT_ACK [i])) (*( in_INSERT_FRONT_END_ID [i])); 119 // if (_param->_have_port_context_id) 120 // (*(out_INSERT_ACK [i])) (*( in_INSERT_CONTEXT_ID [i])); 121 // (*(out_INSERT_ACK [i])) (*( in_INSERT_TYPE [i])); 122 // (*(out_INSERT_ACK [i])) (*( in_INSERT_OPERATION [i])); 113 123 114 (*(out_INSERT_STORE_QUEUE_PTR_WRITE [i])) (*( in_INSERT_VAL [i]));115 if (_param->_have_port_front_end_id)116 (*(out_INSERT_STORE_QUEUE_PTR_WRITE [i])) (*( in_INSERT_FRONT_END_ID [i]));117 if (_param->_have_port_context_id)118 (*(out_INSERT_STORE_QUEUE_PTR_WRITE [i])) (*( in_INSERT_CONTEXT_ID [i]));119 (*(out_INSERT_STORE_QUEUE_PTR_WRITE [i])) (*( in_INSERT_TYPE [i]));120 (*(out_INSERT_STORE_QUEUE_PTR_WRITE [i])) (*( in_INSERT_OPERATION [i]));124 // (*(out_INSERT_STORE_QUEUE_PTR_WRITE [i])) (*( in_INSERT_VAL [i])); 125 // if (_param->_have_port_front_end_id) 126 // (*(out_INSERT_STORE_QUEUE_PTR_WRITE [i])) (*( in_INSERT_FRONT_END_ID [i])); 127 // if (_param->_have_port_context_id) 128 // (*(out_INSERT_STORE_QUEUE_PTR_WRITE [i])) (*( in_INSERT_CONTEXT_ID [i])); 129 // (*(out_INSERT_STORE_QUEUE_PTR_WRITE [i])) (*( in_INSERT_TYPE [i])); 130 // (*(out_INSERT_STORE_QUEUE_PTR_WRITE [i])) (*( in_INSERT_OPERATION [i])); 121 131 122 if (_param->_have_port_load_queue_ptr)123 {124 (*(out_INSERT_LOAD_QUEUE_PTR_WRITE [i])) (*( in_INSERT_VAL [i]));125 if (_param->_have_port_front_end_id)126 (*(out_INSERT_LOAD_QUEUE_PTR_WRITE [i])) (*( in_INSERT_FRONT_END_ID [i]));127 if (_param->_have_port_context_id)128 (*(out_INSERT_LOAD_QUEUE_PTR_WRITE [i])) (*( in_INSERT_CONTEXT_ID [i]));129 (*(out_INSERT_LOAD_QUEUE_PTR_WRITE [i])) (*( in_INSERT_TYPE [i]));130 (*(out_INSERT_LOAD_QUEUE_PTR_WRITE [i])) (*( in_INSERT_OPERATION [i]));131 }132 }132 // if (_param->_have_port_load_queue_ptr) 133 // { 134 // (*(out_INSERT_LOAD_QUEUE_PTR_WRITE [i])) (*( in_INSERT_VAL [i])); 135 // if (_param->_have_port_front_end_id) 136 // (*(out_INSERT_LOAD_QUEUE_PTR_WRITE [i])) (*( in_INSERT_FRONT_END_ID [i])); 137 // if (_param->_have_port_context_id) 138 // (*(out_INSERT_LOAD_QUEUE_PTR_WRITE [i])) (*( in_INSERT_CONTEXT_ID [i])); 139 // (*(out_INSERT_LOAD_QUEUE_PTR_WRITE [i])) (*( in_INSERT_TYPE [i])); 140 // (*(out_INSERT_LOAD_QUEUE_PTR_WRITE [i])) (*( in_INSERT_OPERATION [i])); 141 // } 142 // } 133 143 # endif 134 144 -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_OOO_Engine/OOO_Engine/Rename_unit/Load_Store_pointer_unit/src/Load_Store_pointer_unit_allocation.cpp
r112 r122 67 67 ALLOC1_SIGNAL_IN ( in_INSERT_OPERATION ,"operation" ,Toperation_t,_param->_size_operation ); 68 68 ALLOC1_SIGNAL_OUT(out_INSERT_STORE_QUEUE_PTR_WRITE,"store_queue_ptr_write",Tlsq_ptr_t ,_param->_size_store_queue_ptr); 69 ALLOC1_SIGNAL_OUT(out_INSERT_STORE_QUEUE_PTR_READ ,"store_queue_ptr_read" ,Tlsq_ptr_t ,_param->_size_store_queue_ptr); 70 ALLOC1_SIGNAL_OUT(out_INSERT_STORE_QUEUE_EMPTY ,"store_queue_empty" ,Tcontrol_t ,1 ); 69 71 ALLOC1_SIGNAL_OUT(out_INSERT_LOAD_QUEUE_PTR_WRITE ,"load_queue_ptr_write" ,Tlsq_ptr_t ,_param->_size_load_queue_ptr ); 70 72 … … 80 82 ALLOC1_SIGNAL_IN ( in_RETIRE_FRONT_END_ID ,"front_end_id" ,Tcontext_t ,_param->_size_front_end_id ); 81 83 ALLOC1_SIGNAL_IN ( in_RETIRE_CONTEXT_ID ,"context_id" ,Tcontext_t ,_param->_size_context_id ); 82 // 83 // 84 // ALLOC1_SIGNAL_IN ( in_RETIRE_TYPE ,"type" ,Ttype_t ,_param->_size_type ); 85 // ALLOC1_SIGNAL_IN ( in_RETIRE_OPERATION ,"operation" ,Toperation_t,_param->_size_operation ); 84 86 ALLOC1_SIGNAL_IN ( in_RETIRE_USE_STORE_QUEUE ,"use_store_queue" ,Tcontrol_t ,1); 85 87 ALLOC1_SIGNAL_IN ( in_RETIRE_USE_LOAD_QUEUE ,"use_load_queue" ,Tcontrol_t ,1); … … 90 92 } 91 93 94 // ~~~~~[ Interface : "retire_event" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 95 { 96 ALLOC2_INTERFACE_BEGIN("retire_event", IN,NORTH, _("Retire event"), _param->_nb_front_end, _param->_nb_context[it1]); 97 98 _ALLOC2_VALACK_IN ( in_RETIRE_EVENT_VAL ,VAL,_param->_nb_front_end, _param->_nb_context[it1]); 99 _ALLOC2_VALACK_OUT(out_RETIRE_EVENT_ACK ,ACK,_param->_nb_front_end, _param->_nb_context[it1]); 100 _ALLOC2_SIGNAL_IN ( in_RETIRE_EVENT_STATE ,"state" ,Tevent_state_t ,_param->_size_event_state, _param->_nb_front_end, _param->_nb_context[it1]); 101 102 ALLOC2_INTERFACE_END(_param->_nb_front_end, _param->_nb_context[it1]); 103 } 104 92 105 if (usage_is_set(_usage,USE_SYSTEMC)) 93 106 { 94 107 ALLOC1(reg_STORE_QUEUE_PTR_WRITE ,Tlsq_ptr_t ,_param->_nb_load_store_queue); 108 ALLOC2(reg_STORE_QUEUE_PTR_READ ,Tlsq_ptr_t ,_param->_nb_front_end, _param->_nb_context[it1]); 109 ALLOC2(reg_STORE_QUEUE_EMPTY ,bool ,_param->_nb_front_end, _param->_nb_context[it1]); 95 110 ALLOC2(reg_STORE_QUEUE_USE ,bool ,_param->_nb_load_store_queue,_param->_size_store_queue [it1]); 96 111 ALLOC1(reg_STORE_QUEUE_NB_USE ,Tlsq_ptr_t ,_param->_nb_load_store_queue); … … 107 122 ALLOC1(internal_RETIRE_LSQ ,uint32_t ,_param->_nb_inst_retire); 108 123 ALLOC1(internal_RETIRE_PTR ,Tlsq_ptr_t ,_param->_nb_inst_retire); 124 125 ALLOC2(internal_RETIRE_EVENT_ACK ,Tcontrol_t ,_param->_nb_front_end,_param->_nb_context[it1]); 109 126 } 127 110 128 // ~~~~~[ Component ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 111 129 -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_OOO_Engine/OOO_Engine/Rename_unit/Load_Store_pointer_unit/src/Load_Store_pointer_unit_deallocation.cpp
r112 r122 36 36 DELETE1_SIGNAL( in_INSERT_OPERATION ,_param->_nb_inst_insert,_param->_size_operation ); 37 37 DELETE1_SIGNAL(out_INSERT_STORE_QUEUE_PTR_WRITE,_param->_nb_inst_insert,_param->_size_store_queue_ptr); 38 DELETE1_SIGNAL(out_INSERT_STORE_QUEUE_PTR_READ ,_param->_nb_inst_insert,_param->_size_store_queue_ptr); 39 DELETE1_SIGNAL(out_INSERT_STORE_QUEUE_EMPTY ,_param->_nb_inst_insert,1); 38 40 DELETE1_SIGNAL(out_INSERT_LOAD_QUEUE_PTR_WRITE ,_param->_nb_inst_insert,_param->_size_load_queue_ptr ); 39 41 … … 49 51 DELETE1_SIGNAL( in_RETIRE_LOAD_QUEUE_PTR_WRITE ,_param->_nb_inst_retire,_param->_size_load_queue_ptr ); 50 52 53 DELETE2_SIGNAL( in_RETIRE_EVENT_VAL ,_param->_nb_front_end, _param->_nb_context[it1],1); 54 DELETE2_SIGNAL(out_RETIRE_EVENT_ACK ,_param->_nb_front_end, _param->_nb_context[it1],1); 55 DELETE2_SIGNAL( in_RETIRE_EVENT_STATE ,_param->_nb_front_end, _param->_nb_context[it1],_param->_size_event_state); 56 51 57 DELETE1(reg_STORE_QUEUE_PTR_WRITE ,_param->_nb_load_store_queue); 58 DELETE2(reg_STORE_QUEUE_PTR_READ ,_param->_nb_front_end, _param->_nb_context[it1]); 59 DELETE2(reg_STORE_QUEUE_EMPTY ,_param->_nb_front_end, _param->_nb_context[it1]); 52 60 DELETE2(reg_STORE_QUEUE_USE ,_param->_nb_load_store_queue,_param->_size_store_queue [it1]); 53 61 DELETE1(reg_STORE_QUEUE_NB_USE ,_param->_nb_load_store_queue); … … 64 72 DELETE1(internal_RETIRE_LSQ ,_param->_nb_inst_retire); 65 73 DELETE1(internal_RETIRE_PTR ,_param->_nb_inst_retire); 74 75 DELETE2(internal_RETIRE_EVENT_ACK ,_param->_nb_front_end,_param->_nb_context[it1]); 66 76 } 67 77 -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_OOO_Engine/OOO_Engine/Rename_unit/Load_Store_pointer_unit/src/Load_Store_pointer_unit_genMealy_insert.cpp
r110 r122 54 54 Tcontrol_t ack = false; 55 55 56 if ( 57 56 if ((PORT_READ(in_INSERT_VAL [i]) == true ) and 57 (PORT_READ(in_INSERT_TYPE [i]) == TYPE_MEMORY)) 58 58 { 59 59 log_printf(TRACE,Load_Store_pointer_unit,FUNCTION," * type is memory"); … … 75 75 uint32_t ptr; 76 76 77 PORT_WRITE(out_INSERT_STORE_QUEUE_PTR_WRITE [i], STORE_QUEUE_PTR_WRITE [lsq]); 77 PORT_WRITE(out_INSERT_STORE_QUEUE_PTR_WRITE [i], STORE_QUEUE_PTR_WRITE [lsq]); 78 // PORT_WRITE(out_INSERT_STORE_QUEUE_PTR_READ [i], ((reg_STORE_QUEUE_PTR_READ [front_end_id][context_id]+1)%_param->_size_load_queue[lsq])); 79 PORT_WRITE(out_INSERT_STORE_QUEUE_PTR_READ [i], reg_STORE_QUEUE_PTR_READ [front_end_id][context_id]); 80 PORT_WRITE(out_INSERT_STORE_QUEUE_EMPTY [i], reg_STORE_QUEUE_EMPTY [front_end_id][context_id]); 78 81 if (_param->_have_port_load_queue_ptr) 79 82 PORT_WRITE(out_INSERT_LOAD_QUEUE_PTR_WRITE [i], LOAD_QUEUE_PTR_WRITE [lsq]); -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_OOO_Engine/OOO_Engine/Rename_unit/Load_Store_pointer_unit/src/Load_Store_pointer_unit_transition.cpp
r110 r122 38 38 reg_LOAD_QUEUE_USE [i][j] = false; 39 39 } 40 for (uint32_t i=0; i<_param->_nb_front_end; ++i) 41 for (uint32_t j=0; j<_param->_nb_context[i]; ++j) 42 { 43 reg_STORE_QUEUE_PTR_READ [i][j] = 0; 44 reg_STORE_QUEUE_EMPTY [i][j] = true; 45 } 40 46 } 41 47 else … … 56 62 log_printf(TRACE,Load_Store_pointer_unit,FUNCTION," * use STORE_QUEUE"); 57 63 64 Tcontext_t front_end_id = (_param->_have_port_front_end_id)?PORT_READ(in_INSERT_FRONT_END_ID [i]):0; 65 Tcontext_t context_id = (_param->_have_port_context_id )?PORT_READ(in_INSERT_CONTEXT_ID [i]):0; 58 66 uint32_t lsq = internal_INSERT_LSQ [i]; 59 67 Tlsq_ptr_t ptr = internal_INSERT_PTR [i]; … … 62 70 log_printf(TRACE,Load_Store_pointer_unit,FUNCTION," * ptr : %d",ptr); 63 71 72 reg_STORE_QUEUE_EMPTY [front_end_id][context_id] = false; // new element 64 73 reg_STORE_QUEUE_PTR_WRITE [lsq] = (ptr+1)%_param->_size_store_queue[lsq]; 65 74 reg_STORE_QUEUE_NB_USE [lsq] ++; … … 109 118 log_printf(TRACE,Load_Store_pointer_unit,FUNCTION," * lsq : %d",lsq); 110 119 log_printf(TRACE,Load_Store_pointer_unit,FUNCTION," * ptr : %d",ptr); 111 120 121 // TODO : if ROB retire ooo context, can retire store ooo. 122 112 123 // reg_STORE_QUEUE_PTR_WRITE [lsq] = ((ptr==0)?_param->_size_store_queue[lsq]:ptr)-1; 113 124 reg_STORE_QUEUE_NB_USE [lsq] --; … … 137 148 } 138 149 } 150 151 for (uint32_t i=0; i<_param->_nb_front_end; ++i) 152 for (uint32_t j=0; j<_param->_nb_context[i]; ++j) 153 { 154 uint32_t lsq = _param->_link_load_store_unit_with_thread[i][j]; 155 156 if (PORT_READ(in_RETIRE_EVENT_STATE [i][j]) == EVENT_STATE_NO_EVENT) 157 { 158 uint32_t ptr_old = reg_STORE_QUEUE_PTR_READ[i][j]; 159 uint32_t ptr_new = (reg_STORE_QUEUE_PTR_READ[i][j]+1)%_param->_size_store_queue[lsq]; 160 161 if ((reg_STORE_QUEUE_USE [lsq][ptr_old] == false) and 162 (reg_STORE_QUEUE_EMPTY [i][j] == false)) 163 { 164 reg_STORE_QUEUE_PTR_READ [i][j] = ptr_new; 165 if (ptr_new == reg_STORE_QUEUE_PTR_WRITE [lsq]) 166 reg_STORE_QUEUE_EMPTY [i][j] = true; 167 } 168 } 169 170 if (PORT_READ(in_RETIRE_EVENT_VAL[i][j]) and internal_RETIRE_EVENT_ACK [i][j]) 171 if (PORT_READ(in_RETIRE_EVENT_STATE [i][j]) == EVENT_STATE_EVENT) 172 { 173 log_printf(TRACE,Load_Store_pointer_unit,FUNCTION," * EVENT [%d][%d]",i,j); 174 175 // reset ptr_read 176 reg_STORE_QUEUE_PTR_READ [i][j] = reg_STORE_QUEUE_PTR_WRITE [lsq]; 177 reg_STORE_QUEUE_EMPTY [i][j] = true; 178 } 179 } 139 180 } 140 181 141 182 // =================================================================== 142 183 // =====[ OTHER ]===================================================== … … 150 191 { 151 192 log_printf(TRACE,Load_Store_pointer_unit,FUNCTION," * Load_Store_unit [%d]",i); 193 log_printf(TRACE,Load_Store_pointer_unit,FUNCTION," * reg_LOAD_QUEUE_PTR_WRITE : %d", reg_LOAD_QUEUE_PTR_WRITE [i]); 194 log_printf(TRACE,Load_Store_pointer_unit,FUNCTION," * reg_LOAD_QUEUE_USE :"); 195 for (uint32_t j=0; j<_param->_size_load_queue [i]; ++j) 196 log_printf(TRACE,Load_Store_pointer_unit,FUNCTION," [%d] %d",j,reg_LOAD_QUEUE_USE [i][j]); 152 197 log_printf(TRACE,Load_Store_pointer_unit,FUNCTION," * reg_STORE_QUEUE_NB_USE : %d", reg_STORE_QUEUE_NB_USE [i]); 153 198 log_printf(TRACE,Load_Store_pointer_unit,FUNCTION," * reg_STORE_QUEUE_PTR_WRITE : %d", reg_STORE_QUEUE_PTR_WRITE[i]); … … 155 200 for (uint32_t j=0; j<_param->_size_store_queue [i]; ++j) 156 201 log_printf(TRACE,Load_Store_pointer_unit,FUNCTION," [%d] %d",j,reg_STORE_QUEUE_USE [i][j]); 157 log_printf(TRACE,Load_Store_pointer_unit,FUNCTION," * reg_LOAD_QUEUE_PTR_WRITE : %d", reg_LOAD_QUEUE_PTR_WRITE [i]);158 log_printf(TRACE,Load_Store_pointer_unit,FUNCTION," * reg_LOAD_QUEUE_USE :");159 for (uint32_t j=0; j<_param->_size_load_queue [i]; ++j)160 log_printf(TRACE,Load_Store_pointer_unit,FUNCTION," [%d] %d",j,reg_LOAD_QUEUE_USE [i][j]);161 202 } 203 for (uint32_t i=0; i<_param->_nb_front_end; ++i) 204 for (uint32_t j=0; j<_param->_nb_context[i]; ++j) 205 { 206 log_printf(TRACE,Load_Store_pointer_unit,FUNCTION," * reg_STORE_QUEUE_PTR_READ [%d][%d] : %d",i,j,reg_STORE_QUEUE_PTR_READ [i][j]); 207 log_printf(TRACE,Load_Store_pointer_unit,FUNCTION," * reg_STORE_QUEUE_EMPTY [%d][%d] : %d",i,j,reg_STORE_QUEUE_EMPTY [i][j]); 208 } 162 209 } 163 210 #endif -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_OOO_Engine/OOO_Engine/Rename_unit/Register_translation_unit/Register_Address_Translation_unit/include/Register_Address_Translation_unit.h
r112 r122 100 100 public : SC_IN (Tgeneral_address_t) ** in_RETIRE_NUM_REG_RD_LOG ;//[nb_inst_retire] 101 101 public : SC_IN (Tspecial_address_t) ** in_RETIRE_NUM_REG_RE_LOG ;//[nb_inst_retire] 102 public : SC_IN (Tgeneral_address_t) ** in_RETIRE_NUM_REG_RD_PHY_ OLD;//[nb_inst_retire]103 public : SC_IN (Tspecial_address_t) ** in_RETIRE_NUM_REG_RE_PHY_ OLD;//[nb_inst_retire]102 public : SC_IN (Tgeneral_address_t) ** in_RETIRE_NUM_REG_RD_PHY_NEW;//[nb_inst_retire] 103 public : SC_IN (Tspecial_address_t) ** in_RETIRE_NUM_REG_RE_PHY_NEW;//[nb_inst_retire] 104 104 public : SC_OUT(Tcontrol_t ) ** out_RETIRE_RESTORE_RD_PHY_OLD;//[nb_inst_retire] 105 105 public : SC_OUT(Tcontrol_t ) ** out_RETIRE_RESTORE_RE_PHY_OLD;//[nb_inst_retire] … … 114 114 115 115 // ~~~~~[ Register ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 116 private : Tgeneral_address_t *** rat_gpr; //[nb_front_end][nb_context][nb_general_register_logic] 116 private : Tgeneral_address_t *** rat_gpr_not_speculative; //[nb_front_end][nb_context][nb_general_register_logic] 117 private : Tgeneral_address_t *** rat_gpr_speculative; //[nb_front_end][nb_context][nb_general_register_logic] 118 private : bool *** rat_gpr_speculative_valid; //[nb_front_end][nb_context][nb_general_register_logic] 117 119 private : bool *** rat_gpr_update_table; //[nb_front_end][nb_context][nb_general_register_logic] 118 private : Tspecial_address_t *** rat_spr; //[nb_front_end][nb_context][nb_special_register_logic] 120 121 private : Tspecial_address_t *** rat_spr_not_speculative; //[nb_front_end][nb_context][nb_special_register_logic] 122 private : Tspecial_address_t *** rat_spr_speculative; //[nb_front_end][nb_context][nb_special_register_logic] 123 private : bool *** rat_spr_speculative_valid; //[nb_front_end][nb_context][nb_special_register_logic] 119 124 private : bool *** rat_spr_update_table; //[nb_front_end][nb_context][nb_special_register_logic] 120 125 … … 123 128 private : Tcontrol_t * internal_INSERT_ACK; //[nb_inst_insert] 124 129 private : Tcontrol_t * internal_RETIRE_ACK; //[nb_inst_retire] 125 public : Tcontrol_t ** internal_RETIRE_EVENT_ACK ;//[nb_front_end][nb_context] 126 127 private : bool *** internal_rat_gpr_update_table; //[nb_front_end][nb_context][nb_general_register_logic] 128 private : bool *** internal_rat_spr_update_table; //[nb_front_end][nb_context][nb_special_register_logic] 129 public : Tcontrol_t * internal_RETIRE_RESTORE_RD_PHY_OLD;//[nb_inst_retire] 130 public : Tcontrol_t * internal_RETIRE_RESTORE_RE_PHY_OLD;//[nb_inst_retire] 130 private : Tcontrol_t ** internal_RETIRE_EVENT_ACK ;//[nb_front_end][nb_context] 131 132 private : bool *** internal_rat_gpr_update_table;//[nb_front_end][nb_context][nb_general_register_logic] 133 private : bool *** internal_rat_spr_update_table;//[nb_front_end][nb_context][nb_special_register_logic] 134 135 private : Tcontrol_t * internal_RETIRE_RESTORE ;//[nb_inst_retire] 136 private : Tcontrol_t * internal_RETIRE_RESTORE_RD_PHY_OLD;//[nb_inst_retire] 137 private : Tcontrol_t * internal_RETIRE_RESTORE_RE_PHY_OLD;//[nb_inst_retire] 131 138 132 139 #endif -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_OOO_Engine/OOO_Engine/Rename_unit/Register_translation_unit/Register_Address_Translation_unit/src/Register_Address_Translation_unit.cpp
r106 r122 129 129 << (*(in_RENAME_NUM_REG_RE_LOG [i])); 130 130 } 131 for (uint32_t i=0; i<_param->_nb_front_end; ++i) 132 for (uint32_t j=0; j<_param->_nb_context[i]; ++j) 133 sensitive << (*(in_RETIRE_EVENT_VAL [i][j])) 134 << (*(in_RETIRE_EVENT_STATE [i][j])); 131 135 132 136 # ifdef SYSTEMCASS_SPECIFIC -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_OOO_Engine/OOO_Engine/Rename_unit/Register_translation_unit/Register_Address_Translation_unit/src/Register_Address_Translation_unit_allocation.cpp
r112 r122 109 109 ALLOC1_SIGNAL_IN ( in_RETIRE_NUM_REG_RD_LOG ,"num_reg_rd_log" ,Tgeneral_address_t,_param->_size_general_register_logic); 110 110 ALLOC1_SIGNAL_IN ( in_RETIRE_NUM_REG_RE_LOG ,"num_reg_re_log" ,Tspecial_address_t,_param->_size_special_register_logic); 111 ALLOC1_SIGNAL_IN ( in_RETIRE_NUM_REG_RD_PHY_ OLD,"num_reg_rd_phy_old",Tgeneral_address_t,_param->_size_general_register);112 ALLOC1_SIGNAL_IN ( in_RETIRE_NUM_REG_RE_PHY_ OLD,"num_reg_re_phy_old",Tspecial_address_t,_param->_size_special_register);111 ALLOC1_SIGNAL_IN ( in_RETIRE_NUM_REG_RD_PHY_NEW,"num_reg_rd_phy_new",Tgeneral_address_t,_param->_size_general_register); 112 ALLOC1_SIGNAL_IN ( in_RETIRE_NUM_REG_RE_PHY_NEW,"num_reg_re_phy_new",Tspecial_address_t,_param->_size_special_register); 113 113 ALLOC1_SIGNAL_OUT(out_RETIRE_RESTORE_RD_PHY_OLD,"restore_rd_phy_old",Tcontrol_t ,1); 114 114 ALLOC1_SIGNAL_OUT(out_RETIRE_RESTORE_RE_PHY_OLD,"restore_re_phy_old",Tcontrol_t ,1); … … 136 136 ALLOC2(internal_RETIRE_EVENT_ACK ,Tcontrol_t,_param->_nb_front_end,_param->_nb_context[it1]); 137 137 138 ALLOC3(rat_gpr ,Tgeneral_address_t,_param->_nb_front_end,_param->_nb_context[it1],_param->_nb_general_register_logic); 139 ALLOC3(rat_spr ,Tspecial_address_t,_param->_nb_front_end,_param->_nb_context[it1],_param->_nb_special_register_logic); 140 ALLOC3(rat_gpr_update_table ,bool ,_param->_nb_front_end,_param->_nb_context[it1],_param->_nb_general_register_logic); 141 ALLOC3(rat_spr_update_table ,bool ,_param->_nb_front_end,_param->_nb_context[it1],_param->_nb_special_register_logic); 142 ALLOC3(internal_rat_gpr_update_table,bool ,_param->_nb_front_end,_param->_nb_context[it1],_param->_nb_general_register_logic); 143 ALLOC3(internal_rat_spr_update_table,bool ,_param->_nb_front_end,_param->_nb_context[it1],_param->_nb_special_register_logic); 138 ALLOC3(rat_gpr_not_speculative ,Tgeneral_address_t,_param->_nb_front_end,_param->_nb_context[it1],_param->_nb_general_register_logic); 139 ALLOC3(rat_gpr_speculative ,Tgeneral_address_t,_param->_nb_front_end,_param->_nb_context[it1],_param->_nb_general_register_logic); 140 ALLOC3(rat_gpr_speculative_valid,bool ,_param->_nb_front_end,_param->_nb_context[it1],_param->_nb_general_register_logic); 141 ALLOC3(rat_gpr_update_table ,bool ,_param->_nb_front_end,_param->_nb_context[it1],_param->_nb_general_register_logic); 142 143 ALLOC3(rat_spr_not_speculative ,Tspecial_address_t,_param->_nb_front_end,_param->_nb_context[it1],_param->_nb_special_register_logic); 144 ALLOC3(rat_spr_speculative ,Tspecial_address_t,_param->_nb_front_end,_param->_nb_context[it1],_param->_nb_special_register_logic); 145 ALLOC3(rat_spr_speculative_valid,bool ,_param->_nb_front_end,_param->_nb_context[it1],_param->_nb_special_register_logic); 146 ALLOC3(rat_spr_update_table ,bool ,_param->_nb_front_end,_param->_nb_context[it1],_param->_nb_special_register_logic); 144 147 148 ALLOC3(internal_rat_gpr_update_table,bool, _param->_nb_front_end,_param->_nb_context[it1],_param->_nb_general_register_logic); 149 ALLOC3(internal_rat_spr_update_table,bool, _param->_nb_front_end,_param->_nb_context[it1],_param->_nb_special_register_logic); 150 151 ALLOC1(internal_RETIRE_RESTORE ,Tcontrol_t,_param->_nb_inst_retire); 145 152 ALLOC1(internal_RETIRE_RESTORE_RD_PHY_OLD,Tcontrol_t,_param->_nb_inst_retire); 146 153 ALLOC1(internal_RETIRE_RESTORE_RE_PHY_OLD,Tcontrol_t,_param->_nb_inst_retire); -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_OOO_Engine/OOO_Engine/Rename_unit/Register_translation_unit/Register_Address_Translation_unit/src/Register_Address_Translation_unit_deallocation.cpp
r112 r122 64 64 DELETE1_SIGNAL( in_RETIRE_NUM_REG_RD_LOG ,_param->_nb_inst_retire,_param->_size_general_register_logic); 65 65 DELETE1_SIGNAL( in_RETIRE_NUM_REG_RE_LOG ,_param->_nb_inst_retire,_param->_size_special_register_logic); 66 DELETE1_SIGNAL( in_RETIRE_NUM_REG_RD_PHY_ OLD,_param->_nb_inst_retire,_param->_size_general_register);67 DELETE1_SIGNAL( in_RETIRE_NUM_REG_RE_PHY_ OLD,_param->_nb_inst_retire,_param->_size_special_register);66 DELETE1_SIGNAL( in_RETIRE_NUM_REG_RD_PHY_NEW,_param->_nb_inst_retire,_param->_size_general_register); 67 DELETE1_SIGNAL( in_RETIRE_NUM_REG_RE_PHY_NEW,_param->_nb_inst_retire,_param->_size_special_register); 68 68 DELETE1_SIGNAL(out_RETIRE_RESTORE_RD_PHY_OLD,_param->_nb_inst_retire,1); 69 69 DELETE1_SIGNAL(out_RETIRE_RESTORE_RE_PHY_OLD,_param->_nb_inst_retire,1); … … 79 79 DELETE2(internal_RETIRE_EVENT_ACK ,_param->_nb_front_end,_param->_nb_context[it1]); 80 80 81 DELETE3(rat_gpr ,_param->_nb_front_end,_param->_nb_context[it1],_param->_nb_general_register_logic); 82 DELETE3(rat_spr ,_param->_nb_front_end,_param->_nb_context[it1],_param->_nb_special_register_logic); 81 DELETE3(rat_gpr_not_speculative ,_param->_nb_front_end,_param->_nb_context[it1],_param->_nb_general_register_logic); 82 DELETE3(rat_gpr_speculative ,_param->_nb_front_end,_param->_nb_context[it1],_param->_nb_general_register_logic); 83 DELETE3(rat_gpr_speculative_valid ,_param->_nb_front_end,_param->_nb_context[it1],_param->_nb_general_register_logic); 83 84 DELETE3(rat_gpr_update_table ,_param->_nb_front_end,_param->_nb_context[it1],_param->_nb_general_register_logic); 85 86 DELETE3(rat_spr_not_speculative ,_param->_nb_front_end,_param->_nb_context[it1],_param->_nb_special_register_logic); 87 DELETE3(rat_spr_speculative ,_param->_nb_front_end,_param->_nb_context[it1],_param->_nb_special_register_logic); 88 DELETE3(rat_spr_speculative_valid ,_param->_nb_front_end,_param->_nb_context[it1],_param->_nb_special_register_logic); 84 89 DELETE3(rat_spr_update_table ,_param->_nb_front_end,_param->_nb_context[it1],_param->_nb_special_register_logic); 90 85 91 DELETE3(internal_rat_gpr_update_table,_param->_nb_front_end,_param->_nb_context[it1],_param->_nb_general_register_logic); 86 92 DELETE3(internal_rat_spr_update_table,_param->_nb_front_end,_param->_nb_context[it1],_param->_nb_special_register_logic); 87 93 94 DELETE1(internal_RETIRE_RESTORE ,_param->_nb_inst_retire); 88 95 DELETE1(internal_RETIRE_RESTORE_RD_PHY_OLD,_param->_nb_inst_retire); 89 96 DELETE1(internal_RETIRE_RESTORE_RE_PHY_OLD,_param->_nb_inst_retire); 90 97 } 91 98 92 // ~~~~~[ Component ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~99 // ~~~~~[ Component ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 93 100 delete _component; 94 101 -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_OOO_Engine/OOO_Engine/Rename_unit/Register_translation_unit/Register_Address_Translation_unit/src/Register_Address_Translation_unit_genMealy_rename.cpp
r100 r122 26 26 log_function(Register_Address_Translation_unit,FUNCTION,_name.c_str()); 27 27 28 if (PORT_READ(in_NRESET) != 0) 28 29 for (uint32_t i=0; i<_param->_nb_inst_insert; i++) 29 30 if (PORT_READ(in_RENAME_VAL [i])) // not in sensitive list : it's to have valide value to array access … … 33 34 Tcontext_t front_end_id = (_param->_have_port_front_end_id)?PORT_READ(in_RENAME_FRONT_END_ID [i]):0; 34 35 Tcontext_t context_id = (_param->_have_port_context_id )?PORT_READ(in_RENAME_CONTEXT_ID [i]):0; 36 bool have_event = (PORT_READ(in_RETIRE_EVENT_VAL [front_end_id][context_id]) and // always ack 37 (PORT_READ(in_RETIRE_EVENT_STATE [front_end_id][context_id]) == EVENT_STATE_EVENT)); 38 35 39 36 40 log_printf(TRACE,Register_Address_Translation_unit,FUNCTION," * front_end_id : %d",front_end_id); 37 41 log_printf(TRACE,Register_Address_Translation_unit,FUNCTION," * context_id : %d",context_id); 42 log_printf(TRACE,Register_Address_Translation_unit,FUNCTION," * have_event : %d",have_event); 38 43 39 44 Tgeneral_address_t num_reg_ra_log = PORT_READ(in_RENAME_NUM_REG_RA_LOG [i]); //%_param->_nb_general_register; … … 43 48 Tspecial_address_t num_reg_re_log = PORT_READ(in_RENAME_NUM_REG_RE_LOG [i]); //%_param->_nb_special_register; 44 49 45 Tgeneral_address_t num_reg_ra_phy = rat_gpr[front_end_id][context_id][num_reg_ra_log]; 46 Tgeneral_address_t num_reg_rb_phy = rat_gpr[front_end_id][context_id][num_reg_rb_log]; 47 Tspecial_address_t num_reg_rc_phy = rat_spr[front_end_id][context_id][num_reg_rc_log]; 48 Tgeneral_address_t num_reg_rd_phy_old= rat_gpr[front_end_id][context_id][num_reg_rd_log]; 49 Tspecial_address_t num_reg_re_phy_old= rat_spr[front_end_id][context_id][num_reg_re_log]; 50 // if rat_speculative is valid, 51 // then read rat_speculative have the most valid alias register 52 // else, they have an previous event, the rat_not_speculative have the valid register 53 54 Tgeneral_address_t num_reg_ra_phy = (rat_gpr_speculative_valid[front_end_id][context_id][num_reg_ra_log] and not have_event)?rat_gpr_speculative[front_end_id][context_id][num_reg_ra_log]:rat_gpr_not_speculative[front_end_id][context_id][num_reg_ra_log]; 55 Tgeneral_address_t num_reg_rb_phy = (rat_gpr_speculative_valid[front_end_id][context_id][num_reg_rb_log] and not have_event)?rat_gpr_speculative[front_end_id][context_id][num_reg_rb_log]:rat_gpr_not_speculative[front_end_id][context_id][num_reg_rb_log]; 56 Tspecial_address_t num_reg_rc_phy = (rat_spr_speculative_valid[front_end_id][context_id][num_reg_rc_log] and not have_event)?rat_spr_speculative[front_end_id][context_id][num_reg_rc_log]:rat_spr_not_speculative[front_end_id][context_id][num_reg_rc_log]; 57 Tgeneral_address_t num_reg_rd_phy_old= (rat_gpr_speculative_valid[front_end_id][context_id][num_reg_rd_log] and not have_event)?rat_gpr_speculative[front_end_id][context_id][num_reg_rd_log]:rat_gpr_not_speculative[front_end_id][context_id][num_reg_rd_log]; 58 Tspecial_address_t num_reg_re_phy_old= (rat_spr_speculative_valid[front_end_id][context_id][num_reg_re_log] and not have_event)?rat_spr_speculative[front_end_id][context_id][num_reg_re_log]:rat_spr_not_speculative[front_end_id][context_id][num_reg_re_log]; 50 59 51 60 log_printf(TRACE,Register_Address_Translation_unit,FUNCTION," * num_reg_ra : %d -> %d",num_reg_ra_log,num_reg_ra_phy ); … … 54 63 log_printf(TRACE,Register_Address_Translation_unit,FUNCTION," * num_reg_rd : %d -> %d",num_reg_rd_log,num_reg_rd_phy_old); 55 64 log_printf(TRACE,Register_Address_Translation_unit,FUNCTION," * num_reg_re : %d -> %d",num_reg_re_log,num_reg_re_phy_old); 56 57 65 58 66 PORT_WRITE(out_RENAME_NUM_REG_RA_PHY [i], num_reg_ra_phy ); -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_OOO_Engine/OOO_Engine/Rename_unit/Register_translation_unit/Register_Address_Translation_unit/src/Register_Address_Translation_unit_genMealy_retire.cpp
r112 r122 26 26 log_function(Register_Address_Translation_unit,FUNCTION,_name.c_str()); 27 27 28 if (PORT_READ(in_NRESET) != 0) 29 { 28 30 // Init internal update table 29 31 for (uint32_t i=0; i<_param->_nb_front_end; i++) 30 32 for (uint32_t j=0; j<_param->_nb_context[i]; j++) 31 33 { 34 log_printf(TRACE,Register_Address_Translation_unit,FUNCTION," * init [%d][%d]",i,j); 35 32 36 // An event occure 33 37 // bool event = (PORT_READ(in_RETIRE_EVENT_STATE [i][j]) != EVENT_STATE_NO_EVENT); … … 35 39 (PORT_READ(in_RETIRE_EVENT_STATE [i][j]) == EVENT_STATE_EVENT)); 36 40 41 log_printf(TRACE,Register_Address_Translation_unit,FUNCTION," * reset_update_table : %d",reset_update_table); 42 37 43 // not event -> update_table == 1 -> always update 38 44 // event -> update_table and not reset 39 45 for (uint32_t k=0; k<_param->_nb_general_register_logic; ++k) 40 46 internal_rat_gpr_update_table [i][j][k] = // not event or 41 ( rat_gpr_update_table [i][j][k] and not reset_update_table);47 (not reset_update_table and rat_gpr_update_table [i][j][k]); 42 48 for (uint32_t k=0; k<_param->_nb_special_register_logic; ++k) 43 49 internal_rat_spr_update_table [i][j][k] = // not event or 44 ( rat_spr_update_table [i][j][k] and not reset_update_table);50 (not reset_update_table and rat_spr_update_table [i][j][k]); 45 51 } 46 47 52 48 53 // RETIRE is in order -> also don't need test if an instruction is valid … … 55 60 Tcontrol_t retire_restore_re_phy_old = false; 56 61 57 Tcontext_t front_end_id = (_param->_have_port_front_end_id)?PORT_READ(in_RETIRE_FRONT_END_ID [i]):0; 58 Tcontext_t context_id = (_param->_have_port_context_id )?PORT_READ(in_RETIRE_CONTEXT_ID [i]):0; 59 Tcontrol_t restore = (PORT_READ(in_RETIRE_EVENT_STATE [front_end_id][context_id]) != EVENT_STATE_NO_EVENT); 62 Tcontext_t front_end_id = (_param->_have_port_front_end_id)?PORT_READ(in_RETIRE_FRONT_END_ID [i]):0; 63 Tcontext_t context_id = (_param->_have_port_context_id )?PORT_READ(in_RETIRE_CONTEXT_ID [i]):0; 64 Tcontrol_t retire_restore = (PORT_READ(in_RETIRE_EVENT_STATE [front_end_id][context_id]) != EVENT_STATE_NO_EVENT); 65 66 log_printf(TRACE,Register_Address_Translation_unit,FUNCTION," * front_end_id : %d",front_end_id); 67 log_printf(TRACE,Register_Address_Translation_unit,FUNCTION," * context_id : %d",context_id ); 68 log_printf(TRACE,Register_Address_Translation_unit,FUNCTION," * restore : %d",retire_restore); 60 69 61 70 // Test if event -> need restore ? 62 if (re store)71 if (retire_restore) 63 72 { 64 log_printf(TRACE,Register_Address_Translation_unit,FUNCTION," * Have event"); 65 log_printf(TRACE,Register_Address_Translation_unit,FUNCTION," * front_end_id : %d",front_end_id); 66 log_printf(TRACE,Register_Address_Translation_unit,FUNCTION," * context_id : %d",context_id ); 73 log_printf(TRACE,Register_Address_Translation_unit,FUNCTION," * Have event"); 67 74 68 75 // Test and update update table … … 87 94 } 88 95 89 log_printf(TRACE,Register_Address_Translation_unit,FUNCTION," * restore_rd_phy_old : %d",retire_restore_rd_phy_old);90 log_printf(TRACE,Register_Address_Translation_unit,FUNCTION," * restore_re_phy_old : %d",retire_restore_re_phy_old);96 log_printf(TRACE,Register_Address_Translation_unit,FUNCTION," * restore_rd_phy_old : %d",retire_restore_rd_phy_old); 97 log_printf(TRACE,Register_Address_Translation_unit,FUNCTION," * restore_re_phy_old : %d",retire_restore_re_phy_old); 91 98 } 92 99 93 internal_RETIRE_RESTORE_RD_PHY_OLD[i] = retire_restore_rd_phy_old; 94 internal_RETIRE_RESTORE_RE_PHY_OLD[i] = retire_restore_re_phy_old; 100 internal_RETIRE_RESTORE [i] = retire_restore; 101 internal_RETIRE_RESTORE_RD_PHY_OLD [i] = retire_restore_rd_phy_old; 102 internal_RETIRE_RESTORE_RE_PHY_OLD [i] = retire_restore_re_phy_old; 95 103 96 PORT_WRITE(out_RETIRE_RESTORE_RD_PHY_OLD[i], internal_RETIRE_RESTORE_RD_PHY_OLD[i]); 97 PORT_WRITE(out_RETIRE_RESTORE_RE_PHY_OLD[i], internal_RETIRE_RESTORE_RE_PHY_OLD[i]); 98 PORT_WRITE(out_RETIRE_RESTORE [i], restore); 104 PORT_WRITE(out_RETIRE_RESTORE [i], internal_RETIRE_RESTORE [i]); 105 PORT_WRITE(out_RETIRE_RESTORE_RD_PHY_OLD[i], internal_RETIRE_RESTORE_RD_PHY_OLD [i]); 106 PORT_WRITE(out_RETIRE_RESTORE_RE_PHY_OLD[i], internal_RETIRE_RESTORE_RE_PHY_OLD [i]); 107 } 99 108 } 100 109 -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_OOO_Engine/OOO_Engine/Rename_unit/Register_translation_unit/Register_Address_Translation_unit/src/Register_Address_Translation_unit_transition.cpp
r112 r122 34 34 for (uint32_t j=0; j<_param->_nb_context[i]; j++) 35 35 { 36 rat_gpr [i][j][0] = 0; 36 rat_gpr_not_speculative [i][j][0] = 0; 37 rat_gpr_speculative_valid [i][j][0] = false; 37 38 38 39 for (uint32_t k=1; k<_param->_nb_general_register_logic; k++) 39 40 { 40 rat_gpr [i][j][k] = gpr++; 41 // rat_gpr_update_table[i][j][k] = 0; 41 rat_gpr_not_speculative [i][j][k] = gpr++; 42 // rat_gpr_speculative [i][j][k] = gpr++; 43 rat_gpr_speculative_valid [i][j][k] = false; 44 // rat_gpr_update_table [i][j][k] = false; 42 45 } 43 46 for (uint32_t k=0; k<_param->_nb_special_register_logic; k++) 44 47 { 45 rat_spr [i][j][k] = spr++; 46 // rat_spr_update_table[i][j][k] = 0; 48 rat_spr_not_speculative [i][j][k] = spr++; 49 // rat_spr_speculative [i][j][k] = spr++; 50 rat_spr_speculative_valid [i][j][k] = false; 51 // rat_spr_update_table [i][j][k] = false; 47 52 } 48 53 } … … 53 58 54 59 // ===================================================== 60 // ====[ RETIRE_EVENT ]================================= 61 // ===================================================== 62 for (uint32_t i=0; i<_param->_nb_front_end; ++i) 63 for (uint32_t j=0; j<_param->_nb_context[i]; ++j) 64 if (PORT_READ(in_RETIRE_EVENT_VAL [i][j]) and internal_RETIRE_EVENT_ACK [i][j]) 65 // Test if event have just occure 66 if (PORT_READ(in_RETIRE_EVENT_STATE [i][j]) == EVENT_STATE_EVENT) 67 { 68 log_printf(TRACE,Register_Address_Translation_unit,FUNCTION," * Reset Update Table"); 69 70 // Reset update_table and validity table 71 for (uint32_t k=0; k<_param->_nb_general_register_logic; k++) 72 { 73 rat_gpr_update_table [i][j][k] = false; 74 rat_gpr_speculative_valid [i][j][k] = false; 75 } 76 for (uint32_t k=0; k<_param->_nb_special_register_logic; k++) 77 { 78 rat_spr_update_table [i][j][k] = false; 79 rat_spr_speculative_valid [i][j][k] = false; 80 } 81 } 82 83 // ===================================================== 55 84 // ====[ INSERT ]======================================= 56 85 // ===================================================== 57 86 // First : interface insert 87 // this instruction is speculative !!! 58 88 for (uint32_t i=0; i<_param->_nb_inst_insert; i++) 59 89 // Test transaction … … 64 94 Tcontext_t front_end_id = (_param->_have_port_front_end_id)?PORT_READ(in_RENAME_FRONT_END_ID [i]):0; 65 95 Tcontext_t context_id = (_param->_have_port_context_id )?PORT_READ(in_RENAME_CONTEXT_ID [i]):0; 66 67 log_printf(TRACE,Register_Address_Translation_unit,FUNCTION," * front_end : %d",front_end_id); 68 log_printf(TRACE,Register_Address_Translation_unit,FUNCTION," * context : %d",context_id); 96 Tcontrol_t write_rd = PORT_READ(in_INSERT_WRITE_RD [i]); 97 Tcontrol_t write_re = PORT_READ(in_INSERT_WRITE_RE [i]); 98 99 log_printf(TRACE,Register_Address_Translation_unit,FUNCTION," * front_end : %d",front_end_id); 100 log_printf(TRACE,Register_Address_Translation_unit,FUNCTION," * context : %d",context_id); 69 101 70 // Test if write 71 log_printf(TRACE,Register_Address_Translation_unit,FUNCTION," * write_rd : %d",PORT_READ(in_INSERT_WRITE_RD [i])); 72 if (PORT_READ(in_INSERT_WRITE_RD [i]) == 1) 73 { 74 log_printf(TRACE,Register_Address_Translation_unit,FUNCTION," * num_reg_rd_phy : %d",PORT_READ(in_INSERT_NUM_REG_RD_PHY [i])); 75 rat_gpr[front_end_id][context_id][PORT_READ(in_INSERT_NUM_REG_RD_LOG [i])] = PORT_READ(in_INSERT_NUM_REG_RD_PHY [i]); 76 } 77 78 log_printf(TRACE,Register_Address_Translation_unit,FUNCTION," * write_re : %d",PORT_READ(in_INSERT_WRITE_RE [i])); 79 if (PORT_READ(in_INSERT_WRITE_RE [i]) == 1) 80 { 81 log_printf(TRACE,Register_Address_Translation_unit,FUNCTION," * num_reg_re_phy : %d",PORT_READ(in_INSERT_NUM_REG_RE_PHY [i])); 82 rat_spr[front_end_id][context_id][PORT_READ(in_INSERT_NUM_REG_RE_LOG [i])] = PORT_READ(in_INSERT_NUM_REG_RE_PHY [i]); 102 // Test if write and modifie RAT 103 log_printf(TRACE,Register_Address_Translation_unit,FUNCTION," * write_rd : %d",write_rd); 104 if (write_rd == 1) 105 { 106 Tgeneral_address_t num_reg_rd_log = PORT_READ(in_INSERT_NUM_REG_RD_LOG [i]); 107 Tgeneral_address_t num_reg_rd_phy = PORT_READ(in_INSERT_NUM_REG_RD_PHY [i]); 108 109 log_printf(TRACE,Register_Address_Translation_unit,FUNCTION," * num_reg_rd_log : %d",num_reg_rd_log); 110 log_printf(TRACE,Register_Address_Translation_unit,FUNCTION," * num_reg_rd_phy : %d",num_reg_rd_phy); 111 112 rat_gpr_speculative [front_end_id][context_id][num_reg_rd_log] = num_reg_rd_phy; 113 rat_gpr_speculative_valid [front_end_id][context_id][num_reg_rd_log] = true; 114 } 115 116 log_printf(TRACE,Register_Address_Translation_unit,FUNCTION," * write_re : %d",write_re); 117 if (write_re == 1) 118 { 119 Tspecial_address_t num_reg_re_log = PORT_READ(in_INSERT_NUM_REG_RE_LOG [i]); 120 Tspecial_address_t num_reg_re_phy = PORT_READ(in_INSERT_NUM_REG_RE_PHY [i]); 121 122 log_printf(TRACE,Register_Address_Translation_unit,FUNCTION," * num_reg_re_log : %d",num_reg_re_log); 123 log_printf(TRACE,Register_Address_Translation_unit,FUNCTION," * num_reg_re_phy : %d",num_reg_re_phy); 124 125 rat_spr_speculative [front_end_id][context_id][num_reg_re_log] = num_reg_re_phy; 126 rat_spr_speculative_valid [front_end_id][context_id][num_reg_re_log] = true; 83 127 } 84 128 } 85 86 // =====================================================87 // ====[ RETIRE_EVENT ]=================================88 // =====================================================89 for (uint32_t i=0; i<_param->_nb_front_end; ++i)90 for (uint32_t j=0; j<_param->_nb_context[i]; ++j)91 if (PORT_READ(in_RETIRE_EVENT_VAL [i][j]) and internal_RETIRE_EVENT_ACK [i][j])92 // Test if event have just occure93 if (PORT_READ(in_RETIRE_EVENT_STATE [i][j]) == EVENT_STATE_EVENT)94 {95 log_printf(TRACE,Register_Address_Translation_unit,FUNCTION," * Reset Update Table");96 97 // Reset update_table98 for (uint32_t k=0; k<_param->_nb_general_register_logic; k++)99 rat_gpr_update_table [i][j][k] = 0;100 for (uint32_t k=0; k<_param->_nb_special_register_logic; k++)101 rat_spr_update_table [i][j][k] = 0;102 }103 129 104 130 // ===================================================== … … 117 143 // the retire interface became of the Re Order Buffer, also is in program sequence ! 118 144 119 Tcontext_t front_end_id = (_param->_have_port_front_end_id)?PORT_READ(in_RETIRE_FRONT_END_ID [i]):0; 120 Tcontext_t context_id = (_param->_have_port_context_id )?PORT_READ(in_RETIRE_CONTEXT_ID [i]):0; 121 Tevent_state_t event_state = PORT_READ(in_RETIRE_EVENT_STATE [front_end_id][context_id]); 122 123 log_printf(TRACE,Register_Address_Translation_unit,FUNCTION," * front_end_id : %d",front_end_id); 124 log_printf(TRACE,Register_Address_Translation_unit,FUNCTION," * context_id : %d",context_id); 125 log_printf(TRACE,Register_Address_Translation_unit,FUNCTION," * event_state : %d",event_state); 126 127 // if (event_state != EVENT_STATE_NO_EVENT) 128 // { 129 // Test if write and have not a previous update 130 if (PORT_READ(in_RETIRE_WRITE_RD [i]) == 1) 131 { 132 Tgeneral_address_t rd_log = PORT_READ(in_RETIRE_NUM_REG_RD_LOG [i]); 145 Tcontext_t front_end_id = (_param->_have_port_front_end_id)?PORT_READ(in_RETIRE_FRONT_END_ID [i]):0; 146 Tcontext_t context_id = (_param->_have_port_context_id )?PORT_READ(in_RETIRE_CONTEXT_ID [i]):0; 147 Tcontrol_t write_rd = PORT_READ(in_RETIRE_WRITE_RD [i]); 148 Tcontrol_t write_re = PORT_READ(in_RETIRE_WRITE_RE [i]); 149 Tcontrol_t restore = internal_RETIRE_RESTORE [i]; 150 151 log_printf(TRACE,Register_Address_Translation_unit,FUNCTION," * front_end_id : %d",front_end_id); 152 log_printf(TRACE,Register_Address_Translation_unit,FUNCTION," * context_id : %d",context_id ); 153 log_printf(TRACE,Register_Address_Translation_unit,FUNCTION," * restore : %d",restore ); 154 155 // Test if write and have not a previous update 156 log_printf(TRACE,Register_Address_Translation_unit,FUNCTION," * write_rd : %d",write_rd); 157 if (PORT_READ(in_RETIRE_WRITE_RD [i]) == 1) 158 { 159 Tgeneral_address_t num_reg_rd_log = PORT_READ(in_RETIRE_NUM_REG_RD_LOG [i]); 160 161 log_printf(TRACE,Register_Address_Translation_unit,FUNCTION," * num_reg_rd_log : %d",num_reg_rd_log ); 162 163 if (not restore) 164 { 165 Tgeneral_address_t num_reg_rd_phy_new = PORT_READ(in_RETIRE_NUM_REG_RD_PHY_NEW [i]); 166 167 log_printf(TRACE,Register_Address_Translation_unit,FUNCTION," * num_reg_rd_phy_new : %d",num_reg_rd_phy_new); 168 169 rat_gpr_not_speculative [front_end_id][context_id][num_reg_rd_log] = num_reg_rd_phy_new; 170 } 171 172 Tcontrol_t restore_rd = internal_RETIRE_RESTORE_RD_PHY_OLD [i]; 173 log_printf(TRACE,Register_Address_Translation_unit,FUNCTION," * restore_rd : %d",restore_rd ); 133 174 134 log_printf(TRACE,Register_Address_Translation_unit,FUNCTION," * retire RD"); 135 log_printf(TRACE,Register_Address_Translation_unit,FUNCTION," * rd_log : %d",rd_log); 136 137 // #ifdef DEBUG_TEST 138 // if (not (internal_RETIRE_RESTORE_RD_PHY_OLD [i] and ( (rat_gpr_update_table [front_end_id][context_id][rd_log] == 0)) and (event_state != EVENT_STATE_NO_EVENT))) 139 // throw ERRORMORPHEO(FUNCTION,toString(_("restore_rd_phy_old [%d] = %d, but rat_gpr_update_table[%d][%d][%d] = %d\n"), 140 // i,internal_RETIRE_RESTORE_RD_PHY_OLD [i], 141 // front_end_id,context_id,rd_log,rat_gpr_update_table [front_end_id][context_id][rd_log])); 142 // #endif 143 144 if (internal_RETIRE_RESTORE_RD_PHY_OLD [i]) 145 // if (rat_gpr_update_table [front_end_id][context_id][rd_log] == 0) 146 { 147 rat_gpr [front_end_id][context_id][rd_log] = PORT_READ(in_RETIRE_NUM_REG_RD_PHY_OLD [i]); 148 rat_gpr_update_table [front_end_id][context_id][rd_log] = 1; 149 } 150 } 151 152 if (PORT_READ(in_RETIRE_WRITE_RE [i]) == 1) 153 { 154 Tspecial_address_t re_log = PORT_READ(in_RETIRE_NUM_REG_RE_LOG [i]); 155 156 log_printf(TRACE,Register_Address_Translation_unit,FUNCTION," * retire RE"); 157 log_printf(TRACE,Register_Address_Translation_unit,FUNCTION," * re_log : %d",re_log); 158 159 // #ifdef DEBUG_TEST 160 // if (not (internal_RETIRE_RESTORE_RE_PHY_OLD [i] and ((rat_spr_update_table [front_end_id][context_id][re_log] == 0) and (event_state != EVENT_STATE_NO_EVENT)))) 161 // throw ERRORMORPHEO(FUNCTION,toString(_("restore_re_phy_old [%d] = %d, but rat_spr_update_table[%d][%d][%d] = %d\n"), 162 // i,internal_RETIRE_RESTORE_RE_PHY_OLD [i], 163 // front_end_id,context_id,re_log,rat_spr_update_table [front_end_id][context_id][re_log])); 164 // #endif 165 166 if (internal_RETIRE_RESTORE_RE_PHY_OLD [i]) 167 // if (rat_spr_update_table [front_end_id][context_id][re_log] == 0) 168 { 169 rat_spr [front_end_id][context_id][re_log] = PORT_READ(in_RETIRE_NUM_REG_RE_PHY_OLD [i]); 170 rat_spr_update_table [front_end_id][context_id][re_log] = 1; 171 } 172 } 173 // } 175 if (restore_rd) 176 rat_gpr_update_table [front_end_id][context_id][num_reg_rd_log] = true; 177 } 178 179 log_printf(TRACE,Register_Address_Translation_unit,FUNCTION," * write_re : %d",write_re); 180 if (PORT_READ(in_RETIRE_WRITE_RE [i]) == 1) 181 { 182 Tspecial_address_t num_reg_re_log = PORT_READ(in_RETIRE_NUM_REG_RE_LOG [i]); 183 184 log_printf(TRACE,Register_Address_Translation_unit,FUNCTION," * num_reg_re_log : %d",num_reg_re_log ); 185 186 if (not restore) 187 { 188 Tspecial_address_t num_reg_re_phy_new = PORT_READ(in_RETIRE_NUM_REG_RE_PHY_NEW [i]); 189 190 log_printf(TRACE,Register_Address_Translation_unit,FUNCTION," * num_reg_re_phy_new : %d",num_reg_re_phy_new); 191 192 rat_spr_not_speculative [front_end_id][context_id][num_reg_re_log] = num_reg_re_phy_new; 193 } 194 195 Tcontrol_t restore_re = internal_RETIRE_RESTORE_RE_PHY_OLD [i]; 196 log_printf(TRACE,Register_Address_Translation_unit,FUNCTION," * restore_re : %d",restore_re ); 197 198 if (restore_re) 199 rat_spr_update_table [front_end_id][context_id][num_reg_re_log] = true; 200 } 201 174 202 } 175 203 } … … 194 222 break; 195 223 else 196 str+=toString("GPR[%.4d] - %. 5d %.1d | ",index,rat_gpr[i][j][index],rat_gpr_update_table[i][j][index]);224 str+=toString("GPR[%.4d] - %.1d %.5d (%.5d) %.1d | ",index,rat_gpr_speculative_valid [i][j][index],rat_gpr_speculative [i][j][index],rat_gpr_not_speculative [i][j][index],rat_gpr_update_table[i][j][index]); 197 225 } 198 226 log_printf(TRACE,Register_Address_Translation_unit,FUNCTION," * %s",str.c_str()); … … 209 237 break; 210 238 else 211 str+=toString("SPR[%.4d] - %. 5d %.1d | ",index,rat_spr[i][j][index],rat_spr_update_table[i][j][index]);239 str+=toString("SPR[%.4d] - %.1d %.5d (%.5d) %.1d | ",index,rat_spr_speculative_valid [i][j][index],rat_spr_speculative [i][j][index],rat_spr_not_speculative [i][j][index],rat_spr_update_table[i][j][index]); 212 240 } 213 241 log_printf(TRACE,Register_Address_Translation_unit,FUNCTION," * %s",str.c_str()); … … 218 246 219 247 #ifdef DEBUG_TEST 220 if (1) 248 # if 1 249 { 250 for (uint32_t i=0; i<_param->_nb_front_end; ++i) 251 for (uint32_t j=0; j<_param->_nb_context[i]; ++j) 221 252 { 222 for (uint32_t i=0; i<_param->_nb_front_end; ++i) 223 for (uint32_t j=0; j<_param->_nb_context[i]; ++j) 224 { 225 for (uint32_t x=0; x<_param->_nb_general_register_logic; ++x) 226 for (uint32_t y=x+1; y<_param->_nb_general_register_logic; ++y) 227 if (rat_gpr[i][j][x] == rat_gpr[i][j][y]) 228 throw ERRORMORPHEO (FUNCTION,toString(_("In RAT, rat_gpr[%d][%d][%d] == rat_gpr[%d][%d][%d] == %d"),i,j,x,i,j,y,rat_gpr[i][j][x])); 229 for (uint32_t x=0; x<_param->_nb_special_register_logic; ++x) 230 for (uint32_t y=x+1; y<_param->_nb_special_register_logic; ++y) 231 if (rat_spr[i][j][x] == rat_spr[i][j][y]) 232 throw ERRORMORPHEO (FUNCTION,toString(_("In RAT, rat_spr[%d][%d][%d] == rat_spr[%d][%d][%d] == %d"),i,j,x,i,j,y,rat_spr[i][j][x])); 233 } 234 253 for (uint32_t x=0; x<_param->_nb_general_register_logic; ++x) 254 for (uint32_t y=x+1; y<_param->_nb_general_register_logic; ++y) 255 { 256 if (rat_gpr_speculative_valid [i][j][x] and 257 rat_gpr_speculative_valid [i][j][y] and 258 (rat_gpr_speculative[i][j][x] == rat_gpr_speculative[i][j][y])) 259 throw ERRORMORPHEO (FUNCTION,toString(_("In RAT, rat_gpr_speculative[%d][%d][%d] == rat_gpr_speculative[%d][%d][%d] == %d"),i,j,x,i,j,y,rat_gpr_speculative[i][j][x])); 260 if (rat_gpr_not_speculative[i][j][x] == rat_gpr_not_speculative[i][j][y]) 261 throw ERRORMORPHEO (FUNCTION,toString(_("In RAT, rat_gpr_not_speculative[%d][%d][%d] == rat_gpr_not_speculative[%d][%d][%d] == %d"),i,j,x,i,j,y,rat_gpr_not_speculative[i][j][x])); 262 263 } 264 for (uint32_t x=0; x<_param->_nb_special_register_logic; ++x) 265 for (uint32_t y=x+1; y<_param->_nb_special_register_logic; ++y) 266 { 267 if(rat_spr_speculative_valid [i][j][x] and 268 rat_spr_speculative_valid [i][j][y] and 269 (rat_spr_speculative[i][j][x] == rat_spr_speculative[i][j][y])) 270 throw ERRORMORPHEO (FUNCTION,toString(_("In RAT, rat_spr_speculative[%d][%d][%d] == rat_spr_speculative[%d][%d][%d] == %d"),i,j,x,i,j,y,rat_spr_speculative[i][j][x])); 271 if (rat_spr_not_speculative[i][j][x] == rat_spr_not_speculative[i][j][y]) 272 throw ERRORMORPHEO (FUNCTION,toString(_("In RAT, rat_spr_not_speculative[%d][%d][%d] == rat_spr_not_speculative[%d][%d][%d] == %d"),i,j,x,i,j,y,rat_spr_not_speculative[i][j][x])); 273 274 } 235 275 } 276 277 } 278 # endif 236 279 #endif 237 280 -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_OOO_Engine/OOO_Engine/Rename_unit/Register_translation_unit/src/Register_translation_unit_allocation.cpp
r121 r122 361 361 PORT_MAP(_component,src , "in_RETIRE_"+toString(i)+"_NUM_REG_RE_LOG" , 362 362 dest, "in_RETIRE_"+toString(i)+"_NUM_REG_RE_LOG" ); 363 PORT_MAP(_component,src , "in_RETIRE_"+toString(i)+"_NUM_REG_RD_PHY_ OLD",364 dest, "in_RETIRE_"+toString(i)+"_NUM_REG_RD_PHY_ OLD");365 PORT_MAP(_component,src , "in_RETIRE_"+toString(i)+"_NUM_REG_RE_PHY_ OLD",366 dest, "in_RETIRE_"+toString(i)+"_NUM_REG_RE_PHY_ OLD");363 PORT_MAP(_component,src , "in_RETIRE_"+toString(i)+"_NUM_REG_RD_PHY_NEW", 364 dest, "in_RETIRE_"+toString(i)+"_NUM_REG_RD_PHY_NEW"); 365 PORT_MAP(_component,src , "in_RETIRE_"+toString(i)+"_NUM_REG_RE_PHY_NEW", 366 dest, "in_RETIRE_"+toString(i)+"_NUM_REG_RE_PHY_NEW"); 367 367 368 368 dest = _name+"_register_translation_unit_glue"; -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_OOO_Engine/OOO_Engine/Rename_unit/Rename_select/include/Rename_select.h
r108 r122 125 125 126 126 // ~~~~~[ Interface "retire_event" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 127 public : SC_IN (Tevent_state_t ) *** in_RETIRE_EVENT_STATE ;//[nb_front_end][nb_context] 127 public : SC_IN (Tcontrol_t ) *** in_RETIRE_EVENT_FLUSH ;//[nb_front_end][nb_context] 128 public : SC_IN (Tcontrol_t ) *** in_RETIRE_EVENT_STOP ;//[nb_front_end][nb_context] 128 129 129 130 // ~~~~~[ Component ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_OOO_Engine/OOO_Engine/Rename_unit/Rename_select/src/Rename_select.cpp
r111 r122 125 125 for (uint32_t i=0; i<_param->_nb_front_end; i++) 126 126 for (uint32_t j=0; j<_param->_nb_context [i]; j++) 127 sensitive << (*(in_RETIRE_EVENT_STATE [i][j])); 127 sensitive << (*(in_RETIRE_EVENT_FLUSH [i][j])) 128 << (*(in_RETIRE_EVENT_STOP [i][j])); 128 129 129 130 for (uint32_t i=0; i<_param->_nb_inst_rename; i++) -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_OOO_Engine/OOO_Engine/Rename_unit/Rename_select/src/Rename_select_allocation.cpp
r112 r122 130 130 ALLOC2_INTERFACE_BEGIN("retire_event", IN,NORTH, _("Retire event"), _param->_nb_front_end, _param->_nb_context[it1]); 131 131 132 _ALLOC2_SIGNAL_IN ( in_RETIRE_EVENT_STATE ,"state" ,Tevent_state_t ,_param->_size_event_state, _param->_nb_front_end, _param->_nb_context[it1]); 132 _ALLOC2_SIGNAL_IN ( in_RETIRE_EVENT_FLUSH ,"flush" ,Tcontrol_t ,1 , _param->_nb_front_end, _param->_nb_context[it1]); 133 _ALLOC2_SIGNAL_IN ( in_RETIRE_EVENT_STOP ,"stop" ,Tcontrol_t ,1 , _param->_nb_front_end, _param->_nb_context[it1]); 133 134 134 135 ALLOC2_INTERFACE_END(_param->_nb_front_end, _param->_nb_context[it1]); -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_OOO_Engine/OOO_Engine/Rename_unit/Rename_select/src/Rename_select_deallocation.cpp
r112 r122 85 85 DELETE1_SIGNAL(out_RENAME_OUT_EXCEPTION ,_param->_nb_inst_rename,_param->_size_exception ); 86 86 87 DELETE2_SIGNAL( in_RETIRE_EVENT_STATE ,_param->_nb_front_end, _param->_nb_context[it1],_param->_size_event_state); 87 DELETE2_SIGNAL( in_RETIRE_EVENT_FLUSH ,_param->_nb_front_end, _param->_nb_context[it1],1); 88 DELETE2_SIGNAL( in_RETIRE_EVENT_STOP ,_param->_nb_front_end, _param->_nb_context[it1],1); 88 89 } 89 90 -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_OOO_Engine/OOO_Engine/Rename_unit/Rename_select/src/Rename_select_genMealy.cpp
r115 r122 17 17 namespace rename_select { 18 18 19 // #define CONTINUE_ON_EVENT_STOP 19 20 20 21 #undef FUNCTION … … 59 60 PORT_READ(in_RENAME_IN_VAL[x][y])) 60 61 { 61 // Find !!!62 val [i] = true;63 ack [x][y] = PORT_READ(in_RENAME_OUT_ACK [i]);64 62 65 63 log_printf(TRACE,Rename_select,FUNCTION," * in_RENAME_OUT_ACK : %d",PORT_READ(in_RENAME_OUT_ACK[i])); 66 64 Tcontext_t front_end_id = (_param->_have_port_front_end_id)?PORT_READ(in_RENAME_IN_FRONT_END_ID [x][y]):0; 67 65 Tcontext_t context_id = (_param->_have_port_context_id )?PORT_READ(in_RENAME_IN_CONTEXT_ID [x][y]):0; 66 Tcontrol_t stop = PORT_READ(in_RETIRE_EVENT_STOP [x][context_id]); 68 67 69 68 log_printf(TRACE,Rename_select,FUNCTION," * front_end_id : %d",front_end_id); 70 69 log_printf(TRACE,Rename_select,FUNCTION," * context_id : %d",context_id); 70 log_printf(TRACE,Rename_select,FUNCTION," * stop : %d",stop); 71 71 72 72 // Test if ROB is Flushed 73 Tevent_state_t event_state = PORT_READ(in_RETIRE_EVENT_STATE [x][context_id]); 74 Tcontrol_t have_event = (event_state != EVENT_STATE_NO_EVENT); 75 Tcontrol_t can_register_access = not have_event; 76 Tcontrol_t no_execute = (PORT_READ(in_RENAME_IN_NO_EXECUTE [x][y]) or have_event); 77 Tcontrol_t read_ra = (PORT_READ(in_RENAME_IN_READ_RA [x][y]) and can_register_access); 78 Tcontrol_t read_rb = (PORT_READ(in_RENAME_IN_READ_RB [x][y]) and can_register_access); 79 Tcontrol_t read_rc = (PORT_READ(in_RENAME_IN_READ_RC [x][y]) and can_register_access); 80 Tcontrol_t write_rd = (PORT_READ(in_RENAME_IN_WRITE_RD [x][y]) and can_register_access); 81 Tcontrol_t write_re = (PORT_READ(in_RENAME_IN_WRITE_RE [x][y]) and can_register_access); 82 // Tcontrol_t read_ra = (PORT_READ(in_RENAME_IN_READ_RA [x][y])); 83 // Tcontrol_t read_rb = (PORT_READ(in_RENAME_IN_READ_RB [x][y])); 84 // Tcontrol_t read_rc = (PORT_READ(in_RENAME_IN_READ_RC [x][y])); 85 // Tcontrol_t write_rd = (PORT_READ(in_RENAME_IN_WRITE_RD [x][y])); 86 // Tcontrol_t write_re = (PORT_READ(in_RENAME_IN_WRITE_RE [x][y])); 87 88 log_printf(TRACE,Rename_select,FUNCTION," * event_state : %d",event_state); 89 log_printf(TRACE,Rename_select,FUNCTION," * no_execute (before) : %d",PORT_READ(in_RENAME_IN_NO_EXECUTE [x][y])); 90 log_printf(TRACE,Rename_select,FUNCTION," * no_execute (after) : %d",no_execute); 91 92 if (_param->_have_port_front_end_id) 93 PORT_WRITE(out_RENAME_OUT_FRONT_END_ID [i],front_end_id); 94 if (_param->_have_port_context_id) 95 PORT_WRITE(out_RENAME_OUT_CONTEXT_ID [i],context_id); 96 if (_param->_have_port_depth) 97 PORT_WRITE(out_RENAME_OUT_DEPTH [i],PORT_READ(in_RENAME_IN_DEPTH [x][y])); 98 PORT_WRITE(out_RENAME_OUT_TYPE [i],PORT_READ(in_RENAME_IN_TYPE [x][y])); 99 PORT_WRITE(out_RENAME_OUT_OPERATION [i],PORT_READ(in_RENAME_IN_OPERATION [x][y])); 100 PORT_WRITE(out_RENAME_OUT_NO_EXECUTE [i],no_execute); 101 PORT_WRITE(out_RENAME_OUT_IS_DELAY_SLOT[i],PORT_READ(in_RENAME_IN_IS_DELAY_SLOT [x][y])); 102 #ifdef DEBUG 103 PORT_WRITE(out_RENAME_OUT_ADDRESS [i],PORT_READ(in_RENAME_IN_ADDRESS [x][y])); 73 #ifndef CONTINUE_ON_EVENT_STOP 74 if (not stop) 104 75 #endif 105 PORT_WRITE(out_RENAME_OUT_ADDRESS_NEXT [i],PORT_READ(in_RENAME_IN_ADDRESS_NEXT [x][y])); 106 PORT_WRITE(out_RENAME_OUT_HAS_IMMEDIAT [i],PORT_READ(in_RENAME_IN_HAS_IMMEDIAT [x][y])); 107 PORT_WRITE(out_RENAME_OUT_IMMEDIAT [i],PORT_READ(in_RENAME_IN_IMMEDIAT [x][y])); 108 PORT_WRITE(out_RENAME_OUT_READ_RA [i],read_ra); 109 PORT_WRITE(out_RENAME_OUT_NUM_REG_RA [i],PORT_READ(in_RENAME_IN_NUM_REG_RA [x][y])); 110 PORT_WRITE(out_RENAME_OUT_READ_RB [i],read_rb); 111 PORT_WRITE(out_RENAME_OUT_NUM_REG_RB [i],PORT_READ(in_RENAME_IN_NUM_REG_RB [x][y])); 112 PORT_WRITE(out_RENAME_OUT_READ_RC [i],read_rc); 113 PORT_WRITE(out_RENAME_OUT_NUM_REG_RC [i],PORT_READ(in_RENAME_IN_NUM_REG_RC [x][y])); 114 PORT_WRITE(out_RENAME_OUT_WRITE_RD [i],write_rd); 115 PORT_WRITE(out_RENAME_OUT_NUM_REG_RD [i],PORT_READ(in_RENAME_IN_NUM_REG_RD [x][y])); 116 PORT_WRITE(out_RENAME_OUT_WRITE_RE [i],write_re); 117 PORT_WRITE(out_RENAME_OUT_NUM_REG_RE [i],PORT_READ(in_RENAME_IN_NUM_REG_RE [x][y])); 118 PORT_WRITE(out_RENAME_OUT_EXCEPTION_USE[i],PORT_READ(in_RENAME_IN_EXCEPTION_USE [x][y])); 119 PORT_WRITE(out_RENAME_OUT_EXCEPTION [i],PORT_READ(in_RENAME_IN_EXCEPTION [x][y])); 76 { 77 // Find !!! 78 val [i] = true; 79 ack [x][y] = PORT_READ(in_RENAME_OUT_ACK [i]); 80 81 Tcontrol_t have_event = (PORT_READ(in_RETIRE_EVENT_FLUSH [x][context_id]) 82 #ifdef CONTINUE_ON_EVENT_STOP 83 or stop 84 #endif 85 ); 86 Tcontrol_t can_register_access = not have_event; 87 Tcontrol_t no_execute = (PORT_READ(in_RENAME_IN_NO_EXECUTE [x][y]) or have_event); 88 Tcontrol_t read_ra = (PORT_READ(in_RENAME_IN_READ_RA [x][y]) and can_register_access); 89 Tcontrol_t read_rb = (PORT_READ(in_RENAME_IN_READ_RB [x][y]) and can_register_access); 90 Tcontrol_t read_rc = (PORT_READ(in_RENAME_IN_READ_RC [x][y]) and can_register_access); 91 Tcontrol_t write_rd = (PORT_READ(in_RENAME_IN_WRITE_RD [x][y]) and can_register_access); 92 Tcontrol_t write_re = (PORT_READ(in_RENAME_IN_WRITE_RE [x][y]) and can_register_access); 93 // Tcontrol_t read_ra = (PORT_READ(in_RENAME_IN_READ_RA [x][y])); 94 // Tcontrol_t read_rb = (PORT_READ(in_RENAME_IN_READ_RB [x][y])); 95 // Tcontrol_t read_rc = (PORT_READ(in_RENAME_IN_READ_RC [x][y])); 96 // Tcontrol_t write_rd = (PORT_READ(in_RENAME_IN_WRITE_RD [x][y])); 97 // Tcontrol_t write_re = (PORT_READ(in_RENAME_IN_WRITE_RE [x][y])); 98 99 log_printf(TRACE,Rename_select,FUNCTION," * have_event : %d",have_event); 100 log_printf(TRACE,Rename_select,FUNCTION," * no_execute (before) : %d",PORT_READ(in_RENAME_IN_NO_EXECUTE [x][y])); 101 log_printf(TRACE,Rename_select,FUNCTION," * no_execute (after) : %d",no_execute); 102 103 if (_param->_have_port_front_end_id) 104 PORT_WRITE(out_RENAME_OUT_FRONT_END_ID [i],front_end_id); 105 if (_param->_have_port_context_id) 106 PORT_WRITE(out_RENAME_OUT_CONTEXT_ID [i],context_id); 107 if (_param->_have_port_depth) 108 PORT_WRITE(out_RENAME_OUT_DEPTH [i],PORT_READ(in_RENAME_IN_DEPTH [x][y])); 109 PORT_WRITE(out_RENAME_OUT_TYPE [i],PORT_READ(in_RENAME_IN_TYPE [x][y])); 110 PORT_WRITE(out_RENAME_OUT_OPERATION [i],PORT_READ(in_RENAME_IN_OPERATION [x][y])); 111 PORT_WRITE(out_RENAME_OUT_NO_EXECUTE [i],no_execute); 112 PORT_WRITE(out_RENAME_OUT_IS_DELAY_SLOT[i],PORT_READ(in_RENAME_IN_IS_DELAY_SLOT [x][y])); 113 #ifdef DEBUG 114 PORT_WRITE(out_RENAME_OUT_ADDRESS [i],PORT_READ(in_RENAME_IN_ADDRESS [x][y])); 115 #endif 116 PORT_WRITE(out_RENAME_OUT_ADDRESS_NEXT [i],PORT_READ(in_RENAME_IN_ADDRESS_NEXT [x][y])); 117 PORT_WRITE(out_RENAME_OUT_HAS_IMMEDIAT [i],PORT_READ(in_RENAME_IN_HAS_IMMEDIAT [x][y])); 118 PORT_WRITE(out_RENAME_OUT_IMMEDIAT [i],PORT_READ(in_RENAME_IN_IMMEDIAT [x][y])); 119 PORT_WRITE(out_RENAME_OUT_READ_RA [i],read_ra); 120 PORT_WRITE(out_RENAME_OUT_NUM_REG_RA [i],PORT_READ(in_RENAME_IN_NUM_REG_RA [x][y])); 121 PORT_WRITE(out_RENAME_OUT_READ_RB [i],read_rb); 122 PORT_WRITE(out_RENAME_OUT_NUM_REG_RB [i],PORT_READ(in_RENAME_IN_NUM_REG_RB [x][y])); 123 PORT_WRITE(out_RENAME_OUT_READ_RC [i],read_rc); 124 PORT_WRITE(out_RENAME_OUT_NUM_REG_RC [i],PORT_READ(in_RENAME_IN_NUM_REG_RC [x][y])); 125 PORT_WRITE(out_RENAME_OUT_WRITE_RD [i],write_rd); 126 PORT_WRITE(out_RENAME_OUT_NUM_REG_RD [i],PORT_READ(in_RENAME_IN_NUM_REG_RD [x][y])); 127 PORT_WRITE(out_RENAME_OUT_WRITE_RE [i],write_re); 128 PORT_WRITE(out_RENAME_OUT_NUM_REG_RE [i],PORT_READ(in_RENAME_IN_NUM_REG_RE [x][y])); 129 PORT_WRITE(out_RENAME_OUT_EXCEPTION_USE[i],PORT_READ(in_RENAME_IN_EXCEPTION_USE [x][y])); 130 PORT_WRITE(out_RENAME_OUT_EXCEPTION [i],PORT_READ(in_RENAME_IN_EXCEPTION [x][y])); 131 } 120 132 } 121 133 -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_OOO_Engine/OOO_Engine/Rename_unit/Rename_unit_Glue/include/Rename_unit_Glue.h
r115 r122 107 107 public : SC_OUT(Tcontrol_t ) ** out_RETIRE_LOAD_STORE_QUEUE_POINTER_VAL ;//[nb_inst_retire] 108 108 public : SC_IN (Tcontrol_t ) ** in_RETIRE_LOAD_STORE_QUEUE_POINTER_ACK ;//[nb_inst_retire] 109 //public : SC_OUT(Ttype_t ) ** out_RETIRE_LOAD_STORE_QUEUE_POINTER_TYPE ;//[nb_inst_retire]110 //public : SC_OUT(Toperation_t ) ** out_RETIRE_LOAD_STORE_QUEUE_POINTER_OPERATION ;//[nb_inst_retire]111 109 112 110 public : SC_OUT(Tcontrol_t ) ** out_RETIRE_REGISTER_TRANSLATION_VAL ;//[nb_inst_retire] 113 111 public : SC_IN (Tcontrol_t ) ** in_RETIRE_REGISTER_TRANSLATION_ACK ;//[nb_inst_retire] 112 113 // ~~~~~[ Interface : "retire_event" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 114 public : SC_IN (Tcontrol_t ) *** in_RETIRE_EVENT_VAL ;//[nb_front_end][nb_context] 115 public : SC_OUT(Tcontrol_t ) *** out_RETIRE_EVENT_ACK ;//[nb_front_end][nb_context] 114 116 117 public : SC_OUT(Tcontrol_t ) *** out_RETIRE_EVENT_LOAD_STORE_QUEUE_POINTER_VAL ;//[nb_front_end][nb_context] 118 public : SC_IN (Tcontrol_t ) *** in_RETIRE_EVENT_LOAD_STORE_QUEUE_POINTER_ACK ;//[nb_front_end][nb_context] 119 120 public : SC_OUT(Tcontrol_t ) *** out_RETIRE_EVENT_REGISTER_TRANSLATION_VAL ;//[nb_front_end][nb_context] 121 public : SC_IN (Tcontrol_t ) *** in_RETIRE_EVENT_REGISTER_TRANSLATION_ACK ;//[nb_front_end][nb_context] 122 115 123 // ~~~~~[ Interface : "spr_read" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 116 124 public : SC_IN (Tspr_t ) *** in_SPR_READ_SR ;//[nb_front_end][nb_context] … … 153 161 154 162 #ifdef SYSTEMC 155 public : void transition (void); 156 //public : void genMoore (void); 157 public : void genMealy_insert_valack (void); 158 public : void genMealy_retire_valack (void); 159 public : void genMealy_insert (void); 163 public : void transition (void); 164 //public : void genMoore (void); 165 public : void genMealy_insert_valack (void); 166 public : void genMealy_retire_valack (void); 167 public : void genMealy_retire_event_valack (void); 168 public : void genMealy_insert (void); 160 169 #endif 161 170 -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_OOO_Engine/OOO_Engine/Rename_unit/Rename_unit_Glue/src/Rename_unit_Glue.cpp
r115 r122 126 126 << (*(in_RETIRE_REGISTER_TRANSLATION_ACK [i])) 127 127 ; 128 129 # ifdef SYSTEMCASS_SPECIFIC 130 // List dependency information 131 # endif 132 133 log_printf(INFO,Rename_unit_Glue,FUNCTION,_("<%s> : Method - genMealy_retire_event_valack"),_name.c_str()); 134 135 SC_METHOD (genMealy_retire_event_valack); 136 dont_initialize (); 137 // sensitive << (*(in_CLOCK)).neg(); // don't need internal register 138 for (uint32_t i=0; i<_param->_nb_front_end; i++) 139 for (uint32_t j=0; j<_param->_nb_context[i]; j++) 140 sensitive 141 << (*(in_RETIRE_EVENT_VAL [i][j])) 142 << (*(in_RETIRE_EVENT_LOAD_STORE_QUEUE_POINTER_ACK [i][j])) 143 << (*(in_RETIRE_EVENT_REGISTER_TRANSLATION_ACK [i][j])) 144 ; 128 145 129 146 # ifdef SYSTEMCASS_SPECIFIC -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_OOO_Engine/OOO_Engine/Rename_unit/Rename_unit_Glue/src/Rename_unit_Glue_allocation.cpp
r115 r122 115 115 } 116 116 117 // ~~~~~[ Interface : "retire_event" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 118 { 119 ALLOC2_INTERFACE_BEGIN("retire_event",OUT,NORTH,_("Retire_Event interface"),_param->_nb_front_end,_param->_nb_context[it1]); 120 121 _ALLOC2_SIGNAL_IN ( in_RETIRE_EVENT_VAL ,"VAL" ,Tcontrol_t ,1,_param->_nb_front_end,_param->_nb_context[it1]); 122 _ALLOC2_SIGNAL_OUT(out_RETIRE_EVENT_ACK ,"ACK" ,Tcontrol_t ,1,_param->_nb_front_end,_param->_nb_context[it1]); 123 _ALLOC2_SIGNAL_OUT(out_RETIRE_EVENT_LOAD_STORE_QUEUE_POINTER_VAL ,"LOAD_STORE_QUEUE_POINTER_VAL" ,Tcontrol_t ,1,_param->_nb_front_end,_param->_nb_context[it1]); 124 _ALLOC2_SIGNAL_IN ( in_RETIRE_EVENT_LOAD_STORE_QUEUE_POINTER_ACK ,"LOAD_STORE_QUEUE_POINTER_ACK" ,Tcontrol_t ,1,_param->_nb_front_end,_param->_nb_context[it1]); 125 _ALLOC2_SIGNAL_OUT(out_RETIRE_EVENT_REGISTER_TRANSLATION_VAL ,"REGISTER_TRANSLATION_VAL" ,Tcontrol_t ,1,_param->_nb_front_end,_param->_nb_context[it1]); 126 _ALLOC2_SIGNAL_IN ( in_RETIRE_EVENT_REGISTER_TRANSLATION_ACK ,"REGISTER_TRANSLATION_ACK" ,Tcontrol_t ,1,_param->_nb_front_end,_param->_nb_context[it1]); 127 128 ALLOC2_INTERFACE_END(_param->_nb_front_end,_param->_nb_context[it1]); 129 } 130 117 131 // ~~~~~[ Interface : "spr_read" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 118 132 { -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_OOO_Engine/OOO_Engine/Rename_unit/Rename_unit_Glue/src/Rename_unit_Glue_deallocation.cpp
r115 r122 72 72 DELETE1_SIGNAL(out_RETIRE_REGISTER_TRANSLATION_VAL ,_param->_nb_inst_retire,1); 73 73 DELETE1_SIGNAL( in_RETIRE_REGISTER_TRANSLATION_ACK ,_param->_nb_inst_retire,1); 74 75 DELETE2_SIGNAL( in_RETIRE_EVENT_VAL ,_param->_nb_front_end,_param->_nb_context[it1],1); 76 DELETE2_SIGNAL(out_RETIRE_EVENT_ACK ,_param->_nb_front_end,_param->_nb_context[it1],1); 77 DELETE2_SIGNAL(out_RETIRE_EVENT_LOAD_STORE_QUEUE_POINTER_VAL ,_param->_nb_front_end,_param->_nb_context[it1],1); 78 DELETE2_SIGNAL( in_RETIRE_EVENT_LOAD_STORE_QUEUE_POINTER_ACK ,_param->_nb_front_end,_param->_nb_context[it1],1); 79 DELETE2_SIGNAL(out_RETIRE_EVENT_REGISTER_TRANSLATION_VAL ,_param->_nb_front_end,_param->_nb_context[it1],1); 80 DELETE2_SIGNAL( in_RETIRE_EVENT_REGISTER_TRANSLATION_ACK ,_param->_nb_front_end,_param->_nb_context[it1],1); 74 81 75 82 DELETE2_SIGNAL( in_SPR_READ_SR ,_param->_nb_front_end,_param->_nb_context[it1],_param->_size_spr); -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_OOO_Engine/OOO_Engine/Rename_unit/include/Rename_unit.h
r121 r122 114 114 public : SC_OUT(Tgeneral_data_t ) ** out_INSERT_IMMEDIAT ;//[nb_inst_insert] 115 115 public : SC_OUT(Tlsq_ptr_t ) ** out_INSERT_STORE_QUEUE_PTR_WRITE;//[nb_inst_insert] 116 public : SC_OUT(Tlsq_ptr_t ) ** out_INSERT_STORE_QUEUE_PTR_READ ;//[nb_inst_insert] 117 public : SC_OUT(Tcontrol_t ) ** out_INSERT_STORE_QUEUE_EMPTY ;//[nb_inst_insert] 116 118 public : SC_OUT(Tlsq_ptr_t ) ** out_INSERT_LOAD_QUEUE_PTR_WRITE ;//[nb_inst_insert] 117 119 public : SC_OUT(Tcontrol_t ) ** out_INSERT_READ_RA ;//[nb_inst_insert] … … 171 173 public : SC_OUT(Tcontrol_t ) *** out_RETIRE_EVENT_ACK ;//[nb_front_end][nb_context] 172 174 public : SC_IN (Tevent_state_t ) *** in_RETIRE_EVENT_STATE ;//[nb_front_end][nb_context] 175 public : SC_IN (Tcontrol_t ) *** in_RETIRE_EVENT_FLUSH ;//[nb_front_end][nb_context] 176 public : SC_IN (Tcontrol_t ) *** in_RETIRE_EVENT_STOP ;//[nb_front_end][nb_context] 173 177 174 178 // ~~~~~[ Interface : "spr_read" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_OOO_Engine/OOO_Engine/Rename_unit/src/Rename_unit_allocation.cpp
r121 r122 111 111 ALLOC1_SIGNAL_OUT(out_INSERT_IMMEDIAT ,"immediat" ,Tgeneral_data_t ,_param->_size_general_data ); 112 112 ALLOC1_SIGNAL_OUT(out_INSERT_STORE_QUEUE_PTR_WRITE,"store_queue_ptr_write",Tlsq_ptr_t ,_param->_size_store_queue_ptr ); 113 ALLOC1_SIGNAL_OUT(out_INSERT_STORE_QUEUE_PTR_READ ,"store_queue_ptr_read" ,Tlsq_ptr_t ,_param->_size_store_queue_ptr ); 114 ALLOC1_SIGNAL_OUT(out_INSERT_STORE_QUEUE_EMPTY ,"store_queue_empty" ,Tcontrol_t ,1 ); 113 115 ALLOC1_SIGNAL_OUT(out_INSERT_LOAD_QUEUE_PTR_WRITE ,"load_queue_ptr_write" ,Tlsq_ptr_t ,_param->_size_load_queue_ptr ); 114 116 ALLOC1_SIGNAL_OUT(out_INSERT_EXCEPTION_USE ,"exception_use" ,Texception_t ,_param->_size_exception_use ); … … 180 182 _ALLOC2_VALACK_OUT(out_RETIRE_EVENT_ACK ,ACK,_param->_nb_front_end, _param->_nb_context[it1]); 181 183 _ALLOC2_SIGNAL_IN ( in_RETIRE_EVENT_STATE ,"state" ,Tevent_state_t ,_param->_size_event_state, _param->_nb_front_end, _param->_nb_context[it1]); 184 _ALLOC2_SIGNAL_IN ( in_RETIRE_EVENT_FLUSH ,"flush" ,Tcontrol_t ,1 , _param->_nb_front_end, _param->_nb_context[it1]); 185 _ALLOC2_SIGNAL_IN ( in_RETIRE_EVENT_STOP ,"stop" ,Tcontrol_t ,1 , _param->_nb_front_end, _param->_nb_context[it1]); 182 186 183 187 ALLOC2_INTERFACE_END(_param->_nb_front_end, _param->_nb_context[it1]); … … 452 456 dest,"retire_event_"+toString(i)+"_"+toString(j)); 453 457 #endif 454 PORT_MAP(_component,src , "in_RETIRE_EVENT_"+toString(i)+"_"+toString(j)+"_STATE", 455 dest, "in_RETIRE_EVENT_"+toString(i)+"_"+toString(j)+"_STATE"); 458 PORT_MAP(_component,src , "in_RETIRE_EVENT_"+toString(i)+"_"+toString(j)+"_FLUSH", 459 dest, "in_RETIRE_EVENT_"+toString(i)+"_"+toString(j)+"_FLUSH"); 460 PORT_MAP(_component,src , "in_RETIRE_EVENT_"+toString(i)+"_"+toString(j)+"_STOP", 461 dest, "in_RETIRE_EVENT_"+toString(i)+"_"+toString(j)+"_STOP"); 456 462 } 457 463 } … … 637 643 for (uint32_t j=0; j<_param->_nb_context[i]; j++) 638 644 { 639 dest = _name ;645 dest = _name+"_glue"; 640 646 641 647 #ifdef POSITION … … 643 649 dest,"retire_event_"+toString(i)+"_"+toString(j)); 644 650 #endif 645 PORT_MAP(_component,src , "in_RETIRE_EVENT_"+toString(i)+"_"+toString(j)+"_VAL" , 646 dest, "in_RETIRE_EVENT_"+toString(i)+"_"+toString(j)+"_VAL" ); 647 PORT_MAP(_component,src ,"out_RETIRE_EVENT_"+toString(i)+"_"+toString(j)+"_ACK" , 648 dest,"out_RETIRE_EVENT_"+toString(i)+"_"+toString(j)+"_ACK" ); 651 COMPONENT_MAP(_component,src , "in_RETIRE_EVENT_"+toString(i)+"_"+toString(j)+ "_VAL" , 652 dest,"out_RETIRE_EVENT_"+toString(i)+"_"+toString(j)+"_REGISTER_TRANSLATION_VAL" ); 653 COMPONENT_MAP(_component,src ,"out_RETIRE_EVENT_"+toString(i)+"_"+toString(j)+ "_ACK" , 654 dest, "in_RETIRE_EVENT_"+toString(i)+"_"+toString(j)+"_REGISTER_TRANSLATION_ACK" ); 655 656 dest = _name; 657 658 #ifdef POSITION 659 _component->interface_map (src ,"retire_event_"+toString(i)+"_"+toString(j), 660 dest,"retire_event_"+toString(i)+"_"+toString(j)); 661 #endif 649 662 PORT_MAP(_component,src , "in_RETIRE_EVENT_"+toString(i)+"_"+toString(j)+"_STATE", 650 663 dest, "in_RETIRE_EVENT_"+toString(i)+"_"+toString(j)+"_STATE"); … … 680 693 PORT_MAP(_component,src ,"out_INSERT_"+toString(i)+"_STORE_QUEUE_PTR_WRITE", 681 694 dest,"out_INSERT_"+toString(i)+"_STORE_QUEUE_PTR_WRITE"); 695 PORT_MAP(_component,src ,"out_INSERT_"+toString(i)+"_STORE_QUEUE_PTR_READ" , 696 dest,"out_INSERT_"+toString(i)+"_STORE_QUEUE_PTR_READ" ); 697 PORT_MAP(_component,src ,"out_INSERT_"+toString(i)+"_STORE_QUEUE_EMPTY" , 698 dest,"out_INSERT_"+toString(i)+"_STORE_QUEUE_EMPTY" ); 682 699 if (_param->_have_port_load_queue_ptr) 683 700 PORT_MAP(_component,src ,"out_INSERT_"+toString(i)+"_LOAD_QUEUE_PTR_WRITE" , … … 746 763 //// in_RETIRE_OPERATION - glue 747 764 } 765 766 for (uint32_t i=0; i<_param->_nb_front_end; i++) 767 for (uint32_t j=0; j<_param->_nb_context[i]; j++) 768 { 769 dest = _name+"_glue"; 770 771 #ifdef POSITION 772 _component->interface_map (src ,"retire_event_"+toString(i)+"_"+toString(j), 773 dest,"retire_event_"+toString(i)+"_"+toString(j)); 774 #endif 775 COMPONENT_MAP(_component,src , "in_RETIRE_EVENT_"+toString(i)+"_"+toString(j)+ "_VAL" , 776 dest,"out_RETIRE_EVENT_"+toString(i)+"_"+toString(j)+"_LOAD_STORE_QUEUE_POINTER_VAL" ); 777 COMPONENT_MAP(_component,src ,"out_RETIRE_EVENT_"+toString(i)+"_"+toString(j)+ "_ACK" , 778 dest, "in_RETIRE_EVENT_"+toString(i)+"_"+toString(j)+"_LOAD_STORE_QUEUE_POINTER_ACK" ); 779 780 dest = _name; 781 782 #ifdef POSITION 783 _component->interface_map (src ,"retire_event_"+toString(i)+"_"+toString(j), 784 dest,"retire_event_"+toString(i)+"_"+toString(j)); 785 #endif 786 PORT_MAP(_component,src , "in_RETIRE_EVENT_"+toString(i)+"_"+toString(j)+"_STATE", 787 dest, "in_RETIRE_EVENT_"+toString(i)+"_"+toString(j)+"_STATE"); 788 } 748 789 } 749 790 … … 844 885 845 886 for (uint32_t i=0; i<_param->_nb_front_end; i++) 887 for (uint32_t j=0; j<_param->_nb_context[i]; j++) 888 { 889 dest = _name; 890 891 #ifdef POSITION 892 _component->interface_map (src ,"retire_event_"+toString(i)+"_"+toString(j), 893 dest,"retire_event_"+toString(i)+"_"+toString(j)); 894 #endif 895 896 PORT_MAP(_component,src , "in_RETIRE_EVENT_"+toString(i)+"_"+toString(j)+"_VAL", 897 dest, "in_RETIRE_EVENT_"+toString(i)+"_"+toString(j)+"_VAL"); 898 PORT_MAP(_component,src ,"out_RETIRE_EVENT_"+toString(i)+"_"+toString(j)+"_ACK", 899 dest,"out_RETIRE_EVENT_"+toString(i)+"_"+toString(j)+"_ACK"); 900 901 // out_RETIRE_EVENT_LOAD_STORE_QUEUE_POINTER_VAL - load_store_pointer_unit 902 // in_RETIRE_EVENT_LOAD_STORE_QUEUE_POINTER_ACK - load_store_pointer_unit 903 // out_RETIRE_EVENT_REGISTER_TRANSLATION_VAL - register_translation_unit 904 // in_RETIRE_EVENT_REGISTER_TRANSLATION_ACK - register_translation_unit 905 } 906 907 908 for (uint32_t i=0; i<_param->_nb_front_end; i++) 846 909 for (uint32_t j=0; j<_param->_nb_context[i]; j++) 847 910 { -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_OOO_Engine/OOO_Engine/Rename_unit/src/Rename_unit_deallocation.cpp
r121 r122 72 72 DELETE1_SIGNAL(out_INSERT_IMMEDIAT ,_param->_nb_inst_insert,_param->_size_general_data ); 73 73 DELETE1_SIGNAL(out_INSERT_STORE_QUEUE_PTR_WRITE,_param->_nb_inst_insert,_param->_size_store_queue_ptr ); 74 DELETE1_SIGNAL(out_INSERT_STORE_QUEUE_PTR_READ ,_param->_nb_inst_insert,_param->_size_store_queue_ptr ); 75 DELETE1_SIGNAL(out_INSERT_STORE_QUEUE_EMPTY ,_param->_nb_inst_insert,1 ); 74 76 DELETE1_SIGNAL(out_INSERT_LOAD_QUEUE_PTR_WRITE ,_param->_nb_inst_insert,_param->_size_load_queue_ptr ); 75 77 DELETE1_SIGNAL(out_INSERT_EXCEPTION_USE ,_param->_nb_inst_insert,_param->_size_exception_use ); … … 127 129 DELETE2_SIGNAL(out_RETIRE_EVENT_ACK ,_param->_nb_front_end, _param->_nb_context[it1],1); 128 130 DELETE2_SIGNAL( in_RETIRE_EVENT_STATE ,_param->_nb_front_end, _param->_nb_context[it1],_param->_size_event_state); 131 DELETE2_SIGNAL( in_RETIRE_EVENT_FLUSH ,_param->_nb_front_end, _param->_nb_context[it1],1); 132 DELETE2_SIGNAL( in_RETIRE_EVENT_STOP ,_param->_nb_front_end, _param->_nb_context[it1],1); 129 133 130 134 DELETE2_SIGNAL(in_SPR_READ_SR ,_param->_nb_front_end, _param->_nb_context[it1],_param->_size_spr); -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_OOO_Engine/OOO_Engine/include/OOO_Engine.h
r108 r122 105 105 public : SC_OUT(Toperation_t ) ** out_ISSUE_OPERATION ;//[nb_inst_issue] 106 106 public : SC_OUT(Tlsq_ptr_t ) ** out_ISSUE_STORE_QUEUE_PTR_WRITE ;//[nb_inst_issue] 107 public : SC_OUT(Tlsq_ptr_t ) ** out_ISSUE_STORE_QUEUE_PTR_READ ;//[nb_inst_issue] 108 public : SC_OUT(Tcontrol_t ) ** out_ISSUE_STORE_QUEUE_EMPTY ;//[nb_inst_issue] 107 109 public : SC_OUT(Tlsq_ptr_t ) ** out_ISSUE_LOAD_QUEUE_PTR_WRITE ;//[nb_inst_issue] 108 110 public : SC_OUT(Tcontrol_t ) ** out_ISSUE_HAS_IMMEDIAT ;//[nb_inst_issue] -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_OOO_Engine/OOO_Engine/src/OOO_Engine_allocation.cpp
r121 r122 100 100 ALLOC1_SIGNAL_OUT (out_ISSUE_OPERATION ,"OPERATION" ,Toperation_t ,_param->_size_operation ); 101 101 ALLOC1_SIGNAL_OUT (out_ISSUE_STORE_QUEUE_PTR_WRITE ,"STORE_QUEUE_PTR_WRITE" ,Tlsq_ptr_t ,_param->_size_store_queue_ptr ); 102 ALLOC1_SIGNAL_OUT (out_ISSUE_STORE_QUEUE_PTR_READ ,"STORE_QUEUE_PTR_READ" ,Tlsq_ptr_t ,_param->_size_store_queue_ptr ); 103 ALLOC1_SIGNAL_OUT (out_ISSUE_STORE_QUEUE_EMPTY ,"STORE_QUEUE_EMPTY" ,Tcontrol_t ,1 ); 102 104 ALLOC1_SIGNAL_OUT (out_ISSUE_LOAD_QUEUE_PTR_WRITE ,"LOAD_QUEUE_PTR_WRITE" ,Tlsq_ptr_t ,_param->_size_load_queue_ptr ); 103 105 ALLOC1_SIGNAL_OUT (out_ISSUE_HAS_IMMEDIAT ,"HAS_IMMEDIAT" ,Tcontrol_t ,1 ); … … 561 563 COMPONENT_MAP(_component,src ,"out_INSERT_"+toString(j)+ "_STORE_QUEUE_PTR_WRITE", 562 564 dest, "in_INSERT_"+toString(i)+"_"+toString(j)+"_RENAME_UNIT_STORE_QUEUE_PTR_WRITE"); 565 COMPONENT_MAP(_component,src ,"out_INSERT_"+toString(j)+ "_STORE_QUEUE_PTR_READ" , 566 dest, "in_INSERT_"+toString(i)+"_"+toString(j)+"_RENAME_UNIT_STORE_QUEUE_PTR_READ" ); 567 COMPONENT_MAP(_component,src ,"out_INSERT_"+toString(j)+ "_STORE_QUEUE_EMPTY" , 568 dest, "in_INSERT_"+toString(i)+"_"+toString(j)+"_RENAME_UNIT_STORE_QUEUE_EMPTY" ); 563 569 if (_param->_have_port_load_queue_ptr) 564 570 COMPONENT_MAP(_component,src ,"out_INSERT_"+toString(j)+ "_LOAD_QUEUE_PTR_WRITE" , … … 655 661 } 656 662 657 // ~~~~~[ Interface : " spr_read" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~663 // ~~~~~[ Interface : "retire_event" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 658 664 { 659 665 std::vector<uint32_t>::iterator it = _param->_link_front_end_with_rename_unit[i].begin(); … … 676 682 COMPONENT_MAP(_component,src , "in_RETIRE_EVENT_"+toString(x)+"_"+toString(k)+"_STATE", 677 683 dest,"out_RETIRE_EVENT_"+toString(j)+"_"+toString(k)+"_STATE"); 684 COMPONENT_MAP(_component,src , "in_RETIRE_EVENT_"+toString(x)+"_"+toString(k)+"_FLUSH", 685 dest,"out_RETIRE_EVENT_"+toString(j)+"_"+toString(k)+"_FLUSH"); 686 COMPONENT_MAP(_component,src , "in_RETIRE_EVENT_"+toString(x)+"_"+toString(k)+"_STOP", 687 dest,"out_RETIRE_EVENT_"+toString(j)+"_"+toString(k)+"_STOP"); 678 688 } 679 689 x++; … … 850 860 // out_RETIRE_NUM_REG_RE_PHY_OLD - component_rename_unit 851 861 // out_RETIRE_NUM_REG_RE_PHY_NEW - component_rename_unit 852 // out_RETIRE_EVENT_STATE - component_rename_unit853 862 854 863 // out_RETIRE_CONTEXT_ID - component_rename_unit … … 872 881 // in_RETIRE_ACK - rename_unit. in_RETIRE_ACK 873 882 // out_RETIRE_EVENT_STATE - rename_unit.out_RETIRE_EVENT_STATE 883 // out_RETIRE_EVENT_FLUSH - rename_unit.out_RETIRE_EVENT_FLUSH 884 // out_RETIRE_EVENT_STOP - rename_unit.out_RETIRE_EVENT_STOP 874 885 875 886 … … 1150 1161 COMPONENT_MAP(_component,src , "in_ISSUE_IN_"+toString(i)+"_"+toString(j)+ "_STORE_QUEUE_PTR_WRITE", 1151 1162 dest,"out_INSERT_" +toString(i)+"_"+toString(j)+"_ISSUE_QUEUE_STORE_QUEUE_PTR_WRITE"); 1163 COMPONENT_MAP(_component,src , "in_ISSUE_IN_"+toString(i)+"_"+toString(j)+ "_STORE_QUEUE_PTR_READ" , 1164 dest,"out_INSERT_" +toString(i)+"_"+toString(j)+"_ISSUE_QUEUE_STORE_QUEUE_PTR_READ" ); 1165 COMPONENT_MAP(_component,src , "in_ISSUE_IN_"+toString(i)+"_"+toString(j)+ "_STORE_QUEUE_EMPTY" , 1166 dest,"out_INSERT_" +toString(i)+"_"+toString(j)+"_ISSUE_QUEUE_STORE_QUEUE_EMPTY" ); 1152 1167 if (_param->_have_port_load_queue_ptr) 1153 1168 COMPONENT_MAP(_component,src , "in_ISSUE_IN_"+toString(i)+"_"+toString(j)+ "_LOAD_QUEUE_PTR_WRITE" , … … 1212 1227 COMPONENT_MAP(_component,src , "in_REEXECUTE_"+toString(i)+"_STORE_QUEUE_PTR_WRITE", 1213 1228 dest,"out_REEXECUTE_"+toString(i)+"_STORE_QUEUE_PTR_WRITE"); 1229 COMPONENT_MAP(_component,src , "in_REEXECUTE_"+toString(i)+"_STORE_QUEUE_PTR_READ" , 1230 dest,"out_REEXECUTE_"+toString(i)+"_STORE_QUEUE_PTR_READ" ); 1231 COMPONENT_MAP(_component,src , "in_REEXECUTE_"+toString(i)+"_STORE_QUEUE_EMPTY" , 1232 dest,"out_REEXECUTE_"+toString(i)+"_STORE_QUEUE_EMPTY" ); 1214 1233 if (_param->_have_port_load_queue_ptr) 1215 1234 COMPONENT_MAP(_component,src , "in_REEXECUTE_"+toString(i)+"_LOAD_QUEUE_PTR_WRITE" , … … 1270 1289 PORT_MAP(_component,src ,"out_ISSUE_OUT_"+toString(i)+"_STORE_QUEUE_PTR_WRITE", 1271 1290 dest,"out_ISSUE_" +toString(i)+"_STORE_QUEUE_PTR_WRITE"); 1291 PORT_MAP(_component,src ,"out_ISSUE_OUT_"+toString(i)+"_STORE_QUEUE_PTR_READ" , 1292 dest,"out_ISSUE_" +toString(i)+"_STORE_QUEUE_PTR_READ" ); 1293 PORT_MAP(_component,src ,"out_ISSUE_OUT_"+toString(i)+"_STORE_QUEUE_EMPTY" , 1294 dest,"out_ISSUE_" +toString(i)+"_STORE_QUEUE_EMPTY" ); 1272 1295 if (_param->_have_port_load_queue_ptr) 1273 1296 PORT_MAP(_component,src ,"out_ISSUE_OUT_"+toString(i)+"_LOAD_QUEUE_PTR_WRITE" , -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_OOO_Engine/OOO_Engine/src/OOO_Engine_deallocation.cpp
r112 r122 63 63 DELETE1_SIGNAL(out_ISSUE_OPERATION ,_param->_nb_inst_issue,_param->_size_operation ); 64 64 DELETE1_SIGNAL(out_ISSUE_STORE_QUEUE_PTR_WRITE ,_param->_nb_inst_issue,_param->_size_store_queue_ptr ); 65 DELETE1_SIGNAL(out_ISSUE_STORE_QUEUE_PTR_READ ,_param->_nb_inst_issue,_param->_size_store_queue_ptr ); 66 DELETE1_SIGNAL(out_ISSUE_STORE_QUEUE_EMPTY ,_param->_nb_inst_issue,1 ); 65 67 DELETE1_SIGNAL(out_ISSUE_LOAD_QUEUE_PTR_WRITE ,_param->_nb_inst_issue,_param->_size_load_queue_ptr ); 66 68 DELETE1_SIGNAL(out_ISSUE_HAS_IMMEDIAT ,_param->_nb_inst_issue,1 ); -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/src/Core_allocation.cpp
r117 r122 728 728 COMPONENT_MAP(_component,src ,"out_ISSUE_" +toString(j)+"_STORE_QUEUE_PTR_WRITE", 729 729 dest, "in_ISSUE_OOO_ENGINE_"+toString(i)+"_"+toString(j)+"_STORE_QUEUE_PTR_WRITE"); 730 COMPONENT_MAP(_component,src ,"out_ISSUE_" +toString(j)+"_STORE_QUEUE_PTR_READ" , 731 dest, "in_ISSUE_OOO_ENGINE_"+toString(i)+"_"+toString(j)+"_STORE_QUEUE_PTR_READ" ); 732 COMPONENT_MAP(_component,src ,"out_ISSUE_" +toString(j)+"_STORE_QUEUE_EMPTY" , 733 dest, "in_ISSUE_OOO_ENGINE_"+toString(i)+"_"+toString(j)+"_STORE_QUEUE_EMPTY" ); 730 734 if (_param->_have_port_load_queue_ptr) 731 735 COMPONENT_MAP(_component,src ,"out_ISSUE_" +toString(j)+"_LOAD_QUEUE_PTR_WRITE" , … … 872 876 COMPONENT_MAP(_component,src , "in_EXECUTE_LOOP_IN_" +toString(j)+"_STORE_QUEUE_PTR_WRITE", 873 877 dest,"out_ISSUE_EXECUTE_LOOP_"+toString(i)+"_"+toString(j)+"_STORE_QUEUE_PTR_WRITE"); 878 COMPONENT_MAP(_component,src , "in_EXECUTE_LOOP_IN_" +toString(j)+"_STORE_QUEUE_PTR_READ" , 879 dest,"out_ISSUE_EXECUTE_LOOP_"+toString(i)+"_"+toString(j)+"_STORE_QUEUE_PTR_READ" ); 880 COMPONENT_MAP(_component,src , "in_EXECUTE_LOOP_IN_" +toString(j)+"_STORE_QUEUE_EMPTY" , 881 dest,"out_ISSUE_EXECUTE_LOOP_"+toString(i)+"_"+toString(j)+"_STORE_QUEUE_EMPTY" ); 874 882 if (_param->_have_port_load_queue_ptr) 875 883 COMPONENT_MAP(_component,src , "in_EXECUTE_LOOP_IN_" +toString(j)+"_LOAD_QUEUE_PTR_WRITE" , … … 1324 1332 // in_ISSUE_OOO_ENGINE_OPERATION - ooo_engine.out_ISSUE_OPERATION 1325 1333 // in_ISSUE_OOO_ENGINE_STORE_QUEUE_PTR_WRITE - ooo_engine.out_ISSUE_STORE_QUEUE_PTR_WRITE 1334 // in_ISSUE_OOO_ENGINE_STORE_QUEUE_PTR_READ - ooo_engine.out_ISSUE_STORE_QUEUE_PTR_READ 1335 // in_ISSUE_OOO_ENGINE_STORE_QUEUE_EMPTY - ooo_engine.out_ISSUE_STORE_QUEUE_EMPTY 1326 1336 // in_ISSUE_OOO_ENGINE_LOAD_QUEUE_PTR_WRITE - ooo_engine.out_ISSUE_LOAD_QUEUE_PTR_WRITE 1327 1337 // in_ISSUE_OOO_ENGINE_HAS_IMMEDIAT - ooo_engine.out_ISSUE_HAS_IMMEDIAT … … 1347 1357 // out_ISSUE_EXECUTE_LOOP_TYPE - execute_loop. in_EXECUTE_LOOP_IN_TYPE 1348 1358 // out_ISSUE_EXECUTE_LOOP_STORE_QUEUE_PTR_WRITE - execute_loop. in_EXECUTE_LOOP_IN_STORE_QUEUE_PTR_WRITE 1359 // out_ISSUE_EXECUTE_LOOP_STORE_QUEUE_PTR_READ - execute_loop. in_EXECUTE_LOOP_IN_STORE_QUEUE_PTR_READ 1360 // out_ISSUE_EXECUTE_LOOP_STORE_QUEUE_EMPTY - execute_loop. in_EXECUTE_LOOP_IN_STORE_QUEUE_EMPTY 1349 1361 // out_ISSUE_EXECUTE_LOOP_LOAD_QUEUE_PTR_WRITE - execute_loop. in_EXECUTE_LOOP_IN_LOAD_QUEUE_PTR_WRITE 1350 1362 // out_ISSUE_EXECUTE_LOOP_HAS_IMMEDIAT - execute_loop. in_EXECUTE_LOOP_IN_HAS_IMMEDIAT -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/src/Core_deallocation.cpp
r112 r122 59 59 // ~~~~~[ Component ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 60 60 61 DELETE0(_component_glue); 62 DELETE0(_component_dcache_access); 63 DELETE0(_component_icache_access); 64 DELETE1(_component_execute_loop, _param->_nb_execute_loop); 65 DELETE1(_component_ooo_engine , _param->_nb_ooo_engine); 66 DELETE1(_component_front_end , _param->_nb_front_end); 61 delete _component_glue; 62 delete _component_dcache_access; 63 delete _component_icache_access; 64 for (uint32_t i=0; i<_param->_nb_execute_loop; ++i) 65 delete _component_execute_loop [i]; 66 delete [] _component_execute_loop; 67 for (uint32_t i=0; i<_param->_nb_ooo_engine; ++i) 68 delete _component_ooo_engine [i]; 69 delete [] _component_ooo_engine; 70 for (uint32_t i=0; i<_param->_nb_front_end; ++i) 71 delete _component_front_end [i]; 72 delete [] _component_front_end; 67 73 68 74 delete _component; -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/src/Parameters.cpp
r120 r122 2181 2181 log_begin(Core,FUNCTION); 2182 2182 2183 for (uint32_t i=0; i<_nb_front_end; ++i) 2184 delete _param_front_end [i]; 2183 2185 delete [] _param_front_end; 2186 for (uint32_t i=0; i<_nb_ooo_engine; ++i) 2187 delete _param_ooo_engine [i]; 2184 2188 delete [] _param_ooo_engine; 2189 for (uint32_t i=0; i<_nb_execute_loop; ++i) 2190 delete _param_execute_loop [i]; 2185 2191 delete [] _param_execute_loop; 2186 2192 delete _param_icache_access; -
trunk/IPs/systemC/processor/Morpheo/Behavioural/include/Allocation.h
r115 r122 250 250 251 251 #ifdef POSITION 252 #define ALLOC1_INTERFACE_BEGIN( name, direction, localisation, str, x1) 252 #define ALLOC1_INTERFACE_BEGIN( name, direction, localisation, str, x1) \ 253 253 INTERFACE_PRINT(name); \ 254 uint32_t iterator_1 = 0; 255 morpheo::behavioural::Interface_fifo ** interface; 254 uint32_t iterator_1 = 0; \ 255 morpheo::behavioural::Interface_fifo ** interface; \ 256 256 { \ 257 257 std::string separator="_"; \ … … 264 264 } 265 265 #else 266 #define ALLOC1_INTERFACE_BEGIN( name, direction, localisation, str, x1) 266 #define ALLOC1_INTERFACE_BEGIN( name, direction, localisation, str, x1) \ 267 267 INTERFACE_PRINT(name); \ 268 const uint32_t iterator_1 = x1; \ 269 morpheo::behavioural::Interface_fifo * interface [iterator_1]; \ 270 { \ 271 std::string separator="_"; \ 268 uint32_t iterator_1 = 0; \ 269 morpheo::behavioural::Interface_fifo ** interface; \ 270 { \ 271 std::string separator="_"; \ 272 iterator_1 = x1; \ 273 interface = new morpheo::behavioural::Interface_fifo * [iterator_1]; \ 272 274 for (uint32_t it1=0; it1<iterator_1; it1++) \ 273 275 { \ … … 277 279 #endif 278 280 279 #define ALLOC1_INTERFACE_END(x1) 281 #define ALLOC1_INTERFACE_END(x1) \ 282 delete [] interface; 280 283 281 284 #define ALLOC1_VAL_ACK_IN( sig, name, type) \ … … 467 470 #endif 468 471 469 #define ALLOC2_INTERFACE_END(x1, x2) \472 #define ALLOC2_INTERFACE_END(x1, x2) \ 470 473 for (uint32_t it1=0; it1<x1; it1++) \ 471 delete interface [it1];\474 delete [] interface [it1]; \ 472 475 delete [] interface; 473 476 … … 734 737 { \ 735 738 for (uint32_t it2=0; it2<x2; it2++) \ 736 delete interface [it1][it2];\739 delete [] interface [it1][it2]; \ 737 740 delete [] interface [it1]; \ 738 741 } \ -
trunk/IPs/systemC/processor/Morpheo/Behavioural/include/Version.h
r121 r122 10 10 #define MORPHEO_MAJOR_VERSION "0" 11 11 #define MORPHEO_MINOR_VERSION "2" 12 #define MORPHEO_REVISION "12 1"12 #define MORPHEO_REVISION "122" 13 13 #define MORPHEO_CODENAME "Castor" 14 14 15 #define MORPHEO_DATE_DAY " 27"16 #define MORPHEO_DATE_MONTH "0 5"15 #define MORPHEO_DATE_DAY "03" 16 #define MORPHEO_DATE_MONTH "06" 17 17 #define MORPHEO_DATE_YEAR "2009" 18 18 -
trunk/IPs/systemC/processor/Morpheo/Files/Instance_x1_w4_1.cfg
r120 r122 127 127 <parameter name="nb_execute_loop_select" value="1" /> 128 128 <parameter name="size_re_order_buffer" value="64"/> 129 <parameter name="nb_re_order_buffer_bank" value=" 64" />129 <parameter name="nb_re_order_buffer_bank" value="16" /> 130 130 <parameter name="commit_priority" value="1" /> 131 131 <parameter name="commit_load_balancing" value="1" /> -
trunk/IPs/systemC/processor/Morpheo/Files/Instance_x1_w4_2.cfg
r120 r122 127 127 <parameter name="nb_execute_loop_select" value="1" /> 128 128 <parameter name="size_re_order_buffer" value="128"/> 129 <parameter name="nb_re_order_buffer_bank" value=" 64" />129 <parameter name="nb_re_order_buffer_bank" value="16" /> 130 130 <parameter name="commit_priority" value="1" /> 131 131 <parameter name="commit_load_balancing" value="1" /> -
trunk/IPs/systemC/processor/Morpheo/Files/Morpheo.sim
r120 r122 20 20 <parameter name="statistics_period" value="0" /> 21 21 22 <parameter name="simulation_nb_cycle" value="1000000 000"/>22 <parameter name="simulation_nb_cycle" value="1000000" /> 23 23 <parameter name="simulation_nb_instruction" value="0" /> 24 24 -
trunk/IPs/systemC/processor/Morpheo/Files/debug.sim
r120 r122 8 8 <parameter name="use_vhdl_testbench_assert" value="0" /> 9 9 <parameter name="use_position" value="0" /> 10 <parameter name="use_statistics" value=" 1" />10 <parameter name="use_statistics" value="0" /> 11 11 <parameter name="use_information" value="0" /> 12 12 <parameter name="use_header" value="0" /> … … 20 20 <parameter name="statistics_period" value="0" /> 21 21 22 <parameter name="simulation_nb_cycle" value=" 20000" />22 <parameter name="simulation_nb_cycle" value="100" /> 23 23 <parameter name="simulation_nb_instruction" value="0" /> 24 24 25 <parameter name="debug_level" value=" 3" />26 <parameter name="debug_cycle_start" value=" 30"/>27 <parameter name="debug_cycle_stop" value=" 50"/>25 <parameter name="debug_level" value="0" /> 26 <parameter name="debug_cycle_start" value="8000" /> 27 <parameter name="debug_cycle_stop" value="9000" /> 28 28 29 29 <parameter name="debug_log_file_generate" value="0" /> 30 30 <parameter name="debug_log_file_with_pid" value="0" /> 31 <parameter name="debug_idle_cycle" value=" 200" />32 <parameter name="debug_idle_time" value=" 10"/>31 <parameter name="debug_idle_cycle" value="100" /> 32 <parameter name="debug_idle_time" value="5" /> 33 33 34 <component name="Comparator" model="systemc" debug=" 1" />35 <component name="Counter" model="systemc" debug=" 1" />36 <component name="Divider" model="systemc" debug=" 1" />37 <component name="Multiplier" model="systemc" debug=" 1" />38 <component name="Priority" model="systemc" debug=" 1" />39 <component name="Queue_Control" model="systemc" debug=" 1" />40 <component name="Queue" model="systemc" debug=" 1" />41 <component name="RegisterFile_Monolithic" model="systemc" debug=" 1" />42 <component name="RegisterFile_Multi_Banked" model="systemc" debug=" 1" />43 <component name="RegisterFile" model="systemc" debug=" 1" />44 <component name="Select_Priority_Fixed" model="systemc" debug=" 1" />45 <component name="Select" model="systemc" debug=" 1" />46 <component name="Shifter" model="systemc" debug=" 1" />47 <component name="Sort" model="systemc" debug=" 1" />48 <component name="Victim_Pseudo_LRU" model="systemc" debug=" 1" />49 <component name="Victim" model="systemc" debug=" 1" />50 <component name="Execute_loop_Glue" model="systemc" debug=" 1" />51 <component name="Functionnal_unit" model="systemc" debug=" 1" />52 <component name="Load_store_unit" model="systemc" debug=" 1" />53 <component name="Read_queue" model="systemc" debug=" 1" />54 <component name="Reservation_station" model="systemc" debug=" 1" />55 <component name="Read_unit" model="systemc" debug=" 1" />56 <component name="Execute_queue" model="systemc" debug=" 1" />57 <component name="Write_queue" model="systemc" debug=" 1" />58 <component name="Write_unit" model="systemc" debug=" 1" />59 <component name="Execution_unit_to_Write_unit" model="systemc" debug=" 1" />60 <component name="Read_unit_to_Execution_unit" model="systemc" debug=" 1" />61 <component name="Register_unit_Glue" model="systemc" debug=" 1" />62 <component name="Register_unit" model="systemc" debug=" 1" />63 <component name="Execute_loop" model="systemc" debug=" 1" />34 <component name="Comparator" model="systemc" debug="0" /> 35 <component name="Counter" model="systemc" debug="0" /> 36 <component name="Divider" model="systemc" debug="0" /> 37 <component name="Multiplier" model="systemc" debug="0" /> 38 <component name="Priority" model="systemc" debug="0" /> 39 <component name="Queue_Control" model="systemc" debug="0" /> 40 <component name="Queue" model="systemc" debug="0" /> 41 <component name="RegisterFile_Monolithic" model="systemc" debug="0" /> 42 <component name="RegisterFile_Multi_Banked" model="systemc" debug="0" /> 43 <component name="RegisterFile" model="systemc" debug="0" /> 44 <component name="Select_Priority_Fixed" model="systemc" debug="0" /> 45 <component name="Select" model="systemc" debug="0" /> 46 <component name="Shifter" model="systemc" debug="0" /> 47 <component name="Sort" model="systemc" debug="0" /> 48 <component name="Victim_Pseudo_LRU" model="systemc" debug="0" /> 49 <component name="Victim" model="systemc" debug="0" /> 50 <component name="Execute_loop_Glue" model="systemc" debug="0" /> 51 <component name="Functionnal_unit" model="systemc" debug="0" /> 52 <component name="Load_store_unit" model="systemc" debug="0" /> 53 <component name="Read_queue" model="systemc" debug="0" /> 54 <component name="Reservation_station" model="systemc" debug="0" /> 55 <component name="Read_unit" model="systemc" debug="0" /> 56 <component name="Execute_queue" model="systemc" debug="0" /> 57 <component name="Write_queue" model="systemc" debug="0" /> 58 <component name="Write_unit" model="systemc" debug="0" /> 59 <component name="Execution_unit_to_Write_unit" model="systemc" debug="0" /> 60 <component name="Read_unit_to_Execution_unit" model="systemc" debug="0" /> 61 <component name="Register_unit_Glue" model="systemc" debug="0" /> 62 <component name="Register_unit" model="systemc" debug="0" /> 63 <component name="Execute_loop" model="systemc" debug="0" /> 64 64 <component name="Commit_unit" model="systemc" debug="1" /> 65 <component name="Issue_queue" model="systemc" debug=" 1" />66 <component name="OOO_Engine_Glue" model="systemc" debug=" 1" />67 <component name="Reexecute_unit" model="systemc" debug=" 1" />68 <component name="Load_Store_pointer_unit" model="systemc" debug=" 1" />69 <component name="Dependency_checking_unit" model="systemc" debug=" 1" />70 <component name="Free_List_unit" model="systemc" debug=" 1" />71 <component name="Register_Address_Translation_unit" model="systemc" debug=" 1" />72 <component name="Register_translation_unit_Glue" model="systemc" debug=" 1" />73 <component name="Stat_List_unit" model="systemc" debug=" 1" />74 <component name="Register_translation_unit" model="systemc" debug=" 1" />75 <component name="Rename_unit_Glue" model="systemc" debug=" 1" />76 <component name="Rename_select" model="systemc" debug=" 1" />77 <component name="Rename_unit" model="systemc" debug=" 1" />78 <component name="Special_Register_unit" model="systemc" debug=" 1" />79 <component name="OOO_Engine" model="systemc" debug=" 1" />65 <component name="Issue_queue" model="systemc" debug="0" /> 66 <component name="OOO_Engine_Glue" model="systemc" debug="0" /> 67 <component name="Reexecute_unit" model="systemc" debug="0" /> 68 <component name="Load_Store_pointer_unit" model="systemc" debug="0" /> 69 <component name="Dependency_checking_unit" model="systemc" debug="0" /> 70 <component name="Free_List_unit" model="systemc" debug="0" /> 71 <component name="Register_Address_Translation_unit" model="systemc" debug="0" /> 72 <component name="Register_translation_unit_Glue" model="systemc" debug="0" /> 73 <component name="Stat_List_unit" model="systemc" debug="0" /> 74 <component name="Register_translation_unit" model="systemc" debug="0" /> 75 <component name="Rename_unit_Glue" model="systemc" debug="0" /> 76 <component name="Rename_select" model="systemc" debug="0" /> 77 <component name="Rename_unit" model="systemc" debug="0" /> 78 <component name="Special_Register_unit" model="systemc" debug="0" /> 79 <component name="OOO_Engine" model="systemc" debug="0" /> 80 80 <component name="Context_State" model="systemc" debug="1" /> 81 <component name="Decod" model="systemc" debug=" 1" />82 <component name="Decod_queue" model="systemc" debug=" 1" />83 <component name="Decod_unit" model="systemc" debug=" 1" />84 <component name="Front_end_Glue" model="systemc" debug=" 1" />85 <component name="Address_management" model="systemc" debug=" 1" />86 <component name="Ifetch_queue" model="systemc" debug=" 1" />87 <component name="Ifetch_unit_Glue" model="systemc" debug=" 1" />88 <component name="Ifetch_unit" model="systemc" debug=" 1" />89 <component name="Branch_Target_Buffer_Glue" model="systemc" debug=" 1" />90 <component name="Branch_Target_Buffer_Register" model="systemc" debug=" 1" />91 <component name="Branch_Target_Buffer" model="systemc" debug=" 1" />92 <component name="Direction_Glue" model="systemc" debug=" 1" />93 <component name="Direction" model="systemc" debug=" 1" />94 <component name="Two_Level_Branch_Predictor" model="systemc" debug=" 1" />95 <component name="Meta_Predictor_Glue" model="systemc" debug=" 1" />96 <component name="Meta_Predictor" model="systemc" debug=" 1" />97 <component name="Prediction_unit_Glue" model="systemc" debug=" 1" />98 <component name="Return_Address_Stack" model="systemc" debug=" 1" />81 <component name="Decod" model="systemc" debug="0" /> 82 <component name="Decod_queue" model="systemc" debug="0" /> 83 <component name="Decod_unit" model="systemc" debug="0" /> 84 <component name="Front_end_Glue" model="systemc" debug="0" /> 85 <component name="Address_management" model="systemc" debug="0" /> 86 <component name="Ifetch_queue" model="systemc" debug="0" /> 87 <component name="Ifetch_unit_Glue" model="systemc" debug="0" /> 88 <component name="Ifetch_unit" model="systemc" debug="0" /> 89 <component name="Branch_Target_Buffer_Glue" model="systemc" debug="0" /> 90 <component name="Branch_Target_Buffer_Register" model="systemc" debug="0" /> 91 <component name="Branch_Target_Buffer" model="systemc" debug="0" /> 92 <component name="Direction_Glue" model="systemc" debug="0" /> 93 <component name="Direction" model="systemc" debug="0" /> 94 <component name="Two_Level_Branch_Predictor" model="systemc" debug="0" /> 95 <component name="Meta_Predictor_Glue" model="systemc" debug="0" /> 96 <component name="Meta_Predictor" model="systemc" debug="0" /> 97 <component name="Prediction_unit_Glue" model="systemc" debug="0" /> 98 <component name="Return_Address_Stack" model="systemc" debug="0" /> 99 99 <component name="Update_Prediction_Table" model="systemc" debug="1" /> 100 <component name="Prediction_unit" model="systemc" debug=" 1" />101 <component name="Front_end" model="systemc" debug=" 1" />102 <component name="Icache_Access" model="systemc" debug=" 1" />103 <component name="Dcache_Access" model="systemc" debug=" 1" />104 <component name="Core_Glue" model="systemc" debug=" 1" />105 <component name="Core" model="systemc" debug=" 1" />106 <component name="TopLevel" model="systemc" debug=" 1" />100 <component name="Prediction_unit" model="systemc" debug="0" /> 101 <component name="Front_end" model="systemc" debug="0" /> 102 <component name="Icache_Access" model="systemc" debug="0" /> 103 <component name="Dcache_Access" model="systemc" debug="0" /> 104 <component name="Core_Glue" model="systemc" debug="0" /> 105 <component name="Core" model="systemc" debug="0" /> 106 <component name="TopLevel" model="systemc" debug="0" /> 107 107 108 <component name="Behavioural" model="systemc" debug=" 1" />109 <component name="Interface" model="systemc" debug=" 1" />110 <component name="Allocation" model="systemc" debug=" 1" />108 <component name="Behavioural" model="systemc" debug="0" /> 109 <component name="Interface" model="systemc" debug="0" /> 110 <component name="Allocation" model="systemc" debug="0" /> 111 111 112 112 </parameters> -
trunk/IPs/systemC/processor/Morpheo/Script/instruction_flow_diff.sh
r117 r122 34 34 # Read symbol file and take function address and function name 35 35 local -a array1_address; 36 local -a array1_load_data; 36 37 local -i cpt1; 37 38 local -i cpt2; … … 45 46 # extract address 46 47 address1=$(echo ${line} | cut -d' ' -f2); 48 load_data1=$(echo ${line} | cut -d' ' -f7); 47 49 48 50 array1_address[${cpt1}]=${address1}; 51 array1_load_data[${cpt1}]=${load_data1}; 49 52 50 53 cpt1=$((${cpt1}+1)); … … 56 59 cpt2=1; 57 60 address1=${array1_address[${cpt1}]}; 61 load_data1=${array1_load_data[${cpt1}]}; 58 62 59 63 while read line; do … … 67 71 # extract address 68 72 address2=$(echo ${line} | cut -d' ' -f2); 73 load_data2=$(echo ${line} | cut -d' ' -f7); 69 74 70 75 # test address 71 76 if test "${address1}" != "${address2}"; then 72 echo "diff line ${cpt2} :"; 77 echo "diff line ${cpt2} on address:"; 78 echo "${line}"; 79 exit; 80 fi; 81 82 if test "${load_data1}" != "${load_data2}"; then 83 echo "diff line ${cpt2} on load_data:"; 73 84 echo "${line}"; 74 85 exit; … … 77 88 cpt1=$((${cpt1}+1)); 78 89 address1=${array1_address[${cpt1}]}; 90 load_data1=${array1_load_data[${cpt1}]}; 79 91 80 92 fi;
Note: See TracChangeset
for help on using the changeset viewer.