hwt/simulator/shortcuts.py
def simUnitVcd(simModel, stimulFunctions, outputFile=sys.stdout,
               until=100 * Time.ns):
    """
    Syntax sugar
    If outputFile is string try to open it as file

    :return: hdl simulator object
    """
    assert isinstance(simModel, SimModel), \
        "Class of SimModel is required (got %r)" % (simModel)
    if isinstance(outputFile, str):
        d = os.path.dirname(outputFile)
        if d:
            os.makedirs(d, exist_ok=True)
        with open(outputFile, 'w') as f:
            return _simUnitVcd(simModel, stimulFunctions,
                               f, until)
    else:
        return _simUnitVcd(simModel, stimulFunctions,
                           outputFile, until)
def simUnitVcd(simModel, stimulFunctions, outputFile=sys.stdout,
               until=100 * Time.ns):
    """
    Syntax sugar
    If outputFile is string try to open it as file

    :return: hdl simulator object
    """
    assert isinstance(simModel, SimModel), \
        "Class of SimModel is required (got %r)" % (simModel)
    if isinstance(outputFile, str):
        d = os.path.dirname(outputFile)
        if d:
            os.makedirs(d, exist_ok=True)
        with open(outputFile, 'w') as f:
            return _simUnitVcd(simModel, stimulFunctions,
                               f, until)
    else:
        return _simUnitVcd(simModel, stimulFunctions,
                           outputFile, until)
Syntax sugar
    If outputFile is string try to open it as file

    :return: hdl simulator object