3
0
Fork 0
mirror of https://github.com/YosysHQ/yosys synced 2026-02-22 00:07:38 +00:00

modtools: add ModIndex unit test

This commit is contained in:
Emil J. Tywoniak 2026-02-18 22:15:44 +01:00
parent c75d80905a
commit abc7563a35
2 changed files with 56 additions and 3 deletions

View file

@ -151,11 +151,11 @@ struct ModIndex : public RTLIL::Monitor
}
}
void check()
bool ok()
{
#ifndef NDEBUG
if (auto_reload_module)
return;
return true;
for (auto it : database)
log_assert(it.first == sigmap(it.first));
@ -175,11 +175,17 @@ struct ModIndex : public RTLIL::Monitor
else if (!(it.second == database_bak.at(it.first)))
log("ModuleIndex::check(): Different content for database[%s].\n", log_signal(it.first));
log_assert(database == database_bak);
return false;
}
return true;
#endif
}
void check()
{
log_assert(ok());
}
void notify_connect(RTLIL::Cell *cell, RTLIL::IdString port, const RTLIL::SigSpec &old_sig, const RTLIL::SigSpec &sig) override
{
log_assert(module == cell->module);