liteXXX cores: share same methodology for on-board tests
This commit is contained in:
parent
7b464b2b1c
commit
67ca0da1d9
|
@ -72,7 +72,7 @@ devel [AT] lists.m-labs.hk.
|
||||||
5. Test design (only for KC705 for now):
|
5. Test design (only for KC705 for now):
|
||||||
try to ping 192.168.1.40
|
try to ping 192.168.1.40
|
||||||
go to [..]/example_designs/test/
|
go to [..]/example_designs/test/
|
||||||
run ./make.py udp
|
run ./make.py test_udp
|
||||||
|
|
||||||
6. Build and load Etherbone design (only for KC705 for now):
|
6. Build and load Etherbone design (only for KC705 for now):
|
||||||
python3 make.py -t etherbone all load-bitstream
|
python3 make.py -t etherbone all load-bitstream
|
||||||
|
@ -80,7 +80,7 @@ devel [AT] lists.m-labs.hk.
|
||||||
7. Test design (only for KC705 for now):
|
7. Test design (only for KC705 for now):
|
||||||
try to ping 192.168.1.40
|
try to ping 192.168.1.40
|
||||||
go to [..]/example_designs/test/
|
go to [..]/example_designs/test/
|
||||||
run ./make.py etherbone
|
run ./make.py test_etherbone
|
||||||
|
|
||||||
[> Simulations:
|
[> Simulations:
|
||||||
Simulations are available in misoclib/com/liteeth/test/:
|
Simulations are available in misoclib/com/liteeth/test/:
|
||||||
|
|
|
@ -29,5 +29,5 @@ if __name__ == "__main__":
|
||||||
return importlib.import_module(name)
|
return importlib.import_module(name)
|
||||||
|
|
||||||
for test in args.test:
|
for test in args.test:
|
||||||
t = _import("test_"+test)
|
t = _import(test)
|
||||||
t.main(wb)
|
t.main(wb)
|
||||||
|
|
|
@ -100,7 +100,7 @@ devel [AT] lists.m-labs.hk.
|
||||||
|
|
||||||
6. Test design (only for KC705 for now):
|
6. Test design (only for KC705 for now):
|
||||||
go to [..]/example_designs/test/
|
go to [..]/example_designs/test/
|
||||||
run ./make.py --port your_serial_port bist
|
run ./bist.py --port your_serial_port
|
||||||
|
|
||||||
7. If you only want to build the core and use it with your
|
7. If you only want to build the core and use it with your
|
||||||
regular design flow:
|
regular design flow:
|
||||||
|
|
|
@ -2,7 +2,7 @@ import time
|
||||||
import argparse
|
import argparse
|
||||||
import random as rand
|
import random as rand
|
||||||
from collections import OrderedDict
|
from collections import OrderedDict
|
||||||
from config import *
|
from misoclib.tools.litescope.host.driver.uart import LiteScopeUARTDriver
|
||||||
|
|
||||||
KB = 1024
|
KB = 1024
|
||||||
MB = 1024*KB
|
MB = 1024*KB
|
||||||
|
@ -128,6 +128,9 @@ def _get_args():
|
||||||
description="""\
|
description="""\
|
||||||
SATA BIST utility.
|
SATA BIST utility.
|
||||||
""")
|
""")
|
||||||
|
parser.add_argument("--port", default=2, help="UART port")
|
||||||
|
parser.add_argument("--baudrate", default=921600, help="UART baudrate")
|
||||||
|
parser.add_argument("--busword", default=32, help="CSR busword")
|
||||||
parser.add_argument("-s", "--transfer_size", default=1024, help="transfer sizes (in KB, up to 16MB)")
|
parser.add_argument("-s", "--transfer_size", default=1024, help="transfer sizes (in KB, up to 16MB)")
|
||||||
parser.add_argument("-l", "--total_length", default=256, help="total transfer length (in MB, up to HDD capacity)")
|
parser.add_argument("-l", "--total_length", default=256, help="total transfer length (in MB, up to HDD capacity)")
|
||||||
parser.add_argument("-n", "--loops", default=1, help="number of loop per transfer (allow more precision on speed calculation for small transfers)")
|
parser.add_argument("-n", "--loops", default=1, help="number of loop per transfer (allow more precision on speed calculation for small transfers)")
|
||||||
|
@ -140,6 +143,7 @@ SATA BIST utility.
|
||||||
|
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
args = _get_args()
|
args = _get_args()
|
||||||
|
wb = LiteScopeUARTDriver(args.port, args.baudrate, "./csr.csv", int(args.busword), debug=False)
|
||||||
wb.open()
|
wb.open()
|
||||||
###
|
###
|
||||||
identify = LiteSATABISTIdentifyDriver(wb.regs, "sata_bist")
|
identify = LiteSATABISTIdentifyDriver(wb.regs, "sata_bist")
|
||||||
|
|
|
@ -1,9 +0,0 @@
|
||||||
from litescope.host.driver.uart import LiteScopeUARTDriver
|
|
||||||
|
|
||||||
csr_csv_file = "./csr.csv"
|
|
||||||
busword = 32
|
|
||||||
debug_wb = False
|
|
||||||
|
|
||||||
com = 2
|
|
||||||
baud = 921600
|
|
||||||
wb = LiteScopeUARTDriver(com, baud, csr_csv_file, busword, debug_wb)
|
|
|
@ -0,0 +1,33 @@
|
||||||
|
#!/usr/bin/env python3
|
||||||
|
import argparse, 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=921600, help="UART baudrate")
|
||||||
|
parser.add_argument("--ip_address", default="192.168.1.40", help="Etherbone IP address")
|
||||||
|
parser.add_argument("--udp_port", default=20000, help="Etherbone UDP port")
|
||||||
|
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.tools.litescope.host.driver.uart import LiteScopeUARTDriver
|
||||||
|
wb = LiteScopeUARTDriver(args.port, args.baudrate, "./csr.csv", int(args.busword), debug=False)
|
||||||
|
elif args.bridge == "etherbone":
|
||||||
|
from misoclib.tools.litescope.host.driver.etherbone import LiteScopeEtherboneDriver
|
||||||
|
wb = LiteScopeEtherboneDriver(args.ip_address, int(args.udp_port), "./csr.csv", int(args.busword), debug=False)
|
||||||
|
else:
|
||||||
|
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,9 +1,9 @@
|
||||||
import sys
|
import sys
|
||||||
from config import *
|
|
||||||
from tools import *
|
from tools import *
|
||||||
from bist import *
|
from test_bist import *
|
||||||
from litescope.host.driver.la import LiteScopeLADriver
|
from litescope.host.driver.la import LiteScopeLADriver
|
||||||
|
|
||||||
|
def main(wb):
|
||||||
la = LiteScopeLADriver(wb.regs, "la")
|
la = LiteScopeLADriver(wb.regs, "la")
|
||||||
identify = LiteSATABISTIdentifyDriver(wb.regs, "sata_bist")
|
identify = LiteSATABISTIdentifyDriver(wb.regs, "sata_bist")
|
||||||
generator = LiteSATABISTGeneratorDriver(wb.regs, "sata_bist")
|
generator = LiteSATABISTGeneratorDriver(wb.regs, "sata_bist")
|
||||||
|
|
|
@ -1,5 +1,4 @@
|
||||||
from config import *
|
def main(wb):
|
||||||
|
|
||||||
wb.open()
|
wb.open()
|
||||||
regs = wb.regs
|
regs = wb.regs
|
||||||
###
|
###
|
||||||
|
|
|
@ -91,12 +91,12 @@ devel [AT] lists.m-labs.hk.
|
||||||
|
|
||||||
5. Test design:
|
5. Test design:
|
||||||
go to [..]/example_designs/test/ and run:
|
go to [..]/example_designs/test/ and run:
|
||||||
./make.py --port your_serial_port io (will blink leds)
|
./make.py --port your_serial_port test_io (will blink leds)
|
||||||
./make.py --port your_serial_port la (will capture counter)
|
./make.py --port your_serial_port test_la (will capture counter)
|
||||||
|
|
||||||
tests can also be executed over Etherbone (provided with LiteEth):
|
tests can also be executed over Etherbone (provided with LiteEth):
|
||||||
./make.py --ip_address fpga_ip_address io
|
./make.py --ip_address fpga_ip_address test_io
|
||||||
./make.py --ip_address fpga_ip_address la
|
./make.py --ip_address fpga_ip_address test_la
|
||||||
|
|
||||||
[> Simulations:
|
[> Simulations:
|
||||||
XXX convert simulations
|
XXX convert simulations
|
||||||
|
|
|
@ -29,5 +29,5 @@ if __name__ == "__main__":
|
||||||
return importlib.import_module(name)
|
return importlib.import_module(name)
|
||||||
|
|
||||||
for test in args.test:
|
for test in args.test:
|
||||||
t = _import("test_"+test)
|
t = _import(test)
|
||||||
t.main(wb)
|
t.main(wb)
|
||||||
|
|
Loading…
Reference in New Issue