Ignore:
Timestamp:
Dec 31, 2008, 11:18:08 AM (15 years ago)
Author:
rosiere
Message:

1) Fix bug (read unit, RAT -> write in R0, SPR desallocation ...)
2) Change VHDL Execute_queue -> use Generic/Queue?
3) Complete document on VHDL generation
4) Add soc test

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_OOO_Engine/OOO_Engine/Special_Register_unit/src/Special_Register_unit_genMealy_spr_access.cpp

    r88 r98  
    2222  {
    2323    log_begin(Special_Register_unit,FUNCTION);
    24 
     24    log_function(Special_Register_unit,FUNCTION,_name.c_str());
    2525
    2626    // ===================================================================
     
    2828    // ===================================================================
    2929    for (uint32_t i=0; i<_param->_nb_inst_reexecute; i++)
    30 //       if (PORT_READ(in_SPR_ACCESS_VAL [i]) and not PORT_READ(in_SPR_ACCESS_WEN [i]))
     30      // not necessery if have not read enable
     31      if (PORT_READ(in_SPR_ACCESS_VAL [i]))
    3132        {
     33          log_printf(TRACE,Special_Register_unit,FUNCTION,"  * SPR_ACCESS [%d]",i);
     34
    3235          Tcontext_t     front_end_id = (_param->_have_port_front_end_id)?PORT_READ(in_SPR_ACCESS_FRONT_END_ID [i]):0;
    3336          Tcontext_t     context_id   = (_param->_have_port_context_id  )?PORT_READ(in_SPR_ACCESS_CONTEXT_ID   [i]):0;
     
    3538          Tspr_address_t num_reg      = PORT_READ(in_SPR_ACCESS_NUM_REG   [i]);
    3639         
     40          log_printf(TRACE,Special_Register_unit,FUNCTION,"    * front_end_id : %d",front_end_id);
     41          log_printf(TRACE,Special_Register_unit,FUNCTION,"    * context_id   : %d",context_id  );
     42          log_printf(TRACE,Special_Register_unit,FUNCTION,"    * num_group    : %d",num_group   );
     43          log_printf(TRACE,Special_Register_unit,FUNCTION,"    * num_reg      : %d",num_reg     );
     44         
     45#ifdef DEBUG_TEST
     46          if (not _spr_access_mode [front_end_id][context_id]->exist(num_group,num_reg))
     47            msgWarning("Access at an invalid special register (group %d, register %d)\n",num_group,num_reg);
     48#endif
     49
    3750          SR * sr = static_cast<SR*>(_spr [front_end_id][context_id][GROUP_SYSTEM_AND_CONTROL][SPR_SR]);
    3851         
     
    4356                                                                               sm,
    4457                                                                               sumra);
    45          
    46           PORT_WRITE(out_SPR_ACCESS_RDATA   [i], (valid)?_spr[front_end_id][context_id][num_group][num_reg]->read():0);
    47           PORT_WRITE(out_SPR_ACCESS_INVALID [i], not valid);
     58
     59          log_printf(TRACE,Special_Register_unit,FUNCTION,"    * SM           : %d",sm);
     60          log_printf(TRACE,Special_Register_unit,FUNCTION,"    * SUMRA        : %d",sumra);
     61          log_printf(TRACE,Special_Register_unit,FUNCTION,"    * valid        : %d",valid);
     62
     63          // ISA OpenRISC : no action/exception if unauthorised spr access. Also, read 0.
     64//           if (not PORT_READ(in_SPR_ACCESS_WEN [i]))
     65//             {
     66          Tspr_t rdata = (valid)?(_spr[front_end_id][context_id][num_group][num_reg]->read()):0;
     67
     68          log_printf(TRACE,Special_Register_unit,FUNCTION,"    * rdata        : %.8x",rdata);
     69
     70          PORT_WRITE(out_SPR_ACCESS_RDATA   [i], rdata);
     71//             }
     72          PORT_WRITE(out_SPR_ACCESS_INVALID [i], not valid);
    4873        }
    4974   
    50 #if defined(STATISTICS) or defined(VHDL_TESTBENCH)
    51     end_cycle ();
    52 #endif
    53 
    5475    log_end(Special_Register_unit,FUNCTION);
    5576  };
Note: See TracChangeset for help on using the changeset viewer.