1 | /* |
---|
2 | * $Id: Parameters.cpp 83 2008-05-09 18:00:21Z 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) (uint32_t)) |
---|
33 | { |
---|
34 | log_begin(Decod_unit,FUNCTION); |
---|
35 | |
---|
36 | _nb_context = nb_context ; |
---|
37 | _nb_inst_fetch = nb_inst_fetch ; |
---|
38 | _nb_inst_decod = nb_inst_decod ; |
---|
39 | _size_queue = size_queue ; |
---|
40 | _size_general_data = size_general_data ; |
---|
41 | _nb_branch_speculated = nb_branch_speculated ; |
---|
42 | _size_branch_update_prediction = size_branch_update_prediction; |
---|
43 | _nb_context_select = nb_context_select ; |
---|
44 | _select_priority = select_priority ; |
---|
45 | _select_load_balancing = select_load_balancing ; |
---|
46 | _instruction_implemeted = instruction_implemeted ; |
---|
47 | _get_custom_information = get_custom_information ; |
---|
48 | |
---|
49 | _max_nb_inst_fetch = max<uint32_t>(_nb_inst_fetch,_nb_context); |
---|
50 | |
---|
51 | _size_context_id = log2(nb_context ); |
---|
52 | _size_depth = log2(max<uint32_t>(_nb_branch_speculated,_nb_context)); |
---|
53 | _size_inst_ifetch_ptr = log2(_max_nb_inst_fetch ); |
---|
54 | |
---|
55 | _have_port_context_id = (_size_context_id > 0); |
---|
56 | _have_port_depth = (_size_depth > 0); |
---|
57 | _have_port_branch_update_prediction_id = (_size_branch_update_prediction > 0); |
---|
58 | _have_port_inst_ifetch_ptr = (_size_inst_ifetch_ptr > 0); |
---|
59 | |
---|
60 | test(); |
---|
61 | |
---|
62 | _param_decod = new morpheo::behavioural::core::multi_front_end::front_end::decod_unit::decod::Parameters |
---|
63 | (_nb_context , |
---|
64 | _nb_inst_fetch , |
---|
65 | _nb_inst_decod , |
---|
66 | max<uint32_t>(_nb_branch_speculated,_nb_context), |
---|
67 | _size_branch_update_prediction, |
---|
68 | _nb_context_select , |
---|
69 | _size_general_data , |
---|
70 | _select_priority , |
---|
71 | _select_load_balancing , |
---|
72 | _instruction_implemeted , |
---|
73 | _get_custom_information); |
---|
74 | |
---|
75 | _param_decod_queue = new morpheo::behavioural::core::multi_front_end::front_end::decod_unit::decod_queue::Parameters |
---|
76 | (_nb_context , |
---|
77 | _nb_inst_decod , |
---|
78 | _size_queue , |
---|
79 | _size_general_data , |
---|
80 | _nb_branch_speculated); |
---|
81 | |
---|
82 | _size_nb_inst_decod = _param_decod_queue->_size_nb_inst; |
---|
83 | |
---|
84 | log_end(Decod_unit,FUNCTION); |
---|
85 | }; |
---|
86 | |
---|
87 | // #undef FUNCTION |
---|
88 | // #define FUNCTION "Decod_unit::Parameters (copy)" |
---|
89 | // Parameters::Parameters (Parameters & param) |
---|
90 | // { |
---|
91 | // log_begin(Decod_unit,FUNCTION); |
---|
92 | // test(); |
---|
93 | // log_end(Decod_unit,FUNCTION); |
---|
94 | // }; |
---|
95 | |
---|
96 | #undef FUNCTION |
---|
97 | #define FUNCTION "Decod_unit::~Parameters" |
---|
98 | Parameters::~Parameters () |
---|
99 | { |
---|
100 | log_begin(Decod_unit,FUNCTION); |
---|
101 | |
---|
102 | delete _param_decod; |
---|
103 | delete _param_decod_queue; |
---|
104 | |
---|
105 | log_end(Decod_unit,FUNCTION); |
---|
106 | }; |
---|
107 | |
---|
108 | }; // end namespace decod_unit |
---|
109 | }; // end namespace front_end |
---|
110 | }; // end namespace multi_front_end |
---|
111 | }; // end namespace core |
---|
112 | |
---|
113 | }; // end namespace behavioural |
---|
114 | }; // end namespace morpheo |
---|