@@ -146,7 +146,9 @@ int InstPort::num_pins() const {
146146}
147147
148148void free_arch (t_arch* arch) {
149- if (arch == nullptr ) { return ; }
149+ if (arch == nullptr ) {
150+ return ;
151+ }
150152
151153 delete[] arch->Switches ;
152154 arch->Switches = nullptr ;
@@ -192,7 +194,9 @@ void free_arch(t_arch* arch) {
192194 delete[] arch->model_library ;
193195 }
194196
195- if (arch->clocks ) { vtr::free (arch->clocks ->clock_inf ); }
197+ if (arch->clocks ) {
198+ vtr::free (arch->clocks ->clock_inf );
199+ }
196200
197201 delete (arch->noc );
198202}
@@ -207,7 +211,8 @@ void free_arch_models(t_model* models) {
207211
208212// Frees the specified model, and returns the next model (if any) in the linked list
209213t_model* free_arch_model (t_model* model) {
210- if (!model) return nullptr ;
214+ if (!model)
215+ return nullptr ;
211216
212217 t_model* next_model = model->next ;
213218
@@ -221,7 +226,8 @@ t_model* free_arch_model(t_model* model) {
221226 vtr::free (vptr_prev);
222227 }
223228
224- if (model->instances ) vtr::free (model->instances );
229+ if (model->instances )
230+ vtr::free (model->instances );
225231 vtr::free (model->name );
226232 delete model;
227233
@@ -238,7 +244,8 @@ void free_arch_model_ports(t_model_ports* model_ports) {
238244
239245// Frees the specified model_port, and returns the next model_port (if any) in the linked list
240246t_model_ports* free_arch_model_port (t_model_ports* model_port) {
241- if (!model_port) return nullptr ;
247+ if (!model_port)
248+ return nullptr ;
242249
243250 t_model_ports* next_port = model_port->next ;
244251
@@ -251,7 +258,9 @@ t_model_ports* free_arch_model_port(t_model_ports* model_port) {
251258void free_type_descriptors (std::vector<t_physical_tile_type>& type_descriptors) {
252259 for (auto & type : type_descriptors) {
253260 vtr::free (type.name );
254- if (type.index == EMPTY_TYPE_INDEX) { continue ; }
261+ if (type.index == EMPTY_TYPE_INDEX) {
262+ continue ;
263+ }
255264
256265 for (auto & sub_tile : type.sub_tiles ) {
257266 vtr::free (sub_tile.name );
@@ -269,7 +278,9 @@ void free_type_descriptors(std::vector<t_logical_block_type>& type_descriptors)
269278
270279 for (auto & type : type_descriptors) {
271280 vtr::free (type.name );
272- if (type.index == EMPTY_TYPE_INDEX) { continue ; }
281+ if (type.index == EMPTY_TYPE_INDEX) {
282+ continue ;
283+ }
273284
274285 free_pb_type (type.pb_type );
275286 delete type.pb_type ;
@@ -343,7 +354,8 @@ static void free_pb_graph(t_pb_graph_node* pb_graph_node) {
343354
344355 if (pb_graph_node->interconnect_pins ) {
345356 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 ;
347359
348360 t_mode* mode = &pb_graph_node->pb_type ->modes [i];
349361
@@ -383,7 +395,8 @@ static void free_pb_graph(t_pb_graph_node* pb_graph_node) {
383395
384396static void free_pb_type (t_pb_type* pb_type) {
385397 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 );
387400
388401 for (int i = 0 ; i < pb_type->num_modes ; ++i) {
389402 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) {
415428 if (pb_type->modes [i].interconnect [j].interconnect_power )
416429 vtr::free (pb_type->modes [i].interconnect [j].interconnect_power );
417430 }
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 );
420435 }
421- if (pb_type->modes ) delete[] pb_type->modes ;
436+ if (pb_type->modes )
437+ delete[] pb_type->modes ;
422438
423439 for (int i = 0 ; i < pb_type->num_annotations ; ++i) {
424440 for (int j = 0 ; j < pb_type->annotations [i].num_value_prop_pairs ; ++j) {
425441 vtr::free (pb_type->annotations [i].value [j]);
426442 }
427443 vtr::free (pb_type->annotations [i].value );
428444 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 );
432457 }
433- if (pb_type->num_annotations > 0 ) { vtr::free (pb_type->annotations ); }
434458
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+ }
436462
437463 for (int i = 0 ; i < pb_type->num_ports ; ++i) {
438464 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+ }
441471 }
442472 vtr::free (pb_type->ports );
443473}
@@ -462,7 +492,9 @@ t_port* findPortByName(const char* name, t_pb_type* pb_type, int* high_index, in
462492 break ;
463493 }
464494 }
465- if (i >= pb_type->num_ports ) { return nullptr ; }
495+ if (i >= pb_type->num_ports ) {
496+ return nullptr ;
497+ }
466498
467499 /* Get indices */
468500 if (strlen (name) > bracket_pos) {
@@ -702,9 +734,15 @@ void ProcessLutClass(t_pb_type* lut_pb_type) {
702734 }
703735 free (lut_pb_type->annotations [i].value );
704736 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+ }
708746 }
709747 lut_pb_type->num_annotations = 0 ;
710748 free (lut_pb_type->annotations );
@@ -1028,7 +1066,9 @@ void CreateModelLibrary(t_arch* arch) {
10281066
10291067void SyncModelsPbTypes (t_arch* arch, const std::vector<t_logical_block_type>& Types) {
10301068 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+ }
10321072 }
10331073}
10341074
@@ -1178,7 +1218,9 @@ void primitives_annotation_clock_match(t_pin_to_pin_annotation* annotation, t_pb
11781218const t_segment_inf* find_segment (const t_arch* arch, std::string name) {
11791219 for (size_t i = 0 ; i < (arch->Segments ).size (); ++i) {
11801220 const t_segment_inf* seg = &arch->Segments [i];
1181- if (seg->name == name) { return seg; }
1221+ if (seg->name == name) {
1222+ return seg;
1223+ }
11821224 }
11831225
11841226 return nullptr ;
@@ -1207,7 +1249,9 @@ bool block_type_contains_blif_model(t_logical_block_type_ptr type, const std::st
12071249
12081250// Returns true of a pb_type (or it's children) contain the specified blif model name
12091251bool 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+ }
12111255
12121256 if (pb_type->blif_model != nullptr ) {
12131257 // Leaf pb_type
@@ -1223,7 +1267,9 @@ bool pb_type_contains_blif_model(const t_pb_type* pb_type, const std::string& bl
12231267
12241268 for (int ichild = 0 ; ichild < mode->num_pb_type_children ; ++ichild) {
12251269 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+ }
12271273 }
12281274 }
12291275 }
@@ -1242,7 +1288,9 @@ const t_pin_to_pin_annotation* find_sequential_annotation(const t_pb_type* pb_ty
12421288 InstPort annot_in (annot->input_pins );
12431289 if (annot_in.port_name () == port->name ) {
12441290 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+ }
12461294 }
12471295 }
12481296 }
@@ -1277,7 +1325,8 @@ const t_pin_to_pin_annotation* find_combinational_annotation(const t_pb_type* pb
12771325void link_physical_logical_types (std::vector<t_physical_tile_type>& PhysicalTileTypes,
12781326 std::vector<t_logical_block_type>& LogicalBlockTypes) {
12791327 for (auto & physical_tile : PhysicalTileTypes) {
1280- if (physical_tile.index == EMPTY_TYPE_INDEX) continue ;
1328+ if (physical_tile.index == EMPTY_TYPE_INDEX)
1329+ continue ;
12811330
12821331 auto eq_sites_set = get_equivalent_sites_set (&physical_tile);
12831332 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
13071356 }
13081357
13091358 for (auto & logical_block : LogicalBlockTypes) {
1310- if (logical_block.index == EMPTY_TYPE_INDEX) continue ;
1359+ if (logical_block.index == EMPTY_TYPE_INDEX)
1360+ continue ;
13111361
13121362 auto & equivalent_tiles = logical_block.equivalent_tiles ;
13131363
@@ -1427,7 +1477,9 @@ void setup_pin_classes(t_physical_tile_type* type) {
14271477 // clock pins and other specified global ports are flaged as global
14281478 type->is_pin_global [pin_count] = port.is_clock || port.is_non_clock_global ;
14291479
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+ }
14311483
14321484 pin_count++;
14331485 }
@@ -1457,7 +1509,9 @@ void setup_pin_classes(t_physical_tile_type* type) {
14571509 // clock pins and other specified global ports are flaged as global
14581510 type->is_pin_global [pin_count] = port.is_clock || port.is_non_clock_global ;
14591511
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+ }
14611515
14621516 pin_count++;
14631517
0 commit comments