Skip to content

Commit

Permalink
Gowin. Fix the port check for connectivity.
Browse files Browse the repository at this point in the history
What happens is that it's not enough to check for a network, we also
need to make sure that the network is functional: has src and sinks

Signed-off-by: YRabbit <[email protected]>
  • Loading branch information
yrabbit committed Oct 2, 2024
1 parent 4c3cc5f commit c064b84
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 11 deletions.
2 changes: 1 addition & 1 deletion himbaechel/uarch/gowin/cst.cc
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ struct GowinCstReader
Context *ctx;
std::istream &in;

GowinCstReader(Context *ctx, std::istream &in) : ctx(ctx), in(in){};
GowinCstReader(Context *ctx, std::istream &in) : ctx(ctx), in(in) {};

const PadInfoPOD *pinLookup(const PadInfoPOD *list, const size_t len, const IdString idx)
{
Expand Down
12 changes: 4 additions & 8 deletions himbaechel/uarch/gowin/globals.cc
Original file line number Diff line number Diff line change
Expand Up @@ -340,8 +340,7 @@ struct GowinGlobalRouter
src = ctx->getBelPinWire(driver.cell->bel, driver.port);
}

RouteResult route_result = route_direct_net(
net, [&](PipId pip) { return global_DQCE_pip_filter(pip); }, src);
RouteResult route_result = route_direct_net(net, [&](PipId pip) { return global_DQCE_pip_filter(pip); }, src);
if (route_result == NOT_ROUTED) {
log_error("Can't route the %s network.\n", ctx->nameOf(net));
}
Expand Down Expand Up @@ -418,8 +417,7 @@ struct GowinGlobalRouter
src = ctx->getBelPinWire(driver.cell->bel, driver.port);
}

RouteResult route_result = route_direct_net(
net, [&](PipId pip) { return global_DCS_pip_filter(pip); }, src);
RouteResult route_result = route_direct_net(net, [&](PipId pip) { return global_DCS_pip_filter(pip); }, src);
if (route_result == NOT_ROUTED) {
log_error("Can't route the %s network.\n", ctx->nameOf(net));
}
Expand Down Expand Up @@ -506,8 +504,7 @@ struct GowinGlobalRouter
WireId src = ctx->getBelPinWire(driver.cell->bel, port);

std::vector<PipId> path;
RouteResult route_result = route_direct_net(
net, [&](PipId pip) { return global_pip_filter(pip); }, src, &path);
RouteResult route_result = route_direct_net(net, [&](PipId pip) { return global_pip_filter(pip); }, src, &path);
if (route_result == NOT_ROUTED) {
log_error("Can't route the %s network.\n", ctx->nameOf(net));
}
Expand Down Expand Up @@ -571,8 +568,7 @@ struct GowinGlobalRouter
NetInfo *net_before_buf = buf_ci->getPort(id_I);
NPNR_ASSERT(net_before_buf != nullptr);

RouteResult route_result = route_direct_net(
net, [&](PipId pip) { return global_pip_filter(pip); }, src);
RouteResult route_result = route_direct_net(net, [&](PipId pip) { return global_pip_filter(pip); }, src);
if (route_result == NOT_ROUTED || route_result == ROUTED_PARTIALLY) {
log_error("Can't route the %s net. It might be worth removing the BUFG buffer flag.\n", ctx->nameOf(net));
}
Expand Down
4 changes: 2 additions & 2 deletions himbaechel/uarch/gowin/gowin.cc
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ namespace {
struct GowinImpl : HimbaechelAPI
{

~GowinImpl(){};
~GowinImpl() {};
void init_database(Arch *arch) override;
void init(Context *ctx) override;

Expand Down Expand Up @@ -102,7 +102,7 @@ struct GowinImpl : HimbaechelAPI

struct GowinArch : HimbaechelArch
{
GowinArch() : HimbaechelArch("gowin"){};
GowinArch() : HimbaechelArch("gowin") {};

bool match_device(const std::string &device) override { return device.size() > 2 && device.substr(0, 2) == "GW"; }

Expand Down

0 comments on commit c064b84

Please sign in to comment.