1 | /* |
---|
2 | * $Id: Parameters.cpp 118 2009-05-20 22:01:32Z rosiere $ |
---|
3 | * |
---|
4 | * [ Description ] |
---|
5 | * |
---|
6 | */ |
---|
7 | |
---|
8 | #include "Behavioural/Core/Multi_Execute_loop/Execute_loop/Multi_Write_unit/Write_unit/Write_queue/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 | namespace write_queue { |
---|
18 | |
---|
19 | |
---|
20 | #undef FUNCTION |
---|
21 | #define FUNCTION "Write_queue::Parameters" |
---|
22 | Parameters::Parameters (uint32_t size_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 | Twrite_queue_scheme_t queue_scheme , |
---|
33 | bool is_toplevel ): |
---|
34 | behavioural::Parameters ("Write_queue") |
---|
35 | { |
---|
36 | log_printf(FUNC,Write_queue,FUNCTION,"Begin"); |
---|
37 | |
---|
38 | _size_queue = size_queue ; |
---|
39 | _nb_context = nb_context ; |
---|
40 | _nb_front_end = nb_front_end ; |
---|
41 | _nb_ooo_engine = nb_ooo_engine ; |
---|
42 | _nb_packet = nb_packet ; |
---|
43 | _nb_general_register = nb_general_register; |
---|
44 | _nb_special_register = nb_special_register; |
---|
45 | _nb_bypass_write = nb_bypass_write ; |
---|
46 | _queue_scheme = queue_scheme ; |
---|
47 | _bypass_write_scheme = BYPASS_WRITE_FROM_ALU; |
---|
48 | // _bypass_write_scheme = BYPASS_WRITE_FROM_QUEUE; |
---|
49 | |
---|
50 | _nb_gpr_write = 1; |
---|
51 | _nb_spr_write = 1; |
---|
52 | |
---|
53 | test(); |
---|
54 | |
---|
55 | if (is_toplevel) |
---|
56 | { |
---|
57 | _size_instruction_address= size_general_data-2; |
---|
58 | _size_context_id = log2(_nb_context ); |
---|
59 | _size_front_end_id = log2(_nb_front_end ); |
---|
60 | _size_ooo_engine_id = log2(_nb_ooo_engine ); |
---|
61 | _size_rob_ptr = log2(_nb_packet ); |
---|
62 | _size_general_register = log2(_nb_general_register); |
---|
63 | _size_special_register = log2(_nb_special_register); |
---|
64 | _size_general_data = size_general_data ; |
---|
65 | _size_special_data = size_special_data ; |
---|
66 | |
---|
67 | _have_port_context_id = _size_context_id > 0; |
---|
68 | _have_port_front_end_id = _size_front_end_id > 0; |
---|
69 | _have_port_ooo_engine_id = _size_ooo_engine_id > 0; |
---|
70 | _have_port_rob_ptr = _size_rob_ptr > 0; |
---|
71 | |
---|
72 | copy(); |
---|
73 | } |
---|
74 | |
---|
75 | log_printf(FUNC,Write_queue,FUNCTION,"End"); |
---|
76 | }; |
---|
77 | |
---|
78 | // #undef FUNCTION |
---|
79 | // #define FUNCTION "Write_queue::Parameters (copy)" |
---|
80 | // Parameters::Parameters (Parameters & param): |
---|
81 | // _size_queue (param._size_queue ), |
---|
82 | // _nb_context (param._nb_context ), |
---|
83 | // _nb_front_end (param._nb_front_end ), |
---|
84 | // _nb_ooo_engine (param._nb_ooo_engine ), |
---|
85 | // _nb_packet (param._nb_packet ), |
---|
86 | // _size_general_data (param._size_general_data ), |
---|
87 | // _nb_general_register (param._nb_general_register ), |
---|
88 | // _size_special_data (param._size_special_data ), |
---|
89 | // _nb_special_register (param._nb_special_register ), |
---|
90 | // _nb_bypass_write (param._nb_bypass_write ), |
---|
91 | |
---|
92 | // _nb_gpr_write (param._nb_gpr_write ), |
---|
93 | // _nb_spr_write (param._nb_spr_write ), |
---|
94 | |
---|
95 | // _size_context_id (param._size_context_id ), |
---|
96 | // _size_front_end_id (param._size_front_end_id ), |
---|
97 | // _size_ooo_engine_id (param._size_ooo_engine_id ), |
---|
98 | // _size_packet_id (param._size_packet_id ), |
---|
99 | // _size_general_register (param._size_general_register ), |
---|
100 | // _size_special_register (param._size_special_register ), |
---|
101 | |
---|
102 | // _have_port_context_id (param._have_port_context_id ), |
---|
103 | // _have_port_front_end_id (param._have_port_front_end_id ), |
---|
104 | // _have_port_ooo_engine_id (param._have_port_ooo_engine_id), |
---|
105 | // _have_port_packet_id (param._have_port_packet_id ) |
---|
106 | // { |
---|
107 | // log_printf(FUNC,Write_queue,FUNCTION,"Begin"); |
---|
108 | // test(); |
---|
109 | // log_printf(FUNC,Write_queue,FUNCTION,"End"); |
---|
110 | // }; |
---|
111 | |
---|
112 | #undef FUNCTION |
---|
113 | #define FUNCTION "Write_queue::~Parameters" |
---|
114 | Parameters::~Parameters (void) |
---|
115 | { |
---|
116 | log_printf(FUNC,Write_queue,FUNCTION,"Begin"); |
---|
117 | log_printf(FUNC,Write_queue,FUNCTION,"End"); |
---|
118 | }; |
---|
119 | |
---|
120 | #undef FUNCTION |
---|
121 | #define FUNCTION "Write_queue::copy" |
---|
122 | void Parameters::copy (void) |
---|
123 | { |
---|
124 | log_printf(FUNC,Write_queue,FUNCTION,"Begin"); |
---|
125 | |
---|
126 | _size_internal_queue = |
---|
127 | ( _size_context_id + |
---|
128 | _size_front_end_id + |
---|
129 | _size_ooo_engine_id + |
---|
130 | _size_rob_ptr + |
---|
131 | 1 + |
---|
132 | _size_general_register + |
---|
133 | _size_general_data + |
---|
134 | 1 + |
---|
135 | _size_special_register + |
---|
136 | _size_special_data + |
---|
137 | _size_exception + |
---|
138 | 1 + |
---|
139 | _size_instruction_address |
---|
140 | ); |
---|
141 | |
---|
142 | log_printf(FUNC,Write_queue,FUNCTION,"End"); |
---|
143 | }; |
---|
144 | |
---|
145 | }; // end namespace write_queue |
---|
146 | }; // end namespace write_unit |
---|
147 | }; // end namespace multi_write_unit |
---|
148 | }; // end namespace execute_loop |
---|
149 | }; // end namespace multi_execute_loop |
---|
150 | }; // end namespace core |
---|
151 | |
---|
152 | }; // end namespace behavioural |
---|
153 | }; // end namespace morpheo |
---|