Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion himbaechel/uarch/gowin/constids.inc
Original file line number Diff line number Diff line change
Expand Up @@ -1192,4 +1192,5 @@ X(HCLK_OUT3)
X(BUFG)
X(CLOCK)


// Globally routed
X(GLOBALLY_ROUTED)
5 changes: 5 additions & 0 deletions himbaechel/uarch/gowin/globals.cc
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,10 @@ struct GowinGlobalRouter
}
if (routed == NOT_ROUTED) {
ctx->unbindWire(src);
} else {
net->attrs[id_GLOBALLY_ROUTED] = Property("YES");
}

return routed;
}

Expand Down Expand Up @@ -233,6 +236,8 @@ struct GowinGlobalRouter
}
if (routed == NOT_ROUTED) {
ctx->unbindWire(src);
} else {
net->attrs[id_GLOBALLY_ROUTED] = Property("YES");
}

// b) route net before buf from whatever to the buf input
Expand Down
11 changes: 11 additions & 0 deletions himbaechel/uarch/gowin/gowin.cc
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ struct GowinImpl : HimbaechelAPI

// wires
bool checkPipAvail(PipId pip) const override;
bool checkPipAvailForNet(PipId pip, const NetInfo *net) const override;

// Cluster
bool isClusterStrict(const CellInfo *cell) const { return true; }
Expand Down Expand Up @@ -188,6 +189,16 @@ void GowinImpl::init(Context *ctx)
// 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::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()
{
if (ctx->settings.count(ctx->id("cst.filename"))) {
Expand Down