1 | /* |
---|
2 | * $Id$ |
---|
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 , |
---|
31 | uint32_t size_counter ) |
---|
32 | { |
---|
33 | log_printf(FUNC,Stat_List_unit,FUNCTION,"Begin"); |
---|
34 | |
---|
35 | _nb_front_end = nb_front_end ; |
---|
36 | _nb_context = nb_context ; |
---|
37 | _nb_general_register = nb_general_register; |
---|
38 | _nb_special_register = nb_special_register; |
---|
39 | _nb_inst_insert = nb_inst_insert ; |
---|
40 | _nb_inst_retire = nb_inst_retire ; |
---|
41 | _nb_reg_free = nb_reg_free ; |
---|
42 | _nb_bank = nb_bank ; |
---|
43 | _size_counter = size_counter ; |
---|
44 | |
---|
45 | _size_general_register = log2(nb_general_register); |
---|
46 | _size_special_register = log2(nb_special_register); |
---|
47 | |
---|
48 | _max_reader = 1<<size_counter; |
---|
49 | |
---|
50 | uint32_t nb_thread = 0; |
---|
51 | |
---|
52 | for (uint32_t i=0; i<nb_front_end; i++) |
---|
53 | nb_thread += nb_context [i]; |
---|
54 | |
---|
55 | _nb_gpr_use_init = (nb_thread*(_nb_general_register_logic-1))+1; // R0 is allocated once time |
---|
56 | _nb_spr_use_init = nb_thread* _nb_special_register_logic; |
---|
57 | |
---|
58 | _nb_general_register_by_bank = nb_general_register / nb_bank; |
---|
59 | _nb_special_register_by_bank = nb_special_register / nb_bank; |
---|
60 | |
---|
61 | _nb_bank_by_port_free = _nb_bank / _nb_reg_free; |
---|
62 | |
---|
63 | _shift_gpr = log2(_nb_general_register_by_bank); |
---|
64 | _shift_spr = log2(_nb_special_register_by_bank); |
---|
65 | |
---|
66 | _mask_gpr = gen_mask<Tgeneral_address_t>(log2(_nb_general_register_by_bank)); |
---|
67 | _mask_spr = gen_mask<Tspecial_address_t>(log2(_nb_special_register_by_bank)); |
---|
68 | |
---|
69 | test(); |
---|
70 | log_printf(FUNC,Stat_List_unit,FUNCTION,"End"); |
---|
71 | }; |
---|
72 | |
---|
73 | // #undef FUNCTION |
---|
74 | // #define FUNCTION "Stat_List_unit::Parameters (copy)" |
---|
75 | // Parameters::Parameters (Parameters & param) |
---|
76 | // { |
---|
77 | // log_printf(FUNC,Stat_List_unit,FUNCTION,"Begin"); |
---|
78 | // test(); |
---|
79 | // log_printf(FUNC,Stat_List_unit,FUNCTION,"End"); |
---|
80 | // }; |
---|
81 | |
---|
82 | #undef FUNCTION |
---|
83 | #define FUNCTION "Stat_List_unit::~Parameters" |
---|
84 | Parameters::~Parameters () |
---|
85 | { |
---|
86 | log_printf(FUNC,Stat_List_unit,FUNCTION,"Begin"); |
---|
87 | log_printf(FUNC,Stat_List_unit,FUNCTION,"End"); |
---|
88 | }; |
---|
89 | |
---|
90 | }; // end namespace stat_list_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 |
---|