From 5bf19c155f398248ba92a0c721740d6625c08002 Mon Sep 17 00:00:00 2001 From: Sebastien Bourdeauducq Date: Sun, 5 Aug 2012 00:16:11 +0200 Subject: [PATCH] sim: ensure clean IPC shutdown --- examples/sim/fir.py | 1 + migen/sim/generic.py | 3 +++ 2 files changed, 4 insertions(+) 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. -- 2.30.2