From f9825c31302fe2de8a67698b0dd9717c5e2baad1 Mon Sep 17 00:00:00 2001 From: gatecat Date: Thu, 7 Sep 2023 11:01:56 +0200 Subject: [PATCH] ice40: only set/clear negclk bit if IO clock actually used Signed-off-by: gatecat --- ice40/bitstream.cc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/ice40/bitstream.cc b/ice40/bitstream.cc index 533f310a..97883f95 100644 --- a/ice40/bitstream.cc +++ b/ice40/bitstream.cc @@ -540,7 +540,8 @@ void write_asc(const Context *ctx, std::ostream &out) bool val = (pin_type >> i) & 0x01; set_config(ti, config.at(y).at(x), "IOB_" + std::to_string(z) + ".PINTYPE_" + std::to_string(i), val); } - set_config(ti, config.at(y).at(x), "NegClk", neg_trigger); + if (cell.second->getPort(id_INPUT_CLK) || cell.second->getPort(id_OUTPUT_CLK)) + set_config(ti, config.at(y).at(x), "NegClk", neg_trigger); bool input_en = false; if ((ctx->wire_to_net[ctx->getBelPinWire(bel, id_D_IN_0).index] != nullptr) ||