This commit is contained in:
Adrian Parvin D. Ouano 2024-07-29 21:23:20 +08:00 committed by GitHub
commit 7cf6875844
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 18 additions and 1 deletions

View File

@ -1200,4 +1200,5 @@ X(HCLK_OUT3)
X(BUFG) X(BUFG)
X(CLOCK) X(CLOCK)
// Globally routed
X(GLOBALLY_ROUTED)

View File

@ -196,7 +196,10 @@ struct GowinGlobalRouter
} }
if (routed == NOT_ROUTED) { if (routed == NOT_ROUTED) {
ctx->unbindWire(src); ctx->unbindWire(src);
} else {
net->attrs[id_GLOBALLY_ROUTED] = Property("YES");
} }
return routed; return routed;
} }
@ -233,6 +236,8 @@ struct GowinGlobalRouter
} }
if (routed == NOT_ROUTED) { if (routed == NOT_ROUTED) {
ctx->unbindWire(src); ctx->unbindWire(src);
} else {
net->attrs[id_GLOBALLY_ROUTED] = Property("YES");
} }
// b) route net before buf from whatever to the buf input // b) route net before buf from whatever to the buf input

View File

@ -41,6 +41,7 @@ struct GowinImpl : HimbaechelAPI
// wires // wires
bool checkPipAvail(PipId pip) const override; bool checkPipAvail(PipId pip) const override;
bool checkPipAvailForNet(PipId pip, const NetInfo *net) const override;
// Cluster // Cluster
bool isClusterStrict(const CellInfo *cell) const { return true; } bool isClusterStrict(const CellInfo *cell) const { return true; }
@ -188,6 +189,16 @@ void GowinImpl::init(Context *ctx)
// We do not allow the use of global wires that bypass a special router. // We do not allow the use of global wires that bypass a special router.
bool GowinImpl::checkPipAvail(PipId pip) const { return !gwu.is_global_pip(pip); } bool GowinImpl::checkPipAvail(PipId pip) const { return !gwu.is_global_pip(pip); }
bool GowinImpl::checkPipAvailForNet(PipId pip, const NetInfo *net) const {
if (gwu.is_global_pip(pip)) {
// Available for a globally routed net
auto prop = net->attrs.find(id_GLOBALLY_ROUTED);
return prop != net->attrs.end() && prop->second == Property("YES");
}
return true;
}
void GowinImpl::pack() void GowinImpl::pack()
{ {
if (ctx->settings.count(ctx->id("cst.filename"))) { if (ctx->settings.count(ctx->id("cst.filename"))) {