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.0.42")
|
|
|
|
self.submodules.tty = LiteEthTTY(self.core.udp, convert_ip("192.168.0.14"), 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 = {
|
2015-09-27 13:14:46 -04:00
|
|
|
"logic_analyzer": 20
|
2015-09-07 07:28:02 -04:00
|
|
|
}
|
|
|
|
csr_map.update(TTYSoC.csr_map)
|
|
|
|
def __init__(self, platform):
|
2015-09-27 13:14:46 -04:00
|
|
|
from litescope.frontend.logic_analyzer import LiteScopeLogicAnalyzer
|
2015-09-12 14:53:14 -04:00
|
|
|
from litescope.core.port import LiteScopeTerm
|
2015-09-07 07:28:02 -04:00
|
|
|
TTYSoC.__init__(self, platform)
|
|
|
|
debug = (
|
|
|
|
self.tty.sink.stb,
|
|
|
|
self.tty.sink.ack,
|
|
|
|
self.tty.sink.data,
|
|
|
|
|
|
|
|
self.tty.source.stb,
|
|
|
|
self.tty.source.ack,
|
|
|
|
self.tty.source.data
|
|
|
|
)
|
2015-09-27 13:14:46 -04:00
|
|
|
self.submodules.logic_analyzer = LiteScopeLogicAnalyzer(debug, 4096)
|
|
|
|
self.logic_analyzer.trigger.add_port(LiteScopeTerm(self.logic_analyzer.dw))
|
2015-09-07 07:28:02 -04:00
|
|
|
|
|
|
|
def do_exit(self, vns):
|
2015-09-27 13:14:46 -04:00
|
|
|
self.logic_analyzer.export(vns, "test/logic_analyzer.csv")
|
2015-09-07 07:28:02 -04:00
|
|
|
|
|
|
|
default_subtarget = TTYSoC
|