Replace assert in addModule with more useful error message

This commit is contained in:
Dan Ravensloft 2021-03-05 21:45:11 +00:00 committed by Marcelina Kościelnicka
parent 9dd813374e
commit 55e5bd4213
1 changed files with 2 additions and 1 deletions

View File

@ -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;