2019-11-23 13:49:23 -05:00
|
|
|
# This file is Copyright (c) 2015-2019 Florent Kermarrec <florent@enjoy-digital.fr>
|
2019-06-24 05:43:10 -04:00
|
|
|
# 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
|
|
|
|
|
2019-11-23 13:49:23 -05:00
|
|
|
# EtherboneSoC -------------------------------------------------------------------------------------
|
2015-09-07 07:28:02 -04:00
|
|
|
|
|
|
|
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")
|
2019-11-23 13:49:23 -05:00
|
|
|
self.submodules.etherbone = LiteEthEtherbone(self.ethcore.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
|
|
|
|
2019-11-23 13:49:23 -05:00
|
|
|
# EtherboneSoCDevel --------------------------------------------------------------------------------
|
2015-09-07 07:28:02 -04:00
|
|
|
|
|
|
|
class EtherboneSoCDevel(EtherboneSoC):
|
|
|
|
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 = [
|
2019-11-23 13:49:23 -05: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
|
|
|
|
2019-11-23 13:49:23 -05: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
|
|
|
|
2019-11-23 13:49:23 -05: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
|
|
|
]
|
2019-11-23 09:47:42 -05:00
|
|
|
self.submodules.analyzer = LiteScopeAnalyzer(debug, 4096, csr_csv="test/analyzer.csv")
|
|
|
|
self.add_csr("analyzer")
|
2015-09-07 07:28:02 -04:00
|
|
|
|
|
|
|
default_subtarget = EtherboneSoC
|