1 | /* |
---|
2 | * $Id: Return_Address_Stack_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/Return_Address_Stack/include/Return_Address_Stack.h" |
---|
9 | #include "Behavioural/include/Allocation.h" |
---|
10 | |
---|
11 | namespace morpheo { |
---|
12 | namespace behavioural { |
---|
13 | namespace core { |
---|
14 | namespace multi_front_end { |
---|
15 | namespace front_end { |
---|
16 | namespace prediction_unit { |
---|
17 | namespace return_address_stack { |
---|
18 | |
---|
19 | #undef FUNCTION |
---|
20 | #define FUNCTION "Return_Address_Stack::allocation" |
---|
21 | void Return_Address_Stack::allocation ( |
---|
22 | #ifdef STATISTICS |
---|
23 | morpheo::behavioural::Parameters_Statistics * param_statistics |
---|
24 | #else |
---|
25 | void |
---|
26 | #endif |
---|
27 | ) |
---|
28 | { |
---|
29 | log_printf(FUNC,Return_Address_Stack,FUNCTION,"Begin"); |
---|
30 | |
---|
31 | _component = new Component (_usage); |
---|
32 | |
---|
33 | Entity * entity = _component->set_entity (_name |
---|
34 | ,"Return_Address_Stack" |
---|
35 | #ifdef POSITION |
---|
36 | ,COMBINATORY |
---|
37 | #endif |
---|
38 | ); |
---|
39 | |
---|
40 | _interfaces = entity->set_interfaces(); |
---|
41 | |
---|
42 | // ~~~~~[ Interface : "" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
---|
43 | { |
---|
44 | Interface * interface = _interfaces->set_interface("" |
---|
45 | #ifdef POSITION |
---|
46 | ,IN |
---|
47 | ,SOUTH, |
---|
48 | _("Generalist interface") |
---|
49 | #endif |
---|
50 | ); |
---|
51 | |
---|
52 | in_CLOCK = interface->set_signal_clk ("clock" ,1, CLOCK_VHDL_YES); |
---|
53 | in_NRESET = interface->set_signal_in <Tcontrol_t> ("nreset",1, RESET_VHDL_YES); |
---|
54 | } |
---|
55 | |
---|
56 | // ~~~~~[ Interface : "predict" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
---|
57 | { |
---|
58 | ALLOC1_INTERFACE_BEGIN("predict", IN, SOUTH, _("predict's interface"), _param->_nb_inst_predict); |
---|
59 | |
---|
60 | ALLOC1_VALACK_IN ( in_PREDICT_VAL ,VAL); |
---|
61 | ALLOC1_VALACK_OUT(out_PREDICT_ACK ,ACK); |
---|
62 | ALLOC1_SIGNAL_IN ( in_PREDICT_CONTEXT_ID ,"context_id" ,Tcontext_t,_param->_size_context_id); |
---|
63 | ALLOC1_SIGNAL_OUT(out_PREDICT_HIT ,"hit" ,Tcontrol_t,1); |
---|
64 | ALLOC1_SIGNAL_IN ( in_PREDICT_PUSH ,"push" ,Tcontrol_t,1); |
---|
65 | ALLOC1_SIGNAL_IN ( in_PREDICT_ADDRESS_PUSH,"address_push",Taddress_t,_param->_size_instruction_address); |
---|
66 | ALLOC1_SIGNAL_OUT(out_PREDICT_ADDRESS_POP ,"address_pop" ,Taddress_t,_param->_size_instruction_address); |
---|
67 | ALLOC1_SIGNAL_OUT(out_PREDICT_INDEX ,"index" ,Tptr_t ,_param->_size_index); |
---|
68 | |
---|
69 | ALLOC1_INTERFACE_END(_param->_nb_inst_predict); |
---|
70 | } |
---|
71 | |
---|
72 | // ~~~~~[ Interface : "decod" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
---|
73 | { |
---|
74 | ALLOC1_INTERFACE_BEGIN("decod", IN, SOUTH, _("decod's interface"), _param->_nb_inst_decod); |
---|
75 | |
---|
76 | ALLOC1_VALACK_IN ( in_DECOD_VAL ,VAL); |
---|
77 | ALLOC1_VALACK_OUT(out_DECOD_ACK ,ACK); |
---|
78 | ALLOC1_SIGNAL_IN ( in_DECOD_CONTEXT_ID ,"context_id" ,Tcontext_t,_param->_size_context_id); |
---|
79 | ALLOC1_SIGNAL_OUT(out_DECOD_HIT ,"hit" ,Tcontrol_t,1); |
---|
80 | ALLOC1_SIGNAL_IN ( in_DECOD_PUSH ,"push" ,Tcontrol_t,1); |
---|
81 | ALLOC1_SIGNAL_IN ( in_DECOD_ADDRESS_PUSH ,"address_push" ,Taddress_t,_param->_size_instruction_address); |
---|
82 | ALLOC1_SIGNAL_OUT(out_DECOD_ADDRESS_POP ,"address_pop" ,Taddress_t,_param->_size_instruction_address); |
---|
83 | ALLOC1_SIGNAL_OUT(out_DECOD_INDEX ,"index" ,Tptr_t ,_param->_size_index); |
---|
84 | ALLOC1_SIGNAL_IN ( in_DECOD_MISS_PREDICTION,"miss_prediction",Tcontrol_t,1); |
---|
85 | |
---|
86 | ALLOC1_INTERFACE_END(_param->_nb_inst_decod); |
---|
87 | } |
---|
88 | |
---|
89 | // ~~~~~[ Interface : "update" ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
---|
90 | { |
---|
91 | ALLOC1_INTERFACE_BEGIN("update", IN, SOUTH, _("update's interface"), _param->_nb_inst_update); |
---|
92 | |
---|
93 | ALLOC1_VALACK_IN ( in_UPDATE_VAL ,VAL); |
---|
94 | ALLOC1_VALACK_OUT(out_UPDATE_ACK ,ACK); |
---|
95 | ALLOC1_SIGNAL_IN ( in_UPDATE_CONTEXT_ID ,"context_id" ,Tcontext_t,_param->_size_context_id); |
---|
96 | ALLOC1_SIGNAL_IN ( in_UPDATE_PUSH ,"push" ,Tcontrol_t,1); |
---|
97 | ALLOC1_SIGNAL_IN ( in_UPDATE_FLUSH ,"flush" ,Tcontrol_t,1); |
---|
98 | ALLOC1_SIGNAL_IN ( in_UPDATE_ADDRESS ,"address" ,Taddress_t,_param->_size_instruction_address); |
---|
99 | ALLOC1_SIGNAL_IN ( in_UPDATE_INDEX ,"index" ,Tptr_t ,_param->_size_index); |
---|
100 | ALLOC1_SIGNAL_IN ( in_UPDATE_MISS_PREDICTION ,"miss_prediction" ,Tcontrol_t,1); |
---|
101 | ALLOC1_SIGNAL_IN ( in_UPDATE_PREDICTION_IFETCH,"prediction_ifetch",Tcontrol_t,1); |
---|
102 | |
---|
103 | ALLOC1_INTERFACE_END(_param->_nb_inst_update); |
---|
104 | } |
---|
105 | |
---|
106 | if (usage_is_set(_usage,USE_SYSTEMC)) |
---|
107 | { |
---|
108 | // ~~~~~[ Internal ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
---|
109 | ALLOC2(reg_stack ,ras_entry_t,_param->_nb_context,_param->_size_queue [it1]); |
---|
110 | |
---|
111 | ALLOC1(reg_TOP ,Tptr_t ,_param->_nb_context); |
---|
112 | // ALLOC1(reg_BOTTOM ,Tptr_t ,_param->_nb_context); |
---|
113 | ALLOC1(reg_NB_ELT ,Tptr_t ,_param->_nb_context); |
---|
114 | |
---|
115 | ALLOC1(reg_PREDICT_TOP ,Tptr_t ,_param->_nb_context); |
---|
116 | // ALLOC1(reg_PREDICT_BOTTOM ,Tptr_t ,_param->_nb_context); |
---|
117 | ALLOC1(reg_PREDICT_NB_ELT ,Tptr_t ,_param->_nb_context); |
---|
118 | |
---|
119 | ALLOC1(internal_PREDICT_ACK ,Tcontrol_t ,_param->_nb_inst_predict); |
---|
120 | ALLOC1(internal_PREDICT_HIT ,Tcontrol_t ,_param->_nb_inst_predict); |
---|
121 | ALLOC1(internal_DECOD_ACK ,Tcontrol_t ,_param->_nb_inst_decod ); |
---|
122 | ALLOC1(internal_DECOD_HIT ,Tcontrol_t ,_param->_nb_inst_decod ); |
---|
123 | ALLOC1(internal_UPDATE_ACK ,Tcontrol_t ,_param->_nb_inst_update ); |
---|
124 | } |
---|
125 | |
---|
126 | // ~~~~~[ Component ]~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ |
---|
127 | |
---|
128 | #ifdef POSITION |
---|
129 | if (usage_is_set(_usage,USE_POSITION)) |
---|
130 | _component->generate_file(); |
---|
131 | #endif |
---|
132 | |
---|
133 | log_printf(FUNC,Return_Address_Stack,FUNCTION,"End"); |
---|
134 | }; |
---|
135 | |
---|
136 | }; // end namespace return_address_stack |
---|
137 | }; // end namespace prediction_unit |
---|
138 | }; // end namespace front_end |
---|
139 | }; // end namespace multi_front_end |
---|
140 | }; // end namespace core |
---|
141 | }; // end namespace behavioural |
---|
142 | }; // end namespace morpheo |
---|