Skip to content

Commit 15f6997

Browse files
committed
vpr: pack: use second primitive_type_feasible() check
Signed-off-by: Pawel Czarnecki <pczarnecki@antmicro.com>
1 parent ab49f26 commit 15f6997

File tree

4 files changed

+15
-16
lines changed

4 files changed

+15
-16
lines changed

vpr/src/pack/cluster_placement.cpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,7 @@ bool get_next_primitive_list(t_cluster_placement_stats* cluster_placement_stats,
138138
continue; /* no more primitives of this type available */
139139
}
140140
if (primitive_type_feasible(molecule->atom_block_ids[molecule->root],
141-
cluster_placement_stats->valid_primitives[i]->next_primitive->pb_graph_node->pb_type)) {
141+
cluster_placement_stats->valid_primitives[i]->next_primitive->pb_graph_node)) {
142142
prev = cluster_placement_stats->valid_primitives[i];
143143
cur = cluster_placement_stats->valid_primitives[i]->next_primitive;
144144
while (cur) {
@@ -397,7 +397,7 @@ static float try_place_molecule(const t_pack_molecule* molecule,
397397
list_size = get_array_size_of_molecule(molecule);
398398

399399
if (primitive_type_feasible(molecule->atom_block_ids[molecule->root],
400-
root->pb_type)) {
400+
root)) {
401401
if (root->cluster_placement_primitive->valid == true) {
402402
for (i = 0; i < list_size; i++) {
403403
primitives_list[i] = nullptr;

vpr/src/pack/cluster_util.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -631,7 +631,7 @@ bool primitive_feasible(const AtomBlockId blk_id, t_pb* cur_pb) {
631631
}
632632

633633
//Generic feasibility check
634-
return primitive_type_feasible(blk_id, cur_pb_type);
634+
return primitive_type_feasible(blk_id, cur_pb->pb_graph_node);
635635
}
636636

637637
bool primitive_memory_sibling_feasible(const AtomBlockId blk_id, const t_pb_type* cur_pb_type, const AtomBlockId sibling_blk_id) {

vpr/src/pack/prepack.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1237,7 +1237,7 @@ static t_pb_graph_node* get_expected_lowest_cost_primitive_for_atom_block_in_pb_
12371237
}
12381238

12391239
if (curr_pb_graph_node->pb_type->blif_model != nullptr) {
1240-
if (primitive_type_feasible(blk_id, curr_pb_graph_node->pb_type)) {
1240+
if (primitive_type_feasible(blk_id, curr_pb_graph_node)) {
12411241
cur_cost = compute_primitive_base_cost(curr_pb_graph_node);
12421242
if (best_cost == UNDEFINED || best_cost > cur_cost) {
12431243
best_cost = cur_cost;

vpr/src/util/vpr_utils.cpp

Lines changed: 11 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -914,24 +914,23 @@ bool primitive_type_feasible(const AtomBlockId blk_id, t_pb_graph_node* curr_pb_
914914

915915
auto& atom_ctx = g_vpr_ctx.atom();
916916
if (cur_pb_type->model != atom_ctx.nlist.block_model(blk_id)) {
917-
if ((strcmp(atom_ctx.nlist.block_model(blk_id)->name, MODEL_LATCH) == 0) &&
918-
(strcmp(atom_ctx.nlist.block_model(blk_id)->name, cur_pb_type->model->name) == 0)) {
919-
/**
920-
* Special case for .latch: this model exists in 2 variations which are
921-
* defined one after another in linked list, check if the second variant match
922-
*/
917+
if ((strcmp(atom_ctx.nlist.block_model(blk_id)->name, MODEL_LATCH) == 0) && (strcmp(atom_ctx.nlist.block_model(blk_id)->name, cur_pb_type->model->name) == 0)) {
918+
/**
919+
* Special case for .latch: this model exists in 2 variations which are
920+
* defined one after another in linked list, check if the second variant match
921+
*/
923922

924923
if (cur_pb_type->model->next == atom_ctx.nlist.block_model(blk_id) && atom_ctx.nlist.block_model(blk_id)->inputs[1].trigg_edge == TriggeringEdge::FALLING_EDGE) {
925924
//Next primitive match atom - add secondary references
926925
if (!curr_pb_graph_node->has_secondary)
927-
curr_pb_graph_node->update_pins();
926+
curr_pb_graph_node->update_pins();
928927
} else {
929928
//Next primitive and atom do not match
930929
return false;
931930
}
932931
} else {
933-
//Primitive and atom do not match
934-
return false;
932+
//Primitive and atom do not match
933+
return false;
935934
}
936935
}
937936

@@ -948,10 +947,10 @@ bool primitive_type_feasible(const AtomBlockId blk_id, t_pb_graph_node* curr_pb_
948947
//as the atom requires
949948
for (int iport = 0; iport < cur_pb_type->num_ports; ++iport) {
950949
t_port* pb_port;
951-
if(curr_pb_graph_node->has_secondary)
952-
pb_port = &cur_pb_type->ports_sec[iport];
950+
if (curr_pb_graph_node->has_secondary)
951+
pb_port = &cur_pb_type->ports_sec[iport];
953952
else
954-
pb_port = &cur_pb_type->ports[iport];
953+
pb_port = &cur_pb_type->ports[iport];
955954

956955
const t_model_ports* pb_model_port = pb_port->model_port;
957956

0 commit comments

Comments
 (0)