source: trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Direction/Meta_Predictor/Two_Level_Branch_Predictor/include/Two_Level_Branch_Predictor.h @ 111

Last change on this file since 111 was 111, checked in by rosiere, 15 years ago

1) Decod_queue : multi implementation (one_fifo, multi_fifo)
2) Issue_queue : multi implementation (in_order, out_of_order)
3) Direction : Add Meta predictor
4) Context_State : re add Branch_complete, More priority to Load miss (is not speculative)
5) Return_Address_Stack : update reg_PREDICT pointer on decod miss prediction
6) UPT : Fix bug in multi event
7) Prediction_glue : in read_stack case, insert in UPT pc_next
8) Rename select : when rob have an event (need flush), read_r{a,b,c} and write_r{d,e} is set at 0

  • Property svn:keywords set to Id
File size: 6.3 KB
Line 
1#ifndef morpheo_behavioural_core_multi_front_end_front_end_prediction_unit_direction_meta_predictor_two_level_branch_predictor_Two_Level_Branch_Predictor_h
2#define morpheo_behavioural_core_multi_front_end_front_end_prediction_unit_direction_meta_predictor_two_level_branch_predictor_Two_Level_Branch_Predictor_h
3
4/*
5 * $Id: Two_Level_Branch_Predictor.h 111 2009-02-27 18:37:40Z rosiere $
6 *
7 * [ Description ]
8 *
9 */
10
11#ifdef SYSTEMC
12#include "systemc.h"
13#endif
14
15
16#include "Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Direction/Meta_Predictor/Two_Level_Branch_Predictor/include/Parameters.h"
17#include "Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Direction/Meta_Predictor/Two_Level_Branch_Predictor/include/Types.h"
18#ifdef STATISTICS
19#include "Behavioural/include/Stat.h"
20#endif
21#include "Behavioural/include/Component.h"
22#ifdef VHDL
23#include "Behavioural/include/Vhdl.h"
24#endif
25#include "Behavioural/include/Usage.h"
26
27#include "Common/include/ToString.h"
28#include "Common/include/Debug.h"
29
30#include <iostream>
31
32namespace morpheo {
33namespace behavioural {
34
35namespace core {
36namespace multi_front_end {
37namespace front_end {
38namespace prediction_unit {
39namespace direction {
40namespace meta_predictor {
41namespace two_level_branch_predictor {
42
43
44  class Two_Level_Branch_Predictor
45#if SYSTEMC
46    : public sc_module
47#endif
48  {
49    // -----[ fields ]----------------------------------------------------
50    // Parameters
51  protected : const std::string  _name;
52  protected : const Parameters * _param;
53  private   : const Tusage_t     _usage;
54
55#ifdef STATISTICS
56  public    : Stat                           * _stat;
57#endif
58
59  public    : Component                      * _component;
60  private   : Interfaces                     * _interfaces;
61
62#ifdef SYSTEMC
63    // ~~~~~[ Interface ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
64    // ~~~~~[ Interface : "" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
65  public    : SC_CLOCK                      *  in_CLOCK        ;
66  public    : SC_IN (Tcontrol_t)            *  in_NRESET       ;
67
68    // ~~~~~[ Interface : "predict" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
69  public    : SC_IN (Tcontrol_t)           **  in_PREDICT_VAL          ;//[nb_inst_predict]
70  public    : SC_OUT(Tcontrol_t)           ** out_PREDICT_ACK          ;//[nb_inst_predict]
71  public    : SC_IN (Taddress_t)           **  in_PREDICT_ADDRESS      ;//[nb_inst_predict]
72  public    : SC_OUT(Tcontrol_t)           ** out_PREDICT_DIRECTION    ;//[nb_inst_predict] // = MSB[history]
73  public    : SC_OUT(Thistory_t)           ** out_PREDICT_HISTORY      ;//[nb_inst_predict]
74  public    : SC_IN (Tcontrol_t)           **  in_PREDICT_DIRECTION_VAL;//[nb_inst_predict] // if update_on_prediction
75  public    : SC_IN (Tcontrol_t)           **  in_PREDICT_DIRECTION    ;//[nb_inst_predict] // if update_on_prediction
76
77    // ~~~~~[ Interface : "update" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
78  public    : SC_IN (Tcontrol_t)           **  in_UPDATE_VAL           ;//[nb_inst_update]
79  public    : SC_OUT(Tcontrol_t)           ** out_UPDATE_ACK           ;//[nb_inst_update]
80  public    : SC_IN (Taddress_t)           **  in_UPDATE_ADDRESS       ;//[nb_inst_update]
81  public    : SC_IN (Thistory_t)           **  in_UPDATE_HISTORY       ;//[nb_inst_update]
82  public    : SC_IN (Tcontrol_t)           **  in_UPDATE_DIRECTION     ;//[nb_inst_update]
83  public    : SC_IN (Tcontrol_t)           **  in_UPDATE_MISS          ;//[nb_inst_update] // if update_on_prediction
84
85    // ~~~~~[ Component ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~   
86   
87    // ~~~~~[ Register ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~   
88  private   : Thistory_t                    * reg_BHT                       ;//[bht_nb_shifter]
89  private   : Thistory_t                   ** reg_PHT                       ;//[pht_nb_counter][pht_nb_bank]
90
91    // ~~~~~[ Internal ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
92  private   : Tcontrol_t                    * internal_PREDICT_ACK          ;//[nb_inst_predict]
93  private   : Thistory_t                    * internal_PREDICT_BHT_NUM_REG  ;//[nb_inst_predict] // if update_on_prediction
94  private   : Thistory_t                    * internal_PREDICT_PHT_NUM_BANK ;//[nb_inst_predict] // if update_on_prediction
95  private   : Thistory_t                    * internal_PREDICT_PHT_NUM_REG  ;//[nb_inst_predict] // if update_on_prediction
96
97  private   : Tcontrol_t                    * internal_UPDATE_ACK           ;//[nb_inst_update]
98#endif
99
100    // -----[ Methods ]---------------------------------------------------
101
102#ifdef SYSTEMC
103    SC_HAS_PROCESS (Two_Level_Branch_Predictor);
104#endif
105  public  :          Two_Level_Branch_Predictor             
106  (
107#ifdef SYSTEMC
108   sc_module_name                                name,
109#else                                         
110   std::string                                   name,
111#endif                                         
112#ifdef STATISTICS
113   morpheo::behavioural::Parameters_Statistics * param_statistics,
114#endif
115   Parameters                                  * param,
116   morpheo::behavioural::Tusage_t                usage
117   );
118  public  :          ~Two_Level_Branch_Predictor             (void);
119                                               
120  private : void        allocation                (
121#ifdef STATISTICS
122                                                   morpheo::behavioural::Parameters_Statistics * param_statistics
123#else
124                                                   void
125#endif
126                                                   );
127  private : void        deallocation              (void);
128                                               
129#ifdef SYSTEMC                                 
130  public  : void        transition                (void);
131  public  : void        genMealy_predict          (void);
132#endif                                         
133
134#if VHDL                                       
135  public  : void        vhdl                      (void);
136  private : void        vhdl_declaration          (Vhdl * & vhdl);
137  private : void        vhdl_body                 (Vhdl * & vhdl);
138#endif                                         
139
140#ifdef STATISTICS
141  public  : void        statistics_allocation     (morpheo::behavioural::Parameters_Statistics * param_statistics);
142  public  : void        statistics_deallocation   (void);
143#endif
144#if defined(STATISTICS) or defined(VHDL_TESTBENCH)
145  private : void        end_cycle                 (void);
146#endif
147  };
148
149}; // end namespace two_level_branch_predictor
150}; // end namespace meta_predictor
151}; // end namespace direction
152}; // end namespace prediction_unit
153}; // end namespace front_end
154}; // end namespace multi_front_end
155}; // end namespace core
156
157}; // end namespace behavioural
158}; // end namespace morpheo             
159
160#endif
Note: See TracBrowser for help on using the repository browser.