Ignore:
Timestamp:
Mar 6, 2007, 3:34:04 PM (17 years ago)
Author:
kane
Message:

1) Ajout d'un "printer" XML pour la configuration de paramètres

2) Fin du composant "Two_Level_Branch_Predictor"

validation * systemc

  • vhdl
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Stage_1_Ifetch/Predictor/Meta_Predictor/Two_Level_Branch_Predictor/Pattern_History_Table/SelfTest/src/test.cpp

    r2 r3  
    4343   *********************************************************************/
    4444  sc_clock                                 CLOCK ("clock", 1.0, 0.5);
    45   sc_signal<Tcontrol_t>                    PREDICT_VAL             [param._nb_prediction];
    46   sc_signal<Tcontrol_t>                    PREDICT_ACK             [param._nb_prediction];
    47   sc_signal<Taddress_t>                    PREDICT_ADDRESS         [param._nb_prediction];
    48   sc_signal<Thistory_t>                    PREDICT_HISTORY         [param._nb_prediction];
    49                                            
    50   sc_signal<Tcontrol_t>                    BRANCH_COMPLETE_VAL     [param._nb_branch_complete];
    51   sc_signal<Tcontrol_t>                    BRANCH_COMPLETE_ACK     [param._nb_branch_complete];
    52   sc_signal<Taddress_t>                    BRANCH_COMPLETE_ADDRESS [param._nb_branch_complete];
    53   sc_signal<Thistory_t>                    BRANCH_COMPLETE_HISTORY [param._nb_branch_complete];
    54   sc_signal<Tcontrol_t>                    BRANCH_COMPLETE_HIT    [param._nb_branch_complete];
     45  sc_signal<Tcontrol_t>                    PREDICT_VAL               [param._nb_prediction];
     46  sc_signal<Tcontrol_t>                    PREDICT_ACK               [param._nb_prediction];
     47  sc_signal<Taddress_t>                    PREDICT_ADDRESS           [param._nb_prediction];
     48  sc_signal<Thistory_t>                    PREDICT_HISTORY           [param._nb_prediction];
     49                                                                    
     50  sc_signal<Tcontrol_t>                    BRANCH_COMPLETE_VAL       [param._nb_branch_complete];
     51  sc_signal<Tcontrol_t>                    BRANCH_COMPLETE_ACK       [param._nb_branch_complete];
     52  sc_signal<Taddress_t>                    BRANCH_COMPLETE_ADDRESS   [param._nb_branch_complete];
     53  sc_signal<Thistory_t>                    BRANCH_COMPLETE_HISTORY   [param._nb_branch_complete];
     54  sc_signal<Tcontrol_t>                    BRANCH_COMPLETE_DIRECTION [param._nb_branch_complete];
    5555 
    5656  /********************************************************
     
    7272  for (uint32_t i=0; i<param._nb_branch_complete; i++)
    7373    {
    74       (*(_Pattern_History_Table-> in_BRANCH_COMPLETE_VAL     [i]))        (BRANCH_COMPLETE_VAL     [i]);
    75       (*(_Pattern_History_Table->out_BRANCH_COMPLETE_ACK     [i]))        (BRANCH_COMPLETE_ACK     [i]);
    76       (*(_Pattern_History_Table-> in_BRANCH_COMPLETE_ADDRESS [i]))        (BRANCH_COMPLETE_ADDRESS [i]);
    77       (*(_Pattern_History_Table-> in_BRANCH_COMPLETE_HISTORY [i]))        (BRANCH_COMPLETE_HISTORY [i]);
    78       (*(_Pattern_History_Table-> in_BRANCH_COMPLETE_HIT     [i]))        (BRANCH_COMPLETE_HIT    [i]);
     74      (*(_Pattern_History_Table-> in_BRANCH_COMPLETE_VAL       [i]))        (BRANCH_COMPLETE_VAL       [i]);
     75      (*(_Pattern_History_Table->out_BRANCH_COMPLETE_ACK       [i]))        (BRANCH_COMPLETE_ACK       [i]);
     76      (*(_Pattern_History_Table-> in_BRANCH_COMPLETE_ADDRESS   [i]))        (BRANCH_COMPLETE_ADDRESS  [i]);
     77      (*(_Pattern_History_Table-> in_BRANCH_COMPLETE_HISTORY   [i]))        (BRANCH_COMPLETE_HISTORY  [i]);
     78      (*(_Pattern_History_Table-> in_BRANCH_COMPLETE_DIRECTION [i]))        (BRANCH_COMPLETE_DIRECTION [i]);
    7979    }
    8080
     
    105105  Thistory_t history_max              = (1<<param._size_counter)-1;
    106106  Thistory_t history                  = 0;
    107   Tcontrol_t hit                      = 0;
     107  Tcontrol_t direction                = 0;
    108108
    109109  while (address<param._nb_counter)
    110110    {
    111       BRANCH_COMPLETE_VAL     [0].write(1);
    112       BRANCH_COMPLETE_ADDRESS [0].write(address);
    113       BRANCH_COMPLETE_HISTORY [0].write(0);
    114       BRANCH_COMPLETE_HIT    [0].write(0);
     111      BRANCH_COMPLETE_VAL       [0].write(1);
     112      BRANCH_COMPLETE_ADDRESS   [0].write(address);
     113      BRANCH_COMPLETE_HISTORY   [0].write(0);
     114      BRANCH_COMPLETE_DIRECTION [0].write(0);
    115115
    116116      sc_start(1);
     
    133133      address                  = rand() % param._nb_counter        ;
    134134      history                  = rand() % (1<<param._size_counter) ;
    135       hit                      = rand() % 2;
     135      direction                = rand() % 2;
    136136
    137137      cout << "{"+toString(static_cast<uint32_t>(sc_simulation_time()))+"} ["+toString(num_port_branch_complete)+"]" << endl
    138138           << hex
    139            << " - address     : " << address << endl
    140            << " - history old : " << history << endl
    141            << " - hit         : " << hit    << endl;
     139           << " - address     : " << address   << endl
     140           << " - history old : " << history   << endl
     141           << " - direction   : " << direction << endl;
    142142
    143       BRANCH_COMPLETE_VAL     [num_port_branch_complete].write(1);
    144       BRANCH_COMPLETE_ADDRESS [num_port_branch_complete].write(address);
    145       BRANCH_COMPLETE_HISTORY [num_port_branch_complete].write(history);
    146       BRANCH_COMPLETE_HIT     [num_port_branch_complete].write(hit);
     143      BRANCH_COMPLETE_VAL       [num_port_branch_complete].write(1);
     144      BRANCH_COMPLETE_ADDRESS   [num_port_branch_complete].write(address);
     145      BRANCH_COMPLETE_HISTORY   [num_port_branch_complete].write(history);
     146      BRANCH_COMPLETE_DIRECTION [num_port_branch_complete].write(direction);
    147147
    148148      // Wait Ack
     
    157157      PREDICT_ADDRESS         [num_port_predict        ].write(address);
    158158     
    159       history                  = (hit==1)?((history<history_max)?history+1:history):((history>0)?history-1:history);
     159      history                  = (direction==1)?((history<history_max)?history+1:history):((history>0)?history-1:history);
    160160     
    161161      // Wait Ack
Note: See TracChangeset for help on using the changeset viewer.