aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorClifford Wolf <clifford@clifford.at>2019-06-06 06:49:07 +0200
committerGitHub <noreply@github.com>2019-06-06 06:49:07 +0200
commit50e2dce5e7b9a193eab90def9b68e4d77b3789ca (patch)
treea9f0670b8cf7d3fc215a26b3431dbbd2b9c7db36
parentfd8ef128bfdc01b6bcf90ca5a3426aac22811161 (diff)
parentdd134914cc93f7506504ad95aad438a468bb0fe8 (diff)
downloadyosys-50e2dce5e7b9a193eab90def9b68e4d77b3789ca.tar.gz
yosys-50e2dce5e7b9a193eab90def9b68e4d77b3789ca.tar.bz2
yosys-50e2dce5e7b9a193eab90def9b68e4d77b3789ca.zip
Merge pull request #1072 from YosysHQ/eddie/fix_1069
Error out if no top module given before 'sim'
-rw-r--r--passes/sat/sim.cc5
1 files changed, 5 insertions, 0 deletions
diff --git a/passes/sat/sim.cc b/passes/sat/sim.cc
index 53e248adf..4c3022c70 100644
--- a/passes/sat/sim.cc
+++ b/passes/sat/sim.cc
@@ -88,6 +88,8 @@ struct SimInstance
SimInstance(SimShared *shared, Module *module, Cell *instance = nullptr, SimInstance *parent = nullptr) :
shared(shared), module(module), instance(instance), parent(parent), sigmap(module)
{
+ log_assert(module);
+
if (parent) {
log_assert(parent->children.count(instance) == 0);
parent->children[instance] = this;
@@ -848,6 +850,9 @@ struct SimPass : public Pass {
if (design->full_selection()) {
top_mod = design->top_module();
+
+ if (!top_mod)
+ log_cmd_error("Design has no top module, use the 'hierarchy' command to specify one.\n");
} else {
auto mods = design->selected_whole_modules();
if (GetSize(mods) != 1)