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 @ 112

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

1) Stat_list : fix retire old and new register bug
2) Stat_list : remove read_counter and valid flag, because validation of destination is in retire step (not in commit step)
3) Model : add class Model (cf Morpheo.sim)
4) Allocation : alloc_interface_begin and alloc_interface_end to delete temporary array.
5) Script : add distexe.sh
6) Add Comparator, Multiplier, Divider. But this component are not implemented
7) Software : add Dhrystone

  • Property svn:keywords set to Id
File size: 4.8 KB
Line 
1/*
2 * $Id: Meta_Predictor_Glue.cpp 112 2009-03-18 22:36:26Z 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_HISTORY_VAL [i]))
105                    << (*(in_UPDATE_DIRECTION   [i]));
106
107# ifdef SYSTEMCASS_SPECIFIC
108        // List dependency information
109# endif   
110
111        log_printf(INFO,Meta_Predictor_Glue,FUNCTION,_("<%s> : Method - genMealy_predict_valack"),_name.c_str());
112
113        SC_METHOD (genMealy_predict_valack);
114        dont_initialize ();
115//      sensitive << (*(in_CLOCK)).neg(); // don't need internal register
116        for (uint32_t i=0; i<_param->_nb_inst_predict; ++i)
117          {
118            sensitive << (*(in_PREDICT_VAL [i]));
119
120            for (uint32_t j=0; j<_param->_nb_predictor; ++j)
121              sensitive << (*(in_PREDICT_PREDICTOR_ACK [j][i]));
122          }
123
124# ifdef SYSTEMCASS_SPECIFIC
125        // List dependency information
126# endif   
127
128        log_printf(INFO,Meta_Predictor_Glue,FUNCTION,_("<%s> : Method - genMealy_predict"),_name.c_str());
129
130        SC_METHOD (genMealy_predict);
131        dont_initialize ();
132//      sensitive << (*(in_CLOCK)).neg(); // don't need internal register
133        for (uint32_t i=0; i<_param->_nb_inst_predict; ++i)
134          for (uint32_t j=0; j<_param->_nb_predictor; ++j)
135            sensitive << (*(in_PREDICT_PREDICTOR_HISTORY   [j][i]))
136                      << (*(in_PREDICT_PREDICTOR_DIRECTION [j][i]));
137
138# ifdef SYSTEMCASS_SPECIFIC
139        // List dependency information
140# endif   
141       
142#endif
143      }
144    log_end(Meta_Predictor_Glue,FUNCTION);
145  };
146   
147#undef  FUNCTION
148#define FUNCTION "Meta_Predictor_Glue::~Meta_Predictor_Glue"
149  Meta_Predictor_Glue::~Meta_Predictor_Glue (void)
150  {
151    log_begin(Meta_Predictor_Glue,FUNCTION);
152
153#ifdef STATISTICS
154    if (usage_is_set(_usage,USE_STATISTICS))
155      {
156        statistics_deallocation();
157      }
158#endif
159
160    log_printf(INFO,Meta_Predictor_Glue,FUNCTION,_("<%s> : Deallocation"),_name.c_str());
161    deallocation ();
162
163    log_end(Meta_Predictor_Glue,FUNCTION);
164  };
165
166}; // end namespace meta_predictor_glue
167}; // end namespace meta_predictor
168}; // end namespace direction
169}; // end namespace prediction_unit
170}; // end namespace front_end
171}; // end namespace multi_front_end
172}; // end namespace core
173
174}; // end namespace behavioural
175}; // end namespace morpheo             
Note: See TracBrowser for help on using the repository browser.