Beispiel #1
0
def analyzer():
    analyzer = LiteScopeAnalyzerDriver(wb_amc.regs, "analyzer", config_csv="../sayma_amc/analyzer.csv", debug=True)
    analyzer.configure_group(groups["wishbone"])
    analyzer.configure_trigger(cond={"wishbone_access" : 1})
    analyzer.run(offset=32, length=128)

    write_pattern(32)
    errors = check_pattern(32, debug=True)
    print("errors: {:d}".format(errors))

    analyzer.wait_done()
    analyzer.upload()
    analyzer.save("dump.vcd")
Beispiel #2
0
def analyzer():
    groups = {
        "dfi_phase0": 0,
        "dfi_phase1": 1,
        "dfi_phase2": 2,
        "dfi_phase3": 3
    }

    analyzer = LiteScopeAnalyzerDriver(wb.regs, "analyzer", debug=True)
    analyzer.configure_group(groups["dfi_phase0"])
    analyzer.configure_trigger(cond={})

    write_test(0x00000000, 1024*MB, False)
    read_test(0x00000000, 1024*MB, False)

    analyzer.run(offset=32, length=64)

    analyzer.wait_done()
    analyzer.upload()
    analyzer.save("dump.vcd")
Beispiel #3
0
from litex.soc.tools.remote import RemoteClient
from litescope.software.driver.analyzer import LiteScopeAnalyzerDriver

wb = RemoteClient()
wb.open()

# # #

analyzer = LiteScopeAnalyzerDriver(wb.regs, "analyzer", debug=True)
analyzer.configure_trigger(cond={"s7pciephy_sink_valid": 1})
#analyzer.configure_trigger(cond={})
analyzer.configure_subsampler(1)
analyzer.run(offset=16, length=64)
analyzer.wait_done()
analyzer.upload()
analyzer.save("dump.vcd")

# # #

wb.close()
Beispiel #4
0
#!/usr/bin/env python3

from litex.soc.tools.remote import RemoteClient
from litescope.software.driver.analyzer import LiteScopeAnalyzerDriver

wb = RemoteClient("192.168.1.50", 1234, csr_data_width=8)
wb.open()

# # #

logic_analyzer = LiteScopeAnalyzerDriver(wb.regs, "analyzer", debug=True)

cond = {}
logic_analyzer.configure_trigger(cond=cond)
logic_analyzer.run(offset=256, length=2048)

while not logic_analyzer.done():
    pass
logic_analyzer.upload()

logic_analyzer.save("dump.vcd")

# # #

wb.close()
Beispiel #5
0
#!/usr/bin/env python3

from litex import RemoteClient

from litescope.software.driver.analyzer import LiteScopeAnalyzerDriver

wb = RemoteClient()
wb.open()

# # #

analyzer = LiteScopeAnalyzerDriver(wb.regs, "analyzer", debug=True)
analyzer.configure_trigger(cond={"ecp5ddrphy_dfi_p0_rddata_valid": 1})
analyzer.run(offset=32, length=128)
analyzer.wait_done()
analyzer.upload()
analyzer.save("dump.vcd")

# # #

wb.close()
Beispiel #6
0
#!/usr/bin/env python3

from litex.soc.tools.remote import RemoteClient
from litescope.software.driver.analyzer import LiteScopeAnalyzerDriver

wb = RemoteClient("192.168.1.50", 1234, debug=False)
wb.open()

# # #

analyzer = LiteScopeAnalyzerDriver(wb.regs, "analyzer", debug=True)
analyzer.configure_trigger(cond={})
analyzer.configure_subsampler(1)
analyzer.run(offset=16, length=1024)
while not analyzer.done():
    pass
analyzer.upload()
analyzer.save("dump.vcd")

# # #

wb.close()
Beispiel #7
0
import sys

from litex.gen.fhdl.structure import *

from litex.soc.tools.remote import RemoteClient
from litescope.software.driver.analyzer import LiteScopeAnalyzerDriver

wb = RemoteClient()
wb.open()

# # #

analyzer = LiteScopeAnalyzerDriver(wb.regs, "analyzer", debug=True)
#analyzer.configure_trigger(cond={"charsync0_data": 0x354})
#analyzer.configure_trigger(cond={"hdmi_in0_frame_de" : 1})
#analyzer.configure_trigger(cond={})
t = getattr(analyzer, "frontend_trigger_value")
m = getattr(analyzer, "frontend_trigger_mask")
t.write(0x80000000000000000)
m.write(0x80000000000000000)

analyzer.configure_subsampler(1)
analyzer.run(offset=32, length=512)
analyzer.wait_done()
analyzer.upload()
analyzer.save("dump.vcd")

# # #

wb.close()
Beispiel #8
0
        for j in range(3):
            regs.ddrphy_rdly_dq_bitslip.write(1)
    for i in range(delay):
        regs.ddrphy_rdly_dq_inc.write(1)

#

test_size = 1024 * 1024
run_analyzer = True

#

analyzer.configure_trigger(cond={"generator_start_re": 1})
analyzer.configure_trigger(cond={"checker_start_re": 1})
analyzer.configure_subsampler(1)
analyzer.run(offset=16, length=512)

regs.generator_reset.write(1)
regs.generator_reset.write(0)
regs.generator_base.write(0)
regs.generator_length.write((test_size * 8) // 128)

regs.generator_start.write(1)
while (not regs.generator_done.read()):
    pass

regs.checker_reset.write(1)
regs.checker_reset.write(0)
regs.checker_base.write(0)
regs.checker_length.write((test_size * 8) // 128)
Beispiel #9
0
from litex.tools.litex_client import RemoteClient
from litescope.software.driver.analyzer import LiteScopeAnalyzerDriver

wb = RemoteClient()
wb.open()

analyzer = LiteScopeAnalyzerDriver(wb.regs, "analyzer", debug=True)

analyzer.configure_subsampler(
    1)  ## increase this to "skip" cycles, e.g. subsample
analyzer.configure_group(0)

# trigger conditions will depend upon each other in sequence
#analyzer.add_rising_edge_trigger("adc_i_fclk1")

analyzer.add_rising_edge_trigger("adc_i_we0")

analyzer.run(offset=16, length=512)  ### CHANGE THIS TO MATCH DEPTH
analyzer.wait_done()
analyzer.upload()
analyzer.save("dump.vcd")

wb.close()
Beispiel #10
0
#!/usr/bin/env python3

#
# This file is part of LiteEth.
#
# Copyright (c) 2015-2018 Florent Kermarrec <*****@*****.**>
# SPDX-License-Identifier: BSD-2-Clause

from litex import RemoteClient

wb = RemoteClient()
wb.open()

# # #

from litescope.software.driver.analyzer import LiteScopeAnalyzerDriver
analyzer = LiteScopeAnalyzerDriver(wb.regs, "analyzer", debug=True)
analyzer.configure_trigger(cond={})
analyzer.configure_subsampler(1)
analyzer.run(offset=128, length=256)
analyzer.wait_done()
analyzer.upload()
analyzer.save("dump.vcd")

# # #

wb.close()
Beispiel #11
0
#!/usr/bin/env python3

from litex import RemoteClient

from litescope.software.driver.analyzer import LiteScopeAnalyzerDriver

wb = RemoteClient()
wb.open()

# # #

analyzer = LiteScopeAnalyzerDriver(wb.regs, "analyzer", debug=True)
analyzer.configure_trigger(cond={"mac_crc32_checker_source_source_valid": 1})
analyzer.run(offset=16, length=128)
analyzer.wait_done()
analyzer.upload()
analyzer.save("dump.vcd")

# # #

wb.close()
Beispiel #12
0
from litex.tools.litex_client import RemoteClient
from litescope.software.driver.analyzer import LiteScopeAnalyzerDriver

wb = RemoteClient()
wb.open()

analyzer = LiteScopeAnalyzerDriver(wb.regs, "analyzer", debug=True)

analyzer.configure_subsampler(
    1)  ## increase this to "skip" cycles, e.g. subsample
analyzer.configure_group(0)

#analyzer.add_falling_edge_trigger("soc_videooverlaysoc_hdmi_in0_timing_payload_vsync")
#analyzer.add_rising_edge_trigger("soc_videooverlaysoc_hdmi_in0_timing_payload_de")
#analyzer.add_trigger(cond={"soc_videooverlaysoc_hdmi_in0_timing_payload_hsync" : 1})
#analyzer.add_rising_edge_trigger("descrambler0_source_ready")

# trigger conditions will depend upon each other in sequence
#analyzer.add_trigger(cond = {"gtp0_source_payload_data" : 0x1cbc,
#                             "gtp0_source_payload_ctrl" : 3})
#analyzer.add_trigger(cond = {"detectorderedsets1_source_payload_type" : 1})

#analyzer.add_falling_edge_trigger("trig")

analyzer.run(offset=128, length=1024)  ### CHANGE THIS TO MATCH DEPTH
analyzer.wait_done()
analyzer.upload()
analyzer.save("dump.vcd")

wb.close()
        for j in range(3):
            regs.ddrphy_rdly_dq_bitslip.write(1)
    for i in range(delay):
        regs.ddrphy_rdly_dq_inc.write(1)

#

test_size = 1024*1024
run_analyzer = True

#

analyzer.configure_trigger(cond={"generator_start_re": 1})
analyzer.configure_trigger(cond={"checker_start_re": 1})
analyzer.configure_subsampler(1)
analyzer.run(offset=16, length=512)

regs.generator_reset.write(1)
regs.generator_reset.write(0)
regs.generator_base.write(0)
regs.generator_length.write((test_size*8)//128)

regs.generator_start.write(1)
while(not regs.generator_done.read()):
    pass

regs.checker_reset.write(1)
regs.checker_reset.write(0)
regs.checker_base.write(0)
regs.checker_length.write((test_size*8)//128)
Beispiel #14
0
def main():
    args, wb = connect("LiteX Etherbone Memtest BIST", target='memtest')
    print_memmap(wb)
    print()

    main_ram = wb.mems.main_ram
    print("DDR at 0x{:x} -- {} Megabytes".format(
        main_ram.base, int(main_ram.size / (1024 * 1024))))
    print()
    # init
    print("Reset")
    wb.regs.generator_reset.write(1)
    wb.regs.checker_reset.write(1)

    wb.regs.generator_reset.write(0)
    wb.regs.checker_reset.write(0)

    assert not wb.regs.checker_scope_error.read()
    print()

    analyzer = LiteScopeAnalyzerDriver(wb.regs,
                                       "analyzer",
                                       config_csv='{}/analyzer.csv'.format(
                                           make_testdir(args)),
                                       debug=True)
    print("Init analyzer")
    #analyzer.configure_trigger(cond={'checker_core_data_error': 1})
    analyzer.configure_trigger(cond={'data_error': 1})
    analyzer.configure_trigger(cond={})
    analyzer.configure_subsampler(1)
    analyzer.run(offset=16, length=1024)
    assert not analyzer.done()
    print()

    base = int(512e3)
    #length = int((main_ram.size-base)*8/16) # 64e6 == 64 megabytes
    #length = int(2e6)
    length = int(1)

    # write
    print("Write")
    write_and_check(wb.regs.generator_base, base)
    write_and_check(wb.regs.generator_length, length)

    assert not wb.regs.generator_done.read()
    wb.regs.generator_start.write(1)
    print("Waiting", end=' ')
    while wb.regs.generator_done.read() == 0:
        print(".", end='', flush=True)
        time.sleep(0.1)
    assert wb.regs.generator_done.read() == 1
    print()

    # read
    assert wb.regs.checker_err_count.read() == 0

    print("Read")
    write_and_check(wb.regs.checker_base, base)
    write_and_check(wb.regs.checker_length, length)

    assert not wb.regs.checker_done.read()
    assert not analyzer.done()
    wb.regs.checker_start.write(1)
    print("Waiting")
    while wb.regs.checker_done.read() == 0:
        print("  Errors:", wb.regs.checker_err_count.read())
        time.sleep(0.1)
    assert wb.regs.checker_done.read() == 1
    print("Final errors:", wb.regs.checker_err_count.read())

    errors = wb.regs.checker_err_count.read()

    if errors != 0:
        # Check litescope
        assert analyzer.done()
        analyzer.upload()
        analyzer.save('sim.vcd')

        data = {v.name: v for v in analyzer.dump().variables}

        okay = set()
        errors = {}
        for i in range(0, len(data['clk'].values)):
            address = hex(data['data_address'].values[i])

            if data['data_error'].values[i] != 1:
                okay.add(address)
                continue

            expected = data['data_expected'].values[i]
            actual = data['data_actual'].values[i]

            r = MemError(address, hex(expected), hex(actual))
            if address in errors:
                assert errors[address] == r
            else:
                errors[address] = r

        import pprint
        print(len(errors))
        pprint.pprint(errors)

        from IPython import embed
        embed()
        #print("Error @ {} - {:x} != {:x}".format(addr, expect, actual))

    print("Done!")

    wb.close()
Beispiel #15
0
#!/usr/bin/env python3

from litex.soc.tools.remote import RemoteClient

from litescope.software.driver.analyzer import LiteScopeAnalyzerDriver

wb = RemoteClient()
wb.open()

# # #

analyzer = LiteScopeAnalyzerDriver(wb.regs, "analyzer", debug=True)
analyzer.configure_trigger(cond={"pmoda_0": 0})
analyzer.configure_subsampler(64)
analyzer.run(offset=128, length=8192)
analyzer.wait_done()
analyzer.upload()
analyzer.save("dump.vcd")
analyzer.save("dump.sr")

# # #

wb.close()