@@ -229,7 +229,7 @@ static std::string clustering_xml_interconnect_text(t_logical_block_type_ptr typ
229
229
if (prev_node == OPEN) {
230
230
/* No previous driver implies that this is either a top-level input pin or a primitive output pin */
231
231
const t_pb_graph_pin* cur_pin = pb_graph_pin_lookup_from_index_by_type.pb_gpin (type->index , inode);
232
- VTR_ASSERT (cur_pin->parent_node ->pb_type ->parent_mode == nullptr || (cur_pin->is_primitive_pin () && cur_pin->port ->type == OUT_PORT));
232
+ VTR_ASSERT (cur_pin->parent_node ->pb_type ->is_root () || (cur_pin->is_primitive_pin () && cur_pin->port ->type == OUT_PORT));
233
233
return clustering_xml_net_text (pb_route[inode].atom_net_id );
234
234
} else {
235
235
const t_pb_graph_pin* cur_pin = pb_graph_pin_lookup_from_index_by_type.pb_gpin (type->index , inode);
@@ -291,7 +291,7 @@ static void clustering_xml_open_block(pugi::xml_node& parent_node, t_logical_blo
291
291
for (j = 0 ; j < pb_type->ports [i].num_pins ; j++) {
292
292
const t_pb_graph_pin* pin = &pb_graph_node->output_pins [port_index][j];
293
293
node_index = pin->pin_count_in_cluster ;
294
- if (pb_type->num_modes > 0 && pb_route.count (node_index) && pb_route[node_index].atom_net_id ) {
294
+ if (! pb_type->is_primitive () && pb_route.count (node_index) && pb_route[node_index].atom_net_id ) {
295
295
prev_node = pb_route[node_index].driver_pb_pin_id ;
296
296
const t_pb_graph_pin* prev_pin = pb_graph_pin_lookup_from_index_by_type.pb_gpin (type->index , prev_node);
297
297
const t_pb_graph_edge* edge = get_edge_between_pins (prev_pin, pin);
@@ -330,7 +330,7 @@ static void clustering_xml_open_block(pugi::xml_node& parent_node, t_logical_blo
330
330
for (j = 0 ; j < pb_type->ports [i].num_pins ; j++) {
331
331
node_index = pb_graph_node->input_pins [port_index][j].pin_count_in_cluster ;
332
332
333
- if (pb_type->parent_mode == nullptr ) {
333
+ if (pb_type->is_root () ) {
334
334
pins.push_back (clustering_xml_net_text (pb_route[node_index].atom_net_id ));
335
335
} else {
336
336
pins.push_back (clustering_xml_interconnect_text (type, pb_graph_pin_lookup_from_index_by_type, node_index, pb_route));
@@ -371,7 +371,7 @@ static void clustering_xml_open_block(pugi::xml_node& parent_node, t_logical_blo
371
371
std::vector<std::string> pins;
372
372
for (j = 0 ; j < pb_type->ports [i].num_pins ; j++) {
373
373
node_index = pb_graph_node->clock_pins [port_index][j].pin_count_in_cluster ;
374
- if (pb_type->parent_mode == nullptr ) {
374
+ if (pb_type->is_root () ) {
375
375
pins.push_back (clustering_xml_net_text (pb_route[node_index].atom_net_id ));
376
376
} else {
377
377
pins.push_back (clustering_xml_interconnect_text (type, pb_graph_pin_lookup_from_index_by_type, node_index, pb_route));
@@ -382,7 +382,7 @@ static void clustering_xml_open_block(pugi::xml_node& parent_node, t_logical_blo
382
382
}
383
383
}
384
384
385
- if (pb_type->num_modes > 0 ) {
385
+ if (! pb_type->is_primitive () ) {
386
386
for (i = 0 ; i < mode->num_pb_type_children ; i++) {
387
387
child_pb_type = &mode->pb_type_children [i];
388
388
for (j = 0 ; j < mode->pb_type_children [i].num_pb ; j++) {
@@ -426,7 +426,7 @@ static void clustering_xml_block(pugi::xml_node& parent_node, t_logical_block_ty
426
426
block_node.append_attribute (" name" ) = pb->name ;
427
427
block_node.append_attribute (" instance" ) = vtr::string_fmt (" %s[%d]" , pb_type->name , pb_index).c_str ();
428
428
429
- if (pb_type->num_modes > 0 ) {
429
+ if (! pb_type->is_primitive () ) {
430
430
block_node.append_attribute (" mode" ) = mode->name ;
431
431
} else {
432
432
const auto & atom_ctx = g_vpr_ctx.atom ();
@@ -460,7 +460,7 @@ static void clustering_xml_block(pugi::xml_node& parent_node, t_logical_block_ty
460
460
for (j = 0 ; j < pb_type->ports [i].num_pins ; j++) {
461
461
node_index = pb->pb_graph_node ->input_pins [port_index][j].pin_count_in_cluster ;
462
462
463
- if (pb_type->parent_mode == nullptr ) {
463
+ if (pb_type->is_root () ) {
464
464
if (pb_route.count (node_index)) {
465
465
pins.push_back (clustering_xml_net_text (pb_route[node_index].atom_net_id ));
466
466
} else {
@@ -475,7 +475,7 @@ static void clustering_xml_block(pugi::xml_node& parent_node, t_logical_block_ty
475
475
// The cluster router may have rotated equivalent pins (e.g. LUT inputs),
476
476
// record the resulting rotation here so it can be unambigously mapped
477
477
// back to the atom netlist
478
- if (pb_type->ports [i].equivalent != PortEquivalence::NONE && pb_type->parent_mode != nullptr && pb_type->num_modes == 0 ) {
478
+ if (pb_type->ports [i].equivalent != PortEquivalence::NONE && pb_type->parent_mode != nullptr && pb_type->is_primitive () ) {
479
479
// This is a primitive with equivalent inputs
480
480
481
481
auto & atom_ctx = g_vpr_ctx.atom ();
@@ -560,7 +560,7 @@ static void clustering_xml_block(pugi::xml_node& parent_node, t_logical_block_ty
560
560
std::vector<std::string> pins;
561
561
for (j = 0 ; j < pb_type->ports [i].num_pins ; j++) {
562
562
node_index = pb->pb_graph_node ->clock_pins [port_index][j].pin_count_in_cluster ;
563
- if (pb_type->parent_mode == nullptr ) {
563
+ if (pb_type->is_root () ) {
564
564
if (pb_route.count (node_index)) {
565
565
pins.push_back (clustering_xml_net_text (pb_route[node_index].atom_net_id ));
566
566
} else {
@@ -575,7 +575,7 @@ static void clustering_xml_block(pugi::xml_node& parent_node, t_logical_block_ty
575
575
}
576
576
}
577
577
578
- if (pb_type->num_modes > 0 ) {
578
+ if (! pb_type->is_primitive () ) {
579
579
for (i = 0 ; i < mode->num_pb_type_children ; i++) {
580
580
for (j = 0 ; j < mode->pb_type_children [i].num_pb ; j++) {
581
581
/* If child pb is not used but routing is used, I must print things differently */
0 commit comments