From 2a0bb2be29a58017c31dd813cc061268abb292f8 Mon Sep 17 00:00:00 2001 From: David Shah Date: Sat, 29 Sep 2018 16:49:29 +0100 Subject: ecp5: Integrate global router and debug naming Signed-off-by: David Shah --- ecp5/arch.cc | 6 +++++- ecp5/globals.cc | 6 ++++-- 2 files changed, 9 insertions(+), 3 deletions(-) (limited to 'ecp5') diff --git a/ecp5/arch.cc b/ecp5/arch.cc index 3aa24aca..861aeef2 100644 --- a/ecp5/arch.cc +++ b/ecp5/arch.cc @@ -27,6 +27,7 @@ #include "placer1.h" #include "router1.h" #include "util.h" +#include "globals.h" NEXTPNR_NAMESPACE_BEGIN @@ -390,7 +391,10 @@ bool Arch::getBudgetOverride(const NetInfo *net_info, const PortRef &sink, delay bool Arch::place() { return placer1(getCtx(), Placer1Cfg(getCtx())); } -bool Arch::route() { return router1(getCtx(), Router1Cfg(getCtx())); } +bool Arch::route() { + route_ecp5_globals(getCtx()); + return router1(getCtx(), Router1Cfg(getCtx())); +} // ----------------------------------------------------------------------- diff --git a/ecp5/globals.cc b/ecp5/globals.cc index b68bed28..0c95cd23 100644 --- a/ecp5/globals.cc +++ b/ecp5/globals.cc @@ -52,7 +52,7 @@ class Ecp5GlobalRouter private: bool is_clock_port(const PortRef &user) { - if (user.cell->type == ctx->id("TRELLIS_LC") && user.port == ctx->id("CLK")) + if (user.cell->type == id_TRELLIS_SLICE && user.port == id_CLK) return true; return false; } @@ -67,6 +67,7 @@ class Ecp5GlobalRouter if (is_clock_port(user)) clockCount[ni->name]++; } + //log_info("clkcount %s: %d\n", ni->name.c_str(ctx),clockCount[ni->name]); } std::vector clocks; while (clocks.size() < 16) { @@ -187,7 +188,7 @@ class Ecp5GlobalRouter WireId get_global_wire(GlobalQuadrant quad, int network) { - return ctx->getWireByLocAndBasename(Location(0, 0), get_quad_name(quad) + "PCLK" + std::to_string(network)); + return ctx->getWireByLocAndBasename(Location(0, 0), "G_" + get_quad_name(quad) + "PCLK" + std::to_string(network)); } bool simple_router(NetInfo *net, WireId src, WireId dst, bool allow_fail = false) @@ -238,6 +239,7 @@ class Ecp5GlobalRouter glb_src = ctx->getNetinfoSourceWire(net); for (int quad = QUAD_UL; quad < QUAD_LR + 1; quad++) { WireId glb_dst = get_global_wire(GlobalQuadrant(quad), network); + NPNR_ASSERT(glb_dst != WireId()); bool routed = simple_router(net, glb_src, glb_dst); if (!routed) return false; -- cgit v1.2.3