@@ -146,7 +146,9 @@ int InstPort::num_pins() const {
146
146
}
147
147
148
148
void free_arch (t_arch* arch) {
149
- if (arch == nullptr ) { return ; }
149
+ if (arch == nullptr ) {
150
+ return ;
151
+ }
150
152
151
153
delete[] arch->Switches ;
152
154
arch->Switches = nullptr ;
@@ -192,7 +194,9 @@ void free_arch(t_arch* arch) {
192
194
delete[] arch->model_library ;
193
195
}
194
196
195
- if (arch->clocks ) { vtr::free (arch->clocks ->clock_inf ); }
197
+ if (arch->clocks ) {
198
+ vtr::free (arch->clocks ->clock_inf );
199
+ }
196
200
197
201
delete (arch->noc );
198
202
}
@@ -207,7 +211,8 @@ void free_arch_models(t_model* models) {
207
211
208
212
// Frees the specified model, and returns the next model (if any) in the linked list
209
213
t_model* free_arch_model (t_model* model) {
210
- if (!model) return nullptr ;
214
+ if (!model)
215
+ return nullptr ;
211
216
212
217
t_model* next_model = model->next ;
213
218
@@ -221,7 +226,8 @@ t_model* free_arch_model(t_model* model) {
221
226
vtr::free (vptr_prev);
222
227
}
223
228
224
- if (model->instances ) vtr::free (model->instances );
229
+ if (model->instances )
230
+ vtr::free (model->instances );
225
231
vtr::free (model->name );
226
232
delete model;
227
233
@@ -238,7 +244,8 @@ void free_arch_model_ports(t_model_ports* model_ports) {
238
244
239
245
// Frees the specified model_port, and returns the next model_port (if any) in the linked list
240
246
t_model_ports* free_arch_model_port (t_model_ports* model_port) {
241
- if (!model_port) return nullptr ;
247
+ if (!model_port)
248
+ return nullptr ;
242
249
243
250
t_model_ports* next_port = model_port->next ;
244
251
@@ -251,7 +258,9 @@ t_model_ports* free_arch_model_port(t_model_ports* model_port) {
251
258
void free_type_descriptors (std::vector<t_physical_tile_type>& type_descriptors) {
252
259
for (auto & type : type_descriptors) {
253
260
vtr::free (type.name );
254
- if (type.index == EMPTY_TYPE_INDEX) { continue ; }
261
+ if (type.index == EMPTY_TYPE_INDEX) {
262
+ continue ;
263
+ }
255
264
256
265
for (auto & sub_tile : type.sub_tiles ) {
257
266
vtr::free (sub_tile.name );
@@ -269,7 +278,9 @@ void free_type_descriptors(std::vector<t_logical_block_type>& type_descriptors)
269
278
270
279
for (auto & type : type_descriptors) {
271
280
vtr::free (type.name );
272
- if (type.index == EMPTY_TYPE_INDEX) { continue ; }
281
+ if (type.index == EMPTY_TYPE_INDEX) {
282
+ continue ;
283
+ }
273
284
274
285
free_pb_type (type.pb_type );
275
286
delete type.pb_type ;
@@ -343,7 +354,8 @@ static void free_pb_graph(t_pb_graph_node* pb_graph_node) {
343
354
344
355
if (pb_graph_node->interconnect_pins ) {
345
356
for (i = 0 ; i < pb_graph_node->pb_type ->num_modes ; i++) {
346
- if (pb_graph_node->interconnect_pins [i] == nullptr ) continue ;
357
+ if (pb_graph_node->interconnect_pins [i] == nullptr )
358
+ continue ;
347
359
348
360
t_mode* mode = &pb_graph_node->pb_type ->modes [i];
349
361
@@ -383,7 +395,8 @@ static void free_pb_graph(t_pb_graph_node* pb_graph_node) {
383
395
384
396
static void free_pb_type (t_pb_type* pb_type) {
385
397
vtr::free (pb_type->name );
386
- if (pb_type->blif_model ) vtr::free (pb_type->blif_model );
398
+ if (pb_type->blif_model )
399
+ vtr::free (pb_type->blif_model );
387
400
388
401
for (int i = 0 ; i < pb_type->num_modes ; ++i) {
389
402
for (int j = 0 ; j < pb_type->modes [i].num_pb_type_children ; ++j) {
@@ -415,29 +428,46 @@ static void free_pb_type(t_pb_type* pb_type) {
415
428
if (pb_type->modes [i].interconnect [j].interconnect_power )
416
429
vtr::free (pb_type->modes [i].interconnect [j].interconnect_power );
417
430
}
418
- if (pb_type->modes [i].interconnect ) delete[] pb_type->modes [i].interconnect ;
419
- if (pb_type->modes [i].mode_power ) vtr::free (pb_type->modes [i].mode_power );
431
+ if (pb_type->modes [i].interconnect )
432
+ delete[] pb_type->modes [i].interconnect ;
433
+ if (pb_type->modes [i].mode_power )
434
+ vtr::free (pb_type->modes [i].mode_power );
420
435
}
421
- if (pb_type->modes ) delete[] pb_type->modes ;
436
+ if (pb_type->modes )
437
+ delete[] pb_type->modes ;
422
438
423
439
for (int i = 0 ; i < pb_type->num_annotations ; ++i) {
424
440
for (int j = 0 ; j < pb_type->annotations [i].num_value_prop_pairs ; ++j) {
425
441
vtr::free (pb_type->annotations [i].value [j]);
426
442
}
427
443
vtr::free (pb_type->annotations [i].value );
428
444
vtr::free (pb_type->annotations [i].prop );
429
- if (pb_type->annotations [i].input_pins ) { vtr::free (pb_type->annotations [i].input_pins ); }
430
- if (pb_type->annotations [i].output_pins ) { vtr::free (pb_type->annotations [i].output_pins ); }
431
- if (pb_type->annotations [i].clock ) { vtr::free (pb_type->annotations [i].clock ); }
445
+ if (pb_type->annotations [i].input_pins ) {
446
+ vtr::free (pb_type->annotations [i].input_pins );
447
+ }
448
+ if (pb_type->annotations [i].output_pins ) {
449
+ vtr::free (pb_type->annotations [i].output_pins );
450
+ }
451
+ if (pb_type->annotations [i].clock ) {
452
+ vtr::free (pb_type->annotations [i].clock );
453
+ }
454
+ }
455
+ if (pb_type->num_annotations > 0 ) {
456
+ vtr::free (pb_type->annotations );
432
457
}
433
- if (pb_type->num_annotations > 0 ) { vtr::free (pb_type->annotations ); }
434
458
435
- if (pb_type->pb_type_power ) { vtr::free (pb_type->pb_type_power ); }
459
+ if (pb_type->pb_type_power ) {
460
+ vtr::free (pb_type->pb_type_power );
461
+ }
436
462
437
463
for (int i = 0 ; i < pb_type->num_ports ; ++i) {
438
464
vtr::free (pb_type->ports [i].name );
439
- if (pb_type->ports [i].port_class ) { vtr::free (pb_type->ports [i].port_class ); }
440
- if (pb_type->ports [i].port_power ) { vtr::free (pb_type->ports [i].port_power ); }
465
+ if (pb_type->ports [i].port_class ) {
466
+ vtr::free (pb_type->ports [i].port_class );
467
+ }
468
+ if (pb_type->ports [i].port_power ) {
469
+ vtr::free (pb_type->ports [i].port_power );
470
+ }
441
471
}
442
472
vtr::free (pb_type->ports );
443
473
}
@@ -462,7 +492,9 @@ t_port* findPortByName(const char* name, t_pb_type* pb_type, int* high_index, in
462
492
break ;
463
493
}
464
494
}
465
- if (i >= pb_type->num_ports ) { return nullptr ; }
495
+ if (i >= pb_type->num_ports ) {
496
+ return nullptr ;
497
+ }
466
498
467
499
/* Get indices */
468
500
if (strlen (name) > bracket_pos) {
@@ -702,9 +734,15 @@ void ProcessLutClass(t_pb_type* lut_pb_type) {
702
734
}
703
735
free (lut_pb_type->annotations [i].value );
704
736
free (lut_pb_type->annotations [i].prop );
705
- if (lut_pb_type->annotations [i].input_pins ) { free (lut_pb_type->annotations [i].input_pins ); }
706
- if (lut_pb_type->annotations [i].output_pins ) { free (lut_pb_type->annotations [i].output_pins ); }
707
- if (lut_pb_type->annotations [i].clock ) { free (lut_pb_type->annotations [i].clock ); }
737
+ if (lut_pb_type->annotations [i].input_pins ) {
738
+ free (lut_pb_type->annotations [i].input_pins );
739
+ }
740
+ if (lut_pb_type->annotations [i].output_pins ) {
741
+ free (lut_pb_type->annotations [i].output_pins );
742
+ }
743
+ if (lut_pb_type->annotations [i].clock ) {
744
+ free (lut_pb_type->annotations [i].clock );
745
+ }
708
746
}
709
747
lut_pb_type->num_annotations = 0 ;
710
748
free (lut_pb_type->annotations );
@@ -1028,7 +1066,9 @@ void CreateModelLibrary(t_arch* arch) {
1028
1066
1029
1067
void SyncModelsPbTypes (t_arch* arch, const std::vector<t_logical_block_type>& Types) {
1030
1068
for (auto & Type : Types) {
1031
- if (Type.pb_type != nullptr ) { SyncModelsPbTypes_rec (arch, Type.pb_type ); }
1069
+ if (Type.pb_type != nullptr ) {
1070
+ SyncModelsPbTypes_rec (arch, Type.pb_type );
1071
+ }
1032
1072
}
1033
1073
}
1034
1074
@@ -1178,7 +1218,9 @@ void primitives_annotation_clock_match(t_pin_to_pin_annotation* annotation, t_pb
1178
1218
const t_segment_inf* find_segment (const t_arch* arch, std::string name) {
1179
1219
for (size_t i = 0 ; i < (arch->Segments ).size (); ++i) {
1180
1220
const t_segment_inf* seg = &arch->Segments [i];
1181
- if (seg->name == name) { return seg; }
1221
+ if (seg->name == name) {
1222
+ return seg;
1223
+ }
1182
1224
}
1183
1225
1184
1226
return nullptr ;
@@ -1207,7 +1249,9 @@ bool block_type_contains_blif_model(t_logical_block_type_ptr type, const std::st
1207
1249
1208
1250
// Returns true of a pb_type (or it's children) contain the specified blif model name
1209
1251
bool pb_type_contains_blif_model (const t_pb_type* pb_type, const std::string& blif_model_name) {
1210
- if (!pb_type) { return false ; }
1252
+ if (!pb_type) {
1253
+ return false ;
1254
+ }
1211
1255
1212
1256
if (pb_type->blif_model != nullptr ) {
1213
1257
// Leaf pb_type
@@ -1223,7 +1267,9 @@ bool pb_type_contains_blif_model(const t_pb_type* pb_type, const std::string& bl
1223
1267
1224
1268
for (int ichild = 0 ; ichild < mode->num_pb_type_children ; ++ichild) {
1225
1269
const t_pb_type* pb_type_child = &mode->pb_type_children [ichild];
1226
- if (pb_type_contains_blif_model (pb_type_child, blif_model_name)) { return true ; }
1270
+ if (pb_type_contains_blif_model (pb_type_child, blif_model_name)) {
1271
+ return true ;
1272
+ }
1227
1273
}
1228
1274
}
1229
1275
}
@@ -1242,7 +1288,9 @@ const t_pin_to_pin_annotation* find_sequential_annotation(const t_pb_type* pb_ty
1242
1288
InstPort annot_in (annot->input_pins );
1243
1289
if (annot_in.port_name () == port->name ) {
1244
1290
for (int iprop = 0 ; iprop < annot->num_value_prop_pairs ; ++iprop) {
1245
- if (annot->prop [iprop] == annot_type) { return annot; }
1291
+ if (annot->prop [iprop] == annot_type) {
1292
+ return annot;
1293
+ }
1246
1294
}
1247
1295
}
1248
1296
}
@@ -1277,7 +1325,8 @@ const t_pin_to_pin_annotation* find_combinational_annotation(const t_pb_type* pb
1277
1325
void link_physical_logical_types (std::vector<t_physical_tile_type>& PhysicalTileTypes,
1278
1326
std::vector<t_logical_block_type>& LogicalBlockTypes) {
1279
1327
for (auto & physical_tile : PhysicalTileTypes) {
1280
- if (physical_tile.index == EMPTY_TYPE_INDEX) continue ;
1328
+ if (physical_tile.index == EMPTY_TYPE_INDEX)
1329
+ continue ;
1281
1330
1282
1331
auto eq_sites_set = get_equivalent_sites_set (&physical_tile);
1283
1332
auto equivalent_sites = std::vector<t_logical_block_type_ptr>(eq_sites_set.begin (), eq_sites_set.end ());
@@ -1307,7 +1356,8 @@ void link_physical_logical_types(std::vector<t_physical_tile_type>& PhysicalTile
1307
1356
}
1308
1357
1309
1358
for (auto & logical_block : LogicalBlockTypes) {
1310
- if (logical_block.index == EMPTY_TYPE_INDEX) continue ;
1359
+ if (logical_block.index == EMPTY_TYPE_INDEX)
1360
+ continue ;
1311
1361
1312
1362
auto & equivalent_tiles = logical_block.equivalent_tiles ;
1313
1363
@@ -1427,7 +1477,9 @@ void setup_pin_classes(t_physical_tile_type* type) {
1427
1477
// clock pins and other specified global ports are flaged as global
1428
1478
type->is_pin_global [pin_count] = port.is_clock || port.is_non_clock_global ;
1429
1479
1430
- if (port.is_clock ) { type->clock_pin_indices .push_back (pin_count); }
1480
+ if (port.is_clock ) {
1481
+ type->clock_pin_indices .push_back (pin_count);
1482
+ }
1431
1483
1432
1484
pin_count++;
1433
1485
}
@@ -1457,7 +1509,9 @@ void setup_pin_classes(t_physical_tile_type* type) {
1457
1509
// clock pins and other specified global ports are flaged as global
1458
1510
type->is_pin_global [pin_count] = port.is_clock || port.is_non_clock_global ;
1459
1511
1460
- if (port.is_clock ) { type->clock_pin_indices .push_back (pin_count); }
1512
+ if (port.is_clock ) {
1513
+ type->clock_pin_indices .push_back (pin_count);
1514
+ }
1461
1515
1462
1516
pin_count++;
1463
1517
0 commit comments