source: trunk/IPs/systemC/processor/Morpheo/Behavioural/Stage_1_Ifetch/Predictor/Meta_Predictor/Two_Level_Branch_Predictor/include/Two_Level_Branch_Predictor.h @ 2

Last change on this file since 2 was 2, checked in by kane, 17 years ago

Import Morpheo

File size: 6.5 KB
Line 
1#ifndef morpheo_behavioural_stage_1_ifetch_predictor_meta_predictor_two_level_branch_predictor_Two_Level_Branch_Predictor_h
2#define morpheo_behavioural_stage_1_ifetch_predictor_meta_predictor_two_level_branch_predictor_Two_Level_Branch_Predictor_h
3
4/*
5 * $Id$
6 *
7 * [ Description ]
8 *
9 */
10
11#ifdef SYSTEMC
12#include "systemc.h"
13#endif
14
15#include <iostream>
16#include "Include/ToString.h"
17#include "Include/Debug.h"
18
19// Internal structure
20#include "Behavioural/Stage_1_Ifetch/Predictor/Meta_Predictor/Two_Level_Branch_Predictor/Branch_History_Table/include/Branch_History_Table.h"
21#include "Behavioural/Stage_1_Ifetch/Predictor/Meta_Predictor/Two_Level_Branch_Predictor/Pattern_History_Table/include/Pattern_History_Table.h"
22#include "Behavioural/Stage_1_Ifetch/Predictor/Meta_Predictor/Two_Level_Branch_Predictor/Two_Level_Branch_Predictor_Glue/include/Two_Level_Branch_Predictor_Glue.h"
23
24#include "Behavioural/Stage_1_Ifetch/Predictor/Meta_Predictor/Two_Level_Branch_Predictor/include/Parameters.h"
25#include "Behavioural/Stage_1_Ifetch/Predictor/Meta_Predictor/Two_Level_Branch_Predictor/include/Types.h"
26#ifdef STATISTICS
27#include "Behavioural/Stage_1_Ifetch/Predictor/Meta_Predictor/Two_Level_Branch_Predictor/include/Statistics.h"
28#endif
29#ifdef VHDL
30#include "Behavioural/include/Vhdl.h"
31#endif
32#ifdef VHDL_TESTBENCH
33#include "Behavioural/include/Vhdl_Testbench.h"
34#endif
35
36using namespace std;
37
38namespace morpheo {
39namespace behavioural {
40namespace stage_1_ifetch {
41namespace predictor {
42namespace meta_predictor {
43namespace two_level_branch_predictor {
44
45
46  class Two_Level_Branch_Predictor
47#if SYSTEMC
48    : public sc_module
49#endif
50  {
51    // -----[ fields ]----------------------------------------------------
52    // Parameters
53  protected : const string     _name;
54
55  protected : const Parameters _param;
56#ifdef STATISTICS
57 protected : const morpheo::behavioural::Parameters_Statistics _param_statistics;
58#endif
59
60#ifdef STATISTICS
61  private   : Statistics                     * _stat;
62#endif
63
64#ifdef VHDL_TESTBENCH
65  private   : Vhdl_Testbench                 * _vhdl_testbench;
66#endif
67
68#ifdef SYSTEMC
69    // ~~~~~[ Interface ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
70    // Interface
71  public    : SC_CLOCK                      *  in_CLOCK                      ;
72
73    // Interface Predict
74  public    : SC_IN (Tcontrol_t)           **  in_PREDICT_VAL                ;
75  public    : SC_OUT(Tcontrol_t)           ** out_PREDICT_ACK                ;
76  public    : SC_IN (Taddress_t)           **  in_PREDICT_ADDRESS            ;
77  public    : SC_OUT(Tbht_history_t)       ** out_PREDICT_BHT_HISTORY        ;
78  public    : SC_OUT(Tpht_history_t)       ** out_PREDICT_PHT_HISTORY        ;
79                       
80    // Interface Branch_complete
81  public    : SC_IN (Tcontrol_t)           **  in_BRANCH_COMPLETE_VAL        ;
82  public    : SC_OUT(Tcontrol_t)           ** out_BRANCH_COMPLETE_ACK        ;
83  public    : SC_IN (Taddress_t)           **  in_BRANCH_COMPLETE_ADDRESS    ;
84  public    : SC_IN (Tbht_history_t)       **  in_BRANCH_COMPLETE_BHT_HISTORY;
85  public    : SC_IN (Tpht_history_t)       **  in_BRANCH_COMPLETE_PHT_HISTORY;
86  public    : SC_IN (Tcontrol_t)           **  in_BRANCH_COMPLETE_HIT        ;
87
88    // ~~~~~[ Register ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~   
89
90    // ~~~~~[ Internal ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
91  private   : SC_SIGNAL(Tcontrol_t)        ** signal_PREDICT_BHT_ACK            ;
92  private   : SC_SIGNAL(Tcontrol_t)        ** signal_PREDICT_PHT_ACK            ;
93  private   : SC_SIGNAL(Taddress_t)        ** signal_PREDICT_BHT_ADDRESS        ;
94  private   : SC_SIGNAL(Taddress_t)        ** signal_PREDICT_PHT_ADDRESS        ;
95  private   : SC_SIGNAL(Tbht_history_t)    ** signal_PREDICT_BHT_HISTORY        ;
96
97  private   : SC_SIGNAL(Tcontrol_t)        ** signal_BRANCH_COMPLETE_BHT_ACK    ;
98  private   : SC_SIGNAL(Tcontrol_t)        ** signal_BRANCH_COMPLETE_PHT_ACK    ;
99  private   : SC_SIGNAL(Taddress_t)        ** signal_BRANCH_COMPLETE_BHT_ADDRESS; 
100  private   : SC_SIGNAL(Taddress_t)        ** signal_BRANCH_COMPLETE_PHT_ADDRESS;
101#endif
102
103    // ~~~~~[ Component ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~   
104  protected : morpheo::behavioural::stage_1_ifetch::predictor::meta_predictor::two_level_branch_predictor::branch_history_table ::Branch_History_Table  * component_Branch_History_Table;
105  protected : morpheo::behavioural::stage_1_ifetch::predictor::meta_predictor::two_level_branch_predictor::pattern_history_table::Pattern_History_Table * component_Pattern_History_Table;
106  protected : morpheo::behavioural::stage_1_ifetch::predictor::meta_predictor::two_level_branch_predictor::two_level_branch_predictor_glue::Two_Level_Branch_Predictor_Glue * component_Two_Level_Branch_Predictor_Glue;
107
108    // -----[ methods ]---------------------------------------------------
109
110#ifdef SYSTEMC
111    SC_HAS_PROCESS (Two_Level_Branch_Predictor);
112#endif                                         
113  public  :          Two_Level_Branch_Predictor              (
114#ifdef SYSTEMC
115                                                              sc_module_name                              name,
116#else                                         
117                                                              string                                      name,
118#endif                                         
119#ifdef STATISTICS
120                                                              morpheo::behavioural::Parameters_Statistics param_statistics,
121#endif
122                                                              Parameters                                  param );
123                                                             
124  public  :          Two_Level_Branch_Predictor              (Parameters param );
125  public  :          ~Two_Level_Branch_Predictor             (void);
126                                               
127#ifdef SYSTEMC                                 
128  private : void     allocation                (void);
129  private : void     deallocation              (void);
130                                               
131#if (defined(STATISTICS) || defined (VHDL_TESTBENCH))
132  public  : void     transition                (void);
133#endif
134#endif                                         
135#ifdef STATISTICS
136  public  : string   statistics                (uint32_t depth);
137#endif
138                                               
139#if VHDL                                       
140  public  : void     vhdl                      (void);
141  private : void     vhdl_port                 (Vhdl & vhdl);
142  private : void     vhdl_declaration          (Vhdl & vhdl);
143  private : void     vhdl_body                 (Vhdl & vhdl);
144#endif                                         
145                                               
146#ifdef VHDL_TESTBENCH                         
147  private : void     vhdl_testbench_port       (void);
148  private : void     vhdl_testbench_transition (void);
149#endif
150  public  : void     vhdl_testbench_label      (string label);
151  };
152
153}; // end namespace two_level_branch_predictor
154}; // end namespace meta_predictor
155}; // end namespace predictor
156}; // end namespace stage_1_ifetch
157
158}; // end namespace behavioural
159}; // end namespace morpheo             
160
161#endif
Note: See TracBrowser for help on using the repository browser.