Changeset 86 for trunk/IPs/systemC/processor
- Timestamp:
- May 14, 2008, 7:08:56 PM (17 years ago)
- Location:
- trunk/IPs/systemC/processor/Morpheo/Behavioural
- Files:
-
- 15 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Decod_unit/Decod/Instruction/include/Instruction.h
r81 r86 37 37 38 38 void instruction_illegal (decod_instruction_t * inst, decod_param_t * param); 39 40 void instruction_l_custom (decod_instruction_t * inst, decod_param_t * param); 41 void instruction_lf_custom (decod_instruction_t * inst, decod_param_t * param); 42 void instruction_lv_custom (decod_instruction_t * inst, decod_param_t * param); 43 void instruction_custom (decod_instruction_t * inst, decod_param_t * param); 39 44 40 45 // ORBIS -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Decod_unit/Decod/Instruction/include/Types.h
r81 r86 63 63 public : Tgeneral_data_t _mask_data ; 64 64 public : Tgeneral_data_t _mask_shift; 65 public : void (*** _function_decod) (decod_instruction_t *, decod_param_t *); // [type][opcod] 65 public : void (*** _function_decod ) (decod_instruction_t *, decod_param_t *); // [type][opcod] 66 public : void (*** _function_custom) (decod_instruction_t *, decod_param_t *); // [type][opcod] 66 67 67 68 public : decod_param_t (uint32_t size_data, 68 void (*** function_decod) (decod_instruction_t *, decod_param_t *)) 69 void (*** function_decod ) (decod_instruction_t *, decod_param_t *), 70 void (*** function_custom) (decod_instruction_t *, decod_param_t *)) 69 71 { 70 _size_data = size_data; 71 _mask_data = gen_mask<Tgeneral_data_t> (size_data); 72 _mask_shift = gen_mask<Tgeneral_data_t> (log2(size_data)); 73 _function_decod = function_decod; 72 _size_data = size_data; 73 _mask_data = gen_mask<Tgeneral_data_t> (size_data); 74 _mask_shift = gen_mask<Tgeneral_data_t> (log2(size_data)); 75 _function_decod = function_decod; 76 _function_custom = function_custom; 74 77 }; 75 78 public : ~decod_param_t (void) -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Decod_unit/Decod/Instruction/src/Instruction.cpp
r81 r86 13 13 14 14 #include "Behavioural/Core/Multi_Front_end/Front_end/Decod_unit/Decod/Instruction/include/Instruction.h" 15 #include "Behavioural/include/Constants.h" 15 16 16 17 namespace morpheo { … … 130 131 131 132 inst->_event_type = EVENT_TYPE_EXCEPTION; 133 } 134 135 void instruction_l_custom (decod_instruction_t * inst, decod_param_t * param) 136 { 137 log_printf(TRACE,Decod,"instruction_l_custom"," * instruction : custom"); 138 139 uint32_t opcod = range<uint32_t>(inst->_instruction,31,26); 140 141 inst->_type = TYPE_CUSTOM; 142 switch (opcod) 143 { 144 case OPCOD_L_CUST1 : {inst->_operation = OPERATION_CUSTOM_L_1; break;} 145 case OPCOD_L_CUST2 : {inst->_operation = OPERATION_CUSTOM_L_2; break;} 146 case OPCOD_L_CUST3 : {inst->_operation = OPERATION_CUSTOM_L_3; break;} 147 case OPCOD_L_CUST4 : {inst->_operation = OPERATION_CUSTOM_L_4; break;} 148 case OPCOD_L_CUST5 : {inst->_operation = OPERATION_CUSTOM_L_5; break;} 149 case OPCOD_L_CUST6 : {inst->_operation = OPERATION_CUSTOM_L_6; break;} 150 case OPCOD_L_CUST7 : {inst->_operation = OPERATION_CUSTOM_L_7; break;} 151 case OPCOD_L_CUST8 : {inst->_operation = OPERATION_CUSTOM_L_8; break;} 152 default : {throw ERRORMORPHEO("instruction_l_custom",_("Invalid Custom Opcod."));} 153 } 154 155 (* param->_function_custom[ 0][opcod]) (inst,param); 156 157 instruction_custom(inst,param); 158 } 159 160 void instruction_lf_custom (decod_instruction_t * inst, decod_param_t * param) 161 { 162 log_printf(TRACE,Decod,"instruction_lf_custom"," * instruction : custom"); 163 164 uint32_t opcod = range<uint32_t>(inst->_instruction, 7, 0); 165 166 inst->_type = TYPE_CUSTOM; 167 switch (opcod) 168 { 169 // case OPCOD_LF_CUST1_D : {inst->_operation = OPERATION_CUSTOM_LF_1_D; break;} 170 // case OPCOD_LF_CUST1_S : {inst->_operation = OPERATION_CUSTOM_LF_1_S; break;} 171 default : {throw ERRORMORPHEO("instruction_lf_custom",_("Invalid Custom Opcod."));} 172 } 173 174 (* param->_function_custom[ 1][opcod]) (inst,param); 175 176 instruction_custom(inst,param); 177 } 178 179 void instruction_lv_custom (decod_instruction_t * inst, decod_param_t * param) 180 { 181 log_printf(TRACE,Decod,"instruction_lv_custom"," * instruction : custom"); 182 183 uint32_t opcod = range<uint32_t>(inst->_instruction, 7, 0); 184 185 inst->_type = TYPE_CUSTOM; 186 switch (opcod) 187 { 188 // case OPCOD_LV_CUST1 : {inst->_operation = OPERATION_CUSTOM_LV_1; break;} 189 // case OPCOD_LV_CUST2 : {inst->_operation = OPERATION_CUSTOM_LV_2; break;} 190 // case OPCOD_LV_CUST3 : {inst->_operation = OPERATION_CUSTOM_LV_3; break;} 191 // case OPCOD_LV_CUST4 : {inst->_operation = OPERATION_CUSTOM_LV_4; break;} 192 default : {throw ERRORMORPHEO("instruction_lv_custom",_("Invalid Custom Opcod."));} 193 } 194 195 (* param->_function_custom[ 2][opcod]) (inst,param); 196 197 instruction_custom(inst,param); 198 } 199 200 void instruction_custom (decod_instruction_t * inst, decod_param_t * param) 201 { 202 // Test custom operation 203 204 std::string msg = ""; 205 206 if (inst->_exception_use != EXCEPTION_USE_ILLEGAL_INSTRUCTION) 207 { 208 if (inst->_type != TYPE_CUSTOM) 209 msg += _("Invalid Type.\n"); 210 211 if ((inst->_operation != OPERATION_CUSTOM_L_1 ) and 212 (inst->_operation != OPERATION_CUSTOM_L_2 ) and 213 (inst->_operation != OPERATION_CUSTOM_L_3 ) and 214 (inst->_operation != OPERATION_CUSTOM_L_4 ) and 215 (inst->_operation != OPERATION_CUSTOM_L_5 ) and 216 (inst->_operation != OPERATION_CUSTOM_L_6 ) and 217 (inst->_operation != OPERATION_CUSTOM_L_7 ) and 218 (inst->_operation != OPERATION_CUSTOM_L_8 ) and 219 (inst->_operation != OPERATION_CUSTOM_LF_1_D) and 220 (inst->_operation != OPERATION_CUSTOM_LF_1_S) and 221 (inst->_operation != OPERATION_CUSTOM_LV_1 ) and 222 (inst->_operation != OPERATION_CUSTOM_LV_2 ) and 223 (inst->_operation != OPERATION_CUSTOM_LV_3 ) and 224 (inst->_operation != OPERATION_CUSTOM_LV_4 )) 225 msg += _("Invalid Operation.\n"); 226 227 if ((inst->_exception_use != EXCEPTION_USE_NONE ) and 228 (inst->_exception_use != EXCEPTION_USE_RANGE ) and 229 (inst->_exception_use != EXCEPTION_USE_CUSTOM_0 ) and 230 (inst->_exception_use != EXCEPTION_USE_CUSTOM_1 ) and 231 (inst->_exception_use != EXCEPTION_USE_CUSTOM_2 ) and 232 (inst->_exception_use != EXCEPTION_USE_CUSTOM_3 ) and 233 (inst->_exception_use != EXCEPTION_USE_CUSTOM_4 ) and 234 (inst->_exception_use != EXCEPTION_USE_CUSTOM_5 ) and 235 (inst->_exception_use != EXCEPTION_USE_CUSTOM_6 )) 236 msg += _("Invalid Exception.\n"); 237 238 if ((inst->_event_type != EVENT_TYPE_NONE ) and 239 (inst->_event_type != EVENT_TYPE_SPR_ACCESS)) 240 msg += _("Invalid Event_type.\n"); 241 242 if (inst->_address_next != (inst->_address+1)) 243 msg += _("Address must be in sequence.\n"); 244 245 if (msg != "") 246 throw ERRORMORPHEO("instruction_custom","Invalid decod : "+msg); 247 } 132 248 } 133 249 … … 706 822 inst->_operation = OPERATION_BRANCH_L_JALR; 707 823 inst->_has_immediat = 1; 708 inst->_immediat = inst->_address_next+ 4;824 inst->_immediat = inst->_address_next+1; 709 825 inst->_read_ra = 0; 710 826 // inst->_num_reg_ra = ; -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Decod_unit/Decod/SelfTest/src/main.cpp
r81 r86 7 7 8 8 #include "Behavioural/Core/Multi_Front_end/Front_end/Decod_unit/Decod/SelfTest/include/test.h" 9 #include "Behavioural/Custom/include/Custom_example.h" 9 10 10 11 #define NB_PARAMS 8 … … 79 80 _load_balancing , 80 81 _instruction_implemeted , 81 NULL); 82 &(morpheo::behavioural::custom::example_get_custom_information) 83 ); 82 84 83 85 msg(_("%s"),param->print(1).c_str()); -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Decod_unit/Decod/SelfTest/src/test.cpp
r82 r86 17 17 class entry_t 18 18 { 19 // 19 //public : Tcontrol_t _val ; 20 20 public : Tinstruction_t _instruction ; 21 // 21 //public : Tcontext_t _context_id ; 22 22 public : Tgeneral_address_t _address_previous ; 23 23 public : Tgeneral_address_t _address ; … … 26 26 public : Tprediction_ptr_t _branch_update_prediction_id; 27 27 public : Tbranch_condition_t _branch_condition ; 28 // 28 //public : Tcontrol_t _branch_stack_write ; 29 29 public : Tcontrol_t _branch_direction ; 30 30 public : Tgeneral_address_t _branch_address_dest ; … … 299 299 300 300 uint32_t w; 301 uint32_t x = 0xfc;302 uint32_t y = 0x100;303 uint32_t z = 0x104;301 uint32_t x = (0x100>>2)-1; 302 uint32_t y = (0x100>>2); 303 uint32_t z = (0x100>>2)+1; 304 304 305 305 uint32_t delay_slot_previous [_param->_nb_context]; … … 307 307 uint32_t delay_slot_next [_param->_nb_context]; 308 308 309 #define SEQ do {x=y; y=z; z+= 4;} while(0);310 #define JMP(j) do {x=y; y=z; z =j; } while(0);309 #define SEQ do {x=y; y=z; z+=1; LABEL("%.8x - previous : 0x%x (%d), current : 0x%x (%d), next : 0x%x (%d)",request [0].back()._instruction, x,x,y,y,z,z);} while(0); 310 #define JMP(j) do {x=y; y=z; z =j; LABEL("%.8x - previous : 0x%x (%d), current : 0x%x (%d), next : 0x%x (%d)",request [0].back()._instruction, x,x,y,y,z,z);} while(0); 311 311 312 312 // ===== l.add r15, r4 , r8 … … 615 615 BRANCH_STATE_NONE,0,BRANCH_CONDITION_NONE_WITH_WRITE_STACK,1, w, 616 616 0,TYPE_BRANCH,OPERATION_BRANCH_L_JALR,false, 617 1,z+ 4,0, 0,0,0 ,0,0 ,1,9 ,0,0 ,617 1,z+1,0, 0,0,0 ,0,0 ,1,9 ,0,0 , 618 618 EXCEPTION_USE_NONE ,EVENT_TYPE_NONE)); 619 619 JMP(w); … … 643 643 BRANCH_STATE_NONE,0,BRANCH_CONDITION_NONE_WITH_WRITE_STACK,1, w, 644 644 0,TYPE_BRANCH,OPERATION_BRANCH_L_JALR,false, 645 1,z+ 4,0, 0,0,0 ,0,0 ,1,9 ,0,0 ,645 1,z+1,0, 0,0,0 ,0,0 ,1,9 ,0,0 , 646 646 EXCEPTION_USE_NONE ,EVENT_TYPE_NONE)); 647 647 JMP(w); … … 1418 1418 TYPE_TEST,OPERATION_TEST_L_SFLTU,false, 1419 1419 1,0xfffffc06, 1,10, 0,0, 0,0, 0,0, 1,SPR_LOGIC_SR_F, 1420 EXCEPTION_USE_NONE,EVENT_TYPE_NONE)); 1421 SEQ; 1422 1423 // ===== l.cust4 (encrypt) 1424 request [0].push_back (entry_t( 1425 0x7de80000,x,y,z, 1426 0,0,0,0,0,0, 1427 TYPE_CUSTOM,OPERATION_CUSTOM_L_4,false, 1428 0,0x0, 1, 8, 0,0, 0,0, 1,15, 0,0, 1429 EXCEPTION_USE_NONE,EVENT_TYPE_NONE)); 1430 SEQ; 1431 1432 // ===== l.cust8 (decrypt) 1433 request [0].push_back (entry_t( 1434 0xfde80000,x,y,z, 1435 0,0,0,0,0,0, 1436 TYPE_CUSTOM,OPERATION_CUSTOM_L_8,false, 1437 0,0x0, 1, 8, 0,0, 0,0, 1,15, 0,0, 1420 1438 EXCEPTION_USE_NONE,EVENT_TYPE_NONE)); 1421 1439 SEQ; … … 1451 1469 if (it!=request [i].end()) 1452 1470 { 1453 uint32_t lsb = (it->_address>>2)%_param->_nb_inst_fetch[i];1471 uint32_t lsb = it->_address%_param->_nb_inst_fetch[i]; 1454 1472 1455 in_IFETCH_ADDRESS [i]->write(it->_address- (lsb<<2));1473 in_IFETCH_ADDRESS [i]->write(it->_address-lsb); 1456 1474 in_IFETCH_BRANCH_STATE [i]->write(BRANCH_STATE_NONE); 1457 1475 if (_param->_have_port_inst_ifetch_ptr) … … 1515 1533 LABEL("DECOD [%d] : transaction",i ); 1516 1534 LABEL(" * context : %d",context); 1535 LABEL(" * instruction : 0x%x",request [context].front()._instruction); 1517 1536 1518 1537 if (_param->_have_port_depth) … … 1554 1573 if (_param->_have_port_context_id) 1555 1574 TEST(Tcontext_t , out_PREDICT_CONTEXT_ID [i]->read(), context); 1556 TEST(Tcontrol_t , out_PREDICT_MATCH_INST_IFETCH_PTR [i]->read(),((request [context].front()._address >>2)%_param->_nb_inst_fetch[context]) == 0);1575 TEST(Tcontrol_t , out_PREDICT_MATCH_INST_IFETCH_PTR [i]->read(),((request [context].front()._address)%_param->_nb_inst_fetch[context]) == 0); 1557 1576 TEST(Tbranch_state_t , out_PREDICT_BRANCH_STATE [i]->read(), request [context].front()._branch_state ); 1558 1577 if (_param->_have_port_branch_update_prediction_id) -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Decod_unit/Decod/include/Decod.h
r82 r86 140 140 private : decod_param_t ** _decod_param ; //[nb_context] 141 141 private : function_decod_t **** _function_decod ; //[nb_context][type][opcod] 142 private : function_decod_t **** _function_custom ; //[nb_context][type][opcod] 142 143 private : std::list<select_t> select; 143 144 #endif -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Decod_unit/Decod/include/Parameters.h
r82 r86 40 40 public : uint32_t _max_nb_inst_fetch ; 41 41 42 public : uint32_t _size_address_inst ; 42 43 public : uint32_t _size_context_id ; 43 44 public : uint32_t _size_depth ; -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Decod_unit/Decod/src/Decod_allocation.cpp
r81 r86 69 69 70 70 ALLOC1_SIGNAL_IN (in_IFETCH_CONTEXT_ID ,"context_id" ,Tcontext_t ,_param->_size_context_id ); 71 ALLOC1_SIGNAL_IN (in_IFETCH_ADDRESS ,"address" ,Tgeneral_address_t ,_param->_size_ general_data);72 // ALLOC1_SIGNAL_IN (in_IFETCH_ADDRESS_NEXT ,"address_next" ,Tgeneral_address_t ,_param->_size_ general_data);71 ALLOC1_SIGNAL_IN (in_IFETCH_ADDRESS ,"address" ,Tgeneral_address_t ,_param->_size_address_inst ); 72 // ALLOC1_SIGNAL_IN (in_IFETCH_ADDRESS_NEXT ,"address_next" ,Tgeneral_address_t ,_param->_size_address_inst ); 73 73 ALLOC1_SIGNAL_IN (in_IFETCH_INST_IFETCH_PTR ,"inst_ifetch_ptr" ,Tinst_ifetch_ptr_t ,_param->_size_inst_ifetch_ptr ); 74 74 ALLOC1_SIGNAL_IN (in_IFETCH_BRANCH_STATE ,"branch_state" ,Tbranch_state_t ,_param->_size_branch_state ); … … 87 87 ALLOC1_SIGNAL_OUT(out_DECOD_OPERATION ,"operation" ,Toperation_t ,_param->_size_operation ); 88 88 ALLOC1_SIGNAL_OUT(out_DECOD_IS_DELAY_SLOT,"is_delay_slot",Tcontrol_t ,1 ); 89 ALLOC1_SIGNAL_OUT(out_DECOD_ADDRESS ,"address" ,Tgeneral_data_t ,_param->_size_ general_data);89 ALLOC1_SIGNAL_OUT(out_DECOD_ADDRESS ,"address" ,Tgeneral_data_t ,_param->_size_address_inst ); 90 90 ALLOC1_SIGNAL_OUT(out_DECOD_HAS_IMMEDIAT ,"has_immediat" ,Tcontrol_t ,1 ); 91 91 ALLOC1_SIGNAL_OUT(out_DECOD_IMMEDIAT ,"immediat" ,Tgeneral_data_t ,_param->_size_general_data ); … … 116 116 // ALLOC1_SIGNAL_OUT(out_PREDICT_BRANCH_STACK_WRITE ,"branch_stack_write" ,Tcontrol_t ,1 ); 117 117 ALLOC1_SIGNAL_OUT(out_PREDICT_BRANCH_DIRECTION ,"branch_direction" ,Tcontrol_t ,1 ); 118 ALLOC1_SIGNAL_OUT(out_PREDICT_ADDRESS_SRC ,"address_src" ,Tgeneral_data_t ,_param->_size_ general_data);119 ALLOC1_SIGNAL_OUT(out_PREDICT_ADDRESS_DEST ,"address_dest" ,Tgeneral_data_t ,_param->_size_ general_data);118 ALLOC1_SIGNAL_OUT(out_PREDICT_ADDRESS_SRC ,"address_src" ,Tgeneral_data_t ,_param->_size_address_inst ); 119 ALLOC1_SIGNAL_OUT(out_PREDICT_ADDRESS_DEST ,"address_dest" ,Tgeneral_data_t ,_param->_size_address_inst ); 120 120 // ALLOC1_SIGNAL_IN ( in_PREDICT_CAN_CONTINUE ,"can_continue" ,Tcontrol_t ,1 ); 121 121 } … … 138 138 ALLOC_SIGNAL_OUT(out_CONTEXT_EVENT_TYPE ,"type" ,Tevent_type_t ,_param->_size_event_type ); 139 139 ALLOC_SIGNAL_OUT(out_CONTEXT_EVENT_IS_DELAY_SLOT,"is_delay_slot",Tcontrol_t ,1 ); 140 ALLOC_SIGNAL_OUT(out_CONTEXT_EVENT_ADDRESS ,"address" ,Tgeneral_data_t,_param->_size_ general_data);141 ALLOC_SIGNAL_OUT(out_CONTEXT_EVENT_ADDRESS_EPCR ,"address_epcr" ,Tgeneral_data_t,_param->_size_ general_data);140 ALLOC_SIGNAL_OUT(out_CONTEXT_EVENT_ADDRESS ,"address" ,Tgeneral_data_t,_param->_size_address_inst); 141 ALLOC_SIGNAL_OUT(out_CONTEXT_EVENT_ADDRESS_EPCR ,"address_epcr" ,Tgeneral_data_t,_param->_size_address_inst); 142 142 } 143 143 … … 167 167 MAX_OPCOD_13}; 168 168 169 _function_decod = new function_decod_t *** [_param->_nb_context]; 169 _function_decod = new function_decod_t *** [_param->_nb_context]; 170 _function_custom = new function_decod_t *** [_param->_nb_context]; 170 171 for (uint32_t i=0; i<_param->_nb_context; i++) 171 172 { 172 _function_decod [i] = new function_decod_t ** [nb_opcod_type]; 173 _function_decod [i] = new function_decod_t ** [nb_opcod_type]; 174 _function_custom [i] = new function_decod_t ** [nb_opcod_type]; 173 175 for (uint32_t j=0; j<nb_opcod_type; j++) 174 176 { 175 _function_decod [i][j] = new function_decod_t * [tab_opcod_type[j]]; 177 _function_decod [i][j] = new function_decod_t * [tab_opcod_type[j]]; 178 _function_custom [i][j] = new function_decod_t * [tab_opcod_type[j]]; 176 179 for (uint32_t k=0; k<tab_opcod_type[j]; k++) 177 180 { 178 _function_decod [i][j][k] = &(instruction_illegal); 181 _function_decod [i][j][k] = &(instruction_illegal); 182 _function_custom [i][j][k] = &(instruction_illegal); 179 183 } 180 184 } … … 194 198 _function_decod[i][3][OPCOD_12] = &(instruction_decod_type_12); // Instructions extend 195 199 _function_decod[i][3][OPCOD_13] = &(instruction_decod_type_13); // Instructions extend (64b) 196 197 200 198 201 if (_param->_instruction_implemeted[i][INSTRUCTION_L_ADD ]) _function_decod[i][ 3][OPCOD_L_ADD ] = &(instruction_l_add ); … … 396 399 // if (_param->_instruction_implemeted[i][INSTRUCTION_LV_XOR ]) _function_decod[i][ 2][OPCOD_LV_XOR ] = &(instruction_lv_xor ); 397 400 398 // Custom Instrucion 399 400 if (_param->_instruction_implemeted[i][INSTRUCTION_L_CUST1 ]) _function_decod[i][ 0][OPCOD_L_CUST1 ] = _param->_get_custom_information(i)._get_custom_decod(OPERATION_CUSTOM_L_1 ); 401 if (_param->_instruction_implemeted[i][INSTRUCTION_L_CUST2 ]) _function_decod[i][ 0][OPCOD_L_CUST2 ] = _param->_get_custom_information(i)._get_custom_decod(OPERATION_CUSTOM_L_2 ); 402 if (_param->_instruction_implemeted[i][INSTRUCTION_L_CUST3 ]) _function_decod[i][ 0][OPCOD_L_CUST3 ] = _param->_get_custom_information(i)._get_custom_decod(OPERATION_CUSTOM_L_3 ); 403 if (_param->_instruction_implemeted[i][INSTRUCTION_L_CUST4 ]) _function_decod[i][ 0][OPCOD_L_CUST4 ] = _param->_get_custom_information(i)._get_custom_decod(OPERATION_CUSTOM_L_4 ); 404 if (_param->_instruction_implemeted[i][INSTRUCTION_L_CUST5 ]) _function_decod[i][ 0][OPCOD_L_CUST5 ] = _param->_get_custom_information(i)._get_custom_decod(OPERATION_CUSTOM_L_5 ); 405 if (_param->_instruction_implemeted[i][INSTRUCTION_L_CUST6 ]) _function_decod[i][ 0][OPCOD_L_CUST6 ] = _param->_get_custom_information(i)._get_custom_decod(OPERATION_CUSTOM_L_6 ); 406 if (_param->_instruction_implemeted[i][INSTRUCTION_L_CUST7 ]) _function_decod[i][ 0][OPCOD_L_CUST7 ] = _param->_get_custom_information(i)._get_custom_decod(OPERATION_CUSTOM_L_7 ); 407 if (_param->_instruction_implemeted[i][INSTRUCTION_L_CUST8 ]) _function_decod[i][ 0][OPCOD_L_CUST8 ] = _param->_get_custom_information(i)._get_custom_decod(OPERATION_CUSTOM_L_8 ); 408 // if (_param->_instruction_implemeted[i][INSTRUCTION_LF_CUST1_D ]) _function_decod[i][ 1][OPCOD_LF_CUST1_D ] = _param->_get_custom_information(i)._get_custom_decod(OPERATION_CUSTOM_LF_1_D); 409 // if (_param->_instruction_implemeted[i][INSTRUCTION_LF_CUST1_S ]) _function_decod[i][ 1][OPCOD_LF_CUST1_S ] = _param->_get_custom_information(i)._get_custom_decod(OPERATION_CUSTOM_LF_1_S); 410 // if (_param->_instruction_implemeted[i][INSTRUCTION_LV_CUST1 ]) _function_decod[i][ 2][OPCOD_LV_CUST1 ] = _param->_get_custom_information(i)._get_custom_decod(OPERATION_CUSTOM_LV_1 ); 411 // if (_param->_instruction_implemeted[i][INSTRUCTION_LV_CUST2 ]) _function_decod[i][ 2][OPCOD_LV_CUST2 ] = _param->_get_custom_information(i)._get_custom_decod(OPERATION_CUSTOM_LV_2 ); 412 // if (_param->_instruction_implemeted[i][INSTRUCTION_LV_CUST3 ]) _function_decod[i][ 2][OPCOD_LV_CUST3 ] = _param->_get_custom_information(i)._get_custom_decod(OPERATION_CUSTOM_LV_3 ); 413 // if (_param->_instruction_implemeted[i][INSTRUCTION_LV_CUST4 ]) _function_decod[i][ 2][OPCOD_LV_CUST4 ] = _param->_get_custom_information(i)._get_custom_decod(OPERATION_CUSTOM_LV_4 ); 401 // Custom Instruction 402 if (_param->_instruction_implemeted[i][INSTRUCTION_L_CUST1 ]) _function_decod [i][ 0][OPCOD_L_CUST1 ] = &(instruction_l_custom ); 403 if (_param->_instruction_implemeted[i][INSTRUCTION_L_CUST2 ]) _function_decod [i][ 0][OPCOD_L_CUST2 ] = &(instruction_l_custom ); 404 if (_param->_instruction_implemeted[i][INSTRUCTION_L_CUST3 ]) _function_decod [i][ 0][OPCOD_L_CUST3 ] = &(instruction_l_custom ); 405 if (_param->_instruction_implemeted[i][INSTRUCTION_L_CUST4 ]) _function_decod [i][ 0][OPCOD_L_CUST4 ] = &(instruction_l_custom ); 406 if (_param->_instruction_implemeted[i][INSTRUCTION_L_CUST5 ]) _function_decod [i][ 0][OPCOD_L_CUST5 ] = &(instruction_l_custom ); 407 if (_param->_instruction_implemeted[i][INSTRUCTION_L_CUST6 ]) _function_decod [i][ 0][OPCOD_L_CUST6 ] = &(instruction_l_custom ); 408 if (_param->_instruction_implemeted[i][INSTRUCTION_L_CUST7 ]) _function_decod [i][ 0][OPCOD_L_CUST7 ] = &(instruction_l_custom ); 409 if (_param->_instruction_implemeted[i][INSTRUCTION_L_CUST8 ]) _function_decod [i][ 0][OPCOD_L_CUST8 ] = &(instruction_l_custom ); 410 // if (_param->_instruction_implemeted[i][INSTRUCTION_LF_CUST1_D ]) _function_decod [i][ 1][OPCOD_LF_CUST1_D ] = &(instruction_lf_custom); 411 // if (_param->_instruction_implemeted[i][INSTRUCTION_LF_CUST1_S ]) _function_decod [i][ 1][OPCOD_LF_CUST1_S ] = &(instruction_lf_custom); 412 // if (_param->_instruction_implemeted[i][INSTRUCTION_LV_CUST1 ]) _function_decod [i][ 2][OPCOD_LV_CUST1 ] = &(instruction_lv_custom); 413 // if (_param->_instruction_implemeted[i][INSTRUCTION_LV_CUST2 ]) _function_decod [i][ 2][OPCOD_LV_CUST2 ] = &(instruction_lv_custom); 414 // if (_param->_instruction_implemeted[i][INSTRUCTION_LV_CUST3 ]) _function_decod [i][ 2][OPCOD_LV_CUST3 ] = &(instruction_lv_custom); 415 // if (_param->_instruction_implemeted[i][INSTRUCTION_LV_CUST4 ]) _function_decod [i][ 2][OPCOD_LV_CUST4 ] = &(instruction_lv_custom); 416 417 if (_param->_instruction_implemeted[i][INSTRUCTION_L_CUST1 ]) _function_custom[i][ 0][OPCOD_L_CUST1 ] = _param->_get_custom_information(i)._get_custom_decod(OPERATION_CUSTOM_L_1 ); 418 if (_param->_instruction_implemeted[i][INSTRUCTION_L_CUST2 ]) _function_custom[i][ 0][OPCOD_L_CUST2 ] = _param->_get_custom_information(i)._get_custom_decod(OPERATION_CUSTOM_L_2 ); 419 if (_param->_instruction_implemeted[i][INSTRUCTION_L_CUST3 ]) _function_custom[i][ 0][OPCOD_L_CUST3 ] = _param->_get_custom_information(i)._get_custom_decod(OPERATION_CUSTOM_L_3 ); 420 if (_param->_instruction_implemeted[i][INSTRUCTION_L_CUST4 ]) _function_custom[i][ 0][OPCOD_L_CUST4 ] = _param->_get_custom_information(i)._get_custom_decod(OPERATION_CUSTOM_L_4 ); 421 if (_param->_instruction_implemeted[i][INSTRUCTION_L_CUST5 ]) _function_custom[i][ 0][OPCOD_L_CUST5 ] = _param->_get_custom_information(i)._get_custom_decod(OPERATION_CUSTOM_L_5 ); 422 if (_param->_instruction_implemeted[i][INSTRUCTION_L_CUST6 ]) _function_custom[i][ 0][OPCOD_L_CUST6 ] = _param->_get_custom_information(i)._get_custom_decod(OPERATION_CUSTOM_L_6 ); 423 if (_param->_instruction_implemeted[i][INSTRUCTION_L_CUST7 ]) _function_custom[i][ 0][OPCOD_L_CUST7 ] = _param->_get_custom_information(i)._get_custom_decod(OPERATION_CUSTOM_L_7 ); 424 if (_param->_instruction_implemeted[i][INSTRUCTION_L_CUST8 ]) _function_custom[i][ 0][OPCOD_L_CUST8 ] = _param->_get_custom_information(i)._get_custom_decod(OPERATION_CUSTOM_L_8 ); 425 // if (_param->_instruction_implemeted[i][INSTRUCTION_LF_CUST1_D ]) _function_custom[i][ 1][OPCOD_LF_CUST1_D ] = _param->_get_custom_information(i)._get_custom_decod(OPERATION_CUSTOM_LF_1_D); 426 // if (_param->_instruction_implemeted[i][INSTRUCTION_LF_CUST1_S ]) _function_custom[i][ 1][OPCOD_LF_CUST1_S ] = _param->_get_custom_information(i)._get_custom_decod(OPERATION_CUSTOM_LF_1_S); 427 // if (_param->_instruction_implemeted[i][INSTRUCTION_LV_CUST1 ]) _function_custom[i][ 2][OPCOD_LV_CUST1 ] = _param->_get_custom_information(i)._get_custom_decod(OPERATION_CUSTOM_LV_1 ); 428 // if (_param->_instruction_implemeted[i][INSTRUCTION_LV_CUST2 ]) _function_custom[i][ 2][OPCOD_LV_CUST2 ] = _param->_get_custom_information(i)._get_custom_decod(OPERATION_CUSTOM_LV_2 ); 429 // if (_param->_instruction_implemeted[i][INSTRUCTION_LV_CUST3 ]) _function_custom[i][ 2][OPCOD_LV_CUST3 ] = _param->_get_custom_information(i)._get_custom_decod(OPERATION_CUSTOM_LV_3 ); 430 // if (_param->_instruction_implemeted[i][INSTRUCTION_LV_CUST4 ]) _function_custom[i][ 2][OPCOD_LV_CUST4 ] = _param->_get_custom_information(i)._get_custom_decod(OPERATION_CUSTOM_LV_4 ); 414 431 } 415 432 … … 419 436 for (uint32_t i=0; i<_param->_nb_context; i++) 420 437 _decod_param [i] = new decod_param_t (_param->_size_general_data, 421 _function_decod[i]); 438 _function_decod [i], 439 _function_custom[i]); 422 440 423 441 #ifdef POSITION -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Decod_unit/Decod/src/Decod_deallocation.cpp
r81 r86 102 102 delete internal_CONTEXT_IS_DELAY_SLOT ; 103 103 104 delete [] _function_decod ; 104 const uint32_t nb_opcod_type = 14; 105 106 for (uint32_t i=0; i<_param->_nb_context; i++) 107 { 108 for (uint32_t j=0; j<nb_opcod_type; j++) 109 { 110 delete [] _function_decod [i][j]; 111 delete [] _function_custom [i][j]; 112 } 113 delete [] _function_decod [i]; 114 delete [] _function_custom [i]; 115 } 116 delete [] _function_decod ; 117 delete [] _function_custom; 105 118 delete _decod_instruction; 106 119 delete _decod_param ; -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Decod_unit/Decod/src/Decod_genMealy.cpp
r81 r86 27 27 // Initialization 28 28 //----------------------------------- 29 Tcontrol_t context_event_val ;29 Tcontrol_t context_event_val = false; 30 30 Tcontrol_t ifetch_ack [_param->_nb_context][_param->_max_nb_inst_fetch]; 31 31 for (uint32_t i=0; i<_param->_nb_context; i++) … … 79 79 ifetch_ack [x][y] = PORT_READ(in_DECOD_ACK [i]); // fetch_val and decod_enable and decod_ack 80 80 81 Tgeneral_data_t addr = PORT_READ(in_IFETCH_ADDRESS [x])+ 4*y;81 Tgeneral_data_t addr = PORT_READ(in_IFETCH_ADDRESS [x])+y; 82 82 83 83 _decod_instruction->_instruction = PORT_READ(in_IFETCH_INSTRUCTION [x][y]); … … 85 85 _decod_instruction->_address_previous = internal_CONTEXT_ADDRESS_PREVIOUS [x]; 86 86 _decod_instruction->_address = addr; //Compute the current address 87 _decod_instruction->_address_next = addr+ 4;87 _decod_instruction->_address_next = addr+1; 88 88 _decod_instruction->_is_delay_slot = internal_CONTEXT_IS_DELAY_SLOT [x]; 89 89 … … 94 94 log_printf(TRACE,Decod,FUNCTION," * address : %.8x",addr); 95 95 log_printf(TRACE,Decod,FUNCTION," * is_delay_slot : %d",internal_CONTEXT_IS_DELAY_SLOT [x]); 96 96 97 instruction_decod (_decod_instruction, _decod_param[x]); 97 98 -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Decod_unit/Decod/src/Parameters.cpp
r81 r86 53 53 _max_nb_inst_fetch = max<uint32_t>(nb_inst_fetch,nb_context); 54 54 55 _size_address_inst = size_address-2; 55 56 _size_context_id = log2(nb_context ); 56 57 _size_depth = log2(nb_branch_speculated); -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Custom/include/Encryption.h
r81 r86 45 45 morpheo::behavioural::core::multi_execute_loop::execute_loop::multi_execute_unit::execute_unit::functionnal_unit::execute_register_t * reg, 46 46 morpheo::behavioural::core::multi_execute_loop::execute_loop::multi_execute_unit::execute_unit::functionnal_unit::execute_param_t * param); 47 48 private : static void decod_encrypt (morpheo::behavioural::core::multi_front_end::front_end::decod_unit::decod::decod_instruction_t * inst, 49 morpheo::behavioural::core::multi_front_end::front_end::decod_unit::decod::decod_param_t * param); 50 private : static void decod_decrypt (morpheo::behavioural::core::multi_front_end::front_end::decod_unit::decod::decod_instruction_t * inst, 51 morpheo::behavioural::core::multi_front_end::front_end::decod_unit::decod::decod_param_t * param); 47 52 }; 48 53 -
trunk/IPs/systemC/processor/Morpheo/Behavioural/Custom/src/Encryption.cpp
r81 r86 37 37 custom_decod_t * Encryption::get_custom_decod (Toperation_t operation) 38 38 { 39 // TODO !!!!! 40 return NULL; 39 if (operation == _operation_encrypt) 40 return &(morpheo::behavioural::custom::encryption::Encryption::decod_encrypt); 41 if (operation == _operation_decrypt) 42 return &(morpheo::behavioural::custom::encryption::Encryption::decod_decrypt); 43 44 return &(morpheo::behavioural::core::multi_front_end::front_end::decod_unit::decod::instruction_illegal); // unimplemented function 41 45 } 42 46 … … 82 86 83 87 // Result 84 85 88 op->_timing = morpheo::behavioural::core::multi_execute_loop::execute_loop::multi_execute_unit::execute_unit::functionnal_unit::execute_timing_t(rool, rool); 86 89 op->_data_rd = data; … … 118 121 }; 119 122 123 void Encryption::decod_encrypt (morpheo::behavioural::core::multi_front_end::front_end::decod_unit::decod::decod_instruction_t * inst, 124 morpheo::behavioural::core::multi_front_end::front_end::decod_unit::decod::decod_param_t * param) 125 { 126 log_printf(TRACE,Decod,"decod_encrypt"," * instruction : encrypt"); 127 128 inst->_has_immediat = 0; 129 // inst->_immediat = ; 130 inst->_read_ra = 1; 131 inst->_num_reg_ra = range<Tgeneral_address_t>(inst->_instruction,20,16); 132 inst->_read_rb = 0; 133 // inst->_num_reg_rb = ; 134 inst->_read_rc = 0; 135 // inst->_num_reg_rc = ; 136 inst->_write_rd = 1; 137 inst->_num_reg_rd = range<Tgeneral_address_t>(inst->_instruction,25,21); 138 inst->_write_re = 0; 139 // inst->_num_reg_re = ; 140 inst->_exception_use = EXCEPTION_USE_NONE; 141 inst->_event_type = EVENT_TYPE_NONE; 142 } 143 144 void Encryption::decod_decrypt (morpheo::behavioural::core::multi_front_end::front_end::decod_unit::decod::decod_instruction_t * inst, 145 morpheo::behavioural::core::multi_front_end::front_end::decod_unit::decod::decod_param_t * param) 146 { 147 log_printf(TRACE,Decod,"decod_decrypt"," * instruction : decrypt"); 148 149 inst->_has_immediat = 0; 150 // inst->_immediat = ; 151 inst->_read_ra = 1; 152 inst->_num_reg_ra = range<Tgeneral_address_t>(inst->_instruction,20,16); 153 inst->_read_rb = 0; 154 // inst->_num_reg_rb = ; 155 inst->_read_rc = 0; 156 // inst->_num_reg_rc = ; 157 inst->_write_rd = 1; 158 inst->_num_reg_rd = range<Tgeneral_address_t>(inst->_instruction,25,21); 159 inst->_write_re = 0; 160 // inst->_num_reg_re = ; 161 inst->_exception_use = EXCEPTION_USE_NONE; 162 inst->_event_type = EVENT_TYPE_NONE; 163 } 164 120 165 }; // end namespace encryption 121 166 }; // end namespace custom -
trunk/IPs/systemC/processor/Morpheo/Behavioural/include/Debug_component.h
r85 r86 42 42 # define DEBUG_Front_end false 43 43 # define DEBUG_Context_State false 44 # define DEBUG_Decod_unit false45 # define DEBUG_Decod false46 # define DEBUG_Decod_queue false47 # define DEBUG_Ifetch_unit true48 # define DEBUG_Address_management true49 # define DEBUG_Ifetch_queue true50 # define DEBUG_Ifetch_unit_Glue true44 # define DEBUG_Decod_unit true 45 # define DEBUG_Decod true 46 # define DEBUG_Decod_queue true 47 # define DEBUG_Ifetch_unit false 48 # define DEBUG_Address_management false 49 # define DEBUG_Ifetch_queue false 50 # define DEBUG_Ifetch_unit_Glue false 51 51 # define DEBUG_Prediction_unit false 52 52 # define DEBUG_Branch_Target_Buffer false -
trunk/IPs/systemC/processor/Morpheo/Behavioural/include/Version.h
r85 r86 10 10 #define MORPHEO_MAJOR_VERSION 0 11 11 #define MORPHEO_MINOR_VERSION 2 12 #define MORPHEO_REVISION 8 512 #define MORPHEO_REVISION 86 13 13 14 14 #define MORPHEO_VERSION morpheo::toString(MORPHEO_MAJOR_VERSION)+"."+morpheo::toString(MORPHEO_MINOR_VERSION)+"."+morpheo::toString(MORPHEO_REVISION)
Note: See TracChangeset
for help on using the changeset viewer.