Ejemplo n.º 1
0
 def __init__(self):
     # config
     self.cli = VUnitCLI()
     self.args = self.cli.parse_args()
     self.args.num_threads = 4
     self.ui = VUnit.from_args(self.args)
     self.lib = self.ui.add_library("lib")
Ejemplo n.º 2
0
def get_args(root):
    """
    Create and extract command line arguments
    """
    cli = VUnitCLI()
    cli.parser.add_argument(
        '-s',
        '--vendor-verification',
        action='store_true',
        help='Use vendor ieee library for internal package references.')
    cli.parser.add_argument(
        '-a',
        '--vhdl-assert-stop-level',
        default="all",
        choices=["all", "warning", "error", "failure"],
        help=('VHDL assert stop level. "all" will use all levels.'))
    args = cli.parse_args()

    if args.xunit_xml is None:
        args.xunit_xml = str(root / "result.xml")

    xunit_xml_path = Path(args.xunit_xml)
    if xunit_xml_path.exists():
        xunit_xml_path.unlink()

    return args
Ejemplo n.º 3
0
def setup_vunit(argv=None):
    '''
    Sets up vunit logging and returns the VUnit object.
    '''
    args = VUnitCLI().parse_args(argv=argv)
    log_level = args.log_level
    vu = VUnit.from_args(args)
    vu.log_level = getattr(logging, log_level.upper())
    return vu
Ejemplo n.º 4
0
 def __init__(self):
     # config
     self.cli = VUnitCLI()
     self.args = self.cli.parse_args()
     self.args.gtkwave_fmt = 'vcd'
     self.args.num_threads = 4
     #self.args.log_level = 'info'
     self.ui = VUnit.from_args(self.args)
     self.lib = self.ui.add_library("lib")
Ejemplo n.º 5
0
from os.path import join, dirname
from vunit import VUnit, VUnitCLI
from vunit.simulator_factory import SIMULATOR_FACTORY
from run_support import run_with_compile_errors

root = dirname(__file__)

vhdl_standard = ("2019" if SIMULATOR_FACTORY.select_simulator().name
                 == "rivierapro" else "2008")

args = VUnitCLI().parse_args()

# keep_going is a planned VUnit feature which adds support for dealing with testbenches
# that don't compile
if "keep_going" in args:
    args.keep_going = True

ui = VUnit.from_args(args, vhdl_standard=vhdl_standard)
vhdl_2008 = ui.add_library("vhdl_2008")
vhdl_2019 = ui.add_library("vhdl_2019")
vhdl_2008.add_source_files(join(root, "vhdl_2008", "*.vhd"))
vhdl_2019.add_source_files(join(root, "vhdl_2019", "*.vhd"))

if "keep_going" in args:
    ui.main()
else:
    # Workaround while keep_going isn't supported
    run_with_compile_errors(ui, args, vhdl_standard)
Ejemplo n.º 6
0
def setup_vunit(argv=None):
    args = VUnitCLI().parse_args(argv=argv)
    log_level = args.log_level
    vu = VUnit.from_args(args)
    vu.log_level = getattr(logging, log_level.upper())
    return vu