From ad2b04d63a8639a294bfe6148ee262980fc962e1 Mon Sep 17 00:00:00 2001 From: Jannis Harder Date: Thu, 18 May 2023 16:50:11 +0200 Subject: [PATCH] sim: Fix cosimulation with nested modules having unconnected inputs When assigning values to input ports of nested modules in cosimulation, sim needs to find the actual driver of the signal to perform the assignment. The existing code didn't handle unconnected inputs in that scenario. --- passes/sat/sim.cc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/passes/sat/sim.cc b/passes/sat/sim.cc index fe1635249..273e9db86 100644 --- a/passes/sat/sim.cc +++ b/passes/sat/sim.cc @@ -223,7 +223,8 @@ struct SimInstance if (wire->port_input && instance != nullptr && parent != nullptr) { for (int i = 0; i < GetSize(sig); i++) { - in_parent_drivers.emplace(sig[i], parent->sigmap(instance->getPort(wire->name)[i])); + if (instance->hasPort(wire->name)) + in_parent_drivers.emplace(sig[i], parent->sigmap(instance->getPort(wire->name)[i])); } } }