diff options
author | David Shah <davey1576@gmail.com> | 2018-09-30 17:42:47 +0100 |
---|---|---|
committer | David Shah <davey1576@gmail.com> | 2018-09-30 17:42:47 +0100 |
commit | 9218d2e56b5d06a57f80e7270b1538d134f8a6fa (patch) | |
tree | fdb3c07512b31734d5f7b04c50c4b2122ff7624a /ecp5/bitstream.cc | |
parent | fef29d87626d9030f54afafa92db744ea9f21741 (diff) | |
download | nextpnr-9218d2e56b5d06a57f80e7270b1538d134f8a6fa.tar.gz nextpnr-9218d2e56b5d06a57f80e7270b1538d134f8a6fa.tar.bz2 nextpnr-9218d2e56b5d06a57f80e7270b1538d134f8a6fa.zip |
ecp5: Relative placement and bitstream gen for carries
Signed-off-by: David Shah <davey1576@gmail.com>
Diffstat (limited to 'ecp5/bitstream.cc')
-rw-r--r-- | ecp5/bitstream.cc | 17 |
1 files changed, 16 insertions, 1 deletions
diff --git a/ecp5/bitstream.cc b/ecp5/bitstream.cc index f04b1269..5e851fbf 100644 --- a/ecp5/bitstream.cc +++ b/ecp5/bitstream.cc @@ -256,7 +256,22 @@ void write_bitstream(Context *ctx, std::string base_config_file, std::string tex cc.tiles[tname].add_enum("LSR1.SRMODE", str_or_default(ci->params, ctx->id("SRMODE"), "LSR_OVER_CE")); cc.tiles[tname].add_enum("LSR1.LSRMUX", str_or_default(ci->params, ctx->id("LSRMUX"), "LSR")); } - // TODO: CLKMUX, CEMUX, carry + + if (str_or_default(ci->params, ctx->id("MODE"), "LOGIC") == "CCU2") { + cc.tiles[tname].add_enum(slice + ".CCU2.INJECT1_0", + str_or_default(ci->params, ctx->id("INJECT1_0"), "YES")); + cc.tiles[tname].add_enum(slice + ".CCU2.INJECT1_1", + str_or_default(ci->params, ctx->id("INJECT1_1"), "YES")); + } + + // Tie unused inputs high + for (auto input : {id_A0, id_B0, id_C0, id_D0, id_A1, id_B1, id_C1, id_D1}) { + if (ci->ports.find(input) == ci->ports.end() || ci->ports.at(input).net == nullptr) { + cc.tiles[tname].add_enum(slice + "." + input.str(ctx) + "MUX", "1"); + } + } + + // TODO: CLKMUX } else if (ci->type == ctx->id("TRELLIS_IO")) { std::string pio = ctx->locInfo(bel)->bel_data[bel.index].name.get(); std::string iotype = str_or_default(ci->attrs, ctx->id("IO_TYPE"), "LVCMOS33"); |