Ignore:
Timestamp:
Feb 9, 2009, 11:55:26 PM (15 years ago)
Author:
rosiere
Message:

1) RAT : Fix bug when update and event in same cycle
2) Context State : Compute depth
3) Load Store Unit : In check logic, translate all access in little endian. More easy to check
4) UFPT : End Event

Location:
trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end
Files:
19 edited

Legend:

Unmodified
Added
Removed
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Context_State/SelfTest/config_min.cfg

    r98 r106  
    331       1       +1      # nb_decod_unit
    441       1       +1      # nb_inst_branch_complete
    5 0       0       +1      # size_depth                    [0] [nb_context]
     51       1       +1      # nb_inst_branch_speculated     [0] [nb_context]
    6632      32      +1      # size_general_data             
    771       1       +1      # size_inst_decod               [0] [nb_decod_unit]
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Context_State/SelfTest/config_mono_context.cfg

    r98 r106  
    331       1       *4      # nb_decod_unit
    441       4       *4      # nb_inst_branch_complete
    5 0       2       +1      # size_depth                    [0] [nb_context]
     51       4       *2      # nb_inst_branch_speculated     [0] [nb_context]
    6632      32      +1      # size_general_data             
    771       4       *4      # size_inst_decod               [0] [nb_decod_unit]
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Context_State/SelfTest/config_multi_context.cfg

    r98 r106  
    334       4       *4      # nb_decod_unit
    442       2       *4      # nb_inst_branch_complete
    5 4       4       +1      # size_depth                    [0] [nb_context]
    6 2       2       +1      # size_depth                    [1] [nb_context]
    7 1       1       +1      # size_depth                    [2] [nb_context]
    8 0       0       +1      # size_depth                    [3] [nb_context]
    9 4       4       +1      # size_depth                    [4] [nb_context]
    10 2       2       +1      # size_depth                    [5] [nb_context]
    11 1       1       +1      # size_depth                    [6] [nb_context]
    12 0       0       +1      # size_depth                    [7] [nb_context]
     56       6       +1      # nb_inst_branch_speculated     [0] [nb_context]
     63       3       +1      # nb_inst_branch_speculated     [1] [nb_context]
     72       2       +1      # nb_inst_branch_speculated     [2] [nb_context]
     81       1       +1      # nb_inst_branch_speculated     [3] [nb_context]
     98       8       +1      # nb_inst_branch_speculated     [4] [nb_context]
     104       4       +1      # nb_inst_branch_speculated     [5] [nb_context]
     112       2       +1      # nb_inst_branch_speculated     [6] [nb_context]
     121       1       +1      # nb_inst_branch_speculated     [7] [nb_context]
    131332      32      +1      # size_general_data             
    14144       4       *4      # size_inst_decod               [0] [nb_decod_unit]
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Context_State/SelfTest/src/main.cpp

    r98 r106  
    1717  err (_(" * nb_decod_unit                                 (uint32_t)\n"));
    1818  err (_(" * nb_inst_branch_complete                       (uint32_t)\n"));
    19   err (_(" * size_depth                    [nb_context]    (uint32_t)\n"));
     19  err (_(" * nb_inst_branch_speculated     [nb_context]    (uint32_t)\n"));
    2020  err (_(" * size_general_data                             (uint32_t)\n"));
    2121  err (_(" * size_inst_decod               [nb_decod_unit] (uint32_t)\n"));
     
    4848    usage (argc, argv);
    4949
    50   uint32_t * _size_depth                    = new uint32_t [_nb_context];
     50  uint32_t * _nb_inst_branch_speculated     = new uint32_t [_nb_context];
    5151  for (uint32_t i=0; i<_nb_context; i++)
    52     _size_depth [i] = fromString<uint32_t>(argv[x++]);
     52    _nb_inst_branch_speculated [i] = fromString<uint32_t>(argv[x++]);
    5353
    5454  uint32_t   _size_general_data = fromString<uint32_t>(argv[x++]);
     
    6969         _nb_decod_unit                ,
    7070         _nb_inst_branch_complete      ,
    71          _size_depth                   ,
     71         _nb_inst_branch_speculated    ,
    7272         _size_general_data            ,
    7373         _size_inst_decod              ,
     
    8787    }
    8888
    89   delete [] _size_depth;                   
     89  delete [] _nb_inst_branch_speculated;                   
    9090  delete [] _size_inst_decod;             
    9191  delete [] _link_context_to_decod_unit;   
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Context_State/SelfTest/src/test.cpp

    r105 r106  
    275275      for (uint32_t i=0; i<_param->_nb_context; i++)
    276276        if (_param->_have_port_depth)
    277           in_DEPTH_MIN  [i]->write((_param->_array_size_depth[i]==0)?0:(i%_param->_array_size_depth[i]));
     277          in_DEPTH_MIN  [i]->write((log2(_param->_nb_inst_branch_speculated[i])==0)?0:(i%log2(_param->_nb_inst_branch_speculated[i])));
    278278     
    279279      uint32_t context    = rand()%_param->_nb_context;
     
    295295          in_DECOD_EVENT_ADDRESS_EPCR  [port]->write(0xdeadbeef);
    296296          if (_param->_have_port_depth)
    297           in_DECOD_EVENT_DEPTH         [port]->write((_param->_array_size_depth[context]==0)?0:((context+1)%_param->_array_size_depth[context]));
     297          in_DECOD_EVENT_DEPTH         [port]->write((log2(_param->_nb_inst_branch_speculated[context])==0)?0:((context+1)%log2(_param->_nb_inst_branch_speculated[context])));
    298298          in_DECOD_EVENT_TYPE          [port]->write(EVENT_TYPE_MSYNC);
    299299         
     
    350350          in_DECOD_EVENT_ADDRESS_EPCR  [port]->write(0xdeadbebe);
    351351          if (_param->_have_port_depth)
    352           in_DECOD_EVENT_DEPTH         [port]->write((_param->_array_size_depth[context]==0)?0:((context+1)%_param->_array_size_depth[context]));
     352          in_DECOD_EVENT_DEPTH         [port]->write((log2(_param->_nb_inst_branch_speculated[context])==0)?0:((context+1)%log2(_param->_nb_inst_branch_speculated[context])));
    353353          in_DECOD_EVENT_TYPE          [port]->write(EVENT_TYPE_PSYNC);
    354354         
     
    428428          in_DECOD_EVENT_ADDRESS_EPCR  [port]->write(0xdead0300);
    429429          if (_param->_have_port_depth)
    430           in_DECOD_EVENT_DEPTH         [port]->write((_param->_array_size_depth[context]==0)?0:((context+1)%_param->_array_size_depth[context]));
     430          in_DECOD_EVENT_DEPTH         [port]->write((log2(_param->_nb_inst_branch_speculated[context])==0)?0:((context+1)%log2(_param->_nb_inst_branch_speculated[context])));
    431431          in_DECOD_EVENT_TYPE          [port]->write(EVENT_TYPE_CSYNC);
    432432         
     
    507507          in_DECOD_EVENT_ADDRESS_EPCR  [port]->write(0xdead0400);
    508508          if (_param->_have_port_depth)
    509           in_DECOD_EVENT_DEPTH         [port]->write((_param->_array_size_depth[context]==0)?0:((context+1)%_param->_array_size_depth[context]));
     509          in_DECOD_EVENT_DEPTH         [port]->write((log2(_param->_nb_inst_branch_speculated[context])==0)?0:((context+1)%log2(_param->_nb_inst_branch_speculated[context])));
    510510          in_DECOD_EVENT_TYPE          [port]->write(EVENT_TYPE_SPR_ACCESS);
    511511         
     
    559559//        in_BRANCH_COMPLETE_CONTEXT_ID       [port]->write(context);
    560560//        if (_param->_have_port_depth)
    561 //        in_BRANCH_COMPLETE_DEPTH            [port]->write((_param->_array_size_depth[context]==0)?0:((context+1)%_param->_array_size_depth[context]));
     561//        in_BRANCH_COMPLETE_DEPTH            [port]->write((log2(_param->_nb_inst_branch_speculated[context])==0)?0:((context+1)%log2(_param->_nb_inst_branch_speculated[context])));
    562562//        in_BRANCH_COMPLETE_ADDRESS_SRC      [port]->write(0x400);
    563563//        in_BRANCH_COMPLETE_ADDRESS_DEST     [port]->write(0x500);
     
    580580         
    581581          if (_param->_have_port_depth)
    582           in_BRANCH_EVENT_DEPTH            [port]->write((_param->_array_size_depth[context]==0)?0:((context+1)%_param->_array_size_depth[context]));
     582          in_BRANCH_EVENT_DEPTH            [port]->write((log2(_param->_nb_inst_branch_speculated[context])==0)?0:((context+1)%log2(_param->_nb_inst_branch_speculated[context])));
    583583          in_BRANCH_EVENT_ADDRESS_SRC      [port]->write(0x400);
    584584          in_BRANCH_EVENT_ADDRESS_DEST     [port]->write(0x500);
     
    649649//        in_BRANCH_COMPLETE_CONTEXT_ID       [port]->write(context);
    650650//        if (_param->_have_port_depth)
    651 //        in_BRANCH_COMPLETE_DEPTH            [port]->write((_param->_array_size_depth[context]==0)?0:((context+1)%_param->_array_size_depth[context]));
     651//        in_BRANCH_COMPLETE_DEPTH            [port]->write((log2(_param->_nb_inst_branch_speculated[context])==0)?0:((context+1)%log2(_param->_nb_inst_branch_speculated[context])));
    652652//        in_BRANCH_COMPLETE_ADDRESS_SRC      [port]->write(0x600);
    653653//        in_BRANCH_COMPLETE_ADDRESS_DEST     [port]->write(0x700);
     
    669669          uint32_t port = context;
    670670         
    671           in_BRANCH_EVENT_DEPTH            [port]->write((_param->_array_size_depth[context]==0)?0:((context+1)%_param->_array_size_depth[context]));
     671          in_BRANCH_EVENT_DEPTH            [port]->write((log2(_param->_nb_inst_branch_speculated[context])==0)?0:((context+1)%log2(_param->_nb_inst_branch_speculated[context])));
    672672          in_BRANCH_EVENT_ADDRESS_SRC      [port]->write(0x600);
    673673          in_BRANCH_EVENT_ADDRESS_DEST     [port]->write(0x700);
     
    736736          in_DECOD_EVENT_CONTEXT_ID       [port]->write(context);
    737737          if (_param->_have_port_depth)
    738           in_DECOD_EVENT_DEPTH            [port]->write((_param->_array_size_depth[context]==0)?0:((context)%_param->_array_size_depth[context]));
     738          in_DECOD_EVENT_DEPTH            [port]->write((log2(_param->_nb_inst_branch_speculated[context])==0)?0:((context)%log2(_param->_nb_inst_branch_speculated[context])));
    739739          in_DECOD_EVENT_TYPE             [port]->write(EVENT_TYPE_EXCEPTION);
    740740          in_DECOD_EVENT_IS_DELAY_SLOT    [port]->write(0);
     
    830830          in_DECOD_EVENT_CONTEXT_ID       [port]->write(context);
    831831          if (_param->_have_port_depth)
    832           in_DECOD_EVENT_DEPTH            [port]->write((_param->_array_size_depth[context]==0)?0:((context)%_param->_array_size_depth[context]));
     832          in_DECOD_EVENT_DEPTH            [port]->write((log2(_param->_nb_inst_branch_speculated[context])==0)?0:((context)%log2(_param->_nb_inst_branch_speculated[context])));
    833833          in_DECOD_EVENT_TYPE             [port]->write(EVENT_TYPE_EXCEPTION);
    834834          in_DECOD_EVENT_IS_DELAY_SLOT    [port]->write(1);
     
    922922          in_COMMIT_EVENT_CONTEXT_ID       ->write(context);
    923923          if (_param->_have_port_depth)
    924           in_COMMIT_EVENT_DEPTH            ->write((_param->_array_size_depth[context]==0)?0:((context)%_param->_array_size_depth[context]));
     924          in_COMMIT_EVENT_DEPTH            ->write((log2(_param->_nb_inst_branch_speculated[context])==0)?0:((context)%log2(_param->_nb_inst_branch_speculated[context])));
    925925          in_COMMIT_EVENT_TYPE             ->write(EVENT_TYPE_EXCEPTION);
    926926          in_COMMIT_EVENT_IS_DELAY_SLOT    ->write(0);
     
    10171017          in_COMMIT_EVENT_CONTEXT_ID       ->write(context);
    10181018          if (_param->_have_port_depth)
    1019           in_COMMIT_EVENT_DEPTH            ->write((_param->_array_size_depth[context]==0)?0:((context)%_param->_array_size_depth[context]));
     1019          in_COMMIT_EVENT_DEPTH            ->write((log2(_param->_nb_inst_branch_speculated[context])==0)?0:((context)%log2(_param->_nb_inst_branch_speculated[context])));
    10201020          in_COMMIT_EVENT_TYPE             ->write(EVENT_TYPE_EXCEPTION);
    10211021          in_COMMIT_EVENT_IS_DELAY_SLOT    ->write(1);
     
    11121112          in_COMMIT_EVENT_CONTEXT_ID       ->write(context);
    11131113          if (_param->_have_port_depth)
    1114           in_COMMIT_EVENT_DEPTH            ->write((_param->_array_size_depth[context]==0)?0:((context)%_param->_array_size_depth[context]));
     1114          in_COMMIT_EVENT_DEPTH            ->write((log2(_param->_nb_inst_branch_speculated[context])==0)?0:((context)%log2(_param->_nb_inst_branch_speculated[context])));
    11151115          in_COMMIT_EVENT_TYPE             ->write(EVENT_TYPE_EXCEPTION);
    11161116          in_COMMIT_EVENT_IS_DELAY_SLOT    ->write(0);
     
    12071207          in_COMMIT_EVENT_CONTEXT_ID       ->write(context);
    12081208          if (_param->_have_port_depth)
    1209           in_COMMIT_EVENT_DEPTH            ->write((_param->_array_size_depth[context]==0)?0:((context)%_param->_array_size_depth[context]));
     1209          in_COMMIT_EVENT_DEPTH            ->write((log2(_param->_nb_inst_branch_speculated[context])==0)?0:((context)%log2(_param->_nb_inst_branch_speculated[context])));
    12101210          in_COMMIT_EVENT_TYPE             ->write(EVENT_TYPE_EXCEPTION);
    12111211          in_COMMIT_EVENT_IS_DELAY_SLOT    ->write(1);
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Context_State/include/Parameters.h

    r98 r106  
    2727  public : uint32_t   _nb_decod_unit                ;
    2828  public : uint32_t   _nb_inst_branch_complete      ;
    29   public : uint32_t * _array_size_depth             ; //[nb_context]
     29  public : uint32_t * _nb_inst_branch_speculated    ; //[nb_context]
    3030//public : uint32_t * _size_depth                   ; //[nb_context]
    3131//public : uint32_t   _size_general_data            ;
     
    3838                        uint32_t   nb_decod_unit,
    3939                        uint32_t   nb_inst_branch_complete,
    40                         uint32_t * size_depth,               
     40                        uint32_t * nb_inst_branch_speculated,
    4141                        uint32_t   size_general_data,
    4242                        uint32_t * size_nb_inst_decod,           
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Context_State/src/Context_State_transition.cpp

    r105 r106  
    196196              log_printf(TRACE,Context_State,FUNCTION,"  * BRANCH_EVENT [%d]",i);
    197197
    198 //               throw ERRORMORPHEO(FUNCTION,_("Not yet implemented (Comming Soon).\n"));
    199 
    200198              context_state_t state = reg_STATE [i];
    201199
     
    203201              Tdepth_t   depth_cur  = reg_EVENT_DEPTH [i];
    204202              Tdepth_t   depth_min  = (_param->_have_port_depth)?PORT_READ(in_DEPTH_MIN [i]):0;
    205               Tdepth_t   depth_max  = _param->_array_size_depth [i];
     203              Tdepth_t   depth_max  = _param->_nb_inst_branch_speculated [i];
    206204             
    207 //               Tdepth_t   depth0     = (depth_cur>=depth_min)?(depth_cur-depth_min):((depth_cur+depth_max-depth_min));
    208 //               Tdepth_t   depth1     = (depth    >=depth_min)?(depth    -depth_min):((depth    +depth_max-depth_min));
    209               Tdepth_t   depth0     = (depth_cur>=depth_min)?(depth_cur):((depth_cur+depth_max));
    210               Tdepth_t   depth1     = (depth    >=depth_min)?(depth    ):((depth    +depth_max));
     205              Tdepth_t   depth0     = (depth_cur>=depth_min)?(depth_cur-depth_min):((depth_cur+depth_max-depth_min));
     206              Tdepth_t   depth1     = (depth    >=depth_min)?(depth    -depth_min):((depth    +depth_max-depth_min));
     207//               Tdepth_t   depth0     = (depth_cur>=depth_min)?(depth_cur):((depth_cur+depth_max));
     208//               Tdepth_t   depth1     = (depth    >=depth_min)?(depth    ):((depth    +depth_max));
    211209
    212210              // priority : miss > excep > spr/sync
    213               uint8_t    priority0  = ((state == CONTEXT_STATE_KO_MISS_BRANCH_ADDR) or (state == CONTEXT_STATE_KO_MISS_LOAD_ADDR) or (state == CONTEXT_STATE_KO_MISS_BRANCH_WAITEND) or (state == CONTEXT_STATE_KO_MISS_LOAD_WAITEND))?2:((state == EVENT_TYPE_EXCEPTION)?1:0);
     211              uint8_t    priority0  = ((state == CONTEXT_STATE_KO_MISS_BRANCH_ADDR   ) or
     212                                       (state == CONTEXT_STATE_KO_MISS_LOAD_ADDR     ) or
     213                                       (state == CONTEXT_STATE_KO_MISS_BRANCH_WAITEND) or
     214                                       (state == CONTEXT_STATE_KO_MISS_LOAD_WAITEND  ))?2:((state == EVENT_TYPE_EXCEPTION)?1:0);
    214215              uint8_t    priority1  = 2; // miss
    215216
     
    217218              //   if context_state_ok : yes
    218219              //   if context_state_ko : test the depth, and the priority of event
    219 
    220220              bool       is_valid   = ((state == CONTEXT_STATE_OK) or
    221221                                       (depth1< depth0) or
    222222                                       ((depth1==depth0) and (priority1>=priority0))); // >= because another branch can be a miss prediction with same depth
     223
     224              log_printf(TRACE,Context_State,FUNCTION,"    * depth     : %d",depth     );
     225              log_printf(TRACE,Context_State,FUNCTION,"    * depth_cur : %d",depth_cur );
     226              log_printf(TRACE,Context_State,FUNCTION,"    * depth_min : %d",depth_min );
     227              log_printf(TRACE,Context_State,FUNCTION,"    * depth_max : %d",depth_max );
     228              log_printf(TRACE,Context_State,FUNCTION,"    * depth0    : %d",depth0    );
     229              log_printf(TRACE,Context_State,FUNCTION,"    * depth1    : %d",depth1    );
     230              log_printf(TRACE,Context_State,FUNCTION,"    * priority0 : %d",priority0 );
     231              log_printf(TRACE,Context_State,FUNCTION,"    * priority1 : %d",priority1 );
     232              log_printf(TRACE,Context_State,FUNCTION,"  * is_valid    : %d",is_valid  );
    223233
    224234              if (is_valid)
     
    251261              Tdepth_t   depth_cur  = reg_EVENT_DEPTH [context];
    252262              Tdepth_t   depth_min = (_param->_have_port_depth      )?PORT_READ(in_DEPTH_MIN [context]):0;
    253               Tdepth_t   depth_max  = _param->_array_size_depth [context];
     263              Tdepth_t   depth_max  = _param->_nb_inst_branch_speculated [context];
    254264             
    255 //               Tdepth_t   depth0     = (depth_cur>=depth_min)?(depth_cur-depth_min):((depth_cur+depth_max-depth_min));
    256 //               Tdepth_t   depth1     = (depth    >=depth_min)?(depth    -depth_min):((depth    +depth_max-depth_min));
    257               Tdepth_t   depth0     = (depth_cur>=depth_min)?(depth_cur):((depth_cur+depth_max));
    258               Tdepth_t   depth1     = (depth    >=depth_min)?(depth    ):((depth    +depth_max));
     265              Tdepth_t   depth0     = (depth_cur>=depth_min)?(depth_cur-depth_min):((depth_cur+depth_max-depth_min));
     266              Tdepth_t   depth1     = (depth    >=depth_min)?(depth    -depth_min):((depth    +depth_max-depth_min));
     267//               Tdepth_t   depth0     = (depth_cur>=depth_min)?(depth_cur):((depth_cur+depth_max));
     268//               Tdepth_t   depth1     = (depth    >=depth_min)?(depth    ):((depth    +depth_max));
    259269
    260270              context_state_t state = reg_STATE [context];
     
    262272             
    263273              // miss > excep > spr/sync
    264               uint8_t    priority0  = ((state == CONTEXT_STATE_KO_MISS_BRANCH_ADDR) or (state == CONTEXT_STATE_KO_MISS_LOAD_ADDR) or (state == CONTEXT_STATE_KO_MISS_BRANCH_WAITEND) or (state == CONTEXT_STATE_KO_MISS_LOAD_WAITEND))?2:((state == CONTEXT_STATE_KO_EXCEP)?1:0);
     274              uint8_t    priority0  = ((state == CONTEXT_STATE_KO_MISS_BRANCH_ADDR   ) or
     275                                       (state == CONTEXT_STATE_KO_MISS_LOAD_ADDR     ) or
     276                                       (state == CONTEXT_STATE_KO_MISS_BRANCH_WAITEND) or
     277                                       (state == CONTEXT_STATE_KO_MISS_LOAD_WAITEND  ))?2:((state == CONTEXT_STATE_KO_EXCEP)?1:0);
    265278              uint8_t    priority1  = (state == EVENT_TYPE_EXCEPTION)?1:0;
    266279
     
    272285                                       (depth1< depth0) or
    273286                                       ((depth1==depth0) and (priority1>=priority0)));
     287
     288              log_printf(TRACE,Context_State,FUNCTION,"    * depth     : %d",depth     );
     289              log_printf(TRACE,Context_State,FUNCTION,"    * depth_cur : %d",depth_cur );
     290              log_printf(TRACE,Context_State,FUNCTION,"    * depth_min : %d",depth_min );
     291              log_printf(TRACE,Context_State,FUNCTION,"    * depth_max : %d",depth_max );
     292              log_printf(TRACE,Context_State,FUNCTION,"    * depth0    : %d",depth0    );
     293              log_printf(TRACE,Context_State,FUNCTION,"    * depth1    : %d",depth1    );
     294              log_printf(TRACE,Context_State,FUNCTION,"    * priority0 : %d",priority0 );
     295              log_printf(TRACE,Context_State,FUNCTION,"    * priority1 : %d",priority1 );
     296              log_printf(TRACE,Context_State,FUNCTION,"  * is_valid    : %d",is_valid  );
    274297
    275298              if (is_valid)
     
    371394            Tdepth_t   depth_cur  = reg_EVENT_DEPTH [context];
    372395            Tdepth_t   depth_min = (_param->_have_port_depth     )?PORT_READ(in_DEPTH_MIN [context]):0;
    373             Tdepth_t   depth_max  = _param->_array_size_depth [context];
     396            Tdepth_t   depth_max  = _param->_nb_inst_branch_speculated [context];
    374397           
    375 //          Tdepth_t   depth0     = (depth_cur>=depth_min)?(depth_cur-depth_min):((depth_cur+depth_max-depth_min));
    376 //          Tdepth_t   depth1     = (depth    >=depth_min)?(depth    -depth_min):((depth    +depth_max-depth_min));
    377             Tdepth_t   depth0     = (depth_cur>=depth_min)?(depth_cur):((depth_cur+depth_max));
    378             Tdepth_t   depth1     = (depth    >=depth_min)?(depth    ):((depth    +depth_max));
     398            Tdepth_t   depth0     = (depth_cur>=depth_min)?(depth_cur-depth_min):((depth_cur+depth_max-depth_min));
     399            Tdepth_t   depth1     = (depth    >=depth_min)?(depth    -depth_min):((depth    +depth_max-depth_min));
     400//             Tdepth_t   depth0     = (depth_cur>=depth_min)?(depth_cur):((depth_cur+depth_max));
     401//             Tdepth_t   depth1     = (depth    >=depth_min)?(depth    ):((depth    +depth_max));
    379402
    380403            context_state_t state = reg_STATE [context];
     
    382405           
    383406            // miss > excep > spr/sync
    384             uint8_t    priority0  = ((state == CONTEXT_STATE_KO_MISS_BRANCH_ADDR) or (state == CONTEXT_STATE_KO_MISS_LOAD_ADDR) or (state == CONTEXT_STATE_KO_MISS_BRANCH_WAITEND) or (state == CONTEXT_STATE_KO_MISS_LOAD_WAITEND))?2:((state == CONTEXT_STATE_KO_EXCEP)?1:0);
     407            uint8_t    priority0  = ((state == CONTEXT_STATE_KO_MISS_BRANCH_ADDR   ) or
     408                                     (state == CONTEXT_STATE_KO_MISS_LOAD_ADDR     ) or
     409                                     (state == CONTEXT_STATE_KO_MISS_BRANCH_WAITEND) or
     410                                     (state == CONTEXT_STATE_KO_MISS_LOAD_WAITEND  ))?2:((state == CONTEXT_STATE_KO_EXCEP)?1:0);
    385411            uint8_t    priority1  = (state == EVENT_TYPE_EXCEPTION)?1:2; // else load_miss_speculation (EVENT_TYPE_MISS_SPECULATION)
    386412
     
    392418                                     (depth1< depth0) or
    393419                                     ((depth1==depth0) and (priority1>=priority0)));
     420
     421            log_printf(TRACE,Context_State,FUNCTION,"    * depth     : %d",depth     );
     422            log_printf(TRACE,Context_State,FUNCTION,"    * depth_cur : %d",depth_cur );
     423            log_printf(TRACE,Context_State,FUNCTION,"    * depth_min : %d",depth_min );
     424            log_printf(TRACE,Context_State,FUNCTION,"    * depth_max : %d",depth_max );
     425            log_printf(TRACE,Context_State,FUNCTION,"    * depth0    : %d",depth0    );
     426            log_printf(TRACE,Context_State,FUNCTION,"    * depth1    : %d",depth1    );
     427            log_printf(TRACE,Context_State,FUNCTION,"    * priority0 : %d",priority0 );
     428            log_printf(TRACE,Context_State,FUNCTION,"    * priority1 : %d",priority1 );
     429            log_printf(TRACE,Context_State,FUNCTION,"  * is_valid    : %d",is_valid  );
    394430
    395431            if (is_valid)
     
    427463
    428464        // -------------------------------------------------------------------
    429         // -----[ BRANCH_COMPLETE ]-------------------------------------------
    430         // -------------------------------------------------------------------
    431 
    432 //         for (uint32_t i=0; i<_param->_nb_inst_branch_complete; i++)
    433 //           if (PORT_READ(in_BRANCH_COMPLETE_VAL [i]) and internal_BRANCH_COMPLETE_ACK [i])
    434 //             {
    435 //               log_printf(TRACE,Context_State,FUNCTION,"  * BRANCH_COMPLETE [%d]",i);
    436 //               if (PORT_READ(in_BRANCH_COMPLETE_MISS_PREDICTION [i]))
    437 //                 {
    438 //                   Tcontext_t context    = (_param->_have_port_context_id)?PORT_READ(in_BRANCH_COMPLETE_CONTEXT_ID [i]):0;
    439 //                   Tdepth_t   depth      = (_param->_have_port_depth     )?PORT_READ(in_BRANCH_COMPLETE_DEPTH      [i]):0;
    440 //                   Tdepth_t   depth_cur  = reg_EVENT_DEPTH [context];
    441 //                   Tdepth_t   depth_min = (_param->_have_port_depth     )?PORT_READ(in_DEPTH_MIN [context]):0;
    442 //                   Tdepth_t   depth_max  = _param->_array_size_depth [context];
    443                  
    444 // //                   Tdepth_t   depth0     = (depth_cur>=depth_min)?(depth_cur-depth_min):((depth_cur+depth_max-depth_min));
    445 // //                   Tdepth_t   depth1     = (depth    >=depth_min)?(depth    -depth_min):((depth    +depth_max-depth_min));
    446 //                   Tdepth_t   depth0     = (depth_cur>=depth_min)?(depth_cur):((depth_cur+depth_max));
    447 //                   Tdepth_t   depth1     = (depth    >=depth_min)?(depth    ):((depth    +depth_max));
    448                  
    449 //                   context_state_t state = reg_STATE [context];
    450                  
    451 //                   // miss > excep > spr/sync
    452 //                   uint8_t    priority0  = ((state == CONTEXT_STATE_KO_MISS_BRANCH_ADDR) or (state == CONTEXT_STATE_KO_MISS_LOAD_ADDR) or (state == CONTEXT_STATE_KO_MISS_BRANCH_WAITEND) or (state == CONTEXT_STATE_KO_MISS_LOAD_WAITEND))?2:((state == CONTEXT_STATE_KO_EXCEP)?1:0);
    453 //                   uint8_t    priority1  = 2; // miss
    454                  
    455 //                   // is_valid = can modify local information
    456 //                   //  if context_state_ok : yes
    457 //                   //  if context_state_ko : test the depth, and the priority of envent
    458                  
    459 //                   bool       is_valid   = ((state == CONTEXT_STATE_OK) or
    460 //                                            (depth1< depth0) or
    461 //                                            ((depth1==depth0) and (priority1>=priority0)));
    462                  
    463 //                   if (is_valid)
    464 //                     {
    465 //                       // commit
    466 //                       Tcontrol_t take = PORT_READ(in_BRANCH_COMPLETE_TAKE [i]);
    467 //                       reg_STATE                  [context] = CONTEXT_STATE_KO_MISS;
    468 //                       reg_EVENT_ADDRESS          [context] = PORT_READ(in_BRANCH_COMPLETE_ADDRESS_SRC  [i])+1; //DELAY_SLOT
    469 //                       reg_EVENT_ADDRESS_EPCR     [context] = PORT_READ(in_BRANCH_COMPLETE_ADDRESS_DEST [i]);
    470 //                       reg_EVENT_ADDRESS_EPCR_VAL [context] = take; // if not take : in sequence
    471 //                     //reg_EVENT_ADDRESS_EEAR     [context];
    472 //                       reg_EVENT_ADDRESS_EEAR_VAL [context] = 0;
    473 //                       reg_EVENT_IS_DELAY_SLOT    [context] = take;
    474 //                       reg_EVENT_IS_DS_TAKE       [context] = take;
    475 //                       reg_EVENT_DEPTH            [context] = depth;
    476 //                     }
    477 //                 }
    478 //             }
    479 
    480         // -------------------------------------------------------------------
    481465        // -----[ EVENT ]-----------------------------------------------------
    482466        // -------------------------------------------------------------------
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Context_State/src/Parameters.cpp

    r98 r106  
    2222                          uint32_t   nb_decod_unit,
    2323                          uint32_t   nb_inst_branch_complete,
    24                           uint32_t * size_depth,               
     24                          uint32_t * nb_inst_branch_speculated,               
    2525                          uint32_t   size_general_data,
    2626                          uint32_t * size_nb_inst_decod,           
     
    3434    _nb_decod_unit                 = nb_decod_unit                ;
    3535    _nb_inst_branch_complete       = nb_inst_branch_complete      ;
    36     _array_size_depth              = size_depth                   ;
     36    _nb_inst_branch_speculated     = nb_inst_branch_speculated    ;
    3737//  _size_general_data             = size_general_data            ;
    3838//  _size_nb_inst_decod            = size_nb_inst_decod           ;
     
    4545      {
    4646        _size_context_id               = log2(_nb_context);
    47         _size_depth                    = log2(max<uint32_t>(size_depth,_nb_context));
     47        _size_depth                    = log2(max<uint32_t>(nb_inst_branch_speculated,_nb_context));
    4848        _size_general_data             = size_general_data;
    4949        _size_instruction_address      = size_general_data-2;
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Decod_unit/Decod_queue/src/Decod_queue_genMealy_decod_out.cpp

    r105 r106  
    8585            else
    8686              {
    87                 // Cusume the instruction (to erase)
     87                // Consume the instruction (to erase)
    8888                internal_DECOD_OUT_ACK [i] = 1;
    8989              }
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Prediction_unit_Glue/src/Prediction_unit_Glue_genMealy_predict.cpp

    r101 r106  
    144144                //   * BTB hit and the branchement is the PC current and it's the last slot.
    145145                //     -> next pc must be the delay slot
    146                 if ((not pc_current_is_ds_take) and // if pc_current is ds_take, alors pc_next is the destination of branchement
     146                if ((not pc_current_is_ds_take) and // if pc_current is ds_take, then pc_next is the destination of branchement
    147147                    (address_src_lsb == (_param->_nb_instruction [context]-1)))
    148148                  {
     
    173173                          log_printf(TRACE,Prediction_unit_Glue,FUNCTION,"      * BRANCH_CONDITION_NONE_WITHOUT_WRITE_STACK");
    174174                         
    175                           // use none unit (dir, upt and ras)
     175                          // use none unit (dir and ras)
     176                          use_upt      = true;
    176177                          direction    = true;
    177178                          pc_next      = address_dest;
     
    324325                               );
    325326                   
     327                    log_printf(TRACE,Prediction_unit_Glue,FUNCTION,"    * btb_{     val, ack}   :    %d, %d",        btb_val, btb_ack);
     328                    log_printf(TRACE,Prediction_unit_Glue,FUNCTION,"    * dir_{use, val, ack}   : %d, %d, %d",use_dir,dir_val, dir_ack);
     329                    log_printf(TRACE,Prediction_unit_Glue,FUNCTION,"    * ras_{use, val, ack}   : %d, %d, %d",use_ras,ras_val, ras_ack);
     330                    log_printf(TRACE,Prediction_unit_Glue,FUNCTION,"    * upt_{use, val, ack}   : %d, %d, %d",use_upt,upt_val, upt_ack);
     331
     332                   
    326333//                  pc_next      - is previously computed
    327334//                  branch_state - is previously computed
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Update_Prediction_Table/SelfTest/src/test.cpp

    r105 r106  
    14241424                 (upt_top    [context] != out_DEPTH_MAX [context]->read()))
    14251425            SC_START(1);
    1426 
    14271426        }
    14281427      }
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Update_Prediction_Table/include/Types.h

    r105 r106  
    4747      UPDATE_PREDICTION_STATE_KO                , // this branch is a miss prediction
    4848      UPDATE_PREDICTION_STATE_EVENT             , // previous branch is a miss prediction
    49       UPDATE_PREDICTION_STATE_END_OK            , // branch is updated,       update pointer
    50       UPDATE_PREDICTION_STATE_END_KO_WAIT_END   , // branch is updated, don't update pointer
     49      UPDATE_PREDICTION_STATE_END               , // update pointer
     50//    UPDATE_PREDICTION_STATE_END_OK            , // branch is updated,       update pointer
     51//    UPDATE_PREDICTION_STATE_END_KO_WAIT_END   , // branch is updated, don't update pointer
    5152      UPDATE_PREDICTION_STATE_END_KO              // branch is updated, don't update pointer
    5253    } upt_state_t;
     
    153154      case morpheo::behavioural::core::multi_front_end::front_end::prediction_unit::update_prediction_table::UPDATE_PREDICTION_STATE_KO         : return "ko"        ; break;
    154155      case morpheo::behavioural::core::multi_front_end::front_end::prediction_unit::update_prediction_table::UPDATE_PREDICTION_STATE_EVENT      : return "event"     ; break;
    155       case morpheo::behavioural::core::multi_front_end::front_end::prediction_unit::update_prediction_table::UPDATE_PREDICTION_STATE_END_OK     : return "end_ok"    ; break;
    156       case morpheo::behavioural::core::multi_front_end::front_end::prediction_unit::update_prediction_table::UPDATE_PREDICTION_STATE_END_KO_WAIT_END: return "end_ko_wait_end"    ; break;
     156      case morpheo::behavioural::core::multi_front_end::front_end::prediction_unit::update_prediction_table::UPDATE_PREDICTION_STATE_END        : return "end"       ; break;
     157//    case morpheo::behavioural::core::multi_front_end::front_end::prediction_unit::update_prediction_table::UPDATE_PREDICTION_STATE_END_OK     : return "end_ok"    ; break;
     158//    case morpheo::behavioural::core::multi_front_end::front_end::prediction_unit::update_prediction_table::UPDATE_PREDICTION_STATE_END_KO_WAIT_END: return "end_ko_wait_end"    ; break;
    157159      case morpheo::behavioural::core::multi_front_end::front_end::prediction_unit::update_prediction_table::UPDATE_PREDICTION_STATE_END_KO     : return "end_ko"    ; break;
    158160      default    : return ""      ; break;
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Update_Prediction_Table/include/Update_Prediction_Table.h

    r105 r106  
    168168  private   : uint32_t                      * reg_UFPT_UPDATE                    ; //[nb_context]
    169169  private   : uint32_t                      * reg_UFPT_NB_NEED_UPDATE            ; //[nb_context]
     170  private   : uint32_t                      * reg_UFPT_NB_UPDATE                 ; //[nb_context]
    170171                                                                                             
    171172  private   : upt_entry_t                  ** reg_UPDATE_PREDICTION_TABLE        ; //[nb_context][size_upt_queue]
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Update_Prediction_Table/src/Update_Prediction_Table_allocation.cpp

    r105 r106  
    197197    ALLOC1(reg_UFPT_UPDATE                  ,uint32_t     ,_param->_nb_context);
    198198    ALLOC1(reg_UFPT_NB_NEED_UPDATE          ,uint32_t     ,_param->_nb_context);
     199    ALLOC1(reg_UFPT_NB_UPDATE               ,uint32_t     ,_param->_nb_context);
    199200                                                         
    200201    ALLOC2(reg_UPDATE_PREDICTION_TABLE      ,upt_entry_t  ,_param->_nb_context,_param->_size_upt_queue[it1]);
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Update_Prediction_Table/src/Update_Prediction_Table_deallocation.cpp

    r105 r106  
    150150        DELETE1(reg_UFPT_UPDATE                  ,_param->_nb_context);
    151151        DELETE1(reg_UFPT_NB_NEED_UPDATE          ,_param->_nb_context);
     152        DELETE1(reg_UFPT_NB_UPDATE               ,_param->_nb_context);
    152153       
    153154        DELETE2(reg_UPDATE_PREDICTION_TABLE      ,_param->_nb_context,_param->_size_upt_queue[it1]);
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Update_Prediction_Table/src/Update_Prediction_Table_genMoore.cpp

    r105 r106  
    6161    bool     retire_ras_from_ufpt [_param->_nb_context]; // event ufpt -> restore RAS, else update upt
    6262    bool     retire_ras_from_upt  [_param->_nb_context]; // event upt  -> restore RAS, else restore others structure
    63 //     bool     have_event           [_param->_nb_context];
     63//  bool     have_event           [_param->_nb_context];
    6464    bool     ufpt_update          [_param->_nb_context];
    6565    bool     upt_update           [_param->_nb_context];
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Update_Prediction_Table/src/Update_Prediction_Table_transition.cpp

    r105 r106  
    3939            reg_UFPT_UPDATE          [i] = 0;
    4040            reg_UFPT_NB_NEED_UPDATE  [i] = 0;
     41            reg_UFPT_NB_UPDATE       [i] = 0;
    4142                                                               
    4243            for (uint32_t j=0; j<_param->_size_upt_queue[i]; ++j)
     
    9293            {
    9394              uint32_t      bottom      = reg_UPT_BOTTOM [i];
    94               bool          end_ok      = (reg_UPDATE_PREDICTION_TABLE [i][bottom]._state == UPDATE_PREDICTION_STATE_END_OK);
    95               bool          end_ko      = (reg_UPDATE_PREDICTION_TABLE [i][bottom]._state == UPDATE_PREDICTION_STATE_END_KO);
     95              bool          end         = (reg_UPDATE_PREDICTION_TABLE [i][bottom]._state == UPDATE_PREDICTION_STATE_END);
     96//               bool          end_ok      = (reg_UPDATE_PREDICTION_TABLE [i][bottom]._state == UPDATE_PREDICTION_STATE_END_OK);
     97//               bool          end_ko      = (reg_UPDATE_PREDICTION_TABLE [i][bottom]._state == UPDATE_PREDICTION_STATE_END_KO);
    9698//               event_state_t event_state = reg_EVENT_STATE [i];
    9799
    98100              // Test if state is end
    99 //               if ((end_ok or end_ko) and
    100 //                   ((event_state != EVENT_STATE_UPDATE_CONTEXT) and
    101 //                    (event_state != EVENT_STATE_WAIT_END_EVENT)))
    102               if (end_ok or end_ko)
     101//               if (end_ok or end_ko)
     102              if (end)
    103103                {
    104104                  log_printf(TRACE,Update_Prediction_Table,FUNCTION,"    * UPT [%d][%d]",i,bottom);
    105105                  log_printf(TRACE,Update_Prediction_Table,FUNCTION,"    * UPT [%d][%d]._state =  UPDATE_PREDICTION_STATE_EMPTY",i,bottom);
    106 
    107106                  // Free slot
    108107                  reg_UPDATE_PREDICTION_TABLE [i][bottom]._state = UPDATE_PREDICTION_STATE_EMPTY;
     
    110109                  // Update pointer
    111110                  reg_UPT_BOTTOM [i] = (bottom+1)%_param->_size_upt_queue[i];
    112 
     111                 
    113112                  if (reg_UPT_BOTTOM [i] == reg_UPT_TOP [i])
    114113                    reg_UPT_EMPTY [i] = true; // free a slot
     
    118117
    119118                  if (reg_EVENT_VAL [i] and (reg_EVENT_UPT_PTR [i] == bottom))
    120 //                   if (end_ko) // free
    121119                    {
    122120                      log_printf(TRACE,Update_Prediction_Table,FUNCTION,"  * END EVENT");
     
    129127                        reg_UPT_EMPTY [i] = false;
    130128                    }
     129
    131130                }
    132131            }
    133132          }
     133
    134134        log_printf(TRACE,Update_Prediction_Table,FUNCTION,"  * GARBAGE COLLECTOR (END)");
    135135
     
    450450                      // if free a slot, also all queue is updated
    451451                      // Last slot ?
    452                       if (reg_UFPT_UPDATE [context] == reg_UFPT_BOTTOM [context])
     452//                       if (reg_UFPT_UPDATE [context] == reg_UFPT_BOTTOM [context])
     453                      if ((--reg_UFPT_NB_UPDATE [context])==0)
    453454                        switch (reg_EVENT_STATE [context])
    454455                          {
     
    472473                     
    473474                      reg_UPDATE_FETCH_PREDICTION_TABLE [context][depth]._state = UPDATE_FETCH_PREDICTION_STATE_END;
    474                      
    475                      
     475                                           
    476476                      // Update pointer
    477477                      log_printf(TRACE,Update_Prediction_Table,FUNCTION,"    * reg_UFPT_UPDATE (before) : %d",reg_UFPT_UPDATE [context]);
     
    531531                      else
    532532                        {
    533                           log_printf(TRACE,Update_Prediction_Table,FUNCTION,"    * UPT  [%d][%d].state <- UPDATE_PREDICTION_STATE_END_OK (update)",context,depth);
    534                          
    535                           reg_UPDATE_PREDICTION_TABLE [context][depth]._state = UPDATE_PREDICTION_STATE_END_OK;
    536 
     533//                           log_printf(TRACE,Update_Prediction_Table,FUNCTION,"    * UPT  [%d][%d].state <- UPDATE_PREDICTION_STATE_END_OK (update)",context,depth);
     534//                           reg_UPDATE_PREDICTION_TABLE [context][depth]._state = UPDATE_PREDICTION_STATE_END_OK;
     535
     536                          log_printf(TRACE,Update_Prediction_Table,FUNCTION,"    * UPT  [%d][%d].state <- UPDATE_PREDICTION_STATE_END (update)",context,depth);
     537                          reg_UPDATE_PREDICTION_TABLE [context][depth]._state = UPDATE_PREDICTION_STATE_END;
    537538
    538539#ifdef STATISTICS
     
    650651                    reg_EVENT_STATE [i] = EVENT_STATE_OK;
    651652                    reg_IS_ACCURATE [i] = true;
    652                    
    653 //                  Tdepth_t depth = reg_UPT_TOP [i];
    654 
    655 #ifdef DEBUG_TEST
    656 //                  if (reg_UPDATE_PREDICTION_TABLE [i][depth]._state != UPDATE_PREDICTION_STATE_END_KO_WAIT_END)
    657 //                    throw ERRORMORPHEO(FUNCTION,_("Event : invalid upt event state."));
     653
     654                    Tdepth_t depth = reg_EVENT_UPT_PTR [i];
     655
     656                    if (reg_UPDATE_PREDICTION_TABLE [i][depth]._state == UPDATE_PREDICTION_STATE_END_KO)
     657                      {
     658                        log_printf(TRACE,Update_Prediction_Table,FUNCTION,"    * UPT  [%d][%d].state <- UPDATE_PREDICTION_STATE_END (event)",i,depth);
     659                       
     660                        reg_UPDATE_PREDICTION_TABLE [i][depth]._state = UPDATE_PREDICTION_STATE_END;
     661                      }
     662
     663#ifdef DEBUG_TEST
     664//                     if (reg_UPDATE_PREDICTION_TABLE [i][depth]._state != UPDATE_PREDICTION_STATE_END_KO_WAIT_END)
     665//                       throw ERRORMORPHEO(FUNCTION,_("Event : invalid upt event state."));
    658666//                  if (reg_UPDATE_PREDICTION_TABLE [i][depth]._state != UPDATE_PREDICTION_STATE_END_KO)
    659667//                    throw ERRORMORPHEO(FUNCTION,_("Event : invalid upt event state."));
    660668#endif
    661                  
    662 //                  log_printf(TRACE,Update_Prediction_Table,FUNCTION,"    * UPT  [%d][%d].state <- UPDATE_PREDICTION_STATE_END_KO (update)",i,depth);
    663                          
    664 //                  reg_UPDATE_PREDICTION_TABLE [i][depth]._state = UPDATE_PREDICTION_STATE_END_KO;
    665 
     669
     670//                     log_printf(TRACE,Update_Prediction_Table,FUNCTION,"    * UPT  [%d][%d].state <- UPDATE_PREDICTION_STATE_END_KO (update)",i,depth);
     671                   
     672//                     reg_UPDATE_PREDICTION_TABLE [i][depth]._state = UPDATE_PREDICTION_STATE_END_KO;
     673                   
    666674                    break;
    667675                  }
     
    685693                    log_printf(TRACE,Update_Prediction_Table,FUNCTION,"    * new_update : %d",new_update);
    686694
    687                    
    688 #ifdef DEBUG_TEST
    689                     if (reg_UPDATE_PREDICTION_TABLE [i][depth]._state != UPDATE_PREDICTION_STATE_WAIT_END)
    690                       throw ERRORMORPHEO(FUNCTION,_("Branch complete : invalid upt state."));
    691 #endif
    692 
    693                     // flush all slot after the event
    694                     for (uint32_t j=depth;
    695                          j!=top;
    696                          j=(j+1)%_param->_size_upt_queue[i])
    697                       reg_UPDATE_PREDICTION_TABLE [i][j]._state = UPDATE_PREDICTION_STATE_EVENT;
    698                      
    699                     // test full :
    700                     if (full)
    701                       reg_UPDATE_PREDICTION_TABLE [i][depth]._state = UPDATE_PREDICTION_STATE_EVENT;
     695                    // Test empty
     696                    if (not reg_UPT_EMPTY [i])
     697                      {
     698#ifdef DEBUG_TEST
     699                        if (reg_UPDATE_PREDICTION_TABLE [i][depth]._state != UPDATE_PREDICTION_STATE_WAIT_END)
     700                          throw ERRORMORPHEO(FUNCTION,_("Branch complete : invalid upt state."));
     701#endif
     702                        reg_UPDATE_PREDICTION_TABLE [i][depth]._state = UPDATE_PREDICTION_STATE_EVENT;
     703
     704                        // flush all slot after the event
     705                        for (uint32_t j=(depth+1)%_param->_size_upt_queue[i];
     706                             j!=top;
     707                             j=(j+1)%_param->_size_upt_queue[i])
     708                          reg_UPDATE_PREDICTION_TABLE [i][j]._state = UPDATE_PREDICTION_STATE_EVENT;
     709                      }
    702710             
    703711//                  reg_UPT_BOTTOM    [i];
     
    802810                {
    803811                  for (uint32_t j=0; j<_param->_size_ufpt_queue[i]; ++j)
    804                     reg_UPDATE_FETCH_PREDICTION_TABLE [i][j]._state = UPDATE_FETCH_PREDICTION_STATE_EVENT;
    805                  
     812                    {
     813                      reg_UFPT_NB_UPDATE [i] ++;
     814                      reg_UPDATE_FETCH_PREDICTION_TABLE [i][j]._state = UPDATE_FETCH_PREDICTION_STATE_EVENT;
     815                    }
     816
    806817                  // TOP is next write slot : last slot is TOP-1
    807818                  uint32_t top = reg_UFPT_TOP [i];
    808                   reg_UFPT_UPDATE [i] = ((top==0)?_param->_size_ufpt_queue[i]:top)-1;
    809                  
    810 //                reg_UFPT_BOTTOM [i];
    811 //                reg_UFPT_TOP    [i];
     819                  reg_UFPT_UPDATE    [i] = ((top==0)?_param->_size_ufpt_queue[i]:top)-1;
     820
     821//                reg_UFPT_BOTTOM    [i];
     822//                reg_UFPT_TOP       [i];
    812823                }
    813824
     
    853864        log_printf(TRACE,Update_Prediction_Table,FUNCTION,"      * reg_UFPT_UPDATE         : %d",reg_UFPT_UPDATE         [i]);
    854865        log_printf(TRACE,Update_Prediction_Table,FUNCTION,"      * reg_UFPT_NB_NEED_UPDATE : %d",reg_UFPT_NB_NEED_UPDATE [i]);
     866        log_printf(TRACE,Update_Prediction_Table,FUNCTION,"      * reg_UFPT_NB_UPDATE      : %d",reg_UFPT_NB_UPDATE      [i]);
    855867        for (uint32_t j=0; j<_param->_size_ufpt_queue[i]; j++)
    856868          log_printf(TRACE,Update_Prediction_Table,FUNCTION,"        [%d] %.4d, %.8x %.8x, %.1d   %.1d, %.8d %.8x %.4d - %s",
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/include/Parameters.h

    r95 r106  
    8080//public : uint32_t                _size_context_id                      ;
    8181//public : uint32_t                _size_address                         ;
     82  public : uint32_t              * _array_size_depth                     ;//[nb_context]
    8283  public : uint32_t              * _array_size_nb_inst_decod             ;//[nb_decod_unit]
    83   public : uint32_t              * _array_size_depth                     ;//[nb_context]
    8484//public : uint32_t                _max_size_depth                       ;
    8585//public : uint32_t              * _size_ifetch_queue_ptr                ;//[nb_context]
  • trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/src/Parameters.cpp

    r95 r106  
    100100//  _size_context_id                     = log2(_nb_context);
    101101    uint32_t size_instruction_address   = size_general_data - 2;
    102    
     102
    103103    _array_size_depth                   = new uint32_t [_nb_context];
    104104    for (uint32_t i=0; i<_nb_context; i++)
    105105      _array_size_depth [i] = log2(_upt_size_queue[i]);
    106 
     106   
    107107    _array_size_nb_inst_decod = new uint32_t [_nb_decod_unit];
    108108    for (uint32_t i=0; i<_nb_decod_unit; i++)
     
    221221       _nb_decod_unit,
    222222       _nb_inst_branch_complete,
    223        _array_size_depth,               
     223       _upt_size_queue,               
    224224        size_instruction_address,
    225225       _array_size_nb_inst_decod,           
Note: See TracChangeset for help on using the changeset viewer.