test: use new RemoteClient/RemoveServer provided by LiteX
This commit is contained in:
parent
198babae69
commit
577d83dc80
|
@ -1,19 +0,0 @@
|
|||
COREDIR = ../../
|
||||
PYTHON = python3
|
||||
SERIAL ?= 2
|
||||
|
||||
CMD = PYTHONPATH=$(COREDIR) $(PYTHON) make.py --port $(SERIAL)
|
||||
|
||||
test_regs:
|
||||
$(CMD) test_regs
|
||||
|
||||
test_inout:
|
||||
$(CMD) test_inout
|
||||
|
||||
test_logic_analyzer:
|
||||
$(CMD) test_logic_analyzer
|
||||
|
||||
all: test_regs test_inout test_logic_analyzer
|
||||
|
||||
clean:
|
||||
rm -f *.csv dump.*
|
|
@ -1,30 +0,0 @@
|
|||
#!/usr/bin/env python3
|
||||
import argparse
|
||||
import importlib
|
||||
|
||||
|
||||
def _get_args():
|
||||
parser = argparse.ArgumentParser()
|
||||
parser.add_argument("-b", "--bridge", default="uart", help="Bridge to use")
|
||||
parser.add_argument("--port", default="2", help="UART port")
|
||||
parser.add_argument("--baudrate", default=115200, help="UART baudrate")
|
||||
parser.add_argument("--busword", default=32, help="CSR busword")
|
||||
|
||||
parser.add_argument("test", nargs="+", help="specify a test")
|
||||
|
||||
return parser.parse_args()
|
||||
|
||||
if __name__ == "__main__":
|
||||
args = _get_args()
|
||||
if args.bridge == "uart":
|
||||
from misoclib.com.uart.software.wishbone import UARTWishboneBridgeDriver
|
||||
port = args.port if not args.port.isdigit() else int(args.port)
|
||||
wb = UARTWishboneBridgeDriver(port, args.baudrate, "./csr.csv", int(args.busword), debug=False)
|
||||
ValueError("Invalid bridge {}".format(args.bridge))
|
||||
|
||||
def _import(name):
|
||||
return importlib.import_module(name)
|
||||
|
||||
for test in args.test:
|
||||
t = _import(test)
|
||||
t.main(wb)
|
|
@ -1,4 +1,5 @@
|
|||
import time
|
||||
from litex.soc.tools.remote import RemoteClient
|
||||
from litescope.software.driver.inout import LiteScopeInOutDriver
|
||||
|
||||
|
||||
|
@ -25,13 +26,17 @@ def led_anim1(inout):
|
|||
time.sleep(i*i*0.0020)
|
||||
led_data = (led_data >> 1)
|
||||
|
||||
|
||||
def main(wb):
|
||||
inout = LiteScopeInOutDriver(wb.regs, "inout")
|
||||
wb = RemoteClient()
|
||||
wb.open()
|
||||
|
||||
# # #
|
||||
|
||||
inout = LiteScopeInOutDriver(wb.regs, "inout")
|
||||
|
||||
led_anim0(inout)
|
||||
led_anim1(inout)
|
||||
print("{:02X}".format(inout.read()))
|
||||
|
||||
# # #
|
||||
|
||||
wb.close()
|
||||
|
|
|
@ -1,9 +1,10 @@
|
|||
from litescope.software.driver.logic_analyzer import LiteScopeLogicAnalyzerDriver
|
||||
from litex.soc.tools.remote import RemoteClient
|
||||
|
||||
|
||||
def main(wb):
|
||||
wb = RemoteClient()
|
||||
wb.open()
|
||||
|
||||
# # #
|
||||
|
||||
logic_analyzer = LiteScopeLogicAnalyzerDriver(wb.regs, "logic_analyzer", debug=True)
|
||||
|
||||
cond = {} # immediate trigger
|
||||
|
@ -22,5 +23,7 @@ def main(wb):
|
|||
logic_analyzer.save("dump.csv")
|
||||
logic_analyzer.save("dump.py")
|
||||
logic_analyzer.save("dump.sr")
|
||||
|
||||
# # #
|
||||
|
||||
wb.close()
|
||||
|
|
|
@ -1,9 +1,16 @@
|
|||
def main(wb):
|
||||
from litex.soc.tools.remote import RemoteClient
|
||||
|
||||
wb = RemoteClient()
|
||||
wb.open()
|
||||
regs = wb.regs
|
||||
|
||||
# # #
|
||||
print("sysid : 0x{:04x}".format(regs.identifier_sysid.read()))
|
||||
print("revision : 0x{:04x}".format(regs.identifier_revision.read()))
|
||||
print("frequency : {}MHz".format(int(regs.identifier_frequency.read()/1000000)))
|
||||
|
||||
identifier = ""
|
||||
for i in range(30):
|
||||
identifier += chr(wb.read(wb.bases.identifier_mem + 4*(i+1))) # TODO: why + 1?
|
||||
print(identifier)
|
||||
print("frequency : {}MHz".format(wb.constants.system_clock_frequency/1000000))
|
||||
|
||||
# # #
|
||||
|
||||
wb.close()
|
||||
|
|
Loading…
Reference in New Issue