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