Ignore:
Timestamp:
May 14, 2008, 7:08:56 PM (16 years ago)
Author:
rosiere
Message:

Decod :

  • Correct selftest
  • Set Instruction address on (32/64)-2 bits,
  • Decod Custom Instruction : valid and tested. (add an test to verify the decod information)
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  
    1717  class entry_t
    1818  {
    19 //   public : Tcontrol_t          _val                        ;
     19//public : Tcontrol_t          _val                        ;
    2020  public : Tinstruction_t      _instruction                ;
    21 //   public : Tcontext_t          _context_id                 ;
     21//public : Tcontext_t          _context_id                 ;
    2222  public : Tgeneral_address_t  _address_previous           ;
    2323  public : Tgeneral_address_t  _address                    ;
     
    2626  public : Tprediction_ptr_t   _branch_update_prediction_id;
    2727  public : Tbranch_condition_t _branch_condition           ;
    28 //   public : Tcontrol_t          _branch_stack_write         ;
     28//public : Tcontrol_t          _branch_stack_write         ;
    2929  public : Tcontrol_t          _branch_direction           ;
    3030  public : Tgeneral_address_t  _branch_address_dest        ;
     
    299299
    300300      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;
    304304
    305305      uint32_t delay_slot_previous [_param->_nb_context];
     
    307307      uint32_t delay_slot_next     [_param->_nb_context];
    308308
    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);
    311311
    312312      // ===== l.add    r15, r4 , r8
     
    615615      BRANCH_STATE_NONE,0,BRANCH_CONDITION_NONE_WITH_WRITE_STACK,1, w,
    616616      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                 ,
    618618      EXCEPTION_USE_NONE ,EVENT_TYPE_NONE));
    619619      JMP(w);
     
    643643      BRANCH_STATE_NONE,0,BRANCH_CONDITION_NONE_WITH_WRITE_STACK,1, w,
    644644      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                 ,
    646646      EXCEPTION_USE_NONE ,EVENT_TYPE_NONE));
    647647      JMP(w);
     
    14181418      TYPE_TEST,OPERATION_TEST_L_SFLTU,false,
    14191419      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,
    14201438      EXCEPTION_USE_NONE,EVENT_TYPE_NONE));
    14211439      SEQ;
     
    14511469                  if (it!=request [i].end())
    14521470                    {
    1453                       uint32_t lsb = (it->_address>>2)%_param->_nb_inst_fetch[i];
     1471                      uint32_t lsb = it->_address%_param->_nb_inst_fetch[i];
    14541472                     
    1455                       in_IFETCH_ADDRESS         [i]->write(it->_address-(lsb<<2));
     1473                      in_IFETCH_ADDRESS         [i]->write(it->_address-lsb);
    14561474                      in_IFETCH_BRANCH_STATE    [i]->write(BRANCH_STATE_NONE);
    14571475                      if (_param->_have_port_inst_ifetch_ptr)
     
    15151533                LABEL("DECOD       [%d]    : transaction",i  );
    15161534                LABEL(" * context         : %d",context);
     1535                LABEL(" * instruction     : 0x%x",request [context].front()._instruction);
    15171536
    15181537                if (_param->_have_port_depth)
     
    15541573                    if (_param->_have_port_context_id)
    15551574                    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);
    15571576                    TEST(Tbranch_state_t    , out_PREDICT_BRANCH_STATE                [i]->read(), request [context].front()._branch_state               );
    15581577                    if (_param->_have_port_branch_update_prediction_id)
Note: See TracChangeset for help on using the changeset viewer.