1 | /* |
---|
2 | * $Id: Load_Store_pointer_unit.cpp 132 2009-07-11 16:39:35Z rosiere $ |
---|
3 | * |
---|
4 | * [ Description ] |
---|
5 | * |
---|
6 | */ |
---|
7 | |
---|
8 | #include "Behavioural/Core/Multi_OOO_Engine/OOO_Engine/Rename_unit/Load_Store_pointer_unit/include/Load_Store_pointer_unit.h" |
---|
9 | |
---|
10 | namespace morpheo { |
---|
11 | namespace behavioural { |
---|
12 | namespace core { |
---|
13 | namespace multi_ooo_engine { |
---|
14 | namespace ooo_engine { |
---|
15 | namespace rename_unit { |
---|
16 | namespace load_store_pointer_unit { |
---|
17 | |
---|
18 | |
---|
19 | #undef FUNCTION |
---|
20 | #define FUNCTION "Load_Store_pointer_unit::Load_Store_pointer_unit" |
---|
21 | Load_Store_pointer_unit::Load_Store_pointer_unit |
---|
22 | ( |
---|
23 | #ifdef SYSTEMC |
---|
24 | sc_module_name name, |
---|
25 | #else |
---|
26 | string name, |
---|
27 | #endif |
---|
28 | #ifdef STATISTICS |
---|
29 | morpheo::behavioural::Parameters_Statistics * param_statistics, |
---|
30 | #endif |
---|
31 | morpheo::behavioural::core::multi_ooo_engine::ooo_engine::rename_unit::load_store_pointer_unit::Parameters * param, |
---|
32 | morpheo::behavioural::Tusage_t usage |
---|
33 | ): |
---|
34 | _name (name) |
---|
35 | ,_param (param) |
---|
36 | ,_usage (usage) |
---|
37 | { |
---|
38 | log_printf(FUNC,Load_Store_pointer_unit,FUNCTION,"Begin"); |
---|
39 | |
---|
40 | // #if DEBUG_Load_Store_pointer_unit == true |
---|
41 | // log_printf(INFO,Load_Store_pointer_unit,FUNCTION,_("<%s> Parameters"),_name.c_str()); |
---|
42 | |
---|
43 | // std::cout << *param << std::endl; |
---|
44 | // #endif |
---|
45 | |
---|
46 | log_printf(INFO,Load_Store_pointer_unit,FUNCTION,"Allocation"); |
---|
47 | |
---|
48 | allocation ( |
---|
49 | #ifdef STATISTICS |
---|
50 | param_statistics |
---|
51 | #endif |
---|
52 | ); |
---|
53 | |
---|
54 | #ifdef STATISTICS |
---|
55 | if (usage_is_set(_usage,USE_STATISTICS)) |
---|
56 | { |
---|
57 | log_printf(INFO,Load_Store_pointer_unit,FUNCTION,"Allocation of statistics"); |
---|
58 | |
---|
59 | statistics_declaration(param_statistics); |
---|
60 | } |
---|
61 | #endif |
---|
62 | |
---|
63 | #ifdef VHDL |
---|
64 | if (usage_is_set(_usage,USE_VHDL)) |
---|
65 | { |
---|
66 | // generate the vhdl |
---|
67 | log_printf(INFO,Load_Store_pointer_unit,FUNCTION,"Generate the vhdl"); |
---|
68 | |
---|
69 | vhdl(); |
---|
70 | } |
---|
71 | #endif |
---|
72 | |
---|
73 | #ifdef SYSTEMC |
---|
74 | if (usage_is_set(_usage,USE_SYSTEMC)) |
---|
75 | { |
---|
76 | #ifdef SYSTEMCASS_SPECIFIC |
---|
77 | constant(); |
---|
78 | #else |
---|
79 | log_printf(INFO,Load_Store_pointer_unit,FUNCTION,"Method - constant"); |
---|
80 | |
---|
81 | SC_METHOD (constant); |
---|
82 | // dont_initialize (); |
---|
83 | |
---|
84 | # ifdef SYSTEMCASS_SPECIFIC |
---|
85 | // List dependency information |
---|
86 | # endif |
---|
87 | #endif |
---|
88 | |
---|
89 | log_printf(INFO,Load_Store_pointer_unit,FUNCTION,"Method - transition"); |
---|
90 | |
---|
91 | SC_METHOD (transition); |
---|
92 | dont_initialize (); |
---|
93 | sensitive << (*(in_CLOCK)).pos(); |
---|
94 | |
---|
95 | # ifdef SYSTEMCASS_SPECIFIC |
---|
96 | // List dependency information |
---|
97 | # endif |
---|
98 | |
---|
99 | log_printf(INFO,Load_Store_pointer_unit,FUNCTION,"Method - genMealy_insert"); |
---|
100 | |
---|
101 | SC_METHOD (genMealy_insert); |
---|
102 | dont_initialize (); |
---|
103 | sensitive << (*(in_CLOCK)).neg() |
---|
104 | << (*(in_NRESET)); |
---|
105 | |
---|
106 | for (uint32_t i=0; i<_param->_nb_inst_insert; i++) |
---|
107 | { |
---|
108 | if (_param->_have_port_front_end_id) |
---|
109 | sensitive << (*(in_INSERT_FRONT_END_ID [i])); |
---|
110 | if (_param->_have_port_context_id) |
---|
111 | sensitive << (*(in_INSERT_CONTEXT_ID [i])); |
---|
112 | sensitive << (*(in_INSERT_VAL [i])) |
---|
113 | << (*(in_INSERT_TYPE [i])) |
---|
114 | << (*(in_INSERT_OPERATION [i])); |
---|
115 | } |
---|
116 | |
---|
117 | # ifdef SYSTEMCASS_SPECIFIC |
---|
118 | // // List dependency information |
---|
119 | // for (uint32_t i=0; i<_param->_nb_inst_insert; i++) |
---|
120 | // { |
---|
121 | // (*(out_INSERT_ACK [i])) (*( in_INSERT_VAL [i])); |
---|
122 | // if (_param->_have_port_front_end_id) |
---|
123 | // (*(out_INSERT_ACK [i])) (*( in_INSERT_FRONT_END_ID [i])); |
---|
124 | // if (_param->_have_port_context_id) |
---|
125 | // (*(out_INSERT_ACK [i])) (*( in_INSERT_CONTEXT_ID [i])); |
---|
126 | // (*(out_INSERT_ACK [i])) (*( in_INSERT_TYPE [i])); |
---|
127 | // (*(out_INSERT_ACK [i])) (*( in_INSERT_OPERATION [i])); |
---|
128 | |
---|
129 | // (*(out_INSERT_STORE_QUEUE_PTR_WRITE [i])) (*( in_INSERT_VAL [i])); |
---|
130 | // if (_param->_have_port_front_end_id) |
---|
131 | // (*(out_INSERT_STORE_QUEUE_PTR_WRITE [i])) (*( in_INSERT_FRONT_END_ID [i])); |
---|
132 | // if (_param->_have_port_context_id) |
---|
133 | // (*(out_INSERT_STORE_QUEUE_PTR_WRITE [i])) (*( in_INSERT_CONTEXT_ID [i])); |
---|
134 | // (*(out_INSERT_STORE_QUEUE_PTR_WRITE [i])) (*( in_INSERT_TYPE [i])); |
---|
135 | // (*(out_INSERT_STORE_QUEUE_PTR_WRITE [i])) (*( in_INSERT_OPERATION [i])); |
---|
136 | |
---|
137 | // if (_param->_have_port_load_queue_ptr) |
---|
138 | // { |
---|
139 | // (*(out_INSERT_LOAD_QUEUE_PTR_WRITE [i])) (*( in_INSERT_VAL [i])); |
---|
140 | // if (_param->_have_port_front_end_id) |
---|
141 | // (*(out_INSERT_LOAD_QUEUE_PTR_WRITE [i])) (*( in_INSERT_FRONT_END_ID [i])); |
---|
142 | // if (_param->_have_port_context_id) |
---|
143 | // (*(out_INSERT_LOAD_QUEUE_PTR_WRITE [i])) (*( in_INSERT_CONTEXT_ID [i])); |
---|
144 | // (*(out_INSERT_LOAD_QUEUE_PTR_WRITE [i])) (*( in_INSERT_TYPE [i])); |
---|
145 | // (*(out_INSERT_LOAD_QUEUE_PTR_WRITE [i])) (*( in_INSERT_OPERATION [i])); |
---|
146 | // } |
---|
147 | // } |
---|
148 | # endif |
---|
149 | |
---|
150 | log_printf(INFO,Load_Store_pointer_unit,FUNCTION,"Method - genMealy_retire"); |
---|
151 | |
---|
152 | SC_METHOD (genMealy_retire); |
---|
153 | dont_initialize (); |
---|
154 | sensitive << (*(in_CLOCK)).neg() |
---|
155 | << (*(in_NRESET)); |
---|
156 | |
---|
157 | for (uint32_t i=0; i<_param->_nb_inst_retire; i++) |
---|
158 | { |
---|
159 | if (_param->_have_port_front_end_id) |
---|
160 | sensitive << (*(in_RETIRE_FRONT_END_ID [i])); |
---|
161 | if (_param->_have_port_context_id) |
---|
162 | sensitive << (*(in_RETIRE_CONTEXT_ID [i])); |
---|
163 | if (_param->_have_port_load_queue_ptr) |
---|
164 | sensitive << (*(in_RETIRE_LOAD_QUEUE_PTR_WRITE [i])); |
---|
165 | sensitive << (*(in_RETIRE_VAL [i])) |
---|
166 | // << (*(in_RETIRE_TYPE [i])) |
---|
167 | // << (*(in_RETIRE_OPERATION [i])) |
---|
168 | << (*(in_RETIRE_USE_STORE_QUEUE [i])) |
---|
169 | << (*(in_RETIRE_USE_LOAD_QUEUE [i])) |
---|
170 | << (*(in_RETIRE_STORE_QUEUE_PTR_WRITE [i]));; |
---|
171 | } |
---|
172 | |
---|
173 | # ifdef SYSTEMCASS_SPECIFIC |
---|
174 | // List dependency information |
---|
175 | for (uint32_t i=0; i<_param->_nb_inst_retire; i++) |
---|
176 | { |
---|
177 | (*(out_RETIRE_ACK [i])) (*( in_RETIRE_VAL [i])); |
---|
178 | if (_param->_have_port_front_end_id) |
---|
179 | (*(out_RETIRE_ACK [i])) (*( in_RETIRE_FRONT_END_ID [i])); |
---|
180 | if (_param->_have_port_context_id) |
---|
181 | (*(out_RETIRE_ACK [i])) (*( in_RETIRE_CONTEXT_ID [i])); |
---|
182 | // (*(out_RETIRE_ACK [i])) (*( in_RETIRE_TYPE [i])); |
---|
183 | // (*(out_RETIRE_ACK [i])) (*( in_RETIRE_OPERATION [i])); |
---|
184 | (*(out_RETIRE_ACK [i])) (*( in_RETIRE_USE_STORE_QUEUE [i])); |
---|
185 | (*(out_RETIRE_ACK [i])) (*( in_RETIRE_USE_LOAD_QUEUE [i])); |
---|
186 | if (_param->_have_port_load_queue_ptr) |
---|
187 | (*(out_RETIRE_ACK [i])) (*( in_RETIRE_LOAD_QUEUE_PTR_WRITE [i])); |
---|
188 | (*(out_RETIRE_ACK [i])) (*( in_RETIRE_STORE_QUEUE_PTR_WRITE [i])); |
---|
189 | } |
---|
190 | # endif |
---|
191 | |
---|
192 | #endif |
---|
193 | } |
---|
194 | log_printf(FUNC,Load_Store_pointer_unit,FUNCTION,"End"); |
---|
195 | }; |
---|
196 | |
---|
197 | #undef FUNCTION |
---|
198 | #define FUNCTION "Load_Store_pointer_unit::~Load_Store_pointer_unit" |
---|
199 | Load_Store_pointer_unit::~Load_Store_pointer_unit (void) |
---|
200 | { |
---|
201 | log_printf(FUNC,Load_Store_pointer_unit,FUNCTION,"Begin"); |
---|
202 | |
---|
203 | #ifdef STATISTICS |
---|
204 | if (usage_is_set(_usage,USE_STATISTICS)) |
---|
205 | { |
---|
206 | log_printf(INFO,Load_Store_pointer_unit,FUNCTION,"Generate Statistics file"); |
---|
207 | |
---|
208 | delete _stat; |
---|
209 | } |
---|
210 | #endif |
---|
211 | |
---|
212 | log_printf(INFO,Load_Store_pointer_unit,FUNCTION,"Deallocation"); |
---|
213 | deallocation (); |
---|
214 | |
---|
215 | log_printf(FUNC,Load_Store_pointer_unit,FUNCTION,"End"); |
---|
216 | }; |
---|
217 | |
---|
218 | }; // end namespace load_store_pointer_unit |
---|
219 | }; // end namespace rename_unit |
---|
220 | }; // end namespace ooo_engine |
---|
221 | }; // end namespace multi_ooo_engine |
---|
222 | }; // end namespace core |
---|
223 | |
---|
224 | }; // end namespace behavioural |
---|
225 | }; // end namespace morpheo |
---|