liteeth/examples/targets/tty.py

40 lines
1.1 KiB
Python
Raw Normal View History

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
class TTYSoC(BaseSoC):
default_platform = "kc705"
def __init__(self, platform):
BaseSoC.__init__(self, platform,
mac_address=0x10e2d5000000,
ip_address="192.168.1.50")
self.submodules.tty = LiteEthTTY(self.core.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
class TTYSoCDevel(TTYSoC):
csr_map = {
2016-03-31 15:27:08 -04:00
"analyzer": 20
2015-09-07 07:28:02 -04:00
}
csr_map.update(TTYSoC.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
TTYSoC.__init__(self, platform)
2016-03-31 15:27:08 -04:00
debug = [
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
]
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 = TTYSoC