1 | /* |
---|
2 | * $Id$ |
---|
3 | * |
---|
4 | * [ Description ] |
---|
5 | * |
---|
6 | */ |
---|
7 | |
---|
8 | #include "Behavioural/Core/Multi_OOO_Engine/OOO_Engine/Rename_unit/Register_translation_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 | namespace register_translation_unit { |
---|
18 | |
---|
19 | |
---|
20 | #undef FUNCTION |
---|
21 | #define FUNCTION "Register_translation_unit::Parameters" |
---|
22 | Parameters::Parameters (uint32_t nb_front_end , |
---|
23 | uint32_t * nb_context , |
---|
24 | uint32_t nb_general_register , |
---|
25 | uint32_t nb_special_register , |
---|
26 | uint32_t nb_inst_insert , |
---|
27 | uint32_t nb_inst_retire , |
---|
28 | uint32_t nb_reg_free , |
---|
29 | uint32_t nb_bank , |
---|
30 | uint32_t size_read_counter ) |
---|
31 | { |
---|
32 | log_printf(FUNC,Register_translation_unit,FUNCTION,"Begin"); |
---|
33 | |
---|
34 | _nb_front_end = nb_front_end ; |
---|
35 | _nb_context = nb_context ; |
---|
36 | _nb_general_register = nb_general_register; |
---|
37 | _nb_special_register = nb_special_register; |
---|
38 | _nb_inst_insert = nb_inst_insert ; |
---|
39 | _nb_inst_retire = nb_inst_retire ; |
---|
40 | _nb_reg_free = nb_reg_free ; |
---|
41 | _nb_bank = nb_bank ; |
---|
42 | _size_read_counter = size_read_counter ; |
---|
43 | |
---|
44 | uint32_t max_nb_context = max<uint32_t>(nb_context, nb_front_end); |
---|
45 | |
---|
46 | _size_front_end_id = log2(nb_front_end ); |
---|
47 | _size_context_id = log2(max_nb_context ); |
---|
48 | _size_general_register = log2(nb_general_register); |
---|
49 | _size_special_register = log2(nb_special_register); |
---|
50 | |
---|
51 | _have_port_front_end_id = _size_front_end_id>0; |
---|
52 | _have_port_context_id = _size_context_id >0; |
---|
53 | |
---|
54 | |
---|
55 | uint32_t nb_thread = 0; |
---|
56 | for (uint32_t i=0; i<nb_front_end; i++) |
---|
57 | nb_thread += nb_context[i]; |
---|
58 | |
---|
59 | _param_dependency_checking_unit = new morpheo::behavioural::core::multi_ooo_engine::ooo_engine::rename_unit::register_translation_unit::dependency_checking_unit::Parameters |
---|
60 | (_nb_front_end , |
---|
61 | max_nb_context , |
---|
62 | _nb_general_register, |
---|
63 | _nb_special_register, |
---|
64 | _nb_inst_insert ); |
---|
65 | |
---|
66 | _param_free_list_unit = new morpheo::behavioural::core::multi_ooo_engine::ooo_engine::rename_unit::register_translation_unit::free_list_unit::Parameters |
---|
67 | (nb_thread , |
---|
68 | _nb_general_register, |
---|
69 | _nb_special_register, |
---|
70 | _nb_bank , |
---|
71 | _nb_inst_insert , |
---|
72 | _nb_reg_free , |
---|
73 | PRIORITY_ROUND_ROBIN); |
---|
74 | |
---|
75 | _param_register_address_translation_unit = new morpheo::behavioural::core::multi_ooo_engine::ooo_engine::rename_unit::register_translation_unit::register_address_translation_unit::Parameters |
---|
76 | (_nb_front_end , |
---|
77 | _nb_context , |
---|
78 | _nb_general_register, |
---|
79 | _nb_special_register, |
---|
80 | _nb_inst_insert , |
---|
81 | _nb_inst_retire ); |
---|
82 | |
---|
83 | _param_stat_list_unit = new morpheo::behavioural::core::multi_ooo_engine::ooo_engine::rename_unit::register_translation_unit::stat_list_unit::Parameters |
---|
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 | _param_register_translation_unit_glue = new morpheo::behavioural::core::multi_ooo_engine::ooo_engine::rename_unit::register_translation_unit::register_translation_unit_glue::Parameters |
---|
95 | (_nb_inst_insert, |
---|
96 | _nb_inst_retire); |
---|
97 | |
---|
98 | test(); |
---|
99 | log_printf(FUNC,Register_translation_unit,FUNCTION,"End"); |
---|
100 | }; |
---|
101 | |
---|
102 | // #undef FUNCTION |
---|
103 | // #define FUNCTION "Register_translation_unit::Parameters (copy)" |
---|
104 | // Parameters::Parameters (Parameters & param) |
---|
105 | // { |
---|
106 | // log_printf(FUNC,Register_translation_unit,FUNCTION,"Begin"); |
---|
107 | // test(); |
---|
108 | // log_printf(FUNC,Register_translation_unit,FUNCTION,"End"); |
---|
109 | // }; |
---|
110 | |
---|
111 | #undef FUNCTION |
---|
112 | #define FUNCTION "Register_translation_unit::~Parameters" |
---|
113 | Parameters::~Parameters () |
---|
114 | { |
---|
115 | log_printf(FUNC,Register_translation_unit,FUNCTION,"Begin"); |
---|
116 | |
---|
117 | delete [] _param_dependency_checking_unit; |
---|
118 | delete [] _param_free_list_unit; |
---|
119 | delete [] _param_register_address_translation_unit; |
---|
120 | delete [] _param_stat_list_unit; |
---|
121 | delete [] _param_register_translation_unit_glue; |
---|
122 | |
---|
123 | log_printf(FUNC,Register_translation_unit,FUNCTION,"End"); |
---|
124 | }; |
---|
125 | |
---|
126 | }; // end namespace register_translation_unit |
---|
127 | }; // end namespace rename_unit |
---|
128 | }; // end namespace ooo_engine |
---|
129 | }; // end namespace multi_ooo_engine |
---|
130 | }; // end namespace core |
---|
131 | |
---|
132 | }; // end namespace behavioural |
---|
133 | }; // end namespace morpheo |
---|