From: Dan Ravensloft Date: Fri, 5 Mar 2021 21:45:11 +0000 (+0000) Subject: Replace assert in addModule with more useful error message X-Git-Tag: working-ls180~13 X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=55e5bd4213c8065994fb916e72105d822bd4175a;p=yosys.git Replace assert in addModule with more useful error message --- diff --git a/kernel/rtlil.cc b/kernel/rtlil.cc index 1faf376e7..40079ffc5 100644 --- a/kernel/rtlil.cc +++ b/kernel/rtlil.cc @@ -613,7 +613,8 @@ void RTLIL::Design::add(RTLIL::Module *module) RTLIL::Module *RTLIL::Design::addModule(RTLIL::IdString name) { - log_assert(modules_.count(name) == 0); + if (modules_.count(name) != 0) + log_error("Attempted to add new module named '%s', but a module by that name already exists\n", name.c_str()); log_assert(refcount_modules_ == 0); RTLIL::Module *module = new RTLIL::Module;