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

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

Import Morpheo

File size: 5.6 KB
Line 
1#ifndef morpheo_behavioural_stage_1_ifetch_predictor_meta_predictor_two_level_branch_predictor_two_level_branch_predictor_glue_Two_Level_Branch_Predictor_Glue_h
2#define morpheo_behavioural_stage_1_ifetch_predictor_meta_predictor_two_level_branch_predictor_two_level_branch_predictor_glue_Two_Level_Branch_Predictor_Glue_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#include "Behavioural/Stage_1_Ifetch/Predictor/Meta_Predictor/Two_Level_Branch_Predictor/Two_Level_Branch_Predictor_Glue/include/Parameters.h"
20#include "Behavioural/Stage_1_Ifetch/Predictor/Meta_Predictor/Two_Level_Branch_Predictor/Two_Level_Branch_Predictor_Glue/include/Types.h"
21#ifdef STATISTICS
22#include "Behavioural/Stage_1_Ifetch/Predictor/Meta_Predictor/Two_Level_Branch_Predictor/Two_Level_Branch_Predictor_Glue/include/Statistics.h"
23#endif
24#ifdef VHDL
25#include "Behavioural/include/Vhdl.h"
26#endif
27#ifdef VHDL_TESTBENCH
28#include "Behavioural/include/Vhdl_Testbench.h"
29#endif
30
31using namespace std;
32
33namespace morpheo {
34namespace behavioural {
35namespace stage_1_ifetch {
36namespace predictor {
37namespace meta_predictor {
38namespace two_level_branch_predictor {
39namespace two_level_branch_predictor_glue {
40
41
42  class Two_Level_Branch_Predictor_Glue
43#if SYSTEMC
44    : public sc_module
45#endif
46  {
47    // -----[ fields ]----------------------------------------------------
48    // Parameters
49  protected : const string     _name;
50
51  protected : const Parameters _param;
52//#ifdef STATISTICS
53//  protected : const morpheo::behavioural::Parameters_Statistics _param_statistics;
54//#endif
55
56#ifdef STATISTICS
57  private   : Statistics                     * _stat;
58#endif
59
60#ifdef VHDL_TESTBENCH
61  private   : Vhdl_Testbench                 * _vhdl_testbench;
62#endif
63
64#ifdef SYSTEMC
65    // ~~~~~[ Interface ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
66    // Interface
67  public    : SC_CLOCK                      *  in_CLOCK                      ;
68
69  public    : SC_IN (Tcontrol_t)           **  in_PREDICT_BHT_ACK            ;
70  public    : SC_IN (Tcontrol_t)           **  in_PREDICT_PHT_ACK            ;
71  public    : SC_OUT(Tcontrol_t)           ** out_PREDICT_ACK                ;
72                                           
73  public    : SC_IN (Taddress_t)           **  in_PREDICT_ADDRESS            ;
74  public    : SC_IN (Tbht_history_t)       **  in_PREDICT_BHT_HISTORY        ;
75  public    : SC_OUT(Taddress_t)           ** out_PREDICT_BHT_ADDRESS        ;
76  public    : SC_OUT(Taddress_t)           ** out_PREDICT_PHT_ADDRESS        ;
77                                           
78  public    : SC_IN (Tcontrol_t)           **  in_BRANCH_COMPLETE_BHT_ACK    ;
79  public    : SC_IN (Tcontrol_t)           **  in_BRANCH_COMPLETE_PHT_ACK    ;
80  public    : SC_OUT(Tcontrol_t)           ** out_BRANCH_COMPLETE_ACK        ;
81                                           
82  public    : SC_IN (Taddress_t)           **  in_BRANCH_COMPLETE_ADDRESS    ;
83  public    : SC_IN (Tbht_history_t)       **  in_BRANCH_COMPLETE_BHT_HISTORY;
84  public    : SC_OUT(Taddress_t)           ** out_BRANCH_COMPLETE_BHT_ADDRESS;
85  public    : SC_OUT(Taddress_t)           ** out_BRANCH_COMPLETE_PHT_ADDRESS;
86
87    // ~~~~~[ Component ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~   
88
89    // ~~~~~[ Register ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~   
90
91    // ~~~~~[ Internal ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
92#endif
93
94    // -----[ methods ]---------------------------------------------------
95
96#ifdef SYSTEMC
97    SC_HAS_PROCESS (Two_Level_Branch_Predictor_Glue);
98#endif
99  public  :          Two_Level_Branch_Predictor_Glue              (
100#ifdef SYSTEMC
101                                                                   sc_module_name                              name,
102#else                                         
103                                                                   string                                      name,
104#endif                                         
105#ifdef STATISTICS
106                                                                   morpheo::behavioural::Parameters_Statistics param_statistics,
107#endif
108                                                                   Parameters                                  param );
109                                               
110  public  :          Two_Level_Branch_Predictor_Glue              (Parameters param );
111  public  :          ~Two_Level_Branch_Predictor_Glue             (void);
112                                               
113#ifdef SYSTEMC                                 
114  private : void     allocation                (void);
115  private : void     deallocation              (void);
116                                               
117#if defined(STATISTICS) or defined(VHDL_TESTBENCH)
118  public  : void     transition                            (void);
119#endif                                                     
120  public  : void     genMealy_predict_ack                  (void);
121  public  : void     genMealy_predict_bht_address          (void);
122  public  : void     genMealy_predict_pht_address          (void);
123  public  : void     genMealy_branch_complete_ack          (void);
124  public  : void     genMealy_branch_complete_bht_address  (void);
125  public  : void     genMealy_branch_complete_pht_address  (void);
126#endif                                         
127
128#ifdef STATISTICS
129  public  : string   statistics                (uint32_t depth);
130#endif
131                                               
132#if VHDL                                       
133  public  : void     vhdl                      (void);
134  private : void     vhdl_port                 (Vhdl & vhdl);
135  private : void     vhdl_declaration          (Vhdl & vhdl);
136  private : void     vhdl_body                 (Vhdl & vhdl);
137#endif                                         
138                                               
139#ifdef VHDL_TESTBENCH                         
140  private : void     vhdl_testbench_port       (void);
141  private : void     vhdl_testbench_transition (void);
142#endif
143  public  : void     vhdl_testbench_label      (string label);
144  };
145
146}; // end namespace two_level_branch_predictor_glue
147}; // end namespace two_level_branch_predictor
148}; // end namespace meta_predictor
149}; // end namespace predictor
150}; // end namespace stage_1_ifetch
151
152}; // end namespace behavioural
153}; // end namespace morpheo             
154
155#endif
Note: See TracBrowser for help on using the repository browser.