liteeth/examples/targets/tty.py

39 lines
1.3 KiB
Python
Raw Normal View History

2019-11-23 13:49:23 -05:00
# This file is Copyright (c) 2015-2019 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.tty import LiteEthTTY
2015-09-07 07:28:02 -04:00
from targets.base import BaseSoC
2019-11-23 13:49:23 -05:00
# TTYSoC -------------------------------------------------------------------------------------------
2015-09-07 07:28:02 -04:00
class TTYSoC(BaseSoC):
default_platform = "kc705"
def __init__(self, platform):
BaseSoC.__init__(self, platform,
mac_address=0x10e2d5000000,
ip_address="192.168.1.50")
2019-11-23 13:49:23 -05:00
self.submodules.tty = LiteEthTTY(self.ethcore.udp, convert_ip("192.168.1.100"), 10000)
2015-12-27 06:26:01 -05:00
self.comb += self.tty.source.connect(self.tty.sink)
2015-09-07 07:28:02 -04:00
2019-11-23 13:49:23 -05:00
# TTYSoDevel ---------------------------------------------------------------------------------------
2015-09-07 07:28:02 -04:00
class TTYSoCDevel(TTYSoC):
def __init__(self, platform):
2016-03-31 15:27:08 -04:00
from litescope import LiteScopeAnalyzer
2015-09-07 07:28:02 -04:00
TTYSoC.__init__(self, platform)
2019-11-23 13:49:23 -05:00
analyzer_signals = [
self.tty.sink.valid,
self.tty.sink.ready,
2015-09-07 07:28:02 -04:00
self.tty.sink.data,
self.tty.source.valid,
self.tty.source.ready,
2015-09-07 07:28:02 -04:00
self.tty.source.data
2016-03-31 15:27:08 -04:00
]
2019-11-23 13:49:23 -05:00
self.submodules.analyzer = LiteScopeAnalyzer(analyzer_signals, 4096, csr_csv="test/analyzer.csv")
2019-11-23 09:47:42 -05:00
self.add_csr("analyzer")
2015-09-07 07:28:02 -04:00
default_subtarget = TTYSoC