1 | /* |
---|
2 | * $Id: Load_Store_pointer_unit.cpp 81 2008-04-15 18:40:01Z 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 | log_printf(INFO,Load_Store_pointer_unit,FUNCTION,"Allocation"); |
---|
41 | |
---|
42 | allocation ( |
---|
43 | #ifdef STATISTICS |
---|
44 | param_statistics |
---|
45 | #endif |
---|
46 | ); |
---|
47 | |
---|
48 | #ifdef STATISTICS |
---|
49 | if (_usage & USE_STATISTICS) |
---|
50 | { |
---|
51 | log_printf(INFO,Load_Store_pointer_unit,FUNCTION,"Allocation of statistics"); |
---|
52 | |
---|
53 | statistics_declaration(param_statistics); |
---|
54 | } |
---|
55 | #endif |
---|
56 | |
---|
57 | #ifdef VHDL |
---|
58 | if (_usage & USE_VHDL) |
---|
59 | { |
---|
60 | // generate the vhdl |
---|
61 | log_printf(INFO,Load_Store_pointer_unit,FUNCTION,"Generate the vhdl"); |
---|
62 | |
---|
63 | vhdl(); |
---|
64 | } |
---|
65 | #endif |
---|
66 | |
---|
67 | #ifdef SYSTEMC |
---|
68 | if (_usage & USE_SYSTEMC) |
---|
69 | { |
---|
70 | log_printf(INFO,Load_Store_pointer_unit,FUNCTION,"Method - transition"); |
---|
71 | |
---|
72 | SC_METHOD (transition); |
---|
73 | dont_initialize (); |
---|
74 | sensitive << (*(in_CLOCK)).pos(); |
---|
75 | |
---|
76 | # ifdef SYSTEMCASS_SPECIFIC |
---|
77 | // List dependency information |
---|
78 | # endif |
---|
79 | |
---|
80 | log_printf(INFO,Load_Store_pointer_unit,FUNCTION,"Method - genMealy_insert"); |
---|
81 | |
---|
82 | SC_METHOD (genMealy_insert); |
---|
83 | dont_initialize (); |
---|
84 | sensitive << (*(in_CLOCK)).neg(); |
---|
85 | for (uint32_t i=0; i<_param->_nb_inst_insert; i++) |
---|
86 | { |
---|
87 | if (_param->_have_port_front_end_id) |
---|
88 | sensitive << (*(in_INSERT_FRONT_END_ID [i])); |
---|
89 | if (_param->_have_port_context_id) |
---|
90 | sensitive << (*(in_INSERT_CONTEXT_ID [i])); |
---|
91 | sensitive << (*(in_INSERT_VAL [i])) |
---|
92 | << (*(in_INSERT_TYPE [i])) |
---|
93 | << (*(in_INSERT_OPERATION [i])); |
---|
94 | } |
---|
95 | |
---|
96 | # ifdef SYSTEMCASS_SPECIFIC |
---|
97 | // List dependency information |
---|
98 | for (uint32_t i=0; i<_param->_nb_inst_insert; i++) |
---|
99 | { |
---|
100 | (*(out_INSERT_ACK [i])) (*( in_INSERT_VAL [i])); |
---|
101 | if (_param->_have_port_front_end_id) |
---|
102 | (*(out_INSERT_ACK [i])) (*( in_INSERT_FRONT_END_ID [i])); |
---|
103 | if (_param->_have_port_context_id) |
---|
104 | (*(out_INSERT_ACK [i])) (*( in_INSERT_CONTEXT_ID [i])); |
---|
105 | (*(out_INSERT_ACK [i])) (*( in_INSERT_TYPE [i])); |
---|
106 | (*(out_INSERT_ACK [i])) (*( in_INSERT_OPERATION [i])); |
---|
107 | |
---|
108 | (*(out_INSERT_STORE_QUEUE_PTR_WRITE [i])) (*( in_INSERT_VAL [i])); |
---|
109 | if (_param->_have_port_front_end_id) |
---|
110 | (*(out_INSERT_STORE_QUEUE_PTR_WRITE [i])) (*( in_INSERT_FRONT_END_ID [i])); |
---|
111 | if (_param->_have_port_context_id) |
---|
112 | (*(out_INSERT_STORE_QUEUE_PTR_WRITE [i])) (*( in_INSERT_CONTEXT_ID [i])); |
---|
113 | (*(out_INSERT_STORE_QUEUE_PTR_WRITE [i])) (*( in_INSERT_TYPE [i])); |
---|
114 | (*(out_INSERT_STORE_QUEUE_PTR_WRITE [i])) (*( in_INSERT_OPERATION [i])); |
---|
115 | |
---|
116 | if (_param->_have_port_load_queue_ptr) |
---|
117 | { |
---|
118 | (*(out_INSERT_LOAD_QUEUE_PTR_WRITE [i])) (*( in_INSERT_VAL [i])); |
---|
119 | if (_param->_have_port_front_end_id) |
---|
120 | (*(out_INSERT_LOAD_QUEUE_PTR_WRITE [i])) (*( in_INSERT_FRONT_END_ID [i])); |
---|
121 | if (_param->_have_port_context_id) |
---|
122 | (*(out_INSERT_LOAD_QUEUE_PTR_WRITE [i])) (*( in_INSERT_CONTEXT_ID [i])); |
---|
123 | (*(out_INSERT_LOAD_QUEUE_PTR_WRITE [i])) (*( in_INSERT_TYPE [i])); |
---|
124 | (*(out_INSERT_LOAD_QUEUE_PTR_WRITE [i])) (*( in_INSERT_OPERATION [i])); |
---|
125 | } |
---|
126 | } |
---|
127 | # endif |
---|
128 | |
---|
129 | log_printf(INFO,Load_Store_pointer_unit,FUNCTION,"Method - genMealy_retire"); |
---|
130 | |
---|
131 | SC_METHOD (genMealy_retire); |
---|
132 | dont_initialize (); |
---|
133 | sensitive << (*(in_CLOCK)).neg(); |
---|
134 | for (uint32_t i=0; i<_param->_nb_inst_retire; i++) |
---|
135 | { |
---|
136 | if (_param->_have_port_front_end_id) |
---|
137 | sensitive << (*(in_RETIRE_FRONT_END_ID [i])); |
---|
138 | if (_param->_have_port_context_id) |
---|
139 | sensitive << (*(in_RETIRE_CONTEXT_ID [i])); |
---|
140 | if (_param->_have_port_load_queue_ptr) |
---|
141 | sensitive << (*(in_RETIRE_LOAD_QUEUE_PTR_WRITE [i])); |
---|
142 | sensitive << (*(in_RETIRE_VAL [i])) |
---|
143 | << (*(in_RETIRE_TYPE [i])) |
---|
144 | << (*(in_RETIRE_OPERATION [i])) |
---|
145 | << (*(in_RETIRE_STORE_QUEUE_PTR_WRITE [i]));; |
---|
146 | } |
---|
147 | |
---|
148 | # ifdef SYSTEMCASS_SPECIFIC |
---|
149 | // List dependency information |
---|
150 | for (uint32_t i=0; i<_param->_nb_inst_retire; i++) |
---|
151 | { |
---|
152 | (*(out_RETIRE_ACK [i])) (*( in_RETIRE_VAL [i])); |
---|
153 | if (_param->_have_port_front_end_id) |
---|
154 | (*(out_RETIRE_ACK [i])) (*( in_RETIRE_FRONT_END_ID [i])); |
---|
155 | if (_param->_have_port_context_id) |
---|
156 | (*(out_RETIRE_ACK [i])) (*( in_RETIRE_CONTEXT_ID [i])); |
---|
157 | (*(out_RETIRE_ACK [i])) (*( in_RETIRE_TYPE [i])); |
---|
158 | (*(out_RETIRE_ACK [i])) (*( in_RETIRE_OPERATION [i])); |
---|
159 | if (_param->_have_port_load_queue_ptr) |
---|
160 | (*(out_RETIRE_ACK [i])) (*( in_RETIRE_LOAD_QUEUE_PTR_WRITE [i])); |
---|
161 | (*(out_RETIRE_ACK [i])) (*( in_RETIRE_STORE_QUEUE_PTR_WRITE [i])); |
---|
162 | } |
---|
163 | # endif |
---|
164 | |
---|
165 | #endif |
---|
166 | } |
---|
167 | log_printf(FUNC,Load_Store_pointer_unit,FUNCTION,"End"); |
---|
168 | }; |
---|
169 | |
---|
170 | #undef FUNCTION |
---|
171 | #define FUNCTION "Load_Store_pointer_unit::~Load_Store_pointer_unit" |
---|
172 | Load_Store_pointer_unit::~Load_Store_pointer_unit (void) |
---|
173 | { |
---|
174 | log_printf(FUNC,Load_Store_pointer_unit,FUNCTION,"Begin"); |
---|
175 | |
---|
176 | #ifdef STATISTICS |
---|
177 | if (_usage & USE_STATISTICS) |
---|
178 | { |
---|
179 | log_printf(INFO,Load_Store_pointer_unit,FUNCTION,"Generate Statistics file"); |
---|
180 | |
---|
181 | delete _stat; |
---|
182 | } |
---|
183 | #endif |
---|
184 | |
---|
185 | log_printf(INFO,Load_Store_pointer_unit,FUNCTION,"Deallocation"); |
---|
186 | deallocation (); |
---|
187 | |
---|
188 | log_printf(FUNC,Load_Store_pointer_unit,FUNCTION,"End"); |
---|
189 | }; |
---|
190 | |
---|
191 | }; // end namespace load_store_pointer_unit |
---|
192 | }; // end namespace rename_unit |
---|
193 | }; // end namespace ooo_engine |
---|
194 | }; // end namespace multi_ooo_engine |
---|
195 | }; // end namespace core |
---|
196 | |
---|
197 | }; // end namespace behavioural |
---|
198 | }; // end namespace morpheo |
---|