ecp5: Improve global routing robustness

Signed-off-by: David Shah <dave@ds0.me>
This commit is contained in:
David Shah 2020-05-14 13:12:30 +01:00
parent 2aaef61547
commit 3c60ea383d

View File

@ -63,6 +63,13 @@ class Ecp5GlobalRouter
return false;
}
bool is_logic_port(const PortRef &user)
{
if (user.cell->type == id_TRELLIS_SLICE && user.port != id_CLK && user.port != id_WCK)
return true;
return false;
}
std::vector<NetInfo *> get_clocks()
{
std::unordered_map<IdString, int> clockCount;
@ -162,6 +169,8 @@ class Ecp5GlobalRouter
if (ctx->checkWireAvail(next)) {
for (auto pip : ctx->getPipsUphill(next)) {
WireId src = ctx->getPipSrcWire(pip);
if (backtrace.count(src))
continue;
backtrace[src] = pip;
upstream.push(src);
}
@ -414,6 +423,8 @@ class Ecp5GlobalRouter
keep_users.push_back(user);
} else if (net->driver.cell->type == id_EXTREFB && user.cell->type == id_DCUA) {
keep_users.push_back(user);
} else if (is_logic_port(user)) {
keep_users.push_back(user);
} else {
glbnet->users.push_back(user);
user.cell->ports.at(user.port).net = glbnet.get();