Changeset 86 for trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Decod_unit/Decod/SelfTest/src/test.cpp
- Timestamp:
- May 14, 2008, 7:08:56 PM (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
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)
Note: See TracChangeset
for help on using the changeset viewer.