@@ -154,7 +154,7 @@ void free_arch(t_arch* arch) {
154
154
155
155
for (int i = 0 ; i < arch->num_switches ; ++i) {
156
156
if (arch->Switches ->name != nullptr ) {
157
- delete arch->Switches [i].name ;
157
+ vtr::free ( arch->Switches [i].name ) ;
158
158
}
159
159
}
160
160
delete[] arch->Switches ;
@@ -163,13 +163,13 @@ void free_arch(t_arch* arch) {
163
163
free_arch_models (arch->models );
164
164
165
165
for (int i = 0 ; i < arch->num_directs ; ++i) {
166
- delete arch->Directs [i].name ;
167
- delete arch->Directs [i].from_pin ;
168
- delete arch->Directs [i].to_pin ;
166
+ vtr::free ( arch->Directs [i].name ) ;
167
+ vtr::free ( arch->Directs [i].from_pin ) ;
168
+ vtr::free ( arch->Directs [i].to_pin ) ;
169
169
}
170
- delete arch->Directs ;
170
+ vtr::free ( arch->Directs ) ;
171
171
172
- delete arch->architecture_id ;
172
+ vtr::free ( arch->architecture_id ) ;
173
173
174
174
// Free internal model library
175
175
if (arch->model_library ) {
@@ -178,50 +178,50 @@ void free_arch(t_arch* arch) {
178
178
while (vptr) {
179
179
vtr::t_linked_vptr* vptr_prev = vptr;
180
180
vptr = vptr->next ;
181
- delete vptr_prev;
181
+ vtr::free ( vptr_prev) ;
182
182
}
183
183
}
184
184
185
185
// Each model has different number of inputs/outputs - delete each model separately
186
186
// Free INPAD
187
- delete arch->model_library [LIB_INPUT].name ;
188
- delete arch->model_library [LIB_INPUT].outputs ->name ;
187
+ vtr::free ( arch->model_library [LIB_INPUT].name ) ;
188
+ vtr::free ( arch->model_library [LIB_INPUT].outputs ->name ) ;
189
189
delete[] arch->model_library [LIB_INPUT].outputs ;
190
190
191
191
// Free OUTPAD
192
- delete arch->model_library [LIB_OUTPUT].name ;
193
- delete arch->model_library [LIB_OUTPUT].inputs ->name ;
192
+ vtr::free ( arch->model_library [LIB_OUTPUT].name ) ;
193
+ vtr::free ( arch->model_library [LIB_OUTPUT].inputs ->name ) ;
194
194
delete[] arch->model_library [LIB_OUTPUT].inputs ;
195
195
196
196
// Free LATCH triggered at RISING EDGE
197
- delete arch->model_library [LIB_LATCH_RE].name ;
198
- delete arch->model_library [LIB_LATCH_RE].inputs [0 ].name ;
199
- delete arch->model_library [LIB_LATCH_RE].inputs [1 ].name ;
197
+ vtr::free ( arch->model_library [LIB_LATCH_RE].name ) ;
198
+ vtr::free ( arch->model_library [LIB_LATCH_RE].inputs [0 ].name ) ;
199
+ vtr::free ( arch->model_library [LIB_LATCH_RE].inputs [1 ].name ) ;
200
200
delete[] arch->model_library [LIB_LATCH_RE].inputs ;
201
- delete arch->model_library [LIB_LATCH_RE].outputs ->name ;
201
+ vtr::free ( arch->model_library [LIB_LATCH_RE].outputs ->name ) ;
202
202
delete[] arch->model_library [LIB_LATCH_RE].outputs ;
203
203
204
204
// Free LATCH triggered at FALLING EDGE
205
- delete arch->model_library [LIB_LATCH_FE].name ;
206
- delete arch->model_library [LIB_LATCH_FE].inputs [0 ].name ;
207
- delete arch->model_library [LIB_LATCH_FE].inputs [1 ].name ;
205
+ vtr::free ( arch->model_library [LIB_LATCH_FE].name ) ;
206
+ vtr::free ( arch->model_library [LIB_LATCH_FE].inputs [0 ].name ) ;
207
+ vtr::free ( arch->model_library [LIB_LATCH_FE].inputs [1 ].name ) ;
208
208
delete[] arch->model_library [LIB_LATCH_FE].inputs ;
209
- delete arch->model_library [LIB_LATCH_FE].outputs ->name ;
209
+ vtr::free ( arch->model_library [LIB_LATCH_FE].outputs ->name ) ;
210
210
delete[] arch->model_library [LIB_LATCH_FE].outputs ;
211
211
212
212
// Free NAMES
213
- delete arch->model_library [LIB_NAMES].name ;
214
- delete arch->model_library [LIB_NAMES].inputs ->name ;
213
+ vtr::free ( arch->model_library [LIB_NAMES].name ) ;
214
+ vtr::free ( arch->model_library [LIB_NAMES].inputs ->name ) ;
215
215
delete[] arch->model_library [LIB_NAMES].inputs ;
216
- delete arch->model_library [LIB_NAMES].outputs ->name ;
216
+ vtr::free ( arch->model_library [LIB_NAMES].outputs ->name ) ;
217
217
delete[] arch->model_library [LIB_NAMES].outputs ;
218
218
219
219
// Free the library array
220
220
delete[] arch->model_library ;
221
221
}
222
222
223
223
if (arch->clocks ) {
224
- delete arch->clocks ->clock_inf ;
224
+ vtr::free ( arch->clocks ->clock_inf ) ;
225
225
}
226
226
227
227
delete (arch->noc );
@@ -248,12 +248,12 @@ t_model* free_arch_model(t_model* model) {
248
248
while (vptr) {
249
249
vtr::t_linked_vptr* vptr_prev = vptr;
250
250
vptr = vptr->next ;
251
- delete vptr_prev;
251
+ vtr::free ( vptr_prev) ;
252
252
}
253
253
254
254
if (model->instances )
255
255
vtr::free (model->instances );
256
- delete model->name ;
256
+ vtr::free ( model->name ) ;
257
257
delete model;
258
258
259
259
return next_model;
@@ -273,24 +273,24 @@ t_model_ports* free_arch_model_port(t_model_ports* model_port) {
273
273
274
274
t_model_ports* next_port = model_port->next ;
275
275
276
- delete model_port->name ;
276
+ vtr::free ( model_port->name ) ;
277
277
delete model_port;
278
278
279
279
return next_port;
280
280
}
281
281
282
282
void free_type_descriptors (std::vector<t_physical_tile_type>& type_descriptors) {
283
283
for (auto & type : type_descriptors) {
284
- delete type.name ;
284
+ vtr::free ( type.name ) ;
285
285
if (type.index == EMPTY_TYPE_INDEX) {
286
286
continue ;
287
287
}
288
288
289
289
for (auto & sub_tile : type.sub_tiles ) {
290
- delete sub_tile.name ;
290
+ vtr::free ( sub_tile.name ) ;
291
291
292
292
for (auto port : sub_tile.ports ) {
293
- delete port.name ;
293
+ vtr::free ( port.name ) ;
294
294
}
295
295
}
296
296
}
@@ -301,7 +301,7 @@ void free_type_descriptors(std::vector<t_logical_block_type>& type_descriptors)
301
301
free_all_pb_graph_nodes (type_descriptors);
302
302
303
303
for (auto & type : type_descriptors) {
304
- delete type.name ;
304
+ vtr::free ( type.name ) ;
305
305
if (type.index == EMPTY_TYPE_INDEX) {
306
306
continue ;
307
307
}
@@ -421,98 +421,98 @@ static void free_pb_graph(t_pb_graph_node* pb_graph_node) {
421
421
for (k = 0 ; k < pb_type->modes [i].pb_type_children [j].num_pb ; k++) {
422
422
free_pb_graph (&pb_graph_node->child_pb_graph_nodes [i][j][k]);
423
423
}
424
- delete pb_graph_node->child_pb_graph_nodes [i][j];
424
+ vtr::free ( pb_graph_node->child_pb_graph_nodes [i][j]) ;
425
425
}
426
- delete pb_graph_node->child_pb_graph_nodes [i];
426
+ vtr::free ( pb_graph_node->child_pb_graph_nodes [i]) ;
427
427
}
428
- delete pb_graph_node->child_pb_graph_nodes ;
428
+ vtr::free ( pb_graph_node->child_pb_graph_nodes ) ;
429
429
}
430
430
431
431
static void free_pb_type (t_pb_type* pb_type) {
432
- delete pb_type->name ;
432
+ vtr::free ( pb_type->name ) ;
433
433
if (pb_type->blif_model )
434
- delete pb_type->blif_model ;
434
+ vtr::free ( pb_type->blif_model ) ;
435
435
436
436
for (int i = 0 ; i < pb_type->num_modes ; ++i) {
437
437
for (int j = 0 ; j < pb_type->modes [i].num_pb_type_children ; ++j) {
438
438
free_pb_type (&pb_type->modes [i].pb_type_children [j]);
439
439
}
440
440
delete[] pb_type->modes [i].pb_type_children ;
441
- delete pb_type->modes [i].name ;
441
+ vtr::free ( pb_type->modes [i].name ) ;
442
442
for (int j = 0 ; j < pb_type->modes [i].num_interconnect ; ++j) {
443
- delete pb_type->modes [i].interconnect [j].input_string ;
444
- delete pb_type->modes [i].interconnect [j].output_string ;
445
- delete pb_type->modes [i].interconnect [j].name ;
443
+ vtr::free ( pb_type->modes [i].interconnect [j].input_string ) ;
444
+ vtr::free ( pb_type->modes [i].interconnect [j].output_string ) ;
445
+ vtr::free ( pb_type->modes [i].interconnect [j].name ) ;
446
446
447
447
for (int k = 0 ; k < pb_type->modes [i].interconnect [j].num_annotations ; ++k) {
448
448
if (pb_type->modes [i].interconnect [j].annotations [k].clock )
449
- delete pb_type->modes [i].interconnect [j].annotations [k].clock ;
449
+ vtr::free ( pb_type->modes [i].interconnect [j].annotations [k].clock ) ;
450
450
if (pb_type->modes [i].interconnect [j].annotations [k].input_pins ) {
451
- delete pb_type->modes [i].interconnect [j].annotations [k].input_pins ;
451
+ vtr::free ( pb_type->modes [i].interconnect [j].annotations [k].input_pins ) ;
452
452
}
453
453
if (pb_type->modes [i].interconnect [j].annotations [k].output_pins ) {
454
- delete pb_type->modes [i].interconnect [j].annotations [k].output_pins ;
454
+ vtr::free ( pb_type->modes [i].interconnect [j].annotations [k].output_pins ) ;
455
455
}
456
456
for (int m = 0 ; m < pb_type->modes [i].interconnect [j].annotations [k].num_value_prop_pairs ; ++m) {
457
- delete pb_type->modes [i].interconnect [j].annotations [k].value [m];
457
+ vtr::free ( pb_type->modes [i].interconnect [j].annotations [k].value [m]) ;
458
458
}
459
- delete pb_type->modes [i].interconnect [j].annotations [k].prop ;
460
- delete pb_type->modes [i].interconnect [j].annotations [k].value ;
459
+ vtr::free ( pb_type->modes [i].interconnect [j].annotations [k].prop ) ;
460
+ vtr::free ( pb_type->modes [i].interconnect [j].annotations [k].value ) ;
461
461
}
462
- delete pb_type->modes [i].interconnect [j].annotations ;
462
+ vtr::free ( pb_type->modes [i].interconnect [j].annotations ) ;
463
463
if (pb_type->modes [i].interconnect [j].interconnect_power )
464
- delete pb_type->modes [i].interconnect [j].interconnect_power ;
464
+ vtr::free ( pb_type->modes [i].interconnect [j].interconnect_power ) ;
465
465
}
466
466
if (pb_type->modes [i].interconnect )
467
467
delete[] pb_type->modes [i].interconnect ;
468
468
if (pb_type->modes [i].mode_power )
469
- delete pb_type->modes [i].mode_power ;
469
+ vtr::free ( pb_type->modes [i].mode_power ) ;
470
470
}
471
471
if (pb_type->modes )
472
472
delete[] pb_type->modes ;
473
473
474
474
for (int i = 0 ; i < pb_type->num_annotations ; ++i) {
475
475
for (int j = 0 ; j < pb_type->annotations [i].num_value_prop_pairs ; ++j) {
476
- delete pb_type->annotations [i].value [j];
476
+ vtr::free ( pb_type->annotations [i].value [j]) ;
477
477
}
478
- delete pb_type->annotations [i].value ;
479
- delete pb_type->annotations [i].prop ;
478
+ vtr::free ( pb_type->annotations [i].value ) ;
479
+ vtr::free ( pb_type->annotations [i].prop ) ;
480
480
if (pb_type->annotations [i].input_pins ) {
481
- delete pb_type->annotations [i].input_pins ;
481
+ vtr::free ( pb_type->annotations [i].input_pins ) ;
482
482
}
483
483
if (pb_type->annotations [i].output_pins ) {
484
- delete pb_type->annotations [i].output_pins ;
484
+ vtr::free ( pb_type->annotations [i].output_pins ) ;
485
485
}
486
486
if (pb_type->annotations [i].clock ) {
487
- delete pb_type->annotations [i].clock ;
487
+ vtr::free ( pb_type->annotations [i].clock ) ;
488
488
}
489
489
}
490
490
if (pb_type->num_annotations > 0 ) {
491
- delete pb_type->annotations ;
491
+ vtr::free ( pb_type->annotations ) ;
492
492
}
493
493
494
494
if (pb_type->pb_type_power ) {
495
- delete pb_type->pb_type_power ;
495
+ vtr::free ( pb_type->pb_type_power ) ;
496
496
}
497
497
498
498
for (int i = 0 ; i < pb_type->num_ports ; ++i) {
499
- delete pb_type->ports [i].name ;
499
+ vtr::free ( pb_type->ports [i].name ) ;
500
500
if (pb_type->class_type == LATCH_CLASS)
501
- delete pb_type->ports_sec [i].name ;
501
+ vtr::free ( pb_type->ports_sec [i].name ) ;
502
502
if (pb_type->ports [i].port_class ) {
503
- delete pb_type->ports [i].port_class ;
503
+ vtr::free ( pb_type->ports [i].port_class ) ;
504
504
if (pb_type->class_type == LATCH_CLASS)
505
- delete pb_type->ports_sec [i].port_class ;
505
+ vtr::free ( pb_type->ports_sec [i].port_class ) ;
506
506
}
507
507
if (pb_type->ports [i].port_power ) {
508
- delete pb_type->ports [i].port_power ;
508
+ vtr::free ( pb_type->ports [i].port_power ) ;
509
509
if (pb_type->class_type == LATCH_CLASS)
510
- delete pb_type->ports_sec [i].port_power ;
510
+ vtr::free ( pb_type->ports_sec [i].port_power ) ;
511
511
}
512
512
}
513
- delete pb_type->ports ;
513
+ vtr::free ( pb_type->ports ) ;
514
514
if (pb_type->class_type == LATCH_CLASS)
515
- delete pb_type->ports_sec ;
515
+ vtr::free ( pb_type->ports_sec ) ;
516
516
}
517
517
518
518
t_port* findPortByName (const char * name, t_pb_type* pb_type, int * high_index, int * low_index) {
@@ -809,22 +809,22 @@ void ProcessLutClass(t_pb_type* lut_pb_type) {
809
809
/* moved annotations to child so delete old annotations */
810
810
for (i = 0 ; i < lut_pb_type->num_annotations ; i++) {
811
811
for (j = 0 ; j < lut_pb_type->annotations [i].num_value_prop_pairs ; j++) {
812
- delete lut_pb_type->annotations [i].value [j];
812
+ free ( lut_pb_type->annotations [i].value [j]) ;
813
813
}
814
- delete lut_pb_type->annotations [i].value ;
815
- delete lut_pb_type->annotations [i].prop ;
814
+ free ( lut_pb_type->annotations [i].value ) ;
815
+ free ( lut_pb_type->annotations [i].prop ) ;
816
816
if (lut_pb_type->annotations [i].input_pins ) {
817
- delete lut_pb_type->annotations [i].input_pins ;
817
+ free ( lut_pb_type->annotations [i].input_pins ) ;
818
818
}
819
819
if (lut_pb_type->annotations [i].output_pins ) {
820
- delete lut_pb_type->annotations [i].output_pins ;
820
+ free ( lut_pb_type->annotations [i].output_pins ) ;
821
821
}
822
822
if (lut_pb_type->annotations [i].clock ) {
823
- delete lut_pb_type->annotations [i].clock ;
823
+ free ( lut_pb_type->annotations [i].clock ) ;
824
824
}
825
825
}
826
826
lut_pb_type->num_annotations = 0 ;
827
- delete lut_pb_type->annotations ;
827
+ free ( lut_pb_type->annotations ) ;
828
828
lut_pb_type->annotations = nullptr ;
829
829
lut_pb_type->modes [1 ].pb_type_children [0 ].depth = lut_pb_type->depth + 1 ;
830
830
lut_pb_type->modes [1 ].pb_type_children [0 ].parent_mode = &lut_pb_type->modes [1 ];
@@ -873,9 +873,9 @@ void ProcessLutClass(t_pb_type* lut_pb_type) {
873
873
lut_pb_type->modes [1 ].interconnect [1 ].parent_mode = &lut_pb_type->modes [1 ];
874
874
lut_pb_type->modes [1 ].interconnect [1 ].interconnect_power = (t_interconnect_power*)vtr::calloc (1 , sizeof (t_interconnect_power));
875
875
876
- delete default_name;
876
+ free ( default_name) ;
877
877
878
- delete lut_pb_type->blif_model ;
878
+ free ( lut_pb_type->blif_model ) ;
879
879
lut_pb_type->blif_model = nullptr ;
880
880
lut_pb_type->model = nullptr ;
881
881
}
@@ -924,7 +924,7 @@ void ProcessMemoryClass(t_pb_type* mem_pb_type) {
924
924
925
925
mem_pb_type->num_modes = 1 ;
926
926
927
- delete mem_pb_type->blif_model ;
927
+ free ( mem_pb_type->blif_model ) ;
928
928
mem_pb_type->blif_model = nullptr ;
929
929
mem_pb_type->model = nullptr ;
930
930
@@ -1043,7 +1043,7 @@ void ProcessMemoryClass(t_pb_type* mem_pb_type) {
1043
1043
1044
1044
mem_pb_type->modes [0 ].num_interconnect = i_inter;
1045
1045
1046
- delete default_name;
1046
+ free ( default_name) ;
1047
1047
}
1048
1048
1049
1049
e_power_estimation_method power_method_inherited (e_power_estimation_method parent_power_method) {
0 commit comments