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 | |
---|
12 | namespace morpheo { |
---|
13 | namespace behavioural { |
---|
14 | namespace core { |
---|
15 | namespace multi_front_end { |
---|
16 | namespace front_end { |
---|
17 | namespace prediction_unit { |
---|
18 | namespace direction { |
---|
19 | namespace meta_predictor { |
---|
20 | namespace 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 |
---|