1 | /* |
---|
2 | * $Id: Reexecute_unit.cpp 88 2008-12-10 18:31:39Z rosiere $ |
---|
3 | * |
---|
4 | * [ Description ] |
---|
5 | * |
---|
6 | */ |
---|
7 | |
---|
8 | #include "Behavioural/Core/Multi_OOO_Engine/OOO_Engine/Reexecute_unit/include/Reexecute_unit.h" |
---|
9 | |
---|
10 | namespace morpheo { |
---|
11 | namespace behavioural { |
---|
12 | namespace core { |
---|
13 | namespace multi_ooo_engine { |
---|
14 | namespace ooo_engine { |
---|
15 | namespace reexecute_unit { |
---|
16 | |
---|
17 | |
---|
18 | #undef FUNCTION |
---|
19 | #define FUNCTION "Reexecute_unit::Reexecute_unit" |
---|
20 | Reexecute_unit::Reexecute_unit |
---|
21 | ( |
---|
22 | #ifdef SYSTEMC |
---|
23 | sc_module_name name, |
---|
24 | #else |
---|
25 | string name, |
---|
26 | #endif |
---|
27 | #ifdef STATISTICS |
---|
28 | morpheo::behavioural::Parameters_Statistics * param_statistics, |
---|
29 | #endif |
---|
30 | morpheo::behavioural::core::multi_ooo_engine::ooo_engine::reexecute_unit::Parameters * param, |
---|
31 | morpheo::behavioural::Tusage_t usage |
---|
32 | ): |
---|
33 | _name (name) |
---|
34 | ,_param (param) |
---|
35 | ,_usage (usage) |
---|
36 | { |
---|
37 | log_begin(Reexecute_unit,FUNCTION); |
---|
38 | |
---|
39 | usage_environment(_usage); |
---|
40 | |
---|
41 | #if DEBUG_Reexecute_unit == true |
---|
42 | log_printf(INFO,Reexecute_unit,FUNCTION,_("<%s> Parameters"),_name.c_str()); |
---|
43 | |
---|
44 | std::cout << *param << std::endl; |
---|
45 | #endif |
---|
46 | |
---|
47 | log_printf(INFO,Reexecute_unit,FUNCTION,_("<%s> : Allocation"),_name.c_str()); |
---|
48 | |
---|
49 | allocation ( |
---|
50 | #ifdef STATISTICS |
---|
51 | param_statistics |
---|
52 | #endif |
---|
53 | ); |
---|
54 | |
---|
55 | #ifdef STATISTICS |
---|
56 | if (usage_is_set(_usage,USE_STATISTICS)) |
---|
57 | { |
---|
58 | log_printf(INFO,Reexecute_unit,FUNCTION,_("<%s> : Allocation of statistics"),_name.c_str()); |
---|
59 | |
---|
60 | statistics_allocation(param_statistics); |
---|
61 | } |
---|
62 | #endif |
---|
63 | |
---|
64 | #ifdef VHDL |
---|
65 | if (usage_is_set(_usage,USE_VHDL)) |
---|
66 | { |
---|
67 | // generate the vhdl |
---|
68 | log_printf(INFO,Reexecute_unit,FUNCTION,_("<%s> : Generate the vhdl"),_name.c_str()); |
---|
69 | |
---|
70 | vhdl(); |
---|
71 | } |
---|
72 | #endif |
---|
73 | |
---|
74 | #ifdef SYSTEMC |
---|
75 | if (usage_is_set(_usage,USE_SYSTEMC)) |
---|
76 | { |
---|
77 | // Constant |
---|
78 | for (uint32_t i=0; i<_param->_nb_inst_reexecute; ++i) |
---|
79 | { |
---|
80 | if (_param->_have_port_load_queue_ptr) |
---|
81 | PORT_WRITE(out_REEXECUTE_LOAD_QUEUE_PTR_WRITE [i],0); |
---|
82 | PORT_WRITE(out_REEXECUTE_READ_RA [i],0); |
---|
83 | PORT_WRITE(out_REEXECUTE_NUM_REG_RA [i],0); |
---|
84 | PORT_WRITE(out_REEXECUTE_READ_RB [i],0); |
---|
85 | PORT_WRITE(out_REEXECUTE_NUM_REG_RB [i],0); |
---|
86 | PORT_WRITE(out_REEXECUTE_READ_RC [i],0); |
---|
87 | PORT_WRITE(out_REEXECUTE_NUM_REG_RC [i],0); |
---|
88 | PORT_WRITE(out_REEXECUTE_WRITE_RE [i],0); |
---|
89 | PORT_WRITE(out_REEXECUTE_NUM_REG_RE [i],0); |
---|
90 | } |
---|
91 | |
---|
92 | |
---|
93 | log_printf(INFO,Reexecute_unit,FUNCTION,_("<%s> : Method - transition"),_name.c_str()); |
---|
94 | |
---|
95 | SC_METHOD (transition); |
---|
96 | dont_initialize (); |
---|
97 | sensitive << (*(in_CLOCK)).pos(); |
---|
98 | |
---|
99 | # ifdef SYSTEMCASS_SPECIFIC |
---|
100 | // List dependency information |
---|
101 | # endif |
---|
102 | |
---|
103 | log_printf(INFO,Reexecute_unit,FUNCTION,_("<%s> : Method - genMoore"),_name.c_str()); |
---|
104 | |
---|
105 | SC_METHOD (genMoore); |
---|
106 | dont_initialize (); |
---|
107 | sensitive << (*(in_CLOCK)).neg(); // need internal register |
---|
108 | |
---|
109 | # ifdef SYSTEMCASS_SPECIFIC |
---|
110 | // List dependency information |
---|
111 | # endif |
---|
112 | |
---|
113 | log_printf(INFO,Reexecute_unit,FUNCTION,_("<%s> : Method - genMealy_reexecute"),_name.c_str()); |
---|
114 | |
---|
115 | SC_METHOD (genMealy_reexecute); |
---|
116 | dont_initialize (); |
---|
117 | sensitive << (*(in_CLOCK)).neg(); // need internal register |
---|
118 | |
---|
119 | for (uint32_t i=0; i<_param->_nb_inst_reexecute; i++) |
---|
120 | { |
---|
121 | if (_param->_have_port_context_id) |
---|
122 | sensitive << (*(in_REEXECUTE_ROB_CONTEXT_ID [i])); |
---|
123 | if (_param->_have_port_front_end_id) |
---|
124 | sensitive << (*(in_REEXECUTE_ROB_FRONT_END_ID [i])); |
---|
125 | if (_param->_have_port_rob_ptr ) |
---|
126 | sensitive << (*(in_REEXECUTE_ROB_PACKET_ID [i])); |
---|
127 | sensitive << (*(in_REEXECUTE_ROB_OPERATION [i])) |
---|
128 | << (*(in_REEXECUTE_ROB_TYPE [i])) |
---|
129 | << (*(in_REEXECUTE_ROB_STORE_QUEUE_PTR_WRITE [i])); |
---|
130 | } |
---|
131 | |
---|
132 | # ifdef SYSTEMCASS_SPECIFIC |
---|
133 | // List dependency information |
---|
134 | # endif |
---|
135 | |
---|
136 | log_printf(INFO,Reexecute_unit,FUNCTION,_("<%s> : Method - genMealy_commit"),_name.c_str()); |
---|
137 | |
---|
138 | SC_METHOD (genMealy_commit); |
---|
139 | dont_initialize (); |
---|
140 | sensitive << (*(in_CLOCK)).neg(); // need internal register |
---|
141 | |
---|
142 | for (uint32_t i=0; i<_param->_nb_execute_loop; ++i) |
---|
143 | for (uint32_t j=0; j<_param->_nb_inst_execute [i]; ++j) |
---|
144 | { |
---|
145 | if (_param->_have_port_context_id) |
---|
146 | sensitive << (*(in_EXECUTE_LOOP_CONTEXT_ID [i][j])); |
---|
147 | if (_param->_have_port_front_end_id) |
---|
148 | sensitive << (*(in_EXECUTE_LOOP_FRONT_END_ID [i][j])); |
---|
149 | if (_param->_have_port_rob_ptr ) |
---|
150 | sensitive << (*(in_EXECUTE_LOOP_PACKET_ID [i][j])); |
---|
151 | sensitive << (*(in_EXECUTE_LOOP_VAL [i][j])) |
---|
152 | // << (*(in_EXECUTE_LOOP_OPERATION [i][j])) |
---|
153 | // << (*(in_EXECUTE_LOOP_TYPE [i][j])) |
---|
154 | << (*(in_EXECUTE_LOOP_FLAGS [i][j])) |
---|
155 | << (*(in_EXECUTE_LOOP_EXCEPTION [i][j])) |
---|
156 | << (*(in_EXECUTE_LOOP_NO_SEQUENCE [i][j])) |
---|
157 | << (*(in_EXECUTE_LOOP_ADDRESS [i][j])) |
---|
158 | << (*(in_EXECUTE_LOOP_DATA [i][j])); |
---|
159 | } |
---|
160 | for (uint32_t i=0; i<_param->_nb_inst_commit; ++i) |
---|
161 | sensitive << (*(in_COMMIT_ACK [i])); |
---|
162 | |
---|
163 | # ifdef SYSTEMCASS_SPECIFIC |
---|
164 | // List dependency information |
---|
165 | # endif |
---|
166 | |
---|
167 | #endif |
---|
168 | } |
---|
169 | log_end(Reexecute_unit,FUNCTION); |
---|
170 | }; |
---|
171 | |
---|
172 | #undef FUNCTION |
---|
173 | #define FUNCTION "Reexecute_unit::~Reexecute_unit" |
---|
174 | Reexecute_unit::~Reexecute_unit (void) |
---|
175 | { |
---|
176 | log_begin(Reexecute_unit,FUNCTION); |
---|
177 | |
---|
178 | #ifdef STATISTICS |
---|
179 | if (usage_is_set(_usage,USE_STATISTICS)) |
---|
180 | { |
---|
181 | statistics_deallocation(); |
---|
182 | } |
---|
183 | #endif |
---|
184 | |
---|
185 | log_printf(INFO,Reexecute_unit,FUNCTION,_("<%s> : Deallocation"),_name.c_str()); |
---|
186 | deallocation (); |
---|
187 | |
---|
188 | log_end(Reexecute_unit,FUNCTION); |
---|
189 | }; |
---|
190 | |
---|
191 | }; // end namespace reexecute_unit |
---|
192 | }; // end namespace ooo_engine |
---|
193 | }; // end namespace multi_ooo_engine |
---|
194 | }; // end namespace core |
---|
195 | |
---|
196 | }; // end namespace behavioural |
---|
197 | }; // end namespace morpheo |
---|