From: Sebastien Bourdeauducq Date: Sat, 4 Aug 2012 22:16:11 +0000 (+0200) Subject: sim: ensure clean IPC shutdown X-Git-Tag: 24jan2021_ls180~2099^2~851 X-Git-Url: https://git.libre-soc.org/?a=commitdiff_plain;h=5bf19c155f398248ba92a0c721740d6625c08002;p=litex.git sim: ensure clean IPC shutdown --- diff --git a/examples/sim/fir.py b/examples/sim/fir.py index 3b4b8d8a..1415fbfd 100644 --- a/examples/sim/fir.py +++ b/examples/sim/fir.py @@ -66,6 +66,7 @@ def main(): fragment = autofragment.from_local() sim = Simulator(fragment, Runner()) sim.run(100) + del sim in_signals += tb.inputs out_signals += tb.outputs diff --git a/migen/sim/generic.py b/migen/sim/generic.py index 70ca1803..e027dc9c 100644 --- a/migen/sim/generic.py +++ b/migen/sim/generic.py @@ -158,6 +158,9 @@ class Simulator: for k, v in value.items(): self.multiwrite(getattr(obj, k), v) + def __del__(self): + del self.ipc + del self.sim_runner # Contrary to multiread/multiwrite, Proxy fetches the necessary signals only and # immediately forwards writes into the simulation.