ecp5: Integrate global router and debug naming
Signed-off-by: David Shah <davey1576@gmail.com>
This commit is contained in:
parent
4cd582478b
commit
2a0bb2be29
@ -27,6 +27,7 @@
|
|||||||
#include "placer1.h"
|
#include "placer1.h"
|
||||||
#include "router1.h"
|
#include "router1.h"
|
||||||
#include "util.h"
|
#include "util.h"
|
||||||
|
#include "globals.h"
|
||||||
|
|
||||||
NEXTPNR_NAMESPACE_BEGIN
|
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::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()));
|
||||||
|
}
|
||||||
|
|
||||||
// -----------------------------------------------------------------------
|
// -----------------------------------------------------------------------
|
||||||
|
|
||||||
|
@ -52,7 +52,7 @@ class Ecp5GlobalRouter
|
|||||||
private:
|
private:
|
||||||
bool is_clock_port(const PortRef &user)
|
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 true;
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@ -67,6 +67,7 @@ class Ecp5GlobalRouter
|
|||||||
if (is_clock_port(user))
|
if (is_clock_port(user))
|
||||||
clockCount[ni->name]++;
|
clockCount[ni->name]++;
|
||||||
}
|
}
|
||||||
|
//log_info("clkcount %s: %d\n", ni->name.c_str(ctx),clockCount[ni->name]);
|
||||||
}
|
}
|
||||||
std::vector<NetInfo *> clocks;
|
std::vector<NetInfo *> clocks;
|
||||||
while (clocks.size() < 16) {
|
while (clocks.size() < 16) {
|
||||||
@ -187,7 +188,7 @@ class Ecp5GlobalRouter
|
|||||||
|
|
||||||
WireId get_global_wire(GlobalQuadrant quad, int network)
|
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)
|
bool simple_router(NetInfo *net, WireId src, WireId dst, bool allow_fail = false)
|
||||||
@ -238,6 +239,7 @@ class Ecp5GlobalRouter
|
|||||||
glb_src = ctx->getNetinfoSourceWire(net);
|
glb_src = ctx->getNetinfoSourceWire(net);
|
||||||
for (int quad = QUAD_UL; quad < QUAD_LR + 1; quad++) {
|
for (int quad = QUAD_UL; quad < QUAD_LR + 1; quad++) {
|
||||||
WireId glb_dst = get_global_wire(GlobalQuadrant(quad), network);
|
WireId glb_dst = get_global_wire(GlobalQuadrant(quad), network);
|
||||||
|
NPNR_ASSERT(glb_dst != WireId());
|
||||||
bool routed = simple_router(net, glb_src, glb_dst);
|
bool routed = simple_router(net, glb_src, glb_dst);
|
||||||
if (!routed)
|
if (!routed)
|
||||||
return false;
|
return false;
|
||||||
|
Loading…
Reference in New Issue
Block a user