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

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

Import Morpheo

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