@@ -162,10 +162,6 @@ void free_arch(t_arch* arch) {
162
162
163
163
vtr::free (arch->architecture_id );
164
164
165
- if (arch->clocks ) {
166
- delete[] arch->clocks ->clock_inf ;
167
- }
168
-
169
165
delete (arch->noc );
170
166
}
171
167
@@ -332,11 +328,7 @@ static void free_pb_type(t_pb_type* pb_type) {
332
328
if (pb_type->modes [i].interconnect [j].annotations [k].output_pins ) {
333
329
vtr::free (pb_type->modes [i].interconnect [j].annotations [k].output_pins );
334
330
}
335
- for (int m = 0 ; m < pb_type->modes [i].interconnect [j].annotations [k].num_value_prop_pairs ; ++m) {
336
- vtr::free (pb_type->modes [i].interconnect [j].annotations [k].value [m]);
337
- }
338
- delete[] pb_type->modes [i].interconnect [j].annotations [k].prop ;
339
- delete[] pb_type->modes [i].interconnect [j].annotations [k].value ;
331
+
340
332
}
341
333
delete[] pb_type->modes [i].interconnect [j].annotations ;
342
334
if (pb_type->modes [i].interconnect [j].interconnect_power )
@@ -351,11 +343,7 @@ static void free_pb_type(t_pb_type* pb_type) {
351
343
delete[] pb_type->modes ;
352
344
353
345
for (int i = 0 ; i < pb_type->num_annotations ; ++i) {
354
- for (int j = 0 ; j < pb_type->annotations [i].num_value_prop_pairs ; ++j) {
355
- vtr::free (pb_type->annotations [i].value [j]);
356
- }
357
- delete[] pb_type->annotations [i].value ;
358
- delete[] pb_type->annotations [i].prop ;
346
+
359
347
if (pb_type->annotations [i].input_pins ) {
360
348
vtr::free (pb_type->annotations [i].input_pins );
361
349
}
@@ -476,7 +464,7 @@ std::unordered_set<t_logical_block_type_ptr> get_equivalent_sites_set(t_physical
476
464
void alloc_and_load_default_child_for_pb_type (t_pb_type* pb_type,
477
465
char * new_name,
478
466
t_pb_type* copy) {
479
- int i, j ;
467
+ int i;
480
468
char * dot;
481
469
482
470
VTR_ASSERT (pb_type->blif_model != nullptr );
@@ -546,13 +534,7 @@ void alloc_and_load_default_child_for_pb_type(t_pb_type* pb_type,
546
534
copy->annotations [i].line_num = pb_type->annotations [i].line_num ;
547
535
copy->annotations [i].format = pb_type->annotations [i].format ;
548
536
copy->annotations [i].type = pb_type->annotations [i].type ;
549
- copy->annotations [i].num_value_prop_pairs = pb_type->annotations [i].num_value_prop_pairs ;
550
- copy->annotations [i].prop = new int [pb_type->annotations [i].num_value_prop_pairs ];
551
- copy->annotations [i].value = new char *[pb_type->annotations [i].num_value_prop_pairs ];
552
- for (j = 0 ; j < pb_type->annotations [i].num_value_prop_pairs ; j++) {
553
- copy->annotations [i].prop [j] = pb_type->annotations [i].prop [j];
554
- copy->annotations [i].value [j] = vtr::strdup (pb_type->annotations [i].value [j]);
555
- }
537
+ copy->annotations [i].pairs = pb_type->annotations [i].pairs ;
556
538
}
557
539
}
558
540
@@ -561,7 +543,7 @@ void ProcessLutClass(t_pb_type* lut_pb_type) {
561
543
char * default_name;
562
544
t_port* in_port;
563
545
t_port* out_port;
564
- int i, j ;
546
+ int i;
565
547
566
548
if (strcmp (lut_pb_type->name , " lut" ) != 0 ) {
567
549
default_name = vtr::strdup (" lut" );
@@ -622,13 +604,8 @@ void ProcessLutClass(t_pb_type* lut_pb_type) {
622
604
lut_pb_type->modes [0 ].interconnect [0 ].annotations [i].line_num = lut_pb_type->annotations [i].line_num ;
623
605
lut_pb_type->modes [0 ].interconnect [0 ].annotations [i].format = lut_pb_type->annotations [i].format ;
624
606
lut_pb_type->modes [0 ].interconnect [0 ].annotations [i].type = lut_pb_type->annotations [i].type ;
625
- lut_pb_type->modes [0 ].interconnect [0 ].annotations [i].num_value_prop_pairs = lut_pb_type->annotations [i].num_value_prop_pairs ;
626
- lut_pb_type->modes [0 ].interconnect [0 ].annotations [i].prop = new int [lut_pb_type->annotations [i].num_value_prop_pairs ];
627
- lut_pb_type->modes [0 ].interconnect [0 ].annotations [i].value = new char *[lut_pb_type->annotations [i].num_value_prop_pairs ];
628
- for (j = 0 ; j < lut_pb_type->annotations [i].num_value_prop_pairs ; j++) {
629
- lut_pb_type->modes [0 ].interconnect [0 ].annotations [i].prop [j] = lut_pb_type->annotations [i].prop [j];
630
- lut_pb_type->modes [0 ].interconnect [0 ].annotations [i].value [j] = vtr::strdup (lut_pb_type->annotations [i].value [j]);
631
- }
607
+
608
+ lut_pb_type->modes [0 ].interconnect [0 ].annotations [i].pairs = lut_pb_type->annotations [i].pairs ;
632
609
}
633
610
634
611
/* Second mode, LUT */
@@ -643,11 +620,6 @@ void ProcessLutClass(t_pb_type* lut_pb_type) {
643
620
lut_pb_type->modes [1 ].pb_type_children );
644
621
/* moved annotations to child so delete old annotations */
645
622
for (i = 0 ; i < lut_pb_type->num_annotations ; i++) {
646
- for (j = 0 ; j < lut_pb_type->annotations [i].num_value_prop_pairs ; j++) {
647
- vtr::free (lut_pb_type->annotations [i].value [j]);
648
- }
649
- delete[] lut_pb_type->annotations [i].value ;
650
- delete[] lut_pb_type->annotations [i].prop ;
651
623
if (lut_pb_type->annotations [i].input_pins ) {
652
624
vtr::free (lut_pb_type->annotations [i].input_pins );
653
625
}
@@ -1099,8 +1071,8 @@ const t_pin_to_pin_annotation* find_sequential_annotation(const t_pb_type* pb_ty
1099
1071
const t_pin_to_pin_annotation* annot = &pb_type->annotations [iannot];
1100
1072
InstPort annot_in (annot->input_pins );
1101
1073
if (annot_in.port_name () == port->name ) {
1102
- for (int iprop = 0 ; iprop < annot->num_value_prop_pairs ; ++iprop) {
1103
- if (annot->prop [iprop] == annot_type) {
1074
+ for (size_t iprop = 0 ; iprop < annot->pairs . size () ; ++iprop) {
1075
+ if (annot->pairs [iprop]. first == annot_type) {
1104
1076
return annot;
1105
1077
}
1106
1078
}
@@ -1118,9 +1090,9 @@ const t_pin_to_pin_annotation* find_combinational_annotation(const t_pb_type* pb
1118
1090
for (const auto & annot_out_str : vtr::split (annot->output_pins )) {
1119
1091
InstPort out_pins (annot_out_str);
1120
1092
if (in_pins.port_name () == in_port && out_pins.port_name () == out_port) {
1121
- for (int iprop = 0 ; iprop < annot->num_value_prop_pairs ; ++iprop) {
1122
- if (annot->prop [iprop] == E_ANNOT_PIN_TO_PIN_DELAY_MAX
1123
- || annot->prop [iprop] == E_ANNOT_PIN_TO_PIN_DELAY_MIN) {
1093
+ for (size_t iprop = 0 ; iprop < annot->pairs . size () ; ++iprop) {
1094
+ if (annot->pairs [iprop]. first == E_ANNOT_PIN_TO_PIN_DELAY_MAX
1095
+ || annot->pairs [iprop]. first == E_ANNOT_PIN_TO_PIN_DELAY_MIN) {
1124
1096
return annot;
1125
1097
}
1126
1098
}
0 commit comments