Skip to content

Commit

Permalink
Merge pull request #2671 from verilog-to-routing/force_site_bounds_check
Browse files Browse the repository at this point in the history
added bounds check for forced primitive site
  • Loading branch information
vaughnbetz authored Aug 1, 2024
2 parents 6405610 + 0865f01 commit b2cf268
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion vpr/src/pack/cluster_placement.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -140,9 +140,15 @@ bool get_next_primitive_list(t_cluster_placement_stats* cluster_placement_stats,
continue;
}


/* check for force site match, if applicable */
if (force_site > -1) {
/* check that the forced site index is within the available range */
int max_site = it->second->pb_graph_node->total_primitive_count - 1;
if (force_site > max_site) {
VTR_LOG("The specified primitive site (%d) is out of range (max %d)\n",
force_site, max_site);
break;
}
if (force_site == it->second->pb_graph_node->flat_site_index) {
cost = try_place_molecule(molecule, it->second->pb_graph_node, primitives_list);
if (cost < HUGE_POSITIVE_FLOAT) {
Expand Down

0 comments on commit b2cf268

Please sign in to comment.