From 6ac43e49bc7db6a6c13b0ff302ef193db1fa7064 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Povi=C5=A1er?= Date: Thu, 5 Oct 2023 19:21:52 +0200 Subject: [PATCH 1/3] sim: Change clocked read port suggestion to `memory_nordff` `memory_nordff` has the advantage that it can be called just ahead of the simulation step no matter whether the clocked read port has been inferred or was explicitly instantiated in a flow. --- passes/sat/sim.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/passes/sat/sim.cc b/passes/sat/sim.cc index 963c6481b16..31490591474 100644 --- a/passes/sat/sim.cc +++ b/passes/sat/sim.cc @@ -579,7 +579,7 @@ struct SimInstance Const data = Const(State::Sx, mem.width << port.wide_log2); if (port.clk_enable) - log_error("Memory %s.%s has clocked read ports. Run 'memory' with -nordff.\n", log_id(module), log_id(mem.memid)); + log_error("Memory %s.%s has clocked read ports. Run 'memory_nordff' to transform the circuit to remove those.\n", log_id(module), log_id(mem.memid)); if (addr.is_fully_def()) { int addr_int = addr.as_int(); From a782b15aae8890c819c133566f77dc5ac8362b99 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Povi=C5=A1er?= Date: Thu, 5 Oct 2023 19:22:08 +0200 Subject: [PATCH 2/3] sim: s/instanced/instantiated/ --- passes/sat/sim.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/passes/sat/sim.cc b/passes/sat/sim.cc index 31490591474..9ce79973599 100644 --- a/passes/sat/sim.cc +++ b/passes/sat/sim.cc @@ -219,7 +219,7 @@ struct SimInstance log_assert(module); if (module->get_blackbox_attribute(true)) - log_error("Cannot simulate blackbox module %s (instanced at %s).\n", + log_error("Cannot simulate blackbox module %s (instantiated at %s).\n", log_id(module->name), hiername().c_str()); if (parent) { From c3fd88624a53c3778ea8ec1a43fc68d0686143ed Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20Povi=C5=A1er?= Date: Thu, 5 Oct 2023 19:23:48 +0200 Subject: [PATCH 3/3] sim: Bail on processes Instead of silently missimulating, error out when there are processes found in the simulation hierarchy. --- passes/sat/sim.cc | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/passes/sat/sim.cc b/passes/sat/sim.cc index 9ce79973599..a8516470cfe 100644 --- a/passes/sat/sim.cc +++ b/passes/sat/sim.cc @@ -222,6 +222,10 @@ struct SimInstance log_error("Cannot simulate blackbox module %s (instantiated at %s).\n", log_id(module->name), hiername().c_str()); + if (module->has_processes()) + log_error("Found processes in simulation hierarchy (in module %s at %s). Run 'proc' first.\n", + log_id(module), hiername().c_str()); + if (parent) { log_assert(parent->children.count(instance) == 0); parent->children[instance] = this;