Skip to content

Commit e2b9e2d

Browse files
mkurc-antkmurray
authored andcommitted
Fixed placement cost computation when there are zero-capacity channels in the graph.
Signed-off-by: Maciej Kurc <[email protected]>
1 parent daf46b8 commit e2b9e2d

File tree

1 file changed

+10
-0
lines changed

1 file changed

+10
-0
lines changed

vpr/src/place/place.cpp

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2348,6 +2348,11 @@ static void alloc_and_load_for_fast_cost_update(float place_cost_exp) {
23482348

23492349
for (size_t high = 0; high < device_ctx.grid.height(); high++)
23502350
for (size_t low = 0; low <= high; low++) {
2351+
if (chanx_place_cost_fac[high][low] == 0.0f) {
2352+
VTR_LOG_WARN("CHANX place cost fac is 0 at %d %d\n", high, low);
2353+
chanx_place_cost_fac[high][low] = 1.0f;
2354+
}
2355+
23512356
chanx_place_cost_fac[high][low] = (high - low + 1.)
23522357
/ chanx_place_cost_fac[high][low];
23532358
chanx_place_cost_fac[high][low] = pow((double)chanx_place_cost_fac[high][low], (double)place_cost_exp);
@@ -2370,6 +2375,11 @@ static void alloc_and_load_for_fast_cost_update(float place_cost_exp) {
23702375

23712376
for (size_t high = 0; high < device_ctx.grid.width(); high++)
23722377
for (size_t low = 0; low <= high; low++) {
2378+
if (chany_place_cost_fac[high][low] == 0.0f) {
2379+
VTR_LOG_WARN("CHANY place cost fac is 0 at %d %d\n", high, low);
2380+
chany_place_cost_fac[high][low] = 1.0f;
2381+
}
2382+
23732383
chany_place_cost_fac[high][low] = (high - low + 1.)
23742384
/ chany_place_cost_fac[high][low];
23752385
chany_place_cost_fac[high][low] = pow((double)chany_place_cost_fac[high][low], (double)place_cost_exp);

0 commit comments

Comments
 (0)