Hide keyboard shortcuts

Hot-keys on this page

r m x p   toggle line displays

j k   next/prev highlighted chunk

0   (zero) top of page

1   (one) first highlighted chunk

1# -------------------------------------------------------------------------------------------------- 

2# Copyright (c) Lukas Vik. All rights reserved. 

3# 

4# This file is part of the tsfpga project. 

5# https://tsfpga.com 

6# https://gitlab.com/tsfpga/tsfpga 

7# -------------------------------------------------------------------------------------------------- 

8 

9from .simlib_commercial import VivadoSimlibCommercial 

10from .simlib_ghdl import VivadoSimlibGhdl 

11 

12 

13class VivadoSimlib: 

14 

15 """ 

16 Factory class for getting a Vivado simlib API. 

17 """ 

18 

19 @staticmethod 

20 def init(output_path, vunit_proj, vivado_path=None): 

21 """ 

22 Get a Vivado simlib API suitable for your current simulator. Uses VUnit mechanism 

23 for detecting the simulator currently in use. 

24 

25 Arguments: 

26 output_path (`pathlib.Path`): The compiled simlib will be placed here. 

27 vunit_proj: The VUnit project that is used to run simulation. 

28 vivado_path (`pathlib.Path`): Path to Vivado executable. If left out, the default 

29 from PATH will be used. 

30 Return: 

31 A :class:`.VivadoSimlibCommon` child object. 

32 """ 

33 simulator_interface = vunit_proj._simulator_class # pylint: disable=protected-access 

34 if simulator_interface.name == "ghdl": 

35 return VivadoSimlibGhdl(output_path, vunit_proj, simulator_interface, vivado_path) 

36 return VivadoSimlibCommercial(output_path, vunit_proj, simulator_interface, vivado_path)