Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

added bounds check for forced primitive site #2671

Merged
merged 1 commit into from
Aug 1, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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