1 | /* |
---|
2 | |
---|
3 | * $Id: Parameters.cpp 87 2008-05-15 19:23:42Z rosiere $ |
---|
4 | * |
---|
5 | * [ Description ] |
---|
6 | * |
---|
7 | */ |
---|
8 | |
---|
9 | #include "Behavioural/Core/Multi_Front_end/Front_end/Decod_unit/Decod/include/Parameters.h" |
---|
10 | #include "Common/include/Max.h" |
---|
11 | |
---|
12 | namespace morpheo { |
---|
13 | namespace behavioural { |
---|
14 | namespace core { |
---|
15 | namespace multi_front_end { |
---|
16 | namespace front_end { |
---|
17 | namespace decod_unit { |
---|
18 | namespace decod { |
---|
19 | |
---|
20 | |
---|
21 | #undef FUNCTION |
---|
22 | #define FUNCTION "Decod::Parameters" |
---|
23 | Parameters::Parameters (uint32_t nb_context , |
---|
24 | uint32_t * nb_inst_fetch , |
---|
25 | uint32_t nb_inst_decod , |
---|
26 | uint32_t nb_branch_speculated , |
---|
27 | uint32_t size_branch_update_prediction, |
---|
28 | uint32_t nb_context_select , |
---|
29 | uint32_t size_general_data , |
---|
30 | Tpriority_t priority , |
---|
31 | Tload_balancing_t load_balancing , |
---|
32 | bool ** instruction_implemeted , |
---|
33 | morpheo::behavioural::custom::custom_information_t (*get_custom_information) (uint32_t)) |
---|
34 | { |
---|
35 | log_printf(FUNC,Decod,FUNCTION,"Begin"); |
---|
36 | |
---|
37 | _nb_context = nb_context ; |
---|
38 | _nb_inst_fetch = nb_inst_fetch ; |
---|
39 | _nb_inst_decod = nb_inst_decod ; |
---|
40 | _nb_branch_speculated = nb_branch_speculated ; |
---|
41 | _nb_context_select = nb_context_select ; |
---|
42 | _size_branch_update_prediction = size_branch_update_prediction; |
---|
43 | _size_general_data = size_general_data ; |
---|
44 | _priority = priority ; |
---|
45 | _load_balancing = load_balancing ; |
---|
46 | _instruction_implemeted = instruction_implemeted ; |
---|
47 | |
---|
48 | if (get_custom_information == NULL) |
---|
49 | _get_custom_information = &(morpheo::behavioural::custom::default_get_custom_information); |
---|
50 | else |
---|
51 | _get_custom_information = get_custom_information; |
---|
52 | |
---|
53 | |
---|
54 | _max_nb_inst_fetch = max<uint32_t>(nb_inst_fetch,nb_context); |
---|
55 | |
---|
56 | _size_address_inst = size_general_data-2; |
---|
57 | _size_context_id = log2(nb_context ); |
---|
58 | _size_depth = log2(nb_branch_speculated); |
---|
59 | _size_inst_ifetch_ptr = log2(_max_nb_inst_fetch ); |
---|
60 | |
---|
61 | _have_port_context_id = _size_context_id > 0; |
---|
62 | _have_port_depth = _size_depth > 0; |
---|
63 | _have_port_branch_update_prediction_id = _size_branch_update_prediction > 0; |
---|
64 | _have_port_inst_ifetch_ptr = _size_inst_ifetch_ptr > 0; |
---|
65 | |
---|
66 | test(); |
---|
67 | log_printf(FUNC,Decod,FUNCTION,"End"); |
---|
68 | }; |
---|
69 | |
---|
70 | // #undef FUNCTION |
---|
71 | // #define FUNCTION "Decod::Parameters (copy)" |
---|
72 | // Parameters::Parameters (Parameters & param) |
---|
73 | // { |
---|
74 | // log_printf(FUNC,Decod,FUNCTION,"Begin"); |
---|
75 | // test(); |
---|
76 | // log_printf(FUNC,Decod,FUNCTION,"End"); |
---|
77 | // }; |
---|
78 | |
---|
79 | #undef FUNCTION |
---|
80 | #define FUNCTION "Decod::~Parameters" |
---|
81 | Parameters::~Parameters () |
---|
82 | { |
---|
83 | log_printf(FUNC,Decod,FUNCTION,"Begin"); |
---|
84 | log_printf(FUNC,Decod,FUNCTION,"End"); |
---|
85 | }; |
---|
86 | |
---|
87 | }; // end namespace decod |
---|
88 | }; // end namespace decod_unit |
---|
89 | }; // end namespace front_end |
---|
90 | }; // end namespace multi_front_end |
---|
91 | }; // end namespace core |
---|
92 | |
---|
93 | }; // end namespace behavioural |
---|
94 | }; // end namespace morpheo |
---|