示例#1
0
def main():
    args = parse_args()

    basename = os.path.splitext(os.path.basename(args.csv))[0]

    # Check if analyzer file is present and exit if not.
    if not os.path.exists(args.csv):
        raise ValueError(
            "{} not found. This is necessary to load the wires which have been tapped to scope."
            "Try setting --csv to value of the csr_csv argument to LiteScopeAnalyzer in the SoC."
            .format(args.csv))
        sys.exit(1)

    # Get list of signals from analyzer configuratio file.
    signals = get_signals(args.csv, args.group)

    # If in list mode, list signals and exit.
    if args.list:
        for signal in signals:
            print(signal)
        sys.exit(0)

    # Create and open remote control.
    if not os.path.exists(args.csr_csv):
        raise ValueError(
            "{} not found. This is necessary to load the 'regs' of the remote. Try setting --csr-csv here to "
            "the path to the --csr-csv argument of the SoC build.".format(
                args.csr_csv))
    bus = RemoteClient(csr_csv=args.csr_csv)
    bus.open()

    # Configure and run LiteScope analyzer.
    try:
        analyzer = LiteScopeAnalyzerDriver(bus.regs, basename, debug=True)
        analyzer.configure_group(int(args.group, 0))
        analyzer.configure_subsampler(int(args.subsampling, 0))
        if not add_triggers(args, analyzer, signals):
            print("No trigger, immediate capture.")
        analyzer.run(
            offset=int(args.offset, 0),
            length=None if args.length is None else int(args.length, 0))
        analyzer.wait_done()
        analyzer.upload()
        analyzer.save(args.dump)

    # Close remove control.
    finally:
        bus.close()
示例#2
0
#!/usr/bin/env python3

# This file is Copyright (c) 2018 Florent Kermarrec <*****@*****.**>
# License: BSD

from litex import RemoteClient

from litescope import LiteScopeAnalyzerDriver

wb = RemoteClient()
wb.open()

# # #

analyzer = LiteScopeAnalyzerDriver(wb.regs, "analyzer", debug=True)
analyzer.configure_subsampler(1)
analyzer.configure_group(0)
analyzer.add_rising_edge_trigger("zero")
analyzer.run(offset=32, length=128)
analyzer.wait_done()
analyzer.upload()
analyzer.save("dump.vcd")

# # #

wb.close()
示例#3
0
parser = argparse.ArgumentParser()
parser.add_argument("--ibus_adr",
                    default=0x00000000,
                    help="Trigger on IBus Adr value.")
parser.add_argument("--offset", default=128, help="Capture Offset.")
parser.add_argument("--length", default=1024, help="Capture Length.")
args = parser.parse_args()

wb = RemoteClient(csr_csv="build/arty/csr.csv")
wb.open()

# # #

analyzer = LiteScopeAnalyzerDriver(wb.regs,
                                   "analyzer",
                                   debug=True,
                                   config_csv="build/arty/analyzer.csv")
#analyzer.configure_subsampler(10)
analyzer.configure_group(0)
#analyzer.add_rising_edge_trigger("basesoc_spimaster_status_status")

#analyzer.add_rising_edge_trigger("dw1000_spi_clk")
analyzer.add_falling_edge_trigger("dw1000_spi_cs_n")
#analyzer.add_rising_edge_trigger("main_basesoc_spimaster_cs_storage")
#analyzer.add_falling_edge_trigger("spi_miso")

#analyzer.configure_trigger(cond={"main_basesoc_cpu_ibus_ibus_adr": hex(args.ibus_adr)})
#analyzer.configure_trigger(cond={"main_basesoc_ibus_ibus_adr": bin(0xea0)})
#analyzer.configure_trigger(cond={"spi_mosi": bin(ord("h"))})
analyzer.run(offset=int(args.offset), length=int(args.length))
示例#4
0
#!/usr/bin/env python3
from litex import RemoteClient
from litescope import LiteScopeAnalyzerDriver
import sys
sys.path.append("..")
from common import *

r = conLitexServer()

# # #

analyzer = LiteScopeAnalyzerDriver(r.regs,
                                   "analyzer",
                                   config_csv="build/analyzer.csv",
                                   debug=True)
analyzer.configure_subsampler(1)
analyzer.configure_group(0)
try:
    trig = sys.argv[1]
except Exception:
    trig = "user_btn_u"
print("Trigger:", trig)
analyzer.add_rising_edge_trigger(trig)
analyzer.run(offset=32, length=64)
analyzer.wait_done()
analyzer.upload()
analyzer.save("dump.vcd")

# # #

r.close()