ecp5: Integrate global router and debug naming

Signed-off-by: David Shah <davey1576@gmail.com>
This commit is contained in:
David Shah 2018-09-29 16:49:29 +01:00
parent 4cd582478b
commit 2a0bb2be29
2 changed files with 9 additions and 3 deletions

View File

@ -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()));
}
// -----------------------------------------------------------------------

View File

@ -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<NetInfo *> 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;