Changeset 111 for trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Decod_unit
- Timestamp:
- Feb 27, 2009, 7:37:40 PM (15 years ago)
- Location:
- trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Decod_unit
- Files:
-
- 6 added
- 24 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Decod_unit/Decod_queue/SelfTest/config_min.cfg
r82 r111 3 3 1 1 *4 # nb_inst_decod 4 4 1 1 *4 # size_queue 5 0 1 +1 # queue_scheme 5 6 32 32 +1 # size_general_data 6 7 1 1 +1 # nb_branch_speculated [0] [nb_context] -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Decod_unit/Decod_queue/SelfTest/config_mono_context.cfg
r87 r111 3 3 1 8 *2 # nb_inst_decod 4 4 8 16 *2 # size_queue 5 0 1 +1 # queue_scheme 5 6 32 32 +1 # size_general_data 6 7 1 2 +1 # nb_branch_speculated [0] [nb_context] -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Decod_unit/Decod_queue/SelfTest/config_multi_context.cfg
r82 r111 3 3 4 4 *4 # nb_inst_decod 4 4 16 16 *4 # size_queue 5 0 1 +1 # queue_scheme 5 6 32 32 +1 # size_general_data 6 7 2 2 +1 # nb_branch_speculated [0] [nb_context] -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Decod_unit/Decod_queue/SelfTest/src/main.cpp
r88 r111 8 8 #include "Behavioural/Core/Multi_Front_end/Front_end/Decod_unit/Decod_queue/SelfTest/include/test.h" 9 9 10 #define NB_PARAMS 410 #define NB_PARAMS 5 11 11 12 12 void usage (int argc, char * argv[]) … … 14 14 err (_("<Usage> %s name_instance list_params.\n"),argv[0]); 15 15 err (_("list_params is :\n")); 16 err (_(" * nb_context (uint32_t)\n")); 17 err (_(" * nb_inst_decod (uint32_t)\n")); 18 err (_(" * size_queue (uint32_t)\n")); 19 err (_(" * size_general_data (uint32_t)\n")); 20 err (_(" * nb_branch_speculated [nb_context] (uint32_t)\n")); 16 err (_(" * nb_context (uint32_t )\n")); 17 err (_(" * nb_inst_decod (uint32_t )\n")); 18 err (_(" * size_queue (uint32_t )\n")); 19 err (_(" * queue_scheme (Tdecod_queue_scheme_t)\n")); 20 err (_(" * size_general_data (uint32_t )\n")); 21 err (_(" * nb_branch_speculated [nb_context] (uint32_t )\n")); 21 22 22 23 exit (1); … … 38 39 uint32_t _nb_inst_decod = fromString<uint32_t>(argv[x++]); 39 40 uint32_t _size_queue = fromString<uint32_t>(argv[x++]); 41 Tdecod_queue_scheme_t _queue_scheme = fromString<Tdecod_queue_scheme_t>(argv[x++]); 40 42 uint32_t _size_general_data = fromString<uint32_t>(argv[x++]); 41 43 … … 54 56 _nb_inst_decod , 55 57 _size_queue , 58 _queue_scheme , 56 59 _size_general_data, 57 60 _nb_branch_speculated, -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Decod_unit/Decod_queue/SelfTest/src/test.cpp
r108 r111 7 7 */ 8 8 9 #define NB_ITERATION 1289 #define NB_ITERATION 512 10 10 #define CYCLE_MAX (128*NB_ITERATION) 11 11 … … 20 20 21 21 #ifdef STATISTICS 22 morpheo::behavioural::Parameters_Statistics * _parameters_statistics = new morpheo::behavioural::Parameters_Statistics (5, 50);22 morpheo::behavioural::Parameters_Statistics * _parameters_statistics = new morpheo::behavioural::Parameters_Statistics (5,CYCLE_MAX); 23 23 #endif 24 24 … … 234 234 address_tmp [i] = address_src [i]; 235 235 236 uint32_t x = rand()%_param->_nb_inst_decod; 236 uint32_t x = rand()%_param->_nb_inst_decod; 237 237 238 for (uint32_t i=0; i<_param->_nb_inst_decod; i++) 238 239 { … … 242 243 in_DECOD_IN_CONTEXT_ID [i]->write(context); 243 244 in_DECOD_IN_DEPTH [i]->write(depth [context]); 245 #ifdef DEBUG 246 in_DECOD_IN_ADDRESS [i]->write(address_tmp [context]); 247 #endif 244 248 in_DECOD_IN_ADDRESS_NEXT [i]->write(address_tmp [context]); 245 249 … … 250 254 { 251 255 uint32_t x = rand()%_param->_nb_inst_decod; 256 252 257 for (uint32_t i=0; i<_param->_nb_inst_decod; i++) 253 258 { … … 270 275 nb_inst [context] ++; 271 276 address_src [context] ++; 277 278 LABEL(" * nb_inst : %d",nb_inst [context]); 272 279 } 273 280 } … … 284 291 TEST(Tdepth_t ,out_DECOD_OUT_DEPTH [i]->read(),depth [context]); 285 292 TEST(Taddress_t,out_DECOD_OUT_ADDRESS_NEXT [i]->read(),address_dest [context]); 286 293 #ifdef DEBUG 294 TEST(Taddress_t,out_DECOD_OUT_ADDRESS [i]->read(),address_dest [context]); 295 #endif 287 296 nb_inst [context] --; 288 297 address_dest [context] ++; 298 299 LABEL(" * nb_inst : %d",nb_inst [context]); 289 300 } 290 301 } -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Decod_unit/Decod_queue/include/Decod_queue.h
r110 r111 136 136 // ~~~~~[ Component ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 137 137 138 // ~~~~~[ Register ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 139 private : std::list<decod_queue_entry_t*>* reg_QUEUE ; 140 private : uint32_t * reg_NB_INST ;//[nb_context] 141 private : uint32_t reg_LAST_SLOT ; 138 // ~~~~~[ Register ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 139 140 // implementation : common 141 private : std::list<decod_queue_entry_t*> * reg_QUEUE ; 142 private : uint32_t * reg_NB_INST ;//[nb_context] 143 // implementation : one_fifo only 144 private : uint32_t reg_LAST_SLOT ; 145 // implementation : multi_fifo only 146 private : uint32_t reg_NUM_BANK_HEAD ; 147 private : uint32_t reg_NUM_BANK_TAIL ; 142 148 143 149 // ~~~~~[ Internal ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 150 // implementation : common 144 151 private : Tcontrol_t * internal_DECOD_IN_ACK ;//[nb_inst_decod] 145 152 private : Tcontrol_t * internal_DECOD_OUT_VAL ;//[nb_inst_decod] 146 153 private : Tcontrol_t * internal_DECOD_OUT_ACK ;//[nb_inst_decod] 154 // implementation : one_fifo only 155 // implementation : multi_fifo only 156 157 // function pointer 158 public : void (morpheo::behavioural::core::multi_front_end::front_end::decod_unit::decod_queue::Decod_queue::*function_transition ) (void); 159 public : void (morpheo::behavioural::core::multi_front_end::front_end::decod_unit::decod_queue::Decod_queue::*function_genMoore ) (void); 160 public : void (morpheo::behavioural::core::multi_front_end::front_end::decod_unit::decod_queue::Decod_queue::*function_genMealy_decod_out) (void); 147 161 #endif 148 162 … … 177 191 178 192 #ifdef SYSTEMC 179 public : void transition (void); 180 public : void genMoore (void); 181 public : void genMealy_decod_out (void); 193 public : void transition (void); 194 public : void genMoore (void); 195 public : void genMealy_decod_out (void); 196 197 public : void function_one_fifo_transition (void); 198 public : void function_one_fifo_genMoore (void); 199 public : void function_one_fifo_genMealy_decod_out (void); 200 201 public : void function_multi_fifo_transition (void); 202 public : void function_multi_fifo_genMoore (void); 203 public : void function_multi_fifo_genMealy_decod_out (void); 182 204 #endif 183 205 -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Decod_unit/Decod_queue/include/Parameters.h
r109 r111 11 11 #include "Common/include/Debug.h" 12 12 #include "Behavioural/include/Parameters.h" 13 #include "Behavioural/Core/Multi_Front_end/Front_end/Decod_unit/Decod_queue/include/Types.h" 13 14 14 15 namespace morpheo { … … 24 25 { 25 26 //-----[ fields ]------------------------------------------------------------ 26 public : uint32_t _nb_context ; 27 public : uint32_t _nb_inst_decod ; 28 public : uint32_t _size_queue ; 29 //public : uint32_t _size_general_data ; 30 public : uint32_t * _nb_branch_speculated ; //[nb_context] 31 public : uint32_t _nb_instruction_in_queue; 27 public : uint32_t _nb_context ; 28 public : uint32_t _nb_inst_decod ; 29 public : uint32_t _size_queue ; 30 public : Tdecod_queue_scheme_t _queue_scheme ; 31 //public : uint32_t _size_general_data ; 32 public : uint32_t * _nb_branch_speculated ; //[nb_context] 33 public : uint32_t _nb_instruction_in_queue; 34 35 public : uint32_t _nb_bank; 32 36 33 37 //-----[ methods ]----------------------------------------------------------- 34 public : Parameters (uint32_t nb_context , 35 uint32_t nb_inst_decod , 36 uint32_t size_queue , 37 uint32_t size_general_data , 38 uint32_t * nb_branch_speculated, 39 bool is_toplevel=false ); 38 public : Parameters (uint32_t nb_context , 39 uint32_t nb_inst_decod , 40 uint32_t size_queue , 41 Tdecod_queue_scheme_t queue_scheme , 42 uint32_t size_general_data , 43 uint32_t * nb_branch_speculated, 44 bool is_toplevel=false ); 40 45 // public : Parameters (Parameters & param) ; 41 46 public : ~Parameters () ; -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Decod_unit/Decod_queue/include/Types.h
r108 r111 18 18 namespace decod_unit { 19 19 namespace decod_queue { 20 21 typedef enum 22 { 23 DECOD_QUEUE_SCHEME_ONE_FIFO // One fifo with a instruction bundle per slot ( internal fragmentation) 24 ,DECOD_QUEUE_SCHEME_MULTI_FIFO // One fifo per instruction. Rename in order (no internal fragmentation) 25 } Tdecod_queue_scheme_t; 20 26 21 27 class decod_queue_entry_t … … 117 123 }; // end namespace multi_front_end 118 124 }; // end namespace core 125 }; // end namespace behavioural 119 126 120 }; // end namespace behavioural 127 template<> inline std::string toString<morpheo::behavioural::core::multi_front_end::front_end::decod_unit::decod_queue::Tdecod_queue_scheme_t>(const morpheo::behavioural::core::multi_front_end::front_end::decod_unit::decod_queue::Tdecod_queue_scheme_t& x) 128 { 129 switch (x) 130 { 131 case morpheo::behavioural::core::multi_front_end::front_end::decod_unit::decod_queue::DECOD_QUEUE_SCHEME_ONE_FIFO : return "one_fifo" ; break; 132 case morpheo::behavioural::core::multi_front_end::front_end::decod_unit::decod_queue::DECOD_QUEUE_SCHEME_MULTI_FIFO : return "multi_fifo"; break; 133 default : return ""; break; 134 } 135 }; 136 137 template<> inline morpheo::behavioural::core::multi_front_end::front_end::decod_unit::decod_queue::Tdecod_queue_scheme_t fromString<morpheo::behavioural::core::multi_front_end::front_end::decod_unit::decod_queue::Tdecod_queue_scheme_t>(const std::string& x) 138 { 139 if ( (x.compare(toString(static_cast<uint32_t>(morpheo::behavioural::core::multi_front_end::front_end::decod_unit::decod_queue::DECOD_QUEUE_SCHEME_ONE_FIFO ))) == 0) or 140 (x.compare("one_fifo") == 0)) 141 return morpheo::behavioural::core::multi_front_end::front_end::decod_unit::decod_queue::DECOD_QUEUE_SCHEME_ONE_FIFO; 142 if ( (x.compare(toString(static_cast<uint32_t>(morpheo::behavioural::core::multi_front_end::front_end::decod_unit::decod_queue::DECOD_QUEUE_SCHEME_MULTI_FIFO))) == 0) or 143 (x.compare("multi_fifo") == 0)) 144 return morpheo::behavioural::core::multi_front_end::front_end::decod_unit::decod_queue::DECOD_QUEUE_SCHEME_MULTI_FIFO; 145 146 throw (ErrorMorpheo ("<fromString> : Unknow string : \""+x+"\"")); 147 }; 148 149 121 150 }; // end namespace morpheo 122 151 -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Decod_unit/Decod_queue/src/Decod_queue.cpp
r101 r111 76 76 if (usage_is_set(_usage,USE_SYSTEMC)) 77 77 { 78 // Function pointer 79 switch (_param->_queue_scheme) 80 { 81 case DECOD_QUEUE_SCHEME_ONE_FIFO : 82 { 83 function_transition = &morpheo::behavioural::core::multi_front_end::front_end::decod_unit::decod_queue::Decod_queue::function_one_fifo_transition ; 84 function_genMoore = &morpheo::behavioural::core::multi_front_end::front_end::decod_unit::decod_queue::Decod_queue::function_one_fifo_genMoore ; 85 function_genMealy_decod_out = &morpheo::behavioural::core::multi_front_end::front_end::decod_unit::decod_queue::Decod_queue::function_one_fifo_genMealy_decod_out; 86 87 break; 88 } 89 case DECOD_QUEUE_SCHEME_MULTI_FIFO : 90 { 91 function_transition = &morpheo::behavioural::core::multi_front_end::front_end::decod_unit::decod_queue::Decod_queue::function_multi_fifo_transition ; 92 function_genMoore = &morpheo::behavioural::core::multi_front_end::front_end::decod_unit::decod_queue::Decod_queue::function_multi_fifo_genMoore ; 93 function_genMealy_decod_out = &morpheo::behavioural::core::multi_front_end::front_end::decod_unit::decod_queue::Decod_queue::function_multi_fifo_genMealy_decod_out; 94 95 break; 96 } 97 default : 98 { 99 break; 100 } 101 } 102 78 103 log_printf(INFO,Decod_queue,FUNCTION,_("Method - transition")); 79 104 -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Decod_unit/Decod_queue/src/Decod_queue_allocation.cpp
r108 r111 138 138 { 139 139 // ~~~~~[ Register ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 140 reg_QUEUE = new std::list<decod_queue_entry_t*>; 140 switch (_param->_queue_scheme) 141 { 142 case DECOD_QUEUE_SCHEME_ONE_FIFO : reg_QUEUE = new std::list<decod_queue_entry_t*>; break; 143 case DECOD_QUEUE_SCHEME_MULTI_FIFO : ALLOC1(reg_QUEUE,std::list<decod_queue_entry_t*>,_param->_nb_bank); break; 144 } 141 145 reg_NB_INST = new uint32_t [_param->_nb_context]; 142 146 -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Decod_unit/Decod_queue/src/Decod_queue_deallocation.cpp
r108 r111 90 90 91 91 // ~~~~~[ Register ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ 92 delete reg_QUEUE; 92 switch (_param->_queue_scheme) 93 { 94 case DECOD_QUEUE_SCHEME_ONE_FIFO : delete reg_QUEUE; break; 95 case DECOD_QUEUE_SCHEME_MULTI_FIFO : DELETE1(reg_QUEUE,_param->_nb_bank); break; 96 } 93 97 delete [] reg_NB_INST; 94 98 -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Decod_unit/Decod_queue/src/Decod_queue_genMealy_decod_out.cpp
r108 r111 25 25 log_function(Decod_queue,FUNCTION,_name.c_str()); 26 26 27 Tcontrol_t val [_param->_nb_inst_decod]; 28 for (uint32_t i=0; i<_param->_nb_inst_decod; i++) 29 { 30 val [i] = 0; 31 internal_DECOD_OUT_VAL [i] = 0; 32 internal_DECOD_OUT_ACK [i] = 0; 33 } 34 35 if (not reg_QUEUE->empty()) 36 for (uint32_t i=0; i<_param->_nb_inst_decod; i++) 37 { 38 uint32_t index = reg_LAST_SLOT + i; 39 40 // Stop 41 if (index >= _param->_nb_inst_decod) 42 break; 43 44 if (reg_QUEUE->front()->_val [index]) 45 { 46 log_printf(TRACE,Decod_queue,FUNCTION,_(" * Queue is not empty, slot [%d] is valid."),i); 47 48 Tcontext_t context = reg_QUEUE->front()->_context_id [index]; 49 Tdepth_t depth = reg_QUEUE->front()->_depth [index]; 50 Tdepth_t depth_min = (_param->_have_port_depth)?PORT_READ(in_DEPTH_MIN [context]):0; 51 Tdepth_t depth_max = (_param->_have_port_depth)?PORT_READ(in_DEPTH_MAX [context]):0; 52 Tcontrol_t depth_full = PORT_READ(in_DEPTH_FULL[context]); 53 54 // is a valid instruction ? 55 // If DEPTH_CURRENT : 56 // equal at DEPTH_MIN -> not speculative 57 // not include ]DEPTH_MIN:DEPTH_MAX] -> previous branch miss 58 // include ]DEPTH_MIN:DEPTH_MAX] -> speculative 59 60 // All case 61 // ....... min ...X... max ....... OK 62 // ....... min ....... max ...X... KO 63 // ...X... min ....... max ....... KO 64 // ....... max ....... min ...X... OK 65 // ...X... max ....... min ....... OK 66 // ....... max ...X... min ....... KO 67 68 Tcontrol_t is_valid = ((depth == depth_min) or 69 depth_full or 70 ((depth_min <= depth_max)? 71 ((depth >= depth_min) and (depth <=depth_max)): 72 ((depth >= depth_min) or (depth <=depth_max)))); 73 //Tcontrol_t is_valid = ((depth == depth_min) or 74 // ((depth_min < depth_max)? 75 // (depth<=depth_max): 76 // ((depth > depth_min) or (depth <= depth_max)))); 77 //Tcontrol_t is_valid = depth <= depth_max; 78 79 log_printf(TRACE,Decod_queue,FUNCTION," * is_valid : %d",is_valid); 80 log_printf(TRACE,Decod_queue,FUNCTION," * context : %d",context); 81 log_printf(TRACE,Decod_queue,FUNCTION," * depth : %d",depth); 82 log_printf(TRACE,Decod_queue,FUNCTION," * depth_min : %d",depth_min); 83 log_printf(TRACE,Decod_queue,FUNCTION," * depth_max : %d",depth_max); 84 log_printf(TRACE,Decod_queue,FUNCTION," * depth_full : %d",depth_full); 85 #ifdef DEBUG 86 log_printf(TRACE,Decod_queue,FUNCTION," * address : 0x%x (0x%x)",reg_QUEUE->front()->_address [index],reg_QUEUE->front()->_address [index]<<2); 87 #endif 88 log_printf(TRACE,Decod_queue,FUNCTION," * address_next : 0x%x (0x%x)",reg_QUEUE->front()->_address_next[index],reg_QUEUE->front()->_address_next[index]<<2); 89 internal_DECOD_OUT_VAL [index] = 1; // in all case, val is set (entry is not empty, and instruction is valid) 90 if (is_valid) 91 { 92 val [i] = 1; 93 internal_DECOD_OUT_ACK [index] = PORT_READ(in_DECOD_OUT_ACK [i]); 94 } 95 else 96 { 97 // Consume the instruction (to erase) 98 internal_DECOD_OUT_ACK [index] = 1; 99 } 100 } 101 } 102 103 for (uint32_t i=0; i<_param->_nb_inst_decod; i++) 104 { 105 log_printf(TRACE,Decod_queue,FUNCTION," * DECOD_OUT_VAL : %d",val [i]); 106 107 PORT_WRITE(out_DECOD_OUT_VAL [i],val [i]); 108 } 27 (this->*function_genMealy_decod_out) (); 109 28 110 29 log_end(Decod_queue,FUNCTION); -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Decod_unit/Decod_queue/src/Decod_queue_genMoore.cpp
r109 r111 25 25 log_function(Decod_queue,FUNCTION,_name.c_str()); 26 26 27 //-------------------------------------------------------------------- 28 //-----[ DECOD_IN ]--------------------------------------------------- 29 //-------------------------------------------------------------------- 30 { 31 Tcontrol_t ack = reg_QUEUE->size() < _param->_size_queue; 32 33 for (uint32_t i=0; i<_param->_nb_inst_decod; i++) 34 { 35 internal_DECOD_IN_ACK [i] = ack; 36 PORT_WRITE(out_DECOD_IN_ACK [i],ack); 37 } 38 } 39 40 //-------------------------------------------------------------------- 41 //-----[ DECOD_OUT ]-------------------------------------------------- 42 //-------------------------------------------------------------------- 43 if (not reg_QUEUE->empty()) 44 for (uint32_t i=0; i<_param->_nb_inst_decod; i++) 45 { 46 uint32_t index = reg_LAST_SLOT + i; 47 48 // Stop 49 if (index >= _param->_nb_inst_decod) 50 break; 51 52 if (_param->_have_port_context_id) 53 PORT_WRITE(out_DECOD_OUT_CONTEXT_ID [i],reg_QUEUE->front()->_context_id [index]); 54 if (_param->_have_port_depth) 55 PORT_WRITE(out_DECOD_OUT_DEPTH [i],reg_QUEUE->front()->_depth [index]); 56 PORT_WRITE(out_DECOD_OUT_TYPE [i],reg_QUEUE->front()->_type [index]); 57 PORT_WRITE(out_DECOD_OUT_OPERATION [i],reg_QUEUE->front()->_operation [index]); 58 PORT_WRITE(out_DECOD_OUT_NO_EXECUTE [i],reg_QUEUE->front()->_no_execute [index]); 59 PORT_WRITE(out_DECOD_OUT_IS_DELAY_SLOT [i],reg_QUEUE->front()->_is_delay_slot [index]); 60 #ifdef DEBUG 61 PORT_WRITE(out_DECOD_OUT_ADDRESS [i],reg_QUEUE->front()->_address [index]); 62 #endif 63 PORT_WRITE(out_DECOD_OUT_ADDRESS_NEXT [i],reg_QUEUE->front()->_address_next [index]); 64 PORT_WRITE(out_DECOD_OUT_HAS_IMMEDIAT [i],reg_QUEUE->front()->_has_immediat [index]); 65 PORT_WRITE(out_DECOD_OUT_IMMEDIAT [i],reg_QUEUE->front()->_immediat [index]); 66 PORT_WRITE(out_DECOD_OUT_READ_RA [i],reg_QUEUE->front()->_read_ra [index]); 67 PORT_WRITE(out_DECOD_OUT_NUM_REG_RA [i],reg_QUEUE->front()->_num_reg_ra [index]); 68 PORT_WRITE(out_DECOD_OUT_READ_RB [i],reg_QUEUE->front()->_read_rb [index]); 69 PORT_WRITE(out_DECOD_OUT_NUM_REG_RB [i],reg_QUEUE->front()->_num_reg_rb [index]); 70 PORT_WRITE(out_DECOD_OUT_READ_RC [i],reg_QUEUE->front()->_read_rc [index]); 71 PORT_WRITE(out_DECOD_OUT_NUM_REG_RC [i],reg_QUEUE->front()->_num_reg_rc [index]); 72 PORT_WRITE(out_DECOD_OUT_WRITE_RD [i],reg_QUEUE->front()->_write_rd [index]); 73 PORT_WRITE(out_DECOD_OUT_NUM_REG_RD [i],reg_QUEUE->front()->_num_reg_rd [index]); 74 PORT_WRITE(out_DECOD_OUT_WRITE_RE [i],reg_QUEUE->front()->_write_re [index]); 75 PORT_WRITE(out_DECOD_OUT_NUM_REG_RE [i],reg_QUEUE->front()->_num_reg_re [index]); 76 PORT_WRITE(out_DECOD_OUT_EXCEPTION_USE [i],reg_QUEUE->front()->_exception_use [index]); 77 PORT_WRITE(out_DECOD_OUT_EXCEPTION [i],reg_QUEUE->front()->_exception [index]); 78 } 79 80 //-------------------------------------------------------------------- 81 //-----[ NB_INST ]---------------------------------------------------- 82 //-------------------------------------------------------------------- 83 for (uint32_t i=0; i<_param->_nb_context; i++) 84 PORT_WRITE(out_NB_INST_ALL [i], reg_NB_INST [i]); 27 (this->*function_genMoore) (); 85 28 86 29 log_end(Decod_queue,FUNCTION); -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Decod_unit/Decod_queue/src/Decod_queue_transition.cpp
r110 r111 25 25 log_function(Decod_queue,FUNCTION,_name.c_str()); 26 26 27 if (PORT_READ(in_NRESET) == 0) 28 { 29 reg_QUEUE->clear(); 30 31 for (uint32_t i=0; i<_param->_nb_context; i++) 32 reg_NB_INST [i]=0; 33 34 reg_LAST_SLOT = 0; 35 } 36 else 37 { 38 //-------------------------------------------------------------------- 39 //-----[ DECOD_IN ]--------------------------------------------------- 40 //-------------------------------------------------------------------- 41 decod_queue_entry_t * entry = NULL; 42 for (uint32_t i=0; i<_param->_nb_inst_decod; i++) 43 { 44 if (PORT_READ(in_DECOD_IN_VAL [i]) and internal_DECOD_IN_ACK[i]) 45 { 46 log_printf(TRACE,Decod_queue,FUNCTION,_(" * DECOD_IN [%d]"),i); 47 48 if (entry == NULL) 49 { 50 // Once creation and insert in queue 51 entry = new decod_queue_entry_t (_param->_nb_inst_decod); 52 reg_QUEUE->push_back(entry); 53 54 #ifdef STATISTICS 55 if (usage_is_set(_usage,USE_STATISTICS)) 56 (*_stat_sum_transaction_decod_in) ++; 57 #endif 58 } 59 60 #ifdef STATISTICS 61 if (usage_is_set(_usage,USE_STATISTICS)) 62 (*_stat_sum_inst_enable) ++; 63 #endif 64 65 Tcontext_t context = (_param->_have_port_context_id)?PORT_READ(in_DECOD_IN_CONTEXT_ID [i]):0; 66 67 log_printf(TRACE,Decod_queue,FUNCTION,_(" * context : %d"),context); 68 69 entry->_val [i] = 1; 70 entry->_context_id [i] = context; 71 entry->_depth [i] = (_param->_have_port_depth)?PORT_READ(in_DECOD_IN_DEPTH [i]):0; 72 entry->_type [i] = PORT_READ(in_DECOD_IN_TYPE [i]); 73 entry->_operation [i] = PORT_READ(in_DECOD_IN_OPERATION [i]); 74 entry->_no_execute [i] = PORT_READ(in_DECOD_IN_NO_EXECUTE [i]); 75 entry->_is_delay_slot [i] = PORT_READ(in_DECOD_IN_IS_DELAY_SLOT [i]); 76 #ifdef DEBUG 77 entry->_address [i] = PORT_READ(in_DECOD_IN_ADDRESS [i]); 78 #endif 79 entry->_address_next [i] = PORT_READ(in_DECOD_IN_ADDRESS_NEXT [i]); 80 entry->_has_immediat [i] = PORT_READ(in_DECOD_IN_HAS_IMMEDIAT [i]); 81 entry->_immediat [i] = PORT_READ(in_DECOD_IN_IMMEDIAT [i]); 82 entry->_read_ra [i] = PORT_READ(in_DECOD_IN_READ_RA [i]); 83 entry->_num_reg_ra [i] = PORT_READ(in_DECOD_IN_NUM_REG_RA [i]); 84 entry->_read_rb [i] = PORT_READ(in_DECOD_IN_READ_RB [i]); 85 entry->_num_reg_rb [i] = PORT_READ(in_DECOD_IN_NUM_REG_RB [i]); 86 entry->_read_rc [i] = PORT_READ(in_DECOD_IN_READ_RC [i]); 87 entry->_num_reg_rc [i] = PORT_READ(in_DECOD_IN_NUM_REG_RC [i]); 88 entry->_write_rd [i] = PORT_READ(in_DECOD_IN_WRITE_RD [i]); 89 entry->_num_reg_rd [i] = PORT_READ(in_DECOD_IN_NUM_REG_RD [i]); 90 entry->_write_re [i] = PORT_READ(in_DECOD_IN_WRITE_RE [i]); 91 entry->_num_reg_re [i] = PORT_READ(in_DECOD_IN_NUM_REG_RE [i]); 92 entry->_exception_use [i] = PORT_READ(in_DECOD_IN_EXCEPTION_USE [i]); 93 entry->_exception [i] = PORT_READ(in_DECOD_IN_EXCEPTION [i]); 94 95 reg_NB_INST [context] ++; 96 97 log_printf(TRACE,Decod_queue,FUNCTION,_(" * nb_inst : %d"),reg_NB_INST [context]); 98 log_printf(TRACE,Decod_queue,FUNCTION,_(" * PUSH queue")); 99 } 100 } 101 102 //-------------------------------------------------------------------- 103 //-----[ DECOD_OUT ]-------------------------------------------------- 104 //-------------------------------------------------------------------- 105 if (not reg_QUEUE->empty()) 106 { 107 bool find = false; 108 109 for (uint32_t i=0; i<_param->_nb_inst_decod; i++) 110 { 111 // Test transaction : if ok then invalid slot 112 // In order by rename logic 113 if (internal_DECOD_OUT_VAL [i] and internal_DECOD_OUT_ACK[i]) 114 { 115 log_printf(TRACE,Decod_queue,FUNCTION,_(" * DECOD_OUT [%d]"),i); 116 117 #ifdef DEBUG_TEST 118 if (reg_LAST_SLOT != i) 119 throw ERRORMORPHEO(FUNCTION,toString(_("reg_LAST_SLOT (%d) is different at decod_out port (%d)."),reg_LAST_SLOT,i)); 120 #endif 121 reg_LAST_SLOT ++; 122 123 reg_QUEUE->front()->_val [i] = 0; 124 125 Tcontext_t context = reg_QUEUE->front()->_context_id [i]; 126 log_printf(TRACE,Decod_queue,FUNCTION,_(" * context : %d"),context); 127 128 reg_NB_INST [context] --; 129 log_printf(TRACE,Decod_queue,FUNCTION,_(" * nb_inst : %d"),reg_NB_INST [context]); 130 } 131 // Test if slot is (again) valid, if yes, then have less one instruction in the entry 132 find |= reg_QUEUE->front()->_val [i]; 133 } 134 135 // test if can free the entry : test if have consume all entry 136 if (not find) // no valid instruction in current slot 137 { 138 log_printf(TRACE,Decod_queue,FUNCTION,_(" * POP queue")); 139 140 // can pop the slot 141 delete reg_QUEUE->front(); 142 reg_QUEUE->pop_front(); 143 144 reg_LAST_SLOT = 0; 145 } 146 } 147 } 148 149 #if defined(DEBUG) and defined(DEBUG_Decod_queue) and (DEBUG >= DEBUG_TRACE) 150 log_printf(TRACE,Decod_queue,FUNCTION," * Dump decod_queue"); 151 log_printf(TRACE,Decod_queue,FUNCTION," * reg_LAST_SLOT : %d",reg_LAST_SLOT); 152 uint32_t x=0; 153 for (std::list<decod_queue_entry_t*>::iterator it=reg_QUEUE->begin(); 154 it!=reg_QUEUE->end(); 155 it++) 156 { 157 for (uint32_t i=0; i<_param->_nb_inst_decod; i++) 158 { 159 if ((*it)->_val [i]) 160 log_printf(TRACE,Decod_queue,FUNCTION," * [%.4d][%.4d] %.1d, %.3d %.2d, %.2d %.3d %.1d %.1d, 0x%.8x (0x%.8x), %.1d 0x%.8x, %.1d %.2d, %.1d %.2d, %.1d %.2d, %.1d %.2d, %.1d %.2d, %.1d %.2d" 161 ,x 162 ,i 163 ,(*it)->_val [i] 164 ,(*it)->_context_id [i] 165 ,(*it)->_depth [i] 166 ,(*it)->_type [i] 167 ,(*it)->_operation [i] 168 ,(*it)->_no_execute [i] 169 ,(*it)->_is_delay_slot [i] 170 ,(*it)->_address [i] 171 ,(*it)->_address [i]<<2 172 ,(*it)->_has_immediat [i] 173 ,(*it)->_immediat [i] 174 ,(*it)->_read_ra [i] 175 ,(*it)->_num_reg_ra [i] 176 ,(*it)->_read_rb [i] 177 ,(*it)->_num_reg_rb [i] 178 ,(*it)->_read_rc [i] 179 ,(*it)->_num_reg_rc [i] 180 ,(*it)->_write_rd [i] 181 ,(*it)->_num_reg_rd [i] 182 ,(*it)->_write_re [i] 183 ,(*it)->_num_reg_re [i] 184 ,(*it)->_exception_use [i] 185 ,(*it)->_exception [i] 186 ); 187 else 188 log_printf(TRACE,Decod_queue,FUNCTION," * [%.4d][%.4d] %d" 189 ,x 190 ,i 191 ,(*it)->_val [i] 192 ); 193 194 } 195 x++; 196 } 197 #endif 198 199 #ifdef STATISTICS 200 if (usage_is_set(_usage,USE_STATISTICS)) 201 { 202 *(_stat_use_queue) += reg_QUEUE->size(); 203 for (uint32_t i=0; i<_param->_nb_context; i++) 204 *(_stat_nb_inst [i]) += reg_NB_INST [i]; 205 } 206 #endif 27 (this->*function_transition) (); 207 28 208 29 #if defined(STATISTICS) or defined(VHDL_TESTBENCH) -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Decod_unit/Decod_queue/src/Parameters.cpp
r109 r111 20 20 #undef FUNCTION 21 21 #define FUNCTION "Decod_queue::Parameters" 22 Parameters::Parameters (uint32_t nb_context , 23 uint32_t nb_inst_decod , 24 uint32_t size_queue , 25 uint32_t size_general_data , 26 uint32_t * nb_branch_speculated, 27 bool is_toplevel ) 22 Parameters::Parameters (uint32_t nb_context , 23 uint32_t nb_inst_decod , 24 uint32_t size_queue , 25 Tdecod_queue_scheme_t queue_scheme , 26 uint32_t size_general_data , 27 uint32_t * nb_branch_speculated, 28 bool is_toplevel) 28 29 { 29 30 log_begin(Decod_queue,FUNCTION); … … 32 33 _nb_inst_decod = nb_inst_decod ; 33 34 _size_queue = size_queue/nb_inst_decod; 34 // _size_general_data = size_general_data ; 35 _nb_branch_speculated = nb_branch_speculated; 36 _nb_instruction_in_queue = size_queue; 37 35 _queue_scheme = queue_scheme ; 36 // _size_general_data = size_general_data ; 37 _nb_branch_speculated = nb_branch_speculated ; 38 _nb_instruction_in_queue = size_queue ; 39 40 _nb_bank = nb_inst_decod ; 41 38 42 test(); 39 43 -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Decod_unit/Decod_queue/src/Parameters_msg_error.cpp
r109 r111 30 30 test.error("Size of decod queue must be a multiple of nb_instruction.\n"); 31 31 32 switch (_queue_scheme) 33 { 34 case DECOD_QUEUE_SCHEME_ONE_FIFO : 35 case DECOD_QUEUE_SCHEME_MULTI_FIFO : 36 { 37 break; 38 } 39 default : 40 { 41 test.error(toString(_("Decod queue scheme '%s' is not supported. Please wait a next revision.\n"),toString(_queue_scheme).c_str())); 42 break; 43 } 44 } 45 32 46 log_end(Decod_queue,FUNCTION); 33 47 -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Decod_unit/Decod_queue/src/Parameters_print.cpp
r82 r111 30 30 xml.singleton_begin("nb_inst_decod "); xml.attribut("value",toString(_nb_inst_decod )); xml.singleton_end(); 31 31 xml.singleton_begin("size_queue "); xml.attribut("value",toString(_size_queue )); xml.singleton_end(); 32 xml.singleton_begin("queue_scheme "); xml.attribut("value",toString(_queue_scheme )); xml.singleton_end(); 32 33 xml.singleton_begin("size_general_data "); xml.attribut("value",toString(_size_general_data)); xml.singleton_end(); 33 34 for (uint32_t i=0;i<_nb_context; i++) -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Decod_unit/SelfTest/config_min.cfg
r88 r111 4 4 1 1 +1 # nb_inst_decod 5 5 1 1 +1 # size_queue 6 0 1 +1 # queue_scheme 6 7 32 32 +1 # size_general_data 7 8 1 1 +1 # nb_branch_speculated [0][nb_context] -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Decod_unit/SelfTest/config_mono_context.cfg
r88 r111 4 4 1 4 *4 # nb_inst_decod 5 5 4 16 *4 # size_queue 6 0 1 +1 # queue_scheme 6 7 32 32 +1 # size_general_data 7 8 1 1 *4 # nb_branch_speculated [0][nb_context] -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Decod_unit/SelfTest/config_multi_context.cfg
r88 r111 7 7 1 8 *4 # nb_inst_decod 8 8 16 16 *4 # size_queue 9 0 1 +1 # queue_scheme 9 10 32 32 +1 # size_general_data 10 11 1 1 *4 # nb_branch_speculated [0][nb_context] -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Decod_unit/SelfTest/src/main.cpp
r88 r111 9 9 #include "Behavioural/Custom/include/Custom_example.h" 10 10 11 #define NB_PARAMS 711 #define NB_PARAMS 8 12 12 13 13 void usage (int argc, char * argv[]) … … 15 15 err (_("<Usage> %s name_instance list_params.\n"),argv[0]); 16 16 err (_("list_params is :\n")); 17 err (_(" * nb_context (uint32_t )\n")); 18 err (_(" * nb_inst_fetch [nb_context] (uint32_t )\n")); 19 err (_(" * nb_inst_decod (uint32_t )\n")); 20 err (_(" * size_queue (uint32_t )\n")); 21 err (_(" * size_general_data (uint32_t )\n")); 22 err (_(" * nb_branch_speculated [nb_context] (uint32_t )\n")); 23 err (_(" * nb_context_select (uint32_t )\n")); 24 err (_(" * select_priority (Tpriority_t )\n")); 25 err (_(" * select_load_balancing (Tload_balancing_t)\n")); 17 err (_(" * nb_context (uint32_t )\n")); 18 err (_(" * nb_inst_fetch [nb_context] (uint32_t )\n")); 19 err (_(" * nb_inst_decod (uint32_t )\n")); 20 err (_(" * size_queue (uint32_t )\n")); 21 err (_(" * queue_scheme (Tdecod_queue_scheme_t)\n")); 22 err (_(" * size_general_data (uint32_t )\n")); 23 err (_(" * nb_branch_speculated [nb_context] (uint32_t )\n")); 24 err (_(" * nb_context_select (uint32_t )\n")); 25 err (_(" * select_priority (Tpriority_t )\n")); 26 err (_(" * select_load_balancing (Tload_balancing_t )\n")); 26 27 27 28 exit (1); … … 51 52 uint32_t _nb_inst_decod = fromString<uint32_t >(argv[x++]); 52 53 uint32_t _size_queue = fromString<uint32_t >(argv[x++]); 54 decod_queue::Tdecod_queue_scheme_t _queue_scheme = fromString<decod_queue::Tdecod_queue_scheme_t>(argv[x++]); 53 55 uint32_t _size_general_data = fromString<uint32_t >(argv[x++]); 54 56 uint32_t * _nb_branch_speculated = new uint32_t [_nb_context]; … … 77 79 _nb_inst_decod , 78 80 _size_queue , 81 _queue_scheme , 79 82 _size_general_data , 80 83 _nb_branch_speculated , -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Decod_unit/include/Parameters.h
r88 r111 30 30 public : uint32_t _nb_inst_decod ; 31 31 public : uint32_t _size_queue ; 32 public : decod_queue::Tdecod_queue_scheme_t 33 _queue_scheme ; 32 34 //public : uint32_t _size_general_data ; 33 35 public : uint32_t * _nb_branch_speculated ; //[nb_context] … … 50 52 uint32_t nb_inst_decod , 51 53 uint32_t size_queue , 54 decod_queue::Tdecod_queue_scheme_t 55 queue_scheme , 52 56 uint32_t size_general_data , 53 57 uint32_t * nb_branch_speculated , -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Decod_unit/src/Parameters.cpp
r88 r111 23 23 uint32_t nb_inst_decod , 24 24 uint32_t size_queue , 25 decod_queue::Tdecod_queue_scheme_t 26 queue_scheme , 25 27 uint32_t size_general_data , 26 28 uint32_t * nb_branch_speculated , … … 40 42 _nb_inst_decod = nb_inst_decod ; 41 43 _size_queue = size_queue ; 44 _queue_scheme = queue_scheme ; 42 45 // _size_general_data = size_general_data ; 43 46 _nb_branch_speculated = nb_branch_speculated ; … … 71 74 _nb_inst_decod , 72 75 _size_queue , 76 _queue_scheme , 73 77 size_general_data , 74 78 _nb_branch_speculated); -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Decod_unit/src/Parameters_print.cpp
r88 r111 29 29 xml.singleton_begin("nb_inst_decod "); xml.attribut("value",toString(_nb_inst_decod )); xml.singleton_end(); 30 30 xml.singleton_begin("size_queue "); xml.attribut("value",toString(_size_queue )); xml.singleton_end(); 31 xml.singleton_begin("queue_scheme "); xml.attribut("value",toString(_queue_scheme )); xml.singleton_end(); 31 32 xml.singleton_begin("size_general_data "); xml.attribut("value",toString(_size_general_data )); xml.singleton_end(); 32 33 xml.singleton_begin("nb_context_select "); xml.attribut("value",toString(_nb_context_select )); xml.singleton_end();
Note: See TracChangeset
for help on using the changeset viewer.