本文整理汇总了Python中vunit.VUnit.from_args方法的典型用法代码示例。如果您正苦于以下问题:Python VUnit.from_args方法的具体用法?Python VUnit.from_args怎么用?Python VUnit.from_args使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类vunit.VUnit
的用法示例。
在下文中一共展示了VUnit.from_args方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。
示例1: dirname
# 需要导入模块: from vunit import VUnit [as 别名]
# 或者: from vunit.VUnit import from_args [as 别名]
# -------
from vunit import VUnit, VUnitCLI
root = dirname(__file__)
# These lines add the option to specify the Bitvis Utility Library root directory
# from the command line (python run.py -b <path to my BVUL root>). They
# can be replaced by a single line, ui = VUnit.from_argv(), if you assign the root
# directory to the bvul_root variable directly
cli = VUnitCLI()
cli.parser.add_argument('-b', '--bvul-root',
required=True,
help='Bitvis Utility Library root directory')
args = cli.parse_args()
ui = VUnit.from_args(args)
# ------
# Create VHDL libraries and add the related BVUL files to these
bvul_root = args.bvul_root
bvul_lib = ui.add_library('bitvis_util')
bvul_lib.add_source_files(join(bvul_root, 'bitvis_util', 'src2008', '*.vhd'))
bitvis_vip_spi_lib = ui.add_library('bitvis_vip_sbi')
bitvis_vip_spi_lib.add_source_files(join(bvul_root, 'bitvis_vip_sbi', 'src', '*.vhd'))
# Add all testbenches to lib
lib = ui.add_library('lib')
lib.add_source_files(join(root, 'test', '*.vhd'))
示例2: VUnitCLI
# 需要导入模块: from vunit import VUnit [as 别名]
# 或者: from vunit.VUnit import from_args [as 别名]
# WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN
# ACTION OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF
# OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
from collections import OrderedDict
import os.path
from fusesoc.config import Config
from fusesoc.coremanager import CoreManager, DependencyError
from vunit import VUnitCLI, VUnit
cli = VUnitCLI()
cli.parser.add_argument('--core', nargs=1, required=True, help='Top-level FuseSoC core')
args = cli.parse_args()
# Create VUnit instance by parsing command line arguments
vu = VUnit.from_args(args=args)
top_core = args.core[0]
#Create singleton instances for core manager and configuration handler
#Configuration manager is not needed in this example
cm = CoreManager()
#config = Config()
#Add core libraries that were picked up from fusesoc.conf by the config handler
#Not really necessary for this example as we can just add 'corelib' manually
try:
#cm.add_cores_root(config.cores_root)
cm.add_cores_root('corelib')
except (RuntimeError, IOError) as e:
pr_warn("Failed to register cores root '{}'".format(str(e)))