Ejemplo n.º 1
0
def test_axi_adder():
    tests = axi_adder.get_tests()
    slvcodec_config.setup_fusesoc(cores_roots=[coresdir])
    vu = slvcodec_config.setup_vunit(argv=['--dont-catch-exceptions'])
    for coretest in tests:
        test_utils.register_coretest_with_vunit(vu, coretest, testoutput_dir)
    all_ok = vu._main()
    assert all_ok
Ejemplo n.º 2
0
def run_vunit(tests, cores_roots, test_output_directory):
    '''
    Setup vunit, register the tests, and run them.
    '''
    vu = config.setup_vunit()
    config.setup_logging(vu.log_level)
    config.setup_fusesoc(cores_roots)
    for test in tests:
        register_coretest_with_vunit(vu, test, test_output_directory)
    vu.main()
Ejemplo n.º 3
0
def test_vunit_coretest_integration():
    thistestoutput_dir = os.path.join(testoutput_dir, 'coretest_integration')
    if os.path.exists(thistestoutput_dir):
        shutil.rmtree(thistestoutput_dir)
    os.makedirs(thistestoutput_dir)
    coretest = {
        'core_name': 'Dummy',
        'entity_name': 'dummy',
        'param_sets': [{
            'top_params': {},
            'generic_sets': [{'length': 3}],
        }],
        'generator': DummyChecker,
        }
    config.setup_fusesoc(cores_roots=[coresdir])
    vu = config.setup_vunit(argv=['--dont-catch-exceptions'])
    test_utils.register_coretest_with_vunit(vu, coretest, thistestoutput_dir)
    all_ok = vu._main(post_run=None)
    assert all_ok
Ejemplo n.º 4
0
def test_vunit_coretest_integration():
    thistestoutput_dir = os.path.join(testoutput_dir, 'coretest_integration')
    if os.path.exists(thistestoutput_dir):
        shutil.rmtree(thistestoutput_dir)
    os.makedirs(thistestoutput_dir)
    coretest = {
        'core_name': 'Dummy',
        'entity_name': 'dummy',
        'all_generics': [{
            'length': 4
        }, {
            'length': 12
        }],
        'generator': DummyChecker,
    }
    config.setup_fusesoc(cores_roots=[coresdir])
    vu = config.setup_vunit(argv=[])
    test_utils.register_coretest_with_vunit(vu, coretest, thistestoutput_dir)
    all_ok = vu._main()
    assert all_ok
Ejemplo n.º 5
0
        'design_files': new_fns + filenames + [xdc_file],
        'simulation_files': [],
        'ips': ips,
        'top_module': top_entity + '_jtag'
    }
    return files_and_ip


if __name__ == '__main__':
    from slvcodec import config as slvcodec_config
    import axilent
    from axilent.examples import axi_adder
    work_root = '/home/ben/Code/local/deleteme_test_axi_adder'
    corename = 'axi_adder'
    entityname = 'axi_adder'
    slvcodec_config.setup_fusesoc([axilent.coresdir])

    from pyvivado import vivado_project
    p = vivado_project.VivadoProject.from_fusesoc_core(
        directory=work_root,
        corename=corename,
        entityname=entityname,
        generics={},
        top_params={},
        boardname='xilinx:vc709',
        frequency=100,
        overwrite_ok=True,
    )
    tests = [axi_adder.AxiAdderTest()]
    p.implement_deploy_and_run_tests(tests)
Ejemplo n.º 6
0
        'design_files': new_fns + filenames + [xdc_file],
        'simulation_files': [],
        'ips': ips,
        'top_module': top_entity + '_jtag'
        }
    return files_and_ip


if __name__ == '__main__':
    from slvcodec import config as slvcodec_config
    import axilent
    from axilent.examples import axi_adder
    work_root = '/home/ben/Code/local/deleteme_test_axi_adder'
    corename = 'axi_adder'
    entityname = 'axi_adder'
    slvcodec_config.setup_fusesoc([axilent.coresdir])

    from pyvivado import vivado_project
    p = vivado_project.VivadoProject.from_fusesoc_core(
        directory=work_root,
        corename=corename,
        entityname=entityname,
        generics={},
        top_params={},
        boardname='xilinx:vc709',
        frequency=100,
        overwrite_ok=True,
    )
    tests = [axi_adder.AxiAdderTest()]
    p.implement_deploy_and_run_tests(tests)