Ignore:
Timestamp:
Dec 10, 2008, 7:31:39 PM (15 years ago)
Author:
rosiere
Message:

Almost complete design
with Test and test platform

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_OOO_Engine/OOO_Engine/Rename_unit/Register_translation_unit/Register_Address_Translation_unit/SelfTest/src/test.cpp

    r82 r88  
    2424#endif
    2525
     26  Tusage_t _usage = USE_ALL;
     27
     28//   _usage = usage_unset(_usage,USE_SYSTEMC              );
     29//   _usage = usage_unset(_usage,USE_VHDL                 );
     30//   _usage = usage_unset(_usage,USE_VHDL_TESTBENCH       );
     31//   _usage = usage_unset(_usage,USE_VHDL_TESTBENCH_ASSERT);
     32//   _usage = usage_unset(_usage,USE_POSITION             );
     33//   _usage = usage_unset(_usage,USE_STATISTICS           );
     34//   _usage = usage_unset(_usage,USE_INFORMATION          );
     35
    2636  Register_Address_Translation_unit * _Register_Address_Translation_unit = new Register_Address_Translation_unit
    2737    (name.c_str(),
     
    3040#endif
    3141     _param,
    32      USE_ALL);
     42     _usage);
    3343 
    3444#ifdef SYSTEMC
     
    7888  ALLOC1_SC_SIGNAL( in_RETIRE_NUM_REG_RD_PHY_OLD," in_RETIRE_NUM_REG_RD_PHY_OLD",Tgeneral_address_t,_param->_nb_inst_retire);
    7989  ALLOC1_SC_SIGNAL( in_RETIRE_NUM_REG_RE_PHY_OLD," in_RETIRE_NUM_REG_RE_PHY_OLD",Tspecial_address_t,_param->_nb_inst_retire);
     90  ALLOC1_SC_SIGNAL(out_RETIRE_RESTORE_RD_PHY_OLD,"out_RETIRE_RESTORE_RD_PHY_OLD",Tcontrol_t        ,_param->_nb_inst_retire);
     91  ALLOC1_SC_SIGNAL(out_RETIRE_RESTORE_RE_PHY_OLD,"out_RETIRE_RESTORE_RE_PHY_OLD",Tcontrol_t        ,_param->_nb_inst_retire);
    8092 
    8193  /********************************************************
     
    131143  INSTANCE1_SC_SIGNAL(_Register_Address_Translation_unit, in_RETIRE_NUM_REG_RD_PHY_OLD,_param->_nb_inst_retire);
    132144  INSTANCE1_SC_SIGNAL(_Register_Address_Translation_unit, in_RETIRE_NUM_REG_RE_PHY_OLD,_param->_nb_inst_retire);
     145  INSTANCE1_SC_SIGNAL(_Register_Address_Translation_unit,out_RETIRE_RESTORE_RD_PHY_OLD,_param->_nb_inst_retire);
     146  INSTANCE1_SC_SIGNAL(_Register_Address_Translation_unit,out_RETIRE_RESTORE_RE_PHY_OLD,_param->_nb_inst_retire);
    133147
    134148  msg(_("<%s> : Start Simulation ............\n"),name.c_str());
     
    226240            }
    227241
     242          uint32_t retire_max = _param->_nb_inst_retire;
    228243          for (uint32_t i=0; i<_param->_nb_inst_retire; i++)
    229244            {
    230               Tcontrol_t val = (rand()%100)<percent_transaction_retire;
     245              // in order ...........
     246
     247              Tcontrol_t val = (i<retire_max) and ((rand()%100)<percent_transaction_retire);
    231248             
     249              if (not val)
     250                retire_max = i;
     251
    232252              Tcontext_t front_end_id = rand() % _param->_nb_front_end;
    233253
     
    259279                }
    260280            }
     281
     282          for (uint32_t i=0; i<_param->_nb_inst_retire; i++)
     283            {
     284              TEST(Tcontrol_t,out_RETIRE_RESTORE_RD_PHY_OLD[i]->read(), 0);
     285              TEST(Tcontrol_t,out_RETIRE_RESTORE_RE_PHY_OLD[i]->read(), 0);
     286            }
     287
    261288          for (uint32_t i=0; i<_param->_nb_inst_insert; i++)
    262289            {
     
    320347      SC_START(1);
    321348
     349      // EVENT !!!!!!!!
     350
    322351      nb_request = 32;
    323352      while (nb_request > 1)
     
    347376            }
    348377
     378          uint32_t retire_max = _param->_nb_inst_retire;
    349379          for (uint32_t i=0; i<_param->_nb_inst_retire; i++)
    350380            {
    351               Tcontrol_t val = (rand()%100)<percent_transaction_retire;
     381              // in order ...........
     382
     383              Tcontrol_t val = (i<retire_max) and ((rand()%100)<percent_transaction_retire);
     384             
     385              if (not val)
     386                retire_max = i;
     387
    352388              in_RETIRE_VAL                [i]->write(val);
    353389              in_RETIRE_FRONT_END_ID       [i]->write(retire_front_end_id [i]);
     
    362398            }
    363399
    364           SC_START(1);
     400          SC_START(0);
    365401         
    366402
     
    380416          for (uint32_t i=0; i<_param->_nb_inst_retire; i++)
    381417            {
     418              LABEL("RETIRE[%d]",i);
     419
    382420              Tcontext_t front_end_id = in_RETIRE_FRONT_END_ID [i]->read();
    383421              Tcontext_t context_id   = in_RETIRE_CONTEXT_ID   [i]->read();
     422
     423              LABEL("  * front_end_id : %d",front_end_id);
     424              LABEL("  * context_id   : %d",context_id  );
     425
    384426              if (in_RETIRE_VAL [i]->read() and out_RETIRE_ACK [i]->read())
    385427                {
    386428                  if (in_RETIRE_WRITE_RD [i]->read() == 1)
    387429                    {
     430//                       LABEL("  * transaction and write rd");
     431//                       LABEL("    * rd_log       : %d",in_RETIRE_NUM_REG_RD_LOG[i]->read());
     432//                       LABEL("    * rat_gpr_updt : %d",rat_gpr_updt [front_end_id][context_id][in_RETIRE_NUM_REG_RD_LOG[i]->read()]);
     433                      TEST(Tcontrol_t,out_RETIRE_RESTORE_RD_PHY_OLD[i]->read(), (rat_gpr_updt [front_end_id][context_id][in_RETIRE_NUM_REG_RD_LOG[i]->read()] == false));
     434
    388435                      if (rat_gpr_updt [front_end_id][context_id][in_RETIRE_NUM_REG_RD_LOG[i]->read()] == false)
    389436                        rat_gpr[front_end_id][context_id][in_RETIRE_NUM_REG_RD_LOG[i]->read()] = in_RETIRE_NUM_REG_RD_PHY_OLD[i]->read();
     
    392439                  if (in_RETIRE_WRITE_RE [i]->read() == 1)
    393440                    {
     441                      TEST(Tcontrol_t,out_RETIRE_RESTORE_RE_PHY_OLD[i]->read(), (rat_spr_updt [front_end_id][context_id][in_RETIRE_NUM_REG_RE_LOG[i]->read()] == false));
     442
    394443                      if (rat_spr_updt [front_end_id][context_id][in_RETIRE_NUM_REG_RE_LOG[i]->read()] == false)
    395444                        rat_spr[front_end_id][context_id][in_RETIRE_NUM_REG_RE_LOG[i]->read()] = in_RETIRE_NUM_REG_RE_PHY_OLD[i]->read();
     
    398447                }
    399448            }
     449
     450          SC_START(1);
     451
    400452          for (uint32_t i=0; i<_param->_nb_inst_insert; i++)
    401453            {
     
    412464                  TEST(Tspecial_address_t,out_RENAME_NUM_REG_RE_PHY_OLD[i]->read(), rat_spr[front_end_id][context_id][in_RENAME_NUM_REG_RE_LOG[i]->read()]);
    413465                }
    414 
    415             }
     466            }
     467
    416468        }
    417469    }
     
    472524  delete []  in_RETIRE_NUM_REG_RD_PHY_OLD;
    473525  delete []  in_RETIRE_NUM_REG_RE_PHY_OLD;
     526  delete [] out_RETIRE_RESTORE_RD_PHY_OLD;
     527  delete [] out_RETIRE_RESTORE_RE_PHY_OLD;
    474528
    475529#endif
Note: See TracChangeset for help on using the changeset viewer.