From: whitequark Date: Sun, 1 Nov 2020 15:25:55 +0000 (+0000) Subject: cxxrtl: don't assert on non-constant $meminit inputs. X-Git-Tag: working-ls180~212^2 X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=2ba05f5c31941967e84a2ab1a3dec89f60235057;p=yosys.git cxxrtl: don't assert on non-constant $meminit inputs. Fixes #2129. --- diff --git a/backends/cxxrtl/cxxrtl_backend.cc b/backends/cxxrtl/cxxrtl_backend.cc index da46711c1..ac4c78267 100644 --- a/backends/cxxrtl/cxxrtl_backend.cc +++ b/backends/cxxrtl/cxxrtl_backend.cc @@ -22,6 +22,7 @@ #include "kernel/sigtools.h" #include "kernel/utils.h" #include "kernel/celltypes.h" +#include "kernel/mem.h" #include "kernel/log.h" USING_YOSYS_NAMESPACE @@ -2347,8 +2348,9 @@ struct CxxrtlWorker { if (sync->type == RTLIL::STi) has_sync_init = true; - for (auto cell : module->cells()) - if (cell->type == ID($mem)) + // The Mem constructor also checks for well-formedness of $meminit cells, if any. + for (auto &mem : Mem::get_all_memories(module)) + if (mem.packed) has_packed_mem = true; } }