1 | /* |
---|
2 | * $Id: Parameters.cpp 95 2008-12-16 16:24:26Z rosiere $ |
---|
3 | * |
---|
4 | * [ Description ] |
---|
5 | * |
---|
6 | */ |
---|
7 | |
---|
8 | #include "Behavioural/Core/Multi_Front_end/Front_end/Decod_unit/Decod_queue/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 | namespace decod_queue { |
---|
18 | |
---|
19 | |
---|
20 | #undef FUNCTION |
---|
21 | #define FUNCTION "Decod_queue::Parameters" |
---|
22 | Parameters::Parameters (uint32_t nb_context , |
---|
23 | uint32_t nb_inst_decod , |
---|
24 | uint32_t size_queue , |
---|
25 | uint32_t size_general_data , |
---|
26 | uint32_t * nb_branch_speculated, |
---|
27 | bool is_toplevel ) |
---|
28 | { |
---|
29 | log_begin(Decod_queue,FUNCTION); |
---|
30 | |
---|
31 | _nb_context = nb_context ; |
---|
32 | _nb_inst_decod = nb_inst_decod ; |
---|
33 | _size_queue = size_queue ; |
---|
34 | // _size_general_data = size_general_data ; |
---|
35 | _nb_branch_speculated = nb_branch_speculated; |
---|
36 | |
---|
37 | _nb_bank = _nb_inst_decod ; |
---|
38 | _size_bank = _size_queue / _nb_bank; |
---|
39 | |
---|
40 | test(); |
---|
41 | |
---|
42 | if (is_toplevel) |
---|
43 | { |
---|
44 | _size_context_id = log2(nb_context); |
---|
45 | _size_nb_inst_decod = log2(_size_queue)+1; |
---|
46 | _size_depth = log2(max<uint32_t>(_nb_branch_speculated,_nb_context)); |
---|
47 | _size_general_data = size_general_data; |
---|
48 | _size_instruction_address = size_general_data-2; |
---|
49 | |
---|
50 | _have_port_context_id = _size_context_id > 0; |
---|
51 | _have_port_depth = _size_depth > 0; |
---|
52 | |
---|
53 | copy (); |
---|
54 | } |
---|
55 | |
---|
56 | log_end(Decod_queue,FUNCTION); |
---|
57 | }; |
---|
58 | |
---|
59 | // #undef FUNCTION |
---|
60 | // #define FUNCTION "Decod_queue::Parameters (copy)" |
---|
61 | // Parameters::Parameters (Parameters & param) |
---|
62 | // { |
---|
63 | // log_begin(Decod_queue,FUNCTION); |
---|
64 | // test(); |
---|
65 | // log_end(Decod_queue,FUNCTION); |
---|
66 | // }; |
---|
67 | |
---|
68 | #undef FUNCTION |
---|
69 | #define FUNCTION "Decod_queue::~Parameters" |
---|
70 | Parameters::~Parameters () |
---|
71 | { |
---|
72 | log_begin(Decod_queue,FUNCTION); |
---|
73 | |
---|
74 | log_end(Decod_queue,FUNCTION); |
---|
75 | }; |
---|
76 | |
---|
77 | #undef FUNCTION |
---|
78 | #define FUNCTION "Decod_queue::copy" |
---|
79 | void Parameters::copy (void) |
---|
80 | { |
---|
81 | log_begin(Decod_queue,FUNCTION); |
---|
82 | |
---|
83 | log_end(Decod_queue,FUNCTION); |
---|
84 | }; |
---|
85 | |
---|
86 | }; // end namespace decod_queue |
---|
87 | }; // end namespace decod_unit |
---|
88 | }; // end namespace front_end |
---|
89 | }; // end namespace multi_front_end |
---|
90 | }; // end namespace core |
---|
91 | |
---|
92 | }; // end namespace behavioural |
---|
93 | }; // end namespace morpheo |
---|