diff options
author | gatecat <gatecat@ds0.me> | 2023-04-12 17:16:49 +0200 |
---|---|---|
committer | myrtle <gatecat@ds0.me> | 2023-04-13 13:29:52 +0200 |
commit | b0a78de78f213d6cb169a22e38179c48f3dc02fc (patch) | |
tree | ba12a28df2d730a32dbc3b717d4f733faa2f8540 | |
parent | 62b8baa9595aacc4373bd47af479157322ffa85a (diff) | |
download | nextpnr-b0a78de78f213d6cb169a22e38179c48f3dc02fc.tar.gz nextpnr-b0a78de78f213d6cb169a22e38179c48f3dc02fc.tar.bz2 nextpnr-b0a78de78f213d6cb169a22e38179c48f3dc02fc.zip |
fabulous: Support for configurable LUT size
Signed-off-by: gatecat <gatecat@ds0.me>
-rw-r--r-- | generic/viaduct/fabulous/fabulous.cc | 2 | ||||
-rw-r--r-- | generic/viaduct/fabulous/fasm.cc | 6 |
2 files changed, 6 insertions, 2 deletions
diff --git a/generic/viaduct/fabulous/fabulous.cc b/generic/viaduct/fabulous/fabulous.cc index 6141974e..ed528b0b 100644 --- a/generic/viaduct/fabulous/fabulous.cc +++ b/generic/viaduct/fabulous/fabulous.cc @@ -48,6 +48,8 @@ struct FabulousImpl : ViaductAPI for (auto a : args) { if (a.first == "fasm") fasm_file = a.second; + else if (a.first == "lut_k") + cfg.clb.lut_k = std::stoi(a.second); else log_error("unrecognised fabulous option '%s'\n", a.first.c_str()); } diff --git a/generic/viaduct/fabulous/fasm.cc b/generic/viaduct/fabulous/fasm.cc index f1c0c648..0ec6f02d 100644 --- a/generic/viaduct/fabulous/fasm.cc +++ b/generic/viaduct/fabulous/fasm.cc @@ -99,7 +99,7 @@ struct FabFasmWriter { std::vector<bool> bits(width, false); for (int i = 0; i < width; i++) - bits[i] = (value & (1ULL << i)) != 0; + bits[i] = (value & (1ULL << unsigned(i))) != 0; write_vector(name, bits, invert); } // Write an int vector param @@ -124,7 +124,9 @@ struct FabFasmWriter uint64_t depermute_lut(const CellInfo *lut) { - uint64_t orig_init = int_or_default(lut->params, id_INIT, 0); + uint64_t orig_init = 0; + if (lut->params.count(id_INIT)) + orig_init = lut->params.at(id_INIT).as_int64(); std::vector<std::vector<unsigned>> phys_to_log; phys_to_log.resize(cfg.clb.lut_k); for (unsigned i = 0; i < cfg.clb.lut_k; i++) { |