Changeset 86 for trunk/IPs


Ignore:
Timestamp:
May 14, 2008, 7:08:56 PM (17 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)
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  
    3737
    3838  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);
    3944 
    4045  // ORBIS
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Decod_unit/Decod/Instruction/include/Types.h

    r81 r86  
    6363  public : Tgeneral_data_t    _mask_data ;
    6464  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]
    6667 
    6768  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 *))
    6971    {
    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;
    7477    };
    7578  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  
    1313
    1414#include "Behavioural/Core/Multi_Front_end/Front_end/Decod_unit/Decod/Instruction/include/Instruction.h"
     15#include "Behavioural/include/Constants.h"
    1516
    1617namespace morpheo {
     
    130131
    131132    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      }
    132248  }
    133249 
     
    706822    inst->_operation          = OPERATION_BRANCH_L_JALR;
    707823    inst->_has_immediat       = 1;
    708     inst->_immediat           = inst->_address_next+4;
     824    inst->_immediat           = inst->_address_next+1;
    709825    inst->_read_ra            = 0;
    710826//  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  
    77
    88#include "Behavioural/Core/Multi_Front_end/Front_end/Decod_unit/Decod/SelfTest/include/test.h"
     9#include "Behavioural/Custom/include/Custom_example.h"
    910
    1011#define NB_PARAMS 8
     
    7980         _load_balancing               ,
    8081         _instruction_implemeted       ,
    81          NULL);
     82         &(morpheo::behavioural::custom::example_get_custom_information)
     83);
    8284     
    8385      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  
    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)
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Decod_unit/Decod/include/Decod.h

    r82 r86  
    140140  private   : decod_param_t                ** _decod_param      ; //[nb_context]
    141141  private   : function_decod_t           **** _function_decod   ; //[nb_context][type][opcod]
     142  private   : function_decod_t           **** _function_custom  ; //[nb_context][type][opcod]
    142143  private   : std::list<select_t>             select;
    143144#endif
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Decod_unit/Decod/include/Parameters.h

    r82 r86  
    4040  public : uint32_t            _max_nb_inst_fetch     ;
    4141
     42  public : uint32_t            _size_address_inst     ;
    4243  public : uint32_t            _size_context_id       ;
    4344  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  
    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
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Decod_unit/Decod/src/Decod_deallocation.cpp

    r81 r86  
    102102    delete    internal_CONTEXT_IS_DELAY_SLOT    ;
    103103
    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;
    105118    delete    _decod_instruction;
    106119    delete    _decod_param      ;
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Decod_unit/Decod/src/Decod_genMealy.cpp

    r81 r86  
    2727    // Initialization
    2828    //-----------------------------------
    29     Tcontrol_t context_event_val;
     29    Tcontrol_t context_event_val = false;
    3030    Tcontrol_t ifetch_ack [_param->_nb_context][_param->_max_nb_inst_fetch];
    3131    for (uint32_t i=0; i<_param->_nb_context; i++)
     
    7979                ifetch_ack [x][y] = PORT_READ(in_DECOD_ACK [i]); // fetch_val and decod_enable and decod_ack
    8080
    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;
    8282
    8383                _decod_instruction->_instruction      = PORT_READ(in_IFETCH_INSTRUCTION [x][y]);
     
    8585                _decod_instruction->_address_previous = internal_CONTEXT_ADDRESS_PREVIOUS [x];
    8686                _decod_instruction->_address          = addr; //Compute the current address
    87                 _decod_instruction->_address_next     = addr+4;
     87                _decod_instruction->_address_next     = addr+1;
    8888                _decod_instruction->_is_delay_slot    = internal_CONTEXT_IS_DELAY_SLOT [x];
    8989
     
    9494                log_printf(TRACE,Decod,FUNCTION,"  * address       : %.8x",addr);
    9595                log_printf(TRACE,Decod,FUNCTION,"  * is_delay_slot : %d",internal_CONTEXT_IS_DELAY_SLOT [x]);
     96
    9697                instruction_decod (_decod_instruction, _decod_param[x]);
    9798
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Decod_unit/Decod/src/Parameters.cpp

    r81 r86  
    5353    _max_nb_inst_fetch                     = max<uint32_t>(nb_inst_fetch,nb_context);
    5454
     55    _size_address_inst                     = size_address-2;
    5556    _size_context_id                       = log2(nb_context          );
    5657    _size_depth                            = log2(nb_branch_speculated);
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Custom/include/Encryption.h

    r81 r86  
    4545                                          morpheo::behavioural::core::multi_execute_loop::execute_loop::multi_execute_unit::execute_unit::functionnal_unit::execute_register_t  * reg,
    4646                                          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);
    4752  };
    4853 
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Custom/src/Encryption.cpp

    r81 r86  
    3737  custom_decod_t * Encryption::get_custom_decod (Toperation_t operation)
    3838  {
    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
    4145  }
    4246
     
    8286   
    8387    // Result
    84    
    8588    op->_timing       = morpheo::behavioural::core::multi_execute_loop::execute_loop::multi_execute_unit::execute_unit::functionnal_unit::execute_timing_t(rool, rool);
    8689    op->_data_rd      = data;
     
    118121  };
    119122
     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
    120165}; // end namespace encryption
    121166}; // end namespace custom
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/include/Debug_component.h

    r85 r86  
    4242#  define       DEBUG_Front_end                                     false
    4343#  define         DEBUG_Context_State                               false
    44 #  define         DEBUG_Decod_unit                                  false
    45 #  define           DEBUG_Decod                                     false
    46 #  define           DEBUG_Decod_queue                               false
    47 #  define         DEBUG_Ifetch_unit                                 true
    48 #  define           DEBUG_Address_management                        true
    49 #  define           DEBUG_Ifetch_queue                              true
    50 #  define           DEBUG_Ifetch_unit_Glue                          true
     44#  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
    5151#  define         DEBUG_Prediction_unit                             false
    5252#  define           DEBUG_Branch_Target_Buffer                      false
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/include/Version.h

    r85 r86  
    1010#define MORPHEO_MAJOR_VERSION 0
    1111#define MORPHEO_MINOR_VERSION 2
    12 #define MORPHEO_REVISION      85
     12#define MORPHEO_REVISION      86
    1313
    1414#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.