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_allocation.cpp

Last change on this file 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: 5.0 KB
Line 
1/*
2 * $Id: Meta_Predictor_Glue_allocation.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#include "Behavioural/include/Allocation.h"
10#include "Common/include/Max.h"
11
12namespace morpheo                    {
13namespace behavioural {
14namespace core {
15namespace multi_front_end {
16namespace front_end {
17namespace prediction_unit {
18namespace direction {
19namespace meta_predictor {
20namespace meta_predictor_glue {
21
22
23
24#undef  FUNCTION
25#define FUNCTION "Meta_Predictor_Glue::allocation"
26  void Meta_Predictor_Glue::allocation (
27#ifdef STATISTICS
28                               morpheo::behavioural::Parameters_Statistics * param_statistics
29#else
30                               void
31#endif
32                               )
33  {
34    log_begin(Meta_Predictor_Glue,FUNCTION);
35
36    _component   = new Component (_usage);
37
38    Entity * entity = _component->set_entity (_name       
39                                              ,"Meta_Predictor_Glue"
40#ifdef POSITION
41                                              ,COMBINATORY
42#endif
43                                              );
44
45    _interfaces = entity->set_interfaces();
46
47    // ~~~~~[ Interface : "" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
48    {
49      Interface * interface = _interfaces->set_interface(""
50#ifdef POSITION
51                                                         ,IN
52                                                         ,SOUTH,
53                                                         _("Generalist interface")
54#endif
55                                                         );
56     
57      in_CLOCK        = interface->set_signal_clk              ("clock" ,1, CLOCK_VHDL_YES);
58      in_NRESET       = interface->set_signal_in  <Tcontrol_t> ("nreset",1, RESET_VHDL_YES);
59    }
60
61    // ~~~~~[ Interface : "predict" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
62    {
63      ALLOC1_INTERFACE_BEGIN("predict",IN,NORTH,_("Predict next address"),_param->_nb_inst_predict);
64
65      ALLOC1_SIGNAL_IN ( in_PREDICT_VAL                    ,"VAL"          ,Tcontrol_t,1);
66      ALLOC1_SIGNAL_OUT(out_PREDICT_ACK                    ,"ACK"          ,Tcontrol_t,1);
67      ALLOC1_SIGNAL_OUT(out_PREDICT_HISTORY                ,"HISTORY"      ,Thistory_t,_param->_size_history);
68      ALLOC1_SIGNAL_OUT(out_PREDICT_DIRECTION              ,"DIRECTION"    ,Tcontrol_t,1);
69
70      ALLOC1_INTERFACE_END(_param->_nb_inst_predict);
71    }
72
73    {
74      ALLOC2_INTERFACE_BEGIN("predict_predictor",IN,NORTH,_("Predict next address"),_param->_nb_predictor,_param->_nb_inst_predict);
75     
76      ALLOC2_SIGNAL_OUT(out_PREDICT_PREDICTOR_VAL          ,"VAL"          ,Tcontrol_t,1);
77      ALLOC2_SIGNAL_IN ( in_PREDICT_PREDICTOR_ACK          ,"ACK"          ,Tcontrol_t,1);
78      ALLOC2_SIGNAL_IN ( in_PREDICT_PREDICTOR_HISTORY      ,"HISTORY"      ,Thistory_t,_param->_predictor_size_history[it1]);
79      ALLOC2_SIGNAL_IN ( in_PREDICT_PREDICTOR_DIRECTION    ,"DIRECTION"    ,Tcontrol_t,1);
80      ALLOC2_SIGNAL_OUT(out_PREDICT_PREDICTOR_DIRECTION_VAL,"DIRECTION_VAL",Tcontrol_t,(_param->_predictor_update_on_prediction [it1])?1:0);
81      ALLOC2_SIGNAL_OUT(out_PREDICT_PREDICTOR_DIRECTION    ,"DIRECTION"    ,Tcontrol_t,(_param->_predictor_update_on_prediction [it1])?1:0);
82
83      ALLOC2_INTERFACE_END(_param->_nb_predictor,_param->_nb_inst_predict);
84    }
85
86    // ~~~~~[ Interface : "update" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
87    {
88      ALLOC1_INTERFACE_BEGIN("update",IN,NORTH,_("Update predictor"),_param->_nb_inst_update);
89     
90      ALLOC1_SIGNAL_IN ( in_UPDATE_VAL                     ,"VAL"          ,Tcontrol_t,1);
91      ALLOC1_SIGNAL_OUT(out_UPDATE_ACK                     ,"ACK"          ,Tcontrol_t,1);
92      ALLOC1_SIGNAL_IN ( in_UPDATE_HISTORY                 ,"HISTORY"      ,Thistory_t,_param->_size_history);
93      ALLOC1_SIGNAL_IN ( in_UPDATE_HISTORY_VAL             ,"HISTORY_VAL"  ,Tcontrol_t,1);
94      ALLOC1_SIGNAL_IN ( in_UPDATE_DIRECTION               ,"DIRECTION"    ,Tcontrol_t,1);
95
96      ALLOC1_INTERFACE_END(_param->_nb_inst_update);
97    }
98    {
99      ALLOC2_INTERFACE_BEGIN("update_predictor",IN,NORTH,_("Update predictor"),_param->_nb_predictor,_param->_nb_inst_update);
100     
101      ALLOC2_SIGNAL_OUT(out_UPDATE_PREDICTOR_VAL           ,"VAL"          ,Tcontrol_t,1);
102      ALLOC2_SIGNAL_IN ( in_UPDATE_PREDICTOR_ACK           ,"ACK"          ,Tcontrol_t,1);
103      ALLOC2_SIGNAL_OUT(out_UPDATE_PREDICTOR_HISTORY       ,"HISTORY"      ,Thistory_t,_param->_predictor_size_history[it1]);
104      ALLOC2_SIGNAL_OUT(out_UPDATE_PREDICTOR_HISTORY_VAL   ,"HISTORY_VAL"  ,Tcontrol_t,1);
105      ALLOC2_SIGNAL_OUT(out_UPDATE_PREDICTOR_DIRECTION     ,"DIRECTION"    ,Tcontrol_t,1);
106      ALLOC2_SIGNAL_OUT(out_UPDATE_PREDICTOR_MISS          ,"MISS"         ,Tcontrol_t,(_param->_predictor_update_on_prediction [it1])?1:0);
107
108      ALLOC2_INTERFACE_END(_param->_nb_predictor,_param->_nb_inst_update);
109    }
110
111    // ~~~~~[ Component ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~   
112
113#ifdef POSITION
114    if (usage_is_set(_usage,USE_POSITION))
115        _component->generate_file();
116#endif
117
118    log_end(Meta_Predictor_Glue,FUNCTION);
119  };
120
121}; // end namespace meta_predictor_glue
122}; // end namespace meta_predictor
123}; // end namespace direction
124}; // end namespace prediction_unit
125}; // end namespace front_end
126}; // end namespace multi_front_end
127}; // end namespace core
128
129}; // end namespace behavioural
130}; // end namespace morpheo             
Note: See TracBrowser for help on using the repository browser.