back.pysim: close .vcd/.gtkw files on context manager exit.
authorwhitequark <cz@m-labs.hk>
Fri, 14 Dec 2018 13:59:03 +0000 (13:59 +0000)
committerwhitequark <cz@m-labs.hk>
Fri, 14 Dec 2018 13:59:03 +0000 (13:59 +0000)
nmigen/back/pysim.py

index a174ec80aa6c776e181fd318132bdf573ff2809b..d6df00a8130344764a9cd182348ab1c7a4ba7550 100644 (file)
@@ -579,3 +579,8 @@ class Simulator:
 
             for signal in self._gtkw_signals:
                 add_trace(signal)
+
+        if self._vcd_file:
+            self._vcd_file.close()
+        if self._gtkw_file:
+            self._gtkw_file.close()