Ejemplo n.º 1
0
def do_test(baud, parity, bpb):
    myenv = {'parity': parity, 'baud': baud, 'bits_per_byte': bpb}
    path = "app_uart_test_rx_bpb"
    resources = xmostest.request_resource("xsim")

    checker = UARTRxChecker("tile[0]:XS1_PORT_1A", "tile[0]:XS1_PORT_1B",
                            Parity[parity], baud, 1, bpb,
                            [0x00, 0x1a, 0x07, 0x12])
    tester = xmostest.ComparisonTester(open('test_rx_bpb_uart.expect'),
                                       "lib_uart",
                                       "sim_regression",
                                       "rx_bpb",
                                       myenv,
                                       regexp=True)

    # Only want no parity @ 115200 baud for smoke tests
    if baud != 115200 or parity != 'UART_PARITY_NONE':
        tester.set_min_testlevel('nightly')

    xmostest.run_on_simulator(
        resources['xsim'],
        'app_uart_test_rx_bpb/bin/smoke/app_uart_test_rx_bpb_smoke.xe',
        simthreads=[checker],
        xscope_io=True,
        tester=tester,
        clean_before_build=True,
        build_env=myenv)
Ejemplo n.º 2
0
def do_sp_test(speed):
    resources = xmostest.request_resource("xsim")

    binary = 'i2c_sp_test/bin/%(speed)d/i2c_sp_test_%(speed)d.xe' % {
        'speed': speed
    }

    checker = I2CMasterChecker("tile[0]:XS1_PORT_8A.1",
                               "tile[0]:XS1_PORT_8A.3",
                               tx_data=[0x99, 0x3A, 0xff],
                               expected_speed=speed)

    tester = xmostest.ComparisonTester(open('single_port_test.expect'),
                                       'lib_i2c',
                                       'i2c_master_sim_tests',
                                       'single_port_test', {'speed': speed},
                                       regexp=True)

    if speed == 10:
        tester.set_min_testlevel('nightly')

    xmostest.run_on_simulator(resources['xsim'],
                              binary,
                              simthreads=[checker],
                              simargs=['--weak-external-drive'],
                              suppress_multidrive_messages=True,
                              tester=tester)
Ejemplo n.º 3
0
def do_multi_client_async(burnt_threads, mosi_enable, combine):
    resources = xmostest.request_resource("xsim")

    binary = "spi_master_async_multi_client/bin/{burnt}{mosi}{combined}/spi_master_async_multi_client_{burnt}{mosi}{combined}.xe".format(
        burnt=burnt_threads, mosi=mosi_enable, combined=combine)

    checker = SPIMasterChecker("tile[0]:XS1_PORT_1C", "tile[0]:XS1_PORT_1D",
                               "tile[0]:XS1_PORT_1A", ["tile[0]:XS1_PORT_1B"],
                               "tile[0]:XS1_PORT_1E", "tile[0]:XS1_PORT_16B")

    tester = xmostest.ComparisonTester(
        open('master.expect'),
        'lib_spi',
        'spi_master_sim_tests',
        'multi_client_async_{burnt}{mosi}{combined}'.format(
            burnt=burnt_threads, mosi=mosi_enable, combined=combine),
        regexp=True)
    tester.set_min_testlevel('nightly')
    xmostest.run_on_simulator(
        resources['xsim'],
        binary,
        simthreads=[checker],
        #simargs=['--vcd-tracing', '-o ./spi_master_async_multi_client/trace.vcd -tile tile[0] -pads -functions'],
        simargs=[],
        suppress_multidrive_messages=False,
        tester=tester)
Ejemplo n.º 4
0
def do_rx_test(mac,
               arch,
               rx_clk,
               rx_phy,
               tx_clk,
               tx_phy,
               packets,
               test_file,
               seed,
               level='nightly',
               extra_tasks=[]):
    """ Shared test code for all RX tests using the test_rx application.
    """
    testname, extension = os.path.splitext(os.path.basename(test_file))

    resources = xmostest.request_resource("xsim")

    binary = 'test_rx/bin/{mac}_{phy}_{arch}/test_rx_{mac}_{phy}_{arch}.xe'.format(
        mac=mac, phy=tx_phy.get_name(), arch=arch)

    if xmostest.testlevel_is_at_least(xmostest.get_testlevel(), level):
        print "Running {test}: {mac} mac, {phy} phy, {arch} arch sending {n} packets at {clk} (seed {seed})".format(
            test=testname,
            n=len(packets),
            mac=mac,
            phy=tx_phy.get_name(),
            arch=arch,
            clk=tx_clk.get_name(),
            seed=seed)

    tx_phy.set_packets(packets)
    rx_phy.set_expected_packets(packets)

    expect_folder = create_if_needed("expect")
    expect_filename = '{folder}/{test}_{mac}_{phy}_{clk}_{arch}.expect'.format(
        folder=expect_folder,
        test=testname,
        mac=mac,
        phy=tx_phy.get_name(),
        clk=tx_clk.get_name(),
        arch=arch)
    create_expect(packets, expect_filename)

    tester = xmostest.ComparisonTester(
        open(expect_filename), 'lib_ethernet', 'basic_tests', testname, {
            'mac': mac,
            'phy': tx_phy.get_name(),
            'clk': tx_clk.get_name(),
            'arch': arch
        })

    tester.set_min_testlevel(level)

    simargs = get_sim_args(testname, mac, tx_clk, tx_phy, arch)
    xmostest.run_on_simulator(resources['xsim'],
                              binary,
                              simthreads=[rx_clk, rx_phy, tx_clk, tx_phy] +
                              extra_tasks,
                              tester=tester,
                              simargs=simargs)
def do_rx_tx_async(burnt_threads, mosi_enable, speed_tests, combine,
                   testlevel):
    resources = xmostest.request_resource("xsim")

    binary = "spi_master_async_rx_tx/bin/{burnt}{mosi}{speed}{combined}/spi_master_async_rx_tx_{burnt}{mosi}{speed}{combined}.xe".format(
        burnt=burnt_threads,
        mosi=mosi_enable,
        combined=combine,
        speed=speed_tests)

    checker = SPIMasterChecker("tile[0]:XS1_PORT_1C", "tile[0]:XS1_PORT_1D",
                               "tile[0]:XS1_PORT_1A", ["tile[0]:XS1_PORT_1B"],
                               "tile[0]:XS1_PORT_1E", "tile[0]:XS1_PORT_16B")

    tester = xmostest.ComparisonTester(
        open('master.expect'),
        'lib_spi',
        'spi_master_sim_tests',
        'spi_master_async_rx_tx_{burnt}{mosi}{speed}{combined}'.format(
            burnt=burnt_threads,
            mosi=mosi_enable,
            combined=combine,
            speed=speed_tests),
        regexp=True)

    tester.set_min_testlevel(testlevel)
    xmostest.run_on_simulator(resources['xsim'],
                              binary,
                              simthreads=[checker],
                              simargs=[],
                              timeout=1200,
                              tester=tester)
def do_input_1bit_basic_test(timestamps):
    resources = xmostest.request_resource("xsim")

    path = ''
    if not timestamps:
        path += '_basic'
    else:
        if timestamps:
            path += '_timestamps'

    binary = 'gpio_input_1bit_test/bin/input' + path + \
        '/gpio_input_1bit_test_input' + path + '.xe'

    checker = GPIOBasicChecker(mode="input",
                               test_port="tile[0]:XS1_PORT_1A",
                               expected_test_port_data=0b1,
                               num_clients=1)

    tester = xmostest.ComparisonTester(open('input_1bit_basic_test.expected'),
                                       'lib_gpio', 'gpio_sim_tests',
                                       'input_1bit_basic_test',
                                       {'timestamps':timestamps,},
                                       regexp=False)

    xmostest.run_on_simulator(resources['xsim'], binary, simthreads = [checker],
                              tester = tester)
Ejemplo n.º 7
0
def do_test(sample_rate, num_channels, receive_increment, send_increment,
            testlevel):

    resources = xmostest.request_resource("xsim")

    binary = 'backpressure_test/bin/{sr}_{nc}_{ri}_{si}/backpressure_test_{sr}_{nc}_{ri}_{si}.xe'.format(
        sr=sample_rate,
        nc=num_channels,
        ri=receive_increment,
        si=send_increment)

    tester = xmostest.ComparisonTester(
        open('backpressure_test.expect'), 'lib_i2s', 'i2s_backpressure_tests',
        'backpressure_%s' % testlevel, {
            'sample_rate': sample_rate,
            'num_channels': num_channels,
            'receive_increment': receive_increment,
            'send_increment': send_increment
        })

    tester.set_min_testlevel(testlevel)

    xmostest.run_on_simulator(
        resources['xsim'],
        binary,
        simargs=['--xscope', '-offline xscope.xmt'],
        # simargs=['--xscope', '-offline xscope.xmt', '--trace-to', 'sim.log', '--vcd-tracing', '-o ./backpressure_test/trace.vcd -tile tile[0] -ports-detailed -functions'],
        loopback=[{
            'from': 'tile[0]:XS1_PORT_1G',
            'to': 'tile[0]:XS1_PORT_1A'
        }],
        suppress_multidrive_messages=True,
        tester=tester)
Ejemplo n.º 8
0
def do_master_test(arch, speed, impl, stop):
    resources = xmostest.request_resource("xsim")

    binary = 'i2c_master_async_test/bin/%(impl)s_%(speed)s_%(arch)s_%(stop)s/i2c_master_async_test_%(impl)s_%(speed)s_%(arch)s_%(stop)s.xe' % {
      'impl' : impl,
      'speed' : speed,
      'arch' : arch,
      'stop' : stop
    }

    checker = I2CMasterChecker("tile[0]:XS1_PORT_1A",
                               "tile[0]:XS1_PORT_1B",
                               tx_data = [0x99, 0x3A, 0xff],
                               expected_speed = speed,
                               ack_sequence=[True, True, False,
                                             True,
                                             True,
                                             True, True, True, False,
                                             True, False])

    tester = xmostest.ComparisonTester(open('master_test_%s.expect' % stop),
                                     'lib_i2c', 'i2c_master_sim_tests',
                                     'async_basic_test',
                                     {'speed' : speed, 'impl' : impl, 'arch' : arch, 'stop' : stop},
                                     regexp=True)

    if speed == 10:
        tester.set_min_testlevel('nightly')

    xmostest.run_on_simulator(resources['xsim'], binary,
                              simthreads = [checker],
                              simargs=['--weak-external-drive'],
                              suppress_multidrive_messages = True,
                              tester = tester)
Ejemplo n.º 9
0
def do_test(baud):
    myenv = {'baud': baud}
    path = "app_uart_test_tx"
    resources = xmostest.request_resource("xsim")

    checker = UARTTxChecker("tile[0]:XS1_PORT_1A", "tile[0]:XS1_PORT_1B",
                            Parity['UART_PARITY_NONE'], baud, 128, 1, 8)
    tester = xmostest.ComparisonTester(open('test_tx_uart.expect'),
                                       "lib_uart",
                                       "sim_regression",
                                       "tx",
                                       myenv,
                                       regexp=True)

    # This test is long, only run on nightly
    tester.set_min_testlevel('nightly')

    xmostest.run_on_simulator(
        resources['xsim'],
        'app_uart_test_tx/bin/smoke/app_uart_test_tx_smoke.xe',
        simthreads=[checker],
        xscope_io=True,
        tester=tester,
        clean_before_build=True,
        build_env=myenv)
Ejemplo n.º 10
0
def do_master_test(num_in, num_out, testlevel):

    resources = xmostest.request_resource("xsim")

    binary = 'i2s_master_test/bin/{tl}_{i}{o}/i2s_master_test_{tl}_{i}{o}.xe'.format(
        i=num_in, o=num_out, tl=testlevel)

    clk = Clock("tile[0]:XS1_PORT_1A")

    checker = I2SMasterChecker("tile[0]:XS1_PORT_1B", "tile[0]:XS1_PORT_1C", [
        "tile[0]:XS1_PORT_1H", "tile[0]:XS1_PORT_1I", "tile[0]:XS1_PORT_1J",
        "tile[0]:XS1_PORT_1K"
    ], [
        "tile[0]:XS1_PORT_1D", "tile[0]:XS1_PORT_1E", "tile[0]:XS1_PORT_1F",
        "tile[0]:XS1_PORT_1G"
    ], "tile[0]:XS1_PORT_1L", "tile[0]:XS1_PORT_16A", "tile[0]:XS1_PORT_1M",
                               clk)

    tester = xmostest.ComparisonTester(open('master_test.expect'),
                                       'lib_i2s',
                                       'i2s_master_sim_tests',
                                       'basic_test_%s' % testlevel, {
                                           'num_in': num_in,
                                           'num_out': num_out
                                       },
                                       ignore=["CONFIG:.*"])

    tester.set_min_testlevel(testlevel)

    xmostest.run_on_simulator(resources['xsim'],
                              binary,
                              simthreads=[clk, checker],
                              simargs=[],
                              suppress_multidrive_messages=True,
                              tester=tester)
Ejemplo n.º 11
0
def do_backend_test(length, frame_count, testlevel):

    # Check if the test is running in an environment with hardware resources
    # available - the test takes a long time to run in the simulator
    args = xmostest.getargs()
    if not args.remote_resourcer:
        # Abort the test
        print 'remote resourcer not avaliable'
        return

    binary = 'test_fir_model/bin/COUNT{fc}_{len}/test_fir_model_COUNT{fc}_{len}.xe'.format(
        fc=frame_count, len=length)

    tester = xmostest.ComparisonTester(open('fir_model.expect'),
                                       'lib_mic_array',
                                       'lib_mic_array_backend_tests',
                                       'backend_test_%s' % testlevel, {
                                           'frame_count': frame_count,
                                           'length': length
                                       })

    tester.set_min_testlevel(testlevel)

    resources = xmostest.request_resource("uac2_xcore200_mc_testrig_os_x_11",
                                          tester)

    run_job = xmostest.run_on_xcore(resources['analysis_device_1'],
                                    binary,
                                    tester=tester,
                                    timeout=3600)

    xmostest.complete_all_jobs()
Ejemplo n.º 12
0
def do_test(baud, internal_clock):
    myenv = {'baud': baud, 'internal_clock': internal_clock}
    path = "app_uart_test_multi_tx"
    resources = xmostest.request_resource("xsim")

    tx_checker = UARTTxChecker("tile[0]:XS1_PORT_1A", "tile[0]:XS1_PORT_8B.1",
                               TxParity['UART_PARITY_NONE'], baud, 4, 1, 8)
    uart_clock = UARTClockDevice("tile[0]:XS1_PORT_1F", 230400)

    tester = xmostest.ComparisonTester(open('test_tx_multi_uart.expect'),
                                       "lib_uart",
                                       "sim_regression",
                                       "multi_tx_simple",
                                       myenv,
                                       regexp=True)

    # Only want no parity @ 230400 baud for smoke tests
    if baud != 115200:
        tester.set_min_testlevel('nightly')

    xmostest.run_on_simulator(
        resources['xsim'],
        'app_uart_test_multi_tx/bin/smoke/app_uart_test_multi_tx_smoke.xe',
        simthreads=[tx_checker, uart_clock],
        xscope_io=True,
        tester=tester,
        simargs=["--vcd-tracing", "-tile tile[0] -pads -o trace.vcd"],
        clean_before_build=True,
        build_env=myenv)
Ejemplo n.º 13
0
def runtest():
    resources = xmostest.request_resource("xsim")

    speed = 100
    build_config = "interfere"

    binary = 'i2c_master_async_test/bin/%(config)s/i2c_master_async_test_%(config)s.xe' % {'config':build_config}

    checker = I2CMasterChecker("tile[0]:XS1_PORT_1A",
                               "tile[0]:XS1_PORT_1B",
                               tx_data = [0x99, 0x3A, 0xff],
                               expected_speed = None,
                               ack_sequence=[True, True, False,
                                             True,
                                             True,
                                             True, True, True, False,
                                             True, False])

    tester = xmostest.ComparisonTester(open('master_test.expect'),
                                     'lib_i2c', 'i2c_master_sim_tests',
                                     'async_interference_test', {'speed':str(speed)},
                                     regexp=True)

    xmostest.run_on_simulator(resources['xsim'], binary,
                              simthreads = [checker],
                              simargs=['--weak-external-drive'],
                              suppress_multidrive_messages = True,
                              tester = tester)
Ejemplo n.º 14
0
def do_master_test(num_in, num_out, testlevel):

    resources = xmostest.request_resource("xsim")

    binary = 'i2s_tdm_master_test/bin/i2s/i2s_tdm_master_test_i2s.xe'

    clk = Clock("tile[0]:XS1_PORT_1A")

    checker = I2SMasterChecker("tile[0]:XS1_PORT_1B", "tile[0]:XS1_PORT_1C", [
        "tile[0]:XS1_PORT_1H", "tile[0]:XS1_PORT_1I", "tile[0]:XS1_PORT_1J",
        "tile[0]:XS1_PORT_1K"
    ], [
        "tile[0]:XS1_PORT_1D", "tile[0]:XS1_PORT_1E", "tile[0]:XS1_PORT_1F",
        "tile[0]:XS1_PORT_1G"
    ], "tile[0]:XS1_PORT_1L", "tile[0]:XS1_PORT_16A", "tile[0]:XS1_PORT_1M",
                               clk)

    tester = xmostest.ComparisonTester(open('master_test.expect'),
                                       'lib_i2s',
                                       'i2s_tdm_master_sim_tests',
                                       'i2s_test', {},
                                       ignore=["CONFIG:.*"])

    tester.set_min_testlevel(testlevel)

    xmostest.run_on_simulator(resources['xsim'],
                              binary,
                              simthreads=[clk, checker],
                              tester=tester)
Ejemplo n.º 15
0
def runtest():
    resources = xmostest.request_resource("xsim")

    binary = 'lcd_testbench_port32/bin/lcd_testbench.xe'

    checker = LCD_data_checker("tile[0]:XS1_PORT_32A",
                               "tile[0]:XS1_PORT_1I",
                               "tile[0]:XS1_PORT_1L",
                               "tile[0]:XS1_PORT_1J",
                               "tile[0]:XS1_PORT_1K",
                               lcd_height=272,
                               lcd_width=480)

    tester = xmostest.ComparisonTester(open('lcd_data_test.expect'),
                                       'lib_lcd',
                                       'lcd_sim_tests',
                                       'data32_test',
                                       regexp=True)

    xmostest.run_on_simulator(resources['xsim'],
                              binary,
                              simthreads=[checker],
                              simargs=['--weak-external-drive'],
                              suppress_multidrive_messages=True,
                              tester=tester)
Ejemplo n.º 16
0
def do_slave_test(num_in, num_out, testlevel):

    resources = xmostest.request_resource("xsim")

    binary = 'i2s_slave_test/bin/{tl}_{i}{o}_inv/i2s_slave_test_{tl}_{i}{o}_inv.xe'.format(i=num_in, o=num_out, tl=testlevel)

    clk = Clock("tile[0]:XS1_PORT_1A")

    checker = I2SSlaveChecker(
        "tile[0]:XS1_PORT_1B",
        "tile[0]:XS1_PORT_1C",
        ["tile[0]:XS1_PORT_1H","tile[0]:XS1_PORT_1I","tile[0]:XS1_PORT_1J", "tile[0]:XS1_PORT_1K"],
        ["tile[0]:XS1_PORT_1D","tile[0]:XS1_PORT_1E","tile[0]:XS1_PORT_1F", "tile[0]:XS1_PORT_1G"],
        "tile[0]:XS1_PORT_1L",
        "tile[0]:XS1_PORT_16A",
        "tile[0]:XS1_PORT_1M",
         clk,
         invert_bclk = True)

    tester = xmostest.ComparisonTester(open('bclk_invert.expect'),
                                     'lib_i2s', 'i2s_slave_sim_tests',
                                     'slave_bclk_invert_%s'%testlevel,
                                     {'num_in':num_in, 'num_out':num_out},
                                       regexp=True,
                                       ignore=["CONFIG:.*"])

    tester.set_min_testlevel(testlevel)

    xmostest.run_on_simulator(resources['xsim'], binary,
                              simthreads = [clk, checker],
                              #simargs=['--vcd-tracing', '-o ./i2s_slave_test/trace.vcd -tile tile[0] -ports-detailed'],
                              suppress_multidrive_messages = True,
                              tester = tester)
Ejemplo n.º 17
0
def runtest():
    resources = xmostest.request_resource("xsim")

    binary = 'i2s_tdm_master_test/bin/tdm/i2s_tdm_master_test_tdm.xe'

    checker = TDMMasterChecker(
        "tile[0]:XS1_PORT_1A",
        "tile[0]:XS1_PORT_1N",
        ["tile[0]:XS1_PORT_1O"],
        ["tile[0]:XS1_PORT_1P"],
        "tile[0]:XS1_PORT_1L", 
        "tile[0]:XS1_PORT_16A", 
        "tile[0]:XS1_PORT_1M",
        extra_clocks = 16)

    tester = xmostest.ComparisonTester(open('tdm_cb_test.expect'),
                                     'lib_i2s', 'i2s_tdm_master_sim_tests',
                                     'tdm_test',
                                     {},
                                       regexp=True,
                                       ignore=["CONFIG:"])

    xmostest.run_on_simulator(resources['xsim'], binary,
                              simthreads = [checker],
                              tester = tester,
                              simargs = ['--vcd-tracing','-o ttt.vcd -tile tile[0] -ports'])

    return
Ejemplo n.º 18
0
def do_slave_rx_tx(combined, burnt_threads, miso_enable, mode, transfer_size, testlevel):

    resources = xmostest.request_resource("xsim")

    binary = "spi_slave_rx_tx/bin/{com}{burnt}{miso}{m}{t}/spi_slave_rx_tx_{com}{burnt}{miso}{m}{t}.xe".format(com=combined,burnt=burnt_threads,miso=miso_enable,m=mode,t=transfer_size)

    checker = SPISlaveChecker("tile[0]:XS1_PORT_1C",
                               "tile[0]:XS1_PORT_1D",
                               "tile[0]:XS1_PORT_1A",
                               "tile[0]:XS1_PORT_1B",
                               "tile[0]:XS1_PORT_1E",
                               "tile[0]:XS1_PORT_16B",
                               "tile[0]:XS1_PORT_1F")

    tester = xmostest.ComparisonTester(open('slave.expect'),
                                     'lib_spi',
                                     'spi_slave_sim_tests',
                                     'rx_tx_slave_{com}{burnt}{miso}{m}{t}.xe'.format(com=combined,burnt=burnt_threads,miso=miso_enable,m=mode,t=transfer_size),
                                     {'combined': combined, 'burnt_threads': burnt_threads, 'miso_enable': miso_enable, 'mode': mode, 'transfer_size': transfer_size},
                                     regexp=True)

    tester.set_min_testlevel(testlevel)

    xmostest.run_on_simulator(resources['xsim'], binary,
                              simthreads = [checker],
                              #simargs=['--vcd-tracing', '-o ./spi_slave_rx_tx/trace.vcd -tile tile[0] -pads -functions -clock-blocks -ports-detailed -instructions'],
                              simargs=[],
                              suppress_multidrive_messages = False,
                              tester = tester)
Ejemplo n.º 19
0
def do_slave_test(speed, level):
    resources = xmostest.request_resource("xsim")

    binary = 'i2c_slave_test/bin/i2c_slave_test.xe'

    checker = I2CSlaveChecker("tile[0]:XS1_PORT_1A",
                              "tile[0]:XS1_PORT_1B",
                              tsequence=[("w", 0x3c, [0x33, 0x44, 0x3]),
                                         ("r", 0x3c, 3), ("w", 0x3c, [0x99]),
                                         ("w", 0x44, [0x33]), ("r", 0x3c, 1),
                                         ("w", 0x3c, [0x22, 0xff])],
                              speed=speed)

    tester = xmostest.ComparisonTester(open('basic_slave_test.expect'),
                                       'lib_i2c',
                                       'i2c_slave_sim_tests',
                                       'basic_test', {'speed': speed},
                                       regexp=True)

    tester.set_min_testlevel(level)

    xmostest.run_on_simulator(resources['xsim'],
                              binary,
                              simthreads=[checker],
                              simargs=['--weak-external-drive'],
                              suppress_multidrive_messages=True,
                              tester=tester)
Ejemplo n.º 20
0
def do_test(mac, tx_clk, tx_phy):
    resources = xmostest.request_resource("xsim")

    testname = 'test_link_status'

    binary = '{test}/bin/{mac}_{phy}/{test}_{mac}_{phy}.xe'.format(
        test=testname, mac=mac, phy=tx_phy.get_name())

    print "Running {test}: {phy} phy at {clk}".format(test=testname,
                                                      phy=tx_phy.get_name(),
                                                      clk=tx_clk.get_name())

    tester = xmostest.ComparisonTester(open('{}.expect'.format(testname)),
                                       'lib_ethernet', 'basic_tests', testname,
                                       {
                                           'mac': mac,
                                           'phy': tx_phy.get_name(),
                                           'clk': tx_clk.get_name()
                                       })

    simargs = get_sim_args(testname, mac, tx_clk, tx_phy)
    xmostest.run_on_simulator(resources['xsim'],
                              binary,
                              simthreads=[],
                              tester=tester,
                              simargs=simargs)
Ejemplo n.º 21
0
def do_test(baud):
    myenv = {'baud': baud, 'parity': 'UART_PARITY_EVEN'}
    path = "app_uart_test_rx_intermittent"
    resources = xmostest.request_resource("xsim")

    checker = UARTRxChecker("tile[0]:XS1_PORT_1A",
                            "tile[0]:XS1_PORT_1B",
                            Parity['UART_PARITY_BAD'],
                            baud,
                            1,
                            8,
                            data=range(50),
                            intermittent=True)
    tester = xmostest.ComparisonTester(
        open('test_rx_intermittent_uart.expect'),
        "lib_uart",
        "sim_regression",
        "rx_intermittent",
        myenv,
        regexp=True)

    if baud != 115200:
        tester.set_min_testlevel('nightly')

    xmostest.run_on_simulator(
        resources['xsim'],
        'app_uart_test_rx_intermittent/bin/smoke/app_uart_test_rx_intermittent_smoke.xe',
        simthreads=[checker],
        xscope_io=True,
        tester=tester,
        simargs=["--vcd-tracing", "-tile tile[0] -ports -o trace.vcd"],
        clean_before_build=True,
        build_env=myenv)
Ejemplo n.º 22
0
def do_test(baud, parity):
    myenv = {'parity': parity, 'baud': baud}
    path = "app_uart_test_parity"
    resources = xmostest.request_resource("xsim")

    checker = UARTTxChecker("tile[0]:XS1_PORT_1A", "tile[0]:XS1_PORT_1B",
                            Parity[parity], baud, 4, 1, 8)
    tester = xmostest.ComparisonTester(open('test_tx_parity_uart.expect'),
                                       "lib_uart",
                                       "sim_regression",
                                       "tx_parity",
                                       myenv,
                                       regexp=True)

    # Only want no parity @ 115200 baud for smoke tests
    if baud != 115200 or parity != 'UART_PARITY_EVEN':
        tester.set_min_testlevel('nightly')

    xmostest.run_on_simulator(
        resources['xsim'],
        'app_uart_test_parity/bin/smoke/app_uart_test_parity_smoke.xe',
        simthreads=[checker],
        xscope_io=True,
        tester=tester,
        clean_before_build=True,
        build_env=myenv)
Ejemplo n.º 23
0
def do_test(arch):
    resources = xmostest.request_resource("xsim")

    binary = 'i2c_test_locks/bin/%(arch)s/i2c_test_locks_%(arch)s.xe' % {
        'arch': arch
    }

    speed = 400

    checker = I2CMasterChecker("tile[0]:XS1_PORT_1A",
                               "tile[0]:XS1_PORT_1B",
                               expected_speed=speed)

    tester = xmostest.ComparisonTester(open('lock_test.expect'),
                                       'lib_i2c',
                                       'i2c_master_sim_tests',
                                       'bus_locks', {
                                           'speed': speed,
                                           'arch': arch
                                       },
                                       regexp=True)

    xmostest.run_on_simulator(resources['xsim'],
                              binary,
                              simthreads=[checker],
                              simargs=['--weak-external-drive'],
                              suppress_multidrive_messages=True,
                              tester=tester)
Ejemplo n.º 24
0
def do_dc_offset_removal_test(testlevel):

    # Check if the test is running in an environment with hardware resources
    # available - the test takes a long time to run in the simulator
    args = xmostest.getargs()
    if not args.remote_resourcer:
        # Abort the test
        print 'remote resourcer not avaliable'
        return

    binary = 'test_dc_offset_removal/bin/test_dc_offset_removal.xe'

    tester = xmostest.ComparisonTester(open('test_dc_offset_removal.expect'),
                                       'lib_mic_array',
                                       'lib_mic_array_backend_tests',
                                       'dc_offset_removal_test_%s' % testlevel)

    tester.set_min_testlevel(testlevel)

    resources = xmostest.request_resource("testrig_os_x_11", tester)

    run_job = xmostest.run_on_xcore(
        resources['uac2_xcore200_mc_analysis_device_1'], binary, tester=tester)

    xmostest.complete_all_jobs()
Ejemplo n.º 25
0
def do_test(arch):
    resources = xmostest.request_resource("xsim")

    binary = 'i2c_master_reg_test/bin/%(arch)s/i2c_master_reg_test_%(arch)s.xe' % {
      'arch' : arch
    }

    checker = I2CMasterChecker("tile[0]:XS1_PORT_1A",
                               "tile[0]:XS1_PORT_1B",
                               tx_data=[0x99, 0x3A, 0xff, 0x05, 0x11, 0x22],
                               expected_speed=400,
                               ack_sequence=[False, # NACK header
                                               True, True, False, # NACK before data
                                               True, False, # NACK before data
                                               True, False, # NACK before data
                                               False, # NACK address
                                               True, False, # NACK before data
                                               True, False, # NACK before data
                                               True, True, False # NACK before data
                                            ])

    tester = xmostest.ComparisonTester(open('reg_ops_nack.expect'),
                                     'lib_i2c', 'i2c_master_sim_tests',
                                     'reg_ops_nack_test',
                                     {'arch' : arch},
                                     regexp=True)

    xmostest.run_on_simulator(resources['xsim'], binary,
                              simthreads=[checker],
                              simargs=['--weak-external-drive'],
                              suppress_multidrive_messages=True,
                              tester=tester)
Ejemplo n.º 26
0
def run(arch):
    test_name = os.path.splitext(
        os.path.basename(__file__).replace("test_", "", 1))[0]

    resources = xmostest.request_resource("xsim")

    binary = '{}/bin/{}/{}_{}.xe'.format(test_name, arch, test_name, arch)

    tester = xmostest.ComparisonTester(open('{}.expect'.format(test_name)),
                                       'lib_xcore_c',
                                       'xcore_c_tests',
                                       "{}_{}".format(test_name, arch),
                                       regexp=True)

    tester.set_min_testlevel("smoke")

    xmostest.run_on_simulator(resources['xsim'],
                              binary,
                              simthreads=[],
                              tester=tester,
                              simargs=['--xscope', '-offline xscope.xmt'],
                              loopback=[{
                                  'from': 'tile[0]:XS1_PORT_1A',
                                  'to': 'tile[0]:XS1_PORT_1B'
                              }, {
                                  'from': 'tile[1]:XS1_PORT_1A',
                                  'to': 'tile[1]:XS1_PORT_1B'
                              }])
Ejemplo n.º 27
0
def do_master_test(arch, stop):
    resources = xmostest.request_resource("xsim")

    binary = 'i2c_master_test/bin/tx_only_%(stop)s_%(arch)s/i2c_master_test_tx_only_%(stop)s_%(arch)s.xe' % {
        'stop': stop,
        'arch': arch,
    }

    checker = I2CMasterChecker(
        "tile[0]:XS1_PORT_1A",
        "tile[0]:XS1_PORT_1B",
        tx_data=[0x99, 0x3A, 0xff],
        expected_speed=400,
        ack_sequence=[True, True, True, True, True, False, False, True])

    tester = xmostest.ComparisonTester(open('ack_test_%s.expect' % stop),
                                       'lib_i2c',
                                       'i2c_master_sim_tests',
                                       'ack_test', {
                                           'speed': 400,
                                           'arch': arch,
                                           'stop': stop
                                       },
                                       regexp=True)

    xmostest.run_on_simulator(resources['xsim'],
                              binary,
                              simthreads=[checker],
                              simargs=['--weak-external-drive'],
                              suppress_multidrive_messages=True,
                              tester=tester)
Ejemplo n.º 28
0
def do_test(mac, arch, rx_clk, rx_phy, tx_clk, tx_phy):
    resources = xmostest.request_resource("xsim")

    testname = 'test_tx'

    binary = '{test}/bin/{mac}_{phy}_{arch}/{test}_{mac}_{phy}_{arch}.xe'.format(
        test=testname, mac=mac, phy=rx_phy.get_name(), arch=arch)

    print "Running {test}: {mac} {phy} phy, {arch} arch at {clk}".format(
        test=testname,
        mac=mac,
        phy=rx_phy.get_name(),
        clk=rx_clk.get_name(),
        arch=arch)

    tester = xmostest.ComparisonTester(
        open('{test}.expect'.format(test=testname)), 'lib_ethernet',
        'basic_tests', testname, {
            'mac': mac,
            'phy': rx_phy.get_name(),
            'clk': rx_clk.get_name(),
            'arch': arch
        })

    simargs = get_sim_args(testname, mac, rx_clk, rx_phy)
    xmostest.run_on_simulator(resources['xsim'],
                              binary,
                              simthreads=[rx_clk, rx_phy, tx_clk, tx_phy],
                              tester=tester,
                              simargs=simargs)
Ejemplo n.º 29
0
def do_test(baud, parity):
    myenv = {'baud': baud, 'parity': parity}
    path = "app_uart_test_half_duplex_combined"
    resources = xmostest.request_resource("xsim")

    hd_checker = UARTHalfDuplexChecker("tile[0]:XS1_PORT_1A",
                                       "tile[0]:XS1_PORT_1A",
                                       "tile[0]:XS1_PORT_1B", Parity[parity],
                                       baud, 4, 1, 8)

    tester = xmostest.ComparisonTester(
        open('test_half_duplex_combined.expect'),
        "lib_uart",
        "sim_regression",
        "half_duplex_combined",
        myenv,
        regexp=True)

    # Only want no parity @ 115200 baud for smoke tests
    if baud != 115200 or parity != "UART_PARITY_NONE":
        tester.set_min_testlevel('nightly')

    xmostest.run_on_simulator(
        resources['xsim'],
        'app_uart_test_half_duplex_combined/bin/smoke/app_uart_test_half_duplex_combined_smoke.xe',
        simthreads=[hd_checker],
        xscope_io=True,
        tester=tester,
        simargs=["--vcd-tracing", "-tile tile[0] -ports -o trace.vcd"],
        clean_before_build=True,
        build_env=myenv)
Ejemplo n.º 30
0
def do_input_events_test(events):
    resources = xmostest.request_resource("xsim")

    path = ''
    if not events:
        path += '_basic'
    else:
        if events:
            path += '_events'

    binary = 'gpio_input_events_test/bin/input' + path + \
        '/gpio_input_events_test_input' + path + '.xe'

    checker = GPIOEventsChecker(test_port="tile[0]:XS1_PORT_4D",
                                expected_test_port_data=0b1010,
                                num_clients=4,
                                trigger_port="tile[0]:XS1_PORT_4B")

    tester = xmostest.ComparisonTester(open('input_events_test%s.expected' %
                                            path),
                                       'lib_gpio',
                                       'gpio_sim_tests',
                                       'input_events_test', {'events': events},
                                       regexp=True)

    xmostest.run_on_simulator(resources['xsim'],
                              binary,
                              simthreads=[checker],
                              tester=tester)