source: trunk/IPs/systemC/processor/Morpheo/Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Direction/Meta_Predictor/Meta_Predictor_Glue/src/Meta_Predictor_Glue.cpp @ 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: 4.8 KB
Line 
1/*
2 * $Id: Meta_Predictor_Glue.cpp 111 2009-02-27 18:37:40Z rosiere $
3 *
4 * [ Description ]
5 *
6 */
7
8#include "Behavioural/Core/Multi_Front_end/Front_end/Prediction_unit/Direction/Meta_Predictor/Meta_Predictor_Glue/include/Meta_Predictor_Glue.h"
9
10namespace morpheo                    {
11namespace behavioural {
12namespace core {
13namespace multi_front_end {
14namespace front_end {
15namespace prediction_unit {
16namespace direction {
17namespace meta_predictor {
18namespace meta_predictor_glue {
19
20
21#undef  FUNCTION
22#define FUNCTION "Meta_Predictor_Glue::Meta_Predictor_Glue"
23  Meta_Predictor_Glue::Meta_Predictor_Glue
24  (
25#ifdef SYSTEMC
26   sc_module_name name,
27#else
28   string name,
29#endif
30#ifdef STATISTICS
31   morpheo::behavioural::Parameters_Statistics * param_statistics,
32#endif
33   morpheo::behavioural::core::multi_front_end::front_end::prediction_unit::direction::meta_predictor::meta_predictor_glue::Parameters * param,
34   morpheo::behavioural::Tusage_t usage
35   ):
36    _name              (name)
37    ,_param            (param)
38    ,_usage            (usage)
39  {
40    log_begin(Meta_Predictor_Glue,FUNCTION);
41
42    usage_environment(_usage);
43
44    log_printf(INFO,Meta_Predictor_Glue,FUNCTION,_("<%s> : Allocation"),_name.c_str());
45
46    allocation (
47#ifdef STATISTICS
48                param_statistics
49#endif
50                );
51
52#ifdef STATISTICS
53    if (usage_is_set(_usage,USE_STATISTICS))
54      { 
55        log_printf(INFO,Meta_Predictor_Glue,FUNCTION,_("<%s> : Allocation of statistics"),_name.c_str());
56
57        statistics_allocation(param_statistics);
58      }
59#endif
60
61#ifdef VHDL
62    if (usage_is_set(_usage,USE_VHDL))
63      {
64        // generate the vhdl
65        log_printf(INFO,Meta_Predictor_Glue,FUNCTION,_("<%s> : Generate the vhdl"),_name.c_str());
66       
67        vhdl();
68      }
69#endif
70
71#ifdef SYSTEMC
72    if (usage_is_set(_usage,USE_SYSTEMC))
73      {
74        log_printf(INFO,Meta_Predictor_Glue,FUNCTION,_("<%s> : Method - transition"),_name.c_str());
75
76        SC_METHOD (transition);
77        dont_initialize ();
78        sensitive << (*(in_CLOCK)).pos();
79       
80# ifdef SYSTEMCASS_SPECIFIC
81        // List dependency information
82# endif   
83
84        log_printf(INFO,Meta_Predictor_Glue,FUNCTION,_("<%s> : Method - genMealy_update_valack"),_name.c_str());
85
86        SC_METHOD (genMealy_update_valack);
87        dont_initialize ();
88//      sensitive << (*(in_CLOCK)).neg(); // don't need internal register
89        for (uint32_t i=0; i<_param->_nb_inst_update; ++i)
90          {
91            sensitive << (*(in_UPDATE_VAL [i]));
92
93            for (uint32_t j=0; j<_param->_nb_predictor; ++j)
94              sensitive << (*(in_UPDATE_PREDICTOR_ACK [j][i]));
95          }
96
97        log_printf(INFO,Meta_Predictor_Glue,FUNCTION,_("<%s> : Method - genMealy_update"),_name.c_str());
98
99        SC_METHOD (genMealy_update);
100        dont_initialize ();
101//      sensitive << (*(in_CLOCK)).neg(); // don't need internal register
102        for (uint32_t i=0; i<_param->_nb_inst_update; ++i)
103          sensitive << (*(in_UPDATE_HISTORY   [i]))
104                    << (*(in_UPDATE_DIRECTION [i]));
105
106# ifdef SYSTEMCASS_SPECIFIC
107        // List dependency information
108# endif   
109
110        log_printf(INFO,Meta_Predictor_Glue,FUNCTION,_("<%s> : Method - genMealy_predict_valack"),_name.c_str());
111
112        SC_METHOD (genMealy_predict_valack);
113        dont_initialize ();
114//      sensitive << (*(in_CLOCK)).neg(); // don't need internal register
115        for (uint32_t i=0; i<_param->_nb_inst_predict; ++i)
116          {
117            sensitive << (*(in_PREDICT_VAL [i]));
118
119            for (uint32_t j=0; j<_param->_nb_predictor; ++j)
120              sensitive << (*(in_PREDICT_PREDICTOR_ACK [j][i]));
121          }
122
123# ifdef SYSTEMCASS_SPECIFIC
124        // List dependency information
125# endif   
126
127        log_printf(INFO,Meta_Predictor_Glue,FUNCTION,_("<%s> : Method - genMealy_predict"),_name.c_str());
128
129        SC_METHOD (genMealy_predict);
130        dont_initialize ();
131//      sensitive << (*(in_CLOCK)).neg(); // don't need internal register
132        for (uint32_t i=0; i<_param->_nb_inst_predict; ++i)
133          for (uint32_t j=0; j<_param->_nb_predictor; ++j)
134            sensitive << (*(in_PREDICT_PREDICTOR_HISTORY   [j][i]))
135                      << (*(in_PREDICT_PREDICTOR_DIRECTION [j][i]));
136
137# ifdef SYSTEMCASS_SPECIFIC
138        // List dependency information
139# endif   
140       
141#endif
142      }
143    log_end(Meta_Predictor_Glue,FUNCTION);
144  };
145   
146#undef  FUNCTION
147#define FUNCTION "Meta_Predictor_Glue::~Meta_Predictor_Glue"
148  Meta_Predictor_Glue::~Meta_Predictor_Glue (void)
149  {
150    log_begin(Meta_Predictor_Glue,FUNCTION);
151
152#ifdef STATISTICS
153    if (usage_is_set(_usage,USE_STATISTICS))
154      {
155        statistics_deallocation();
156      }
157#endif
158
159    log_printf(INFO,Meta_Predictor_Glue,FUNCTION,_("<%s> : Deallocation"),_name.c_str());
160    deallocation ();
161
162    log_end(Meta_Predictor_Glue,FUNCTION);
163  };
164
165}; // end namespace meta_predictor_glue
166}; // end namespace meta_predictor
167}; // end namespace direction
168}; // end namespace prediction_unit
169}; // end namespace front_end
170}; // end namespace multi_front_end
171}; // end namespace core
172
173}; // end namespace behavioural
174}; // end namespace morpheo             
Note: See TracBrowser for help on using the repository browser.