sim: ensure clean IPC shutdown
authorSebastien Bourdeauducq <sebastien@milkymist.org>
Sat, 4 Aug 2012 22:16:11 +0000 (00:16 +0200)
committerSebastien Bourdeauducq <sebastien@milkymist.org>
Sat, 4 Aug 2012 22:16:11 +0000 (00:16 +0200)
examples/sim/fir.py
migen/sim/generic.py

index 3b4b8d8abc9dda73749af763ee6d7a1f08d2e5f3..1415fbfddfcbf60a045e34d1fcc46edeaedd3346 100644 (file)
@@ -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
        
index 70ca18039a8765f573ca52c64b8e0011a7d78a69..e027dc9c8451bbc1dd8da8d0e3492498a074a35f 100644 (file)
@@ -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.