diff options
author | Keith Rothman <537074+litghost@users.noreply.github.com> | 2021-03-25 17:11:06 -0700 |
---|---|---|
committer | Keith Rothman <537074+litghost@users.noreply.github.com> | 2021-03-25 17:56:11 -0700 |
commit | c8dccd3e7bec95c635ebe435c8454ffe10edd6f3 (patch) | |
tree | 3d73b20a24fab6cc57194247c2b1a31ea1fc4028 /fpga_interchange/site_arch.cc | |
parent | cc4f2b451613f2d7152e1d42d2e4d0d59887df1c (diff) | |
download | nextpnr-c8dccd3e7bec95c635ebe435c8454ffe10edd6f3.tar.gz nextpnr-c8dccd3e7bec95c635ebe435c8454ffe10edd6f3.tar.bz2 nextpnr-c8dccd3e7bec95c635ebe435c8454ffe10edd6f3.zip |
Implement debugging tools for site router.
- Finishes implementation of SiteArch::nameOfPip and SiteArch::nameOfWire
- Adds "explain_bel_status", which should be an exhaustive diagnostic
of the status of a BEL placement.
Signed-off-by: Keith Rothman <537074+litghost@users.noreply.github.com>
Diffstat (limited to 'fpga_interchange/site_arch.cc')
-rw-r--r-- | fpga_interchange/site_arch.cc | 46 |
1 files changed, 36 insertions, 10 deletions
diff --git a/fpga_interchange/site_arch.cc b/fpga_interchange/site_arch.cc index 711bef44..9cf7fa0c 100644 --- a/fpga_interchange/site_arch.cc +++ b/fpga_interchange/site_arch.cc @@ -59,6 +59,10 @@ bool SiteArch::bindPip(const SitePip &pip, SiteNetInfo *net) result.first->second.count += 1; } + if (debug()) { + log_info("Bound pip %s to wire %s\n", nameOfPip(pip), nameOfWire(dst)); + } + return true; } @@ -67,6 +71,10 @@ void SiteArch::unbindPip(const SitePip &pip) SiteWire src = getPipSrcWire(pip); SiteWire dst = getPipDstWire(pip); + if (debug()) { + log_info("Unbinding pip %s from wire %s\n", nameOfPip(pip), nameOfWire(dst)); + } + SiteNetInfo *src_net = unbindWire(src); SiteNetInfo *dst_net = unbindWire(dst); NPNR_ASSERT(src_net == dst_net); @@ -280,10 +288,16 @@ const char *SiteArch::nameOfWire(const SiteWire &wire) const return ctx->nameOfWire(wire.wire); case SiteWire::SITE_PORT_SOURCE: return ctx->nameOfWire(wire.wire); - case SiteWire::OUT_OF_SITE_SOURCE: - return "out of site source, implement me!"; - case SiteWire::OUT_OF_SITE_SINK: - return "out of site sink, implement me!"; + case SiteWire::OUT_OF_SITE_SOURCE: { + std::string &str = ctx->log_strs.next(); + str = stringf("Out of site source for net %s", wire.net->name.c_str(ctx)); + return str.c_str(); + } + case SiteWire::OUT_OF_SITE_SINK: { + std::string &str = ctx->log_strs.next(); + str = stringf("Out of sink source for net %s", wire.net->name.c_str(ctx)); + return str.c_str(); + } default: // Unreachable! NPNR_ASSERT(false); @@ -297,12 +311,24 @@ const char *SiteArch::nameOfPip(const SitePip &pip) const return ctx->nameOfPip(pip.pip); case SitePip::SITE_PORT: return ctx->nameOfPip(pip.pip); - case SitePip::SOURCE_TO_SITE_PORT: - return "source to site port, implement me!"; - case SitePip::SITE_PORT_TO_SINK: - return "site port to sink, implement me!"; - case SitePip::SITE_PORT_TO_SITE_PORT: - return "site port to site port, implement me!"; + case SitePip::SOURCE_TO_SITE_PORT: { + std::string &str = ctx->log_strs.next(); + str = stringf("Out of site source for net %s => %s", pip.wire.net->name.c_str(ctx), + ctx->nameOfWire(ctx->getPipSrcWire(pip.pip))); + return str.c_str(); + } + case SitePip::SITE_PORT_TO_SINK: { + std::string &str = ctx->log_strs.next(); + str = stringf("%s => Out of site sink for net %s", ctx->nameOfWire(ctx->getPipDstWire(pip.pip)), + pip.wire.net->name.c_str(ctx)); + return str.c_str(); + } + case SitePip::SITE_PORT_TO_SITE_PORT: { + std::string &str = ctx->log_strs.next(); + str = stringf("%s => %s", ctx->nameOfWire(ctx->getPipSrcWire(pip.pip)), + ctx->nameOfWire(ctx->getPipDstWire(pip.other_pip))); + return str.c_str(); + } default: // Unreachable! NPNR_ASSERT(false); |