diff options
-rw-r--r-- | fpga_interchange/site_router.cc | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/fpga_interchange/site_router.cc b/fpga_interchange/site_router.cc index 962acc4b..8870fa32 100644 --- a/fpga_interchange/site_router.cc +++ b/fpga_interchange/site_router.cc @@ -376,12 +376,16 @@ bool test_solution(SiteArch *ctx, SiteNetInfo *net, std::vector<SitePip>::const_ { bool valid = true; std::vector<SitePip>::const_iterator good_pip_end = pips_begin; - for (auto iter = pips_begin; iter != pips_end; ++iter) { - if (!ctx->bindPip(*iter, net)) { + std::vector<SitePip>::const_iterator iter = pips_begin; + SitePip pip; + while (iter != pips_end) { + pip = *iter; + if (!ctx->bindPip(pip, net)) { valid = false; break; } + ++iter; good_pip_end = iter; } @@ -391,7 +395,7 @@ bool test_solution(SiteArch *ctx, SiteNetInfo *net, std::vector<SitePip>::const_ ctx->unbindPip(*iter); } } else { - NPNR_ASSERT(net->driver == ctx->getPipSrcWire(*good_pip_end)); + NPNR_ASSERT(net->driver == ctx->getPipSrcWire(pip)); } return valid; |