1 | #ifndef morpheo_behavioural_core_multi_ooo_engine_ooo_engine_commit_unit_Types_h |
---|
2 | #define morpheo_behavioural_core_multi_ooo_engine_ooo_engine_commit_unit_Types_h |
---|
3 | |
---|
4 | /* |
---|
5 | * $Id: Types.h 145 2010-10-13 18:15:51Z rosiere $ |
---|
6 | * |
---|
7 | * [ Description ] |
---|
8 | * |
---|
9 | */ |
---|
10 | |
---|
11 | #include "Behavioural/include/Types.h" |
---|
12 | |
---|
13 | namespace morpheo { |
---|
14 | namespace behavioural { |
---|
15 | namespace core { |
---|
16 | namespace multi_ooo_engine { |
---|
17 | namespace ooo_engine { |
---|
18 | namespace commit_unit { |
---|
19 | |
---|
20 | typedef enum |
---|
21 | { |
---|
22 | RETIRE_IN_ORDER , |
---|
23 | RETIRE_OOO_RENAME_UNIT, |
---|
24 | RETIRE_OOO_CONTEXT |
---|
25 | } Tretire_ooo_scheme_t; |
---|
26 | |
---|
27 | typedef enum |
---|
28 | { |
---|
29 | ROB_EMPTY , // |
---|
30 | |
---|
31 | ROB_BRANCH_WAIT_END , // |
---|
32 | ROB_BRANCH_COMPLETE , // |
---|
33 | |
---|
34 | ROB_STORE_WAIT_END_OK , // |
---|
35 | ROB_STORE_WAIT_END_KO , // |
---|
36 | ROB_STORE_OK , // |
---|
37 | ROB_STORE_KO , // |
---|
38 | ROB_STORE_OK_WAIT_END , // |
---|
39 | ROB_STORE_KO_WAIT_END , // |
---|
40 | ROB_STORE_EVENT , // |
---|
41 | |
---|
42 | ROB_OTHER_WAIT_END , // |
---|
43 | |
---|
44 | ROB_EVENT_WAIT_END , // |
---|
45 | |
---|
46 | ROB_END_OK_SPECULATIVE , // |
---|
47 | ROB_END_OK , // |
---|
48 | ROB_END_KO_SPECULATIVE , // |
---|
49 | ROB_END_KO , // |
---|
50 | ROB_END_BRANCH_MISS_SPECULATIVE, // |
---|
51 | ROB_END_BRANCH_MISS , // |
---|
52 | ROB_END_LOAD_MISS_SPECULATIVE , // |
---|
53 | ROB_END_LOAD_MISS_UPDATE , // |
---|
54 | ROB_END_LOAD_MISS , // |
---|
55 | ROB_END_MISS , // |
---|
56 | ROB_END_EXCEPTION_WAIT_HEAD , // |
---|
57 | ROB_END_EXCEPTION_UPDATE , // |
---|
58 | ROB_END_EXCEPTION , // |
---|
59 | ROB_END |
---|
60 | } rob_state_t; |
---|
61 | |
---|
62 | typedef enum |
---|
63 | { |
---|
64 | COMMIT_EVENT_STATE_NO_EVENT , |
---|
65 | COMMIT_EVENT_STATE_NOT_YET_EVENT, |
---|
66 | COMMIT_EVENT_STATE_EVENT , |
---|
67 | // COMMIT_EVENT_STATE_WAIT_DECOD , |
---|
68 | COMMIT_EVENT_STATE_WAIT_END , |
---|
69 | // COMMIT_EVENT_STATE_END |
---|
70 | } Tcommit_event_state_t; |
---|
71 | |
---|
72 | #define commit_event_state_to_event_state(x) ((x==COMMIT_EVENT_STATE_EVENT)?EVENT_STATE_EVENT:((x==COMMIT_EVENT_STATE_WAIT_END)?EVENT_STATE_WAITEND:EVENT_STATE_NO_EVENT)) |
---|
73 | #define rob_state_to_event_type(x) ((x==ROB_END_BRANCH_MISS)?EVENT_TYPE_BRANCH_MISS_SPECULATION:((x==ROB_END_LOAD_MISS)?EVENT_TYPE_LOAD_MISS_SPECULATION:((x==ROB_END_EXCEPTION)?EVENT_TYPE_EXCEPTION:EVENT_TYPE_NONE))) |
---|
74 | |
---|
75 | // #define commit_event_state_to_event_state(x) ((x==COMMIT_EVENT_STATE_EVENT)?EVENT_STATE_EVENT:((x==COMMIT_EVENT_STATE_WAIT_END)?EVENT_STATE_WAITEND:((x==COMMIT_EVENT_STATE_END)?EVENT_STATE_END:EVENT_STATE_NO_EVENT))) |
---|
76 | // #define commit_event_state_to_event_state(x) ((x==COMMIT_EVENT_STATE_EVENT)?EVENT_STATE_EVENT:((x==COMMIT_EVENT_STATE_WAIT_DECOD)?EVENT_STATE_WAITEND:((x==COMMIT_EVENT_STATE_WAIT_END)?EVENT_STATE_WAITEND:((x==COMMIT_EVENT_STATE_END)?EVENT_STATE_END:EVENT_STATE_NO_EVENT)))) |
---|
77 | |
---|
78 | |
---|
79 | class entry_t |
---|
80 | { |
---|
81 | public : rob_state_t state ; |
---|
82 | public : rob_state_t state_old ; |
---|
83 | //public : Tcontrol_t restore ; |
---|
84 | |
---|
85 | public : uint32_t ptr ; |
---|
86 | public : Tcontext_t front_end_id ; |
---|
87 | public : Tcontext_t context_id ; |
---|
88 | public : uint32_t rename_unit_id ; |
---|
89 | public : Tdepth_t depth ; |
---|
90 | #ifdef STATISTICS |
---|
91 | public : uint32_t instruction ; |
---|
92 | #endif |
---|
93 | public : Ttype_t type ; |
---|
94 | public : Toperation_t operation ; |
---|
95 | public : Tcontrol_t is_delay_slot ; |
---|
96 | //public : Tgeneral_data_t address ; |
---|
97 | public : Tcontrol_t use_store_queue ; |
---|
98 | public : Tcontrol_t use_load_queue ; |
---|
99 | public : Tlsq_ptr_t store_queue_ptr_write ; |
---|
100 | public : Tlsq_ptr_t load_queue_ptr_write ; |
---|
101 | #ifdef DEBUG |
---|
102 | public : Tcontrol_t read_ra ; |
---|
103 | public : Tgeneral_address_t num_reg_ra_log ; |
---|
104 | public : Tgeneral_address_t num_reg_ra_phy ; |
---|
105 | #endif |
---|
106 | public : Tcontrol_t read_rb ; |
---|
107 | #ifdef DEBUG |
---|
108 | public : Tgeneral_address_t num_reg_rb_log ; |
---|
109 | public : Tgeneral_address_t num_reg_rb_phy ; |
---|
110 | public : Tcontrol_t read_rc ; |
---|
111 | public : Tspecial_address_t num_reg_rc_log ; |
---|
112 | public : Tspecial_address_t num_reg_rc_phy ; |
---|
113 | #endif |
---|
114 | public : Tcontrol_t write_rd ; |
---|
115 | public : Tgeneral_address_t num_reg_rd_log ; |
---|
116 | public : Tgeneral_address_t num_reg_rd_phy_old ; |
---|
117 | public : Tgeneral_address_t num_reg_rd_phy_new ; |
---|
118 | public : Tcontrol_t write_re ; |
---|
119 | public : Tspecial_address_t num_reg_re_log ; |
---|
120 | public : Tspecial_address_t num_reg_re_phy_old ; |
---|
121 | public : Tspecial_address_t num_reg_re_phy_new ; |
---|
122 | |
---|
123 | public : Texception_t exception ; |
---|
124 | public : Texception_t exception_use ; |
---|
125 | |
---|
126 | public : Tspecial_data_t flags ; |
---|
127 | public : Tcontrol_t no_sequence ; |
---|
128 | //public : Tcontrol_t speculative ; |
---|
129 | //public : Tgeneral_data_t data_commit ; // branch's destination |
---|
130 | #ifdef DEBUG |
---|
131 | public : Tgeneral_data_t load_data ; |
---|
132 | public : Taddress_t address ; |
---|
133 | #endif |
---|
134 | public : Taddress_t address_next ; |
---|
135 | #ifdef DEBUG |
---|
136 | public : double cycle_rob_in ; |
---|
137 | public : double cycle_commit ; |
---|
138 | #endif |
---|
139 | |
---|
140 | }; |
---|
141 | |
---|
142 | }; // end namespace commit_unit |
---|
143 | }; // end namespace ooo_engine |
---|
144 | }; // end namespace multi_ooo_engine |
---|
145 | }; // end namespace core |
---|
146 | }; // end namespace behavioural |
---|
147 | |
---|
148 | template<> inline std::string toString<morpheo::behavioural::core::multi_ooo_engine::ooo_engine::commit_unit::Tretire_ooo_scheme_t>(const morpheo::behavioural::core::multi_ooo_engine::ooo_engine::commit_unit::Tretire_ooo_scheme_t& x) |
---|
149 | { |
---|
150 | switch (x) |
---|
151 | { |
---|
152 | case morpheo::behavioural::core::multi_ooo_engine::ooo_engine::commit_unit::RETIRE_IN_ORDER : return "retire_in_order" ; break; |
---|
153 | case morpheo::behavioural::core::multi_ooo_engine::ooo_engine::commit_unit::RETIRE_OOO_RENAME_UNIT : return "retire_ooo_rename_unit"; break; |
---|
154 | case morpheo::behavioural::core::multi_ooo_engine::ooo_engine::commit_unit::RETIRE_OOO_CONTEXT : return "retire_ooo_context" ; break; |
---|
155 | default : return "" ; break; |
---|
156 | } |
---|
157 | }; |
---|
158 | |
---|
159 | template<> inline morpheo::behavioural::core::multi_ooo_engine::ooo_engine::commit_unit::Tretire_ooo_scheme_t fromString<morpheo::behavioural::core::multi_ooo_engine::ooo_engine::commit_unit::Tretire_ooo_scheme_t>(const std::string& x) |
---|
160 | { |
---|
161 | if ((x.compare(toString(static_cast<uint32_t>(morpheo::behavioural::core::multi_ooo_engine::ooo_engine::commit_unit::RETIRE_IN_ORDER ))) == 0) or |
---|
162 | (x.compare(toString( morpheo::behavioural::core::multi_ooo_engine::ooo_engine::commit_unit::RETIRE_IN_ORDER )) == 0)) |
---|
163 | return morpheo::behavioural::core::multi_ooo_engine::ooo_engine::commit_unit::RETIRE_IN_ORDER; |
---|
164 | |
---|
165 | if ((x.compare(toString(static_cast<uint32_t>(morpheo::behavioural::core::multi_ooo_engine::ooo_engine::commit_unit::RETIRE_OOO_RENAME_UNIT))) == 0) or |
---|
166 | (x.compare(toString( morpheo::behavioural::core::multi_ooo_engine::ooo_engine::commit_unit::RETIRE_OOO_RENAME_UNIT )) == 0)) |
---|
167 | return morpheo::behavioural::core::multi_ooo_engine::ooo_engine::commit_unit::RETIRE_OOO_RENAME_UNIT; |
---|
168 | |
---|
169 | if ((x.compare(toString(static_cast<uint32_t>(morpheo::behavioural::core::multi_ooo_engine::ooo_engine::commit_unit::RETIRE_OOO_CONTEXT ))) == 0) or |
---|
170 | (x.compare(toString( morpheo::behavioural::core::multi_ooo_engine::ooo_engine::commit_unit::RETIRE_OOO_CONTEXT )) == 0)) |
---|
171 | return morpheo::behavioural::core::multi_ooo_engine::ooo_engine::commit_unit::RETIRE_OOO_CONTEXT; |
---|
172 | |
---|
173 | throw (ERRORMORPHEO ("fromString","Unknow string : \""+x+"\"")); |
---|
174 | }; |
---|
175 | |
---|
176 | template<> inline std::string toString<morpheo::behavioural::core::multi_ooo_engine::ooo_engine::commit_unit::rob_state_t>(const morpheo::behavioural::core::multi_ooo_engine::ooo_engine::commit_unit::rob_state_t& x) |
---|
177 | { |
---|
178 | switch (x) |
---|
179 | { |
---|
180 | case morpheo::behavioural::core::multi_ooo_engine::ooo_engine::commit_unit::ROB_EMPTY : return "ROB_EMPTY" ; break; |
---|
181 | case morpheo::behavioural::core::multi_ooo_engine::ooo_engine::commit_unit::ROB_BRANCH_WAIT_END : return "ROB_BRANCH_WAIT_END" ; break; |
---|
182 | case morpheo::behavioural::core::multi_ooo_engine::ooo_engine::commit_unit::ROB_BRANCH_COMPLETE : return "ROB_BRANCH_COMPLETE" ; break; |
---|
183 | case morpheo::behavioural::core::multi_ooo_engine::ooo_engine::commit_unit::ROB_STORE_WAIT_END_OK : return "ROB_STORE_WAIT_END_OK" ; break; |
---|
184 | case morpheo::behavioural::core::multi_ooo_engine::ooo_engine::commit_unit::ROB_STORE_WAIT_END_KO : return "ROB_STORE_WAIT_END_KO" ; break; |
---|
185 | case morpheo::behavioural::core::multi_ooo_engine::ooo_engine::commit_unit::ROB_STORE_OK : return "ROB_STORE_OK" ; break; |
---|
186 | case morpheo::behavioural::core::multi_ooo_engine::ooo_engine::commit_unit::ROB_STORE_KO : return "ROB_STORE_KO" ; break; |
---|
187 | case morpheo::behavioural::core::multi_ooo_engine::ooo_engine::commit_unit::ROB_STORE_OK_WAIT_END : return "ROB_STORE_OK_WAIT_END" ; break; |
---|
188 | case morpheo::behavioural::core::multi_ooo_engine::ooo_engine::commit_unit::ROB_STORE_KO_WAIT_END : return "ROB_STORE_KO_WAIT_END" ; break; |
---|
189 | case morpheo::behavioural::core::multi_ooo_engine::ooo_engine::commit_unit::ROB_STORE_EVENT : return "ROB_STORE_EVENT" ; break; |
---|
190 | case morpheo::behavioural::core::multi_ooo_engine::ooo_engine::commit_unit::ROB_OTHER_WAIT_END : return "ROB_OTHER_WAIT_END" ; break; |
---|
191 | case morpheo::behavioural::core::multi_ooo_engine::ooo_engine::commit_unit::ROB_EVENT_WAIT_END : return "ROB_EVENT_WAIT_END" ; break; |
---|
192 | case morpheo::behavioural::core::multi_ooo_engine::ooo_engine::commit_unit::ROB_END_OK_SPECULATIVE : return "ROB_END_OK_SPECULATIVE" ; break; |
---|
193 | case morpheo::behavioural::core::multi_ooo_engine::ooo_engine::commit_unit::ROB_END_OK : return "ROB_END_OK" ; break; |
---|
194 | case morpheo::behavioural::core::multi_ooo_engine::ooo_engine::commit_unit::ROB_END_KO_SPECULATIVE : return "ROB_END_KO_SPECULATIVE" ; break; |
---|
195 | case morpheo::behavioural::core::multi_ooo_engine::ooo_engine::commit_unit::ROB_END_KO : return "ROB_END_KO" ; break; |
---|
196 | case morpheo::behavioural::core::multi_ooo_engine::ooo_engine::commit_unit::ROB_END_BRANCH_MISS_SPECULATIVE: return "ROB_END_BRANCH_MISS_SPECULATIVE" ; break; |
---|
197 | case morpheo::behavioural::core::multi_ooo_engine::ooo_engine::commit_unit::ROB_END_BRANCH_MISS : return "ROB_END_BRANCH_MISS" ; break; |
---|
198 | case morpheo::behavioural::core::multi_ooo_engine::ooo_engine::commit_unit::ROB_END_LOAD_MISS_SPECULATIVE : return "ROB_END_LOAD_MISS_SPECULATIVE" ; break; |
---|
199 | case morpheo::behavioural::core::multi_ooo_engine::ooo_engine::commit_unit::ROB_END_LOAD_MISS_UPDATE : return "ROB_END_LOAD_MISS_UPDATE" ; break; |
---|
200 | case morpheo::behavioural::core::multi_ooo_engine::ooo_engine::commit_unit::ROB_END_LOAD_MISS : return "ROB_END_LOAD_MISS" ; break; |
---|
201 | case morpheo::behavioural::core::multi_ooo_engine::ooo_engine::commit_unit::ROB_END_MISS : return "ROB_END_MISS" ; break; |
---|
202 | case morpheo::behavioural::core::multi_ooo_engine::ooo_engine::commit_unit::ROB_END_EXCEPTION_WAIT_HEAD : return "ROB_END_EXCEPTION_WAIT_HEAD" ; break; |
---|
203 | case morpheo::behavioural::core::multi_ooo_engine::ooo_engine::commit_unit::ROB_END_EXCEPTION_UPDATE : return "ROB_END_EXCEPTION_UPDATE" ; break; |
---|
204 | case morpheo::behavioural::core::multi_ooo_engine::ooo_engine::commit_unit::ROB_END_EXCEPTION : return "ROB_END_EXCEPTION" ; break; |
---|
205 | case morpheo::behavioural::core::multi_ooo_engine::ooo_engine::commit_unit::ROB_END : return "ROB_END" ; break; |
---|
206 | |
---|
207 | default : return "" ; break; |
---|
208 | } |
---|
209 | }; |
---|
210 | |
---|
211 | template<> inline std::string toString<morpheo::behavioural::core::multi_ooo_engine::ooo_engine::commit_unit::Tcommit_event_state_t>(const morpheo::behavioural::core::multi_ooo_engine::ooo_engine::commit_unit::Tcommit_event_state_t& x) |
---|
212 | { |
---|
213 | switch (x) |
---|
214 | { |
---|
215 | case morpheo::behavioural::core::multi_ooo_engine::ooo_engine::commit_unit::COMMIT_EVENT_STATE_NO_EVENT : return "COMMIT_EVENT_STATE_NO_EVENT" ; break; |
---|
216 | case morpheo::behavioural::core::multi_ooo_engine::ooo_engine::commit_unit::COMMIT_EVENT_STATE_NOT_YET_EVENT : return "COMMIT_EVENT_STATE_NOT_YET_EVENT"; break; |
---|
217 | case morpheo::behavioural::core::multi_ooo_engine::ooo_engine::commit_unit::COMMIT_EVENT_STATE_EVENT : return "COMMIT_EVENT_STATE_EVENT" ; break; |
---|
218 | // case morpheo::behavioural::core::multi_ooo_engine::ooo_engine::commit_unit::COMMIT_EVENT_STATE_WAIT_DECOD : return "COMMIT_EVENT_STATE_WAIT_DECOD" ; break; |
---|
219 | case morpheo::behavioural::core::multi_ooo_engine::ooo_engine::commit_unit::COMMIT_EVENT_STATE_WAIT_END : return "COMMIT_EVENT_STATE_WAIT_END" ; break; |
---|
220 | // case morpheo::behavioural::core::multi_ooo_engine::ooo_engine::commit_unit::COMMIT_EVENT_STATE_END : return "COMMIT_EVENT_STATE_END" ; break; |
---|
221 | |
---|
222 | default : return "" ; break; |
---|
223 | } |
---|
224 | }; |
---|
225 | |
---|
226 | |
---|
227 | }; // end namespace morpheo |
---|
228 | |
---|
229 | #endif |
---|