Skip to content

Commit 5cda635

Browse files
Change t_pb_type users to use helper functions
1 parent fc0d7c6 commit 5cda635

17 files changed

+51
-57
lines changed

libs/libarchfpga/src/arch_util.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -1077,7 +1077,7 @@ bool pb_type_contains_blif_model(const t_pb_type* pb_type, const std::string& bl
10771077

10781078
if (pb_type->blif_model != nullptr) {
10791079
//Leaf pb_type
1080-
VTR_ASSERT(pb_type->num_modes == 0);
1080+
VTR_ASSERT(pb_type->is_primitive());
10811081
if (blif_model_name == pb_type->blif_model
10821082
|| ".subckt " + blif_model_name == pb_type->blif_model) {
10831083
return true;

libs/libarchfpga/src/physical_types.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -1361,7 +1361,7 @@ class t_pb_graph_node {
13611361
t_interconnect_pins** interconnect_pins; /* [0..num_modes-1][0..num_interconnect_in_mode] */
13621362

13631363
// Returns true if this pb_graph_node represents a primitive type (primitives have 0 modes)
1364-
bool is_primitive() const { return this->pb_type->num_modes == 0; }
1364+
bool is_primitive() const { return this->pb_type->is_primitive(); }
13651365

13661366
// Returns true if this pb_graph_node represents a root graph node (ex. clb)
13671367
bool is_root() const { return this->parent_pb_graph_node == nullptr; }

libs/libarchfpga/src/read_xml_arch_file.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -1415,7 +1415,7 @@ static void ProcessPb_Type(pugi::xml_node Parent,
14151415
pb_type->pb_type_power->leakage_default_mode = 0;
14161416
int mode_idx = 0;
14171417

1418-
if (pb_type->num_modes == 0) {
1418+
if (pb_type->is_primitive()) {
14191419
/* The pb_type operates in an implied one mode */
14201420
pb_type->num_modes = 1;
14211421
pb_type->modes = new t_mode[pb_type->num_modes];

vpr/src/analytical_place/flat_placement_mass_calculator.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -68,7 +68,7 @@ static PrimitiveVector calc_pb_type_capacity(const t_pb_type* pb_type) {
6868
// capacities as if the pb could choose either one.
6969
PrimitiveVector capacity;
7070
// If this is a leaf / primitive, create the base PrimitiveVector capacity.
71-
if (pb_type->num_modes == 0) {
71+
if (pb_type->is_primitive()) {
7272
LogicalModelId model_id = pb_type->model_id;
7373
VTR_ASSERT(model_id.is_valid());
7474
capacity.add_val_to_dim(get_model_mass(model_id), (size_t)model_id);

vpr/src/base/netlist_walker.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -42,7 +42,7 @@ void NetlistWalker::walk_blocks(const t_pb_routes& top_pb_route, const t_pb* pb)
4242

4343
//Recurse
4444
const t_pb_type* pb_type = pb->pb_graph_node->pb_type;
45-
if (pb_type->num_modes > 0) {
45+
if (!pb_type->is_primitive()) {
4646
const t_mode* mode = &pb_type->modes[pb->mode];
4747
for (int i = 0; i < mode->num_pb_type_children; i++) {
4848
for (int j = 0; j < mode->pb_type_children[i].num_pb; j++) {

vpr/src/base/read_netlist.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -463,7 +463,7 @@ static void processPb(pugi::xml_node Parent, const ClusterBlockId index, t_pb* p
463463
VTR_ASSERT(clb_nlist->block_ports(index).size() == (unsigned)pb_type->num_ports);
464464
}
465465

466-
if (pb_type->num_modes == 0) {
466+
if (pb_type->is_primitive()) {
467467
/* A primitive type */
468468
AtomBlockId blk_id = atom_ctx.netlist().find_block(pb->name);
469469
if (!blk_id) {

vpr/src/draw/intra_logic_block.cpp

+14-19
Original file line numberDiff line numberDiff line change
@@ -202,8 +202,8 @@ static int draw_internal_find_max_lvl(const t_pb_type& pb_type) {
202202
t_mode mode;
203203
int max_levels = 0;
204204

205-
/* If no modes, we have reached the end of pb_graph */
206-
if (pb_type.num_modes == 0)
205+
/* If pb_type is a primitive, we have reached the end of pb_graph */
206+
if (pb_type.is_primitive())
207207
return (pb_type.depth);
208208

209209
for (i = 0; i < pb_type.num_modes; ++i) {
@@ -221,30 +221,25 @@ static int draw_internal_find_max_lvl(const t_pb_type& pb_type) {
221221
* calls helper function to compute bounding box values.
222222
*/
223223
static void draw_internal_load_coords(int type_descrip_index, t_pb_graph_node* pb_graph_node, float parent_width, float parent_height) {
224-
int i, j, k;
225-
t_pb_type* pb_type;
226-
int num_modes, num_children, num_pb;
227-
t_mode mode;
228224
float blk_width = 0.;
229225
float blk_height = 0.;
230226

231-
/* Get information about the pb_type */
232-
pb_type = pb_graph_node->pb_type;
233-
num_modes = pb_type->num_modes;
234-
235-
/* If no modes, we have reached the end of pb_graph */
236-
if (num_modes == 0)
227+
t_pb_type* pb_type = pb_graph_node->pb_type;
228+
int num_modes = pb_type->num_modes;
229+
/* If pb_type is primitive, we have reached the end of pb_graph */
230+
if (pb_type->is_primitive()) {
237231
return;
232+
}
238233

239-
for (i = 0; i < num_modes; ++i) {
240-
mode = pb_type->modes[i];
241-
num_children = mode.num_pb_type_children;
234+
for (int i = 0; i < num_modes; ++i) {
235+
t_mode mode = pb_type->modes[i];
236+
int num_children = mode.num_pb_type_children;
242237

243-
for (j = 0; j < num_children; ++j) {
238+
for (int j = 0; j < num_children; ++j) {
244239
/* Find the number of instances for each child pb_type. */
245-
num_pb = mode.pb_type_children[j].num_pb;
240+
int num_pb = mode.pb_type_children[j].num_pb;
246241

247-
for (k = 0; k < num_pb; ++k) {
242+
for (int k = 0; k < num_pb; ++k) {
248243
/* Compute bound box for block. Don't call if pb_type is root-level pb. */
249244
draw_internal_calc_coords(type_descrip_index,
250245
&pb_graph_node->child_pb_graph_nodes[i][j][k],
@@ -721,7 +716,7 @@ t_pb* highlight_sub_block_helper(const ClusterBlockId clb_index, t_pb* pb, const
721716
// and if pb is dud
722717
if (pb_type->depth + 1 > max_depth
723718
|| pb->child_pbs == nullptr
724-
|| pb_type->num_modes == 0) {
719+
|| pb_type->is_primitive()) {
725720
return nullptr;
726721
}
727722

vpr/src/pack/cluster_legalizer.cpp

+9-10
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ static void check_cluster_atom_blocks(t_pb* pb, std::unordered_set<AtomBlockId>&
6565
const AtomContext& atom_ctx = g_vpr_ctx.atom();
6666

6767
const t_pb_type* pb_type = pb->pb_graph_node->pb_type;
68-
if (pb_type->num_modes == 0) {
68+
if (pb_type->is_primitive()) {
6969
/* primitive */
7070
AtomBlockId blk_id = atom_pb_lookup.pb_atom(pb);
7171
if (blk_id) {
@@ -396,7 +396,7 @@ static bool primitive_memory_sibling_feasible(const AtomBlockId blk_id, const t_
396396
static bool primitive_feasible(const AtomBlockId blk_id, t_pb* cur_pb, const AtomPBBimap& atom_to_pb) {
397397
const t_pb_type* cur_pb_type = cur_pb->pb_graph_node->pb_type;
398398

399-
VTR_ASSERT(cur_pb_type->num_modes == 0); /* primitive */
399+
VTR_ASSERT(cur_pb_type->is_primitive()); /* primitive */
400400

401401
AtomBlockId cur_pb_blk_id = atom_to_pb.pb_atom(cur_pb);
402402
if (cur_pb_blk_id && cur_pb_blk_id != blk_id) {
@@ -511,9 +511,7 @@ try_place_atom_block_rec(const t_pb_graph_node* pb_graph_node,
511511
return e_block_pack_status::BLK_FAILED_FEASIBLE;
512512
}
513513

514-
bool is_primitive = (pb_type->num_modes == 0);
515-
516-
if (is_primitive) {
514+
if (pb_type->is_primitive()) {
517515
VTR_ASSERT(!atom_to_pb.pb_atom(pb)
518516
&& atom_to_pb.atom_pb(blk_id) == nullptr
519517
&& atom_cluster[blk_id] == LegalizationClusterId::INVALID());
@@ -576,7 +574,7 @@ static void reset_lookahead_pins_used(t_pb* cur_pb) {
576574
return; /* No pins used, no need to continue */
577575
}
578576

579-
if (pb_type->num_modes > 0 && cur_pb->name != nullptr) {
577+
if (!pb_type->is_primitive() && cur_pb->name != nullptr) {
580578
for (int i = 0; i < cur_pb->pb_graph_node->num_input_pin_class; i++) {
581579
cur_pb->pb_stats->lookahead_input_pins_used[i].clear();
582580
}
@@ -821,7 +819,7 @@ static void try_update_lookahead_pins_used(t_pb* cur_pb,
821819
const AtomPBBimap& atom_to_pb) {
822820
// run recursively till a leaf (primitive) pb block is reached
823821
const t_pb_type* pb_type = cur_pb->pb_graph_node->pb_type;
824-
if (pb_type->num_modes > 0 && cur_pb->name != nullptr) {
822+
if (!pb_type->is_primitive() && cur_pb->name != nullptr) {
825823
if (cur_pb->child_pbs != nullptr) {
826824
for (int i = 0; i < pb_type->modes[cur_pb->mode].num_pb_type_children; i++) {
827825
if (cur_pb->child_pbs[i] != nullptr) {
@@ -835,6 +833,7 @@ static void try_update_lookahead_pins_used(t_pb* cur_pb,
835833
// find if this child (primitive) pb block has an atom mapped to it,
836834
// if yes compute and mark lookahead pins used for that pb block
837835
AtomBlockId blk_id = atom_to_pb.pb_atom(cur_pb);
836+
// TODO: Primitive pb_types should have non-null blif_model. Shoud this be an assertion?
838837
if (pb_type->blif_model != nullptr && blk_id) {
839838
compute_and_mark_lookahead_pins_used(blk_id, atom_cluster, atom_to_pb);
840839
}
@@ -848,7 +847,7 @@ static void try_update_lookahead_pins_used(t_pb* cur_pb,
848847
static bool check_lookahead_pins_used(t_pb* cur_pb, t_ext_pin_util max_external_pin_util) {
849848
const t_pb_type* pb_type = cur_pb->pb_graph_node->pb_type;
850849

851-
if (pb_type->num_modes > 0 && cur_pb->name) {
850+
if (!pb_type->is_primitive() && cur_pb->name) {
852851
for (int i = 0; i < cur_pb->pb_graph_node->num_input_pin_class; i++) {
853852
size_t class_size = cur_pb->pb_graph_node->input_pin_class_size[i];
854853

@@ -1015,7 +1014,7 @@ static void revert_place_atom_block(const AtomBlockId blk_id,
10151014
static void commit_lookahead_pins_used(t_pb* cur_pb) {
10161015
const t_pb_type* pb_type = cur_pb->pb_graph_node->pb_type;
10171016

1018-
if (pb_type->num_modes > 0 && cur_pb->name) {
1017+
if (!pb_type->is_primitive() && cur_pb->name) {
10191018
for (int i = 0; i < cur_pb->pb_graph_node->num_input_pin_class; i++) {
10201019
VTR_ASSERT(cur_pb->pb_stats->lookahead_input_pins_used[i].size() <= (unsigned int)cur_pb->pb_graph_node->input_pin_class_size[i]);
10211020
for (size_t j = 0; j < cur_pb->pb_stats->lookahead_input_pins_used[i].size(); j++) {
@@ -1076,7 +1075,7 @@ static bool cleanup_pb(t_pb* pb) {
10761075
t_pb_type* pb_type = pb_child->pb_graph_node->pb_type;
10771076

10781077
/* Primitive, check occupancy */
1079-
if (pb_type->num_modes == 0) {
1078+
if (pb_type->is_primitive()) {
10801079
if (pb_child->name != nullptr) {
10811080
can_free = false;
10821081
}

vpr/src/pack/cluster_util.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -215,7 +215,7 @@ size_t update_pb_type_count(const t_pb* pb, std::map<t_pb_type*, int>& pb_type_c
215215

216216
pb_type_count[pb_type]++;
217217

218-
if (pb_type->num_modes > 0) {
218+
if (!pb_type->is_primitive()) {
219219
for (int i = 0; i < mode->num_pb_type_children; i++) {
220220
for (int j = 0; j < mode->pb_type_children[i].num_pb; j++) {
221221
if (pb->child_pbs[i] && pb->child_pbs[i][j].name) {
@@ -365,7 +365,7 @@ bool pb_used_for_blif_model(const t_pb* pb, const std::string& blif_model_name)
365365
}
366366
}
367367

368-
if (pb_type->num_modes > 0) {
368+
if (!pb_type->is_primitive()) {
369369
for (int i = 0; i < mode->num_pb_type_children; i++) {
370370
for (int j = 0; j < mode->pb_type_children[i].num_pb; j++) {
371371
if (pb->child_pbs[i] && pb->child_pbs[i][j].name) {

vpr/src/pack/lb_type_rr_graph.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -296,7 +296,7 @@ static void alloc_and_load_lb_type_rr_graph_for_pb_graph_node(const t_pb_graph_n
296296
parent_node = pb_graph_node->parent_pb_graph_node;
297297
int num_modes;
298298

299-
if (pb_type->num_modes == 0) {
299+
if (pb_type->is_primitive()) {
300300
/* This pb_graph_node is a terminating leaf node (primitive) */
301301

302302
/* alloc and load input pins that connect to sinks */

vpr/src/pack/output_clustering.cpp

+10-10
Original file line numberDiff line numberDiff line change
@@ -229,7 +229,7 @@ static std::string clustering_xml_interconnect_text(t_logical_block_type_ptr typ
229229
if (prev_node == OPEN) {
230230
/* No previous driver implies that this is either a top-level input pin or a primitive output pin */
231231
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));
233233
return clustering_xml_net_text(pb_route[inode].atom_net_id);
234234
} else {
235235
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
291291
for (j = 0; j < pb_type->ports[i].num_pins; j++) {
292292
const t_pb_graph_pin* pin = &pb_graph_node->output_pins[port_index][j];
293293
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) {
295295
prev_node = pb_route[node_index].driver_pb_pin_id;
296296
const t_pb_graph_pin* prev_pin = pb_graph_pin_lookup_from_index_by_type.pb_gpin(type->index, prev_node);
297297
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
330330
for (j = 0; j < pb_type->ports[i].num_pins; j++) {
331331
node_index = pb_graph_node->input_pins[port_index][j].pin_count_in_cluster;
332332

333-
if (pb_type->parent_mode == nullptr) {
333+
if (pb_type->is_root()) {
334334
pins.push_back(clustering_xml_net_text(pb_route[node_index].atom_net_id));
335335
} else {
336336
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
371371
std::vector<std::string> pins;
372372
for (j = 0; j < pb_type->ports[i].num_pins; j++) {
373373
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()) {
375375
pins.push_back(clustering_xml_net_text(pb_route[node_index].atom_net_id));
376376
} else {
377377
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
382382
}
383383
}
384384

385-
if (pb_type->num_modes > 0) {
385+
if (!pb_type->is_primitive()) {
386386
for (i = 0; i < mode->num_pb_type_children; i++) {
387387
child_pb_type = &mode->pb_type_children[i];
388388
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
426426
block_node.append_attribute("name") = pb->name;
427427
block_node.append_attribute("instance") = vtr::string_fmt("%s[%d]", pb_type->name, pb_index).c_str();
428428

429-
if (pb_type->num_modes > 0) {
429+
if (!pb_type->is_primitive()) {
430430
block_node.append_attribute("mode") = mode->name;
431431
} else {
432432
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
460460
for (j = 0; j < pb_type->ports[i].num_pins; j++) {
461461
node_index = pb->pb_graph_node->input_pins[port_index][j].pin_count_in_cluster;
462462

463-
if (pb_type->parent_mode == nullptr) {
463+
if (pb_type->is_root()) {
464464
if (pb_route.count(node_index)) {
465465
pins.push_back(clustering_xml_net_text(pb_route[node_index].atom_net_id));
466466
} else {
@@ -475,7 +475,7 @@ static void clustering_xml_block(pugi::xml_node& parent_node, t_logical_block_ty
475475
//The cluster router may have rotated equivalent pins (e.g. LUT inputs),
476476
//record the resulting rotation here so it can be unambigously mapped
477477
//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()) {
479479
//This is a primitive with equivalent inputs
480480

481481
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
560560
std::vector<std::string> pins;
561561
for (j = 0; j < pb_type->ports[i].num_pins; j++) {
562562
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()) {
564564
if (pb_route.count(node_index)) {
565565
pins.push_back(clustering_xml_net_text(pb_route[node_index].atom_net_id));
566566
} else {
@@ -575,7 +575,7 @@ static void clustering_xml_block(pugi::xml_node& parent_node, t_logical_block_ty
575575
}
576576
}
577577

578-
if (pb_type->num_modes > 0) {
578+
if (!pb_type->is_primitive()) {
579579
for (i = 0; i < mode->num_pb_type_children; i++) {
580580
for (j = 0; j < mode->pb_type_children[i].num_pb; j++) {
581581
/* If child pb is not used but routing is used, I must print things differently */

vpr/src/pack/pb_type_graph.cpp

+2-2
Original file line numberDiff line numberDiff line change
@@ -281,7 +281,7 @@ static void alloc_and_load_pb_graph(t_pb_graph_node* pb_graph_node,
281281
pb_graph_node->pin_num_range.low = pin_count_in_cluster;
282282
for (i = 0; i < pb_type->num_ports; i++) {
283283
if (pb_type->ports[i].model_port) {
284-
VTR_ASSERT(pb_type->num_modes == 0);
284+
VTR_ASSERT(pb_type->is_primitive());
285285
} else {
286286
VTR_ASSERT(pb_type->num_modes != 0 || pb_type->ports[i].is_clock);
287287
}
@@ -1645,7 +1645,7 @@ static void echo_pb_rec(const t_pb_graph_node* pb_graph_node, const int level, F
16451645
}
16461646
fprintf(fp, "\n");
16471647

1648-
if (pb_graph_node->pb_type->num_modes > 0) {
1648+
if (!pb_graph_node->pb_type->is_primitive()) {
16491649
print_tabs(fp, level);
16501650
fprintf(fp, "Children:\n");
16511651
}

vpr/src/pack/pb_type_graph_annotations.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ void load_pb_graph_pin_to_pin_annotations(t_pb_graph_node* pb_graph_node) {
4747
pb_type = pb_graph_node->pb_type;
4848

4949
/* Load primitive critical path delays */
50-
if (pb_type->num_modes == 0) {
50+
if (pb_type->is_primitive()) {
5151
annotations = pb_type->annotations;
5252
for (i = 0; i < pb_type->num_annotations; i++) {
5353
if (annotations[i].type == E_ANNOT_PIN_TO_PIN_DELAY) {

vpr/src/pack/prepack.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -726,7 +726,7 @@ static void backward_expand_pack_pattern_from_edge(const t_pb_graph_edge* expans
726726
// check if this input pin of the expansion edge has no driving pin
727727
if (expansion_edge->input_pins[i]->num_input_edges == 0) {
728728
// check if this input pin of the expansion edge belongs to a root block (i.e doesn't have a parent block)
729-
if (expansion_edge->input_pins[i]->parent_node->pb_type->parent_mode == nullptr) {
729+
if (expansion_edge->input_pins[i]->parent_node->pb_type->is_root()) {
730730
// This pack pattern extends to CLB (root pb block) input pin,
731731
// thus it extends across multiple logic blocks, treat as a chain
732732
packing_pattern.is_chain = true;

vpr/src/power/power_sizing.cpp

+1-1
Original file line numberDiff line numberDiff line change
@@ -312,7 +312,7 @@ static double power_count_transistors_pb_node(t_pb_graph_node* pb_node) {
312312
t_pb_type* pb_type = pb_node->pb_type;
313313

314314
/* Check if this is a leaf node, or whether it has children */
315-
if (pb_type->num_modes == 0) {
315+
if (pb_type->is_primitive()) {
316316
/* Leaf node */
317317
tc_interc_max = 0;
318318
tc_children_max = power_count_transistors_primitive(pb_type);

vpr/src/util/vpr_utils.cpp

+3-3
Original file line numberDiff line numberDiff line change
@@ -708,7 +708,7 @@ static bool pb_type_contains_blif_model(const t_pb_type* pb_type, const std::reg
708708

709709
if (pb_type->blif_model != nullptr) {
710710
//Leaf pb_type
711-
VTR_ASSERT(pb_type->num_modes == 0);
711+
VTR_ASSERT(pb_type->is_primitive());
712712
if (std::regex_match(pb_type->blif_model, blif_model_regex)) {
713713
return true;
714714
} else {
@@ -769,7 +769,7 @@ int get_max_nets_in_pb_type(const t_pb_type* pb_type) {
769769
}
770770
}
771771
}
772-
if (pb_type->parent_mode == nullptr) {
772+
if (pb_type->is_root()) {
773773
max_nets += pb_type->num_input_pins + pb_type->num_output_pins
774774
+ pb_type->num_clock_pins;
775775
}
@@ -1169,7 +1169,7 @@ static void load_pin_id_to_pb_mapping_rec(t_pb* cur_pb, t_pb** pin_id_to_pb_mapp
11691169
}
11701170
}
11711171

1172-
if (pb_type->num_modes == 0 || cur_pb->child_pbs == nullptr) {
1172+
if (pb_type->is_primitive() || cur_pb->child_pbs == nullptr) {
11731173
return;
11741174
}
11751175

0 commit comments

Comments
 (0)