From f723aaa373e188a4c926eff07c4c63b0d8467e0e Mon Sep 17 00:00:00 2001 From: David Shah Date: Sun, 17 Jun 2018 15:21:35 +0200 Subject: ice40: Fixing negative clock bitstream generation Signed-off-by: David Shah --- ice40/bitstream.cc | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'ice40') diff --git a/ice40/bitstream.cc b/ice40/bitstream.cc index 9309a7da..23cd6af1 100644 --- a/ice40/bitstream.cc +++ b/ice40/bitstream.cc @@ -19,6 +19,7 @@ */ #include "bitstream.h" #include +#include "log.h" NEXTPNR_NAMESPACE_BEGIN @@ -59,11 +60,16 @@ void set_config(const TileInfoPOD &ti, if (index == -1) { for (int i = 0; i < cfg.num_bits; i++) { int8_t &cbit = tile_cfg.at(cfg.bits[i].row).at(cfg.bits[i].col); + if (cbit && !value) + log_error("clearing already set config bit %s", name.c_str()); cbit = value; } } else { int8_t &cbit = tile_cfg.at(cfg.bits[index].row).at(cfg.bits[index].col); cbit = value; + if (cbit && !value) + log_error("clearing already set config bit %s[%d]", name.c_str(), + index); } } @@ -179,7 +185,8 @@ void write_asc(const Design &design, std::ostream &out) for (int i = 0; i < 20; i++) set_config(ti, config.at(y).at(x), "LC_" + std::to_string(z), lc.at(i), i); - set_config(ti, config.at(y).at(x), "NegClk", neg_clk); + if (dff_enable) + set_config(ti, config.at(y).at(x), "NegClk", neg_clk); } else if (cell.second->type == "SB_IO") { TileInfoPOD &ti = bi.tiles_nonrouting[TILE_IO]; unsigned pin_type = get_param_or_def(cell.second, "PIN_TYPE"); -- cgit v1.2.3