1 | /* |
---|
2 | * $Id: Parameters.cpp 139 2010-07-30 14:47:27Z rosiere $ |
---|
3 | * |
---|
4 | * [ Description ] |
---|
5 | * |
---|
6 | */ |
---|
7 | |
---|
8 | #include "Behavioural/Core/Multi_OOO_Engine/OOO_Engine/Rename_unit/include/Parameters.h" |
---|
9 | #include "Common/include/Max.h" |
---|
10 | |
---|
11 | namespace morpheo { |
---|
12 | namespace behavioural { |
---|
13 | namespace core { |
---|
14 | namespace multi_ooo_engine { |
---|
15 | namespace ooo_engine { |
---|
16 | namespace rename_unit { |
---|
17 | |
---|
18 | |
---|
19 | #undef FUNCTION |
---|
20 | #define FUNCTION "Rename_unit::Parameters" |
---|
21 | Parameters::Parameters (uint32_t nb_front_end , |
---|
22 | uint32_t * nb_context , |
---|
23 | uint32_t * nb_inst_decod , |
---|
24 | uint32_t nb_inst_insert , |
---|
25 | uint32_t nb_inst_retire , |
---|
26 | uint32_t nb_load_store_queue , |
---|
27 | uint32_t * size_store_queue , |
---|
28 | uint32_t * size_load_queue , |
---|
29 | uint32_t * nb_inst_memory , |
---|
30 | uint32_t ** link_load_store_unit_with_thread , |
---|
31 | Tpriority_t rename_select_priority , |
---|
32 | Tload_balancing_t rename_select_load_balancing , |
---|
33 | uint32_t rename_select_nb_front_end_select, |
---|
34 | uint32_t max_branch_speculated , |
---|
35 | uint32_t size_general_data , |
---|
36 | uint32_t nb_general_register , |
---|
37 | uint32_t nb_special_register , |
---|
38 | Trat_scheme_t rat_scheme , |
---|
39 | uint32_t nb_reg_free , |
---|
40 | uint32_t nb_bank , |
---|
41 | // uint32_t size_read_counter , |
---|
42 | uint32_t ** nb_branch_speculated ,//[nb_front_end][nb_context] |
---|
43 | bool is_toplevel) |
---|
44 | { |
---|
45 | log_begin(Rename_unit,FUNCTION); |
---|
46 | |
---|
47 | _nb_front_end = nb_front_end ; |
---|
48 | _nb_context = nb_context ; |
---|
49 | _nb_inst_decod = nb_inst_decod ; |
---|
50 | _nb_inst_insert = nb_inst_insert ; |
---|
51 | _nb_inst_retire = nb_inst_retire ; |
---|
52 | _nb_load_store_queue = nb_load_store_queue ; |
---|
53 | _size_store_queue = size_store_queue ; |
---|
54 | _size_load_queue = size_load_queue ; |
---|
55 | _nb_inst_memory = nb_inst_memory ; |
---|
56 | _link_load_store_unit_with_thread = link_load_store_unit_with_thread ; |
---|
57 | _rename_select_priority = rename_select_priority ; |
---|
58 | _rename_select_load_balancing = rename_select_load_balancing ; |
---|
59 | _rename_select_nb_front_end_select = rename_select_nb_front_end_select; |
---|
60 | _max_branch_speculated = max_branch_speculated ; |
---|
61 | _nb_general_register = nb_general_register ; |
---|
62 | _nb_special_register = nb_special_register ; |
---|
63 | _rat_scheme = rat_scheme ; |
---|
64 | _nb_reg_free = nb_reg_free ; |
---|
65 | _nb_bank = nb_bank ; |
---|
66 | // _size_read_counter = size_read_counter ; |
---|
67 | _nb_branch_speculated = nb_branch_speculated ; |
---|
68 | |
---|
69 | uint32_t size_special_register = log2(_nb_special_register); |
---|
70 | |
---|
71 | test(); |
---|
72 | |
---|
73 | log_printf(TRACE,Rename_unit,FUNCTION,_("Creation : _param_rename_select.")); |
---|
74 | _param_rename_select = new morpheo::behavioural::core::multi_ooo_engine::ooo_engine::rename_unit::rename_select::Parameters |
---|
75 | ( |
---|
76 | _nb_front_end , |
---|
77 | _nb_context , |
---|
78 | _max_branch_speculated, |
---|
79 | _size_general_data , |
---|
80 | _nb_inst_insert , |
---|
81 | _nb_inst_decod , |
---|
82 | _rename_select_nb_front_end_select , |
---|
83 | _rename_select_priority , |
---|
84 | _rename_select_load_balancing |
---|
85 | ); |
---|
86 | |
---|
87 | log_printf(TRACE,Rename_unit,FUNCTION,_("Creation : _param_register_translation_unit.")); |
---|
88 | _param_register_translation_unit = new morpheo::behavioural::core::multi_ooo_engine::ooo_engine::rename_unit::register_translation_unit::Parameters |
---|
89 | ( |
---|
90 | _nb_front_end , |
---|
91 | _nb_context , |
---|
92 | _nb_general_register , |
---|
93 | _nb_special_register , |
---|
94 | _rat_scheme , |
---|
95 | _nb_inst_insert , |
---|
96 | _nb_inst_retire , |
---|
97 | _nb_reg_free , |
---|
98 | _nb_bank , |
---|
99 | // _size_read_counter , |
---|
100 | _nb_branch_speculated |
---|
101 | ); |
---|
102 | |
---|
103 | log_printf(TRACE,Rename_unit,FUNCTION,_("Creation : _param_load_store_pointer_unit.")); |
---|
104 | _param_load_store_pointer_unit = new morpheo::behavioural::core::multi_ooo_engine::ooo_engine::rename_unit::load_store_pointer_unit::Parameters |
---|
105 | ( |
---|
106 | _nb_front_end , |
---|
107 | _nb_context , |
---|
108 | _nb_load_store_queue , |
---|
109 | _size_store_queue , |
---|
110 | _size_load_queue , |
---|
111 | _nb_inst_memory , |
---|
112 | _link_load_store_unit_with_thread, |
---|
113 | _nb_inst_insert , |
---|
114 | _nb_inst_retire |
---|
115 | ); |
---|
116 | |
---|
117 | log_printf(TRACE,Rename_unit,FUNCTION,_("Creation : _param_glue.")); |
---|
118 | _param_glue = new morpheo::behavioural::core::multi_ooo_engine::ooo_engine::rename_unit::rename_unit_glue::Parameters |
---|
119 | ( |
---|
120 | _nb_front_end , |
---|
121 | _nb_context , |
---|
122 | _nb_inst_insert , |
---|
123 | _nb_inst_retire , |
---|
124 | _size_general_data , |
---|
125 | _size_special_register, |
---|
126 | _rat_scheme |
---|
127 | ); |
---|
128 | |
---|
129 | if (is_toplevel) |
---|
130 | { |
---|
131 | _size_instruction_address = size_general_data-2; |
---|
132 | _size_front_end_id = log2(_nb_front_end); |
---|
133 | _size_context_id = log2(max<uint32_t>(_nb_context,_nb_front_end)); |
---|
134 | _size_store_queue_ptr = log2(max<uint32_t>(_size_store_queue,nb_load_store_queue)); |
---|
135 | _size_load_queue_ptr = log2(max<uint32_t>(_size_load_queue ,nb_load_store_queue)); |
---|
136 | _size_general_register = log2(_nb_general_register); |
---|
137 | _size_special_register = size_special_register; |
---|
138 | _size_depth = log2(_max_branch_speculated); |
---|
139 | _size_general_data = size_general_data ; |
---|
140 | |
---|
141 | _have_port_front_end_id = _size_front_end_id > 0; |
---|
142 | _have_port_context_id = _size_context_id > 0; |
---|
143 | _have_port_load_queue_ptr = _size_load_queue_ptr > 0; |
---|
144 | _have_port_depth = _size_depth > 0; |
---|
145 | |
---|
146 | copy(); |
---|
147 | } |
---|
148 | |
---|
149 | log_end(Rename_unit,FUNCTION); |
---|
150 | }; |
---|
151 | |
---|
152 | // #undef FUNCTION |
---|
153 | // #define FUNCTION "Rename_unit::Parameters (copy)" |
---|
154 | // Parameters::Parameters (Parameters & param) |
---|
155 | // { |
---|
156 | // log_begin(Rename_unit,FUNCTION); |
---|
157 | // test(); |
---|
158 | // log_end(Rename_unit,FUNCTION); |
---|
159 | // }; |
---|
160 | |
---|
161 | #undef FUNCTION |
---|
162 | #define FUNCTION "Rename_unit::~Parameters" |
---|
163 | Parameters::~Parameters (void) |
---|
164 | { |
---|
165 | log_begin(Rename_unit,FUNCTION); |
---|
166 | |
---|
167 | delete _param_rename_select ; |
---|
168 | delete _param_register_translation_unit; |
---|
169 | delete _param_load_store_pointer_unit ; |
---|
170 | delete _param_glue ; |
---|
171 | |
---|
172 | log_end(Rename_unit,FUNCTION); |
---|
173 | }; |
---|
174 | |
---|
175 | #undef FUNCTION |
---|
176 | #define FUNCTION "Rename_unit::copy" |
---|
177 | void Parameters::copy (void) |
---|
178 | { |
---|
179 | log_begin(Rename_unit,FUNCTION); |
---|
180 | |
---|
181 | COPY(_param_rename_select ); |
---|
182 | COPY(_param_register_translation_unit); |
---|
183 | COPY(_param_load_store_pointer_unit ); |
---|
184 | COPY(_param_glue ); |
---|
185 | |
---|
186 | log_end(Rename_unit,FUNCTION); |
---|
187 | }; |
---|
188 | |
---|
189 | }; // end namespace rename_unit |
---|
190 | }; // end namespace ooo_engine |
---|
191 | }; // end namespace multi_ooo_engine |
---|
192 | }; // end namespace core |
---|
193 | |
---|
194 | }; // end namespace behavioural |
---|
195 | }; // end namespace morpheo |
---|