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/src/Decod_allocation.cpp

    r81 r86  
    6969     
    7070      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            );
    7373      ALLOC1_SIGNAL_IN (in_IFETCH_INST_IFETCH_PTR            ,"inst_ifetch_ptr"            ,Tinst_ifetch_ptr_t ,_param->_size_inst_ifetch_ptr         );
    7474      ALLOC1_SIGNAL_IN (in_IFETCH_BRANCH_STATE               ,"branch_state"               ,Tbranch_state_t    ,_param->_size_branch_state            );
     
    8787      ALLOC1_SIGNAL_OUT(out_DECOD_OPERATION    ,"operation"    ,Toperation_t      ,_param->_size_operation             );
    8888      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          );
    9090      ALLOC1_SIGNAL_OUT(out_DECOD_HAS_IMMEDIAT ,"has_immediat" ,Tcontrol_t        ,1                                   );
    9191      ALLOC1_SIGNAL_OUT(out_DECOD_IMMEDIAT     ,"immediat"     ,Tgeneral_data_t   ,_param->_size_general_data          );
     
    116116//    ALLOC1_SIGNAL_OUT(out_PREDICT_BRANCH_STACK_WRITE         ,"branch_stack_write"         ,Tcontrol_t         ,1                                     );
    117117      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            );
    120120//    ALLOC1_SIGNAL_IN ( in_PREDICT_CAN_CONTINUE               ,"can_continue"               ,Tcontrol_t         ,1                                     );
    121121    }
     
    138138      ALLOC_SIGNAL_OUT(out_CONTEXT_EVENT_TYPE         ,"type"         ,Tevent_type_t  ,_param->_size_event_type  );
    139139      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);
    142142    }
    143143
     
    167167                                        MAX_OPCOD_13};
    168168   
    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];
    170171    for (uint32_t i=0; i<_param->_nb_context; i++)
    171172      {
    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];
    173175        for (uint32_t j=0; j<nb_opcod_type; j++)
    174176          {
    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]];
    176179            for (uint32_t k=0; k<tab_opcod_type[j]; k++)
    177180              {
    178                 _function_decod [i][j][k] = &(instruction_illegal);
     181                _function_decod  [i][j][k] = &(instruction_illegal);
     182                _function_custom [i][j][k] = &(instruction_illegal);
    179183              }
    180184          }
     
    194198        _function_decod[i][3][OPCOD_12] = &(instruction_decod_type_12); // Instructions extend                   
    195199        _function_decod[i][3][OPCOD_13] = &(instruction_decod_type_13); // Instructions extend (64b)             
    196 
    197200
    198201        if (_param->_instruction_implemeted[i][INSTRUCTION_L_ADD      ]) _function_decod[i][ 3][OPCOD_L_ADD      ] = &(instruction_l_add       );
     
    396399//      if (_param->_instruction_implemeted[i][INSTRUCTION_LV_XOR     ]) _function_decod[i][ 2][OPCOD_LV_XOR     ] = &(instruction_lv_xor      );
    397400
    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  );
    414431      }
    415432
     
    419436    for (uint32_t i=0; i<_param->_nb_context; i++)
    420437      _decod_param [i] = new decod_param_t (_param->_size_general_data,
    421                                             _function_decod[i]);
     438                                            _function_decod [i],
     439                                            _function_custom[i]);
    422440
    423441#ifdef POSITION
Note: See TracChangeset for help on using the changeset viewer.