1 | /* |
---|
2 | * $Id: Instance.cpp 88 2008-12-10 18:31:39Z rosiere $ |
---|
3 | * |
---|
4 | * [ Description ] |
---|
5 | * |
---|
6 | */ |
---|
7 | |
---|
8 | #include "Behavioural/Configuration/include/Instance.h" |
---|
9 | #include "Behavioural/include/Allocation.h" |
---|
10 | |
---|
11 | namespace morpheo { |
---|
12 | namespace behavioural { |
---|
13 | namespace configuration { |
---|
14 | |
---|
15 | #undef FUNCTION |
---|
16 | #define FUNCTION "Instance::Instance" |
---|
17 | Instance::Instance (std::string filename, |
---|
18 | Generator * generator, |
---|
19 | behavioural::custom::custom_information_t (*get_custom_information) (void)) |
---|
20 | { |
---|
21 | log_begin(Configuration,FUNCTION); |
---|
22 | |
---|
23 | _name = ""; |
---|
24 | _filename = filename; |
---|
25 | |
---|
26 | _list_parameters = new list_parameters_t; |
---|
27 | _list_links = new list_links_t; |
---|
28 | _list_components = new list_components_t; |
---|
29 | |
---|
30 | _generator = generator; |
---|
31 | _param = new Parameters; |
---|
32 | _param->_get_custom_information = get_custom_information; |
---|
33 | |
---|
34 | fromFile (filename); |
---|
35 | |
---|
36 | log_end(Configuration,FUNCTION); |
---|
37 | }; |
---|
38 | |
---|
39 | #undef FUNCTION |
---|
40 | #define FUNCTION "Instance::~Instance" |
---|
41 | Instance::~Instance () |
---|
42 | { |
---|
43 | log_begin(Configuration,FUNCTION); |
---|
44 | |
---|
45 | for (list_parameters_t::iterator it = _list_parameters->begin(); |
---|
46 | it != _list_parameters->end(); |
---|
47 | ++it) |
---|
48 | delete it->second; |
---|
49 | delete _list_parameters; |
---|
50 | |
---|
51 | for (list_links_t::iterator it1 = _list_links->begin(); |
---|
52 | it1 != _list_links->end(); |
---|
53 | ++it1) |
---|
54 | for (list_link_t::iterator it2 = it1->second.begin(); |
---|
55 | it2 != it1->second.end(); |
---|
56 | ++it2) |
---|
57 | delete it2->second; |
---|
58 | delete _list_links; |
---|
59 | |
---|
60 | for (list_components_t::iterator it1 = _list_components->begin(); |
---|
61 | it1 != _list_components->end(); |
---|
62 | ++it1) |
---|
63 | for (list_instances_t::iterator it2 = it1->second.begin(); |
---|
64 | it2 != it1->second.end(); |
---|
65 | ++it2) |
---|
66 | delete it2->second; |
---|
67 | delete _list_components; |
---|
68 | |
---|
69 | if (_param != NULL) // TEST A ENLEVER |
---|
70 | { |
---|
71 | DELETE2(_param->_link_dcache_port_with_load_store_unit ,_param->_nb_load_store_unit,_param->_nb_cache_port[it1]); |
---|
72 | DELETE1(_param->_link_icache_port_with_thread ,_param->_nb_thread); |
---|
73 | DELETE2(_param->_link_thread_and_functionnal_unit ,_param->_nb_thread,_param->_nb_functionnal_unit); |
---|
74 | DELETE1(_param->_link_load_store_unit_with_thread ,_param->_nb_thread); |
---|
75 | DELETE2(_param->_link_write_bloc_and_functionnal_unit ,_param->_nb_write_bloc,_param->_nb_functionnal_unit); |
---|
76 | DELETE2(_param->_link_write_bloc_and_load_store_unit ,_param->_nb_write_bloc,_param->_nb_load_store_unit); |
---|
77 | DELETE2(_param->_link_read_bloc_and_functionnal_unit ,_param->_nb_read_bloc,_param->_nb_functionnal_unit); |
---|
78 | DELETE2(_param->_link_read_bloc_and_load_store_unit ,_param->_nb_read_bloc,_param->_nb_load_store_unit); |
---|
79 | DELETE3(_param->_table_dispatch ,_param->_nb_ooo_engine,_param->_nb_inst_issue[it1],_param->_nb_read_bloc); |
---|
80 | DELETE1(_param->_link_rename_bloc_with_front_end ,_param->_nb_front_end); |
---|
81 | DELETE1(_param->_link_decod_bloc_with_thread ,_param->_nb_thread); |
---|
82 | DELETE1(_param->_link_execute_unit_with_load_store_unit ,_param->_nb_load_store_unit); |
---|
83 | DELETE1(_param->_link_execute_unit_with_functionnal_unit,_param->_nb_functionnal_unit); |
---|
84 | DELETE1(_param->_link_write_unit_with_write_bloc ,_param->_nb_write_bloc); |
---|
85 | DELETE1(_param->_link_read_unit_with_read_bloc ,_param->_nb_read_bloc); |
---|
86 | DELETE1(_param->_link_rename_unit_with_rename_bloc ,_param->_nb_rename_bloc); |
---|
87 | DELETE1(_param->_link_decod_unit_with_decod_bloc ,_param->_nb_decod_bloc); |
---|
88 | DELETE1(_param->_link_context_with_thread ,_param->_nb_thread); |
---|
89 | DELETE1(_param->_read_unit_to_execution_unit_priority ,_param->_nb_execute_loop); |
---|
90 | DELETE1(_param->_execution_unit_to_write_unit_priority ,_param->_nb_execute_loop); |
---|
91 | DELETE1(_param->_nb_spr_port_write_by_bank ,_param->_nb_execute_loop); |
---|
92 | DELETE1(_param->_nb_spr_port_read_by_bank ,_param->_nb_execute_loop); |
---|
93 | DELETE1(_param->_nb_spr_bank ,_param->_nb_execute_loop); |
---|
94 | DELETE1(_param->_nb_gpr_port_write_by_bank ,_param->_nb_execute_loop); |
---|
95 | DELETE1(_param->_nb_gpr_port_read_by_bank ,_param->_nb_execute_loop); |
---|
96 | DELETE1(_param->_nb_gpr_bank ,_param->_nb_execute_loop); |
---|
97 | DELETE1(_param->_nb_write_unit ,_param->_nb_execute_loop); |
---|
98 | DELETE1(_param->_nb_execute_unit ,_param->_nb_execute_loop); |
---|
99 | DELETE1(_param->_nb_read_unit ,_param->_nb_execute_loop); |
---|
100 | DELETE1(_param->_reexecute_load_balancing ,_param->_nb_ooo_engine); |
---|
101 | DELETE1(_param->_reexecute_priority ,_param->_nb_ooo_engine); |
---|
102 | DELETE1(_param->_size_reexecute_queue ,_param->_nb_ooo_engine); |
---|
103 | DELETE1(_param->_issue_load_balancing ,_param->_nb_ooo_engine); |
---|
104 | DELETE1(_param->_issue_priority ,_param->_nb_ooo_engine); |
---|
105 | DELETE1(_param->_nb_issue_queue_bank ,_param->_nb_ooo_engine); |
---|
106 | DELETE1(_param->_size_issue_queue ,_param->_nb_ooo_engine); |
---|
107 | DELETE1(_param->_commit_load_balancing ,_param->_nb_ooo_engine); |
---|
108 | DELETE1(_param->_commit_priority ,_param->_nb_ooo_engine); |
---|
109 | DELETE1(_param->_nb_re_order_buffer_bank ,_param->_nb_ooo_engine); |
---|
110 | DELETE1(_param->_size_re_order_buffer ,_param->_nb_ooo_engine); |
---|
111 | DELETE1(_param->_nb_execute_loop_select ,_param->_nb_ooo_engine); |
---|
112 | DELETE1(_param->_nb_rename_unit_select ,_param->_nb_ooo_engine); |
---|
113 | DELETE1(_param->_nb_inst_branch_complete ,_param->_nb_ooo_engine); |
---|
114 | DELETE1(_param->_nb_inst_commit ,_param->_nb_ooo_engine); |
---|
115 | DELETE1(_param->_nb_inst_reexecute ,_param->_nb_ooo_engine); |
---|
116 | DELETE1(_param->_nb_inst_issue ,_param->_nb_ooo_engine); |
---|
117 | DELETE1(_param->_nb_rename_unit ,_param->_nb_ooo_engine); |
---|
118 | DELETE2(_param->_dir_pht_size_address_share ,_param->_nb_front_end,3); |
---|
119 | DELETE2(_param->_dir_pht_nb_counter ,_param->_nb_front_end,3); |
---|
120 | DELETE2(_param->_dir_pht_size_counter ,_param->_nb_front_end,3); |
---|
121 | DELETE2(_param->_dir_have_pht ,_param->_nb_front_end,3); |
---|
122 | DELETE2(_param->_dir_bht_nb_shifter ,_param->_nb_front_end,3); |
---|
123 | DELETE2(_param->_dir_bht_size_shifter ,_param->_nb_front_end,3); |
---|
124 | DELETE2(_param->_dir_have_bht ,_param->_nb_front_end,3); |
---|
125 | DELETE1(_param->_dir_predictor_scheme ,_param->_nb_front_end); |
---|
126 | DELETE1(_param->_btb_victim_scheme ,_param->_nb_front_end); |
---|
127 | DELETE1(_param->_btb_size_counter ,_param->_nb_front_end); |
---|
128 | DELETE1(_param->_btb_associativity ,_param->_nb_front_end); |
---|
129 | DELETE1(_param->_btb_size_queue ,_param->_nb_front_end); |
---|
130 | DELETE1(_param->_nb_inst_branch_update ,_param->_nb_front_end); |
---|
131 | DELETE1(_param->_nb_inst_branch_decod ,_param->_nb_front_end); |
---|
132 | DELETE1(_param->_nb_inst_branch_predict ,_param->_nb_front_end); |
---|
133 | DELETE1(_param->_nb_decod_unit ,_param->_nb_front_end); |
---|
134 | DELETE1(_param->_nb_context ,_param->_nb_front_end); |
---|
135 | DELETE3(_param->_timing ,_param->_nb_functionnal_unit,MAX_TYPE,MAX_OPERATION); |
---|
136 | DELETE1(_param->_nb_inst_functionnal_unit ,_param->_nb_functionnal_unit); |
---|
137 | DELETE1(_param->_speculative_load ,_param->_nb_load_store_unit); |
---|
138 | DELETE1(_param->_nb_inst_memory ,_param->_nb_load_store_unit); |
---|
139 | DELETE1(_param->_nb_cache_port ,_param->_nb_load_store_unit); |
---|
140 | DELETE1(_param->_nb_bypass_memory ,_param->_nb_load_store_unit); |
---|
141 | DELETE1(_param->_nb_port_check ,_param->_nb_load_store_unit); |
---|
142 | DELETE1(_param->_size_speculative_access_queue ,_param->_nb_load_store_unit); |
---|
143 | DELETE1(_param->_size_load_queue ,_param->_nb_load_store_unit); |
---|
144 | DELETE1(_param->_size_store_queue ,_param->_nb_load_store_unit); |
---|
145 | DELETE1(_param->_nb_bypass_write ,_param->_nb_write_bloc); |
---|
146 | DELETE1(_param->_size_execute_queue ,_param->_nb_write_bloc); |
---|
147 | DELETE1(_param->_size_write_queue ,_param->_nb_write_bloc); |
---|
148 | DELETE1(_param->_nb_inst_retire_reservation_station ,_param->_nb_read_bloc); |
---|
149 | DELETE1(_param->_size_reservation_station ,_param->_nb_read_bloc); |
---|
150 | DELETE1(_param->_size_read_queue ,_param->_nb_read_bloc); |
---|
151 | DELETE1(_param->_size_read_counter ,_param->_nb_rename_bloc); |
---|
152 | DELETE1(_param->_nb_rename_unit_bank ,_param->_nb_rename_bloc); |
---|
153 | DELETE1(_param->_nb_reg_free ,_param->_nb_rename_bloc); |
---|
154 | DELETE1(_param->_nb_special_register ,_param->_nb_rename_bloc); |
---|
155 | DELETE1(_param->_nb_general_register ,_param->_nb_rename_bloc); |
---|
156 | DELETE1(_param->_rename_select_nb_front_end_select ,_param->_nb_rename_bloc); |
---|
157 | DELETE1(_param->_rename_select_load_balancing ,_param->_nb_rename_bloc); |
---|
158 | DELETE1(_param->_rename_select_priority ,_param->_nb_rename_bloc); |
---|
159 | DELETE1(_param->_nb_inst_retire ,_param->_nb_rename_bloc); |
---|
160 | DELETE1(_param->_nb_inst_insert ,_param->_nb_rename_bloc); |
---|
161 | DELETE1(_param->_context_select_load_balancing ,_param->_nb_decod_bloc); |
---|
162 | DELETE1(_param->_context_select_priority ,_param->_nb_decod_bloc); |
---|
163 | DELETE1(_param->_nb_context_select ,_param->_nb_decod_bloc); |
---|
164 | DELETE1(_param->_nb_inst_decod ,_param->_nb_decod_bloc); |
---|
165 | DELETE1(_param->_size_decod_queue ,_param->_nb_decod_bloc); |
---|
166 | DELETE1(_param->_upt_size_queue ,_param->_nb_thread); |
---|
167 | DELETE1(_param->_ras_size_queue ,_param->_nb_thread); |
---|
168 | DELETE2(_param->_implement_group ,_param->_nb_thread,NB_GROUP); |
---|
169 | DELETE1(_param->_nb_inst_fetch ,_param->_nb_thread); |
---|
170 | DELETE1(_param->_size_ifetch_queue ,_param->_nb_thread); |
---|
171 | |
---|
172 | delete _param; |
---|
173 | } |
---|
174 | log_end(Configuration,FUNCTION); |
---|
175 | }; |
---|
176 | |
---|
177 | }; // end namespace configuration |
---|
178 | }; // end namespace behavioural |
---|
179 | }; // end namespace morpheo |
---|