elasticai.creator.testing.cocotb_runner#

Module Contents#

Functions#

get_and_create_sim_build_dir

run_cocotb_sim_for_src_dir

Function for running Verilog/VHDL Simulation using COCOTB environment

run_cocotb_sim

Function for running Verilog/VHDL Simulation using COCOTB environment

API#

elasticai.creator.testing.cocotb_runner.get_and_create_sim_build_dir(folder_name: str) pathlib.Path[source]#
elasticai.creator.testing.cocotb_runner.run_cocotb_sim_for_src_dir(src_files: collections.abc.Iterable[str] | collections.abc.Iterable[pathlib.Path], top_module_name: str, cocotb_test_module: str, path2src: str = '', defines: dict = {}, params: dict = {}, timescale: tuple[str, str] = ('1ps', '1fs'), en_debug_mode: bool = True, build_waveforms: bool = False) None[source]#

Function for running Verilog/VHDL Simulation using COCOTB environment

Parameters:
  • src_files – List with source files of each used Verilog/VHDL file

  • top_module_name – Name of the top module (from file)

  • cocotb_test_module – Fully qualified name of python module containing cotName of the cocotb testbench in Python

  • path2src – Path to the folder in which all src files are available for testing

  • defines – Dictionary of parameters to pass to the module [key: value, …] - usable only in Verilog

  • params – Dictionary of parameters to pass to the module [key: value, …] - value will be ignored

  • timescale – Tuple with Timescale value for simulation (step, accuracy)

  • en_debug_mode – Enable debug mode

  • build_waveforms – Boolean for building the waveforms of the stimuli (will be saved in build_sim folder)

Returns:

None

elasticai.creator.testing.cocotb_runner.run_cocotb_sim(src_files: collections.abc.Iterable[str] | collections.abc.Iterable[pathlib.Path], top_module_name: str, cocotb_test_module: str, defines: dict[str, Any] = {}, params: dict[str, Any] = {}, timescale: tuple[str, str] = ('1ps', '1fs'), en_debug_mode: bool = True, build_waveforms: bool = False) None[source]#

Function for running Verilog/VHDL Simulation using COCOTB environment

Parameters:
  • src_files – List with source files of each used Verilog/VHDL file

  • top_module_name – Name of the top module (from file)

  • cocotb_test_module – Fully qualified name of python module containing cotName of the cocotb testbench in Python

  • defines – Dictionary of parameters to pass to the module [key: value, …] - usable only in Verilog

  • params – Dictionary of parameters to pass to the module [key: value, …] - value will be ignored

  • timescale – Tuple with Timescale value for simulation (step, accuracy)

  • en_debug_mode – Enable debug mode

  • build_waveforms – Boolean for building the waveforms of the stimuli (will be saved in build_sim folder)

Returns:

None