1 | /* |
---|
2 | * $Id: Parameters.cpp 88 2008-12-10 18:31:39Z rosiere $ |
---|
3 | * |
---|
4 | * [ Description ] |
---|
5 | * |
---|
6 | */ |
---|
7 | |
---|
8 | #include "Behavioural/Core/Multi_Execute_loop/Execute_loop/Network/Read_unit_to_Execution_unit/include/Parameters.h" |
---|
9 | #include "Common/include/Max.h" |
---|
10 | |
---|
11 | namespace morpheo { |
---|
12 | namespace behavioural { |
---|
13 | namespace core { |
---|
14 | namespace multi_execute_loop { |
---|
15 | namespace execute_loop { |
---|
16 | namespace network { |
---|
17 | namespace read_unit_to_execution_unit { |
---|
18 | |
---|
19 | |
---|
20 | #undef FUNCTION |
---|
21 | #define FUNCTION "Read_unit_to_Execution_unit::Parameters" |
---|
22 | Parameters::Parameters (uint32_t nb_read_unit , |
---|
23 | uint32_t * nb_read_unit_port , |
---|
24 | uint32_t nb_execute_unit , |
---|
25 | uint32_t * nb_execute_unit_port , |
---|
26 | uint32_t nb_context , |
---|
27 | uint32_t nb_front_end , |
---|
28 | uint32_t nb_ooo_engine , |
---|
29 | uint32_t nb_packet , |
---|
30 | uint32_t size_general_data , |
---|
31 | uint32_t size_special_data , |
---|
32 | uint32_t nb_general_register , |
---|
33 | uint32_t nb_special_register , |
---|
34 | uint32_t size_store_queue , |
---|
35 | uint32_t size_load_queue , |
---|
36 | Tpriority_t priority , |
---|
37 | bool *** table_routing , |
---|
38 | bool ** table_execute_type , |
---|
39 | bool ** table_execute_thread , |
---|
40 | bool is_toplevel ) |
---|
41 | { |
---|
42 | log_printf(FUNC,Read_unit_to_Execution_unit,FUNCTION,"Begin"); |
---|
43 | |
---|
44 | _nb_read_unit = nb_read_unit ; |
---|
45 | _nb_read_unit_port = nb_read_unit_port ; |
---|
46 | _nb_execute_unit = nb_execute_unit ; |
---|
47 | _nb_execute_unit_port = nb_execute_unit_port; |
---|
48 | _nb_context = nb_context ; |
---|
49 | _nb_front_end = nb_front_end ; |
---|
50 | _nb_ooo_engine = nb_ooo_engine ; |
---|
51 | _nb_packet = nb_packet ; |
---|
52 | _nb_general_register = nb_general_register ; |
---|
53 | _nb_special_register = nb_special_register ; |
---|
54 | _priority = priority ; |
---|
55 | _table_routing = table_routing ; |
---|
56 | _table_execute_type = table_execute_type ; |
---|
57 | _table_execute_thread = table_execute_thread; |
---|
58 | |
---|
59 | _max_nb_read_unit_port = max<uint32_t>(_nb_read_unit_port, _nb_read_unit); |
---|
60 | _max_nb_execute_unit_port= max<uint32_t>(_nb_execute_unit_port, _nb_execute_unit); |
---|
61 | |
---|
62 | _nb_thread = get_nb_thread (nb_context, nb_front_end, nb_ooo_engine); |
---|
63 | _nb_load_store_unit = 0; |
---|
64 | |
---|
65 | for (uint32_t i=0; i<nb_execute_unit; i++) |
---|
66 | { |
---|
67 | if (table_execute_type[i][TYPE_MEMORY] == true) |
---|
68 | _nb_load_store_unit ++; |
---|
69 | } |
---|
70 | // a execution_unit can't be a load_store unit and a functionnal unit |
---|
71 | _nb_functionnal_unit = nb_execute_unit-_nb_load_store_unit; |
---|
72 | |
---|
73 | test(); |
---|
74 | |
---|
75 | if (is_toplevel) |
---|
76 | { |
---|
77 | _size_context_id = log2(nb_context ); |
---|
78 | _size_front_end_id = log2(nb_front_end ); |
---|
79 | _size_ooo_engine_id = log2(nb_ooo_engine ); |
---|
80 | _size_rob_ptr = log2(nb_packet ); |
---|
81 | _size_general_register = log2(nb_general_register); |
---|
82 | _size_special_register = log2(nb_special_register); |
---|
83 | _size_general_data = size_general_data ; |
---|
84 | _size_special_data = size_special_data ; |
---|
85 | _size_store_queue_ptr = log2(size_store_queue ); |
---|
86 | _size_load_queue_ptr = log2(size_load_queue ); |
---|
87 | |
---|
88 | _have_port_context_id = _size_context_id > 0; |
---|
89 | _have_port_front_end_id = _size_front_end_id > 0; |
---|
90 | _have_port_ooo_engine_id = _size_ooo_engine_id > 0; |
---|
91 | _have_port_rob_ptr = _size_rob_ptr > 0; |
---|
92 | _have_port_load_queue_ptr= _size_load_queue_ptr> 0; |
---|
93 | |
---|
94 | copy(); |
---|
95 | } |
---|
96 | |
---|
97 | log_printf(FUNC,Read_unit_to_Execution_unit,FUNCTION,"End"); |
---|
98 | }; |
---|
99 | |
---|
100 | // #undef FUNCTION |
---|
101 | // #define FUNCTION "Read_unit_to_Execution_unit::Parameters (copy)" |
---|
102 | // Parameters::Parameters (Parameters & param) |
---|
103 | // { |
---|
104 | // log_printf(FUNC,Read_unit_to_Execution_unit,FUNCTION,"Begin"); |
---|
105 | |
---|
106 | // test(); |
---|
107 | // log_printf(FUNC,Read_unit_to_Execution_unit,FUNCTION,"End"); |
---|
108 | // }; |
---|
109 | |
---|
110 | #undef FUNCTION |
---|
111 | #define FUNCTION "Read_unit_to_Execution_unit::~Parameters" |
---|
112 | Parameters::~Parameters () |
---|
113 | { |
---|
114 | log_printf(FUNC,Read_unit_to_Execution_unit,FUNCTION,"Begin"); |
---|
115 | log_printf(FUNC,Read_unit_to_Execution_unit,FUNCTION,"End"); |
---|
116 | }; |
---|
117 | |
---|
118 | #undef FUNCTION |
---|
119 | #define FUNCTION "Read_unit_to_Execution_unit::copy" |
---|
120 | void Parameters::copy (void) |
---|
121 | { |
---|
122 | log_printf(FUNC,Read_unit_to_Execution_unit,FUNCTION,"Begin"); |
---|
123 | log_printf(FUNC,Read_unit_to_Execution_unit,FUNCTION,"End"); |
---|
124 | }; |
---|
125 | |
---|
126 | }; // end namespace read_unit_to_execution_unit |
---|
127 | }; // end namespace network |
---|
128 | }; // end namespace execute_loop |
---|
129 | }; // end namespace multi_execute_loop |
---|
130 | }; // end namespace core |
---|
131 | |
---|
132 | }; // end namespace behavioural |
---|
133 | }; // end namespace morpheo |
---|