aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--generic/viaduct/fabulous/fabulous.cc2
-rw-r--r--generic/viaduct/fabulous/fasm.cc6
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++) {