chiptools.wrappers.simulators.modelsim module

class chiptools.wrappers.simulators.modelsim.Modelsim(project, user_paths)[source]

Bases: chiptools.wrappers.simulator.Simulator

ModelsimSimulator provides a wrapper around ModelSim to allow simulations to be performed using the data contained in the supplied Project and Options instances. The ModelsimSimulator wrapper can be used to create libraries, compile files and invoke ModelSim in either interactive (GUI) mode or as a console application to support automated unit testing of the design.

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] = ['vcom', 'vlib', 'vlog', 'vmap', 'vsim']
name = 'modelsim'
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={}, includes={}, 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 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 allowsyou 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.