simplify litescope export with do_exit call

This commit is contained in:
Florent Kermarrec 2015-02-12 20:39:29 +01:00
parent bceee36ef6
commit 4e4800e1b2
3 changed files with 12 additions and 23 deletions

View file

@ -117,7 +117,10 @@ System Clk: {} MHz
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()

View file

@ -1,4 +1,4 @@
import os, atexit
import os
from migen.bank import csrgen
from migen.bus import wishbone, csr
@ -15,6 +15,7 @@ from litescope.frontend.la import LiteScopeLA
from litescope.core.port import LiteScopeTerm
from liteeth.common import *
from liteeth.generic import *
from liteeth.phy.gmii import LiteEthPHYGMII
from liteeth.core import LiteEthUDPIPCore
from liteeth.core.etherbone import LiteEthEtherbone
@ -179,12 +180,10 @@ class EtherboneSoCDevel(EtherboneSoC, AutoCSR):
self.submodules.la = LiteScopeLA(debug, 4096)
self.la.trigger.add_port(LiteScopeTerm(self.la.dw))
atexit.register(self.exit, platform)
def do_finalize(self):
EtherboneSoC.do_finalize(self)
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 = EtherboneSoC

View file

@ -1,4 +1,4 @@
import os, atexit
import os
from migen.bank import csrgen
from migen.bus import wishbone, csr
@ -15,6 +15,7 @@ from litescope.frontend.la import LiteScopeLA
from litescope.core.port import LiteScopeTerm
from liteeth.common import *
from liteeth.generic import *
from liteeth.phy.gmii import LiteEthPHYGMII
from liteeth.core import LiteEthUDPIPCore
@ -177,18 +178,6 @@ class UDPSoCDevel(UDPSoC, AutoCSR):
self.core.ip.crossbar.master.sink.ip_address,
self.core.ip.crossbar.master.sink.protocol,
self.loopback_buffer.sink.stb,
self.loopback_buffer.sink.sop,
self.loopback_buffer.sink.eop,
self.loopback_buffer.sink.ack,
self.loopback_buffer.sink.data,
self.loopback_buffer.source.stb,
self.loopback_buffer.source.sop,
self.loopback_buffer.source.eop,
self.loopback_buffer.source.ack,
self.loopback_buffer.source.data,
self.phy.sink.stb,
self.phy.sink.sop,
self.phy.sink.eop,
@ -214,7 +203,6 @@ class UDPSoCDevel(UDPSoC, AutoCSR):
self.submodules.la = LiteScopeLA(debug, 4096)
self.la.trigger.add_port(LiteScopeTerm(self.la.dw))
atexit.register(self.exit, platform)
def do_finalize(self):
UDPSoC.do_finalize(self)
@ -230,8 +218,7 @@ class UDPSoCDevel(UDPSoC, AutoCSR):
self.core_arp_table_fsm_state.eq(self.core.arp.table.fsm.state)
]
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 = UDPSoC