2019-06-24 05:43:10 -04:00
|
|
|
# This file is Copyright (c) 2015-2018 Florent Kermarrec <florent@enjoy-digital.fr>
|
|
|
|
# License: BSD
|
|
|
|
|
2015-09-08 03:50:45 -04:00
|
|
|
from liteeth.common import *
|
2015-11-24 14:44:00 -05:00
|
|
|
from liteeth.frontend.etherbone import LiteEthEtherbone
|
2015-09-07 07:28:02 -04:00
|
|
|
|
|
|
|
from targets.base import BaseSoC
|
|
|
|
|
|
|
|
|
|
|
|
class EtherboneSoC(BaseSoC):
|
|
|
|
default_platform = "kc705"
|
|
|
|
def __init__(self, platform):
|
|
|
|
BaseSoC.__init__(self, platform,
|
|
|
|
mac_address=0x10e2d5000000,
|
2016-03-15 10:40:06 -04:00
|
|
|
ip_address="192.168.1.50")
|
2017-06-22 05:28:45 -04:00
|
|
|
self.submodules.etherbone = LiteEthEtherbone(self.core.udp, 1234, mode="master")
|
2017-03-30 08:46:54 -04:00
|
|
|
self.add_wb_master(self.etherbone.wishbone.bus)
|
2015-09-07 07:28:02 -04:00
|
|
|
|
|
|
|
|
|
|
|
class EtherboneSoCDevel(EtherboneSoC):
|
|
|
|
csr_map = {
|
2016-03-31 15:27:08 -04:00
|
|
|
"analyzer": 20
|
2015-09-07 07:28:02 -04:00
|
|
|
}
|
|
|
|
csr_map.update(EtherboneSoC.csr_map)
|
|
|
|
def __init__(self, platform):
|
2016-03-31 15:27:08 -04:00
|
|
|
from litescope import LiteScopeAnalyzer
|
2015-09-07 07:28:02 -04:00
|
|
|
EtherboneSoC.__init__(self, platform)
|
2016-03-31 15:27:08 -04:00
|
|
|
debug = [
|
2015-09-07 07:28:02 -04:00
|
|
|
# mmap stream from HOST
|
2017-03-30 08:46:54 -04:00
|
|
|
self.etherbone.wishbone.sink.valid,
|
|
|
|
self.etherbone.wishbone.sink.last,
|
|
|
|
self.etherbone.wishbone.sink.ready,
|
|
|
|
self.etherbone.wishbone.sink.we,
|
|
|
|
self.etherbone.wishbone.sink.count,
|
|
|
|
self.etherbone.wishbone.sink.base_addr,
|
|
|
|
self.etherbone.wishbone.sink.be,
|
|
|
|
self.etherbone.wishbone.sink.addr,
|
|
|
|
self.etherbone.wishbone.sink.data,
|
2015-09-07 07:28:02 -04:00
|
|
|
|
|
|
|
# mmap stream to HOST
|
2017-03-30 08:46:54 -04:00
|
|
|
self.etherbone.wishbone.source.valid,
|
|
|
|
self.etherbone.wishbone.source.last,
|
|
|
|
self.etherbone.wishbone.source.ready,
|
|
|
|
self.etherbone.wishbone.source.we,
|
|
|
|
self.etherbone.wishbone.source.count,
|
|
|
|
self.etherbone.wishbone.source.base_addr,
|
|
|
|
self.etherbone.wishbone.source.be,
|
|
|
|
self.etherbone.wishbone.source.addr,
|
|
|
|
self.etherbone.wishbone.source.data,
|
2015-09-07 07:28:02 -04:00
|
|
|
|
|
|
|
# etherbone wishbone master
|
2017-03-30 08:46:54 -04:00
|
|
|
self.etherbone.wishbone.bus.dat_w,
|
|
|
|
self.etherbone.wishbone.bus.dat_r,
|
|
|
|
self.etherbone.wishbone.bus.adr,
|
|
|
|
self.etherbone.wishbone.bus.sel,
|
|
|
|
self.etherbone.wishbone.bus.cyc,
|
|
|
|
self.etherbone.wishbone.bus.stb,
|
|
|
|
self.etherbone.wishbone.bus.ack,
|
|
|
|
self.etherbone.wishbone.bus.we,
|
|
|
|
self.etherbone.wishbone.bus.cti,
|
|
|
|
self.etherbone.wishbone.bus.bte,
|
|
|
|
self.etherbone.wishbone.bus.err
|
2016-03-31 15:27:08 -04:00
|
|
|
]
|
|
|
|
self.submodules.analyzer = LiteScopeAnalyzer(debug, 4096)
|
2015-09-07 07:28:02 -04:00
|
|
|
|
|
|
|
def do_exit(self, vns):
|
2016-03-31 15:27:08 -04:00
|
|
|
self.analyzer.export_csv(vns, "test/analyzer.csv")
|
2015-09-07 07:28:02 -04:00
|
|
|
|
|
|
|
default_subtarget = EtherboneSoC
|