diff options
author | David Shah <davey1576@gmail.com> | 2018-08-07 15:53:41 +0200 |
---|---|---|
committer | David Shah <davey1576@gmail.com> | 2018-09-29 16:09:21 +0100 |
commit | c8674652dc9ee7d28bc8ded1c0a9ac7a6e168176 (patch) | |
tree | d164bde857cd9eb5b7422dc878675ed924dd905e | |
parent | 24414614d2896b6cbb62457e90f5d997d9a1d32a (diff) | |
download | nextpnr-c8674652dc9ee7d28bc8ded1c0a9ac7a6e168176.tar.gz nextpnr-c8674652dc9ee7d28bc8ded1c0a9ac7a6e168176.tar.bz2 nextpnr-c8674652dc9ee7d28bc8ded1c0a9ac7a6e168176.zip |
ecp5: Add SPINE routing to global router
Signed-off-by: David Shah <davey1576@gmail.com>
-rw-r--r-- | ecp5/globals.cc | 18 |
1 files changed, 17 insertions, 1 deletions
diff --git a/ecp5/globals.cc b/ecp5/globals.cc index 3d7d7518..155d4ecb 100644 --- a/ecp5/globals.cc +++ b/ecp5/globals.cc @@ -98,6 +98,16 @@ class Ecp5GlobalRouter return *(ctx->getPipsUphill(tap_wire).begin()); } + PipId find_spine_pip(WireId tap_wire) + { + std::string wireName = ctx->getWireBasename(tap_wire).str(ctx); + Location spine_loc; + spine_loc.x = ctx->globalInfoAtLoc(tap_wire.location).spine_col; + spine_loc.y = ctx->globalInfoAtLoc(tap_wire.location).spine_row; + WireId spine_wire = ctx->getWireByLocAndBasename(spine_loc, wireName); + return *(ctx->getPipsUphill(spine_wire).begin()); + } + void route_logic_tile_global(NetInfo *net, int global_index, PortRef user) { WireId userWire = ctx->getBelPinWire(user.cell->bel, ctx->portPinFromId(user.port)); @@ -151,7 +161,13 @@ class Ecp5GlobalRouter NetInfo *tap_net = ctx->getBoundPipNet(tap_pip); if (tap_net == nullptr) { ctx->bindPip(tap_pip, net, STRENGTH_LOCKED); - // TODO: SPINE + PipId spine_pip = find_spine_pip(ctx->getPipSrcWire(tap_pip)); + NetInfo *spine_net = ctx->getBoundPipNet(spine_pip); + if (spine_net == nullptr) { + ctx->bindPip(spine_pip, net, STRENGTH_LOCKED); + } else { + NPNR_ASSERT(spine_net == net); + } } else { NPNR_ASSERT(tap_net == net); } |