simplify litescope export with do_exit call and remove automatic clean
authorFlorent Kermarrec <florent@enjoy-digital.fr>
Thu, 12 Feb 2015 20:15:29 +0000 (21:15 +0100)
committerFlorent Kermarrec <florent@enjoy-digital.fr>
Thu, 12 Feb 2015 20:15:51 +0000 (21:15 +0100)
make.py
targets/simple.py

diff --git a/make.py b/make.py
index 84eebcbd7362bf78fff5704cb641cf713feed57e..f6f84f5c821fcdcc65e8561c3cf61348acf7c52f 100644 (file)
--- a/make.py
+++ b/make.py
@@ -111,15 +111,14 @@ RLE: {}
        str(soc.la.with_rle)
        )
 )
+
        # dependencies
        if actions["all"]:
-               actions["clean"] = True
                actions["build-csr-csv"] = True
                actions["build-bitstream"] = True
                actions["load-bitstream"] = True
 
        if actions["build-bitstream"]:
-               actions["clean"] = True
                actions["build-csr-csv"] = True
                actions["build-bitstream"] = True
                actions["load-bitstream"] = True
@@ -132,7 +131,10 @@ RLE: {}
                write_to_file(args.csr_csv, csr_csv)
 
        if actions["build-bitstream"]:
-               platform.build(soc, build_name=build_name)
+               vns = platform.build(soc, build_name=build_name)
+               if hasattr(soc, "do_exit") and vns is not None:
+                       if hasattr(soc.do_exit, '__call__'):
+                               soc.do_exit(vns)
 
        if actions["load-bitstream"]:
                prog = platform.create_programmer()
index 9f9dca6088b92ce5128a1f2c4b71450c463c1ffd..4f2f648cd8ca6cedac8768342edc3c3aafe3942f 100644 (file)
@@ -1,4 +1,4 @@
-import os, atexit
+import os
 
 from migen.bank import csrgen
 from migen.bus import wishbone, csr
@@ -99,10 +99,8 @@ class LiteScopeSoC(GenSoC, AutoCSR):
                )
                self.submodules.la = LiteScopeLA(self.debug, 512, with_subsampler=True)
                self.la.trigger.add_port(LiteScopeTerm(self.la.dw))
-               atexit.register(self.exit, platform)
 
-       def exit(self, platform):
-               if platform.vns is not None:
-                       self.la.export(platform.vns, "./test/la.csv")
+       def do_exit(self, vns):
+               self.la.export(vns, "test/la.csv")
 
 default_subtarget = LiteScopeSoC