diff options
author | gatecat <gatecat@ds0.me> | 2021-05-14 20:25:41 +0100 |
---|---|---|
committer | gatecat <gatecat@ds0.me> | 2021-05-15 14:54:33 +0100 |
commit | b29fa1d24c44f7f6454158d27e751203c2d9e099 (patch) | |
tree | 75ccaaf5ad84bdc1e4cf1d7b37955dd9f1813685 /mistral/bitstream.cc | |
parent | 66b3a192f8966538d32d3467dbb160ae31e2ee9e (diff) | |
download | nextpnr-b29fa1d24c44f7f6454158d27e751203c2d9e099.tar.gz nextpnr-b29fa1d24c44f7f6454158d27e751203c2d9e099.tar.bz2 nextpnr-b29fa1d24c44f7f6454158d27e751203c2d9e099.zip |
mistral: FF&CLKBUF fixes, part 1
Signed-off-by: gatecat <gatecat@ds0.me>
Diffstat (limited to 'mistral/bitstream.cc')
-rw-r--r-- | mistral/bitstream.cc | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/mistral/bitstream.cc b/mistral/bitstream.cc index 7885f959..6921bbb5 100644 --- a/mistral/bitstream.cc +++ b/mistral/bitstream.cc @@ -189,7 +189,7 @@ struct MistralBitgen { (void)ci; // currently unused auto pos = CycloneV::xy2pos(x, y); - cv->bmux_n_set(CycloneV::CMUXHG, pos, CycloneV::INPUT_SELECT, bi, 0x1b); // hardcode to general routing + cv->bmux_r_set(CycloneV::CMUXHG, pos, CycloneV::INPUT_SELECT, bi, 0x1b); // hardcode to general routing cv->bmux_m_set(CycloneV::CMUXHG, pos, CycloneV::TESTSYN_ENOUT_SELECT, bi, CycloneV::PRE_SYNENB); } @@ -245,8 +245,10 @@ struct MistralBitgen if (is_carry && alm == 5) cv->bmux_b_set(CycloneV::LAB, pos, CycloneV::BTO_DIS, alm, true); // Flipflop configuration + const std::array<CycloneV::bmux_type_t, 2> ef_sel{CycloneV::TEF_SEL, CycloneV::BEF_SEL}; const std::array<CycloneV::bmux_type_t, 4> pkreg{CycloneV::TPKREG0, CycloneV::TPKREG1, CycloneV::BPKREG0, CycloneV::BPKREG1}; + const std::array<CycloneV::bmux_type_t, 2> clk_sel{CycloneV::TCLK_SEL, CycloneV::BCLK_SEL}, clr_sel{CycloneV::TCLR_SEL, CycloneV::BCLR_SEL}, sclr_dis{CycloneV::TSCLR_DIS, CycloneV::BSCLR_DIS}, sload_en{CycloneV::TSLOAD_EN, CycloneV::BSLOAD_EN}; @@ -258,6 +260,12 @@ struct MistralBitgen en_ninv{CycloneV::EN0_NINV, CycloneV::EN1_NINV, CycloneV::EN2_NINV}; const std::array<CycloneV::bmux_type_t, 2> aclr_inv{CycloneV::ACLR0_INV, CycloneV::ACLR1_INV}; + for (int i = 0; i < 2; i++) { + // EF selection mux + if (ctx->wires_connected(ctx->getBelPinWire(alm_data.lut_bels[i], i ? id_F1 : id_F0), alm_data.sel_ef[i])) + cv->bmux_m_set(CycloneV::LAB, pos, ef_sel[i], alm, CycloneV::bmux_type_t::F); + } + for (int i = 0; i < 4; i++) { CellInfo *ff = ffs[i]; if (!ff) |