1 | /* |
---|
2 | * $Id: Parameters.cpp 137 2010-02-16 12:35:48Z 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 | Tdecod_queue_scheme_t queue_scheme , |
---|
26 | uint32_t size_general_data , |
---|
27 | uint32_t * nb_branch_speculated, |
---|
28 | bool is_toplevel) |
---|
29 | { |
---|
30 | log_begin(Decod_queue,FUNCTION); |
---|
31 | |
---|
32 | _nb_context = nb_context ; |
---|
33 | _nb_inst_decod = nb_inst_decod ; |
---|
34 | _size_queue = size_queue/nb_inst_decod; |
---|
35 | _queue_scheme = queue_scheme ; |
---|
36 | // _size_general_data = size_general_data ; |
---|
37 | _nb_branch_speculated = nb_branch_speculated ; |
---|
38 | _nb_instruction_in_queue = size_queue ; |
---|
39 | |
---|
40 | _nb_bank = nb_inst_decod ; |
---|
41 | |
---|
42 | test(); |
---|
43 | |
---|
44 | if (is_toplevel) |
---|
45 | { |
---|
46 | _size_context_id = log2(nb_context); |
---|
47 | _size_nb_inst_decod = log2(_size_queue)+1; |
---|
48 | _size_depth = log2(max<uint32_t>(_nb_branch_speculated,_nb_context)); |
---|
49 | _size_general_data = size_general_data; |
---|
50 | _size_instruction_address = size_general_data-2; |
---|
51 | |
---|
52 | _have_port_context_id = _size_context_id > 0; |
---|
53 | _have_port_depth = _size_depth > 0; |
---|
54 | |
---|
55 | copy (); |
---|
56 | } |
---|
57 | |
---|
58 | log_end(Decod_queue,FUNCTION); |
---|
59 | }; |
---|
60 | |
---|
61 | // #undef FUNCTION |
---|
62 | // #define FUNCTION "Decod_queue::Parameters (copy)" |
---|
63 | // Parameters::Parameters (Parameters & param) |
---|
64 | // { |
---|
65 | // log_begin(Decod_queue,FUNCTION); |
---|
66 | // test(); |
---|
67 | // log_end(Decod_queue,FUNCTION); |
---|
68 | // }; |
---|
69 | |
---|
70 | #undef FUNCTION |
---|
71 | #define FUNCTION "Decod_queue::~Parameters" |
---|
72 | Parameters::~Parameters () |
---|
73 | { |
---|
74 | log_begin(Decod_queue,FUNCTION); |
---|
75 | |
---|
76 | log_end(Decod_queue,FUNCTION); |
---|
77 | }; |
---|
78 | |
---|
79 | #undef FUNCTION |
---|
80 | #define FUNCTION "Decod_queue::copy" |
---|
81 | void Parameters::copy (void) |
---|
82 | { |
---|
83 | log_begin(Decod_queue,FUNCTION); |
---|
84 | |
---|
85 | _size_internal_queue = |
---|
86 | (1 + // _val |
---|
87 | _size_context_id + // _context_id |
---|
88 | _size_depth + // _depth |
---|
89 | _size_type + // _type |
---|
90 | _size_operation + // _operation |
---|
91 | 1 + // _no_execute |
---|
92 | 1 + // _is_delay_slot |
---|
93 | #ifdef DEBUG |
---|
94 | _size_instruction_address + // _address |
---|
95 | #endif |
---|
96 | _size_instruction_address + // _address_next |
---|
97 | 1 + // _has_immediat |
---|
98 | _size_general_data + // _immediat |
---|
99 | 1 + // _read_ra |
---|
100 | _size_general_register_logic + // _num_reg_ra |
---|
101 | 1 + // _read_rb |
---|
102 | _size_general_register_logic + // _num_reg_rb |
---|
103 | 1 + // _read_rc |
---|
104 | _size_special_register_logic + // _num_reg_rc |
---|
105 | 1 + // _write_rd |
---|
106 | _size_general_register_logic + // _num_reg_rd |
---|
107 | 1 + // _write_re |
---|
108 | _size_special_register_logic + // _num_reg_re |
---|
109 | _size_exception_use + // _exception_use |
---|
110 | _size_exception_decod // _exception |
---|
111 | ) * _nb_inst_decod; |
---|
112 | |
---|
113 | log_end(Decod_queue,FUNCTION); |
---|
114 | }; |
---|
115 | |
---|
116 | }; // end namespace decod_queue |
---|
117 | }; // end namespace decod_unit |
---|
118 | }; // end namespace front_end |
---|
119 | }; // end namespace multi_front_end |
---|
120 | }; // end namespace core |
---|
121 | |
---|
122 | }; // end namespace behavioural |
---|
123 | }; // end namespace morpheo |
---|