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_Front_end/Front_end/Ifetch_unit/SelfTest/src/test.cpp

    r85 r88  
    77 */
    88
    9 #define NB_ITERATION  128
     9#define NB_ITERATION  1024
    1010#define CYCLE_MAX     (128*NB_ITERATION)
    1111
     
    4040#endif
    4141
     42  Tusage_t _usage = USE_ALL;
     43//   _usage = usage_unset(_usage,USE_SYSTEMC              );
     44//   _usage = usage_unset(_usage,USE_VHDL                 );
     45//   _usage = usage_unset(_usage,USE_VHDL_TESTBENCH       );
     46//   _usage = usage_unset(_usage,USE_VHDL_TESTBENCH_ASSERT);
     47//   _usage = usage_unset(_usage,USE_POSITION             );
     48  _usage = usage_unset(_usage,USE_STATISTICS           );
     49//   _usage = usage_unset(_usage,USE_INFORMATION          );
     50
    4251  Ifetch_unit * _Ifetch_unit = new Ifetch_unit
    4352    (name.c_str(),
     
    4655#endif
    4756     _param,
    48      USE_ALL);
     57     _usage);
    4958 
    5059#ifdef SYSTEMC
     
    92101  ALLOC_SC_SIGNAL (out_EVENT_ACK                          ,"out_EVENT_ACK                          ",Tcontrol_t           );
    93102  ALLOC_SC_SIGNAL ( in_EVENT_ADDRESS                      ," in_EVENT_ADDRESS                      ",Tgeneral_address_t   );
     103  ALLOC_SC_SIGNAL ( in_EVENT_ADDRESS_NEXT                 ," in_EVENT_ADDRESS_NEXT                 ",Tgeneral_address_t   );
     104  ALLOC_SC_SIGNAL ( in_EVENT_ADDRESS_NEXT_VAL             ," in_EVENT_ADDRESS_NEXT_VAL             ",Tcontrol_t           );
     105  ALLOC_SC_SIGNAL ( in_EVENT_IS_DS_TAKE                   ," in_EVENT_IS_DS_TAKE                   ",Tcontrol_t           );
    94106 
    95107  /********************************************************
     
    105117  INSTANCE_SC_SIGNAL (_Ifetch_unit, in_ICACHE_REQ_ACK                     );
    106118//INSTANCE_SC_SIGNAL (_Ifetch_unit,out_ICACHE_REQ_THREAD_ID               );
    107   if (_param->_have_port_queue_ptr)
     119  if (_param->_have_port_ifetch_queue_ptr)
    108120  INSTANCE_SC_SIGNAL (_Ifetch_unit,out_ICACHE_REQ_PACKET_ID               );
    109121  INSTANCE_SC_SIGNAL (_Ifetch_unit,out_ICACHE_REQ_ADDRESS                 );
     
    112124  INSTANCE_SC_SIGNAL (_Ifetch_unit,out_ICACHE_RSP_ACK                     );
    113125//INSTANCE_SC_SIGNAL (_Ifetch_unit, in_ICACHE_RSP_THREAD_ID               );
    114   if (_param->_have_port_queue_ptr)
     126  if (_param->_have_port_ifetch_queue_ptr)
    115127  INSTANCE_SC_SIGNAL (_Ifetch_unit, in_ICACHE_RSP_PACKET_ID               );
    116128  INSTANCE1_SC_SIGNAL(_Ifetch_unit, in_ICACHE_RSP_INSTRUCTION             ,_param->_nb_instruction);
     
    124136  INSTANCE_SC_SIGNAL (_Ifetch_unit, in_PREDICT_PC_NEXT_IS_DS_TAKE         );
    125137  INSTANCE1_SC_SIGNAL(_Ifetch_unit, in_PREDICT_INSTRUCTION_ENABLE         ,_param->_nb_instruction);
    126   if (_param->_have_port_instruction_ptr)
     138  if (_param->_have_port_inst_ifetch_ptr)
    127139  INSTANCE_SC_SIGNAL (_Ifetch_unit, in_PREDICT_INST_IFETCH_PTR            );
    128140  INSTANCE_SC_SIGNAL (_Ifetch_unit, in_PREDICT_BRANCH_STATE               );
    129   if (_param->_have_port_branch_update_prediction_id)
     141  if (_param->_have_port_depth)
    130142  INSTANCE_SC_SIGNAL (_Ifetch_unit, in_PREDICT_BRANCH_UPDATE_PREDICTION_ID);
    131143  INSTANCE1_SC_SIGNAL(_Ifetch_unit,out_DECOD_VAL                          ,_param->_nb_instruction);
     
    134146//INSTANCE_SC_SIGNAL (_Ifetch_unit,out_DECOD_CONTEXT_ID                   );
    135147  INSTANCE_SC_SIGNAL (_Ifetch_unit,out_DECOD_ADDRESS                      );
    136   if (_param->_have_port_instruction_ptr)
     148  if (_param->_have_port_inst_ifetch_ptr)
    137149  INSTANCE_SC_SIGNAL (_Ifetch_unit,out_DECOD_INST_IFETCH_PTR              );
    138150  INSTANCE_SC_SIGNAL (_Ifetch_unit,out_DECOD_BRANCH_STATE                 );
    139   if (_param->_have_port_branch_update_prediction_id)
     151  if (_param->_have_port_depth)
    140152  INSTANCE_SC_SIGNAL (_Ifetch_unit,out_DECOD_BRANCH_UPDATE_PREDICTION_ID  );
    141153  INSTANCE_SC_SIGNAL (_Ifetch_unit,out_DECOD_EXCEPTION                    );
     
    143155  INSTANCE_SC_SIGNAL (_Ifetch_unit,out_EVENT_ACK                          );
    144156  INSTANCE_SC_SIGNAL (_Ifetch_unit, in_EVENT_ADDRESS                      );
     157  INSTANCE_SC_SIGNAL (_Ifetch_unit, in_EVENT_ADDRESS_NEXT                 );
     158  INSTANCE_SC_SIGNAL (_Ifetch_unit, in_EVENT_ADDRESS_NEXT_VAL             );
     159  INSTANCE_SC_SIGNAL (_Ifetch_unit, in_EVENT_IS_DS_TAKE                   );
    145160
    146161  msg(_("<%s> : Start Simulation ............\n"),name.c_str());
     
    178193  Tcontrol_t      nn_val  = false;
    179194
    180   Tgeneral_data_t c_addr  = 0x100;
    181   Tgeneral_data_t n_addr  = 0x100;
    182   Tgeneral_data_t nn_addr = 0x100;
     195  Tgeneral_data_t c_addr  = 0x100>>2;
     196  Tgeneral_data_t n_addr  = 0x100>>2;
     197  Tgeneral_data_t nn_addr = 0x100>>2;
    183198
    184199  Tcontrol_t      c_enable [_param->_nb_instruction];
     
    218233    TEST(Tcontrol_t,out_DECOD_VAL [i]->read(), 0);
    219234
    220   LABEL("Send Reset");
    221   do
    222     {
    223       in_EVENT_VAL    ->write(1);
    224       in_EVENT_ADDRESS->write(n_addr);
    225       SC_START(1); 
    226     } while (out_EVENT_ACK->read() == false);
    227   in_EVENT_VAL    ->write(0);
     235//   LABEL("Send Reset");
     236//   do
     237//     {
     238//       in_EVENT_VAL    ->write(1);
     239//       in_EVENT_ADDRESS->write(n_addr);
     240//       SC_START(1); 
     241//     } while (out_EVENT_ACK->read() == false);
     242//   in_EVENT_VAL    ->write(0);
    228243
    229244  n_val = 1;
     
    270285
    271286      // EVENT
    272       in_EVENT_VAL    ->write((rand()%100)<percent_transaction_event  );
    273       in_EVENT_ADDRESS->write(0x100);
     287      in_EVENT_VAL             ->write((rand()%100)<percent_transaction_event  );
     288      in_EVENT_ADDRESS         ->write(0x77);
     289      in_EVENT_ADDRESS_NEXT    ->write(0x171);
     290      Tcontrol_t is_ds_take = rand();
     291      in_EVENT_ADDRESS_NEXT_VAL->write(is_ds_take);
     292      in_EVENT_IS_DS_TAKE      ->write(is_ds_take);
    274293
    275294      // ICACHE_REQ
     
    305324          LABEL("ICACHE_REQ : Transaction accepted");
    306325
    307           Tpacket_t  packet  = (_param->_have_port_queue_ptr)?out_ICACHE_REQ_PACKET_ID->read():0;
     326          Tpacket_t  packet  = (_param->_have_port_ifetch_queue_ptr)?out_ICACHE_REQ_PACKET_ID->read():0;
    308327          Taddress_t address = out_ICACHE_REQ_ADDRESS->read();
    309328
     
    344363        if (find)
    345364          {
    346             if (_param->_have_port_instruction_ptr)
     365            if (_param->_have_port_inst_ifetch_ptr)
    347366            TEST(Tinst_ifetch_ptr_t, out_DECOD_INST_IFETCH_PTR            ->read(), 0);
    348367            TEST(Tbranch_state_t   , out_DECOD_BRANCH_STATE               ->read(), 0);
    349             if (_param->_have_port_branch_update_prediction_id)
     368            if (_param->_have_port_depth)
    350369            TEST(Tprediction_ptr_t , out_DECOD_BRANCH_UPDATE_PREDICTION_ID->read(), 0);
    351370            TEST(Texception_t      , out_DECOD_EXCEPTION                  ->read(), 0);
     
    404423          c_val           = false;
    405424          n_val           = true;
    406           nn_val          = false;
    407 
    408           n_addr         = in_EVENT_ADDRESS->read();
    409           n_is_ds_take   = 0;
     425
     426          n_addr          = in_EVENT_ADDRESS->read();
     427          n_is_ds_take    = in_EVENT_IS_DS_TAKE->read();
     428          nn_val          = in_EVENT_ADDRESS_NEXT_VAL->read();
     429          nn_addr         = in_EVENT_ADDRESS_NEXT    ->read();
     430          nn_is_ds_take   = 0;
    410431
    411432          n_enable [0] = 1;
     
    496517  delete    out_EVENT_ACK                           ;
    497518  delete     in_EVENT_ADDRESS                       ;
     519  delete     in_EVENT_ADDRESS_NEXT                  ;
     520  delete     in_EVENT_ADDRESS_NEXT_VAL              ;
     521  delete     in_EVENT_IS_DS_TAKE                    ;
    498522
    499523  delete    param_cache;
Note: See TracChangeset for help on using the changeset viewer.