1 | /* |
---|
2 | * $Id: Parameters.cpp 145 2010-10-13 18:15:51Z rosiere $ |
---|
3 | * |
---|
4 | * [ Description ] |
---|
5 | * |
---|
6 | */ |
---|
7 | |
---|
8 | #include "Behavioural/Core/Multi_OOO_Engine/OOO_Engine/Rename_unit/Register_translation_unit/Register_Address_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 | namespace register_address_translation_unit { |
---|
19 | |
---|
20 | #undef FUNCTION |
---|
21 | #define FUNCTION "Register_Address_Translation_unit::Parameters" |
---|
22 | Parameters::Parameters (uint32_t nb_front_end , |
---|
23 | uint32_t * nb_context ,//[nb_front_end] |
---|
24 | uint32_t nb_general_register , |
---|
25 | uint32_t nb_special_register , |
---|
26 | Trat_scheme_t rat_scheme , |
---|
27 | uint32_t nb_inst_insert , |
---|
28 | uint32_t nb_inst_retire , |
---|
29 | uint32_t ** nb_branch_speculated,//[nb_front_end][nb_context] |
---|
30 | bool is_toplevel) |
---|
31 | { |
---|
32 | log_printf(FUNC,Register_Address_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 | _rat_scheme = rat_scheme ; |
---|
39 | _nb_inst_insert = nb_inst_insert ; |
---|
40 | _nb_inst_retire = nb_inst_retire ; |
---|
41 | _nb_branch_speculated = nb_branch_speculated; |
---|
42 | |
---|
43 | _max_nb_context = max<uint32_t>(_nb_context, _nb_front_end); |
---|
44 | _max_nb_branch_speculated= max<uint32_t>(_nb_branch_speculated, _nb_front_end, _nb_context); |
---|
45 | |
---|
46 | test(); |
---|
47 | |
---|
48 | if (is_toplevel) |
---|
49 | { |
---|
50 | _size_front_end_id = log2(_nb_front_end ); |
---|
51 | _size_context_id = log2(_max_nb_context ); |
---|
52 | _size_general_register = log2(_nb_general_register); |
---|
53 | _size_special_register = log2(_nb_special_register); |
---|
54 | _size_depth = log2(max<uint32_t>(_nb_branch_speculated,_nb_front_end,_nb_context)); |
---|
55 | |
---|
56 | _have_port_front_end_id = _size_front_end_id>0; |
---|
57 | _have_port_context_id = _size_context_id >0; |
---|
58 | _have_port_depth = _size_depth >0; |
---|
59 | |
---|
60 | copy(); |
---|
61 | } |
---|
62 | |
---|
63 | log_printf(FUNC,Register_Address_Translation_unit,FUNCTION,"End"); |
---|
64 | }; |
---|
65 | |
---|
66 | // #undef FUNCTION |
---|
67 | // #define FUNCTION "Register_Address_Translation_unit::Parameters (copy)" |
---|
68 | // Parameters::Parameters (Parameters & param) |
---|
69 | // { |
---|
70 | // log_printf(FUNC,Register_Address_Translation_unit,FUNCTION,"Begin"); |
---|
71 | // test(); |
---|
72 | // log_printf(FUNC,Register_Address_Translation_unit,FUNCTION,"End"); |
---|
73 | // }; |
---|
74 | |
---|
75 | #undef FUNCTION |
---|
76 | #define FUNCTION "Register_Address_Translation_unit::~Parameters" |
---|
77 | Parameters::~Parameters (void) |
---|
78 | { |
---|
79 | log_printf(FUNC,Register_Address_Translation_unit,FUNCTION,"Begin"); |
---|
80 | log_printf(FUNC,Register_Address_Translation_unit,FUNCTION,"End"); |
---|
81 | }; |
---|
82 | |
---|
83 | #undef FUNCTION |
---|
84 | #define FUNCTION "Register_Address_Translation_unit::copy" |
---|
85 | void Parameters::copy (void) |
---|
86 | { |
---|
87 | log_printf(FUNC,Register_Address_Translation_unit,FUNCTION,"Begin"); |
---|
88 | log_printf(FUNC,Register_Address_Translation_unit,FUNCTION,"End"); |
---|
89 | }; |
---|
90 | |
---|
91 | }; // end namespace register_address_translation_unit |
---|
92 | }; // end namespace register_translation_unit |
---|
93 | }; // end namespace rename_unit |
---|
94 | }; // end namespace ooo_engine |
---|
95 | }; // end namespace multi_ooo_engine |
---|
96 | }; // end namespace core |
---|
97 | |
---|
98 | }; // end namespace behavioural |
---|
99 | }; // end namespace morpheo |
---|