[78] | 1 | /* |
---|
| 2 | * $Id: Parameters.cpp 144 2010-09-28 11:19:10Z 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" |
---|
[144] | 10 | |
---|
[78] | 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" |
---|
[139] | 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) |
---|
[78] | 31 | { |
---|
| 32 | log_printf(FUNC,Register_Address_Translation_unit,FUNCTION,"Begin"); |
---|
| 33 | |
---|
[139] | 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; |
---|
[78] | 42 | |
---|
[139] | 43 | _max_nb_context = max<uint32_t>(_nb_context, _nb_front_end); |
---|
| 44 | |
---|
[88] | 45 | test(); |
---|
| 46 | |
---|
| 47 | if (is_toplevel) |
---|
| 48 | { |
---|
[139] | 49 | _size_front_end_id = log2(_nb_front_end ); |
---|
| 50 | _size_context_id = log2(_max_nb_context ); |
---|
| 51 | _size_general_register = log2(_nb_general_register); |
---|
| 52 | _size_special_register = log2(_nb_special_register); |
---|
| 53 | _size_depth = log2(max<uint32_t>(_nb_branch_speculated,_nb_front_end,_nb_context)); |
---|
[78] | 54 | |
---|
[88] | 55 | _have_port_front_end_id = _size_front_end_id>0; |
---|
| 56 | _have_port_context_id = _size_context_id >0; |
---|
[139] | 57 | _have_port_depth = _size_depth >0; |
---|
| 58 | |
---|
[88] | 59 | copy(); |
---|
| 60 | } |
---|
[78] | 61 | |
---|
| 62 | log_printf(FUNC,Register_Address_Translation_unit,FUNCTION,"End"); |
---|
| 63 | }; |
---|
| 64 | |
---|
| 65 | // #undef FUNCTION |
---|
| 66 | // #define FUNCTION "Register_Address_Translation_unit::Parameters (copy)" |
---|
| 67 | // Parameters::Parameters (Parameters & param) |
---|
| 68 | // { |
---|
| 69 | // log_printf(FUNC,Register_Address_Translation_unit,FUNCTION,"Begin"); |
---|
| 70 | // test(); |
---|
| 71 | // log_printf(FUNC,Register_Address_Translation_unit,FUNCTION,"End"); |
---|
| 72 | // }; |
---|
| 73 | |
---|
| 74 | #undef FUNCTION |
---|
| 75 | #define FUNCTION "Register_Address_Translation_unit::~Parameters" |
---|
[88] | 76 | Parameters::~Parameters (void) |
---|
[78] | 77 | { |
---|
| 78 | log_printf(FUNC,Register_Address_Translation_unit,FUNCTION,"Begin"); |
---|
| 79 | log_printf(FUNC,Register_Address_Translation_unit,FUNCTION,"End"); |
---|
| 80 | }; |
---|
| 81 | |
---|
[88] | 82 | #undef FUNCTION |
---|
| 83 | #define FUNCTION "Register_Address_Translation_unit::copy" |
---|
| 84 | void Parameters::copy (void) |
---|
| 85 | { |
---|
| 86 | log_printf(FUNC,Register_Address_Translation_unit,FUNCTION,"Begin"); |
---|
| 87 | log_printf(FUNC,Register_Address_Translation_unit,FUNCTION,"End"); |
---|
| 88 | }; |
---|
| 89 | |
---|
[78] | 90 | }; // end namespace register_address_translation_unit |
---|
| 91 | }; // end namespace register_translation_unit |
---|
| 92 | }; // end namespace rename_unit |
---|
| 93 | }; // end namespace ooo_engine |
---|
| 94 | }; // end namespace multi_ooo_engine |
---|
| 95 | }; // end namespace core |
---|
| 96 | |
---|
| 97 | }; // end namespace behavioural |
---|
| 98 | }; // end namespace morpheo |
---|