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/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
Note: See TracChangeset for help on using the changeset viewer.