1 | /* |
---|
2 | * $Id: Parameters.cpp 88 2008-12-10 18:31:39Z rosiere $ |
---|
3 | * |
---|
4 | * [ Description ] |
---|
5 | * |
---|
6 | */ |
---|
7 | |
---|
8 | #include "Behavioural/Core/Multi_Front_end/Front_end/Decod_unit/include/Parameters.h" |
---|
9 | #include "Common/include/Max.h" |
---|
10 | |
---|
11 | namespace morpheo { |
---|
12 | namespace behavioural { |
---|
13 | namespace core { |
---|
14 | namespace multi_front_end { |
---|
15 | namespace front_end { |
---|
16 | namespace decod_unit { |
---|
17 | |
---|
18 | |
---|
19 | #undef FUNCTION |
---|
20 | #define FUNCTION "Decod_unit::Parameters" |
---|
21 | Parameters::Parameters (uint32_t nb_context , |
---|
22 | uint32_t * nb_inst_fetch , |
---|
23 | uint32_t nb_inst_decod , |
---|
24 | uint32_t size_queue , |
---|
25 | uint32_t size_general_data , |
---|
26 | uint32_t * nb_branch_speculated , |
---|
27 | // uint32_t * size_branch_update_prediction, |
---|
28 | uint32_t nb_context_select , |
---|
29 | Tpriority_t select_priority , |
---|
30 | Tload_balancing_t select_load_balancing , |
---|
31 | bool ** instruction_implemeted , |
---|
32 | morpheo::behavioural::custom::custom_information_t (*get_custom_information) (void), |
---|
33 | bool is_toplevel |
---|
34 | ) |
---|
35 | { |
---|
36 | log_begin(Decod_unit,FUNCTION); |
---|
37 | |
---|
38 | _nb_context = nb_context ; |
---|
39 | _nb_inst_fetch = nb_inst_fetch ; |
---|
40 | _nb_inst_decod = nb_inst_decod ; |
---|
41 | _size_queue = size_queue ; |
---|
42 | // _size_general_data = size_general_data ; |
---|
43 | _nb_branch_speculated = nb_branch_speculated ; |
---|
44 | // _size_branch_update_prediction = size_branch_update_prediction; |
---|
45 | _nb_context_select = nb_context_select ; |
---|
46 | _select_priority = select_priority ; |
---|
47 | _select_load_balancing = select_load_balancing ; |
---|
48 | _instruction_implemeted = instruction_implemeted ; |
---|
49 | _get_custom_information = get_custom_information ; |
---|
50 | |
---|
51 | _max_nb_inst_fetch = max<uint32_t>(_nb_inst_fetch,_nb_context); |
---|
52 | // _size_address_inst = size_general_data-2; |
---|
53 | |
---|
54 | test(); |
---|
55 | |
---|
56 | _param_decod = new morpheo::behavioural::core::multi_front_end::front_end::decod_unit::decod::Parameters |
---|
57 | (_nb_context , |
---|
58 | _nb_inst_fetch , |
---|
59 | _nb_inst_decod , |
---|
60 | _nb_branch_speculated, |
---|
61 | // _size_branch_update_prediction, |
---|
62 | _nb_context_select , |
---|
63 | size_general_data , |
---|
64 | _select_priority , |
---|
65 | _select_load_balancing , |
---|
66 | _instruction_implemeted , |
---|
67 | _get_custom_information); |
---|
68 | |
---|
69 | _param_decod_queue = new morpheo::behavioural::core::multi_front_end::front_end::decod_unit::decod_queue::Parameters |
---|
70 | (_nb_context , |
---|
71 | _nb_inst_decod , |
---|
72 | _size_queue , |
---|
73 | size_general_data , |
---|
74 | _nb_branch_speculated); |
---|
75 | |
---|
76 | if (is_toplevel) |
---|
77 | { |
---|
78 | _size_context_id = log2(_nb_context); |
---|
79 | _size_depth = max<uint32_t>(_nb_branch_speculated,_nb_context); |
---|
80 | // _size_branch_update_prediction_id = max<uint32_t>(_size_branch_update_prediction,_nb_context); |
---|
81 | _size_inst_ifetch_ptr = log2(max<uint32_t>(_nb_inst_fetch,_nb_context)); |
---|
82 | _size_nb_inst_decod = log2(_size_queue)+1; |
---|
83 | |
---|
84 | _size_instruction_address = size_general_data-2; |
---|
85 | _size_general_data = size_general_data; |
---|
86 | |
---|
87 | _have_port_context_id = _size_context_id > 0; |
---|
88 | _have_port_depth = (_size_depth > 0); |
---|
89 | // _have_port_branch_update_prediction_id = (_size_branch_update_prediction_id > 0); |
---|
90 | _have_port_inst_ifetch_ptr = (_size_inst_ifetch_ptr > 0); |
---|
91 | |
---|
92 | copy (); |
---|
93 | } |
---|
94 | |
---|
95 | log_end(Decod_unit,FUNCTION); |
---|
96 | }; |
---|
97 | |
---|
98 | // #undef FUNCTION |
---|
99 | // #define FUNCTION "Decod_unit::Parameters (copy)" |
---|
100 | // Parameters::Parameters (Parameters & param) |
---|
101 | // { |
---|
102 | // log_begin(Decod_unit,FUNCTION); |
---|
103 | // test(); |
---|
104 | // log_end(Decod_unit,FUNCTION); |
---|
105 | // }; |
---|
106 | |
---|
107 | #undef FUNCTION |
---|
108 | #define FUNCTION "Decod_unit::~Parameters" |
---|
109 | Parameters::~Parameters () |
---|
110 | { |
---|
111 | log_begin(Decod_unit,FUNCTION); |
---|
112 | |
---|
113 | delete _param_decod; |
---|
114 | delete _param_decod_queue; |
---|
115 | |
---|
116 | log_end(Decod_unit,FUNCTION); |
---|
117 | }; |
---|
118 | |
---|
119 | |
---|
120 | #undef FUNCTION |
---|
121 | #define FUNCTION "Decod_unit::copy" |
---|
122 | void Parameters::copy (void) |
---|
123 | { |
---|
124 | log_begin(Decod_unit,FUNCTION); |
---|
125 | |
---|
126 | COPY(_param_decod ); |
---|
127 | COPY(_param_decod_queue); |
---|
128 | |
---|
129 | log_end(Decod_unit,FUNCTION); |
---|
130 | }; |
---|
131 | |
---|
132 | }; // end namespace decod_unit |
---|
133 | }; // end namespace front_end |
---|
134 | }; // end namespace multi_front_end |
---|
135 | }; // end namespace core |
---|
136 | |
---|
137 | }; // end namespace behavioural |
---|
138 | }; // end namespace morpheo |
---|