[78] | 1 | /* |
---|
| 2 | * $Id: Parameters.cpp 112 2009-03-18 22:36:26Z rosiere $ |
---|
| 3 | * |
---|
| 4 | * [ Description ] |
---|
| 5 | * |
---|
| 6 | */ |
---|
| 7 | |
---|
| 8 | #include "Behavioural/Core/Multi_OOO_Engine/OOO_Engine/Rename_unit/Register_translation_unit/Stat_List_unit/include/Parameters.h" |
---|
| 9 | #include "Common/include/Max.h" |
---|
| 10 | #include "Common/include/BitManipulation.h" |
---|
| 11 | |
---|
| 12 | namespace morpheo { |
---|
| 13 | namespace behavioural { |
---|
| 14 | namespace core { |
---|
| 15 | namespace multi_ooo_engine { |
---|
| 16 | namespace ooo_engine { |
---|
| 17 | namespace rename_unit { |
---|
| 18 | namespace register_translation_unit { |
---|
| 19 | namespace stat_list_unit { |
---|
| 20 | |
---|
| 21 | #undef FUNCTION |
---|
| 22 | #define FUNCTION "Stat_List_unit::Parameters" |
---|
| 23 | Parameters::Parameters (uint32_t nb_front_end , |
---|
| 24 | uint32_t * nb_context , |
---|
| 25 | uint32_t nb_general_register , |
---|
| 26 | uint32_t nb_special_register , |
---|
| 27 | uint32_t nb_inst_insert , |
---|
| 28 | uint32_t nb_inst_retire , |
---|
| 29 | uint32_t nb_reg_free , |
---|
| 30 | uint32_t nb_bank , |
---|
[112] | 31 | // uint32_t size_counter , |
---|
[88] | 32 | bool is_toplevel) |
---|
[78] | 33 | { |
---|
| 34 | log_printf(FUNC,Stat_List_unit,FUNCTION,"Begin"); |
---|
| 35 | |
---|
| 36 | _nb_front_end = nb_front_end ; |
---|
| 37 | _nb_context = nb_context ; |
---|
| 38 | _nb_general_register = nb_general_register; |
---|
| 39 | _nb_special_register = nb_special_register; |
---|
| 40 | _nb_inst_insert = nb_inst_insert ; |
---|
| 41 | _nb_inst_retire = nb_inst_retire ; |
---|
| 42 | _nb_reg_free = nb_reg_free ; |
---|
| 43 | _nb_bank = nb_bank ; |
---|
[112] | 44 | // _size_counter = size_counter ; |
---|
[78] | 45 | |
---|
[112] | 46 | // _max_reader = 1<<size_counter; |
---|
[78] | 47 | |
---|
| 48 | uint32_t nb_thread = 0; |
---|
| 49 | |
---|
| 50 | for (uint32_t i=0; i<nb_front_end; i++) |
---|
| 51 | nb_thread += nb_context [i]; |
---|
| 52 | |
---|
| 53 | _nb_gpr_use_init = (nb_thread*(_nb_general_register_logic-1))+1; // R0 is allocated once time |
---|
| 54 | _nb_spr_use_init = nb_thread* _nb_special_register_logic; |
---|
| 55 | |
---|
| 56 | _nb_general_register_by_bank = nb_general_register / nb_bank; |
---|
| 57 | _nb_special_register_by_bank = nb_special_register / nb_bank; |
---|
| 58 | |
---|
| 59 | _nb_bank_by_port_free = _nb_bank / _nb_reg_free; |
---|
| 60 | |
---|
| 61 | _shift_gpr = log2(_nb_general_register_by_bank); |
---|
| 62 | _shift_spr = log2(_nb_special_register_by_bank); |
---|
| 63 | |
---|
| 64 | _mask_gpr = gen_mask<Tgeneral_address_t>(log2(_nb_general_register_by_bank)); |
---|
| 65 | _mask_spr = gen_mask<Tspecial_address_t>(log2(_nb_special_register_by_bank)); |
---|
| 66 | |
---|
| 67 | test(); |
---|
[88] | 68 | |
---|
| 69 | if (is_toplevel) |
---|
| 70 | { |
---|
| 71 | _size_general_register = log2(nb_general_register); |
---|
| 72 | _size_special_register = log2(nb_special_register); |
---|
| 73 | |
---|
| 74 | copy (); |
---|
| 75 | } |
---|
| 76 | |
---|
[78] | 77 | log_printf(FUNC,Stat_List_unit,FUNCTION,"End"); |
---|
| 78 | }; |
---|
| 79 | |
---|
| 80 | // #undef FUNCTION |
---|
| 81 | // #define FUNCTION "Stat_List_unit::Parameters (copy)" |
---|
| 82 | // Parameters::Parameters (Parameters & param) |
---|
| 83 | // { |
---|
| 84 | // log_printf(FUNC,Stat_List_unit,FUNCTION,"Begin"); |
---|
| 85 | // test(); |
---|
| 86 | // log_printf(FUNC,Stat_List_unit,FUNCTION,"End"); |
---|
| 87 | // }; |
---|
| 88 | |
---|
| 89 | #undef FUNCTION |
---|
| 90 | #define FUNCTION "Stat_List_unit::~Parameters" |
---|
[88] | 91 | Parameters::~Parameters (void) |
---|
[78] | 92 | { |
---|
| 93 | log_printf(FUNC,Stat_List_unit,FUNCTION,"Begin"); |
---|
| 94 | log_printf(FUNC,Stat_List_unit,FUNCTION,"End"); |
---|
| 95 | }; |
---|
| 96 | |
---|
[88] | 97 | #undef FUNCTION |
---|
| 98 | #define FUNCTION "Stat_List_unit::copy" |
---|
| 99 | void Parameters::copy (void) |
---|
| 100 | { |
---|
| 101 | log_printf(FUNC,Stat_List_unit,FUNCTION,"Begin"); |
---|
| 102 | log_printf(FUNC,Stat_List_unit,FUNCTION,"End"); |
---|
| 103 | }; |
---|
| 104 | |
---|
| 105 | |
---|
[78] | 106 | }; // end namespace stat_list_unit |
---|
| 107 | }; // end namespace register_translation_unit |
---|
| 108 | }; // end namespace rename_unit |
---|
| 109 | }; // end namespace ooo_engine |
---|
| 110 | }; // end namespace multi_ooo_engine |
---|
| 111 | }; // end namespace core |
---|
| 112 | |
---|
| 113 | }; // end namespace behavioural |
---|
| 114 | }; // end namespace morpheo |
---|