chiptools.wrappers.simulators.ghdl module

class chiptools.wrappers.simulators.ghdl.Ghdl(project, user_paths)[source]

Bases: chiptools.wrappers.simulator.Simulator

add_library(library)[source]

Create a new source file library for compiling design files into. For example on ModelSim this would invoke the vlib command with the supplied library name.

compile(file_object, cwd=None)[source]

Compile the supplied file_object into the current working library.

executables: List[str] = ['ghdl']
library_exists(libname, workdir)[source]

Return True if the given libname exists in the workdir. GHDL doesn’t create a folder for each library so we have to check for compiled units directly.

name = 'ghdl'
set_library_path(library, path, cwd=None)[source]
set_working_library(library, cwd=None)[source]

Set the current working library where source files are to be compiled to when using the ‘compile’ method.

simulate(library, entity, gui=False, generics=mappingproxy({}), includes=mappingproxy({}), args=(), duration=None)[source]

Invoke the simulator and target the given entity in the given library. If the optional argument gui is set to False the simulator will execute as a console application (where supported) otherwise it will run as a GUI. This function is blocking and will only continue when the simulator terminates. The optional argument generics provides a dictionary of generic name/generic value key, value pairs that are passed to the simulator as a command line argument. This allows you to set generics present on the entity being simulated. The optional argument do can be used to supply a string argument to be interpreted by the simulator as a script to execute after loading.