source: trunk/IPs/systemC/processor/Morpheo/Behavioural/Stage_1_Ifetch/Predictor/Meta_Predictor/Meta_Predictor_Glue/src/Meta_Predictor_Glue_genMealy_branch_complete_history.cpp @ 5

Last change on this file since 5 was 5, checked in by rosiere, 17 years ago

Ajout du composant Meta_Predictor

File size: 2.2 KB
Line 
1#ifdef SYSTEMC
2/*
3 * $Id$
4 *
5 * [ Description ]
6 *
7 */
8
9#include "Behavioural/Stage_1_Ifetch/Predictor/Meta_Predictor/Meta_Predictor_Glue/include/Meta_Predictor_Glue.h"
10#include "Include/BitManipulation.h"
11
12namespace morpheo                    {
13namespace behavioural {
14namespace stage_1_ifetch {
15namespace predictor {
16namespace meta_predictor {
17namespace meta_predictor_glue {
18
19  void Meta_Predictor_Glue::genMealy_branch_complete_history (void)
20  {
21    log_printf(FUNC,Meta_Predictor_Glue,"genMealy_branch_complete_history","Begin");
22   
23    for (uint32_t i=0; i<_param._nb_branch_complete; i++)
24      {
25        Thistory_t     history = PORT_READ(in_BRANCH_COMPLETE_HISTORY [i]);
26
27        if (_param._have_meta_predictor)
28          {
29        if (_param._predictor_0_have_bht)
30        PORT_WRITE(out_BRANCH_COMPLETE_PREDICTOR_0_BHT_HISTORY [i], (history >> _param._shift_0) & gen_mask<Tbht_history_t>(_param._predictor_0_bht_size_shifter));
31        if (_param._predictor_0_have_pht)
32        PORT_WRITE(out_BRANCH_COMPLETE_PREDICTOR_0_PHT_HISTORY [i], (history >> _param._shift_1) & gen_mask<Tpht_history_t>(_param._predictor_0_pht_size_counter));
33          }
34
35        if (_param._predictor_1_have_bht)
36          {
37        PORT_WRITE(out_BRANCH_COMPLETE_PREDICTOR_1_BHT_HISTORY [i], (history >> _param._shift_2) & gen_mask<Tbht_history_t>(_param._predictor_1_bht_size_shifter));
38
39        if (_param._predictor_1_have_pht)
40        PORT_WRITE(out_BRANCH_COMPLETE_PREDICTOR_1_PHT_HISTORY [i], (history >> _param._shift_3) & gen_mask<Tpht_history_t>(_param._predictor_1_pht_size_counter));
41          }
42
43        if (_param._predictor_2_have_bht)
44        PORT_WRITE(out_BRANCH_COMPLETE_PREDICTOR_2_BHT_HISTORY [i], (history >> _param._shift_4) & gen_mask<Tbht_history_t>(_param._predictor_2_bht_size_shifter));
45        if (_param._predictor_2_have_pht)
46        PORT_WRITE(out_BRANCH_COMPLETE_PREDICTOR_2_PHT_HISTORY [i], (history >> _param._shift_5) & gen_mask<Tpht_history_t>(_param._predictor_2_pht_size_counter));
47      }
48
49    log_printf(FUNC,Meta_Predictor_Glue,"genMealy_branch_complete_history","End");
50  };
51
52}; // end namespace meta_predictor_glue
53}; // end namespace meta_predictor
54}; // end namespace predictor
55}; // end namespace stage_1_ifetch
56}; // end namespace behavioural
57}; // end namespace morpheo             
58#endif
Note: See TracBrowser for help on using the repository browser.