1 | /* |
---|
2 | * $Id: Parameters.cpp 115 2009-04-20 21:29:17Z rosiere $ |
---|
3 | * |
---|
4 | * [ Description ] |
---|
5 | * |
---|
6 | */ |
---|
7 | |
---|
8 | #include "Behavioural/Core/Multi_Execute_loop/Execute_loop/Multi_Write_unit/Write_unit/include/Parameters.h" |
---|
9 | |
---|
10 | namespace morpheo { |
---|
11 | namespace behavioural { |
---|
12 | namespace core { |
---|
13 | namespace multi_execute_loop { |
---|
14 | namespace execute_loop { |
---|
15 | namespace multi_write_unit { |
---|
16 | namespace write_unit { |
---|
17 | |
---|
18 | |
---|
19 | #undef FUNCTION |
---|
20 | #define FUNCTION "Write_unit::Parameters" |
---|
21 | Parameters::Parameters (uint32_t size_write_queue , |
---|
22 | uint32_t size_execute_queue , |
---|
23 | uint32_t nb_context , |
---|
24 | uint32_t nb_front_end , |
---|
25 | uint32_t nb_ooo_engine , |
---|
26 | uint32_t nb_packet , |
---|
27 | uint32_t size_general_data , |
---|
28 | uint32_t nb_general_register, |
---|
29 | uint32_t size_special_data , |
---|
30 | uint32_t nb_special_register, |
---|
31 | uint32_t nb_bypass_write , |
---|
32 | write_queue::Twrite_queue_scheme_t write_queue_scheme , |
---|
33 | bool is_toplevel): |
---|
34 | behavioural::Parameters("Write_unit") |
---|
35 | { |
---|
36 | log_printf(FUNC,Write_unit,FUNCTION,"Begin"); |
---|
37 | |
---|
38 | _size_write_queue = size_write_queue ; |
---|
39 | _size_execute_queue = size_execute_queue ; |
---|
40 | _nb_context = nb_context ; |
---|
41 | _nb_front_end = nb_front_end ; |
---|
42 | _nb_ooo_engine = nb_ooo_engine ; |
---|
43 | _nb_packet = nb_packet ; |
---|
44 | _nb_general_register = nb_general_register; |
---|
45 | _nb_special_register = nb_special_register; |
---|
46 | _nb_bypass_write = nb_bypass_write ; |
---|
47 | _write_queue_scheme = write_queue_scheme ; |
---|
48 | |
---|
49 | _nb_gpr_write = 1; |
---|
50 | _nb_spr_write = 1; |
---|
51 | |
---|
52 | _have_component_execute_queue = _size_execute_queue > 0; |
---|
53 | |
---|
54 | _param_write_queue = new morpheo::behavioural::core::multi_execute_loop::execute_loop::multi_write_unit::write_unit::write_queue ::Parameters |
---|
55 | (_size_write_queue , |
---|
56 | _nb_context , |
---|
57 | _nb_front_end , |
---|
58 | _nb_ooo_engine , |
---|
59 | _nb_packet , |
---|
60 | size_general_data , |
---|
61 | _nb_general_register, |
---|
62 | size_special_data , |
---|
63 | _nb_special_register, |
---|
64 | _nb_bypass_write , |
---|
65 | _write_queue_scheme ); |
---|
66 | |
---|
67 | if (_have_component_execute_queue) |
---|
68 | _param_execute_queue = new morpheo::behavioural::core::multi_execute_loop::execute_loop::multi_write_unit::write_unit::execute_queue::Parameters |
---|
69 | (_size_execute_queue , |
---|
70 | _nb_context , |
---|
71 | _nb_front_end , |
---|
72 | _nb_ooo_engine , |
---|
73 | _nb_packet , |
---|
74 | size_general_data , |
---|
75 | size_special_data ); |
---|
76 | |
---|
77 | test(); |
---|
78 | |
---|
79 | if (is_toplevel) |
---|
80 | { |
---|
81 | _size_instruction_address = size_general_data-2; |
---|
82 | _size_context_id = log2(_nb_context ); |
---|
83 | _size_front_end_id = log2(_nb_front_end ); |
---|
84 | _size_ooo_engine_id = log2(_nb_ooo_engine ); |
---|
85 | _size_rob_ptr = log2(_nb_packet ); |
---|
86 | _size_general_register = log2(_nb_general_register); |
---|
87 | _size_special_register = log2(_nb_special_register); |
---|
88 | _size_general_data = size_general_data ; |
---|
89 | _size_special_data = size_special_data ; |
---|
90 | |
---|
91 | _have_port_context_id = _size_context_id > 0; |
---|
92 | _have_port_front_end_id = _size_front_end_id > 0; |
---|
93 | _have_port_ooo_engine_id = _size_ooo_engine_id > 0; |
---|
94 | _have_port_rob_ptr = _size_rob_ptr > 0; |
---|
95 | |
---|
96 | copy(); |
---|
97 | } |
---|
98 | |
---|
99 | log_printf(FUNC,Write_unit,FUNCTION,"End"); |
---|
100 | }; |
---|
101 | |
---|
102 | // #undef FUNCTION |
---|
103 | // #define FUNCTION "Write_unit::Parameters (copy)" |
---|
104 | // Parameters::Parameters (Parameters & param): |
---|
105 | // _size_write_queue (param._size_write_queue ), |
---|
106 | // _size_execute_queue (param._size_execute_queue ), |
---|
107 | // _nb_context (param._nb_context ), |
---|
108 | // _nb_front_end (param._nb_front_end ), |
---|
109 | // _nb_ooo_engine (param._nb_ooo_engine ), |
---|
110 | // _nb_packet (param._nb_packet ), |
---|
111 | // _size_general_data (param._size_general_data ), |
---|
112 | // _nb_general_register (param._nb_general_register ), |
---|
113 | // _size_special_data (param._size_special_data ), |
---|
114 | // _nb_special_register (param._nb_special_register ), |
---|
115 | // _nb_bypass_write (param._nb_bypass_write ), |
---|
116 | |
---|
117 | // _nb_gpr_write (param._nb_gpr_write ), |
---|
118 | // _nb_spr_write (param._nb_spr_write ), |
---|
119 | |
---|
120 | // _size_context_id (param._size_context_id ), |
---|
121 | // _size_front_end_id (param._size_front_end_id ), |
---|
122 | // _size_ooo_engine_id (param._size_ooo_engine_id ), |
---|
123 | // _size_packet_id (param._size_packet_id ), |
---|
124 | // _size_general_register (param._size_general_register ), |
---|
125 | // _size_special_register (param._size_special_register ), |
---|
126 | |
---|
127 | // _have_component_execute_queue (param._have_component_execute_queue), |
---|
128 | // _have_port_context_id (param._have_port_context_id ), |
---|
129 | // _have_port_front_end_id (param._have_port_front_end_id ), |
---|
130 | // _have_port_ooo_engine_id (param._have_port_ooo_engine_id ), |
---|
131 | // _have_port_packet_id (param._have_port_packet_id ) |
---|
132 | // { |
---|
133 | // log_printf(FUNC,Write_unit,FUNCTION,"Begin"); |
---|
134 | |
---|
135 | // _param_write_queue = param._param_write_queue ; |
---|
136 | // _param_execute_queue = param._param_execute_queue; |
---|
137 | |
---|
138 | // test(); |
---|
139 | // log_printf(FUNC,Write_unit,FUNCTION,"End"); |
---|
140 | // }; |
---|
141 | |
---|
142 | #undef FUNCTION |
---|
143 | #define FUNCTION "Write_unit::~Parameters" |
---|
144 | Parameters::~Parameters (void) |
---|
145 | { |
---|
146 | log_printf(FUNC,Write_unit,FUNCTION,"Begin"); |
---|
147 | |
---|
148 | delete _param_write_queue; |
---|
149 | |
---|
150 | if (_have_component_execute_queue) |
---|
151 | delete _param_execute_queue; |
---|
152 | |
---|
153 | log_printf(FUNC,Write_unit,FUNCTION,"End"); |
---|
154 | }; |
---|
155 | |
---|
156 | #undef FUNCTION |
---|
157 | #define FUNCTION "Write_unit::copy" |
---|
158 | void Parameters::copy (void) |
---|
159 | { |
---|
160 | log_printf(FUNC,Write_unit,FUNCTION,"Begin"); |
---|
161 | |
---|
162 | COPY(_param_write_queue); |
---|
163 | if (_have_component_execute_queue) |
---|
164 | COPY(_param_execute_queue); |
---|
165 | |
---|
166 | log_printf(FUNC,Write_unit,FUNCTION,"End"); |
---|
167 | }; |
---|
168 | |
---|
169 | }; // end namespace write_unit |
---|
170 | }; // end namespace multi_write_unit |
---|
171 | }; // end namespace execute_loop |
---|
172 | }; // end namespace multi_execute_loop |
---|
173 | }; // end namespace core |
---|
174 | }; // end namespace behavioural |
---|
175 | }; // end namespace morpheo |
---|