diff --git a/xc7/blinky.sh b/xc7/blinky.sh index 1ba77434..dff168e0 100755 --- a/xc7/blinky.sh +++ b/xc7/blinky.sh @@ -1,7 +1,7 @@ #!/bin/bash set -ex yosys blinky.ys -../nextpnr-xc7 --json blinky.json --pcf blinky.pcf --xdl blinky.xdl --freq 150 +- ../nextpnr-xc7 --json blinky.json --pcf blinky.pcf --xdl blinky.xdl --freq 150 xdl -xdl2ncd blinky.xdl bitgen -w blinky.ncd -g UnconstrainedPins:Allow trce blinky.ncd -v 10 diff --git a/xc7/cells.cc b/xc7/cells.cc index b7aefce6..e95de384 100644 --- a/xc7/cells.cc +++ b/xc7/cells.cc @@ -285,7 +285,7 @@ void dff_to_lc(const Context *ctx, CellInfo *dff, CellInfo *lc, bool pass_thru_l lc->params[ctx->id("DFF_ENABLE")] = "1"; std::string config = dff->type.str(ctx).substr(2); auto citer = config.begin(); - replace_port(dff, id_C, lc, id_CLK); + replace_port(dff, ctx->id("C"), lc, id_CLK); if (citer != config.end()) { auto gnd_net = ctx->nets.at(ctx->id("$PACKER_GND_NET")).get(); @@ -410,7 +410,7 @@ bool is_clock_port(const BaseCtx *ctx, const PortRef &port) if (port.cell == nullptr) return false; if (is_ff(ctx, port.cell)) - return port.port == id_C; + return port.port == ctx->id("C"); if (port.cell->type == ctx->id("ICESTORM_LC")) return port.port == id_CLK; if (is_ram(ctx, port.cell) || port.cell->type == ctx->id("ICESTORM_RAM")) diff --git a/xc7/xdl.cc b/xc7/xdl.cc index 3940f070..317b4108 100644 --- a/xc7/xdl.cc +++ b/xc7/xdl.cc @@ -176,13 +176,15 @@ DesignSharedPtr create_torc_design(const Context *ctx) instPtr->setConfig(setting + "INIT", "", cell.second->params.at(ctx->id("FFINIT"))); if (cell.second->lcInfo.negClk) - instPtr->setConfig("CLKINV", "", "CLK_B"); + instPtr->setConfig("CLKINV", "", "CLK_B"); + else + instPtr->setConfig("CLKINV", "", "CLK"); if (get_net_or_empty(cell.second.get(), id_SR)) { - instPtr->setConfig(setting + "SR", "", cell.second->params.at(id_SR)); - instPtr->setConfig("SYNC_ATTR", "", cell.second->params.at(ctx->id("SYNC_ATTR"))); + instPtr->setConfig(setting + "SR", "", cell.second->params.at(id_SR)); + instPtr->setConfig("SYNC_ATTR", "", cell.second->params.at(ctx->id("SYNC_ATTR"))); instPtr->setConfig("SRUSEDMUX", "", "IN"); - } + } if (get_net_or_empty(cell.second.get(), ctx->id("CE"))) instPtr->setConfig("CEUSEDMUX", "", "IN");