Ignore:
Timestamp:
May 1, 2008, 6:48:45 PM (16 years ago)
Author:
rosiere
Message:
  • support locale (now must "just" translate)
  • update all component with new test format
  • update all component with usage
  • New component : decod queue and prediction_unit
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Update_Prediction_Table/SelfTest/src/test.cpp

    r81 r82  
    7171  ALLOC1_SC_SIGNAL( in_DECOD_RAS_ADDRESS              ," in_DECOD_RAS_ADDRESS              ",Taddress_t         ,_param->_nb_inst_decod);
    7272  ALLOC1_SC_SIGNAL( in_DECOD_RAS_INDEX                ," in_DECOD_RAS_INDEX                ",Tptr_t             ,_param->_nb_inst_decod);
    73   ALLOC1_SC_SIGNAL( in_DECOD_MISS_PREDICTION          ," in_DECOD_MISS_PREDICTION          ",Tcontrol_t         ,_param->_nb_inst_decod);
     73  ALLOC1_SC_SIGNAL( in_DECOD_MISS_IFETCH              ," in_DECOD_MISS_IFETCH              ",Tcontrol_t         ,_param->_nb_inst_decod);
     74  ALLOC1_SC_SIGNAL( in_DECOD_MISS_DECOD               ," in_DECOD_MISS_DECOD               ",Tcontrol_t         ,_param->_nb_inst_decod);
    7475  ALLOC1_SC_SIGNAL( in_DECOD_UPDATE_PREDICTION_ID     ," in_DECOD_UPDATE_PREDICTION_ID     ",Tprediction_ptr_t  ,_param->_nb_inst_decod);
    7576//ALLOC1_SC_SIGNAL(out_DECOD_DEPTH                    ,"out_DECOD_DEPTH                    ",Tdepth_t           ,_param->_nb_inst_decod);
     77
    7678  ALLOC1_SC_SIGNAL( in_BRANCH_COMPLETE_VAL            ," in_BRANCH_COMPLETE_VAL            ",Tcontrol_t         ,_param->_nb_inst_branch_complete);
    7779  ALLOC1_SC_SIGNAL(out_BRANCH_COMPLETE_ACK            ,"out_BRANCH_COMPLETE_ACK            ",Tcontrol_t         ,_param->_nb_inst_branch_complete);
     
    8486  ALLOC1_SC_SIGNAL(out_BRANCH_COMPLETE_ADDRESS_SRC    ,"out_BRANCH_COMPLETE_ADDRESS_SRC    ",Taddress_t         ,_param->_nb_inst_branch_complete);
    8587  ALLOC1_SC_SIGNAL(out_BRANCH_COMPLETE_ADDRESS_DEST   ,"out_BRANCH_COMPLETE_ADDRESS_DEST   ",Taddress_t         ,_param->_nb_inst_branch_complete);
     88
     89  ALLOC1_SC_SIGNAL(out_BRANCH_EVENT_VAL            ,"out_BRANCH_EVENT_VAL            ",Tcontrol_t         ,_param->_nb_context);
     90  ALLOC1_SC_SIGNAL( in_BRANCH_EVENT_ACK            ," in_BRANCH_EVENT_ACK            ",Tcontrol_t         ,_param->_nb_context);
     91//   ALLOC1_SC_SIGNAL( in_BRANCH_EVENT_CONTEXT_ID     ," in_BRANCH_EVENT_CONTEXT_ID     ",Tcontext_t         ,_param->_nb_context);
     92//   ALLOC1_SC_SIGNAL( in_BRANCH_EVENT_DEPTH          ," in_BRANCH_EVENT_DEPTH          ",Tdepth_t           ,_param->_nb_context);
     93//   ALLOC1_SC_SIGNAL(out_BRANCH_EVENT_MISS_PREDICTION,"out_BRANCH_EVENT_MISS_PREDICTION",Tcontrol_t         ,_param->_nb_context);
     94  ALLOC1_SC_SIGNAL(out_BRANCH_EVENT_ADDRESS_SRC    ,"out_BRANCH_EVENT_ADDRESS_SRC    ",Taddress_t         ,_param->_nb_context);
     95  ALLOC1_SC_SIGNAL(out_BRANCH_EVENT_ADDRESS_DEST   ,"out_BRANCH_EVENT_ADDRESS_DEST   ",Taddress_t         ,_param->_nb_context);
     96
    8697  ALLOC1_SC_SIGNAL(out_UPDATE_VAL                     ,"out_UPDATE_VAL                     ",Tcontrol_t         ,_param->_nb_inst_update);
    8798  ALLOC1_SC_SIGNAL( in_UPDATE_ACK                     ," in_UPDATE_ACK                     ",Tcontrol_t         ,_param->_nb_inst_update);
     
    96107  ALLOC1_SC_SIGNAL(out_UPDATE_DIR_HISTORY             ,"out_UPDATE_DIR_HISTORY             ",Thistory_t         ,_param->_nb_inst_update);
    97108  ALLOC1_SC_SIGNAL(out_UPDATE_RAS_VAL                 ,"out_UPDATE_RAS_VAL                 ",Tcontrol_t         ,_param->_nb_inst_update);
     109  ALLOC1_SC_SIGNAL(out_UPDATE_RAS_PUSH                ,"out_UPDATE_RAS_PUSH                ",Tcontrol_t         ,_param->_nb_inst_update);
    98110  ALLOC1_SC_SIGNAL(out_UPDATE_RAS_ADDRESS             ,"out_UPDATE_RAS_ADDRESS             ",Taddress_t         ,_param->_nb_inst_update);
    99111  ALLOC1_SC_SIGNAL(out_UPDATE_RAS_INDEX               ,"out_UPDATE_RAS_INDEX               ",Tptr_t             ,_param->_nb_inst_update);
     
    136148  INSTANCE1_SC_SIGNAL(_Update_Prediction_Table, in_DECOD_RAS_ADDRESS              ,_param->_nb_inst_decod);
    137149  INSTANCE1_SC_SIGNAL(_Update_Prediction_Table, in_DECOD_RAS_INDEX                ,_param->_nb_inst_decod);
    138   INSTANCE1_SC_SIGNAL(_Update_Prediction_Table, in_DECOD_MISS_PREDICTION          ,_param->_nb_inst_decod);
    139   if (_param->_have_port_depth)
     150  INSTANCE1_SC_SIGNAL(_Update_Prediction_Table, in_DECOD_MISS_IFETCH              ,_param->_nb_inst_decod);
     151  INSTANCE1_SC_SIGNAL(_Update_Prediction_Table, in_DECOD_MISS_DECOD               ,_param->_nb_inst_decod);
     152  if (_param->_have_port_max_depth)
    140153  INSTANCE1_SC_SIGNAL(_Update_Prediction_Table, in_DECOD_UPDATE_PREDICTION_ID     ,_param->_nb_inst_decod);
    141154//if (_param->_have_port_depth)
     
    145158  if (_param->_have_port_context_id)
    146159  INSTANCE1_SC_SIGNAL(_Update_Prediction_Table, in_BRANCH_COMPLETE_CONTEXT_ID     ,_param->_nb_inst_branch_complete);
    147   if (_param->_have_port_depth)
     160  if (_param->_have_port_max_depth)
    148161  INSTANCE1_SC_SIGNAL(_Update_Prediction_Table, in_BRANCH_COMPLETE_DEPTH          ,_param->_nb_inst_branch_complete);
    149162  INSTANCE1_SC_SIGNAL(_Update_Prediction_Table, in_BRANCH_COMPLETE_ADDRESS        ,_param->_nb_inst_branch_complete);
     
    153166  INSTANCE1_SC_SIGNAL(_Update_Prediction_Table,out_BRANCH_COMPLETE_ADDRESS_SRC    ,_param->_nb_inst_branch_complete);
    154167  INSTANCE1_SC_SIGNAL(_Update_Prediction_Table,out_BRANCH_COMPLETE_ADDRESS_DEST   ,_param->_nb_inst_branch_complete);
     168
     169  INSTANCE1_SC_SIGNAL(_Update_Prediction_Table,out_BRANCH_EVENT_VAL            ,_param->_nb_context);
     170  INSTANCE1_SC_SIGNAL(_Update_Prediction_Table, in_BRANCH_EVENT_ACK            ,_param->_nb_context);
     171//   if (_param->_have_port_context_id)
     172//   INSTANCE1_SC_SIGNAL(_Update_Prediction_Table, in_BRANCH_EVENT_CONTEXT_ID     ,_param->_nb_context);
     173//   if (_param->_have_port_max_depth)
     174//   INSTANCE1_SC_SIGNAL(_Update_Prediction_Table, in_BRANCH_EVENT_DEPTH          ,_param->_nb_context);
     175//   INSTANCE1_SC_SIGNAL(_Update_Prediction_Table, in_BRANCH_EVENT_ADDRESS        ,_param->_nb_context);
     176//   INSTANCE1_SC_SIGNAL(_Update_Prediction_Table,out_BRANCH_EVENT_MISS_PREDICTION,_param->_nb_context);
     177  INSTANCE1_SC_SIGNAL(_Update_Prediction_Table,out_BRANCH_EVENT_ADDRESS_SRC    ,_param->_nb_context);
     178  INSTANCE1_SC_SIGNAL(_Update_Prediction_Table,out_BRANCH_EVENT_ADDRESS_DEST   ,_param->_nb_context);
     179
    155180  INSTANCE1_SC_SIGNAL(_Update_Prediction_Table,out_UPDATE_VAL                     ,_param->_nb_inst_update);
    156181  INSTANCE1_SC_SIGNAL(_Update_Prediction_Table, in_UPDATE_ACK                     ,_param->_nb_inst_update);
     
    167192  INSTANCE1_SC_SIGNAL(_Update_Prediction_Table,out_UPDATE_DIR_HISTORY             ,_param->_nb_inst_update);
    168193  INSTANCE1_SC_SIGNAL(_Update_Prediction_Table,out_UPDATE_RAS_VAL                 ,_param->_nb_inst_update);
     194  INSTANCE1_SC_SIGNAL(_Update_Prediction_Table,out_UPDATE_RAS_PUSH                ,_param->_nb_inst_update);
    169195  INSTANCE1_SC_SIGNAL(_Update_Prediction_Table,out_UPDATE_RAS_ADDRESS             ,_param->_nb_inst_update);
    170196  INSTANCE1_SC_SIGNAL(_Update_Prediction_Table,out_UPDATE_RAS_INDEX               ,_param->_nb_inst_update);
    171197  INSTANCE1_SC_SIGNAL(_Update_Prediction_Table,out_UPDATE_RAS_PREDICTION_IFETCH   ,_param->_nb_inst_update);
    172   if (_param->_have_port_depth)
    173   INSTANCE1_SC_SIGNAL(_Update_Prediction_Table,out_DEPTH_NB_BRANCH                ,_param->_nb_context);
    174   if (_param->_have_port_depth)
    175   INSTANCE1_SC_SIGNAL(_Update_Prediction_Table,out_DEPTH_TAIL                     ,_param->_nb_context);
     198  for (uint32_t i=0; i<_param->_nb_context; i++)
     199    {
     200      if (_param->_have_port_depth[i])
     201        {
     202          INSTANCE_SC_SIGNAL(_Update_Prediction_Table,out_DEPTH_TAIL      [i]);
     203        }
     204      INSTANCE_SC_SIGNAL(_Update_Prediction_Table,out_DEPTH_NB_BRANCH [i]);
     205    }
    176206
    177207  msg(_("<%s> : Start Simulation ............\n"),name.c_str());
     
    202232  SC_START(5);
    203233  in_NRESET->write(1); 
     234
     235  for (uint32_t i=0; i<_param->_nb_context; i++)
     236    {
     237      PORT_WRITE(in_BRANCH_EVENT_ACK [i],1);
     238    }
    204239
    205240  LABEL("Loop of Test");
     
    236271                  in_PREDICT_RAS_INDEX        [port]->write((0x12345678+i)%_param->_size_ras_index[context]);
    237272                 
    238                   if (_param->_have_port_depth)
     273                  if (_param->_have_port_depth[context])
    239274                    {
    240275                      TEST(Tdepth_t,out_DEPTH_TAIL     [context]->read(), 0);
     276                    }
    241277                      TEST(Tdepth_t,out_DEPTH_NB_BRANCH[context]->read(), i);
    242                     }
     278                     
    243279                  SC_START(0);
    244280                 
     
    256292              in_PREDICT_VAL              [port]->write(0);
    257293             
    258               if (_param->_have_port_depth)
     294              if (_param->_have_port_depth[context])
    259295                {
    260296                  TEST(Tdepth_t,out_DEPTH_TAIL     [context]->read(), 0);
     297                }
    261298                  TEST(Tdepth_t,out_DEPTH_NB_BRANCH[context]->read(), i+1);
    262                 }
     299
    263300            }
    264301        }
     
    283320                  in_DECOD_RAS_ADDRESS          [port]->write(0xdeaddead+i);
    284321                  in_DECOD_RAS_INDEX            [port]->write((0x12345678+i)%_param->_size_ras_index[context]);
    285                   in_DECOD_MISS_PREDICTION      [port]->write(false);
     322                  in_DECOD_MISS_IFETCH          [port]->write(false);
     323                  in_DECOD_MISS_DECOD           [port]->write(false);
    286324                  in_DECOD_UPDATE_PREDICTION_ID [port]->write(i);
    287325                 
    288                   if (_param->_have_port_depth)
     326                  if (_param->_have_port_depth[context])
    289327                    {
    290328                      TEST(Tdepth_t,out_DEPTH_TAIL     [context]->read(), 0);
     329                    }
    291330                      TEST(Tdepth_t,out_DEPTH_NB_BRANCH[context]->read(), _param->_size_queue[context]);
    292                     }
    293331                 
    294332                  SC_START(0);
     
    307345              in_DECOD_VAL              [port]->write(0);
    308346             
    309               if (_param->_have_port_depth)
     347              if (_param->_have_port_depth[context])
    310348                {
    311349                  TEST(Tdepth_t,out_DEPTH_TAIL     [context]->read(), 0);
     350                }
    312351                  TEST(Tdepth_t,out_DEPTH_NB_BRANCH[context]->read(), _param->_size_queue[context]);
    313                 }
    314352            }
    315353        }
     
    331369                  in_BRANCH_COMPLETE_FLAG                 [port]->write(1);
    332370                 
    333                   if (_param->_have_port_depth)
     371                  if (_param->_have_port_depth[context])
    334372                    {
    335373                      TEST(Tdepth_t,out_DEPTH_TAIL     [context]->read(), 0);
     374                    }
    336375                      TEST(Tdepth_t,out_DEPTH_NB_BRANCH[context]->read(), _param->_size_queue[context]);
    337                     }
    338376                 
    339377                  SC_START(0);
     
    357395              in_BRANCH_COMPLETE_VAL              [port]->write(0);
    358396             
    359               if (_param->_have_port_depth)
     397              if (_param->_have_port_depth[context])
    360398                {
    361399                  TEST(Tdepth_t,out_DEPTH_TAIL     [context]->read(), 0);
     400                }
    362401                  TEST(Tdepth_t,out_DEPTH_NB_BRANCH[context]->read(), _param->_size_queue[context]);
    363                 }
    364402            }
    365403        }
     
    396434                        TEST(Thistory_t         ,out_UPDATE_DIR_HISTORY           [port]->read(), i);
    397435                      TEST(Tcontrol_t         ,out_UPDATE_RAS_VAL               [port]->read(), 0);
     436                      TEST(Tcontrol_t         ,out_UPDATE_RAS_PUSH              [port]->read(), 0);
    398437                      TEST(Taddress_t         ,out_UPDATE_RAS_ADDRESS           [port]->read(), 0xdeaddead+i);
    399438                      TEST(Tptr_t             ,out_UPDATE_RAS_INDEX             [port]->read(), (0x12345678+i)%_param->_size_ras_index[context]);
     
    411450 
    412451          // wait the garbage collector
    413           if (_param->_have_port_depth)
    414             while ((out_DEPTH_TAIL     [context]->read() != 0) and
    415                    (out_DEPTH_NB_BRANCH[context]->read() != 0))
    416               {
    417                 LABEL("DEPTH [%d] nb_branch : %d - tail : %d",context,out_DEPTH_NB_BRANCH[context]->read(), out_DEPTH_TAIL [context]->read());
    418                 SC_START(1);
    419               }
     452          while ((not (_param->_have_port_depth[context]) or (out_DEPTH_TAIL     [context]->read() != 0)) and
     453                 (out_DEPTH_NB_BRANCH[context]->read() != 0))
     454            {
     455              LABEL("DEPTH [%d] nb_branch : %d - tail : %d",context,out_DEPTH_NB_BRANCH[context]->read(), out_DEPTH_TAIL [context]->read());
     456              SC_START(1);
     457            }
    420458        }
    421459      }
     
    448486                  in_PREDICT_RAS_INDEX        [port]->write((0x12345678+i)%_param->_size_ras_index[context]);
    449487                 
    450                   if (_param->_have_port_depth)
     488                  if (_param->_have_port_depth[context])
    451489                    {
    452490                      TEST(Tdepth_t,out_DEPTH_TAIL     [context]->read(), 0);
     491                    }
    453492                      TEST(Tdepth_t,out_DEPTH_NB_BRANCH[context]->read(), i);
    454                     }
     493
    455494                  SC_START(0);
    456495                 
     
    468507              in_PREDICT_VAL              [port]->write(0);
    469508             
    470               if (_param->_have_port_depth)
     509              if (_param->_have_port_depth[context])
    471510                {
    472511                  TEST(Tdepth_t,out_DEPTH_TAIL     [context]->read(), 0);
     512                }
    473513                  TEST(Tdepth_t,out_DEPTH_NB_BRANCH[context]->read(), i+1);
    474                 }
    475514            }
    476515        }
     
    495534                  in_DECOD_RAS_ADDRESS          [port]->write(0xdeaddead+i);
    496535                  in_DECOD_RAS_INDEX            [port]->write((0x12345678+i)%_param->_size_ras_index[context]);
    497                   in_DECOD_MISS_PREDICTION      [port]->write(false);
     536                  in_DECOD_MISS_IFETCH          [port]->write(false);
     537                  in_DECOD_MISS_DECOD           [port]->write(false);
    498538                  in_DECOD_UPDATE_PREDICTION_ID [port]->write(i);
    499539                 
    500                   if (_param->_have_port_depth)
     540                  if (_param->_have_port_depth[context])
    501541                    {
    502542                      TEST(Tdepth_t,out_DEPTH_TAIL     [context]->read(), 0);
     543                    }
    503544                      TEST(Tdepth_t,out_DEPTH_NB_BRANCH[context]->read(), _param->_size_queue[context]);
    504                     }
    505545                 
    506546                  SC_START(0);
     
    519559              in_DECOD_VAL              [port]->write(0);
    520560             
    521               if (_param->_have_port_depth)
     561              if (_param->_have_port_depth[context])
    522562                {
    523563                  TEST(Tdepth_t,out_DEPTH_TAIL     [context]->read(), 0);
     564                }
    524565                  TEST(Tdepth_t,out_DEPTH_NB_BRANCH[context]->read(), _param->_size_queue[context]);
    525                 }
    526566            }
    527567        }
     
    543583                  in_BRANCH_COMPLETE_FLAG                 [port]->write(0);
    544584                 
    545                   if (_param->_have_port_depth)
     585                  if (_param->_have_port_depth[context])
    546586                    {
    547587                      TEST(Tdepth_t,out_DEPTH_TAIL     [context]->read(), 0);
     588                    }
    548589                      TEST(Tdepth_t,out_DEPTH_NB_BRANCH[context]->read(), _param->_size_queue[context]);
    549                     }
    550590                 
    551591                  SC_START(0);
     
    604644                        TEST(Thistory_t         ,out_UPDATE_DIR_HISTORY           [port]->read(), i);
    605645                      TEST(Tcontrol_t         ,out_UPDATE_RAS_VAL               [port]->read(), 0);
     646                      TEST(Tcontrol_t         ,out_UPDATE_RAS_PUSH              [port]->read(), 0);
    606647                      TEST(Taddress_t         ,out_UPDATE_RAS_ADDRESS           [port]->read(), 0xdeaddead+i);
    607648                      TEST(Tptr_t             ,out_UPDATE_RAS_INDEX             [port]->read(), (0x12345678+i)%_param->_size_ras_index[context]);
     
    619660           
    620661            // wait the garbage collector
    621             if (_param->_have_port_depth)
    622               while ((out_DEPTH_TAIL     [context]->read() != 0) and
    623                      (out_DEPTH_NB_BRANCH[context]->read() != 0))
     662            while (((not (_param->_have_port_depth[context])) or (out_DEPTH_TAIL     [context]->read() != 0)) and
     663                   (out_DEPTH_NB_BRANCH[context]->read() != 0))
    624664                {
    625665                  LABEL("DEPTH [%d] nb_branch : %d - tail : %d",context,out_DEPTH_NB_BRANCH[context]->read(), out_DEPTH_TAIL [context]->read());
     
    671711  delete []  in_DECOD_RAS_ADDRESS           ;
    672712  delete []  in_DECOD_RAS_INDEX             ;
    673   delete []  in_DECOD_MISS_PREDICTION       ;
     713  delete []  in_DECOD_MISS_IFETCH           ;
     714  delete []  in_DECOD_MISS_DECOD            ;
    674715  delete []  in_DECOD_UPDATE_PREDICTION_ID  ;
    675716//delete [] out_DECOD_DEPTH                 ;
     
    686727  delete [] out_BRANCH_COMPLETE_ADDRESS_SRC    ;
    687728  delete [] out_BRANCH_COMPLETE_ADDRESS_DEST   ;
     729
     730  // ~~~~~[ Interface : "branch_event" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
     731  delete [] out_BRANCH_EVENT_VAL            ;
     732  delete []  in_BRANCH_EVENT_ACK            ;
     733//   delete []  in_BRANCH_EVENT_CONTEXT_ID     ;
     734//   delete []  in_BRANCH_EVENT_DEPTH          ;
     735//   delete [] out_BRANCH_EVENT_MISS_PREDICTION;
     736  delete [] out_BRANCH_EVENT_ADDRESS_SRC    ;
     737  delete [] out_BRANCH_EVENT_ADDRESS_DEST   ;
    688738 
    689739  // ~~~~~[ Interface : "update" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
     
    700750  delete [] out_UPDATE_DIR_HISTORY          ;
    701751  delete [] out_UPDATE_RAS_VAL              ;
     752  delete [] out_UPDATE_RAS_PUSH             ;
    702753  delete [] out_UPDATE_RAS_ADDRESS          ;
    703754  delete [] out_UPDATE_RAS_INDEX            ;
Note: See TracChangeset for help on using the changeset viewer.