# Table of Contents - [Welcome to cocotb’s documentation! — cocotb 1.9.2 documentation](#welcome-to-cocotb-s-documentation-cocotb-1-9-2-documentation) - [Welcome to cocotb’s documentation! — cocotb 1.9.2 documentation](#welcome-to-cocotb-s-documentation-cocotb-1-9-2-documentation) - [Welcome to cocotb’s documentation! — cocotb 1.8.0 documentation](#welcome-to-cocotb-s-documentation-cocotb-1-8-0-documentation) - [Welcome to cocotb’s documentation! — cocotb 1.8.1 documentation](#welcome-to-cocotb-s-documentation-cocotb-1-8-1-documentation) - [Welcome to cocotb’s documentation! — cocotb 1.7.1 documentation](#welcome-to-cocotb-s-documentation-cocotb-1-7-1-documentation) - [Welcome to cocotb’s documentation! — cocotb 1.7.0 documentation](#welcome-to-cocotb-s-documentation-cocotb-1-7-0-documentation) - [Welcome to cocotb’s Documentation! — cocotb 2.0.0.dev1+1700f3f documentation](#welcome-to-cocotb-s-documentation-cocotb-2-0-0-dev1-1700f3f-documentation) - [Welcome to cocotb’s documentation! — cocotb 1.7.2 documentation](#welcome-to-cocotb-s-documentation-cocotb-1-7-2-documentation) - [Welcome to cocotb’s documentation! — cocotb 1.6.2 documentation](#welcome-to-cocotb-s-documentation-cocotb-1-6-2-documentation) - [Welcome to cocotb’s documentation! — cocotb 1.6.1 documentation](#welcome-to-cocotb-s-documentation-cocotb-1-6-1-documentation) - [Welcome to cocotb’s documentation! — cocotb 1.9.1 documentation](#welcome-to-cocotb-s-documentation-cocotb-1-9-1-documentation) - [Welcome to cocotb’s documentation! — cocotb 1.9.0 documentation](#welcome-to-cocotb-s-documentation-cocotb-1-9-0-documentation) - [Welcome to cocotb’s documentation! — cocotb 1.6.0.dev0+g0872e05c.d20210320 documentation](#welcome-to-cocotb-s-documentation-cocotb-1-6-0-dev0-g0872e05c-d20210320-documentation) - [Welcome to cocotb’s documentation! — cocotb 1.6.0 documentation](#welcome-to-cocotb-s-documentation-cocotb-1-6-0-documentation) - [Welcome to cocotb’s documentation! — cocotb 1.4.0 documentation](#welcome-to-cocotb-s-documentation-cocotb-1-4-0-documentation) - [Welcome to cocotb’s documentation! — cocotb 1.6.0.dev0+gd1946447.d20210311 documentation](#welcome-to-cocotb-s-documentation-cocotb-1-6-0-dev0-gd1946447-d20210311-documentation) - [Welcome to Cocotb’s documentation! — cocotb 1.1 documentation](#welcome-to-cocotb-s-documentation-cocotb-1-1-documentation) - [Welcome to cocotb’s documentation! — cocotb 1.6.0.dev0+gec99a877.d20210503 documentation](#welcome-to-cocotb-s-documentation-cocotb-1-6-0-dev0-gec99a877-d20210503-documentation) - [Welcome to Cocotb’s documentation! — cocotb 1.3.1 documentation](#welcome-to-cocotb-s-documentation-cocotb-1-3-1-documentation) - [Welcome to Cocotb’s documentation! — cocotb 1.3.0 documentation](#welcome-to-cocotb-s-documentation-cocotb-1-3-0-documentation) - [Welcome to Cocotb’s documentation! — cocotb 1.1 documentation](#welcome-to-cocotb-s-documentation-cocotb-1-1-documentation) - [Unknown](#unknown) - [Installation — cocotb 1.9.2 documentation](#installation-cocotb-1-9-2-documentation) - [Writing Testbenches — cocotb 1.9.2 documentation](#writing-testbenches-cocotb-1-9-2-documentation) - [Building HDL and Running Tests — cocotb 1.9.2 documentation](#building-hdl-and-running-tests-cocotb-1-9-2-documentation) - [Coroutines and Tasks — cocotb 1.9.2 documentation](#coroutines-and-tasks-cocotb-1-9-2-documentation) - [Rotating Log Files — cocotb 1.9.2 documentation](#rotating-log-files-cocotb-1-9-2-documentation) - [Triggers — cocotb 1.9.2 documentation](#triggers-cocotb-1-9-2-documentation) - [Python Module Index — cocotb 1.9.2 documentation](#python-module-index-cocotb-1-9-2-documentation) - [Extending existing build flows — cocotb 1.9.2 documentation](#extending-existing-build-flows-cocotb-1-9-2-documentation) - [Troubleshooting — cocotb 1.9.2 documentation](#troubleshooting-cocotb-1-9-2-documentation) - [Quickstart Guide — cocotb 1.9.2 documentation](#quickstart-guide-cocotb-1-9-2-documentation) - [Platform Support — cocotb 1.9.2 documentation](#platform-support-cocotb-1-9-2-documentation) - [Simulator Support — cocotb 1.9.2 documentation](#simulator-support-cocotb-1-9-2-documentation) - [Build options and Environment Variables — cocotb 1.9.2 documentation](#build-options-and-environment-variables-cocotb-1-9-2-documentation) - [Index — cocotb 1.9.2 documentation](#index-cocotb-1-9-2-documentation) - [Contributors — cocotb 1.9.2 documentation](#contributors-cocotb-1-9-2-documentation) - [Roadmap — cocotb 1.9.2 documentation](#roadmap-cocotb-1-9-2-documentation) - [Writing cocotb extensions — cocotb 1.9.2 documentation](#writing-cocotb-extensions-cocotb-1-9-2-documentation) - [Further Resources — cocotb 1.9.2 documentation](#further-resources-cocotb-1-9-2-documentation) - [Reference Card — cocotb 1.9.2 documentation](#reference-card-cocotb-1-9-2-documentation) - [Glossary — cocotb 1.9.2 documentation](#glossary-cocotb-1-9-2-documentation) - [GPI Library Reference — cocotb 1.9.2 documentation](#gpi-library-reference-cocotb-1-9-2-documentation) - [Installing the Development Version — cocotb 1.9.2 documentation](#installing-the-development-version-cocotb-1-9-2-documentation) - [More Examples — cocotb 1.9.2 documentation](#more-examples-cocotb-1-9-2-documentation) - [Release Notes — cocotb 1.9.2 documentation](#release-notes-cocotb-1-9-2-documentation) - [Library Reference — cocotb 1.9.2 documentation](#library-reference-cocotb-1-9-2-documentation) - [Quickstart Guide — cocotb 1.9.2 documentation](#quickstart-guide-cocotb-1-9-2-documentation) - [Unknown](#unknown) - [Unknown](#unknown) - [Introduction — cocotb 1.1 documentation](#introduction-cocotb-1-1-documentation) - [Triggers — cocotb 1.1 documentation](#triggers-cocotb-1-1-documentation) - [Roadmap — cocotb 1.1 documentation](#roadmap-cocotb-1-1-documentation) - [Troubleshooting — cocotb 1.1 documentation](#troubleshooting-cocotb-1-1-documentation) - [Simulator Support — cocotb 1.1 documentation](#simulator-support-cocotb-1-1-documentation) - [Coroutines — cocotb 1.1 documentation](#coroutines-cocotb-1-1-documentation) - [Build options and Environment Variables — cocotb 1.1 documentation](#build-options-and-environment-variables-cocotb-1-1-documentation) - [Tutorial: Ping — cocotb 1.1 documentation](#tutorial-ping-cocotb-1-1-documentation) - [Tutorial: Driver Cosimulation — cocotb 1.1 documentation](#tutorial-driver-cosimulation-cocotb-1-1-documentation) - [Quickstart Guide — cocotb 1.1 documentation](#quickstart-guide-cocotb-1-1-documentation) - [Testbench Tools — cocotb 1.1 documentation](#testbench-tools-cocotb-1-1-documentation) - [Tutorial: Endian Swapper — cocotb 1.1 documentation](#tutorial-endian-swapper-cocotb-1-1-documentation) - [Introduction — cocotb 1.3.1 documentation](#introduction-cocotb-1-3-1-documentation) - [Introduction — cocotb 1.3.0 documentation](#introduction-cocotb-1-3-0-documentation) - [Introduction — cocotb 1.1 documentation](#introduction-cocotb-1-1-documentation) - [Index — cocotb 1.1 documentation](#index-cocotb-1-1-documentation) - [Quickstart Guide — cocotb 1.3.1 documentation](#quickstart-guide-cocotb-1-3-1-documentation) - [Quickstart Guide — cocotb 1.3.0 documentation](#quickstart-guide-cocotb-1-3-0-documentation) - [Build options and Environment Variables — cocotb 1.3.1 documentation](#build-options-and-environment-variables-cocotb-1-3-1-documentation) - [Quickstart Guide — cocotb 1.1 documentation](#quickstart-guide-cocotb-1-1-documentation) - [Build options and Environment Variables — cocotb 1.3.0 documentation](#build-options-and-environment-variables-cocotb-1-3-0-documentation) - [Contributors — cocotb 1.6.0.dev0+gec99a877.d20210503 documentation](#contributors-cocotb-1-6-0-dev0-gec99a877-d20210503-documentation) - [Python Module Index — cocotb 1.1 documentation](#python-module-index-cocotb-1-1-documentation) - [Build options and Environment Variables — cocotb 1.1 documentation](#build-options-and-environment-variables-cocotb-1-1-documentation) - [Coroutines — cocotb 1.3.1 documentation](#coroutines-cocotb-1-3-1-documentation) - [Coroutines — cocotb 1.3.0 documentation](#coroutines-cocotb-1-3-0-documentation) - [Release Notes — cocotb 1.6.0.dev0+gec99a877.d20210503 documentation](#release-notes-cocotb-1-6-0-dev0-gec99a877-d20210503-documentation) - [Search — cocotb 1.1 documentation](#search-cocotb-1-1-documentation) - [Coroutines — cocotb 1.1 documentation](#coroutines-cocotb-1-1-documentation) - [Triggers — cocotb 1.3.1 documentation](#triggers-cocotb-1-3-1-documentation) - [Triggers — cocotb 1.3.0 documentation](#triggers-cocotb-1-3-0-documentation) - [Further Resources — cocotb 1.6.0.dev0+gec99a877.d20210503 documentation](#further-resources-cocotb-1-6-0-dev0-gec99a877-d20210503-documentation) - [Triggers — cocotb 1.1 documentation](#triggers-cocotb-1-1-documentation) - [Testbench Tools — cocotb 1.3.1 documentation](#testbench-tools-cocotb-1-3-1-documentation) - [Unknown](#unknown) - [Unknown](#unknown) - [Unknown](#unknown) - [Unknown](#unknown) - [Unknown](#unknown) - [Unknown](#unknown) - [Unknown](#unknown) - [Class FliEnumObjHdl — cocotb 1.4.0 documentation](#class-flienumobjhdl-cocotb-1-4-0-documentation) - [Class FliImpl — cocotb 1.4.0 documentation](#class-fliimpl-cocotb-1-4-0-documentation) - [Class FliIntObjHdl — cocotb 1.4.0 documentation](#class-fliintobjhdl-cocotb-1-4-0-documentation) - [Class FliNextPhaseCbHdl — cocotb 1.4.0 documentation](#class-flinextphasecbhdl-cocotb-1-4-0-documentation) - [Class FliIterator — cocotb 1.4.0 documentation](#class-fliiterator-cocotb-1-4-0-documentation) - [Class FliLogicObjHdl — cocotb 1.4.0 documentation](#class-flilogicobjhdl-cocotb-1-4-0-documentation) - [Class FliObj — cocotb 1.4.0 documentation](#class-fliobj-cocotb-1-4-0-documentation) - [Class FliObjHdl — cocotb 1.4.0 documentation](#class-fliobjhdl-cocotb-1-4-0-documentation) - [Class FliReadOnlyCbHdl — cocotb 1.4.0 documentation](#class-flireadonlycbhdl-cocotb-1-4-0-documentation) - [Class FliProcessCbHdl — cocotb 1.4.0 documentation](#class-fliprocesscbhdl-cocotb-1-4-0-documentation) - [Class FliRealObjHdl — cocotb 1.4.0 documentation](#class-flirealobjhdl-cocotb-1-4-0-documentation) - [Class FliShutdownCbHdl — cocotb 1.4.0 documentation](#class-flishutdowncbhdl-cocotb-1-4-0-documentation) - [Class FliReadWriteCbHdl — cocotb 1.4.0 documentation](#class-flireadwritecbhdl-cocotb-1-4-0-documentation) - [Class FliSignalObjHdl — cocotb 1.4.0 documentation](#class-flisignalobjhdl-cocotb-1-4-0-documentation) - [Class FliStartupCbHdl — cocotb 1.4.0 documentation](#class-flistartupcbhdl-cocotb-1-4-0-documentation) - [Class FliSignalCbHdl — cocotb 1.4.0 documentation](#class-flisignalcbhdl-cocotb-1-4-0-documentation) - [Class FliSimPhaseCbHdl — cocotb 1.4.0 documentation](#class-flisimphasecbhdl-cocotb-1-4-0-documentation) - [Class FliTimedCbHdl — cocotb 1.4.0 documentation](#class-flitimedcbhdl-cocotb-1-4-0-documentation) - [Class FliStringObjHdl — cocotb 1.4.0 documentation](#class-flistringobjhdl-cocotb-1-4-0-documentation) - [Class FliTimerCache — cocotb 1.4.0 documentation](#class-flitimercache-cocotb-1-4-0-documentation) - [Class GpiCbHdl — cocotb 1.4.0 documentation](#class-gpicbhdl-cocotb-1-4-0-documentation) - [Class FliValueObjHdl — cocotb 1.4.0 documentation](#class-flivalueobjhdl-cocotb-1-4-0-documentation) - [Class GpiImplInterface — cocotb 1.4.0 documentation](#class-gpiimplinterface-cocotb-1-4-0-documentation) - [Class GpiHdl — cocotb 1.4.0 documentation](#class-gpihdl-cocotb-1-4-0-documentation) - [Class GpiIterator — cocotb 1.4.0 documentation](#class-gpiiterator-cocotb-1-4-0-documentation) - [Class GpiIteratorMapping — cocotb 1.4.0 documentation](#class-gpiiteratormapping-cocotb-1-4-0-documentation) - [Class GpiObjHdl — cocotb 1.4.0 documentation](#class-gpiobjhdl-cocotb-1-4-0-documentation) - [Class GpiValueCbHdl — cocotb 1.4.0 documentation](#class-gpivaluecbhdl-cocotb-1-4-0-documentation) - [Class GpiSignalObjHdl — cocotb 1.4.0 documentation](#class-gpisignalobjhdl-cocotb-1-4-0-documentation) - [Class VhpiArrayObjHdl — cocotb 1.4.0 documentation](#class-vhpiarrayobjhdl-cocotb-1-4-0-documentation) - [Class VhpiCbHdl — cocotb 1.4.0 documentation](#class-vhpicbhdl-cocotb-1-4-0-documentation) - [Class VhpiImpl — cocotb 1.4.0 documentation](#class-vhpiimpl-cocotb-1-4-0-documentation) - [Class VhpiIterator — cocotb 1.4.0 documentation](#class-vhpiiterator-cocotb-1-4-0-documentation) - [Class VhpiLogicSignalObjHdl — cocotb 1.4.0 documentation](#class-vhpilogicsignalobjhdl-cocotb-1-4-0-documentation) - [Class VhpiObjHdl — cocotb 1.4.0 documentation](#class-vhpiobjhdl-cocotb-1-4-0-documentation) - [Class VhpiNextPhaseCbHdl — cocotb 1.4.0 documentation](#class-vhpinextphasecbhdl-cocotb-1-4-0-documentation) - [Class VhpiReadOnlyCbHdl — cocotb 1.4.0 documentation](#class-vhpireadonlycbhdl-cocotb-1-4-0-documentation) - [Class VhpiReadwriteCbHdl — cocotb 1.4.0 documentation](#class-vhpireadwritecbhdl-cocotb-1-4-0-documentation) - [Class VhpiShutdownCbHdl — cocotb 1.4.0 documentation](#class-vhpishutdowncbhdl-cocotb-1-4-0-documentation) - [Class VhpiSignalObjHdl — cocotb 1.4.0 documentation](#class-vhpisignalobjhdl-cocotb-1-4-0-documentation) - [Class VhpiTimedCbHdl — cocotb 1.4.0 documentation](#class-vhpitimedcbhdl-cocotb-1-4-0-documentation) - [Class VhpiStartupCbHdl — cocotb 1.4.0 documentation](#class-vhpistartupcbhdl-cocotb-1-4-0-documentation) - [File FliCbHdl.cpp — cocotb 1.4.0 documentation](#file-flicbhdl-cpp-cocotb-1-4-0-documentation) - [File FliImpl.cpp — cocotb 1.4.0 documentation](#file-fliimpl-cpp-cocotb-1-4-0-documentation) - [File FliImpl.h — cocotb 1.4.0 documentation](#file-fliimpl-h-cocotb-1-4-0-documentation) - [Class VhpiValueCbHdl — cocotb 1.4.0 documentation](#class-vhpivaluecbhdl-cocotb-1-4-0-documentation) - [Class VpiArrayObjHdl — cocotb 1.4.0 documentation](#class-vpiarrayobjhdl-cocotb-1-4-0-documentation) - [Class VpiCbHdl — cocotb 1.4.0 documentation](#class-vpicbhdl-cocotb-1-4-0-documentation) - [Class VpiImpl — cocotb 1.4.0 documentation](#class-vpiimpl-cocotb-1-4-0-documentation) - [File GpiCbHdl.cpp — cocotb 1.4.0 documentation](#file-gpicbhdl-cpp-cocotb-1-4-0-documentation) - [Class VpiIterator — cocotb 1.4.0 documentation](#class-vpiiterator-cocotb-1-4-0-documentation) - [Class VpiNextPhaseCbHdl — cocotb 1.4.0 documentation](#class-vpinextphasecbhdl-cocotb-1-4-0-documentation) - [File FliObjHdl.cpp — cocotb 1.4.0 documentation](#file-fliobjhdl-cpp-cocotb-1-4-0-documentation) - [Class VpiReadOnlyCbHdl — cocotb 1.4.0 documentation](#class-vpireadonlycbhdl-cocotb-1-4-0-documentation) - [Class VpiObjHdl — cocotb 1.4.0 documentation](#class-vpiobjhdl-cocotb-1-4-0-documentation) - [Class VpiSignalObjHdl — cocotb 1.4.0 documentation](#class-vpisignalobjhdl-cocotb-1-4-0-documentation) - [Class VpiReadwriteCbHdl — cocotb 1.4.0 documentation](#class-vpireadwritecbhdl-cocotb-1-4-0-documentation) - [Class VpiShutdownCbHdl — cocotb 1.4.0 documentation](#class-vpishutdowncbhdl-cocotb-1-4-0-documentation) - [Class VpiSingleIterator — cocotb 1.4.0 documentation](#class-vpisingleiterator-cocotb-1-4-0-documentation) - [Class VpiTimedCbHdl — cocotb 1.4.0 documentation](#class-vpitimedcbhdl-cocotb-1-4-0-documentation) - [Class VpiStartupCbHdl — cocotb 1.4.0 documentation](#class-vpistartupcbhdl-cocotb-1-4-0-documentation) - [Class VpiValueCbHdl — cocotb 1.4.0 documentation](#class-vpivaluecbhdl-cocotb-1-4-0-documentation) - [File GpiCommon.cpp — cocotb 1.4.0 documentation](#file-gpicommon-cpp-cocotb-1-4-0-documentation) - [File VhpiCbHdl.cpp — cocotb 1.4.0 documentation](#file-vhpicbhdl-cpp-cocotb-1-4-0-documentation) - [File VhpiImpl.cpp — cocotb 1.4.0 documentation](#file-vhpiimpl-cpp-cocotb-1-4-0-documentation) - [File VhpiImpl.h — cocotb 1.4.0 documentation](#file-vhpiimpl-h-cocotb-1-4-0-documentation) - [File VpiCbHdl.cpp — cocotb 1.4.0 documentation](#file-vpicbhdl-cpp-cocotb-1-4-0-documentation) - [File VpiImpl.cpp — cocotb 1.4.0 documentation](#file-vpiimpl-cpp-cocotb-1-4-0-documentation) - [File cocotb_utils.cpp — cocotb 1.4.0 documentation](#file-cocotb-utils-cpp-cocotb-1-4-0-documentation) - [File VpiImpl.h — cocotb 1.4.0 documentation](#file-vpiimpl-h-cocotb-1-4-0-documentation) - [File cocotb_utils.h — cocotb 1.4.0 documentation](#file-cocotb-utils-h-cocotb-1-4-0-documentation) - [File embed.h — cocotb 1.4.0 documentation](#file-embed-h-cocotb-1-4-0-documentation) - [File gpi.h — cocotb 1.4.0 documentation](#file-gpi-h-cocotb-1-4-0-documentation) - [File gpi_embed.cpp — cocotb 1.4.0 documentation](#file-gpi-embed-cpp-cocotb-1-4-0-documentation) - [File gpi_logging.cpp — cocotb 1.4.0 documentation](#file-gpi-logging-cpp-cocotb-1-4-0-documentation) - [File gpi_logging.h — cocotb 1.4.0 documentation](#file-gpi-logging-h-cocotb-1-4-0-documentation) - [File gpi_priv.h — cocotb 1.4.0 documentation](#file-gpi-priv-h-cocotb-1-4-0-documentation) - [File simulatormodule.cpp — cocotb 1.4.0 documentation](#file-simulatormodule-cpp-cocotb-1-4-0-documentation) - [File simulatormodule.h — cocotb 1.4.0 documentation](#file-simulatormodule-h-cocotb-1-4-0-documentation) - [File sv_vpi_user.h — cocotb 1.4.0 documentation](#file-sv-vpi-user-h-cocotb-1-4-0-documentation) - [Unknown](#unknown) - [Unknown](#unknown) - [Unknown](#unknown) - [Unknown](#unknown) - [Unknown](#unknown) - [Unknown](#unknown) - [Unknown](#unknown) - [Unknown](#unknown) - [Unknown](#unknown) - [Unknown](#unknown) - [Unknown](#unknown) - [Struct _log_level_table — cocotb 1.4.0 documentation](#struct-log-level-table-cocotb-1-4-0-documentation) - [Struct t_vpi_arrayvalue — cocotb 1.4.0 documentation](#struct-t-vpi-arrayvalue-cocotb-1-4-0-documentation) - [Struct t_vpi_attempt_info — cocotb 1.4.0 documentation](#struct-t-vpi-attempt-info-cocotb-1-4-0-documentation) - [Struct sim_time — cocotb 1.4.0 documentation](#struct-sim-time-cocotb-1-4-0-documentation) - [Struct t_vpi_delay — cocotb 1.4.0 documentation](#struct-t-vpi-delay-cocotb-1-4-0-documentation) - [Struct t_vpi_error_info — cocotb 1.4.0 documentation](#struct-t-vpi-error-info-cocotb-1-4-0-documentation) - [Struct callback_data — cocotb 1.4.0 documentation](#struct-callback-data-cocotb-1-4-0-documentation) - [Struct t_vpi_assertion_step_info — cocotb 1.4.0 documentation](#struct-t-vpi-assertion-step-info-cocotb-1-4-0-documentation) - [Struct t_cb_data — cocotb 1.4.0 documentation](#struct-t-cb-data-cocotb-1-4-0-documentation) - [Unknown](#unknown) - [File vhpi_user_ext.h — cocotb 1.4.0 documentation](#file-vhpi-user-ext-h-cocotb-1-4-0-documentation) - [File verilator.cpp — cocotb 1.4.0 documentation](#file-verilator-cpp-cocotb-1-4-0-documentation) - [File vpi_user_ext.h — cocotb 1.4.0 documentation](#file-vpi-user-ext-h-cocotb-1-4-0-documentation) - [File vhpi_user.h — cocotb 1.4.0 documentation](#file-vhpi-user-h-cocotb-1-4-0-documentation) - [Unknown](#unknown) - [Unknown](#unknown) - [Unknown](#unknown) - [Unknown](#unknown) - [Unknown](#unknown) - [Unknown](#unknown) - [Unknown](#unknown) - [Struct t_vpi_value — cocotb 1.4.0 documentation](#struct-t-vpi-value-cocotb-1-4-0-documentation) - [Struct t_vpi_strengthval — cocotb 1.4.0 documentation](#struct-t-vpi-strengthval-cocotb-1-4-0-documentation) - [Struct t_vpi_systf_data — cocotb 1.4.0 documentation](#struct-t-vpi-systf-data-cocotb-1-4-0-documentation) - [Struct t_vpi_time — cocotb 1.4.0 documentation](#struct-t-vpi-time-cocotb-1-4-0-documentation) - [File vpi_user.h — cocotb 1.4.0 documentation](#file-vpi-user-h-cocotb-1-4-0-documentation) - [Unknown](#unknown) - [Struct t_vpi_vecval — cocotb 1.4.0 documentation](#struct-t-vpi-vecval-cocotb-1-4-0-documentation) - [Unknown](#unknown) - [Struct t_vpi_vlog_info — cocotb 1.4.0 documentation](#struct-t-vpi-vlog-info-cocotb-1-4-0-documentation) - [Struct vhpiPhysS — cocotb 1.4.0 documentation](#struct-vhpiphyss-cocotb-1-4-0-documentation) - [Struct vhpiErrorInfoS — cocotb 1.4.0 documentation](#struct-vhpierrorinfos-cocotb-1-4-0-documentation) - [Struct vhpiCbDataS — cocotb 1.4.0 documentation](#struct-vhpicbdatas-cocotb-1-4-0-documentation) - [Struct vhpiTimeS — cocotb 1.4.0 documentation](#struct-vhpitimes-cocotb-1-4-0-documentation) - [Struct vhpiForeignDataS — cocotb 1.4.0 documentation](#struct-vhpiforeigndatas-cocotb-1-4-0-documentation) - [Struct list — cocotb 1.4.0 documentation](#struct-list-cocotb-1-4-0-documentation) - [Unknown](#unknown) - [Unknown](#unknown) - [Unknown](#unknown) - [Unknown](#unknown) - [Unknown](#unknown) - [Unknown](#unknown) - [Unknown](#unknown) - [Unknown](#unknown) - [Unknown](#unknown) - [Unknown](#unknown) - [Unknown](#unknown) - [Unknown](#unknown) - [Unknown](#unknown) - [Unknown](#unknown) - [Unknown](#unknown) - [Unknown](#unknown) - [Unknown](#unknown) - [Unknown](#unknown) - [Unknown](#unknown) - [Struct vhpiValueS — cocotb 1.4.0 documentation](#struct-vhpivalues-cocotb-1-4-0-documentation) - [Testbench Tools — cocotb 1.1 documentation](#testbench-tools-cocotb-1-1-documentation) - [Testbench Tools — cocotb 1.3.0 documentation](#testbench-tools-cocotb-1-3-0-documentation) - [Index — cocotb 1.6.0.dev0+gec99a877.d20210503 documentation](#index-cocotb-1-6-0-dev0-gec99a877-d20210503-documentation) --- # Welcome to cocotb’s documentation! — cocotb 1.9.2 documentation * [](https://docs.cocotb.org/en/stable/index.html#) * Welcome to cocotb’s documentation! * [View page source](https://docs.cocotb.org/en/stable/_sources/index.rst.txt) * * * Welcome to cocotb’s documentation![](https://docs.cocotb.org/en/stable/index.html#welcome-to-cocotb-s-documentation "Link to this heading") ============================================================================================================================================= What is cocotb?[](https://docs.cocotb.org/en/stable/index.html#what-is-cocotb "Link to this heading") ------------------------------------------------------------------------------------------------------- **cocotb** is a _COroutine_ based _COsimulation_ _TestBench_ environment for verifying VHDL and SystemVerilog [RTL](https://docs.cocotb.org/en/stable/glossary.html#term-RTL) using [Python](https://www.python.org/) . cocotb is completely free, open source (under the [BSD License](https://en.wikipedia.org/wiki/BSD_licenses#3-clause_license_(%22BSD_License_2.0%22,_%22Revised_BSD_License%22,_%22New_BSD_License%22,_or_%22Modified_BSD_License%22)) ) and hosted on [GitHub](https://github.com/cocotb/cocotb) . cocotb requires a simulator to simulate the [HDL](https://docs.cocotb.org/en/stable/glossary.html#term-HDL) design and has been used with a variety of simulators on Linux, Windows and macOS. Please check the [Simulator Support](https://docs.cocotb.org/en/stable/simulator_support.html#simulator-support) page for specifics. A (possibly older) version of cocotb can be used live in a web browser on [EDA Playground](https://www.edaplayground.com/) . How is cocotb different?[](https://docs.cocotb.org/en/stable/index.html#how-is-cocotb-different "Link to this heading") ------------------------------------------------------------------------------------------------------------------------- cocotb encourages the same philosophy of design re-use and randomized testing as [UVM](https://en.wikipedia.org/wiki/Universal_Verification_Methodology) , however is implemented in Python. With cocotb, VHDL or SystemVerilog are normally only used for the design itself, not the testbench. cocotb has built-in support for integrating with continuous integration systems, such as Jenkins, GitLab, etc. through standardized, machine-readable test reporting formats. cocotb was specifically designed to lower the overhead of creating a test. cocotb automatically discovers tests so that no additional step is required to add a test to a regression. All verification is done using Python which has various advantages over using SystemVerilog or VHDL for verification: * Writing Python is **fast** - it’s a very productive language. * It’s **easy** to interface to other languages from Python. * Python has a huge library of existing code to **re-use**. * Python is **interpreted** - tests can be edited and re-run without having to recompile the design. * Python is **popular** - far more engineers know Python than SystemVerilog or VHDL. How does cocotb work?[](https://docs.cocotb.org/en/stable/index.html#how-does-cocotb-work "Link to this heading") ------------------------------------------------------------------------------------------------------------------- A typical cocotb testbench requires no additional [RTL](https://docs.cocotb.org/en/stable/glossary.html#term-RTL) code. The Design Under Test ([DUT](https://docs.cocotb.org/en/stable/glossary.html#term-DUT) ) is instantiated as the toplevel in the simulator without any wrapper code. cocotb drives stimulus onto the inputs to the [DUT](https://docs.cocotb.org/en/stable/glossary.html#term-DUT) (or further down the hierarchy) and monitors the outputs directly from Python. Note that cocotb can not instantiate [HDL](https://docs.cocotb.org/en/stable/glossary.html#term-HDL) blocks - your DUT must be complete. ![_images/cocotb_overview.svg](https://docs.cocotb.org/en/stable/_images/cocotb_overview.svg) A test is simply a Python function. At any given time either the simulator is advancing time or the Python code is executing. The [`await`](https://docs.python.org/3/reference/expressions.html#await "(in Python v3.13)") keyword is used to indicate when to pass control of execution back to the simulator. A test can spawn multiple coroutines, allowing for independent flows of execution. --- # Welcome to cocotb’s documentation! — cocotb 1.9.2 documentation * [](https://docs.cocotb.org/en/v1.9.2/#) * Welcome to cocotb’s documentation! * [View page source](https://docs.cocotb.org/en/v1.9.2/_sources/index.rst.txt) * * * Welcome to cocotb’s documentation![](https://docs.cocotb.org/en/v1.9.2/#welcome-to-cocotb-s-documentation "Link to this heading") =================================================================================================================================== What is cocotb?[](https://docs.cocotb.org/en/v1.9.2/#what-is-cocotb "Link to this heading") --------------------------------------------------------------------------------------------- **cocotb** is a _COroutine_ based _COsimulation_ _TestBench_ environment for verifying VHDL and SystemVerilog [RTL](https://docs.cocotb.org/en/v1.9.2/glossary.html#term-RTL) using [Python](https://www.python.org/) . cocotb is completely free, open source (under the [BSD License](https://en.wikipedia.org/wiki/BSD_licenses#3-clause_license_(%22BSD_License_2.0%22,_%22Revised_BSD_License%22,_%22New_BSD_License%22,_or_%22Modified_BSD_License%22)) ) and hosted on [GitHub](https://github.com/cocotb/cocotb) . cocotb requires a simulator to simulate the [HDL](https://docs.cocotb.org/en/v1.9.2/glossary.html#term-HDL) design and has been used with a variety of simulators on Linux, Windows and macOS. Please check the [Simulator Support](https://docs.cocotb.org/en/v1.9.2/simulator_support.html#simulator-support) page for specifics. A (possibly older) version of cocotb can be used live in a web browser on [EDA Playground](https://www.edaplayground.com/) . How is cocotb different?[](https://docs.cocotb.org/en/v1.9.2/#how-is-cocotb-different "Link to this heading") --------------------------------------------------------------------------------------------------------------- cocotb encourages the same philosophy of design re-use and randomized testing as [UVM](https://en.wikipedia.org/wiki/Universal_Verification_Methodology) , however is implemented in Python. With cocotb, VHDL or SystemVerilog are normally only used for the design itself, not the testbench. cocotb has built-in support for integrating with continuous integration systems, such as Jenkins, GitLab, etc. through standardized, machine-readable test reporting formats. cocotb was specifically designed to lower the overhead of creating a test. cocotb automatically discovers tests so that no additional step is required to add a test to a regression. All verification is done using Python which has various advantages over using SystemVerilog or VHDL for verification: * Writing Python is **fast** - it’s a very productive language. * It’s **easy** to interface to other languages from Python. * Python has a huge library of existing code to **re-use**. * Python is **interpreted** - tests can be edited and re-run without having to recompile the design. * Python is **popular** - far more engineers know Python than SystemVerilog or VHDL. How does cocotb work?[](https://docs.cocotb.org/en/v1.9.2/#how-does-cocotb-work "Link to this heading") --------------------------------------------------------------------------------------------------------- A typical cocotb testbench requires no additional [RTL](https://docs.cocotb.org/en/v1.9.2/glossary.html#term-RTL) code. The Design Under Test ([DUT](https://docs.cocotb.org/en/v1.9.2/glossary.html#term-DUT) ) is instantiated as the toplevel in the simulator without any wrapper code. cocotb drives stimulus onto the inputs to the [DUT](https://docs.cocotb.org/en/v1.9.2/glossary.html#term-DUT) (or further down the hierarchy) and monitors the outputs directly from Python. Note that cocotb can not instantiate [HDL](https://docs.cocotb.org/en/v1.9.2/glossary.html#term-HDL) blocks - your DUT must be complete. ![_images/cocotb_overview.svg](https://docs.cocotb.org/en/v1.9.2/_images/cocotb_overview.svg) A test is simply a Python function. At any given time either the simulator is advancing time or the Python code is executing. The [`await`](https://docs.python.org/3/reference/expressions.html#await "(in Python v3.13)") keyword is used to indicate when to pass control of execution back to the simulator. A test can spawn multiple coroutines, allowing for independent flows of execution. --- # Welcome to cocotb’s documentation! — cocotb 1.8.0 documentation * [](https://docs.cocotb.org/en/v1.8.0/#) * Welcome to cocotb’s documentation! * [Edit on GitHub](https://github.com/cocotb/cocotb/blob/v1.8.0/documentation/source/index.rst) * * * Welcome to cocotb’s documentation![](https://docs.cocotb.org/en/v1.8.0/#welcome-to-cocotb-s-documentation "Permalink to this headline") ========================================================================================================================================= What is cocotb?[](https://docs.cocotb.org/en/v1.8.0/#what-is-cocotb "Permalink to this headline") --------------------------------------------------------------------------------------------------- **cocotb** is a _COroutine_ based _COsimulation_ _TestBench_ environment for verifying VHDL and SystemVerilog [RTL](https://docs.cocotb.org/en/v1.8.0/glossary.html#term-RTL) using [Python](https://www.python.org/) . cocotb is completely free, open source (under the [BSD License](https://en.wikipedia.org/wiki/BSD_licenses#3-clause_license_(%22BSD_License_2.0%22,_%22Revised_BSD_License%22,_%22New_BSD_License%22,_or_%22Modified_BSD_License%22)) ) and hosted on [GitHub](https://github.com/cocotb/cocotb) . cocotb requires a simulator to simulate the [HDL](https://docs.cocotb.org/en/v1.8.0/glossary.html#term-HDL) design and has been used with a variety of simulators on Linux, Windows and macOS. Please check the [Simulator Support](https://docs.cocotb.org/en/v1.8.0/simulator_support.html#simulator-support) page for specifics. A (possibly older) version of cocotb can be used live in a web browser on [EDA Playground](https://www.edaplayground.com/) . How is cocotb different?[](https://docs.cocotb.org/en/v1.8.0/#how-is-cocotb-different "Permalink to this headline") --------------------------------------------------------------------------------------------------------------------- cocotb encourages the same philosophy of design re-use and randomized testing as [UVM](https://en.wikipedia.org/wiki/Universal_Verification_Methodology) , however is implemented in Python. With cocotb, VHDL or SystemVerilog are normally only used for the design itself, not the testbench. cocotb has built-in support for integrating with continuous integration systems, such as Jenkins, GitLab, etc. through standardized, machine-readable test reporting formats. cocotb was specifically designed to lower the overhead of creating a test. cocotb automatically discovers tests so that no additional step is required to add a test to a regression. All verification is done using Python which has various advantages over using SystemVerilog or VHDL for verification: * Writing Python is **fast** - it’s a very productive language. * It’s **easy** to interface to other languages from Python. * Python has a huge library of existing code to **re-use**. * Python is **interpreted** - tests can be edited and re-run without having to recompile the design. * Python is **popular** - far more engineers know Python than SystemVerilog or VHDL. How does cocotb work?[](https://docs.cocotb.org/en/v1.8.0/#how-does-cocotb-work "Permalink to this headline") --------------------------------------------------------------------------------------------------------------- A typical cocotb testbench requires no additional [RTL](https://docs.cocotb.org/en/v1.8.0/glossary.html#term-RTL) code. The Design Under Test ([DUT](https://docs.cocotb.org/en/v1.8.0/glossary.html#term-DUT) ) is instantiated as the toplevel in the simulator without any wrapper code. cocotb drives stimulus onto the inputs to the [DUT](https://docs.cocotb.org/en/v1.8.0/glossary.html#term-DUT) (or further down the hierarchy) and monitors the outputs directly from Python. Note that cocotb can not instantiate [HDL](https://docs.cocotb.org/en/v1.8.0/glossary.html#term-HDL) blocks - your DUT must be complete. ![_images/cocotb_overview.svg](https://docs.cocotb.org/en/v1.8.0/_images/cocotb_overview.svg) A test is simply a Python function. At any given time either the simulator is advancing time or the Python code is executing. The [`await`](https://docs.python.org/3/reference/expressions.html#await "(in Python v3.11)") keyword is used to indicate when to pass control of execution back to the simulator. A test can spawn multiple coroutines, allowing for independent flows of execution. --- # Welcome to cocotb’s documentation! — cocotb 1.8.1 documentation * [](https://docs.cocotb.org/en/v1.8.1/#) * Welcome to cocotb’s documentation! * [Edit on GitHub](https://github.com/cocotb/cocotb/blob/v1.8.1/documentation/source/index.rst) * * * Welcome to cocotb’s documentation![](https://docs.cocotb.org/en/v1.8.1/#welcome-to-cocotb-s-documentation "Link to this heading") =================================================================================================================================== What is cocotb?[](https://docs.cocotb.org/en/v1.8.1/#what-is-cocotb "Link to this heading") --------------------------------------------------------------------------------------------- **cocotb** is a _COroutine_ based _COsimulation_ _TestBench_ environment for verifying VHDL and SystemVerilog [RTL](https://docs.cocotb.org/en/v1.8.1/glossary.html#term-RTL) using [Python](https://www.python.org/) . cocotb is completely free, open source (under the [BSD License](https://en.wikipedia.org/wiki/BSD_licenses#3-clause_license_(%22BSD_License_2.0%22,_%22Revised_BSD_License%22,_%22New_BSD_License%22,_or_%22Modified_BSD_License%22)) ) and hosted on [GitHub](https://github.com/cocotb/cocotb) . cocotb requires a simulator to simulate the [HDL](https://docs.cocotb.org/en/v1.8.1/glossary.html#term-HDL) design and has been used with a variety of simulators on Linux, Windows and macOS. Please check the [Simulator Support](https://docs.cocotb.org/en/v1.8.1/simulator_support.html#simulator-support) page for specifics. A (possibly older) version of cocotb can be used live in a web browser on [EDA Playground](https://www.edaplayground.com/) . How is cocotb different?[](https://docs.cocotb.org/en/v1.8.1/#how-is-cocotb-different "Link to this heading") --------------------------------------------------------------------------------------------------------------- cocotb encourages the same philosophy of design re-use and randomized testing as [UVM](https://en.wikipedia.org/wiki/Universal_Verification_Methodology) , however is implemented in Python. With cocotb, VHDL or SystemVerilog are normally only used for the design itself, not the testbench. cocotb has built-in support for integrating with continuous integration systems, such as Jenkins, GitLab, etc. through standardized, machine-readable test reporting formats. cocotb was specifically designed to lower the overhead of creating a test. cocotb automatically discovers tests so that no additional step is required to add a test to a regression. All verification is done using Python which has various advantages over using SystemVerilog or VHDL for verification: * Writing Python is **fast** - it’s a very productive language. * It’s **easy** to interface to other languages from Python. * Python has a huge library of existing code to **re-use**. * Python is **interpreted** - tests can be edited and re-run without having to recompile the design. * Python is **popular** - far more engineers know Python than SystemVerilog or VHDL. How does cocotb work?[](https://docs.cocotb.org/en/v1.8.1/#how-does-cocotb-work "Link to this heading") --------------------------------------------------------------------------------------------------------- A typical cocotb testbench requires no additional [RTL](https://docs.cocotb.org/en/v1.8.1/glossary.html#term-RTL) code. The Design Under Test ([DUT](https://docs.cocotb.org/en/v1.8.1/glossary.html#term-DUT) ) is instantiated as the toplevel in the simulator without any wrapper code. cocotb drives stimulus onto the inputs to the [DUT](https://docs.cocotb.org/en/v1.8.1/glossary.html#term-DUT) (or further down the hierarchy) and monitors the outputs directly from Python. Note that cocotb can not instantiate [HDL](https://docs.cocotb.org/en/v1.8.1/glossary.html#term-HDL) blocks - your DUT must be complete. ![_images/cocotb_overview.svg](https://docs.cocotb.org/en/v1.8.1/_images/cocotb_overview.svg) A test is simply a Python function. At any given time either the simulator is advancing time or the Python code is executing. The [`await`](https://docs.python.org/3/reference/expressions.html#await "(in Python v3.12)") keyword is used to indicate when to pass control of execution back to the simulator. A test can spawn multiple coroutines, allowing for independent flows of execution. --- # Welcome to cocotb’s documentation! — cocotb 1.7.1 documentation * [](https://docs.cocotb.org/en/v1.7.1/#) » * Welcome to cocotb’s documentation! * [Edit on GitHub](https://github.com/cocotb/cocotb/blob/v1.7.1/documentation/source/index.rst) * * * Welcome to cocotb’s documentation![](https://docs.cocotb.org/en/v1.7.1/#welcome-to-cocotb-s-documentation "Permalink to this headline") ========================================================================================================================================= What is cocotb?[](https://docs.cocotb.org/en/v1.7.1/#what-is-cocotb "Permalink to this headline") --------------------------------------------------------------------------------------------------- **cocotb** is a _COroutine_ based _COsimulation_ _TestBench_ environment for verifying VHDL and SystemVerilog [RTL](https://docs.cocotb.org/en/v1.7.1/glossary.html#term-RTL) using [Python](https://www.python.org/) . cocotb is completely free, open source (under the [BSD License](https://en.wikipedia.org/wiki/BSD_licenses#3-clause_license_(%22BSD_License_2.0%22,_%22Revised_BSD_License%22,_%22New_BSD_License%22,_or_%22Modified_BSD_License%22)) ) and hosted on [GitHub](https://github.com/cocotb/cocotb) . cocotb requires a simulator to simulate the [HDL](https://docs.cocotb.org/en/v1.7.1/glossary.html#term-HDL) design and has been used with a variety of simulators on Linux, Windows and macOS. Please check the [Simulator Support](https://docs.cocotb.org/en/v1.7.1/simulator_support.html#simulator-support) page for specifics. A (possibly older) version of cocotb can be used live in a web browser on [EDA Playground](https://www.edaplayground.com/) . How is cocotb different?[](https://docs.cocotb.org/en/v1.7.1/#how-is-cocotb-different "Permalink to this headline") --------------------------------------------------------------------------------------------------------------------- cocotb encourages the same philosophy of design re-use and randomized testing as [UVM](https://en.wikipedia.org/wiki/Universal_Verification_Methodology) , however is implemented in Python. With cocotb, VHDL or SystemVerilog are normally only used for the design itself, not the testbench. cocotb has built-in support for integrating with continuous integration systems, such as Jenkins, GitLab, etc. through standardized, machine-readable test reporting formats. cocotb was specifically designed to lower the overhead of creating a test. cocotb automatically discovers tests so that no additional step is required to add a test to a regression. All verification is done using Python which has various advantages over using SystemVerilog or VHDL for verification: * Writing Python is **fast** - it’s a very productive language. * It’s **easy** to interface to other languages from Python. * Python has a huge library of existing code to **re-use**. * Python is **interpreted** - tests can be edited and re-run without having to recompile the design. * Python is **popular** - far more engineers know Python than SystemVerilog or VHDL. How does cocotb work?[](https://docs.cocotb.org/en/v1.7.1/#how-does-cocotb-work "Permalink to this headline") --------------------------------------------------------------------------------------------------------------- A typical cocotb testbench requires no additional [RTL](https://docs.cocotb.org/en/v1.7.1/glossary.html#term-RTL) code. The Design Under Test ([DUT](https://docs.cocotb.org/en/v1.7.1/glossary.html#term-DUT) ) is instantiated as the toplevel in the simulator without any wrapper code. cocotb drives stimulus onto the inputs to the [DUT](https://docs.cocotb.org/en/v1.7.1/glossary.html#term-DUT) (or further down the hierarchy) and monitors the outputs directly from Python. Note that cocotb can not instantiate [HDL](https://docs.cocotb.org/en/v1.7.1/glossary.html#term-HDL) blocks - your DUT must be complete. ![_images/cocotb_overview.svg](https://docs.cocotb.org/en/v1.7.1/_images/cocotb_overview.svg) A test is simply a Python function. At any given time either the simulator is advancing time or the Python code is executing. The [`await`](https://docs.python.org/3/reference/expressions.html#await "(in Python v3.10)") keyword is used to indicate when to pass control of execution back to the simulator. A test can spawn multiple coroutines, allowing for independent flows of execution. --- # Welcome to cocotb’s documentation! — cocotb 1.7.0 documentation * [](https://docs.cocotb.org/en/v1.7.0/#) » * Welcome to cocotb’s documentation! * [Edit on GitHub](https://github.com/cocotb/cocotb/blob/v1.7.0/documentation/source/index.rst) * * * Welcome to cocotb’s documentation![](https://docs.cocotb.org/en/v1.7.0/#welcome-to-cocotb-s-documentation "Permalink to this headline") ========================================================================================================================================= What is cocotb?[](https://docs.cocotb.org/en/v1.7.0/#what-is-cocotb "Permalink to this headline") --------------------------------------------------------------------------------------------------- **cocotb** is a _COroutine_ based _COsimulation_ _TestBench_ environment for verifying VHDL and SystemVerilog [RTL](https://docs.cocotb.org/en/v1.7.0/glossary.html#term-RTL) using [Python](https://www.python.org/) . cocotb is completely free, open source (under the [BSD License](https://en.wikipedia.org/wiki/BSD_licenses#3-clause_license_(%22BSD_License_2.0%22,_%22Revised_BSD_License%22,_%22New_BSD_License%22,_or_%22Modified_BSD_License%22)) ) and hosted on [GitHub](https://github.com/cocotb/cocotb) . cocotb requires a simulator to simulate the [HDL](https://docs.cocotb.org/en/v1.7.0/glossary.html#term-HDL) design and has been used with a variety of simulators on Linux, Windows and macOS. Please check the [Simulator Support](https://docs.cocotb.org/en/v1.7.0/simulator_support.html#simulator-support) page for specifics. A (possibly older) version of cocotb can be used live in a web browser on [EDA Playground](https://www.edaplayground.com/) . How is cocotb different?[](https://docs.cocotb.org/en/v1.7.0/#how-is-cocotb-different "Permalink to this headline") --------------------------------------------------------------------------------------------------------------------- cocotb encourages the same philosophy of design re-use and randomized testing as [UVM](https://en.wikipedia.org/wiki/Universal_Verification_Methodology) , however is implemented in Python. With cocotb, VHDL or SystemVerilog are normally only used for the design itself, not the testbench. cocotb has built-in support for integrating with continuous integration systems, such as Jenkins, GitLab, etc. through standardized, machine-readable test reporting formats. cocotb was specifically designed to lower the overhead of creating a test. cocotb automatically discovers tests so that no additional step is required to add a test to a regression. All verification is done using Python which has various advantages over using SystemVerilog or VHDL for verification: * Writing Python is **fast** - it’s a very productive language. * It’s **easy** to interface to other languages from Python. * Python has a huge library of existing code to **re-use**. * Python is **interpreted** - tests can be edited and re-run without having to recompile the design. * Python is **popular** - far more engineers know Python than SystemVerilog or VHDL. How does cocotb work?[](https://docs.cocotb.org/en/v1.7.0/#how-does-cocotb-work "Permalink to this headline") --------------------------------------------------------------------------------------------------------------- A typical cocotb testbench requires no additional [RTL](https://docs.cocotb.org/en/v1.7.0/glossary.html#term-RTL) code. The Design Under Test ([DUT](https://docs.cocotb.org/en/v1.7.0/glossary.html#term-DUT) ) is instantiated as the toplevel in the simulator without any wrapper code. cocotb drives stimulus onto the inputs to the [DUT](https://docs.cocotb.org/en/v1.7.0/glossary.html#term-DUT) (or further down the hierarchy) and monitors the outputs directly from Python. Note that cocotb can not instantiate [HDL](https://docs.cocotb.org/en/v1.7.0/glossary.html#term-HDL) blocks - your DUT must be complete. ![_images/cocotb_overview.svg](https://docs.cocotb.org/en/v1.7.0/_images/cocotb_overview.svg) A test is simply a Python function. At any given time either the simulator is advancing time or the Python code is executing. The [`await`](https://docs.python.org/3/reference/expressions.html#await "(in Python v3.10)") keyword is used to indicate when to pass control of execution back to the simulator. A test can spawn multiple coroutines, allowing for independent flows of execution. --- # Welcome to cocotb’s Documentation! — cocotb 2.0.0.dev1+1700f3f documentation [Skip to main content](https://docs.cocotb.org/en/development/#main-content) Back to top Ctrl+K [![cocotb 2.0.0.dev1+1700f3f documentation - Home](https://docs.cocotb.org/en/development/_static/cocotb-logo.svg) ![cocotb 2.0.0.dev1+1700f3f documentation - Home](https://docs.cocotb.org/en/development/_static/cocotb-logo-dark.svg)](https://cocotb.org/) Search Ctrl+K * [Repository](https://github.com/cocotb/cocotb) * [Open issue](https://github.com/cocotb/cocotb/issues/new?title=Issue%20on%20page%20%2Findex.html&body=Your%20issue%20content%20here.) * [.rst](https://docs.cocotb.org/en/development/_sources/index.rst) * .pdf Light Dark System Settings Welcome to cocotb’s Documentation! ================================== Contents -------- Welcome to cocotb’s Documentation![#](https://docs.cocotb.org/en/development/#welcome-to-cocotb-s-documentation "Link to this heading") ======================================================================================================================================== What is cocotb?[#](https://docs.cocotb.org/en/development/#what-is-cocotb "Link to this heading") -------------------------------------------------------------------------------------------------- **cocotb** is a _COroutine_ based _COsimulation_ _TestBench_ environment for verifying VHDL and SystemVerilog [RTL](https://docs.cocotb.org/en/development/glossary.html#term-RTL) using [Python](https://www.python.org/) . cocotb is completely free, open source (under the [BSD License](https://en.wikipedia.org/wiki/BSD_licenses#3-clause_license_(%22BSD_License_2.0%22,_%22Revised_BSD_License%22,_%22New_BSD_License%22,_or_%22Modified_BSD_License%22)) ) and hosted on [GitHub](https://github.com/cocotb/cocotb) . cocotb requires a simulator to simulate the [HDL](https://docs.cocotb.org/en/development/glossary.html#term-HDL) design and has been used with a variety of simulators on Linux, Windows and macOS. Please check the [Simulator Support](https://docs.cocotb.org/en/development/simulator_support.html#simulator-support) page for specifics. A (possibly older) version of cocotb can be used live in a web browser on [EDA Playground](https://www.edaplayground.com/) . How is cocotb different?[#](https://docs.cocotb.org/en/development/#how-is-cocotb-different "Link to this heading") -------------------------------------------------------------------------------------------------------------------- cocotb encourages the same philosophy of design reuse and randomized testing as [UVM](https://en.wikipedia.org/wiki/Universal_Verification_Methodology) , however is implemented in Python. With cocotb, VHDL or SystemVerilog are normally only used for the design itself, not the testbench. cocotb has built-in support for integrating with continuous integration systems, such as Jenkins, GitLab, etc. through standardized, machine-readable test reporting formats. cocotb was specifically designed to lower the overhead of creating a test. cocotb automatically discovers tests so that no additional step is required to add a test to a regression. All verification is done using Python which has various advantages over using SystemVerilog or VHDL for verification: * Writing Python is **fast** - it’s a very productive language. * It’s **easy** to interface to other languages from Python. * Python has a huge library of existing code to **reuse**. * Python is **interpreted** - tests can be edited and re-run without having to recompile the design. * Python is **popular** - far more engineers know Python than SystemVerilog or VHDL. How does cocotb work?[#](https://docs.cocotb.org/en/development/#how-does-cocotb-work "Link to this heading") -------------------------------------------------------------------------------------------------------------- A typical cocotb testbench requires no additional [RTL](https://docs.cocotb.org/en/development/glossary.html#term-RTL) code. The Design Under Test ([DUT](https://docs.cocotb.org/en/development/glossary.html#term-DUT) ) is instantiated as the toplevel in the simulator without any wrapper code. cocotb drives stimulus onto the inputs to the [DUT](https://docs.cocotb.org/en/development/glossary.html#term-DUT) (or further down the hierarchy) and monitors the outputs directly from Python. Note that cocotb can not instantiate [HDL](https://docs.cocotb.org/en/development/glossary.html#term-HDL) blocks - your DUT must be complete. ![_images/cocotb_overview.svg](https://docs.cocotb.org/en/development/_images/cocotb_overview.svg) A test is simply a Python function. At any given time either the simulator is advancing time or the Python code is executing. The [`await`](https://docs.python.org/3/reference/expressions.html#await "(in Python v3.13)") keyword is used to indicate when to pass control of execution back to the simulator. A test can spawn multiple coroutines, allowing for independent flows of execution. Contents --- # Welcome to cocotb’s documentation! — cocotb 1.7.2 documentation * [](https://docs.cocotb.org/en/v1.7.2/#) * Welcome to cocotb’s documentation! * [Edit on GitHub](https://github.com/cocotb/cocotb/blob/v1.7.2/documentation/source/index.rst) * * * Welcome to cocotb’s documentation![](https://docs.cocotb.org/en/v1.7.2/#welcome-to-cocotb-s-documentation "Permalink to this headline") ========================================================================================================================================= What is cocotb?[](https://docs.cocotb.org/en/v1.7.2/#what-is-cocotb "Permalink to this headline") --------------------------------------------------------------------------------------------------- **cocotb** is a _COroutine_ based _COsimulation_ _TestBench_ environment for verifying VHDL and SystemVerilog [RTL](https://docs.cocotb.org/en/v1.7.2/glossary.html#term-RTL) using [Python](https://www.python.org/) . cocotb is completely free, open source (under the [BSD License](https://en.wikipedia.org/wiki/BSD_licenses#3-clause_license_(%22BSD_License_2.0%22,_%22Revised_BSD_License%22,_%22New_BSD_License%22,_or_%22Modified_BSD_License%22)) ) and hosted on [GitHub](https://github.com/cocotb/cocotb) . cocotb requires a simulator to simulate the [HDL](https://docs.cocotb.org/en/v1.7.2/glossary.html#term-HDL) design and has been used with a variety of simulators on Linux, Windows and macOS. Please check the [Simulator Support](https://docs.cocotb.org/en/v1.7.2/simulator_support.html#simulator-support) page for specifics. A (possibly older) version of cocotb can be used live in a web browser on [EDA Playground](https://www.edaplayground.com/) . How is cocotb different?[](https://docs.cocotb.org/en/v1.7.2/#how-is-cocotb-different "Permalink to this headline") --------------------------------------------------------------------------------------------------------------------- cocotb encourages the same philosophy of design re-use and randomized testing as [UVM](https://en.wikipedia.org/wiki/Universal_Verification_Methodology) , however is implemented in Python. With cocotb, VHDL or SystemVerilog are normally only used for the design itself, not the testbench. cocotb has built-in support for integrating with continuous integration systems, such as Jenkins, GitLab, etc. through standardized, machine-readable test reporting formats. cocotb was specifically designed to lower the overhead of creating a test. cocotb automatically discovers tests so that no additional step is required to add a test to a regression. All verification is done using Python which has various advantages over using SystemVerilog or VHDL for verification: * Writing Python is **fast** - it’s a very productive language. * It’s **easy** to interface to other languages from Python. * Python has a huge library of existing code to **re-use**. * Python is **interpreted** - tests can be edited and re-run without having to recompile the design. * Python is **popular** - far more engineers know Python than SystemVerilog or VHDL. How does cocotb work?[](https://docs.cocotb.org/en/v1.7.2/#how-does-cocotb-work "Permalink to this headline") --------------------------------------------------------------------------------------------------------------- A typical cocotb testbench requires no additional [RTL](https://docs.cocotb.org/en/v1.7.2/glossary.html#term-RTL) code. The Design Under Test ([DUT](https://docs.cocotb.org/en/v1.7.2/glossary.html#term-DUT) ) is instantiated as the toplevel in the simulator without any wrapper code. cocotb drives stimulus onto the inputs to the [DUT](https://docs.cocotb.org/en/v1.7.2/glossary.html#term-DUT) (or further down the hierarchy) and monitors the outputs directly from Python. Note that cocotb can not instantiate [HDL](https://docs.cocotb.org/en/v1.7.2/glossary.html#term-HDL) blocks - your DUT must be complete. ![_images/cocotb_overview.svg](https://docs.cocotb.org/en/v1.7.2/_images/cocotb_overview.svg) A test is simply a Python function. At any given time either the simulator is advancing time or the Python code is executing. The [`await`](https://docs.python.org/3/reference/expressions.html#await "(in Python v3.11)") keyword is used to indicate when to pass control of execution back to the simulator. A test can spawn multiple coroutines, allowing for independent flows of execution. --- # Welcome to cocotb’s documentation! — cocotb 1.6.2 documentation * [](https://docs.cocotb.org/en/v1.6.2/#) » * Welcome to cocotb’s documentation! * [Edit on GitHub](https://github.com/cocotb/cocotb/blob/v1.6.2/documentation/source/index.rst) * * * Welcome to cocotb’s documentation![](https://docs.cocotb.org/en/v1.6.2/#welcome-to-cocotb-s-documentation "Permalink to this headline") ========================================================================================================================================= What is cocotb?[](https://docs.cocotb.org/en/v1.6.2/#what-is-cocotb "Permalink to this headline") --------------------------------------------------------------------------------------------------- **cocotb** is a _COroutine_ based _COsimulation_ _TestBench_ environment for verifying VHDL and SystemVerilog [RTL](https://docs.cocotb.org/en/v1.6.2/glossary.html#term-RTL) using [Python](https://www.python.org/) . cocotb is completely free, open source (under the [BSD License](https://en.wikipedia.org/wiki/BSD_licenses#3-clause_license_(%22BSD_License_2.0%22,_%22Revised_BSD_License%22,_%22New_BSD_License%22,_or_%22Modified_BSD_License%22)) ) and hosted on [GitHub](https://github.com/cocotb/cocotb) . cocotb requires a simulator to simulate the [HDL](https://docs.cocotb.org/en/v1.6.2/glossary.html#term-HDL) design and has been used with a variety of simulators on Linux, Windows and macOS. Please check the [Simulator Support](https://docs.cocotb.org/en/v1.6.2/simulator_support.html#simulator-support) page for specifics. A (possibly older) version of cocotb can be used live in a web browser on [EDA Playground](https://www.edaplayground.com/) . How is cocotb different?[](https://docs.cocotb.org/en/v1.6.2/#how-is-cocotb-different "Permalink to this headline") --------------------------------------------------------------------------------------------------------------------- cocotb encourages the same philosophy of design re-use and randomized testing as [UVM](https://en.wikipedia.org/wiki/Universal_Verification_Methodology) , however is implemented in Python. With cocotb, VHDL or SystemVerilog are normally only used for the design itself, not the testbench. cocotb has built-in support for integrating with continuous integration systems, such as Jenkins, GitLab, etc. through standardized, machine-readable test reporting formats. cocotb was specifically designed to lower the overhead of creating a test. cocotb automatically discovers tests so that no additional step is required to add a test to a regression. All verification is done using Python which has various advantages over using SystemVerilog or VHDL for verification: * Writing Python is **fast** - it’s a very productive language. * It’s **easy** to interface to other languages from Python. * Python has a huge library of existing code to **re-use**. * Python is **interpreted** - tests can be edited and re-run without having to recompile the design or exit the simulator GUI. * Python is **popular** - far more engineers know Python than SystemVerilog or VHDL. How does cocotb work?[](https://docs.cocotb.org/en/v1.6.2/#how-does-cocotb-work "Permalink to this headline") --------------------------------------------------------------------------------------------------------------- A typical cocotb testbench requires no additional [RTL](https://docs.cocotb.org/en/v1.6.2/glossary.html#term-RTL) code. The Design Under Test ([DUT](https://docs.cocotb.org/en/v1.6.2/glossary.html#term-DUT) ) is instantiated as the toplevel in the simulator without any wrapper code. cocotb drives stimulus onto the inputs to the [DUT](https://docs.cocotb.org/en/v1.6.2/glossary.html#term-DUT) (or further down the hierarchy) and monitors the outputs directly from Python. Note that cocotb can not instantiate [HDL](https://docs.cocotb.org/en/v1.6.2/glossary.html#term-HDL) blocks - your DUT must be complete. ![_images/cocotb_overview.svg](https://docs.cocotb.org/en/v1.6.2/_images/cocotb_overview.svg) A test is simply a Python function. At any given time either the simulator is advancing time or the Python code is executing. The [`await`](https://docs.python.org/3/reference/expressions.html#await "(in Python v3.10)") keyword is used to indicate when to pass control of execution back to the simulator. A test can spawn multiple coroutines, allowing for independent flows of execution. --- # Welcome to cocotb’s documentation! — cocotb 1.6.1 documentation * [](https://docs.cocotb.org/en/v1.6.1/#) » * Welcome to cocotb’s documentation! * [Edit on GitHub](https://github.com/cocotb/cocotb/blob/v1.6.1/documentation/source/index.rst) * * * Welcome to cocotb’s documentation![](https://docs.cocotb.org/en/v1.6.1/#welcome-to-cocotb-s-documentation "Permalink to this headline") ========================================================================================================================================= What is cocotb?[](https://docs.cocotb.org/en/v1.6.1/#what-is-cocotb "Permalink to this headline") --------------------------------------------------------------------------------------------------- **cocotb** is a _COroutine_ based _COsimulation_ _TestBench_ environment for verifying VHDL and SystemVerilog [RTL](https://docs.cocotb.org/en/v1.6.1/glossary.html#term-RTL) using [Python](https://www.python.org/) . cocotb is completely free, open source (under the [BSD License](https://en.wikipedia.org/wiki/BSD_licenses#3-clause_license_(%22BSD_License_2.0%22,_%22Revised_BSD_License%22,_%22New_BSD_License%22,_or_%22Modified_BSD_License%22)) ) and hosted on [GitHub](https://github.com/cocotb/cocotb) . cocotb requires a simulator to simulate the [HDL](https://docs.cocotb.org/en/v1.6.1/glossary.html#term-HDL) design and has been used with a variety of simulators on Linux, Windows and macOS. Please check the [Simulator Support](https://docs.cocotb.org/en/v1.6.1/simulator_support.html#simulator-support) page for specifics. A (possibly older) version of cocotb can be used live in a web browser on [EDA Playground](https://www.edaplayground.com/) . How is cocotb different?[](https://docs.cocotb.org/en/v1.6.1/#how-is-cocotb-different "Permalink to this headline") --------------------------------------------------------------------------------------------------------------------- cocotb encourages the same philosophy of design re-use and randomized testing as [UVM](https://en.wikipedia.org/wiki/Universal_Verification_Methodology) , however is implemented in Python. With cocotb, VHDL or SystemVerilog are normally only used for the design itself, not the testbench. cocotb has built-in support for integrating with continuous integration systems, such as Jenkins, GitLab, etc. through standardized, machine-readable test reporting formats. cocotb was specifically designed to lower the overhead of creating a test. cocotb automatically discovers tests so that no additional step is required to add a test to a regression. All verification is done using Python which has various advantages over using SystemVerilog or VHDL for verification: * Writing Python is **fast** - it’s a very productive language. * It’s **easy** to interface to other languages from Python. * Python has a huge library of existing code to **re-use**. * Python is **interpreted** - tests can be edited and re-run without having to recompile the design or exit the simulator GUI. * Python is **popular** - far more engineers know Python than SystemVerilog or VHDL. How does cocotb work?[](https://docs.cocotb.org/en/v1.6.1/#how-does-cocotb-work "Permalink to this headline") --------------------------------------------------------------------------------------------------------------- A typical cocotb testbench requires no additional [RTL](https://docs.cocotb.org/en/v1.6.1/glossary.html#term-RTL) code. The Design Under Test ([DUT](https://docs.cocotb.org/en/v1.6.1/glossary.html#term-DUT) ) is instantiated as the toplevel in the simulator without any wrapper code. cocotb drives stimulus onto the inputs to the [DUT](https://docs.cocotb.org/en/v1.6.1/glossary.html#term-DUT) (or further down the hierarchy) and monitors the outputs directly from Python. Note that cocotb can not instantiate [HDL](https://docs.cocotb.org/en/v1.6.1/glossary.html#term-HDL) blocks - your DUT must be complete. ![_images/cocotb_overview.svg](https://docs.cocotb.org/en/v1.6.1/_images/cocotb_overview.svg) A test is simply a Python function. At any given time either the simulator is advancing time or the Python code is executing. The [`await`](https://docs.python.org/3/reference/expressions.html#await "(in Python v3.10)") keyword is used to indicate when to pass control of execution back to the simulator. A test can spawn multiple coroutines, allowing for independent flows of execution. --- # Welcome to cocotb’s documentation! — cocotb 1.9.1 documentation * [](https://docs.cocotb.org/en/v1.9.1/#) * Welcome to cocotb’s documentation! * [Edit on GitHub](https://github.com/cocotb/cocotb/blob/v1.9.1/documentation/source/index.rst) * * * Welcome to cocotb’s documentation![](https://docs.cocotb.org/en/v1.9.1/#welcome-to-cocotb-s-documentation "Link to this heading") =================================================================================================================================== What is cocotb?[](https://docs.cocotb.org/en/v1.9.1/#what-is-cocotb "Link to this heading") --------------------------------------------------------------------------------------------- **cocotb** is a _COroutine_ based _COsimulation_ _TestBench_ environment for verifying VHDL and SystemVerilog [RTL](https://docs.cocotb.org/en/v1.9.1/glossary.html#term-RTL) using [Python](https://www.python.org/) . cocotb is completely free, open source (under the [BSD License](https://en.wikipedia.org/wiki/BSD_licenses#3-clause_license_(%22BSD_License_2.0%22,_%22Revised_BSD_License%22,_%22New_BSD_License%22,_or_%22Modified_BSD_License%22)) ) and hosted on [GitHub](https://github.com/cocotb/cocotb) . cocotb requires a simulator to simulate the [HDL](https://docs.cocotb.org/en/v1.9.1/glossary.html#term-HDL) design and has been used with a variety of simulators on Linux, Windows and macOS. Please check the [Simulator Support](https://docs.cocotb.org/en/v1.9.1/simulator_support.html#simulator-support) page for specifics. A (possibly older) version of cocotb can be used live in a web browser on [EDA Playground](https://www.edaplayground.com/) . How is cocotb different?[](https://docs.cocotb.org/en/v1.9.1/#how-is-cocotb-different "Link to this heading") --------------------------------------------------------------------------------------------------------------- cocotb encourages the same philosophy of design re-use and randomized testing as [UVM](https://en.wikipedia.org/wiki/Universal_Verification_Methodology) , however is implemented in Python. With cocotb, VHDL or SystemVerilog are normally only used for the design itself, not the testbench. cocotb has built-in support for integrating with continuous integration systems, such as Jenkins, GitLab, etc. through standardized, machine-readable test reporting formats. cocotb was specifically designed to lower the overhead of creating a test. cocotb automatically discovers tests so that no additional step is required to add a test to a regression. All verification is done using Python which has various advantages over using SystemVerilog or VHDL for verification: * Writing Python is **fast** - it’s a very productive language. * It’s **easy** to interface to other languages from Python. * Python has a huge library of existing code to **re-use**. * Python is **interpreted** - tests can be edited and re-run without having to recompile the design. * Python is **popular** - far more engineers know Python than SystemVerilog or VHDL. How does cocotb work?[](https://docs.cocotb.org/en/v1.9.1/#how-does-cocotb-work "Link to this heading") --------------------------------------------------------------------------------------------------------- A typical cocotb testbench requires no additional [RTL](https://docs.cocotb.org/en/v1.9.1/glossary.html#term-RTL) code. The Design Under Test ([DUT](https://docs.cocotb.org/en/v1.9.1/glossary.html#term-DUT) ) is instantiated as the toplevel in the simulator without any wrapper code. cocotb drives stimulus onto the inputs to the [DUT](https://docs.cocotb.org/en/v1.9.1/glossary.html#term-DUT) (or further down the hierarchy) and monitors the outputs directly from Python. Note that cocotb can not instantiate [HDL](https://docs.cocotb.org/en/v1.9.1/glossary.html#term-HDL) blocks - your DUT must be complete. ![_images/cocotb_overview.svg](https://docs.cocotb.org/en/v1.9.1/_images/cocotb_overview.svg) A test is simply a Python function. At any given time either the simulator is advancing time or the Python code is executing. The [`await`](https://docs.python.org/3/reference/expressions.html#await "(in Python v3.12)") keyword is used to indicate when to pass control of execution back to the simulator. A test can spawn multiple coroutines, allowing for independent flows of execution. --- # Welcome to cocotb’s documentation! — cocotb 1.9.0 documentation * [](https://docs.cocotb.org/en/v1.9.0/#) * Welcome to cocotb’s documentation! * [Edit on GitHub](https://github.com/cocotb/cocotb/blob/v1.9.0/documentation/source/index.rst) * * * Welcome to cocotb’s documentation![](https://docs.cocotb.org/en/v1.9.0/#welcome-to-cocotb-s-documentation "Link to this heading") =================================================================================================================================== What is cocotb?[](https://docs.cocotb.org/en/v1.9.0/#what-is-cocotb "Link to this heading") --------------------------------------------------------------------------------------------- **cocotb** is a _COroutine_ based _COsimulation_ _TestBench_ environment for verifying VHDL and SystemVerilog [RTL](https://docs.cocotb.org/en/v1.9.0/glossary.html#term-RTL) using [Python](https://www.python.org/) . cocotb is completely free, open source (under the [BSD License](https://en.wikipedia.org/wiki/BSD_licenses#3-clause_license_(%22BSD_License_2.0%22,_%22Revised_BSD_License%22,_%22New_BSD_License%22,_or_%22Modified_BSD_License%22)) ) and hosted on [GitHub](https://github.com/cocotb/cocotb) . cocotb requires a simulator to simulate the [HDL](https://docs.cocotb.org/en/v1.9.0/glossary.html#term-HDL) design and has been used with a variety of simulators on Linux, Windows and macOS. Please check the [Simulator Support](https://docs.cocotb.org/en/v1.9.0/simulator_support.html#simulator-support) page for specifics. A (possibly older) version of cocotb can be used live in a web browser on [EDA Playground](https://www.edaplayground.com/) . How is cocotb different?[](https://docs.cocotb.org/en/v1.9.0/#how-is-cocotb-different "Link to this heading") --------------------------------------------------------------------------------------------------------------- cocotb encourages the same philosophy of design re-use and randomized testing as [UVM](https://en.wikipedia.org/wiki/Universal_Verification_Methodology) , however is implemented in Python. With cocotb, VHDL or SystemVerilog are normally only used for the design itself, not the testbench. cocotb has built-in support for integrating with continuous integration systems, such as Jenkins, GitLab, etc. through standardized, machine-readable test reporting formats. cocotb was specifically designed to lower the overhead of creating a test. cocotb automatically discovers tests so that no additional step is required to add a test to a regression. All verification is done using Python which has various advantages over using SystemVerilog or VHDL for verification: * Writing Python is **fast** - it’s a very productive language. * It’s **easy** to interface to other languages from Python. * Python has a huge library of existing code to **re-use**. * Python is **interpreted** - tests can be edited and re-run without having to recompile the design. * Python is **popular** - far more engineers know Python than SystemVerilog or VHDL. How does cocotb work?[](https://docs.cocotb.org/en/v1.9.0/#how-does-cocotb-work "Link to this heading") --------------------------------------------------------------------------------------------------------- A typical cocotb testbench requires no additional [RTL](https://docs.cocotb.org/en/v1.9.0/glossary.html#term-RTL) code. The Design Under Test ([DUT](https://docs.cocotb.org/en/v1.9.0/glossary.html#term-DUT) ) is instantiated as the toplevel in the simulator without any wrapper code. cocotb drives stimulus onto the inputs to the [DUT](https://docs.cocotb.org/en/v1.9.0/glossary.html#term-DUT) (or further down the hierarchy) and monitors the outputs directly from Python. Note that cocotb can not instantiate [HDL](https://docs.cocotb.org/en/v1.9.0/glossary.html#term-HDL) blocks - your DUT must be complete. ![_images/cocotb_overview.svg](https://docs.cocotb.org/en/v1.9.0/_images/cocotb_overview.svg) A test is simply a Python function. At any given time either the simulator is advancing time or the Python code is executing. The [`await`](https://docs.python.org/3/reference/expressions.html#await "(in Python v3.12)") keyword is used to indicate when to pass control of execution back to the simulator. A test can spawn multiple coroutines, allowing for independent flows of execution. --- # Welcome to cocotb’s documentation! — cocotb 1.6.0.dev0+g0872e05c.d20210320 documentation * [](https://docs.cocotb.org/en/v1.5.1/#) » * Welcome to cocotb’s documentation! * [Edit on GitHub](https://github.com/cocotb/cocotb/blob/v1.5.1/documentation/source/index.rst) * * * Welcome to cocotb’s documentation![¶](https://docs.cocotb.org/en/v1.5.1/#welcome-to-cocotb-s-documentation "Permalink to this headline") ========================================================================================================================================= What is cocotb?[¶](https://docs.cocotb.org/en/v1.5.1/#what-is-cocotb "Permalink to this headline") --------------------------------------------------------------------------------------------------- **cocotb** is a _COroutine_ based _COsimulation_ _TestBench_ environment for verifying VHDL and SystemVerilog [RTL](https://docs.cocotb.org/en/v1.5.1/glossary.html#term-RTL) using [Python](https://www.python.org/) . cocotb is completely free, open source (under the [BSD License](https://en.wikipedia.org/wiki/BSD_licenses#3-clause_license_(%22BSD_License_2.0%22,_%22Revised_BSD_License%22,_%22New_BSD_License%22,_or_%22Modified_BSD_License%22)) ) and hosted on [GitHub](https://github.com/cocotb/cocotb) . cocotb requires a simulator to simulate the [HDL](https://docs.cocotb.org/en/v1.5.1/glossary.html#term-HDL) design and has been used with a variety of simulators on Linux, Windows and macOS. Please check the [Simulator Support](https://docs.cocotb.org/en/v1.5.1/simulator_support.html#simulator-support) page for specifics. A (possibly older) version of cocotb can be used live in a web browser on [EDA Playground](https://www.edaplayground.com/) . How is cocotb different?[¶](https://docs.cocotb.org/en/v1.5.1/#how-is-cocotb-different "Permalink to this headline") --------------------------------------------------------------------------------------------------------------------- cocotb encourages the same philosophy of design re-use and randomized testing as [UVM](https://en.wikipedia.org/wiki/Universal_Verification_Methodology) , however is implemented in Python. With cocotb, VHDL or SystemVerilog are normally only used for the design itself, not the testbench. cocotb has built-in support for integrating with continuous integration systems, such as Jenkins, GitLab, etc. through standardized, machine-readable test reporting formats. cocotb was specifically designed to lower the overhead of creating a test. cocotb automatically discovers tests so that no additional step is required to add a test to a regression. All verification is done using Python which has various advantages over using SystemVerilog or VHDL for verification: * Writing Python is **fast** - it’s a very productive language. * It’s **easy** to interface to other languages from Python. * Python has a huge library of existing code to **re-use**. * Python is **interpreted** - tests can be edited and re-run without having to recompile the design or exit the simulator GUI. * Python is **popular** - far more engineers know Python than SystemVerilog or VHDL. How does cocotb work?[¶](https://docs.cocotb.org/en/v1.5.1/#how-does-cocotb-work "Permalink to this headline") --------------------------------------------------------------------------------------------------------------- A typical cocotb testbench requires no additional [RTL](https://docs.cocotb.org/en/v1.5.1/glossary.html#term-RTL) code. The Design Under Test ([DUT](https://docs.cocotb.org/en/v1.5.1/glossary.html#term-DUT) ) is instantiated as the toplevel in the simulator without any wrapper code. cocotb drives stimulus onto the inputs to the [DUT](https://docs.cocotb.org/en/v1.5.1/glossary.html#term-DUT) (or further down the hierarchy) and monitors the outputs directly from Python. Note that cocotb can not instantiate [HDL](https://docs.cocotb.org/en/v1.5.1/glossary.html#term-HDL) blocks - your DUT must be complete. ![_images/cocotb_overview.svg](https://docs.cocotb.org/en/v1.5.1/_images/cocotb_overview.svg) A test is simply a Python function. At any given time either the simulator is advancing time or the Python code is executing. The [`await`](https://docs.python.org/3/reference/expressions.html#await "(in Python v3.9)") keyword is used to indicate when to pass control of execution back to the simulator. A test can spawn multiple coroutines, allowing for independent flows of execution. --- # Welcome to cocotb’s documentation! — cocotb 1.6.0 documentation * [](https://docs.cocotb.org/en/v1.6.0/#) » * Welcome to cocotb’s documentation! * [Edit on GitHub](https://github.com/cocotb/cocotb/blob/v1.6.0/documentation/source/index.rst) * * * Welcome to cocotb’s documentation![](https://docs.cocotb.org/en/v1.6.0/#welcome-to-cocotb-s-documentation "Permalink to this headline") ========================================================================================================================================= What is cocotb?[](https://docs.cocotb.org/en/v1.6.0/#what-is-cocotb "Permalink to this headline") --------------------------------------------------------------------------------------------------- **cocotb** is a _COroutine_ based _COsimulation_ _TestBench_ environment for verifying VHDL and SystemVerilog [RTL](https://docs.cocotb.org/en/v1.6.0/glossary.html#term-RTL) using [Python](https://www.python.org/) . cocotb is completely free, open source (under the [BSD License](https://en.wikipedia.org/wiki/BSD_licenses#3-clause_license_(%22BSD_License_2.0%22,_%22Revised_BSD_License%22,_%22New_BSD_License%22,_or_%22Modified_BSD_License%22)) ) and hosted on [GitHub](https://github.com/cocotb/cocotb) . cocotb requires a simulator to simulate the [HDL](https://docs.cocotb.org/en/v1.6.0/glossary.html#term-HDL) design and has been used with a variety of simulators on Linux, Windows and macOS. Please check the [Simulator Support](https://docs.cocotb.org/en/v1.6.0/simulator_support.html#simulator-support) page for specifics. A (possibly older) version of cocotb can be used live in a web browser on [EDA Playground](https://www.edaplayground.com/) . How is cocotb different?[](https://docs.cocotb.org/en/v1.6.0/#how-is-cocotb-different "Permalink to this headline") --------------------------------------------------------------------------------------------------------------------- cocotb encourages the same philosophy of design re-use and randomized testing as [UVM](https://en.wikipedia.org/wiki/Universal_Verification_Methodology) , however is implemented in Python. With cocotb, VHDL or SystemVerilog are normally only used for the design itself, not the testbench. cocotb has built-in support for integrating with continuous integration systems, such as Jenkins, GitLab, etc. through standardized, machine-readable test reporting formats. cocotb was specifically designed to lower the overhead of creating a test. cocotb automatically discovers tests so that no additional step is required to add a test to a regression. All verification is done using Python which has various advantages over using SystemVerilog or VHDL for verification: * Writing Python is **fast** - it’s a very productive language. * It’s **easy** to interface to other languages from Python. * Python has a huge library of existing code to **re-use**. * Python is **interpreted** - tests can be edited and re-run without having to recompile the design or exit the simulator GUI. * Python is **popular** - far more engineers know Python than SystemVerilog or VHDL. How does cocotb work?[](https://docs.cocotb.org/en/v1.6.0/#how-does-cocotb-work "Permalink to this headline") --------------------------------------------------------------------------------------------------------------- A typical cocotb testbench requires no additional [RTL](https://docs.cocotb.org/en/v1.6.0/glossary.html#term-RTL) code. The Design Under Test ([DUT](https://docs.cocotb.org/en/v1.6.0/glossary.html#term-DUT) ) is instantiated as the toplevel in the simulator without any wrapper code. cocotb drives stimulus onto the inputs to the [DUT](https://docs.cocotb.org/en/v1.6.0/glossary.html#term-DUT) (or further down the hierarchy) and monitors the outputs directly from Python. Note that cocotb can not instantiate [HDL](https://docs.cocotb.org/en/v1.6.0/glossary.html#term-HDL) blocks - your DUT must be complete. ![_images/cocotb_overview.svg](https://docs.cocotb.org/en/v1.6.0/_images/cocotb_overview.svg) A test is simply a Python function. At any given time either the simulator is advancing time or the Python code is executing. The [`await`](https://docs.python.org/3/reference/expressions.html#await "(in Python v3.10)") keyword is used to indicate when to pass control of execution back to the simulator. A test can spawn multiple coroutines, allowing for independent flows of execution. --- # Welcome to cocotb’s documentation! — cocotb 1.4.0 documentation * [](https://docs.cocotb.org/en/v1.4.0/#) » * Welcome to cocotb’s documentation! * [Edit on GitHub](https://github.com/cocotb/cocotb/blob/v1.4.0/documentation/source/index.rst) * * * Welcome to cocotb’s documentation![¶](https://docs.cocotb.org/en/v1.4.0/#welcome-to-cocotb-s-documentation "Permalink to this headline") ========================================================================================================================================= What is cocotb?[¶](https://docs.cocotb.org/en/v1.4.0/#what-is-cocotb "Permalink to this headline") --------------------------------------------------------------------------------------------------- **cocotb** is a _COroutine_ based _COsimulation_ _TestBench_ environment for verifying VHDL and SystemVerilog RTL using [Python](https://www.python.org/) . cocotb is completely free, open source (under the [BSD License](https://en.wikipedia.org/wiki/BSD_licenses#3-clause_license_(%22BSD_License_2.0%22,_%22Revised_BSD_License%22,_%22New_BSD_License%22,_or_%22Modified_BSD_License%22)) ) and hosted on [GitHub](https://github.com/cocotb/cocotb) . cocotb requires a simulator to simulate the HDL design and has been used with a variety of simulators on Linux, Windows and macOS. Please check the [Simulator Support](https://docs.cocotb.org/en/v1.4.0/simulator_support.html#simulator-support) page for specifics. A (possibly older) version of cocotb can be used live in a web browser on [EDA Playground](https://www.edaplayground.com/) . How is cocotb different?[¶](https://docs.cocotb.org/en/v1.4.0/#how-is-cocotb-different "Permalink to this headline") --------------------------------------------------------------------------------------------------------------------- cocotb encourages the same philosophy of design re-use and randomized testing as [UVM](https://en.wikipedia.org/wiki/Universal_Verification_Methodology) , however is implemented in Python. With cocotb, VHDL or SystemVerilog are normally only used for the design itself, not the testbench. cocotb has built-in support for integrating with continuous integration systems, such as Jenkins, GitLab, etc. through standardized, machine-readable test reporting formats. cocotb was specifically designed to lower the overhead of creating a test. cocotb automatically discovers tests so that no additional step is required to add a test to a regression. All verification is done using Python which has various advantages over using SystemVerilog or VHDL for verification: * Writing Python is **fast** - it’s a very productive language. * It’s **easy** to interface to other languages from Python. * Python has a huge library of existing code to **re-use**. * Python is **interpreted** - tests can be edited and re-run without having to recompile the design or exit the simulator GUI. * Python is **popular** - far more engineers know Python than SystemVerilog or VHDL. How does cocotb work?[¶](https://docs.cocotb.org/en/v1.4.0/#how-does-cocotb-work "Permalink to this headline") --------------------------------------------------------------------------------------------------------------- A typical cocotb testbench requires no additional RTL code. The Design Under Test (DUT) is instantiated as the toplevel in the simulator without any wrapper code. cocotb drives stimulus onto the inputs to the DUT (or further down the hierarchy) and monitors the outputs directly from Python. ![_images/cocotb_overview.svg](https://docs.cocotb.org/en/v1.4.0/_images/cocotb_overview.svg) A test is simply a Python function. At any given time either the simulator is advancing time or the Python code is executing. The [`await`](https://docs.python.org/3/reference/expressions.html#await "(in Python v3.8)") keyword is used to indicate when to pass control of execution back to the simulator. A test can spawn multiple coroutines, allowing for independent flows of execution. --- # Welcome to cocotb’s documentation! — cocotb 1.6.0.dev0+gd1946447.d20210311 documentation * [](https://docs.cocotb.org/en/v1.5.0/#) » * Welcome to cocotb’s documentation! * [Edit on GitHub](https://github.com/cocotb/cocotb/blob/v1.5.0/documentation/source/index.rst) * * * Welcome to cocotb’s documentation![¶](https://docs.cocotb.org/en/v1.5.0/#welcome-to-cocotb-s-documentation "Permalink to this headline") ========================================================================================================================================= What is cocotb?[¶](https://docs.cocotb.org/en/v1.5.0/#what-is-cocotb "Permalink to this headline") --------------------------------------------------------------------------------------------------- **cocotb** is a _COroutine_ based _COsimulation_ _TestBench_ environment for verifying VHDL and SystemVerilog [RTL](https://docs.cocotb.org/en/v1.5.0/glossary.html#term-RTL) using [Python](https://www.python.org/) . cocotb is completely free, open source (under the [BSD License](https://en.wikipedia.org/wiki/BSD_licenses#3-clause_license_(%22BSD_License_2.0%22,_%22Revised_BSD_License%22,_%22New_BSD_License%22,_or_%22Modified_BSD_License%22)) ) and hosted on [GitHub](https://github.com/cocotb/cocotb) . cocotb requires a simulator to simulate the [HDL](https://docs.cocotb.org/en/v1.5.0/glossary.html#term-HDL) design and has been used with a variety of simulators on Linux, Windows and macOS. Please check the [Simulator Support](https://docs.cocotb.org/en/v1.5.0/simulator_support.html#simulator-support) page for specifics. A (possibly older) version of cocotb can be used live in a web browser on [EDA Playground](https://www.edaplayground.com/) . How is cocotb different?[¶](https://docs.cocotb.org/en/v1.5.0/#how-is-cocotb-different "Permalink to this headline") --------------------------------------------------------------------------------------------------------------------- cocotb encourages the same philosophy of design re-use and randomized testing as [UVM](https://en.wikipedia.org/wiki/Universal_Verification_Methodology) , however is implemented in Python. With cocotb, VHDL or SystemVerilog are normally only used for the design itself, not the testbench. cocotb has built-in support for integrating with continuous integration systems, such as Jenkins, GitLab, etc. through standardized, machine-readable test reporting formats. cocotb was specifically designed to lower the overhead of creating a test. cocotb automatically discovers tests so that no additional step is required to add a test to a regression. All verification is done using Python which has various advantages over using SystemVerilog or VHDL for verification: * Writing Python is **fast** - it’s a very productive language. * It’s **easy** to interface to other languages from Python. * Python has a huge library of existing code to **re-use**. * Python is **interpreted** - tests can be edited and re-run without having to recompile the design or exit the simulator GUI. * Python is **popular** - far more engineers know Python than SystemVerilog or VHDL. How does cocotb work?[¶](https://docs.cocotb.org/en/v1.5.0/#how-does-cocotb-work "Permalink to this headline") --------------------------------------------------------------------------------------------------------------- A typical cocotb testbench requires no additional [RTL](https://docs.cocotb.org/en/v1.5.0/glossary.html#term-RTL) code. The Design Under Test ([DUT](https://docs.cocotb.org/en/v1.5.0/glossary.html#term-DUT) ) is instantiated as the toplevel in the simulator without any wrapper code. cocotb drives stimulus onto the inputs to the [DUT](https://docs.cocotb.org/en/v1.5.0/glossary.html#term-DUT) (or further down the hierarchy) and monitors the outputs directly from Python. Note that cocotb can not instantiate [HDL](https://docs.cocotb.org/en/v1.5.0/glossary.html#term-HDL) blocks - your DUT must be complete. ![_images/cocotb_overview.svg](https://docs.cocotb.org/en/v1.5.0/_images/cocotb_overview.svg) A test is simply a Python function. At any given time either the simulator is advancing time or the Python code is executing. The [`await`](https://docs.python.org/3/reference/expressions.html#await "(in Python v3.9)") keyword is used to indicate when to pass control of execution back to the simulator. A test can spawn multiple coroutines, allowing for independent flows of execution. --- # Welcome to Cocotb’s documentation! — cocotb 1.1 documentation * [Docs](https://docs.cocotb.org/en/v1.1/#) » * Welcome to Cocotb’s documentation! * [Edit on GitHub](https://github.com/cocotb/cocotb/blob/v1.1/documentation/source/index.rst) * * * Welcome to Cocotb’s documentation![¶](https://docs.cocotb.org/en/v1.1/#welcome-to-cocotb-s-documentation "Permalink to this headline") ======================================================================================================================================= Contents: * [Introduction](https://docs.cocotb.org/en/v1.1/introduction.html) * [What is cocotb?](https://docs.cocotb.org/en/v1.1/introduction.html#what-is-cocotb) * [How is Cocotb different?](https://docs.cocotb.org/en/v1.1/introduction.html#how-is-cocotb-different) * [How does Cocotb work?](https://docs.cocotb.org/en/v1.1/introduction.html#how-does-cocotb-work) * [Contributors](https://docs.cocotb.org/en/v1.1/introduction.html#contributors) * [Quickstart Guide](https://docs.cocotb.org/en/v1.1/quickstart.html) * [Installing cocotb](https://docs.cocotb.org/en/v1.1/quickstart.html#installing-cocotb) * [Using Cocotb](https://docs.cocotb.org/en/v1.1/quickstart.html#using-cocotb) * [Build options and Environment Variables](https://docs.cocotb.org/en/v1.1/building.html) * [Make System](https://docs.cocotb.org/en/v1.1/building.html#make-system) * [Environment Variables](https://docs.cocotb.org/en/v1.1/building.html#environment-variables) * [Coroutines](https://docs.cocotb.org/en/v1.1/coroutines.html) * [Triggers](https://docs.cocotb.org/en/v1.1/triggers.html) * [Simulation Timing](https://docs.cocotb.org/en/v1.1/triggers.html#simulation-timing) * [Signal related](https://docs.cocotb.org/en/v1.1/triggers.html#signal-related) * [Python Triggers](https://docs.cocotb.org/en/v1.1/triggers.html#python-triggers) * [Testbench Tools](https://docs.cocotb.org/en/v1.1/testbench_tools.html) * [Logging](https://docs.cocotb.org/en/v1.1/testbench_tools.html#logging) * [Busses](https://docs.cocotb.org/en/v1.1/testbench_tools.html#busses) * [Driving Busses](https://docs.cocotb.org/en/v1.1/testbench_tools.html#driving-busses) * [Monitoring Busses](https://docs.cocotb.org/en/v1.1/testbench_tools.html#monitoring-busses) * [Tracking testbench errors](https://docs.cocotb.org/en/v1.1/testbench_tools.html#tracking-testbench-errors) * [Library Reference](https://docs.cocotb.org/en/v1.1/library_reference.html) * [Test Results](https://docs.cocotb.org/en/v1.1/library_reference.html#test-results) * [Writing and Generating tests](https://docs.cocotb.org/en/v1.1/library_reference.html#writing-and-generating-tests) * [Interacting with the Simulator](https://docs.cocotb.org/en/v1.1/library_reference.html#interacting-with-the-simulator) * [Testbench Structure](https://docs.cocotb.org/en/v1.1/library_reference.html#testbench-structure) * [Utilities](https://docs.cocotb.org/en/v1.1/library_reference.html#module-cocotb.utils) * [Simulation Object Handles](https://docs.cocotb.org/en/v1.1/library_reference.html#module-cocotb.handle) * [Implemented Testbench Structures](https://docs.cocotb.org/en/v1.1/library_reference.html#implemented-testbench-structures) * [Tutorial: Endian Swapper](https://docs.cocotb.org/en/v1.1/endian_swapper.html) * [Design](https://docs.cocotb.org/en/v1.1/endian_swapper.html#design) * [Testbench](https://docs.cocotb.org/en/v1.1/endian_swapper.html#testbench) * [Tutorial: Ping](https://docs.cocotb.org/en/v1.1/ping_tun_tap.html) * [Architecture](https://docs.cocotb.org/en/v1.1/ping_tun_tap.html#architecture) * [Implementation](https://docs.cocotb.org/en/v1.1/ping_tun_tap.html#implementation) * [Further work](https://docs.cocotb.org/en/v1.1/ping_tun_tap.html#further-work) * [Tutorial: Driver Cosimulation](https://docs.cocotb.org/en/v1.1/hal_cosimulation.html) * [Difficulties with Driver Co-simulation](https://docs.cocotb.org/en/v1.1/hal_cosimulation.html#difficulties-with-driver-co-simulation) * [Cocotb infrastructure](https://docs.cocotb.org/en/v1.1/hal_cosimulation.html#cocotb-infrastructure) * [Implementation](https://docs.cocotb.org/en/v1.1/hal_cosimulation.html#implementation) * [Further Work](https://docs.cocotb.org/en/v1.1/hal_cosimulation.html#further-work) * [Troubleshooting](https://docs.cocotb.org/en/v1.1/troubleshooting.html) * [Increasing Verbosity](https://docs.cocotb.org/en/v1.1/troubleshooting.html#increasing-verbosity) * [Attaching a Debugger](https://docs.cocotb.org/en/v1.1/troubleshooting.html#attaching-a-debugger) * [Roadmap](https://docs.cocotb.org/en/v1.1/roadmap.html) * [Simulator Support](https://docs.cocotb.org/en/v1.1/simulator_support.html) * [Icarus](https://docs.cocotb.org/en/v1.1/simulator_support.html#icarus) * [Synopsys VCS](https://docs.cocotb.org/en/v1.1/simulator_support.html#synopsys-vcs) * [Aldec Riviera-PRO](https://docs.cocotb.org/en/v1.1/simulator_support.html#aldec-riviera-pro) * [Mentor Questa](https://docs.cocotb.org/en/v1.1/simulator_support.html#mentor-questa) * [Mentor Modelsim](https://docs.cocotb.org/en/v1.1/simulator_support.html#mentor-modelsim) * [Cadence Incisive](https://docs.cocotb.org/en/v1.1/simulator_support.html#cadence-incisive) * [GHDL](https://docs.cocotb.org/en/v1.1/simulator_support.html#ghdl) Indices and tables[¶](https://docs.cocotb.org/en/v1.1/#indices-and-tables "Permalink to this headline") ======================================================================================================== * [Index](https://docs.cocotb.org/en/v1.1/genindex.html) * [Module Index](https://docs.cocotb.org/en/v1.1/py-modindex.html) * [Search Page](https://docs.cocotb.org/en/v1.1/search.html) --- # Welcome to cocotb’s documentation! — cocotb 1.6.0.dev0+gec99a877.d20210503 documentation * [](https://docs.cocotb.org/en/v1.5.2/#) » * Welcome to cocotb’s documentation! * [Edit on GitHub](https://github.com/cocotb/cocotb/blob/v1.5.2/documentation/source/index.rst) * * * Welcome to cocotb’s documentation![¶](https://docs.cocotb.org/en/v1.5.2/#welcome-to-cocotb-s-documentation "Permalink to this headline") ========================================================================================================================================= What is cocotb?[¶](https://docs.cocotb.org/en/v1.5.2/#what-is-cocotb "Permalink to this headline") --------------------------------------------------------------------------------------------------- **cocotb** is a _COroutine_ based _COsimulation_ _TestBench_ environment for verifying VHDL and SystemVerilog [RTL](https://docs.cocotb.org/en/v1.5.2/glossary.html#term-RTL) using [Python](https://www.python.org/) . cocotb is completely free, open source (under the [BSD License](https://en.wikipedia.org/wiki/BSD_licenses#3-clause_license_(%22BSD_License_2.0%22,_%22Revised_BSD_License%22,_%22New_BSD_License%22,_or_%22Modified_BSD_License%22)) ) and hosted on [GitHub](https://github.com/cocotb/cocotb) . cocotb requires a simulator to simulate the [HDL](https://docs.cocotb.org/en/v1.5.2/glossary.html#term-HDL) design and has been used with a variety of simulators on Linux, Windows and macOS. Please check the [Simulator Support](https://docs.cocotb.org/en/v1.5.2/simulator_support.html#simulator-support) page for specifics. A (possibly older) version of cocotb can be used live in a web browser on [EDA Playground](https://www.edaplayground.com/) . How is cocotb different?[¶](https://docs.cocotb.org/en/v1.5.2/#how-is-cocotb-different "Permalink to this headline") --------------------------------------------------------------------------------------------------------------------- cocotb encourages the same philosophy of design re-use and randomized testing as [UVM](https://en.wikipedia.org/wiki/Universal_Verification_Methodology) , however is implemented in Python. With cocotb, VHDL or SystemVerilog are normally only used for the design itself, not the testbench. cocotb has built-in support for integrating with continuous integration systems, such as Jenkins, GitLab, etc. through standardized, machine-readable test reporting formats. cocotb was specifically designed to lower the overhead of creating a test. cocotb automatically discovers tests so that no additional step is required to add a test to a regression. All verification is done using Python which has various advantages over using SystemVerilog or VHDL for verification: * Writing Python is **fast** - it’s a very productive language. * It’s **easy** to interface to other languages from Python. * Python has a huge library of existing code to **re-use**. * Python is **interpreted** - tests can be edited and re-run without having to recompile the design or exit the simulator GUI. * Python is **popular** - far more engineers know Python than SystemVerilog or VHDL. How does cocotb work?[¶](https://docs.cocotb.org/en/v1.5.2/#how-does-cocotb-work "Permalink to this headline") --------------------------------------------------------------------------------------------------------------- A typical cocotb testbench requires no additional [RTL](https://docs.cocotb.org/en/v1.5.2/glossary.html#term-RTL) code. The Design Under Test ([DUT](https://docs.cocotb.org/en/v1.5.2/glossary.html#term-DUT) ) is instantiated as the toplevel in the simulator without any wrapper code. cocotb drives stimulus onto the inputs to the [DUT](https://docs.cocotb.org/en/v1.5.2/glossary.html#term-DUT) (or further down the hierarchy) and monitors the outputs directly from Python. Note that cocotb can not instantiate [HDL](https://docs.cocotb.org/en/v1.5.2/glossary.html#term-HDL) blocks - your DUT must be complete. ![_images/cocotb_overview.svg](https://docs.cocotb.org/en/v1.5.2/_images/cocotb_overview.svg) A test is simply a Python function. At any given time either the simulator is advancing time or the Python code is executing. The [`await`](https://docs.python.org/3/reference/expressions.html#await "(in Python v3.9)") keyword is used to indicate when to pass control of execution back to the simulator. A test can spawn multiple coroutines, allowing for independent flows of execution. --- # Welcome to Cocotb’s documentation! — cocotb 1.3.1 documentation * [Docs](https://docs.cocotb.org/en/v1.3.1/#) » * Welcome to Cocotb’s documentation! * [Edit on GitHub](https://github.com/cocotb/cocotb/blob/v1.3.1/documentation/source/index.rst) * * * Welcome to Cocotb’s documentation![¶](https://docs.cocotb.org/en/v1.3.1/#welcome-to-cocotb-s-documentation "Permalink to this headline") ========================================================================================================================================= Contents: * [Introduction](https://docs.cocotb.org/en/v1.3.1/introduction.html) * [What is cocotb?](https://docs.cocotb.org/en/v1.3.1/introduction.html#what-is-cocotb) * [How is cocotb different?](https://docs.cocotb.org/en/v1.3.1/introduction.html#how-is-cocotb-different) * [How does cocotb work?](https://docs.cocotb.org/en/v1.3.1/introduction.html#how-does-cocotb-work) * [Contributors](https://docs.cocotb.org/en/v1.3.1/introduction.html#contributors) * [Quickstart Guide](https://docs.cocotb.org/en/v1.3.1/quickstart.html) * [Installing cocotb](https://docs.cocotb.org/en/v1.3.1/quickstart.html#installing-cocotb) * [Running your first Example](https://docs.cocotb.org/en/v1.3.1/quickstart.html#running-your-first-example) * [Using cocotb](https://docs.cocotb.org/en/v1.3.1/quickstart.html#using-cocotb) * [Build options and Environment Variables](https://docs.cocotb.org/en/v1.3.1/building.html) * [Make System](https://docs.cocotb.org/en/v1.3.1/building.html#make-system) * [Environment Variables](https://docs.cocotb.org/en/v1.3.1/building.html#environment-variables) * [Coroutines](https://docs.cocotb.org/en/v1.3.1/coroutines.html) * [Async functions](https://docs.cocotb.org/en/v1.3.1/coroutines.html#async-functions) * [Triggers](https://docs.cocotb.org/en/v1.3.1/triggers.html) * [Simulator Triggers](https://docs.cocotb.org/en/v1.3.1/triggers.html#simulator-triggers) * [Python Triggers](https://docs.cocotb.org/en/v1.3.1/triggers.html#python-triggers) * [Testbench Tools](https://docs.cocotb.org/en/v1.3.1/testbench_tools.html) * [Logging](https://docs.cocotb.org/en/v1.3.1/testbench_tools.html#logging) * [Buses](https://docs.cocotb.org/en/v1.3.1/testbench_tools.html#buses) * [Driving Buses](https://docs.cocotb.org/en/v1.3.1/testbench_tools.html#driving-buses) * [Monitoring Buses](https://docs.cocotb.org/en/v1.3.1/testbench_tools.html#monitoring-buses) * [Tracking testbench errors](https://docs.cocotb.org/en/v1.3.1/testbench_tools.html#tracking-testbench-errors) * [Library Reference](https://docs.cocotb.org/en/v1.3.1/library_reference.html) * [Test Results](https://docs.cocotb.org/en/v1.3.1/library_reference.html#test-results) * [Writing and Generating tests](https://docs.cocotb.org/en/v1.3.1/library_reference.html#writing-and-generating-tests) * [Interacting with the Simulator](https://docs.cocotb.org/en/v1.3.1/library_reference.html#interacting-with-the-simulator) * [Testbench Structure](https://docs.cocotb.org/en/v1.3.1/library_reference.html#testbench-structure) * [Utilities](https://docs.cocotb.org/en/v1.3.1/library_reference.html#utilities) * [Simulation Object Handles](https://docs.cocotb.org/en/v1.3.1/library_reference.html#simulation-object-handles) * [Implemented Testbench Structures](https://docs.cocotb.org/en/v1.3.1/library_reference.html#implemented-testbench-structures) * [Miscellaneous](https://docs.cocotb.org/en/v1.3.1/library_reference.html#miscellaneous) * [Developer-focused](https://docs.cocotb.org/en/v1.3.1/library_reference.html#developer-focused) * [C Code Library Reference](https://docs.cocotb.org/en/v1.3.1/library_reference_c.html) * [API Documentation](https://docs.cocotb.org/en/v1.3.1/library_reference_c.html#api-documentation) * [Tutorial: Endian Swapper](https://docs.cocotb.org/en/v1.3.1/endian_swapper.html) * [Design](https://docs.cocotb.org/en/v1.3.1/endian_swapper.html#design) * [Testbench](https://docs.cocotb.org/en/v1.3.1/endian_swapper.html#testbench) * [Tutorial: Ping](https://docs.cocotb.org/en/v1.3.1/ping_tun_tap.html) * [Architecture](https://docs.cocotb.org/en/v1.3.1/ping_tun_tap.html#architecture) * [Implementation](https://docs.cocotb.org/en/v1.3.1/ping_tun_tap.html#implementation) * [Further work](https://docs.cocotb.org/en/v1.3.1/ping_tun_tap.html#further-work) * [Tutorial: Driver Cosimulation](https://docs.cocotb.org/en/v1.3.1/hal_cosimulation.html) * [Difficulties with Driver Co-simulation](https://docs.cocotb.org/en/v1.3.1/hal_cosimulation.html#difficulties-with-driver-co-simulation) * [Cocotb infrastructure](https://docs.cocotb.org/en/v1.3.1/hal_cosimulation.html#cocotb-infrastructure) * [Implementation](https://docs.cocotb.org/en/v1.3.1/hal_cosimulation.html#implementation) * [Further Work](https://docs.cocotb.org/en/v1.3.1/hal_cosimulation.html#further-work) * [More Examples](https://docs.cocotb.org/en/v1.3.1/examples.html) * [Adder](https://docs.cocotb.org/en/v1.3.1/examples.html#adder) * [D Flip-Flop](https://docs.cocotb.org/en/v1.3.1/examples.html#d-flip-flop) * [Mean](https://docs.cocotb.org/en/v1.3.1/examples.html#mean) * [Mixed Language](https://docs.cocotb.org/en/v1.3.1/examples.html#mixed-language) * [AXI Lite Slave](https://docs.cocotb.org/en/v1.3.1/examples.html#axi-lite-slave) * [Sorter](https://docs.cocotb.org/en/v1.3.1/examples.html#sorter) * [Troubleshooting](https://docs.cocotb.org/en/v1.3.1/troubleshooting.html) * [Simulation Hangs](https://docs.cocotb.org/en/v1.3.1/troubleshooting.html#simulation-hangs) * [Increasing Verbosity](https://docs.cocotb.org/en/v1.3.1/troubleshooting.html#increasing-verbosity) * [Attaching a Debugger](https://docs.cocotb.org/en/v1.3.1/troubleshooting.html#attaching-a-debugger) * [Simulator Support](https://docs.cocotb.org/en/v1.3.1/simulator_support.html) * [Icarus](https://docs.cocotb.org/en/v1.3.1/simulator_support.html#icarus) * [Verilator](https://docs.cocotb.org/en/v1.3.1/simulator_support.html#verilator) * [Synopsys VCS](https://docs.cocotb.org/en/v1.3.1/simulator_support.html#synopsys-vcs) * [Aldec Riviera-PRO](https://docs.cocotb.org/en/v1.3.1/simulator_support.html#aldec-riviera-pro) * [Mentor Questa](https://docs.cocotb.org/en/v1.3.1/simulator_support.html#mentor-questa) * [Mentor ModelSim](https://docs.cocotb.org/en/v1.3.1/simulator_support.html#mentor-modelsim) * [Cadence Incisive, Cadence Xcelium](https://docs.cocotb.org/en/v1.3.1/simulator_support.html#cadence-incisive-cadence-xcelium) * [GHDL](https://docs.cocotb.org/en/v1.3.1/simulator_support.html#ghdl) * [Roadmap](https://docs.cocotb.org/en/v1.3.1/roadmap.html) * [Release Notes](https://docs.cocotb.org/en/v1.3.1/release_notes.html) * [cocotb 1.3.1](https://docs.cocotb.org/en/v1.3.1/release_notes.html#cocotb-1-3-1) * [cocotb 1.3.0](https://docs.cocotb.org/en/v1.3.1/release_notes.html#cocotb-1-3-0) * [cocotb 1.2.0](https://docs.cocotb.org/en/v1.3.1/release_notes.html#cocotb-1-2-0) * [cocotb 1.1](https://docs.cocotb.org/en/v1.3.1/release_notes.html#cocotb-1-1) * [cocotb 1.0](https://docs.cocotb.org/en/v1.3.1/release_notes.html#cocotb-1-0) * [cocotb 0.4](https://docs.cocotb.org/en/v1.3.1/release_notes.html#cocotb-0-4) * [cocotb 0.3](https://docs.cocotb.org/en/v1.3.1/release_notes.html#cocotb-0-3) * [cocotb 0.2](https://docs.cocotb.org/en/v1.3.1/release_notes.html#cocotb-0-2) * [cocotb 0.1](https://docs.cocotb.org/en/v1.3.1/release_notes.html#cocotb-0-1) Indices and tables[¶](https://docs.cocotb.org/en/v1.3.1/#indices-and-tables "Permalink to this headline") ========================================================================================================== * [Index](https://docs.cocotb.org/en/v1.3.1/genindex.html) * [Module Index](https://docs.cocotb.org/en/v1.3.1/py-modindex.html) * [Search Page](https://docs.cocotb.org/en/v1.3.1/search.html) --- # Welcome to Cocotb’s documentation! — cocotb 1.3.0 documentation * [Docs](https://docs.cocotb.org/en/v1.3.0/#) » * Welcome to Cocotb’s documentation! * [Edit on GitHub](https://github.com/cocotb/cocotb/blob/v1.3.0/documentation/source/index.rst) * * * Welcome to Cocotb’s documentation![¶](https://docs.cocotb.org/en/v1.3.0/#welcome-to-cocotb-s-documentation "Permalink to this headline") ========================================================================================================================================= Contents: * [Introduction](https://docs.cocotb.org/en/v1.3.0/introduction.html) * [What is cocotb?](https://docs.cocotb.org/en/v1.3.0/introduction.html#what-is-cocotb) * [How is cocotb different?](https://docs.cocotb.org/en/v1.3.0/introduction.html#how-is-cocotb-different) * [How does cocotb work?](https://docs.cocotb.org/en/v1.3.0/introduction.html#how-does-cocotb-work) * [Contributors](https://docs.cocotb.org/en/v1.3.0/introduction.html#contributors) * [Quickstart Guide](https://docs.cocotb.org/en/v1.3.0/quickstart.html) * [Installing cocotb](https://docs.cocotb.org/en/v1.3.0/quickstart.html#installing-cocotb) * [Running your first Example](https://docs.cocotb.org/en/v1.3.0/quickstart.html#running-your-first-example) * [Using cocotb](https://docs.cocotb.org/en/v1.3.0/quickstart.html#using-cocotb) * [Build options and Environment Variables](https://docs.cocotb.org/en/v1.3.0/building.html) * [Make System](https://docs.cocotb.org/en/v1.3.0/building.html#make-system) * [Environment Variables](https://docs.cocotb.org/en/v1.3.0/building.html#environment-variables) * [Coroutines](https://docs.cocotb.org/en/v1.3.0/coroutines.html) * [Async functions](https://docs.cocotb.org/en/v1.3.0/coroutines.html#async-functions) * [Triggers](https://docs.cocotb.org/en/v1.3.0/triggers.html) * [Simulator Triggers](https://docs.cocotb.org/en/v1.3.0/triggers.html#simulator-triggers) * [Python Triggers](https://docs.cocotb.org/en/v1.3.0/triggers.html#python-triggers) * [Testbench Tools](https://docs.cocotb.org/en/v1.3.0/testbench_tools.html) * [Logging](https://docs.cocotb.org/en/v1.3.0/testbench_tools.html#logging) * [Buses](https://docs.cocotb.org/en/v1.3.0/testbench_tools.html#buses) * [Driving Buses](https://docs.cocotb.org/en/v1.3.0/testbench_tools.html#driving-buses) * [Monitoring Buses](https://docs.cocotb.org/en/v1.3.0/testbench_tools.html#monitoring-buses) * [Tracking testbench errors](https://docs.cocotb.org/en/v1.3.0/testbench_tools.html#tracking-testbench-errors) * [Library Reference](https://docs.cocotb.org/en/v1.3.0/library_reference.html) * [Test Results](https://docs.cocotb.org/en/v1.3.0/library_reference.html#test-results) * [Writing and Generating tests](https://docs.cocotb.org/en/v1.3.0/library_reference.html#writing-and-generating-tests) * [Interacting with the Simulator](https://docs.cocotb.org/en/v1.3.0/library_reference.html#interacting-with-the-simulator) * [Testbench Structure](https://docs.cocotb.org/en/v1.3.0/library_reference.html#testbench-structure) * [Utilities](https://docs.cocotb.org/en/v1.3.0/library_reference.html#utilities) * [Simulation Object Handles](https://docs.cocotb.org/en/v1.3.0/library_reference.html#simulation-object-handles) * [Implemented Testbench Structures](https://docs.cocotb.org/en/v1.3.0/library_reference.html#implemented-testbench-structures) * [Miscellaneous](https://docs.cocotb.org/en/v1.3.0/library_reference.html#miscellaneous) * [Developer-focused](https://docs.cocotb.org/en/v1.3.0/library_reference.html#developer-focused) * [C Code Library Reference](https://docs.cocotb.org/en/v1.3.0/library_reference_c.html) * [API Documentation](https://docs.cocotb.org/en/v1.3.0/library_reference_c.html#api-documentation) * [Tutorial: Endian Swapper](https://docs.cocotb.org/en/v1.3.0/endian_swapper.html) * [Design](https://docs.cocotb.org/en/v1.3.0/endian_swapper.html#design) * [Testbench](https://docs.cocotb.org/en/v1.3.0/endian_swapper.html#testbench) * [Tutorial: Ping](https://docs.cocotb.org/en/v1.3.0/ping_tun_tap.html) * [Architecture](https://docs.cocotb.org/en/v1.3.0/ping_tun_tap.html#architecture) * [Implementation](https://docs.cocotb.org/en/v1.3.0/ping_tun_tap.html#implementation) * [Further work](https://docs.cocotb.org/en/v1.3.0/ping_tun_tap.html#further-work) * [Tutorial: Driver Cosimulation](https://docs.cocotb.org/en/v1.3.0/hal_cosimulation.html) * [Difficulties with Driver Co-simulation](https://docs.cocotb.org/en/v1.3.0/hal_cosimulation.html#difficulties-with-driver-co-simulation) * [Cocotb infrastructure](https://docs.cocotb.org/en/v1.3.0/hal_cosimulation.html#cocotb-infrastructure) * [Implementation](https://docs.cocotb.org/en/v1.3.0/hal_cosimulation.html#implementation) * [Further Work](https://docs.cocotb.org/en/v1.3.0/hal_cosimulation.html#further-work) * [More Examples](https://docs.cocotb.org/en/v1.3.0/examples.html) * [Adder](https://docs.cocotb.org/en/v1.3.0/examples.html#adder) * [D Flip-Flop](https://docs.cocotb.org/en/v1.3.0/examples.html#d-flip-flop) * [Mean](https://docs.cocotb.org/en/v1.3.0/examples.html#mean) * [Mixed Language](https://docs.cocotb.org/en/v1.3.0/examples.html#mixed-language) * [AXI Lite Slave](https://docs.cocotb.org/en/v1.3.0/examples.html#axi-lite-slave) * [Sorter](https://docs.cocotb.org/en/v1.3.0/examples.html#sorter) * [Troubleshooting](https://docs.cocotb.org/en/v1.3.0/troubleshooting.html) * [Simulation Hangs](https://docs.cocotb.org/en/v1.3.0/troubleshooting.html#simulation-hangs) * [Increasing Verbosity](https://docs.cocotb.org/en/v1.3.0/troubleshooting.html#increasing-verbosity) * [Attaching a Debugger](https://docs.cocotb.org/en/v1.3.0/troubleshooting.html#attaching-a-debugger) * [Simulator Support](https://docs.cocotb.org/en/v1.3.0/simulator_support.html) * [Icarus](https://docs.cocotb.org/en/v1.3.0/simulator_support.html#icarus) * [Verilator](https://docs.cocotb.org/en/v1.3.0/simulator_support.html#verilator) * [Synopsys VCS](https://docs.cocotb.org/en/v1.3.0/simulator_support.html#synopsys-vcs) * [Aldec Riviera-PRO](https://docs.cocotb.org/en/v1.3.0/simulator_support.html#aldec-riviera-pro) * [Mentor Questa](https://docs.cocotb.org/en/v1.3.0/simulator_support.html#mentor-questa) * [Mentor ModelSim](https://docs.cocotb.org/en/v1.3.0/simulator_support.html#mentor-modelsim) * [Cadence Incisive, Cadence Xcelium](https://docs.cocotb.org/en/v1.3.0/simulator_support.html#cadence-incisive-cadence-xcelium) * [GHDL](https://docs.cocotb.org/en/v1.3.0/simulator_support.html#ghdl) * [Roadmap](https://docs.cocotb.org/en/v1.3.0/roadmap.html) * [Release Notes](https://docs.cocotb.org/en/v1.3.0/release_notes.html) * [cocotb 1.3.0](https://docs.cocotb.org/en/v1.3.0/release_notes.html#cocotb-1-3-0) * [cocotb 1.2.0](https://docs.cocotb.org/en/v1.3.0/release_notes.html#cocotb-1-2-0) * [cocotb 1.1](https://docs.cocotb.org/en/v1.3.0/release_notes.html#cocotb-1-1) * [cocotb 1.0](https://docs.cocotb.org/en/v1.3.0/release_notes.html#cocotb-1-0) * [cocotb 0.4](https://docs.cocotb.org/en/v1.3.0/release_notes.html#cocotb-0-4) * [cocotb 0.3](https://docs.cocotb.org/en/v1.3.0/release_notes.html#cocotb-0-3) * [cocotb 0.2](https://docs.cocotb.org/en/v1.3.0/release_notes.html#cocotb-0-2) * [cocotb 0.1](https://docs.cocotb.org/en/v1.3.0/release_notes.html#cocotb-0-1) Indices and tables[¶](https://docs.cocotb.org/en/v1.3.0/#indices-and-tables "Permalink to this headline") ========================================================================================================== * [Index](https://docs.cocotb.org/en/v1.3.0/genindex.html) * [Module Index](https://docs.cocotb.org/en/v1.3.0/py-modindex.html) * [Search Page](https://docs.cocotb.org/en/v1.3.0/search.html) --- # Welcome to Cocotb’s documentation! — cocotb 1.1 documentation * [Docs](https://docs.cocotb.org/en/v1.2.0/#) » * Welcome to Cocotb’s documentation! * [Edit on GitHub](https://github.com/cocotb/cocotb/blob/v1.2.0/documentation/source/index.rst) * * * Welcome to Cocotb’s documentation![¶](https://docs.cocotb.org/en/v1.2.0/#welcome-to-cocotb-s-documentation "Permalink to this headline") ========================================================================================================================================= Contents: * [Introduction](https://docs.cocotb.org/en/v1.2.0/introduction.html) * [What is cocotb?](https://docs.cocotb.org/en/v1.2.0/introduction.html#what-is-cocotb) * [How is cocotb different?](https://docs.cocotb.org/en/v1.2.0/introduction.html#how-is-cocotb-different) * [How does cocotb work?](https://docs.cocotb.org/en/v1.2.0/introduction.html#how-does-cocotb-work) * [Contributors](https://docs.cocotb.org/en/v1.2.0/introduction.html#contributors) * [Quickstart Guide](https://docs.cocotb.org/en/v1.2.0/quickstart.html) * [Installing cocotb](https://docs.cocotb.org/en/v1.2.0/quickstart.html#installing-cocotb) * [Installing cocotb](https://docs.cocotb.org/en/v1.2.0/quickstart.html#id1) * [Using cocotb](https://docs.cocotb.org/en/v1.2.0/quickstart.html#using-cocotb) * [Build options and Environment Variables](https://docs.cocotb.org/en/v1.2.0/building.html) * [Make System](https://docs.cocotb.org/en/v1.2.0/building.html#make-system) * [Environment Variables](https://docs.cocotb.org/en/v1.2.0/building.html#environment-variables) * [Coroutines](https://docs.cocotb.org/en/v1.2.0/coroutines.html) * [Async functions](https://docs.cocotb.org/en/v1.2.0/coroutines.html#async-functions) * [Triggers](https://docs.cocotb.org/en/v1.2.0/triggers.html) * [Simulation Timing](https://docs.cocotb.org/en/v1.2.0/triggers.html#simulation-timing) * [Signal related](https://docs.cocotb.org/en/v1.2.0/triggers.html#signal-related) * [Python Triggers](https://docs.cocotb.org/en/v1.2.0/triggers.html#python-triggers) * [Testbench Tools](https://docs.cocotb.org/en/v1.2.0/testbench_tools.html) * [Logging](https://docs.cocotb.org/en/v1.2.0/testbench_tools.html#logging) * [Busses](https://docs.cocotb.org/en/v1.2.0/testbench_tools.html#busses) * [Driving Busses](https://docs.cocotb.org/en/v1.2.0/testbench_tools.html#driving-busses) * [Monitoring Busses](https://docs.cocotb.org/en/v1.2.0/testbench_tools.html#monitoring-busses) * [Tracking testbench errors](https://docs.cocotb.org/en/v1.2.0/testbench_tools.html#tracking-testbench-errors) * [Library Reference](https://docs.cocotb.org/en/v1.2.0/library_reference.html) * [Test Results](https://docs.cocotb.org/en/v1.2.0/library_reference.html#test-results) * [Writing and Generating tests](https://docs.cocotb.org/en/v1.2.0/library_reference.html#writing-and-generating-tests) * [Interacting with the Simulator](https://docs.cocotb.org/en/v1.2.0/library_reference.html#interacting-with-the-simulator) * [Testbench Structure](https://docs.cocotb.org/en/v1.2.0/library_reference.html#testbench-structure) * [Utilities](https://docs.cocotb.org/en/v1.2.0/library_reference.html#module-cocotb.utils) * [Simulation Object Handles](https://docs.cocotb.org/en/v1.2.0/library_reference.html#module-cocotb.handle) * [Implemented Testbench Structures](https://docs.cocotb.org/en/v1.2.0/library_reference.html#implemented-testbench-structures) * [C Code Library Reference](https://docs.cocotb.org/en/v1.2.0/library_reference_c.html) * [API Documentation](https://docs.cocotb.org/en/v1.2.0/library_reference_c.html#api-documentation) * [Tutorial: Endian Swapper](https://docs.cocotb.org/en/v1.2.0/endian_swapper.html) * [Design](https://docs.cocotb.org/en/v1.2.0/endian_swapper.html#design) * [Testbench](https://docs.cocotb.org/en/v1.2.0/endian_swapper.html#testbench) * [Tutorial: Ping](https://docs.cocotb.org/en/v1.2.0/ping_tun_tap.html) * [Architecture](https://docs.cocotb.org/en/v1.2.0/ping_tun_tap.html#architecture) * [Implementation](https://docs.cocotb.org/en/v1.2.0/ping_tun_tap.html#implementation) * [Further work](https://docs.cocotb.org/en/v1.2.0/ping_tun_tap.html#further-work) * [Tutorial: Driver Cosimulation](https://docs.cocotb.org/en/v1.2.0/hal_cosimulation.html) * [Difficulties with Driver Co-simulation](https://docs.cocotb.org/en/v1.2.0/hal_cosimulation.html#difficulties-with-driver-co-simulation) * [Cocotb infrastructure](https://docs.cocotb.org/en/v1.2.0/hal_cosimulation.html#cocotb-infrastructure) * [Implementation](https://docs.cocotb.org/en/v1.2.0/hal_cosimulation.html#implementation) * [Further Work](https://docs.cocotb.org/en/v1.2.0/hal_cosimulation.html#further-work) * [More Examples](https://docs.cocotb.org/en/v1.2.0/examples.html) * [Adder](https://docs.cocotb.org/en/v1.2.0/examples.html#adder) * [D Flip-Flop](https://docs.cocotb.org/en/v1.2.0/examples.html#d-flip-flop) * [Mean](https://docs.cocotb.org/en/v1.2.0/examples.html#mean) * [Mixed Language](https://docs.cocotb.org/en/v1.2.0/examples.html#mixed-language) * [AXI Lite Slave](https://docs.cocotb.org/en/v1.2.0/examples.html#axi-lite-slave) * [Sorter](https://docs.cocotb.org/en/v1.2.0/examples.html#sorter) * [Troubleshooting](https://docs.cocotb.org/en/v1.2.0/troubleshooting.html) * [Simulation Hangs](https://docs.cocotb.org/en/v1.2.0/troubleshooting.html#simulation-hangs) * [Increasing Verbosity](https://docs.cocotb.org/en/v1.2.0/troubleshooting.html#increasing-verbosity) * [Attaching a Debugger](https://docs.cocotb.org/en/v1.2.0/troubleshooting.html#attaching-a-debugger) * [Simulator Support](https://docs.cocotb.org/en/v1.2.0/simulator_support.html) * [Icarus](https://docs.cocotb.org/en/v1.2.0/simulator_support.html#icarus) * [Synopsys VCS](https://docs.cocotb.org/en/v1.2.0/simulator_support.html#synopsys-vcs) * [Aldec Riviera-PRO](https://docs.cocotb.org/en/v1.2.0/simulator_support.html#aldec-riviera-pro) * [Mentor Questa](https://docs.cocotb.org/en/v1.2.0/simulator_support.html#mentor-questa) * [Mentor Modelsim](https://docs.cocotb.org/en/v1.2.0/simulator_support.html#mentor-modelsim) * [Cadence Incisive, Cadence Xcelium](https://docs.cocotb.org/en/v1.2.0/simulator_support.html#cadence-incisive-cadence-xcelium) * [GHDL](https://docs.cocotb.org/en/v1.2.0/simulator_support.html#ghdl) * [Roadmap](https://docs.cocotb.org/en/v1.2.0/roadmap.html) * [Release Notes](https://docs.cocotb.org/en/v1.2.0/release_notes.html) * [cocotb 1.2](https://docs.cocotb.org/en/v1.2.0/release_notes.html#cocotb-1-2) * [cocotb 1.1](https://docs.cocotb.org/en/v1.2.0/release_notes.html#cocotb-1-1) * [cocotb 1.0](https://docs.cocotb.org/en/v1.2.0/release_notes.html#cocotb-1-0) * [cocotb 0.4](https://docs.cocotb.org/en/v1.2.0/release_notes.html#cocotb-0-4) * [cocotb 0.3](https://docs.cocotb.org/en/v1.2.0/release_notes.html#cocotb-0-3) * [cocotb 0.2](https://docs.cocotb.org/en/v1.2.0/release_notes.html#cocotb-0-2) * [cocotb 0.1](https://docs.cocotb.org/en/v1.2.0/release_notes.html#cocotb-0-1) Indices and tables[¶](https://docs.cocotb.org/en/v1.2.0/#indices-and-tables "Permalink to this headline") ========================================================================================================== * [Index](https://docs.cocotb.org/en/v1.2.0/genindex.html) * [Module Index](https://docs.cocotb.org/en/v1.2.0/py-modindex.html) * [Search Page](https://docs.cocotb.org/en/v1.2.0/search.html) --- # Unknown ################################## Welcome to cocotb's documentation! ################################## .. This documentation tries to follow https://www.divio.com/blog/documentation/ (Daniele Procida) Other media about the same topic: - https://ep2018.europython.eu/media/conference/slides/get-your-documentation-right.pdf - https://www.youtube.com/watch?v=t4vKPhjcMZg - A good example: http://docs.django-cms.org/en/latest/contributing/documentation.html#contributing-documentation See also https://github.com/cocotb/cocotb/wiki/Howto:-Writing-Documentation \*\*\*\*\*\*\*\*\*\*\*\*\*\*\* What is cocotb? \*\*\*\*\*\*\*\*\*\*\*\*\*\*\* \*\*cocotb\*\* is a \*COroutine\* based \*COsimulation\* \*TestBench\* environment for verifying VHDL and SystemVerilog :term:\`RTL\` using \`Python \`\_. cocotb is completely free, open source (under the \`BSD License \`\_) and hosted on \`GitHub \`\_. cocotb requires a simulator to simulate the :term:\`HDL\` design and has been used with a variety of simulators on Linux, Windows and macOS. Please check the :ref:\`simulator-support\` page for specifics. A (possibly older) version of cocotb can be used live in a web browser on \`EDA Playground \`\_. \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\* How is cocotb different? \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\* cocotb encourages the same philosophy of design re-use and randomized testing as \`UVM \`\_, however is implemented in Python. With cocotb, VHDL or SystemVerilog are normally only used for the design itself, not the testbench. cocotb has built-in support for integrating with continuous integration systems, such as Jenkins, GitLab, etc. through standardized, machine-readable test reporting formats. cocotb was specifically designed to lower the overhead of creating a test. cocotb automatically discovers tests so that no additional step is required to add a test to a regression. All verification is done using Python which has various advantages over using SystemVerilog or VHDL for verification: \* Writing Python is \*\*fast\*\* - it's a very productive language. \* It's \*\*easy\*\* to interface to other languages from Python. \* Python has a huge library of existing code to \*\*re-use\*\*. \* Python is \*\*interpreted\*\* - tests can be edited and re-run without having to recompile the design. \* Python is \*\*popular\*\* - far more engineers know Python than SystemVerilog or VHDL. \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\* How does cocotb work? \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\* A typical cocotb testbench requires no additional :term:\`RTL\` code. The Design Under Test (:term:\`DUT\`) is instantiated as the toplevel in the simulator without any wrapper code. cocotb drives stimulus onto the inputs to the :term:\`DUT\` (or further down the hierarchy) and monitors the outputs directly from Python. Note that cocotb can not instantiate :term:\`HDL\` blocks - your DUT must be complete. .. image:: diagrams/svg/cocotb\_overview.svg A test is simply a Python function. At any given time either the simulator is advancing time or the Python code is executing. The :keyword:\`await\` keyword is used to indicate when to pass control of execution back to the simulator. A test can spawn multiple coroutines, allowing for independent flows of execution. .. toctree:: :maxdepth: 1 :hidden: quickstart install .. Tutorials - lessons that take the reader by the hand through a series of steps to complete a project (Example: kid cooking; learning-oriented) - learning by doing - getting started - inspiring confidence - repeatability - immediate sense of achievement - concreteness, not abstraction - minimum necessary explanation - no distractions .. toctree:: :maxdepth: 1 :caption: Tutorials :name: tutorials :hidden: examples .. How-To Guides - guides that take the reader through the steps required to solve a common problem (Example: recipe; problem-oriented) - a series of steps - a focus on the goal - addressing a specific question - no unnecessary explanation - a little flexibility - practical usability - good naming .. toctree:: :maxdepth: 1 :caption: How-to Guides :name: howto\_guides :hidden: writing\_testbenches runner coroutines triggers custom\_flows rotating\_logger .. todo:: - Add WaveDrom, IPython sections - How to deal with existing Verification IP? - Point to https://github.com/cocotb/cocotb/wiki/Code-Examples .. Explanation (Background, Discussions) - discussions that clarify and illuminate a particular topic (Example: history of cooking; understanding-oriented) - giving context - explaining why - multiple examples, alternative approaches - making connections - no instruction or technical description .. toctree:: :maxdepth: 1 :caption: Key topics :name: key\_topics :hidden: install\_devel troubleshooting .. todo:: - Move section "How does cocotb work?" from Introduction to here - Add some info from :doc:\`coroutines\` - Add GPI section - Explain \`\`ReadOnly\`\`, \`\`ReadWrite\`\`, ... phases - Add pitfall from https://github.com/cocotb/cocotb/issues/526#issuecomment-300371629 to troubleshooting .. Reference - technical descriptions of the machinery and its operation (Example: Wikipedia pages of ingredients; information-oriented) - structure - consistency - description - accuracy .. toctree:: :maxdepth: 1 :caption: Reference :name: reference :hidden: building Python Code Library Reference GPI Library Reference simulator\_support platform\_support extensions refcard .. toctree:: :maxdepth: 1 :caption: Development & Community :name: development\_community :hidden: roadmap contributors release\_notes further\_resources .. todo:: - Add "Join us online" and "Contributing" - In Contributing, add explanation on how to provide a PR, how to test existing PRs, etc. - merge \`further\_resources\` into Contributing .. toctree:: :maxdepth: 1 :caption: Index :name: index :hidden: Classes, Methods, Variables etc. Python Modules glossary --- # Installation — cocotb 1.9.2 documentation * [](https://docs.cocotb.org/en/stable/index.html) * Installation * [View page source](https://docs.cocotb.org/en/stable/_sources/install.rst.txt) * * * Installation[](https://docs.cocotb.org/en/stable/install.html#installation "Link to this heading") ==================================================================================================== Using cocotb requires installation of prerequisites and installation of cocotb itself. In this document, we are assuming that you already have a [supported simulator](https://docs.cocotb.org/en/stable/simulator_support.html#simulator-support) available in `PATH`. Installation of Prerequisites[](https://docs.cocotb.org/en/stable/install.html#installation-of-prerequisites "Link to this heading") -------------------------------------------------------------------------------------------------------------------------------------- The current stable version of cocotb requires: * Python 3.6+ * GNU Make 3+ * A Verilog or VHDL simulator, depending on your [RTL](https://docs.cocotb.org/en/stable/glossary.html#term-RTL) source code Changed in version 1.7.0: Dropped requirement of Python development headers and C++ compiler for release versions. Changed in version 1.6.0: Dropped Python 3.5 support Changed in version 1.4: Dropped Python 2 support Note In order to use a 32-bit simulator you need to use a 32-bit version of Python. The installation instructions vary depending on your operating system: WindowsLinux - DebianLinux - Red HatmacOS We recommend users who are running Windows and who are more comfortable with a Unix shell, or who have legacy Makefile-based projects, to use Windows Subsystem for Linux (WSL). After installing WSL and a supported Linux distribution, follow the Linux installation instructions for cocotb. [Conda](https://conda.io/) is an open-source package and environment management system that we recommend for users who are more comfortable with native Windows development. Download and install [Miniconda](https://docs.conda.io/en/latest/miniconda.html) from [https://conda.io/](https://conda.io/) . From an Anaconda Prompt, use the following line to install a compiler (GCC or Clang) and GNU Make: conda install \-c msys2 m2\-base m2\-make In a terminal, run sudo apt-get install make python3 python3-pip libpython3-dev In a terminal, run sudo yum install make python3 python3-pip python3-libs We recommend using the [Homebrew](https://brew.sh/) package manager. After installing it, run the following line in a terminal: brew install python Installation of cocotb[](https://docs.cocotb.org/en/stable/install.html#installation-of-cocotb "Link to this heading") ------------------------------------------------------------------------------------------------------------------------ You are reading the documentation for cocotb 1.9. To install this version, or any later compatible version, run pip install "cocotb~=|version|" Note The reusable bus interfaces and testbenching components have recently been moved to the [cocotb-bus](https://github.com/cocotb/cocotb-bus) package. You can easily install these at the same time as cocotb by adding the `bus` extra install: `pip install cocotb[bus]`. Note If your user does not have permissions to install cocotb using the instructions above, try adding the `--user` option to **pip** (see [the pip documentation](https://pip.pypa.io/en/stable/user_guide/#user-installs) ). Warning **pip** may belong to a different Python installation to what you expect. Use `pip -V` to check. If this prints “(python 2.7)”, use **pip3** or `python3 -m pip` in place of **pip** in the command shown. If you want to install the **development version** of cocotb, [instructions are here](https://docs.cocotb.org/en/latest/install_devel.html) . After installation, you should be able to execute **cocotb-config**. If it is not found, you need to append its location to the `PATH` environment variable. For more installation options, please see [our Wiki](https://github.com/cocotb/cocotb/wiki/Tier-2-Setup-Instructions) . --- # Writing Testbenches — cocotb 1.9.2 documentation * [](https://docs.cocotb.org/en/stable/index.html) * Writing Testbenches * [View page source](https://docs.cocotb.org/en/stable/_sources/writing_testbenches.rst.txt) * * * Writing Testbenches[](https://docs.cocotb.org/en/stable/writing_testbenches.html#writing-testbenches "Link to this heading") ============================================================================================================================== Accessing the design[](https://docs.cocotb.org/en/stable/writing_testbenches.html#accessing-the-design "Link to this heading") -------------------------------------------------------------------------------------------------------------------------------- When cocotb initializes it finds the toplevel instantiation in the simulator and creates a _handle_ called `dut`. Toplevel signals can be accessed using the “dot” notation used for accessing object attributes in Python. The same mechanism can be used to access signals inside the design. \# Get a reference to the "clk" signal on the toplevel clk \= dut.clk \# Get a reference to a register "count" \# in a sub-block "inst\_sub\_block" \# (the instance name of a Verilog module or VHDL entity/component) count \= dut.inst\_sub\_block.count Finding elements in the design[](https://docs.cocotb.org/en/stable/writing_testbenches.html#finding-elements-in-the-design "Link to this heading") ---------------------------------------------------------------------------------------------------------------------------------------------------- To find elements of the DUT (for example, instances, signals, or constants) at a certain hierarchy level, you can use the [`dir()`](https://docs.cocotb.org/en/stable/library_reference.html#dir "dir") function on a handle. \# Print the instances and signals (which includes the ports) of the design's toplevel print(dir(dut)) \# Print the instances and signals of "inst\_sub\_block" under the toplevel \# which is the instance name of a Verilog module or VHDL entity/component print(dir(dut.inst\_sub\_block)) Assigning values to signals[](https://docs.cocotb.org/en/stable/writing_testbenches.html#assigning-values-to-signals "Link to this heading") ---------------------------------------------------------------------------------------------------------------------------------------------- Values can be assigned to signals using either the [`value`](https://docs.cocotb.org/en/stable/library_reference.html#cocotb.handle.NonHierarchyObject.value "cocotb.handle.NonHierarchyObject.value") property of a handle object or using direct assignment while traversing the hierarchy. \# Get a reference to the "clk" signal and assign a value clk \= dut.clk clk.value \= 1 \# Direct assignment through the hierarchy dut.input\_signal.value \= 12 \# Assign a value to a memory deeper in the hierarchy \# ("inst\_sub\_block" and "inst\_memory" are instance names of the \# respective Verilog modules or VHDL entity/components in the DUT) dut.inst\_sub\_block.inst\_memory.mem\_array\[4\].value \= 2 The assignment syntax `sig.value = new_value` has the same semantics as [HDL](https://docs.cocotb.org/en/stable/glossary.html#term-HDL) : writes are not applied immediately, but delayed until the next write cycle. Use `sig.setimmediatevalue(new_val)` to set a new value immediately (see [`setimmediatevalue()`](https://docs.cocotb.org/en/stable/library_reference.html#cocotb.handle.NonHierarchyObject.setimmediatevalue "cocotb.handle.NonHierarchyObject.setimmediatevalue") ). ### Signed and unsigned values[](https://docs.cocotb.org/en/stable/writing_testbenches.html#signed-and-unsigned-values "Link to this heading") Both signed and unsigned values can be assigned to signals using a Python int. Cocotb makes no assumptions regarding the signedness of the signal. It only considers the width of the signal, so it will allow values in the range from the minimum negative value for a signed number up to the maximum positive value for an unsigned number: `-2**(Nbits - 1) <= value <= 2**Nbits - 1` Note: assigning out-of-range values will raise an [`OverflowError`](https://docs.python.org/3/library/exceptions.html#OverflowError "(in Python v3.13)") . A `BinaryValue` object can be used instead of a Python int to assign a value to signals with more fine-grained control (e.g. signed values only). module my\_module ( input logic clk, input logic rst, input logic \[2:0\] data\_in, output logic \[2:0\] data\_out ); \# assignment of negative value dut.data\_in.value \= \-4 \# assignment of positive value dut.data\_in.value \= 7 \# assignment of out-of-range values dut.data\_in.value \= 8 \# raises OverflowError dut.data\_in.value \= \-5 \# raises OverflowError Reading values from signals[](https://docs.cocotb.org/en/stable/writing_testbenches.html#reading-values-from-signals "Link to this heading") ---------------------------------------------------------------------------------------------------------------------------------------------- Values in the DUT can be accessed with the [`value`](https://docs.cocotb.org/en/stable/library_reference.html#cocotb.handle.NonHierarchyObject.value "cocotb.handle.NonHierarchyObject.value") property of a handle object. A common mistake is forgetting the `.value` which just gives you a reference to a handle (useful for defining an alias name), not the value. The Python type of a value depends on the handle’s HDL type: * Arrays of `logic` and subtypes of that (`sfixed`, `unsigned`, etc.) are of type [`BinaryValue`](https://docs.cocotb.org/en/stable/library_reference.html#cocotb.binary.BinaryValue "cocotb.binary.BinaryValue") . * Integer nets and constants (`integer`, `natural`, etc.) return [`int`](https://docs.python.org/3/library/functions.html#int "(in Python v3.13)") . * Floating point nets and constants (`real`) return [`float`](https://docs.python.org/3/library/functions.html#float "(in Python v3.13)") . * Boolean nets and constants (`boolean`) return [`bool`](https://docs.python.org/3/library/functions.html#bool "(in Python v3.13)") . * String nets and constants (`string`) return [`bytes`](https://docs.python.org/3/library/stdtypes.html#bytes "(in Python v3.13)") . For a [`BinaryValue`](https://docs.cocotb.org/en/stable/library_reference.html#cocotb.binary.BinaryValue "cocotb.binary.BinaryValue") object, any unresolved bits are preserved and can be accessed using the [`binstr`](https://docs.cocotb.org/en/stable/library_reference.html#cocotb.binary.BinaryValue.binstr "cocotb.binary.BinaryValue.binstr") attribute, or a resolved integer value can be accessed using the [`integer`](https://docs.cocotb.org/en/stable/library_reference.html#cocotb.binary.BinaryValue.integer "cocotb.binary.BinaryValue.integer") attribute. \>>> \# Read a value back from the DUT \>>> count \= dut.counter.value \>>> print(count.binstr) 1X1010 \>>> \# Resolve the value to an integer (X or Z treated as 0) \>>> print(count.integer) 42 \>>> \# Show number of bits in a value \>>> print(count.n\_bits) 6 We can also cast the signal handle directly to an integer: \>>> print(int(dut.counter)) 42 Identifying tests[](https://docs.cocotb.org/en/stable/writing_testbenches.html#writing-tbs-identifying-tests "Link to this heading") -------------------------------------------------------------------------------------------------------------------------------------- Cocotb tests are identified using the [`test`](https://docs.cocotb.org/en/stable/library_reference.html#cocotb.test "cocotb.test") decorator. Using this decorator will tell cocotb that this function is a special type of coroutine that is meant to either pass or fail. The [`test`](https://docs.cocotb.org/en/stable/library_reference.html#cocotb.test "cocotb.test") decorator supports several keyword arguments (see section [Writing and Generating tests](https://docs.cocotb.org/en/stable/library_reference.html#writing-tests) ). In most cases no arguments are passed to the decorator so cocotb tests can be written as: \# A valid cocotb test @cocotb.test async def test(dut): pass \# Also a valid cocotb test @cocotb.test() async def test(dut): pass Concurrent and sequential execution[](https://docs.cocotb.org/en/stable/writing_testbenches.html#concurrent-and-sequential-execution "Link to this heading") -------------------------------------------------------------------------------------------------------------------------------------------------------------- An [`await`](https://docs.python.org/3/reference/expressions.html#await "(in Python v3.13)") will run an [`async`](https://docs.python.org/3/reference/compound_stmts.html#async "(in Python v3.13)") coroutine and wait for it to complete. The called coroutine “blocks” the execution of the current coroutine. Wrapping the call in [`start()`](https://docs.cocotb.org/en/stable/library_reference.html#cocotb.start "cocotb.start") or [`start_soon()`](https://docs.cocotb.org/en/stable/library_reference.html#cocotb.start_soon "cocotb.start_soon") runs the coroutine concurrently, allowing the current coroutine to continue executing. At any time you can [`await`](https://docs.python.org/3/reference/expressions.html#await "(in Python v3.13)") the result of the forked coroutine, which will block until the forked coroutine finishes. The following example shows these in action: \# A coroutine async def reset\_dut(reset\_n, duration\_ns): reset\_n.value \= 0 await Timer(duration\_ns, units\="ns") reset\_n.value \= 1 reset\_n.\_log.debug("Reset complete") @cocotb.test() async def parallel\_example(dut): reset\_n \= dut.reset \# Execution will block until reset\_dut has completed await reset\_dut(reset\_n, 500) dut.\_log.debug("After reset") \# Run reset\_dut concurrently reset\_thread \= cocotb.start\_soon(reset\_dut(reset\_n, duration\_ns\=500)) \# This timer will complete before the timer in the concurrently executing "reset\_thread" await Timer(250, units\="ns") dut.\_log.debug("During reset (reset\_n = %s)" % reset\_n.value) \# Wait for the other thread to complete await reset\_thread dut.\_log.debug("After reset") See [Coroutines and Tasks](https://docs.cocotb.org/en/stable/coroutines.html#coroutines) for more examples of what can be done with coroutines. Forcing and freezing signals[](https://docs.cocotb.org/en/stable/writing_testbenches.html#forcing-and-freezing-signals "Link to this heading") ------------------------------------------------------------------------------------------------------------------------------------------------ In addition to regular value assignments (deposits), signals can be forced to a predetermined value or frozen at their current value. To achieve this, the various actions described in [Assignment Methods](https://docs.cocotb.org/en/stable/library_reference.html#assignment-methods) can be used. \# Deposit action dut.my\_signal.value \= 12 dut.my\_signal.value \= Deposit(12) \# equivalent syntax \# Force action dut.my\_signal.value \= Force(12) \# my\_signal stays 12 until released \# Release action dut.my\_signal.value \= Release() \# Reverts any force/freeze assignments \# Freeze action dut.my\_signal.value \= Freeze() \# my\_signal stays at current value until released Accessing Identifiers Starting with an Underscore[](https://docs.cocotb.org/en/stable/writing_testbenches.html#accessing-identifiers-starting-with-an-underscore "Link to this heading") ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ The attribute syntax of `dut._some_signal` cannot be used to access an identifier that starts with an underscore (`_`, as is valid in Verilog) because we reserve such names for cocotb-internals, thus the access will raise an [`AttributeError`](https://docs.python.org/3/library/exceptions.html#AttributeError "(in Python v3.13)") . A workaround is to use indirect access using [`_id()`](https://docs.cocotb.org/en/stable/library_reference.html#cocotb.handle.HierarchyObject._id "cocotb.handle.HierarchyObject._id") like in the following example: `dut._id("_some_signal", extended=False)`. Passing and Failing Tests[](https://docs.cocotb.org/en/stable/writing_testbenches.html#passing-and-failing-tests "Link to this heading") ------------------------------------------------------------------------------------------------------------------------------------------ A cocotb test is considered to have failed if the test coroutine, or any coroutine [`fork()`](https://docs.cocotb.org/en/stable/library_reference.html#cocotb.fork "cocotb.fork") ed by the test coroutine, fails an `assert` statement. Below are examples of failing tests. @cocotb.test() async def test(dut): assert 1 \> 2, "Testing the obvious" @cocotb.test() async def test(dut): async def fails\_test(): assert 1 \> 2 cocotb.start\_soon(fails\_test()) await Timer(10, 'ns') When a test fails, a stacktrace is printed. If [`pytest`](https://docs.pytest.org/en/latest/index.html#module-pytest "(in pytest v8.4.0.dev364)") is installed and `assert` statements are used, a more informative stacktrace is printed which includes the values that caused the `assert` to fail. For example, see the output for the first test from above. 0.00ns ERROR Test Failed: test (result was AssertionError) Traceback (most recent call last): File "test.py", line 3, in test assert 1 \> 2, "Testing the obvious" AssertionError: Testing the obvious A cocotb test is considered to have errored if the test coroutine, or any coroutine [`fork()`](https://docs.cocotb.org/en/stable/library_reference.html#cocotb.fork "cocotb.fork") ed by the test coroutine, raises an exception that isn’t considered a failure. Below are examples of erroring tests. @cocotb.test() async def test(dut): await coro\_that\_does\_not\_exist() \# NameError @cocotb.test() async def test(dut): async def coro\_with\_an\_error(): dut.signal\_that\_does\_not\_exist.value \= 1 \# AttributeError cocotb.start\_soon(coro\_with\_an\_error()) await Timer(10, 'ns') When a test ends with an error, a stacktrace is printed. For example, see the below output for the first test from above. 0.00ns ERROR Test Failed: test (result was NameError) Traceback (most recent call last): File "test.py", line 3, in test await coro\_that\_does\_not\_exist() \# NameError NameError: name 'coro\_that\_does\_not\_exist' is not defined If a test coroutine completes without failing or erroring, or if the test coroutine, or any coroutine [`fork()`](https://docs.cocotb.org/en/stable/library_reference.html#cocotb.fork "cocotb.fork") ed by the test coroutine, raises [`cocotb.result.TestSuccess`](https://docs.cocotb.org/en/stable/library_reference.html#cocotb.result.TestSuccess "cocotb.result.TestSuccess") , the test is considered to have passed. Below are examples of passing tests. @cocotb.test(): async def test(dut): assert 2 \> 1 \# assertion is correct, then the coroutine ends @cocotb.test() async def test(dut): raise TestSuccess("Reason") \# ends test with success early assert 1 \> 2 \# this would fail, but it isn't run because the test was ended early @cocotb.test() async def test(dut): async def ends\_test\_with\_pass(): raise TestSuccess("Reason") cocotb.start\_soon(ends\_test\_with\_pass()) await Timer(10, 'ns') A passing test will print the following output. 0.00ns INFO Test Passed: test Logging[](https://docs.cocotb.org/en/stable/writing_testbenches.html#logging "Link to this heading") ------------------------------------------------------------------------------------------------------ Cocotb uses the builtin [`logging`](https://docs.python.org/3/library/logging.html#module-logging "(in Python v3.13)") library, with some configuration described in [Logging](https://docs.cocotb.org/en/stable/library_reference.html#logging-reference-section) to provide some sensible defaults. Any forked coroutine holds a [`logging.Logger`](https://docs.python.org/3/library/logging.html#logging.Logger "(in Python v3.13)") , and can be set to its own logging level. task \= cocotb.start\_soon(coro) task.log.setLevel(logging.DEBUG) task.log.debug("Running Task!") The [DUT](https://docs.cocotb.org/en/stable/glossary.html#term-DUT) and each hierarchical object can also have individual logging levels set. When logging [HDL](https://docs.cocotb.org/en/stable/glossary.html#term-HDL) objects, beware that `_log` is the preferred way to use logging. This helps minimize the change of name collisions with an [HDL](https://docs.cocotb.org/en/stable/glossary.html#term-HDL) log component with the Python logging functionality. dut.my\_signal.\_log.info("Setting signal") dut.my\_signal.value \= 1 --- # Building HDL and Running Tests — cocotb 1.9.2 documentation * [](https://docs.cocotb.org/en/stable/index.html) * Building HDL and Running Tests * [View page source](https://docs.cocotb.org/en/stable/_sources/runner.rst.txt) * * * Building HDL and Running Tests[](https://docs.cocotb.org/en/stable/runner.html#building-hdl-and-running-tests "Link to this heading") ======================================================================================================================================= Added in version 1.8. Warning Python runners and associated APIs are an experimental feature and subject to change. The Python Test Runner (short: “runner”) described here is a replacement for cocotb’s traditional Makefile flow. It builds the HDL for the simulator and runs the tests. It is not meant to be ideal solution for everyone. You can easily integrate cocotb into your custom flow, see [Extending existing build flows](https://docs.cocotb.org/en/stable/custom_flows.html#custom-flows) . Usage with pytest[](https://docs.cocotb.org/en/stable/runner.html#usage-with-pytest "Link to this heading") ------------------------------------------------------------------------------------------------------------- The runner can be used with [pytest](https://pytest.org/) which is Python’s go-to testing tool. For an example on how to set up the runner with pytest, see the file `_cocotb-root_/examples/simple_dff/test_dff.py`, with the relevant part shown here: def test\_simple\_dff\_runner(): hdl\_toplevel\_lang \= os.getenv("HDL\_TOPLEVEL\_LANG", "verilog") sim \= os.getenv("SIM", "icarus") proj\_path \= Path(\_\_file\_\_).resolve().parent verilog\_sources \= \[\] vhdl\_sources \= \[\] if hdl\_toplevel\_lang \== "verilog": verilog\_sources \= \[proj\_path / "dff.sv"\] else: vhdl\_sources \= \[proj\_path / "dff.vhdl"\] runner \= get\_runner(sim) runner.build( verilog\_sources\=verilog\_sources, vhdl\_sources\=vhdl\_sources, hdl\_toplevel\="dff", always\=True, ) runner.test(hdl\_toplevel\="dff", test\_module\="test\_dff,") You run this file with pytest like SIM\=questa HDL\_TOPLEVEL\_LANG\=vhdl pytest examples/simple\_dff/test\_dff.py Note that the environment variables `SIM` and `HDL_TOPLEVEL_LANG` are defined in this test file to set arguments to the runner’s `build()` and `test()` functions; they are not directly handled by the runner itself. Test filenames and functions have to follow the [pytest discovery](https://docs.pytest.org/explanation/goodpractices.html#test-discovery) convention in order to be automatically found. By default, pytest will only show you a terse “pass/fail” information. To see more details of the simulation run, including the output produced by cocotb, add the `-s` option to the `pytest` call: SIM\=questa HDL\_TOPLEVEL\_LANG\=vhdl pytest examples/simple\_dff/test\_dff.py \-s Note Take a look at the [list of command line flags](https://docs.pytest.org/en/latest/reference/reference.html#command-line-flags "(in pytest v8.4.0.dev364)") in pytest’s official documentation. Direct usage[](https://docs.cocotb.org/en/stable/runner.html#direct-usage "Link to this heading") --------------------------------------------------------------------------------------------------- You can also run the test directly, that is, without using pytest, like so python examples/simple\_dff/test\_dff.py This requires that you define the test to run in the testcase file itself. For example, add the following code at the end: if \_\_name\_\_ \== "\_\_main\_\_": test\_simple\_dff\_runner() API[](https://docs.cocotb.org/en/stable/runner.html#api "Link to this heading") --------------------------------------------------------------------------------- The API of the Python runner is documented in section [Python Test Runner](https://docs.cocotb.org/en/stable/library_reference.html#api-runner) . --- # Coroutines and Tasks — cocotb 1.9.2 documentation * [](https://docs.cocotb.org/en/stable/index.html) * Coroutines and Tasks * [View page source](https://docs.cocotb.org/en/stable/_sources/coroutines.rst.txt) * * * Coroutines and Tasks[](https://docs.cocotb.org/en/stable/coroutines.html#coroutines-and-tasks "Link to this heading") ======================================================================================================================= Testbenches built using cocotb use Python coroutines. _Tasks_ are cocotb objects that wrap coroutines and are used to schedule concurrent execution of the testbench coroutines. While active tasks are executing, the simulation is paused. The coroutine uses the [`await`](https://docs.python.org/3/reference/expressions.html#await "(in Python v3.13)") keyword to block on another coroutine’s execution or pass control of execution back to the simulator, allowing simulation time to advance. Typically coroutines [`await`](https://docs.python.org/3/reference/expressions.html#await "(in Python v3.13)") a [`Trigger`](https://docs.cocotb.org/en/stable/library_reference.html#cocotb.triggers.Trigger "cocotb.triggers.Trigger") object which pauses the task, and indicates to the simulator some event which will cause the task to resume execution. For example: async def wait\_10ns(): cocotb.log.info("About to wait for 10 ns") await Timer(10, units\='ns') cocotb.log.info("Simulation time has advanced by 10 ns") Coroutines may also [`await`](https://docs.python.org/3/reference/expressions.html#await "(in Python v3.13)") on other coroutines: async def wait\_100ns(): for i in range(10): await wait\_10ns() Coroutines can [`return`](https://docs.python.org/3/reference/simple_stmts.html#return "(in Python v3.13)") a value, so that they can be used by other coroutines. async def get\_signal(clk, signal): await RisingEdge(clk) return signal.value async def check\_signal\_changes(dut): first \= await get\_signal(dut.clk, dut.signal) second \= await get\_signal(dut.clk, dut.signal) assert first != second, "Signal did not change" Concurrent Execution[](https://docs.cocotb.org/en/stable/coroutines.html#concurrent-execution "Link to this heading") ----------------------------------------------------------------------------------------------------------------------- Coroutines can be scheduled for concurrent execution with [`fork()`](https://docs.cocotb.org/en/stable/library_reference.html#cocotb.fork "cocotb.fork") , [`start()`](https://docs.cocotb.org/en/stable/library_reference.html#cocotb.start "cocotb.start") , and [`start_soon()`](https://docs.cocotb.org/en/stable/library_reference.html#cocotb.start_soon "cocotb.start_soon") . [`fork()`](https://docs.cocotb.org/en/stable/library_reference.html#cocotb.fork "cocotb.fork") (deprecated) schedules and executes the new coroutine immediately, returning control to the calling task after the new coroutine finishes or yields control. No other pending tasks are run. The _async_ function [`start()`](https://docs.cocotb.org/en/stable/library_reference.html#cocotb.start "cocotb.start") schedules the new coroutine to be executed concurrently, then yields control to allow the new task (and any other pending tasks) to run, before resuming the calling task. [`start_soon()`](https://docs.cocotb.org/en/stable/library_reference.html#cocotb.start_soon "cocotb.start_soon") schedules the new coroutine for future execution, after the calling task yields control. Note The preferred way to schedule tasks is with [`start()`](https://docs.cocotb.org/en/stable/library_reference.html#cocotb.start "cocotb.start") and [`start_soon()`](https://docs.cocotb.org/en/stable/library_reference.html#cocotb.start_soon "cocotb.start_soon") . [`fork()`](https://docs.cocotb.org/en/stable/library_reference.html#cocotb.fork "cocotb.fork") is deprecated and will be removed in a future version of cocotb. @cocotb.test() async def test\_act\_during\_reset(dut): """While reset is active, toggle signals""" tb \= uart\_tb(dut) \# "Clock" is a built in class for toggling a clock signal cocotb.start\_soon(Clock(dut.clk, 1, units\='ns').start()) \# reset\_dut is a function - \# part of the user-generated "uart\_tb" class \# run reset\_dut immediately before continuing await cocotb.start(tb.reset\_dut(dut.rstn, 20)) await Timer(10, units\='ns') print("Reset is still active: %d" % dut.rstn) await Timer(15, units\='ns') print("Reset has gone inactive: %d" % dut.rstn) Other tasks can be used in an [`await`](https://docs.python.org/3/reference/expressions.html#await "(in Python v3.13)") statement to suspend the current task until the other task finishes. @cocotb.test() async def test\_count\_edge\_cycles(dut, period\_ns\=1, clocks\=6): cocotb.start\_soon(Clock(dut.clk, period\_ns, units\='ns').start()) await RisingEdge(dut.clk) timer \= Timer(period\_ns + 10, 'ns') task \= cocotb.start\_soon(count\_edges\_cycles(dut.clk, clocks)) count \= 0 expect \= clocks \- 1 while True: result \= await First(timer, task) if count \> expect: raise TestFailure("Task didn't complete in expected time") if result is timer: dut.\_log.info("Count %d: Task still running" % count) count += 1 else: break Tasks can be killed before they complete, forcing their completion before they would naturally end. @cocotb.test() async def test\_different\_clocks(dut): clk\_1mhz \= Clock(dut.clk, 1.0, units\='us') clk\_250mhz \= Clock(dut.clk, 4.0, units\='ns') clk\_gen \= cocotb.start\_soon(clk\_1mhz.start()) start\_time\_ns \= get\_sim\_time(units\='ns') await Timer(1, units\='ns') await RisingEdge(dut.clk) edge\_time\_ns \= get\_sim\_time(units\='ns') if not isclose(edge\_time\_ns, start\_time\_ns + 1000.0): raise TestFailure("Expected a period of 1 us") clk\_gen.kill() \# kill clock coroutine here clk\_gen \= cocotb.start\_soon(clk\_250mhz.start()) start\_time\_ns \= get\_sim\_time(units\='ns') await Timer(1, units\='ns') await RisingEdge(dut.clk) edge\_time\_ns \= get\_sim\_time(units\='ns') if not isclose(edge\_time\_ns, start\_time\_ns + 4.0): raise TestFailure("Expected a period of 4 ns") Changed in version 1.4: The [`cocotb.coroutine`](https://docs.cocotb.org/en/stable/library_reference.html#cocotb.coroutine "cocotb.coroutine") decorator is no longer necessary for `async def` coroutines. `async def` coroutines can be used, without the `@cocotb.coroutine` decorator, wherever decorated coroutines are accepted, including [`yield`](https://docs.python.org/3/reference/simple_stmts.html#yield "(in Python v3.13)") statements and [`cocotb.fork()`](https://docs.cocotb.org/en/stable/library_reference.html#cocotb.fork "cocotb.fork") . Changed in version 1.6: Added [`cocotb.start()`](https://docs.cocotb.org/en/stable/library_reference.html#cocotb.start "cocotb.start") and [`cocotb.start_soon()`](https://docs.cocotb.org/en/stable/library_reference.html#cocotb.start_soon "cocotb.start_soon") scheduling functions. Changed in version 1.7: Deprecated [`cocotb.fork()`](https://docs.cocotb.org/en/stable/library_reference.html#cocotb.fork "cocotb.fork") . Async generators[](https://docs.cocotb.org/en/stable/coroutines.html#async-generators "Link to this heading") --------------------------------------------------------------------------------------------------------------- In Python 3.6, a `yield` statement within an `async` function has a new meaning (rather than being a `SyntaxError`) which matches the typical meaning of `yield` within regular Python code. It can be used to create a special type of generator function that can be iterated with `async for`: async def ten\_samples\_of(clk, signal): for i in range(10): await RisingEdge(clk) yield signal.value \# this means "send back to the for loop" @cocotb.test() async def test\_samples\_are\_even(dut): async for sample in ten\_samples\_of(dut.clk, dut.signal): assert sample % 2 \== 0 More details on this type of generator can be found in [**PEP 525**](https://peps.python.org/pep-0525/) . Generator-based coroutines[](https://docs.cocotb.org/en/stable/coroutines.html#generator-based-coroutines "Link to this heading") ----------------------------------------------------------------------------------------------------------------------------------- Note This style is no longer recommended and support may someday be removed. Prior to Python 3.5, and the introduction of [`async`](https://docs.python.org/3/reference/compound_stmts.html#async "(in Python v3.13)") and [`await`](https://docs.python.org/3/reference/expressions.html#await "(in Python v3.13)") , coroutines were implemented as wrappers around generators. Coroutine functions would be decorated with [`coroutine`](https://docs.cocotb.org/en/stable/library_reference.html#cocotb.coroutine "cocotb.coroutine") and would use [`yield`](https://docs.python.org/3/reference/simple_stmts.html#yield "(in Python v3.13)") to block on other coroutines or triggers. You may see existing code that uses this syntax for coroutines, but do not worry, it is compatible with [`async`](https://docs.python.org/3/reference/compound_stmts.html#async "(in Python v3.13)") coroutines. Any object that can be used in an [`await`](https://docs.python.org/3/reference/expressions.html#await "(in Python v3.13)") statement can also be used in a [`yield`](https://docs.python.org/3/reference/simple_stmts.html#yield "(in Python v3.13)") statement while in a generator-based coroutine; including triggers like [`Timer`](https://docs.cocotb.org/en/stable/triggers.html#cocotb.triggers.Timer "cocotb.triggers.Timer") . @cocotb.coroutine def simple\_clock(signal, half\_period, half\_period\_units): signal.value \= 0 timer \= Timer(half\_period, half\_period\_units) while True: \# in generator-based coroutines triggers are yielded yield timer signal.value \= ~signal Likewise, any place that will accept [`async`](https://docs.python.org/3/reference/compound_stmts.html#async "(in Python v3.13)") coroutines will also accept generator-based coroutines; including [`fork()`](https://docs.cocotb.org/en/stable/library_reference.html#cocotb.fork "cocotb.fork") . @cocotb.coroutine def start\_clock(clk): \# generator-based coroutines can still be forked cocotb.start\_soon(simple\_clock(clk, 5, units\='ns')) yield RisingEdge(clk) [`async`](https://docs.python.org/3/reference/compound_stmts.html#async "(in Python v3.13)") coroutines can be yielded in generator-based coroutines. async def detect\_transaction(clk, valid): await RisingEdge(clk) while not valid.value: await RisingEdge(clk) @cocotb.coroutine def monitor(clk, valid, data): \# async coroutines can be yielded yield detect\_transaction(clk, valid) return data.value Generator-based coroutines can also be awaited in [`async`](https://docs.python.org/3/reference/compound_stmts.html#async "(in Python v3.13)") coroutines. async def check\_incrementing(clk, valid, data): \# generator-based coroutines can be awaited prev\_count \= await monitor() while True: count \= await monitor() assert count \== (prev\_count + 1) prev\_count \= count You may also see syntax like `yield [trigger_a, trigger_b, ...]`, which is syntactic sugar for [`First`](https://docs.cocotb.org/en/stable/triggers.html#cocotb.triggers.First "cocotb.triggers.First") . @cocotb.coroutine def run\_for(coro, time, units): timeout \= Timer(time, units\='ps') \# block until first trigger fires yield \[timeout, coro\] Tests can also be generator-based coroutines. Tests are not required to be decorated with [`coroutine`](https://docs.cocotb.org/en/stable/library_reference.html#cocotb.coroutine "cocotb.coroutine") as the [`test`](https://docs.cocotb.org/en/stable/library_reference.html#cocotb.test "cocotb.test") decorator will handle this case automatically. \# just need the test decorator @cocotb.test() def run\_test(dut): yield start\_clock(dut.clk) checker \= check\_incrementing( clk\=dut.clk, valid\=dut.valid, data\=dut.cnt) yield run\_for(checker, 1, 'us') --- # Rotating Log Files — cocotb 1.9.2 documentation * [](https://docs.cocotb.org/en/stable/index.html) * Rotating Log Files * [View page source](https://docs.cocotb.org/en/stable/_sources/rotating_logger.rst.txt) * * * Rotating Log Files[](https://docs.cocotb.org/en/stable/rotating_logger.html#rotating-log-files "Link to this heading") ======================================================================================================================== The following is an example of how to support rotation of log files. It will keep the newest 3 files which are at most 5 MiB in size. See also [Logging](https://docs.cocotb.org/en/stable/library_reference.html#logging-reference-section) , and the Python documentation for [`logging.handlers.RotatingFileHandler`](https://docs.python.org/3/library/logging.handlers.html#logging.handlers.RotatingFileHandler "(in Python v3.13)") . from logging.handlers import RotatingFileHandler from cocotb.log import SimLogFormatter root\_logger \= logging.getLogger() \# undo the setup cocotb did for handler in root\_logger.handlers: root\_logger.removeHandler(handler) handler.close() \# do whatever configuration you want instead file\_handler \= RotatingFileHandler("rotating.log", maxBytes\=(5 \* 1024 \* 1024), backupCount\=2) file\_handler.setFormatter(SimLogFormatter()) root\_logger.addHandler(file\_handler) --- # Triggers — cocotb 1.9.2 documentation * [](https://docs.cocotb.org/en/stable/index.html) * Triggers * [View page source](https://docs.cocotb.org/en/stable/_sources/triggers.rst.txt) * * * Triggers[](https://docs.cocotb.org/en/stable/triggers.html#triggers "Link to this heading") ============================================================================================= Triggers are used to indicate when the cocotb scheduler should resume coroutine execution. To use a trigger, a coroutine should [`await`](https://docs.python.org/3/reference/expressions.html#await "(in Python v3.13)") it. This will cause execution of the current coroutine to pause. When the trigger fires, execution of the paused coroutine will resume: async def coro(): print("Some time before the edge") await RisingEdge(clk) print("Immediately after the edge") Simulator Triggers[](https://docs.cocotb.org/en/stable/triggers.html#simulator-triggers "Link to this heading") ----------------------------------------------------------------------------------------------------------------- ### Signals[](https://docs.cocotb.org/en/stable/triggers.html#signals "Link to this heading") _class_ cocotb.triggers.Edge(_signal_)[\[source\]](https://docs.cocotb.org/en/stable/_modules/cocotb/triggers.html#Edge) [](https://docs.cocotb.org/en/stable/triggers.html#cocotb.triggers.Edge "Link to this definition") Fires on any value change of _signal_. _class_ cocotb.triggers.RisingEdge(_signal_)[\[source\]](https://docs.cocotb.org/en/stable/_modules/cocotb/triggers.html#RisingEdge) [](https://docs.cocotb.org/en/stable/triggers.html#cocotb.triggers.RisingEdge "Link to this definition") Fires on the rising edge of _signal_, on a transition from `0` to `1`. _class_ cocotb.triggers.FallingEdge(_signal_)[\[source\]](https://docs.cocotb.org/en/stable/_modules/cocotb/triggers.html#FallingEdge) [](https://docs.cocotb.org/en/stable/triggers.html#cocotb.triggers.FallingEdge "Link to this definition") Fires on the falling edge of _signal_, on a transition from `1` to `0`. _class_ cocotb.triggers.ClockCycles(_signal_, _num\_cycles_, _rising\=True_)[\[source\]](https://docs.cocotb.org/en/stable/_modules/cocotb/triggers.html#ClockCycles) [](https://docs.cocotb.org/en/stable/triggers.html#cocotb.triggers.ClockCycles "Link to this definition") Fires after _num\_cycles_ transitions of _signal_ from `0` to `1`. Parameters: * **signal** – The signal to monitor. * **num\_cycles** ([_int_](https://docs.python.org/3/library/functions.html#int "(in Python v3.13)") ) – The number of cycles to count. * **rising** ([_bool_](https://docs.python.org/3/library/functions.html#bool "(in Python v3.13)") _,_ _optional_) – If `True`, the default, count rising edges. Otherwise, count falling edges. ### Timing[](https://docs.cocotb.org/en/stable/triggers.html#timing "Link to this heading") _class_ cocotb.triggers.Timer(_time\=None_, _units\='step'_, _\*_, _round\_mode\=None_, _time\_ps\=None_)[\[source\]](https://docs.cocotb.org/en/stable/_modules/cocotb/triggers.html#Timer) [](https://docs.cocotb.org/en/stable/triggers.html#cocotb.triggers.Timer "Link to this definition") Fire after the specified simulation time period has elapsed. Parameters: * **time** ([_Real_](https://docs.python.org/3/library/numbers.html#numbers.Real "(in Python v3.13)") _|_ [_Decimal_](https://docs.python.org/3/library/decimal.html#decimal.Decimal "(in Python v3.13)") ) – The time value. Changed in version 1.5.0: Previously this argument was misleadingly called time\_ps. * **units** ([_str_](https://docs.python.org/3/library/stdtypes.html#str "(in Python v3.13)") ) – One of `'step'`, `'fs'`, `'ps'`, `'ns'`, `'us'`, `'ms'`, `'sec'`. When _units_ is `'step'`, the timestep is determined by the simulator (see [`COCOTB_HDL_TIMEPRECISION`](https://docs.cocotb.org/en/stable/building.html#var-COCOTB_HDL_TIMEPRECISION) ). round\_mode (str, optional): String specifying how to handle time values that sit between time steps (one of `'error'`, `'round'`, `'ceil'`, `'floor'`). * **round\_mode** ([_str_](https://docs.python.org/3/library/stdtypes.html#str "(in Python v3.13)") ) * **time\_ps** ([_Real_](https://docs.python.org/3/library/numbers.html#numbers.Real "(in Python v3.13)") _|_ [_Decimal_](https://docs.python.org/3/library/decimal.html#decimal.Decimal "(in Python v3.13)") ) Examples \>>> await Timer(100, units\='ps') The time can also be a `float`: \>>> await Timer(100e-9, units\='sec') which is particularly convenient when working with frequencies: \>>> freq \= 10e6 \# 10 MHz \>>> await Timer(1 / freq, units\='sec') Other builtin exact numeric types can be used too: \>>> from fractions import Fraction \>>> await Timer(Fraction(1, 10), units\='ns') \>>> from decimal import Decimal \>>> await Timer(Decimal('100e-9'), units\='sec') These are most useful when using computed durations while avoiding floating point inaccuracies. See also [`get_sim_steps()`](https://docs.cocotb.org/en/stable/library_reference.html#cocotb.utils.get_sim_steps "cocotb.utils.get_sim_steps") Raises: **TriggerException** – If a negative value is passed for Timer setup. Parameters: * **time** ([_Real_](https://docs.python.org/3/library/numbers.html#numbers.Real "(in Python v3.13)") _|_ [_Decimal_](https://docs.python.org/3/library/decimal.html#decimal.Decimal "(in Python v3.13)") ) * **units** ([_str_](https://docs.python.org/3/library/stdtypes.html#str "(in Python v3.13)") ) * **round\_mode** ([_str_](https://docs.python.org/3/library/stdtypes.html#str "(in Python v3.13)") ) * **time\_ps** ([_Real_](https://docs.python.org/3/library/numbers.html#numbers.Real "(in Python v3.13)") _|_ [_Decimal_](https://docs.python.org/3/library/decimal.html#decimal.Decimal "(in Python v3.13)") ) Changed in version 1.5: Raise an exception when Timer uses a negative value as it is undefined behavior. Warn for 0 as this will cause erratic behavior in some simulators as well. Changed in version 1.5: Support `'step'` as the _units_ argument to mean “simulator time step”. Deprecated since version 1.5: Using `None` as the _units_ argument is deprecated, use `'step'` instead. Changed in version 1.6: Support rounding modes. _class_ cocotb.triggers.ReadOnly[\[source\]](https://docs.cocotb.org/en/stable/_modules/cocotb/triggers.html#ReadOnly) [](https://docs.cocotb.org/en/stable/triggers.html#cocotb.triggers.ReadOnly "Link to this definition") Fires when the current simulation timestep moves to the read-only phase. The read-only phase is entered when the current timestep no longer has any further delta steps. This will be a point where all the signal values are stable as there are no more RTL events scheduled for the timestep. The simulator will not allow scheduling of more events in this timestep. Useful for monitors which need to wait for all processes to execute (both RTL and cocotb) to ensure sampled signal values are final. _class_ cocotb.triggers.ReadWrite[\[source\]](https://docs.cocotb.org/en/stable/_modules/cocotb/triggers.html#ReadWrite) [](https://docs.cocotb.org/en/stable/triggers.html#cocotb.triggers.ReadWrite "Link to this definition") Fires when the read-write portion of the simulation cycles is reached. _class_ cocotb.triggers.NextTimeStep[\[source\]](https://docs.cocotb.org/en/stable/_modules/cocotb/triggers.html#NextTimeStep) [](https://docs.cocotb.org/en/stable/triggers.html#cocotb.triggers.NextTimeStep "Link to this definition") Fires when the next time step is started. Python Triggers[](https://docs.cocotb.org/en/stable/triggers.html#python-triggers "Link to this heading") ----------------------------------------------------------------------------------------------------------- _class_ cocotb.triggers.Combine(_\*triggers_)[\[source\]](https://docs.cocotb.org/en/stable/_modules/cocotb/triggers.html#Combine) [](https://docs.cocotb.org/en/stable/triggers.html#cocotb.triggers.Combine "Link to this definition") Fires when all of _triggers_ have fired. Like most triggers, this simply returns itself. This is similar to Verilog’s `join`. _class_ cocotb.triggers.First(_\*triggers_)[\[source\]](https://docs.cocotb.org/en/stable/_modules/cocotb/triggers.html#First) [](https://docs.cocotb.org/en/stable/triggers.html#cocotb.triggers.First "Link to this definition") Fires when the first trigger in _triggers_ fires. Returns the result of the trigger that fired. This is similar to Verilog’s `join_any`. Note The event loop is single threaded, so while events may be simultaneous in simulation time, they can never be simultaneous in real time. For this reason, the value of `t_ret is t1` in the following example is implementation-defined, and will vary by simulator: t1 \= Timer(10, units\='ps') t2 \= Timer(10, units\='ps') t\_ret \= await First(t1, t2) Note In the old-style [generator-based coroutines](https://docs.cocotb.org/en/stable/coroutines.html#yield-syntax) , `t = yield [a, b]` was another spelling of `t = yield First(a, b)`. This spelling is no longer available when using [`await`](https://docs.python.org/3/reference/expressions.html#await "(in Python v3.13)") \-based coroutines. _class_ cocotb.triggers.Join(_coroutine_)[\[source\]](https://docs.cocotb.org/en/stable/_modules/cocotb/triggers.html#Join) [](https://docs.cocotb.org/en/stable/triggers.html#cocotb.triggers.Join "Link to this definition") Fires when a task completes. The result of blocking on the trigger can be used to get the coroutine result: async def coro\_inner(): await Timer(1, units\='ns') return "Hello world" task \= cocotb.start\_soon(coro\_inner()) result \= await Join(task) assert result \== "Hello world" If the coroutine threw an exception, the [`await`](https://docs.python.org/3/reference/expressions.html#await "(in Python v3.13)") will re-raise it. _property_ retval[](https://docs.cocotb.org/en/stable/triggers.html#cocotb.triggers.Join.retval "Link to this definition") The return value of the joined coroutine. Deprecated since version 1.9: Use `Task.result() \--vpi --public-flat-rw --prefix Vtop \\ > -LDFLAGS "-Wl,-rpath,$(cocotb-config --lib-dir) \\ > -L$(cocotb-config --lib-dir) \\ > -lcocotbvpi\_verilator" \\ > $(cocotb-config --share)/lib/verilator/verilator.cpp * Run Verilator’s makefile as follows: `CPPFLAGS="-std=c++11" make -f Vtop.mk` Synopsys VCS[](https://docs.cocotb.org/en/stable/custom_flows.html#synopsys-vcs "Link to this heading") --------------------------------------------------------------------------------------------------------- * Create a file `pli.tab` with the content `acc+=rw,wn:*` (or equivalent) to allow cocotb to access values in the design. * Extend the `vcs` call with the options `+vpi -P pli.tab -load $(cocotb-config --lib-name-path vpi vcs)`. Aldec Riviera-PRO[](https://docs.cocotb.org/en/stable/custom_flows.html#aldec-riviera-pro "Link to this heading") ------------------------------------------------------------------------------------------------------------------- * The `asim` call needs the `+access +w_nets` option set to allow cocotb to access values in the design. Design with a VHDL ToplevelDesign with a (System)Verilog Toplevel For a design with a VHDL toplevel, call `asim` with the option `-loadvhpi $(cocotb-config --lib-name-path vhpi riviera):vhpi_startup_routines_bootstrap`. Set the [`GPI_EXTRA`](https://docs.cocotb.org/en/stable/building.html#envvar-GPI_EXTRA) environment variable to `$(cocotb-config --lib-name-path vpi riviera):cocotbvpi_entry_point` if there are also (System)Verilog modules in the design. For a design with a (System)Verilog toplevel, call `alog` and `asim` with the option `-pli $(cocotb-config --lib-name-path vpi riviera)`. Set the [`GPI_EXTRA`](https://docs.cocotb.org/en/stable/building.html#envvar-GPI_EXTRA) environment variable to `$(cocotb-config --lib-name-path vhpi riviera):cocotbvhpi_entry_point` if there are also VHDL modules in the design. Aldec Active-HDL[](https://docs.cocotb.org/en/stable/custom_flows.html#aldec-active-hdl "Link to this heading") ----------------------------------------------------------------------------------------------------------------- * The `asim` call needs the `+access +w_nets` option set to allow cocotb to access values in the design. Design with a VHDL ToplevelDesign with a (System)Verilog Toplevel For a design with a VHDL toplevel, call `asim` with the option `-loadvhpi $(cocotb-config --lib-name-path vhpi activehdl):vhpi_startup_routines_bootstrap`. Set the [`GPI_EXTRA`](https://docs.cocotb.org/en/stable/building.html#envvar-GPI_EXTRA) environment variable to `$(cocotb-config --lib-name-path vpi activehdl):cocotbvpi_entry_point` if there are also (System)Verilog modules in the design. For a design with a (System)Verilog toplevel, call `alog` and `asim` with the option `-pli $(cocotb-config --lib-name-path vpi activehdl)`. Set the [`GPI_EXTRA`](https://docs.cocotb.org/en/stable/building.html#envvar-GPI_EXTRA) environment variable to `$(cocotb-config --lib-name-path vhpi activehdl):cocotbvhpi_entry_point` if there are also VHDL modules in the design. Mentor/Siemens EDA Questa and Modelsim[](https://docs.cocotb.org/en/stable/custom_flows.html#mentor-siemens-eda-questa-and-modelsim "Link to this heading") ------------------------------------------------------------------------------------------------------------------------------------------------------------- Design with a VHDL ToplevelDesign with a (System)Verilog Toplevel For a design with a VHDL toplevel, call the `vsim` executable with the option `-foreign "cocotb_init $(cocotb-config --lib-name-path fli questa)"`. Set the [`GPI_EXTRA`](https://docs.cocotb.org/en/stable/building.html#envvar-GPI_EXTRA) environment variable to `$(cocotb-config --lib-name-path vpi questa):cocotbvpi_entry_point` if there are also (System)Verilog modules in the design. For a design with a (System)Verilog toplevel, call the `vsim` executable with the option `-pli $(cocotb-config --lib-name-path vpi questa)`. Set the [`GPI_EXTRA`](https://docs.cocotb.org/en/stable/building.html#envvar-GPI_EXTRA) environment variable to `$(cocotb-config --lib-name-path fli questa):cocotbfli_entry_point` if there are also VHDL modules in the design. Cadence Incisive and Xcelium[](https://docs.cocotb.org/en/stable/custom_flows.html#cadence-incisive-and-xcelium "Link to this heading") ----------------------------------------------------------------------------------------------------------------------------------------- * The `xrun` call (or `xmelab` in multi-step mode) needs the `-access +rwc` (or equivalent, e.g. `-afile _afile_`) option set to allow cocotb to access values in the design. Design with a VHDL ToplevelDesign with a (System)Verilog Toplevel For a design with a VHDL toplevel, call the `xrun` or `xmelab` executable with the options `-NEW_VHPI_PROPAGATE_DELAY -loadvpi $(cocotb-config --lib-name-path vpi xcelium):vlog_startup_routines_bootstrap`. Set the [`GPI_EXTRA`](https://docs.cocotb.org/en/stable/building.html#envvar-GPI_EXTRA) environment variable to `$(cocotb-config --lib-name-path vhpi xcelium):cocotbvhpi_entry_point`. This is because directly loading the VHPI library causes an error in Xcelium, so always load the VPI library and supply VHPI via `GPI_EXTRA`. For a design with a (System)Verilog toplevel, call the `xrun` or `xmelab` executable with the option `-loadvpi $(cocotb-config --lib-name-path vpi xcelium):vlog_startup_routines_bootstrap`. Set the [`GPI_EXTRA`](https://docs.cocotb.org/en/stable/building.html#envvar-GPI_EXTRA) environment variable to `$(cocotb-config --lib-name-path vhpi xcelium):cocotbvhpi_entry_point` if there are also VHDL modules in the design. GHDL[](https://docs.cocotb.org/en/stable/custom_flows.html#ghdl "Link to this heading") ----------------------------------------------------------------------------------------- * Extend the `ghdl -r` call with the option `--vpi=$(cocotb-config --lib-name-path vpi ghdl)`. NVC[](https://docs.cocotb.org/en/stable/custom_flows.html#nvc "Link to this heading") --------------------------------------------------------------------------------------- * Extend the `nvc -r` call with the option `--load=$(cocotb-config --lib-name-path vhpi nvc)`. Tachyon DA CVC[](https://docs.cocotb.org/en/stable/custom_flows.html#tachyon-da-cvc "Link to this heading") ------------------------------------------------------------------------------------------------------------- * Extend the `cvc64` call with the option `+interp +acc+2 +loadvpi=$(cocotb-config --lib-name-path vpi cvc):vlog_startup_routines_bootstrap`. --- # Troubleshooting — cocotb 1.9.2 documentation * [](https://docs.cocotb.org/en/stable/index.html) * Troubleshooting * [View page source](https://docs.cocotb.org/en/stable/_sources/troubleshooting.rst.txt) * * * Troubleshooting[](https://docs.cocotb.org/en/stable/troubleshooting.html#troubleshooting "Link to this heading") ================================================================================================================== Simulation Hangs[](https://docs.cocotb.org/en/stable/troubleshooting.html#simulation-hangs "Link to this heading") -------------------------------------------------------------------------------------------------------------------- Did you directly call an `async def` function without using [`await`](https://docs.python.org/3/reference/expressions.html#await "(in Python v3.13)") ; or a [`coroutine`](https://docs.cocotb.org/en/stable/library_reference.html#cocotb.coroutine "cocotb.coroutine") without using [`yield`](https://docs.python.org/3/reference/simple_stmts.html#yield "(in Python v3.13)") ? If you want to exit cocotb and the simulator using Control\-C (the Unix signal `SIGINT`) but this doesn’t work, you can try Control\-\\ (the Unix signal `SIGQUIT`). Increasing Verbosity[](https://docs.cocotb.org/en/stable/troubleshooting.html#increasing-verbosity "Link to this heading") ---------------------------------------------------------------------------------------------------------------------------- If things fail in the [VPI](https://docs.cocotb.org/en/stable/glossary.html#term-VPI) /[VHPI](https://docs.cocotb.org/en/stable/glossary.html#term-VHPI) /[FLI](https://docs.cocotb.org/en/stable/glossary.html#term-FLI) area, check your simulator’s documentation to see if it has options to increase its verbosity about what may be wrong. You can then set these options on the **make** command line as [`COMPILE_ARGS`](https://docs.cocotb.org/en/stable/building.html#var-COMPILE_ARGS) , [`SIM_ARGS`](https://docs.cocotb.org/en/stable/building.html#var-SIM_ARGS) or [`EXTRA_ARGS`](https://docs.cocotb.org/en/stable/building.html#var-EXTRA_ARGS) (see [Build options and Environment Variables](https://docs.cocotb.org/en/stable/building.html) for details). If things fail from within Python, or coroutines aren’t being called when you expect, the [`COCOTB_SCHEDULER_DEBUG`](https://docs.cocotb.org/en/stable/building.html#envvar-COCOTB_SCHEDULER_DEBUG) variable can be used to (greatly) increase the verbosity of the scheduler. Building cocotb In Development Mode[](https://docs.cocotb.org/en/stable/troubleshooting.html#building-cocotb-in-development-mode "Link to this heading") ---------------------------------------------------------------------------------------------------------------------------------------------------------- By default cocotb binaries installed from PyPi are stripped, i.e. they do not contain debug symbols. Rebuilding cocotb from source can add this information back, making it significantly easier to debug cocotb code. In the following, we’ll assume the use of a Linux machine for debugging cocotb, which simplifies the process significantly. First, install all build requirements as listed at [Installing the Development Version](https://docs.cocotb.org/en/stable/install_devel.html#install-devel) . Then execute the following commands to download a development version of cocotb and prepare a shell environment with this a development build of cocotb available: $ \# Obtain the latest development version of cocotb through git $ git clone https://github.com/cocotb/cocotb.git $ \# Build cocotb in debug mode, and enter a bash shell $ cd cocotb $ nox \-s dev \-- /bin/bash Attaching a Debugger[](https://docs.cocotb.org/en/stable/troubleshooting.html#attaching-a-debugger "Link to this heading") ---------------------------------------------------------------------------------------------------------------------------- ### C and C++[](https://docs.cocotb.org/en/stable/troubleshooting.html#c-and-c "Link to this heading") The most convenient way to debug the cocotb C code and the interaction between cocotb and the simulator is using GDB. This is a two-step process: 1. Run the simulation with [`COCOTB_ATTACH`](https://docs.cocotb.org/en/stable/building.html#envvar-COCOTB_ATTACH) set. 2. Use `gdb -p` to attach to the simulator process. Have a look at [Build options and Environment Variables](https://docs.cocotb.org/en/stable/building.html#building) for various useful variables related to debugging. Example: Debug the test `test_array_simple` with Questa, using the VHDL toplevel and the VHPI. 1. Run the simulation and take note of the process identifier (PID) displayed after the simulator starts up. > $ make \-C tests/test\_cases/test\_array\_simple SIM\=questa TOPLEVEL\_LANG\=vhdl VHDL\_GPI\_INTERFACE\=vhpi COCOTB\_ATTACH\=300 COCOTB\_LOG\_LEVEL\=trace > ... > \# \-.--ns ERROR gpi ..mbed/gpi\_embed.cpp:154 in \_embed\_init\_python Waiting for 300 seconds \- attach to PID 9583 with your debugger 2. Open a new terminal window or tab, and attach GDB to the running process. > $ gdb \-p 9583 > ... > 48 r = INTERNAL\_SYSCALL\_CANCEL (clock\_nanosleep\_time64, clock\_id, flags, req, > (gdb) \# Set breakpoints or do anything else you'd like to do. Finally, let the simulation run: > (gdb) continue > Continuing. > \[Inferior 1 (process 9583) exited normally\] > (gdb) quit ### Python[](https://docs.cocotb.org/en/stable/troubleshooting.html#python "Link to this heading") When executing the Makefile to run a cocotb test, a Python shell interpreter is called from within the [VPI](https://docs.cocotb.org/en/stable/glossary.html#term-VPI) /[VHPI](https://docs.cocotb.org/en/stable/glossary.html#term-VHPI) /[FLI](https://docs.cocotb.org/en/stable/glossary.html#term-FLI) library. Hence it is not possible to directly attach a Python debugger to the Python process being part of the simulator that uses the aforementioned library. Using `import pdb; pdb.set_trace()` directly is also frequently not possible, due to the way that simulators interfere with `stdin`. To successfully debug your Python code use the [remote\_pdb](https://pypi.org/project/remote-pdb/) Python package to create a **pdb** instance accessible via a TCP socket: 1. In your code insert the line: from remote\_pdb import RemotePdb; rpdb \= RemotePdb("127.0.0.1", 4000) 2. Then before the line of code you want the debugger to stop the execution, add a breakpoint: rpdb.set\_trace() \# <-- debugger stops execution after this line \# <-- next statement being evaluated by the interpreter 3. Run the Makefile so that the interpreter hits the breakpoint line and _hangs_. 4. Connect to the freshly created socket, for instance through **telnet**: telnet 127.0.0.1 4000 Embedding an IPython shell[](https://docs.cocotb.org/en/stable/troubleshooting.html#module-cocotb.ipython_support "Link to this heading") ------------------------------------------------------------------------------------------------------------------------------------------- Added in version 1.4. A prebuilt test is included to easily launch an IPython shell in an existing design. cocotb.ipython\_support.run\_ipython(_dut_)[\[source\]](https://docs.cocotb.org/en/stable/_modules/cocotb/ipython_support.html#run_ipython) [](https://docs.cocotb.org/en/stable/troubleshooting.html#cocotb.ipython_support.run_ipython "Link to this definition") A test that launches an interactive Python shell. Do not call this directly - use this as `make MODULE=cocotb.ipython_support`. Within the shell, a global `dut` variable pointing to the design will be present. To embed a shell within an existing test, where it can inspect local variables, the [`embed()`](https://docs.cocotb.org/en/stable/troubleshooting.html#cocotb.ipython_support.embed "cocotb.ipython_support.embed") function can be used. _async_ cocotb.ipython\_support.embed(_user\_ns\={}_)[\[source\]](https://docs.cocotb.org/en/stable/_modules/cocotb/ipython_support.html#embed) [](https://docs.cocotb.org/en/stable/troubleshooting.html#cocotb.ipython_support.embed "Link to this definition") Start an IPython shell in the current coroutine. Unlike using `IPython.embed()` directly, the [`await`](https://docs.python.org/3/reference/expressions.html#await "(in Python v3.13)") keyword can be used directly from the shell to wait for triggers. The [`yield`](https://docs.python.org/3/reference/simple_stmts.html#yield "(in Python v3.13)") keyword from the legacy [Generator-based coroutines](https://docs.cocotb.org/en/stable/coroutines.html#yield-syntax) is not supported. This coroutine will complete only when the user exits the interactive session. Parameters: **user\_ns** ([_dict_](https://docs.python.org/3/library/stdtypes.html#dict "(in Python v3.13)") ) – The variables to have made available in the shell. Passing `locals()` is often a good idea. `cocotb` will automatically be included. Notes If your simulator does not provide an appropriate `stdin`, you may find you cannot type in the resulting shell. Using simulators in batch or non-GUI mode may resolve this. This feature is experimental, and not all simulators are supported. Setting make variables on the command line[](https://docs.cocotb.org/en/stable/troubleshooting.html#setting-make-variables-on-the-command-line "Link to this heading") ------------------------------------------------------------------------------------------------------------------------------------------------------------------------ When trying to set one of the make variables listed in [Build options and Environment Variables](https://docs.cocotb.org/en/stable/building.html#building) from the command line, it is strongly recommended to use an environment variable, i.e. `EXTRA_ARGS="..." make` (for the `fish` and `csh` shells: `env EXTRA_ARGS="..." make`) and _not_ `make EXTRA_ARGS=...`. This is because in the case of the discouraged `make EXTRA_ARGS=...`, if one of the involved Makefiles contains lines to assign (`=`) or append (`+=`) to [`EXTRA_ARGS`](https://docs.cocotb.org/en/stable/building.html#var-EXTRA_ARGS) internally, such lines will be ignored. These lines are needed for the operation of cocotb however, and having them ignored is likely to lead to strange errors. As a side note, when you need to _clear_ a Makefile variable from the command line, use the syntax `make EXTRA_ARGS=`. `GLIBCXX_3.4.XX` not found[](https://docs.cocotb.org/en/stable/troubleshooting.html#glibcxx-3-4-xx-not-found "Link to this heading") -------------------------------------------------------------------------------------------------------------------------------------- This error can occur on Linux, and will raise ``ImportError: /some/libstdc++.so.6: version `GLIBCXX_3.4.XX' not found``. This occurs because an older non-C++11 version of `libstdc++` is being loaded by the simulator or cocotb. It is usually an issue with your environment, but sometimes can occur when using a very old version of certain simulators. ### Check your environment[](https://docs.cocotb.org/en/stable/troubleshooting.html#check-your-environment "Link to this heading") To see if your environment is the issue, look at the value of the `LD_LIBRARY_PATH` environment variable. Ensure the first path in the colon-delimited list is the path to the `libstdc++` that shipped with the compiler you used to build cocotb. echo $LD\_LIBRARY\_PATH This variable might be empty, in which case the loader looks in the system’s libraries. If the library you built cocotb with is not first, prepend that path to the list. export LD\_LIBRARY\_PATH\=/path/to/newer/libraries/:$LD\_LIBRARY\_PATH ### Check your simulator[](https://docs.cocotb.org/en/stable/troubleshooting.html#check-your-simulator "Link to this heading") Sometimes, simulators modify the `LD_LIBRARY_PATH` so they point to the libraries that are shipped with instead of the system libraries. If you are running an old simulator, the packaged libraries may include a pre-C++11 `libstdc++`. To see if your simulator is modifying the `LD_LIBRARY_PATH`, open the simulator up to an internal console and obtain the environment variable. For example, with Mentor Questa and Cadence Xcelium, one could open a Tcl console and run the **env** command to list the current environment. The `LD_LIBRARY_PATH` should appear in the list. If the simulator does modify the `LD_LIBRARY_PATH`, refer to the simulator documentation on how to prevent or work around this issue. For example, Questa ships with GCC. Sometimes that version of GCC is old enough to not support C++11 (<4.8). When you install cocotb, **pip** uses the system (or some other) compiler that supports C++11. But when you try to run cocotb with the older Questa, it prepends the older libraries Questa ships with to `LD_LIBRARY_PATH`. This causes the older `libstdc++` Questa ships with to be loaded, resulting in the error message. For Questa, you can use the `-noautoldlibpath` option to turn off the `LD_LIBRARY_PATH` prepend to resolve this issue. Using cocotb with more than one Python installation[](https://docs.cocotb.org/en/stable/troubleshooting.html#using-cocotb-with-more-than-one-python-installation "Link to this heading") ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ Users of cocotb with more than one installation of a single Python version (including `conda env` users) must take care not to re-use cached versions of the installed cocotb package. If this isn’t done, running simulations fails with errors like `libpython3.7m.so.1.0: cannot open shared object file: No such file or directory`. Cocotb builds binary libraries during its installation process. These libraries are tailored to the installation of Python used when installing cocotb. When switching between Python installations, cocotb needs to be re-installed without using cached build artifacts, e.g. with `pip install --no-cache-dir cocotb`. On Linux distributions, setting `LD_DEBUG=libs` (example: `LD_DEBUG=libs make SIM=verilator`) prints detailed output about which libraries are loaded from where. On Mac OS, you can use `DYLD_PRINT_LIBRARIES=1` instead of `LD_DEBUG=libs` to get similar information. On Windows, use [Process Explorer](https://docs.microsoft.com/en-us/sysinternals/downloads/process-explorer) . Further details are available in [#1943](https://github.com/cocotb/cocotb/issues/1943) . --- # Quickstart Guide — cocotb 1.9.2 documentation * [](https://docs.cocotb.org/en/stable/index.html) * Quickstart Guide * [View page source](https://docs.cocotb.org/en/stable/_sources/quickstart.rst.txt) * * * Quickstart Guide[](https://docs.cocotb.org/en/stable/quickstart.html#quickstart-guide "Link to this heading") =============================================================================================================== In the following sections, we are walking you through creating and running a small but complete cocotb testbench for a fictional _Design Under Test_ ([DUT](https://docs.cocotb.org/en/stable/glossary.html#term-DUT) ) called `my_design`. Please install the [prerequisites](https://docs.cocotb.org/en/stable/install.html#install-prerequisites) and cocotb itself (`pip install cocotb`) now. Run `cocotb-config --version` in a terminal window to check that cocotb is correctly installed. The code for the following example is available as [examples/doc\_examples/quickstart](https://github.com/cocotb/cocotb/blob/master/examples/doc_examples/quickstart) in the cocotb sources. You can also download the files here: [`my_design.sv`](https://docs.cocotb.org/en/stable/_downloads/34a7f224401ef92c903829b38f549f78/my_design.sv) , [`test_my_design.py`](https://docs.cocotb.org/en/stable/_downloads/9b06455a3d69695f077b91c59eeed7c0/test_my_design.py) , [`test_runner.py`](https://docs.cocotb.org/en/stable/_downloads/b962afa4d91aff7d9cb500fc64777110/test_runner.py) , [`Makefile`](https://docs.cocotb.org/en/stable/_downloads/6e692fc833ef972ad9c4b182deb53db4/Makefile) . Creating a Test[](https://docs.cocotb.org/en/stable/quickstart.html#creating-a-test "Link to this heading") ------------------------------------------------------------------------------------------------------------- A typical cocotb testbench requires no additional [HDL](https://docs.cocotb.org/en/stable/glossary.html#term-HDL) code. The [DUT](https://docs.cocotb.org/en/stable/glossary.html#term-DUT) is instantiated as the toplevel in the simulator without any HDL wrapper code. The test is written in Python. In cocotb, you can access all internals of your design, e.g. signals, ports, parameters, etc. through an object that is passed to each test. In the following we’ll call this object `dut`. Let’s create a test file `test_my_design.py` containing the following: \# test\_my\_design.py (simple) import cocotb from cocotb.triggers import Timer @cocotb.test() async def my\_first\_test(dut): """Try accessing the design.""" for cycle in range(10): dut.clk.value \= 0 await Timer(1, units\="ns") dut.clk.value \= 1 await Timer(1, units\="ns") dut.\_log.info("my\_signal\_1 is %s", dut.my\_signal\_1.value) assert dut.my\_signal\_2.value\[0\] \== 0, "my\_signal\_2\[0\] is not 0!" This will first drive 10 periods of a square wave clock onto a port `clk` of the toplevel. After this, the clock stops, the value of `my_signal_1` is printed, and the value of index `0` of `my_signal_2` is checked to be `0`. Things to note: * Use the `@cocotb.test()` decorator to mark the test function to be run. * Use `.value = value` to assign a value to a signal. * Use `.value` to get a signal’s current value. The test shown is running sequentially, from start to end. Each [`await`](https://docs.python.org/3/reference/expressions.html#await "(in Python v3.13)") expression suspends execution of the test until whatever event the test is waiting for occurs and the simulator returns control back to cocotb (see [Simulator Triggers](https://docs.cocotb.org/en/stable/triggers.html#simulator-triggers) ). It’s most likely that you will want to do several things “at the same time” however - think multiple `always` blocks in Verilog or `process` statements in VHDL. In cocotb, you might move the clock generation part of the example above into its own [`async`](https://docs.python.org/3/reference/compound_stmts.html#async "(in Python v3.13)") function and [`start()`](https://docs.cocotb.org/en/stable/library_reference.html#cocotb.start "cocotb.start") it (“start it in the background”) from the test: \# test\_my\_design.py (extended) import cocotb from cocotb.triggers import FallingEdge, Timer async def generate\_clock(dut): """Generate clock pulses.""" for cycle in range(10): dut.clk.value \= 0 await Timer(1, units\="ns") dut.clk.value \= 1 await Timer(1, units\="ns") @cocotb.test() async def my\_second\_test(dut): """Try accessing the design.""" await cocotb.start(generate\_clock(dut)) \# run the clock "in the background" await Timer(5, units\="ns") \# wait a bit await FallingEdge(dut.clk) \# wait for falling edge/"negedge" dut.\_log.info("my\_signal\_1 is %s", dut.my\_signal\_1.value) assert dut.my\_signal\_2.value\[0\] \== 0, "my\_signal\_2\[0\] is not 0!" Note that the `generate_clock()` function is _not_ marked with `@cocotb.test()` since this is not a test on its own, just a helper function. See the sections [Concurrent and sequential execution](https://docs.cocotb.org/en/stable/writing_testbenches.html#writing-tbs-concurrent-sequential) and [Coroutines and Tasks](https://docs.cocotb.org/en/stable/coroutines.html#coroutines) for more information on such concurrent processes. Note Since generating a clock is such a common task, cocotb provides a helper for it - [`cocotb.clock.Clock`](https://docs.cocotb.org/en/stable/library_reference.html#cocotb.clock.Clock "cocotb.clock.Clock") . No need to write your own clock generator! You would start [`Clock`](https://docs.cocotb.org/en/stable/library_reference.html#cocotb.clock.Clock "cocotb.clock.Clock") with `cocotb.start_soon(Clock(dut.clk, 1, units="ns").start())` near the top of your test, after importing it with `from cocotb.clock import Clock`. Creating a Makefile[](https://docs.cocotb.org/en/stable/quickstart.html#creating-a-makefile "Link to this heading") --------------------------------------------------------------------------------------------------------------------- In order to run a test, you create a `Makefile` that contains information about your project (i.e. the specific DUT and test). In the `Makefile` shown below we specify: * the default simulator to use ([`SIM`](https://docs.cocotb.org/en/stable/building.html#var-SIM) ), * the default language of the toplevel module or entity ([`TOPLEVEL_LANG`](https://docs.cocotb.org/en/stable/building.html#var-TOPLEVEL_LANG) , `verilog` in our case), * the design source files ([`VERILOG_SOURCES`](https://docs.cocotb.org/en/stable/building.html#var-VERILOG_SOURCES) and [`VHDL_SOURCES`](https://docs.cocotb.org/en/stable/building.html#var-VHDL_SOURCES) ), * the toplevel module or entity to instantiate ([`TOPLEVEL`](https://docs.cocotb.org/en/stable/building.html#envvar-TOPLEVEL) , `my_design` in our case), * and a Python module that contains our cocotb tests ([`MODULE`](https://docs.cocotb.org/en/stable/building.html#envvar-MODULE) . The file containing the test without the .py extension, `test_my_design` in our case). \# Makefile \# defaults SIM ?= icarus TOPLEVEL\_LANG ?= verilog VERILOG\_SOURCES += $(PWD)/my\_design.sv \# use VHDL\_SOURCES for VHDL files \# TOPLEVEL is the name of the toplevel module in your Verilog or VHDL file TOPLEVEL \= my\_design \# MODULE is the basename of the Python test file MODULE \= test\_my\_design \# include cocotb's make rules to take care of the simulator setup include $(shell cocotb-config --makefiles)/Makefile.sim Running a Test[](https://docs.cocotb.org/en/stable/quickstart.html#running-a-test "Link to this heading") ----------------------------------------------------------------------------------------------------------- When you now type make Icarus Verilog will be used to simulate the Verilog implementation of the DUT because we defined these as the default values. If you want to simulate the DUT with Siemens Questa instead, all you would need to change is the command line: make SIM\=questa Using runners[](https://docs.cocotb.org/en/stable/quickstart.html#using-runners "Link to this heading") --------------------------------------------------------------------------------------------------------- Warning Python runners and associated APIs are an experimental feature and subject to change. An alternative to the `Makefile` is to use the Python Test Runners, or “runner” for short. Let’s define a runner for `test_my_design_runner`: \# test\_runner.py import os from pathlib import Path from cocotb.runner import get\_runner def test\_my\_design\_runner(): sim \= os.getenv("SIM", "icarus") proj\_path \= Path(\_\_file\_\_).resolve().parent sources \= \[proj\_path / "my\_design.sv"\] runner \= get\_runner(sim) runner.build( sources\=sources, hdl\_toplevel\="my\_design", ) runner.test(hdl\_toplevel\="my\_design", test\_module\="test\_my\_design,") if \_\_name\_\_ \== "\_\_main\_\_": test\_my\_design\_runner() Running a test involves three steps: * first the runner is instantiated with `get_runner` based on the default simulator to use, * then the [HDL](https://docs.cocotb.org/en/stable/glossary.html#term-HDL) is built using the design sources and the toplevel with `runner.build`, * finally, the module containing tests to run are passed to `runner.test` The runner can be used with [pytest](https://pytest.org/) : pytest Or it can be run directly: python test\_runner.py See the section [Building HDL and Running Tests](https://docs.cocotb.org/en/stable/runner.html#howto-python-runner) for more details on how to use runners. This concludes our quick introduction to cocotb. You can now look through our Tutorials or check out the [Writing Testbenches](https://docs.cocotb.org/en/stable/writing_testbenches.html#writing-tbs) chapter for more details on the above. --- # Platform Support — cocotb 1.9.2 documentation * [](https://docs.cocotb.org/en/stable/index.html) * Platform Support * [View page source](https://docs.cocotb.org/en/stable/_sources/platform_support.rst.txt) * * * Platform Support[](https://docs.cocotb.org/en/stable/platform_support.html#platform-support "Link to this heading") ===================================================================================================================== cocotb supports Windows, Linux, and macOS, with a wide range of Python versions. This page describes which platform combinations we test and support. The [cocotb Platform Support Policy](https://docs.cocotb.org/en/stable/platform_support.html#platform-support-policy) discusses the underlying policy. Note In many cases cocotb will work on platforms not listed on this page, and we aim to fix compatibility issues as we become aware of them. However, we encourage less experienced users to stick with one of the supported options for a good user experience. Please reach out to the cocotb team if you would like to see support for a different platform, and are willing to contribute to maintaining it. Supported Python Versions[](https://docs.cocotb.org/en/stable/platform_support.html#supported-python-versions "Link to this heading") --------------------------------------------------------------------------------------------------------------------------------------- The following versions of Python (CPython), and all associated patch releases (e.g. 3.8.4), are supported by cocotb. * Python 3.6 * Python 3.7 * Python 3.8 * Python 3.9 * Python 3.10 * Python 3.11 * Python 3.12 * Python 3.13 Supported Linux Distributions and Versions[](https://docs.cocotb.org/en/stable/platform_support.html#supported-linux-distributions-and-versions "Link to this heading") ------------------------------------------------------------------------------------------------------------------------------------------------------------------------- Linux users are in the privileged position of being able to choose from huge variety of distributions. While most of them are compatible with each other, some subtle differences exist. Even though cocotb aims to be agnostic to the distribution, and generally works well on most of them, we are explicitly supporting and testing on a limited subset of distributions which are common in EDA environments. We encourage especially users less experienced with Linux to use one of the supported and tested distributions listed below to ensure a smooth cocotb experience. Linux distributions typically ship a default version of Python called “system Python”. This version of Python can be used with cocotb unless noted otherwise. * **Red Hat Enterprise Linux (RHEL) 7.7+ amd64**, shipping with Python 3.6, pip 9, and glibc 2.17. [Upstream support until June 2024](https://access.redhat.com/support/policy/updates/errata#Life_Cycle_Dates) . * **Red Hat Enterprise Linux (RHEL) 8 amd64**, shipping with Python 3.6 (newer versions of Python are available), pip 9, and glibc 2.28. [Upstream support until May 2029](https://access.redhat.com/support/policy/updates/errata#Life_Cycle_Dates) . * **Red Hat Enterprise Linux (RHEL) 9 amd64**, shipping with Python 3.9 (newer versions of Python are available), pip 21, and glibc 2.34. [Upstream support until May 2032](https://access.redhat.com/support/policy/updates/errata#Life_Cycle_Dates) . * **Ubuntu 20.04 LTS amd64**, shipping with Python 3.8, pip 20, glibc 2.31. [Upstream support until April 2025](https://wiki.ubuntu.com/Releases) . * **Ubuntu 22.04 LTS amd64**, shipping with Python 3.10, pip 22, glibc 2.35. [Upstream support until April 2027](https://wiki.ubuntu.com/Releases) . Note * Binary-compatible RHEL-clones, such as CentOS, AlmaLinux or Rocky Linux, are equally supported. * For RHEL only Red Hat-supported minor versions are supported by cocotb. * Compatible Ubuntu derivatives, such as Kubuntu, Xubuntu, etc., are equally supported. Supported Windows Versions[](https://docs.cocotb.org/en/stable/platform_support.html#supported-windows-versions "Link to this heading") ----------------------------------------------------------------------------------------------------------------------------------------- * **Windows 10 x86\_64** * **Windows 11 x86\_64** Supported macOS Versions[](https://docs.cocotb.org/en/stable/platform_support.html#supported-macos-versions "Link to this heading") ------------------------------------------------------------------------------------------------------------------------------------- * **macOS 11 (Big Sur)** * **macOS 12 (Monterey) x86\_64** * **macOS 13 (Ventura) x86\_64** cocotb Platform Support Policy[](https://docs.cocotb.org/en/stable/platform_support.html#cocotb-platform-support-policy "Link to this heading") ------------------------------------------------------------------------------------------------------------------------------------------------- cocotb’s platform support policy is driven by two main considerations. 1. Support cocotb on the platforms our users are using. 2. Allow our users to use the latest cocotb release. The first item is obvious, but comes with interesting implications: for hardware projects it is common to use “mature” platforms such as the previous version of RHEL, and stay on that for the duration of a chip project, which might last multiple years. For cocotb, this means supporting rather old Python and operating system versions. The second item is less obvious. One might argue that users of older Python or operating system versions should simply use an old version of cocotb. There are two reasons against applying this rule too agressively. First of all, we want to give users the benefit of using the latest and greatest version of cocotb on the platform they are on (and are typically unable to change). But even more importantly, every user who is on the latest release is beneficial for the cocotb project. Supporting multiple older cocotb releases comes a cost: users report bugs which have been fixed in later releases, patch releases need to be supplied (e.g. for security problems), and integrating improvements our users made becomes harder. When determining the list of supported operating systems and Python versions we are trying to balance those two main considerations. The guidance below adds a bit more color to the policy we apply for choosing supported Python and operating system versions. ### Python Support[](https://docs.cocotb.org/en/stable/platform_support.html#python-support "Link to this heading") cocotb aims to support a wide range of Python versions as long as they are supported either by the upstream Python project, or by another entity. In general, cocotb aims to support all versions of Python [supported by the Python upstream community](https://devguide.python.org/#status-of-python-branches) at the time a cocotb release was made. Additionally, the Python version a supported Linux distribution ships with (system Python) is typically supported as well, as long as it receives updates by the operating system vendor (e.g. Red Hat, Debian, or Canonical). Only the standard CPython implementation is supported, the alternatives are not supported. ### Operating System Support[](https://docs.cocotb.org/en/stable/platform_support.html#operating-system-support "Link to this heading") cocotb aims to support all operating systems commonly used by our users. As such, we try to match the support matrix of major EDA tools to enable a seamless interaction between simulators and cocotb. Additionally, cocotb should work on the latest version of Windows, Linux, and macOS to ensure users can update their operating system freely without being blocked by cocotb. cocotb only supports x86\_64 architectures and requires a 64-bit operating system. (Note: 32-bit x86 applications can be run on 64-bit operating systems.) --- # Simulator Support — cocotb 1.9.2 documentation * [](https://docs.cocotb.org/en/stable/index.html) * Simulator Support * [View page source](https://docs.cocotb.org/en/stable/_sources/simulator_support.rst.txt) * * * Simulator Support[](https://docs.cocotb.org/en/stable/simulator_support.html#simulator-support "Link to this heading") ======================================================================================================================== This page lists the simulators that cocotb can be used with and documents specifics, limitations, workarounds etc. In general, cocotb can be used with any simulator supporting the industry-standard VPI, VHPI or FLI interfaces. However, in practice simulators exhibit small differences in behavior that cocotb mostly takes care of. If a simulator you would like to use with cocotb is not listed on this page open an issue at the [cocotb GitHub issue tracker](https://github.com/cocotb/cocotb/issues) . Icarus Verilog[](https://docs.cocotb.org/en/stable/simulator_support.html#icarus-verilog "Link to this heading") ------------------------------------------------------------------------------------------------------------------ In order to use this simulator, set [`SIM`](https://docs.cocotb.org/en/stable/building.html#var-SIM) to `icarus`: make SIM\=icarus Note A working installation of [Icarus Verilog](https://github.com/steveicarus/iverilog) is required. You can find installation instructions [in the Icarus Verilog Installation Guide](https://iverilog.fandom.com/wiki/Installation_Guide) . ### Accessing bits in a vector[](https://docs.cocotb.org/en/stable/simulator_support.html#accessing-bits-in-a-vector "Link to this heading") Accessing bits of a vector directly was not possible until (including) version 10.3: dut.stream\_in\_data\[2\].value \= 1 See also [https://github.com/steveicarus/iverilog/issues/323](https://github.com/steveicarus/iverilog/issues/323) . ### Waveforms[](https://docs.cocotb.org/en/stable/simulator_support.html#waveforms "Link to this heading") Icarus Verilog can produce waveform traces in the FST format, the native format of GTKWave. FST traces are much smaller and more efficient to write than VCD, but requires the use of GTKWave. To enable FST tracing, set [`WAVES`](https://docs.cocotb.org/en/stable/building.html#var-WAVES) to `1`. make SIM\=icarus WAVES\=1 ### Issues for this simulator[](https://docs.cocotb.org/en/stable/simulator_support.html#issues-for-this-simulator "Link to this heading") * [All issues with label category:simulators:icarus](https://github.com/cocotb/cocotb/issues?q=is%3Aissue+-label%3Astatus%3Aduplicate+label%3Acategory%3Asimulators%3Aicarus) Verilator[](https://docs.cocotb.org/en/stable/simulator_support.html#verilator "Link to this heading") -------------------------------------------------------------------------------------------------------- Warning **cocotb supports Verilator 5.022 and later.** Verilator is in the process of adding more functionality to its VPI interface, which is used by cocotb to access the design. Therefore, Verilator support in cocotb is currently experimental, and some features of cocotb may not work correctly or at all. If you encounter an issue using Verilator with cocotb, please try the newest release and [check existing issues](https://github.com/cocotb/cocotb/issues?q=is%3Aissue+-label%3Astatus%3Aduplicate+label%3Acategory%3Asimulators%3Averilator) before opening a new one. In order to use this simulator, set [`SIM`](https://docs.cocotb.org/en/stable/building.html#var-SIM) to `verilator`: make SIM\=verilator Note A working installation of [Verilator](https://www.veripool.org/verilator/) is required. You can find installation instructions [in the Verilator documentation](https://verilator.org/guide/latest/install.html) . Note Delayed assignments require the use of Verilator’s [timing](https://verilator.org/guide/latest/exe_verilator.html#cmdoption-timing) argument. To run cocotb with Verilator, you need `verilator` in your PATH. Added in version 1.3. Changed in version 1.5: Improved cocotb support and greatly improved performance when using a higher time precision. ### Coverage[](https://docs.cocotb.org/en/stable/simulator_support.html#coverage "Link to this heading") To enable [HDL](https://docs.cocotb.org/en/stable/glossary.html#term-HDL) code coverage, add Verilator’s coverage option(s) to the [`EXTRA_ARGS`](https://docs.cocotb.org/en/stable/building.html#var-EXTRA_ARGS) make variable, for example: > EXTRA\_ARGS += \--coverage This will result in coverage data being written to `coverage.dat`. ### Waveforms[](https://docs.cocotb.org/en/stable/simulator_support.html#sim-verilator-waveforms "Link to this heading") To get waveforms in VCD format, add Verilator’s trace option(s) to the [`EXTRA_ARGS`](https://docs.cocotb.org/en/stable/building.html#var-EXTRA_ARGS) make variable, for example in a Makefile: > EXTRA\_ARGS += \--trace \--trace-structs To set the same options on the command line, use `EXTRA_ARGS="--trace --trace-structs" make ...`. A VCD file named `dump.vcd` will be generated in the current directory. Verilator can produce waveform traces in the FST format, the native format of GTKWave. FST traces are much smaller and more efficient to write, but require the use of GTKWave. To enable FST tracing, add `--trace-fst` to [`EXTRA_ARGS`](https://docs.cocotb.org/en/stable/building.html#var-EXTRA_ARGS) as shown below. > EXTRA\_ARGS += \--trace \--trace-fst \--trace-structs The resulting file will be `dump.fst` and can be opened by `gtkwave dump.fst`. ### Issues for this simulator[](https://docs.cocotb.org/en/stable/simulator_support.html#sim-verilator-issues "Link to this heading") * [All issues with label category:simulators:verilator](https://github.com/cocotb/cocotb/issues?q=is%3Aissue+-label%3Astatus%3Aduplicate+label%3Acategory%3Asimulators%3Averilator) Synopsys VCS[](https://docs.cocotb.org/en/stable/simulator_support.html#synopsys-vcs "Link to this heading") -------------------------------------------------------------------------------------------------------------- In order to use this simulator, set [`SIM`](https://docs.cocotb.org/en/stable/building.html#var-SIM) to `vcs`: make SIM\=vcs cocotb currently only supports [VPI](https://docs.cocotb.org/en/stable/glossary.html#term-VPI) for Synopsys VCS, not [VHPI](https://docs.cocotb.org/en/stable/glossary.html#term-VHPI) . ### Issues for this simulator[](https://docs.cocotb.org/en/stable/simulator_support.html#sim-vcs-issues "Link to this heading") * [All issues with label category:simulators:vcs](https://github.com/cocotb/cocotb/issues?q=is%3Aissue+-label%3Astatus%3Aduplicate+label%3Acategory%3Asimulators%3Avcs) Aldec Riviera-PRO[](https://docs.cocotb.org/en/stable/simulator_support.html#aldec-riviera-pro "Link to this heading") ------------------------------------------------------------------------------------------------------------------------ In order to use this simulator, set [`SIM`](https://docs.cocotb.org/en/stable/building.html#var-SIM) to `riviera`: make SIM\=riviera Note On Windows, do not install the C++ compiler, i.e. unselect it during the installation process of Riviera-PRO. (A workaround is to remove or rename the `mingw` directory located in the Riviera-PRO installation directory.) Deprecated since version 1.4: Support for Riviera-PRO was previously available with `SIM=aldec`. The `LICENSE_QUEUE` environment variable can be used for this simulator – this setting will be mirrored in the TCL `license_queue` variable to control runtime license checkouts. ### Issues for this simulator[](https://docs.cocotb.org/en/stable/simulator_support.html#sim-aldec-issues "Link to this heading") * [All issues with label category:simulators:riviera](https://github.com/cocotb/cocotb/issues?q=is%3Aissue+-label%3Astatus%3Aduplicate+label%3Acategory%3Asimulators%3Ariviera) Aldec Active-HDL[](https://docs.cocotb.org/en/stable/simulator_support.html#aldec-active-hdl "Link to this heading") ---------------------------------------------------------------------------------------------------------------------- In order to use this simulator, set [`SIM`](https://docs.cocotb.org/en/stable/building.html#var-SIM) to `activehdl`: make SIM\=activehdl Warning cocotb does not work with some versions of Active-HDL (see [#1494](https://github.com/cocotb/cocotb/issues/1494) ). Known affected versions: * Aldec Active-HDL 10.4a * Aldec Active-HDL 10.5a ### Issues for this simulator[](https://docs.cocotb.org/en/stable/simulator_support.html#sim-activehdl-issues "Link to this heading") * [All issues with label category:simulators:activehdl](https://github.com/cocotb/cocotb/issues?q=is%3Aissue+-label%3Astatus%3Aduplicate+label%3Acategory%3Asimulators%3Aactivehdl) Mentor/Siemens EDA Questa[](https://docs.cocotb.org/en/stable/simulator_support.html#mentor-siemens-eda-questa "Link to this heading") ---------------------------------------------------------------------------------------------------------------------------------------- In order to use this simulator, set [`SIM`](https://docs.cocotb.org/en/stable/building.html#var-SIM) to `questa`: make SIM\=questa Starting with Questa 2022.3 and cocotb 1.7 users with VHDL toplevels can choose between two communication interfaces between Questa and cocotb: the proprietary FLI and VHPI. For backwards-compatibility cocotb defaults to FLI. Users can choose VHPI instead by setting the `VHDL_GPI_INTERFACE` environment variable to `vhpi` before running cocotb. For more information, see [Mentor/Siemens EDA ModelSim](https://docs.cocotb.org/en/stable/simulator_support.html#sim-modelsim) . ### Issues for this simulator[](https://docs.cocotb.org/en/stable/simulator_support.html#sim-questa-issues "Link to this heading") * [All issues with label category:simulators:questa](https://github.com/cocotb/cocotb/issues?q=is%3Aissue+-label%3Astatus%3Aduplicate+label%3Acategory%3Asimulators%3Aquesta) Mentor/Siemens EDA ModelSim[](https://docs.cocotb.org/en/stable/simulator_support.html#mentor-siemens-eda-modelsim "Link to this heading") -------------------------------------------------------------------------------------------------------------------------------------------- In order to use this simulator, set [`SIM`](https://docs.cocotb.org/en/stable/building.html#var-SIM) to `modelsim`: make SIM\=modelsim Any ModelSim PE or ModelSim PE derivatives (like the ModelSim Microsemi, Intel, Lattice Editions) do not support the VHDL [FLI](https://docs.cocotb.org/en/stable/glossary.html#term-FLI) feature. If you try to use them with [FLI](https://docs.cocotb.org/en/stable/glossary.html#term-FLI) , you will see a `vsim-FLI-3155` error: \*\* Error (suppressible): (vsim-FLI-3155) The FLI is not enabled in this version of ModelSim. ModelSim DE and SE (and Questa, of course) support the [FLI](https://docs.cocotb.org/en/stable/glossary.html#term-FLI) . In order to start ModelSim or Questa with the graphical interface and for the simulator to remain active after the tests have completed, set `GUI=1`. If you have previously launched a test without this setting, you might have to delete the [`SIM_BUILD`](https://docs.cocotb.org/en/stable/building.html#var-SIM_BUILD) directory (`sim_build` by default) to get the correct behavior. ### Issues for this simulator[](https://docs.cocotb.org/en/stable/simulator_support.html#sim-modelsim-issues "Link to this heading") * [All issues with label category:simulators:modelsim](https://github.com/cocotb/cocotb/issues?q=is%3Aissue+-label%3Astatus%3Aduplicate+label%3Acategory%3Asimulators%3Amodelsim) Cadence Incisive[](https://docs.cocotb.org/en/stable/simulator_support.html#cadence-incisive "Link to this heading") ---------------------------------------------------------------------------------------------------------------------- In order to use this simulator, set [`SIM`](https://docs.cocotb.org/en/stable/building.html#var-SIM) to `ius`: make SIM\=ius For more information, see [Cadence Xcelium](https://docs.cocotb.org/en/stable/simulator_support.html#sim-xcelium) . ### Issues for this simulator[](https://docs.cocotb.org/en/stable/simulator_support.html#sim-incisive-issues "Link to this heading") * [All issues with label category:simulators:ius](https://github.com/cocotb/cocotb/issues?q=is%3Aissue+-label%3Astatus%3Aduplicate+label%3Acategory%3Asimulators%3Aius) Cadence Xcelium[](https://docs.cocotb.org/en/stable/simulator_support.html#cadence-xcelium "Link to this heading") -------------------------------------------------------------------------------------------------------------------- In order to use this simulator, set [`SIM`](https://docs.cocotb.org/en/stable/building.html#var-SIM) to `xcelium`: make SIM\=xcelium The simulator automatically loads [VPI](https://docs.cocotb.org/en/stable/glossary.html#term-VPI) even when only [VHPI](https://docs.cocotb.org/en/stable/glossary.html#term-VHPI) is requested. Testing designs with VHDL toplevels is only supported with Xcelium 23.09.004 and newer. ### Issues for this simulator[](https://docs.cocotb.org/en/stable/simulator_support.html#sim-xcelium-issues "Link to this heading") * [All issues with label category:simulators:xcelium](https://github.com/cocotb/cocotb/issues?q=is%3Aissue+-label%3Astatus%3Aduplicate+label%3Acategory%3Asimulators%3Axcelium) GHDL[](https://docs.cocotb.org/en/stable/simulator_support.html#ghdl "Link to this heading") ---------------------------------------------------------------------------------------------- Warning GHDL support in cocotb is experimental. Some features of cocotb may not work correctly or at all. At least GHDL 2.0 is required. In order to use this simulator, set [`SIM`](https://docs.cocotb.org/en/stable/building.html#var-SIM) to `ghdl`: make SIM\=ghdl Note A working installation of [GHDL](https://ghdl.github.io/ghdl/about.html) is required. You can find installation instructions [in the GHDL documentation](https://ghdl.github.io/ghdl/getting.html) . Noteworthy is that despite GHDL being a VHDL simulator, it implements the [VPI](https://docs.cocotb.org/en/stable/glossary.html#term-VPI) interface. ### Issues for this simulator[](https://docs.cocotb.org/en/stable/simulator_support.html#sim-ghdl-issues "Link to this heading") * [All issues with label category:simulators:ghdl](https://github.com/cocotb/cocotb/issues?q=is%3Aissue+-label%3Astatus%3Aduplicate+label%3Acategory%3Asimulators%3Aghdl) ### Waveforms[](https://docs.cocotb.org/en/stable/simulator_support.html#sim-ghdl-waveforms "Link to this heading") To get waveforms in VCD format, set the [`SIM_ARGS`](https://docs.cocotb.org/en/stable/building.html#var-SIM_ARGS) option to `--vcd=anyname.vcd`, for example in a Makefile: SIM\_ARGS+=\--vcd\=anyname.vcd The option can be set on the command line, as shown in the following example. SIM\_ARGS\=\--vcd\=anyname.vcd make SIM\=ghdl A VCD file named `anyname.vcd` will be generated in the current directory. [`SIM_ARGS`](https://docs.cocotb.org/en/stable/building.html#var-SIM_ARGS) can also be used to pass command line arguments related to [other waveform formats supported by GHDL](https://ghdl.github.io/ghdl/using/Simulation.html#export-waves "(in GHDL v6.0)") . NVC[](https://docs.cocotb.org/en/stable/simulator_support.html#nvc "Link to this heading") -------------------------------------------------------------------------------------------- Note NVC version **1.11.0** or later is required. In order to use this simulator, set [`SIM`](https://docs.cocotb.org/en/stable/building.html#var-SIM) to `nvc`: make SIM\=nvc ### Issues for this simulator[](https://docs.cocotb.org/en/stable/simulator_support.html#sim-nvc-issues "Link to this heading") * [All issues with label category:simulators:nvc](https://github.com/cocotb/cocotb/issues?q=is%3Aissue+-label%3Astatus%3Aduplicate+label%3Acategory%3Asimulators%3Anvc) ### Coverage[](https://docs.cocotb.org/en/stable/simulator_support.html#id17 "Link to this heading") To enable code coverage, add `--cover` to [`SIM_ARGS`](https://docs.cocotb.org/en/stable/building.html#var-SIM_ARGS) , for example in a Makefile: SIM\_ARGS += \--cover Specifying types of coverage is also supported. For example, to collect statement and branch coverage: SIM\_ARGS += \--cover\=statement,branch The `covdb` files will be placed in the `RTL_LIBRARY` subdirectory of [`SIM_BUILD`](https://docs.cocotb.org/en/stable/building.html#var-SIM_BUILD) . For instructions on how to specify coverage types and produce a report, refer to [NVC’s code coverage documentation](https://www.nickg.me.uk/nvc/manual.html#CODE_COVERAGE) . ### Waveforms[](https://docs.cocotb.org/en/stable/simulator_support.html#sim-nvc-waveforms "Link to this heading") To get waveforms in FST format, set the [`SIM_ARGS`](https://docs.cocotb.org/en/stable/building.html#var-SIM_ARGS) option to `--wave=anyname.fst`, for example in a Makefile: SIM\_ARGS += \--wave\=anyname.fst [`SIM_ARGS`](https://docs.cocotb.org/en/stable/building.html#var-SIM_ARGS) can also be used to set the waveform output to VCD by adding `--format=vcd`. Tachyon DA CVC[](https://docs.cocotb.org/en/stable/simulator_support.html#tachyon-da-cvc "Link to this heading") ------------------------------------------------------------------------------------------------------------------ In order to use [Tachyon DA](http://www.tachyon-da.com/) ’s [CVC](https://github.com/cambridgehackers/open-src-cvc) simulator, set [`SIM`](https://docs.cocotb.org/en/stable/building.html#var-SIM) to `cvc`: make SIM\=cvc Note that cocotb’s makefile is using CVC’s interpreted mode. ### Issues for this simulator[](https://docs.cocotb.org/en/stable/simulator_support.html#sim-cvc-issues "Link to this heading") * [All issues with label category:simulators:cvc](https://github.com/cocotb/cocotb/issues?q=is%3Aissue+-label%3Astatus%3Aduplicate+label%3Acategory%3Asimulators%3Acvc) --- # Build options and Environment Variables — cocotb 1.9.2 documentation * [](https://docs.cocotb.org/en/stable/index.html) * Build options and Environment Variables * [View page source](https://docs.cocotb.org/en/stable/_sources/building.rst.txt) * * * Build options and Environment Variables[](https://docs.cocotb.org/en/stable/building.html#build-options-and-environment-variables "Link to this heading") =========================================================================================================================================================== Make System[](https://docs.cocotb.org/en/stable/building.html#make-system "Link to this heading") --------------------------------------------------------------------------------------------------- Makefiles are provided for a variety of simulators in `cocotb/share/makefiles/simulators`. The common Makefile `cocotb/share/makefiles/Makefile.sim` includes the appropriate simulator Makefile based on the contents of the [`SIM`](https://docs.cocotb.org/en/stable/building.html#var-SIM) variable. ### Make Targets[](https://docs.cocotb.org/en/stable/building.html#make-targets "Link to this heading") Makefiles defines the targets `regression` and `sim`, the default target is `sim`. Both rules create a results file with the name taken from [`COCOTB_RESULTS_FILE`](https://docs.cocotb.org/en/stable/building.html#envvar-COCOTB_RESULTS_FILE) , defaulting to `results.xml`. This file is a xUnit-compatible output file suitable for use with e.g. [Jenkins](https://jenkins.io/) . The `sim` targets unconditionally re-runs the simulator whereas the `regression` target only re-builds if any dependencies have changed. In addition, the target `clean` can be used to remove build and simulation artifacts. The target `help` lists these available targets and the variables described below. ### Make Phases[](https://docs.cocotb.org/en/stable/building.html#make-phases "Link to this heading") Typically the makefiles provided with cocotb for various simulators use a separate `compile` and `run` target. This allows for a rapid re-running of a simulator if none of the [RTL](https://docs.cocotb.org/en/stable/glossary.html#term-RTL) source files have changed and therefore the simulator does not need to recompile the [RTL](https://docs.cocotb.org/en/stable/glossary.html#term-RTL) . Variables[](https://docs.cocotb.org/en/stable/building.html#variables "Link to this heading") ----------------------------------------------------------------------------------------------- The following sections document environment variables and makefile variables according to their owner/consumer. Of the environment variables, only [`MODULE`](https://docs.cocotb.org/en/stable/building.html#envvar-MODULE) is mandatory to be set (typically done in a makefile or run script), all others are optional. ### Cocotb[](https://docs.cocotb.org/en/stable/building.html#cocotb "Link to this heading") TOPLEVEL[](https://docs.cocotb.org/en/stable/building.html#envvar-TOPLEVEL "Link to this definition") Use this to indicate the instance in the hierarchy to use as the [DUT](https://docs.cocotb.org/en/stable/glossary.html#term-DUT) . If this isn’t defined then the first root instance is used. Leading and trailing whitespace are automatically discarded. The DUT is available in cocotb tests as a Python object at [`cocotb.top`](https://docs.cocotb.org/en/stable/library_reference.html#cocotb.top "cocotb.top") ; and is also passed to all cocotb tests as the [first and only parameter](https://docs.cocotb.org/en/stable/quickstart.html#quickstart-creating-a-test) . Changed in version 1.6.0: Strip leading and trailing whitespace RANDOM\_SEED[](https://docs.cocotb.org/en/stable/building.html#envvar-RANDOM_SEED "Link to this definition") Seed the Python random module to recreate a previous test stimulus. At the beginning of every test a message is displayed with the seed used for that execution: INFO cocotb.gpi \_\_init\_\_.py:89 in \_initialise\_testbench Seeding Python random module with 1377424946 To recreate the same stimuli use the following: make RANDOM\_SEED\=1377424946 See also: [`PLUSARGS`](https://docs.cocotb.org/en/stable/building.html#var-PLUSARGS) COCOTB\_ANSI\_OUTPUT[](https://docs.cocotb.org/en/stable/building.html#envvar-COCOTB_ANSI_OUTPUT "Link to this definition") Use this to override the default behavior of annotating cocotb output with ANSI color codes if the output is a terminal (`isatty()`). `COCOTB_ANSI_OUTPUT=1` forces output to be ANSI-colored regardless of the type of `stdout` or the presence of [`NO_COLOR`](https://docs.cocotb.org/en/stable/building.html#envvar-NO_COLOR) `COCOTB_ANSI_OUTPUT=0` suppresses the ANSI color output in the log messages NO\_COLOR[](https://docs.cocotb.org/en/stable/building.html#envvar-NO_COLOR "Link to this definition") From [http://no-color.org](http://no-color.org/) , > All command-line software which outputs text with ANSI color added should check for the presence of a `NO_COLOR` environment variable that, when present (regardless of its value), prevents the addition of ANSI color. COCOTB\_REDUCED\_LOG\_FMT[](https://docs.cocotb.org/en/stable/building.html#envvar-COCOTB_REDUCED_LOG_FMT "Link to this definition") Defaults internally to `1`. If the value is `1`, log lines displayed in the terminal will be shorter. It will print only time, message type (`INFO`, `WARNING`, `ERROR`, …) and the log message itself. Set to `0` if you wish to have the full format message. COCOTB\_ATTACH[](https://docs.cocotb.org/en/stable/building.html#envvar-COCOTB_ATTACH "Link to this definition") In order to give yourself time to attach a debugger to the simulator process before it starts to run, you can set the environment variable [`COCOTB_ATTACH`](https://docs.cocotb.org/en/stable/building.html#envvar-COCOTB_ATTACH) to a pause time value in seconds. If set, cocotb will print the process ID (PID) to attach to and wait the specified time before actually letting the simulator run. COCOTB\_ENABLE\_PROFILING[](https://docs.cocotb.org/en/stable/building.html#envvar-COCOTB_ENABLE_PROFILING "Link to this definition") Enable performance analysis of the Python portion of cocotb. When set, a file `test_profile.pstat` will be written which contains statistics about the cumulative time spent in the functions. From this, a callgraph diagram can be generated with [gprof2dot](https://github.com/jrfonseca/gprof2dot) and `graphviz`. COCOTB\_LOG\_LEVEL[](https://docs.cocotb.org/en/stable/building.html#envvar-COCOTB_LOG_LEVEL "Link to this definition") The default logging level to use. This is set to `INFO` unless overridden. Valid values are `TRACE`, `DEBUG`, `INFO`, `WARNING`, `ERROR`, `CRITICAL`. `TRACE` is used for internal low-level logging and produces very verbose logs. COCOTB\_RESOLVE\_X[](https://docs.cocotb.org/en/stable/building.html#envvar-COCOTB_RESOLVE_X "Link to this definition") Defines how to resolve bits with a value of `X`, `Z`, `U` or `W` when being converted to integer. Valid settings are: `VALUE_ERROR` raise a [`ValueError`](https://docs.python.org/3/library/exceptions.html#ValueError "(in Python v3.13)") exception `ZEROS` resolve to `0` `ONES` resolve to `1` `RANDOM` randomly resolve to a `0` or a `1` Set to `VALUE_ERROR` by default. MEMCHECK[](https://docs.cocotb.org/en/stable/building.html#envvar-MEMCHECK "Link to this definition") HTTP port to use for debugging Python’s memory usage. When set to e.g. `8088`, data will be presented at [http://localhost:8088](http://localhost:8088/) . This needs the `cherrypy` and `dowser` Python modules installed. LIBPYTHON\_LOC[](https://docs.cocotb.org/en/stable/building.html#envvar-LIBPYTHON_LOC "Link to this definition") The absolute path to the Python library associated with the current Python installation; i.e. `libpython.so` or `python.dll` on Windows. This is determined with `cocotb-config --libpython` in cocotb’s makefiles. #### Regression Manager[](https://docs.cocotb.org/en/stable/building.html#regression-manager "Link to this heading") MODULE[](https://docs.cocotb.org/en/stable/building.html#envvar-MODULE "Link to this definition") The name of the Python module(s) to search for test functions - if your tests are in a file called `test_mydesign.py`, `MODULE` would be set to `test_mydesign`. Multiple modules can be specified using a comma-separated list. All tests will be run from each specified module in order of the module’s appearance in this list. The is the only environment variable that is **required** for cocotb, all others are optional. TESTCASE[](https://docs.cocotb.org/en/stable/building.html#envvar-TESTCASE "Link to this definition") The name of the test function(s) to run. If this variable is not defined cocotb discovers and executes all functions decorated with the [`cocotb.test`](https://docs.cocotb.org/en/stable/library_reference.html#cocotb.test "cocotb.test") decorator in the supplied [`MODULE`](https://docs.cocotb.org/en/stable/building.html#envvar-MODULE) list. Multiple test functions can be specified using a comma-separated list. COCOTB\_RESULTS\_FILE[](https://docs.cocotb.org/en/stable/building.html#envvar-COCOTB_RESULTS_FILE "Link to this definition") The file name where xUnit XML tests results are stored. If not provided, the default is `results.xml`. Added in version 1.3. COVERAGE[](https://docs.cocotb.org/en/stable/building.html#envvar-COVERAGE "Link to this definition") Enable to report Python coverage data. For some simulators, this will also report [HDL](https://docs.cocotb.org/en/stable/glossary.html#term-HDL) coverage. This needs the `coverage` Python module to be installed. COCOTB\_PDB\_ON\_EXCEPTION[](https://docs.cocotb.org/en/stable/building.html#envvar-COCOTB_PDB_ON_EXCEPTION "Link to this definition") If defined, cocotb will drop into the Python debugger ([`pdb`](https://docs.python.org/3/library/pdb.html#module-pdb "(in Python v3.13)") ) if a test fails with an exception. See also the [Python](https://docs.cocotb.org/en/stable/troubleshooting.html#troubleshooting-attaching-debugger-python) subsection of [Attaching a Debugger](https://docs.cocotb.org/en/stable/troubleshooting.html#troubleshooting-attaching-debugger) . #### Scheduler[](https://docs.cocotb.org/en/stable/building.html#scheduler "Link to this heading") COCOTB\_SCHEDULER\_DEBUG[](https://docs.cocotb.org/en/stable/building.html#envvar-COCOTB_SCHEDULER_DEBUG "Link to this definition") Enable additional log output of the coroutine scheduler. ### GPI[](https://docs.cocotb.org/en/stable/building.html#gpi "Link to this heading") GPI\_EXTRA[](https://docs.cocotb.org/en/stable/building.html#envvar-GPI_EXTRA "Link to this definition") A comma-separated list of extra libraries that are dynamically loaded at runtime. A function from each of these libraries will be called as an entry point prior to elaboration, allowing these libraries to register system functions and callbacks. Note that [HDL](https://docs.cocotb.org/en/stable/glossary.html#term-HDL) objects cannot be accessed at this time. An entry point function must be named following a `:` separator, which follows an existing simulator convention. For example: * `GPI_EXTRA=libnameA.so:entryA,libnameB.so:entryB` will first load `libnameA.so` with entry point `entryA` , then load `libnameB.so` with entry point `entryB`. Changed in version 1.4.0: Support for the custom entry point via `:` was added. Previously `:` was used as a separator between libraries instead of `,`. Changed in version 1.5.0: Library name must be fully specified. This allows using relative or absolute paths in library names, and loading from libraries that aren’t prefixed with “lib”. Paths should not contain commas. ### PyGPI[](https://docs.cocotb.org/en/stable/building.html#pygpi "Link to this heading") Warning PyGPI is an experimental feature and subject to change. PYGPI\_ENTRY\_POINT[](https://docs.cocotb.org/en/stable/building.html#envvar-PYGPI_ENTRY_POINT "Link to this definition") The Python module and callable that starts up the Python cosimulation environment. This defaults to `cocotb:_initialise_testbench`, which is the cocotb standard entry point. User overloads can be used to enter alternative Python frameworks or to hook existing cocotb functionality. The variable is formatted as `path.to.entry.module:entry_point.function`. The string before the colon is the Python module to import and the string following the colon is the object to call as the entry function. The entry function must be a callable matching this form: * `entry_function(argv: List[str]) -> None` The entry module must have the following additional functions defined. These additional requirements on the entry module may be relaxed over time. * `_sim_event(message: str) -> None` * `_log_from_c(logger_name: str, level: int, filename: str, lineno: int, msg: str, function_name: str)) -> None` * `_filter_from_c(logger_name: str, level: int) -> bool` Changed in version 1.8: `level` argument to `_sim_event` is no longer passed, it is assumed to be SIM\_FAIL (2). ### Makefile-based Test Scripts[](https://docs.cocotb.org/en/stable/building.html#makefile-based-test-scripts "Link to this heading") The following variables are makefile variables, not environment variables. GUI[](https://docs.cocotb.org/en/stable/building.html#var-GUI "Link to this definition") Set this to 1 to enable the GUI mode in the simulator (if supported). SIM[](https://docs.cocotb.org/en/stable/building.html#var-SIM "Link to this definition") Selects which simulator Makefile to use. Attempts to include a simulator specific makefile from `cocotb/share/makefiles/simulators/makefile.$(SIM)` WAVES[](https://docs.cocotb.org/en/stable/building.html#var-WAVES "Link to this definition") Set this to 1 to enable wave traces dump for the Aldec Riviera-PRO, Mentor Graphics Questa, and Icarus Verilog simulators. To get wave traces in Verilator see [Waveforms](https://docs.cocotb.org/en/stable/simulator_support.html#sim-verilator-waveforms) . TOPLEVEL\_LANG[](https://docs.cocotb.org/en/stable/building.html#var-TOPLEVEL_LANG "Link to this definition") Used to inform the makefile scripts which [HDL](https://docs.cocotb.org/en/stable/glossary.html#term-HDL) language the top-level design element is written in. Currently it supports the values `verilog` for Verilog or SystemVerilog tops, and `vhdl` for VHDL tops. This is used by simulators that support more than one interface ([VPI](https://docs.cocotb.org/en/stable/glossary.html#term-VPI) , [VHPI](https://docs.cocotb.org/en/stable/glossary.html#term-VHPI) , or [FLI](https://docs.cocotb.org/en/stable/glossary.html#term-FLI) ) to select the appropriate interface to start cocotb. The variable is also made available to cocotb tests conveniently as [`cocotb.LANGUAGE`](https://docs.cocotb.org/en/stable/library_reference.html#cocotb.LANGUAGE "cocotb.LANGUAGE") . VHDL\_GPI\_INTERFACE[](https://docs.cocotb.org/en/stable/building.html#var-VHDL_GPI_INTERFACE "Link to this definition") Explicitly sets the simulator interface to use when [`TOPLEVEL_LANG`](https://docs.cocotb.org/en/stable/building.html#var-TOPLEVEL_LANG) is `vhdl`. This includes the initial GPI interface loaded, and `GPI_EXTRA` library loaded in mixed language simulations. Valid values are `vpi`, `vhpi`, or `fli`. Not all simulators support all values; refer to the [Simulator Support](https://docs.cocotb.org/en/stable/simulator_support.html#simulator-support) section for details. Setting this variable is rarely needed as cocotb chooses a suitable default value depending on the simulator used. VERILOG\_SOURCES[](https://docs.cocotb.org/en/stable/building.html#var-VERILOG_SOURCES "Link to this definition") A list of the Verilog source files to include. Paths can be absolute or relative; if relative, they are interpreted as relative to the location where `make` was invoked. VERILOG\_INCLUDE\_DIRS[](https://docs.cocotb.org/en/stable/building.html#var-VERILOG_INCLUDE_DIRS "Link to this definition") A list of the Verilog directories to search for include files. Paths can be absolute or relative; if relative, they are interpreted as relative to the location where `make` was invoked. VHDL\_SOURCES[](https://docs.cocotb.org/en/stable/building.html#var-VHDL_SOURCES "Link to this definition") A list of the VHDL source files to include. Paths can be absolute or relative; if relative, they are interpreted as relative to the location where `make` was invoked. VHDL\_SOURCES\_[](https://docs.cocotb.org/en/stable/building.html#var-VHDL_SOURCES_%3Clib%3E "Link to this definition") A list of the VHDL source files to include in the VHDL library _lib_ (currently for GHDL/ModelSim/Questa/Xcelium/Incisive/Riviera-PRO only). VHDL\_LIB\_ORDER[](https://docs.cocotb.org/en/stable/building.html#var-VHDL_LIB_ORDER "Link to this definition") A space-separated list defining the order in which VHDL libraries should be compiled (needed for ModelSim/Questa/Xcelium/Incisive, GHDL determines the order automatically). COMPILE\_ARGS[](https://docs.cocotb.org/en/stable/building.html#var-COMPILE_ARGS "Link to this definition") Any arguments or flags to pass to the compile (analysis) stage of the simulation. SIM\_ARGS[](https://docs.cocotb.org/en/stable/building.html#var-SIM_ARGS "Link to this definition") Any arguments or flags to pass to the execution of the compiled simulation. RUN\_ARGS[](https://docs.cocotb.org/en/stable/building.html#var-RUN_ARGS "Link to this definition") Any argument to be passed to the “first” invocation of a simulator that runs via a TCL script. One motivating usage is to pass \-noautoldlibpath to Questa to prevent it from loading the out-of-date libraries it ships with. Used by Aldec Riviera-PRO and Mentor Graphics Questa simulator. EXTRA\_ARGS[](https://docs.cocotb.org/en/stable/building.html#var-EXTRA_ARGS "Link to this definition") Passed to both the compile and execute phases of simulators with two rules, or passed to the single compile and run command for simulators which don’t have a distinct compilation stage. PLUSARGS[](https://docs.cocotb.org/en/stable/building.html#var-PLUSARGS "Link to this definition") “Plusargs” are options that are starting with a plus (`+`) sign. They are passed to the simulator and are also available within cocotb as [`cocotb.plusargs`](https://docs.cocotb.org/en/stable/library_reference.html#cocotb.plusargs "cocotb.plusargs") . In the simulator, they can be read by the Verilog/SystemVerilog system functions `$test$plusargs` and `$value$plusargs`. The special plusargs `+ntb_random_seed` and `+seed`, if present, are evaluated to set the random seed value if [`RANDOM_SEED`](https://docs.cocotb.org/en/stable/building.html#envvar-RANDOM_SEED) is not set. If both `+ntb_random_seed` and `+seed` are set, `+ntb_random_seed` is used. SIM\_CMD\_PREFIX[](https://docs.cocotb.org/en/stable/building.html#var-SIM_CMD_PREFIX "Link to this definition") Prefix for simulation command invocations. This can be used to add environment variables or other commands before the invocations of simulation commands. For example, `SIM_CMD_PREFIX := LD_PRELOAD="foo.so bar.so"` can be used to force a particular library to load. Or, `SIM_CMD_PREFIX := gdb --args` to run the simulation with the GDB debugger. Added in version 1.6.0. SIM\_CMD\_SUFFIX[](https://docs.cocotb.org/en/stable/building.html#var-SIM_CMD_SUFFIX "Link to this definition") Suffix for simulation command invocations. Typically used to redirect simulator `stdout` and `stderr`: \# Prints simulator stdout and stderr to the terminal \# as well as capture it all in a log file "sim.log". SIM\_CMD\_SUFFIX := 2\>&1 | tee sim.log Added in version 1.9. COCOTB\_HDL\_TIMEUNIT[](https://docs.cocotb.org/en/stable/building.html#var-COCOTB_HDL_TIMEUNIT "Link to this definition") The default time unit that should be assumed for simulation when not specified by modules in the design. If this isn’t specified then it is assumed to be `1ns`. Allowed values are 1, 10, and 100. Allowed units are `s`, `ms`, `us`, `ns`, `ps`, `fs`. Added in version 1.3. COCOTB\_HDL\_TIMEPRECISION[](https://docs.cocotb.org/en/stable/building.html#var-COCOTB_HDL_TIMEPRECISION "Link to this definition") The default time precision that should be assumed for simulation when not specified by modules in the design. If this isn’t specified then it is assumed to be `1ps`. Allowed values are 1, 10, and 100. Allowed units are `s`, `ms`, `us`, `ns`, `ps`, `fs`. Added in version 1.3. CUSTOM\_COMPILE\_DEPS[](https://docs.cocotb.org/en/stable/building.html#var-CUSTOM_COMPILE_DEPS "Link to this definition") Use to add additional dependencies to the compilation target; useful for defining additional rules to run pre-compilation or if the compilation phase depends on files other than the [RTL](https://docs.cocotb.org/en/stable/glossary.html#term-RTL) sources listed in [`VERILOG_SOURCES`](https://docs.cocotb.org/en/stable/building.html#var-VERILOG_SOURCES) or [`VHDL_SOURCES`](https://docs.cocotb.org/en/stable/building.html#var-VHDL_SOURCES) . CUSTOM\_SIM\_DEPS[](https://docs.cocotb.org/en/stable/building.html#var-CUSTOM_SIM_DEPS "Link to this definition") Use to add additional dependencies to the simulation target. SIM\_BUILD[](https://docs.cocotb.org/en/stable/building.html#var-SIM_BUILD "Link to this definition") Use to define a scratch directory for use by the simulator. The path is relative to the location where `make` was invoked. If not provided, the default scratch directory is `sim_build`. SCRIPT\_FILE[](https://docs.cocotb.org/en/stable/building.html#envvar-SCRIPT_FILE "Link to this definition") The name of a simulator script that is run as part of the simulation, e.g. for setting up wave traces. You can usually write out such a file from the simulator’s GUI. This is currently supported for the Mentor Questa, Mentor ModelSim and Aldec Riviera simulators. TOPLEVEL\_LIBRARY[](https://docs.cocotb.org/en/stable/building.html#var-TOPLEVEL_LIBRARY "Link to this definition") The name of the library that contains the [`TOPLEVEL`](https://docs.cocotb.org/en/stable/building.html#envvar-TOPLEVEL) module/entity. Only supported by the Aldec Riviera-PRO, Aldec Active-HDL, and Siemens EDA Questa simulators. ### Library Build Process[](https://docs.cocotb.org/en/stable/building.html#library-build-process "Link to this heading") You can pass additional options to the library build process (which is usually happening as part of the installation with `pip`) using the [conventional variables](https://www.gnu.org/software/make/manual/html_node/Catalogue-of-Rules.html) for C and C++ compilation and linking: CFLAGS, CPPFLAGS, and LDFLAGS. ### Internal Variables[](https://docs.cocotb.org/en/stable/building.html#internal-variables "Link to this heading") The following variables are used for cocotb internals. They may change at any time, and users should not rely on them. COCOTB\_PY\_DIR[](https://docs.cocotb.org/en/stable/building.html#envvar-COCOTB_PY_DIR "Link to this definition") Path to the directory containing the cocotb Python package in the `cocotb` subdirectory. COCOTB\_SHARE\_DIR[](https://docs.cocotb.org/en/stable/building.html#envvar-COCOTB_SHARE_DIR "Link to this definition") Path to the directory containing the cocotb Makefiles and simulator libraries in the subdirectories `lib`, `include`, and `makefiles`. COCOTB\_LIBRARY\_COVERAGE[](https://docs.cocotb.org/en/stable/building.html#envvar-COCOTB_LIBRARY_COVERAGE "Link to this definition") Enable code coverage collection for cocotb internals. When set, a file `.coverage.cocotb` will be written which contains statistics about the code coverage. This is mainly useful for cocotb’s own Continuous Integration setup. --- # Index — cocotb 1.9.2 documentation * [](https://docs.cocotb.org/en/stable/index.html) * Index * * * Index ===== [**\_**](https://docs.cocotb.org/en/stable/genindex.html#_) | [**A**](https://docs.cocotb.org/en/stable/genindex.html#A) | [**B**](https://docs.cocotb.org/en/stable/genindex.html#B) | [**C**](https://docs.cocotb.org/en/stable/genindex.html#C) | [**D**](https://docs.cocotb.org/en/stable/genindex.html#D) | [**E**](https://docs.cocotb.org/en/stable/genindex.html#E) | [**F**](https://docs.cocotb.org/en/stable/genindex.html#F) | [**G**](https://docs.cocotb.org/en/stable/genindex.html#G) | [**H**](https://docs.cocotb.org/en/stable/genindex.html#H) | [**I**](https://docs.cocotb.org/en/stable/genindex.html#I) | [**J**](https://docs.cocotb.org/en/stable/genindex.html#J) | [**K**](https://docs.cocotb.org/en/stable/genindex.html#K) | [**L**](https://docs.cocotb.org/en/stable/genindex.html#L) | [**M**](https://docs.cocotb.org/en/stable/genindex.html#M) | [**N**](https://docs.cocotb.org/en/stable/genindex.html#N) | [**O**](https://docs.cocotb.org/en/stable/genindex.html#O) | [**P**](https://docs.cocotb.org/en/stable/genindex.html#P) | [**Q**](https://docs.cocotb.org/en/stable/genindex.html#Q) | [**R**](https://docs.cocotb.org/en/stable/genindex.html#R) | [**S**](https://docs.cocotb.org/en/stable/genindex.html#S) | [**T**](https://docs.cocotb.org/en/stable/genindex.html#T) | [**U**](https://docs.cocotb.org/en/stable/genindex.html#U) | [**V**](https://docs.cocotb.org/en/stable/genindex.html#V) | [**W**](https://docs.cocotb.org/en/stable/genindex.html#W) | [**X**](https://docs.cocotb.org/en/stable/genindex.html#X) \_ -- | | | | --- | --- | | * [\_\_len\_\_() (cocotb.handle.HierarchyArrayObject method)](https://docs.cocotb.org/en/stable/library_reference.html#cocotb.handle.HierarchyArrayObject.__len__)
* [(cocotb.handle.SimHandleBase method)](https://docs.cocotb.org/en/stable/library_reference.html#cocotb.handle.SimHandleBase.__len__)

* [\_def\_file (cocotb.handle.SimHandleBase attribute)](https://docs.cocotb.org/en/stable/library_reference.html#cocotb.handle.SimHandleBase._def_file)

* [\_def\_name (cocotb.handle.SimHandleBase attribute)](https://docs.cocotb.org/en/stable/library_reference.html#cocotb.handle.SimHandleBase._def_name) | * [\_id() (cocotb.handle.HierarchyObject method)](https://docs.cocotb.org/en/stable/library_reference.html#cocotb.handle.HierarchyObject._id)

* [\_name (cocotb.handle.SimHandleBase attribute)](https://docs.cocotb.org/en/stable/library_reference.html#cocotb.handle.SimHandleBase._name)

* [\_path (cocotb.handle.SimHandleBase attribute)](https://docs.cocotb.org/en/stable/library_reference.html#cocotb.handle.SimHandleBase._path)

* [\_type (cocotb.handle.SimHandleBase attribute)](https://docs.cocotb.org/en/stable/library_reference.html#cocotb.handle.SimHandleBase._type)

* [\_wait() (cocotb.triggers.Waitable method)](https://docs.cocotb.org/en/stable/library_reference.html#cocotb.triggers.Waitable._wait) | A - | | | | --- | --- | | * [acquire() (cocotb.triggers.Lock method)](https://docs.cocotb.org/en/stable/triggers.html#cocotb.triggers.Lock.acquire)

* [add\_option() (cocotb.regression.TestFactory method)](https://docs.cocotb.org/en/stable/library_reference.html#cocotb.regression.TestFactory.add_option)

* [add\_test() (cocotb.scheduler.Scheduler method)](https://docs.cocotb.org/en/stable/library_reference.html#cocotb.scheduler.Scheduler.add_test) | * [argv (in module cocotb)](https://docs.cocotb.org/en/stable/library_reference.html#cocotb.argv)

* [Array (class in cocotb.types)](https://docs.cocotb.org/en/stable/library_reference.html#cocotb.types.Array)

* [assign() (cocotb.binary.BinaryValue method)](https://docs.cocotb.org/en/stable/library_reference.html#cocotb.binary.BinaryValue.assign) | B - | | | | --- | --- | | * [**BFM**](https://docs.cocotb.org/en/stable/glossary.html#term-BFM)

* [BinaryRepresentation (class in cocotb.binary)](https://docs.cocotb.org/en/stable/library_reference.html#cocotb.binary.BinaryRepresentation)

* [BinaryValue (class in cocotb.binary)](https://docs.cocotb.org/en/stable/library_reference.html#cocotb.binary.BinaryValue)

* [binstr (cocotb.binary.BinaryValue property)](https://docs.cocotb.org/en/stable/library_reference.html#cocotb.binary.BinaryValue.binstr)

* [Bit (class in cocotb.types)](https://docs.cocotb.org/en/stable/library_reference.html#cocotb.types.Bit) | * [buff (cocotb.binary.BinaryValue property)](https://docs.cocotb.org/en/stable/library_reference.html#cocotb.binary.BinaryValue.buff)

* [build() (cocotb.runner.Simulator method)](https://docs.cocotb.org/en/stable/library_reference.html#cocotb.runner.Simulator.build)

* built-in function
* [dir()](https://docs.cocotb.org/en/stable/library_reference.html#dir)

* [len()](https://docs.cocotb.org/en/stable/library_reference.html#len) | C - | | | | --- | --- | | * [cancel() (cocotb.task.Task method)](https://docs.cocotb.org/en/stable/library_reference.html#cocotb.task.Task.cancel)

* [cancelled() (cocotb.task.Task method)](https://docs.cocotb.org/en/stable/library_reference.html#cocotb.task.Task.cancelled)

* [check\_results\_file() (in module cocotb.runner)](https://docs.cocotb.org/en/stable/library_reference.html#cocotb.runner.check_results_file)

* [cleanup() (cocotb.scheduler.Scheduler method)](https://docs.cocotb.org/en/stable/library_reference.html#cocotb.scheduler.Scheduler.cleanup)

* [clear() (cocotb.triggers.Event method)](https://docs.cocotb.org/en/stable/triggers.html#cocotb.triggers.Event.clear)
* [(cocotb.wavedrom.Wavedrom method)](https://docs.cocotb.org/en/stable/library_reference.html#cocotb.wavedrom.Wavedrom.clear)

* [Clock (class in cocotb.clock)](https://docs.cocotb.org/en/stable/library_reference.html#cocotb.clock.Clock)

* [ClockCycles (class in cocotb.triggers)](https://docs.cocotb.org/en/stable/triggers.html#cocotb.triggers.ClockCycles)

* [close() (cocotb.task.Task method)](https://docs.cocotb.org/en/stable/library_reference.html#cocotb.task.Task.close)

* cocotb.handle
* [module](https://docs.cocotb.org/en/stable/library_reference.html#module-cocotb.handle)

* cocotb.ipython\_support
* [module](https://docs.cocotb.org/en/stable/troubleshooting.html#module-cocotb.ipython_support)

* cocotb.queue
* [module](https://docs.cocotb.org/en/stable/library_reference.html#module-cocotb.queue)

* cocotb.result
* [module](https://docs.cocotb.org/en/stable/library_reference.html#module-cocotb.result)

* cocotb.runner
* [module](https://docs.cocotb.org/en/stable/library_reference.html#module-cocotb.runner)

* cocotb.simulator
* [module](https://docs.cocotb.org/en/stable/library_reference.html#module-cocotb.simulator)

* cocotb.utils
* [module](https://docs.cocotb.org/en/stable/library_reference.html#module-cocotb.utils)

* cocotb.wavedrom
* [module](https://docs.cocotb.org/en/stable/library_reference.html#module-cocotb.wavedrom)

* [COCOTB\_ANSI\_OUTPUT](https://docs.cocotb.org/en/stable/library_reference.html#index-1)

* [COCOTB\_ATTACH](https://docs.cocotb.org/en/stable/building.html#index-3)
, [\[1\]](https://docs.cocotb.org/en/stable/troubleshooting.html#index-1)

* COCOTB\_HDL\_TIMEPRECISION
* [Make Variable](https://docs.cocotb.org/en/stable/building.html#var-COCOTB_HDL_TIMEPRECISION) | * COCOTB\_HDL\_TIMEUNIT
* [Make Variable](https://docs.cocotb.org/en/stable/building.html#var-COCOTB_HDL_TIMEUNIT)

* [COCOTB\_HOOKS](https://docs.cocotb.org/en/stable/release_notes.html#index-17)

* [COCOTB\_LOG\_LEVEL](https://docs.cocotb.org/en/stable/library_reference.html#index-2)
, [\[1\]](https://docs.cocotb.org/en/stable/release_notes.html#index-12)
, [\[2\]](https://docs.cocotb.org/en/stable/release_notes.html#index-25)

* [COCOTB\_PDB\_ON\_EXCEPTION](https://docs.cocotb.org/en/stable/release_notes.html#index-20)

* [COCOTB\_REDUCED\_LOG\_FMT](https://docs.cocotb.org/en/stable/release_notes.html#index-13)
, [\[1\]](https://docs.cocotb.org/en/stable/release_notes.html#index-14)

* [COCOTB\_RESOLVE\_X](https://docs.cocotb.org/en/stable/library_reference.html#index-0)

* [COCOTB\_RESULTS\_FILE](https://docs.cocotb.org/en/stable/building.html#index-0)
, [\[1\]](https://docs.cocotb.org/en/stable/release_notes.html#index-10)
, [\[2\]](https://docs.cocotb.org/en/stable/release_notes.html#index-26)

* [COCOTB\_SCHEDULER\_DEBUG](https://docs.cocotb.org/en/stable/troubleshooting.html#index-0)

* [Combine (class in cocotb.triggers)](https://docs.cocotb.org/en/stable/triggers.html#cocotb.triggers.Combine)

* COMPILE\_ARGS
* [Make Variable](https://docs.cocotb.org/en/stable/building.html#var-COMPILE_ARGS)

* [concat() (in module cocotb.types)](https://docs.cocotb.org/en/stable/library_reference.html#cocotb.types.concat)

* [ConstantObject (class in cocotb.handle)](https://docs.cocotb.org/en/stable/library_reference.html#cocotb.handle.ConstantObject)

* [**coroutine**](https://docs.cocotb.org/en/stable/glossary.html#term-coroutine)
* [(class in cocotb)](https://docs.cocotb.org/en/stable/library_reference.html#cocotb.coroutine)

* [**coroutine function**](https://docs.cocotb.org/en/stable/glossary.html#term-coroutine-function)

* [COVERAGE](https://docs.cocotb.org/en/stable/release_notes.html#index-6)

* [COVERAGE\_RCFILE](https://docs.cocotb.org/en/stable/release_notes.html#index-7)

* [create\_error() (in module cocotb.result)](https://docs.cocotb.org/en/stable/library_reference.html#cocotb.result.create_error)

* [create\_task() (cocotb.scheduler.Scheduler static method)](https://docs.cocotb.org/en/stable/library_reference.html#cocotb.scheduler.Scheduler.create_task)
* [(in module cocotb)](https://docs.cocotb.org/en/stable/library_reference.html#cocotb.create_task)

* [created\_sim\_time (logging.LogRecord attribute)](https://docs.cocotb.org/en/stable/library_reference.html#logging.LogRecord.created_sim_time)

* CUSTOM\_COMPILE\_DEPS
* [Make Variable](https://docs.cocotb.org/en/stable/building.html#var-CUSTOM_COMPILE_DEPS)

* CUSTOM\_SIM\_DEPS
* [Make Variable](https://docs.cocotb.org/en/stable/building.html#var-CUSTOM_SIM_DEPS) | D - | | | | --- | --- | | * [default\_config() (in module cocotb.log)](https://docs.cocotb.org/en/stable/library_reference.html#cocotb.log.default_config)

* [Deposit (class in cocotb.handle)](https://docs.cocotb.org/en/stable/library_reference.html#cocotb.handle.Deposit)

* [deregister() (cocotb.simulator.gpi\_cb\_hdl method)](https://docs.cocotb.org/en/stable/library_reference.html#cocotb.simulator.gpi_cb_hdl.deregister)

* dir()
* [built-in function](https://docs.cocotb.org/en/stable/library_reference.html#dir) | * [direction (cocotb.types.Array property)](https://docs.cocotb.org/en/stable/library_reference.html#cocotb.types.Array.direction)
* [(cocotb.types.Range property)](https://docs.cocotb.org/en/stable/library_reference.html#cocotb.types.Range.direction)

* [done() (cocotb.task.Task method)](https://docs.cocotb.org/en/stable/library_reference.html#cocotb.task.Task.done)

* [drivers() (cocotb.handle.NonConstantObject method)](https://docs.cocotb.org/en/stable/library_reference.html#cocotb.handle.NonConstantObject.drivers)

* [**DUT**](https://docs.cocotb.org/en/stable/glossary.html#term-DUT)

* [**DUV**](https://docs.cocotb.org/en/stable/glossary.html#term-DUV) | E - | | | | --- | --- | | * [Edge (class in cocotb.triggers)](https://docs.cocotb.org/en/stable/triggers.html#cocotb.triggers.Edge)

* [embed() (in module cocotb.ipython\_support)](https://docs.cocotb.org/en/stable/troubleshooting.html#cocotb.ipython_support.embed)

* [empty() (cocotb.queue.Queue method)](https://docs.cocotb.org/en/stable/library_reference.html#cocotb.queue.Queue.empty)

* [EnumObject (class in cocotb.handle)](https://docs.cocotb.org/en/stable/library_reference.html#cocotb.handle.EnumObject)

* environment variable
* [COCOTB\_ANSI\_OUTPUT](https://docs.cocotb.org/en/stable/building.html#envvar-COCOTB_ANSI_OUTPUT)
, [\[1\]](https://docs.cocotb.org/en/stable/library_reference.html#index-1)

* [COCOTB\_ATTACH](https://docs.cocotb.org/en/stable/building.html#envvar-COCOTB_ATTACH)
, [\[1\]](https://docs.cocotb.org/en/stable/building.html#index-3)
, [\[2\]](https://docs.cocotb.org/en/stable/troubleshooting.html#index-1)

* [COCOTB\_ENABLE\_PROFILING](https://docs.cocotb.org/en/stable/building.html#envvar-COCOTB_ENABLE_PROFILING)

* [COCOTB\_HOOKS](https://docs.cocotb.org/en/stable/release_notes.html#index-17)

* [COCOTB\_LIBRARY\_COVERAGE](https://docs.cocotb.org/en/stable/building.html#envvar-COCOTB_LIBRARY_COVERAGE)

* [COCOTB\_LOG\_LEVEL](https://docs.cocotb.org/en/stable/building.html#envvar-COCOTB_LOG_LEVEL)
, [\[1\]](https://docs.cocotb.org/en/stable/library_reference.html#index-2)
, [\[2\]](https://docs.cocotb.org/en/stable/release_notes.html#index-12)
, [\[3\]](https://docs.cocotb.org/en/stable/release_notes.html#index-25)

* [COCOTB\_PDB\_ON\_EXCEPTION](https://docs.cocotb.org/en/stable/building.html#envvar-COCOTB_PDB_ON_EXCEPTION)
, [\[1\]](https://docs.cocotb.org/en/stable/release_notes.html#index-20)

* [COCOTB\_PY\_DIR](https://docs.cocotb.org/en/stable/building.html#envvar-COCOTB_PY_DIR)

* [COCOTB\_REDUCED\_LOG\_FMT](https://docs.cocotb.org/en/stable/building.html#envvar-COCOTB_REDUCED_LOG_FMT)
, [\[1\]](https://docs.cocotb.org/en/stable/release_notes.html#index-13)
, [\[2\]](https://docs.cocotb.org/en/stable/release_notes.html#index-14)

* [COCOTB\_RESOLVE\_X](https://docs.cocotb.org/en/stable/building.html#envvar-COCOTB_RESOLVE_X)
, [\[1\]](https://docs.cocotb.org/en/stable/library_reference.html#index-0)

* [COCOTB\_RESULTS\_FILE](https://docs.cocotb.org/en/stable/building.html#envvar-COCOTB_RESULTS_FILE)
, [\[1\]](https://docs.cocotb.org/en/stable/building.html#index-0)
, [\[2\]](https://docs.cocotb.org/en/stable/release_notes.html#index-10)
, [\[3\]](https://docs.cocotb.org/en/stable/release_notes.html#index-26)

* [COCOTB\_SCHEDULER\_DEBUG](https://docs.cocotb.org/en/stable/building.html#envvar-COCOTB_SCHEDULER_DEBUG)
, [\[1\]](https://docs.cocotb.org/en/stable/troubleshooting.html#index-0)

* [COCOTB\_SHARE\_DIR](https://docs.cocotb.org/en/stable/building.html#envvar-COCOTB_SHARE_DIR)

* [COVERAGE](https://docs.cocotb.org/en/stable/building.html#envvar-COVERAGE)
, [\[1\]](https://docs.cocotb.org/en/stable/release_notes.html#index-6)

* [COVERAGE\_RCFILE](https://docs.cocotb.org/en/stable/release_notes.html#index-7)

* [GPI\_EXTRA](https://docs.cocotb.org/en/stable/building.html#envvar-GPI_EXTRA)
, [\[1\]](https://docs.cocotb.org/en/stable/custom_flows.html#index-2)
, [\[2\]](https://docs.cocotb.org/en/stable/custom_flows.html#index-3)
, [\[3\]](https://docs.cocotb.org/en/stable/custom_flows.html#index-4)
, [\[4\]](https://docs.cocotb.org/en/stable/custom_flows.html#index-5)
, [\[5\]](https://docs.cocotb.org/en/stable/custom_flows.html#index-6)
, [\[6\]](https://docs.cocotb.org/en/stable/custom_flows.html#index-7)
, [\[7\]](https://docs.cocotb.org/en/stable/custom_flows.html#index-8)
, [\[8\]](https://docs.cocotb.org/en/stable/custom_flows.html#index-9)
, [\[9\]](https://docs.cocotb.org/en/stable/release_notes.html#index-19)
, [\[10\]](https://docs.cocotb.org/en/stable/release_notes.html#index-23)

* [LD\_LIBRARY\_PATH](https://docs.cocotb.org/en/stable/troubleshooting.html#index-2)
, [\[1\]](https://docs.cocotb.org/en/stable/troubleshooting.html#index-3)
, [\[2\]](https://docs.cocotb.org/en/stable/troubleshooting.html#index-4)
, [\[3\]](https://docs.cocotb.org/en/stable/troubleshooting.html#index-5)
, [\[4\]](https://docs.cocotb.org/en/stable/troubleshooting.html#index-6)
, [\[5\]](https://docs.cocotb.org/en/stable/troubleshooting.html#index-7)
, [\[6\]](https://docs.cocotb.org/en/stable/troubleshooting.html#index-8)

* [LIBPYTHON\_LOC](https://docs.cocotb.org/en/stable/building.html#envvar-LIBPYTHON_LOC)
, [\[1\]](https://docs.cocotb.org/en/stable/custom_flows.html#index-0)

* [LICENSE\_QUEUE](https://docs.cocotb.org/en/stable/simulator_support.html#index-0)

* [MEMCHECK](https://docs.cocotb.org/en/stable/building.html#envvar-MEMCHECK)

* [MODULE](https://docs.cocotb.org/en/stable/building.html#envvar-MODULE)
, [\[1\]](https://docs.cocotb.org/en/stable/building.html#index-1)
, [\[2\]](https://docs.cocotb.org/en/stable/building.html#index-4)
, [\[3\]](https://docs.cocotb.org/en/stable/custom_flows.html#index-1)
, [\[4\]](https://docs.cocotb.org/en/stable/library_reference.html#index-5)
, [\[5\]](https://docs.cocotb.org/en/stable/quickstart.html#index-1)
, [\[6\]](https://docs.cocotb.org/en/stable/release_notes.html#index-24)

* [NO\_COLOR](https://docs.cocotb.org/en/stable/building.html#envvar-NO_COLOR)
, [\[1\]](https://docs.cocotb.org/en/stable/building.html#index-2)
, [\[2\]](https://docs.cocotb.org/en/stable/release_notes.html#index-21)

* [PATH](https://docs.cocotb.org/en/stable/install.html#index-0)
, [\[1\]](https://docs.cocotb.org/en/stable/install.html#index-1)

* [PLUSARGS](https://docs.cocotb.org/en/stable/release_notes.html#index-22)

* [PYGPI\_ENTRY\_POINT](https://docs.cocotb.org/en/stable/building.html#envvar-PYGPI_ENTRY_POINT)
, [\[1\]](https://docs.cocotb.org/en/stable/release_notes.html#index-3)
, [\[2\]](https://docs.cocotb.org/en/stable/release_notes.html#index-9)

* [PYTHONHOME](https://docs.cocotb.org/en/stable/release_notes.html#index-8)

* [RANDOM\_SEED](https://docs.cocotb.org/en/stable/building.html#envvar-RANDOM_SEED)
, [\[1\]](https://docs.cocotb.org/en/stable/building.html#index-5)
, [\[2\]](https://docs.cocotb.org/en/stable/library_reference.html#index-3)

* [SCRIPT\_FILE](https://docs.cocotb.org/en/stable/building.html#envvar-SCRIPT_FILE)

* [TESTCASE](https://docs.cocotb.org/en/stable/building.html#envvar-TESTCASE)
, [\[1\]](https://docs.cocotb.org/en/stable/library_reference.html#index-6)
, [\[2\]](https://docs.cocotb.org/en/stable/release_notes.html#index-16)

* [TOPLEVEL](https://docs.cocotb.org/en/stable/building.html#envvar-TOPLEVEL)
, [\[1\]](https://docs.cocotb.org/en/stable/building.html#index-6)
, [\[2\]](https://docs.cocotb.org/en/stable/library_reference.html#index-4)
, [\[3\]](https://docs.cocotb.org/en/stable/quickstart.html#index-0)
, [\[4\]](https://docs.cocotb.org/en/stable/release_notes.html#index-11)
, [\[5\]](https://docs.cocotb.org/en/stable/release_notes.html#index-15)

* [TOPLEVEL\_LIBRARY](https://docs.cocotb.org/en/stable/release_notes.html#index-0)
, [\[1\]](https://docs.cocotb.org/en/stable/release_notes.html#index-1)

* [VERILOG\_INCLUDE\_DIRS](https://docs.cocotb.org/en/stable/release_notes.html#index-4)

* [VHDL\_GPI\_INTERFACE](https://docs.cocotb.org/en/stable/release_notes.html#index-5)
, [\[1\]](https://docs.cocotb.org/en/stable/simulator_support.html#index-1)

* [WAVES](https://docs.cocotb.org/en/stable/release_notes.html#index-2) | * [Event (class in cocotb.triggers)](https://docs.cocotb.org/en/stable/triggers.html#cocotb.triggers.Event)

* [exception() (cocotb.task.Task method)](https://docs.cocotb.org/en/stable/library_reference.html#cocotb.task.Task.exception)

* [external (class in cocotb)](https://docs.cocotb.org/en/stable/library_reference.html#cocotb.external)

* [ExternalException](https://docs.cocotb.org/en/stable/library_reference.html#cocotb.result.ExternalException)

* EXTRA\_ARGS
* [Make Variable](https://docs.cocotb.org/en/stable/building.html#var-EXTRA_ARGS)

* [extract\_coro\_stack() (in module cocotb.utils)](https://docs.cocotb.org/en/stable/library_reference.html#cocotb.utils.extract_coro_stack) | F - | | | | --- | --- | | * [FallingEdge (class in cocotb.triggers)](https://docs.cocotb.org/en/stable/triggers.html#cocotb.triggers.FallingEdge)

* [finish\_scheduler() (cocotb.scheduler.Scheduler method)](https://docs.cocotb.org/en/stable/library_reference.html#cocotb.scheduler.Scheduler.finish_scheduler)

* [finish\_test() (cocotb.scheduler.Scheduler method)](https://docs.cocotb.org/en/stable/library_reference.html#cocotb.scheduler.Scheduler.finish_test)

* [First (class in cocotb.triggers)](https://docs.cocotb.org/en/stable/triggers.html#cocotb.triggers.First)

* [**FLI**](https://docs.cocotb.org/en/stable/glossary.html#term-FLI)

* [Force (class in cocotb.handle)](https://docs.cocotb.org/en/stable/library_reference.html#cocotb.handle.Force) | * [fork() (in module cocotb)](https://docs.cocotb.org/en/stable/library_reference.html#cocotb.fork)

* [Freeze (class in cocotb.handle)](https://docs.cocotb.org/en/stable/library_reference.html#cocotb.handle.Freeze)

* [from\_discovery() (cocotb.regression.RegressionManager class method)](https://docs.cocotb.org/en/stable/library_reference.html#cocotb.regression.RegressionManager.from_discovery)

* [from\_range() (cocotb.types.Range class method)](https://docs.cocotb.org/en/stable/library_reference.html#cocotb.types.Range.from_range)

* [full() (cocotb.queue.Queue method)](https://docs.cocotb.org/en/stable/library_reference.html#cocotb.queue.Queue.full)

* [function (class in cocotb)](https://docs.cocotb.org/en/stable/library_reference.html#cocotb.function) | G - | | | | --- | --- | | * [generate\_tests() (cocotb.regression.TestFactory method)](https://docs.cocotb.org/en/stable/library_reference.html#cocotb.regression.TestFactory.generate_tests)

* [get() (cocotb.queue.Queue method)](https://docs.cocotb.org/en/stable/library_reference.html#cocotb.queue.Queue.get)
* [(cocotb.wavedrom.Wavedrom method)](https://docs.cocotb.org/en/stable/library_reference.html#cocotb.wavedrom.Wavedrom.get)

* [get\_abs\_path() (in module cocotb.runner)](https://docs.cocotb.org/en/stable/library_reference.html#cocotb.runner.get_abs_path)

* [get\_abs\_paths() (in module cocotb.runner)](https://docs.cocotb.org/en/stable/library_reference.html#cocotb.runner.get_abs_paths)

* [get\_const() (cocotb.simulator.gpi\_sim\_hdl method)](https://docs.cocotb.org/en/stable/library_reference.html#cocotb.simulator.gpi_sim_hdl.get_const)

* [get\_definition\_file() (cocotb.simulator.gpi\_sim\_hdl method)](https://docs.cocotb.org/en/stable/library_reference.html#cocotb.simulator.gpi_sim_hdl.get_definition_file)

* [get\_definition\_name() (cocotb.simulator.gpi\_sim\_hdl method)](https://docs.cocotb.org/en/stable/library_reference.html#cocotb.simulator.gpi_sim_hdl.get_definition_name)

* [get\_handle\_by\_index() (cocotb.simulator.gpi\_sim\_hdl method)](https://docs.cocotb.org/en/stable/library_reference.html#cocotb.simulator.gpi_sim_hdl.get_handle_by_index)

* [get\_handle\_by\_name() (cocotb.simulator.gpi\_sim\_hdl method)](https://docs.cocotb.org/en/stable/library_reference.html#cocotb.simulator.gpi_sim_hdl.get_handle_by_name)

* [get\_name\_string() (cocotb.simulator.gpi\_sim\_hdl method)](https://docs.cocotb.org/en/stable/library_reference.html#cocotb.simulator.gpi_sim_hdl.get_name_string)

* [get\_nowait() (cocotb.queue.Queue method)](https://docs.cocotb.org/en/stable/library_reference.html#cocotb.queue.Queue.get_nowait)

* [get\_num\_elems() (cocotb.simulator.gpi\_sim\_hdl method)](https://docs.cocotb.org/en/stable/library_reference.html#cocotb.simulator.gpi_sim_hdl.get_num_elems)

* [get\_precision() (in module cocotb.simulator)](https://docs.cocotb.org/en/stable/library_reference.html#cocotb.simulator.get_precision)

* [get\_range() (cocotb.simulator.gpi\_sim\_hdl method)](https://docs.cocotb.org/en/stable/library_reference.html#cocotb.simulator.gpi_sim_hdl.get_range)

* [get\_results() (in module cocotb.runner)](https://docs.cocotb.org/en/stable/library_reference.html#cocotb.runner.get_results)

* [get\_root\_handle() (in module cocotb.simulator)](https://docs.cocotb.org/en/stable/library_reference.html#cocotb.simulator.get_root_handle)

* [get\_runner() (in module cocotb.runner)](https://docs.cocotb.org/en/stable/library_reference.html#cocotb.runner.get_runner)

* [get\_signal\_val\_binstr() (cocotb.simulator.gpi\_sim\_hdl method)](https://docs.cocotb.org/en/stable/library_reference.html#cocotb.simulator.gpi_sim_hdl.get_signal_val_binstr)

* [get\_signal\_val\_long() (cocotb.simulator.gpi\_sim\_hdl method)](https://docs.cocotb.org/en/stable/library_reference.html#cocotb.simulator.gpi_sim_hdl.get_signal_val_long)

* [get\_signal\_val\_real() (cocotb.simulator.gpi\_sim\_hdl method)](https://docs.cocotb.org/en/stable/library_reference.html#cocotb.simulator.gpi_sim_hdl.get_signal_val_real)

* [get\_signal\_val\_str() (cocotb.simulator.gpi\_sim\_hdl method)](https://docs.cocotb.org/en/stable/library_reference.html#cocotb.simulator.gpi_sim_hdl.get_signal_val_str)

* [get\_sim\_steps() (in module cocotb.utils)](https://docs.cocotb.org/en/stable/library_reference.html#cocotb.utils.get_sim_steps)

* [get\_sim\_time() (in module cocotb.simulator)](https://docs.cocotb.org/en/stable/library_reference.html#cocotb.simulator.get_sim_time)
* [(in module cocotb.utils)](https://docs.cocotb.org/en/stable/library_reference.html#cocotb.utils.get_sim_time)

* [get\_simulator\_product() (in module cocotb.simulator)](https://docs.cocotb.org/en/stable/library_reference.html#cocotb.simulator.get_simulator_product)

* [get\_simulator\_version() (in module cocotb.simulator)](https://docs.cocotb.org/en/stable/library_reference.html#cocotb.simulator.get_simulator_version)

* [get\_time\_from\_sim\_steps() (in module cocotb.utils)](https://docs.cocotb.org/en/stable/library_reference.html#cocotb.utils.get_time_from_sim_steps)

* [get\_type() (cocotb.simulator.gpi\_sim\_hdl method)](https://docs.cocotb.org/en/stable/library_reference.html#cocotb.simulator.gpi_sim_hdl.get_type)

* [get\_type\_string() (cocotb.simulator.gpi\_sim\_hdl method)](https://docs.cocotb.org/en/stable/library_reference.html#cocotb.simulator.gpi_sim_hdl.get_type_string)

* [Ghdl (class in cocotb.runner)](https://docs.cocotb.org/en/stable/library_reference.html#cocotb.runner.Ghdl)

* [**GPI**](https://docs.cocotb.org/en/stable/glossary.html#term-GPI)

* [gpi\_cb\_hdl (C++ type)](https://docs.cocotb.org/en/stable/library_reference_c.html#_CPPv410gpi_cb_hdl)
* [(class in cocotb.simulator)](https://docs.cocotb.org/en/stable/library_reference.html#cocotb.simulator.gpi_cb_hdl)

* [gpi\_deregister\_callback (C++ function)](https://docs.cocotb.org/en/stable/library_reference_c.html#_CPPv423gpi_deregister_callback10gpi_cb_hdl)

* [gpi\_edge (C++ enum)](https://docs.cocotb.org/en/stable/library_reference_c.html#_CPPv48gpi_edge)

* [gpi\_edge::GPI\_FALLING (C++ enumerator)](https://docs.cocotb.org/en/stable/library_reference_c.html#_CPPv4N8gpi_edge11GPI_FALLINGE)

* [gpi\_edge::GPI\_RISING (C++ enumerator)](https://docs.cocotb.org/en/stable/library_reference_c.html#_CPPv4N8gpi_edge10GPI_RISINGE)

* [gpi\_edge\_e (C++ type)](https://docs.cocotb.org/en/stable/library_reference_c.html#_CPPv410gpi_edge_e)

* [GPI\_EXPORT (C macro)](https://docs.cocotb.org/en/stable/library_reference_c.html#c.GPI_EXPORT)

* [GPI\_EXTRA](https://docs.cocotb.org/en/stable/custom_flows.html#index-2)
, [\[1\]](https://docs.cocotb.org/en/stable/custom_flows.html#index-3)
, [\[2\]](https://docs.cocotb.org/en/stable/custom_flows.html#index-4)
, [\[3\]](https://docs.cocotb.org/en/stable/custom_flows.html#index-5)
, [\[4\]](https://docs.cocotb.org/en/stable/custom_flows.html#index-6)
, [\[5\]](https://docs.cocotb.org/en/stable/custom_flows.html#index-7)
, [\[6\]](https://docs.cocotb.org/en/stable/custom_flows.html#index-8)
, [\[7\]](https://docs.cocotb.org/en/stable/custom_flows.html#index-9)
, [\[8\]](https://docs.cocotb.org/en/stable/release_notes.html#index-19)
, [\[9\]](https://docs.cocotb.org/en/stable/release_notes.html#index-23)

* [gpi\_free\_handle (C++ function)](https://docs.cocotb.org/en/stable/library_reference_c.html#_CPPv415gpi_free_handle11gpi_sim_hdl)

* [gpi\_get\_callback\_data (C++ function)](https://docs.cocotb.org/en/stable/library_reference_c.html#_CPPv421gpi_get_callback_data10gpi_cb_hdl)

* [gpi\_get\_definition\_file (C++ function)](https://docs.cocotb.org/en/stable/library_reference_c.html#_CPPv423gpi_get_definition_file11gpi_sim_hdl)

* [gpi\_get\_definition\_name (C++ function)](https://docs.cocotb.org/en/stable/library_reference_c.html#_CPPv423gpi_get_definition_name11gpi_sim_hdl)

* [gpi\_get\_handle\_by\_index (C++ function)](https://docs.cocotb.org/en/stable/library_reference_c.html#_CPPv423gpi_get_handle_by_index11gpi_sim_hdl7int32_t)

* [gpi\_get\_handle\_by\_name (C++ function)](https://docs.cocotb.org/en/stable/library_reference_c.html#_CPPv422gpi_get_handle_by_name11gpi_sim_hdlPKc)

* [gpi\_get\_num\_elems (C++ function)](https://docs.cocotb.org/en/stable/library_reference_c.html#_CPPv417gpi_get_num_elems11gpi_sim_hdl)

* [gpi\_get\_object\_type (C++ function)](https://docs.cocotb.org/en/stable/library_reference_c.html#_CPPv419gpi_get_object_type11gpi_sim_hdl)

* [gpi\_get\_range\_left (C++ function)](https://docs.cocotb.org/en/stable/library_reference_c.html#_CPPv418gpi_get_range_left11gpi_sim_hdl)

* [gpi\_get\_range\_right (C++ function)](https://docs.cocotb.org/en/stable/library_reference_c.html#_CPPv419gpi_get_range_right11gpi_sim_hdl)

* [gpi\_get\_root\_handle (C++ function)](https://docs.cocotb.org/en/stable/library_reference_c.html#_CPPv419gpi_get_root_handlePKc)

* [gpi\_get\_signal\_name\_str (C++ function)](https://docs.cocotb.org/en/stable/library_reference_c.html#_CPPv423gpi_get_signal_name_str11gpi_sim_hdl)

* [gpi\_get\_signal\_type\_str (C++ function)](https://docs.cocotb.org/en/stable/library_reference_c.html#_CPPv423gpi_get_signal_type_str11gpi_sim_hdl) | * [gpi\_get\_signal\_value\_binstr (C++ function)](https://docs.cocotb.org/en/stable/library_reference_c.html#_CPPv427gpi_get_signal_value_binstr11gpi_sim_hdl)

* [gpi\_get\_signal\_value\_long (C++ function)](https://docs.cocotb.org/en/stable/library_reference_c.html#_CPPv425gpi_get_signal_value_long11gpi_sim_hdl)

* [gpi\_get\_signal\_value\_real (C++ function)](https://docs.cocotb.org/en/stable/library_reference_c.html#_CPPv425gpi_get_signal_value_real11gpi_sim_hdl)

* [gpi\_get\_signal\_value\_str (C++ function)](https://docs.cocotb.org/en/stable/library_reference_c.html#_CPPv424gpi_get_signal_value_str11gpi_sim_hdl)

* [gpi\_get\_sim\_precision (C++ function)](https://docs.cocotb.org/en/stable/library_reference_c.html#_CPPv421gpi_get_sim_precisionP7int32_t)

* [gpi\_get\_sim\_time (C++ function)](https://docs.cocotb.org/en/stable/library_reference_c.html#_CPPv416gpi_get_sim_timeP8uint32_tP8uint32_t)

* [gpi\_get\_simulator\_product (C++ function)](https://docs.cocotb.org/en/stable/library_reference_c.html#_CPPv425gpi_get_simulator_productv)

* [gpi\_get\_simulator\_version (C++ function)](https://docs.cocotb.org/en/stable/library_reference_c.html#_CPPv425gpi_get_simulator_versionv)

* [gpi\_has\_registered\_impl (C++ function)](https://docs.cocotb.org/en/stable/library_reference_c.html#_CPPv423gpi_has_registered_implv)

* [gpi\_is\_constant (C++ function)](https://docs.cocotb.org/en/stable/library_reference_c.html#_CPPv415gpi_is_constant11gpi_sim_hdl)

* [gpi\_is\_indexable (C++ function)](https://docs.cocotb.org/en/stable/library_reference_c.html#_CPPv416gpi_is_indexable11gpi_sim_hdl)

* [gpi\_iterate (C++ function)](https://docs.cocotb.org/en/stable/library_reference_c.html#_CPPv411gpi_iterate11gpi_sim_hdl18gpi_iterator_sel_t)

* [gpi\_iterator\_hdl (C++ type)](https://docs.cocotb.org/en/stable/library_reference_c.html#_CPPv416gpi_iterator_hdl)
* [(class in cocotb.simulator)](https://docs.cocotb.org/en/stable/library_reference.html#cocotb.simulator.gpi_iterator_hdl)

* [gpi\_iterator\_sel\_e (C++ enum)](https://docs.cocotb.org/en/stable/library_reference_c.html#_CPPv418gpi_iterator_sel_e)

* [gpi\_iterator\_sel\_e::GPI\_DRIVERS (C++ enumerator)](https://docs.cocotb.org/en/stable/library_reference_c.html#_CPPv4N18gpi_iterator_sel_e11GPI_DRIVERSE)

* [gpi\_iterator\_sel\_e::GPI\_LOADS (C++ enumerator)](https://docs.cocotb.org/en/stable/library_reference_c.html#_CPPv4N18gpi_iterator_sel_e9GPI_LOADSE)

* [gpi\_iterator\_sel\_e::GPI\_OBJECTS (C++ enumerator)](https://docs.cocotb.org/en/stable/library_reference_c.html#_CPPv4N18gpi_iterator_sel_e11GPI_OBJECTSE)

* [gpi\_iterator\_sel\_t (C++ type)](https://docs.cocotb.org/en/stable/library_reference_c.html#_CPPv418gpi_iterator_sel_t)

* [gpi\_next (C++ function)](https://docs.cocotb.org/en/stable/library_reference_c.html#_CPPv48gpi_next16gpi_iterator_hdl)

* [gpi\_objtype\_e (C++ enum)](https://docs.cocotb.org/en/stable/library_reference_c.html#_CPPv413gpi_objtype_e)

* [gpi\_objtype\_e::GPI\_ARRAY (C++ enumerator)](https://docs.cocotb.org/en/stable/library_reference_c.html#_CPPv4N13gpi_objtype_e9GPI_ARRAYE)

* [gpi\_objtype\_e::GPI\_ENUM (C++ enumerator)](https://docs.cocotb.org/en/stable/library_reference_c.html#_CPPv4N13gpi_objtype_e8GPI_ENUME)

* [gpi\_objtype\_e::GPI\_GENARRAY (C++ enumerator)](https://docs.cocotb.org/en/stable/library_reference_c.html#_CPPv4N13gpi_objtype_e12GPI_GENARRAYE)

* [gpi\_objtype\_e::GPI\_INTEGER (C++ enumerator)](https://docs.cocotb.org/en/stable/library_reference_c.html#_CPPv4N13gpi_objtype_e11GPI_INTEGERE)

* [gpi\_objtype\_e::GPI\_MEMORY (C++ enumerator)](https://docs.cocotb.org/en/stable/library_reference_c.html#_CPPv4N13gpi_objtype_e10GPI_MEMORYE)

* [gpi\_objtype\_e::GPI\_MODULE (C++ enumerator)](https://docs.cocotb.org/en/stable/library_reference_c.html#_CPPv4N13gpi_objtype_e10GPI_MODULEE)

* [gpi\_objtype\_e::GPI\_NET (C++ enumerator)](https://docs.cocotb.org/en/stable/library_reference_c.html#_CPPv4N13gpi_objtype_e7GPI_NETE)

* [gpi\_objtype\_e::GPI\_REAL (C++ enumerator)](https://docs.cocotb.org/en/stable/library_reference_c.html#_CPPv4N13gpi_objtype_e8GPI_REALE)

* [gpi\_objtype\_e::GPI\_REGISTER (C++ enumerator)](https://docs.cocotb.org/en/stable/library_reference_c.html#_CPPv4N13gpi_objtype_e12GPI_REGISTERE)

* [gpi\_objtype\_e::GPI\_STRING (C++ enumerator)](https://docs.cocotb.org/en/stable/library_reference_c.html#_CPPv4N13gpi_objtype_e10GPI_STRINGE)

* [gpi\_objtype\_e::GPI\_STRUCTURE (C++ enumerator)](https://docs.cocotb.org/en/stable/library_reference_c.html#_CPPv4N13gpi_objtype_e13GPI_STRUCTUREE)

* [gpi\_objtype\_e::GPI\_UNKNOWN (C++ enumerator)](https://docs.cocotb.org/en/stable/library_reference_c.html#_CPPv4N13gpi_objtype_e11GPI_UNKNOWNE)

* [gpi\_objtype\_t (C++ type)](https://docs.cocotb.org/en/stable/library_reference_c.html#_CPPv413gpi_objtype_t)

* [gpi\_register\_nexttime\_callback (C++ function)](https://docs.cocotb.org/en/stable/library_reference_c.html#_CPPv430gpi_register_nexttime_callbackPFiPvEPv)

* [gpi\_register\_readonly\_callback (C++ function)](https://docs.cocotb.org/en/stable/library_reference_c.html#_CPPv430gpi_register_readonly_callbackPFiPvEPv)

* [gpi\_register\_readwrite\_callback (C++ function)](https://docs.cocotb.org/en/stable/library_reference_c.html#_CPPv431gpi_register_readwrite_callbackPFiPvEPv)

* [gpi\_register\_timed\_callback (C++ function)](https://docs.cocotb.org/en/stable/library_reference_c.html#_CPPv427gpi_register_timed_callbackPFiPvEPv8uint64_t)

* [gpi\_register\_value\_change\_callback (C++ function)](https://docs.cocotb.org/en/stable/library_reference_c.html#_CPPv434gpi_register_value_change_callbackPFiPvEPv11gpi_sim_hdli)

* [gpi\_set\_action\_e (C++ enum)](https://docs.cocotb.org/en/stable/library_reference_c.html#_CPPv416gpi_set_action_e)

* [gpi\_set\_action\_e::GPI\_DEPOSIT (C++ enumerator)](https://docs.cocotb.org/en/stable/library_reference_c.html#_CPPv4N16gpi_set_action_e11GPI_DEPOSITE)

* [gpi\_set\_action\_e::GPI\_FORCE (C++ enumerator)](https://docs.cocotb.org/en/stable/library_reference_c.html#_CPPv4N16gpi_set_action_e9GPI_FORCEE)

* [gpi\_set\_action\_e::GPI\_RELEASE (C++ enumerator)](https://docs.cocotb.org/en/stable/library_reference_c.html#_CPPv4N16gpi_set_action_e11GPI_RELEASEE)

* [gpi\_set\_action\_t (C++ type)](https://docs.cocotb.org/en/stable/library_reference_c.html#_CPPv416gpi_set_action_t)

* [gpi\_set\_signal\_value\_binstr (C++ function)](https://docs.cocotb.org/en/stable/library_reference_c.html#_CPPv427gpi_set_signal_value_binstr11gpi_sim_hdlPKc16gpi_set_action_t)

* [gpi\_set\_signal\_value\_int (C++ function)](https://docs.cocotb.org/en/stable/library_reference_c.html#_CPPv424gpi_set_signal_value_int11gpi_sim_hdl7int32_t16gpi_set_action_t)

* [gpi\_set\_signal\_value\_real (C++ function)](https://docs.cocotb.org/en/stable/library_reference_c.html#_CPPv425gpi_set_signal_value_real11gpi_sim_hdld16gpi_set_action_t)

* [gpi\_set\_signal\_value\_str (C++ function)](https://docs.cocotb.org/en/stable/library_reference_c.html#_CPPv424gpi_set_signal_value_str11gpi_sim_hdlPKc16gpi_set_action_t)

* [gpi\_sim\_end (C++ function)](https://docs.cocotb.org/en/stable/library_reference_c.html#_CPPv411gpi_sim_endv)

* [gpi\_sim\_hdl (C++ type)](https://docs.cocotb.org/en/stable/library_reference_c.html#_CPPv411gpi_sim_hdl)
* [(class in cocotb.simulator)](https://docs.cocotb.org/en/stable/library_reference.html#cocotb.simulator.gpi_sim_hdl)

* [GPITrigger (class in cocotb.triggers)](https://docs.cocotb.org/en/stable/library_reference.html#cocotb.triggers.GPITrigger)

* GUI
* [Make Variable](https://docs.cocotb.org/en/stable/building.html#var-GUI) | H - | | | | --- | --- | | * [**HAL**](https://docs.cocotb.org/en/stable/glossary.html#term-HAL)

* [has\_started() (cocotb.task.Task method)](https://docs.cocotb.org/en/stable/library_reference.html#cocotb.task.Task.has_started)

* [**HDL**](https://docs.cocotb.org/en/stable/glossary.html#term-HDL) | * [hexdiffs() (in module cocotb.utils)](https://docs.cocotb.org/en/stable/library_reference.html#cocotb.utils.hexdiffs)

* [hexdump() (in module cocotb.utils)](https://docs.cocotb.org/en/stable/library_reference.html#cocotb.utils.hexdump)

* [HierarchyArrayObject (class in cocotb.handle)](https://docs.cocotb.org/en/stable/library_reference.html#cocotb.handle.HierarchyArrayObject)

* [HierarchyObject (class in cocotb.handle)](https://docs.cocotb.org/en/stable/library_reference.html#cocotb.handle.HierarchyObject) | I - | | | | --- | --- | | * [Icarus (class in cocotb.runner)](https://docs.cocotb.org/en/stable/library_reference.html#cocotb.runner.Icarus)

* [integer (cocotb.binary.BinaryValue property)](https://docs.cocotb.org/en/stable/library_reference.html#cocotb.binary.BinaryValue.integer)

* [IntegerObject (class in cocotb.handle)](https://docs.cocotb.org/en/stable/library_reference.html#cocotb.handle.IntegerObject) | * [is\_resolvable (cocotb.binary.BinaryValue property)](https://docs.cocotb.org/en/stable/library_reference.html#cocotb.binary.BinaryValue.is_resolvable)

* [is\_running() (in module cocotb.simulator)](https://docs.cocotb.org/en/stable/library_reference.html#cocotb.simulator.is_running)

* [is\_set() (cocotb.triggers.Event method)](https://docs.cocotb.org/en/stable/triggers.html#cocotb.triggers.Event.is_set)

* [iterate() (cocotb.simulator.gpi\_sim\_hdl method)](https://docs.cocotb.org/en/stable/library_reference.html#cocotb.simulator.gpi_sim_hdl.iterate) | J - | | | | --- | --- | | * [Join (class in cocotb.triggers)](https://docs.cocotb.org/en/stable/triggers.html#cocotb.triggers.Join) | * [join() (cocotb.task.Task method)](https://docs.cocotb.org/en/stable/library_reference.html#cocotb.task.Task.join) | K - * [kill() (cocotb.task.Task method)](https://docs.cocotb.org/en/stable/library_reference.html#cocotb.task.Task.kill) L - | | | | --- | --- | | * [LANGUAGE (in module cocotb)](https://docs.cocotb.org/en/stable/library_reference.html#cocotb.LANGUAGE)

* [lazy\_property (class in cocotb.utils)](https://docs.cocotb.org/en/stable/library_reference.html#cocotb.utils.lazy_property)

* [LD\_LIBRARY\_PATH](https://docs.cocotb.org/en/stable/troubleshooting.html#index-2)
, [\[1\]](https://docs.cocotb.org/en/stable/troubleshooting.html#index-3)
, [\[2\]](https://docs.cocotb.org/en/stable/troubleshooting.html#index-4)
, [\[3\]](https://docs.cocotb.org/en/stable/troubleshooting.html#index-5)
, [\[4\]](https://docs.cocotb.org/en/stable/troubleshooting.html#index-6)
, [\[5\]](https://docs.cocotb.org/en/stable/troubleshooting.html#index-7)
, [\[6\]](https://docs.cocotb.org/en/stable/troubleshooting.html#index-8)

* [left (cocotb.types.Array property)](https://docs.cocotb.org/en/stable/library_reference.html#cocotb.types.Array.left)
* [(cocotb.types.Range property)](https://docs.cocotb.org/en/stable/library_reference.html#cocotb.types.Range.left)

* len()
* [built-in function](https://docs.cocotb.org/en/stable/library_reference.html#len)

* [LIBPYTHON\_LOC](https://docs.cocotb.org/en/stable/custom_flows.html#index-0) | * [LICENSE\_QUEUE](https://docs.cocotb.org/en/stable/simulator_support.html#index-0)

* [LifoQueue (class in cocotb.queue)](https://docs.cocotb.org/en/stable/library_reference.html#cocotb.queue.LifoQueue)

* [loads() (cocotb.handle.NonConstantObject method)](https://docs.cocotb.org/en/stable/library_reference.html#cocotb.handle.NonConstantObject.loads)

* [Lock (class in cocotb.triggers)](https://docs.cocotb.org/en/stable/triggers.html#cocotb.triggers.Lock)

* [locked() (cocotb.triggers.Lock method)](https://docs.cocotb.org/en/stable/triggers.html#cocotb.triggers.Lock.locked)

* [log\_level() (in module cocotb.simulator)](https://docs.cocotb.org/en/stable/library_reference.html#cocotb.simulator.log_level)

* [log\_msg() (in module cocotb.simulator)](https://docs.cocotb.org/en/stable/library_reference.html#cocotb.simulator.log_msg)

* [Logic (class in cocotb.types)](https://docs.cocotb.org/en/stable/library_reference.html#cocotb.types.Logic)

* [LogicArray (class in cocotb.types)](https://docs.cocotb.org/en/stable/library_reference.html#cocotb.types.LogicArray) | M - | | | | --- | --- | | * Make Variable
* [COCOTB\_HDL\_TIMEPRECISION](https://docs.cocotb.org/en/stable/building.html#var-COCOTB_HDL_TIMEPRECISION)

* [COCOTB\_HDL\_TIMEUNIT](https://docs.cocotb.org/en/stable/building.html#var-COCOTB_HDL_TIMEUNIT)

* [COMPILE\_ARGS](https://docs.cocotb.org/en/stable/building.html#var-COMPILE_ARGS)

* [CUSTOM\_COMPILE\_DEPS](https://docs.cocotb.org/en/stable/building.html#var-CUSTOM_COMPILE_DEPS)

* [CUSTOM\_SIM\_DEPS](https://docs.cocotb.org/en/stable/building.html#var-CUSTOM_SIM_DEPS)

* [EXTRA\_ARGS](https://docs.cocotb.org/en/stable/building.html#var-EXTRA_ARGS)

* [GUI](https://docs.cocotb.org/en/stable/building.html#var-GUI)

* [PLUSARGS](https://docs.cocotb.org/en/stable/building.html#var-PLUSARGS)

* [RUN\_ARGS](https://docs.cocotb.org/en/stable/building.html#var-RUN_ARGS)

* [SIM](https://docs.cocotb.org/en/stable/building.html#var-SIM)

* [SIM\_ARGS](https://docs.cocotb.org/en/stable/building.html#var-SIM_ARGS)

* [SIM\_BUILD](https://docs.cocotb.org/en/stable/building.html#var-SIM_BUILD)

* [SIM\_CMD\_PREFIX](https://docs.cocotb.org/en/stable/building.html#var-SIM_CMD_PREFIX)

* [SIM\_CMD\_SUFFIX](https://docs.cocotb.org/en/stable/building.html#var-SIM_CMD_SUFFIX)

* [TOPLEVEL\_LANG](https://docs.cocotb.org/en/stable/building.html#var-TOPLEVEL_LANG)

* [TOPLEVEL\_LIBRARY](https://docs.cocotb.org/en/stable/building.html#var-TOPLEVEL_LIBRARY)

* [VERILOG\_INCLUDE\_DIRS](https://docs.cocotb.org/en/stable/building.html#var-VERILOG_INCLUDE_DIRS)

* [VERILOG\_SOURCES](https://docs.cocotb.org/en/stable/building.html#var-VERILOG_SOURCES)

* [VHDL\_GPI\_INTERFACE](https://docs.cocotb.org/en/stable/building.html#var-VHDL_GPI_INTERFACE)

* [VHDL\_LIB\_ORDER](https://docs.cocotb.org/en/stable/building.html#var-VHDL_LIB_ORDER)

* [VHDL\_SOURCES](https://docs.cocotb.org/en/stable/building.html#var-VHDL_SOURCES)

* [VHDL\_SOURCES\_](https://docs.cocotb.org/en/stable/building.html#var-VHDL_SOURCES_%3Clib%3E)

* [WAVES](https://docs.cocotb.org/en/stable/building.html#var-WAVES) | * [maxsize (cocotb.queue.Queue property)](https://docs.cocotb.org/en/stable/library_reference.html#cocotb.queue.Queue.maxsize)

* [**MDV**](https://docs.cocotb.org/en/stable/glossary.html#term-MDV)

* [ModifiableObject (class in cocotb.handle)](https://docs.cocotb.org/en/stable/library_reference.html#cocotb.handle.ModifiableObject)

* [MODULE](https://docs.cocotb.org/en/stable/building.html#index-1)
, [\[1\]](https://docs.cocotb.org/en/stable/building.html#index-4)
, [\[2\]](https://docs.cocotb.org/en/stable/custom_flows.html#index-1)
, [\[3\]](https://docs.cocotb.org/en/stable/library_reference.html#index-5)
, [\[4\]](https://docs.cocotb.org/en/stable/quickstart.html#index-1)
, [\[5\]](https://docs.cocotb.org/en/stable/release_notes.html#index-24)

* module
* [cocotb.handle](https://docs.cocotb.org/en/stable/library_reference.html#module-cocotb.handle)

* [cocotb.ipython\_support](https://docs.cocotb.org/en/stable/troubleshooting.html#module-cocotb.ipython_support)

* [cocotb.queue](https://docs.cocotb.org/en/stable/library_reference.html#module-cocotb.queue)

* [cocotb.result](https://docs.cocotb.org/en/stable/library_reference.html#module-cocotb.result)

* [cocotb.runner](https://docs.cocotb.org/en/stable/library_reference.html#module-cocotb.runner)

* [cocotb.simulator](https://docs.cocotb.org/en/stable/library_reference.html#module-cocotb.simulator)

* [cocotb.utils](https://docs.cocotb.org/en/stable/library_reference.html#module-cocotb.utils)

* [cocotb.wavedrom](https://docs.cocotb.org/en/stable/library_reference.html#module-cocotb.wavedrom) | N - | | | | --- | --- | | * [n\_bits (cocotb.binary.BinaryValue property)](https://docs.cocotb.org/en/stable/library_reference.html#cocotb.binary.BinaryValue.n_bits)

* [NextTimeStep (class in cocotb.triggers)](https://docs.cocotb.org/en/stable/triggers.html#cocotb.triggers.NextTimeStep)

* [NO\_COLOR](https://docs.cocotb.org/en/stable/building.html#index-2)
, [\[1\]](https://docs.cocotb.org/en/stable/release_notes.html#index-21) | * [NonConstantObject (class in cocotb.handle)](https://docs.cocotb.org/en/stable/library_reference.html#cocotb.handle.NonConstantObject)

* [NonHierarchyIndexableObject (class in cocotb.handle)](https://docs.cocotb.org/en/stable/library_reference.html#cocotb.handle.NonHierarchyIndexableObject)

* [NonHierarchyObject (class in cocotb.handle)](https://docs.cocotb.org/en/stable/library_reference.html#cocotb.handle.NonHierarchyObject)

* [Nvc (class in cocotb.runner)](https://docs.cocotb.org/en/stable/library_reference.html#cocotb.runner.Nvc) | O - * [outdated() (in module cocotb.runner)](https://docs.cocotb.org/en/stable/library_reference.html#cocotb.runner.outdated) P - | | | | --- | --- | | * [pack() (in module cocotb.utils)](https://docs.cocotb.org/en/stable/library_reference.html#cocotb.utils.pack)

* [ParametrizedSingleton (class in cocotb.utils)](https://docs.cocotb.org/en/stable/library_reference.html#cocotb.utils.ParametrizedSingleton)

* [PATH](https://docs.cocotb.org/en/stable/install.html#index-0)
, [\[1\]](https://docs.cocotb.org/en/stable/install.html#index-1)

* [PLUSARGS](https://docs.cocotb.org/en/stable/release_notes.html#index-22)
* [Make Variable](https://docs.cocotb.org/en/stable/building.html#var-PLUSARGS)

* [plusargs (in module cocotb)](https://docs.cocotb.org/en/stable/library_reference.html#cocotb.plusargs)

* [prime() (cocotb.triggers.Trigger method)](https://docs.cocotb.org/en/stable/library_reference.html#cocotb.triggers.Trigger.prime)

* [PriorityQueue (class in cocotb.queue)](https://docs.cocotb.org/en/stable/library_reference.html#cocotb.queue.PriorityQueue) | * [put() (cocotb.queue.Queue method)](https://docs.cocotb.org/en/stable/library_reference.html#cocotb.queue.Queue.put)

* [put\_nowait() (cocotb.queue.Queue method)](https://docs.cocotb.org/en/stable/library_reference.html#cocotb.queue.Queue.put_nowait)

* [PYGPI\_ENTRY\_POINT](https://docs.cocotb.org/en/stable/release_notes.html#index-3)
, [\[1\]](https://docs.cocotb.org/en/stable/release_notes.html#index-9)

* Python Enhancement Proposals
* [PEP 420](https://docs.cocotb.org/en/stable/extensions.html#index-0)

* [PEP 517](https://docs.cocotb.org/en/stable/release_notes.html#index-18)

* [PEP 525](https://docs.cocotb.org/en/stable/coroutines.html#index-0)

* [PYTHONHOME](https://docs.cocotb.org/en/stable/release_notes.html#index-8) | Q - | | | | --- | --- | | * [qsize() (cocotb.queue.Queue method)](https://docs.cocotb.org/en/stable/library_reference.html#cocotb.queue.Queue.qsize)

* [Questa (class in cocotb.runner)](https://docs.cocotb.org/en/stable/library_reference.html#cocotb.runner.Questa)

* [Queue (class in cocotb.queue)](https://docs.cocotb.org/en/stable/library_reference.html#cocotb.queue.Queue) | * [queue() (cocotb.scheduler.Scheduler method)](https://docs.cocotb.org/en/stable/library_reference.html#cocotb.scheduler.Scheduler.queue)

* [queue\_function() (cocotb.scheduler.Scheduler method)](https://docs.cocotb.org/en/stable/library_reference.html#cocotb.scheduler.Scheduler.queue_function)

* [QueueEmpty](https://docs.cocotb.org/en/stable/library_reference.html#cocotb.queue.QueueEmpty)

* [QueueFull](https://docs.cocotb.org/en/stable/library_reference.html#cocotb.queue.QueueFull) | R - | | | | --- | --- | | * [raise\_error() (in module cocotb.result)](https://docs.cocotb.org/en/stable/library_reference.html#cocotb.result.raise_error)

* [RANDOM\_SEED](https://docs.cocotb.org/en/stable/building.html#index-5)
, [\[1\]](https://docs.cocotb.org/en/stable/library_reference.html#index-3)
* [(in module cocotb)](https://docs.cocotb.org/en/stable/library_reference.html#cocotb.RANDOM_SEED)

* [Range (class in cocotb.types)](https://docs.cocotb.org/en/stable/library_reference.html#cocotb.types.Range)

* [range (cocotb.types.Array property)](https://docs.cocotb.org/en/stable/library_reference.html#cocotb.types.Array.range)

* [react() (cocotb.scheduler.Scheduler method)](https://docs.cocotb.org/en/stable/library_reference.html#cocotb.scheduler.Scheduler.react)

* [ReadOnly (class in cocotb.triggers)](https://docs.cocotb.org/en/stable/triggers.html#cocotb.triggers.ReadOnly)

* [ReadWrite (class in cocotb.triggers)](https://docs.cocotb.org/en/stable/triggers.html#cocotb.triggers.ReadWrite)

* [RealObject (class in cocotb.handle)](https://docs.cocotb.org/en/stable/library_reference.html#cocotb.handle.RealObject)

* [RegionObject (class in cocotb.handle)](https://docs.cocotb.org/en/stable/library_reference.html#cocotb.handle.RegionObject)

* [register\_nextstep\_callback() (in module cocotb.simulator)](https://docs.cocotb.org/en/stable/library_reference.html#cocotb.simulator.register_nextstep_callback)

* [register\_readonly\_callback() (in module cocotb.simulator)](https://docs.cocotb.org/en/stable/library_reference.html#cocotb.simulator.register_readonly_callback)

* [register\_rwsynch\_callback() (in module cocotb.simulator)](https://docs.cocotb.org/en/stable/library_reference.html#cocotb.simulator.register_rwsynch_callback)

* [register\_timed\_callback() (in module cocotb.simulator)](https://docs.cocotb.org/en/stable/library_reference.html#cocotb.simulator.register_timed_callback)

* [register\_value\_change\_callback() (in module cocotb.simulator)](https://docs.cocotb.org/en/stable/library_reference.html#cocotb.simulator.register_value_change_callback)

* [regression\_manager (in module cocotb)](https://docs.cocotb.org/en/stable/library_reference.html#cocotb.regression_manager)

* [RegressionManager (class in cocotb.regression)](https://docs.cocotb.org/en/stable/library_reference.html#cocotb.regression.RegressionManager) | * [reject\_remaining\_kwargs() (in module cocotb.utils)](https://docs.cocotb.org/en/stable/library_reference.html#cocotb.utils.reject_remaining_kwargs)

* [Release (class in cocotb.handle)](https://docs.cocotb.org/en/stable/library_reference.html#cocotb.handle.Release)

* [release() (cocotb.triggers.Lock method)](https://docs.cocotb.org/en/stable/triggers.html#cocotb.triggers.Lock.release)

* [remove\_traceback\_frames() (in module cocotb.utils)](https://docs.cocotb.org/en/stable/library_reference.html#cocotb.utils.remove_traceback_frames)

* [result() (cocotb.task.Task method)](https://docs.cocotb.org/en/stable/library_reference.html#cocotb.task.Task.result)

* [ReturnValue](https://docs.cocotb.org/en/stable/library_reference.html#cocotb.result.ReturnValue)

* [retval (cocotb.task.Task property)](https://docs.cocotb.org/en/stable/library_reference.html#cocotb.task.Task.retval)
* [(cocotb.triggers.Join property)](https://docs.cocotb.org/en/stable/triggers.html#cocotb.triggers.Join.retval)

* [right (cocotb.types.Array property)](https://docs.cocotb.org/en/stable/library_reference.html#cocotb.types.Array.right)
* [(cocotb.types.Range property)](https://docs.cocotb.org/en/stable/library_reference.html#cocotb.types.Range.right)

* [RisingEdge (class in cocotb.triggers)](https://docs.cocotb.org/en/stable/triggers.html#cocotb.triggers.RisingEdge)

* [Riviera (class in cocotb.runner)](https://docs.cocotb.org/en/stable/library_reference.html#cocotb.runner.Riviera)

* [**RTL**](https://docs.cocotb.org/en/stable/glossary.html#term-RTL)

* RUN\_ARGS
* [Make Variable](https://docs.cocotb.org/en/stable/building.html#var-RUN_ARGS)

* [run\_in\_executor() (cocotb.scheduler.Scheduler method)](https://docs.cocotb.org/en/stable/library_reference.html#cocotb.scheduler.Scheduler.run_in_executor)

* [run\_ipython() (in module cocotb.ipython\_support)](https://docs.cocotb.org/en/stable/troubleshooting.html#cocotb.ipython_support.run_ipython) | S - | | | | --- | --- | | * [sample() (cocotb.wavedrom.Wavedrom method)](https://docs.cocotb.org/en/stable/library_reference.html#cocotb.wavedrom.Wavedrom.sample)

* [schedule() (cocotb.scheduler.Scheduler method)](https://docs.cocotb.org/en/stable/library_reference.html#cocotb.scheduler.Scheduler.schedule)

* [Scheduler (class in cocotb.scheduler)](https://docs.cocotb.org/en/stable/library_reference.html#cocotb.scheduler.Scheduler)

* [scheduler (in module cocotb)](https://docs.cocotb.org/en/stable/library_reference.html#cocotb.scheduler)

* [send() (cocotb.task.Task method)](https://docs.cocotb.org/en/stable/library_reference.html#cocotb.task.Task.send)

* [set() (cocotb.triggers.Event method)](https://docs.cocotb.org/en/stable/triggers.html#cocotb.triggers.Event.set)

* [set\_signal\_val\_binstr() (cocotb.simulator.gpi\_sim\_hdl method)](https://docs.cocotb.org/en/stable/library_reference.html#cocotb.simulator.gpi_sim_hdl.set_signal_val_binstr)

* [set\_signal\_val\_int() (cocotb.simulator.gpi\_sim\_hdl method)](https://docs.cocotb.org/en/stable/library_reference.html#cocotb.simulator.gpi_sim_hdl.set_signal_val_int)

* [set\_signal\_val\_real() (cocotb.simulator.gpi\_sim\_hdl method)](https://docs.cocotb.org/en/stable/library_reference.html#cocotb.simulator.gpi_sim_hdl.set_signal_val_real)

* [set\_signal\_val\_str() (cocotb.simulator.gpi\_sim\_hdl method)](https://docs.cocotb.org/en/stable/library_reference.html#cocotb.simulator.gpi_sim_hdl.set_signal_val_str)

* [setimmediatevalue() (cocotb.handle.NonHierarchyObject method)](https://docs.cocotb.org/en/stable/library_reference.html#cocotb.handle.NonHierarchyObject.setimmediatevalue)

* [shlex\_join() (in module cocotb.runner)](https://docs.cocotb.org/en/stable/library_reference.html#cocotb.runner.shlex_join)

* [signed\_integer (cocotb.binary.BinaryValue property)](https://docs.cocotb.org/en/stable/library_reference.html#cocotb.binary.BinaryValue.signed_integer)

* [SIGNED\_MAGNITUDE (cocotb.binary.BinaryRepresentation attribute)](https://docs.cocotb.org/en/stable/library_reference.html#cocotb.binary.BinaryRepresentation.SIGNED_MAGNITUDE)

* SIM
* [Make Variable](https://docs.cocotb.org/en/stable/building.html#var-SIM)

* SIM\_ARGS
* [Make Variable](https://docs.cocotb.org/en/stable/building.html#var-SIM_ARGS)

* SIM\_BUILD
* [Make Variable](https://docs.cocotb.org/en/stable/building.html#var-SIM_BUILD) | * SIM\_CMD\_PREFIX
* [Make Variable](https://docs.cocotb.org/en/stable/building.html#var-SIM_CMD_PREFIX)

* SIM\_CMD\_SUFFIX
* [Make Variable](https://docs.cocotb.org/en/stable/building.html#var-SIM_CMD_SUFFIX)

* [SIM\_NAME (in module cocotb)](https://docs.cocotb.org/en/stable/library_reference.html#cocotb.SIM_NAME)

* [SIM\_VERSION (in module cocotb)](https://docs.cocotb.org/en/stable/library_reference.html#cocotb.SIM_VERSION)

* [SimColourLogFormatter (class in cocotb.log)](https://docs.cocotb.org/en/stable/library_reference.html#cocotb.log.SimColourLogFormatter)

* [SimFailure](https://docs.cocotb.org/en/stable/library_reference.html#cocotb.result.SimFailure)

* [SimHandle() (in module cocotb.handle)](https://docs.cocotb.org/en/stable/library_reference.html#cocotb.handle.SimHandle)

* [SimHandleBase (class in cocotb.handle)](https://docs.cocotb.org/en/stable/library_reference.html#cocotb.handle.SimHandleBase)

* [SimLogFormatter (class in cocotb.log)](https://docs.cocotb.org/en/stable/library_reference.html#cocotb.log.SimLogFormatter)

* [SimTimeContextFilter (class in cocotb.log)](https://docs.cocotb.org/en/stable/library_reference.html#cocotb.log.SimTimeContextFilter)

* [SimTimeoutError](https://docs.cocotb.org/en/stable/library_reference.html#cocotb.result.SimTimeoutError)

* [Simulator (class in cocotb.runner)](https://docs.cocotb.org/en/stable/library_reference.html#cocotb.runner.Simulator)

* [start() (cocotb.clock.Clock method)](https://docs.cocotb.org/en/stable/library_reference.html#cocotb.clock.Clock.start)
* [(in module cocotb)](https://docs.cocotb.org/en/stable/library_reference.html#cocotb.start)

* [start\_soon() (cocotb.scheduler.Scheduler method)](https://docs.cocotb.org/en/stable/library_reference.html#cocotb.scheduler.Scheduler.start_soon)
* [(in module cocotb)](https://docs.cocotb.org/en/stable/library_reference.html#cocotb.start_soon)

* [stop\_simulator() (in module cocotb.simulator)](https://docs.cocotb.org/en/stable/library_reference.html#cocotb.simulator.stop_simulator)

* [StringObject (class in cocotb.handle)](https://docs.cocotb.org/en/stable/library_reference.html#cocotb.handle.StringObject) | T - | | | | --- | --- | | * [**task**](https://docs.cocotb.org/en/stable/glossary.html#term-task)

* [Task (class in cocotb.task)](https://docs.cocotb.org/en/stable/library_reference.html#cocotb.task.Task)

* [test (class in cocotb)](https://docs.cocotb.org/en/stable/library_reference.html#cocotb.test)

* [test() (cocotb.runner.Simulator method)](https://docs.cocotb.org/en/stable/library_reference.html#cocotb.runner.Simulator.test)

* [TESTCASE](https://docs.cocotb.org/en/stable/library_reference.html#index-6)
, [\[1\]](https://docs.cocotb.org/en/stable/release_notes.html#index-16)

* [TestComplete](https://docs.cocotb.org/en/stable/library_reference.html#cocotb.result.TestComplete)

* [TestError](https://docs.cocotb.org/en/stable/library_reference.html#cocotb.result.TestError)

* [TestFactory (class in cocotb.regression)](https://docs.cocotb.org/en/stable/library_reference.html#cocotb.regression.TestFactory)

* [TestFailure](https://docs.cocotb.org/en/stable/library_reference.html#cocotb.result.TestFailure)

* [TestSuccess](https://docs.cocotb.org/en/stable/library_reference.html#cocotb.result.TestSuccess)

* [throw() (cocotb.task.Task method)](https://docs.cocotb.org/en/stable/library_reference.html#cocotb.task.Task.throw) | * [Timer (class in cocotb.triggers)](https://docs.cocotb.org/en/stable/triggers.html#cocotb.triggers.Timer)

* [to\_range() (cocotb.types.Range method)](https://docs.cocotb.org/en/stable/library_reference.html#cocotb.types.Range.to_range)

* [top (in module cocotb)](https://docs.cocotb.org/en/stable/library_reference.html#cocotb.top)

* [TOPLEVEL](https://docs.cocotb.org/en/stable/building.html#index-6)
, [\[1\]](https://docs.cocotb.org/en/stable/library_reference.html#index-4)
, [\[2\]](https://docs.cocotb.org/en/stable/quickstart.html#index-0)
, [\[3\]](https://docs.cocotb.org/en/stable/release_notes.html#index-11)
, [\[4\]](https://docs.cocotb.org/en/stable/release_notes.html#index-15)

* TOPLEVEL\_LANG
* [Make Variable](https://docs.cocotb.org/en/stable/building.html#var-TOPLEVEL_LANG)

* [TOPLEVEL\_LIBRARY](https://docs.cocotb.org/en/stable/release_notes.html#index-0)
, [\[1\]](https://docs.cocotb.org/en/stable/release_notes.html#index-1)
* [Make Variable](https://docs.cocotb.org/en/stable/building.html#var-TOPLEVEL_LIBRARY)

* [trace (class in cocotb.wavedrom)](https://docs.cocotb.org/en/stable/library_reference.html#cocotb.wavedrom.trace)

* [Trigger (class in cocotb.triggers)](https://docs.cocotb.org/en/stable/library_reference.html#cocotb.triggers.Trigger)

* [TWOS\_COMPLEMENT (cocotb.binary.BinaryRepresentation attribute)](https://docs.cocotb.org/en/stable/library_reference.html#cocotb.binary.BinaryRepresentation.TWOS_COMPLEMENT) | U - | | | | --- | --- | | * [UnknownFileExtension](https://docs.cocotb.org/en/stable/library_reference.html#cocotb.runner.UnknownFileExtension)

* [unpack() (in module cocotb.utils)](https://docs.cocotb.org/en/stable/library_reference.html#cocotb.utils.unpack)

* [unprime() (cocotb.triggers.GPITrigger method)](https://docs.cocotb.org/en/stable/library_reference.html#cocotb.triggers.GPITrigger.unprime)
* [(cocotb.triggers.Trigger method)](https://docs.cocotb.org/en/stable/library_reference.html#cocotb.triggers.Trigger.unprime) | * [unschedule() (cocotb.scheduler.Scheduler method)](https://docs.cocotb.org/en/stable/library_reference.html#cocotb.scheduler.Scheduler.unschedule)

* [UNSIGNED (cocotb.binary.BinaryRepresentation attribute)](https://docs.cocotb.org/en/stable/library_reference.html#cocotb.binary.BinaryRepresentation.UNSIGNED)

* [**UVM**](https://docs.cocotb.org/en/stable/glossary.html#term-UVM) | V - | | | | --- | --- | | * [value (cocotb.binary.BinaryValue property)](https://docs.cocotb.org/en/stable/library_reference.html#cocotb.binary.BinaryValue.value)
* [(cocotb.handle.ConstantObject property)](https://docs.cocotb.org/en/stable/library_reference.html#cocotb.handle.ConstantObject.value)

* [(cocotb.handle.EnumObject property)](https://docs.cocotb.org/en/stable/library_reference.html#cocotb.handle.EnumObject.value)

* [(cocotb.handle.IntegerObject property)](https://docs.cocotb.org/en/stable/library_reference.html#cocotb.handle.IntegerObject.value)

* [(cocotb.handle.ModifiableObject property)](https://docs.cocotb.org/en/stable/library_reference.html#cocotb.handle.ModifiableObject.value)

* [(cocotb.handle.NonHierarchyIndexableObject property)](https://docs.cocotb.org/en/stable/library_reference.html#cocotb.handle.NonHierarchyIndexableObject.value)

* [(cocotb.handle.NonHierarchyObject property)](https://docs.cocotb.org/en/stable/library_reference.html#cocotb.handle.NonHierarchyObject.value)

* [(cocotb.handle.RealObject property)](https://docs.cocotb.org/en/stable/library_reference.html#cocotb.handle.RealObject.value)

* [(cocotb.handle.StringObject property)](https://docs.cocotb.org/en/stable/library_reference.html#cocotb.handle.StringObject.value)

* [Verilator (class in cocotb.runner)](https://docs.cocotb.org/en/stable/library_reference.html#cocotb.runner.Verilator)

* [Verilog (class in cocotb.runner)](https://docs.cocotb.org/en/stable/library_reference.html#cocotb.runner.Verilog)

* [VERILOG\_INCLUDE\_DIRS](https://docs.cocotb.org/en/stable/release_notes.html#index-4)
* [Make Variable](https://docs.cocotb.org/en/stable/building.html#var-VERILOG_INCLUDE_DIRS) | * VERILOG\_SOURCES
* [Make Variable](https://docs.cocotb.org/en/stable/building.html#var-VERILOG_SOURCES)

* [VHDL (class in cocotb.runner)](https://docs.cocotb.org/en/stable/library_reference.html#cocotb.runner.VHDL)

* [VHDL\_GPI\_INTERFACE](https://docs.cocotb.org/en/stable/release_notes.html#index-5)
, [\[1\]](https://docs.cocotb.org/en/stable/simulator_support.html#index-1)
* [Make Variable](https://docs.cocotb.org/en/stable/building.html#var-VHDL_GPI_INTERFACE)

* VHDL\_LIB\_ORDER
* [Make Variable](https://docs.cocotb.org/en/stable/building.html#var-VHDL_LIB_ORDER)

* VHDL\_SOURCES
* [Make Variable](https://docs.cocotb.org/en/stable/building.html#var-VHDL_SOURCES)

* VHDL\_SOURCES\_
* [Make Variable](https://docs.cocotb.org/en/stable/building.html#var-VHDL_SOURCES_%3Clib%3E)

* [**VHPI**](https://docs.cocotb.org/en/stable/glossary.html#term-VHPI)

* [**VIP**](https://docs.cocotb.org/en/stable/glossary.html#term-VIP)

* [**VPI**](https://docs.cocotb.org/en/stable/glossary.html#term-VPI) | W - | | | | --- | --- | | * [wait() (cocotb.triggers.Event method)](https://docs.cocotb.org/en/stable/triggers.html#cocotb.triggers.Event.wait)

* [Waitable (class in cocotb.triggers)](https://docs.cocotb.org/en/stable/library_reference.html#cocotb.triggers.Waitable)

* [walk\_coro\_stack() (in module cocotb.utils)](https://docs.cocotb.org/en/stable/library_reference.html#cocotb.utils.walk_coro_stack)

* [want\_color\_output() (in module cocotb.utils)](https://docs.cocotb.org/en/stable/library_reference.html#cocotb.utils.want_color_output) | * [Wavedrom (class in cocotb.wavedrom)](https://docs.cocotb.org/en/stable/library_reference.html#cocotb.wavedrom.Wavedrom)

* [WAVES](https://docs.cocotb.org/en/stable/release_notes.html#index-2)
* [Make Variable](https://docs.cocotb.org/en/stable/building.html#var-WAVES)

* [with\_timeout() (in module cocotb.triggers)](https://docs.cocotb.org/en/stable/triggers.html#cocotb.triggers.with_timeout) | X - * [Xcelium (class in cocotb.runner)](https://docs.cocotb.org/en/stable/library_reference.html#cocotb.runner.Xcelium) --- # Contributors — cocotb 1.9.2 documentation * [](https://docs.cocotb.org/en/stable/index.html) * Contributors * [View page source](https://docs.cocotb.org/en/stable/_sources/contributors.rst.txt) * * * Contributors[](https://docs.cocotb.org/en/stable/contributors.html#contributors "Link to this heading") ========================================================================================================= cocotb is developed and maintained by an active community. Our GitHub repository contains a list of the [Maintainers](https://github.com/cocotb/cocotb/blob/master/CONTRIBUTING.md#maintainers) and all [contributors](https://github.com/cocotb/cocotb/graphs/contributors) . Since mid-2018 cocotb is an independent project under the umbrella of the [Free and Open Source Silicon Foundation](https://www.fossi-foundation.org/) . The FOSSi Foundation provides the cocotb project with financial, legal and administrative support, and holds cocotb assets. cocotb was originally developed by Stuart Hodgson and Chris Higgs of Potential Ventures with the support of Solarflare Communications Ltd. and contributions from Gordon McGregor and Finn Grimwood. --- # Roadmap — cocotb 1.9.2 documentation * [](https://docs.cocotb.org/en/stable/index.html) * Roadmap * [View page source](https://docs.cocotb.org/en/stable/_sources/roadmap.rst.txt) * * * Roadmap[](https://docs.cocotb.org/en/stable/roadmap.html#roadmap "Link to this heading") ========================================================================================== cocotb is under development; however there is no “master plan”. We depend upon users to contribute new features and improvements while maintainers focus mostly on reviewing PRs, project management, and bugfixes. Releases will occur approximately every 6 months. We use GitHub issues to track our pending tasks. Take a look at the [open feature list](https://github.com/cocotb/cocotb/issues?q=is%3Aissue+is%3Aopen+label%3Atype%3Afeature) to see the work that’s lined up, or the [list of good first issues](https://github.com/cocotb/cocotb/issues?q=is%3Aissue+is%3Aopen+label%3A%22good+first+issue%22) to get your feet wet. If you have a GitHub account you can also [raise an enhancement request](https://github.com/cocotb/cocotb/issues/new) to suggest new features. You may be interested in discussions about [planned deprecations](https://github.com/cocotb/cocotb/issues?q=is%3Aopen+label%3Atype%3Adeprecation) or review the [list of already applied deprecations](https://github.com/cocotb/cocotb/issues?q=is%3Aclosed+label%3Atype%3Adeprecation) . --- # Writing cocotb extensions — cocotb 1.9.2 documentation * [](https://docs.cocotb.org/en/stable/index.html) * Writing cocotb extensions * [View page source](https://docs.cocotb.org/en/stable/_sources/extensions.rst.txt) * * * Writing cocotb extensions[](https://docs.cocotb.org/en/stable/extensions.html#writing-cocotb-extensions "Link to this heading") ================================================================================================================================= This guide explains how to write cocotb extensions, with a focus on the conventions that should be followed. Cocotb gives its users a framework to build Python testbenches for hardware designs. But sometimes the functionality provided by cocotb is too low-level. One common example are bus drivers and monitors: instead of creating a bus adapter from scratch for each new project, wouldn’t it be nice to share this component, and build on top it? In the verification world, such extensions are often called “verification IP” (VIP). In cocotb, such functionality can be packaged and distributed as extensions. Technically, cocotb extensions are normal Python packages, and all standard Python packaging and distribution techniques can be used. Additionally, the cocotb community has agreed on a set of conventions to make extensions easier to use and to discover. Naming conventions[](https://docs.cocotb.org/en/stable/extensions.html#naming-conventions "Link to this heading") ------------------------------------------------------------------------------------------------------------------- Cocotb extensions are normal Python modules which follow these naming conventions. Assuming an extension named `EXTNAME` (all lower-case), * the package is in the `cocotbext.EXTNAME` namespace, and * the distribution (package) name is prefixed with `cocotbext-EXTNAME`. Example: An SPI bus extension might be packaged as `cocotbext-spi`, and its functionality would live in the `cocotbext.spi` namespace. The module can then be installed with `pip3 install cocotbext-spi`, and used with `import cocotbext.spi`. Types of cocotb extensions[](https://docs.cocotb.org/en/stable/extensions.html#types-of-cocotb-extensions "Link to this heading") ----------------------------------------------------------------------------------------------------------------------------------- For some types of cocotb extensions we have developed conventions which go beyond naming. These conventions help to achieve a consistent behavior across extensions of the same type. ### Bus extensions[](https://docs.cocotb.org/en/stable/extensions.html#bus-extensions "Link to this heading") A cocotb extension which interacts with a bus or an interface (such as SPI or AXI) should build on top of a common set of classes to provide a uniform interface for its users. Typically, a bus extension provides three pieces of functionality: an abstraction of the bus itself, a bus driver, and a bus monitor. A bus driver is the “active” part, it drives the signals that make up the bus to request reads or writes from the bus. A bus monitor is the “passive” part, it observes signal changes on the bus and assigns meaning to them. Monitors can also check the bus behavior against a standard to ensure no invalid states are being observed. The signals which make up the bus should be grouped in a class inheriting from `cocotb_bus.bus.Bus`. Bus drivers should inherit from the `cocotb_bus.drivers.BusDriver` class. Bus monitors should inherit from the `cocotb_bus.monitors.BusMonitor` class. Packaging extensions[](https://docs.cocotb.org/en/stable/extensions.html#packaging-extensions "Link to this heading") ----------------------------------------------------------------------------------------------------------------------- To package a cocotb extension as Python package follow the [Naming conventions](https://docs.cocotb.org/en/stable/extensions.html#extensions-naming-conventions) , and the [normal Python packaging rules](https://packaging.python.org/tutorials/packaging-projects/) . Extensions namespaced packages, implemented using the [native namespacing](https://packaging.python.org/guides/packaging-namespace-packages/#native-namespace-packages) approach discussed in [**PEP 420**](https://peps.python.org/pep-0420/) . The module file hierarchy should be as follows (replace `EXTNAME` with the name of the extension, e.g. `spi`). \# file structure of the cocotbext-EXTNAME repository ├── cocotbext/ │ │ # No \_\_init\_\_.py here. │   └── EXTNAME/ │   └── \_\_init\_\_.py ├── README.md └── setup.py The Python source code should go into the `EXTNAME` directory, next to the `__init__.py` file. All packaging metadata goes into `setup.py`. \# Minimal setup.py. Extend as needed. from setuptools import setup, find\_namespace\_packages setup(name \= 'cocotbext-EXTNAME', version \= '0.1', packages \= find\_namespace\_packages(include\=\['cocotbext.\*'\]), install\_requires \= \['cocotb'\], python\_requires \= '>=3.6', classifiers \= \[\ "Programming Language :: Python :: 3",\ "Operating System :: OS Independent",\ "Topic :: Scientific/Engineering :: Electronic Design Automation (EDA)",\ "Framework :: cocotb"\]) With this file structure in place the cocotb extension can be installed through `pip` in development mode $ python3 -m pip install -e . Once the extension has been [uploaded to PyPi](https://packaging.python.org/tutorials/packaging-projects/#uploading-the-distribution-archives) , it can be installed by name. To use the functionality in the extension module, import it into your testbench. \# Examples for importing (parts of) the extension import cocotbext.EXTNAME from cocotbext import EXTNAME from cocotbext.EXTNAME import MyVerificationClass Code hosting[](https://docs.cocotb.org/en/stable/extensions.html#code-hosting "Link to this heading") ------------------------------------------------------------------------------------------------------- The source code of cocotb extensions can be hosted anywhere. If authors wish to do so, extensions can also be hosted on GitHub in the [cocotb GitHub organization](https://github.com/cocotb) (e.g. `github.com/cocotb/cocotbext-EXTNAME`). Please file a [GitHub issue in the cocotb repository](https://github.com/cocotb/cocotb/issues) if you’d like to discuss that. Note that hosting extensions within the cocotb organization is decided on a case-by-case basis by the cocotb maintainers. At least, a cocotb-hosted extension needs to fulfill the following requirements: * It needs tests that can be run in order to see that the extension works and continues to work as cocotb itself changes, especially when a new release is upcoming. * It needs documentation (preferably in Sphinx) so that users know how to use the extension. * We must have access to the PyPi project so that we can continue to upload new releases in case the extension maintainer (“Owner”) becomes unresponsive. --- # Further Resources — cocotb 1.9.2 documentation * [](https://docs.cocotb.org/en/stable/index.html) * Further Resources * [View page source](https://docs.cocotb.org/en/stable/_sources/further_resources.rst.txt) * * * Further Resources[](https://docs.cocotb.org/en/stable/further_resources.html#further-resources "Link to this heading") ======================================================================================================================== We have a list of talks and papers, libraries and examples at our Wiki page [Further Resources](https://github.com/cocotb/cocotb/wiki/Further-Resources) . Feel free to add links to cocotb-related content that we are still missing! --- # Reference Card — cocotb 1.9.2 documentation * [](https://docs.cocotb.org/en/stable/index.html) * Reference Card * [View page source](https://docs.cocotb.org/en/stable/_sources/refcard.rst.txt) * * * Reference Card[](https://docs.cocotb.org/en/stable/refcard.html#reference-card "Link to this heading") ======================================================================================================== _coro_: a coroutine; _task_: a running coroutine | | | | --- | --- | | Assign | `dut.mysignal.value = 0xFF00` | | Assign immediately | `dut.mysignal.setimmediatevalue(0xFF00)` | | Assign metavalue | `dut.mysignal.value = Logic("X")`

`dut.mysignal.value = LogicArray("01XZ")`

`dut.mysignal.value = BinaryValue("X")` (deprecated) | | Read | `val = dut.mysignal.value`

(`mysig = dut.mysignal` _creates an alias/reference_) | | Bit slice | `mybit = dut.myarray[0].value`

`mybits = dut.mysignal.value[0]` | | Convert | `val = dut.mysignal.value.integer`

`val = dut.mysignal.value.binstr` | | Vector length | `num_bits = len(dut.mysignal)` | | Check | `assert dut.mysignal.value == exp, "Not as expected!"` | | Logging | `dut._log.info("Value is", dut.mysignal.value)` | | | | | Wait time | `await cocotb.triggers.Timer(12, "ns")` | | Generate clock | `clk = await cocotb.start(Clock(dut.clk, 12, "ns").start())` | | Wait for signal edge | `await cocotb.triggers.RisingEdge(dut.mysignal)`

`await cocotb.triggers.FallingEdge(dut.mysignal)`

`await cocotb.triggers.Edge(dut.mysignal)` | | Run coros concurrently | `task_0 = await cocotb.start(coro_0())` (start coro now)

`task_1 = cocotb.start_soon(coro)`

`result = await task_0` | | Resume on Task 0 or 1 | `await cocotb.triggers.First(task_0, task_1)` | | Resume on Task 0 and 1 | `await cocotb.triggers.Combine(task_0, task_1)` | | Kill coro | `task_0.kill()` | | | | | Queue write | `await cocotb.queue.Queue.put(item)`

`cocotb.queue.Queue.put_nowait(item)` | | Queue read | `item = await cocotb.queue.Queue.get()`

`item = cocotb.queue.Queue.get_nowait()` | | Queue attributes | `queue.maxsize` (`None` _\== unlimited_)

`queue.qsize()`

`queue.empty()`

`queue.full()` | | Specialized queues | `.PriorityQueue`, `.LifoQueue` | | | | | Set up event | `e = cocotb.triggers.Event()` | | Wake up waiters | `e.set()` | | Wait until `set()` | `await e.wait()` | | Reset after `set()` | `e.clear()` | | Timeout | `await cocotb.triggers.with_timeout(coro, 1, "us")` | | | | | Force value | `dut.mysignal.value = cocotb.handle.Force(0xFF00)` | | Keep value | `dut.mysignal.value = cocotb.handle.Freeze()` | | Release Force/Freeze | `dut.mysignal.value = cocotb.handle.Release()` | | _Normal assignment is a “deposit”_ (`cocotb.handle.Deposit()`) | | | | | | Mark as test | `@cocotb.test(skip, expect_fail, timeout_time, timeout_unit)` | | Normal func → coro | `@cocotb.external()` | | Allow func to block | `@cocotb.function()` | | | | | Set up TestFactory | `tf = cocotb.regression.TestFactory(coro)` | | Add test option | `tf.add_option("arg", ["val0", "val1"])` | | Generate tests | `tf.generate_tests()` | --- # Glossary — cocotb 1.9.2 documentation * [](https://docs.cocotb.org/en/stable/index.html) * Glossary * [View page source](https://docs.cocotb.org/en/stable/_sources/glossary.rst.txt) * * * Glossary[](https://docs.cocotb.org/en/stable/glossary.html#glossary "Link to this heading") ============================================================================================= BFM[](https://docs.cocotb.org/en/stable/glossary.html#term-BFM "Link to this term") Bus Functional Model coroutine function[](https://docs.cocotb.org/en/stable/glossary.html#term-coroutine-function "Link to this term") The definition of a function that, when called, returns a coroutine object. Implemented using [`async`](https://docs.python.org/3/reference/compound_stmts.html#async "(in Python v3.13)") functions. See also the [Python glossary](https://docs.python.org/3/glossary.html#term-coroutine-function "(in Python v3.13)") . coroutine[](https://docs.cocotb.org/en/stable/glossary.html#term-coroutine "Link to this term") The result of calling a [coroutine function](https://docs.cocotb.org/en/stable/glossary.html#term-coroutine-function) . Coroutines are not run immediately, you must either [`await`](https://docs.python.org/3/reference/expressions.html#await "(in Python v3.13)") on them which blocks the awaiting coroutine until it is finished; or fork the coroutine, turning it into a [task](https://docs.cocotb.org/en/stable/glossary.html#term-task) , which runs concurrently. See also the [Python glossary](https://docs.python.org/3/glossary.html#term-coroutine "(in Python v3.13)") . DUT[](https://docs.cocotb.org/en/stable/glossary.html#term-DUT "Link to this term") Design under Test DUV[](https://docs.cocotb.org/en/stable/glossary.html#term-DUV "Link to this term") Design under Verification FLI[](https://docs.cocotb.org/en/stable/glossary.html#term-FLI "Link to this term") Foreign Language Interface. Mentor Graphics’ equivalent to [VHPI](https://docs.cocotb.org/en/stable/glossary.html#term-VHPI) GPI[](https://docs.cocotb.org/en/stable/glossary.html#term-GPI "Link to this term") Generic Procedural Interface, cocotb’s abstraction over [VPI](https://docs.cocotb.org/en/stable/glossary.html#term-VPI) , [VHPI](https://docs.cocotb.org/en/stable/glossary.html#term-VHPI) , and [FLI](https://docs.cocotb.org/en/stable/glossary.html#term-FLI) . HAL[](https://docs.cocotb.org/en/stable/glossary.html#term-HAL "Link to this term") Hardware Abstraction Layer HDL[](https://docs.cocotb.org/en/stable/glossary.html#term-HDL "Link to this term") Hardware Description Language MDV[](https://docs.cocotb.org/en/stable/glossary.html#term-MDV "Link to this term") Metric-driven Verification RTL[](https://docs.cocotb.org/en/stable/glossary.html#term-RTL "Link to this term") Register Transfer Level task[](https://docs.cocotb.org/en/stable/glossary.html#term-task "Link to this term") The result of forking a [coroutine](https://docs.cocotb.org/en/stable/glossary.html#term-coroutine) . A task represents a concurrently running coroutine. UVM[](https://docs.cocotb.org/en/stable/glossary.html#term-UVM "Link to this term") Universal Verification Methodology VHPI[](https://docs.cocotb.org/en/stable/glossary.html#term-VHPI "Link to this term") The VHDL Procedural Interface, an application-programming interface to VHDL tools. VIP[](https://docs.cocotb.org/en/stable/glossary.html#term-VIP "Link to this term") Verification IP VPI[](https://docs.cocotb.org/en/stable/glossary.html#term-VPI "Link to this term") The Verilog Procedural Interface, an application-programming interface to (System)Verilog tools. Its original name was “PLI 2.0”. --- # GPI Library Reference — cocotb 1.9.2 documentation * [](https://docs.cocotb.org/en/stable/index.html) * GPI Library Reference * [View page source](https://docs.cocotb.org/en/stable/_sources/library_reference_c.rst.txt) * * * GPI Library Reference[](https://docs.cocotb.org/en/stable/library_reference_c.html#gpi-library-reference "Link to this heading") ================================================================================================================================== Cocotb contains a library called `GPI` (in directory `cocotb/share/lib/gpi/`) written in C++ that is an abstraction layer for the VPI, VHPI, and FLI simulator interfaces. ![_images/cocotb_overview.svg](https://docs.cocotb.org/en/stable/_images/cocotb_overview.svg) The interaction between Python and GPI is via a Python extension module called `simulator` (in directory `cocotb/share/lib/simulator/`) which provides routines for traversing the hierarchy, getting/setting an object’s value, registering callbacks etc. Defines GPI\_EXPORT COCOTB\_IMPORT[](https://docs.cocotb.org/en/stable/library_reference_c.html#c.GPI_EXPORT "Link to this definition") Typedefs typedef struct GpiObjHdl \*gpi\_sim\_hdl[](https://docs.cocotb.org/en/stable/library_reference_c.html#_CPPv411gpi_sim_hdl "Link to this definition") typedef struct GpiCbHdl \*gpi\_cb\_hdl[](https://docs.cocotb.org/en/stable/library_reference_c.html#_CPPv410gpi_cb_hdl "Link to this definition") typedef struct GpiIterator \*gpi\_iterator\_hdl[](https://docs.cocotb.org/en/stable/library_reference_c.html#_CPPv416gpi_iterator_hdl "Link to this definition") typedef enum [gpi\_objtype\_e](https://docs.cocotb.org/en/stable/library_reference_c.html#_CPPv413gpi_objtype_e "gpi_objtype_e") gpi\_objtype\_t[](https://docs.cocotb.org/en/stable/library_reference_c.html#_CPPv413gpi_objtype_t "Link to this definition") typedef enum [gpi\_iterator\_sel\_e](https://docs.cocotb.org/en/stable/library_reference_c.html#_CPPv418gpi_iterator_sel_e "gpi_iterator_sel_e") gpi\_iterator\_sel\_t[](https://docs.cocotb.org/en/stable/library_reference_c.html#_CPPv418gpi_iterator_sel_t "Link to this definition") typedef enum [gpi\_set\_action\_e](https://docs.cocotb.org/en/stable/library_reference_c.html#_CPPv416gpi_set_action_e "gpi_set_action_e") gpi\_set\_action\_t[](https://docs.cocotb.org/en/stable/library_reference_c.html#_CPPv416gpi_set_action_t "Link to this definition") typedef enum [gpi\_edge](https://docs.cocotb.org/en/stable/library_reference_c.html#_CPPv48gpi_edge "gpi_edge") gpi\_edge\_e[](https://docs.cocotb.org/en/stable/library_reference_c.html#_CPPv410gpi_edge_e "Link to this definition") Enums enum gpi\_objtype\_e[](https://docs.cocotb.org/en/stable/library_reference_c.html#_CPPv413gpi_objtype_e "Link to this definition") _Values:_ enumerator GPI\_UNKNOWN[](https://docs.cocotb.org/en/stable/library_reference_c.html#_CPPv4N13gpi_objtype_e11GPI_UNKNOWNE "Link to this definition") enumerator GPI\_MEMORY[](https://docs.cocotb.org/en/stable/library_reference_c.html#_CPPv4N13gpi_objtype_e10GPI_MEMORYE "Link to this definition") enumerator GPI\_MODULE[](https://docs.cocotb.org/en/stable/library_reference_c.html#_CPPv4N13gpi_objtype_e10GPI_MODULEE "Link to this definition") enumerator GPI\_NET[](https://docs.cocotb.org/en/stable/library_reference_c.html#_CPPv4N13gpi_objtype_e7GPI_NETE "Link to this definition") enumerator GPI\_REGISTER[](https://docs.cocotb.org/en/stable/library_reference_c.html#_CPPv4N13gpi_objtype_e12GPI_REGISTERE "Link to this definition") enumerator GPI\_ARRAY[](https://docs.cocotb.org/en/stable/library_reference_c.html#_CPPv4N13gpi_objtype_e9GPI_ARRAYE "Link to this definition") enumerator GPI\_ENUM[](https://docs.cocotb.org/en/stable/library_reference_c.html#_CPPv4N13gpi_objtype_e8GPI_ENUME "Link to this definition") enumerator GPI\_STRUCTURE[](https://docs.cocotb.org/en/stable/library_reference_c.html#_CPPv4N13gpi_objtype_e13GPI_STRUCTUREE "Link to this definition") enumerator GPI\_REAL[](https://docs.cocotb.org/en/stable/library_reference_c.html#_CPPv4N13gpi_objtype_e8GPI_REALE "Link to this definition") enumerator GPI\_INTEGER[](https://docs.cocotb.org/en/stable/library_reference_c.html#_CPPv4N13gpi_objtype_e11GPI_INTEGERE "Link to this definition") enumerator GPI\_STRING[](https://docs.cocotb.org/en/stable/library_reference_c.html#_CPPv4N13gpi_objtype_e10GPI_STRINGE "Link to this definition") enumerator GPI\_GENARRAY[](https://docs.cocotb.org/en/stable/library_reference_c.html#_CPPv4N13gpi_objtype_e12GPI_GENARRAYE "Link to this definition") enum gpi\_iterator\_sel\_e[](https://docs.cocotb.org/en/stable/library_reference_c.html#_CPPv418gpi_iterator_sel_e "Link to this definition") _Values:_ enumerator GPI\_OBJECTS[](https://docs.cocotb.org/en/stable/library_reference_c.html#_CPPv4N18gpi_iterator_sel_e11GPI_OBJECTSE "Link to this definition") enumerator GPI\_DRIVERS[](https://docs.cocotb.org/en/stable/library_reference_c.html#_CPPv4N18gpi_iterator_sel_e11GPI_DRIVERSE "Link to this definition") enumerator GPI\_LOADS[](https://docs.cocotb.org/en/stable/library_reference_c.html#_CPPv4N18gpi_iterator_sel_e9GPI_LOADSE "Link to this definition") enum gpi\_set\_action\_e[](https://docs.cocotb.org/en/stable/library_reference_c.html#_CPPv416gpi_set_action_e "Link to this definition") _Values:_ enumerator GPI\_DEPOSIT[](https://docs.cocotb.org/en/stable/library_reference_c.html#_CPPv4N16gpi_set_action_e11GPI_DEPOSITE "Link to this definition") enumerator GPI\_FORCE[](https://docs.cocotb.org/en/stable/library_reference_c.html#_CPPv4N16gpi_set_action_e9GPI_FORCEE "Link to this definition") enumerator GPI\_RELEASE[](https://docs.cocotb.org/en/stable/library_reference_c.html#_CPPv4N16gpi_set_action_e11GPI_RELEASEE "Link to this definition") enum gpi\_edge[](https://docs.cocotb.org/en/stable/library_reference_c.html#_CPPv48gpi_edge "Link to this definition") _Values:_ enumerator GPI\_RISING[](https://docs.cocotb.org/en/stable/library_reference_c.html#_CPPv4N8gpi_edge10GPI_RISINGE "Link to this definition") enumerator GPI\_FALLING[](https://docs.cocotb.org/en/stable/library_reference_c.html#_CPPv4N8gpi_edge11GPI_FALLINGE "Link to this definition") Functions GPI\_EXPORT bool gpi\_has\_registered\_impl(void)[](https://docs.cocotb.org/en/stable/library_reference_c.html#_CPPv423gpi_has_registered_implv "Link to this definition") Returns 1 if there is a registered GPI implementation, 0 otherwise. Useful for checking if a simulator is running. GPI\_EXPORT void gpi\_sim\_end(void)[](https://docs.cocotb.org/en/stable/library_reference_c.html#_CPPv411gpi_sim_endv "Link to this definition") GPI\_EXPORT void gpi\_get\_sim\_time(uint32\_t \*high, uint32\_t \*low)[](https://docs.cocotb.org/en/stable/library_reference_c.html#_CPPv416gpi_get_sim_timeP8uint32_tP8uint32_t "Link to this definition") GPI\_EXPORT void gpi\_get\_sim\_precision(int32\_t \*precision)[](https://docs.cocotb.org/en/stable/library_reference_c.html#_CPPv421gpi_get_sim_precisionP7int32_t "Link to this definition") GPI\_EXPORT const char \*gpi\_get\_simulator\_product(void)[](https://docs.cocotb.org/en/stable/library_reference_c.html#_CPPv425gpi_get_simulator_productv "Link to this definition") Returns a string with the running simulator product information. Returns: simulator product string GPI\_EXPORT const char \*gpi\_get\_simulator\_version(void)[](https://docs.cocotb.org/en/stable/library_reference_c.html#_CPPv425gpi_get_simulator_versionv "Link to this definition") Returns a string with the running simulator version. Returns: simulator version string GPI\_EXPORT [gpi\_sim\_hdl](https://docs.cocotb.org/en/stable/library_reference_c.html#_CPPv411gpi_sim_hdl "gpi_sim_hdl") gpi\_get\_root\_handle(const char \*name)[](https://docs.cocotb.org/en/stable/library_reference_c.html#_CPPv419gpi_get_root_handlePKc "Link to this definition") GPI\_EXPORT [gpi\_sim\_hdl](https://docs.cocotb.org/en/stable/library_reference_c.html#_CPPv411gpi_sim_hdl "gpi_sim_hdl") gpi\_get\_handle\_by\_name([gpi\_sim\_hdl](https://docs.cocotb.org/en/stable/library_reference_c.html#_CPPv411gpi_sim_hdl "gpi_sim_hdl") parent, const char \*name)[](https://docs.cocotb.org/en/stable/library_reference_c.html#_CPPv422gpi_get_handle_by_name11gpi_sim_hdlPKc "Link to this definition") GPI\_EXPORT [gpi\_sim\_hdl](https://docs.cocotb.org/en/stable/library_reference_c.html#_CPPv411gpi_sim_hdl "gpi_sim_hdl") gpi\_get\_handle\_by\_index([gpi\_sim\_hdl](https://docs.cocotb.org/en/stable/library_reference_c.html#_CPPv411gpi_sim_hdl "gpi_sim_hdl") parent, int32\_t index)[](https://docs.cocotb.org/en/stable/library_reference_c.html#_CPPv423gpi_get_handle_by_index11gpi_sim_hdl7int32_t "Link to this definition") GPI\_EXPORT void gpi\_free\_handle([gpi\_sim\_hdl](https://docs.cocotb.org/en/stable/library_reference_c.html#_CPPv411gpi_sim_hdl "gpi_sim_hdl") gpi\_hdl)[](https://docs.cocotb.org/en/stable/library_reference_c.html#_CPPv415gpi_free_handle11gpi_sim_hdl "Link to this definition") GPI\_EXPORT [gpi\_iterator\_hdl](https://docs.cocotb.org/en/stable/library_reference_c.html#_CPPv416gpi_iterator_hdl "gpi_iterator_hdl") gpi\_iterate([gpi\_sim\_hdl](https://docs.cocotb.org/en/stable/library_reference_c.html#_CPPv411gpi_sim_hdl "gpi_sim_hdl") base, [gpi\_iterator\_sel\_t](https://docs.cocotb.org/en/stable/library_reference_c.html#_CPPv418gpi_iterator_sel_t "gpi_iterator_sel_t") type)[](https://docs.cocotb.org/en/stable/library_reference_c.html#_CPPv411gpi_iterate11gpi_sim_hdl18gpi_iterator_sel_t "Link to this definition") GPI\_EXPORT [gpi\_sim\_hdl](https://docs.cocotb.org/en/stable/library_reference_c.html#_CPPv411gpi_sim_hdl "gpi_sim_hdl") gpi\_next([gpi\_iterator\_hdl](https://docs.cocotb.org/en/stable/library_reference_c.html#_CPPv416gpi_iterator_hdl "gpi_iterator_hdl") iterator)[](https://docs.cocotb.org/en/stable/library_reference_c.html#_CPPv48gpi_next16gpi_iterator_hdl "Link to this definition") GPI\_EXPORT int gpi\_get\_num\_elems([gpi\_sim\_hdl](https://docs.cocotb.org/en/stable/library_reference_c.html#_CPPv417gpi_get_num_elems11gpi_sim_hdl "gpi_get_num_elems::gpi_sim_hdl") gpi\_sim\_hdl)[](https://docs.cocotb.org/en/stable/library_reference_c.html#_CPPv417gpi_get_num_elems11gpi_sim_hdl "Link to this definition") GPI\_EXPORT int gpi\_get\_range\_left([gpi\_sim\_hdl](https://docs.cocotb.org/en/stable/library_reference_c.html#_CPPv418gpi_get_range_left11gpi_sim_hdl "gpi_get_range_left::gpi_sim_hdl") gpi\_sim\_hdl)[](https://docs.cocotb.org/en/stable/library_reference_c.html#_CPPv418gpi_get_range_left11gpi_sim_hdl "Link to this definition") GPI\_EXPORT int gpi\_get\_range\_right([gpi\_sim\_hdl](https://docs.cocotb.org/en/stable/library_reference_c.html#_CPPv419gpi_get_range_right11gpi_sim_hdl "gpi_get_range_right::gpi_sim_hdl") gpi\_sim\_hdl)[](https://docs.cocotb.org/en/stable/library_reference_c.html#_CPPv419gpi_get_range_right11gpi_sim_hdl "Link to this definition") GPI\_EXPORT const char \*gpi\_get\_signal\_value\_binstr([gpi\_sim\_hdl](https://docs.cocotb.org/en/stable/library_reference_c.html#_CPPv411gpi_sim_hdl "gpi_sim_hdl") gpi\_hdl)[](https://docs.cocotb.org/en/stable/library_reference_c.html#_CPPv427gpi_get_signal_value_binstr11gpi_sim_hdl "Link to this definition") GPI\_EXPORT const char \*gpi\_get\_signal\_value\_str([gpi\_sim\_hdl](https://docs.cocotb.org/en/stable/library_reference_c.html#_CPPv411gpi_sim_hdl "gpi_sim_hdl") gpi\_hdl)[](https://docs.cocotb.org/en/stable/library_reference_c.html#_CPPv424gpi_get_signal_value_str11gpi_sim_hdl "Link to this definition") GPI\_EXPORT double gpi\_get\_signal\_value\_real([gpi\_sim\_hdl](https://docs.cocotb.org/en/stable/library_reference_c.html#_CPPv411gpi_sim_hdl "gpi_sim_hdl") gpi\_hdl)[](https://docs.cocotb.org/en/stable/library_reference_c.html#_CPPv425gpi_get_signal_value_real11gpi_sim_hdl "Link to this definition") GPI\_EXPORT long gpi\_get\_signal\_value\_long([gpi\_sim\_hdl](https://docs.cocotb.org/en/stable/library_reference_c.html#_CPPv411gpi_sim_hdl "gpi_sim_hdl") gpi\_hdl)[](https://docs.cocotb.org/en/stable/library_reference_c.html#_CPPv425gpi_get_signal_value_long11gpi_sim_hdl "Link to this definition") GPI\_EXPORT const char \*gpi\_get\_signal\_name\_str([gpi\_sim\_hdl](https://docs.cocotb.org/en/stable/library_reference_c.html#_CPPv411gpi_sim_hdl "gpi_sim_hdl") gpi\_hdl)[](https://docs.cocotb.org/en/stable/library_reference_c.html#_CPPv423gpi_get_signal_name_str11gpi_sim_hdl "Link to this definition") GPI\_EXPORT const char \*gpi\_get\_signal\_type\_str([gpi\_sim\_hdl](https://docs.cocotb.org/en/stable/library_reference_c.html#_CPPv411gpi_sim_hdl "gpi_sim_hdl") gpi\_hdl)[](https://docs.cocotb.org/en/stable/library_reference_c.html#_CPPv423gpi_get_signal_type_str11gpi_sim_hdl "Link to this definition") GPI\_EXPORT [gpi\_objtype\_t](https://docs.cocotb.org/en/stable/library_reference_c.html#_CPPv413gpi_objtype_t "gpi_objtype_t") gpi\_get\_object\_type([gpi\_sim\_hdl](https://docs.cocotb.org/en/stable/library_reference_c.html#_CPPv411gpi_sim_hdl "gpi_sim_hdl") gpi\_hdl)[](https://docs.cocotb.org/en/stable/library_reference_c.html#_CPPv419gpi_get_object_type11gpi_sim_hdl "Link to this definition") GPI\_EXPORT const char \*gpi\_get\_definition\_name([gpi\_sim\_hdl](https://docs.cocotb.org/en/stable/library_reference_c.html#_CPPv411gpi_sim_hdl "gpi_sim_hdl") gpi\_hdl)[](https://docs.cocotb.org/en/stable/library_reference_c.html#_CPPv423gpi_get_definition_name11gpi_sim_hdl "Link to this definition") GPI\_EXPORT const char \*gpi\_get\_definition\_file([gpi\_sim\_hdl](https://docs.cocotb.org/en/stable/library_reference_c.html#_CPPv411gpi_sim_hdl "gpi_sim_hdl") gpi\_hdl)[](https://docs.cocotb.org/en/stable/library_reference_c.html#_CPPv423gpi_get_definition_file11gpi_sim_hdl "Link to this definition") GPI\_EXPORT int gpi\_is\_constant([gpi\_sim\_hdl](https://docs.cocotb.org/en/stable/library_reference_c.html#_CPPv411gpi_sim_hdl "gpi_sim_hdl") gpi\_hdl)[](https://docs.cocotb.org/en/stable/library_reference_c.html#_CPPv415gpi_is_constant11gpi_sim_hdl "Link to this definition") GPI\_EXPORT int gpi\_is\_indexable([gpi\_sim\_hdl](https://docs.cocotb.org/en/stable/library_reference_c.html#_CPPv411gpi_sim_hdl "gpi_sim_hdl") gpi\_hdl)[](https://docs.cocotb.org/en/stable/library_reference_c.html#_CPPv416gpi_is_indexable11gpi_sim_hdl "Link to this definition") GPI\_EXPORT void gpi\_set\_signal\_value\_real([gpi\_sim\_hdl](https://docs.cocotb.org/en/stable/library_reference_c.html#_CPPv411gpi_sim_hdl "gpi_sim_hdl") gpi\_hdl, double value, [gpi\_set\_action\_t](https://docs.cocotb.org/en/stable/library_reference_c.html#_CPPv416gpi_set_action_t "gpi_set_action_t") action)[](https://docs.cocotb.org/en/stable/library_reference_c.html#_CPPv425gpi_set_signal_value_real11gpi_sim_hdld16gpi_set_action_t "Link to this definition") GPI\_EXPORT void gpi\_set\_signal\_value\_int([gpi\_sim\_hdl](https://docs.cocotb.org/en/stable/library_reference_c.html#_CPPv411gpi_sim_hdl "gpi_sim_hdl") gpi\_hdl, int32\_t value, [gpi\_set\_action\_t](https://docs.cocotb.org/en/stable/library_reference_c.html#_CPPv416gpi_set_action_t "gpi_set_action_t") action)[](https://docs.cocotb.org/en/stable/library_reference_c.html#_CPPv424gpi_set_signal_value_int11gpi_sim_hdl7int32_t16gpi_set_action_t "Link to this definition") GPI\_EXPORT void gpi\_set\_signal\_value\_binstr([gpi\_sim\_hdl](https://docs.cocotb.org/en/stable/library_reference_c.html#_CPPv411gpi_sim_hdl "gpi_sim_hdl") gpi\_hdl, const char \*str, [gpi\_set\_action\_t](https://docs.cocotb.org/en/stable/library_reference_c.html#_CPPv416gpi_set_action_t "gpi_set_action_t") action)[](https://docs.cocotb.org/en/stable/library_reference_c.html#_CPPv427gpi_set_signal_value_binstr11gpi_sim_hdlPKc16gpi_set_action_t "Link to this definition") GPI\_EXPORT void gpi\_set\_signal\_value\_str([gpi\_sim\_hdl](https://docs.cocotb.org/en/stable/library_reference_c.html#_CPPv411gpi_sim_hdl "gpi_sim_hdl") gpi\_hdl, const char \*str, [gpi\_set\_action\_t](https://docs.cocotb.org/en/stable/library_reference_c.html#_CPPv416gpi_set_action_t "gpi_set_action_t") action)[](https://docs.cocotb.org/en/stable/library_reference_c.html#_CPPv424gpi_set_signal_value_str11gpi_sim_hdlPKc16gpi_set_action_t "Link to this definition") GPI\_EXPORT [gpi\_cb\_hdl](https://docs.cocotb.org/en/stable/library_reference_c.html#_CPPv410gpi_cb_hdl "gpi_cb_hdl") gpi\_register\_timed\_callback(int (\*gpi\_function)(void\*), void \*gpi\_cb\_data, uint64\_t time)[](https://docs.cocotb.org/en/stable/library_reference_c.html#_CPPv427gpi_register_timed_callbackPFiPvEPv8uint64_t "Link to this definition") GPI\_EXPORT [gpi\_cb\_hdl](https://docs.cocotb.org/en/stable/library_reference_c.html#_CPPv410gpi_cb_hdl "gpi_cb_hdl") gpi\_register\_value\_change\_callback(int (\*gpi\_function)(void\*), void \*gpi\_cb\_data, [gpi\_sim\_hdl](https://docs.cocotb.org/en/stable/library_reference_c.html#_CPPv411gpi_sim_hdl "gpi_sim_hdl") gpi\_hdl, int edge)[](https://docs.cocotb.org/en/stable/library_reference_c.html#_CPPv434gpi_register_value_change_callbackPFiPvEPv11gpi_sim_hdli "Link to this definition") GPI\_EXPORT [gpi\_cb\_hdl](https://docs.cocotb.org/en/stable/library_reference_c.html#_CPPv410gpi_cb_hdl "gpi_cb_hdl") gpi\_register\_readonly\_callback(int (\*gpi\_function)(void\*), void \*gpi\_cb\_data)[](https://docs.cocotb.org/en/stable/library_reference_c.html#_CPPv430gpi_register_readonly_callbackPFiPvEPv "Link to this definition") GPI\_EXPORT [gpi\_cb\_hdl](https://docs.cocotb.org/en/stable/library_reference_c.html#_CPPv410gpi_cb_hdl "gpi_cb_hdl") gpi\_register\_nexttime\_callback(int (\*gpi\_function)(void\*), void \*gpi\_cb\_data)[](https://docs.cocotb.org/en/stable/library_reference_c.html#_CPPv430gpi_register_nexttime_callbackPFiPvEPv "Link to this definition") GPI\_EXPORT [gpi\_cb\_hdl](https://docs.cocotb.org/en/stable/library_reference_c.html#_CPPv410gpi_cb_hdl "gpi_cb_hdl") gpi\_register\_readwrite\_callback(int (\*gpi\_function)(void\*), void \*gpi\_cb\_data)[](https://docs.cocotb.org/en/stable/library_reference_c.html#_CPPv431gpi_register_readwrite_callbackPFiPvEPv "Link to this definition") GPI\_EXPORT void gpi\_deregister\_callback([gpi\_cb\_hdl](https://docs.cocotb.org/en/stable/library_reference_c.html#_CPPv410gpi_cb_hdl "gpi_cb_hdl") gpi\_hdl)[](https://docs.cocotb.org/en/stable/library_reference_c.html#_CPPv423gpi_deregister_callback10gpi_cb_hdl "Link to this definition") GPI\_EXPORT void \*gpi\_get\_callback\_data([gpi\_cb\_hdl](https://docs.cocotb.org/en/stable/library_reference_c.html#_CPPv410gpi_cb_hdl "gpi_cb_hdl") gpi\_hdl)[](https://docs.cocotb.org/en/stable/library_reference_c.html#_CPPv421gpi_get_callback_data10gpi_cb_hdl "Link to this definition") --- # Installing the Development Version — cocotb 1.9.2 documentation * [](https://docs.cocotb.org/en/stable/index.html) * Installing the Development Version * [View page source](https://docs.cocotb.org/en/stable/_sources/install_devel.rst.txt) * * * Installing the Development Version[](https://docs.cocotb.org/en/stable/install_devel.html#installing-the-development-version "Link to this heading") ====================================================================================================================================================== Note If you want to follow the instructions on this page, make sure you are reading its [latest version](https://docs.cocotb.org/en/latest/install_devel.html) . Once you install the development version, you should keep reading the [matching documentation](https://docs.cocotb.org/en/latest/) . The development version of cocotb has different prerequisites than the stable version (see below). Namely, it requires the Python development headers and a C/C++ compiler. * Python 3.6+ * Python development packages * GCC 4.8.1+, Clang 3.3+ or Microsoft Visual C++ 14.21+ and associated development packages * On Linux: A static build of the C++ standard library `libstdc++`. Some distributions include the static library in their default packages (e.g. Debian/Ubuntu), others (e.g. Red Hat) require the installation of a package typically named `libstdc++-static`. * GNU Make * A Verilog or VHDL simulator, depending on your [RTL](https://docs.cocotb.org/en/stable/glossary.html#term-RTL) source code The installation instructions vary depending on your operating system: Windows + CondaLinux - Debian/UbuntuLinux - Red HatmacOS conda install \-c msys2 m2\-base m2\-make In a terminal, run sudo apt-get install make gcc g++ python3 python3-dev python3-pip In a terminal, run sudo yum install make gcc gcc-c++ libstdc++-devel libstdc++-static python3 python3-devel python3-pip brew install python The development version of cocotb can be installed by running pip install git+https://github.com/cocotb/cocotb@master Note If your user does not have permissions to install cocotb using the instructions above, try adding the `--user` option to `pip` (see [the pip documentation](https://pip.pypa.io/en/stable/user_guide/#user-installs) ). Warning `pip` may belong to a different Python installation to what you expect. Use `pip -V` to check. If this prints “(python 2.7)”, use `pip3` or `python3 -m pip` in place of `pip` in the command shown. After installation, you should be able to execute `cocotb-config`. If it is not found, you need to append its location to the `PATH` environment variable. --- # More Examples — cocotb 1.9.2 documentation * [](https://docs.cocotb.org/en/stable/index.html) * More Examples * [View page source](https://docs.cocotb.org/en/stable/_sources/examples.rst.txt) * * * More Examples[](https://docs.cocotb.org/en/stable/examples.html#more-examples "Link to this heading") ======================================================================================================= Apart from the examples covered with full tutorials in the previous sections, the directory `cocotb/examples/` contains some more smaller modules you may want to take a look at. Adder[](https://docs.cocotb.org/en/stable/examples.html#adder "Link to this heading") --------------------------------------------------------------------------------------- The directory `cocotb/examples/adder/` contains an `adder` [RTL](https://docs.cocotb.org/en/stable/glossary.html#term-RTL) in both Verilog and VHDL, an `adder_model` implemented in Python, and the cocotb testbench with two defined tests ­ a simple `adder_basic_test()` and a slightly more advanced `adder_randomised_test()`. Matrix Multiplier[](https://docs.cocotb.org/en/stable/examples.html#matrix-multiplier "Link to this heading") --------------------------------------------------------------------------------------------------------------- The directory `cocotb/examples/matrix_multiplier` contains a module for multiplying two matrices together, implemented in both **VHDL** and **SystemVerilog**. The module takes two matrices `a_i` and `b_i` as inputs and provides the resulting matrix `c_o` as an output. On each rising clock edge, `c_o` is calculated and output. When input `valid_i` is high and `c_o` is calculated, `valid_o` goes high to signal a valid output value. A reusable `DataValidMonitor` class is defined. It monitors a streaming data/valid bus, samples the bus when a transaction occurs, and places those transactions into an asynchronous [`Queue`](https://docs.cocotb.org/en/stable/library_reference.html#cocotb.queue.Queue "cocotb.queue.Queue") . The queue allows another coroutine to consume monitored transactions at its own pace. A reusable `MatrixMultiplierTester` is also defined. It instantiates two of the `DataValidMonitor`s: one to monitor the matrix multiplier input, and another to monitor the output. The `MatrixMultiplierTester` starts a task which consumes transactions from the input monitor, feeds them into a model to compute an expected output, and finally compares the module output to the expected for correctness. The main test coroutine stimulates the matrix multiplier DUT with the test data. Once all the test inputs have been applied it decides when the test is done. The testbench makes use of random data generators to test many sets of matrices. The number of data bits for each entry in the matrices, as well as the row and column counts for each matrix, are configurable in the Makefile. Note The example module uses one-dimensional arrays in the port definition to represent the matrices. Mixed Language[](https://docs.cocotb.org/en/stable/examples.html#mixed-language "Link to this heading") --------------------------------------------------------------------------------------------------------- The directory `cocotb/examples/mixed_language/` contains two toplevel [HDL](https://docs.cocotb.org/en/stable/glossary.html#term-HDL) files, one in VHDL, one in SystemVerilog, that each instantiate an `endian_swapper` entity in SystemVerilog and VHDL in parallel and chains them together so that the endianness is swapped twice. Thus, we end up with SystemVerilog+VHDL instantiated in VHDL and SystemVerilog+VHDL instantiated in SystemVerilog. The cocotb testbench pulls the reset on both instances and checks that they behave the same. Mixed-signal (analog/digital)[](https://docs.cocotb.org/en/stable/examples.html#mixed-signal-analog-digital "Link to this heading") ------------------------------------------------------------------------------------------------------------------------------------- This example with two different designs shows how cocotb can be used in an analog-mixed signal (AMS) simulation, provided your simulator supports this. Such an AMS setup involves a digital and an analog simulation kernel, and also provides means to transfer data between the digital and the analog domain. The “-AMS” variants of the common digital HDLs (VHDL-AMS, Verilog-AMS and SystemVerilog-AMS) and languages like Spice can be used to express the analog behavior of your circuit. Due to limitations of the underlying simulator interfaces (VPI, VHPI, FLI), cocotb cannot directly access the analog domain but has to resort to e.g. HDL helper code. Thus, unlike the other examples, part of this testbench is implemented with cocotb and the helper part with HDL. * [The cocotb `rescap` Testbench](https://docs.cocotb.org/en/stable/rescap.html) * [Overview Schematic](https://docs.cocotb.org/en/stable/rescap.html#overview-schematic) * [The Design](https://docs.cocotb.org/en/stable/rescap.html#the-design) * [The Testbench](https://docs.cocotb.org/en/stable/rescap.html#the-testbench) * [The HDL part of the Testbench](https://docs.cocotb.org/en/stable/rescap.html#the-hdl-part-of-the-testbench) * [The cocotb part of the Testbench](https://docs.cocotb.org/en/stable/rescap.html#the-cocotb-part-of-the-testbench) * [`test_rescap_minimalist`](https://docs.cocotb.org/en/stable/rescap.html#test-rescap-minimalist) * [`test_rescap`](https://docs.cocotb.org/en/stable/rescap.html#test-rescap) * [The cocotb `regulator` Testbench](https://docs.cocotb.org/en/stable/regulator.html) * [Overview Schematic](https://docs.cocotb.org/en/stable/regulator.html#overview-schematic) * [The Design](https://docs.cocotb.org/en/stable/regulator.html#the-design) * [The Testbench](https://docs.cocotb.org/en/stable/regulator.html#the-testbench) * [The HDL part of the Testbench](https://docs.cocotb.org/en/stable/regulator.html#the-hdl-part-of-the-testbench) * [The cocotb part of the Testbench](https://docs.cocotb.org/en/stable/regulator.html#the-cocotb-part-of-the-testbench) * [test\_regulator\_plot](https://docs.cocotb.org/en/stable/regulator.html#test-regulator-plot) * [test\_regulator\_trim](https://docs.cocotb.org/en/stable/regulator.html#test-regulator-trim) System Modeling[](https://docs.cocotb.org/en/stable/examples.html#system-modeling "Link to this heading") ----------------------------------------------------------------------------------------------------------- * [Models of Analog Circuits](https://docs.cocotb.org/en/stable/analog_model.html) --- # Release Notes — cocotb 1.9.2 documentation * [](https://docs.cocotb.org/en/stable/index.html) * Release Notes * [View page source](https://docs.cocotb.org/en/stable/_sources/release_notes.rst.txt) * * * Release Notes[](https://docs.cocotb.org/en/stable/release_notes.html#release-notes "Link to this heading") ============================================================================================================ All releases are available from the [GitHub Releases Page](https://github.com/cocotb/cocotb/releases) . cocotb 1.9.2 (2024-10-26)[](https://docs.cocotb.org/en/stable/release_notes.html#cocotb-1-9-2-2024-10-26 "Link to this heading") ---------------------------------------------------------------------------------------------------------------------------------- ### Bugfixes[](https://docs.cocotb.org/en/stable/release_notes.html#bugfixes "Link to this heading") * Better handle errors happening during the startup phase. * Fix toplevel discovery in Questa and Modelsim. ### Features[](https://docs.cocotb.org/en/stable/release_notes.html#features "Link to this heading") * Python 3.13 is now supported. ### Deprecations and Removals[](https://docs.cocotb.org/en/stable/release_notes.html#deprecations-and-removals "Link to this heading") * The `RTL_LIBRARY` and `TOPLEVEL_LIBRARY` Makefile variables were merged into `TOPLEVEL_LIBRARY`. Update all uses of `RTL_LIBRARY`. cocotb 1.9.1 (2024-08-29)[](https://docs.cocotb.org/en/stable/release_notes.html#cocotb-1-9-1-2024-08-29 "Link to this heading") ---------------------------------------------------------------------------------------------------------------------------------- ### Bugfixes[](https://docs.cocotb.org/en/stable/release_notes.html#id1 "Link to this heading") * Improve the Verilator Makefile to pass on `--trace` at runtime as well. ([#4088](https://github.com/cocotb/cocotb/issues/4088) ) * Pass `EXTRA_ARGS` in the Verilator Makefile to both the compilation and the simulation step. ### Changes[](https://docs.cocotb.org/en/stable/release_notes.html#changes "Link to this heading") * Support setuptools 72.2.0 cocotb 1.9.0 (2024-07-14)[](https://docs.cocotb.org/en/stable/release_notes.html#cocotb-1-9-0-2024-07-14 "Link to this heading") ---------------------------------------------------------------------------------------------------------------------------------- ### Features[](https://docs.cocotb.org/en/stable/release_notes.html#id2 "Link to this heading") * Not using parentheses on `@cocotb.test` decorator is now supported. ([#2731](https://github.com/cocotb/cocotb/pull/2731) ) * The [`cocotb.runner.Simulator.build()`](https://docs.cocotb.org/en/stable/library_reference.html#cocotb.runner.Simulator.build "cocotb.runner.Simulator.build") method now accepts a `clean` argument to remove `build_dir` completely during build stage. ([#3351](https://github.com/cocotb/cocotb/pull/3351) ) * Added support for the [NVC](https://github.com/nickg/nvc) VHDL simulator. ([#3427](https://github.com/cocotb/cocotb/pull/3427) ) * Added [`SIM_CMD_SUFFIX`](https://docs.cocotb.org/en/stable/building.html#var-SIM_CMD_SUFFIX) to allow users to redirect simulator output or otherwise suffix the simulation command invocation. ([#3561](https://github.com/cocotb/cocotb/pull/3561) ) * Added `--trace` command line argument to Verilator simulation binaries for run-time trace generation. This new argument is passed to the binary when the `waves` argument to [`cocotb.runner.Simulator.test()`](https://docs.cocotb.org/en/stable/library_reference.html#cocotb.runner.Simulator.test "cocotb.runner.Simulator.test") is `True`. ([#3667](https://github.com/cocotb/cocotb/pull/3667) ) * The [`cocotb.runner.Simulator.build()`](https://docs.cocotb.org/en/stable/library_reference.html#cocotb.runner.Simulator.build "cocotb.runner.Simulator.build") and [`cocotb.runner.Simulator.test()`](https://docs.cocotb.org/en/stable/library_reference.html#cocotb.runner.Simulator.test "cocotb.runner.Simulator.test") methods now accept a `log_file` argument to redirect stdout and stderr to the specified file. ([#3668](https://github.com/cocotb/cocotb/pull/3668) ) * The `results_xml` argument to [`cocotb.runner.Simulator.test()`](https://docs.cocotb.org/en/stable/library_reference.html#cocotb.runner.Simulator.test "cocotb.runner.Simulator.test") can now be an absolute path. ([#3669](https://github.com/cocotb/cocotb/pull/3669) ) * Added `--trace-file` command line argument to Verilator simulation binaries which specifies the trace file name. This can be passed to the binary by using the `test_args` argument to [`cocotb.runner.Simulator.test()`](https://docs.cocotb.org/en/stable/library_reference.html#cocotb.runner.Simulator.test "cocotb.runner.Simulator.test") . ([#3683](https://github.com/cocotb/cocotb/pull/3683) ) * The [`cocotb.runner.Simulator.test()`](https://docs.cocotb.org/en/stable/library_reference.html#cocotb.runner.Simulator.test "cocotb.runner.Simulator.test") method now accepts a `pre_cmd` argument to run given commands before the simulation starts. These are typically Tcl commands for simulators that support them. Only support for the Questa simulator has been implemented. ([#3744](https://github.com/cocotb/cocotb/pull/3744) ) * The `sources` option was added to [`cocotb.runner.Simulator.build()`](https://docs.cocotb.org/en/stable/library_reference.html#cocotb.runner.Simulator.build "cocotb.runner.Simulator.build") to better support building mixed-language designs. ([#3796](https://github.com/cocotb/cocotb/pull/3796) ) * Enable use of VPI fallback in all simulators when attempting to access generate blocks directly via lookup. This enables better support for simulators that don’t support `vpiGenScopeArray`, allowing discovery of generate blocks without having to iterate over the parent handle. ([#3817](https://github.com/cocotb/cocotb/pull/3817) ) * Added support for comparing [`BinaryValue`](https://docs.cocotb.org/en/stable/library_reference.html#cocotb.binary.BinaryValue "cocotb.binary.BinaryValue") with [`Logic`](https://docs.cocotb.org/en/stable/library_reference.html#cocotb.types.Logic "cocotb.types.Logic") , [`LogicArray`](https://docs.cocotb.org/en/stable/library_reference.html#cocotb.types.LogicArray "cocotb.types.LogicArray") , and [`str`](https://docs.python.org/3/library/stdtypes.html#str "(in Python v3.13)") . ([#3845](https://github.com/cocotb/cocotb/pull/3845) ) * Riviera-PRO now supports compilation into (multiple) VHDL libraries using `VHDL_SOURCES_`. ([#3922](https://github.com/cocotb/cocotb/pull/3922) ) ### Bugfixes[](https://docs.cocotb.org/en/stable/release_notes.html#id3 "Link to this heading") * Xcelium 23.09.004 and newer can now be used to test designs with a VHDL toplevel. ([#1076](https://github.com/cocotb/cocotb/pull/1076) ) * Fixed a potential issue where pseudo-region lookup may find the wrong generate block if the name of one generate block starts with the name of another generate block. ([#2255](https://github.com/cocotb/cocotb/pull/2255) ) * Support `waves` argument to [`cocotb.runner.Simulator.build()`](https://docs.cocotb.org/en/stable/library_reference.html#cocotb.runner.Simulator.build "cocotb.runner.Simulator.build") for Verilator. ([#3681](https://github.com/cocotb/cocotb/pull/3681) ) * The `test_args` argument to [`cocotb.runner.Simulator.test()`](https://docs.cocotb.org/en/stable/library_reference.html#cocotb.runner.Simulator.test "cocotb.runner.Simulator.test") is now passed to the Verilator simulation binary when running the simulation, which was previously missing. ([#3682](https://github.com/cocotb/cocotb/pull/3682) ) ### Deprecations and Removals[](https://docs.cocotb.org/en/stable/release_notes.html#id4 "Link to this heading") * `bool(Lock())` is deprecated. Use [`locked()`](https://docs.cocotb.org/en/stable/triggers.html#cocotb.triggers.Lock.locked "cocotb.triggers.Lock.locked") instead. ([#3871](https://github.com/cocotb/cocotb/pull/3871) ) * [`Join.retval`](https://docs.cocotb.org/en/stable/triggers.html#cocotb.triggers.Join.retval "cocotb.triggers.Join.retval") is deprecated. Use [`Task.result()`](https://docs.cocotb.org/en/stable/library_reference.html#cocotb.task.Task.result "cocotb.task.Task.result") to get the result of a joined Task. ([#3871](https://github.com/cocotb/cocotb/pull/3871) ) * Passing the _outcome_ argument to `NullTrigger` - which allowed the user to inject arbitrary outcomes when the trigger was `await`ed - is deprecated. There is no alternative. ([#3871](https://github.com/cocotb/cocotb/pull/3871) ) * `Event.fired` is deprecated. Use [`is_set()`](https://docs.cocotb.org/en/stable/triggers.html#cocotb.triggers.Event.is_set "cocotb.triggers.Event.is_set") instead. ([#3871](https://github.com/cocotb/cocotb/pull/3871) ) ### Changes[](https://docs.cocotb.org/en/stable/release_notes.html#id5 "Link to this heading") * For Aldec simulators, the \-dbg and \-O2 options are no longer passed by default, as they reduce simulation speed. Pass these options in `COMPILE_ARGS` and `SIM_ARGS` if you need them for increased observability. ([#3490](https://github.com/cocotb/cocotb/pull/3490) ) * `await`ing a [`Join`](https://docs.cocotb.org/en/stable/triggers.html#cocotb.triggers.Join "cocotb.triggers.Join") trigger will yield the Join trigger and not the result of the task in the 2.0 release. ([#3871](https://github.com/cocotb/cocotb/pull/3871) ) * [`Lock.locked`](https://docs.cocotb.org/en/stable/triggers.html#cocotb.triggers.Lock.locked "cocotb.triggers.Lock.locked") is now a method rather than an attribute to mirror [`asyncio.Lock.locked()`](https://docs.python.org/3/library/asyncio-sync.html#asyncio.Lock.locked "(in Python v3.13)") . ([#3871](https://github.com/cocotb/cocotb/pull/3871) ) cocotb 1.8.1 (2023-10-06)[](https://docs.cocotb.org/en/stable/release_notes.html#cocotb-1-8-1-2023-10-06 "Link to this heading") ---------------------------------------------------------------------------------------------------------------------------------- ### Features[](https://docs.cocotb.org/en/stable/release_notes.html#id6 "Link to this heading") * Python 3.12 is now supported. ### Bugfixes[](https://docs.cocotb.org/en/stable/release_notes.html#id7 "Link to this heading") * Fix incorrect cleanup of pending Tasks (queued by [`cocotb.start_soon()`](https://docs.cocotb.org/en/stable/library_reference.html#cocotb.start_soon "cocotb.start_soon") but not started yet) when a test ends. ([#3354](https://github.com/cocotb/cocotb/issues/3354) ) cocotb 1.8.0 (2023-06-15)[](https://docs.cocotb.org/en/stable/release_notes.html#cocotb-1-8-0-2023-06-15 "Link to this heading") ---------------------------------------------------------------------------------------------------------------------------------- ### Features[](https://docs.cocotb.org/en/stable/release_notes.html#id8 "Link to this heading") * [`cocotb.types.LogicArray`](https://docs.cocotb.org/en/stable/library_reference.html#cocotb.types.LogicArray "cocotb.types.LogicArray") now supports a default value construction if a `range` is given. ([#3031](https://github.com/cocotb/cocotb/pull/3031) ) * Add support for `fraction.Fraction` and [`decimal.Decimal`](https://docs.python.org/3/library/decimal.html#decimal.Decimal "(in Python v3.13)") to the `period` argument of [`cocotb.clock.Clock`](https://docs.cocotb.org/en/stable/library_reference.html#cocotb.clock.Clock "cocotb.clock.Clock") . ([#3045](https://github.com/cocotb/cocotb/pull/3045) ) * This release adds the [Python Test Runner](https://docs.cocotb.org/en/stable/runner.html#howto-python-runner) , an experimental replacement for the traditional Makefile-based build and run flow. ([#3103](https://github.com/cocotb/cocotb/pull/3103) ) * Incisive now supports compilation into a named VHDL library `lib` using `VHDL_SOURCES_`. ([#3261](https://github.com/cocotb/cocotb/pull/3261) ) * Cocotb can now correctly drive Verilator when its new `--timing` flag is used. ([#3316](https://github.com/cocotb/cocotb/pull/3316) ) * Creating an FST waveform dump in Icarus Verilog can now be done by setting the `WAVES` environment variable. Icarus-specific Verilog code is no longer required. ([#3324](https://github.com/cocotb/cocotb/pull/3324) ) ### Bugfixes[](https://docs.cocotb.org/en/stable/release_notes.html#id9 "Link to this heading") * Fixed Verilator not writing coverage files in some cases. ([#1478](https://github.com/cocotb/cocotb/pull/1478) ) * The [`Regression Manager`](https://docs.cocotb.org/en/stable/library_reference.html#cocotb.regression_manager "cocotb.regression_manager") now correctly handles exceptions raised in tests when the exceptions inherit from BaseException. ([#3196](https://github.com/cocotb/cocotb/pull/3196) ) * Fix a performance regression when using Questa with FLI introduced in cocotb 1.7.0. ([#3229](https://github.com/cocotb/cocotb/pull/3229) ) * Adds support for packed union in SystemVerilog when using Cadence Xcelium. ([#3239](https://github.com/cocotb/cocotb/pull/3239) ) * Fixed [`RecursionError`](https://docs.python.org/3/library/exceptions.html#RecursionError "(in Python v3.13)") caused by certain corner cases in the scheduler. ([#3267](https://github.com/cocotb/cocotb/pull/3267) ) * Fixed cleanup in scheduler which caused sporadic warning messages and bugs in some corner cases. ([#3270](https://github.com/cocotb/cocotb/pull/3270) ) * Fix “use after free” bug in VHPI implementation causing Riviera to fail to discover some simulation objects. ([#3307](https://github.com/cocotb/cocotb/pull/3307) ) ### Changes[](https://docs.cocotb.org/en/stable/release_notes.html#id10 "Link to this heading") * Removed `level` arg from `_sim_event` function in the [`PYGPI_ENTRY_POINT`](https://docs.cocotb.org/en/stable/building.html#envvar-PYGPI_ENTRY_POINT) interface. This function can only indicate a request to shutdown from the simulator or GPI. ([#3066](https://github.com/cocotb/cocotb/pull/3066) ) * Moved [`cocotb.task.Task`](https://docs.cocotb.org/en/stable/library_reference.html#cocotb.task.Task "cocotb.task.Task") and friends to `cocotb.task` module to alleviate internal cylic import dependency. Users should update imports of the [`Task`](https://docs.cocotb.org/en/stable/library_reference.html#cocotb.task.Task "cocotb.task.Task") to import from the top-level `cocotb` namespace. ([#3067](https://github.com/cocotb/cocotb/pull/3067) ) * Added support for `VERILOG_INCLUDE_DIRS` in the Makefiles. ([#3189](https://github.com/cocotb/cocotb/pull/3189) ) * Changed platform support: Added Red Hat Enterprise Linux 9 (RHEL) and compatible clones, added macOS 13 x86\_64 (Ventura on Intel), removed Ubuntu 18.04 (end-of-life). Note that Python wheels compatible with Ubuntu 18.04 remain available for the time being. Even though the cocotb project does not provide pre-compiled binaries for unsupported platforms users can typically compile cocotb themselves, as done automatically when running `pip install`. cocotb 1.7.2 (2022-11-15)[](https://docs.cocotb.org/en/stable/release_notes.html#cocotb-1-7-2-2022-11-15 "Link to this heading") ---------------------------------------------------------------------------------------------------------------------------------- ### Changes[](https://docs.cocotb.org/en/stable/release_notes.html#id11 "Link to this heading") * Python 3.11 is now supported. * `find_libpython`, a library to find (as the name indicates) libpython, is now a dependency of cocotb. Its latest version resolves an issue for users on RedHat Enterprise Linux (RHEL) 8 and Python 3.8, where the correct Python library would not be detected. ([#3097](https://github.com/cocotb/cocotb/issues/3097) ) ### Bugfixes[](https://docs.cocotb.org/en/stable/release_notes.html#id12 "Link to this heading") * Fixed a segmentation fault in Aldec Riviera-PRO that prevented mixed-language simulation from running. ([#3078](https://github.com/cocotb/cocotb/issues/3078) ) cocotb 1.7.1 (2022-09-17)[](https://docs.cocotb.org/en/stable/release_notes.html#cocotb-1-7-1-2022-09-17 "Link to this heading") ---------------------------------------------------------------------------------------------------------------------------------- ### Bugfixes[](https://docs.cocotb.org/en/stable/release_notes.html#id13 "Link to this heading") * Fixed the packaging of the source distribution (sdist) to include all necessary files. ([#3072](https://github.com/cocotb/cocotb/pull/3072) ) * Documented the fact that `libstdc++-static` needs to be available on some Linux distributions to install cocotb from source. ([#3082](https://github.com/cocotb/cocotb/pull/3082) ) cocotb 1.7.0 (2022-09-06)[](https://docs.cocotb.org/en/stable/release_notes.html#cocotb-1-7-0-2022-09-06 "Link to this heading") ---------------------------------------------------------------------------------------------------------------------------------- ### Features[](https://docs.cocotb.org/en/stable/release_notes.html#id14 "Link to this heading") * Removed the need for ModelSim or Questa being installed when building cocotb. Similar to the approach taken with VPI and VHPI, cocotb now includes all C header files to build the FLI interface. This improvement was done in close collaboration with Siemens EDA, who changed the license of the relevant source code file. ([#2948](https://github.com/cocotb/cocotb/pull/2948) ) * With Questa 2022.3 VHPI support is now fully working and no longer experimental. cocotb still defaults to using the FLI interface for VHDL toplevels with Questa. Users can choose VHPI instead by setting the `VHDL_GPI_INTERFACE` environment variable to `vhpi` before running cocotb. ([#2803](https://github.com/cocotb/cocotb/pull/2803) ) * cocotb tests are now more reproducible. ([#2721](https://github.com/cocotb/cocotb/pull/2721) ) * [`Force`](https://docs.cocotb.org/en/stable/library_reference.html#cocotb.handle.Force "cocotb.handle.Force") , [`Freeze`](https://docs.cocotb.org/en/stable/library_reference.html#cocotb.handle.Freeze "cocotb.handle.Freeze") , and [`Release`](https://docs.cocotb.org/en/stable/library_reference.html#cocotb.handle.Release "cocotb.handle.Release") are now supported when using the FLI, Questa’s traditional method to access VHDL. ([#2775](https://github.com/cocotb/cocotb/pull/2775) ) * cocotb binaries now statically link libstdc++ on Linux, which prevents library load errors even if the simulator ships its own libstdc++. ([#3002](https://github.com/cocotb/cocotb/pull/3002) ) ### Bugfixes[](https://docs.cocotb.org/en/stable/release_notes.html#id15 "Link to this heading") * Fixed write scheduling to apply writes oldest to newest. ([#2792](https://github.com/cocotb/cocotb/pull/2792) ) * Fixed Riviera makefile error for mixed-language simulation when VHDL is the top-level. This bug prevented the VPI library from loading correctly, and was a regression in 1.5.0. ([#2912](https://github.com/cocotb/cocotb/pull/2912) ) * Fixed FLI issue where unprimed triggers were still firing. ([#3010](https://github.com/cocotb/cocotb/pull/3010) ) ### Deprecations and Removals[](https://docs.cocotb.org/en/stable/release_notes.html#id16 "Link to this heading") * [`cocotb.fork()`](https://docs.cocotb.org/en/stable/library_reference.html#cocotb.fork "cocotb.fork") has been deprecated in favor of [`cocotb.start_soon()`](https://docs.cocotb.org/en/stable/library_reference.html#cocotb.start_soon "cocotb.start_soon") or [`cocotb.start()`](https://docs.cocotb.org/en/stable/library_reference.html#cocotb.start "cocotb.start") . ([#2663](https://github.com/cocotb/cocotb/pull/2663) ) ### Changes[](https://docs.cocotb.org/en/stable/release_notes.html#id17 "Link to this heading") * Passing [coroutine](https://docs.python.org/3/glossary.html#term-coroutine "(in Python v3.13)") s to [`with_timeout()`](https://docs.cocotb.org/en/stable/triggers.html#cocotb.triggers.with_timeout "cocotb.triggers.with_timeout") is now supported. ([#2494](https://github.com/cocotb/cocotb/pull/2494) ) * Renamed `RunningTask` to `Task`. ([#2876](https://github.com/cocotb/cocotb/pull/2876) ) * Made `Task` interface more like [`asyncio.Task`](https://docs.python.org/3/library/asyncio-task.html#asyncio.Task "(in Python v3.13)") ’s. ([#2876](https://github.com/cocotb/cocotb/pull/2876) ) * When code coverage is enabled with [`COVERAGE`](https://docs.cocotb.org/en/stable/building.html#envvar-COVERAGE) and a configuration file is specified with `COVERAGE_RCFILE`, default coverage configuration is not applied to avoid overriding the user-defined configuration. ([#3014](https://github.com/cocotb/cocotb/pull/3014) ) cocotb 1.6.2 (2022-02-07)[](https://docs.cocotb.org/en/stable/release_notes.html#cocotb-1-6-2-2022-02-07 "Link to this heading") ---------------------------------------------------------------------------------------------------------------------------------- ### Bugfixes[](https://docs.cocotb.org/en/stable/release_notes.html#id18 "Link to this heading") * Fix regression in [`TestFactory`](https://docs.cocotb.org/en/stable/library_reference.html#cocotb.regression.TestFactory "cocotb.regression.TestFactory") when using generator-based test coroutines. ([#2839](https://github.com/cocotb/cocotb/issues/2839) ) ### Changes[](https://docs.cocotb.org/en/stable/release_notes.html#id19 "Link to this heading") * Change how [`PYTHONHOME`](https://docs.python.org/3/using/cmdline.html#envvar-PYTHONHOME "(in Python v3.13)") is populated to work with broken mingw environments. ([#2739](https://github.com/cocotb/cocotb/issues/2739) ) cocotb 1.6.1 (2021-12-07)[](https://docs.cocotb.org/en/stable/release_notes.html#cocotb-1-6-1-2021-12-07 "Link to this heading") ---------------------------------------------------------------------------------------------------------------------------------- ### Bugfixes[](https://docs.cocotb.org/en/stable/release_notes.html#id20 "Link to this heading") * Fix regression in [`TestFactory`](https://docs.cocotb.org/en/stable/library_reference.html#cocotb.regression.TestFactory "cocotb.regression.TestFactory") wrt unique test names. ([#2781](https://github.com/cocotb/cocotb/issues/2781) ) cocotb 1.6.0 (2021-10-20)[](https://docs.cocotb.org/en/stable/release_notes.html#cocotb-1-6-0-2021-10-20 "Link to this heading") ---------------------------------------------------------------------------------------------------------------------------------- ### Features[](https://docs.cocotb.org/en/stable/release_notes.html#id21 "Link to this heading") * Support a custom entry point from C to Python with [`PYGPI_ENTRY_POINT`](https://docs.cocotb.org/en/stable/building.html#envvar-PYGPI_ENTRY_POINT) . ([#1225](https://github.com/cocotb/cocotb/pull/1225) ) * Added [`Logic`](https://docs.cocotb.org/en/stable/library_reference.html#cocotb.types.Logic "cocotb.types.Logic") and [`Bit`](https://docs.cocotb.org/en/stable/library_reference.html#cocotb.types.Bit "cocotb.types.Bit") modeling datatypes. ([#2059](https://github.com/cocotb/cocotb/pull/2059) ) * ModelSim and Questa now support compilation into a named VHDL library `lib` using `VHDL_SOURCES_`. ([#2465](https://github.com/cocotb/cocotb/pull/2465) ) * Added the [`LogicArray`](https://docs.cocotb.org/en/stable/library_reference.html#cocotb.types.LogicArray "cocotb.types.LogicArray") modeling datatype. ([#2514](https://github.com/cocotb/cocotb/pull/2514) ) * Xcelium now supports compilation into a named VHDL library `lib` using `VHDL_SOURCES_`. ([#2614](https://github.com/cocotb/cocotb/pull/2614) ) * Add the [`SIM_CMD_PREFIX`](https://docs.cocotb.org/en/stable/building.html#var-SIM_CMD_PREFIX) to supported Makefile variables, allowing users to pass environment variables and other command prefixes to simulators. ([#2615](https://github.com/cocotb/cocotb/pull/2615) ) * To support VHDL libraries in ModelSim/Questa/Xcelium, [`VHDL_LIB_ORDER`](https://docs.cocotb.org/en/stable/building.html#var-VHDL_LIB_ORDER) has been added to specify a library compilation order. ([#2635](https://github.com/cocotb/cocotb/pull/2635) ) * [`cocotb.fork()`](https://docs.cocotb.org/en/stable/library_reference.html#cocotb.fork "cocotb.fork") , [`cocotb.start()`](https://docs.cocotb.org/en/stable/library_reference.html#cocotb.start "cocotb.start") , [`cocotb.start_soon()`](https://docs.cocotb.org/en/stable/library_reference.html#cocotb.start_soon "cocotb.start_soon") , and [`cocotb.create_task()`](https://docs.cocotb.org/en/stable/library_reference.html#cocotb.create_task "cocotb.create_task") now accept any object that implements the [`collections.abc.Coroutine`](https://docs.python.org/3/library/collections.abc.html#collections.abc.Coroutine "(in Python v3.13)") protocol. ([#2647](https://github.com/cocotb/cocotb/pull/2647) ) * [`TestFactory`](https://docs.cocotb.org/en/stable/library_reference.html#cocotb.regression.TestFactory "cocotb.regression.TestFactory") and [`cocotb.test`](https://docs.cocotb.org/en/stable/library_reference.html#cocotb.test "cocotb.test") now accept any [`collections.abc.Callable`](https://docs.python.org/3/library/collections.abc.html#collections.abc.Callable "(in Python v3.13)") object which returns a [`collections.abc.Coroutine`](https://docs.python.org/3/library/collections.abc.html#collections.abc.Coroutine "(in Python v3.13)") as a test function. ([#2647](https://github.com/cocotb/cocotb/pull/2647) ) * Added [`cocotb.start()`](https://docs.cocotb.org/en/stable/library_reference.html#cocotb.start "cocotb.start") and [`cocotb.start_soon()`](https://docs.cocotb.org/en/stable/library_reference.html#cocotb.start_soon "cocotb.start_soon") scheduling functions. ([#2660](https://github.com/cocotb/cocotb/pull/2660) ) * Add [`cocotb.create_task()`](https://docs.cocotb.org/en/stable/library_reference.html#cocotb.create_task "cocotb.create_task") API for creating a Task from a Coroutine without scheduling. ([#2665](https://github.com/cocotb/cocotb/pull/2665) ) * Support rounding modes in [`Timer`](https://docs.cocotb.org/en/stable/triggers.html#cocotb.triggers.Timer "cocotb.triggers.Timer") . ([#2684](https://github.com/cocotb/cocotb/pull/2684) ) * Support rounding modes in [`cocotb.utils.get_sim_steps()`](https://docs.cocotb.org/en/stable/library_reference.html#cocotb.utils.get_sim_steps "cocotb.utils.get_sim_steps") . ([#2684](https://github.com/cocotb/cocotb/pull/2684) ) * Support passing `'step'` as a time unit in [`cocotb.utils.get_sim_time()`](https://docs.cocotb.org/en/stable/library_reference.html#cocotb.utils.get_sim_time "cocotb.utils.get_sim_time") . ([#2691](https://github.com/cocotb/cocotb/pull/2691) ) ### Bugfixes[](https://docs.cocotb.org/en/stable/release_notes.html#id22 "Link to this heading") * VHDL signals that are zero bits in width now read as the integer `0`, instead of raising an exception. ([#2294](https://github.com/cocotb/cocotb/pull/2294) ) * Correctly parse plusargs with `=`s in the value. ([#2483](https://github.com/cocotb/cocotb/pull/2483) ) * [`COCOTB_RESULTS_FILE`](https://docs.cocotb.org/en/stable/building.html#envvar-COCOTB_RESULTS_FILE) now properly communicates with the [`Regression Manager`](https://docs.cocotb.org/en/stable/library_reference.html#cocotb.regression_manager "cocotb.regression_manager") to allow overloading the result filename. ([#2487](https://github.com/cocotb/cocotb/pull/2487) ) * Fixed several scheduling issues related to the use of [`cocotb.scheduler.start_soon`](https://docs.cocotb.org/en/stable/library_reference.html#cocotb.scheduler.Scheduler.start_soon "cocotb.scheduler.Scheduler.start_soon") . ([#2504](https://github.com/cocotb/cocotb/pull/2504) ) * Verilator and Icarus now support running without specifying a [`TOPLEVEL`](https://docs.cocotb.org/en/stable/building.html#envvar-TOPLEVEL) . ([#2547](https://github.com/cocotb/cocotb/pull/2547) ) * Fixed discovery of signals inside SystemVerilog interfaces. ([#2683](https://github.com/cocotb/cocotb/pull/2683) ) ### Improved Documentation[](https://docs.cocotb.org/en/stable/release_notes.html#improved-documentation "Link to this heading") * The [Models of Analog Circuits](https://docs.cocotb.org/en/stable/analog_model.html#analog-model) example has been added, showing how to use Python models for analog circuits together with a digital part. ([#2438](https://github.com/cocotb/cocotb/pull/2438) ) ### Deprecations and Removals[](https://docs.cocotb.org/en/stable/release_notes.html#id23 "Link to this heading") * Setting values on indexed handles using the `handle[i] = value` syntax is deprecated. Instead use the `handle[i].value = value` syntax. ([#2490](https://github.com/cocotb/cocotb/pull/2490) ) * Setting values on handles using the `dut.handle = value` syntax is deprecated. Instead use the `handle.value = value` syntax. ([#2490](https://github.com/cocotb/cocotb/pull/2490) ) * Setting values on handles using the `signal <= newval` syntax is deprecated. Instead, use the `signal.value = newval` syntax. ([#2681](https://github.com/cocotb/cocotb/pull/2681) ) * [`cocotb.utils.hexdump()`](https://docs.cocotb.org/en/stable/library_reference.html#cocotb.utils.hexdump "cocotb.utils.hexdump") is deprecated; use [`scapy.utils.hexdump()`](https://scapy.readthedocs.io/en/latest/api/scapy.utils.html#scapy.utils.hexdump "(in Scapy v2.6.1.dev54)") instead. ([#2691](https://github.com/cocotb/cocotb/pull/2691) ) * [`cocotb.utils.hexdiffs()`](https://docs.cocotb.org/en/stable/library_reference.html#cocotb.utils.hexdiffs "cocotb.utils.hexdiffs") is deprecated; use [`scapy.utils.hexdiff()`](https://scapy.readthedocs.io/en/latest/api/scapy.utils.html#scapy.utils.hexdiff "(in Scapy v2.6.1.dev54)") instead. ([#2691](https://github.com/cocotb/cocotb/pull/2691) ) * Passing `None` to [`cocotb.utils.get_sim_time()`](https://docs.cocotb.org/en/stable/library_reference.html#cocotb.utils.get_sim_time "cocotb.utils.get_sim_time") is deprecated; use `'step'` as the time unit instead. ([#2691](https://github.com/cocotb/cocotb/pull/2691) ) * The `stdout` and `stderr` attributes on [`cocotb.result.TestComplete`](https://docs.cocotb.org/en/stable/library_reference.html#cocotb.result.TestComplete "cocotb.result.TestComplete") and subclasses are deprecated. ([#2692](https://github.com/cocotb/cocotb/pull/2692) ) * [`cocotb.result.TestFailure`](https://docs.cocotb.org/en/stable/library_reference.html#cocotb.result.TestFailure "cocotb.result.TestFailure") is deprecated, use an `assert` statement instead. ([#2692](https://github.com/cocotb/cocotb/pull/2692) ) ### Changes[](https://docs.cocotb.org/en/stable/release_notes.html#id24 "Link to this heading") * Assigning out-of-range Python integers to signals will now raise an [`OverflowError`](https://docs.python.org/3/library/exceptions.html#OverflowError "(in Python v3.13)") . ([#2316](https://github.com/cocotb/cocotb/pull/2316) ) * cocotb now requires Python 3.6+. ([#2422](https://github.com/cocotb/cocotb/pull/2422) ) * Selecting tests using `TESTCASE` will now search for the first occurrence of a test of that name in order of modules listed in `MODULE`s, and not just the first module in that list. ([#2434](https://github.com/cocotb/cocotb/pull/2434) ) * The environment variable [`COCOTB_LOG_LEVEL`](https://docs.cocotb.org/en/stable/building.html#envvar-COCOTB_LOG_LEVEL) now supports `TRACE` value, which is used for verbose low-level logging that was previously in `DEBUG` logs. ([#2502](https://github.com/cocotb/cocotb/pull/2502) ) * Improves formatting on test-related logging outputs. ([#2564](https://github.com/cocotb/cocotb/pull/2564) ) * Shorter log lines (configurable with [`COCOTB_REDUCED_LOG_FMT`](https://docs.cocotb.org/en/stable/building.html#envvar-COCOTB_REDUCED_LOG_FMT) ) are now the default. For wider log output, similar to previous cocotb releases, set the [`COCOTB_REDUCED_LOG_FMT`](https://docs.cocotb.org/en/stable/building.html#envvar-COCOTB_REDUCED_LOG_FMT) environment variable to `0`. ([#2564](https://github.com/cocotb/cocotb/pull/2564) ) cocotb 1.5.2 (2021-05-03)[](https://docs.cocotb.org/en/stable/release_notes.html#cocotb-1-5-2-2021-05-03 "Link to this heading") ---------------------------------------------------------------------------------------------------------------------------------- ### Bugfixes[](https://docs.cocotb.org/en/stable/release_notes.html#id25 "Link to this heading") * Changed some makefile syntax to support GNU Make 3. ([#2496](https://github.com/cocotb/cocotb/pull/2496) ) * Fixed behavior of `cocotb-config --libpython` when finding libpython fails. ([#2522](https://github.com/cocotb/cocotb/pull/2522) ) cocotb 1.5.1 (2021-03-20)[](https://docs.cocotb.org/en/stable/release_notes.html#cocotb-1-5-1-2021-03-20 "Link to this heading") ---------------------------------------------------------------------------------------------------------------------------------- ### Bugfixes[](https://docs.cocotb.org/en/stable/release_notes.html#id26 "Link to this heading") * Prevent pytest assertion rewriting ([#2028](https://github.com/cocotb/cocotb/pull/2028) ) from capturing stdin, which causes problems with IPython support. ([#1649](https://github.com/cocotb/cocotb/pull/1649) ) ([#2462](https://github.com/cocotb/cocotb/pull/2462) ) * Add dependency on [cocotb\_bus](https://github.com/cocotb/cocotb-bus) to prevent breaking users that were previously using the bus and testbenching objects. ([#2477](https://github.com/cocotb/cocotb/pull/2477) ) * Add back functionality to [`cocotb.binary.BinaryValue`](https://docs.cocotb.org/en/stable/library_reference.html#cocotb.binary.BinaryValue "cocotb.binary.BinaryValue") that allows the user to change `binaryRepresentation` after object creation. ([#2480](https://github.com/cocotb/cocotb/pull/2480) ) cocotb 1.5.0 (2021-03-11)[](https://docs.cocotb.org/en/stable/release_notes.html#cocotb-1-5-0-2021-03-11 "Link to this heading") ---------------------------------------------------------------------------------------------------------------------------------- ### Features[](https://docs.cocotb.org/en/stable/release_notes.html#id27 "Link to this heading") * Support for building with Microsoft Visual C++ has been added. See [Installation](https://docs.cocotb.org/en/stable/install.html#install) for more details. ([#1798](https://github.com/cocotb/cocotb/pull/1798) ) * Makefiles now automatically deduce [`TOPLEVEL_LANG`](https://docs.cocotb.org/en/stable/building.html#var-TOPLEVEL_LANG) based on the value of [`VERILOG_SOURCES`](https://docs.cocotb.org/en/stable/building.html#var-VERILOG_SOURCES) and [`VHDL_SOURCES`](https://docs.cocotb.org/en/stable/building.html#var-VHDL_SOURCES) . Makefiles also detect incorrect usage of [`TOPLEVEL_LANG`](https://docs.cocotb.org/en/stable/building.html#var-TOPLEVEL_LANG) for simulators that only support one language. ([#1982](https://github.com/cocotb/cocotb/pull/1982) ) * [`cocotb.fork()`](https://docs.cocotb.org/en/stable/library_reference.html#cocotb.fork "cocotb.fork") will now raise a descriptive [`TypeError`](https://docs.python.org/3/library/exceptions.html#TypeError "(in Python v3.13)") if a coroutine function is passed into them. ([#2006](https://github.com/cocotb/cocotb/pull/2006) ) * Added [`cocotb.scheduler.start_soon`](https://docs.cocotb.org/en/stable/library_reference.html#cocotb.scheduler.Scheduler.start_soon "cocotb.scheduler.Scheduler.start_soon") which schedules a coroutine to start _after_ the current coroutine yields control. This behavior is distinct from [`cocotb.fork()`](https://docs.cocotb.org/en/stable/library_reference.html#cocotb.fork "cocotb.fork") which schedules the given coroutine immediately. ([#2023](https://github.com/cocotb/cocotb/pull/2023) ) * If `pytest` is installed, its assertion-rewriting framework will be used to produce more informative tracebacks from the [`assert`](https://docs.python.org/3/reference/simple_stmts.html#assert "(in Python v3.13)") statement. ([#2028](https://github.com/cocotb/cocotb/pull/2028) ) * The handle to [`TOPLEVEL`](https://docs.cocotb.org/en/stable/building.html#envvar-TOPLEVEL) , typically seen as the first argument to a cocotb test function, is now available globally as [`cocotb.top`](https://docs.cocotb.org/en/stable/library_reference.html#cocotb.top "cocotb.top") . ([#2134](https://github.com/cocotb/cocotb/pull/2134) ) * The `units` argument to [`Timer`](https://docs.cocotb.org/en/stable/triggers.html#cocotb.triggers.Timer "cocotb.triggers.Timer") , [`Clock`](https://docs.cocotb.org/en/stable/library_reference.html#cocotb.clock.Clock "cocotb.clock.Clock") and [`get_sim_steps()`](https://docs.cocotb.org/en/stable/library_reference.html#cocotb.utils.get_sim_steps "cocotb.utils.get_sim_steps") , and the `timeout_unit` argument to [`with_timeout()`](https://docs.cocotb.org/en/stable/triggers.html#cocotb.triggers.with_timeout "cocotb.triggers.with_timeout") and [`cocotb.test`](https://docs.cocotb.org/en/stable/library_reference.html#cocotb.test "cocotb.test") now accepts `'step'` to mean the simulator time step. This used to be expressed using `None`, which is now deprecated. ([#2171](https://github.com/cocotb/cocotb/pull/2171) ) * [`TestFactory.add_option()`](https://docs.cocotb.org/en/stable/library_reference.html#cocotb.regression.TestFactory.add_option "cocotb.regression.TestFactory.add_option") now supports groups of options when a full Cartesian product is not desired. ([#2175](https://github.com/cocotb/cocotb/pull/2175) ) * Added asyncio-style queues, [`Queue`](https://docs.cocotb.org/en/stable/library_reference.html#cocotb.queue.Queue "cocotb.queue.Queue") , [`PriorityQueue`](https://docs.cocotb.org/en/stable/library_reference.html#cocotb.queue.PriorityQueue "cocotb.queue.PriorityQueue") , and [`LifoQueue`](https://docs.cocotb.org/en/stable/library_reference.html#cocotb.queue.LifoQueue "cocotb.queue.LifoQueue") . ([#2297](https://github.com/cocotb/cocotb/pull/2297) ) * Support for the SystemVerilog type `bit` has been added. ([#2322](https://github.com/cocotb/cocotb/pull/2322) ) * Added the `--lib-dir`, `--lib-name` and `--lib-name-path` options to the `cocotb-config` command to make cocotb integration into existing flows easier. ([#2387](https://github.com/cocotb/cocotb/pull/2387) ) * Support for using Questa’s VHPI has been added. Use [`VHDL_GPI_INTERFACE`](https://docs.cocotb.org/en/stable/building.html#var-VHDL_GPI_INTERFACE) to select between using the FLI or VHPI when dealing with VHDL simulations. Note that VHPI support in Questa is still experimental at this time. ([#2408](https://github.com/cocotb/cocotb/pull/2408) ) ### Bugfixes[](https://docs.cocotb.org/en/stable/release_notes.html#id28 "Link to this heading") * Assigning Python integers to signals greater than 32 bits wide will now work correctly for negative values. ([#913](https://github.com/cocotb/cocotb/pull/913) ) * Fix GHDL’s library search path, allowing libraries other than _work_ to be used in simulation. ([#2038](https://github.com/cocotb/cocotb/pull/2038) ) * Tests skipped by default (created with skip=True) can again be run manually by setting the [`TESTCASE`](https://docs.cocotb.org/en/stable/building.html#envvar-TESTCASE) variable. ([#2045](https://github.com/cocotb/cocotb/pull/2045) ) * In [Icarus Verilog](https://docs.cocotb.org/en/stable/simulator_support.html#sim-icarus) , generate blocks are now accessible directly via lookup without having to iterate over parent handle. ([#2079](https://github.com/cocotb/cocotb/pull/2079) , [#2143](https://github.com/cocotb/cocotb/pull/2143) ) > \# Example pseudo-region > dut.genblk1 # * Fixed an issue with VHPI on Mac OS and Linux where negative integers were returned as large positive values. ([#2129](https://github.com/cocotb/cocotb/pull/2129) ) ### Improved Documentation[](https://docs.cocotb.org/en/stable/release_notes.html#id29 "Link to this heading") * The [Mixed-signal (analog/digital)](https://docs.cocotb.org/en/stable/examples.html#mixed-signal) example has been added, showing how to use HDL helper modules in cocotb testbenches that exercise two mixed-signal (i.e. analog and digital) designs. ([#1051](https://github.com/cocotb/cocotb/pull/1051) ) * New example [Matrix Multiplier](https://docs.cocotb.org/en/stable/examples.html#matrix-multiplier) . ([#1502](https://github.com/cocotb/cocotb/pull/1502) ) * A [Reference Card](https://docs.cocotb.org/en/stable/refcard.html#refcard) showing the most used features of cocotb has been added. ([#2321](https://github.com/cocotb/cocotb/pull/2321) ) * A chapter [Extending existing build flows](https://docs.cocotb.org/en/stable/custom_flows.html#custom-flows) has been added. ([#2340](https://github.com/cocotb/cocotb/pull/2340) ) ### Deprecations and Removals[](https://docs.cocotb.org/en/stable/release_notes.html#id30 "Link to this heading") * The contents of `cocotb.generators` have been deprecated. ([#2047](https://github.com/cocotb/cocotb/pull/2047) ) * The outdated “Sorter” example has been removed from the documentation. ([#2049](https://github.com/cocotb/cocotb/pull/2049) ) * Passing [`bool`](https://docs.python.org/3/library/functions.html#bool "(in Python v3.13)") values to `expect_error` option of [`cocotb.test`](https://docs.cocotb.org/en/stable/library_reference.html#cocotb.test "cocotb.test") is deprecated. Pass a specific [`Exception`](https://docs.python.org/3/library/exceptions.html#Exception "(in Python v3.13)") or a tuple of Exceptions instead. ([#2117](https://github.com/cocotb/cocotb/pull/2117) ) * The system task overloads for `$info`, `$warn`, `$error` and `$fatal` in Verilog and mixed language testbenches have been removed. ([#2133](https://github.com/cocotb/cocotb/pull/2133) ) * [`TestError`](https://docs.cocotb.org/en/stable/library_reference.html#cocotb.result.TestError "cocotb.result.TestError") has been deprecated, use [Built-in Exceptions](https://docs.python.org/3/library/exceptions.html#bltin-exceptions "(in Python v3.13)") . ([#2177](https://github.com/cocotb/cocotb/pull/2177) ) * The undocumented class `cocotb.xunit_reporter.File` has been removed. ([#2200](https://github.com/cocotb/cocotb/pull/2200) ) * Deprecated `cocotb.hook` and `COCOTB_HOOKS`. See the documentation for `cocotb.hook` for suggestions on alternatives. ([#2201](https://github.com/cocotb/cocotb/pull/2201) ) * Deprecate [`pack()`](https://docs.cocotb.org/en/stable/library_reference.html#cocotb.utils.pack "cocotb.utils.pack") and [`unpack()`](https://docs.cocotb.org/en/stable/library_reference.html#cocotb.utils.unpack "cocotb.utils.unpack") and the use of [`ctypes.Structure`](https://docs.python.org/3/library/ctypes.html#ctypes.Structure "(in Python v3.13)") in signal assignments. ([#2203](https://github.com/cocotb/cocotb/pull/2203) ) * The outdated “ping” example has been removed from the documentation and repository. ([#2232](https://github.com/cocotb/cocotb/pull/2232) ) * Using the undocumented custom format [`dict`](https://docs.python.org/3/library/stdtypes.html#dict "(in Python v3.13)") object in signal assignments has been deprecated. ([#2240](https://github.com/cocotb/cocotb/pull/2240) ) * The access modes of many interfaces in the cocotb core libraries were re-evaluated. Some interfaces that were previously public are now private and vice versa. Accessing the methods through their old name will create a [`DeprecationWarning`](https://docs.python.org/3/library/exceptions.html#DeprecationWarning "(in Python v3.13)") . In the future, the deprecated names will be removed. ([#2278](https://github.com/cocotb/cocotb/pull/2278) ) * The bus and testbenching components in cocotb have been officially moved to the [cocotb-bus](https://github.com/cocotb/cocotb-bus) package. This includes `Bus`, `Scoreboard`, everything in `cocotb_bus.drivers`, and everything in `cocotb_bus.monitors`. Documentation will remain in the main cocotb repository for now. Old names will continue to exist, but their use will cause a [`DeprecationWarning`](https://docs.python.org/3/library/exceptions.html#DeprecationWarning "(in Python v3.13)") , and will be removed in the future. ([#2289](https://github.com/cocotb/cocotb/pull/2289) ) ### Changes[](https://docs.cocotb.org/en/stable/release_notes.html#id32 "Link to this heading") * Assigning negative Python integers to handles does an implicit two’s compliment conversion. ([#913](https://github.com/cocotb/cocotb/pull/913) ) * Updated `Driver`, `Monitor`, and all their subclasses to use the [`async`](https://docs.python.org/3/reference/compound_stmts.html#async "(in Python v3.13)") /[`await`](https://docs.python.org/3/reference/expressions.html#await "(in Python v3.13)") syntax instead of the [`yield`](https://docs.python.org/3/reference/simple_stmts.html#yield "(in Python v3.13)") syntax. ([#2022](https://github.com/cocotb/cocotb/pull/2022) ) * The package build process is now fully [**PEP 517**](https://peps.python.org/pep-0517/) compliant. ([#2091](https://github.com/cocotb/cocotb/pull/2091) ) * Improved support and performance for [Verilator](https://docs.cocotb.org/en/stable/simulator_support.html#sim-verilator) (version 4.106 or later now required). ([#2105](https://github.com/cocotb/cocotb/pull/2105) ) * Changed how libraries are specified in [`GPI_EXTRA`](https://docs.cocotb.org/en/stable/building.html#envvar-GPI_EXTRA) to allow specifying libraries with paths, and names that don’t start with “lib”. ([#2341](https://github.com/cocotb/cocotb/pull/2341) ) Cocotb 1.4.0 (2020-07-08)[](https://docs.cocotb.org/en/stable/release_notes.html#cocotb-1-4-0-2020-07-08 "Link to this heading") ---------------------------------------------------------------------------------------------------------------------------------- ### Features[](https://docs.cocotb.org/en/stable/release_notes.html#id33 "Link to this heading") * [`Lock`](https://docs.cocotb.org/en/stable/triggers.html#cocotb.triggers.Lock "cocotb.triggers.Lock") can now be used in [`async with`](https://docs.python.org/3/reference/compound_stmts.html#async-with "(in Python v3.13)") statements. ([#1031](https://github.com/cocotb/cocotb/pull/1031) ) * Add support for distinguishing between `net` (`vpiNet`) and `reg` (`vpiReg`) type when using the VPI interface. ([#1107](https://github.com/cocotb/cocotb/pull/1107) ) * Support for dropping into [`pdb`](https://docs.python.org/3/library/pdb.html#module-pdb "(in Python v3.13)") upon failure, via the new [`COCOTB_PDB_ON_EXCEPTION`](https://docs.cocotb.org/en/stable/building.html#envvar-COCOTB_PDB_ON_EXCEPTION) environment variable. ([#1180](https://github.com/cocotb/cocotb/pull/1180) ) * Simulators run through a Tcl script (Aldec Riviera Pro and Mentor simulators) now support a new [`RUN_ARGS`](https://docs.cocotb.org/en/stable/building.html#var-RUN_ARGS) Makefile variable, which is passed to the first invocation of the tool during runtime. ([#1244](https://github.com/cocotb/cocotb/pull/1244) ) * Cocotb now supports the following example of forking a _non-decorated_ [async coroutine](https://docs.cocotb.org/en/stable/coroutines.html#async-functions) . async def example(): for i in range(10): await cocotb.triggers.Timer(10, "ns") cocotb.fork(example()) Issue ([#1255](https://github.com/cocotb/cocotb/pull/1255) ) * The cocotb log configuration is now less intrusive, and only configures the root logger instance, `logging.getLogger()`, as part of [`cocotb.log.default_config()`](https://docs.cocotb.org/en/stable/library_reference.html#cocotb.log.default_config "cocotb.log.default_config") ([#1266](https://github.com/cocotb/cocotb/pull/1266) ). As such, it is now possible to override the default cocotb logging behavior with something like: \# remove the cocotb log handler and formatting root \= logging.getLogger() for h in root.handlers\[:\]: root.remove\_handler(h) h.close() \# add your own logging.basicConfig() * Support for `vpiRealNet`. ([#1282](https://github.com/cocotb/cocotb/pull/1282) ) * The colored output can now be disabled by the [`NO_COLOR`](https://docs.cocotb.org/en/stable/building.html#envvar-NO_COLOR) environment variable. ([#1309](https://github.com/cocotb/cocotb/pull/1309) ) * Cocotb now supports deposit/force/release/freeze actions on simulator handles, exposing functionality similar to the respective Verilog/VHDL assignments. from cocotb.handle import Deposit, Force, Release, Freeze dut.q <= 1 \# A regular value deposit dut.q <= Deposit(1) \# The same, higher verbosity dut.q <= Force(1) \# Force value of q to 1 dut.q <= Release() \# Release q from a Force dut.q <= Freeze() \# Freeze the current value of q Issue ([#1403](https://github.com/cocotb/cocotb/pull/1403) ) * Custom logging handlers can now access the simulator time using [`logging.LogRecord.created_sim_time`](https://docs.cocotb.org/en/stable/library_reference.html#logging.LogRecord.created_sim_time "logging.LogRecord.created_sim_time") , provided the [`SimTimeContextFilter`](https://docs.cocotb.org/en/stable/library_reference.html#cocotb.log.SimTimeContextFilter "cocotb.log.SimTimeContextFilter") filter added by [`default_config()`](https://docs.cocotb.org/en/stable/library_reference.html#cocotb.log.default_config "cocotb.log.default_config") is not removed from the logger instance. ([#1411](https://github.com/cocotb/cocotb/pull/1411) ) * Questa now supports `PLUSARGS`. This requires that `tcl.h` be present on the system. This is likely included in your installation of Questa, otherwise, specify `CFLAGS=-I/path/to/tcl/includedir`. ([#1424](https://github.com/cocotb/cocotb/pull/1424) ) * The name of the entry point symbol for libraries in [`GPI_EXTRA`](https://docs.cocotb.org/en/stable/building.html#envvar-GPI_EXTRA) can now be customized. The delimiter between each library in the list has changed from `:` to `,`. ([#1457](https://github.com/cocotb/cocotb/pull/1457) ) * New methods for setting the value of a [`NonHierarchyIndexableObject`](https://docs.cocotb.org/en/stable/library_reference.html#cocotb.handle.NonHierarchyIndexableObject "cocotb.handle.NonHierarchyIndexableObject") (HDL arrays). ([#1507](https://github.com/cocotb/cocotb/pull/1507) ) \# Now supported dut.some\_array <= \[0xAA, 0xBB, 0xCC\] dut.some\_array.value \= \[0xAA, 0xBB, 0xCC\] \# For simulators that support n-dimensional arrays dut.some\_2d\_array <= \[\[0xAA, 0xBB\], \[0xCC, 0xDD\]\] dut.some\_2d\_array.value \= \[\[0xAA, 0xBB\], \[0xCC, 0xDD\]\] * Added support for Aldec’s Active-HDL simulator. ([#1601](https://github.com/cocotb/cocotb/pull/1601) ) * Including `Makefile.inc` from user makefiles is now a no-op and deprecated. Lines like `include $(shell cocotb-config --makefiles)/Makefile.inc` can be removed from user makefiles without loss in functionality. ([#1629](https://github.com/cocotb/cocotb/pull/1629) ) * Support for using `await` inside an embedded IPython terminal, using [`cocotb.ipython_support`](https://docs.cocotb.org/en/stable/troubleshooting.html#module-cocotb.ipython_support "cocotb.ipython_support") . ([#1649](https://github.com/cocotb/cocotb/pull/1649) ) * Added [`is_set()`](https://docs.cocotb.org/en/stable/triggers.html#cocotb.triggers.Event.is_set "cocotb.triggers.Event.is_set") , so users may check if an [`Event`](https://docs.cocotb.org/en/stable/triggers.html#cocotb.triggers.Event "cocotb.triggers.Event") has fired. ([#1723](https://github.com/cocotb/cocotb/pull/1723) ) * The [`cocotb.simulator.is_running()`](https://docs.cocotb.org/en/stable/library_reference.html#cocotb.simulator.is_running "cocotb.simulator.is_running") function was added so a user of cocotb could determine if they are running within a simulator. ([#1843](https://github.com/cocotb/cocotb/pull/1843) ) ### Bugfixes[](https://docs.cocotb.org/en/stable/release_notes.html#id34 "Link to this heading") * Tests which fail at initialization, for instance due to no `yield` being present, are no longer silently ignored. ([#1253](https://github.com/cocotb/cocotb/pull/1253) ) * Tests that were not run because predecessors threw [`cocotb.result.SimFailure`](https://docs.cocotb.org/en/stable/library_reference.html#cocotb.result.SimFailure "cocotb.result.SimFailure") , and caused the simulator to exit, are now recorded with an outcome of [`cocotb.result.SimFailure`](https://docs.cocotb.org/en/stable/library_reference.html#cocotb.result.SimFailure "cocotb.result.SimFailure") . Previously, these tests were ignored. ([#1279](https://github.com/cocotb/cocotb/pull/1279) ) * Makefiles now correctly fail if the simulation crashes before a `results.xml` file can be written. ([#1314](https://github.com/cocotb/cocotb/pull/1314) ) * Logging of non-string messages with colored log output is now working. ([#1410](https://github.com/cocotb/cocotb/pull/1410) ) * Getting and setting the value of a [`NonHierarchyIndexableObject`](https://docs.cocotb.org/en/stable/library_reference.html#cocotb.handle.NonHierarchyIndexableObject "cocotb.handle.NonHierarchyIndexableObject") now iterates through the correct range of the simulation object, so arrays that do not start/end at index 0 are supported. ([#1507](https://github.com/cocotb/cocotb/pull/1507) ) * The `XGMII` monitor no longer crashes on Python 3, and now assembles packets as [`bytes`](https://docs.python.org/3/library/stdtypes.html#bytes "(in Python v3.13)") instead of [`str`](https://docs.python.org/3/library/stdtypes.html#str "(in Python v3.13)") . The `XGMII` driver has expected [`bytes`](https://docs.python.org/3/library/stdtypes.html#bytes "(in Python v3.13)") since cocotb 1.2.0. ([#1545](https://github.com/cocotb/cocotb/pull/1545) ) * `signal <= value_of_wrong_type` no longer breaks the scheduler, and throws an error immediately. ([#1661](https://github.com/cocotb/cocotb/pull/1661) ) * Scheduling behavior is now consistent before and after the first [`await`](https://docs.python.org/3/reference/expressions.html#await "(in Python v3.13)") of a [`GPITrigger`](https://docs.cocotb.org/en/stable/library_reference.html#cocotb.triggers.GPITrigger "cocotb.triggers.GPITrigger") . ([#1705](https://github.com/cocotb/cocotb/pull/1705) ) * Iterating over `for generate` statements using VHPI has been fixed. This bug caused some simulators to crash, and was a regression in version 1.3. ([#1882](https://github.com/cocotb/cocotb/pull/1882) ) * The `XGMII` driver no longer emits a corrupted word on the first transfer. ([#1905](https://github.com/cocotb/cocotb/pull/1905) ) ### Improved Documentation[](https://docs.cocotb.org/en/stable/release_notes.html#id35 "Link to this heading") * If a makefile uses cocotb’s `Makefile.sim`, `make help` now lists the supported targets and variables. ([#1318](https://github.com/cocotb/cocotb/pull/1318) ) * A new section [Rotating Log Files](https://docs.cocotb.org/en/stable/rotating_logger.html#rotating-logger) has been added. ([#1400](https://github.com/cocotb/cocotb/pull/1400) ) * The documentation at [http://docs.cocotb.org/](http://docs.cocotb.org/) has been restructured, making it easier to find relevant information. ([#1482](https://github.com/cocotb/cocotb/pull/1482) ) ### Deprecations and Removals[](https://docs.cocotb.org/en/stable/release_notes.html#id36 "Link to this heading") * [`cocotb.utils.reject_remaining_kwargs()`](https://docs.cocotb.org/en/stable/library_reference.html#cocotb.utils.reject_remaining_kwargs "cocotb.utils.reject_remaining_kwargs") is deprecated, as it is no longer needed now that we only support Python 3.5 and newer. ([#1339](https://github.com/cocotb/cocotb/pull/1339) ) * The value of [`cocotb.handle.StringObject`](https://docs.cocotb.org/en/stable/library_reference.html#cocotb.handle.StringObject "cocotb.handle.StringObject") s is now of type [`bytes`](https://docs.python.org/3/library/stdtypes.html#bytes "(in Python v3.13)") , instead of [`str`](https://docs.python.org/3/library/stdtypes.html#str "(in Python v3.13)") with an implied ASCII encoding scheme. ([#1381](https://github.com/cocotb/cocotb/pull/1381) ) * `ReturnValue` is now deprecated. Use a [`return`](https://docs.python.org/3/reference/simple_stmts.html#return "(in Python v3.13)") statement instead; this works in all supported versions of Python. ([#1489](https://github.com/cocotb/cocotb/pull/1489) ) * The makefile variable `VERILATOR_TRACE` that was not supported for all simulators has been deprecated. Using it prints a deprecation warning and points to the documentation section [Simulator Support](https://docs.cocotb.org/en/stable/simulator_support.html#simulator-support) explaining how to get the same effect by other means. ([#1495](https://github.com/cocotb/cocotb/pull/1495) ) * `BinaryValue.get_hex_buff` produced nonsense and has been removed. ([#1511](https://github.com/cocotb/cocotb/pull/1511) ) * Passing [`str`](https://docs.python.org/3/library/stdtypes.html#str "(in Python v3.13)") instances to [`cocotb.utils.hexdump()`](https://docs.cocotb.org/en/stable/library_reference.html#cocotb.utils.hexdump "cocotb.utils.hexdump") and [`cocotb.utils.hexdiffs()`](https://docs.cocotb.org/en/stable/library_reference.html#cocotb.utils.hexdiffs "cocotb.utils.hexdiffs") is deprecated. [`bytes`](https://docs.python.org/3/library/stdtypes.html#bytes "(in Python v3.13)") objects should be passed instead. ([#1519](https://github.com/cocotb/cocotb/pull/1519) ) * `Makefile.pylib`, which provided helpers for building C extension modules for Python, has been removed. Users of the `PYTHON_LIBDIR` and `PYTHON_INCLUDEDIR` variables will now have to compute these values themselves. See the `endian_swapper` example for how to do this. ([#1632](https://github.com/cocotb/cocotb/pull/1632) ) * Makefile and documentation for the NVC simulator which has never worked have been removed. ([#1693](https://github.com/cocotb/cocotb/pull/1693) ) ### Changes[](https://docs.cocotb.org/en/stable/release_notes.html#id37 "Link to this heading") * Cocotb no longer supports Python 2, at least Python 3.5 is now required. Users of Python 2.7 can still use cocotb 1.3, but are heavily encouraged to update. It is recommended to use the latest release of Python 3 for improved performance over older Python 3 versions. ([#767](https://github.com/cocotb/cocotb/pull/767) ) * Mentor Questa, Aldec Riviera-PRO and GHDL are now started in the directory containing the Makefile and also save `results.xml` there, bringing them in line with the behavior used by other simulators. ([#1598](https://github.com/cocotb/cocotb/pull/1598) ) ([#1599](https://github.com/cocotb/cocotb/pull/1599) ) ([#1063](https://github.com/cocotb/cocotb/pull/1063) ) * Tests are now evaluated in order of their appearance in the [`MODULE`](https://docs.cocotb.org/en/stable/building.html#envvar-MODULE) environment variable, their stage, and the order of invocation of the [`cocotb.test`](https://docs.cocotb.org/en/stable/library_reference.html#cocotb.test "cocotb.test") decorator within a module. ([#1380](https://github.com/cocotb/cocotb/pull/1380) ) * All libraries are compiled during installation to the `cocotb/libs` directory. The interface libraries `libcocotbvpi` and `libcocotbvhpi` have been renamed to have a `_simulator_name` postfix. The `simulator` module has moved to [`cocotb.simulator`](https://docs.cocotb.org/en/stable/library_reference.html#module-cocotb.simulator "cocotb.simulator") . The `LD_LIBRARY_PATH` environment variable no longer needs to be set by the makefiles, as the libraries now discover each other via `RPATH` settings. ([#1425](https://github.com/cocotb/cocotb/pull/1425) ) * Cocotb must now be [installed](https://docs.cocotb.org/en/stable/install.html#installation-via-pip) before it can be used. ([#1445](https://github.com/cocotb/cocotb/pull/1445) ) * [`cocotb.handle.NonHierarchyIndexableObject.value`](https://docs.cocotb.org/en/stable/library_reference.html#cocotb.handle.NonHierarchyIndexableObject.value "cocotb.handle.NonHierarchyIndexableObject.value") is now a list in left-to-right range order of the underlying simulation object. Previously the list was always ordered low-to-high. ([#1507](https://github.com/cocotb/cocotb/pull/1507) ) * Various binary representations have changed type from [`str`](https://docs.python.org/3/library/stdtypes.html#str "(in Python v3.13)") to [`bytes`](https://docs.python.org/3/library/stdtypes.html#bytes "(in Python v3.13)") . These include: * [`cocotb.binary.BinaryValue.buff`](https://docs.cocotb.org/en/stable/library_reference.html#cocotb.binary.BinaryValue.buff "cocotb.binary.BinaryValue.buff") , which as a consequence means [`cocotb.binary.BinaryValue.assign()`](https://docs.cocotb.org/en/stable/library_reference.html#cocotb.binary.BinaryValue.assign "cocotb.binary.BinaryValue.assign") no longer accepts malformed `10xz`\-style [`str`](https://docs.python.org/3/library/stdtypes.html#str "(in Python v3.13)") s (which were treated as binary). * The objects produced by `cocotb.generators.byte`, which means that single bytes are represented by [`int`](https://docs.python.org/3/library/functions.html#int "(in Python v3.13)") instead of 1-character [`str`](https://docs.python.org/3/library/stdtypes.html#str "(in Python v3.13)") s. * The packets produced by the `AvalonSTPkts`. Code working with these objects may find it needs to switch from creating [`str`](https://docs.python.org/3/library/stdtypes.html#str "(in Python v3.13)") objects like `"this"` to [`bytes`](https://docs.python.org/3/library/stdtypes.html#bytes "(in Python v3.13)") objects like `b"this"`. This change is a consequence of the move to Python 3. ([#1514](https://github.com/cocotb/cocotb/pull/1514) ) * There’s no longer any need to set the `PYTHON_BIN` makefile variable, the Python executable automatically matches the one cocotb was installed into. ([#1574](https://github.com/cocotb/cocotb/pull/1574) ) * The [`SIM`](https://docs.cocotb.org/en/stable/building.html#var-SIM) setting for Aldec Riviera-PRO has changed from `aldec` to `riviera`. ([#1691](https://github.com/cocotb/cocotb/pull/1691) ) * Certain methods on the [`cocotb.simulator`](https://docs.cocotb.org/en/stable/library_reference.html#module-cocotb.simulator "cocotb.simulator") Python module now throw a [`RuntimeError`](https://docs.python.org/3/library/exceptions.html#RuntimeError "(in Python v3.13)") when no simulator is present, making it safe to use `cocotb` without a simulator present. ([#1843](https://github.com/cocotb/cocotb/pull/1843) ) * Invalid values of the environment variable [`COCOTB_LOG_LEVEL`](https://docs.cocotb.org/en/stable/building.html#envvar-COCOTB_LOG_LEVEL) are no longer ignored. They now raise an exception with instructions how to fix the problem. ([#1898](https://github.com/cocotb/cocotb/pull/1898) ) cocotb 1.3.2[](https://docs.cocotb.org/en/stable/release_notes.html#cocotb-1-3-2 "Link to this heading") ---------------------------------------------------------------------------------------------------------- Released on 08 July 2020 ### Notable changes and bug fixes[](https://docs.cocotb.org/en/stable/release_notes.html#notable-changes-and-bug-fixes "Link to this heading") * Iterating over `for generate` statements using VHPI has been fixed. This bug caused some simulators to crash, and was a regression in version 1.3.1. ([#1882](https://github.com/cocotb/cocotb/pull/1882) ) cocotb 1.3.1[](https://docs.cocotb.org/en/stable/release_notes.html#cocotb-1-3-1 "Link to this heading") ---------------------------------------------------------------------------------------------------------- Released on 15 March 2020 ### Notable changes and bug fixes[](https://docs.cocotb.org/en/stable/release_notes.html#id38 "Link to this heading") * The Makefiles for the Aldec Riviera and Cadence Incisive simulators have been fixed to use the correct name of the VHPI library (`libcocotbvhpi`). This bug prevented VHDL designs from being simulated, and was a regression in 1.3.0. ([#1472](https://github.com/cocotb/cocotb/pull/1472) ) cocotb 1.3.0[](https://docs.cocotb.org/en/stable/release_notes.html#cocotb-1-3-0 "Link to this heading") ---------------------------------------------------------------------------------------------------------- Released on 08 January 2020 This will likely be the last release to support Python 2.7. ### New features[](https://docs.cocotb.org/en/stable/release_notes.html#new-features "Link to this heading") * Initial support for the [Verilator](https://docs.cocotb.org/en/stable/simulator_support.html#sim-verilator) simulator (version 4.020 and above). The integration of Verilator into cocotb is not yet as fast or as powerful as it is for other simulators. Please use the latest version of Verilator, and [report bugs](https://github.com/cocotb/cocotb/issues/new) if you experience problems. * New makefile variables [`COCOTB_HDL_TIMEUNIT`](https://docs.cocotb.org/en/stable/building.html#var-COCOTB_HDL_TIMEUNIT) and [`COCOTB_HDL_TIMEPRECISION`](https://docs.cocotb.org/en/stable/building.html#var-COCOTB_HDL_TIMEPRECISION) for setting the default time unit and precision that should be assumed for simulation when not specified by modules in the design. ([#1113](https://github.com/cocotb/cocotb/pull/1113) ) * New `timeout_time` and `timeout_unit` arguments to [`cocotb.test()`](https://docs.cocotb.org/en/stable/library_reference.html#cocotb.test "cocotb.test") , for adding test timeouts. ([#1119](https://github.com/cocotb/cocotb/pull/1119) ) * [`with_timeout()`](https://docs.cocotb.org/en/stable/triggers.html#cocotb.triggers.with_timeout "cocotb.triggers.with_timeout") , for a shorthand for waiting for a trigger with a timeout. ([#1119](https://github.com/cocotb/cocotb/pull/1119) ) * The `expect_error` argument to [`cocotb.test()`](https://docs.cocotb.org/en/stable/library_reference.html#cocotb.test "cocotb.test") now accepts a specific exception type. ([#1116](https://github.com/cocotb/cocotb/pull/1116) ) * New environment variable [`COCOTB_RESULTS_FILE`](https://docs.cocotb.org/en/stable/building.html#envvar-COCOTB_RESULTS_FILE) , to allow configuration of the xUnit XML output filename. ([#1053](https://github.com/cocotb/cocotb/pull/1053) ) * A new `bus_separator` argument to `cocotb.drivers.BusDriver`. ([#1160](https://github.com/cocotb/cocotb/pull/1160) ) * A new `start_high` argument to [`cocotb.clock.Clock.start()`](https://docs.cocotb.org/en/stable/library_reference.html#cocotb.clock.Clock.start "cocotb.clock.Clock.start") . ([#1036](https://github.com/cocotb/cocotb/pull/1036) ) * A new `cocotb.__version__` constant, which contains the version number of the running cocotb. ([#1196](https://github.com/cocotb/cocotb/pull/1196) ) ### Notable changes and bug fixes[](https://docs.cocotb.org/en/stable/release_notes.html#id39 "Link to this heading") * `DeprecationWarning`s are now shown in the output by default. * Tracebacks are now preserved correctly for exceptions in Python 2. The tracebacks in all Python versions are now a little shorter. * [`cocotb.external()`](https://docs.cocotb.org/en/stable/library_reference.html#cocotb.external "cocotb.external") and [`cocotb.function()`](https://docs.cocotb.org/en/stable/library_reference.html#cocotb.function "cocotb.function") now work more reliably and with fewer race conditions. * A failing `assert` will be considered a test failure. Previously, it was considered a test _error_. * [`drivers()`](https://docs.cocotb.org/en/stable/library_reference.html#cocotb.handle.NonConstantObject.drivers "cocotb.handle.NonConstantObject.drivers") and [`loads()`](https://docs.cocotb.org/en/stable/library_reference.html#cocotb.handle.NonConstantObject.loads "cocotb.handle.NonConstantObject.loads") now also work correctly in Python 3.7 onwards. * [`Timer`](https://docs.cocotb.org/en/stable/triggers.html#cocotb.triggers.Timer "cocotb.triggers.Timer") can now be used with [`decimal.Decimal`](https://docs.python.org/3/library/decimal.html#decimal.Decimal "(in Python v3.13)") instances, allowing constructs like `Timer(Decimal("1e-9"), units="sec")` as an alternate spelling for `Timer(100, units="us")`. ([#1114](https://github.com/cocotb/cocotb/pull/1114) ) * Many (editorial) documentation improvements. ### Deprecations[](https://docs.cocotb.org/en/stable/release_notes.html#deprecations "Link to this heading") * `cocotb.result.raise_error` and `cocotb.result.create_error` are deprecated in favor of using Python exceptions directly. [`TestError`](https://docs.cocotb.org/en/stable/library_reference.html#cocotb.result.TestError "cocotb.result.TestError") can still be used if the same exception type is desired. ([#1109](https://github.com/cocotb/cocotb/pull/1109) ) * The `AvalonSTPktsWithChannel` type is deprecated. Use the `report_channel` argument to `AvalonSTPkts` instead. * The `colour` attribute of log objects like `cocotb.log` or `some_coro.log` is deprecated. Use [`cocotb.utils.want_color_output()`](https://docs.cocotb.org/en/stable/library_reference.html#cocotb.utils.want_color_output "cocotb.utils.want_color_output") instead. ([#1231](https://github.com/cocotb/cocotb/pull/1231) ) ### Other news[](https://docs.cocotb.org/en/stable/release_notes.html#other-news "Link to this heading") * cocotb is now packaged for Fedora Linux and available as [python-cocotb](https://apps.fedoraproject.org/packages/python-cocotb) . ([Fedora bug #1747574](https://bugzilla.redhat.com/show_bug.cgi?id=1747574) ) (thanks Ben Rosser) cocotb 1.2.0[](https://docs.cocotb.org/en/stable/release_notes.html#cocotb-1-2-0 "Link to this heading") ---------------------------------------------------------------------------------------------------------- Released on 24 July 2019 ### New features[](https://docs.cocotb.org/en/stable/release_notes.html#id40 "Link to this heading") * cocotb is now built as Python package and installable through pip. ([#517](https://github.com/cocotb/cocotb/pull/517) , [#799](https://github.com/cocotb/cocotb/pull/799) , [#800](https://github.com/cocotb/cocotb/pull/800) , [#803](https://github.com/cocotb/cocotb/pull/803) , [#805](https://github.com/cocotb/cocotb/pull/805) ) * Support for `async` functions and generators was added (Python 3 only). Please have a look at [Coroutines and Tasks](https://docs.cocotb.org/en/stable/coroutines.html#async-functions) for an example how to use this new feature. * VHDL block statements can be traversed. ([#850](https://github.com/cocotb/cocotb/pull/850) ) * Support for Python 3.7 was added. ### Notable changes and bug fixes[](https://docs.cocotb.org/en/stable/release_notes.html#id41 "Link to this heading") * The heart of cocotb, its scheduler, is now even more robust. Many small bugs, inconsistencies and unreliable behavior have been ironed out. * Exceptions are now correctly propagated between coroutines, giving users the “natural” behavior they’d expect with exceptions. ([#633](https://github.com/cocotb/cocotb/pull/633) ) * The `setimmediatevalue()` function now works for values larger than 32 bit. ([#768](https://github.com/cocotb/cocotb/pull/768) ) * The documentation was cleaned up, improved and extended in various places, making it more consistent and complete. * Tab completion in newer versions of IPython is fixed. ([#825](https://github.com/cocotb/cocotb/pull/825) ) * Python 2.6 is officially not supported any more. cocotb supports Python 2.7 and Python 3.5+. * The cocotb GitHub project moved from `potentialventures/cocotb` to `cocotb/cocotb`. Redirects for old URLs are in place. ### Deprecations[](https://docs.cocotb.org/en/stable/release_notes.html#id42 "Link to this heading") * The bits argument to [`BinaryValue`](https://docs.cocotb.org/en/stable/library_reference.html#cocotb.binary.BinaryValue "cocotb.binary.BinaryValue") , which is now called n\_bits. * The logger attribute of log objects like `cocotb.log` or `some_coro.log`, which is now just an alias for `self`. * The `cocotb.utils.get_python_integer_types` function, which was intended to be private. ### Known issues[](https://docs.cocotb.org/en/stable/release_notes.html#known-issues "Link to this heading") * Depending on your simulation, cocotb 1.2 might be roughly 20 percent slower than cocotb 1.1. Much of the work in this release cycle went into fixing correctness bugs in the scheduler, sometimes at the cost of performance. We are continuing to investigate this in issue [#961](https://github.com/cocotb/cocotb/issues/961) . Independent of the cocotb version, we recommend using the latest Python 3 version, which is shown to be significantly faster than previous Python 3 versions, and slightly faster than Python 2.7. Please have a look at the [issue tracker](https://github.com/cocotb/cocotb/issues) for more outstanding issues and contribution opportunities. cocotb 1.1[](https://docs.cocotb.org/en/stable/release_notes.html#cocotb-1-1 "Link to this heading") ------------------------------------------------------------------------------------------------------ Released on 24 January 2019. This release is the result of four years of work with too many bug fixes, improvements and refactorings to name them all. Please have a look at the release announcement [on the mailing list](https://lists.librecores.org/pipermail/cocotb/2019-January/000053.html) for further information. cocotb 1.0[](https://docs.cocotb.org/en/stable/release_notes.html#cocotb-1-0 "Link to this heading") ------------------------------------------------------------------------------------------------------ Released on 15 February 2015. ### New features[](https://docs.cocotb.org/en/stable/release_notes.html#id43 "Link to this heading") * FLI support for ModelSim * Mixed Language, Verilog and VHDL * Windows * 300% performance improvement with VHPI interface * WaveDrom support for wave diagrams. cocotb 0.4[](https://docs.cocotb.org/en/stable/release_notes.html#cocotb-0-4 "Link to this heading") ------------------------------------------------------------------------------------------------------ Released on 25 February 2014. ### New features[](https://docs.cocotb.org/en/stable/release_notes.html#id44 "Link to this heading") * Issue [#101](https://github.com/cocotb/cocotb/issues/101) : Implement Lock primitive to support mutex * Issue [#105](https://github.com/cocotb/cocotb/issues/105) : Compatibility with Aldec Riviera-Pro * Issue [#109](https://github.com/cocotb/cocotb/issues/109) : Combine multiple `results.xml` into a single results file * Issue [#111](https://github.com/cocotb/cocotb/issues/111) : XGMII drivers and monitors added * Issue [#113](https://github.com/cocotb/cocotb/issues/113) : Add operators to `BinaryValue` class * Issue [#116](https://github.com/cocotb/cocotb/issues/116) : Native VHDL support by implementing VHPI layer * Issue [#117](https://github.com/cocotb/cocotb/issues/117) : Added AXI4-Lite Master BFM ### Bugs fixed[](https://docs.cocotb.org/en/stable/release_notes.html#bugs-fixed "Link to this heading") * Issue [#100](https://github.com/cocotb/cocotb/issues/100) : Functional bug in endian\_swapper example RTL * Issue [#102](https://github.com/cocotb/cocotb/issues/102) : Only 1 coroutine wakes up of multiple coroutines wait() on an Event * Issue [#114](https://github.com/cocotb/cocotb/issues/114) : Fix build issues with Cadence IUS simulator ### New examples[](https://docs.cocotb.org/en/stable/release_notes.html#new-examples "Link to this heading") * Issue [#106](https://github.com/cocotb/cocotb/issues/106) : TUN/TAP example using ping cocotb 0.3[](https://docs.cocotb.org/en/stable/release_notes.html#cocotb-0-3 "Link to this heading") ------------------------------------------------------------------------------------------------------ Released on 27 September 2013. This contains a raft of fixes and feature enhancements. cocotb 0.2[](https://docs.cocotb.org/en/stable/release_notes.html#cocotb-0-2 "Link to this heading") ------------------------------------------------------------------------------------------------------ Released on 19 July 2013. ### New features[](https://docs.cocotb.org/en/stable/release_notes.html#id45 "Link to this heading") * Release 0.2 supports more simulators and increases robustness over 0.1. * A centralized installation is now supported (see documentation) with supporting libraries build when the simulation is run for the first time. cocotb 0.1[](https://docs.cocotb.org/en/stable/release_notes.html#cocotb-0-1 "Link to this heading") ------------------------------------------------------------------------------------------------------ Released on 9 July 2013. * The first release of cocotb. * Allows installation and running against Icarus, VCS, Aldec simulators. --- # Library Reference — cocotb 1.9.2 documentation * [](https://docs.cocotb.org/en/stable/index.html) * Library Reference * [View page source](https://docs.cocotb.org/en/stable/_sources/library_reference.rst.txt) * * * Library Reference[](https://docs.cocotb.org/en/stable/library_reference.html#library-reference "Link to this heading") ======================================================================================================================== Python Test Runner[](https://docs.cocotb.org/en/stable/library_reference.html#python-test-runner "Link to this heading") -------------------------------------------------------------------------------------------------------------------------- Warning Python runners and associated APIs are an experimental feature and subject to change. Build HDL and run cocotb tests. cocotb.runner.shlex\_join(_split\_command_)[\[source\]](https://docs.cocotb.org/en/stable/_modules/cocotb/runner.html#shlex_join) [](https://docs.cocotb.org/en/stable/library_reference.html#cocotb.runner.shlex_join "Link to this definition") Return a shell-escaped string from _split\_command_ This is here more for compatibility purposes _class_ cocotb.runner.VHDL[\[source\]](https://docs.cocotb.org/en/stable/_modules/cocotb/runner.html#VHDL) [](https://docs.cocotb.org/en/stable/library_reference.html#cocotb.runner.VHDL "Link to this definition") Tags source files and build arguments to [`build()`](https://docs.cocotb.org/en/stable/library_reference.html#cocotb.runner.Simulator.build "cocotb.runner.Simulator.build") as VHDL-specific. _class_ cocotb.runner.Verilog[\[source\]](https://docs.cocotb.org/en/stable/_modules/cocotb/runner.html#Verilog) [](https://docs.cocotb.org/en/stable/library_reference.html#cocotb.runner.Verilog "Link to this definition") Tags source files and build arguments to [`build()`](https://docs.cocotb.org/en/stable/library_reference.html#cocotb.runner.Simulator.build "cocotb.runner.Simulator.build") as Verilog-specific. _class_ cocotb.runner.Simulator[\[source\]](https://docs.cocotb.org/en/stable/_modules/cocotb/runner.html#Simulator) [](https://docs.cocotb.org/en/stable/library_reference.html#cocotb.runner.Simulator "Link to this definition") build(_hdl\_library\='top'_, _verilog\_sources\=\[\]_, _vhdl\_sources\=\[\]_, _sources\=\[\]_, _includes\=\[\]_, _defines\={}_, _parameters\={}_, _build\_args\=\[\]_, _hdl\_toplevel\=None_, _always\=False_, _build\_dir\='sim\_build'_, _clean\=False_, _verbose\=False_, _timescale\=None_, _waves\=None_, _log\_file\=None_)[\[source\]](https://docs.cocotb.org/en/stable/_modules/cocotb/runner.html#Simulator.build) [](https://docs.cocotb.org/en/stable/library_reference.html#cocotb.runner.Simulator.build "Link to this definition") Build the HDL sources. With mixed language simulators, _sources_ will be built, followed by _vhdl\_sources_, then _verilog\_sources_. With simulators that only support either VHDL or Verilog, _sources_ will be built, followed by _vhdl\_sources_ and _verilog\_sources_, respectively. If your source files use an atypical file extension, use [`VHDL`](https://docs.cocotb.org/en/stable/library_reference.html#cocotb.runner.VHDL "cocotb.runner.VHDL") and [`Verilog`](https://docs.cocotb.org/en/stable/library_reference.html#cocotb.runner.Verilog "cocotb.runner.Verilog") to tag the path as a VHDL or Verilog source file, respectively. If the filepaths aren’t tagged, the extension is used to determine if they are VHDL or Verilog files. | Language | File Extensions | | --- | --- | | VHDL | `.vhd`, `.vhdl` | | Verilog | `.v`, `.sv`, `.vh`, `.svh` | runner.build( sources\=\[\ VHDL("/my/file.is\_actually\_vhdl"),\ Verilog("/other/file.verilog"),\ \], ) The same tagging works for _build\_args_. Tagged _build\_args_ only supply that option to the compiler when building the source file for the tagged language. Non-tagged _build\_args_ are supplied when compiling any language. Parameters: * **hdl\_library** ([_str_](https://docs.python.org/3/library/stdtypes.html#str "(in Python v3.13)") ) – The library name to compile into. * **verilog\_sources** ([_Sequence_](https://docs.python.org/3/library/typing.html#typing.Sequence "(in Python v3.13)") _\[_[_str_](https://docs.python.org/3/library/stdtypes.html#str "(in Python v3.13)")\ _|_ [_PathLike_](https://docs.python.org/3/library/os.html#os.PathLike "(in Python v3.13)")\ _\[_[_str_](https://docs.python.org/3/library/stdtypes.html#str "(in Python v3.13)")\ _\]__\]_) – Verilog source files to build. * **vhdl\_sources** ([_Sequence_](https://docs.python.org/3/library/typing.html#typing.Sequence "(in Python v3.13)") _\[_[_str_](https://docs.python.org/3/library/stdtypes.html#str "(in Python v3.13)")\ _|_ [_PathLike_](https://docs.python.org/3/library/os.html#os.PathLike "(in Python v3.13)")\ _\[_[_str_](https://docs.python.org/3/library/stdtypes.html#str "(in Python v3.13)")\ _\]__\]_) – VHDL source files to build. * **sources** ([_Sequence_](https://docs.python.org/3/library/typing.html#typing.Sequence "(in Python v3.13)") _\[_[_PathLike_](https://docs.python.org/3/library/os.html#os.PathLike "(in Python v3.13)")\ _\[_[_str_](https://docs.python.org/3/library/stdtypes.html#str "(in Python v3.13)")\ _\]_ _|_ [_str_](https://docs.python.org/3/library/stdtypes.html#str "(in Python v3.13)")\ _|_ [_VHDL_](https://docs.cocotb.org/en/stable/library_reference.html#cocotb.runner.VHDL "cocotb.runner.VHDL")\ _|_ [_Verilog_](https://docs.cocotb.org/en/stable/library_reference.html#cocotb.runner.Verilog "cocotb.runner.Verilog")\ _\]_) – Language-agnostic list of source files to build. * **includes** ([_Sequence_](https://docs.python.org/3/library/typing.html#typing.Sequence "(in Python v3.13)") _\[_[_str_](https://docs.python.org/3/library/stdtypes.html#str "(in Python v3.13)")\ _|_ [_PathLike_](https://docs.python.org/3/library/os.html#os.PathLike "(in Python v3.13)")\ _\[_[_str_](https://docs.python.org/3/library/stdtypes.html#str "(in Python v3.13)")\ _\]__\]_) – Verilog include directories. * **defines** ([_Mapping_](https://docs.python.org/3/library/typing.html#typing.Mapping "(in Python v3.13)") _\[_[_str_](https://docs.python.org/3/library/stdtypes.html#str "(in Python v3.13)")\ _,_ [_object_](https://docs.python.org/3/library/functions.html#object "(in Python v3.13)")\ _\]_) – Defines to set. * **parameters** ([_Mapping_](https://docs.python.org/3/library/typing.html#typing.Mapping "(in Python v3.13)") _\[_[_str_](https://docs.python.org/3/library/stdtypes.html#str "(in Python v3.13)")\ _,_ [_object_](https://docs.python.org/3/library/functions.html#object "(in Python v3.13)")\ _\]_) – Verilog parameters or VHDL generics. * **build\_args** ([_Sequence_](https://docs.python.org/3/library/typing.html#typing.Sequence "(in Python v3.13)") _\[_[_str_](https://docs.python.org/3/library/stdtypes.html#str "(in Python v3.13)")\ _|_ [_VHDL_](https://docs.cocotb.org/en/stable/library_reference.html#cocotb.runner.VHDL "cocotb.runner.VHDL")\ _|_ [_Verilog_](https://docs.cocotb.org/en/stable/library_reference.html#cocotb.runner.Verilog "cocotb.runner.Verilog")\ _\]_) – Extra build arguments for the simulator. * **hdl\_toplevel** ([_str_](https://docs.python.org/3/library/stdtypes.html#str "(in Python v3.13)") _|_ _None_) – The name of the HDL toplevel module. * **always** ([_bool_](https://docs.python.org/3/library/functions.html#bool "(in Python v3.13)") ) – Always run the build step. * **build\_dir** ([_PathLike_](https://docs.python.org/3/library/os.html#os.PathLike "(in Python v3.13)") _\[_[_str_](https://docs.python.org/3/library/stdtypes.html#str "(in Python v3.13)")\ _\]_ _|_ [_str_](https://docs.python.org/3/library/stdtypes.html#str "(in Python v3.13)") ) – Directory to run the build step in. * **clean** ([_bool_](https://docs.python.org/3/library/functions.html#bool "(in Python v3.13)") ) – Delete build\_dir before building * **verbose** ([_bool_](https://docs.python.org/3/library/functions.html#bool "(in Python v3.13)") ) – Enable verbose messages. * **timescale** ([_Tuple_](https://docs.python.org/3/library/typing.html#typing.Tuple "(in Python v3.13)") _\[_[_str_](https://docs.python.org/3/library/stdtypes.html#str "(in Python v3.13)")\ _,_ [_str_](https://docs.python.org/3/library/stdtypes.html#str "(in Python v3.13)")\ _\]_ _|_ _None_) – Tuple containing time unit and time precision for simulation. * **waves** ([_bool_](https://docs.python.org/3/library/functions.html#bool "(in Python v3.13)") _|_ _None_) – Record signal traces. * **log\_file** ([_PathLike_](https://docs.python.org/3/library/os.html#os.PathLike "(in Python v3.13)") _\[_[_str_](https://docs.python.org/3/library/stdtypes.html#str "(in Python v3.13)")\ _\]_ _|_ [_str_](https://docs.python.org/3/library/stdtypes.html#str "(in Python v3.13)") _|_ _None_) – File to write the build log to. Return type: None test(_test\_module_, _hdl\_toplevel_, _hdl\_toplevel\_library\='top'_, _hdl\_toplevel\_lang\=None_, _gpi\_interfaces\=None_, _testcase\=None_, _seed\=None_, _test\_args\=\[\]_, _plusargs\=\[\]_, _extra\_env\={}_, _waves\=None_, _gui\=None_, _parameters\=None_, _build\_dir\=None_, _test\_dir\=None_, _results\_xml\=None_, _pre\_cmd\=\[\]_, _verbose\=False_, _timescale\=None_, _log\_file\=None_)[\[source\]](https://docs.cocotb.org/en/stable/_modules/cocotb/runner.html#Simulator.test) [](https://docs.cocotb.org/en/stable/library_reference.html#cocotb.runner.Simulator.test "Link to this definition") Run the tests. Parameters: * **test\_module** ([_str_](https://docs.python.org/3/library/stdtypes.html#str "(in Python v3.13)") _|_ [_Sequence_](https://docs.python.org/3/library/typing.html#typing.Sequence "(in Python v3.13)") _\[_[_str_](https://docs.python.org/3/library/stdtypes.html#str "(in Python v3.13)")\ _\]_) – Name(s) of the Python module(s) containing the tests to run. Can be a comma-separated list. * **hdl\_toplevel** ([_str_](https://docs.python.org/3/library/stdtypes.html#str "(in Python v3.13)") ) – Name of the HDL toplevel module. * **hdl\_toplevel\_library** ([_str_](https://docs.python.org/3/library/stdtypes.html#str "(in Python v3.13)") ) – The library name for HDL toplevel module. * **hdl\_toplevel\_lang** ([_str_](https://docs.python.org/3/library/stdtypes.html#str "(in Python v3.13)") _|_ _None_) – Language of the HDL toplevel module. * **gpi\_interfaces** ([_List_](https://docs.python.org/3/library/typing.html#typing.List "(in Python v3.13)") _\[_[_str_](https://docs.python.org/3/library/stdtypes.html#str "(in Python v3.13)")\ _\]_ _|_ _None_) – List of GPI interfaces to use, with the first one being the entry point. * **testcase** ([_str_](https://docs.python.org/3/library/stdtypes.html#str "(in Python v3.13)") _|_ [_Sequence_](https://docs.python.org/3/library/typing.html#typing.Sequence "(in Python v3.13)") _\[_[_str_](https://docs.python.org/3/library/stdtypes.html#str "(in Python v3.13)")\ _\]_ _|_ _None_) – Name(s) of a specific testcase(s) to run. If not set, run all testcases found in _test\_module_. Can be a comma-separated list. * **seed** ([_str_](https://docs.python.org/3/library/stdtypes.html#str "(in Python v3.13)") _|_ [_int_](https://docs.python.org/3/library/functions.html#int "(in Python v3.13)") _|_ _None_) – A specific random seed to use. * **test\_args** ([_Sequence_](https://docs.python.org/3/library/typing.html#typing.Sequence "(in Python v3.13)") _\[_[_str_](https://docs.python.org/3/library/stdtypes.html#str "(in Python v3.13)")\ _\]_) – Extra arguments for the simulator. * **plusargs** ([_Sequence_](https://docs.python.org/3/library/typing.html#typing.Sequence "(in Python v3.13)") _\[_[_str_](https://docs.python.org/3/library/stdtypes.html#str "(in Python v3.13)")\ _\]_) – ‘plusargs’ to set for the simulator. * **extra\_env** ([_Mapping_](https://docs.python.org/3/library/typing.html#typing.Mapping "(in Python v3.13)") _\[_[_str_](https://docs.python.org/3/library/stdtypes.html#str "(in Python v3.13)")\ _,_ [_str_](https://docs.python.org/3/library/stdtypes.html#str "(in Python v3.13)")\ _\]_) – Extra environment variables to set. * **waves** ([_bool_](https://docs.python.org/3/library/functions.html#bool "(in Python v3.13)") _|_ _None_) – Record signal traces. * **gui** ([_bool_](https://docs.python.org/3/library/functions.html#bool "(in Python v3.13)") _|_ _None_) – Run with simulator GUI. * **parameters** ([_Mapping_](https://docs.python.org/3/library/typing.html#typing.Mapping "(in Python v3.13)") _\[_[_str_](https://docs.python.org/3/library/stdtypes.html#str "(in Python v3.13)")\ _,_ [_object_](https://docs.python.org/3/library/functions.html#object "(in Python v3.13)")\ _\]_) – Verilog parameters or VHDL generics. * **build\_dir** ([_PathLike_](https://docs.python.org/3/library/os.html#os.PathLike "(in Python v3.13)") _\[_[_str_](https://docs.python.org/3/library/stdtypes.html#str "(in Python v3.13)")\ _\]_ _|_ [_str_](https://docs.python.org/3/library/stdtypes.html#str "(in Python v3.13)") _|_ _None_) – Directory the build step has been run in. * **test\_dir** ([_PathLike_](https://docs.python.org/3/library/os.html#os.PathLike "(in Python v3.13)") _\[_[_str_](https://docs.python.org/3/library/stdtypes.html#str "(in Python v3.13)")\ _\]_ _|_ [_str_](https://docs.python.org/3/library/stdtypes.html#str "(in Python v3.13)") _|_ _None_) – Directory to run the tests in. * **results\_xml** ([_str_](https://docs.python.org/3/library/stdtypes.html#str "(in Python v3.13)") _|_ _None_) – Name of xUnit XML file to store test results in. If an absolute path is provided it will be used as-is, `{build_dir}/results.xml` otherwise. This argument should not be set when run with `pytest`. * **verbose** ([_bool_](https://docs.python.org/3/library/functions.html#bool "(in Python v3.13)") ) – Enable verbose messages. * **pre\_cmd** ([_List_](https://docs.python.org/3/library/typing.html#typing.List "(in Python v3.13)") _\[_[_str_](https://docs.python.org/3/library/stdtypes.html#str "(in Python v3.13)")\ _\]_) – Commands to run before simulation begins. * **timescale** ([_Tuple_](https://docs.python.org/3/library/typing.html#typing.Tuple "(in Python v3.13)") _\[_[_str_](https://docs.python.org/3/library/stdtypes.html#str "(in Python v3.13)")\ _,_ [_str_](https://docs.python.org/3/library/stdtypes.html#str "(in Python v3.13)")\ _\]_ _|_ _None_) – Tuple containing time unit and time precision for simulation. * **log\_file** ([_PathLike_](https://docs.python.org/3/library/os.html#os.PathLike "(in Python v3.13)") _\[_[_str_](https://docs.python.org/3/library/stdtypes.html#str "(in Python v3.13)")\ _\]_ _|_ [_str_](https://docs.python.org/3/library/stdtypes.html#str "(in Python v3.13)") _|_ _None_) – File to write the test log to. Returns: The absolute location of the results XML file which can be defined by the _results\_xml_ argument. Return type: [_Path_](https://docs.python.org/3/library/pathlib.html#pathlib.Path "(in Python v3.13)") cocotb.runner.get\_results(_results\_xml\_file_)[\[source\]](https://docs.cocotb.org/en/stable/_modules/cocotb/runner.html#get_results) [](https://docs.cocotb.org/en/stable/library_reference.html#cocotb.runner.get_results "Link to this definition") Return number of tests and fails in _results\_xml\_file_. Returns: Tuple of number of tests and number of fails. Raises: [**SystemExit**](https://docs.python.org/3/library/exceptions.html#SystemExit "(in Python v3.13)") – _results\_xml\_file_ is non-existent. Parameters: **results\_xml\_file** ([_Path_](https://docs.python.org/3/library/pathlib.html#pathlib.Path "(in Python v3.13)") ) Return type: [_Tuple_](https://docs.python.org/3/library/typing.html#typing.Tuple "(in Python v3.13)") \[[int](https://docs.python.org/3/library/functions.html#int "(in Python v3.13)")\ , [int](https://docs.python.org/3/library/functions.html#int "(in Python v3.13)")\ \] cocotb.runner.check\_results\_file(_results\_xml\_file_)[\[source\]](https://docs.cocotb.org/en/stable/_modules/cocotb/runner.html#check_results_file) [](https://docs.cocotb.org/en/stable/library_reference.html#cocotb.runner.check_results_file "Link to this definition") Raise exception if _results\_xml\_file_ does not exist or contains failed tests. Raises: [**SystemExit**](https://docs.python.org/3/library/exceptions.html#SystemExit "(in Python v3.13)") – _results\_xml\_file_ is non-existent or contains fails. Parameters: **results\_xml\_file** ([_Path_](https://docs.python.org/3/library/pathlib.html#pathlib.Path "(in Python v3.13)") ) Return type: None cocotb.runner.outdated(_output_, _dependencies_)[\[source\]](https://docs.cocotb.org/en/stable/_modules/cocotb/runner.html#outdated) [](https://docs.cocotb.org/en/stable/library_reference.html#cocotb.runner.outdated "Link to this definition") Return `True` if any source files in _dependencies_ are newer than the _output_ directory. Returns: `True` if any source files are newer, `False` otherwise. Parameters: * **output** ([_Path_](https://docs.python.org/3/library/pathlib.html#pathlib.Path "(in Python v3.13)") ) * **dependencies** ([_Sequence_](https://docs.python.org/3/library/typing.html#typing.Sequence "(in Python v3.13)") _\[_[_Path_](https://docs.python.org/3/library/pathlib.html#pathlib.Path "(in Python v3.13)")\ _\]_) Return type: [bool](https://docs.python.org/3/library/functions.html#bool "(in Python v3.13)") cocotb.runner.get\_abs\_path(_path_)[\[source\]](https://docs.cocotb.org/en/stable/_modules/cocotb/runner.html#get_abs_path) [](https://docs.cocotb.org/en/stable/library_reference.html#cocotb.runner.get_abs_path "Link to this definition") Return _path_ in absolute form. Parameters: **path** ([_PathLike_](https://docs.python.org/3/library/os.html#os.PathLike "(in Python v3.13)") _\[_[_str_](https://docs.python.org/3/library/stdtypes.html#str "(in Python v3.13)")\ _\]_ _|_ [_str_](https://docs.python.org/3/library/stdtypes.html#str "(in Python v3.13)") ) Return type: [_Path_](https://docs.python.org/3/library/pathlib.html#pathlib.Path "(in Python v3.13)") cocotb.runner.get\_abs\_paths(_paths_)[\[source\]](https://docs.cocotb.org/en/stable/_modules/cocotb/runner.html#get_abs_paths) [](https://docs.cocotb.org/en/stable/library_reference.html#cocotb.runner.get_abs_paths "Link to this definition") Return list of _paths_ in absolute form. Parameters: **paths** ([_Sequence_](https://docs.python.org/3/library/typing.html#typing.Sequence "(in Python v3.13)") _\[_[_str_](https://docs.python.org/3/library/stdtypes.html#str "(in Python v3.13)")\ _|_ [_PathLike_](https://docs.python.org/3/library/os.html#os.PathLike "(in Python v3.13)")\ _\[_[_str_](https://docs.python.org/3/library/stdtypes.html#str "(in Python v3.13)")\ _\]__\]_) Return type: [_List_](https://docs.python.org/3/library/typing.html#typing.List "(in Python v3.13)") \[[_Path_](https://docs.python.org/3/library/pathlib.html#pathlib.Path "(in Python v3.13)")\ \] _exception_ cocotb.runner.UnknownFileExtension(_source_)[\[source\]](https://docs.cocotb.org/en/stable/_modules/cocotb/runner.html#UnknownFileExtension) [](https://docs.cocotb.org/en/stable/library_reference.html#cocotb.runner.UnknownFileExtension "Link to this definition") Parameters: **source** ([_os.PathLike_](https://docs.python.org/3/library/os.html#os.PathLike "(in Python v3.13)") _\[_[_str_](https://docs.python.org/3/library/stdtypes.html#str "(in Python v3.13)")\ _\]_ _|_ [_str_](https://docs.python.org/3/library/stdtypes.html#str "(in Python v3.13)") ) Return type: None _class_ cocotb.runner.Icarus[\[source\]](https://docs.cocotb.org/en/stable/_modules/cocotb/runner.html#Icarus) [](https://docs.cocotb.org/en/stable/library_reference.html#cocotb.runner.Icarus "Link to this definition") _class_ cocotb.runner.Questa[\[source\]](https://docs.cocotb.org/en/stable/_modules/cocotb/runner.html#Questa) [](https://docs.cocotb.org/en/stable/library_reference.html#cocotb.runner.Questa "Link to this definition") _class_ cocotb.runner.Ghdl[\[source\]](https://docs.cocotb.org/en/stable/_modules/cocotb/runner.html#Ghdl) [](https://docs.cocotb.org/en/stable/library_reference.html#cocotb.runner.Ghdl "Link to this definition") _class_ cocotb.runner.Nvc[\[source\]](https://docs.cocotb.org/en/stable/_modules/cocotb/runner.html#Nvc) [](https://docs.cocotb.org/en/stable/library_reference.html#cocotb.runner.Nvc "Link to this definition") _class_ cocotb.runner.Riviera[\[source\]](https://docs.cocotb.org/en/stable/_modules/cocotb/runner.html#Riviera) [](https://docs.cocotb.org/en/stable/library_reference.html#cocotb.runner.Riviera "Link to this definition") _class_ cocotb.runner.Verilator[\[source\]](https://docs.cocotb.org/en/stable/_modules/cocotb/runner.html#Verilator) [](https://docs.cocotb.org/en/stable/library_reference.html#cocotb.runner.Verilator "Link to this definition") _class_ cocotb.runner.Xcelium[\[source\]](https://docs.cocotb.org/en/stable/_modules/cocotb/runner.html#Xcelium) [](https://docs.cocotb.org/en/stable/library_reference.html#cocotb.runner.Xcelium "Link to this definition") cocotb.runner.get\_runner(_simulator\_name_)[\[source\]](https://docs.cocotb.org/en/stable/_modules/cocotb/runner.html#get_runner) [](https://docs.cocotb.org/en/stable/library_reference.html#cocotb.runner.get_runner "Link to this definition") Return the _simulator\_name_ instance. Parameters: **simulator\_name** ([_str_](https://docs.python.org/3/library/stdtypes.html#str "(in Python v3.13)") ) Return type: [_Simulator_](https://docs.cocotb.org/en/stable/library_reference.html#cocotb.runner.Simulator "cocotb.runner.Simulator") Test Results[](https://docs.cocotb.org/en/stable/library_reference.html#test-results "Link to this heading") -------------------------------------------------------------------------------------------------------------- The exceptions in this module can be raised at any point by any code and will terminate the test. cocotb.result.raise\_error(_obj_, _msg_)[\[source\]](https://docs.cocotb.org/en/stable/_modules/cocotb/result.html#raise_error) [](https://docs.cocotb.org/en/stable/library_reference.html#cocotb.result.raise_error "Link to this definition") Create a [`TestError`](https://docs.cocotb.org/en/stable/library_reference.html#cocotb.result.TestError "cocotb.result.TestError") exception and raise it after printing a traceback. Deprecated since version 1.3: Raise a standard Python exception instead of calling this function. A stacktrace will be printed by cocotb automatically if the exception is unhandled. Parameters: * **obj** – Object with a log method. * **msg** ([_str_](https://docs.python.org/3/library/stdtypes.html#str "(in Python v3.13)") ) – The log message. cocotb.result.create\_error(_obj_, _msg_)[\[source\]](https://docs.cocotb.org/en/stable/_modules/cocotb/result.html#create_error) [](https://docs.cocotb.org/en/stable/library_reference.html#cocotb.result.create_error "Link to this definition") Like [`raise_error()`](https://docs.cocotb.org/en/stable/library_reference.html#cocotb.result.raise_error "cocotb.result.raise_error") , but return the exception rather than raise it, simply to avoid too many levels of nested try/except blocks. Deprecated since version 1.3: Raise a standard Python exception instead of calling this function. Parameters: * **obj** – Object with a log method. * **msg** ([_str_](https://docs.python.org/3/library/stdtypes.html#str "(in Python v3.13)") ) – The log message. _exception_ cocotb.result.ReturnValue(_retval_)[\[source\]](https://docs.cocotb.org/en/stable/_modules/cocotb/result.html#ReturnValue) [](https://docs.cocotb.org/en/stable/library_reference.html#cocotb.result.ReturnValue "Link to this definition") Helper exception needed for Python versions prior to 3.3. Deprecated since version 1.4: Use a [`return`](https://docs.python.org/3/reference/simple_stmts.html#return "(in Python v3.13)") statement instead; this works in all supported versions of Python. _exception_ cocotb.result.TestComplete(_\*args_, _\*\*kwargs_)[\[source\]](https://docs.cocotb.org/en/stable/_modules/cocotb/result.html#TestComplete) [](https://docs.cocotb.org/en/stable/library_reference.html#cocotb.result.TestComplete "Link to this definition") Exception showing that the test was completed. Sub-exceptions detail the exit status. Deprecated since version 1.6.0: The `stdout` and `stderr` attributes. _exception_ cocotb.result.ExternalException(_exception_)[\[source\]](https://docs.cocotb.org/en/stable/_modules/cocotb/result.html#ExternalException) [](https://docs.cocotb.org/en/stable/library_reference.html#cocotb.result.ExternalException "Link to this definition") Exception thrown by [`cocotb.external`](https://docs.cocotb.org/en/stable/library_reference.html#cocotb.external "cocotb.external") functions. _exception_ cocotb.result.TestError(_\*args_, _\*\*kwargs_)[\[source\]](https://docs.cocotb.org/en/stable/_modules/cocotb/result.html#TestError) [](https://docs.cocotb.org/en/stable/library_reference.html#cocotb.result.TestError "Link to this definition") Exception showing that the test was completed with severity Error. Deprecated since version 1.5: Raise a standard Python exception instead. A stacktrace will be printed by cocotb automatically if the exception is unhandled. _exception_ cocotb.result.TestFailure(_\*args_, _\*\*kwargs_)[\[source\]](https://docs.cocotb.org/en/stable/_modules/cocotb/result.html#TestFailure) [](https://docs.cocotb.org/en/stable/library_reference.html#cocotb.result.TestFailure "Link to this definition") Exception showing that the test was completed with severity Failure. Deprecated since version 1.6.0: Use a standard `assert` statement instead of raising this exception. Use `expect_fail` rather than `expect_error` with this exception in the [`cocotb.test`](https://docs.cocotb.org/en/stable/library_reference.html#cocotb.test "cocotb.test") decorator. _exception_ cocotb.result.TestSuccess(_\*args_, _\*\*kwargs_)[\[source\]](https://docs.cocotb.org/en/stable/_modules/cocotb/result.html#TestSuccess) [](https://docs.cocotb.org/en/stable/library_reference.html#cocotb.result.TestSuccess "Link to this definition") Exception showing that the test was completed successfully. _exception_ cocotb.result.SimFailure(_\*args_, _\*\*kwargs_)[\[source\]](https://docs.cocotb.org/en/stable/_modules/cocotb/result.html#SimFailure) [](https://docs.cocotb.org/en/stable/library_reference.html#cocotb.result.SimFailure "Link to this definition") Exception showing that the simulator exited unsuccessfully. _exception_ cocotb.result.SimTimeoutError[\[source\]](https://docs.cocotb.org/en/stable/_modules/cocotb/result.html#SimTimeoutError) [](https://docs.cocotb.org/en/stable/library_reference.html#cocotb.result.SimTimeoutError "Link to this definition") Exception for when a timeout, in terms of simulation time, occurs. Writing and Generating tests[](https://docs.cocotb.org/en/stable/library_reference.html#writing-and-generating-tests "Link to this heading") ---------------------------------------------------------------------------------------------------------------------------------------------- _class_ cocotb.test(_\*args_, _\*\*kwargs_)[\[source\]](https://docs.cocotb.org/en/stable/_modules/cocotb/decorators.html#test) [](https://docs.cocotb.org/en/stable/library_reference.html#cocotb.test "Link to this definition") Decorator to mark a Callable which returns a Coroutine as a test. The test decorator provides a test timeout, and allows us to mark tests as skipped or expecting errors or failures. Tests are evaluated in the order they are defined in a test module. Used as `@cocotb.test(...)`. Parameters: * **timeout\_time** ([_numbers.Real_](https://docs.python.org/3/library/numbers.html#numbers.Real "(in Python v3.13)") _or_ [_decimal.Decimal_](https://docs.python.org/3/library/decimal.html#decimal.Decimal "(in Python v3.13)") _,_ _optional_) – Simulation time duration before timeout occurs. Added in version 1.3. Note Test timeout is intended for protection against deadlock. Users should use [`with_timeout`](https://docs.cocotb.org/en/stable/triggers.html#cocotb.triggers.with_timeout "cocotb.triggers.with_timeout") if they require a more general-purpose timeout mechanism. * **timeout\_unit** ([_str_](https://docs.python.org/3/library/stdtypes.html#str "(in Python v3.13)") _,_ _optional_) – Units of timeout\_time, accepts any units that [`Timer`](https://docs.cocotb.org/en/stable/triggers.html#cocotb.triggers.Timer "cocotb.triggers.Timer") does. Added in version 1.3. Deprecated since version 1.5: Using `None` as the _timeout\_unit_ argument is deprecated, use `'step'` instead. * **expect\_fail** ([_bool_](https://docs.python.org/3/library/functions.html#bool "(in Python v3.13)") _,_ _optional_) – If `True` and the test fails a functional check via an `assert` statement, `pytest.raises`, `pytest.warns`, or `pytest.deprecated_call` the test is considered to have passed. If `True` and the test passes successfully, the test is considered to have failed. * **expect\_error** (_exception type_ _or_ [_tuple_](https://docs.python.org/3/library/stdtypes.html#tuple "(in Python v3.13)") _of_ _exception types__,_ _optional_) – Mark the result as a pass only if one of the exception types is raised in the test. This is primarily for cocotb internal regression use for when a simulator error is expected. Users are encouraged to use the following idiom instead: @cocotb.test() async def my\_test(dut): try: await thing\_that\_should\_fail() except ExceptionIExpect: pass else: assert False, "Exception did not occur" Changed in version 1.3: Specific exception types can be expected Deprecated since version 1.5: Passing a [`bool`](https://docs.python.org/3/library/functions.html#bool "(in Python v3.13)") value is now deprecated. Pass a specific [`Exception`](https://docs.python.org/3/library/exceptions.html#Exception "(in Python v3.13)") or a tuple of Exceptions instead. * **skip** ([_bool_](https://docs.python.org/3/library/functions.html#bool "(in Python v3.13)") _,_ _optional_) – Don’t execute this test as part of the regression. Test can still be run manually by setting `TESTCASE`. * **stage** ([_int_](https://docs.python.org/3/library/functions.html#int "(in Python v3.13)") ) – Order tests logically into stages, where multiple tests can share a stage. Defaults to 0. _class_ cocotb.coroutine(_func_)[\[source\]](https://docs.cocotb.org/en/stable/_modules/cocotb/decorators.html#coroutine) [](https://docs.cocotb.org/en/stable/library_reference.html#cocotb.coroutine "Link to this definition") Decorator class that allows us to provide common coroutine mechanisms: `log` methods will log to `cocotb.coroutine.name`. [`join()`](https://docs.cocotb.org/en/stable/library_reference.html#cocotb.task.Task.join "cocotb.task.Task.join") method returns an event which will fire when the coroutine exits. Used as `@cocotb.coroutine`. _class_ cocotb.external(_func_)[\[source\]](https://docs.cocotb.org/en/stable/_modules/cocotb/decorators.html#external) [](https://docs.cocotb.org/en/stable/library_reference.html#cocotb.external "Link to this definition") Decorator to apply to an external function to enable calling from cocotb. This turns a normal function that isn’t a coroutine into a blocking coroutine. Currently, this creates a new execution thread for each function that is called. Scope for this to be streamlined to a queue in future. _class_ cocotb.function(_func_)[\[source\]](https://docs.cocotb.org/en/stable/_modules/cocotb/decorators.html#function) [](https://docs.cocotb.org/en/stable/library_reference.html#cocotb.function "Link to this definition") Decorator class that allows a function to block. This allows a coroutine that consumes simulation time to be called by a thread started with [`cocotb.external`](https://docs.cocotb.org/en/stable/library_reference.html#cocotb.external "cocotb.external") ; in other words, to internally block while externally appear to yield. _class_ cocotb.regression.TestFactory(_test\_function_, _\*args_, _\*\*kwargs_)[\[source\]](https://docs.cocotb.org/en/stable/_modules/cocotb/regression.html#TestFactory) [](https://docs.cocotb.org/en/stable/library_reference.html#cocotb.regression.TestFactory "Link to this definition") Factory to automatically generate tests. Parameters: * **test\_function** – A Callable that returns the test Coroutine. Must take _dut_ as the first argument. * **\*args** – Remaining arguments are passed directly to the test function. Note that these arguments are not varied. An argument that varies with each test must be a keyword argument to the test function. * **\*\*kwargs** – Remaining keyword arguments are passed directly to the test function. Note that these arguments are not varied. An argument that varies with each test must be a keyword argument to the test function. Assuming we have a common test function that will run a test. This test function will take keyword arguments (for example generators for each of the input interfaces) and generate tests that call the supplied function. This Factory allows us to generate sets of tests based on the different permutations of the possible arguments to the test function. For example, if we have a module that takes backpressure, has two configurable features where enabling `feature_b` requires `feature_a` to be active, and need to test against data generation routines `gen_a` and `gen_b`: \>>> tf \= TestFactory(test\_function\=run\_test) \>>> tf.add\_option(name\='data\_in', optionlist\=\[gen\_a, gen\_b\]) \>>> tf.add\_option('backpressure', \[None, random\_backpressure\]) \>>> tf.add\_option(('feature\_a', 'feature\_b'), \[(False, False), (True, False), (True, True)\]) \>>> tf.generate\_tests() We would get the following tests: > * `gen_a` with no backpressure and both features disabled > > * `gen_a` with no backpressure and only `feature_a` enabled > > * `gen_a` with no backpressure and both features enabled > > * `gen_a` with `random_backpressure` and both features disabled > > * `gen_a` with `random_backpressure` and only `feature_a` enabled > > * `gen_a` with `random_backpressure` and both features enabled > > * `gen_b` with no backpressure and both features disabled > > * `gen_b` with no backpressure and only `feature_a` enabled > > * `gen_b` with no backpressure and both features enabled > > * `gen_b` with `random_backpressure` and both features disabled > > * `gen_b` with `random_backpressure` and only `feature_a` enabled > > * `gen_b` with `random_backpressure` and both features enabled > The tests are appended to the calling module for auto-discovery. Tests are simply named `test_function_N`. The docstring for the test (hence the test description) includes the name and description of each generator. Changed in version 1.5: Groups of options are now supported add\_option(_name_, _optionlist_)[\[source\]](https://docs.cocotb.org/en/stable/_modules/cocotb/regression.html#TestFactory.add_option) [](https://docs.cocotb.org/en/stable/library_reference.html#cocotb.regression.TestFactory.add_option "Link to this definition") Add a named option to the test. Parameters: * **name** ([_str_](https://docs.python.org/3/library/stdtypes.html#str "(in Python v3.13)") _or_ _iterable_ _of_ [_str_](https://docs.python.org/3/library/stdtypes.html#str "(in Python v3.13)") ) – An option name, or an iterable of several option names. Passed to test as keyword arguments. * **optionlist** ([_list_](https://docs.python.org/3/library/stdtypes.html#list "(in Python v3.13)") ) – A list of possible options for this test knob. If N names were specified, this must be a list of N-tuples or lists, where each element specifies a value for its respective option. Changed in version 1.5: Groups of options are now supported generate\_tests(_prefix\=''_, _postfix\=''_)[\[source\]](https://docs.cocotb.org/en/stable/_modules/cocotb/regression.html#TestFactory.generate_tests) [](https://docs.cocotb.org/en/stable/library_reference.html#cocotb.regression.TestFactory.generate_tests "Link to this definition") Generate an exhaustive set of tests using the cartesian product of the possible keyword arguments. The generated tests are appended to the namespace of the calling module. Parameters: * **prefix** ([_str_](https://docs.python.org/3/library/stdtypes.html#str "(in Python v3.13)") ) – Text string to append to start of `test_function` name when naming generated test cases. This allows reuse of a single `test_function` with multiple [`TestFactories`](https://docs.cocotb.org/en/stable/library_reference.html#cocotb.regression.TestFactory "cocotb.regression.TestFactory") without name clashes. * **postfix** ([_str_](https://docs.python.org/3/library/stdtypes.html#str "(in Python v3.13)") ) – Text string to append to end of `test_function` name when naming generated test cases. This allows reuse of a single `test_function` with multiple [`TestFactories`](https://docs.cocotb.org/en/stable/library_reference.html#cocotb.regression.TestFactory "cocotb.regression.TestFactory") without name clashes. Interacting with the Simulator[](https://docs.cocotb.org/en/stable/library_reference.html#interacting-with-the-simulator "Link to this heading") -------------------------------------------------------------------------------------------------------------------------------------------------- ### Task Management[](https://docs.cocotb.org/en/stable/library_reference.html#task-management "Link to this heading") cocotb.fork(_coro_)[\[source\]](https://docs.cocotb.org/en/stable/_modules/cocotb.html#fork) [](https://docs.cocotb.org/en/stable/library_reference.html#cocotb.fork "Link to this definition") Schedule a coroutine to be run concurrently. See [Coroutines and Tasks](https://docs.cocotb.org/en/stable/coroutines.html#coroutines) for details on its use. Deprecated since version 1.7.0: This function has been deprecated in favor of [`cocotb.start_soon()`](https://docs.cocotb.org/en/stable/library_reference.html#cocotb.start_soon "cocotb.start_soon") and [`cocotb.start()`](https://docs.cocotb.org/en/stable/library_reference.html#cocotb.start "cocotb.start") . In most cases you can simply substitute `cocotb.fork` with `cocotb.start_soon`. For more information on when to use `start_soon` vs `start` see [Coroutines and Tasks](https://docs.cocotb.org/en/stable/coroutines.html#coroutines) . Parameters: **coro** ([_Task_](https://docs.cocotb.org/en/stable/library_reference.html#cocotb.task.Task "cocotb.task.Task") _|_ [_Coroutine_](https://docs.python.org/3/library/collections.abc.html#collections.abc.Coroutine "(in Python v3.13)") ) Return type: [_Task_](https://docs.cocotb.org/en/stable/library_reference.html#cocotb.task.Task "cocotb.task.Task") cocotb.start\_soon(_coro_)[\[source\]](https://docs.cocotb.org/en/stable/_modules/cocotb.html#start_soon) [](https://docs.cocotb.org/en/stable/library_reference.html#cocotb.start_soon "Link to this definition") Schedule a coroutine to be run concurrently. Note that this is not an async function, and the new task will not execute until the calling task yields control. Added in version 1.6.0. Parameters: **coro** ([_Task_](https://docs.cocotb.org/en/stable/library_reference.html#cocotb.task.Task "cocotb.task.Task") _|_ [_Coroutine_](https://docs.python.org/3/library/collections.abc.html#collections.abc.Coroutine "(in Python v3.13)") ) Return type: [_Task_](https://docs.cocotb.org/en/stable/library_reference.html#cocotb.task.Task "cocotb.task.Task") _async_ cocotb.start(_coro_)[\[source\]](https://docs.cocotb.org/en/stable/_modules/cocotb.html#start) [](https://docs.cocotb.org/en/stable/library_reference.html#cocotb.start "Link to this definition") Schedule a coroutine to be run concurrently, then yield control to allow pending tasks to execute. The calling task will resume execution before control is returned to the simulator. Added in version 1.6.0. Parameters: **coro** ([_Task_](https://docs.cocotb.org/en/stable/library_reference.html#cocotb.task.Task "cocotb.task.Task") _|_ [_Coroutine_](https://docs.python.org/3/library/collections.abc.html#collections.abc.Coroutine "(in Python v3.13)") ) Return type: [_Task_](https://docs.cocotb.org/en/stable/library_reference.html#cocotb.task.Task "cocotb.task.Task") cocotb.create\_task(_coro_)[\[source\]](https://docs.cocotb.org/en/stable/_modules/cocotb.html#create_task) [](https://docs.cocotb.org/en/stable/library_reference.html#cocotb.create_task "Link to this definition") Construct a coroutine into a Task without scheduling the Task. The Task can later be scheduled with [`cocotb.fork()`](https://docs.cocotb.org/en/stable/library_reference.html#cocotb.fork "cocotb.fork") , [`cocotb.start()`](https://docs.cocotb.org/en/stable/library_reference.html#cocotb.start "cocotb.start") , or [`cocotb.start_soon()`](https://docs.cocotb.org/en/stable/library_reference.html#cocotb.start_soon "cocotb.start_soon") . Added in version 1.6.0. Parameters: **coro** ([_Task_](https://docs.cocotb.org/en/stable/library_reference.html#cocotb.task.Task "cocotb.task.Task") _|_ [_Coroutine_](https://docs.python.org/3/library/collections.abc.html#collections.abc.Coroutine "(in Python v3.13)") ) Return type: [_Task_](https://docs.cocotb.org/en/stable/library_reference.html#cocotb.task.Task "cocotb.task.Task") _class_ cocotb.task.Task(_inst_)[\[source\]](https://docs.cocotb.org/en/stable/_modules/cocotb/task.html#Task) [](https://docs.cocotb.org/en/stable/library_reference.html#cocotb.task.Task "Link to this definition") Concurrently executing task. This class is not intended for users to directly instantiate. Use [`cocotb.create_task()`](https://docs.cocotb.org/en/stable/library_reference.html#cocotb.create_task "cocotb.create_task") to create a Task object, or use [`cocotb.start_soon()`](https://docs.cocotb.org/en/stable/library_reference.html#cocotb.start_soon "cocotb.start_soon") or [`cocotb.start()`](https://docs.cocotb.org/en/stable/library_reference.html#cocotb.start "cocotb.start") to create a Task and schedule it to run. Changed in version 1.8.0: Moved to the `cocotb.task` module. cancel(_msg\=None_)[\[source\]](https://docs.cocotb.org/en/stable/_modules/cocotb/task.html#Task.cancel) [](https://docs.cocotb.org/en/stable/library_reference.html#cocotb.task.Task.cancel "Link to this definition") Cancel a Task’s further execution. When a Task is cancelled, a [`asyncio.CancelledError`](https://docs.python.org/3/library/asyncio-exceptions.html#asyncio.CancelledError "(in Python v3.13)") is thrown into the Task. Parameters: **msg** ([_str_](https://docs.python.org/3/library/stdtypes.html#str "(in Python v3.13)") _|_ _None_) Return type: None cancelled()[\[source\]](https://docs.cocotb.org/en/stable/_modules/cocotb/task.html#Task.cancelled) [](https://docs.cocotb.org/en/stable/library_reference.html#cocotb.task.Task.cancelled "Link to this definition") Return `True` if the Task was cancelled. Return type: [bool](https://docs.python.org/3/library/functions.html#bool "(in Python v3.13)") close()[\[source\]](https://docs.cocotb.org/en/stable/_modules/cocotb/task.html#Task.close) [](https://docs.cocotb.org/en/stable/library_reference.html#cocotb.task.Task.close "Link to this definition") Raise GeneratorExit inside coroutine. Return type: None done()[\[source\]](https://docs.cocotb.org/en/stable/_modules/cocotb/task.html#Task.done) [](https://docs.cocotb.org/en/stable/library_reference.html#cocotb.task.Task.done "Link to this definition") Return `True` if the Task has finished executing. Return type: [bool](https://docs.python.org/3/library/functions.html#bool "(in Python v3.13)") exception()[\[source\]](https://docs.cocotb.org/en/stable/_modules/cocotb/task.html#Task.exception) [](https://docs.cocotb.org/en/stable/library_reference.html#cocotb.task.Task.exception "Link to this definition") Return the exception of the Task. If the Task ran to completion, `None` is returned. If the Task failed with an exception, the exception is returned. If the Task was cancelled, the CancelledError is re-raised. If the coroutine is not yet complete, a [`asyncio.InvalidStateError`](https://docs.python.org/3/library/asyncio-exceptions.html#asyncio.InvalidStateError "(in Python v3.13)") is raised. Return type: [BaseException](https://docs.python.org/3/library/exceptions.html#BaseException "(in Python v3.13)") | None has\_started()[\[source\]](https://docs.cocotb.org/en/stable/_modules/cocotb/task.html#Task.has_started) [](https://docs.cocotb.org/en/stable/library_reference.html#cocotb.task.Task.has_started "Link to this definition") Return `True` if the Task has started executing. Return type: [bool](https://docs.python.org/3/library/functions.html#bool "(in Python v3.13)") join()[\[source\]](https://docs.cocotb.org/en/stable/_modules/cocotb/task.html#Task.join) [](https://docs.cocotb.org/en/stable/library_reference.html#cocotb.task.Task.join "Link to this definition") Return a trigger that will fire when the wrapped coroutine exits. Return type: [_Join_](https://docs.cocotb.org/en/stable/triggers.html#cocotb.triggers.Join "cocotb.triggers.Join") kill()[\[source\]](https://docs.cocotb.org/en/stable/_modules/cocotb/task.html#Task.kill) [](https://docs.cocotb.org/en/stable/library_reference.html#cocotb.task.Task.kill "Link to this definition") Kill a coroutine. Return type: None result()[\[source\]](https://docs.cocotb.org/en/stable/_modules/cocotb/task.html#Task.result) [](https://docs.cocotb.org/en/stable/library_reference.html#cocotb.task.Task.result "Link to this definition") Return the result of the Task. If the Task ran to completion, the result is returned. If the Task failed with an exception, the exception is re-raised. If the Task was cancelled, the CancelledError is re-raised. If the coroutine is not yet complete, a [`asyncio.InvalidStateError`](https://docs.python.org/3/library/asyncio-exceptions.html#asyncio.InvalidStateError "(in Python v3.13)") is raised. Return type: _T_ _property_ retval_: T_[](https://docs.cocotb.org/en/stable/library_reference.html#cocotb.task.Task.retval "Link to this definition") Return the result of the Task. If the Task ran to completion, the result is returned. If the Task failed with an exception, the exception is re-raised. If the Task is not yet complete, a [`RuntimeError`](https://docs.python.org/3/library/exceptions.html#RuntimeError "(in Python v3.13)") is raised. Deprecated since version 1.7.0. send(_value_)[\[source\]](https://docs.cocotb.org/en/stable/_modules/cocotb/task.html#Task.send) [](https://docs.cocotb.org/en/stable/library_reference.html#cocotb.task.Task.send "Link to this definition") Send a value into the coroutine. Return next yielded value or raise StopIteration. Parameters: **value** ([_Any_](https://docs.python.org/3/library/typing.html#typing.Any "(in Python v3.13)") ) Return type: [_Any_](https://docs.python.org/3/library/typing.html#typing.Any "(in Python v3.13)") throw(_exc_)[\[source\]](https://docs.cocotb.org/en/stable/_modules/cocotb/task.html#Task.throw) [](https://docs.cocotb.org/en/stable/library_reference.html#cocotb.task.Task.throw "Link to this definition") Raise an exception in the coroutine. Return next yielded value or raise StopIteration. Parameters: **exc** ([_BaseException_](https://docs.python.org/3/library/exceptions.html#BaseException "(in Python v3.13)") ) Return type: [_Any_](https://docs.python.org/3/library/typing.html#typing.Any "(in Python v3.13)") ### Handle Values[](https://docs.cocotb.org/en/stable/library_reference.html#handle-values "Link to this heading") _class_ cocotb.binary.BinaryRepresentation[\[source\]](https://docs.cocotb.org/en/stable/_modules/cocotb/binary.html#BinaryRepresentation) [](https://docs.cocotb.org/en/stable/library_reference.html#cocotb.binary.BinaryRepresentation "Link to this definition") UNSIGNED _\= 0_[](https://docs.cocotb.org/en/stable/library_reference.html#cocotb.binary.BinaryRepresentation.UNSIGNED "Link to this definition") Unsigned format SIGNED\_MAGNITUDE _\= 1_[](https://docs.cocotb.org/en/stable/library_reference.html#cocotb.binary.BinaryRepresentation.SIGNED_MAGNITUDE "Link to this definition") Sign and magnitude format TWOS\_COMPLEMENT _\= 2_[](https://docs.cocotb.org/en/stable/library_reference.html#cocotb.binary.BinaryRepresentation.TWOS_COMPLEMENT "Link to this definition") Two’s complement format _class_ cocotb.binary.BinaryValue(_value\=None_, _n\_bits\=None_, _bigEndian\=True_, _binaryRepresentation\=0_, _bits\=None_)[\[source\]](https://docs.cocotb.org/en/stable/_modules/cocotb/binary.html#BinaryValue) [](https://docs.cocotb.org/en/stable/library_reference.html#cocotb.binary.BinaryValue "Link to this definition") Representation of values in binary format. The underlying value can be set or accessed using these aliasing attributes: > * [`BinaryValue.integer`](https://docs.cocotb.org/en/stable/library_reference.html#cocotb.binary.BinaryValue.integer "cocotb.binary.BinaryValue.integer") > is an integer > > * [`BinaryValue.signed_integer`](https://docs.cocotb.org/en/stable/library_reference.html#cocotb.binary.BinaryValue.signed_integer "cocotb.binary.BinaryValue.signed_integer") > is a signed integer > > * [`BinaryValue.binstr`](https://docs.cocotb.org/en/stable/library_reference.html#cocotb.binary.BinaryValue.binstr "cocotb.binary.BinaryValue.binstr") > is a string of `01xXzZ` > > * [`BinaryValue.buff`](https://docs.cocotb.org/en/stable/library_reference.html#cocotb.binary.BinaryValue.buff "cocotb.binary.BinaryValue.buff") > is a binary buffer of bytes > > * [`BinaryValue.value`](https://docs.cocotb.org/en/stable/library_reference.html#cocotb.binary.BinaryValue.value "cocotb.binary.BinaryValue.value") > is an integer **deprecated** > For example: \>>> vec \= BinaryValue() \>>> vec.integer \= 42 \>>> print(vec.binstr) 101010 \>>> print(vec.buff) b'\*' Parameters: * **value** ([_str_](https://docs.python.org/3/library/stdtypes.html#str "(in Python v3.13)") _or_ [_int_](https://docs.python.org/3/library/functions.html#int "(in Python v3.13)") _or_ _long__,_ _optional_) – Value to assign to the bus. * **n\_bits** ([_int_](https://docs.python.org/3/library/functions.html#int "(in Python v3.13)") _,_ _optional_) – Number of bits to use for the underlying binary representation. * **bigEndian** ([_bool_](https://docs.python.org/3/library/functions.html#bool "(in Python v3.13)") _,_ _optional_) – Interpret the binary as big-endian when converting to/from a string buffer. * **binaryRepresentation** ([_BinaryRepresentation_](https://docs.cocotb.org/en/stable/library_reference.html#cocotb.binary.BinaryRepresentation "cocotb.binary.BinaryRepresentation") ) – The representation of the binary value (one of [`UNSIGNED`](https://docs.cocotb.org/en/stable/library_reference.html#cocotb.binary.BinaryRepresentation.UNSIGNED "cocotb.binary.BinaryRepresentation.UNSIGNED") , [`SIGNED_MAGNITUDE`](https://docs.cocotb.org/en/stable/library_reference.html#cocotb.binary.BinaryRepresentation.SIGNED_MAGNITUDE "cocotb.binary.BinaryRepresentation.SIGNED_MAGNITUDE") , [`TWOS_COMPLEMENT`](https://docs.cocotb.org/en/stable/library_reference.html#cocotb.binary.BinaryRepresentation.TWOS_COMPLEMENT "cocotb.binary.BinaryRepresentation.TWOS_COMPLEMENT") ). Defaults to unsigned representation. * **bits** ([_int_](https://docs.python.org/3/library/functions.html#int "(in Python v3.13)") _,_ _optional_) – Deprecated: Compatibility wrapper for [`n_bits`](https://docs.cocotb.org/en/stable/library_reference.html#cocotb.binary.BinaryValue.n_bits "cocotb.binary.BinaryValue.n_bits") . assign(_value_)[\[source\]](https://docs.cocotb.org/en/stable/_modules/cocotb/binary.html#BinaryValue.assign) [](https://docs.cocotb.org/en/stable/library_reference.html#cocotb.binary.BinaryValue.assign "Link to this definition") Decides how best to assign the value to the vector. Picks from the type of its argument whether to set [`integer`](https://docs.cocotb.org/en/stable/library_reference.html#cocotb.binary.BinaryValue.integer "cocotb.binary.BinaryValue.integer") , [`binstr`](https://docs.cocotb.org/en/stable/library_reference.html#cocotb.binary.BinaryValue.binstr "cocotb.binary.BinaryValue.binstr") , or [`buff`](https://docs.cocotb.org/en/stable/library_reference.html#cocotb.binary.BinaryValue.buff "cocotb.binary.BinaryValue.buff") . Parameters: **value** ([_str_](https://docs.python.org/3/library/stdtypes.html#str "(in Python v3.13)") _or_ [_int_](https://docs.python.org/3/library/functions.html#int "(in Python v3.13)") _or_ [_bytes_](https://docs.python.org/3/library/stdtypes.html#bytes "(in Python v3.13)") ) – The value to assign. Changed in version 1.4: This no longer falls back to setting [`buff`](https://docs.cocotb.org/en/stable/library_reference.html#cocotb.binary.BinaryValue.buff "cocotb.binary.BinaryValue.buff") if a [`str`](https://docs.python.org/3/library/stdtypes.html#str "(in Python v3.13)") containing any characters that aren’t `0`, `1`, `X` or `Z` is used, since [`buff`](https://docs.cocotb.org/en/stable/library_reference.html#cocotb.binary.BinaryValue.buff "cocotb.binary.BinaryValue.buff") now accepts only [`bytes`](https://docs.python.org/3/library/stdtypes.html#bytes "(in Python v3.13)") . Instead, an error is raised. _property_ integer[](https://docs.cocotb.org/en/stable/library_reference.html#cocotb.binary.BinaryValue.integer "Link to this definition") The integer representation of the underlying vector. _property_ value[](https://docs.cocotb.org/en/stable/library_reference.html#cocotb.binary.BinaryValue.value "Link to this definition") Integer access to the value. **deprecated** _property_ signed\_integer[](https://docs.cocotb.org/en/stable/library_reference.html#cocotb.binary.BinaryValue.signed_integer "Link to this definition") The signed integer representation of the underlying vector. _property_ is\_resolvable_: [bool](https://docs.python.org/3/library/functions.html#bool "(in Python v3.13)") _[](https://docs.cocotb.org/en/stable/library_reference.html#cocotb.binary.BinaryValue.is_resolvable "Link to this definition") Return whether the value contains only resolvable (i.e. no “unknown”) bits. By default the values `X`, `Z`, `U` and `W` are considered unresolvable. This can be configured with [`COCOTB_RESOLVE_X`](https://docs.cocotb.org/en/stable/building.html#envvar-COCOTB_RESOLVE_X) . This is similar to the SystemVerilog Assertion `$isunknown` system function or the VHDL function `is_x` (with an inverted meaning). _property_ buff_: [bytes](https://docs.python.org/3/library/stdtypes.html#bytes "(in Python v3.13)") _[](https://docs.cocotb.org/en/stable/library_reference.html#cocotb.binary.BinaryValue.buff "Link to this definition") The value as a binary string buffer. \>>> BinaryValue("01000001" + "00101111").buff \== b"\\x41\\x2F" True Changed in version 1.4: This changed from [`str`](https://docs.python.org/3/library/stdtypes.html#str "(in Python v3.13)") to [`bytes`](https://docs.python.org/3/library/stdtypes.html#bytes "(in Python v3.13)") . Note that for older versions used with Python 2 these types were indistinguishable. _property_ binstr[](https://docs.cocotb.org/en/stable/library_reference.html#cocotb.binary.BinaryValue.binstr "Link to this definition") The binary representation stored as a string of `0`, `1`, and possibly `x`, `z`, and other states. _property_ n\_bits[](https://docs.cocotb.org/en/stable/library_reference.html#cocotb.binary.BinaryValue.n_bits "Link to this definition") The number of bits of the binary value. ### HDL Datatypes[](https://docs.cocotb.org/en/stable/library_reference.html#hdl-datatypes "Link to this heading") These are a set of datatypes that model the behavior of common HDL datatypes. They can be used independently of cocotb for modeling and will replace [`BinaryValue`](https://docs.cocotb.org/en/stable/library_reference.html#cocotb.binary.BinaryValue "cocotb.binary.BinaryValue") as the types used by cocotb’s [simulator handles](https://docs.cocotb.org/en/stable/library_reference.html#simulation-object-handles) . Added in version 1.6.0. _class_ cocotb.types.Logic(_value\=None_)[\[source\]](https://docs.cocotb.org/en/stable/_modules/cocotb/types/logic.html#Logic) [](https://docs.cocotb.org/en/stable/library_reference.html#cocotb.types.Logic "Link to this definition") Model of a 4-value (`0`, `1`, `X`, `Z`) datatype commonly seen in HDLs. This is modeled after (System)Verilog’s 4-value `logic` type. VHDL’s 9-value `std_ulogic` type maps to this type by treating weak values as full strength values and treating “uninitialized” (`U`) and “don’t care” (`-`) as “unknown” (`X`). [`Logic`](https://docs.cocotb.org/en/stable/library_reference.html#cocotb.types.Logic "cocotb.types.Logic") can be converted to and from [`int`](https://docs.python.org/3/library/functions.html#int "(in Python v3.13)") , [`str`](https://docs.python.org/3/library/stdtypes.html#str "(in Python v3.13)") , [`bool`](https://docs.python.org/3/library/functions.html#bool "(in Python v3.13)") , and [`Bit`](https://docs.cocotb.org/en/stable/library_reference.html#cocotb.types.Bit "cocotb.types.Bit") by using the appropriate constructor syntax. The list of values convertable to [`Logic`](https://docs.cocotb.org/en/stable/library_reference.html#cocotb.types.Logic "cocotb.types.Logic") includes `0`, `1`, `True`, `False`, `"0"`, `"1"`, `"X"`, `"Z"`, `Bit('0')`, and `Bit('1')`. For a comprehensive list of values that can be converted into [`Logic`](https://docs.cocotb.org/en/stable/library_reference.html#cocotb.types.Logic "cocotb.types.Logic") see `tests/pytest/test_logic.py`. \>>> Logic("X") Logic('X') \>>> Logic(True) Logic('1') \>>> Logic(1) Logic('1') \>>> Logic(Bit(0)) Logic('0') \>>> Logic() \# default value Logic('X') \>>> str(Logic("Z")) 'Z' \>>> bool(Logic(0)) False \>>> int(Logic(1)) 1 \>>> Bit(Logic("1")) Bit('1') Note The [`int`](https://docs.python.org/3/library/functions.html#int "(in Python v3.13)") and [`bool`](https://docs.python.org/3/library/functions.html#bool "(in Python v3.13)") conversions will raise [`ValueError`](https://docs.python.org/3/library/exceptions.html#ValueError "(in Python v3.13)") if the value is not `0` or `1`. [`Logic`](https://docs.cocotb.org/en/stable/library_reference.html#cocotb.types.Logic "cocotb.types.Logic") values are immutable and therefore hashable and can be placed in [`set`](https://docs.python.org/3/library/stdtypes.html#set "(in Python v3.13)") s and used as keys in [`dict`](https://docs.python.org/3/library/stdtypes.html#dict "(in Python v3.13)") s. [`Logic`](https://docs.cocotb.org/en/stable/library_reference.html#cocotb.types.Logic "cocotb.types.Logic") supports the common logic operations `&`, `|`, `^`, and `~`. \>>> def full\_adder(a: Logic, b: Logic, carry: Logic) \-> typing.Tuple\[Logic, Logic\]: ... res \= a ^ b ^ carry ... carry\_out \= (a & b) | (b & carry) | (a & carry) ... return res, carry\_out \>>> full\_adder(a\=Logic('0'), b\=Logic('1'), carry\=Logic('1')) (Logic('0'), Logic('1')) Parameters: **value** ([_str_](https://docs.python.org/3/library/stdtypes.html#str "(in Python v3.13)") _|_ [_int_](https://docs.python.org/3/library/functions.html#int "(in Python v3.13)") _|_ [_bool_](https://docs.python.org/3/library/functions.html#bool "(in Python v3.13)") _|_ [_Logic_](https://docs.cocotb.org/en/stable/library_reference.html#cocotb.types.Logic "cocotb.types.Logic") _|_ _None_) – value to construct into a [`Logic`](https://docs.cocotb.org/en/stable/library_reference.html#cocotb.types.Logic "cocotb.types.Logic") . Raises: [**ValueError**](https://docs.python.org/3/library/exceptions.html#ValueError "(in Python v3.13)") – if the value cannot be constructed into a [`Logic`](https://docs.cocotb.org/en/stable/library_reference.html#cocotb.types.Logic "cocotb.types.Logic") . Return type: _LogicT_ _class_ cocotb.types.Bit(_value\=None_)[\[source\]](https://docs.cocotb.org/en/stable/_modules/cocotb/types/logic.html#Bit) [](https://docs.cocotb.org/en/stable/library_reference.html#cocotb.types.Bit "Link to this definition") Model of a 2-value (`0`, `1`) datatype commonly seen in HDLs. This is modeled after (System)Verilog’s 2-value `bit` type. VHDL’s `bit` type maps to this type perfectly. [`Bit`](https://docs.cocotb.org/en/stable/library_reference.html#cocotb.types.Bit "cocotb.types.Bit") is a proper subtype of [`Logic`](https://docs.cocotb.org/en/stable/library_reference.html#cocotb.types.Logic "cocotb.types.Logic") , meaning a use of [`Logic`](https://docs.cocotb.org/en/stable/library_reference.html#cocotb.types.Logic "cocotb.types.Logic") can be substituted with a [`Bit`](https://docs.cocotb.org/en/stable/library_reference.html#cocotb.types.Bit "cocotb.types.Bit") . Some behavior may surprise you if you do not expect it. \>>> Bit(0) \== Logic(0) True \>>> Bit(0) in {Logic(0)} True [`Bit`](https://docs.cocotb.org/en/stable/library_reference.html#cocotb.types.Bit "cocotb.types.Bit") can be converted to and from [`int`](https://docs.python.org/3/library/functions.html#int "(in Python v3.13)") , [`str`](https://docs.python.org/3/library/stdtypes.html#str "(in Python v3.13)") , [`bool`](https://docs.python.org/3/library/functions.html#bool "(in Python v3.13)") , and [`Logic`](https://docs.cocotb.org/en/stable/library_reference.html#cocotb.types.Logic "cocotb.types.Logic") by using the appropriate constructor syntax. The list of values convertable to [`Bit`](https://docs.cocotb.org/en/stable/library_reference.html#cocotb.types.Bit "cocotb.types.Bit") includes `0`, `1`, `True`, `False`, `"0"`, `"1"`, `Logic('0')`, and `Logic('1')`. For a comprehensive list of values that can be converted into [`Bit`](https://docs.cocotb.org/en/stable/library_reference.html#cocotb.types.Bit "cocotb.types.Bit") see `tests/pytest/test_logic.py`. \>>> Bit("0") Bit('0') \>>> Bit(True) Bit('1') \>>> Bit(1) Bit('1') \>>> Bit(Logic(0)) Bit('0') \>>> Bit() \# default value Bit('0') \>>> str(Bit("0")) '0' \>>> bool(Bit(False)) False \>>> int(Bit(1)) 1 \>>> Logic(Bit("1")) Logic('1') [`Bit`](https://docs.cocotb.org/en/stable/library_reference.html#cocotb.types.Bit "cocotb.types.Bit") values are hashable and can be placed in [`set`](https://docs.python.org/3/library/stdtypes.html#set "(in Python v3.13)") s and used as keys in [`dict`](https://docs.python.org/3/library/stdtypes.html#dict "(in Python v3.13)") s. [`Bit`](https://docs.cocotb.org/en/stable/library_reference.html#cocotb.types.Bit "cocotb.types.Bit") supports the common logic operations `&`, `|`, `^`, and `~`. \>>> def mux(a: Bit, b: Bit, s: Bit) \-> Bit: ... return (a & ~s) | (b & s) \>>> a \= Bit(0) \>>> b \= Bit(1) \>>> sel \= Bit(1) \# choose second argument \>>> mux(a, b, sel) Bit('1') Parameters: **value** ([_str_](https://docs.python.org/3/library/stdtypes.html#str "(in Python v3.13)") _|_ [_int_](https://docs.python.org/3/library/functions.html#int "(in Python v3.13)") _|_ [_bool_](https://docs.python.org/3/library/functions.html#bool "(in Python v3.13)") _|_ [_Logic_](https://docs.cocotb.org/en/stable/library_reference.html#cocotb.types.Logic "cocotb.types.Logic") _|_ _None_) – value to construct into a [`Bit`](https://docs.cocotb.org/en/stable/library_reference.html#cocotb.types.Bit "cocotb.types.Bit") . Raises: [**ValueError**](https://docs.python.org/3/library/exceptions.html#ValueError "(in Python v3.13)") – if the value cannot be constructed into a [`Bit`](https://docs.cocotb.org/en/stable/library_reference.html#cocotb.types.Bit "cocotb.types.Bit") . Return type: _LogicT_ _class_ cocotb.types.Range(_left: [int](https://docs.python.org/3/library/functions.html#int "(in Python v3.13)") _, _direction: [int](https://docs.python.org/3/library/functions.html#int "(in Python v3.13)") _)[\[source\]](https://docs.cocotb.org/en/stable/_modules/cocotb/types/range.html#Range) [](https://docs.cocotb.org/en/stable/library_reference.html#cocotb.types.Range "Link to this definition") _class_ cocotb.types.Range(_left: [int](https://docs.python.org/3/library/functions.html#int "(in Python v3.13)") _, _direction: [str](https://docs.python.org/3/library/stdtypes.html#str "(in Python v3.13)") _, _right: [int](https://docs.python.org/3/library/functions.html#int "(in Python v3.13)") _) _class_ cocotb.types.Range(_left: [int](https://docs.python.org/3/library/functions.html#int "(in Python v3.13)") _, _\*_, _right: [int](https://docs.python.org/3/library/functions.html#int "(in Python v3.13)") _) Variant of [`range`](https://docs.python.org/3/library/stdtypes.html#range "(in Python v3.13)") with inclusive right bound. In Python, [`range`](https://docs.python.org/3/library/stdtypes.html#range "(in Python v3.13)") and [`slice`](https://docs.python.org/3/library/functions.html#slice "(in Python v3.13)") have a non-inclusive right bound. In both Verilog and VHDL, ranges and arrays have an inclusive right bound. This type mimics Python’s [`range`](https://docs.python.org/3/library/stdtypes.html#range "(in Python v3.13)") type, but implements HDL-like inclusive right bounds, using the names [`left`](https://docs.cocotb.org/en/stable/library_reference.html#cocotb.types.Range.left "cocotb.types.Range.left") and [`right`](https://docs.cocotb.org/en/stable/library_reference.html#cocotb.types.Range.right "cocotb.types.Range.right") as replacements for `start` and `stop` to match VHDL. Range directionality can be specified using `'to'` or `'downto'` between the left and right bounds. Not specifying directionality will cause the directionality to be inferred. \>>> r \= Range(\-2, 3) \>>> r.left, r.right, len(r) (-2, 3, 6) \>>> s \= Range(8, 'downto', 1) \>>> s.left, s.right, len(s) (8, 1, 8) [`from_range()`](https://docs.cocotb.org/en/stable/library_reference.html#cocotb.types.Range.from_range "cocotb.types.Range.from_range") and [`to_range()`](https://docs.cocotb.org/en/stable/library_reference.html#cocotb.types.Range.to_range "cocotb.types.Range.to_range") can be used to convert from and to [`range`](https://docs.python.org/3/library/stdtypes.html#range "(in Python v3.13)") . \>>> r \= Range(\-2, 3) \>>> r.to\_range() range(-2, 4) [`Range`](https://docs.cocotb.org/en/stable/library_reference.html#cocotb.types.Range "cocotb.types.Range") supports “null” ranges as seen in VHDL. “null” ranges occur when a left bound cannot reach a right bound with the given direction. They have a length of 0, but the [`left`](https://docs.cocotb.org/en/stable/library_reference.html#cocotb.types.Range.left "cocotb.types.Range.left") , [`right`](https://docs.cocotb.org/en/stable/library_reference.html#cocotb.types.Range.right "cocotb.types.Range.right") , and [`direction`](https://docs.cocotb.org/en/stable/library_reference.html#cocotb.types.Range.direction "cocotb.types.Range.direction") values remain as given. \>>> r \= Range(1, 'to', 0) \# no way to count from 1 'to' 0 \>>> r.left, r.direction, r.right (1, 'to', 0) \>>> len(r) 0 Note This is only possible when specifying the direction. Ranges also support all the features of [`range`](https://docs.python.org/3/library/stdtypes.html#range "(in Python v3.13)") including, but not limited to: * `value in range` to see if a value is in the range, * `range.index(value)` to see what position in the range the value is, The typical use case of this type is in conjunction with [`Array`](https://docs.cocotb.org/en/stable/library_reference.html#cocotb.types.Array "cocotb.types.Array") . Parameters: * **left** ([_int_](https://docs.python.org/3/library/functions.html#int "(in Python v3.13)") ) – leftmost bound of range * **direction** ([_int_](https://docs.python.org/3/library/functions.html#int "(in Python v3.13)") _|_ [_str_](https://docs.python.org/3/library/stdtypes.html#str "(in Python v3.13)") _|_ _None_) – `'to'` if values are ascending, `'downto'` if descending * **right** ([_int_](https://docs.python.org/3/library/functions.html#int "(in Python v3.13)") _|_ _None_) – rightmost bound of range (inclusive) _property_ direction_: [str](https://docs.python.org/3/library/stdtypes.html#str "(in Python v3.13)") _[](https://docs.cocotb.org/en/stable/library_reference.html#cocotb.types.Range.direction "Link to this definition") `'to'` if values are meant to be ascending, `'downto'` otherwise. _classmethod_ from\_range(_range_)[\[source\]](https://docs.cocotb.org/en/stable/_modules/cocotb/types/range.html#Range.from_range) [](https://docs.cocotb.org/en/stable/library_reference.html#cocotb.types.Range.from_range "Link to this definition") Convert [`range`](https://docs.python.org/3/library/stdtypes.html#range "(in Python v3.13)") to [`Range`](https://docs.cocotb.org/en/stable/library_reference.html#cocotb.types.Range "cocotb.types.Range") . Parameters: **range** ([_range_](https://docs.python.org/3/library/stdtypes.html#range "(in Python v3.13)") ) Return type: [_Range_](https://docs.cocotb.org/en/stable/library_reference.html#cocotb.types.Range "cocotb.types.range.Range") _property_ left_: [int](https://docs.python.org/3/library/functions.html#int "(in Python v3.13)") _[](https://docs.cocotb.org/en/stable/library_reference.html#cocotb.types.Range.left "Link to this definition") Leftmost value in a range. _property_ right_: [int](https://docs.python.org/3/library/functions.html#int "(in Python v3.13)") _[](https://docs.cocotb.org/en/stable/library_reference.html#cocotb.types.Range.right "Link to this definition") Rightmost value in a range. to\_range()[\[source\]](https://docs.cocotb.org/en/stable/_modules/cocotb/types/range.html#Range.to_range) [](https://docs.cocotb.org/en/stable/library_reference.html#cocotb.types.Range.to_range "Link to this definition") Convert [`Range`](https://docs.cocotb.org/en/stable/library_reference.html#cocotb.types.Range "cocotb.types.Range") to [`range`](https://docs.python.org/3/library/stdtypes.html#range "(in Python v3.13)") . Return type: [range](https://docs.python.org/3/library/stdtypes.html#range "(in Python v3.13)") cocotb.types.concat(_a_, _b_)[\[source\]](https://docs.cocotb.org/en/stable/_modules/cocotb/types.html#concat) [](https://docs.cocotb.org/en/stable/library_reference.html#cocotb.types.concat "Link to this definition") Create a new array that is the concatenation of one array with another. Uses the `__concat__()` or `__rconcat__()` special methods to dispatch to a particular implementation, exactly like other binary operations in Python. Raises: [**TypeError**](https://docs.python.org/3/library/exceptions.html#TypeError "(in Python v3.13)") – when the arguments do not support concatenation in the given order. Parameters: * **a** ([_Any_](https://docs.python.org/3/library/typing.html#typing.Any "(in Python v3.13)") ) * **b** ([_Any_](https://docs.python.org/3/library/typing.html#typing.Any "(in Python v3.13)") ) Return type: [_Any_](https://docs.python.org/3/library/typing.html#typing.Any "(in Python v3.13)") _class_ cocotb.types.Array(_value_, _range\=None_)[\[source\]](https://docs.cocotb.org/en/stable/_modules/cocotb/types/array.html#Array) [](https://docs.cocotb.org/en/stable/library_reference.html#cocotb.types.Array "Link to this definition") Fixed-size, arbitrarily-indexed, homogeneous collection type. Arrays are similar to, but different from Python [`list`](https://docs.python.org/3/library/stdtypes.html#list "(in Python v3.13)") s. An array can store values of any type or values of multiple types at a time, just like a [`list`](https://docs.python.org/3/library/stdtypes.html#list "(in Python v3.13)") . Unlike [`list`](https://docs.python.org/3/library/stdtypes.html#list "(in Python v3.13)") s, an array’s size cannot change. The indexes of an array can start or end at any integer value, they are not limited to 0-based indexing. Indexing schemes can be either ascending or descending in value. An array’s indexes are described using a [`Range`](https://docs.cocotb.org/en/stable/library_reference.html#cocotb.types.Range "cocotb.types.Range") object. Initial values are treated as iterables, which are copied into an internal buffer. \>>> Array("1234") \# the 0-based range \`(0, len(value)-1)\` is inferred Array(\['1', '2', '3', '4'\], Range(0, 'to', 3)) \>>> Array(\[1, True, None, "example"\], Range(\-2, 1)) \# initial value and range lengths must be equal Array(\[1, True, None, 'example'\], Range(-2, 'to', 1)) Arrays also support “null” ranges; “null” arrays have zero length and cannot be indexed. \>>> Array(\[\], range\=Range(1, "to", 0)) Array(\[\], Range(1, 'to', 0)) Indexing and slicing is very similar to [`list`](https://docs.python.org/3/library/stdtypes.html#list "(in Python v3.13)") s, but it uses the indexing scheme specified. Slicing, just like the [`Range`](https://docs.cocotb.org/en/stable/library_reference.html#cocotb.types.Range "cocotb.types.Range") object uses an inclusive right bound, which is commonly seen in HDLs. Like [`list`](https://docs.python.org/3/library/stdtypes.html#list "(in Python v3.13)") s, if a start or stop index is not specified, it is inferred as the start or end of the array. Slicing an array returns a new [`Array`](https://docs.cocotb.org/en/stable/library_reference.html#cocotb.types.Array "cocotb.types.Array") object, whose bounds are the slice indexes. \>>> a \= Array("1234abcd") \>>> a\[7\] 'd' \>>> a\[2:5\] Array(\['3', '4', 'a', 'b'\], Range(2, 'to', 5)) \>>> a\[2:5\] \= reversed(a\[2:5\]) \>>> "".join(a) '12ba43cd' \>>> b \= Array("1234", Range(0, \-3)) \>>> b\[\-2\] '3' \>>> b\[\-1:\] Array(\['2', '3', '4'\], Range(-1, 'downto', -3)) \>>> b\[:\] \= reversed(b) \>>> b Array(\['4', '3', '2', '1'\], Range(0, 'downto', -3)) Warning Arrays behave differently in certain situations than Python’s builtin sequence types ([`list`](https://docs.python.org/3/library/stdtypes.html#list "(in Python v3.13)") , [`tuple`](https://docs.python.org/3/library/stdtypes.html#tuple "(in Python v3.13)") , etc.). * Arrays are not necessarily 0-based and slices use inclusive right bounds, so many functions that work on Python sequences by index (like [`bisect`](https://docs.python.org/3/library/bisect.html#module-bisect "(in Python v3.13)") ) may not work on arrays. * Slice indexes must be specified in the same direction as the array and do not support specifying a “step”. * When setting a slice, the new value must be an iterable of the same size as the slice. * Negative indexes are _not_ treated as an offset from the end of the array, but are treated literally. Arrays are equal to other arrays of the same length with the same values (structural equality). Bounds do not matter for equality. \>>> a \= Array(\[1, 1, 2, 3, 5\], Range(4, "downto", 0)) \>>> b \= Array(\[1, 1, 2, 3, 5\], Range(\-2, "to", 2)) \>>> a \== b True You can change the bounds of an array by setting the [`range`](https://docs.cocotb.org/en/stable/library_reference.html#cocotb.types.Array.range "cocotb.types.Array.range") to a new value. The new bounds must be the same length of the array. \>>> a \= Array("1234") \>>> a.range Range(0, 'to', 3) \>>> a.range \= Range(3, 'downto', 0) \>>> a.range Range(3, 'downto', 0) Arrays support the methods and semantics defined by [`collections.abc.Sequence`](https://docs.python.org/3/library/collections.abc.html#collections.abc.Sequence "(in Python v3.13)") . \>>> a \= Array("stuff", Range(2, "downto", \-2)) \>>> len(a) 5 \>>> "t" in a True \>>> a.index("u") 0 \>>> for c in a: ... print(c) s t u f f Parameters: * **value** ([_Iterable_](https://docs.python.org/3/library/typing.html#typing.Iterable "(in Python v3.13)") _\[__T__\]_) – Initial value for the array. * **range** ([_Range_](https://docs.cocotb.org/en/stable/library_reference.html#cocotb.types.Range "cocotb.types.range.Range") _|_ _None_) – Indexing scheme of the array. Raises: * [**ValueError**](https://docs.python.org/3/library/exceptions.html#ValueError "(in Python v3.13)") – When argument values cannot be used to construct an array. * [**TypeError**](https://docs.python.org/3/library/exceptions.html#TypeError "(in Python v3.13)") – When invalid argument types are used. _property_ direction_: [str](https://docs.python.org/3/library/stdtypes.html#str "(in Python v3.13)") _[](https://docs.cocotb.org/en/stable/library_reference.html#cocotb.types.Array.direction "Link to this definition") `"to"` if indexes are ascending, `"downto"` otherwise. _property_ left_: [int](https://docs.python.org/3/library/functions.html#int "(in Python v3.13)") _[](https://docs.cocotb.org/en/stable/library_reference.html#cocotb.types.Array.left "Link to this definition") Leftmost index of the array. _property_ range_: [Range](https://docs.cocotb.org/en/stable/library_reference.html#cocotb.types.Range "cocotb.types.range.Range") _[](https://docs.cocotb.org/en/stable/library_reference.html#cocotb.types.Array.range "Link to this definition") [`Range`](https://docs.cocotb.org/en/stable/library_reference.html#cocotb.types.Range "cocotb.types.Range") of the indexes of the array. _property_ right_: [int](https://docs.python.org/3/library/functions.html#int "(in Python v3.13)") _[](https://docs.cocotb.org/en/stable/library_reference.html#cocotb.types.Array.right "Link to this definition") Rightmost index of the array. _class_ cocotb.types.LogicArray(_value: [int](https://docs.python.org/3/library/functions.html#int "(in Python v3.13)") | [Iterable](https://docs.python.org/3/library/typing.html#typing.Iterable "(in Python v3.13)") \[[str](https://docs.python.org/3/library/stdtypes.html#str "(in Python v3.13)")\ | [int](https://docs.python.org/3/library/functions.html#int "(in Python v3.13)")\ | [bool](https://docs.python.org/3/library/functions.html#bool "(in Python v3.13)")\ | [Logic](https://docs.cocotb.org/en/stable/library_reference.html#cocotb.types.Logic "cocotb.types.logic.Logic")\ \] | [BinaryValue](https://docs.cocotb.org/en/stable/library_reference.html#cocotb.binary.BinaryValue "cocotb.binary.BinaryValue") _, _range: [Range](https://docs.cocotb.org/en/stable/library_reference.html#cocotb.types.Range "cocotb.types.range.Range") | [None](https://docs.python.org/3/library/constants.html#None "(in Python v3.13)") _)[\[source\]](https://docs.cocotb.org/en/stable/_modules/cocotb/types/logic_array.html#LogicArray) [](https://docs.cocotb.org/en/stable/library_reference.html#cocotb.types.LogicArray "Link to this definition") _class_ cocotb.types.LogicArray(_value: [int](https://docs.python.org/3/library/functions.html#int "(in Python v3.13)") | [Iterable](https://docs.python.org/3/library/typing.html#typing.Iterable "(in Python v3.13)") \[[str](https://docs.python.org/3/library/stdtypes.html#str "(in Python v3.13)")\ | [int](https://docs.python.org/3/library/functions.html#int "(in Python v3.13)")\ | [bool](https://docs.python.org/3/library/functions.html#bool "(in Python v3.13)")\ | [Logic](https://docs.cocotb.org/en/stable/library_reference.html#cocotb.types.Logic "cocotb.types.logic.Logic")\ \] | [BinaryValue](https://docs.cocotb.org/en/stable/library_reference.html#cocotb.binary.BinaryValue "cocotb.binary.BinaryValue") | [None](https://docs.python.org/3/library/constants.html#None "(in Python v3.13)") _, _range: [Range](https://docs.cocotb.org/en/stable/library_reference.html#cocotb.types.Range "cocotb.types.range.Range") _) Fixed-sized, arbitrarily-indexed, array of [`cocotb.types.Logic`](https://docs.cocotb.org/en/stable/library_reference.html#cocotb.types.Logic "cocotb.types.Logic") . [`LogicArray`](https://docs.cocotb.org/en/stable/library_reference.html#cocotb.types.LogicArray "cocotb.types.LogicArray") s can be constructed from either iterables of values constructible into [`Logic`](https://docs.cocotb.org/en/stable/library_reference.html#cocotb.types.Logic "cocotb.types.Logic") : like [`bool`](https://docs.python.org/3/library/functions.html#bool "(in Python v3.13)") , [`str`](https://docs.python.org/3/library/stdtypes.html#str "(in Python v3.13)") , [`int`](https://docs.python.org/3/library/functions.html#int "(in Python v3.13)") ; or from integers. If constructed from a positive integer, an unsigned bit representation is used to construct the [`LogicArray`](https://docs.cocotb.org/en/stable/library_reference.html#cocotb.types.LogicArray "cocotb.types.LogicArray") . If constructed from a negative integer, a two’s complement bit representation is used. Like [`Array`](https://docs.cocotb.org/en/stable/library_reference.html#cocotb.types.Array "cocotb.types.Array") , if no _range_ argument is given, it is deduced from the length of the iterable or bit string used to initialize the variable. If a _range_ argument is given, but no value, the array is filled with the default value of Logic(). \>>> LogicArray("01XZ") LogicArray('01XZ', Range(3, 'downto', 0)) \>>> LogicArray(\[0, True, "X"\]) LogicArray('01X', Range(2, 'downto', 0)) \>>> LogicArray(0xA) \# picks smallest range that can fit the value LogicArray('1010', Range(3, 'downto', 0)) \>>> LogicArray(\-4, Range(0, "to", 3)) \# will sign-extend LogicArray('1100', Range(0, 'to', 3)) \>>> LogicArray(range\=Range(0, "to", 3)) \# default values LogicArray('XXXX', Range(0, 'to', 3)) [`LogicArray`](https://docs.cocotb.org/en/stable/library_reference.html#cocotb.types.LogicArray "cocotb.types.LogicArray") s support the same operations as [`Array`](https://docs.cocotb.org/en/stable/library_reference.html#cocotb.types.Array "cocotb.types.Array") ; however, it enforces the condition that all elements must be a [`Logic`](https://docs.cocotb.org/en/stable/library_reference.html#cocotb.types.Logic "cocotb.types.Logic") . \>>> la \= LogicArray("1010") \>>> la\[0\] \# is indexable Logic('0') \>>> la\[1:\] \# is slice-able LogicArray('10', Range(1, 'downto', 0)) \>>> Logic("0") in la \# is a collection True \>>> list(la) \# is an iterable \[Logic('1'), Logic('0'), Logic('1'), Logic('0')\] When setting an element or slice, the _value_ is first constructed into a [`Logic`](https://docs.cocotb.org/en/stable/library_reference.html#cocotb.types.Logic "cocotb.types.Logic") . \>>> la \= LogicArray("1010") \>>> la\[3\] \= "Z" \>>> la\[3\] Logic('Z') \>>> la\[2:\] \= \['X', True, 0\] \>>> la LogicArray('ZX10', Range(3, 'downto', 0)) [`LogicArray`](https://docs.cocotb.org/en/stable/library_reference.html#cocotb.types.LogicArray "cocotb.types.LogicArray") s can be converted into [`str`](https://docs.python.org/3/library/stdtypes.html#str "(in Python v3.13)") s or [`int`](https://docs.python.org/3/library/functions.html#int "(in Python v3.13)") s. \>>> la \= LogicArray("1010") \>>> la.binstr '1010' \>>> la.integer \# uses unsigned representation 10 \>>> la.signed\_integer \# uses two's complement representation \-6 [`LogicArray`](https://docs.cocotb.org/en/stable/library_reference.html#cocotb.types.LogicArray "cocotb.types.LogicArray") s also support element-wise logical operations: `&`, `|`, `^`, and `~`. \>>> def big\_mux(a: LogicArray, b: LogicArray, sel: Logic) \-> LogicArray: ... s \= LogicArray(\[sel\] \* len(a)) ... return (a & ~s) | (b & s) \>>> la \= LogicArray("0110") \>>> p \= LogicArray("1110") \>>> sel \= Logic('1') \# choose second option \>>> big\_mux(la, p, sel) LogicArray('1110', Range(3, 'downto', 0)) Parameters: * **value** ([_int_](https://docs.python.org/3/library/functions.html#int "(in Python v3.13)") _|_ [_Iterable_](https://docs.python.org/3/library/typing.html#typing.Iterable "(in Python v3.13)") _\[_[_str_](https://docs.python.org/3/library/stdtypes.html#str "(in Python v3.13)")\ _|_ [_int_](https://docs.python.org/3/library/functions.html#int "(in Python v3.13)")\ _|_ [_bool_](https://docs.python.org/3/library/functions.html#bool "(in Python v3.13)")\ _|_ [_Logic_](https://docs.cocotb.org/en/stable/library_reference.html#cocotb.types.Logic "cocotb.types.Logic")\ _\]_ _|_ [_BinaryValue_](https://docs.cocotb.org/en/stable/library_reference.html#cocotb.binary.BinaryValue "cocotb.binary.BinaryValue") _|_ _None_) – Initial value for the array. * **range** ([_Range_](https://docs.cocotb.org/en/stable/library_reference.html#cocotb.types.Range "cocotb.types.range.Range") _|_ _None_) – Indexing scheme of the array. Raises: * [**ValueError**](https://docs.python.org/3/library/exceptions.html#ValueError "(in Python v3.13)") – When argument values cannot be used to construct an array. * [**TypeError**](https://docs.python.org/3/library/exceptions.html#TypeError "(in Python v3.13)") – When invalid argument types are used. ### Triggers[](https://docs.cocotb.org/en/stable/library_reference.html#triggers "Link to this heading") See [Simulator Triggers](https://docs.cocotb.org/en/stable/triggers.html#simulator-triggers) for a list of sub-classes. Below are the internal classes used within `cocotb`. _class_ cocotb.triggers.Trigger[\[source\]](https://docs.cocotb.org/en/stable/_modules/cocotb/triggers.html#Trigger) [](https://docs.cocotb.org/en/stable/library_reference.html#cocotb.triggers.Trigger "Link to this definition") Base class to derive from. _abstract_ prime(_callback_)[\[source\]](https://docs.cocotb.org/en/stable/_modules/cocotb/triggers.html#Trigger.prime) [](https://docs.cocotb.org/en/stable/library_reference.html#cocotb.triggers.Trigger.prime "Link to this definition") Set a callback to be invoked when the trigger fires. The callback will be invoked with a single argument, self. Sub-classes must override this, but should end by calling the base class method. Warning Do not call this directly within a [task](https://docs.cocotb.org/en/stable/glossary.html#term-task) . It is intended to be used only by the scheduler. unprime()[\[source\]](https://docs.cocotb.org/en/stable/_modules/cocotb/triggers.html#Trigger.unprime) [](https://docs.cocotb.org/en/stable/library_reference.html#cocotb.triggers.Trigger.unprime "Link to this definition") Remove the callback, and perform cleanup if necessary. After being un-primed, a Trigger may be re-primed again in the future. Calling unprime multiple times is allowed, subsequent calls should be a no-op. Sub-classes may override this, but should end by calling the base class method. Warning Do not call this directly within a [task](https://docs.cocotb.org/en/stable/glossary.html#term-task) . It is intended to be used only by the scheduler. _class_ cocotb.triggers.GPITrigger[\[source\]](https://docs.cocotb.org/en/stable/_modules/cocotb/triggers.html#GPITrigger) [](https://docs.cocotb.org/en/stable/library_reference.html#cocotb.triggers.GPITrigger "Link to this definition") Base Trigger class for GPI triggers. Consumes simulation time. unprime()[\[source\]](https://docs.cocotb.org/en/stable/_modules/cocotb/triggers.html#GPITrigger.unprime) [](https://docs.cocotb.org/en/stable/library_reference.html#cocotb.triggers.GPITrigger.unprime "Link to this definition") Disable a primed trigger, can be re-primed. _class_ cocotb.triggers.Waitable[\[source\]](https://docs.cocotb.org/en/stable/_modules/cocotb/triggers.html#Waitable) [](https://docs.cocotb.org/en/stable/library_reference.html#cocotb.triggers.Waitable "Link to this definition") Base class for trigger-like objects implemented using coroutines. This converts a \_wait abstract method into a suitable \_\_await\_\_. _async_ \_wait()[\[source\]](https://docs.cocotb.org/en/stable/_modules/cocotb/triggers.html#Waitable._wait) [](https://docs.cocotb.org/en/stable/library_reference.html#cocotb.triggers.Waitable._wait "Link to this definition") Should be implemented by the sub-class. Called by await self to convert the waitable object into a coroutine. Testbench Structure[](https://docs.cocotb.org/en/stable/library_reference.html#testbench-structure "Link to this heading") ---------------------------------------------------------------------------------------------------------------------------- ### Clock[](https://docs.cocotb.org/en/stable/library_reference.html#clock "Link to this heading") _class_ cocotb.clock.Clock(_signal_, _period_, _units\='step'_)[\[source\]](https://docs.cocotb.org/en/stable/_modules/cocotb/clock.html#Clock) [](https://docs.cocotb.org/en/stable/library_reference.html#cocotb.clock.Clock "Link to this definition") Simple 50:50 duty cycle clock driver. Instances of this class should call its [`start()`](https://docs.cocotb.org/en/stable/library_reference.html#cocotb.clock.Clock.start "cocotb.clock.Clock.start") method and pass the coroutine object to one of the functions in [Task Management](https://docs.cocotb.org/en/stable/library_reference.html#task-management) . This will create a clocking task that drives the signal at the desired period/frequency. Example: c \= Clock(dut.clk, 10, 'ns') await cocotb.start(c.start()) Parameters: * **signal** – The clock pin/signal to be driven. * **period** ([_int_](https://docs.python.org/3/library/functions.html#int "(in Python v3.13)") ) – The clock period. Must convert to an even number of timesteps. * **units** ([_str_](https://docs.python.org/3/library/stdtypes.html#str "(in Python v3.13)") _,_ _optional_) – One of `'step'`, `'fs'`, `'ps'`, `'ns'`, `'us'`, `'ms'`, `'sec'`. When _units_ is `'step'`, the timestep is determined by the simulator (see [`COCOTB_HDL_TIMEPRECISION`](https://docs.cocotb.org/en/stable/building.html#var-COCOTB_HDL_TIMEPRECISION) ). If you need more features like a phase shift and an asymmetric duty cycle, it is simple to create your own clock generator (that you then [`start()`](https://docs.cocotb.org/en/stable/library_reference.html#cocotb.start "cocotb.start") ): async def custom\_clock(): \# pre-construct triggers for performance high\_time \= Timer(high\_delay, units\="ns") low\_time \= Timer(low\_delay, units\="ns") await Timer(initial\_delay, units\="ns") while True: dut.clk.value \= 1 await high\_time dut.clk.value \= 0 await low\_time If you also want to change the timing during simulation, use this slightly more inefficient example instead where the `Timer`s inside the while loop are created with current delay values: async def custom\_clock(): while True: dut.clk.value \= 1 await Timer(high\_delay, units\="ns") dut.clk.value \= 0 await Timer(low\_delay, units\="ns") high\_delay \= low\_delay \= 100 await cocotb.start(custom\_clock()) await Timer(1000, units\="ns") high\_delay \= low\_delay \= 10 \# change the clock speed await Timer(1000, units\="ns") Changed in version 1.5: Support `'step'` as the _units_ argument to mean “simulator time step”. Deprecated since version 1.5: Using `None` as the _units_ argument is deprecated, use `'step'` instead. _async_ start(_cycles\=None_, _start\_high\=True_)[\[source\]](https://docs.cocotb.org/en/stable/_modules/cocotb/clock.html#Clock.start) [](https://docs.cocotb.org/en/stable/library_reference.html#cocotb.clock.Clock.start "Link to this definition") Clocking coroutine. Start driving your clock by [`cocotb.start()`](https://docs.cocotb.org/en/stable/library_reference.html#cocotb.start "cocotb.start") ing a call to this. Parameters: * **cycles** ([_int_](https://docs.python.org/3/library/functions.html#int "(in Python v3.13)") _,_ _optional_) – Cycle the clock _cycles_ number of times, or if `None` then cycle the clock forever. Note: `0` is not the same as `None`, as `0` will cycle no times. * **start\_high** ([_bool_](https://docs.python.org/3/library/functions.html#bool "(in Python v3.13)") _,_ _optional_) – Whether to start the clock with a `1` for the first half of the period. Default is `True`. Added in version 1.3. Utilities[](https://docs.cocotb.org/en/stable/library_reference.html#module-cocotb.utils "Link to this heading") ------------------------------------------------------------------------------------------------------------------ Collection of handy functions. cocotb.utils.get\_sim\_time(_units\='step'_)[\[source\]](https://docs.cocotb.org/en/stable/_modules/cocotb/utils.html#get_sim_time) [](https://docs.cocotb.org/en/stable/library_reference.html#cocotb.utils.get_sim_time "Link to this definition") Retrieves the simulation time from the simulator. Parameters: **units** ([_str_](https://docs.python.org/3/library/stdtypes.html#str "(in Python v3.13)") ) – String specifying the units of the result (one of `'step'`, `'fs'`, `'ps'`, `'ns'`, `'us'`, `'ms'`, `'sec'`). `'step'` will return the raw simulation time. Deprecated since version 1.6.0: Using `None` as the _units_ argument is deprecated, use `'step'` instead. Returns: The simulation time in the specified units. Return type: [int](https://docs.python.org/3/library/functions.html#int "(in Python v3.13)") Changed in version 1.6.0: Support `'step'` as the the _units_ argument to mean “simulator time step”. cocotb.utils.get\_time\_from\_sim\_steps(_steps_, _units_)[\[source\]](https://docs.cocotb.org/en/stable/_modules/cocotb/utils.html#get_time_from_sim_steps) [](https://docs.cocotb.org/en/stable/library_reference.html#cocotb.utils.get_time_from_sim_steps "Link to this definition") Calculates simulation time in the specified _units_ from the _steps_ based on the simulator precision. Parameters: * **steps** ([_int_](https://docs.python.org/3/library/functions.html#int "(in Python v3.13)") ) – Number of simulation steps. * **units** ([_str_](https://docs.python.org/3/library/stdtypes.html#str "(in Python v3.13)") ) – String specifying the units of the result (one of `'fs'`, `'ps'`, `'ns'`, `'us'`, `'ms'`, `'sec'`). Returns: The simulation time in the specified units. Return type: [int](https://docs.python.org/3/library/functions.html#int "(in Python v3.13)") cocotb.utils.get\_sim\_steps(_time_, _units\='step'_, _\*_, _round\_mode\='error'_)[\[source\]](https://docs.cocotb.org/en/stable/_modules/cocotb/utils.html#get_sim_steps) [](https://docs.cocotb.org/en/stable/library_reference.html#cocotb.utils.get_sim_steps "Link to this definition") Calculates the number of simulation time steps for a given amount of _time_. When _round\_mode_ is `"error"`, a [`ValueError`](https://docs.python.org/3/library/exceptions.html#ValueError "(in Python v3.13)") is thrown if the value cannot be accurately represented in terms of simulator time steps. When _round\_mode_ is `"round"`, `"ceil"`, or `"floor"`, the corresponding rounding function from the standard library will be used to round to a simulator time step. Parameters: * **time** ([_Real_](https://docs.python.org/3/library/numbers.html#numbers.Real "(in Python v3.13)") _|_ [_Decimal_](https://docs.python.org/3/library/decimal.html#decimal.Decimal "(in Python v3.13)") ) – The value to convert to simulation time steps. * **units** ([_str_](https://docs.python.org/3/library/stdtypes.html#str "(in Python v3.13)") ) – String specifying the units of the result (one of `'step'`, `'fs'`, `'ps'`, `'ns'`, `'us'`, `'ms'`, `'sec'`). `'step'` means _time_ is already in simulation time steps. * **round\_mode** ([_str_](https://docs.python.org/3/library/stdtypes.html#str "(in Python v3.13)") ) – String specifying how to handle time values that sit between time steps (one of `'error'`, `'round'`, `'ceil'`, `'floor'`). Returns: The number of simulation time steps. Raises: [**ValueError**](https://docs.python.org/3/library/exceptions.html#ValueError "(in Python v3.13)") – if the value cannot be represented accurately in terms of simulator time steps when _round\_mode_ is `"error"`. Return type: [int](https://docs.python.org/3/library/functions.html#int "(in Python v3.13)") Changed in version 1.5: Support `'step'` as the _units_ argument to mean “simulator time step”. Changed in version 1.6: Support rounding modes. cocotb.utils.pack(_ctypes\_obj_)[\[source\]](https://docs.cocotb.org/en/stable/_modules/cocotb/utils.html#pack) [](https://docs.cocotb.org/en/stable/library_reference.html#cocotb.utils.pack "Link to this definition") Convert a [`ctypes`](https://docs.python.org/3/library/ctypes.html#module-ctypes "(in Python v3.13)") structure into a Python string. Parameters: **ctypes\_obj** ([_ctypes.Structure_](https://docs.python.org/3/library/ctypes.html#ctypes.Structure "(in Python v3.13)") ) – The [`ctypes`](https://docs.python.org/3/library/ctypes.html#module-ctypes "(in Python v3.13)") structure to convert to a string. Returns: New Python string containing the bytes from memory holding _ctypes\_obj_. Deprecated since version 1.5: This function is deprecated, use `bytes(ctypes_obj)` instead. cocotb.utils.unpack(_ctypes\_obj_, _string_, _bytes\=None_)[\[source\]](https://docs.cocotb.org/en/stable/_modules/cocotb/utils.html#unpack) [](https://docs.cocotb.org/en/stable/library_reference.html#cocotb.utils.unpack "Link to this definition") Unpack a Python string into a [`ctypes`](https://docs.python.org/3/library/ctypes.html#module-ctypes "(in Python v3.13)") structure. If the length of _string_ is not the correct size for the memory footprint of the [`ctypes`](https://docs.python.org/3/library/ctypes.html#module-ctypes "(in Python v3.13)") structure then the _bytes_ keyword argument must be used. Parameters: * **ctypes\_obj** ([_ctypes.Structure_](https://docs.python.org/3/library/ctypes.html#ctypes.Structure "(in Python v3.13)") ) – The [`ctypes`](https://docs.python.org/3/library/ctypes.html#module-ctypes "(in Python v3.13)") structure to pack into. * **string** ([_str_](https://docs.python.org/3/library/stdtypes.html#str "(in Python v3.13)") ) – String to copy over the _ctypes\_obj_ memory space. * **bytes** ([_int_](https://docs.python.org/3/library/functions.html#int "(in Python v3.13)") _,_ _optional_) – Number of bytes to copy. Defaults to `None`, meaning the length of _string_ is used. Raises: * [**ValueError**](https://docs.python.org/3/library/exceptions.html#ValueError "(in Python v3.13)") – If length of _string_ and size of _ctypes\_obj_ are not equal. * [**MemoryError**](https://docs.python.org/3/library/exceptions.html#MemoryError "(in Python v3.13)") – If _bytes_ is longer than size of _ctypes\_obj_. Deprecated since version 1.5: Converting bytes to a ctypes object should be done with [`from_buffer_copy()`](https://docs.python.org/3/library/ctypes.html#ctypes._CData.from_buffer_copy "(in Python v3.13)") . If you need to assign bytes into an _existing_ ctypes object, use `memoryview(ctypes_obj).cast('B')[:bytes] = string`, see [`memoryview`](https://docs.python.org/3/library/stdtypes.html#memoryview "(in Python v3.13)") for details. cocotb.utils.hexdump(_x_)[\[source\]](https://docs.cocotb.org/en/stable/_modules/cocotb/utils.html#hexdump) [](https://docs.cocotb.org/en/stable/library_reference.html#cocotb.utils.hexdump "Link to this definition") Hexdump a buffer. Parameters: **x** ([_bytes_](https://docs.python.org/3/library/stdtypes.html#bytes "(in Python v3.13)") ) – Object that supports conversion to [`bytes`](https://docs.python.org/3/library/stdtypes.html#bytes "(in Python v3.13)") . Returns: A string containing the hexdump. Return type: [str](https://docs.python.org/3/library/stdtypes.html#str "(in Python v3.13)") Deprecated since version 1.4: Passing a [`str`](https://docs.python.org/3/library/stdtypes.html#str "(in Python v3.13)") to this function is deprecated, as it is not an appropriate type for binary data. Doing so anyway will encode the string to `latin1`. Deprecated since version 1.6.0: The function will be removed in the next major version. Use [`scapy.utils.hexdump()`](https://scapy.readthedocs.io/en/latest/api/scapy.utils.html#scapy.utils.hexdump "(in Scapy v2.6.1.dev54)") instead. Example \>>> print(hexdump(b'this somewhat long string')) 0000 74 68 69 73 20 73 6F 6D 65 77 68 61 74 20 6C 6F this somewhat lo 0010 6E 67 20 73 74 72 69 6E 67 ng string cocotb.utils.hexdiffs(_x_, _y_)[\[source\]](https://docs.cocotb.org/en/stable/_modules/cocotb/utils.html#hexdiffs) [](https://docs.cocotb.org/en/stable/library_reference.html#cocotb.utils.hexdiffs "Link to this definition") Return a diff string showing differences between two binary strings. Parameters: * **x** ([_bytes_](https://docs.python.org/3/library/stdtypes.html#bytes "(in Python v3.13)") ) – Object that supports conversion to [`bytes`](https://docs.python.org/3/library/stdtypes.html#bytes "(in Python v3.13)") . * **y** ([_bytes_](https://docs.python.org/3/library/stdtypes.html#bytes "(in Python v3.13)") ) – Object that supports conversion to [`bytes`](https://docs.python.org/3/library/stdtypes.html#bytes "(in Python v3.13)") . Return type: [str](https://docs.python.org/3/library/stdtypes.html#str "(in Python v3.13)") Deprecated since version 1.4: Passing [`str`](https://docs.python.org/3/library/stdtypes.html#str "(in Python v3.13)") s to this function is deprecated, as it is not an appropriate type for binary data. Doing so anyway will encode the string to `latin1`. Deprecated since version 1.6.0: The function will be removed in the next major version. Use [`scapy.utils.hexdiff()`](https://scapy.readthedocs.io/en/latest/api/scapy.utils.html#scapy.utils.hexdiff "(in Scapy v2.6.1.dev54)") instead. Example \>>> print(hexdiffs(b'a', b'b')) 0000 61 a 0000 62 b \>>> print(hexdiffs(b'this short thing', b'this also short')) 0000 746869732073686F 7274207468696E67 this short thing 0000 7468697320616C73 6F 2073686F7274 this also short _class_ cocotb.utils.ParametrizedSingleton(_\*args_, _\*\*kwargs_)[\[source\]](https://docs.cocotb.org/en/stable/_modules/cocotb/utils.html#ParametrizedSingleton) [](https://docs.cocotb.org/en/stable/library_reference.html#cocotb.utils.ParametrizedSingleton "Link to this definition") A metaclass that allows class construction to reuse an existing instance. We use this so that [`RisingEdge(sig)`](https://docs.cocotb.org/en/stable/triggers.html#cocotb.triggers.RisingEdge "cocotb.triggers.RisingEdge") and [`Join(coroutine)`](https://docs.cocotb.org/en/stable/triggers.html#cocotb.triggers.Join "cocotb.triggers.Join") always return the same instance, rather than creating new copies. cocotb.utils.reject\_remaining\_kwargs(_name_, _kwargs_)[\[source\]](https://docs.cocotb.org/en/stable/_modules/cocotb/utils.html#reject_remaining_kwargs) [](https://docs.cocotb.org/en/stable/library_reference.html#cocotb.utils.reject_remaining_kwargs "Link to this definition") Helper function to emulate Python 3 keyword-only arguments. Use as: def func(x1, \*\*kwargs): a \= kwargs.pop('a', 1) b \= kwargs.pop('b', 2) reject\_remaining\_kwargs('func', kwargs) ... To emulate the Python 3 syntax: def func(x1, \*, a\=1, b\=2): ... Deprecated since version 1.4: Since the minimum supported Python version is now 3.5, this function is not needed. _class_ cocotb.utils.lazy\_property(_fget_)[\[source\]](https://docs.cocotb.org/en/stable/_modules/cocotb/utils.html#lazy_property) [](https://docs.cocotb.org/en/stable/library_reference.html#cocotb.utils.lazy_property "Link to this definition") A property that is executed the first time, then cached forever. It does this by replacing itself on the instance, which works because unlike @property it does not define \_\_set\_\_. This should be used for expensive members of objects that are not always used. cocotb.utils.want\_color\_output()[\[source\]](https://docs.cocotb.org/en/stable/_modules/cocotb/utils.html#want_color_output) [](https://docs.cocotb.org/en/stable/library_reference.html#cocotb.utils.want_color_output "Link to this definition") Return `True` if colored output is possible/requested and not running in GUI. Colored output can be explicitly requested by setting [`COCOTB_ANSI_OUTPUT`](https://docs.cocotb.org/en/stable/building.html#envvar-COCOTB_ANSI_OUTPUT) to `1`. cocotb.utils.remove\_traceback\_frames(_tb\_or\_exc_, _frame\_names_)[\[source\]](https://docs.cocotb.org/en/stable/_modules/cocotb/utils.html#remove_traceback_frames) [](https://docs.cocotb.org/en/stable/library_reference.html#cocotb.utils.remove_traceback_frames "Link to this definition") Strip leading frames from a traceback Parameters: * **tb\_or\_exc** (_Union__\[__traceback__,_ [_BaseException_](https://docs.python.org/3/library/exceptions.html#BaseException "(in Python v3.13)")\ _,_ _exc\_info__\]_) – Object to strip frames from. If an exception is passed, creates a copy of the exception with a new shorter traceback. If a tuple from sys.exc\_info is passed, returns the same tuple with the traceback shortened * **frame\_names** (_List__\[_[_str_](https://docs.python.org/3/library/stdtypes.html#str "(in Python v3.13)")\ _\]_) – Names of the frames to strip, which must be present. cocotb.utils.walk\_coro\_stack(_coro_)[\[source\]](https://docs.cocotb.org/en/stable/_modules/cocotb/utils.html#walk_coro_stack) [](https://docs.cocotb.org/en/stable/library_reference.html#cocotb.utils.walk_coro_stack "Link to this definition") Walk down the coroutine stack, starting at _coro_. Supports coroutines and generators. cocotb.utils.extract\_coro\_stack(_coro_, _limit\=None_)[\[source\]](https://docs.cocotb.org/en/stable/_modules/cocotb/utils.html#extract_coro_stack) [](https://docs.cocotb.org/en/stable/library_reference.html#cocotb.utils.extract_coro_stack "Link to this definition") Create a list of pre-processed entries from the coroutine stack. This is based on [`traceback.extract_tb()`](https://docs.python.org/3/library/traceback.html#traceback.extract_tb "(in Python v3.13)") . If _limit_ is omitted or `None`, all entries are extracted. The list is a [`traceback.StackSummary`](https://docs.python.org/3/library/traceback.html#traceback.StackSummary "(in Python v3.13)") object, and each entry in the list is a [`traceback.FrameSummary`](https://docs.python.org/3/library/traceback.html#traceback.FrameSummary "(in Python v3.13)") object containing attributes `filename`, `lineno`, `name`, and `line` representing the information that is usually printed for a stack trace. The line is a string with leading and trailing whitespace stripped; if the source is not available it is `None`. ### Logging[](https://docs.cocotb.org/en/stable/library_reference.html#logging "Link to this heading") cocotb.log.default\_config()[\[source\]](https://docs.cocotb.org/en/stable/_modules/cocotb/log.html#default_config) [](https://docs.cocotb.org/en/stable/library_reference.html#cocotb.log.default_config "Link to this definition") Apply the default cocotb log formatting to the root logger. This hooks up the logger to write to stdout, using either [`SimColourLogFormatter`](https://docs.cocotb.org/en/stable/library_reference.html#cocotb.log.SimColourLogFormatter "cocotb.log.SimColourLogFormatter") or [`SimLogFormatter`](https://docs.cocotb.org/en/stable/library_reference.html#cocotb.log.SimLogFormatter "cocotb.log.SimLogFormatter") depending on whether colored output is requested. It also adds a [`SimTimeContextFilter`](https://docs.cocotb.org/en/stable/library_reference.html#cocotb.log.SimTimeContextFilter "cocotb.log.SimTimeContextFilter") filter so that [`created_sim_time`](https://docs.cocotb.org/en/stable/library_reference.html#logging.LogRecord.created_sim_time "logging.LogRecord.created_sim_time") is available to the formatter. The logging level for cocotb logs is set based on the [`COCOTB_LOG_LEVEL`](https://docs.cocotb.org/en/stable/building.html#envvar-COCOTB_LOG_LEVEL) environment variable, which defaults to `INFO`. If desired, this logging configuration can be overwritten by calling `logging.basicConfig(..., force=True)` (in Python 3.8 onwards), or by manually resetting the root logger instance. An example of this can be found in the section on [Rotating Log Files](https://docs.cocotb.org/en/stable/rotating_logger.html#rotating-logger) . Added in version 1.4. _class_ cocotb.log.SimLogFormatter[\[source\]](https://docs.cocotb.org/en/stable/_modules/cocotb/log.html#SimLogFormatter) [](https://docs.cocotb.org/en/stable/library_reference.html#cocotb.log.SimLogFormatter "Link to this definition") Bases: [`Formatter`](https://docs.python.org/3/library/logging.html#logging.Formatter "(in Python v3.13)") Log formatter to provide consistent log message handling. This will only add simulator timestamps if the handler object this formatter is attached to has a [`SimTimeContextFilter`](https://docs.cocotb.org/en/stable/library_reference.html#cocotb.log.SimTimeContextFilter "cocotb.log.SimTimeContextFilter") filter attached, which cocotb ensures by default. Takes no arguments. _class_ cocotb.log.SimColourLogFormatter[\[source\]](https://docs.cocotb.org/en/stable/_modules/cocotb/log.html#SimColourLogFormatter) [](https://docs.cocotb.org/en/stable/library_reference.html#cocotb.log.SimColourLogFormatter "Link to this definition") Bases: [`SimLogFormatter`](https://docs.cocotb.org/en/stable/library_reference.html#cocotb.log.SimLogFormatter "cocotb.log.SimLogFormatter") Log formatter to provide consistent log message handling. Takes no arguments. _class_ cocotb.log.SimTimeContextFilter[\[source\]](https://docs.cocotb.org/en/stable/_modules/cocotb/log.html#SimTimeContextFilter) [](https://docs.cocotb.org/en/stable/library_reference.html#cocotb.log.SimTimeContextFilter "Link to this definition") Bases: [`Filter`](https://docs.python.org/3/library/logging.html#logging.Filter "(in Python v3.13)") A filter to inject simulator times into the log records. This uses the approach described in the [Python logging cookbook](https://docs.python.org/3/howto/logging-cookbook.html#filters-contextual "(in Python v3.13)") . This adds the [`created_sim_time`](https://docs.cocotb.org/en/stable/library_reference.html#logging.LogRecord.created_sim_time "logging.LogRecord.created_sim_time") attribute. Added in version 1.4. logging.LogRecord.created\_sim\_time[](https://docs.cocotb.org/en/stable/library_reference.html#logging.LogRecord.created_sim_time "Link to this definition") The result of [`get_sim_time()`](https://docs.cocotb.org/en/stable/library_reference.html#cocotb.utils.get_sim_time "cocotb.utils.get_sim_time") at the point the log was created (in simulator units). The formatter is responsible for converting this to something like nanoseconds via [`get_time_from_sim_steps()`](https://docs.cocotb.org/en/stable/library_reference.html#cocotb.utils.get_time_from_sim_steps "cocotb.utils.get_time_from_sim_steps") . This is added by [`cocotb.log.SimTimeContextFilter`](https://docs.cocotb.org/en/stable/library_reference.html#cocotb.log.SimTimeContextFilter "cocotb.log.SimTimeContextFilter") . Simulation Object Handles[](https://docs.cocotb.org/en/stable/library_reference.html#simulation-object-handles "Link to this heading") ---------------------------------------------------------------------------------------------------------------------------------------- ![The class inheritance diagram for cocotb.handle](https://docs.cocotb.org/en/stable/_images/inheritance-cocotb.handle.svg) _class_ cocotb.handle.SimHandleBase(_handle_, _path_)[\[source\]](https://docs.cocotb.org/en/stable/_modules/cocotb/handle.html#SimHandleBase) [](https://docs.cocotb.org/en/stable/library_reference.html#cocotb.handle.SimHandleBase "Link to this definition") Bases: [`object`](https://docs.python.org/3/library/functions.html#object "(in Python v3.13)") Base class for all simulation objects. We maintain a handle which we can use for GPI calls. Parameters: * **handle** ([_int_](https://docs.python.org/3/library/functions.html#int "(in Python v3.13)") ) – The GPI handle to the simulator object. * **path** ([_str_](https://docs.python.org/3/library/stdtypes.html#str "(in Python v3.13)") ) – Path to this handle, `None` if root. \_name_: [str](https://docs.python.org/3/library/stdtypes.html#str "(in Python v3.13)") _[](https://docs.cocotb.org/en/stable/library_reference.html#cocotb.handle.SimHandleBase._name "Link to this definition") The name of an object. \_type_: [str](https://docs.python.org/3/library/stdtypes.html#str "(in Python v3.13)") _[](https://docs.cocotb.org/en/stable/library_reference.html#cocotb.handle.SimHandleBase._type "Link to this definition") The type of an object as a string. \_path_: [str](https://docs.python.org/3/library/stdtypes.html#str "(in Python v3.13)") _[](https://docs.cocotb.org/en/stable/library_reference.html#cocotb.handle.SimHandleBase._path "Link to this definition") The path to this handle, or its name if this is the root handle. \_def\_name_: [str](https://docs.python.org/3/library/stdtypes.html#str "(in Python v3.13)") _[](https://docs.cocotb.org/en/stable/library_reference.html#cocotb.handle.SimHandleBase._def_name "Link to this definition") The name of a GPI object’s definition. This is the value of `vpiDefName` for VPI, `vhpiNameP` for VHPI, and `mti_GetPrimaryName` for FLI. Support for this depends on the specific object type and simulator used. \_def\_file_: [str](https://docs.python.org/3/library/stdtypes.html#str "(in Python v3.13)") _[](https://docs.cocotb.org/en/stable/library_reference.html#cocotb.handle.SimHandleBase._def_file "Link to this definition") The name of the file that sources the object’s definition. This is the value of `vpiDefFile` for VPI, `vhpiFileNameP` for VHPI, and `mti_GetRegionSourceName` for FLI. Support for this depends on the specific object type and simulator used. \_\_len\_\_()[\[source\]](https://docs.cocotb.org/en/stable/_modules/cocotb/handle.html#SimHandleBase.__len__) [](https://docs.cocotb.org/en/stable/library_reference.html#cocotb.handle.SimHandleBase.__len__ "Link to this definition") Return the “length” (the number of elements) of the underlying object. For vectors this is the number of bits. _class_ cocotb.handle.RegionObject(_handle_, _path_)[\[source\]](https://docs.cocotb.org/en/stable/_modules/cocotb/handle.html#RegionObject) [](https://docs.cocotb.org/en/stable/library_reference.html#cocotb.handle.RegionObject "Link to this definition") Bases: [`SimHandleBase`](https://docs.cocotb.org/en/stable/library_reference.html#cocotb.handle.SimHandleBase "cocotb.handle.SimHandleBase") A region object, such as a scope or namespace. Region objects don’t have values, they are effectively scopes or namespaces. Parameters: * **handle** ([_int_](https://docs.python.org/3/library/functions.html#int "(in Python v3.13)") ) – The GPI handle to the simulator object. * **path** ([_str_](https://docs.python.org/3/library/stdtypes.html#str "(in Python v3.13)") ) – Path to this handle, `None` if root. _class_ cocotb.handle.HierarchyObject(_handle_, _path_)[\[source\]](https://docs.cocotb.org/en/stable/_modules/cocotb/handle.html#HierarchyObject) [](https://docs.cocotb.org/en/stable/library_reference.html#cocotb.handle.HierarchyObject "Link to this definition") Bases: [`RegionObject`](https://docs.cocotb.org/en/stable/library_reference.html#cocotb.handle.RegionObject "cocotb.handle.RegionObject") Hierarchy objects are namespace/scope objects. Parameters: * **handle** ([_int_](https://docs.python.org/3/library/functions.html#int "(in Python v3.13)") ) – The GPI handle to the simulator object. * **path** ([_str_](https://docs.python.org/3/library/stdtypes.html#str "(in Python v3.13)") ) – Path to this handle, `None` if root. \_id(_name_, _extended\=True_)[\[source\]](https://docs.cocotb.org/en/stable/_modules/cocotb/handle.html#HierarchyObject._id) [](https://docs.cocotb.org/en/stable/library_reference.html#cocotb.handle.HierarchyObject._id "Link to this definition") Query the simulator for an object with the specified _name_, and cache the result to build a tree of objects. If _extended_ is `True`, run the query only for VHDL extended identifiers. For Verilog, only `extended=False` is supported. Parameters: **extended** ([_bool_](https://docs.python.org/3/library/functions.html#bool "(in Python v3.13)") ) _class_ cocotb.handle.HierarchyArrayObject(_handle_, _path_)[\[source\]](https://docs.cocotb.org/en/stable/_modules/cocotb/handle.html#HierarchyArrayObject) [](https://docs.cocotb.org/en/stable/library_reference.html#cocotb.handle.HierarchyArrayObject "Link to this definition") Bases: [`RegionObject`](https://docs.cocotb.org/en/stable/library_reference.html#cocotb.handle.RegionObject "cocotb.handle.RegionObject") Hierarchy Arrays are containers of Hierarchy Objects. Parameters: * **handle** ([_int_](https://docs.python.org/3/library/functions.html#int "(in Python v3.13)") ) – The GPI handle to the simulator object. * **path** ([_str_](https://docs.python.org/3/library/stdtypes.html#str "(in Python v3.13)") ) – Path to this handle, `None` if root. \_\_len\_\_()[\[source\]](https://docs.cocotb.org/en/stable/_modules/cocotb/handle.html#HierarchyArrayObject.__len__) [](https://docs.cocotb.org/en/stable/library_reference.html#cocotb.handle.HierarchyArrayObject.__len__ "Link to this definition") Return the “length” of the generate block. _class_ cocotb.handle.NonHierarchyObject(_handle_, _path_)[\[source\]](https://docs.cocotb.org/en/stable/_modules/cocotb/handle.html#NonHierarchyObject) [](https://docs.cocotb.org/en/stable/library_reference.html#cocotb.handle.NonHierarchyObject "Link to this definition") Bases: [`SimHandleBase`](https://docs.cocotb.org/en/stable/library_reference.html#cocotb.handle.SimHandleBase "cocotb.handle.SimHandleBase") Common base class for all non-hierarchy objects. Parameters: * **handle** ([_int_](https://docs.python.org/3/library/functions.html#int "(in Python v3.13)") ) – The GPI handle to the simulator object. * **path** ([_str_](https://docs.python.org/3/library/stdtypes.html#str "(in Python v3.13)") ) – Path to this handle, `None` if root. _property_ value[](https://docs.cocotb.org/en/stable/library_reference.html#cocotb.handle.NonHierarchyObject.value "Link to this definition") The value of this simulation object. Note When setting this property, the value is stored by the [`Scheduler`](https://docs.cocotb.org/en/stable/library_reference.html#cocotb.scheduler.Scheduler "cocotb.scheduler.Scheduler") and all stored values are written at the same time at the end of the current simulator time step. Use [`setimmediatevalue()`](https://docs.cocotb.org/en/stable/library_reference.html#cocotb.handle.NonHierarchyObject.setimmediatevalue "cocotb.handle.NonHierarchyObject.setimmediatevalue") to set the value immediately. setimmediatevalue(_value_)[\[source\]](https://docs.cocotb.org/en/stable/_modules/cocotb/handle.html#NonHierarchyObject.setimmediatevalue) [](https://docs.cocotb.org/en/stable/library_reference.html#cocotb.handle.NonHierarchyObject.setimmediatevalue "Link to this definition") Assign a value to this simulation object immediately. _class_ cocotb.handle.ConstantObject(_handle_, _path_, _handle\_type_)[\[source\]](https://docs.cocotb.org/en/stable/_modules/cocotb/handle.html#ConstantObject) [](https://docs.cocotb.org/en/stable/library_reference.html#cocotb.handle.ConstantObject "Link to this definition") Bases: [`NonHierarchyObject`](https://docs.cocotb.org/en/stable/library_reference.html#cocotb.handle.NonHierarchyObject "cocotb.handle.NonHierarchyObject") An object which has a value that can be read, but not set. The value is cached in the class since it is fixed at elaboration time and won’t change within a simulation. Parameters: * **handle** ([_int_](https://docs.python.org/3/library/functions.html#int "(in Python v3.13)") ) – The GPI handle to the simulator object. * **path** ([_str_](https://docs.python.org/3/library/stdtypes.html#str "(in Python v3.13)") ) – Path to this handle, `None` if root. * **handle\_type** – The type of the handle (`simulator.INTEGER`, `simulator.ENUM`, `simulator.REAL`, `simulator.STRING`). _property_ value[](https://docs.cocotb.org/en/stable/library_reference.html#cocotb.handle.ConstantObject.value "Link to this definition") The value of this simulation object. _class_ cocotb.handle.NonHierarchyIndexableObject(_handle_, _path_)[\[source\]](https://docs.cocotb.org/en/stable/_modules/cocotb/handle.html#NonHierarchyIndexableObject) [](https://docs.cocotb.org/en/stable/library_reference.html#cocotb.handle.NonHierarchyIndexableObject "Link to this definition") Bases: [`NonHierarchyObject`](https://docs.cocotb.org/en/stable/library_reference.html#cocotb.handle.NonHierarchyObject "cocotb.handle.NonHierarchyObject") A non-hierarchy indexable object. Getting and setting the current value of an array is done by iterating through sub-handles in left-to-right order. Given an HDL array `arr`: | Verilog | VHDL | `arr.value` is equivalent to | | --- | --- | --- | | `arr[4:7]` | `arr(4 to 7)` | `[arr[4].value, arr[5].value, arr[6].value, arr[7].value]` | | `arr[7:4]` | `arr(7 downto 4)` | `[arr[7].value, arr[6].value, arr[5].value, arr[4].value]` | When setting the signal as in `arr.value = ...`, the same index equivalence as noted in the table holds. Warning Assigning a value to a sub-handle: * **Wrong**: `dut.some_array.value[0] = 1` (gets value as a list then updates index 0) * **Correct**: `dut.some_array[0].value = 1` Parameters: * **handle** ([_int_](https://docs.python.org/3/library/functions.html#int "(in Python v3.13)") ) – The GPI handle to the simulator object. * **path** ([_str_](https://docs.python.org/3/library/stdtypes.html#str "(in Python v3.13)") ) – Path to this handle, `None` if root. _property_ value_: [list](https://docs.python.org/3/library/stdtypes.html#list "(in Python v3.13)") _[](https://docs.cocotb.org/en/stable/library_reference.html#cocotb.handle.NonHierarchyIndexableObject.value "Link to this definition") The value of this simulation object. Note When setting this property, the value is stored by the [`Scheduler`](https://docs.cocotb.org/en/stable/library_reference.html#cocotb.scheduler.Scheduler "cocotb.scheduler.Scheduler") and all stored values are written at the same time at the end of the current simulator time step. Use `setimmediatevalue()` to set the value immediately. _class_ cocotb.handle.NonConstantObject(_handle_, _path_)[\[source\]](https://docs.cocotb.org/en/stable/_modules/cocotb/handle.html#NonConstantObject) [](https://docs.cocotb.org/en/stable/library_reference.html#cocotb.handle.NonConstantObject "Link to this definition") Bases: [`NonHierarchyIndexableObject`](https://docs.cocotb.org/en/stable/library_reference.html#cocotb.handle.NonHierarchyIndexableObject "cocotb.handle.NonHierarchyIndexableObject") A non-constant object Parameters: * **handle** ([_int_](https://docs.python.org/3/library/functions.html#int "(in Python v3.13)") ) – The GPI handle to the simulator object. * **path** ([_str_](https://docs.python.org/3/library/stdtypes.html#str "(in Python v3.13)") ) – Path to this handle, `None` if root. drivers()[\[source\]](https://docs.cocotb.org/en/stable/_modules/cocotb/handle.html#NonConstantObject.drivers) [](https://docs.cocotb.org/en/stable/library_reference.html#cocotb.handle.NonConstantObject.drivers "Link to this definition") An iterator for gathering all drivers for a signal. This is currently only available for VPI. Also, only a few simulators implement this. loads()[\[source\]](https://docs.cocotb.org/en/stable/_modules/cocotb/handle.html#NonConstantObject.loads) [](https://docs.cocotb.org/en/stable/library_reference.html#cocotb.handle.NonConstantObject.loads "Link to this definition") An iterator for gathering all loads on a signal. This is currently only available for VPI. Also, only a few simulators implement this. _class_ cocotb.handle.ModifiableObject(_handle_, _path_)[\[source\]](https://docs.cocotb.org/en/stable/_modules/cocotb/handle.html#ModifiableObject) [](https://docs.cocotb.org/en/stable/library_reference.html#cocotb.handle.ModifiableObject "Link to this definition") Bases: [`NonConstantObject`](https://docs.cocotb.org/en/stable/library_reference.html#cocotb.handle.NonConstantObject "cocotb.handle.NonConstantObject") Base class for simulator objects whose values can be modified. Parameters: * **handle** ([_int_](https://docs.python.org/3/library/functions.html#int "(in Python v3.13)") ) – The GPI handle to the simulator object. * **path** ([_str_](https://docs.python.org/3/library/stdtypes.html#str "(in Python v3.13)") ) – Path to this handle, `None` if root. _property_ value_: [BinaryValue](https://docs.cocotb.org/en/stable/library_reference.html#cocotb.binary.BinaryValue "cocotb.binary.BinaryValue") _[](https://docs.cocotb.org/en/stable/library_reference.html#cocotb.handle.ModifiableObject.value "Link to this definition") The value of this simulation object. Note When setting this property, the value is stored by the [`Scheduler`](https://docs.cocotb.org/en/stable/library_reference.html#cocotb.scheduler.Scheduler "cocotb.scheduler.Scheduler") and all stored values are written at the same time at the end of the current simulator time step. Use `setimmediatevalue()` to set the value immediately. _class_ cocotb.handle.RealObject(_handle_, _path_)[\[source\]](https://docs.cocotb.org/en/stable/_modules/cocotb/handle.html#RealObject) [](https://docs.cocotb.org/en/stable/library_reference.html#cocotb.handle.RealObject "Link to this definition") Bases: [`ModifiableObject`](https://docs.cocotb.org/en/stable/library_reference.html#cocotb.handle.ModifiableObject "cocotb.handle.ModifiableObject") Specific object handle for Real signals and variables. Parameters: * **handle** ([_int_](https://docs.python.org/3/library/functions.html#int "(in Python v3.13)") ) – The GPI handle to the simulator object. * **path** ([_str_](https://docs.python.org/3/library/stdtypes.html#str "(in Python v3.13)") ) – Path to this handle, `None` if root. _property_ value_: [float](https://docs.python.org/3/library/functions.html#float "(in Python v3.13)") _[](https://docs.cocotb.org/en/stable/library_reference.html#cocotb.handle.RealObject.value "Link to this definition") The value of this simulation object. Note When setting this property, the value is stored by the [`Scheduler`](https://docs.cocotb.org/en/stable/library_reference.html#cocotb.scheduler.Scheduler "cocotb.scheduler.Scheduler") and all stored values are written at the same time at the end of the current simulator time step. Use `setimmediatevalue()` to set the value immediately. _class_ cocotb.handle.EnumObject(_handle_, _path_)[\[source\]](https://docs.cocotb.org/en/stable/_modules/cocotb/handle.html#EnumObject) [](https://docs.cocotb.org/en/stable/library_reference.html#cocotb.handle.EnumObject "Link to this definition") Bases: [`ModifiableObject`](https://docs.cocotb.org/en/stable/library_reference.html#cocotb.handle.ModifiableObject "cocotb.handle.ModifiableObject") Specific object handle for enumeration signals and variables. Parameters: * **handle** ([_int_](https://docs.python.org/3/library/functions.html#int "(in Python v3.13)") ) – The GPI handle to the simulator object. * **path** ([_str_](https://docs.python.org/3/library/stdtypes.html#str "(in Python v3.13)") ) – Path to this handle, `None` if root. _property_ value_: [int](https://docs.python.org/3/library/functions.html#int "(in Python v3.13)") _[](https://docs.cocotb.org/en/stable/library_reference.html#cocotb.handle.EnumObject.value "Link to this definition") The value of this simulation object. Note When setting this property, the value is stored by the [`Scheduler`](https://docs.cocotb.org/en/stable/library_reference.html#cocotb.scheduler.Scheduler "cocotb.scheduler.Scheduler") and all stored values are written at the same time at the end of the current simulator time step. Use `setimmediatevalue()` to set the value immediately. _class_ cocotb.handle.IntegerObject(_handle_, _path_)[\[source\]](https://docs.cocotb.org/en/stable/_modules/cocotb/handle.html#IntegerObject) [](https://docs.cocotb.org/en/stable/library_reference.html#cocotb.handle.IntegerObject "Link to this definition") Bases: [`ModifiableObject`](https://docs.cocotb.org/en/stable/library_reference.html#cocotb.handle.ModifiableObject "cocotb.handle.ModifiableObject") Specific object handle for integer and enumeration signals and variables. Parameters: * **handle** ([_int_](https://docs.python.org/3/library/functions.html#int "(in Python v3.13)") ) – The GPI handle to the simulator object. * **path** ([_str_](https://docs.python.org/3/library/stdtypes.html#str "(in Python v3.13)") ) – Path to this handle, `None` if root. _property_ value_: [int](https://docs.python.org/3/library/functions.html#int "(in Python v3.13)") _[](https://docs.cocotb.org/en/stable/library_reference.html#cocotb.handle.IntegerObject.value "Link to this definition") The value of this simulation object. Note When setting this property, the value is stored by the [`Scheduler`](https://docs.cocotb.org/en/stable/library_reference.html#cocotb.scheduler.Scheduler "cocotb.scheduler.Scheduler") and all stored values are written at the same time at the end of the current simulator time step. Use `setimmediatevalue()` to set the value immediately. _class_ cocotb.handle.StringObject(_handle_, _path_)[\[source\]](https://docs.cocotb.org/en/stable/_modules/cocotb/handle.html#StringObject) [](https://docs.cocotb.org/en/stable/library_reference.html#cocotb.handle.StringObject "Link to this definition") Bases: [`ModifiableObject`](https://docs.cocotb.org/en/stable/library_reference.html#cocotb.handle.ModifiableObject "cocotb.handle.ModifiableObject") Specific object handle for String variables. Parameters: * **handle** ([_int_](https://docs.python.org/3/library/functions.html#int "(in Python v3.13)") ) – The GPI handle to the simulator object. * **path** ([_str_](https://docs.python.org/3/library/stdtypes.html#str "(in Python v3.13)") ) – Path to this handle, `None` if root. _property_ value_: [bytes](https://docs.python.org/3/library/stdtypes.html#bytes "(in Python v3.13)") _[](https://docs.cocotb.org/en/stable/library_reference.html#cocotb.handle.StringObject.value "Link to this definition") The value of this simulation object. Note When setting this property, the value is stored by the [`Scheduler`](https://docs.cocotb.org/en/stable/library_reference.html#cocotb.scheduler.Scheduler "cocotb.scheduler.Scheduler") and all stored values are written at the same time at the end of the current simulator time step. Use `setimmediatevalue()` to set the value immediately. cocotb.handle.SimHandle(_handle_, _path\=None_)[\[source\]](https://docs.cocotb.org/en/stable/_modules/cocotb/handle.html#SimHandle) [](https://docs.cocotb.org/en/stable/library_reference.html#cocotb.handle.SimHandle "Link to this definition") Factory function to create the correct type of SimHandle object. Parameters: * **handle** ([_int_](https://docs.python.org/3/library/functions.html#int "(in Python v3.13)") ) – The GPI handle to the simulator object. * **path** ([_str_](https://docs.python.org/3/library/stdtypes.html#str "(in Python v3.13)") ) – Path to this handle, `None` if root. Returns: The SimHandle object. Raises: [**NotImplementedError**](https://docs.python.org/3/library/exceptions.html#NotImplementedError "(in Python v3.13)") – If no matching object for GPI type could be found. ### Assignment Methods[](https://docs.cocotb.org/en/stable/library_reference.html#assignment-methods "Link to this heading") _class_ cocotb.handle.Deposit(_value_)[\[source\]](https://docs.cocotb.org/en/stable/_modules/cocotb/handle.html#Deposit) [](https://docs.cocotb.org/en/stable/library_reference.html#cocotb.handle.Deposit "Link to this definition") Action used for placing a value into a given handle. _class_ cocotb.handle.Force(_value_)[\[source\]](https://docs.cocotb.org/en/stable/_modules/cocotb/handle.html#Force) [](https://docs.cocotb.org/en/stable/library_reference.html#cocotb.handle.Force "Link to this definition") Action used to force a handle to a given value until a release is applied. _class_ cocotb.handle.Freeze[\[source\]](https://docs.cocotb.org/en/stable/_modules/cocotb/handle.html#Freeze) [](https://docs.cocotb.org/en/stable/library_reference.html#cocotb.handle.Freeze "Link to this definition") Action used to make a handle keep its current value until a release is used. _class_ cocotb.handle.Release[\[source\]](https://docs.cocotb.org/en/stable/_modules/cocotb/handle.html#Release) [](https://docs.cocotb.org/en/stable/library_reference.html#cocotb.handle.Release "Link to this definition") Action used to stop the effects of a previously applied force/freeze action. ### Other Handle Methods[](https://docs.cocotb.org/en/stable/library_reference.html#other-handle-methods "Link to this heading") len(_handle_)[](https://docs.cocotb.org/en/stable/library_reference.html#len "Link to this definition") Return the “length” (the number of elements) of the underlying object. For vectors this is the number of bits. dir(_handle_)[](https://docs.cocotb.org/en/stable/library_reference.html#dir "Link to this definition") Return a list of the sub-handles of _handle_, that is, the instances, signals, constants etc. of a certain hierarchy level in the DUT. Miscellaneous[](https://docs.cocotb.org/en/stable/library_reference.html#miscellaneous "Link to this heading") ---------------------------------------------------------------------------------------------------------------- ### Asynchronous Queues[](https://docs.cocotb.org/en/stable/library_reference.html#module-cocotb.queue "Link to this heading") _exception_ cocotb.queue.QueueFull[\[source\]](https://docs.cocotb.org/en/stable/_modules/cocotb/queue.html#QueueFull) [](https://docs.cocotb.org/en/stable/library_reference.html#cocotb.queue.QueueFull "Link to this definition") Raised when the Queue.put\_nowait() method is called on a full Queue. _exception_ cocotb.queue.QueueEmpty[\[source\]](https://docs.cocotb.org/en/stable/_modules/cocotb/queue.html#QueueEmpty) [](https://docs.cocotb.org/en/stable/library_reference.html#cocotb.queue.QueueEmpty "Link to this definition") Raised when the Queue.get\_nowait() method is called on a empty Queue. _class_ cocotb.queue.Queue(_maxsize\=0_)[\[source\]](https://docs.cocotb.org/en/stable/_modules/cocotb/queue.html#Queue) [](https://docs.cocotb.org/en/stable/library_reference.html#cocotb.queue.Queue "Link to this definition") A queue, useful for coordinating producer and consumer coroutines. If _maxsize_ is less than or equal to 0, the queue size is infinite. If it is an integer greater than 0, then [`put()`](https://docs.cocotb.org/en/stable/library_reference.html#cocotb.queue.Queue.put "cocotb.queue.Queue.put") will block when the queue reaches _maxsize_, until an item is removed by [`get()`](https://docs.cocotb.org/en/stable/library_reference.html#cocotb.queue.Queue.get "cocotb.queue.Queue.get") . Parameters: **maxsize** ([_int_](https://docs.python.org/3/library/functions.html#int "(in Python v3.13)") ) qsize()[\[source\]](https://docs.cocotb.org/en/stable/_modules/cocotb/queue.html#Queue.qsize) [](https://docs.cocotb.org/en/stable/library_reference.html#cocotb.queue.Queue.qsize "Link to this definition") Number of items in the queue. Return type: [int](https://docs.python.org/3/library/functions.html#int "(in Python v3.13)") _property_ maxsize_: [int](https://docs.python.org/3/library/functions.html#int "(in Python v3.13)") _[](https://docs.cocotb.org/en/stable/library_reference.html#cocotb.queue.Queue.maxsize "Link to this definition") Number of items allowed in the queue. empty()[\[source\]](https://docs.cocotb.org/en/stable/_modules/cocotb/queue.html#Queue.empty) [](https://docs.cocotb.org/en/stable/library_reference.html#cocotb.queue.Queue.empty "Link to this definition") Return `True` if the queue is empty, `False` otherwise. Return type: [bool](https://docs.python.org/3/library/functions.html#bool "(in Python v3.13)") full()[\[source\]](https://docs.cocotb.org/en/stable/_modules/cocotb/queue.html#Queue.full) [](https://docs.cocotb.org/en/stable/library_reference.html#cocotb.queue.Queue.full "Link to this definition") Return `True` if there are [`maxsize()`](https://docs.cocotb.org/en/stable/library_reference.html#cocotb.queue.Queue.maxsize "cocotb.queue.Queue.maxsize") items in the queue. Note If the Queue was initialized with `maxsize=0` (the default), then [`full()`](https://docs.cocotb.org/en/stable/library_reference.html#cocotb.queue.Queue.full "cocotb.queue.Queue.full") is never `True`. Return type: [bool](https://docs.python.org/3/library/functions.html#bool "(in Python v3.13)") _async_ put(_item_)[\[source\]](https://docs.cocotb.org/en/stable/_modules/cocotb/queue.html#Queue.put) [](https://docs.cocotb.org/en/stable/library_reference.html#cocotb.queue.Queue.put "Link to this definition") Put an _item_ into the queue. If the queue is full, wait until a free slot is available before adding the item. Parameters: **item** (_T_) Return type: None put\_nowait(_item_)[\[source\]](https://docs.cocotb.org/en/stable/_modules/cocotb/queue.html#Queue.put_nowait) [](https://docs.cocotb.org/en/stable/library_reference.html#cocotb.queue.Queue.put_nowait "Link to this definition") Put an _item_ into the queue without blocking. If no free slot is immediately available, raise [`asyncio.QueueFull`](https://docs.python.org/3/library/asyncio-queue.html#asyncio.QueueFull "(in Python v3.13)") . Parameters: **item** (_T_) Return type: None _async_ get()[\[source\]](https://docs.cocotb.org/en/stable/_modules/cocotb/queue.html#Queue.get) [](https://docs.cocotb.org/en/stable/library_reference.html#cocotb.queue.Queue.get "Link to this definition") Remove and return an item from the queue. If the queue is empty, wait until an item is available. Return type: _T_ get\_nowait()[\[source\]](https://docs.cocotb.org/en/stable/_modules/cocotb/queue.html#Queue.get_nowait) [](https://docs.cocotb.org/en/stable/library_reference.html#cocotb.queue.Queue.get_nowait "Link to this definition") Remove and return an item from the queue. Return an item if one is immediately available, else raise [`asyncio.QueueEmpty`](https://docs.python.org/3/library/asyncio-queue.html#asyncio.QueueEmpty "(in Python v3.13)") . Return type: _T_ _class_ cocotb.queue.PriorityQueue(_maxsize\=0_)[\[source\]](https://docs.cocotb.org/en/stable/_modules/cocotb/queue.html#PriorityQueue) [](https://docs.cocotb.org/en/stable/library_reference.html#cocotb.queue.PriorityQueue "Link to this definition") A subclass of [`Queue`](https://docs.cocotb.org/en/stable/library_reference.html#cocotb.queue.Queue "cocotb.queue.Queue") ; retrieves entries in priority order (smallest item first). Entries are typically tuples of the form `(priority number, data)`. Parameters: **maxsize** ([_int_](https://docs.python.org/3/library/functions.html#int "(in Python v3.13)") ) _class_ cocotb.queue.LifoQueue(_maxsize\=0_)[\[source\]](https://docs.cocotb.org/en/stable/_modules/cocotb/queue.html#LifoQueue) [](https://docs.cocotb.org/en/stable/library_reference.html#cocotb.queue.LifoQueue "Link to this definition") A subclass of [`Queue`](https://docs.cocotb.org/en/stable/library_reference.html#cocotb.queue.Queue "cocotb.queue.Queue") ; retrieves most recently added entries first. Parameters: **maxsize** ([_int_](https://docs.python.org/3/library/functions.html#int "(in Python v3.13)") ) ### Other Runtime Information[](https://docs.cocotb.org/en/stable/library_reference.html#other-runtime-information "Link to this heading") cocotb.argv_: [List](https://docs.python.org/3/library/typing.html#typing.List "(in Python v3.13)") \[[str](https://docs.python.org/3/library/stdtypes.html#str "(in Python v3.13)")\ \] | [None](https://docs.python.org/3/library/constants.html#None "(in Python v3.13)") _ _\= None_[](https://docs.cocotb.org/en/stable/library_reference.html#cocotb.argv "Link to this definition") The argument list as seen by the simulator. This is guaranteed to hold a value at test time. cocotb.SIM\_NAME_: [str](https://docs.python.org/3/library/stdtypes.html#str "(in Python v3.13)") | [None](https://docs.python.org/3/library/constants.html#None "(in Python v3.13)") _ _\= None_[](https://docs.cocotb.org/en/stable/library_reference.html#cocotb.SIM_NAME "Link to this definition") The running simulator product information. `None` if `cocotb` was not loaded from a simulator. cocotb.SIM\_VERSION_: [str](https://docs.python.org/3/library/stdtypes.html#str "(in Python v3.13)") | [None](https://docs.python.org/3/library/constants.html#None "(in Python v3.13)") _ _\= None_[](https://docs.cocotb.org/en/stable/library_reference.html#cocotb.SIM_VERSION "Link to this definition") The version of the running simulator. `None` if `cocotb` was not loaded from a simulator. cocotb.RANDOM\_SEED_: [int](https://docs.python.org/3/library/functions.html#int "(in Python v3.13)") | [None](https://docs.python.org/3/library/constants.html#None "(in Python v3.13)") _ _\= None_[](https://docs.cocotb.org/en/stable/library_reference.html#cocotb.RANDOM_SEED "Link to this definition") The value passed to the Python default random number generator. See [`RANDOM_SEED`](https://docs.cocotb.org/en/stable/building.html#envvar-RANDOM_SEED) for details on how the value is computed. This is guaranteed to hold a value at test time. cocotb.plusargs_: [Dict](https://docs.python.org/3/library/typing.html#typing.Dict "(in Python v3.13)") \[[str](https://docs.python.org/3/library/stdtypes.html#str "(in Python v3.13)")\ , [bool](https://docs.python.org/3/library/functions.html#bool "(in Python v3.13)")\ | [str](https://docs.python.org/3/library/stdtypes.html#str "(in Python v3.13)")\ \] | [None](https://docs.python.org/3/library/constants.html#None "(in Python v3.13)") _ _\= None_[](https://docs.cocotb.org/en/stable/library_reference.html#cocotb.plusargs "Link to this definition") A dictionary of “plusargs” handed to the simulation. See [`PLUSARGS`](https://docs.cocotb.org/en/stable/building.html#var-PLUSARGS) for details. This is guaranteed to hold a value at test time. cocotb.LANGUAGE_: [str](https://docs.python.org/3/library/stdtypes.html#str "(in Python v3.13)") | [None](https://docs.python.org/3/library/constants.html#None "(in Python v3.13)") _ _\= None_[](https://docs.cocotb.org/en/stable/library_reference.html#cocotb.LANGUAGE "Link to this definition") The value of [`TOPLEVEL_LANG`](https://docs.cocotb.org/en/stable/building.html#var-TOPLEVEL_LANG) . This is guaranteed to hold a value at test time. cocotb.top_: [SimHandleBase](https://docs.cocotb.org/en/stable/library_reference.html#cocotb.handle.SimHandleBase "cocotb.handle.SimHandleBase") | [None](https://docs.python.org/3/library/constants.html#None "(in Python v3.13)") _ _\= None_[](https://docs.cocotb.org/en/stable/library_reference.html#cocotb.top "Link to this definition") A handle to the [`TOPLEVEL`](https://docs.cocotb.org/en/stable/building.html#envvar-TOPLEVEL) entity/module. This is equivalent to the [DUT](https://docs.cocotb.org/en/stable/glossary.html#term-DUT) parameter given to cocotb tests, so it can be used wherever that variable can be used. It is particularly useful for extracting information about the [DUT](https://docs.cocotb.org/en/stable/glossary.html#term-DUT) in module-level class and function definitions; and in parameters to [`TestFactory`](https://docs.cocotb.org/en/stable/library_reference.html#cocotb.regression.TestFactory "cocotb.regression.TestFactory") s. `None` if `cocotb` was not loaded from a simulator. ### Signal Tracer for WaveDrom[](https://docs.cocotb.org/en/stable/library_reference.html#module-cocotb.wavedrom "Link to this heading") _class_ cocotb.wavedrom.Wavedrom(_obj_, _name\=''_)[\[source\]](https://docs.cocotb.org/en/stable/_modules/cocotb/wavedrom.html#Wavedrom) [](https://docs.cocotb.org/en/stable/library_reference.html#cocotb.wavedrom.Wavedrom "Link to this definition") Base class for a WaveDrom compatible tracer. sample()[\[source\]](https://docs.cocotb.org/en/stable/_modules/cocotb/wavedrom.html#Wavedrom.sample) [](https://docs.cocotb.org/en/stable/library_reference.html#cocotb.wavedrom.Wavedrom.sample "Link to this definition") Record a sample of the signal value at this point in time. clear()[\[source\]](https://docs.cocotb.org/en/stable/_modules/cocotb/wavedrom.html#Wavedrom.clear) [](https://docs.cocotb.org/en/stable/library_reference.html#cocotb.wavedrom.Wavedrom.clear "Link to this definition") Delete all sampled data. get(_add\_clock\=True_)[\[source\]](https://docs.cocotb.org/en/stable/_modules/cocotb/wavedrom.html#Wavedrom.get) [](https://docs.cocotb.org/en/stable/library_reference.html#cocotb.wavedrom.Wavedrom.get "Link to this definition") Return the samples as a list suitable for use with WaveDrom. _class_ cocotb.wavedrom.trace(_\*args_, _clk\=None_)[\[source\]](https://docs.cocotb.org/en/stable/_modules/cocotb/wavedrom.html#trace) [](https://docs.cocotb.org/en/stable/library_reference.html#cocotb.wavedrom.trace "Link to this definition") Context manager to enable tracing of signals. Arguments are an arbitrary number of signals or buses to trace. We also require a clock to sample on, passed in as a keyword argument. Usage: with trace(sig1, sig2, a\_bus, clk\=clk) as waves: \# Stuff happens, we trace it \# Dump to JSON format compatible with WaveDrom j \= waves.dumpj() Implementation Details[](https://docs.cocotb.org/en/stable/library_reference.html#implementation-details "Link to this heading") ---------------------------------------------------------------------------------------------------------------------------------- Note In general, nothing in this section should be interacted with directly - these components work mostly behind the scenes. ### The Scheduler[](https://docs.cocotb.org/en/stable/library_reference.html#the-scheduler "Link to this heading") cocotb.scheduler_: [Scheduler](https://docs.cocotb.org/en/stable/library_reference.html#cocotb.scheduler.Scheduler "cocotb.scheduler.Scheduler") | [None](https://docs.python.org/3/library/constants.html#None "(in Python v3.13)") _ _\= None_[](https://docs.cocotb.org/en/stable/library_reference.html#cocotb.scheduler "Link to this definition") The global scheduler instance. This is guaranteed to hold a value at test time. _class_ cocotb.scheduler.Scheduler(_handle\_result_)[\[source\]](https://docs.cocotb.org/en/stable/_modules/cocotb/scheduler.html#Scheduler) [](https://docs.cocotb.org/en/stable/library_reference.html#cocotb.scheduler.Scheduler "Link to this definition") The main scheduler. Here we accept callbacks from the simulator and schedule the appropriate coroutines. A callback fires, causing the [`react`](https://docs.cocotb.org/en/stable/library_reference.html#cocotb.scheduler.Scheduler.react "cocotb.scheduler.Scheduler.react") method to be called, with the trigger that caused the callback as the first argument. We look up a list of coroutines to schedule (indexed by the trigger) and schedule them in turn. Attention Implementors should not depend on the scheduling order! Some additional management is required since coroutines can return a list of triggers, to be scheduled when any one of the triggers fires. To ensure we don’t receive spurious callbacks, we have to un-prime all the other triggers when any one fires. Due to the simulator nuances and fun with delta delays we have the following modes: Normal mode * Callbacks cause coroutines to be scheduled * Any pending writes are cached and do not happen immediately ReadOnly mode * Corresponds to `cbReadOnlySynch` (VPI) or `vhpiCbRepEndOfTimeStep` (VHPI). In this state we are not allowed to perform writes. Write mode * Corresponds to `cbReadWriteSynch` (VPI) or `vhpiCbRepLastKnownDeltaCycle` (VHPI) In this mode we play back all the cached write updates. We can legally transition from Normal to Write by registering a [`ReadWrite`](https://docs.cocotb.org/en/stable/triggers.html#cocotb.triggers.ReadWrite "cocotb.triggers.ReadWrite") callback, however usually once a simulator has entered the ReadOnly phase of a given timestep then we must move to a new timestep before performing any writes. The mechanism for moving to a new timestep may not be consistent across simulators and therefore we provide an abstraction to assist with compatibility. Unless a coroutine has explicitly requested to be scheduled in ReadOnly mode (for example wanting to sample the finally settled value after all delta delays) then it can reasonably be expected to be scheduled during “normal mode” i.e. where writes are permitted. Parameters: **handle\_result** ([_Callable_](https://docs.python.org/3/library/typing.html#typing.Callable "(in Python v3.13)") _\[__\[_[_Task_](https://docs.cocotb.org/en/stable/library_reference.html#cocotb.task.Task "cocotb.task.Task")\ _\]__,_ _None__\]_) react(_trigger_)[\[source\]](https://docs.cocotb.org/en/stable/_modules/cocotb/scheduler.html#Scheduler.react) [](https://docs.cocotb.org/en/stable/library_reference.html#cocotb.scheduler.Scheduler.react "Link to this definition") Deprecated since version 1.5: This function is now private. unschedule(_coro_)[\[source\]](https://docs.cocotb.org/en/stable/_modules/cocotb/scheduler.html#Scheduler.unschedule) [](https://docs.cocotb.org/en/stable/library_reference.html#cocotb.scheduler.Scheduler.unschedule "Link to this definition") Deprecated since version 1.5: This function is now private. queue(_coroutine_)[\[source\]](https://docs.cocotb.org/en/stable/_modules/cocotb/scheduler.html#Scheduler.queue) [](https://docs.cocotb.org/en/stable/library_reference.html#cocotb.scheduler.Scheduler.queue "Link to this definition") Deprecated since version 1.5: This function is now private. queue\_function(_coro_)[\[source\]](https://docs.cocotb.org/en/stable/_modules/cocotb/scheduler.html#Scheduler.queue_function) [](https://docs.cocotb.org/en/stable/library_reference.html#cocotb.scheduler.Scheduler.queue_function "Link to this definition") Deprecated since version 1.5: This function is now private. run\_in\_executor(_func_, _\*args_, _\*\*kwargs_)[\[source\]](https://docs.cocotb.org/en/stable/_modules/cocotb/scheduler.html#Scheduler.run_in_executor) [](https://docs.cocotb.org/en/stable/library_reference.html#cocotb.scheduler.Scheduler.run_in_executor "Link to this definition") Deprecated since version 1.5: This function is now private. _static_ create\_task(_coroutine_)[\[source\]](https://docs.cocotb.org/en/stable/_modules/cocotb/scheduler.html#Scheduler.create_task) [](https://docs.cocotb.org/en/stable/library_reference.html#cocotb.scheduler.Scheduler.create_task "Link to this definition") Check to see if the given object is a schedulable coroutine object and if so, return it. Parameters: **coroutine** ([_Any_](https://docs.python.org/3/library/typing.html#typing.Any "(in Python v3.13)") ) Return type: [_Task_](https://docs.cocotb.org/en/stable/library_reference.html#cocotb.task.Task "cocotb.task.Task") start\_soon(_coro_)[\[source\]](https://docs.cocotb.org/en/stable/_modules/cocotb/scheduler.html#Scheduler.start_soon) [](https://docs.cocotb.org/en/stable/library_reference.html#cocotb.scheduler.Scheduler.start_soon "Link to this definition") Schedule a coroutine to be run concurrently, starting after the current coroutine yields control. In contrast to [`fork()`](https://docs.cocotb.org/en/stable/library_reference.html#cocotb.fork "cocotb.fork") which starts the given coroutine immediately, this function starts the given coroutine only after the current coroutine yields control. This is useful when the coroutine to be forked has logic before the first [`await`](https://docs.python.org/3/reference/expressions.html#await "(in Python v3.13)") that may not be safe to execute immediately. Added in version 1.5. Parameters: **coro** ([_Coroutine_](https://docs.python.org/3/library/collections.abc.html#collections.abc.Coroutine "(in Python v3.13)") _|_ [_Task_](https://docs.cocotb.org/en/stable/library_reference.html#cocotb.task.Task "cocotb.task.Task") ) Return type: [_Task_](https://docs.cocotb.org/en/stable/library_reference.html#cocotb.task.Task "cocotb.task.Task") add\_test(_test\_coro_)[\[source\]](https://docs.cocotb.org/en/stable/_modules/cocotb/scheduler.html#Scheduler.add_test) [](https://docs.cocotb.org/en/stable/library_reference.html#cocotb.scheduler.Scheduler.add_test "Link to this definition") Deprecated since version 1.5: This function is now private. schedule(_coroutine_, _trigger\=None_)[\[source\]](https://docs.cocotb.org/en/stable/_modules/cocotb/scheduler.html#Scheduler.schedule) [](https://docs.cocotb.org/en/stable/library_reference.html#cocotb.scheduler.Scheduler.schedule "Link to this definition") Deprecated since version 1.5: This function is now private. finish\_test(_exc_)[\[source\]](https://docs.cocotb.org/en/stable/_modules/cocotb/scheduler.html#Scheduler.finish_test) [](https://docs.cocotb.org/en/stable/library_reference.html#cocotb.scheduler.Scheduler.finish_test "Link to this definition") Deprecated since version 1.5: This function is now private. finish\_scheduler(_exc_)[\[source\]](https://docs.cocotb.org/en/stable/_modules/cocotb/scheduler.html#Scheduler.finish_scheduler) [](https://docs.cocotb.org/en/stable/library_reference.html#cocotb.scheduler.Scheduler.finish_scheduler "Link to this definition") Deprecated since version 1.5: This function is now private. cleanup()[\[source\]](https://docs.cocotb.org/en/stable/_modules/cocotb/scheduler.html#Scheduler.cleanup) [](https://docs.cocotb.org/en/stable/library_reference.html#cocotb.scheduler.Scheduler.cleanup "Link to this definition") Deprecated since version 1.5: This function is now private. ### The Regression Manager[](https://docs.cocotb.org/en/stable/library_reference.html#the-regression-manager "Link to this heading") cocotb.regression\_manager_: [RegressionManager](https://docs.cocotb.org/en/stable/library_reference.html#cocotb.regression.RegressionManager "cocotb.regression.RegressionManager") | [None](https://docs.python.org/3/library/constants.html#None "(in Python v3.13)") _ _\= None_[](https://docs.cocotb.org/en/stable/library_reference.html#cocotb.regression_manager "Link to this definition") The global regression manager instance. This is guaranteed to hold a value at test time. _class_ cocotb.regression.RegressionManager(_dut_, _tests_)[\[source\]](https://docs.cocotb.org/en/stable/_modules/cocotb/regression.html#RegressionManager) [](https://docs.cocotb.org/en/stable/library_reference.html#cocotb.regression.RegressionManager "Link to this definition") Encapsulates all regression capability into a single place Parameters: * **dut** (_SimHandle_) – The root handle to pass into test functions. * **tests** (_Iterable__\[__Test__\]_) – tests to run _classmethod_ from\_discovery(_dut_)[\[source\]](https://docs.cocotb.org/en/stable/_modules/cocotb/regression.html#RegressionManager.from_discovery) [](https://docs.cocotb.org/en/stable/library_reference.html#cocotb.regression.RegressionManager.from_discovery "Link to this definition") Obtains the test list by discovery. See [`MODULE`](https://docs.cocotb.org/en/stable/building.html#envvar-MODULE) and [`TESTCASE`](https://docs.cocotb.org/en/stable/building.html#envvar-TESTCASE) for details on how tests are discovered. Parameters: **dut** (_SimHandle_) – The root handle to pass into test functions. ### The `cocotb.simulator` module[](https://docs.cocotb.org/en/stable/library_reference.html#the-cocotb-simulator-module "Link to this heading") This module is a Python wrapper to libgpi. It should not be considered public API, but is documented here for developers of cocotb. cocotb.simulator.get\_precision() → [int](https://docs.python.org/3/library/functions.html#int "(in Python v3.13)") [](https://docs.cocotb.org/en/stable/library_reference.html#cocotb.simulator.get_precision "Link to this definition") Get the precision of the simulator in powers of 10. For example, if `-12` is returned, the simulator’s time precision is 10\*\*-12 or 1 ps. cocotb.simulator.get\_root\_handle(_name: [str](https://docs.python.org/3/library/stdtypes.html#str "(in Python v3.13)") _) → [cocotb.simulator.gpi\_sim\_hdl](https://docs.cocotb.org/en/stable/library_reference.html#cocotb.simulator.gpi_sim_hdl "cocotb.simulator.gpi_sim_hdl") [](https://docs.cocotb.org/en/stable/library_reference.html#cocotb.simulator.get_root_handle "Link to this definition") Get the root handle. cocotb.simulator.get\_sim\_time() → Tuple\[[int](https://docs.python.org/3/library/functions.html#int "(in Python v3.13)")\ , [int](https://docs.python.org/3/library/functions.html#int "(in Python v3.13)")\ \][](https://docs.cocotb.org/en/stable/library_reference.html#cocotb.simulator.get_sim_time "Link to this definition") Get the current simulation time. Time is represented as a tuple of 32 bit integers (\[low32, high32\]) comprising a single 64 bit integer. cocotb.simulator.get\_simulator\_product() → [str](https://docs.python.org/3/library/stdtypes.html#str "(in Python v3.13)") [](https://docs.cocotb.org/en/stable/library_reference.html#cocotb.simulator.get_simulator_product "Link to this definition") Get the simulator’s product string. cocotb.simulator.get\_simulator\_version() → [str](https://docs.python.org/3/library/stdtypes.html#str "(in Python v3.13)") [](https://docs.cocotb.org/en/stable/library_reference.html#cocotb.simulator.get_simulator_version "Link to this definition") Get the simulator’s product version string. _class_ cocotb.simulator.gpi\_cb\_hdl[](https://docs.cocotb.org/en/stable/library_reference.html#cocotb.simulator.gpi_cb_hdl "Link to this definition") GPI callback handle deregister() → [None](https://docs.python.org/3/library/constants.html#None "(in Python v3.13)") [](https://docs.cocotb.org/en/stable/library_reference.html#cocotb.simulator.gpi_cb_hdl.deregister "Link to this definition") De-register this callback. _class_ cocotb.simulator.gpi\_iterator\_hdl[](https://docs.cocotb.org/en/stable/library_reference.html#cocotb.simulator.gpi_iterator_hdl "Link to this definition") GPI iterator handle. _class_ cocotb.simulator.gpi\_sim\_hdl[](https://docs.cocotb.org/en/stable/library_reference.html#cocotb.simulator.gpi_sim_hdl "Link to this definition") GPI object handle Contains methods for getting and setting the value of a GPI object, and introspection. get\_const() → [bool](https://docs.python.org/3/library/functions.html#bool "(in Python v3.13)") [](https://docs.cocotb.org/en/stable/library_reference.html#cocotb.simulator.gpi_sim_hdl.get_const "Link to this definition") Return `True` if the object is a constant. get\_definition\_file() → [str](https://docs.python.org/3/library/stdtypes.html#str "(in Python v3.13)") [](https://docs.cocotb.org/en/stable/library_reference.html#cocotb.simulator.gpi_sim_hdl.get_definition_file "Link to this definition") Get the file that sources the object’s definition. get\_definition\_name() → [str](https://docs.python.org/3/library/stdtypes.html#str "(in Python v3.13)") [](https://docs.cocotb.org/en/stable/library_reference.html#cocotb.simulator.gpi_sim_hdl.get_definition_name "Link to this definition") Get the name of a GPI object’s definition. get\_handle\_by\_index(_index: [int](https://docs.python.org/3/library/functions.html#int "(in Python v3.13)") _) → [cocotb.simulator.gpi\_sim\_hdl](https://docs.cocotb.org/en/stable/library_reference.html#cocotb.simulator.gpi_sim_hdl "cocotb.simulator.gpi_sim_hdl") [](https://docs.cocotb.org/en/stable/library_reference.html#cocotb.simulator.gpi_sim_hdl.get_handle_by_index "Link to this definition") Get a handle to a child object by index. get\_handle\_by\_name(_name: [str](https://docs.python.org/3/library/stdtypes.html#str "(in Python v3.13)") _) → [cocotb.simulator.gpi\_sim\_hdl](https://docs.cocotb.org/en/stable/library_reference.html#cocotb.simulator.gpi_sim_hdl "cocotb.simulator.gpi_sim_hdl") [](https://docs.cocotb.org/en/stable/library_reference.html#cocotb.simulator.gpi_sim_hdl.get_handle_by_name "Link to this definition") Get a handle to a child object by name. get\_name\_string() → [str](https://docs.python.org/3/library/stdtypes.html#str "(in Python v3.13)") [](https://docs.cocotb.org/en/stable/library_reference.html#cocotb.simulator.gpi_sim_hdl.get_name_string "Link to this definition") Get the name of an object as a string. get\_num\_elems() → [int](https://docs.python.org/3/library/functions.html#int "(in Python v3.13)") [](https://docs.cocotb.org/en/stable/library_reference.html#cocotb.simulator.gpi_sim_hdl.get_num_elems "Link to this definition") Get the number of elements contained in the handle. get\_range() → Tuple\[[int](https://docs.python.org/3/library/functions.html#int "(in Python v3.13)")\ , [int](https://docs.python.org/3/library/functions.html#int "(in Python v3.13)")\ \][](https://docs.cocotb.org/en/stable/library_reference.html#cocotb.simulator.gpi_sim_hdl.get_range "Link to this definition") Get the range of elements (tuple) contained in the handle, return `None` if not indexable. get\_signal\_val\_binstr() → [str](https://docs.python.org/3/library/stdtypes.html#str "(in Python v3.13)") [](https://docs.cocotb.org/en/stable/library_reference.html#cocotb.simulator.gpi_sim_hdl.get_signal_val_binstr "Link to this definition") Get the value of a logic vector signal as a string of (`0`, `1`, `X`, etc.), one element per character. get\_signal\_val\_long() → [int](https://docs.python.org/3/library/functions.html#int "(in Python v3.13)") [](https://docs.cocotb.org/en/stable/library_reference.html#cocotb.simulator.gpi_sim_hdl.get_signal_val_long "Link to this definition") Get the value of a signal as an integer. get\_signal\_val\_real() → [float](https://docs.python.org/3/library/functions.html#float "(in Python v3.13)") [](https://docs.cocotb.org/en/stable/library_reference.html#cocotb.simulator.gpi_sim_hdl.get_signal_val_real "Link to this definition") Get the value of a signal as a float. get\_signal\_val\_str() → [bytes](https://docs.python.org/3/library/stdtypes.html#bytes "(in Python v3.13)") [](https://docs.cocotb.org/en/stable/library_reference.html#cocotb.simulator.gpi_sim_hdl.get_signal_val_str "Link to this definition") Get the value of a signal as a byte string. get\_type() → [int](https://docs.python.org/3/library/functions.html#int "(in Python v3.13)") [](https://docs.cocotb.org/en/stable/library_reference.html#cocotb.simulator.gpi_sim_hdl.get_type "Link to this definition") Get the GPI type of an object as an enum. get\_type\_string() → [str](https://docs.python.org/3/library/stdtypes.html#str "(in Python v3.13)") [](https://docs.cocotb.org/en/stable/library_reference.html#cocotb.simulator.gpi_sim_hdl.get_type_string "Link to this definition") Get the GPI type of an object as a string. iterate(_mode: [int](https://docs.python.org/3/library/functions.html#int "(in Python v3.13)") _) → [cocotb.simulator.gpi\_iterator\_hdl](https://docs.cocotb.org/en/stable/library_reference.html#cocotb.simulator.gpi_iterator_hdl "cocotb.simulator.gpi_iterator_hdl") [](https://docs.cocotb.org/en/stable/library_reference.html#cocotb.simulator.gpi_sim_hdl.iterate "Link to this definition") Get an iterator handle to loop over all members in an object. set\_signal\_val\_binstr(_action: [int](https://docs.python.org/3/library/functions.html#int "(in Python v3.13)") _, _value: [str](https://docs.python.org/3/library/stdtypes.html#str "(in Python v3.13)") _) → [None](https://docs.python.org/3/library/constants.html#None "(in Python v3.13)") [](https://docs.cocotb.org/en/stable/library_reference.html#cocotb.simulator.gpi_sim_hdl.set_signal_val_binstr "Link to this definition") Set the value of a logic vector signal using a string of (`0`, `1`, `X`, etc.), one element per character. set\_signal\_val\_int(_action_, _value_, _/_)[](https://docs.cocotb.org/en/stable/library_reference.html#cocotb.simulator.gpi_sim_hdl.set_signal_val_int "Link to this definition") Set the value of a signal using an int set\_signal\_val\_real(_action: [int](https://docs.python.org/3/library/functions.html#int "(in Python v3.13)") _, _value: [float](https://docs.python.org/3/library/functions.html#float "(in Python v3.13)") _) → [None](https://docs.python.org/3/library/constants.html#None "(in Python v3.13)") [](https://docs.cocotb.org/en/stable/library_reference.html#cocotb.simulator.gpi_sim_hdl.set_signal_val_real "Link to this definition") Set the value of a signal using a float. set\_signal\_val\_str(_action: [int](https://docs.python.org/3/library/functions.html#int "(in Python v3.13)") _, _value: [bytes](https://docs.python.org/3/library/stdtypes.html#bytes "(in Python v3.13)") _) → [None](https://docs.python.org/3/library/constants.html#None "(in Python v3.13)") [](https://docs.cocotb.org/en/stable/library_reference.html#cocotb.simulator.gpi_sim_hdl.set_signal_val_str "Link to this definition") Set the value of a signal using a user-encoded string. cocotb.simulator.is\_running() → [bool](https://docs.python.org/3/library/functions.html#bool "(in Python v3.13)") [](https://docs.cocotb.org/en/stable/library_reference.html#cocotb.simulator.is_running "Link to this definition") Returns `True` if the caller is running within a simulator. Added in version 1.4. cocotb.simulator.log\_level(_level: [int](https://docs.python.org/3/library/functions.html#int "(in Python v3.13)") _) → [None](https://docs.python.org/3/library/constants.html#None "(in Python v3.13)") [](https://docs.cocotb.org/en/stable/library_reference.html#cocotb.simulator.log_level "Link to this definition") Set the log level for GPI. cocotb.simulator.log\_msg(_name: [str](https://docs.python.org/3/library/stdtypes.html#str "(in Python v3.13)") _, _path: [str](https://docs.python.org/3/library/stdtypes.html#str "(in Python v3.13)") _, _funcname: [str](https://docs.python.org/3/library/stdtypes.html#str "(in Python v3.13)") _, _lineno: [int](https://docs.python.org/3/library/functions.html#int "(in Python v3.13)") _, _msg: [str](https://docs.python.org/3/library/stdtypes.html#str "(in Python v3.13)") _) → [None](https://docs.python.org/3/library/constants.html#None "(in Python v3.13)") [](https://docs.cocotb.org/en/stable/library_reference.html#cocotb.simulator.log_msg "Link to this definition") Log a message. cocotb.simulator.register\_nextstep\_callback(_func: Callable\[..., [None](https://docs.python.org/3/library/constants.html#None "(in Python v3.13)")\ \]_, _\*args: Any_) → [cocotb.simulator.gpi\_cb\_hdl](https://docs.cocotb.org/en/stable/library_reference.html#cocotb.simulator.gpi_cb_hdl "cocotb.simulator.gpi_cb_hdl") [](https://docs.cocotb.org/en/stable/library_reference.html#cocotb.simulator.register_nextstep_callback "Link to this definition") Register a callback for the cbNextSimTime callback. cocotb.simulator.register\_readonly\_callback(_func: Callable\[..., [None](https://docs.python.org/3/library/constants.html#None "(in Python v3.13)")\ \]_, _\*args: Any_) → [cocotb.simulator.gpi\_cb\_hdl](https://docs.cocotb.org/en/stable/library_reference.html#cocotb.simulator.gpi_cb_hdl "cocotb.simulator.gpi_cb_hdl") [](https://docs.cocotb.org/en/stable/library_reference.html#cocotb.simulator.register_readonly_callback "Link to this definition") Register a callback for the read-only section. cocotb.simulator.register\_rwsynch\_callback(_func: Callable\[..., [None](https://docs.python.org/3/library/constants.html#None "(in Python v3.13)")\ \]_, _\*args: Any_) → [cocotb.simulator.gpi\_cb\_hdl](https://docs.cocotb.org/en/stable/library_reference.html#cocotb.simulator.gpi_cb_hdl "cocotb.simulator.gpi_cb_hdl") [](https://docs.cocotb.org/en/stable/library_reference.html#cocotb.simulator.register_rwsynch_callback "Link to this definition") Register a callback for the read-write section. cocotb.simulator.register\_timed\_callback(_time: [int](https://docs.python.org/3/library/functions.html#int "(in Python v3.13)") _, _func: Callable\[..., [None](https://docs.python.org/3/library/constants.html#None "(in Python v3.13)")\ \]_, _\*args: Any_) → [cocotb.simulator.gpi\_cb\_hdl](https://docs.cocotb.org/en/stable/library_reference.html#cocotb.simulator.gpi_cb_hdl "cocotb.simulator.gpi_cb_hdl") [](https://docs.cocotb.org/en/stable/library_reference.html#cocotb.simulator.register_timed_callback "Link to this definition") Register a timed callback. cocotb.simulator.register\_value\_change\_callback(_signal: [cocotb.simulator.gpi\_sim\_hdl](https://docs.cocotb.org/en/stable/library_reference.html#cocotb.simulator.gpi_sim_hdl "cocotb.simulator.gpi_sim_hdl") _, _func: Callable\[..., [None](https://docs.python.org/3/library/constants.html#None "(in Python v3.13)")\ \]_, _edge: [int](https://docs.python.org/3/library/functions.html#int "(in Python v3.13)") _, _\*args: Any_) → [cocotb.simulator.gpi\_cb\_hdl](https://docs.cocotb.org/en/stable/library_reference.html#cocotb.simulator.gpi_cb_hdl "cocotb.simulator.gpi_cb_hdl") [](https://docs.cocotb.org/en/stable/library_reference.html#cocotb.simulator.register_value_change_callback "Link to this definition") Register a signal change callback. cocotb.simulator.stop\_simulator() → [None](https://docs.python.org/3/library/constants.html#None "(in Python v3.13)") [](https://docs.cocotb.org/en/stable/library_reference.html#cocotb.simulator.stop_simulator "Link to this definition") Instruct the attached simulator to stop. Users should not call this function. ### The `cocotb-config` script[](https://docs.cocotb.org/en/stable/library_reference.html#the-cocotb-config-script "Link to this heading") #### cocotb-config - CLI interface[](https://docs.cocotb.org/en/stable/library_reference.html#cocotb-config---CLI-interface "Link to this heading") cocotb\-config \[\-h\] \[\--prefix\] \[\--share\] \[\--makefiles\] \[\--python\-bin\] \[\--help\-vars\] \[\--libpython\] \[\--lib\-dir\] \[\--lib\-name INTERFACE SIMULATOR\] \[\--lib\-name\-path INTERFACE SIMULATOR\] \[\-v\] ##### cocotb-config options[](https://docs.cocotb.org/en/stable/library_reference.html#cocotb-config-options "Link to this heading") * [**`-h`**](https://docs.cocotb.org/en/stable/library_reference.html#cocotb-config--h "cocotb-config -h") , [**`--help`**](https://docs.cocotb.org/en/stable/library_reference.html#cocotb-config---help "cocotb-config --help") - show this help message and exit * [**`--prefix`**](https://docs.cocotb.org/en/stable/library_reference.html#cocotb-config---prefix "cocotb-config --prefix") - echo the package-prefix of cocotb (default: `None`) * [**`--share`**](https://docs.cocotb.org/en/stable/library_reference.html#cocotb-config---share "cocotb-config --share") - echo the package-share of cocotb (default: `None`) * [**`--makefiles`**](https://docs.cocotb.org/en/stable/library_reference.html#cocotb-config---makefiles "cocotb-config --makefiles") - echo the package-makefiles of cocotb (default: `None`) * [**`--python-bin`**](https://docs.cocotb.org/en/stable/library_reference.html#cocotb-config---python-bin "cocotb-config --python-bin") - echo the path to the Python binary cocotb is installed for (default: `None`) * [**`--help-vars`**](https://docs.cocotb.org/en/stable/library_reference.html#cocotb-config---help-vars "cocotb-config --help-vars") - show help about supported variables (default: `None`) * [**`--libpython`**](https://docs.cocotb.org/en/stable/library_reference.html#cocotb-config---libpython "cocotb-config --libpython") - Print the absolute path to the libpython associated with the current Python installation (default: `None`) * [**`--lib-dir`**](https://docs.cocotb.org/en/stable/library_reference.html#cocotb-config---lib-dir "cocotb-config --lib-dir") - Print the absolute path to the interface libraries location (default: `None`) * [**`--lib-name`**](https://docs.cocotb.org/en/stable/library_reference.html#cocotb-config---lib-name "cocotb-config --lib-name") `INTERFACE` - Print the name of interface library for given interface (VPI/VHPI/FLI) and simulator (default: `None`) * [**`--lib-name-path`**](https://docs.cocotb.org/en/stable/library_reference.html#cocotb-config---lib-name-path "cocotb-config --lib-name-path") `INTERFACE` - Print the absolute path of interface library for given interface (VPI/VHPI/FLI) and simulator (default: `None`) * [**`-v`**](https://docs.cocotb.org/en/stable/library_reference.html#cocotb-config--v "cocotb-config -v") , [**`--version`**](https://docs.cocotb.org/en/stable/library_reference.html#cocotb-config---version "cocotb-config --version") - echo the version of cocotb (default: `None`) --- # Quickstart Guide — cocotb 1.9.2 documentation * [](https://docs.cocotb.org/en/v1.9.2/index.html) * Quickstart Guide * [View page source](https://docs.cocotb.org/en/v1.9.2/_sources/quickstart.rst.txt) * * * Quickstart Guide[](https://docs.cocotb.org/en/v1.9.2/quickstart.html#quickstart-guide "Link to this heading") =============================================================================================================== In the following sections, we are walking you through creating and running a small but complete cocotb testbench for a fictional _Design Under Test_ ([DUT](https://docs.cocotb.org/en/v1.9.2/glossary.html#term-DUT) ) called `my_design`. Please install the [prerequisites](https://docs.cocotb.org/en/v1.9.2/install.html#install-prerequisites) and cocotb itself (`pip install cocotb`) now. Run `cocotb-config --version` in a terminal window to check that cocotb is correctly installed. The code for the following example is available as [examples/doc\_examples/quickstart](https://github.com/cocotb/cocotb/blob/master/examples/doc_examples/quickstart) in the cocotb sources. You can also download the files here: [`my_design.sv`](https://docs.cocotb.org/en/v1.9.2/_downloads/34a7f224401ef92c903829b38f549f78/my_design.sv) , [`test_my_design.py`](https://docs.cocotb.org/en/v1.9.2/_downloads/9b06455a3d69695f077b91c59eeed7c0/test_my_design.py) , [`test_runner.py`](https://docs.cocotb.org/en/v1.9.2/_downloads/b962afa4d91aff7d9cb500fc64777110/test_runner.py) , [`Makefile`](https://docs.cocotb.org/en/v1.9.2/_downloads/6e692fc833ef972ad9c4b182deb53db4/Makefile) . Creating a Test[](https://docs.cocotb.org/en/v1.9.2/quickstart.html#creating-a-test "Link to this heading") ------------------------------------------------------------------------------------------------------------- A typical cocotb testbench requires no additional [HDL](https://docs.cocotb.org/en/v1.9.2/glossary.html#term-HDL) code. The [DUT](https://docs.cocotb.org/en/v1.9.2/glossary.html#term-DUT) is instantiated as the toplevel in the simulator without any HDL wrapper code. The test is written in Python. In cocotb, you can access all internals of your design, e.g. signals, ports, parameters, etc. through an object that is passed to each test. In the following we’ll call this object `dut`. Let’s create a test file `test_my_design.py` containing the following: \# test\_my\_design.py (simple) import cocotb from cocotb.triggers import Timer @cocotb.test() async def my\_first\_test(dut): """Try accessing the design.""" for cycle in range(10): dut.clk.value \= 0 await Timer(1, units\="ns") dut.clk.value \= 1 await Timer(1, units\="ns") dut.\_log.info("my\_signal\_1 is %s", dut.my\_signal\_1.value) assert dut.my\_signal\_2.value\[0\] \== 0, "my\_signal\_2\[0\] is not 0!" This will first drive 10 periods of a square wave clock onto a port `clk` of the toplevel. After this, the clock stops, the value of `my_signal_1` is printed, and the value of index `0` of `my_signal_2` is checked to be `0`. Things to note: * Use the `@cocotb.test()` decorator to mark the test function to be run. * Use `.value = value` to assign a value to a signal. * Use `.value` to get a signal’s current value. The test shown is running sequentially, from start to end. Each [`await`](https://docs.python.org/3/reference/expressions.html#await "(in Python v3.13)") expression suspends execution of the test until whatever event the test is waiting for occurs and the simulator returns control back to cocotb (see [Simulator Triggers](https://docs.cocotb.org/en/v1.9.2/triggers.html#simulator-triggers) ). It’s most likely that you will want to do several things “at the same time” however - think multiple `always` blocks in Verilog or `process` statements in VHDL. In cocotb, you might move the clock generation part of the example above into its own [`async`](https://docs.python.org/3/reference/compound_stmts.html#async "(in Python v3.13)") function and [`start()`](https://docs.cocotb.org/en/v1.9.2/library_reference.html#cocotb.start "cocotb.start") it (“start it in the background”) from the test: \# test\_my\_design.py (extended) import cocotb from cocotb.triggers import FallingEdge, Timer async def generate\_clock(dut): """Generate clock pulses.""" for cycle in range(10): dut.clk.value \= 0 await Timer(1, units\="ns") dut.clk.value \= 1 await Timer(1, units\="ns") @cocotb.test() async def my\_second\_test(dut): """Try accessing the design.""" await cocotb.start(generate\_clock(dut)) \# run the clock "in the background" await Timer(5, units\="ns") \# wait a bit await FallingEdge(dut.clk) \# wait for falling edge/"negedge" dut.\_log.info("my\_signal\_1 is %s", dut.my\_signal\_1.value) assert dut.my\_signal\_2.value\[0\] \== 0, "my\_signal\_2\[0\] is not 0!" Note that the `generate_clock()` function is _not_ marked with `@cocotb.test()` since this is not a test on its own, just a helper function. See the sections [Concurrent and sequential execution](https://docs.cocotb.org/en/v1.9.2/writing_testbenches.html#writing-tbs-concurrent-sequential) and [Coroutines and Tasks](https://docs.cocotb.org/en/v1.9.2/coroutines.html#coroutines) for more information on such concurrent processes. Note Since generating a clock is such a common task, cocotb provides a helper for it - [`cocotb.clock.Clock`](https://docs.cocotb.org/en/v1.9.2/library_reference.html#cocotb.clock.Clock "cocotb.clock.Clock") . No need to write your own clock generator! You would start [`Clock`](https://docs.cocotb.org/en/v1.9.2/library_reference.html#cocotb.clock.Clock "cocotb.clock.Clock") with `cocotb.start_soon(Clock(dut.clk, 1, units="ns").start())` near the top of your test, after importing it with `from cocotb.clock import Clock`. Creating a Makefile[](https://docs.cocotb.org/en/v1.9.2/quickstart.html#creating-a-makefile "Link to this heading") --------------------------------------------------------------------------------------------------------------------- In order to run a test, you create a `Makefile` that contains information about your project (i.e. the specific DUT and test). In the `Makefile` shown below we specify: * the default simulator to use ([`SIM`](https://docs.cocotb.org/en/v1.9.2/building.html#var-SIM) ), * the default language of the toplevel module or entity ([`TOPLEVEL_LANG`](https://docs.cocotb.org/en/v1.9.2/building.html#var-TOPLEVEL_LANG) , `verilog` in our case), * the design source files ([`VERILOG_SOURCES`](https://docs.cocotb.org/en/v1.9.2/building.html#var-VERILOG_SOURCES) and [`VHDL_SOURCES`](https://docs.cocotb.org/en/v1.9.2/building.html#var-VHDL_SOURCES) ), * the toplevel module or entity to instantiate ([`TOPLEVEL`](https://docs.cocotb.org/en/v1.9.2/building.html#envvar-TOPLEVEL) , `my_design` in our case), * and a Python module that contains our cocotb tests ([`MODULE`](https://docs.cocotb.org/en/v1.9.2/building.html#envvar-MODULE) . The file containing the test without the .py extension, `test_my_design` in our case). \# Makefile \# defaults SIM ?= icarus TOPLEVEL\_LANG ?= verilog VERILOG\_SOURCES += $(PWD)/my\_design.sv \# use VHDL\_SOURCES for VHDL files \# TOPLEVEL is the name of the toplevel module in your Verilog or VHDL file TOPLEVEL \= my\_design \# MODULE is the basename of the Python test file MODULE \= test\_my\_design \# include cocotb's make rules to take care of the simulator setup include $(shell cocotb-config --makefiles)/Makefile.sim Running a Test[](https://docs.cocotb.org/en/v1.9.2/quickstart.html#running-a-test "Link to this heading") ----------------------------------------------------------------------------------------------------------- When you now type make Icarus Verilog will be used to simulate the Verilog implementation of the DUT because we defined these as the default values. If you want to simulate the DUT with Siemens Questa instead, all you would need to change is the command line: make SIM\=questa Using runners[](https://docs.cocotb.org/en/v1.9.2/quickstart.html#using-runners "Link to this heading") --------------------------------------------------------------------------------------------------------- Warning Python runners and associated APIs are an experimental feature and subject to change. An alternative to the `Makefile` is to use the Python Test Runners, or “runner” for short. Let’s define a runner for `test_my_design_runner`: \# test\_runner.py import os from pathlib import Path from cocotb.runner import get\_runner def test\_my\_design\_runner(): sim \= os.getenv("SIM", "icarus") proj\_path \= Path(\_\_file\_\_).resolve().parent sources \= \[proj\_path / "my\_design.sv"\] runner \= get\_runner(sim) runner.build( sources\=sources, hdl\_toplevel\="my\_design", ) runner.test(hdl\_toplevel\="my\_design", test\_module\="test\_my\_design,") if \_\_name\_\_ \== "\_\_main\_\_": test\_my\_design\_runner() Running a test involves three steps: * first the runner is instantiated with `get_runner` based on the default simulator to use, * then the [HDL](https://docs.cocotb.org/en/v1.9.2/glossary.html#term-HDL) is built using the design sources and the toplevel with `runner.build`, * finally, the module containing tests to run are passed to `runner.test` The runner can be used with [pytest](https://pytest.org/) : pytest Or it can be run directly: python test\_runner.py See the section [Building HDL and Running Tests](https://docs.cocotb.org/en/v1.9.2/runner.html#howto-python-runner) for more details on how to use runners. This concludes our quick introduction to cocotb. You can now look through our Tutorials or check out the [Writing Testbenches](https://docs.cocotb.org/en/v1.9.2/writing_testbenches.html#writing-tbs) chapter for more details on the above. --- # Unknown ################################## Welcome to cocotb's documentation! ################################## .. This documentation tries to follow https://www.divio.com/blog/documentation/ (Daniele Procida) Other media about the same topic: - https://ep2018.europython.eu/media/conference/slides/get-your-documentation-right.pdf - https://www.youtube.com/watch?v=t4vKPhjcMZg - A good example: http://docs.django-cms.org/en/latest/contributing/documentation.html#contributing-documentation See also https://github.com/cocotb/cocotb/wiki/Howto:-Writing-Documentation \*\*\*\*\*\*\*\*\*\*\*\*\*\*\* What is cocotb? \*\*\*\*\*\*\*\*\*\*\*\*\*\*\* \*\*cocotb\*\* is a \*COroutine\* based \*COsimulation\* \*TestBench\* environment for verifying VHDL and SystemVerilog :term:\`RTL\` using \`Python \`\_. cocotb is completely free, open source (under the \`BSD License \`\_) and hosted on \`GitHub \`\_. cocotb requires a simulator to simulate the :term:\`HDL\` design and has been used with a variety of simulators on Linux, Windows and macOS. Please check the :ref:\`simulator-support\` page for specifics. A (possibly older) version of cocotb can be used live in a web browser on \`EDA Playground \`\_. \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\* How is cocotb different? \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\* cocotb encourages the same philosophy of design re-use and randomized testing as \`UVM \`\_, however is implemented in Python. With cocotb, VHDL or SystemVerilog are normally only used for the design itself, not the testbench. cocotb has built-in support for integrating with continuous integration systems, such as Jenkins, GitLab, etc. through standardized, machine-readable test reporting formats. cocotb was specifically designed to lower the overhead of creating a test. cocotb automatically discovers tests so that no additional step is required to add a test to a regression. All verification is done using Python which has various advantages over using SystemVerilog or VHDL for verification: \* Writing Python is \*\*fast\*\* - it's a very productive language. \* It's \*\*easy\*\* to interface to other languages from Python. \* Python has a huge library of existing code to \*\*re-use\*\*. \* Python is \*\*interpreted\*\* - tests can be edited and re-run without having to recompile the design. \* Python is \*\*popular\*\* - far more engineers know Python than SystemVerilog or VHDL. \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\* How does cocotb work? \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\* A typical cocotb testbench requires no additional :term:\`RTL\` code. The Design Under Test (:term:\`DUT\`) is instantiated as the toplevel in the simulator without any wrapper code. cocotb drives stimulus onto the inputs to the :term:\`DUT\` (or further down the hierarchy) and monitors the outputs directly from Python. Note that cocotb can not instantiate :term:\`HDL\` blocks - your DUT must be complete. .. image:: diagrams/svg/cocotb\_overview.svg A test is simply a Python function. At any given time either the simulator is advancing time or the Python code is executing. The :keyword:\`await\` keyword is used to indicate when to pass control of execution back to the simulator. A test can spawn multiple coroutines, allowing for independent flows of execution. .. toctree:: :maxdepth: 1 :hidden: quickstart install .. Tutorials - lessons that take the reader by the hand through a series of steps to complete a project (Example: kid cooking; learning-oriented) - learning by doing - getting started - inspiring confidence - repeatability - immediate sense of achievement - concreteness, not abstraction - minimum necessary explanation - no distractions .. toctree:: :maxdepth: 1 :caption: Tutorials :name: tutorials :hidden: examples .. How-To Guides - guides that take the reader through the steps required to solve a common problem (Example: recipe; problem-oriented) - a series of steps - a focus on the goal - addressing a specific question - no unnecessary explanation - a little flexibility - practical usability - good naming .. toctree:: :maxdepth: 1 :caption: How-to Guides :name: howto\_guides :hidden: writing\_testbenches runner coroutines triggers custom\_flows rotating\_logger .. todo:: - Add WaveDrom, IPython sections - How to deal with existing Verification IP? - Point to https://github.com/cocotb/cocotb/wiki/Code-Examples .. Explanation (Background, Discussions) - discussions that clarify and illuminate a particular topic (Example: history of cooking; understanding-oriented) - giving context - explaining why - multiple examples, alternative approaches - making connections - no instruction or technical description .. toctree:: :maxdepth: 1 :caption: Key topics :name: key\_topics :hidden: install\_devel troubleshooting .. todo:: - Move section "How does cocotb work?" from Introduction to here - Add some info from :doc:\`coroutines\` - Add GPI section - Explain \`\`ReadOnly\`\`, \`\`ReadWrite\`\`, ... phases - Add pitfall from https://github.com/cocotb/cocotb/issues/526#issuecomment-300371629 to troubleshooting .. Reference - technical descriptions of the machinery and its operation (Example: Wikipedia pages of ingredients; information-oriented) - structure - consistency - description - accuracy .. toctree:: :maxdepth: 1 :caption: Reference :name: reference :hidden: building Python Code Library Reference GPI Library Reference simulator\_support platform\_support extensions refcard .. toctree:: :maxdepth: 1 :caption: Development & Community :name: development\_community :hidden: roadmap contributors release\_notes further\_resources .. todo:: - Add "Join us online" and "Contributing" - In Contributing, add explanation on how to provide a PR, how to test existing PRs, etc. - merge \`further\_resources\` into Contributing .. toctree:: :maxdepth: 1 :caption: Index :name: index :hidden: Classes, Methods, Variables etc. Python Modules glossary --- # Unknown ################################## Welcome to cocotb's Documentation! ################################## .. This documentation tries to follow https://www.divio.com/blog/documentation/ (Daniele Procida) Other media about the same topic: - https://ep2018.europython.eu/media/conference/slides/get-your-documentation-right.pdf - https://www.youtube.com/watch?v=t4vKPhjcMZg - A good example: http://docs.django-cms.org/en/latest/contributing/documentation.html#contributing-documentation See also https://github.com/cocotb/cocotb/wiki/Howto:-Writing-Documentation \*\*\*\*\*\*\*\*\*\*\*\*\*\*\* What is cocotb? \*\*\*\*\*\*\*\*\*\*\*\*\*\*\* \*\*cocotb\*\* is a \*COroutine\* based \*COsimulation\* \*TestBench\* environment for verifying VHDL and SystemVerilog :term:\`RTL\` using \`Python \`\_. cocotb is completely free, open source (under the \`BSD License \`\_) and hosted on \`GitHub \`\_. cocotb requires a simulator to simulate the :term:\`HDL\` design and has been used with a variety of simulators on Linux, Windows and macOS. Please check the :ref:\`simulator-support\` page for specifics. A (possibly older) version of cocotb can be used live in a web browser on \`EDA Playground \`\_. \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\* How is cocotb different? \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\* cocotb encourages the same philosophy of design reuse and randomized testing as \`UVM \`\_, however is implemented in Python. With cocotb, VHDL or SystemVerilog are normally only used for the design itself, not the testbench. cocotb has built-in support for integrating with continuous integration systems, such as Jenkins, GitLab, etc. through standardized, machine-readable test reporting formats. cocotb was specifically designed to lower the overhead of creating a test. cocotb automatically discovers tests so that no additional step is required to add a test to a regression. All verification is done using Python which has various advantages over using SystemVerilog or VHDL for verification: \* Writing Python is \*\*fast\*\* - it's a very productive language. \* It's \*\*easy\*\* to interface to other languages from Python. \* Python has a huge library of existing code to \*\*reuse\*\*. \* Python is \*\*interpreted\*\* - tests can be edited and re-run without having to recompile the design. \* Python is \*\*popular\*\* - far more engineers know Python than SystemVerilog or VHDL. \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\* How does cocotb work? \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\* A typical cocotb testbench requires no additional :term:\`RTL\` code. The Design Under Test (:term:\`DUT\`) is instantiated as the toplevel in the simulator without any wrapper code. cocotb drives stimulus onto the inputs to the :term:\`DUT\` (or further down the hierarchy) and monitors the outputs directly from Python. Note that cocotb can not instantiate :term:\`HDL\` blocks - your DUT must be complete. .. image:: diagrams/svg/cocotb\_overview.svg A test is simply a Python function. At any given time either the simulator is advancing time or the Python code is executing. The :keyword:\`await\` keyword is used to indicate when to pass control of execution back to the simulator. A test can spawn multiple coroutines, allowing for independent flows of execution. .. toctree:: :maxdepth: 1 :hidden: quickstart install .. Tutorials - lessons that take the reader by the hand through a series of steps to complete a project (Example: kid cooking; learning-oriented) - learning by doing - getting started - inspiring confidence - repeatability - immediate sense of achievement - concreteness, not abstraction - minimum necessary explanation - no distractions .. toctree:: :maxdepth: 1 :caption: Tutorials :name: tutorials :hidden: examples .. How-To Guides - guides that take the reader through the steps required to solve a common problem (Example: recipe; problem-oriented) - a series of steps - a focus on the goal - addressing a specific question - no unnecessary explanation - a little flexibility - practical usability - good naming .. toctree:: :maxdepth: 1 :caption: How-to Guides :name: howto\_guides :hidden: writing\_testbenches runner coroutines triggers custom\_flows rotating\_logger extensions upgrade-2.0 update\_indexing .. todo:: - Add IPython section - How to deal with existing Verification IP? - Point to https://github.com/cocotb/cocotb/wiki/Code-Examples .. Explanation (Background, Discussions) - discussions that clarify and illuminate a particular topic (Example: history of cooking; understanding-oriented) - giving context - explaining why - multiple examples, alternative approaches - making connections - no instruction or technical description .. toctree:: :maxdepth: 1 :caption: Key topics :name: key\_topics :hidden: install\_devel troubleshooting timing\_model .. todo:: - Move section "How does cocotb work?" from Introduction to here - Add some info from :doc:\`coroutines\` - Add GPI section .. Reference - technical descriptions of the machinery and its operation (Example: Wikipedia pages of ingredients; information-oriented) - structure - consistency - description - accuracy .. toctree:: :maxdepth: 1 :caption: Reference :name: reference :hidden: building Python Code Library Reference GPI Library Reference simulator\_support platform\_support refcard .. toctree:: :maxdepth: 1 :caption: Development & Community :name: development\_community :hidden: support contributing developing maintaining contributors roadmap release\_notes further\_resources .. todo:: - merge \`further\_resources\` into Contributing .. toctree:: :maxdepth: 1 :caption: Index :name: index :hidden: Classes, Methods, Variables etc. Python Modules glossary --- # Introduction — cocotb 1.1 documentation * [Docs](https://docs.cocotb.org/en/v1.1/index.html) » * Introduction * [Edit on GitHub](https://github.com/cocotb/cocotb/blob/v1.1/documentation/source/introduction.rst) * * * Introduction[¶](https://docs.cocotb.org/en/v1.1/introduction.html#introduction "Permalink to this headline") ============================================================================================================= What is cocotb?[¶](https://docs.cocotb.org/en/v1.1/introduction.html#what-is-cocotb "Permalink to this headline") ------------------------------------------------------------------------------------------------------------------ **Cocotb** is a _COroutine_ based _COsimulation_ _TestBench_ environment for verifying VHDL/Verilog RTL using [Python](http://python.org/) . **Cocotb** is completely free, open source (under the [BSD License](http://en.wikipedia.org/wiki/BSD_licenses#3-clause_license_.28.22Revised_BSD_License.22.2C_.22New_BSD_License.22.2C_or_.22Modified_BSD_License.22.29) ) and hosted on [GitHub](https://github.com/potentialventures/cocotb) . **Cocotb** requires a simulator to simulate the RTL. Simulators that have been tested and known to work with Cocotb: Linux Platforms * [Icarus Verilog](http://iverilog.icarus.com/) * [GHDL](https://ghdl.free.fr/) * [Aldec](https://www.aldec.com/) Riviera-PRO * [Synopsys](http://www.synopsys.com/) VCS * [Cadence](http://www.cadence.com/) Incisive * [Mentor](http://www.mentor.com/) Modelsim (DE and SE) Windows Platform * [Icarus Verilog](http://iverilog.icarus.com/) * [Aldec](https://www.aldec.com/) Riviera-PRO * [Mentor](http://www.mentor.com/) Modelsim (DE and SE) An older version of **Cocotb** can be used live in a web-browser using [EDA Playground](http://www.edaplayground.com/) . How is Cocotb different?[¶](https://docs.cocotb.org/en/v1.1/introduction.html#how-is-cocotb-different "Permalink to this headline") ------------------------------------------------------------------------------------------------------------------------------------ **Cocotb** encourages the same philosophy of design re-use and randomised testing as UVM, however is implemented in Python rather than SystemVerilog. In Cocotb VHDL/Verilog/SystemVerilog are only used for the synthesisable design. **Cocotb** has built-in support for integrating with the [Jenkins](http://jenkins-ci.org/) continuous integration system. Cocotb was specifically designed to lower the overhead of creating a test. **Cocotb** automatically discovers tests so that no additional step is required to add a test to a regression. All verification is done using Python which has various advantages over using SystemVerilog or VHDL for verification: * Writing Python is **fast** - it’s a very productive language * It’s **easy** to interface to other languages from Python * Python has a huge library of existing code to **re-use** like [packet generation](http://www.secdev.org/projects/scapy/) libraries. * Python is **interpreted**. Tests can be edited and re-run them without having to recompile the design or exit the simulator GUI. * Python is **popular** - far more engineers know Python than SystemVerilog or VHDL How does Cocotb work?[¶](https://docs.cocotb.org/en/v1.1/introduction.html#how-does-cocotb-work "Permalink to this headline") ------------------------------------------------------------------------------------------------------------------------------ ### Overview[¶](https://docs.cocotb.org/en/v1.1/introduction.html#overview "Permalink to this headline") A typical cocotb testbench requires no additional RTL code. The Design Under Test (DUT) is instantiated as the toplevel in the simulator without any wrapper code. Cocotb drives stimulus onto the inputs to the DUT (or further down the hierarchy) and monitors the outputs directly from Python. ![_images/cocotb_overview.svg](https://docs.cocotb.org/en/v1.1/_images/cocotb_overview.svg) A test is simply a Python function. At any given time either the simulator is advancing time or the Python code is executing. The **yield** keyword is used to indicate when to pass control of execution back to the simulator. A test can spawn multiple coroutines, allowing for independent flows of execution. Contributors[¶](https://docs.cocotb.org/en/v1.1/introduction.html#contributors "Permalink to this headline") ------------------------------------------------------------------------------------------------------------- **Cocotb** was developed by [Potential Ventures](http://potential.ventures/) with the support of [Solarflare Communications Ltd](http://www.solarflare.com/) and contributions from Gordon McGregor and Finn Grimwood (see [contributers](https://github.com/potentialventures/cocotb/graphs/contributors) for full list of contributions). --- # Triggers — cocotb 1.1 documentation * [Docs](https://docs.cocotb.org/en/v1.1/index.html) » * Triggers * [Edit on GitHub](https://github.com/cocotb/cocotb/blob/v1.1/documentation/source/triggers.rst) * * * Triggers[¶](https://docs.cocotb.org/en/v1.1/triggers.html#triggers "Permalink to this headline") ================================================================================================= Triggers are used to indicate when the cocotb scheduler should resume coroutine execution. Typically a coroutine will [`yield`](https://docs.python.org/3/reference/simple_stmts.html#yield "(in Python v3.8)") a trigger or a list of triggers, while it is waiting for them to complete. Simulation Timing[¶](https://docs.cocotb.org/en/v1.1/triggers.html#simulation-timing "Permalink to this headline") ------------------------------------------------------------------------------------------------------------------- [`Timer(time)`](https://docs.cocotb.org/en/v1.1/library_reference.html#cocotb.triggers.Timer "cocotb.triggers.Timer") : Registers a timed callback with the simulator to continue execution of the coroutine after a specified simulation time period has elapsed. [`ReadOnly()`](https://docs.cocotb.org/en/v1.1/library_reference.html#cocotb.triggers.ReadOnly "cocotb.triggers.ReadOnly") : Registers a callback which will continue execution of the coroutine when the current simulation timestep moves to the [`ReadOnly`](https://docs.cocotb.org/en/v1.1/library_reference.html#cocotb.triggers.ReadOnly "cocotb.triggers.ReadOnly") phase of the RTL simulator. The [`ReadOnly`](https://docs.cocotb.org/en/v1.1/library_reference.html#cocotb.triggers.ReadOnly "cocotb.triggers.ReadOnly") phase is entered when the current timestep no longer has any further delta steps. This should be a point where all the signal values are stable as there are no more RTL events scheduled for the timestep. The simulator should not allow scheduling of more events in this timestep. Useful for monitors which need to wait for all processes to execute (both RTL and cocotb) to ensure sampled signal values are final. Signal related[¶](https://docs.cocotb.org/en/v1.1/triggers.html#signal-related "Permalink to this headline") ------------------------------------------------------------------------------------------------------------- [`Edge(signal)`](https://docs.cocotb.org/en/v1.1/library_reference.html#cocotb.triggers.Edge "cocotb.triggers.Edge") : Registers a callback that will continue execution of the coroutine on any value change of _signal_. [`RisingEdge(signal)`](https://docs.cocotb.org/en/v1.1/library_reference.html#cocotb.triggers.RisingEdge "cocotb.triggers.RisingEdge") : Registers a callback that will continue execution of the coroutine on a transition from `0` to `1` of _signal_. [`FallingEdge(signal)`](https://docs.cocotb.org/en/v1.1/library_reference.html#cocotb.triggers.FallingEdge "cocotb.triggers.FallingEdge") : Registers a callback that will continue execution of the coroutine on a transition from `1` to `0` of _signal_. [`ClockCycles(signal, num_cycles)`](https://docs.cocotb.org/en/v1.1/library_reference.html#cocotb.triggers.ClockCycles "cocotb.triggers.ClockCycles") : Registers a callback that will continue execution of the coroutine when _num\_cycles_ transitions from `0` to `1` have occured on _signal_. Python Triggers[¶](https://docs.cocotb.org/en/v1.1/triggers.html#python-triggers "Permalink to this headline") --------------------------------------------------------------------------------------------------------------- [`Event()`](https://docs.cocotb.org/en/v1.1/library_reference.html#cocotb.triggers.Event "cocotb.triggers.Event") : Can be used to synchronise between coroutines. Yielding [`Event.wait()`](https://docs.cocotb.org/en/v1.1/library_reference.html#cocotb.triggers.Event.wait "cocotb.triggers.Event.wait") will block the coroutine until [`Event.set()`](https://docs.cocotb.org/en/v1.1/library_reference.html#cocotb.triggers.Event.set "cocotb.triggers.Event.set") is called somewhere else. [`Join(coroutine_2)`](https://docs.cocotb.org/en/v1.1/library_reference.html#cocotb.triggers.Join "cocotb.triggers.Join") : Will block the coroutine until _coroutine\_2_ has completed. --- # Roadmap — cocotb 1.1 documentation * [Docs](https://docs.cocotb.org/en/v1.1/index.html) » * Roadmap * [Edit on GitHub](https://github.com/cocotb/cocotb/blob/v1.1/documentation/source/roadmap.rst) * * * Roadmap[¶](https://docs.cocotb.org/en/v1.1/roadmap.html#roadmap "Permalink to this headline") ============================================================================================== Cocotb is in active development. We use GitHub issues to track our pending tasks. Take a look at the [open Enhancements](https://github.com/potentialventures/cocotb/issues?labels=enhancement&state=open) to see the work that’s lined up. If you have a GitHub account you can also [raise an enhancement request](https://github.com/potentialventures/cocotb/issues/new) to suggest new features. --- # Troubleshooting — cocotb 1.1 documentation * [Docs](https://docs.cocotb.org/en/v1.1/index.html) » * Troubleshooting * [Edit on GitHub](https://github.com/cocotb/cocotb/blob/v1.1/documentation/source/troubleshooting.rst) * * * Troubleshooting[¶](https://docs.cocotb.org/en/v1.1/troubleshooting.html#troubleshooting "Permalink to this headline") ====================================================================================================================== Increasing Verbosity[¶](https://docs.cocotb.org/en/v1.1/troubleshooting.html#increasing-verbosity "Permalink to this headline") -------------------------------------------------------------------------------------------------------------------------------- If things fail in the VPI/VHPI/FLI area, check your simulator’s documentation to see if it has options to increase its verbosity about what may be wrong. You can then set these options on the `make` command line as `COMPILE_ARGS`, `SIM_ARGS` or `EXTRA_OPTS` (see [Build options and Environment Variables](https://docs.cocotb.org/en/v1.1/building.html) for details). Attaching a Debugger[¶](https://docs.cocotb.org/en/v1.1/troubleshooting.html#attaching-a-debugger "Permalink to this headline") -------------------------------------------------------------------------------------------------------------------------------- In order to give yourself time to attach a debugger to the simulator process before it starts to run, you can set the environment variable `COCOTB_ATTACH` to a pause time value in seconds. If set, Cocotb will print the process ID (PID) to attach to and wait the specified time before actually letting the simulator run. For the GNU debugger GDB, the command is `attach `. --- # Simulator Support — cocotb 1.1 documentation * [Docs](https://docs.cocotb.org/en/v1.1/index.html) » * Simulator Support * [Edit on GitHub](https://github.com/cocotb/cocotb/blob/v1.1/documentation/source/simulator_support.rst) * * * Simulator Support[¶](https://docs.cocotb.org/en/v1.1/simulator_support.html#simulator-support "Permalink to this headline") ============================================================================================================================ This page documents any known quirks and gotchas in the various simulators. Icarus[¶](https://docs.cocotb.org/en/v1.1/simulator_support.html#icarus "Permalink to this headline") ------------------------------------------------------------------------------------------------------ Accessing bits of a vector doesn’t work: dut.stream\_in\_data\[2\] <= 1 See “access\_single\_bit” test in examples/functionality/tests/test\_discovery.py. Synopsys VCS[¶](https://docs.cocotb.org/en/v1.1/simulator_support.html#synopsys-vcs "Permalink to this headline") ------------------------------------------------------------------------------------------------------------------ Aldec Riviera-PRO[¶](https://docs.cocotb.org/en/v1.1/simulator_support.html#aldec-riviera-pro "Permalink to this headline") ---------------------------------------------------------------------------------------------------------------------------- The $LICENSE\_QUEUE environmental variable can be used for this simulator - this setting will be mirrored in the TCL license\_queue variable to control runtime license checkouts. Mentor Questa[¶](https://docs.cocotb.org/en/v1.1/simulator_support.html#mentor-questa "Permalink to this headline") -------------------------------------------------------------------------------------------------------------------- Mentor Modelsim[¶](https://docs.cocotb.org/en/v1.1/simulator_support.html#mentor-modelsim "Permalink to this headline") ------------------------------------------------------------------------------------------------------------------------ Any ModelSim-PE or ModelSim-PE derivative (like ModelSim Microsemi, Altera, Lattice Edition) does not support the VHDL FLI feature. If you try to run with FLI enabled, you will see a vsim-FLI-3155 error: \*\* Error (suppressible): (vsim-FLI-3155) The FLI is not enabled in this version of ModelSim. ModelSim DE and SE (and Questa, of course) supports the FLI. Cadence Incisive[¶](https://docs.cocotb.org/en/v1.1/simulator_support.html#cadence-incisive "Permalink to this headline") -------------------------------------------------------------------------------------------------------------------------- GHDL[¶](https://docs.cocotb.org/en/v1.1/simulator_support.html#ghdl "Permalink to this headline") -------------------------------------------------------------------------------------------------- Support is preliminary. --- # Coroutines — cocotb 1.1 documentation * [Docs](https://docs.cocotb.org/en/v1.1/index.html) » * Coroutines * [Edit on GitHub](https://github.com/cocotb/cocotb/blob/v1.1/documentation/source/coroutines.rst) * * * Coroutines[¶](https://docs.cocotb.org/en/v1.1/coroutines.html#coroutines "Permalink to this headline") ======================================================================================================= Testbenches built using cocotb use coroutines. While the coroutine is executing the simulation is paused. The coroutine uses the [`yield`](https://docs.python.org/3/reference/simple_stmts.html#yield "(in Python v3.8)") keyword to pass control of execution back to the simulator and simulation time can advance again. Typically coroutines [`yield`](https://docs.python.org/3/reference/simple_stmts.html#yield "(in Python v3.8)") a `Trigger` object which indicates to the simulator some event which will cause the coroutine to be woken when it occurs. For example: @cocotb.coroutine def wait\_10ns(): cocotb.log.info("About to wait for 10ns") yield Timer(10000) cocotb.log.info("Simulation time has advanced by 10 ns") Coroutines may also yield other coroutines: @cocotb.coroutine def wait\_100ns(): for i in range(10): yield wait\_10ns() Coroutines can return a value, so that they can be used by other coroutines. Before Python 3.3, this requires a [`ReturnValue`](https://docs.cocotb.org/en/v1.1/library_reference.html#cocotb.result.ReturnValue "cocotb.result.ReturnValue") to be raised. @cocotb.coroutine def get\_signal(clk, signal): yield RisingEdge(clk) raise ReturnValue(signal.value) @cocotb.coroutine def get\_signal\_python\_33(clk, signal): \# newer versions of Python can use return normally yield RisingEdge(clk) return signal.value @cocotb.coroutine def check\_signal\_changes(dut): first \= yield get\_signal(dut.clk, dut.signal) second \= yield get\_signal(dut.clk, dut.signal) if first \== second: raise TestFailure("Signal did not change") Coroutines may also yield a list of triggers and coroutines to indicate that execution should resume if _any_ of them fires: @cocotb.coroutine def packet\_with\_timeout(monitor, timeout): """Wait for a packet but time out if nothing arrives""" yield \[Timer(timeout), RisingEdge(dut.ready)\] The trigger that caused execution to resume is passed back to the coroutine, allowing them to distinguish which trigger fired: @cocotb.coroutine def packet\_with\_timeout(monitor, timeout): """Wait for a packet but time out if nothing arrives""" tout\_trigger \= Timer(timeout) result \= yield \[tout\_trigger, RisingEdge(dut.ready)\] if result is tout\_trigger: raise TestFailure("Timed out waiting for packet") Coroutines can be forked for parallel operation within a function of that code and the forked code. @cocotb.test() def test\_act\_during\_reset(dut): """While reset is active, toggle signals""" tb \= uart\_tb(dut) \# "Clock" is a built in class for toggling a clock signal cocotb.fork(Clock(dut.clk, 1000).start()) \# reset\_dut is a function - \# part of the user-generated "uart\_tb" class cocotb.fork(tb.reset\_dut(dut.rstn, 20000)) yield Timer(10000) print("Reset is still active: %d" % dut.rstn) yield Timer(15000) print("Reset has gone inactive: %d" % dut.rstn) Coroutines can be joined to end parallel operation within a function. @cocotb.test() def test\_count\_edge\_cycles(dut, period\=1000, clocks\=6): cocotb.fork(Clock(dut.clk, period).start()) yield RisingEdge(dut.clk) timer \= Timer(period + 10) task \= cocotb.fork(count\_edges\_cycles(dut.clk, clocks)) count \= 0 expect \= clocks \- 1 while True: result \= yield \[timer, task.join()\] if count \> expect: raise TestFailure("Task didn't complete in expected time") if result is timer: dut.\_log.info("Count %d: Task still running" % count) count += 1 else: break Coroutines can be killed before they complete, forcing their completion before they’d naturally end. @cocotb.test() def test\_different\_clocks(dut): clk\_1mhz \= Clock(dut.clk, 1.0, units\='us') clk\_250mhz \= Clock(dut.clk, 4.0, units\='ns') clk\_gen \= cocotb.fork(clk\_1mhz.start()) start\_time\_ns \= get\_sim\_time(units\='ns') yield Timer(1) yield RisingEdge(dut.clk) edge\_time\_ns \= get\_sim\_time(units\='ns') \# NOTE: isclose is a python 3.5+ feature if not isclose(edge\_time\_ns, start\_time\_ns + 1000.0): raise TestFailure("Expected a period of 1 us") clk\_gen.kill() clk\_gen \= cocotb.fork(clk\_250mhz.start()) start\_time\_ns \= get\_sim\_time(units\='ns') yield Timer(1) yield RisingEdge(dut.clk) edge\_time\_ns \= get\_sim\_time(units\='ns') \# NOTE: isclose is a python 3.5+ feature if not isclose(edge\_time\_ns, start\_time\_ns + 4.0): raise TestFailure("Expected a period of 4 ns") --- # Build options and Environment Variables — cocotb 1.1 documentation * [Docs](https://docs.cocotb.org/en/v1.1/index.html) » * Build options and Environment Variables * [Edit on GitHub](https://github.com/cocotb/cocotb/blob/v1.1/documentation/source/building.rst) * * * Build options and Environment Variables[¶](https://docs.cocotb.org/en/v1.1/building.html#build-options-and-environment-variables "Permalink to this headline") =============================================================================================================================================================== Make System[¶](https://docs.cocotb.org/en/v1.1/building.html#make-system "Permalink to this headline") ------------------------------------------------------------------------------------------------------- Makefiles are provided for a variety of simulators in `cocotb/makefiles/simulators`. The common Makefile `cocotb/makefiles/Makefile.sim` includes the appropriate simulator Makefile based on the contents of the `SIM` variable. ### Make Targets[¶](https://docs.cocotb.org/en/v1.1/building.html#make-targets "Permalink to this headline") Makefiles define two targets, `regression` and `sim`, the default target is `sim`. Both rules create a results file in the calling directory called `results.xml`. This file is a JUnit-compatible output file suitable for use with [Jenkins](http://jenkins-ci.org/) . The `sim` targets unconditionally re-runs the simulator whereas the `regression` target only re-builds if any dependencies have changed. ### Make Phases[¶](https://docs.cocotb.org/en/v1.1/building.html#make-phases "Permalink to this headline") Typically the makefiles provided with Cocotb for various simulators use a separate `compile` and `run` target. This allows for a rapid re-running of a simulator if none of the RTL source files have changed and therefore the simulator does not need to recompile the RTL. ### Make Variables[¶](https://docs.cocotb.org/en/v1.1/building.html#make-variables "Permalink to this headline") `GUI` Set this to 1 to enable the GUI mode in the simulator (if supported). `SIM` Selects which simulator Makefile to use. Attempts to include a simulator specific makefile from `cocotb/makefiles/makefile.$(SIM)` `VERILOG_SOURCES` A list of the Verilog source files to include. `VHDL_SOURCES` A list of the VHDL source files to include. `COMPILE_ARGS` Any arguments or flags to pass to the compile stage of the simulation. Only applies to simulators with a separate compilation stage (currently Icarus and VCS). `SIM_ARGS` Any arguments or flags to pass to the execution of the compiled simulation. Only applies to simulators with a separate compilation stage (currently Icarus, VCS and GHDL). `EXTRA_ARGS` Passed to both the compile and execute phases of simulators with two rules, or passed to the single compile and run command for simulators which don’t have a distinct compilation stage. `CUSTOM_COMPILE_DEPS` Use to add additional dependencies to the compilation target; useful for defining additional rules to run pre-compilation or if the compilation phase depends on files other than the RTL sources listed in [VERILOG\_SOURCES](https://docs.cocotb.org/en/v1.1/building.html#term-verilog-sources) or [VHDL\_SOURCES](https://docs.cocotb.org/en/v1.1/building.html#term-vhdl-sources) . `CUSTOM_SIM_DEPS` Use to add additional dependencies to the simulation target. `COCOTB_NVC_TRACE` Set this to 1 to enable display of VHPI traces when using the nvc VHDL simulator. `SIM_BUILD` Use to define a scratch directory for use by the simulator. The path is relative to the Makefile location. If not provided, the default scratch directory is `sim_build`. Environment Variables[¶](https://docs.cocotb.org/en/v1.1/building.html#environment-variables "Permalink to this headline") --------------------------------------------------------------------------------------------------------------------------- `TOPLEVEL` Used to indicate the instance in the hierarchy to use as the DUT. If this isn’t defined then the first root instance is used. `RANDOM_SEED` Seed the Python random module to recreate a previous test stimulus. At the beginning of every test a message is displayed with the seed used for that execution: INFO cocotb.gpi \_\_init\_\_.py:89 in \_initialise\_testbench Seeding Python random module with 1377424946 To recreate the same stimuli use the following: make RANDOM\_SEED\=1377424946 `COCOTB_ANSI_OUTPUT` Use this to override the default behaviour of annotating Cocotb output with ANSI colour codes if the output is a terminal (`isatty()`). `COCOTB_ANSI_OUTPUT=1` forces output to be ANSI regardless of the type stdout `COCOTB_ANSI_OUTPUT=0` supresses the ANSI output in the log messages `COCOTB_REDUCED_LOG_FMT` If defined, log lines displayed in terminal will be shorter. It will print only time, message type (`INFO`, `WARNING`, `ERROR`) and log message. `MODULE` The name of the module(s) to search for test functions. Multiple modules can be specified using a comma-separated list. `TESTCASE` The name of the test function(s) to run. If this variable is not defined Cocotb discovers and executes all functions decorated with the [`cocotb.test`](https://docs.cocotb.org/en/v1.1/library_reference.html#cocotb.test "cocotb.test") decorator in the supplied modules. Multiple functions can be specified in a comma-separated list. ### Additional Environment Variables[¶](https://docs.cocotb.org/en/v1.1/building.html#additional-environment-variables "Permalink to this headline") `COCOTB_ATTACH` In order to give yourself time to attach a debugger to the simulator process before it starts to run, you can set the environment variable `COCOTB_ATTACH` to a pause time value in seconds. If set, Cocotb will print the process ID (PID) to attach to and wait the specified time before actually letting the simulator run. `COCOTB_ENABLE_PROFILING` Enable performance analysis of the Python portion of Cocotb. When set, a file `test_profile.pstat` will be written which contains statistics about the cumulative time spent in the functions. From this, a callgraph diagram can be generated with [gprof2dot](https://github.com/jrfonseca/gprof2dot) and `graphviz`. See the `profile` Make target in the `endian_swapper` example on how to set this up. `COCOTB_HOOKS` A comma-separated list of modules that should be executed before the first test. You can also use the [`cocotb.hook`](https://docs.cocotb.org/en/v1.1/library_reference.html#cocotb.hook "cocotb.hook") decorator to mark a function to be run before test code. `COCOTB_LOG_LEVEL` Default logging level to use. This is set to `INFO` unless overridden. `COCOTB_RESOLVE_X` Defines how to resolve bits with a value of `X`, `Z`, `U` or `W` when being converted to integer. Valid settings are: `VALUE_ERROR` raise a [`ValueError`](https://docs.python.org/3/library/exceptions.html#ValueError "(in Python v3.8)") exception `ZEROS` resolve to `0` `ONES` resolve to `1` `RANDOM` randomly resolve to a `0` or a `1` Set to `VALUE_ERROR` by default. `COCOTB_SCHEDULER_DEBUG` Enable additional log output of the coroutine scheduler. `MEMCHECK` HTTP port to use for debugging Python’s memory usage. When set to e.g. `8088`, data will be presented at [http://localhost:8088](http://localhost:8088/) . This needs the `cherrypy` and `dowser` Python modules installed. `SIM_ROOT` The root directory of the Cocotb installation. `VERSION` The version of the Cocotb installation. You probably don’t want to modify this. --- # Tutorial: Ping — cocotb 1.1 documentation * [Docs](https://docs.cocotb.org/en/v1.1/index.html) » * Tutorial: Ping * [Edit on GitHub](https://github.com/cocotb/cocotb/blob/v1.1/documentation/source/ping_tun_tap.rst) * * * Tutorial: Ping[¶](https://docs.cocotb.org/en/v1.1/ping_tun_tap.html#tutorial-ping "Permalink to this headline") ================================================================================================================ One of the benefits of Python is the ease with which interfacing is possible. In this tutorial we’ll look at interfacing the standard GNU [ping](http://www.gnu.org/software/inetutils/manual/html_node/ping-invocation.html) command to the simulator. Using Python we can ping our DUT with fewer than 50 lines of code. For the impatient this tutorial is provided as an example with Cocotb. You can run this example from a fresh checkout: cd examples/ping\_tun\_tap/tests sudo make Note To create a virtual interface the test either needs root permissions or have CAP\_NET\_ADMIN capability. Architecture[¶](https://docs.cocotb.org/en/v1.1/ping_tun_tap.html#architecture "Permalink to this headline") ------------------------------------------------------------------------------------------------------------- We have a simple RTL block that takes ICMP echo requests and generates an ICMP echo response. To verify this behaviour we want to run the [ping](http://www.gnu.org/software/inetutils/manual/html_node/ping-invocation.html) utility against our RTL running in the simulator. In order to achieve this we need to capture the packets that are created by ping, drive them onto the pins of our DUT in simulation, monitor the output of the DUT and send any responses back to the ping process. Linux has a [TUN/TAP](http://en.wikipedia.org/wiki/TUN/TAP) virtual network device which we can use for this purpose, allowing [ping](http://www.gnu.org/software/inetutils/manual/html_node/ping-invocation.html) to run unmodified and unaware that it is communicating with our simulation rather than a remote network endpoint. ![_images/ping_tun_tap.svg](https://docs.cocotb.org/en/v1.1/_images/ping_tun_tap.svg) Implementation[¶](https://docs.cocotb.org/en/v1.1/ping_tun_tap.html#implementation "Permalink to this headline") ----------------------------------------------------------------------------------------------------------------- First of all we need to work out how to create a virtual interface. Python has a huge developer base and a quick search of the web reveals a [TUN example](https://gist.github.com/glacjay/585369) that looks like an ideal starting point for our testbench. Using this example we write a function that will create our virtual interface: import subprocess, fcntl, struct def create\_tun(name\="tun0", ip\="192.168.255.1"): TUNSETIFF \= 0x400454ca TUNSETOWNER \= TUNSETIFF + 2 IFF\_TUN \= 0x0001 IFF\_NO\_PI \= 0x1000 tun \= open('/dev/net/tun', 'r+b') ifr \= struct.pack('16sH', name, IFF\_TUN | IFF\_NO\_PI) fcntl.ioctl(tun, TUNSETIFF, ifr) fcntl.ioctl(tun, TUNSETOWNER, 1000) subprocess.check\_call('ifconfig tun0 %s up pointopoint 192.168.255.2 up' % ip, shell\=True) return tun Now we can get started on the actual test. First of all we’ll create a clock signal and connect up the Avalon driver and monitor to the DUT. To help debug the testbench we’ll enable verbose debug on the drivers and monitors by setting the log level to **logging.DEBUG**. import cocotb from cocotb.clock import Clock from cocotb.drivers.avalon import AvalonSTPkts as AvalonSTDriver from cocotb.monitors.avalon import AvalonSTPkts as AvalonSTMonitor @cocotb.test() def tun\_tap\_example\_test(dut): cocotb.fork(Clock(dut.clk, 5000).start()) stream\_in \= AvalonSTDriver(dut, "stream\_in", dut.clk) stream\_out \= AvalonSTMonitor(dut, "stream\_out", dut.clk) \# Enable verbose logging on the streaming interfaces stream\_in.log.setLevel(logging.DEBUG) stream\_out.log.setLevel(logging.DEBUG) We also need to reset the DUT and drive some default values onto some of the bus signals. Note that we’ll need to import the **Timer** and **RisingEdge** triggers. \# Reset the DUT dut.\_log.debug("Resetting DUT") dut.reset\_n <= 0 stream\_in.bus.valid <= 0 yield Timer(10000) yield RisingEdge(dut.clk) dut.reset\_n <= 1 dut.stream\_out\_ready <= 1 The rest of the test becomes fairly straightforward. We create our TUN interface using our function defined previously. We’ll also use the **subprocess** module to actually start the ping command. We then wait for a packet by calling a blocking read call on the TUN file descriptor and simply append that to the queue on the driver. We wait for a packet to arrive on the monitor by yielding on wait\_for\_recv() and then write the received packet back to the TUN file descriptor. \# Create our interface (destroyed at the end of the test) tun \= create\_tun() fd \= tun.fileno() \# Kick off a ping... subprocess.check\_call('ping -c 5 192.168.255.2 &', shell\=True) \# Respond to 5 pings, then quit for i in range(5): cocotb.log.info("Waiting for packets on tun interface") packet \= os.read(fd, 2048) cocotb.log.info("Received a packet!") stream\_in.append(packet) result \= yield stream\_out.wait\_for\_recv() os.write(fd, str(result)) That’s it - simple! Further work[¶](https://docs.cocotb.org/en/v1.1/ping_tun_tap.html#further-work "Permalink to this headline") ------------------------------------------------------------------------------------------------------------- This example is deliberately simplistic to focus on the fundamentals of interfacing to the simulator using TUN/TAP. As an exercise for the reader a useful addition would be to make the file descriptor non-blocking and spawn out separate coroutines for the monitor / driver, thus decoupling the sending and receiving of packets. --- # Tutorial: Driver Cosimulation — cocotb 1.1 documentation * [Docs](https://docs.cocotb.org/en/v1.1/index.html) » * Tutorial: Driver Cosimulation * [Edit on GitHub](https://github.com/cocotb/cocotb/blob/v1.1/documentation/source/hal_cosimulation.rst) * * * Tutorial: Driver Cosimulation[¶](https://docs.cocotb.org/en/v1.1/hal_cosimulation.html#tutorial-driver-cosimulation "Permalink to this headline") ================================================================================================================================================== Cocotb was designed to provide a common platform for hardware and software developers to interact. By integrating systems early, ideally at the block level, it’s possible to find bugs earlier in the design process. For any given component that has a software interface there is typically a software abstraction layer or driver which communicates with the hardware. In this tutorial we will call unmodified production software from our testbench and re-use the code written to configure the entity. For the impatient this tutorial is provided as an example with Cocotb. You can run this example from a fresh checkout: cd examples/endian\_swapper/tests make MODULE\=test\_endian\_swapper\_hal Note [SWIG](http://www.swig.org/) is required to compile the example Difficulties with Driver Co-simulation[¶](https://docs.cocotb.org/en/v1.1/hal_cosimulation.html#difficulties-with-driver-co-simulation "Permalink to this headline") --------------------------------------------------------------------------------------------------------------------------------------------------------------------- Co-simulating _un-modified_ production software against a block-level testbench is not trivial - there are a couple of significant obstacles to overcome: ### Calling the HAL from a test[¶](https://docs.cocotb.org/en/v1.1/hal_cosimulation.html#calling-the-hal-from-a-test "Permalink to this headline") Typically the software component (often referred to as a Hardware Abstraction Layer or HAL) is written in C. We need to call this software from our test written in Python. There are multiple ways to call C code from Python, in this tutorial we’ll use [SWIG](http://www.swig.org/) to generate Python bindings for our HAL. ### Blocking in the driver[¶](https://docs.cocotb.org/en/v1.1/hal_cosimulation.html#blocking-in-the-driver "Permalink to this headline") Another difficulty to overcome is the fact that the HAL is expecting to call a low-level function to access the hardware, often something like `ioread32`. We need this call to block while simulation time advances and a value is either read or written on the bus. To achieve this we link the HAL against a C library that provides the low level read/write functions. These functions in turn call into Cocotb and perform the relevant access on the DUT. Cocotb infrastructure[¶](https://docs.cocotb.org/en/v1.1/hal_cosimulation.html#cocotb-infrastructure "Permalink to this headline") ----------------------------------------------------------------------------------------------------------------------------------- There are two decorators provided to enable this flow, which are typically used together to achieve the required functionality. The `cocotb.external` decorator turns a normal function that isn’t a coroutine into a blocking coroutine (by running the function in a separate thread). The `cocotb.function` decorator allows a coroutine that consumes simulation time to be called by a normal thread. The call sequence looks like this: ![_images/hal_cosimulation.svg](https://docs.cocotb.org/en/v1.1/_images/hal_cosimulation.svg) Implementation[¶](https://docs.cocotb.org/en/v1.1/hal_cosimulation.html#implementation "Permalink to this headline") --------------------------------------------------------------------------------------------------------------------- ### Register Map[¶](https://docs.cocotb.org/en/v1.1/hal_cosimulation.html#register-map "Permalink to this headline") The endian swapper has a very simple register map: | Byte Offset | Register | Bits | Access | Description | | --- | --- | --- | --- | --- | | 0 | CONTROL | 0 | R/W | Enable | | 31:1 | N/A | Reserved | | 4 | PACKET\_COUNT | 31:0 | RO | Num Packets | ### HAL[¶](https://docs.cocotb.org/en/v1.1/hal_cosimulation.html#hal "Permalink to this headline") To keep things simple we use the same RTL from the [Tutorial: Endian Swapper](https://docs.cocotb.org/en/v1.1/endian_swapper.html) . We write a simplistic HAL which provides the following functions: endian\_swapper\_enable(endian\_swapper\_state\_t \*state); endian\_swapper\_disable(endian\_swapper\_state\_t \*state); endian\_swapper\_get\_count(endian\_swapper\_state\_t \*state); These functions call `IORD` and `IOWR` - usually provided by the Altera NIOS framework. ### IO Module[¶](https://docs.cocotb.org/en/v1.1/hal_cosimulation.html#io-module "Permalink to this headline") This module acts as the bridge between the C HAL and the Python testbench. It exposes the `IORD` and `IOWR` calls to link the HAL against, but also provides a Python interface to allow the read/write bindings to be dynamically set (through `set_write_function` and `set_read_function` module functions). In a more complicated scenario, this could act as an interconnect, dispatching the access to the appropriate driver depending on address decoding, for instance. ### Testbench[¶](https://docs.cocotb.org/en/v1.1/hal_cosimulation.html#testbench "Permalink to this headline") First of all we set up a clock, create an Avalon Master interface and reset the DUT. Then we create two functions that are wrapped with the `cocotb.function` decorator to be called when the HAL attempts to perform a read or write. These are then passed to the [IO Module](https://docs.cocotb.org/en/v1.1/hal_cosimulation.html#io-module) : @cocotb.function def read(address): master.log.debug("External source: reading address 0x%08X" % address) value \= yield master.read(address) master.log.debug("Reading complete: got value 0x%08x" % value) raise ReturnValue(value) @cocotb.function def write(address, value): master.log.debug("Write called for 0x%08X -> %d" % (address, value)) yield master.write(address, value) master.log.debug("Write complete") io\_module.set\_write\_function(write) io\_module.set\_read\_function(read) We can then intialise the HAL and call functions, using the `cocotb.external` decorator to turn the normal function into a blocking coroutine that we can `yield`: state \= hal.endian\_swapper\_init(0) yield cocotb.external(hal.endian\_swapper\_enable)(state) The HAL will perform whatever calls it needs, accessing the DUT through the Avalon-MM driver, and control will return to the testbench when the function returns. Note The decorator is applied to the function before it is called Further Work[¶](https://docs.cocotb.org/en/v1.1/hal_cosimulation.html#further-work "Permalink to this headline") ----------------------------------------------------------------------------------------------------------------- In future tutorials we’ll consider co-simulating unmodified drivers written using `mmap` (for example built upon the [UIO framework](https://www.kernel.org/doc/html/latest/driver-api/uio-howto.html) ) and consider interfacing with emulators like [QEMU](http://wiki.qemu.org/Main_Page) to allow us to co-simulate when the software needs to execute on a different processor architecture. --- # Quickstart Guide — cocotb 1.1 documentation * [Docs](https://docs.cocotb.org/en/v1.1/index.html) » * Quickstart Guide * [Edit on GitHub](https://github.com/cocotb/cocotb/blob/v1.1/documentation/source/quickstart.rst) * * * Quickstart Guide[¶](https://docs.cocotb.org/en/v1.1/quickstart.html#quickstart-guide "Permalink to this headline") =================================================================================================================== Installing cocotb[¶](https://docs.cocotb.org/en/v1.1/quickstart.html#installing-cocotb "Permalink to this headline") --------------------------------------------------------------------------------------------------------------------- ### Pre-requisites[¶](https://docs.cocotb.org/en/v1.1/quickstart.html#pre-requisites "Permalink to this headline") Cocotb has the following requirements: * Python 2.6+ * Python-dev packages * GCC and associated development packages * GNU Make * A Verilog or VHDL simulator, depending on your source RTL code Internal development is performed on Linux Mint 17 (x64). We also use RedHat 6.5(x64). Other RedHat and Ubuntu based distributions (x32 and x64) should work too but due fragmented nature of Linux we can not test everything. Instructions are provided for the main distributions we use. ### Linux native arch installation[¶](https://docs.cocotb.org/en/v1.1/quickstart.html#linux-native-arch-installation "Permalink to this headline") Ubuntu based installation $> sudo apt-get install git make gcc g++ swig python-dev This will allow building of the cocotb libs for use with a 64-bit native simulator. If a 32-bit simulator is being used then additional steps to install 32-bit development libraries and Python are needed. RedHat based installation $> sudo yum install gcc gcc-c++ libstdc++-devel swig python-devel This will allow building of the cocotb libs for use with a 64-bit native simulator. If a 32-bit simulator is being used then additional steps to install 32-bit development libraries and Python are needed. ### 32-bit Python[¶](https://docs.cocotb.org/en/v1.1/quickstart.html#bit-python "Permalink to this headline") Additional development libraries are needed for building 32-bit Python on 64-bit systems. Ubuntu based installation $> sudo apt-get install libx32gcc1 gcc-4.8-multilib lib32stdc++-4.8-dev Replace 4.8 with the version of GCC that was installed on the system in the step above. Unlike on RedHat where 32-bit Python can co-exist with native Python, Ubuntu requires the source to be downloaded and built. RedHat based installation $> sudo yum install glibc.i686 glibc-devel.i386 libgcc.i686 libstdc++-devel.i686 Specific releases can be downloaded from [https://www.python.org/downloads/](https://www.python.org/downloads/) . $> wget https://www.python.org/ftp/python/2.7.9/Python-2.7.9.tgz $> tar xvf Python-2.7.9.tgz $> cd Python-2.7.9 $> export PY32\_DIR\=/opt/pym32 $> ./configure CC\="gcc -m32" LDFLAGS\="-L/lib32 -L/usr/lib32 -Lpwd/lib32 -Wl,-rpath,/lib32 -Wl,-rpath,$PY32\_DIR/lib" --prefix\=$PY32\_DIR --enable-shared $> make $> sudo make install Cocotb can now be built against 32-bit Python by setting the architecture and placing the 32-bit Python ahead of the native version in the path when running a test. $> export PATH\=/opt/pym32/bin $> cd $> ARCH\=i686 make ### Windows 7 installation[¶](https://docs.cocotb.org/en/v1.1/quickstart.html#windows-7-installation "Permalink to this headline") Work has been done with the support of the cocotb community to enable Windows support using the MinGW/Msys environment. Download the MinGQ installer from. [http://sourceforge.net/projects/mingw/files/latest/download?source=files](http://sourceforge.net/projects/mingw/files/latest/download?source=files) . Run the GUI installer and specify a directory you would like the environment installed in. The installer will retrieve a list of possible packages, when this is done press continue. The MinGW Installation Manager is then launched. The following packages need selecting by checking the tick box and selecting “Mark for installation” Basic Installation -- mingw-developer-tools -- mingw32-base -- mingw32-gcc-g++ -- msys-base From the Installation menu then select “Apply Changes”, in the next dialog select “Apply”. When installed a shell can be opened using the “msys.bat” file located under the /msys/1.0/ Python can be downloaded from [https://www.python.org/ftp/python/2.7.9/python-2.7.9.msi](https://www.python.org/ftp/python/2.7.9/python-2.7.9.msi) , other versions of Python can be used as well. Run the installer and download to your chosen location. It is beneficial to add the path to Python to the Windows system `PATH` variable so it can be used easily from inside Msys. Once inside the Msys shell commands as given here will work as expected. ### Mac Packages[¶](https://docs.cocotb.org/en/v1.1/quickstart.html#mac-packages "Permalink to this headline") You need a few packages installed to get cocotb running on Mac. Installing a package manager really helps things out here. [Brew](https://brew.sh/) seems to be the most popular, so we’ll assume you have that installed. ### Running an example[¶](https://docs.cocotb.org/en/v1.1/quickstart.html#running-an-example "Permalink to this headline") $> git clone https://github.com/potentialventures/cocotb $> cd cocotb/examples/endian\_swapper/tests $> make To run a test using a different simulator: $> make SIM\=vcs ### Running a VHDL example[¶](https://docs.cocotb.org/en/v1.1/quickstart.html#running-a-vhdl-example "Permalink to this headline") The `endian_swapper` example includes both a VHDL and a Verilog RTL implementation. The cocotb testbench can execute against either implementation using VPI for Verilog and VHPI/FLI for VHDL. To run the test suite against the VHDL implementation use the following command (a VHPI or FLI capable simulator must be used): $> make SIM\=ghdl TOPLEVEL\_LANG\=vhdl Using Cocotb[¶](https://docs.cocotb.org/en/v1.1/quickstart.html#using-cocotb "Permalink to this headline") ----------------------------------------------------------------------------------------------------------- A typical cocotb testbench requires no additional RTL code. The Design Under Test (DUT) is instantiated as the toplevel in the simulator without any wrapper code. Cocotb drives stimulus onto the inputs to the DUT and monitors the outputs directly from Python. ### Creating a Makefile[¶](https://docs.cocotb.org/en/v1.1/quickstart.html#creating-a-makefile "Permalink to this headline") To create a cocotb test we typically have to create a Makefile. Cocotb provides rules which make it easy to get started. We simply inform cocotb of the source files we need compiling, the toplevel entity to instantiate and the Python test script to load. VERILOG\_SOURCES \= $(PWD)/submodule.sv $(PWD)/my\_design.sv TOPLEVEL\=my\_design \# the module name in your Verilog or VHDL file MODULE\=test\_my\_design \# the name of the Python test file include $(COCOTB)/makefiles/Makefile.inc include $(COCOTB)/makefiles/Makefile.sim We would then create a file called `test_my_design.py` containing our tests. ### Creating a test[¶](https://docs.cocotb.org/en/v1.1/quickstart.html#creating-a-test "Permalink to this headline") The test is written in Python. Cocotb wraps your top level with the handle you pass it. In this documentation, and most of the examples in the project, that handle is `dut`, but you can pass your own preferred name in instead. The handle is used in all Python files referencing your RTL project. Assuming we have a toplevel port called `clk` we could create a test file containing the following: import cocotb from cocotb.triggers import Timer @cocotb.test() def my\_first\_test(dut): """ Try accessing the design """ dut.\_log.info("Running test!") for cycle in range(10): dut.clk \= 0 yield Timer(1000) dut.clk \= 1 yield Timer(1000) dut.\_log.info("Running test!") This will drive a square wave clock onto the `clk` port of the toplevel. ### Accessing the design[¶](https://docs.cocotb.org/en/v1.1/quickstart.html#accessing-the-design "Permalink to this headline") When cocotb initialises it finds the top-level instantiation in the simulator and creates a handle called `dut`. Top-level signals can be accessed using the “dot” notation used for accessing object attributes in Python. The same mechanism can be used to access signals inside the design. \# Get a reference to the "clk" signal on the top-level clk \= dut.clk \# Get a reference to a register "count" \# in a sub-block "inst\_sub\_block" count \= dut.inst\_sub\_block.count ### Assigning values to signals[¶](https://docs.cocotb.org/en/v1.1/quickstart.html#assigning-values-to-signals "Permalink to this headline") Values can be assigned to signals using either the [`value`](https://docs.cocotb.org/en/v1.1/library_reference.html#cocotb.handle.NonHierarchyObject.value "cocotb.handle.NonHierarchyObject.value") property of a handle object or using direct assignment while traversing the hierarchy. \# Get a reference to the "clk" signal and assign a value clk \= dut.clk clk.value \= 1 \# Direct assignment through the hierarchy dut.input\_signal <= 12 \# Assign a value to a memory deep in the hierarchy dut.sub\_block.memory.array\[4\] <= 2 The syntax `sig <= new_value` is a short form of `sig.value = new_value`. It not only resembles HDL-syntax, but also has the same semantics: writes are not applied immediately, but delayed until the next write cycle. Use `sig.setimmediatevalue(new_val)` to set a new value immediately (see [`setimmediatevalue()`](https://docs.cocotb.org/en/v1.1/library_reference.html#cocotb.handle.ModifiableObject.setimmediatevalue "cocotb.handle.ModifiableObject.setimmediatevalue") ). ### Reading values from signals[¶](https://docs.cocotb.org/en/v1.1/quickstart.html#reading-values-from-signals "Permalink to this headline") Accessing the [`value`](https://docs.cocotb.org/en/v1.1/library_reference.html#cocotb.handle.NonHierarchyObject.value "cocotb.handle.NonHierarchyObject.value") property of a handle object will return a [`BinaryValue`](https://docs.cocotb.org/en/v1.1/library_reference.html#cocotb.binary.BinaryValue "cocotb.binary.BinaryValue") object. Any unresolved bits are preserved and can be accessed using the [`binstr`](https://docs.cocotb.org/en/v1.1/library_reference.html#cocotb.binary.BinaryValue.binstr "cocotb.binary.BinaryValue.binstr") attribute, or a resolved integer value can be accessed using the [`integer`](https://docs.cocotb.org/en/v1.1/library_reference.html#cocotb.binary.BinaryValue.integer "cocotb.binary.BinaryValue.integer") attribute. \>>> \# Read a value back from the DUT \>>> count \= dut.counter.value \>>> \>>> print(count.binstr) 1X1010 \>>> \# Resolve the value to an integer (X or Z treated as 0) \>>> print(count.integer) 42 \>>> \# Show number of bits in a value \>>> print(count.n\_bits) 6 We can also cast the signal handle directly to an integer: \>>> print(int(dut.counter)) 42 ### Parallel and sequential execution of coroutines[¶](https://docs.cocotb.org/en/v1.1/quickstart.html#parallel-and-sequential-execution-of-coroutines "Permalink to this headline") @cocotb.coroutine def reset\_dut(reset\_n, duration): reset\_n <= 0 yield Timer(duration) reset\_n <= 1 reset\_n.\_log.debug("Reset complete") @cocotb.test() def parallel\_example(dut): reset\_n \= dut.reset \# This will call reset\_dut sequentially \# Execution will block until reset\_dut has completed yield reset\_dut(reset\_n, 500) dut.\_log.debug("After reset") \# Call reset\_dut in parallel with this coroutine reset\_thread \= cocotb.fork(reset\_dut(reset\_n, 500) yield Timer(250) dut.\_log.debug("During reset (reset\_n = %s)" % reset\_n.value) \# Wait for the other thread to complete yield reset\_thread.join() dut.\_log.debug("After reset") --- # Testbench Tools — cocotb 1.1 documentation * [Docs](https://docs.cocotb.org/en/v1.1/index.html) » * Testbench Tools * [Edit on GitHub](https://github.com/cocotb/cocotb/blob/v1.1/documentation/source/testbench_tools.rst) * * * Testbench Tools[¶](https://docs.cocotb.org/en/v1.1/testbench_tools.html#testbench-tools "Permalink to this headline") ====================================================================================================================== Logging[¶](https://docs.cocotb.org/en/v1.1/testbench_tools.html#logging "Permalink to this headline") ------------------------------------------------------------------------------------------------------ Cocotb extends the Python logging library. Each DUT, monitor, driver, and scoreboard (as well as any other function using the coroutine decorator) implements its own `logging` object, and each can be set to its own logging level. Within a DUT, each hierarchical object can also have individual logging levels set. When logging HDL objects, beware that `_log` is the preferred way to use logging. This helps minimize the change of name collisions with an HDL log component with the Python logging functionality. Log printing levels can also be set on a per-object basis. class EndianSwapperTB(object): def \_\_init\_\_(self, dut, debug\=False): self.dut \= dut self.stream\_in \= AvalonSTDriver(dut, "stream\_in", dut.clk) self.stream\_in\_recovered \= AvalonSTMonitor(dut, "stream\_in", dut.clk, callback\=self.model) \# Set verbosity on our various interfaces level \= logging.DEBUG if debug else logging.WARNING self.stream\_in.log.setLevel(level) self.stream\_in\_recovered.log.setLevel(level) self.dut.reset\_n.\_log.setLevel(logging.DEBUG) And when the logging is actually called class AvalonSTPkts(BusMonitor): ... @coroutine def \_monitor\_recv(self): ... self.log.info("Received a packet of %d bytes" % len(pkt)) class Scoreboard(object): ... def add\_interface(self): ... self.log.info("Created with reorder\_depth %d" % reorder\_depth) class EndianSwapTB(object): ... @cocotb.coroutine def reset(): self.dut.\_log.debug("Resetting DUT") will display as something like 0.00ns INFO cocotb.scoreboard.endian\_swapper\_sv scoreboard.py:177 in add\_interface Created with reorder\_depth 0 0.00ns DEBUG cocotb.endian\_swapper\_sv ..\_endian\_swapper.py:106 in reset Resetting DUT 160000000000000.00ns INFO cocotb.endian\_swapper\_sv.stream\_out avalon.py:151 in \_monitor\_recv Received a packet of 125 bytes Busses[¶](https://docs.cocotb.org/en/v1.1/testbench_tools.html#busses "Permalink to this headline") ---------------------------------------------------------------------------------------------------- Busses are simply defined as collection of signals. The [`Bus`](https://docs.cocotb.org/en/v1.1/library_reference.html#cocotb.bus.Bus "cocotb.bus.Bus") class will automatically bundle any group of signals together that are named similar to `dut.`. For instance, dut.stream\_in\_valid dut.stream\_in\_data have a bus name of `stream_in`, a separator of `_`, and signal names of `valid` and `data`. A list of signal names, or a dictionary mapping attribute names to signal names is also passed into the [`Bus`](https://docs.cocotb.org/en/v1.1/library_reference.html#cocotb.bus.Bus "cocotb.bus.Bus") class. Busses can have values driven onto them, be captured (returning a dictionary), or sampled and stored into a similar object. stream\_in\_bus \= Bus(dut, "stream\_in", \["valid", "data"\]) \# '\_' is the default separator Driving Busses[¶](https://docs.cocotb.org/en/v1.1/testbench_tools.html#driving-busses "Permalink to this headline") -------------------------------------------------------------------------------------------------------------------- Examples and specific bus implementation bus drivers (AMBA, Avalon, XGMII, and others) exist in the [`Driver`](https://docs.cocotb.org/en/v1.1/library_reference.html#cocotb.drivers.Driver "cocotb.drivers.Driver") class enabling a test to append transactions to perform the serialization of transactions onto a physical interface. Here is an example using the Avalon bus driver in the `endian_swapper` example: class EndianSwapperTB(object): def \_\_init\_\_(self, dut, debug\=False): self.dut \= dut self.stream\_in \= AvalonSTDriver(dut, "stream\_in", dut.clk) def run\_test(dut, data\_in\=None, config\_coroutine\=None, idle\_inserter\=None, backpressure\_inserter\=None): cocotb.fork(Clock(dut.clk, 5000).start()) tb \= EndianSwapperTB(dut) yield tb.reset() dut.stream\_out\_ready <= 1 if idle\_inserter is not None: tb.stream\_in.set\_valid\_generator(idle\_inserter()) \# Send in the packets for transaction in data\_in(): yield tb.stream\_in.send(transaction) Monitoring Busses[¶](https://docs.cocotb.org/en/v1.1/testbench_tools.html#monitoring-busses "Permalink to this headline") -------------------------------------------------------------------------------------------------------------------------- For our testbenches to actually be useful, we have to monitor some of these busses, and not just drive them. That’s where the [`Monitor`](https://docs.cocotb.org/en/v1.1/library_reference.html#cocotb.monitors.Monitor "cocotb.monitors.Monitor") class comes in, with prebuilt monitors for Avalon and XGMII busses. The Monitor class is a base class which you are expected to derive for your particular purpose. You must create a [`_monitor_recv()`](https://docs.cocotb.org/en/v1.1/library_reference.html#cocotb.monitors.Monitor._monitor_recv "cocotb.monitors.Monitor._monitor_recv") function which is responsible for determining 1) at what points in simulation to call the [`_recv()`](https://docs.cocotb.org/en/v1.1/library_reference.html#cocotb.monitors.Monitor._recv "cocotb.monitors.Monitor._recv") function, and 2) what transaction values to pass to be stored in the monitors receiving queue. Monitors are good for both outputs of the DUT for verification, and for the inputs of the DUT, to drive a test model of the DUT to be compared to the actual DUT. For this purpose, input monitors will often have a callback function passed that is a model. This model will often generate expected transactions, which are then compared using the [`Scoreboard`](https://docs.cocotb.org/en/v1.1/library_reference.html#cocotb.scoreboard.Scoreboard "cocotb.scoreboard.Scoreboard") class. \# ============================================================================== class BitMonitor(Monitor): """Observes single input or output of DUT.""" def \_\_init\_\_(self, name, signal, clock, callback\=None, event\=None): self.name \= name self.signal \= signal self.clock \= clock Monitor.\_\_init\_\_(self, callback, event) @coroutine def \_monitor\_recv(self): clkedge \= RisingEdge(self.clock) while True: \# Capture signal at rising edge of clock yield clkedge vec \= self.signal.value self.\_recv(vec) \# ============================================================================== def input\_gen(): """Generator for input data applied by BitDriver""" while True: yield random.randint(1,5), random.randint(1,5) \# ============================================================================== class DFF\_TB(object): def \_\_init\_\_(self, dut, init\_val): self.dut \= dut \# Create input driver and output monitor self.input\_drv \= BitDriver(dut.d, dut.c, input\_gen()) self.output\_mon \= BitMonitor("output", dut.q, dut.c) \# Create a scoreboard on the outputs self.expected\_output \= \[ init\_val \] \# Reconstruct the input transactions from the pins \# and send them to our 'model' self.input\_mon \= BitMonitor("input", dut.d, dut.c, callback\=self.model) def model(self, transaction): """Model the DUT based on the input transaction.""" \# Do not append an output transaction for the last clock cycle of the \# simulation, that is, after stop() has been called. if not self.stopped: self.expected\_output.append(transaction) Tracking testbench errors[¶](https://docs.cocotb.org/en/v1.1/testbench_tools.html#tracking-testbench-errors "Permalink to this headline") ------------------------------------------------------------------------------------------------------------------------------------------ The [`Scoreboard`](https://docs.cocotb.org/en/v1.1/library_reference.html#cocotb.scoreboard.Scoreboard "cocotb.scoreboard.Scoreboard") class is used to compare the actual outputs to expected outputs. Monitors are added to the scoreboard for the actual outputs, and the expected outputs can be either a simple list, or a function that provides a transaction. Here is some code from the `dff` example, similar to above with the scoreboard added. class DFF\_TB(object): def \_\_init\_\_(self, dut, init\_val): self.dut \= dut \# Create input driver and output monitor self.input\_drv \= BitDriver(dut.d, dut.c, input\_gen()) self.output\_mon \= BitMonitor("output", dut.q, dut.c) \# Create a scoreboard on the outputs self.expected\_output \= \[ init\_val \] self.scoreboard \= Scoreboard(dut) self.scoreboard.add\_interface(self.output\_mon, self.expected\_output) \# Reconstruct the input transactions from the pins \# and send them to our 'model' self.input\_mon \= BitMonitor("input", dut.d, dut.c,callback\=self.model) --- # Tutorial: Endian Swapper — cocotb 1.1 documentation * [Docs](https://docs.cocotb.org/en/v1.1/index.html) » * Tutorial: Endian Swapper * [Edit on GitHub](https://github.com/cocotb/cocotb/blob/v1.1/documentation/source/endian_swapper.rst) * * * Tutorial: Endian Swapper[¶](https://docs.cocotb.org/en/v1.1/endian_swapper.html#tutorial-endian-swapper "Permalink to this headline") ====================================================================================================================================== In this tutorial we’ll use some of the built-in features of cocotb to quickly create a complex testbench. Note All the code and sample output from this example are available on [EDA Playground](http://www.edaplayground.com/s/example/199) For the impatient this tutorial is provided as an example with cocotb. You can run this example from a fresh checkout: cd examples/endian\_swapper/tests make Design[¶](https://docs.cocotb.org/en/v1.1/endian_swapper.html#design "Permalink to this headline") --------------------------------------------------------------------------------------------------- We have a relatively simplistic RTL block called the `endian_swapper`. The DUT has three interfaces, all conforming to the Avalon standard: ![_images/endian_swapper_design.svg](https://docs.cocotb.org/en/v1.1/_images/endian_swapper_design.svg) The DUT will swap the endianness of packets on the Avalon-ST bus if a configuration bit is set. For every packet arriving on the `stream_in` interface the entire packet will be endian swapped if the configuration bit is set, otherwise the entire packet will pass through unmodified. Testbench[¶](https://docs.cocotb.org/en/v1.1/endian_swapper.html#testbench "Permalink to this headline") --------------------------------------------------------------------------------------------------------- To begin with we create a class to encapsulate all the common code for the testbench. It is possible to write directed tests without using a testbench class however to encourage code re-use it is good practice to create a distinct class. class EndianSwapperTB(object): def \_\_init\_\_(self, dut): self.dut \= dut self.stream\_in \= AvalonSTDriver(dut, "stream\_in", dut.clk) self.stream\_out \= AvalonSTMonitor(dut, "stream\_out", dut.clk) self.csr \= AvalonMaster(dut, "csr", dut.clk) self.expected\_output \= \[\] self.scoreboard \= Scoreboard(dut) self.scoreboard.add\_interface(self.stream\_out, self.expected\_output) \# Reconstruct the input transactions from the pins and send them to our 'model' self.stream\_in\_recovered \= AvalonSTMonitor(dut, "stream\_in", dut.clk, callback\=self.model) With the above code we have created a testbench with the following structure: ![_images/endian_swapper_testbench.svg](https://docs.cocotb.org/en/v1.1/_images/endian_swapper_testbench.svg) If we inspect this line-by-line: self.stream\_in \= AvalonSTDriver(dut, "stream\_in", dut.clk) Here we are creating an [`AvalonSTDriver`](https://docs.cocotb.org/en/v1.1/library_reference.html#cocotb.drivers.avalon.AvalonSTPkts "cocotb.drivers.avalon.AvalonSTPkts") instance. The constructor requires 3 arguments - a handle to the entity containing the interface (`dut`), the name of the interface (`stream_in`) and the associated clock with which to drive the interface (`dut.clk`). The driver will auto-discover the signals for the interface, assuming that they follow the naming convention `_`. In this case we have the following signals defined for the `stream_in` interface: | Name | Type | Description (from Avalon Specification) | | --- | --- | --- | | `stream_in_data` | `data` | The data signal from the source to the sink | | `stream_in_empty` | `empty` | Indicates the number of symbols that are empty during cycles that contain the end of a packet | | `stream_in_valid` | `valid` | Asserted by the source to qualify all other source to sink signals | | `stream_in_startofpacket` | `startofpacket` | Asserted by the source to mark the beginning of a packet | | `stream_in_endofpacket` | `endofpacket` | Asserted by the source to mark the end of a packet | | `stream_in_ready` | `ready` | Asserted high to indicate that the sink can accept data | By following the signal naming convention the driver can find the signals associated with this interface automatically. self.stream\_out \= AvalonSTMonitor(dut, "stream\_out", dut.clk) self.csr \= AvalonMaster(dut, "csr", dut.clk) We do the same to create the [`monitor`](https://docs.cocotb.org/en/v1.1/library_reference.html#cocotb.monitors.avalon.AvalonSTPkts "cocotb.monitors.avalon.AvalonSTPkts") on `stream_out` and the CSR interface. self.expected\_output \= \[\] self.scoreboard \= Scoreboard(dut) self.scoreboard.add\_interface(self.stream\_out, self.expected\_output) The above lines create a [`Scoreboard`](https://docs.cocotb.org/en/v1.1/library_reference.html#cocotb.scoreboard.Scoreboard "cocotb.scoreboard.Scoreboard") instance and attach it to the `stream_out` monitor instance. The scoreboard is used to check that the DUT behaviour is correct. The call to [`add_interface()`](https://docs.cocotb.org/en/v1.1/library_reference.html#cocotb.scoreboard.Scoreboard.add_interface "cocotb.scoreboard.Scoreboard.add_interface") takes a Monitor instance as the first argument and the second argument is a mechanism for describing the expected output for that interface. This could be a callable function but in this example a simple list of expected transactions is sufficient. \# Reconstruct the input transactions from the pins and send them to our 'model' self.stream\_in\_recovered \= AvalonSTMonitor(dut, "stream\_in", dut.clk, callback\=self.model) Finally we create another Monitor instance, this time connected to the `stream_in` interface. This is to reconstruct the transactions being driven into the DUT. It’s good practice to use a monitor to reconstruct the transactions from the pin interactions rather than snooping them from a higher abstraction layer as we can gain confidence that our drivers and monitors are functioning correctly. We also pass the keyword argument `callback` to the monitor constructor which will result in the supplied function being called for each transaction seen on the bus with the transaction as the first argument. Our model function is quite straightforward in this case - we simply append the transaction to the expected output list and increment a counter: def model(self, transaction): """Model the DUT based on the input transaction""" self.expected\_output.append(transaction) self.pkts\_sent += 1 ### Test Function[¶](https://docs.cocotb.org/en/v1.1/endian_swapper.html#test-function "Permalink to this headline") There are various ‘knobs’ we can tweak on this testbench to vary the behaviour: * Packet size * Backpressure on the `stream_out` interface * Idle cycles on the `stream_in` interface * Configuration switching of the endian swap register during the test. We want to run different variations of tests but they will all have a very similar structure so we create a common `run_test` function. To generate backpressure on the `stream_out` interface we use the [`BitDriver`](https://docs.cocotb.org/en/v1.1/library_reference.html#cocotb.drivers.BitDriver "cocotb.drivers.BitDriver") class from `cocotb.drivers`. @cocotb.coroutine def run\_test(dut, data\_in\=None, config\_coroutine\=None, idle\_inserter\=None, backpressure\_inserter\=None): cocotb.fork(Clock(dut.clk, 5000).start()) tb \= EndianSwapperTB(dut) yield tb.reset() dut.stream\_out\_ready <= 1 \# Start off any optional coroutines if config\_coroutine is not None: cocotb.fork(config\_coroutine(tb.csr)) if idle\_inserter is not None: tb.stream\_in.set\_valid\_generator(idle\_inserter()) if backpressure\_inserter is not None: tb.backpressure.start(backpressure\_inserter()) \# Send in the packets for transaction in data\_in(): yield tb.stream\_in.send(transaction) \# Wait at least 2 cycles where output ready is low before ending the test for i in range(2): yield RisingEdge(dut.clk) while not dut.stream\_out\_ready.value: yield RisingEdge(dut.clk) pkt\_count \= yield tb.csr.read(1) if pkt\_count.integer != tb.pkts\_sent: raise TestFailure("DUT recorded %d packets but tb counted %d" % ( pkt\_count.integer, tb.pkts\_sent)) else: dut.\_log.info("DUT correctly counted %d packets" % pkt\_count.integer) raise tb.scoreboard.result We can see that this test function creates an instance of the testbench, resets the DUT by running the coroutine `tb.reset()` and then starts off any optional coroutines passed in using the keyword arguments. We then send in all the packets from `data_in`, ensure that all the packets have been received by waiting 2 cycles at the end. We read the packet count and compare this with the number of packets. Finally we use the [`tb.scoreboard.result`](https://docs.cocotb.org/en/v1.1/library_reference.html#cocotb.scoreboard.Scoreboard.result "cocotb.scoreboard.Scoreboard.result") to determine the status of the test. If any transactions didn’t match the expected output then this member would be an instance of the [`TestFailure`](https://docs.cocotb.org/en/v1.1/library_reference.html#cocotb.result.TestFailure "cocotb.result.TestFailure") result. ### Test permutations[¶](https://docs.cocotb.org/en/v1.1/endian_swapper.html#test-permutations "Permalink to this headline") Having defined a test function we can now auto-generate different permutations of tests using the [`TestFactory`](https://docs.cocotb.org/en/v1.1/library_reference.html#cocotb.regression.TestFactory "cocotb.regression.TestFactory") class: factory \= TestFactory(run\_test) factory.add\_option("data\_in", \[random\_packet\_sizes\]) factory.add\_option("config\_coroutine", \[None, randomly\_switch\_config\]) factory.add\_option("idle\_inserter", \[None, wave, intermittent\_single\_cycles, random\_50\_percent\]) factory.add\_option("backpressure\_inserter", \[None, wave, intermittent\_single\_cycles, random\_50\_percent\]) factory.generate\_tests() This will generate 32 tests (named `run_test_001` to `run_test_032`) with all possible permutations of the options provided for each argument. Note that we utilise some of the built-in generators to toggle backpressure and insert idle cycles. --- # Introduction — cocotb 1.3.1 documentation * [Docs](https://docs.cocotb.org/en/v1.3.1/index.html) » * Introduction * [Edit on GitHub](https://github.com/cocotb/cocotb/blob/v1.3.1/documentation/source/introduction.rst) * * * Introduction[¶](https://docs.cocotb.org/en/v1.3.1/introduction.html#introduction "Permalink to this headline") =============================================================================================================== What is cocotb?[¶](https://docs.cocotb.org/en/v1.3.1/introduction.html#what-is-cocotb "Permalink to this headline") -------------------------------------------------------------------------------------------------------------------- **cocotb** is a _COroutine_ based _COsimulation_ _TestBench_ environment for verifying VHDL/Verilog RTL using [Python](https://www.python.org/) . cocotb is completely free, open source (under the [BSD License](https://en.wikipedia.org/wiki/BSD_licenses#3-clause_license_(%22BSD_License_2.0%22,_%22Revised_BSD_License%22,_%22New_BSD_License%22,_or_%22Modified_BSD_License%22)) ) and hosted on [GitHub](https://github.com/cocotb/cocotb) . cocotb requires a simulator to simulate the RTL. Simulators that have been tested and known to work with cocotb: Linux Platforms * [Icarus Verilog](http://iverilog.icarus.com/) * [GHDL](https://ghdl.free.fr/) * [Aldec](https://www.aldec.com/) Riviera-PRO * [Synopsys](https://www.synopsys.com/) VCS * [Cadence](https://www.cadence.com/) Incisive and Xcelium * [Mentor](https://www.mentor.com/) ModelSim (DE and SE) * [Verilator](https://verilator.com/) Windows Platform * [Icarus Verilog](http://iverilog.icarus.com/) * [Aldec](https://www.aldec.com/) Riviera-PRO * [Mentor](https://www.mentor.com/) ModelSim (DE and SE) A (possibly older) version of cocotb can be used live in a web-browser using [EDA Playground](https://www.edaplayground.com/) . How is cocotb different?[¶](https://docs.cocotb.org/en/v1.3.1/introduction.html#how-is-cocotb-different "Permalink to this headline") -------------------------------------------------------------------------------------------------------------------------------------- cocotb encourages the same philosophy of design re-use and randomized testing as UVM, however is implemented in Python rather than SystemVerilog. With cocotb, VHDL/Verilog/SystemVerilog are normally only used for the design itself, not the testbench. cocotb has built-in support for integrating with the [Jenkins](https://jenkins.io/) continuous integration system. cocotb was specifically designed to lower the overhead of creating a test. cocotb automatically discovers tests so that no additional step is required to add a test to a regression. All verification is done using Python which has various advantages over using SystemVerilog or VHDL for verification: * Writing Python is **fast** - it’s a very productive language * It’s **easy** to interface to other languages from Python * Python has a huge library of existing code to **re-use** like [packet generation](https://www.secdev.org/projects/scapy/) libraries. * Python is **interpreted**. Tests can be edited and re-run them without having to recompile the design or exit the simulator GUI. * Python is **popular** - far more engineers know Python than SystemVerilog or VHDL How does cocotb work?[¶](https://docs.cocotb.org/en/v1.3.1/introduction.html#how-does-cocotb-work "Permalink to this headline") -------------------------------------------------------------------------------------------------------------------------------- ### Overview[¶](https://docs.cocotb.org/en/v1.3.1/introduction.html#overview "Permalink to this headline") A typical cocotb testbench requires no additional RTL code. The Design Under Test (DUT) is instantiated as the toplevel in the simulator without any wrapper code. cocotb drives stimulus onto the inputs to the DUT (or further down the hierarchy) and monitors the outputs directly from Python. ![_images/cocotb_overview.svg](https://docs.cocotb.org/en/v1.3.1/_images/cocotb_overview.svg) A test is simply a Python function. At any given time either the simulator is advancing time or the Python code is executing. The [`yield`](https://docs.python.org/3/reference/simple_stmts.html#yield "(in Python v3.8)") keyword is used to indicate when to pass control of execution back to the simulator. A test can spawn multiple coroutines, allowing for independent flows of execution. Contributors[¶](https://docs.cocotb.org/en/v1.3.1/introduction.html#contributors "Permalink to this headline") --------------------------------------------------------------------------------------------------------------- cocotb was developed by [Potential Ventures](https://potential.ventures/) with the support of [Solarflare Communications Ltd](https://www.solarflare.com/) and contributions from Gordon McGregor and Finn Grimwood (see [contributers](https://github.com/cocotb/cocotb/graphs/contributors) for the full list of contributions). We also have a list of talks and papers, libraries and examples at our Wiki page [Further Resources](https://github.com/cocotb/cocotb/wiki/Further-Resources) . Feel free to add links to cocotb-related content that we are still missing! --- # Introduction — cocotb 1.3.0 documentation * [Docs](https://docs.cocotb.org/en/v1.3.0/index.html) » * Introduction * [Edit on GitHub](https://github.com/cocotb/cocotb/blob/v1.3.0/documentation/source/introduction.rst) * * * Introduction[¶](https://docs.cocotb.org/en/v1.3.0/introduction.html#introduction "Permalink to this headline") =============================================================================================================== What is cocotb?[¶](https://docs.cocotb.org/en/v1.3.0/introduction.html#what-is-cocotb "Permalink to this headline") -------------------------------------------------------------------------------------------------------------------- **cocotb** is a _COroutine_ based _COsimulation_ _TestBench_ environment for verifying VHDL/Verilog RTL using [Python](https://www.python.org/) . cocotb is completely free, open source (under the [BSD License](https://en.wikipedia.org/wiki/BSD_licenses#3-clause_license_(%22BSD_License_2.0%22,_%22Revised_BSD_License%22,_%22New_BSD_License%22,_or_%22Modified_BSD_License%22)) ) and hosted on [GitHub](https://github.com/cocotb/cocotb) . cocotb requires a simulator to simulate the RTL. Simulators that have been tested and known to work with cocotb: Linux Platforms * [Icarus Verilog](http://iverilog.icarus.com/) * [GHDL](https://ghdl.free.fr/) * [Aldec](https://www.aldec.com/) Riviera-PRO * [Synopsys](https://www.synopsys.com/) VCS * [Cadence](https://www.cadence.com/) Incisive and Xcelium * [Mentor](https://www.mentor.com/) ModelSim (DE and SE) * [Verilator](https://verilator.com/) Windows Platform * [Icarus Verilog](http://iverilog.icarus.com/) * [Aldec](https://www.aldec.com/) Riviera-PRO * [Mentor](https://www.mentor.com/) ModelSim (DE and SE) A (possibly older) version of cocotb can be used live in a web-browser using [EDA Playground](https://www.edaplayground.com/) . How is cocotb different?[¶](https://docs.cocotb.org/en/v1.3.0/introduction.html#how-is-cocotb-different "Permalink to this headline") -------------------------------------------------------------------------------------------------------------------------------------- cocotb encourages the same philosophy of design re-use and randomized testing as UVM, however is implemented in Python rather than SystemVerilog. With cocotb, VHDL/Verilog/SystemVerilog are normally only used for the design itself, not the testbench. cocotb has built-in support for integrating with the [Jenkins](https://jenkins.io/) continuous integration system. cocotb was specifically designed to lower the overhead of creating a test. cocotb automatically discovers tests so that no additional step is required to add a test to a regression. All verification is done using Python which has various advantages over using SystemVerilog or VHDL for verification: * Writing Python is **fast** - it’s a very productive language * It’s **easy** to interface to other languages from Python * Python has a huge library of existing code to **re-use** like [packet generation](https://www.secdev.org/projects/scapy/) libraries. * Python is **interpreted**. Tests can be edited and re-run them without having to recompile the design or exit the simulator GUI. * Python is **popular** - far more engineers know Python than SystemVerilog or VHDL How does cocotb work?[¶](https://docs.cocotb.org/en/v1.3.0/introduction.html#how-does-cocotb-work "Permalink to this headline") -------------------------------------------------------------------------------------------------------------------------------- ### Overview[¶](https://docs.cocotb.org/en/v1.3.0/introduction.html#overview "Permalink to this headline") A typical cocotb testbench requires no additional RTL code. The Design Under Test (DUT) is instantiated as the toplevel in the simulator without any wrapper code. cocotb drives stimulus onto the inputs to the DUT (or further down the hierarchy) and monitors the outputs directly from Python. ![_images/cocotb_overview.svg](https://docs.cocotb.org/en/v1.3.0/_images/cocotb_overview.svg) A test is simply a Python function. At any given time either the simulator is advancing time or the Python code is executing. The [`yield`](https://docs.python.org/3/reference/simple_stmts.html#yield "(in Python v3.8)") keyword is used to indicate when to pass control of execution back to the simulator. A test can spawn multiple coroutines, allowing for independent flows of execution. Contributors[¶](https://docs.cocotb.org/en/v1.3.0/introduction.html#contributors "Permalink to this headline") --------------------------------------------------------------------------------------------------------------- cocotb was developed by [Potential Ventures](https://potential.ventures/) with the support of [Solarflare Communications Ltd](https://www.solarflare.com/) and contributions from Gordon McGregor and Finn Grimwood (see [contributers](https://github.com/cocotb/cocotb/graphs/contributors) for the full list of contributions). We also have a list of talks and papers, libraries and examples at our Wiki page [Further Resources](https://github.com/cocotb/cocotb/wiki/Further-Resources) . Feel free to add links to cocotb-related content that we are still missing! --- # Introduction — cocotb 1.1 documentation * [Docs](https://docs.cocotb.org/en/v1.2.0/index.html) » * Introduction * [Edit on GitHub](https://github.com/cocotb/cocotb/blob/v1.2.0/documentation/source/introduction.rst) * * * Introduction[¶](https://docs.cocotb.org/en/v1.2.0/introduction.html#introduction "Permalink to this headline") =============================================================================================================== What is cocotb?[¶](https://docs.cocotb.org/en/v1.2.0/introduction.html#what-is-cocotb "Permalink to this headline") -------------------------------------------------------------------------------------------------------------------- **cocotb** is a _COroutine_ based _COsimulation_ _TestBench_ environment for verifying VHDL/Verilog RTL using [Python](https://www.python.org/) . cocotb is completely free, open source (under the [BSD License](https://en.wikipedia.org/wiki/BSD_licenses#3-clause_license_(%22BSD_License_2.0%22,_%22Revised_BSD_License%22,_%22New_BSD_License%22,_or_%22Modified_BSD_License%22)) ) and hosted on [GitHub](https://github.com/cocotb/cocotb) . cocotb requires a simulator to simulate the RTL. Simulators that have been tested and known to work with cocotb: Linux Platforms * [Icarus Verilog](http://iverilog.icarus.com/) * [GHDL](https://ghdl.free.fr/) * [Aldec](https://www.aldec.com/) Riviera-PRO * [Synopsys](https://www.synopsys.com/) VCS * [Cadence](https://www.cadence.com/) Incisive * [Mentor](https://www.mentor.com/) Modelsim (DE and SE) Windows Platform * [Icarus Verilog](http://iverilog.icarus.com/) * [Aldec](https://www.aldec.com/) Riviera-PRO * [Mentor](https://www.mentor.com/) Modelsim (DE and SE) A (possibly older) version of cocotb can be used live in a web-browser using [EDA Playground](https://www.edaplayground.com/) . How is cocotb different?[¶](https://docs.cocotb.org/en/v1.2.0/introduction.html#how-is-cocotb-different "Permalink to this headline") -------------------------------------------------------------------------------------------------------------------------------------- cocotb encourages the same philosophy of design re-use and randomised testing as UVM, however is implemented in Python rather than SystemVerilog. In cocotb, VHDL/Verilog/SystemVerilog are only used for the synthesisable design. cocotb has built-in support for integrating with the [Jenkins](https://jenkins.io/) continuous integration system. cocotb was specifically designed to lower the overhead of creating a test. cocotb automatically discovers tests so that no additional step is required to add a test to a regression. All verification is done using Python which has various advantages over using SystemVerilog or VHDL for verification: * Writing Python is **fast** - it’s a very productive language * It’s **easy** to interface to other languages from Python * Python has a huge library of existing code to **re-use** like [packet generation](https://www.secdev.org/projects/scapy/) libraries. * Python is **interpreted**. Tests can be edited and re-run them without having to recompile the design or exit the simulator GUI. * Python is **popular** - far more engineers know Python than SystemVerilog or VHDL How does cocotb work?[¶](https://docs.cocotb.org/en/v1.2.0/introduction.html#how-does-cocotb-work "Permalink to this headline") -------------------------------------------------------------------------------------------------------------------------------- ### Overview[¶](https://docs.cocotb.org/en/v1.2.0/introduction.html#overview "Permalink to this headline") A typical cocotb testbench requires no additional RTL code. The Design Under Test (DUT) is instantiated as the toplevel in the simulator without any wrapper code. cocotb drives stimulus onto the inputs to the DUT (or further down the hierarchy) and monitors the outputs directly from Python. ![_images/cocotb_overview.svg](https://docs.cocotb.org/en/v1.2.0/_images/cocotb_overview.svg) A test is simply a Python function. At any given time either the simulator is advancing time or the Python code is executing. The `yield` keyword is used to indicate when to pass control of execution back to the simulator. A test can spawn multiple coroutines, allowing for independent flows of execution. Contributors[¶](https://docs.cocotb.org/en/v1.2.0/introduction.html#contributors "Permalink to this headline") --------------------------------------------------------------------------------------------------------------- cocotb was developed by [Potential Ventures](https://potential.ventures/) with the support of [Solarflare Communications Ltd](https://www.solarflare.com/) and contributions from Gordon McGregor and Finn Grimwood (see [contributers](https://github.com/cocotb/cocotb/graphs/contributors) for the full list of contributions). We also have a list of talks and papers, libraries and examples at our wiki page [Further Resources](https://github.com/cocotb/cocotb/wiki/Further-Resources) . Feel free to add links to cocotb-related content that we are still missing! --- # Index — cocotb 1.1 documentation * [Docs](https://docs.cocotb.org/en/v1.1/index.html) » * Index * [Edit on GitHub](https://github.com/cocotb/cocotb/blob/v1.1/documentation/source/genindex.rst) * * * Index ===== [**\_**](https://docs.cocotb.org/en/v1.1/genindex.html#_) | [**A**](https://docs.cocotb.org/en/v1.1/genindex.html#A) | [**B**](https://docs.cocotb.org/en/v1.1/genindex.html#B) | [**C**](https://docs.cocotb.org/en/v1.1/genindex.html#C) | [**D**](https://docs.cocotb.org/en/v1.1/genindex.html#D) | [**E**](https://docs.cocotb.org/en/v1.1/genindex.html#E) | [**F**](https://docs.cocotb.org/en/v1.1/genindex.html#F) | [**G**](https://docs.cocotb.org/en/v1.1/genindex.html#G) | [**H**](https://docs.cocotb.org/en/v1.1/genindex.html#H) | [**I**](https://docs.cocotb.org/en/v1.1/genindex.html#I) | [**J**](https://docs.cocotb.org/en/v1.1/genindex.html#J) | [**L**](https://docs.cocotb.org/en/v1.1/genindex.html#L) | [**M**](https://docs.cocotb.org/en/v1.1/genindex.html#M) | [**N**](https://docs.cocotb.org/en/v1.1/genindex.html#N) | [**O**](https://docs.cocotb.org/en/v1.1/genindex.html#O) | [**P**](https://docs.cocotb.org/en/v1.1/genindex.html#P) | [**R**](https://docs.cocotb.org/en/v1.1/genindex.html#R) | [**S**](https://docs.cocotb.org/en/v1.1/genindex.html#S) | [**T**](https://docs.cocotb.org/en/v1.1/genindex.html#T) | [**U**](https://docs.cocotb.org/en/v1.1/genindex.html#U) | [**V**](https://docs.cocotb.org/en/v1.1/genindex.html#V) | [**W**](https://docs.cocotb.org/en/v1.1/genindex.html#W) | [**X**](https://docs.cocotb.org/en/v1.1/genindex.html#X) \_ -- | | | | --- | --- | | * [\_driver\_send() (cocotb.drivers.Driver method)](https://docs.cocotb.org/en/v1.1/library_reference.html#cocotb.drivers.Driver._driver_send)

* [\_monitor\_recv (cocotb.monitors.Monitor attribute)](https://docs.cocotb.org/en/v1.1/library_reference.html#cocotb.monitors.Monitor._monitor_recv)

* [\_recv() (cocotb.monitors.Monitor method)](https://docs.cocotb.org/en/v1.1/library_reference.html#cocotb.monitors.Monitor._recv) | * [\_send (cocotb.drivers.Driver attribute)](https://docs.cocotb.org/en/v1.1/library_reference.html#cocotb.drivers.Driver._send)

* [\_wait\_for\_nsignal (cocotb.drivers.BusDriver attribute)](https://docs.cocotb.org/en/v1.1/library_reference.html#cocotb.drivers.BusDriver._wait_for_nsignal)

* [\_wait\_for\_signal (cocotb.drivers.BusDriver attribute)](https://docs.cocotb.org/en/v1.1/library_reference.html#cocotb.drivers.BusDriver._wait_for_signal) | A - | | | | --- | --- | | * [acquire() (cocotb.triggers.Lock method)](https://docs.cocotb.org/en/v1.1/library_reference.html#cocotb.triggers.Lock.acquire)

* [AD9361 (class in cocotb.drivers.ad9361)](https://docs.cocotb.org/en/v1.1/library_reference.html#cocotb.drivers.ad9361.AD9361)

* [ad9361\_tx\_to\_rx\_loopback() (cocotb.drivers.ad9361.AD9361 method)](https://docs.cocotb.org/en/v1.1/library_reference.html#cocotb.drivers.ad9361.AD9361.ad9361_tx_to_rx_loopback)

* [add\_interface() (cocotb.scoreboard.Scoreboard method)](https://docs.cocotb.org/en/v1.1/library_reference.html#cocotb.scoreboard.Scoreboard.add_interface)

* [add\_option() (cocotb.regression.TestFactory method)](https://docs.cocotb.org/en/v1.1/library_reference.html#cocotb.regression.TestFactory.add_option)

* [append() (cocotb.drivers.Driver method)](https://docs.cocotb.org/en/v1.1/library_reference.html#cocotb.drivers.Driver.append)

* [assign() (cocotb.binary.BinaryValue method)](https://docs.cocotb.org/en/v1.1/library_reference.html#cocotb.binary.BinaryValue.assign)

* [AvalonMaster (class in cocotb.drivers.avalon)](https://docs.cocotb.org/en/v1.1/library_reference.html#cocotb.drivers.avalon.AvalonMaster) | * [AvalonMemory (class in cocotb.drivers.avalon)](https://docs.cocotb.org/en/v1.1/library_reference.html#cocotb.drivers.avalon.AvalonMemory)

* [AvalonMM (class in cocotb.drivers.avalon)](https://docs.cocotb.org/en/v1.1/library_reference.html#cocotb.drivers.avalon.AvalonMM)

* [AvalonST (class in cocotb.drivers.avalon)](https://docs.cocotb.org/en/v1.1/library_reference.html#cocotb.drivers.avalon.AvalonST)
* [(class in cocotb.monitors.avalon)](https://docs.cocotb.org/en/v1.1/library_reference.html#cocotb.monitors.avalon.AvalonST)

* [AvalonSTPkts (class in cocotb.drivers.avalon)](https://docs.cocotb.org/en/v1.1/library_reference.html#cocotb.drivers.avalon.AvalonSTPkts)
* [(class in cocotb.monitors.avalon)](https://docs.cocotb.org/en/v1.1/library_reference.html#cocotb.monitors.avalon.AvalonSTPkts)

* [AXI4LiteMaster (class in cocotb.drivers.amba)](https://docs.cocotb.org/en/v1.1/library_reference.html#cocotb.drivers.amba.AXI4LiteMaster)

* [AXI4Slave (class in cocotb.drivers.amba)](https://docs.cocotb.org/en/v1.1/library_reference.html#cocotb.drivers.amba.AXI4Slave) | B - | | | | --- | --- | | * [BinaryRepresentation (class in cocotb.binary)](https://docs.cocotb.org/en/v1.1/library_reference.html#cocotb.binary.BinaryRepresentation)

* [BinaryValue (class in cocotb.binary)](https://docs.cocotb.org/en/v1.1/library_reference.html#cocotb.binary.BinaryValue)

* [binstr (cocotb.binary.BinaryValue attribute)](https://docs.cocotb.org/en/v1.1/library_reference.html#cocotb.binary.BinaryValue.binstr)

* [BitDriver (class in cocotb.drivers)](https://docs.cocotb.org/en/v1.1/library_reference.html#cocotb.drivers.BitDriver) | * [buff (cocotb.binary.BinaryValue attribute)](https://docs.cocotb.org/en/v1.1/library_reference.html#cocotb.binary.BinaryValue.buff)

* [Bus (class in cocotb.bus)](https://docs.cocotb.org/en/v1.1/library_reference.html#cocotb.bus.Bus)

* [BusDriver (class in cocotb.drivers)](https://docs.cocotb.org/en/v1.1/library_reference.html#cocotb.drivers.BusDriver)

* [BusMonitor (class in cocotb.monitors)](https://docs.cocotb.org/en/v1.1/library_reference.html#cocotb.monitors.BusMonitor) | C - | | | | --- | --- | | * [capture() (cocotb.bus.Bus method)](https://docs.cocotb.org/en/v1.1/library_reference.html#cocotb.bus.Bus.capture)

* [clear() (cocotb.drivers.Driver method)](https://docs.cocotb.org/en/v1.1/library_reference.html#cocotb.drivers.Driver.clear)
* [(cocotb.triggers.Event method)](https://docs.cocotb.org/en/v1.1/library_reference.html#cocotb.triggers.Event.clear)

* [Clock (class in cocotb.clock)](https://docs.cocotb.org/en/v1.1/library_reference.html#cocotb.clock.Clock)
, [\[1\]](https://docs.cocotb.org/en/v1.1/library_reference.html#cocotb.clock.Clock)

* [ClockCycles (class in cocotb.triggers)](https://docs.cocotb.org/en/v1.1/library_reference.html#cocotb.triggers.ClockCycles)

* [cocotb.handle (module)](https://docs.cocotb.org/en/v1.1/library_reference.html#module-cocotb.handle)

* [cocotb.result (module)](https://docs.cocotb.org/en/v1.1/library_reference.html#module-cocotb.result)

* [cocotb.scoreboard (module)](https://docs.cocotb.org/en/v1.1/library_reference.html#module-cocotb.scoreboard)

* [cocotb.utils (module)](https://docs.cocotb.org/en/v1.1/library_reference.html#module-cocotb.utils)

* [**COCOTB\_ANSI\_OUTPUT**](https://docs.cocotb.org/en/v1.1/building.html#term-cocotb-ansi-output)

* [**COCOTB\_ATTACH**](https://docs.cocotb.org/en/v1.1/building.html#term-cocotb-attach)

* [**COCOTB\_ENABLE\_PROFILING**](https://docs.cocotb.org/en/v1.1/building.html#term-cocotb-enable-profiling) | * [**COCOTB\_HOOKS**](https://docs.cocotb.org/en/v1.1/building.html#term-cocotb-hooks)

* [**COCOTB\_LOG\_LEVEL**](https://docs.cocotb.org/en/v1.1/building.html#term-cocotb-log-level)

* [**COCOTB\_NVC\_TRACE**](https://docs.cocotb.org/en/v1.1/building.html#term-cocotb-nvc-trace)

* [**COCOTB\_REDUCED\_LOG\_FMT**](https://docs.cocotb.org/en/v1.1/building.html#term-cocotb-reduced-log-fmt)

* [**COCOTB\_RESOLVE\_X**](https://docs.cocotb.org/en/v1.1/building.html#term-cocotb-resolve-x)

* [**COCOTB\_SCHEDULER\_DEBUG**](https://docs.cocotb.org/en/v1.1/building.html#term-cocotb-scheduler-debug)

* [compare() (cocotb.scoreboard.Scoreboard method)](https://docs.cocotb.org/en/v1.1/library_reference.html#cocotb.scoreboard.Scoreboard.compare)

* [**COMPILE\_ARGS**](https://docs.cocotb.org/en/v1.1/building.html#term-compile-args)

* [ConstantObject (class in cocotb.handle)](https://docs.cocotb.org/en/v1.1/library_reference.html#cocotb.handle.ConstantObject)

* [coroutine (class in cocotb)](https://docs.cocotb.org/en/v1.1/library_reference.html#cocotb.coroutine)

* [create\_error() (in module cocotb.result)](https://docs.cocotb.org/en/v1.1/library_reference.html#cocotb.result.create_error)

* [**CUSTOM\_COMPILE\_DEPS**](https://docs.cocotb.org/en/v1.1/building.html#term-custom-compile-deps)

* [**CUSTOM\_SIM\_DEPS**](https://docs.cocotb.org/en/v1.1/building.html#term-custom-sim-deps) | D - | | | | --- | --- | | * [drive() (cocotb.bus.Bus method)](https://docs.cocotb.org/en/v1.1/library_reference.html#cocotb.bus.Bus.drive) | * [Driver (class in cocotb.drivers)](https://docs.cocotb.org/en/v1.1/library_reference.html#cocotb.drivers.Driver)

* [drivers() (cocotb.handle.NonConstantObject method)](https://docs.cocotb.org/en/v1.1/library_reference.html#cocotb.handle.NonConstantObject.drivers) | E - | | | | --- | --- | | * [Edge (class in cocotb.triggers)](https://docs.cocotb.org/en/v1.1/library_reference.html#cocotb.triggers.Edge)

* [EnumObject (class in cocotb.handle)](https://docs.cocotb.org/en/v1.1/library_reference.html#cocotb.handle.EnumObject) | * [Event (class in cocotb.triggers)](https://docs.cocotb.org/en/v1.1/library_reference.html#cocotb.triggers.Event)

* [ExternalException](https://docs.cocotb.org/en/v1.1/library_reference.html#cocotb.result.ExternalException)

* [**EXTRA\_ARGS**](https://docs.cocotb.org/en/v1.1/building.html#term-extra-args) | F - * [FallingEdge (class in cocotb.triggers)](https://docs.cocotb.org/en/v1.1/library_reference.html#cocotb.triggers.FallingEdge) G - | | | | --- | --- | | * [generate\_tests() (cocotb.regression.TestFactory method)](https://docs.cocotb.org/en/v1.1/library_reference.html#cocotb.regression.TestFactory.generate_tests)

* [get\_binstr() (cocotb.binary.BinaryValue method)](https://docs.cocotb.org/en/v1.1/library_reference.html#cocotb.binary.BinaryValue.get_binstr)

* [get\_buff() (cocotb.binary.BinaryValue method)](https://docs.cocotb.org/en/v1.1/library_reference.html#cocotb.binary.BinaryValue.get_buff)

* [get\_sim\_steps() (in module cocotb.utils)](https://docs.cocotb.org/en/v1.1/library_reference.html#cocotb.utils.get_sim_steps) | * [get\_sim\_time() (in module cocotb.utils)](https://docs.cocotb.org/en/v1.1/library_reference.html#cocotb.utils.get_sim_time)

* [get\_time\_from\_sim\_steps() (in module cocotb.utils)](https://docs.cocotb.org/en/v1.1/library_reference.html#cocotb.utils.get_time_from_sim_steps)

* [get\_value() (cocotb.binary.BinaryValue method)](https://docs.cocotb.org/en/v1.1/library_reference.html#cocotb.binary.BinaryValue.get_value)

* [get\_value\_signed() (cocotb.binary.BinaryValue method)](https://docs.cocotb.org/en/v1.1/library_reference.html#cocotb.binary.BinaryValue.get_value_signed)

* [**GUI**](https://docs.cocotb.org/en/v1.1/building.html#term-gui) | H - | | | | --- | --- | | * [hexdiffs() (in module cocotb.utils)](https://docs.cocotb.org/en/v1.1/library_reference.html#cocotb.utils.hexdiffs)

* [hexdump() (in module cocotb.utils)](https://docs.cocotb.org/en/v1.1/library_reference.html#cocotb.utils.hexdump) | * [HierarchyArrayObject (class in cocotb.handle)](https://docs.cocotb.org/en/v1.1/library_reference.html#cocotb.handle.HierarchyArrayObject)

* [HierarchyObject (class in cocotb.handle)](https://docs.cocotb.org/en/v1.1/library_reference.html#cocotb.handle.HierarchyObject)

* [hook (class in cocotb)](https://docs.cocotb.org/en/v1.1/library_reference.html#cocotb.hook) | I - | | | | --- | --- | | * [idle() (cocotb.drivers.xgmii.XGMII method)](https://docs.cocotb.org/en/v1.1/library_reference.html#cocotb.drivers.xgmii.XGMII.idle)

* [integer (cocotb.binary.BinaryValue attribute)](https://docs.cocotb.org/en/v1.1/library_reference.html#cocotb.binary.BinaryValue.integer) | * [IntegerObject (class in cocotb.handle)](https://docs.cocotb.org/en/v1.1/library_reference.html#cocotb.handle.IntegerObject)

* [is\_resolvable (cocotb.binary.BinaryValue attribute)](https://docs.cocotb.org/en/v1.1/library_reference.html#cocotb.binary.BinaryValue.is_resolvable) | J - * [Join (class in cocotb.triggers)](https://docs.cocotb.org/en/v1.1/library_reference.html#cocotb.triggers.Join) L - | | | | --- | --- | | * [layer1() (cocotb.drivers.xgmii.XGMII static method)](https://docs.cocotb.org/en/v1.1/library_reference.html#cocotb.drivers.xgmii.XGMII.layer1) | * [loads() (cocotb.handle.NonConstantObject method)](https://docs.cocotb.org/en/v1.1/library_reference.html#cocotb.handle.NonConstantObject.loads)

* [Lock (class in cocotb.triggers)](https://docs.cocotb.org/en/v1.1/library_reference.html#cocotb.triggers.Lock) | M - | | | | --- | --- | | * [**MEMCHECK**](https://docs.cocotb.org/en/v1.1/building.html#term-memcheck)

* [ModifiableObject (class in cocotb.handle)](https://docs.cocotb.org/en/v1.1/library_reference.html#cocotb.handle.ModifiableObject) | * [**MODULE**](https://docs.cocotb.org/en/v1.1/building.html#term-module)

* [Monitor (class in cocotb.monitors)](https://docs.cocotb.org/en/v1.1/library_reference.html#cocotb.monitors.Monitor) | N - | | | | --- | --- | | * [n\_bits (cocotb.binary.BinaryValue attribute)](https://docs.cocotb.org/en/v1.1/library_reference.html#cocotb.binary.BinaryValue.n_bits)

* [NextTimeStep (class in cocotb.triggers)](https://docs.cocotb.org/en/v1.1/library_reference.html#cocotb.triggers.NextTimeStep) | * [NonConstantObject (class in cocotb.handle)](https://docs.cocotb.org/en/v1.1/library_reference.html#cocotb.handle.NonConstantObject)

* [NonHierarchyIndexableObject (class in cocotb.handle)](https://docs.cocotb.org/en/v1.1/library_reference.html#cocotb.handle.NonHierarchyIndexableObject)

* [NonHierarchyObject (class in cocotb.handle)](https://docs.cocotb.org/en/v1.1/library_reference.html#cocotb.handle.NonHierarchyObject) | O - * [OPBMaster (class in cocotb.drivers.opb)](https://docs.cocotb.org/en/v1.1/library_reference.html#cocotb.drivers.opb.OPBMaster) P - | | | | --- | --- | | * [pack() (in module cocotb.utils)](https://docs.cocotb.org/en/v1.1/library_reference.html#cocotb.utils.pack) | * [ParametrizedSingleton (class in cocotb.utils)](https://docs.cocotb.org/en/v1.1/library_reference.html#cocotb.utils.ParametrizedSingleton) | R - | | | | --- | --- | | * [raise\_error() (in module cocotb.result)](https://docs.cocotb.org/en/v1.1/library_reference.html#cocotb.result.raise_error)

* [**RANDOM\_SEED**](https://docs.cocotb.org/en/v1.1/building.html#term-random-seed)

* [read() (cocotb.drivers.amba.AXI4LiteMaster method)](https://docs.cocotb.org/en/v1.1/library_reference.html#cocotb.drivers.amba.AXI4LiteMaster.read)
* [(cocotb.drivers.avalon.AvalonMaster method)](https://docs.cocotb.org/en/v1.1/library_reference.html#cocotb.drivers.avalon.AvalonMaster.read)

* [(cocotb.drivers.opb.OPBMaster method)](https://docs.cocotb.org/en/v1.1/library_reference.html#cocotb.drivers.opb.OPBMaster.read)

* [ReadOnly (class in cocotb.triggers)](https://docs.cocotb.org/en/v1.1/library_reference.html#cocotb.triggers.ReadOnly) | * [RealObject (class in cocotb.handle)](https://docs.cocotb.org/en/v1.1/library_reference.html#cocotb.handle.RealObject)

* [RegionObject (class in cocotb.handle)](https://docs.cocotb.org/en/v1.1/library_reference.html#cocotb.handle.RegionObject)

* [result (cocotb.scoreboard.Scoreboard attribute)](https://docs.cocotb.org/en/v1.1/library_reference.html#cocotb.scoreboard.Scoreboard.result)

* [ReturnValue](https://docs.cocotb.org/en/v1.1/library_reference.html#cocotb.result.ReturnValue)

* [RisingEdge (class in cocotb.triggers)](https://docs.cocotb.org/en/v1.1/library_reference.html#cocotb.triggers.RisingEdge)

* [rx\_data\_to\_ad9361() (cocotb.drivers.ad9361.AD9361 method)](https://docs.cocotb.org/en/v1.1/library_reference.html#cocotb.drivers.ad9361.AD9361.rx_data_to_ad9361) | S - | | | | --- | --- | | * [sample() (cocotb.bus.Bus method)](https://docs.cocotb.org/en/v1.1/library_reference.html#cocotb.bus.Bus.sample)

* [Scoreboard (class in cocotb.scoreboard)](https://docs.cocotb.org/en/v1.1/library_reference.html#cocotb.scoreboard.Scoreboard)

* [send (cocotb.drivers.Driver attribute)](https://docs.cocotb.org/en/v1.1/library_reference.html#cocotb.drivers.Driver.send)

* [send\_data() (cocotb.drivers.ad9361.AD9361 method)](https://docs.cocotb.org/en/v1.1/library_reference.html#cocotb.drivers.ad9361.AD9361.send_data)

* [set() (cocotb.triggers.Event method)](https://docs.cocotb.org/en/v1.1/library_reference.html#cocotb.triggers.Event.set)

* [setimmediatevalue() (cocotb.handle.EnumObject method)](https://docs.cocotb.org/en/v1.1/library_reference.html#cocotb.handle.EnumObject.setimmediatevalue)
* [(cocotb.handle.IntegerObject method)](https://docs.cocotb.org/en/v1.1/library_reference.html#cocotb.handle.IntegerObject.setimmediatevalue)

* [(cocotb.handle.ModifiableObject method)](https://docs.cocotb.org/en/v1.1/library_reference.html#cocotb.handle.ModifiableObject.setimmediatevalue)

* [(cocotb.handle.RealObject method)](https://docs.cocotb.org/en/v1.1/library_reference.html#cocotb.handle.RealObject.setimmediatevalue)

* [(cocotb.handle.StringObject method)](https://docs.cocotb.org/en/v1.1/library_reference.html#cocotb.handle.StringObject.setimmediatevalue) | * [signed\_integer (cocotb.binary.BinaryValue attribute)](https://docs.cocotb.org/en/v1.1/library_reference.html#cocotb.binary.BinaryValue.signed_integer)

* [SIGNED\_MAGNITUDE (cocotb.binary.BinaryRepresentation attribute)](https://docs.cocotb.org/en/v1.1/library_reference.html#cocotb.binary.BinaryRepresentation.SIGNED_MAGNITUDE)

* [**SIM**](https://docs.cocotb.org/en/v1.1/building.html#term-sim)

* [**SIM\_ARGS**](https://docs.cocotb.org/en/v1.1/building.html#term-sim-args)

* [**SIM\_BUILD**](https://docs.cocotb.org/en/v1.1/building.html#term-sim-build)

* [**SIM\_ROOT**](https://docs.cocotb.org/en/v1.1/building.html#term-sim-root)

* [SimFailure](https://docs.cocotb.org/en/v1.1/library_reference.html#cocotb.result.SimFailure)

* [SimHandle() (in module cocotb.handle)](https://docs.cocotb.org/en/v1.1/library_reference.html#cocotb.handle.SimHandle)

* [SimHandleBase (class in cocotb.handle)](https://docs.cocotb.org/en/v1.1/library_reference.html#cocotb.handle.SimHandleBase)

* [start (cocotb.clock.Clock attribute)](https://docs.cocotb.org/en/v1.1/library_reference.html#cocotb.clock.Clock.start)

* [StringObject (class in cocotb.handle)](https://docs.cocotb.org/en/v1.1/library_reference.html#cocotb.handle.StringObject) | T - | | | | --- | --- | | * [terminate() (cocotb.drivers.xgmii.XGMII method)](https://docs.cocotb.org/en/v1.1/library_reference.html#cocotb.drivers.xgmii.XGMII.terminate)

* [test (class in cocotb)](https://docs.cocotb.org/en/v1.1/library_reference.html#cocotb.test)
* [(class in cocotb.decorators)](https://docs.cocotb.org/en/v1.1/tests.html#cocotb.decorators.test)

* [**TESTCASE**](https://docs.cocotb.org/en/v1.1/building.html#term-testcase)

* [TestComplete](https://docs.cocotb.org/en/v1.1/library_reference.html#cocotb.result.TestComplete)

* [TestError](https://docs.cocotb.org/en/v1.1/library_reference.html#cocotb.result.TestError) | * [TestFactory (class in cocotb.regression)](https://docs.cocotb.org/en/v1.1/library_reference.html#cocotb.regression.TestFactory)

* [TestFailure](https://docs.cocotb.org/en/v1.1/library_reference.html#cocotb.result.TestFailure)

* [TestSuccess](https://docs.cocotb.org/en/v1.1/library_reference.html#cocotb.result.TestSuccess)

* [Timer (class in cocotb.triggers)](https://docs.cocotb.org/en/v1.1/library_reference.html#cocotb.triggers.Timer)

* [**TOPLEVEL**](https://docs.cocotb.org/en/v1.1/building.html#term-toplevel)

* [TWOS\_COMPLEMENT (cocotb.binary.BinaryRepresentation attribute)](https://docs.cocotb.org/en/v1.1/library_reference.html#cocotb.binary.BinaryRepresentation.TWOS_COMPLEMENT)

* [tx\_data\_from\_ad9361() (cocotb.drivers.ad9361.AD9361 method)](https://docs.cocotb.org/en/v1.1/library_reference.html#cocotb.drivers.ad9361.AD9361.tx_data_from_ad9361) | U - | | | | --- | --- | | * [unpack() (in module cocotb.utils)](https://docs.cocotb.org/en/v1.1/library_reference.html#cocotb.utils.unpack) | * [UNSIGNED (cocotb.binary.BinaryRepresentation attribute)](https://docs.cocotb.org/en/v1.1/library_reference.html#cocotb.binary.BinaryRepresentation.UNSIGNED) | V - | | | | --- | --- | | * [value (cocotb.binary.BinaryValue attribute)](https://docs.cocotb.org/en/v1.1/library_reference.html#cocotb.binary.BinaryValue.value)
* [(cocotb.handle.NonHierarchyObject attribute)](https://docs.cocotb.org/en/v1.1/library_reference.html#cocotb.handle.NonHierarchyObject.value) | * [**VERILOG\_SOURCES**](https://docs.cocotb.org/en/v1.1/building.html#term-verilog-sources)

* [**VERSION**](https://docs.cocotb.org/en/v1.1/building.html#term-version)

* [**VHDL\_SOURCES**](https://docs.cocotb.org/en/v1.1/building.html#term-vhdl-sources) | W - | | | | --- | --- | | * [wait() (cocotb.triggers.Event method)](https://docs.cocotb.org/en/v1.1/library_reference.html#cocotb.triggers.Event.wait)

* [with\_metaclass() (in module cocotb.utils)](https://docs.cocotb.org/en/v1.1/library_reference.html#cocotb.utils.with_metaclass) | * [write() (cocotb.drivers.amba.AXI4LiteMaster method)](https://docs.cocotb.org/en/v1.1/library_reference.html#cocotb.drivers.amba.AXI4LiteMaster.write)
* [(cocotb.drivers.avalon.AvalonMaster method)](https://docs.cocotb.org/en/v1.1/library_reference.html#cocotb.drivers.avalon.AvalonMaster.write)

* [(cocotb.drivers.opb.OPBMaster method)](https://docs.cocotb.org/en/v1.1/library_reference.html#cocotb.drivers.opb.OPBMaster.write) | X - * [XGMII (class in cocotb.drivers.xgmii)](https://docs.cocotb.org/en/v1.1/library_reference.html#cocotb.drivers.xgmii.XGMII) * [(class in cocotb.monitors.xgmii)](https://docs.cocotb.org/en/v1.1/library_reference.html#cocotb.monitors.xgmii.XGMII) --- # Quickstart Guide — cocotb 1.3.1 documentation * [Docs](https://docs.cocotb.org/en/v1.3.1/index.html) » * Quickstart Guide * [Edit on GitHub](https://github.com/cocotb/cocotb/blob/v1.3.1/documentation/source/quickstart.rst) * * * Quickstart Guide[¶](https://docs.cocotb.org/en/v1.3.1/quickstart.html#quickstart-guide "Permalink to this headline") ===================================================================================================================== Installing cocotb[¶](https://docs.cocotb.org/en/v1.3.1/quickstart.html#installing-cocotb "Permalink to this headline") ----------------------------------------------------------------------------------------------------------------------- ### Pre-requisites[¶](https://docs.cocotb.org/en/v1.3.1/quickstart.html#pre-requisites "Permalink to this headline") Cocotb has the following requirements: * Python 2.7, Python 3.5+ (recommended) * Python-dev packages * GCC 4.8.1+ and associated development packages * GNU Make * A Verilog or VHDL simulator, depending on your RTL source code ### Installation via PIP[¶](https://docs.cocotb.org/en/v1.3.1/quickstart.html#installation-via-pip "Permalink to this headline") New in version 1.2. Cocotb can be installed by running pip3 install cocotb or pip install cocotb For user local installation follow the [pip User Guide](https://pip.pypa.io/en/stable/user_guide/#user-installs/) . To install the development version of cocotb: git clone https://github.com/cocotb/cocotb pip install -e ./cocotb ### Native Linux Installation[¶](https://docs.cocotb.org/en/v1.3.1/quickstart.html#native-linux-installation "Permalink to this headline") The following instructions will allow building of the cocotb libraries for use with a 64-bit native simulator. If a 32-bit simulator is being used then additional steps are needed, please see [our Wiki](https://github.com/cocotb/cocotb/wiki/Tier-2-Setup-Instructions) . #### Debian/Ubuntu-based[¶](https://docs.cocotb.org/en/v1.3.1/quickstart.html#debian-ubuntu-based "Permalink to this headline") sudo apt-get install git make gcc g++ swig python-dev #### Red Hat-based[¶](https://docs.cocotb.org/en/v1.3.1/quickstart.html#red-hat-based "Permalink to this headline") sudo yum install gcc gcc-c++ libstdc++-devel swig python-devel ### Windows Installation[¶](https://docs.cocotb.org/en/v1.3.1/quickstart.html#windows-installation "Permalink to this headline") Download the MinGW installer from [https://osdn.net/projects/mingw/releases/](https://osdn.net/projects/mingw/releases/) . Run the GUI installer and specify a directory you would like the environment installed in. The installer will retrieve a list of possible packages, when this is done press “Continue”. The MinGW Installation Manager is then launched. The following packages need selecting by checking the tick box and selecting “Mark for installation” Basic Installation -- mingw-developer-tools -- mingw32-base -- mingw32-gcc-g++ -- msys-base From the Installation menu then select “Apply Changes”, in the next dialog select “Apply”. When installed a shell can be opened using the `msys.bat` file located under the `/msys/1.0/` Python can be downloaded from [https://www.python.org/downloads/windows/](https://www.python.org/downloads/windows/) . Run the installer and download to your chosen location. It is beneficial to add the path to Python to the Windows system `PATH` variable so it can be used easily from inside Msys. Once inside the Msys shell commands as given here will work as expected. ### macOS Packages[¶](https://docs.cocotb.org/en/v1.3.1/quickstart.html#macos-packages "Permalink to this headline") You need a few packages installed to get cocotb running on macOS. Installing a package manager really helps things out here. [Brew](https://brew.sh/) seems to be the most popular, so we’ll assume you have that installed. brew install python icarus-verilog gtkwave Running your first Example[¶](https://docs.cocotb.org/en/v1.3.1/quickstart.html#running-your-first-example "Permalink to this headline") ----------------------------------------------------------------------------------------------------------------------------------------- Assuming you have installed the prerequisites as above, the following lines are all you need to run a first simulation with cocotb: git clone https://github.com/cocotb/cocotb cd cocotb/examples/endian\_swapper/tests make Selecting a different simulator is as easy as: make SIM\=vcs ### Running the same example as VHDL[¶](https://docs.cocotb.org/en/v1.3.1/quickstart.html#running-the-same-example-as-vhdl "Permalink to this headline") The `endian_swapper` example includes both a VHDL and a Verilog RTL implementation. The cocotb testbench can execute against either implementation using VPI for Verilog and VHPI/FLI for VHDL. To run the test suite against the VHDL implementation use the following command (a VHPI or FLI capable simulator must be used): make SIM\=ghdl TOPLEVEL\_LANG\=vhdl Using cocotb[¶](https://docs.cocotb.org/en/v1.3.1/quickstart.html#using-cocotb "Permalink to this headline") ------------------------------------------------------------------------------------------------------------- A typical cocotb testbench requires no additional HDL code (though nothing prevents you from adding testbench helper code). The Design Under Test (DUT) is instantiated as the toplevel in the simulator without any wrapper code. Cocotb drives stimulus onto the inputs to the DUT and monitors the outputs directly from Python. ### Creating a Makefile[¶](https://docs.cocotb.org/en/v1.3.1/quickstart.html#creating-a-makefile "Permalink to this headline") To create a cocotb test we typically have to create a Makefile. Cocotb provides rules which make it easy to get started. We simply inform cocotb of the source files we need compiling, the toplevel entity to instantiate and the Python test script to load. VERILOG\_SOURCES \= $(PWD)/submodule.sv $(PWD)/my\_design.sv \# TOPLEVEL is the name of the toplevel module in your Verilog or VHDL file: TOPLEVEL\=my\_design \# MODULE is the name of the Python test file: MODULE\=test\_my\_design include $(shell cocotb-config --makefiles)/Makefile.inc include $(shell cocotb-config --makefiles)/Makefile.sim We would then create a file called `test_my_design.py` containing our tests. ### Creating a test[¶](https://docs.cocotb.org/en/v1.3.1/quickstart.html#creating-a-test "Permalink to this headline") The test is written in Python. Cocotb wraps your top level with the handle you pass it. In this documentation, and most of the examples in the project, that handle is `dut`, but you can pass your own preferred name in instead. The handle is used in all Python files referencing your RTL project. Assuming we have a toplevel port called `clk` we could create a test file containing the following: import cocotb from cocotb.triggers import Timer @cocotb.test() def my\_first\_test(dut): """Try accessing the design.""" dut.\_log.info("Running test!") for cycle in range(10): dut.clk \= 0 yield Timer(1, units\='ns') dut.clk \= 1 yield Timer(1, units\='ns') dut.\_log.info("Running test!") This will drive a square wave clock onto the `clk` port of the toplevel. ### Accessing the design[¶](https://docs.cocotb.org/en/v1.3.1/quickstart.html#accessing-the-design "Permalink to this headline") When cocotb initializes it finds the top-level instantiation in the simulator and creates a handle called `dut`. Top-level signals can be accessed using the “dot” notation used for accessing object attributes in Python. The same mechanism can be used to access signals inside the design. \# Get a reference to the "clk" signal on the top-level clk \= dut.clk \# Get a reference to a register "count" \# in a sub-block "inst\_sub\_block" count \= dut.inst\_sub\_block.count ### Assigning values to signals[¶](https://docs.cocotb.org/en/v1.3.1/quickstart.html#assigning-values-to-signals "Permalink to this headline") Values can be assigned to signals using either the [`value`](https://docs.cocotb.org/en/v1.3.1/library_reference.html#cocotb.handle.NonHierarchyObject.value "cocotb.handle.NonHierarchyObject.value") property of a handle object or using direct assignment while traversing the hierarchy. \# Get a reference to the "clk" signal and assign a value clk \= dut.clk clk.value \= 1 \# Direct assignment through the hierarchy dut.input\_signal <= 12 \# Assign a value to a memory deep in the hierarchy dut.sub\_block.memory.array\[4\] <= 2 The syntax `sig <= new_value` is a short form of `sig.value = new_value`. It not only resembles HDL syntax, but also has the same semantics: writes are not applied immediately, but delayed until the next write cycle. Use `sig.setimmediatevalue(new_val)` to set a new value immediately (see [`setimmediatevalue()`](https://docs.cocotb.org/en/v1.3.1/library_reference.html#cocotb.handle.ModifiableObject.setimmediatevalue "cocotb.handle.ModifiableObject.setimmediatevalue") ). ### Reading values from signals[¶](https://docs.cocotb.org/en/v1.3.1/quickstart.html#reading-values-from-signals "Permalink to this headline") Accessing the [`value`](https://docs.cocotb.org/en/v1.3.1/library_reference.html#cocotb.handle.NonHierarchyObject.value "cocotb.handle.NonHierarchyObject.value") property of a handle object will return a [`BinaryValue`](https://docs.cocotb.org/en/v1.3.1/library_reference.html#cocotb.binary.BinaryValue "cocotb.binary.BinaryValue") object. Any unresolved bits are preserved and can be accessed using the [`binstr`](https://docs.cocotb.org/en/v1.3.1/library_reference.html#cocotb.binary.BinaryValue.binstr "cocotb.binary.BinaryValue.binstr") attribute, or a resolved integer value can be accessed using the [`integer`](https://docs.cocotb.org/en/v1.3.1/library_reference.html#cocotb.binary.BinaryValue.integer "cocotb.binary.BinaryValue.integer") attribute. \>>> \# Read a value back from the DUT \>>> count \= dut.counter.value \>>> \>>> print(count.binstr) 1X1010 \>>> \# Resolve the value to an integer (X or Z treated as 0) \>>> print(count.integer) 42 \>>> \# Show number of bits in a value \>>> print(count.n\_bits) 6 We can also cast the signal handle directly to an integer: \>>> print(int(dut.counter)) 42 ### Parallel and sequential execution[¶](https://docs.cocotb.org/en/v1.3.1/quickstart.html#parallel-and-sequential-execution "Permalink to this headline") A [`yield`](https://docs.python.org/3/reference/simple_stmts.html#yield "(in Python v3.8)") will run a function (that must be marked as a “coroutine”, see [Coroutines](https://docs.cocotb.org/en/v1.3.1/coroutines.html#coroutines) ) sequentially, i.e. wait for it to complete. If a coroutine should be run “in the background”, i.e. in parallel to other coroutines, the way to do this is to [`fork()`](https://docs.cocotb.org/en/v1.3.1/library_reference.html#cocotb.fork "cocotb.fork") it. The end of such a forked coroutine can be waited on by using [`join()`](https://docs.cocotb.org/en/v1.3.1/library_reference.html#cocotb.decorators.RunningCoroutine.join "cocotb.decorators.RunningCoroutine.join") . The following example shows these in action: @cocotb.coroutine def reset\_dut(reset\_n, duration): reset\_n <= 0 yield Timer(duration, units\='ns') reset\_n <= 1 reset\_n.\_log.debug("Reset complete") @cocotb.test() def parallel\_example(dut): reset\_n \= dut.reset \# This will call reset\_dut sequentially \# Execution will block until reset\_dut has completed yield reset\_dut(reset\_n, 500) dut.\_log.debug("After reset") \# Call reset\_dut in parallel with the 250 ns timer reset\_thread \= cocotb.fork(reset\_dut(reset\_n, 500)) yield Timer(250, units\='ns') dut.\_log.debug("During reset (reset\_n = %s)" % reset\_n.value) \# Wait for the other thread to complete yield reset\_thread.join() dut.\_log.debug("After reset") --- # Quickstart Guide — cocotb 1.3.0 documentation * [Docs](https://docs.cocotb.org/en/v1.3.0/index.html) » * Quickstart Guide * [Edit on GitHub](https://github.com/cocotb/cocotb/blob/v1.3.0/documentation/source/quickstart.rst) * * * Quickstart Guide[¶](https://docs.cocotb.org/en/v1.3.0/quickstart.html#quickstart-guide "Permalink to this headline") ===================================================================================================================== Installing cocotb[¶](https://docs.cocotb.org/en/v1.3.0/quickstart.html#installing-cocotb "Permalink to this headline") ----------------------------------------------------------------------------------------------------------------------- ### Pre-requisites[¶](https://docs.cocotb.org/en/v1.3.0/quickstart.html#pre-requisites "Permalink to this headline") Cocotb has the following requirements: * Python 2.7, Python 3.5+ (recommended) * Python-dev packages * GCC 4.8.1+ and associated development packages * GNU Make * A Verilog or VHDL simulator, depending on your RTL source code ### Installation via PIP[¶](https://docs.cocotb.org/en/v1.3.0/quickstart.html#installation-via-pip "Permalink to this headline") New in version 1.2. Cocotb can be installed by running pip3 install cocotb or pip install cocotb For user local installation follow the [pip User Guide](https://pip.pypa.io/en/stable/user_guide/#user-installs/) . To install the development version of cocotb: git clone https://github.com/cocotb/cocotb pip install -e ./cocotb ### Native Linux Installation[¶](https://docs.cocotb.org/en/v1.3.0/quickstart.html#native-linux-installation "Permalink to this headline") The following instructions will allow building of the cocotb libraries for use with a 64-bit native simulator. If a 32-bit simulator is being used then additional steps are needed, please see [our Wiki](https://github.com/cocotb/cocotb/wiki/Tier-2-Setup-Instructions) . #### Debian/Ubuntu-based[¶](https://docs.cocotb.org/en/v1.3.0/quickstart.html#debian-ubuntu-based "Permalink to this headline") sudo apt-get install git make gcc g++ swig python-dev #### Red Hat-based[¶](https://docs.cocotb.org/en/v1.3.0/quickstart.html#red-hat-based "Permalink to this headline") sudo yum install gcc gcc-c++ libstdc++-devel swig python-devel ### Windows Installation[¶](https://docs.cocotb.org/en/v1.3.0/quickstart.html#windows-installation "Permalink to this headline") Download the MinGW installer from [https://osdn.net/projects/mingw/releases/](https://osdn.net/projects/mingw/releases/) . Run the GUI installer and specify a directory you would like the environment installed in. The installer will retrieve a list of possible packages, when this is done press “Continue”. The MinGW Installation Manager is then launched. The following packages need selecting by checking the tick box and selecting “Mark for installation” Basic Installation -- mingw-developer-tools -- mingw32-base -- mingw32-gcc-g++ -- msys-base From the Installation menu then select “Apply Changes”, in the next dialog select “Apply”. When installed a shell can be opened using the `msys.bat` file located under the `/msys/1.0/` Python can be downloaded from [https://www.python.org/downloads/windows/](https://www.python.org/downloads/windows/) . Run the installer and download to your chosen location. It is beneficial to add the path to Python to the Windows system `PATH` variable so it can be used easily from inside Msys. Once inside the Msys shell commands as given here will work as expected. ### macOS Packages[¶](https://docs.cocotb.org/en/v1.3.0/quickstart.html#macos-packages "Permalink to this headline") You need a few packages installed to get cocotb running on macOS. Installing a package manager really helps things out here. [Brew](https://brew.sh/) seems to be the most popular, so we’ll assume you have that installed. brew install python icarus-verilog gtkwave Running your first Example[¶](https://docs.cocotb.org/en/v1.3.0/quickstart.html#running-your-first-example "Permalink to this headline") ----------------------------------------------------------------------------------------------------------------------------------------- Assuming you have installed the prerequisites as above, the following lines are all you need to run a first simulation with cocotb: git clone https://github.com/cocotb/cocotb cd cocotb/examples/endian\_swapper/tests make Selecting a different simulator is as easy as: make SIM\=vcs ### Running the same example as VHDL[¶](https://docs.cocotb.org/en/v1.3.0/quickstart.html#running-the-same-example-as-vhdl "Permalink to this headline") The `endian_swapper` example includes both a VHDL and a Verilog RTL implementation. The cocotb testbench can execute against either implementation using VPI for Verilog and VHPI/FLI for VHDL. To run the test suite against the VHDL implementation use the following command (a VHPI or FLI capable simulator must be used): make SIM\=ghdl TOPLEVEL\_LANG\=vhdl Using cocotb[¶](https://docs.cocotb.org/en/v1.3.0/quickstart.html#using-cocotb "Permalink to this headline") ------------------------------------------------------------------------------------------------------------- A typical cocotb testbench requires no additional HDL code (though nothing prevents you from adding testbench helper code). The Design Under Test (DUT) is instantiated as the toplevel in the simulator without any wrapper code. Cocotb drives stimulus onto the inputs to the DUT and monitors the outputs directly from Python. ### Creating a Makefile[¶](https://docs.cocotb.org/en/v1.3.0/quickstart.html#creating-a-makefile "Permalink to this headline") To create a cocotb test we typically have to create a Makefile. Cocotb provides rules which make it easy to get started. We simply inform cocotb of the source files we need compiling, the toplevel entity to instantiate and the Python test script to load. VERILOG\_SOURCES \= $(PWD)/submodule.sv $(PWD)/my\_design.sv \# TOPLEVEL is the name of the toplevel module in your Verilog or VHDL file: TOPLEVEL\=my\_design \# MODULE is the name of the Python test file: MODULE\=test\_my\_design include $(shell cocotb-config --makefiles)/Makefile.inc include $(shell cocotb-config --makefiles)/Makefile.sim We would then create a file called `test_my_design.py` containing our tests. ### Creating a test[¶](https://docs.cocotb.org/en/v1.3.0/quickstart.html#creating-a-test "Permalink to this headline") The test is written in Python. Cocotb wraps your top level with the handle you pass it. In this documentation, and most of the examples in the project, that handle is `dut`, but you can pass your own preferred name in instead. The handle is used in all Python files referencing your RTL project. Assuming we have a toplevel port called `clk` we could create a test file containing the following: import cocotb from cocotb.triggers import Timer @cocotb.test() def my\_first\_test(dut): """Try accessing the design.""" dut.\_log.info("Running test!") for cycle in range(10): dut.clk \= 0 yield Timer(1, units\='ns') dut.clk \= 1 yield Timer(1, units\='ns') dut.\_log.info("Running test!") This will drive a square wave clock onto the `clk` port of the toplevel. ### Accessing the design[¶](https://docs.cocotb.org/en/v1.3.0/quickstart.html#accessing-the-design "Permalink to this headline") When cocotb initializes it finds the top-level instantiation in the simulator and creates a handle called `dut`. Top-level signals can be accessed using the “dot” notation used for accessing object attributes in Python. The same mechanism can be used to access signals inside the design. \# Get a reference to the "clk" signal on the top-level clk \= dut.clk \# Get a reference to a register "count" \# in a sub-block "inst\_sub\_block" count \= dut.inst\_sub\_block.count ### Assigning values to signals[¶](https://docs.cocotb.org/en/v1.3.0/quickstart.html#assigning-values-to-signals "Permalink to this headline") Values can be assigned to signals using either the [`value`](https://docs.cocotb.org/en/v1.3.0/library_reference.html#cocotb.handle.NonHierarchyObject.value "cocotb.handle.NonHierarchyObject.value") property of a handle object or using direct assignment while traversing the hierarchy. \# Get a reference to the "clk" signal and assign a value clk \= dut.clk clk.value \= 1 \# Direct assignment through the hierarchy dut.input\_signal <= 12 \# Assign a value to a memory deep in the hierarchy dut.sub\_block.memory.array\[4\] <= 2 The syntax `sig <= new_value` is a short form of `sig.value = new_value`. It not only resembles HDL syntax, but also has the same semantics: writes are not applied immediately, but delayed until the next write cycle. Use `sig.setimmediatevalue(new_val)` to set a new value immediately (see [`setimmediatevalue()`](https://docs.cocotb.org/en/v1.3.0/library_reference.html#cocotb.handle.ModifiableObject.setimmediatevalue "cocotb.handle.ModifiableObject.setimmediatevalue") ). ### Reading values from signals[¶](https://docs.cocotb.org/en/v1.3.0/quickstart.html#reading-values-from-signals "Permalink to this headline") Accessing the [`value`](https://docs.cocotb.org/en/v1.3.0/library_reference.html#cocotb.handle.NonHierarchyObject.value "cocotb.handle.NonHierarchyObject.value") property of a handle object will return a [`BinaryValue`](https://docs.cocotb.org/en/v1.3.0/library_reference.html#cocotb.binary.BinaryValue "cocotb.binary.BinaryValue") object. Any unresolved bits are preserved and can be accessed using the [`binstr`](https://docs.cocotb.org/en/v1.3.0/library_reference.html#cocotb.binary.BinaryValue.binstr "cocotb.binary.BinaryValue.binstr") attribute, or a resolved integer value can be accessed using the [`integer`](https://docs.cocotb.org/en/v1.3.0/library_reference.html#cocotb.binary.BinaryValue.integer "cocotb.binary.BinaryValue.integer") attribute. \>>> \# Read a value back from the DUT \>>> count \= dut.counter.value \>>> \>>> print(count.binstr) 1X1010 \>>> \# Resolve the value to an integer (X or Z treated as 0) \>>> print(count.integer) 42 \>>> \# Show number of bits in a value \>>> print(count.n\_bits) 6 We can also cast the signal handle directly to an integer: \>>> print(int(dut.counter)) 42 ### Parallel and sequential execution[¶](https://docs.cocotb.org/en/v1.3.0/quickstart.html#parallel-and-sequential-execution "Permalink to this headline") A [`yield`](https://docs.python.org/3/reference/simple_stmts.html#yield "(in Python v3.8)") will run a function (that must be marked as a “coroutine”, see [Coroutines](https://docs.cocotb.org/en/v1.3.0/coroutines.html#coroutines) ) sequentially, i.e. wait for it to complete. If a coroutine should be run “in the background”, i.e. in parallel to other coroutines, the way to do this is to [`fork()`](https://docs.cocotb.org/en/v1.3.0/library_reference.html#cocotb.fork "cocotb.fork") it. The end of such a forked coroutine can be waited on by using [`join()`](https://docs.cocotb.org/en/v1.3.0/library_reference.html#cocotb.decorators.RunningCoroutine.join "cocotb.decorators.RunningCoroutine.join") . The following example shows these in action: @cocotb.coroutine def reset\_dut(reset\_n, duration): reset\_n <= 0 yield Timer(duration, units\='ns') reset\_n <= 1 reset\_n.\_log.debug("Reset complete") @cocotb.test() def parallel\_example(dut): reset\_n \= dut.reset \# This will call reset\_dut sequentially \# Execution will block until reset\_dut has completed yield reset\_dut(reset\_n, 500) dut.\_log.debug("After reset") \# Call reset\_dut in parallel with the 250 ns timer reset\_thread \= cocotb.fork(reset\_dut(reset\_n, 500)) yield Timer(250, units\='ns') dut.\_log.debug("During reset (reset\_n = %s)" % reset\_n.value) \# Wait for the other thread to complete yield reset\_thread.join() dut.\_log.debug("After reset") --- # Build options and Environment Variables — cocotb 1.3.1 documentation * [Docs](https://docs.cocotb.org/en/v1.3.1/index.html) » * Build options and Environment Variables * [Edit on GitHub](https://github.com/cocotb/cocotb/blob/v1.3.1/documentation/source/building.rst) * * * Build options and Environment Variables[¶](https://docs.cocotb.org/en/v1.3.1/building.html#build-options-and-environment-variables "Permalink to this headline") ================================================================================================================================================================= Make System[¶](https://docs.cocotb.org/en/v1.3.1/building.html#make-system "Permalink to this headline") --------------------------------------------------------------------------------------------------------- Makefiles are provided for a variety of simulators in `cocotb/share/makefiles/simulators`. The common Makefile `cocotb/share/makefiles/Makefile.sim` includes the appropriate simulator Makefile based on the contents of the `SIM` variable. ### Make Targets[¶](https://docs.cocotb.org/en/v1.3.1/building.html#make-targets "Permalink to this headline") Makefiles define two targets, `regression` and `sim`, the default target is `sim`. Both rules create a results file with the name taken from [`COCOTB_RESULTS_FILE`](https://docs.cocotb.org/en/v1.3.1/building.html#envvar-COCOTB_RESULTS_FILE) , defaulting to `results.xml`. This file is a JUnit-compatible output file suitable for use with [Jenkins](https://jenkins.io/) . The `sim` targets unconditionally re-runs the simulator whereas the `regression` target only re-builds if any dependencies have changed. ### Make Phases[¶](https://docs.cocotb.org/en/v1.3.1/building.html#make-phases "Permalink to this headline") Typically the makefiles provided with cocotb for various simulators use a separate `compile` and `run` target. This allows for a rapid re-running of a simulator if none of the RTL source files have changed and therefore the simulator does not need to recompile the RTL. ### Make Variables[¶](https://docs.cocotb.org/en/v1.3.1/building.html#make-variables "Permalink to this headline") `GUI`[¶](https://docs.cocotb.org/en/v1.3.1/building.html#var-GUI "Permalink to this definition") Set this to 1 to enable the GUI mode in the simulator (if supported). `SIM`[¶](https://docs.cocotb.org/en/v1.3.1/building.html#var-SIM "Permalink to this definition") Selects which simulator Makefile to use. Attempts to include a simulator specific makefile from `cocotb/share/makefiles/makefile.$(SIM)` `WAVES`[¶](https://docs.cocotb.org/en/v1.3.1/building.html#var-WAVES "Permalink to this definition") Set this to 1 to enable wave traces dump for the Aldec Riviera-PRO and Mentor Graphics Questa simulators. To get wave traces in Icarus Verilog see [Simulator Support](https://docs.cocotb.org/en/v1.3.1/simulator_support.html#simulator-support) . `VERILOG_SOURCES`[¶](https://docs.cocotb.org/en/v1.3.1/building.html#var-VERILOG_SOURCES "Permalink to this definition") A list of the Verilog source files to include. `VHDL_SOURCES`[¶](https://docs.cocotb.org/en/v1.3.1/building.html#var-VHDL_SOURCES "Permalink to this definition") A list of the VHDL source files to include. `VHDL_SOURCES_`[¶](https://docs.cocotb.org/en/v1.3.1/building.html#var-VHDL_SOURCES_%3Clib%3E "Permalink to this definition") A list of the VHDL source files to include in the VHDL library _lib_ (currently for the GHDL simulator only). `COMPILE_ARGS`[¶](https://docs.cocotb.org/en/v1.3.1/building.html#var-COMPILE_ARGS "Permalink to this definition") Any arguments or flags to pass to the compile stage of the simulation. `SIM_ARGS`[¶](https://docs.cocotb.org/en/v1.3.1/building.html#var-SIM_ARGS "Permalink to this definition") Any arguments or flags to pass to the execution of the compiled simulation. `EXTRA_ARGS`[¶](https://docs.cocotb.org/en/v1.3.1/building.html#var-EXTRA_ARGS "Permalink to this definition") Passed to both the compile and execute phases of simulators with two rules, or passed to the single compile and run command for simulators which don’t have a distinct compilation stage. `PLUSARGS`[¶](https://docs.cocotb.org/en/v1.3.1/building.html#var-PLUSARGS "Permalink to this definition") “Plusargs” are options that are starting with a plus (`+`) sign. They are passed to the simulator and are also available within cocotb as [`cocotb.plusargs`](https://docs.cocotb.org/en/v1.3.1/library_reference.html#cocotb.plusargs "cocotb.plusargs") . In the simulator, they can be read by the Verilog/SystemVerilog system functions `$test$plusargs` and `$value$plusargs`. The special plusargs `+ntb_random_seed` and `+seed`, if present, are evaluated to set the random seed value if [`RANDOM_SEED`](https://docs.cocotb.org/en/v1.3.1/building.html#envvar-RANDOM_SEED) is not set. If both `+ntb_random_seed` and `+seed` are set, `+ntb_random_seed` is used. `COCOTB_HDL_TIMEUNIT`[¶](https://docs.cocotb.org/en/v1.3.1/building.html#var-COCOTB_HDL_TIMEUNIT "Permalink to this definition") The default time unit that should be assumed for simulation when not specified by modules in the design. If this isn’t specified then it is assumed to be `1ns`. Allowed values are 1, 10, and 100. Allowed units are `s`, `ms`, `us`, `ns`, `ps`, `fs`. New in version 1.3. `COCOTB_HDL_TIMEPRECISION`[¶](https://docs.cocotb.org/en/v1.3.1/building.html#var-COCOTB_HDL_TIMEPRECISION "Permalink to this definition") The default time precision that should be assumed for simulation when not specified by modules in the design. If this isn’t specified then it is assumed to be `1ps`. Allowed values are 1, 10, and 100. Allowed units are `s`, `ms`, `us`, `ns`, `ps`, `fs`. New in version 1.3. `CUSTOM_COMPILE_DEPS`[¶](https://docs.cocotb.org/en/v1.3.1/building.html#var-CUSTOM_COMPILE_DEPS "Permalink to this definition") Use to add additional dependencies to the compilation target; useful for defining additional rules to run pre-compilation or if the compilation phase depends on files other than the RTL sources listed in [`VERILOG_SOURCES`](https://docs.cocotb.org/en/v1.3.1/building.html#var-VERILOG_SOURCES) or [`VHDL_SOURCES`](https://docs.cocotb.org/en/v1.3.1/building.html#var-VHDL_SOURCES) . `CUSTOM_SIM_DEPS`[¶](https://docs.cocotb.org/en/v1.3.1/building.html#var-CUSTOM_SIM_DEPS "Permalink to this definition") Use to add additional dependencies to the simulation target. `COCOTB_NVC_TRACE`[¶](https://docs.cocotb.org/en/v1.3.1/building.html#var-COCOTB_NVC_TRACE "Permalink to this definition") Set this to 1 to enable display of VHPI traces when using the NVC VHDL simulator. `SIM_BUILD`[¶](https://docs.cocotb.org/en/v1.3.1/building.html#var-SIM_BUILD "Permalink to this definition") Use to define a scratch directory for use by the simulator. The path is relative to the Makefile location. If not provided, the default scratch directory is `sim_build`. Environment Variables[¶](https://docs.cocotb.org/en/v1.3.1/building.html#environment-variables "Permalink to this headline") ----------------------------------------------------------------------------------------------------------------------------- `TOPLEVEL`[¶](https://docs.cocotb.org/en/v1.3.1/building.html#envvar-TOPLEVEL "Permalink to this definition") Use this to indicate the instance in the hierarchy to use as the DUT. If this isn’t defined then the first root instance is used. `RANDOM_SEED`[¶](https://docs.cocotb.org/en/v1.3.1/building.html#envvar-RANDOM_SEED "Permalink to this definition") Seed the Python random module to recreate a previous test stimulus. At the beginning of every test a message is displayed with the seed used for that execution: INFO cocotb.gpi \_\_init\_\_.py:89 in \_initialise\_testbench Seeding Python random module with 1377424946 To recreate the same stimuli use the following: make RANDOM\_SEED\=1377424946 See also: `PLUSARGS` `COCOTB_ANSI_OUTPUT`[¶](https://docs.cocotb.org/en/v1.3.1/building.html#envvar-COCOTB_ANSI_OUTPUT "Permalink to this definition") Use this to override the default behavior of annotating cocotb output with ANSI color codes if the output is a terminal (`isatty()`). `COCOTB_ANSI_OUTPUT=1` forces output to be ANSI regardless of the type of `stdout` `COCOTB_ANSI_OUTPUT=0` suppresses the ANSI output in the log messages `COCOTB_REDUCED_LOG_FMT`[¶](https://docs.cocotb.org/en/v1.3.1/building.html#envvar-COCOTB_REDUCED_LOG_FMT "Permalink to this definition") If defined, log lines displayed in the terminal will be shorter. It will print only time, message type (`INFO`, `WARNING`, `ERROR`, …) and the log message itself. `MODULE`[¶](https://docs.cocotb.org/en/v1.3.1/building.html#envvar-MODULE "Permalink to this definition") The name of the module(s) to search for test functions. Multiple modules can be specified using a comma-separated list. `TESTCASE`[¶](https://docs.cocotb.org/en/v1.3.1/building.html#envvar-TESTCASE "Permalink to this definition") The name of the test function(s) to run. If this variable is not defined cocotb discovers and executes all functions decorated with the [`cocotb.test`](https://docs.cocotb.org/en/v1.3.1/library_reference.html#cocotb.test "cocotb.test") decorator in the supplied [`MODULE`](https://docs.cocotb.org/en/v1.3.1/building.html#envvar-MODULE) list. Multiple test functions can be specified using a comma-separated list. `COCOTB_RESULTS_FILE`[¶](https://docs.cocotb.org/en/v1.3.1/building.html#envvar-COCOTB_RESULTS_FILE "Permalink to this definition") The file name where xUnit XML tests results are stored. If not provided, the default is `results.xml`. New in version 1.3. ### Additional Environment Variables[¶](https://docs.cocotb.org/en/v1.3.1/building.html#additional-environment-variables "Permalink to this headline") `COCOTB_ATTACH`[¶](https://docs.cocotb.org/en/v1.3.1/building.html#envvar-COCOTB_ATTACH "Permalink to this definition") In order to give yourself time to attach a debugger to the simulator process before it starts to run, you can set the environment variable [`COCOTB_ATTACH`](https://docs.cocotb.org/en/v1.3.1/building.html#envvar-COCOTB_ATTACH) to a pause time value in seconds. If set, cocotb will print the process ID (PID) to attach to and wait the specified time before actually letting the simulator run. `COCOTB_ENABLE_PROFILING`[¶](https://docs.cocotb.org/en/v1.3.1/building.html#envvar-COCOTB_ENABLE_PROFILING "Permalink to this definition") Enable performance analysis of the Python portion of cocotb. When set, a file `test_profile.pstat` will be written which contains statistics about the cumulative time spent in the functions. From this, a callgraph diagram can be generated with [gprof2dot](https://github.com/jrfonseca/gprof2dot) and `graphviz`. See the `profile` Make target in the `endian_swapper` example on how to set this up. `COCOTB_HOOKS`[¶](https://docs.cocotb.org/en/v1.3.1/building.html#envvar-COCOTB_HOOKS "Permalink to this definition") A comma-separated list of modules that should be executed before the first test. You can also use the [`cocotb.hook`](https://docs.cocotb.org/en/v1.3.1/library_reference.html#cocotb.hook "cocotb.hook") decorator to mark a function to be run before test code. `COCOTB_LOG_LEVEL`[¶](https://docs.cocotb.org/en/v1.3.1/building.html#envvar-COCOTB_LOG_LEVEL "Permalink to this definition") The default logging level to use. This is set to `INFO` unless overridden. Valid values are `DEBUG`, `INFO`, `WARNING`, `ERROR`, `CRITICAL`. `COCOTB_RESOLVE_X`[¶](https://docs.cocotb.org/en/v1.3.1/building.html#envvar-COCOTB_RESOLVE_X "Permalink to this definition") Defines how to resolve bits with a value of `X`, `Z`, `U` or `W` when being converted to integer. Valid settings are: `VALUE_ERROR` raise a [`ValueError`](https://docs.python.org/3/library/exceptions.html#ValueError "(in Python v3.8)") exception `ZEROS` resolve to `0` `ONES` resolve to `1` `RANDOM` randomly resolve to a `0` or a `1` Set to `VALUE_ERROR` by default. `COCOTB_SCHEDULER_DEBUG`[¶](https://docs.cocotb.org/en/v1.3.1/building.html#envvar-COCOTB_SCHEDULER_DEBUG "Permalink to this definition") Enable additional log output of the coroutine scheduler. `COVERAGE`[¶](https://docs.cocotb.org/en/v1.3.1/building.html#envvar-COVERAGE "Permalink to this definition") Enable to report Python coverage data. For some simulators, this will also report HDL coverage. This needs the `coverage` Python module to be installed. `MEMCHECK`[¶](https://docs.cocotb.org/en/v1.3.1/building.html#envvar-MEMCHECK "Permalink to this definition") HTTP port to use for debugging Python’s memory usage. When set to e.g. `8088`, data will be presented at [http://localhost:8088](http://localhost:8088/) . This needs the `cherrypy` and `dowser` Python modules installed. `COCOTB_PY_DIR`[¶](https://docs.cocotb.org/en/v1.3.1/building.html#envvar-COCOTB_PY_DIR "Permalink to this definition") Path to the directory containing the cocotb Python package in the `cocotb` subdirectory. You don’t normally need to modify this. `COCOTB_SHARE_DIR`[¶](https://docs.cocotb.org/en/v1.3.1/building.html#envvar-COCOTB_SHARE_DIR "Permalink to this definition") Path to the directory containing the cocotb Makefiles and simulator libraries in the subdirectories `lib`, `include`, and `makefiles`. You don’t normally need to modify this. --- # Quickstart Guide — cocotb 1.1 documentation * [Docs](https://docs.cocotb.org/en/v1.2.0/index.html) » * Quickstart Guide * [Edit on GitHub](https://github.com/cocotb/cocotb/blob/v1.2.0/documentation/source/quickstart.rst) * * * Quickstart Guide[¶](https://docs.cocotb.org/en/v1.2.0/quickstart.html#quickstart-guide "Permalink to this headline") ===================================================================================================================== Installing cocotb[¶](https://docs.cocotb.org/en/v1.2.0/quickstart.html#installing-cocotb "Permalink to this headline") ----------------------------------------------------------------------------------------------------------------------- ### Pre-requisites[¶](https://docs.cocotb.org/en/v1.2.0/quickstart.html#pre-requisites "Permalink to this headline") Cocotb has the following requirements: * Python 2.7+ * Python-dev packages * GCC and associated development packages * GNU Make * A Verilog or VHDL simulator, depending on your source RTL code Internal development is performed on Linux Mint 17 (x64). We also use RedHat 6.5(x64). Other RedHat and Ubuntu based distributions (x32 and x64) should work too but due fragmented nature of Linux we can not test everything. Instructions are provided for the main distributions we use. ### Linux native arch installation[¶](https://docs.cocotb.org/en/v1.2.0/quickstart.html#linux-native-arch-installation "Permalink to this headline") Ubuntu based installation $> sudo apt-get install git make gcc g++ swig python-dev This will allow building of the cocotb libs for use with a 64-bit native simulator. If a 32-bit simulator is being used then additional steps to install 32-bit development libraries and Python are needed. RedHat based installation $> sudo yum install gcc gcc-c++ libstdc++-devel swig python-devel This will allow building of the cocotb libs for use with a 64-bit native simulator. If a 32-bit simulator is being used then additional steps to install 32-bit development libraries and Python are needed. ### 32-bit Python[¶](https://docs.cocotb.org/en/v1.2.0/quickstart.html#bit-python "Permalink to this headline") Additional development libraries are needed for building 32-bit Python on 64-bit systems. Ubuntu based installation $> sudo apt-get install libx32gcc1 gcc-4.8-multilib lib32stdc++-4.8-dev Replace 4.8 with the version of GCC that was installed on the system in the step above. Unlike on RedHat where 32-bit Python can co-exist with native Python, Ubuntu requires the source to be downloaded and built. RedHat based installation $> sudo yum install glibc.i686 glibc-devel.i386 libgcc.i686 libstdc++-devel.i686 Specific releases can be downloaded from [https://www.python.org/downloads/](https://www.python.org/downloads/) . $> wget https://www.python.org/ftp/python/2.7.9/Python-2.7.9.tgz $> tar xvf Python-2.7.9.tgz $> cd Python-2.7.9 $> export PY32\_DIR\=/opt/pym32 $> ./configure CC\="gcc -m32" LDFLAGS\="-L/lib32 -L/usr/lib32 -Lpwd/lib32 -Wl,-rpath,/lib32 -Wl,-rpath,$PY32\_DIR/lib" --prefix\=$PY32\_DIR --enable-shared $> make $> sudo make install Cocotb can now be built against 32-bit Python by setting the architecture and placing the 32-bit Python ahead of the native version in the path when running a test. $> export PATH\=/opt/pym32/bin $> cd $> ARCH\=i686 make ### Windows 7 installation[¶](https://docs.cocotb.org/en/v1.2.0/quickstart.html#windows-7-installation "Permalink to this headline") Work has been done with the support of the cocotb community to enable Windows support using the MinGW/Msys environment. Download the MinGQ installer from. [https://sourceforge.net/projects/mingw/files/latest/download?source=files](https://sourceforge.net/projects/mingw/files/latest/download?source=files) . Run the GUI installer and specify a directory you would like the environment installed in. The installer will retrieve a list of possible packages, when this is done press continue. The MinGW Installation Manager is then launched. The following packages need selecting by checking the tick box and selecting “Mark for installation” Basic Installation -- mingw-developer-tools -- mingw32-base -- mingw32-gcc-g++ -- msys-base From the Installation menu then select “Apply Changes”, in the next dialog select “Apply”. When installed a shell can be opened using the “msys.bat” file located under the /msys/1.0/ Python can be downloaded from [https://www.python.org/ftp/python/2.7.9/python-2.7.9.msi](https://www.python.org/ftp/python/2.7.9/python-2.7.9.msi) , other versions of Python can be used as well. Run the installer and download to your chosen location. It is beneficial to add the path to Python to the Windows system `PATH` variable so it can be used easily from inside Msys. Once inside the Msys shell commands as given here will work as expected. ### macOS Packages[¶](https://docs.cocotb.org/en/v1.2.0/quickstart.html#macos-packages "Permalink to this headline") You need a few packages installed to get cocotb running on macOS. Installing a package manager really helps things out here. [Brew](https://brew.sh/) seems to be the most popular, so we’ll assume you have that installed. $> brew install python icarus-verilog gtkwave Installing cocotb[¶](https://docs.cocotb.org/en/v1.2.0/quickstart.html#id1 "Permalink to this headline") --------------------------------------------------------------------------------------------------------- Cocotb can be installed by running (recommended Python3) $> pip3 install cocotb or $> pip install cocotb _\*For user local install follow_ [pip User Guide](https://https//pip.pypa.io/en/stable/user_guide/#user-installs/) . For development version: $> git clone https://github.com/cocotb/cocotb $> pip install -e ./cocotb ### Running an example[¶](https://docs.cocotb.org/en/v1.2.0/quickstart.html#running-an-example "Permalink to this headline") $> git clone https://github.com/cocotb/cocotb $> cd cocotb/examples/endian\_swapper/tests $> make To run a test using a different simulator: $> make SIM\=vcs ### Running a VHDL example[¶](https://docs.cocotb.org/en/v1.2.0/quickstart.html#running-a-vhdl-example "Permalink to this headline") The `endian_swapper` example includes both a VHDL and a Verilog RTL implementation. The cocotb testbench can execute against either implementation using VPI for Verilog and VHPI/FLI for VHDL. To run the test suite against the VHDL implementation use the following command (a VHPI or FLI capable simulator must be used): $> make SIM\=ghdl TOPLEVEL\_LANG\=vhdl Using cocotb[¶](https://docs.cocotb.org/en/v1.2.0/quickstart.html#using-cocotb "Permalink to this headline") ------------------------------------------------------------------------------------------------------------- A typical cocotb testbench requires no additional RTL code. The Design Under Test (DUT) is instantiated as the toplevel in the simulator without any wrapper code. Cocotb drives stimulus onto the inputs to the DUT and monitors the outputs directly from Python. ### Creating a Makefile[¶](https://docs.cocotb.org/en/v1.2.0/quickstart.html#creating-a-makefile "Permalink to this headline") To create a cocotb test we typically have to create a Makefile. Cocotb provides rules which make it easy to get started. We simply inform cocotb of the source files we need compiling, the toplevel entity to instantiate and the Python test script to load. VERILOG\_SOURCES \= $(PWD)/submodule.sv $(PWD)/my\_design.sv TOPLEVEL\=my\_design \# the module name in your Verilog or VHDL file MODULE\=test\_my\_design \# the name of the Python test file include $(shell cocotb-config --makefiles)/Makefile.inc include $(shell cocotb-config --makefiles)/Makefile.sim We would then create a file called `test_my_design.py` containing our tests. ### Creating a test[¶](https://docs.cocotb.org/en/v1.2.0/quickstart.html#creating-a-test "Permalink to this headline") The test is written in Python. Cocotb wraps your top level with the handle you pass it. In this documentation, and most of the examples in the project, that handle is `dut`, but you can pass your own preferred name in instead. The handle is used in all Python files referencing your RTL project. Assuming we have a toplevel port called `clk` we could create a test file containing the following: import cocotb from cocotb.triggers import Timer @cocotb.test() def my\_first\_test(dut): """Try accessing the design.""" dut.\_log.info("Running test!") for cycle in range(10): dut.clk \= 0 yield Timer(1000) dut.clk \= 1 yield Timer(1000) dut.\_log.info("Running test!") This will drive a square wave clock onto the `clk` port of the toplevel. ### Accessing the design[¶](https://docs.cocotb.org/en/v1.2.0/quickstart.html#accessing-the-design "Permalink to this headline") When cocotb initialises it finds the top-level instantiation in the simulator and creates a handle called `dut`. Top-level signals can be accessed using the “dot” notation used for accessing object attributes in Python. The same mechanism can be used to access signals inside the design. \# Get a reference to the "clk" signal on the top-level clk \= dut.clk \# Get a reference to a register "count" \# in a sub-block "inst\_sub\_block" count \= dut.inst\_sub\_block.count ### Assigning values to signals[¶](https://docs.cocotb.org/en/v1.2.0/quickstart.html#assigning-values-to-signals "Permalink to this headline") Values can be assigned to signals using either the [`value`](https://docs.cocotb.org/en/v1.2.0/library_reference.html#cocotb.handle.NonHierarchyObject.value "cocotb.handle.NonHierarchyObject.value") property of a handle object or using direct assignment while traversing the hierarchy. \# Get a reference to the "clk" signal and assign a value clk \= dut.clk clk.value \= 1 \# Direct assignment through the hierarchy dut.input\_signal <= 12 \# Assign a value to a memory deep in the hierarchy dut.sub\_block.memory.array\[4\] <= 2 The syntax `sig <= new_value` is a short form of `sig.value = new_value`. It not only resembles HDL-syntax, but also has the same semantics: writes are not applied immediately, but delayed until the next write cycle. Use `sig.setimmediatevalue(new_val)` to set a new value immediately (see [`setimmediatevalue()`](https://docs.cocotb.org/en/v1.2.0/library_reference.html#cocotb.handle.ModifiableObject.setimmediatevalue "cocotb.handle.ModifiableObject.setimmediatevalue") ). ### Reading values from signals[¶](https://docs.cocotb.org/en/v1.2.0/quickstart.html#reading-values-from-signals "Permalink to this headline") Accessing the [`value`](https://docs.cocotb.org/en/v1.2.0/library_reference.html#cocotb.handle.NonHierarchyObject.value "cocotb.handle.NonHierarchyObject.value") property of a handle object will return a [`BinaryValue`](https://docs.cocotb.org/en/v1.2.0/library_reference.html#cocotb.binary.BinaryValue "cocotb.binary.BinaryValue") object. Any unresolved bits are preserved and can be accessed using the [`binstr`](https://docs.cocotb.org/en/v1.2.0/library_reference.html#cocotb.binary.BinaryValue.binstr "cocotb.binary.BinaryValue.binstr") attribute, or a resolved integer value can be accessed using the [`integer`](https://docs.cocotb.org/en/v1.2.0/library_reference.html#cocotb.binary.BinaryValue.integer "cocotb.binary.BinaryValue.integer") attribute. \>>> \# Read a value back from the DUT \>>> count \= dut.counter.value \>>> \>>> print(count.binstr) 1X1010 \>>> \# Resolve the value to an integer (X or Z treated as 0) \>>> print(count.integer) 42 \>>> \# Show number of bits in a value \>>> print(count.n\_bits) 6 We can also cast the signal handle directly to an integer: \>>> print(int(dut.counter)) 42 ### Parallel and sequential execution of coroutines[¶](https://docs.cocotb.org/en/v1.2.0/quickstart.html#parallel-and-sequential-execution-of-coroutines "Permalink to this headline") @cocotb.coroutine def reset\_dut(reset\_n, duration): reset\_n <= 0 yield Timer(duration) reset\_n <= 1 reset\_n.\_log.debug("Reset complete") @cocotb.test() def parallel\_example(dut): reset\_n \= dut.reset \# This will call reset\_dut sequentially \# Execution will block until reset\_dut has completed yield reset\_dut(reset\_n, 500) dut.\_log.debug("After reset") \# Call reset\_dut in parallel with this coroutine reset\_thread \= cocotb.fork(reset\_dut(reset\_n, 500) yield Timer(250) dut.\_log.debug("During reset (reset\_n = %s)" % reset\_n.value) \# Wait for the other thread to complete yield reset\_thread.join() dut.\_log.debug("After reset") --- # Build options and Environment Variables — cocotb 1.3.0 documentation * [Docs](https://docs.cocotb.org/en/v1.3.0/index.html) » * Build options and Environment Variables * [Edit on GitHub](https://github.com/cocotb/cocotb/blob/v1.3.0/documentation/source/building.rst) * * * Build options and Environment Variables[¶](https://docs.cocotb.org/en/v1.3.0/building.html#build-options-and-environment-variables "Permalink to this headline") ================================================================================================================================================================= Make System[¶](https://docs.cocotb.org/en/v1.3.0/building.html#make-system "Permalink to this headline") --------------------------------------------------------------------------------------------------------- Makefiles are provided for a variety of simulators in `cocotb/share/makefiles/simulators`. The common Makefile `cocotb/share/makefiles/Makefile.sim` includes the appropriate simulator Makefile based on the contents of the `SIM` variable. ### Make Targets[¶](https://docs.cocotb.org/en/v1.3.0/building.html#make-targets "Permalink to this headline") Makefiles define two targets, `regression` and `sim`, the default target is `sim`. Both rules create a results file with the name taken from [`COCOTB_RESULTS_FILE`](https://docs.cocotb.org/en/v1.3.0/building.html#envvar-COCOTB_RESULTS_FILE) , defaulting to `results.xml`. This file is a JUnit-compatible output file suitable for use with [Jenkins](https://jenkins.io/) . The `sim` targets unconditionally re-runs the simulator whereas the `regression` target only re-builds if any dependencies have changed. ### Make Phases[¶](https://docs.cocotb.org/en/v1.3.0/building.html#make-phases "Permalink to this headline") Typically the makefiles provided with cocotb for various simulators use a separate `compile` and `run` target. This allows for a rapid re-running of a simulator if none of the RTL source files have changed and therefore the simulator does not need to recompile the RTL. ### Make Variables[¶](https://docs.cocotb.org/en/v1.3.0/building.html#make-variables "Permalink to this headline") `GUI`[¶](https://docs.cocotb.org/en/v1.3.0/building.html#var-GUI "Permalink to this definition") Set this to 1 to enable the GUI mode in the simulator (if supported). `SIM`[¶](https://docs.cocotb.org/en/v1.3.0/building.html#var-SIM "Permalink to this definition") Selects which simulator Makefile to use. Attempts to include a simulator specific makefile from `cocotb/share/makefiles/makefile.$(SIM)` `WAVES`[¶](https://docs.cocotb.org/en/v1.3.0/building.html#var-WAVES "Permalink to this definition") Set this to 1 to enable wave traces dump for the Aldec Riviera-PRO and Mentor Graphics Questa simulators. To get wave traces in Icarus Verilog see [Simulator Support](https://docs.cocotb.org/en/v1.3.0/simulator_support.html#simulator-support) . `VERILOG_SOURCES`[¶](https://docs.cocotb.org/en/v1.3.0/building.html#var-VERILOG_SOURCES "Permalink to this definition") A list of the Verilog source files to include. `VHDL_SOURCES`[¶](https://docs.cocotb.org/en/v1.3.0/building.html#var-VHDL_SOURCES "Permalink to this definition") A list of the VHDL source files to include. `VHDL_SOURCES_`[¶](https://docs.cocotb.org/en/v1.3.0/building.html#var-VHDL_SOURCES_%3Clib%3E "Permalink to this definition") A list of the VHDL source files to include in the VHDL library _lib_ (currently for the GHDL simulator only). `COMPILE_ARGS`[¶](https://docs.cocotb.org/en/v1.3.0/building.html#var-COMPILE_ARGS "Permalink to this definition") Any arguments or flags to pass to the compile stage of the simulation. `SIM_ARGS`[¶](https://docs.cocotb.org/en/v1.3.0/building.html#var-SIM_ARGS "Permalink to this definition") Any arguments or flags to pass to the execution of the compiled simulation. `EXTRA_ARGS`[¶](https://docs.cocotb.org/en/v1.3.0/building.html#var-EXTRA_ARGS "Permalink to this definition") Passed to both the compile and execute phases of simulators with two rules, or passed to the single compile and run command for simulators which don’t have a distinct compilation stage. `PLUSARGS`[¶](https://docs.cocotb.org/en/v1.3.0/building.html#var-PLUSARGS "Permalink to this definition") “Plusargs” are options that are starting with a plus (`+`) sign. They are passed to the simulator and are also available within cocotb as [`cocotb.plusargs`](https://docs.cocotb.org/en/v1.3.0/library_reference.html#cocotb.plusargs "cocotb.plusargs") . In the simulator, they can be read by the Verilog/SystemVerilog system functions `$test$plusargs` and `$value$plusargs`. The special plusargs `+ntb_random_seed` and `+seed`, if present, are evaluated to set the random seed value if [`RANDOM_SEED`](https://docs.cocotb.org/en/v1.3.0/building.html#envvar-RANDOM_SEED) is not set. If both `+ntb_random_seed` and `+seed` are set, `+ntb_random_seed` is used. `COCOTB_HDL_TIMEUNIT`[¶](https://docs.cocotb.org/en/v1.3.0/building.html#var-COCOTB_HDL_TIMEUNIT "Permalink to this definition") The default time unit that should be assumed for simulation when not specified by modules in the design. If this isn’t specified then it is assumed to be `1ns`. Allowed values are 1, 10, and 100. Allowed units are `s`, `ms`, `us`, `ns`, `ps`, `fs`. New in version 1.3. `COCOTB_HDL_TIMEPRECISION`[¶](https://docs.cocotb.org/en/v1.3.0/building.html#var-COCOTB_HDL_TIMEPRECISION "Permalink to this definition") The default time precision that should be assumed for simulation when not specified by modules in the design. If this isn’t specified then it is assumed to be `1ps`. Allowed values are 1, 10, and 100. Allowed units are `s`, `ms`, `us`, `ns`, `ps`, `fs`. New in version 1.3. `CUSTOM_COMPILE_DEPS`[¶](https://docs.cocotb.org/en/v1.3.0/building.html#var-CUSTOM_COMPILE_DEPS "Permalink to this definition") Use to add additional dependencies to the compilation target; useful for defining additional rules to run pre-compilation or if the compilation phase depends on files other than the RTL sources listed in [`VERILOG_SOURCES`](https://docs.cocotb.org/en/v1.3.0/building.html#var-VERILOG_SOURCES) or [`VHDL_SOURCES`](https://docs.cocotb.org/en/v1.3.0/building.html#var-VHDL_SOURCES) . `CUSTOM_SIM_DEPS`[¶](https://docs.cocotb.org/en/v1.3.0/building.html#var-CUSTOM_SIM_DEPS "Permalink to this definition") Use to add additional dependencies to the simulation target. `COCOTB_NVC_TRACE`[¶](https://docs.cocotb.org/en/v1.3.0/building.html#var-COCOTB_NVC_TRACE "Permalink to this definition") Set this to 1 to enable display of VHPI traces when using the NVC VHDL simulator. `SIM_BUILD`[¶](https://docs.cocotb.org/en/v1.3.0/building.html#var-SIM_BUILD "Permalink to this definition") Use to define a scratch directory for use by the simulator. The path is relative to the Makefile location. If not provided, the default scratch directory is `sim_build`. Environment Variables[¶](https://docs.cocotb.org/en/v1.3.0/building.html#environment-variables "Permalink to this headline") ----------------------------------------------------------------------------------------------------------------------------- `TOPLEVEL`[¶](https://docs.cocotb.org/en/v1.3.0/building.html#envvar-TOPLEVEL "Permalink to this definition") Use this to indicate the instance in the hierarchy to use as the DUT. If this isn’t defined then the first root instance is used. `RANDOM_SEED`[¶](https://docs.cocotb.org/en/v1.3.0/building.html#envvar-RANDOM_SEED "Permalink to this definition") Seed the Python random module to recreate a previous test stimulus. At the beginning of every test a message is displayed with the seed used for that execution: INFO cocotb.gpi \_\_init\_\_.py:89 in \_initialise\_testbench Seeding Python random module with 1377424946 To recreate the same stimuli use the following: make RANDOM\_SEED\=1377424946 See also: `PLUSARGS` `COCOTB_ANSI_OUTPUT`[¶](https://docs.cocotb.org/en/v1.3.0/building.html#envvar-COCOTB_ANSI_OUTPUT "Permalink to this definition") Use this to override the default behavior of annotating cocotb output with ANSI color codes if the output is a terminal (`isatty()`). `COCOTB_ANSI_OUTPUT=1` forces output to be ANSI regardless of the type of `stdout` `COCOTB_ANSI_OUTPUT=0` suppresses the ANSI output in the log messages `COCOTB_REDUCED_LOG_FMT`[¶](https://docs.cocotb.org/en/v1.3.0/building.html#envvar-COCOTB_REDUCED_LOG_FMT "Permalink to this definition") If defined, log lines displayed in the terminal will be shorter. It will print only time, message type (`INFO`, `WARNING`, `ERROR`, …) and the log message itself. `MODULE`[¶](https://docs.cocotb.org/en/v1.3.0/building.html#envvar-MODULE "Permalink to this definition") The name of the module(s) to search for test functions. Multiple modules can be specified using a comma-separated list. `TESTCASE`[¶](https://docs.cocotb.org/en/v1.3.0/building.html#envvar-TESTCASE "Permalink to this definition") The name of the test function(s) to run. If this variable is not defined cocotb discovers and executes all functions decorated with the [`cocotb.test`](https://docs.cocotb.org/en/v1.3.0/library_reference.html#cocotb.test "cocotb.test") decorator in the supplied [`MODULE`](https://docs.cocotb.org/en/v1.3.0/building.html#envvar-MODULE) list. Multiple test functions can be specified using a comma-separated list. `COCOTB_RESULTS_FILE`[¶](https://docs.cocotb.org/en/v1.3.0/building.html#envvar-COCOTB_RESULTS_FILE "Permalink to this definition") The file name where xUnit XML tests results are stored. If not provided, the default is `results.xml`. New in version 1.3. ### Additional Environment Variables[¶](https://docs.cocotb.org/en/v1.3.0/building.html#additional-environment-variables "Permalink to this headline") `COCOTB_ATTACH`[¶](https://docs.cocotb.org/en/v1.3.0/building.html#envvar-COCOTB_ATTACH "Permalink to this definition") In order to give yourself time to attach a debugger to the simulator process before it starts to run, you can set the environment variable [`COCOTB_ATTACH`](https://docs.cocotb.org/en/v1.3.0/building.html#envvar-COCOTB_ATTACH) to a pause time value in seconds. If set, cocotb will print the process ID (PID) to attach to and wait the specified time before actually letting the simulator run. `COCOTB_ENABLE_PROFILING`[¶](https://docs.cocotb.org/en/v1.3.0/building.html#envvar-COCOTB_ENABLE_PROFILING "Permalink to this definition") Enable performance analysis of the Python portion of cocotb. When set, a file `test_profile.pstat` will be written which contains statistics about the cumulative time spent in the functions. From this, a callgraph diagram can be generated with [gprof2dot](https://github.com/jrfonseca/gprof2dot) and `graphviz`. See the `profile` Make target in the `endian_swapper` example on how to set this up. `COCOTB_HOOKS`[¶](https://docs.cocotb.org/en/v1.3.0/building.html#envvar-COCOTB_HOOKS "Permalink to this definition") A comma-separated list of modules that should be executed before the first test. You can also use the [`cocotb.hook`](https://docs.cocotb.org/en/v1.3.0/library_reference.html#cocotb.hook "cocotb.hook") decorator to mark a function to be run before test code. `COCOTB_LOG_LEVEL`[¶](https://docs.cocotb.org/en/v1.3.0/building.html#envvar-COCOTB_LOG_LEVEL "Permalink to this definition") The default logging level to use. This is set to `INFO` unless overridden. Valid values are `DEBUG`, `INFO`, `WARNING`, `ERROR`, `CRITICAL`. `COCOTB_RESOLVE_X`[¶](https://docs.cocotb.org/en/v1.3.0/building.html#envvar-COCOTB_RESOLVE_X "Permalink to this definition") Defines how to resolve bits with a value of `X`, `Z`, `U` or `W` when being converted to integer. Valid settings are: `VALUE_ERROR` raise a [`ValueError`](https://docs.python.org/3/library/exceptions.html#ValueError "(in Python v3.8)") exception `ZEROS` resolve to `0` `ONES` resolve to `1` `RANDOM` randomly resolve to a `0` or a `1` Set to `VALUE_ERROR` by default. `COCOTB_SCHEDULER_DEBUG`[¶](https://docs.cocotb.org/en/v1.3.0/building.html#envvar-COCOTB_SCHEDULER_DEBUG "Permalink to this definition") Enable additional log output of the coroutine scheduler. `COVERAGE`[¶](https://docs.cocotb.org/en/v1.3.0/building.html#envvar-COVERAGE "Permalink to this definition") Enable to report Python coverage data. For some simulators, this will also report HDL coverage. This needs the `coverage` Python module to be installed. `MEMCHECK`[¶](https://docs.cocotb.org/en/v1.3.0/building.html#envvar-MEMCHECK "Permalink to this definition") HTTP port to use for debugging Python’s memory usage. When set to e.g. `8088`, data will be presented at [http://localhost:8088](http://localhost:8088/) . This needs the `cherrypy` and `dowser` Python modules installed. `COCOTB_PY_DIR`[¶](https://docs.cocotb.org/en/v1.3.0/building.html#envvar-COCOTB_PY_DIR "Permalink to this definition") Path to the directory containing the cocotb Python package in the `cocotb` subdirectory. You don’t normally need to modify this. `COCOTB_SHARE_DIR`[¶](https://docs.cocotb.org/en/v1.3.0/building.html#envvar-COCOTB_SHARE_DIR "Permalink to this definition") Path to the directory containing the cocotb Makefiles and simulator libraries in the subdirectories `lib`, `include`, and `makefiles`. You don’t normally need to modify this. --- # Contributors — cocotb 1.6.0.dev0+gec99a877.d20210503 documentation * [](https://docs.cocotb.org/en/v1.5.2/index.html) » * Contributors * [Edit on GitHub](https://github.com/cocotb/cocotb/blob/v1.5.2/documentation/source/contributors.rst) * * * Contributors[¶](https://docs.cocotb.org/en/v1.5.2/contributors.html#contributors "Permalink to this headline") =============================================================================================================== cocotb is developed and maintained by an active community. Our GitHub repository contains a list of all [contributors](https://github.com/cocotb/cocotb/graphs/contributors) . Since mid-2018 cocotb is an independent project under the umbrella of the [Free and Open Source Silicon Foundation](https://www.fossi-foundation.org/) . The FOSSi Foundation provides the cocotb project with financial, legal and administrative support, and holds cocotb assets. cocotb was originally developed by Stuart Hodgson and Chris Higgs of Potential Ventures with the support of Solarflare Communications Ltd. and contributions from Gordon McGregor and Finn Grimwood. --- # Python Module Index — cocotb 1.1 documentation * [Docs](https://docs.cocotb.org/en/v1.1/index.html) » * Python Module Index * * * Python Module Index =================== [**c**](https://docs.cocotb.org/en/v1.1/py-modindex.html#cap-c) | | | | | --- | --- | --- | | | | | | | **c** | | | ![-](https://docs.cocotb.org/en/v1.1/_static/minus.png) | `cocotb` | | | | [`cocotb.handle`](https://docs.cocotb.org/en/v1.1/library_reference.html#module-cocotb.handle) | _Classes for simulation objects._ | | | [`cocotb.result`](https://docs.cocotb.org/en/v1.1/library_reference.html#module-cocotb.result) | _Exceptions and functions for simulation result handling._ | | | [`cocotb.scoreboard`](https://docs.cocotb.org/en/v1.1/library_reference.html#module-cocotb.scoreboard) | _Class for scoreboards._ | | | [`cocotb.utils`](https://docs.cocotb.org/en/v1.1/library_reference.html#module-cocotb.utils) | _Various utilities for testbench writers._ | --- # Build options and Environment Variables — cocotb 1.1 documentation * [Docs](https://docs.cocotb.org/en/v1.2.0/index.html) » * Build options and Environment Variables * [Edit on GitHub](https://github.com/cocotb/cocotb/blob/v1.2.0/documentation/source/building.rst) * * * Build options and Environment Variables[¶](https://docs.cocotb.org/en/v1.2.0/building.html#build-options-and-environment-variables "Permalink to this headline") ================================================================================================================================================================= Make System[¶](https://docs.cocotb.org/en/v1.2.0/building.html#make-system "Permalink to this headline") --------------------------------------------------------------------------------------------------------- Makefiles are provided for a variety of simulators in `cocotb/makefiles/simulators`. The common Makefile `cocotb/makefiles/Makefile.sim` includes the appropriate simulator Makefile based on the contents of the `SIM` variable. ### Make Targets[¶](https://docs.cocotb.org/en/v1.2.0/building.html#make-targets "Permalink to this headline") Makefiles define two targets, `regression` and `sim`, the default target is `sim`. Both rules create a results file in the calling directory called `results.xml`. This file is a JUnit-compatible output file suitable for use with [Jenkins](https://jenkins.io/) . The `sim` targets unconditionally re-runs the simulator whereas the `regression` target only re-builds if any dependencies have changed. ### Make Phases[¶](https://docs.cocotb.org/en/v1.2.0/building.html#make-phases "Permalink to this headline") Typically the makefiles provided with Cocotb for various simulators use a separate `compile` and `run` target. This allows for a rapid re-running of a simulator if none of the RTL source files have changed and therefore the simulator does not need to recompile the RTL. ### Make Variables[¶](https://docs.cocotb.org/en/v1.2.0/building.html#make-variables "Permalink to this headline") `GUI` Set this to 1 to enable the GUI mode in the simulator (if supported). `SIM` Selects which simulator Makefile to use. Attempts to include a simulator specific makefile from `cocotb/makefiles/makefile.$(SIM)` `VERILOG_SOURCES` A list of the Verilog source files to include. `VHDL_SOURCES` A list of the VHDL source files to include. `VHDL_SOURCES_lib` A list of the VHDL source files to include in the VHDL library _lib_ (currently GHDL only). `COMPILE_ARGS` Any arguments or flags to pass to the compile stage of the simulation. `SIM_ARGS` Any arguments or flags to pass to the execution of the compiled simulation. `EXTRA_ARGS` Passed to both the compile and execute phases of simulators with two rules, or passed to the single compile and run command for simulators which don’t have a distinct compilation stage. `CUSTOM_COMPILE_DEPS` Use to add additional dependencies to the compilation target; useful for defining additional rules to run pre-compilation or if the compilation phase depends on files other than the RTL sources listed in [VERILOG\_SOURCES](https://docs.cocotb.org/en/v1.2.0/building.html#term-verilog-sources) or [VHDL\_SOURCES](https://docs.cocotb.org/en/v1.2.0/building.html#term-vhdl-sources) . `CUSTOM_SIM_DEPS` Use to add additional dependencies to the simulation target. `COCOTB_NVC_TRACE` Set this to 1 to enable display of VHPI traces when using the nvc VHDL simulator. `SIM_BUILD` Use to define a scratch directory for use by the simulator. The path is relative to the Makefile location. If not provided, the default scratch directory is `sim_build`. Environment Variables[¶](https://docs.cocotb.org/en/v1.2.0/building.html#environment-variables "Permalink to this headline") ----------------------------------------------------------------------------------------------------------------------------- `TOPLEVEL`[¶](https://docs.cocotb.org/en/v1.2.0/building.html#envvar-TOPLEVEL "Permalink to this definition") Used to indicate the instance in the hierarchy to use as the DUT. If this isn’t defined then the first root instance is used. `RANDOM_SEED`[¶](https://docs.cocotb.org/en/v1.2.0/building.html#envvar-RANDOM_SEED "Permalink to this definition") Seed the Python random module to recreate a previous test stimulus. At the beginning of every test a message is displayed with the seed used for that execution: INFO cocotb.gpi \_\_init\_\_.py:89 in \_initialise\_testbench Seeding Python random module with 1377424946 To recreate the same stimuli use the following: make RANDOM\_SEED\=1377424946 `COCOTB_ANSI_OUTPUT`[¶](https://docs.cocotb.org/en/v1.2.0/building.html#envvar-COCOTB_ANSI_OUTPUT "Permalink to this definition") Use this to override the default behaviour of annotating Cocotb output with ANSI colour codes if the output is a terminal (`isatty()`). `COCOTB_ANSI_OUTPUT=1` forces output to be ANSI regardless of the type stdout `COCOTB_ANSI_OUTPUT=0` supresses the ANSI output in the log messages `COCOTB_REDUCED_LOG_FMT`[¶](https://docs.cocotb.org/en/v1.2.0/building.html#envvar-COCOTB_REDUCED_LOG_FMT "Permalink to this definition") If defined, log lines displayed in terminal will be shorter. It will print only time, message type (`INFO`, `WARNING`, `ERROR`) and log message. `MODULE`[¶](https://docs.cocotb.org/en/v1.2.0/building.html#envvar-MODULE "Permalink to this definition") The name of the module(s) to search for test functions. Multiple modules can be specified using a comma-separated list. `TESTCASE`[¶](https://docs.cocotb.org/en/v1.2.0/building.html#envvar-TESTCASE "Permalink to this definition") The name of the test function(s) to run. If this variable is not defined Cocotb discovers and executes all functions decorated with the [`cocotb.test`](https://docs.cocotb.org/en/v1.2.0/library_reference.html#cocotb.test "cocotb.test") decorator in the supplied modules. Multiple functions can be specified in a comma-separated list. ### Additional Environment Variables[¶](https://docs.cocotb.org/en/v1.2.0/building.html#additional-environment-variables "Permalink to this headline") `COCOTB_ATTACH`[¶](https://docs.cocotb.org/en/v1.2.0/building.html#envvar-COCOTB_ATTACH "Permalink to this definition") In order to give yourself time to attach a debugger to the simulator process before it starts to run, you can set the environment variable [`COCOTB_ATTACH`](https://docs.cocotb.org/en/v1.2.0/building.html#envvar-COCOTB_ATTACH) to a pause time value in seconds. If set, Cocotb will print the process ID (PID) to attach to and wait the specified time before actually letting the simulator run. `COCOTB_ENABLE_PROFILING`[¶](https://docs.cocotb.org/en/v1.2.0/building.html#envvar-COCOTB_ENABLE_PROFILING "Permalink to this definition") Enable performance analysis of the Python portion of Cocotb. When set, a file `test_profile.pstat` will be written which contains statistics about the cumulative time spent in the functions. From this, a callgraph diagram can be generated with [gprof2dot](https://github.com/jrfonseca/gprof2dot) and `graphviz`. See the `profile` Make target in the `endian_swapper` example on how to set this up. `COCOTB_HOOKS`[¶](https://docs.cocotb.org/en/v1.2.0/building.html#envvar-COCOTB_HOOKS "Permalink to this definition") A comma-separated list of modules that should be executed before the first test. You can also use the [`cocotb.hook`](https://docs.cocotb.org/en/v1.2.0/library_reference.html#cocotb.hook "cocotb.hook") decorator to mark a function to be run before test code. `COCOTB_LOG_LEVEL`[¶](https://docs.cocotb.org/en/v1.2.0/building.html#envvar-COCOTB_LOG_LEVEL "Permalink to this definition") Default logging level to use. This is set to `INFO` unless overridden. `COCOTB_RESOLVE_X`[¶](https://docs.cocotb.org/en/v1.2.0/building.html#envvar-COCOTB_RESOLVE_X "Permalink to this definition") Defines how to resolve bits with a value of `X`, `Z`, `U` or `W` when being converted to integer. Valid settings are: `VALUE_ERROR` raise a [`ValueError`](https://docs.python.org/3/library/exceptions.html#ValueError "(in Python v3.8)") exception `ZEROS` resolve to `0` `ONES` resolve to `1` `RANDOM` randomly resolve to a `0` or a `1` Set to `VALUE_ERROR` by default. `COCOTB_SCHEDULER_DEBUG`[¶](https://docs.cocotb.org/en/v1.2.0/building.html#envvar-COCOTB_SCHEDULER_DEBUG "Permalink to this definition") Enable additional log output of the coroutine scheduler. `COVERAGE`[¶](https://docs.cocotb.org/en/v1.2.0/building.html#envvar-COVERAGE "Permalink to this definition") Enable to report python coverage data. For some simulators, this will also report HDL coverage. This needs the `coverage` python module `MEMCHECK`[¶](https://docs.cocotb.org/en/v1.2.0/building.html#envvar-MEMCHECK "Permalink to this definition") HTTP port to use for debugging Python’s memory usage. When set to e.g. `8088`, data will be presented at [http://localhost:8088](http://localhost:8088/) . This needs the `cherrypy` and `dowser` Python modules installed. `COCOTB_PY_DIR`[¶](https://docs.cocotb.org/en/v1.2.0/building.html#envvar-COCOTB_PY_DIR "Permalink to this definition") Path to the directory containing the cocotb Python package in the `cocotb` subdirectory. `COCOTB_SHARE_DIR`[¶](https://docs.cocotb.org/en/v1.2.0/building.html#envvar-COCOTB_SHARE_DIR "Permalink to this definition") Path to the directory containing the cocotb Makefiles and simulator libraries in the subdirectories `lib`, `include`, and `makefiles`. `VERSION`[¶](https://docs.cocotb.org/en/v1.2.0/building.html#envvar-VERSION "Permalink to this definition") The version of the Cocotb installation. You probably don’t want to modify this. --- # Coroutines — cocotb 1.3.1 documentation * [Docs](https://docs.cocotb.org/en/v1.3.1/index.html) » * Coroutines * [Edit on GitHub](https://github.com/cocotb/cocotb/blob/v1.3.1/documentation/source/coroutines.rst) * * * Coroutines[¶](https://docs.cocotb.org/en/v1.3.1/coroutines.html#coroutines "Permalink to this headline") ========================================================================================================= Testbenches built using cocotb use coroutines. While the coroutine is executing the simulation is paused. The coroutine uses the [`yield`](https://docs.python.org/3/reference/simple_stmts.html#yield "(in Python v3.8)") keyword to pass control of execution back to the simulator and simulation time can advance again. Typically coroutines [`yield`](https://docs.python.org/3/reference/simple_stmts.html#yield "(in Python v3.8)") a [`Trigger`](https://docs.cocotb.org/en/v1.3.1/library_reference.html#cocotb.triggers.Trigger "cocotb.triggers.Trigger") object which indicates to the simulator some event which will cause the coroutine to be woken when it occurs. For example: @cocotb.coroutine def wait\_10ns(): cocotb.log.info("About to wait for 10 ns") yield Timer(10, units\='ns') cocotb.log.info("Simulation time has advanced by 10 ns") Coroutines may also yield other coroutines: @cocotb.coroutine def wait\_100ns(): for i in range(10): yield wait\_10ns() Coroutines can return a value, so that they can be used by other coroutines. Before Python 3.3, this requires a [`ReturnValue`](https://docs.cocotb.org/en/v1.3.1/library_reference.html#cocotb.result.ReturnValue "cocotb.result.ReturnValue") to be raised. @cocotb.coroutine def get\_signal(clk, signal): yield RisingEdge(clk) raise ReturnValue(signal.value) @cocotb.coroutine def get\_signal\_python\_33(clk, signal): \# newer versions of Python can use return normally yield RisingEdge(clk) return signal.value @cocotb.coroutine def check\_signal\_changes(dut): first \= yield get\_signal(dut.clk, dut.signal) second \= yield get\_signal(dut.clk, dut.signal) if first \== second: raise TestFailure("Signal did not change") Coroutines may also yield a list of triggers and coroutines to indicate that execution should resume if _any_ of them fires: @cocotb.coroutine def packet\_with\_timeout(monitor, timeout): """Wait for a packet but time out if nothing arrives""" yield \[Timer(timeout, units\='ns'), RisingEdge(dut.ready)\] The trigger that caused execution to resume is passed back to the coroutine, allowing them to distinguish which trigger fired: @cocotb.coroutine def packet\_with\_timeout(monitor, timeout): """Wait for a packet but time out if nothing arrives""" tout\_trigger \= Timer(timeout, units\='ns') result \= yield \[tout\_trigger, RisingEdge(dut.ready)\] if result is tout\_trigger: raise TestFailure("Timed out waiting for packet") Coroutines can be forked for parallel operation within a function of that code and the forked code. @cocotb.test() def test\_act\_during\_reset(dut): """While reset is active, toggle signals""" tb \= uart\_tb(dut) \# "Clock" is a built in class for toggling a clock signal cocotb.fork(Clock(dut.clk, 1, units\='ns').start()) \# reset\_dut is a function - \# part of the user-generated "uart\_tb" class cocotb.fork(tb.reset\_dut(dut.rstn, 20)) yield Timer(10, units\='ns') print("Reset is still active: %d" % dut.rstn) yield Timer(15, units\='ns') print("Reset has gone inactive: %d" % dut.rstn) Coroutines can be joined to end parallel operation within a function. @cocotb.test() def test\_count\_edge\_cycles(dut, period\=1, clocks\=6): cocotb.fork(Clock(dut.clk, period, units\='ns').start()) yield RisingEdge(dut.clk) timer \= Timer(period + 10) task \= cocotb.fork(count\_edges\_cycles(dut.clk, clocks)) count \= 0 expect \= clocks \- 1 while True: result \= yield \[timer, task.join()\] if count \> expect: raise TestFailure("Task didn't complete in expected time") if result is timer: dut.\_log.info("Count %d: Task still running" % count) count += 1 else: break Coroutines can be killed before they complete, forcing their completion before they’d naturally end. @cocotb.test() def test\_different\_clocks(dut): clk\_1mhz \= Clock(dut.clk, 1.0, units\='us') clk\_250mhz \= Clock(dut.clk, 4.0, units\='ns') clk\_gen \= cocotb.fork(clk\_1mhz.start()) start\_time\_ns \= get\_sim\_time(units\='ns') yield Timer(1, units\='ns') yield RisingEdge(dut.clk) edge\_time\_ns \= get\_sim\_time(units\='ns') \# NOTE: isclose is a Python 3.5+ feature if not isclose(edge\_time\_ns, start\_time\_ns + 1000.0): raise TestFailure("Expected a period of 1 us") clk\_gen.kill() clk\_gen \= cocotb.fork(clk\_250mhz.start()) start\_time\_ns \= get\_sim\_time(units\='ns') yield Timer(1, units\='ns') yield RisingEdge(dut.clk) edge\_time\_ns \= get\_sim\_time(units\='ns') \# NOTE: isclose is a Python 3.5+ feature if not isclose(edge\_time\_ns, start\_time\_ns + 4.0): raise TestFailure("Expected a period of 4 ns") Async functions[¶](https://docs.cocotb.org/en/v1.3.1/coroutines.html#async-functions "Permalink to this headline") ------------------------------------------------------------------------------------------------------------------- Python 3.5 introduces [`async`](https://docs.python.org/3/reference/compound_stmts.html#async "(in Python v3.8)") functions, which provide an alternative syntax. For example: @cocotb.coroutine async def wait\_10ns(): cocotb.log.info("About to wait for 10 ns") await Timer(10, units\='ns') cocotb.log.info("Simulation time has advanced by 10 ns") To wait on a trigger or a nested coroutine, these use [`await`](https://docs.python.org/3/reference/expressions.html#await "(in Python v3.8)") instead of [`yield`](https://docs.python.org/3/reference/simple_stmts.html#yield "(in Python v3.8)") . Provided they are decorated with `@cocotb.coroutine`, `async def` functions using [`await`](https://docs.python.org/3/reference/expressions.html#await "(in Python v3.8)") and regular functions using [`yield`](https://docs.python.org/3/reference/simple_stmts.html#yield "(in Python v3.8)") can be used interchangeable - the appropriate keyword to use is determined by which type of function it appears in, not by the sub-coroutine being called. Note It is not legal to `await` a list of triggers as can be done in `yield`\-based coroutine with `yield [trig1, trig2]`. Use `await First(trig1, trig2)` instead. ### Async generators[¶](https://docs.cocotb.org/en/v1.3.1/coroutines.html#async-generators "Permalink to this headline") In Python 3.6, a `yield` statement within an `async` function has a new meaning (rather than being a `SyntaxError`) which matches the typical meaning of `yield` within regular Python code. It can be used to create a special type of generator function that can be iterated with `async for`: async def ten\_samples\_of(clk, signal): for i in range(10): await RisingEdge(clk) yield signal.value \# this means "send back to the for loop" @cocotb.test() async def test\_samples\_are\_even(dut): async for sample in ten\_samples\_of(dut.clk, dut.signal): assert sample % 2 \== 0 More details on this type of generator can be found in [**PEP 525**](https://www.python.org/dev/peps/pep-0525) . --- # Coroutines — cocotb 1.3.0 documentation * [Docs](https://docs.cocotb.org/en/v1.3.0/index.html) » * Coroutines * [Edit on GitHub](https://github.com/cocotb/cocotb/blob/v1.3.0/documentation/source/coroutines.rst) * * * Coroutines[¶](https://docs.cocotb.org/en/v1.3.0/coroutines.html#coroutines "Permalink to this headline") ========================================================================================================= Testbenches built using cocotb use coroutines. While the coroutine is executing the simulation is paused. The coroutine uses the [`yield`](https://docs.python.org/3/reference/simple_stmts.html#yield "(in Python v3.8)") keyword to pass control of execution back to the simulator and simulation time can advance again. Typically coroutines [`yield`](https://docs.python.org/3/reference/simple_stmts.html#yield "(in Python v3.8)") a [`Trigger`](https://docs.cocotb.org/en/v1.3.0/library_reference.html#cocotb.triggers.Trigger "cocotb.triggers.Trigger") object which indicates to the simulator some event which will cause the coroutine to be woken when it occurs. For example: @cocotb.coroutine def wait\_10ns(): cocotb.log.info("About to wait for 10 ns") yield Timer(10, units\='ns') cocotb.log.info("Simulation time has advanced by 10 ns") Coroutines may also yield other coroutines: @cocotb.coroutine def wait\_100ns(): for i in range(10): yield wait\_10ns() Coroutines can return a value, so that they can be used by other coroutines. Before Python 3.3, this requires a [`ReturnValue`](https://docs.cocotb.org/en/v1.3.0/library_reference.html#cocotb.result.ReturnValue "cocotb.result.ReturnValue") to be raised. @cocotb.coroutine def get\_signal(clk, signal): yield RisingEdge(clk) raise ReturnValue(signal.value) @cocotb.coroutine def get\_signal\_python\_33(clk, signal): \# newer versions of Python can use return normally yield RisingEdge(clk) return signal.value @cocotb.coroutine def check\_signal\_changes(dut): first \= yield get\_signal(dut.clk, dut.signal) second \= yield get\_signal(dut.clk, dut.signal) if first \== second: raise TestFailure("Signal did not change") Coroutines may also yield a list of triggers and coroutines to indicate that execution should resume if _any_ of them fires: @cocotb.coroutine def packet\_with\_timeout(monitor, timeout): """Wait for a packet but time out if nothing arrives""" yield \[Timer(timeout, units\='ns'), RisingEdge(dut.ready)\] The trigger that caused execution to resume is passed back to the coroutine, allowing them to distinguish which trigger fired: @cocotb.coroutine def packet\_with\_timeout(monitor, timeout): """Wait for a packet but time out if nothing arrives""" tout\_trigger \= Timer(timeout, units\='ns') result \= yield \[tout\_trigger, RisingEdge(dut.ready)\] if result is tout\_trigger: raise TestFailure("Timed out waiting for packet") Coroutines can be forked for parallel operation within a function of that code and the forked code. @cocotb.test() def test\_act\_during\_reset(dut): """While reset is active, toggle signals""" tb \= uart\_tb(dut) \# "Clock" is a built in class for toggling a clock signal cocotb.fork(Clock(dut.clk, 1, units\='ns').start()) \# reset\_dut is a function - \# part of the user-generated "uart\_tb" class cocotb.fork(tb.reset\_dut(dut.rstn, 20)) yield Timer(10, units\='ns') print("Reset is still active: %d" % dut.rstn) yield Timer(15, units\='ns') print("Reset has gone inactive: %d" % dut.rstn) Coroutines can be joined to end parallel operation within a function. @cocotb.test() def test\_count\_edge\_cycles(dut, period\=1, clocks\=6): cocotb.fork(Clock(dut.clk, period, units\='ns').start()) yield RisingEdge(dut.clk) timer \= Timer(period + 10) task \= cocotb.fork(count\_edges\_cycles(dut.clk, clocks)) count \= 0 expect \= clocks \- 1 while True: result \= yield \[timer, task.join()\] if count \> expect: raise TestFailure("Task didn't complete in expected time") if result is timer: dut.\_log.info("Count %d: Task still running" % count) count += 1 else: break Coroutines can be killed before they complete, forcing their completion before they’d naturally end. @cocotb.test() def test\_different\_clocks(dut): clk\_1mhz \= Clock(dut.clk, 1.0, units\='us') clk\_250mhz \= Clock(dut.clk, 4.0, units\='ns') clk\_gen \= cocotb.fork(clk\_1mhz.start()) start\_time\_ns \= get\_sim\_time(units\='ns') yield Timer(1, units\='ns') yield RisingEdge(dut.clk) edge\_time\_ns \= get\_sim\_time(units\='ns') \# NOTE: isclose is a Python 3.5+ feature if not isclose(edge\_time\_ns, start\_time\_ns + 1000.0): raise TestFailure("Expected a period of 1 us") clk\_gen.kill() clk\_gen \= cocotb.fork(clk\_250mhz.start()) start\_time\_ns \= get\_sim\_time(units\='ns') yield Timer(1, units\='ns') yield RisingEdge(dut.clk) edge\_time\_ns \= get\_sim\_time(units\='ns') \# NOTE: isclose is a Python 3.5+ feature if not isclose(edge\_time\_ns, start\_time\_ns + 4.0): raise TestFailure("Expected a period of 4 ns") Async functions[¶](https://docs.cocotb.org/en/v1.3.0/coroutines.html#async-functions "Permalink to this headline") ------------------------------------------------------------------------------------------------------------------- Python 3.5 introduces [`async`](https://docs.python.org/3/reference/compound_stmts.html#async "(in Python v3.8)") functions, which provide an alternative syntax. For example: @cocotb.coroutine async def wait\_10ns(): cocotb.log.info("About to wait for 10 ns") await Timer(10, units\='ns') cocotb.log.info("Simulation time has advanced by 10 ns") To wait on a trigger or a nested coroutine, these use [`await`](https://docs.python.org/3/reference/expressions.html#await "(in Python v3.8)") instead of [`yield`](https://docs.python.org/3/reference/simple_stmts.html#yield "(in Python v3.8)") . Provided they are decorated with `@cocotb.coroutine`, `async def` functions using [`await`](https://docs.python.org/3/reference/expressions.html#await "(in Python v3.8)") and regular functions using [`yield`](https://docs.python.org/3/reference/simple_stmts.html#yield "(in Python v3.8)") can be used interchangeable - the appropriate keyword to use is determined by which type of function it appears in, not by the sub-coroutine being called. Note It is not legal to `await` a list of triggers as can be done in `yield`\-based coroutine with `yield [trig1, trig2]`. Use `await First(trig1, trig2)` instead. ### Async generators[¶](https://docs.cocotb.org/en/v1.3.0/coroutines.html#async-generators "Permalink to this headline") In Python 3.6, a `yield` statement within an `async` function has a new meaning (rather than being a `SyntaxError`) which matches the typical meaning of `yield` within regular Python code. It can be used to create a special type of generator function that can be iterated with `async for`: async def ten\_samples\_of(clk, signal): for i in range(10): await RisingEdge(clk) yield signal.value \# this means "send back to the for loop" @cocotb.test() async def test\_samples\_are\_even(dut): async for sample in ten\_samples\_of(dut.clk, dut.signal): assert sample % 2 \== 0 More details on this type of generator can be found in [**PEP 525**](https://www.python.org/dev/peps/pep-0525) . --- # Release Notes — cocotb 1.6.0.dev0+gec99a877.d20210503 documentation * [](https://docs.cocotb.org/en/v1.5.2/index.html) » * Release Notes * [Edit on GitHub](https://github.com/cocotb/cocotb/blob/v1.5.2/documentation/source/release_notes.rst) * * * Release Notes[¶](https://docs.cocotb.org/en/v1.5.2/release_notes.html#release-notes "Permalink to this headline") ================================================================================================================== All releases are available from the [GitHub Releases Page](https://github.com/cocotb/cocotb/releases) . cocotb 1.5.2 (2021-05-03)[¶](https://docs.cocotb.org/en/v1.5.2/release_notes.html#cocotb-1-5-2-2021-05-03 "Permalink to this headline") ---------------------------------------------------------------------------------------------------------------------------------------- ### Bugfixes[¶](https://docs.cocotb.org/en/v1.5.2/release_notes.html#bugfixes "Permalink to this headline") * Change some makefile syntax to support GNU Make 3 ([#2496](https://github.com/cocotb/cocotb/pull/2496) ) * Fix behavior of `cocotb-config --libpython` when finding libpython fails ([#2522](https://github.com/cocotb/cocotb/pull/2522) ) cocotb 1.5.1 (2021-03-20)[¶](https://docs.cocotb.org/en/v1.5.2/release_notes.html#cocotb-1-5-1-2021-03-20 "Permalink to this headline") ---------------------------------------------------------------------------------------------------------------------------------------- ### Bugfixes[¶](https://docs.cocotb.org/en/v1.5.2/release_notes.html#id1 "Permalink to this headline") * Prevent pytest assertion rewriting ([#2028](https://github.com/cocotb/cocotb/pull/2028) ) from capturing stdin, which causes problems with IPython support ([#1649](https://github.com/cocotb/cocotb/pull/1649) ). ([#2462](https://github.com/cocotb/cocotb/pull/2462) ) * Add dependency on [cocotb\_bus](https://github.com/cocotb/cocotb-bus) to prevent breaking users that were previously using the bus and testbenching objects. ([#2477](https://github.com/cocotb/cocotb/pull/2477) ) * Add back functionality to [`cocotb.binary.BinaryValue`](https://docs.cocotb.org/en/v1.5.2/library_reference.html#cocotb.binary.BinaryValue "cocotb.binary.BinaryValue") that allows the user to change `binaryRepresentation` after object creation. ([#2480](https://github.com/cocotb/cocotb/pull/2480) ) cocotb 1.5.0 (2021-03-11)[¶](https://docs.cocotb.org/en/v1.5.2/release_notes.html#cocotb-1-5-0-2021-03-11 "Permalink to this headline") ---------------------------------------------------------------------------------------------------------------------------------------- ### Features[¶](https://docs.cocotb.org/en/v1.5.2/release_notes.html#features "Permalink to this headline") * Support for building with Microsoft Visual C++ has been added. See [Installation](https://docs.cocotb.org/en/v1.5.2/install.html#install) for more details. ([#1798](https://github.com/cocotb/cocotb/pull/1798) ) * Makefiles now automatically deduce [`TOPLEVEL_LANG`](https://docs.cocotb.org/en/v1.5.2/building.html#var-TOPLEVEL_LANG) based on the value of [`VERILOG_SOURCES`](https://docs.cocotb.org/en/v1.5.2/building.html#var-VERILOG_SOURCES) and [`VHDL_SOURCES`](https://docs.cocotb.org/en/v1.5.2/building.html#var-VHDL_SOURCES) . Makefiles also detect incorrect usage of [`TOPLEVEL_LANG`](https://docs.cocotb.org/en/v1.5.2/building.html#var-TOPLEVEL_LANG) for simulators that only support one language. ([#1982](https://github.com/cocotb/cocotb/pull/1982) ) * [`cocotb.fork()`](https://docs.cocotb.org/en/v1.5.2/library_reference.html#cocotb.fork "cocotb.fork") will now raise a descriptive [`TypeError`](https://docs.python.org/3/library/exceptions.html#TypeError "(in Python v3.9)") if a coroutine function is passed into them. ([#2006](https://github.com/cocotb/cocotb/pull/2006) ) * Added [`cocotb.scheduler.start_soon`](https://docs.cocotb.org/en/v1.5.2/library_reference.html#cocotb.scheduler.Scheduler.start_soon "cocotb.scheduler.Scheduler.start_soon") which schedules a coroutine to start _after_ the current coroutine yields control. This behavior is distinct from [`cocotb.fork()`](https://docs.cocotb.org/en/v1.5.2/library_reference.html#cocotb.fork "cocotb.fork") which schedules the given coroutine immediately. ([#2023](https://github.com/cocotb/cocotb/pull/2023) ) * If `pytest` is installed, its assertion-rewriting framework will be used to produce more informative tracebacks from the [`assert`](https://docs.python.org/3/reference/simple_stmts.html#assert "(in Python v3.9)") statement. ([#2028](https://github.com/cocotb/cocotb/pull/2028) ) * The handle to [`TOPLEVEL`](https://docs.cocotb.org/en/v1.5.2/building.html#envvar-TOPLEVEL) , typically seen as the first argument to a cocotb test function, is now available globally as [`cocotb.top`](https://docs.cocotb.org/en/v1.5.2/library_reference.html#cocotb.top "cocotb.top") . ([#2134](https://github.com/cocotb/cocotb/pull/2134) ) * The `units` argument to [`cocotb.triggers.Timer`](https://docs.cocotb.org/en/v1.5.2/triggers.html#cocotb.triggers.Timer "cocotb.triggers.Timer") , [`cocotb.clock.Clock`](https://docs.cocotb.org/en/v1.5.2/library_reference.html#cocotb.clock.Clock "cocotb.clock.Clock") and [`cocotb.utils.get_sim_steps()`](https://docs.cocotb.org/en/v1.5.2/library_reference.html#cocotb.utils.get_sim_steps "cocotb.utils.get_sim_steps") , and the `timeout_unit` argument to [`cocotb.triggers.with_timeout()`](https://docs.cocotb.org/en/v1.5.2/triggers.html#cocotb.triggers.with_timeout "cocotb.triggers.with_timeout") and [`cocotb.test`](https://docs.cocotb.org/en/v1.5.2/library_reference.html#cocotb.test "cocotb.test") now accepts `'step'` to mean the simulator time step. This used to be expressed using `None`, which is now deprecated. ([#2171](https://github.com/cocotb/cocotb/pull/2171) ) * [`cocotb.regression.TestFactory.add_option()`](https://docs.cocotb.org/en/v1.5.2/library_reference.html#cocotb.regression.TestFactory.add_option "cocotb.regression.TestFactory.add_option") now supports groups of options when a full Cartesian product is not desired ([#2175](https://github.com/cocotb/cocotb/pull/2175) ) * Added asyncio-style queues, [`cocotb.queue.Queue`](https://docs.cocotb.org/en/v1.5.2/library_reference.html#cocotb.queue.Queue "cocotb.queue.Queue") , [`cocotb.queue.PriorityQueue`](https://docs.cocotb.org/en/v1.5.2/library_reference.html#cocotb.queue.PriorityQueue "cocotb.queue.PriorityQueue") , and [`cocotb.queue.LifoQueue`](https://docs.cocotb.org/en/v1.5.2/library_reference.html#cocotb.queue.LifoQueue "cocotb.queue.LifoQueue") . ([#2297](https://github.com/cocotb/cocotb/pull/2297) ) * Support for the SystemVerilog type `bit` has been added. ([#2322](https://github.com/cocotb/cocotb/pull/2322) ) * Added the `--lib-dir`, `--lib-name` and `--lib-name-path` options to the `cocotb-config` command to make cocotb integration into existing flows easier. ([#2387](https://github.com/cocotb/cocotb/pull/2387) ) * Support for using Questa’s VHPI has been added. Use [`VHDL_GPI_INTERFACE`](https://docs.cocotb.org/en/v1.5.2/building.html#var-VHDL_GPI_INTERFACE) to select between using the FLI or VHPI when dealing with VHDL simulations. Note that VHPI support in Questa is still experimental at this time. ([#2408](https://github.com/cocotb/cocotb/pull/2408) ) ### Bugfixes[¶](https://docs.cocotb.org/en/v1.5.2/release_notes.html#id2 "Permalink to this headline") * Assigning Python integers to signals greater than 32 bits wide will now work correctly for negative values. ([#913](https://github.com/cocotb/cocotb/pull/913) ) * Fix GHDL’s library search path, allowing libraries other than _work_ to be used in simulation. ([#2038](https://github.com/cocotb/cocotb/pull/2038) ) * Tests skipped by default (created with skip=True) can again be run manually by setting the [`TESTCASE`](https://docs.cocotb.org/en/v1.5.2/building.html#envvar-TESTCASE) variable. ([#2045](https://github.com/cocotb/cocotb/pull/2045) ) * In [Icarus Verilog](https://docs.cocotb.org/en/v1.5.2/simulator_support.html#sim-icarus) , generate blocks are now accessible directly via lookup without having to iterate over parent handle. ([#2079](https://github.com/cocotb/cocotb/pull/2079) , [#2143](https://github.com/cocotb/cocotb/pull/2143) ) > \# Example pseudo-region > dut.genblk1 # * Fixed an issue with VHPI on Mac OS and Linux where negative integers were returned as large positive values. ([#2129](https://github.com/cocotb/cocotb/pull/2129) ) ### Improved Documentation[¶](https://docs.cocotb.org/en/v1.5.2/release_notes.html#improved-documentation "Permalink to this headline") * The [Mixed-signal (analog/digital)](https://docs.cocotb.org/en/v1.5.2/examples.html#mixed-signal) example has been added, showing how to use HDL helper modules in cocotb testbenches that exercise two mixed-signal (i.e. analog and digital) designs. ([#1051](https://github.com/cocotb/cocotb/pull/1051) ) * New example [Matrix Multiplier](https://docs.cocotb.org/en/v1.5.2/examples.html#matrix-multiplier) . ([#1502](https://github.com/cocotb/cocotb/pull/1502) ) * A [Reference Card](https://docs.cocotb.org/en/v1.5.2/refcard.html#refcard) showing the most used features of cocotb has been added. ([#2321](https://github.com/cocotb/cocotb/pull/2321) ) * A chapter [Extending existing build flows](https://docs.cocotb.org/en/v1.5.2/custom_flows.html#custom-flows) has been added. ([#2340](https://github.com/cocotb/cocotb/pull/2340) ) ### Deprecations and Removals[¶](https://docs.cocotb.org/en/v1.5.2/release_notes.html#deprecations-and-removals "Permalink to this headline") * The contents of [`cocotb.generators`](https://docs.cocotb.org/en/v1.5.2/library_reference.html#module-cocotb.generators "cocotb.generators: Class for generators.") have been deprecated. ([#2047](https://github.com/cocotb/cocotb/pull/2047) ) * The outdated “Sorter” example has been removed from the documentation. ([#2049](https://github.com/cocotb/cocotb/pull/2049) ) * Passing [`bool`](https://docs.python.org/3/library/functions.html#bool "(in Python v3.9)") values to `expect_error` option of [`cocotb.test`](https://docs.cocotb.org/en/v1.5.2/library_reference.html#cocotb.test "cocotb.test") is deprecated. Pass a specific [`Exception`](https://docs.python.org/3/library/exceptions.html#Exception "(in Python v3.9)") or a tuple of Exceptions instead. ([#2117](https://github.com/cocotb/cocotb/pull/2117) ) * The system task overloads for `$info`, `$warn`, `$error` and `$fatal` in Verilog and mixed language testbenches have been removed. ([#2133](https://github.com/cocotb/cocotb/pull/2133) ) * [`TestError`](https://docs.cocotb.org/en/v1.5.2/library_reference.html#cocotb.result.TestError "cocotb.result.TestError") has been deprecated, use [Built-in Exceptions](https://docs.python.org/3/library/exceptions.html#bltin-exceptions "(in Python v3.9)") . ([#2177](https://github.com/cocotb/cocotb/pull/2177) ) * The undocumented class `cocotb.xunit_reporter.File` has been removed. ([#2200](https://github.com/cocotb/cocotb/pull/2200) ) * Deprecated [`cocotb.hook`](https://docs.cocotb.org/en/v1.5.2/library_reference.html#cocotb.hook "cocotb.hook") and [`COCOTB_HOOKS`](https://docs.cocotb.org/en/v1.5.2/building.html#envvar-COCOTB_HOOKS) . See the documentation for [`cocotb.hook`](https://docs.cocotb.org/en/v1.5.2/library_reference.html#cocotb.hook "cocotb.hook") for suggestions on alternatives. ([#2201](https://github.com/cocotb/cocotb/pull/2201) ) * Deprecate [`pack()`](https://docs.cocotb.org/en/v1.5.2/library_reference.html#cocotb.utils.pack "cocotb.utils.pack") and [`unpack()`](https://docs.cocotb.org/en/v1.5.2/library_reference.html#cocotb.utils.unpack "cocotb.utils.unpack") and the use of [`ctypes.Structure`](https://docs.python.org/3/library/ctypes.html#ctypes.Structure "(in Python v3.9)") in signal assignments. ([#2203](https://github.com/cocotb/cocotb/pull/2203) ) * The outdated “ping” example has been removed from the documentation and repository. ([#2232](https://github.com/cocotb/cocotb/pull/2232) ) * Using the undocumented custom format [`dict`](https://docs.python.org/3/library/stdtypes.html#dict "(in Python v3.9)") object in signal assignments has been deprecated. ([#2240](https://github.com/cocotb/cocotb/pull/2240) ) * The access modes of many interfaces in the cocotb core libraries were re-evaluated. Some interfaces that were previously public are now private and vice versa. Accessing the methods through their old name will create a [`DeprecationWarning`](https://docs.python.org/3/library/exceptions.html#DeprecationWarning "(in Python v3.9)") . In the future, the deprecated names will be removed. ([#2278](https://github.com/cocotb/cocotb/pull/2278) ) * The bus and testbenching components in cocotb have been officially moved to the [cocotb-bus](https://github.com/cocotb/cocotb-bus) package. This includes [`Bus`](https://docs.cocotb.org/en/v1.5.2/library_reference.html#cocotb_bus.bus.Bus "cocotb_bus.bus.Bus") , [`Scoreboard`](https://docs.cocotb.org/en/v1.5.2/library_reference.html#cocotb_bus.scoreboard.Scoreboard "cocotb_bus.scoreboard.Scoreboard") , everything in `cocotb_bus.drivers`, and everything in `cocotb_bus.monitors`. Documentation will remain in the main cocotb repository for now. Old names will continue to exist, but their use will cause a [`DeprecationWarning`](https://docs.python.org/3/library/exceptions.html#DeprecationWarning "(in Python v3.9)") , and will be removed in the future. ([#2289](https://github.com/cocotb/cocotb/pull/2289) ) ### Changes[¶](https://docs.cocotb.org/en/v1.5.2/release_notes.html#changes "Permalink to this headline") * Assigning negative Python integers to handles does an implicit two’s compliment conversion. ([#913](https://github.com/cocotb/cocotb/pull/913) ) * Updated [`Driver`](https://docs.cocotb.org/en/v1.5.2/library_reference.html#cocotb_bus.drivers.Driver "cocotb_bus.drivers.Driver") , [`Monitor`](https://docs.cocotb.org/en/v1.5.2/library_reference.html#cocotb_bus.monitors.Monitor "cocotb_bus.monitors.Monitor") , and all their subclasses to use the [`async`](https://docs.python.org/3/reference/compound_stmts.html#async "(in Python v3.9)") /[`await`](https://docs.python.org/3/reference/expressions.html#await "(in Python v3.9)") syntax instead of the [`yield`](https://docs.python.org/3/reference/simple_stmts.html#yield "(in Python v3.9)") syntax. ([#2022](https://github.com/cocotb/cocotb/pull/2022) ) * The package build process is now fully [**PEP 517**](https://www.python.org/dev/peps/pep-0517) compliant. ([#2091](https://github.com/cocotb/cocotb/pull/2091) ) * Improved support and performance for [Verilator](https://docs.cocotb.org/en/v1.5.2/simulator_support.html#sim-verilator) (version 4.106 or later now required). ([#2105](https://github.com/cocotb/cocotb/pull/2105) ) * Changed how libraries are specified in [`GPI_EXTRA`](https://docs.cocotb.org/en/v1.5.2/building.html#envvar-GPI_EXTRA) to allow specifying libraries with paths, and names that don’t start with “lib”. ([#2341](https://github.com/cocotb/cocotb/pull/2341) ) Cocotb 1.4.0 (2020-07-08)[¶](https://docs.cocotb.org/en/v1.5.2/release_notes.html#cocotb-1-4-0-2020-07-08 "Permalink to this headline") ---------------------------------------------------------------------------------------------------------------------------------------- ### Features[¶](https://docs.cocotb.org/en/v1.5.2/release_notes.html#id4 "Permalink to this headline") * [`Lock`](https://docs.cocotb.org/en/v1.5.2/triggers.html#cocotb.triggers.Lock "cocotb.triggers.Lock") can now be used in [`async with`](https://docs.python.org/3/reference/compound_stmts.html#async-with "(in Python v3.9)") statements. ([#1031](https://github.com/cocotb/cocotb/pull/1031) ) * Add support for distinguishing between `net` (`vpiNet`) and `reg` (`vpiReg`) type when using the VPI interface. ([#1107](https://github.com/cocotb/cocotb/pull/1107) ) * Support for dropping into [`pdb`](https://docs.python.org/3/library/pdb.html#module-pdb "(in Python v3.9)") upon failure, via the new [`COCOTB_PDB_ON_EXCEPTION`](https://docs.cocotb.org/en/v1.5.2/building.html#envvar-COCOTB_PDB_ON_EXCEPTION) environment variable ([#1180](https://github.com/cocotb/cocotb/pull/1180) ) * Simulators run through a Tcl script (Aldec Riviera Pro and Mentor simulators) now support a new [`RUN_ARGS`](https://docs.cocotb.org/en/v1.5.2/building.html#var-RUN_ARGS) Makefile variable, which is passed to the first invocation of the tool during runtime. ([#1244](https://github.com/cocotb/cocotb/pull/1244) ) * Cocotb now supports the following example of forking a _non-decorated_ [async coroutine](https://docs.cocotb.org/en/v1.5.2/coroutines.html#async-functions) . async def example(): for i in range(10): await cocotb.triggers.Timer(10, "ns") cocotb.fork(example()) Issue ([#1255](https://github.com/cocotb/cocotb/pull/1255) ) * The cocotb log configuration is now less intrusive, and only configures the root logger instance, `logging.getLogger()`, as part of [`cocotb.log.default_config()`](https://docs.cocotb.org/en/v1.5.2/library_reference.html#cocotb.log.default_config "cocotb.log.default_config") ([#1266](https://github.com/cocotb/cocotb/pull/1266) ). As such, it is now possible to override the default cocotb logging behavior with something like: \# remove the cocotb log handler and formatting root \= logging.getLogger() for h in root.handlers\[:\]: root.remove\_handler(h) h.close() \# add your own logging.basicConfig() * Support for `vpiRealNet` ([#1282](https://github.com/cocotb/cocotb/pull/1282) ) * The colored output can now be disabled by the [`NO_COLOR`](https://docs.cocotb.org/en/v1.5.2/building.html#envvar-NO_COLOR) environment variable. ([#1309](https://github.com/cocotb/cocotb/pull/1309) ) * Cocotb now supports deposit/force/release/freeze actions on simulator handles, exposing functionality similar to the respective Verilog/VHDL assignments. from cocotb.handle import Deposit, Force, Release, Freeze dut.q <= 1 \# A regular value deposit dut.q <= Deposit(1) \# The same, higher verbosity dut.q <= Force(1) \# Force value of q to 1 dut.q <= Release() \# Release q from a Force dut.q <= Freeze() \# Freeze the current value of q Issue ([#1403](https://github.com/cocotb/cocotb/pull/1403) ) * Custom logging handlers can now access the simulator time using [`logging.LogRecord.created_sim_time`](https://docs.cocotb.org/en/v1.5.2/library_reference.html#logging.LogRecord.created_sim_time "logging.LogRecord.created_sim_time") , provided the [`SimTimeContextFilter`](https://docs.cocotb.org/en/v1.5.2/library_reference.html#cocotb.log.SimTimeContextFilter "cocotb.log.SimTimeContextFilter") filter added by [`default_config()`](https://docs.cocotb.org/en/v1.5.2/library_reference.html#cocotb.log.default_config "cocotb.log.default_config") is not removed from the logger instance. ([#1411](https://github.com/cocotb/cocotb/pull/1411) ) * Questa now supports `PLUSARGS`. This requires that `tcl.h` be present on the system. This is likely included in your installation of Questa, otherwise, specify `CFLAGS=-I/path/to/tcl/includedir`. ([#1424](https://github.com/cocotb/cocotb/pull/1424) ) * The name of the entry point symbol for libraries in [`GPI_EXTRA`](https://docs.cocotb.org/en/v1.5.2/building.html#envvar-GPI_EXTRA) can now be customized. The delimiter between each library in the list has changed from `:` to `,`. ([#1457](https://github.com/cocotb/cocotb/pull/1457) ) * New methods for setting the value of a [`NonHierarchyIndexableObject`](https://docs.cocotb.org/en/v1.5.2/library_reference.html#cocotb.handle.NonHierarchyIndexableObject "cocotb.handle.NonHierarchyIndexableObject") (HDL arrays). ([#1507](https://github.com/cocotb/cocotb/pull/1507) ) \# Now supported dut.some\_array <= \[0xAA, 0xBB, 0xCC\] dut.some\_array.value \= \[0xAA, 0xBB, 0xCC\] \# For simulators that support n-dimensional arrays dut.some\_2d\_array <= \[\[0xAA, 0xBB\], \[0xCC, 0xDD\]\] dut.some\_2d\_array.value \= \[\[0xAA, 0xBB\], \[0xCC, 0xDD\]\] * Added support for Aldec’s Active-HDL simulator. ([#1601](https://github.com/cocotb/cocotb/pull/1601) ) * Including `Makefile.inc` from user makefiles is now a no-op and deprecated. Lines like `include $(shell cocotb-config --makefiles)/Makefile.inc` can be removed from user makefiles without loss in functionality. ([#1629](https://github.com/cocotb/cocotb/pull/1629) ) * Support for using `await` inside an embedded IPython terminal, using [`cocotb.ipython_support`](https://docs.cocotb.org/en/v1.5.2/troubleshooting.html#module-cocotb.ipython_support "cocotb.ipython_support") . ([#1649](https://github.com/cocotb/cocotb/pull/1649) ) * Added [`is_set()`](https://docs.cocotb.org/en/v1.5.2/triggers.html#cocotb.triggers.Event.is_set "cocotb.triggers.Event.is_set") , so users may check if an [`Event`](https://docs.cocotb.org/en/v1.5.2/triggers.html#cocotb.triggers.Event "cocotb.triggers.Event") has fired. ([#1723](https://github.com/cocotb/cocotb/pull/1723) ) * The [`cocotb.simulator.is_running()`](https://docs.cocotb.org/en/v1.5.2/library_reference.html#cocotb.simulator.is_running "cocotb.simulator.is_running") function was added so a user of cocotb could determine if they are running within a simulator. ([#1843](https://github.com/cocotb/cocotb/pull/1843) ) ### Bugfixes[¶](https://docs.cocotb.org/en/v1.5.2/release_notes.html#id5 "Permalink to this headline") * Tests which fail at initialization, for instance due to no `yield` being present, are no longer silently ignored ([#1253](https://github.com/cocotb/cocotb/pull/1253) ) * Tests that were not run because predecessors threw [`cocotb.result.SimFailure`](https://docs.cocotb.org/en/v1.5.2/library_reference.html#cocotb.result.SimFailure "cocotb.result.SimFailure") , and caused the simulator to exit, are now recorded with an outcome of [`cocotb.result.SimFailure`](https://docs.cocotb.org/en/v1.5.2/library_reference.html#cocotb.result.SimFailure "cocotb.result.SimFailure") . Previously, these tests were ignored. ([#1279](https://github.com/cocotb/cocotb/pull/1279) ) * Makefiles now correctly fail if the simulation crashes before a `results.xml` file can be written. ([#1314](https://github.com/cocotb/cocotb/pull/1314) ) * Logging of non-string messages with colored log output is now working. ([#1410](https://github.com/cocotb/cocotb/pull/1410) ) * Getting and setting the value of a [`NonHierarchyIndexableObject`](https://docs.cocotb.org/en/v1.5.2/library_reference.html#cocotb.handle.NonHierarchyIndexableObject "cocotb.handle.NonHierarchyIndexableObject") now iterates through the correct range of the simulation object, so arrays that do not start/end at index 0 are supported. ([#1507](https://github.com/cocotb/cocotb/pull/1507) ) * The `XGMII` monitor no longer crashes on Python 3, and now assembles packets as [`bytes`](https://docs.python.org/3/library/stdtypes.html#bytes "(in Python v3.9)") instead of [`str`](https://docs.python.org/3/library/stdtypes.html#str "(in Python v3.9)") . The `XGMII` driver has expected [`bytes`](https://docs.python.org/3/library/stdtypes.html#bytes "(in Python v3.9)") since cocotb 1.2.0. ([#1545](https://github.com/cocotb/cocotb/pull/1545) ) * `signal <= value_of_wrong_type` no longer breaks the scheduler, and throws an error immediately. ([#1661](https://github.com/cocotb/cocotb/pull/1661) ) * Scheduling behavior is now consistent before and after the first [`await`](https://docs.python.org/3/reference/expressions.html#await "(in Python v3.9)") of a [`GPITrigger`](https://docs.cocotb.org/en/v1.5.2/library_reference.html#cocotb.triggers.GPITrigger "cocotb.triggers.GPITrigger") . ([#1705](https://github.com/cocotb/cocotb/pull/1705) ) * Iterating over `for generate` statements using VHPI has been fixed. This bug caused some simulators to crash, and was a regression in version 1.3. ([#1882](https://github.com/cocotb/cocotb/pull/1882) ) * The `XGMII` driver no longer emits a corrupted word on the first transfer. ([#1905](https://github.com/cocotb/cocotb/pull/1905) ) ### Improved Documentation[¶](https://docs.cocotb.org/en/v1.5.2/release_notes.html#id6 "Permalink to this headline") * If a makefile uses cocotb’s `Makefile.sim`, `make help` now lists the supported targets and variables. ([#1318](https://github.com/cocotb/cocotb/pull/1318) ) * A new section [Rotating Log Files](https://docs.cocotb.org/en/v1.5.2/rotating_logger.html#rotating-logger) has been added. ([#1400](https://github.com/cocotb/cocotb/pull/1400) ) * The documentation at [http://docs.cocotb.org/](http://docs.cocotb.org/) has been restructured, making it easier to find relevant information. ([#1482](https://github.com/cocotb/cocotb/pull/1482) ) ### Deprecations and Removals[¶](https://docs.cocotb.org/en/v1.5.2/release_notes.html#id7 "Permalink to this headline") * [`cocotb.utils.reject_remaining_kwargs()`](https://docs.cocotb.org/en/v1.5.2/library_reference.html#cocotb.utils.reject_remaining_kwargs "cocotb.utils.reject_remaining_kwargs") is deprecated, as it is no longer needed now that we only support Python 3.5 and newer. ([#1339](https://github.com/cocotb/cocotb/pull/1339) ) * The value of [`cocotb.handle.StringObject`](https://docs.cocotb.org/en/v1.5.2/library_reference.html#cocotb.handle.StringObject "cocotb.handle.StringObject") s is now of type [`bytes`](https://docs.python.org/3/library/stdtypes.html#bytes "(in Python v3.9)") , instead of [`str`](https://docs.python.org/3/library/stdtypes.html#str "(in Python v3.9)") with an implied ASCII encoding scheme. ([#1381](https://github.com/cocotb/cocotb/pull/1381) ) * `ReturnValue` is now deprecated. Use a [`return`](https://docs.python.org/3/reference/simple_stmts.html#return "(in Python v3.9)") statement instead; this works in all supported versions of Python. ([#1489](https://github.com/cocotb/cocotb/pull/1489) ) * The makefile variable `VERILATOR_TRACE` that was not supported for all simulators has been deprecated. Using it prints a deprecation warning and points to the documentation section [Simulator Support](https://docs.cocotb.org/en/v1.5.2/simulator_support.html#simulator-support) explaining how to get the same effect by other means. ([#1495](https://github.com/cocotb/cocotb/pull/1495) ) * `BinaryValue.get_hex_buff` produced nonsense and has been removed. ([#1511](https://github.com/cocotb/cocotb/pull/1511) ) * Passing [`str`](https://docs.python.org/3/library/stdtypes.html#str "(in Python v3.9)") instances to [`cocotb.utils.hexdump()`](https://docs.cocotb.org/en/v1.5.2/library_reference.html#cocotb.utils.hexdump "cocotb.utils.hexdump") and [`cocotb.utils.hexdiffs()`](https://docs.cocotb.org/en/v1.5.2/library_reference.html#cocotb.utils.hexdiffs "cocotb.utils.hexdiffs") is deprecated. [`bytes`](https://docs.python.org/3/library/stdtypes.html#bytes "(in Python v3.9)") objects should be passed instead. ([#1519](https://github.com/cocotb/cocotb/pull/1519) ) * `Makefile.pylib`, which provided helpers for building C extension modules for Python, has been removed. Users of the `PYTHON_LIBDIR` and `PYTHON_INCLUDEDIR` variables will now have to compute these values themselves. See the `endian_swapper` example for how to do this. ([#1632](https://github.com/cocotb/cocotb/pull/1632) ) * Makefile and documentation for the NVC simulator which has never worked have been removed. ([#1693](https://github.com/cocotb/cocotb/pull/1693) ) ### Changes[¶](https://docs.cocotb.org/en/v1.5.2/release_notes.html#id8 "Permalink to this headline") * Cocotb no longer supports Python 2, at least Python 3.5 is now required. Users of Python 2.7 can still use cocotb 1.3, but are heavily encouraged to update. It is recommended to use the latest release of Python 3 for improved performance over older Python 3 versions. ([#767](https://github.com/cocotb/cocotb/pull/767) ) * Mentor Questa, Aldec Riviera-PRO and GHDL are now started in the directory containing the Makefile and also save `results.xml` there, bringing them in line with the behavior used by other simulators. ([#1598](https://github.com/cocotb/cocotb/pull/1598) ) ([#1599](https://github.com/cocotb/cocotb/pull/1599) ) ([#1063](https://github.com/cocotb/cocotb/pull/1063) ) * Tests are now evaluated in order of their appearance in the [`MODULE`](https://docs.cocotb.org/en/v1.5.2/building.html#envvar-MODULE) environment variable, their stage, and the order of invocation of the [`cocotb.test`](https://docs.cocotb.org/en/v1.5.2/library_reference.html#cocotb.test "cocotb.test") decorator within a module. ([#1380](https://github.com/cocotb/cocotb/pull/1380) ) * All libraries are compiled during installation to the `cocotb/libs` directory. The interface libraries `libcocotbvpi` and `libcocotbvhpi` have been renamed to have a `_simulator_name` postfix. The `simulator` module has moved to [`cocotb.simulator`](https://docs.cocotb.org/en/v1.5.2/library_reference.html#module-cocotb.simulator "cocotb.simulator") . The `LD_LIBRARY_PATH` environment variable no longer needs to be set by the makefiles, as the libraries now discover each other via `RPATH` settings. ([#1425](https://github.com/cocotb/cocotb/pull/1425) ) * Cocotb must now be [installed](https://docs.cocotb.org/en/v1.5.2/install.html#installation-via-pip) before it can be used. ([#1445](https://github.com/cocotb/cocotb/pull/1445) ) * [`cocotb.handle.NonHierarchyIndexableObject.value`](https://docs.cocotb.org/en/v1.5.2/library_reference.html#cocotb.handle.NonHierarchyIndexableObject.value "cocotb.handle.NonHierarchyIndexableObject.value") is now a list in left-to-right range order of the underlying simulation object. Previously the list was always ordered low-to-high. ([#1507](https://github.com/cocotb/cocotb/pull/1507) ) * Various binary representations have changed type from [`str`](https://docs.python.org/3/library/stdtypes.html#str "(in Python v3.9)") to [`bytes`](https://docs.python.org/3/library/stdtypes.html#bytes "(in Python v3.9)") . These include: * [`cocotb.binary.BinaryValue.buff`](https://docs.cocotb.org/en/v1.5.2/library_reference.html#cocotb.binary.BinaryValue.buff "cocotb.binary.BinaryValue.buff") , which as a consequence means [`cocotb.binary.BinaryValue.assign()`](https://docs.cocotb.org/en/v1.5.2/library_reference.html#cocotb.binary.BinaryValue.assign "cocotb.binary.BinaryValue.assign") no longer accepts malformed `10xz`\-style [`str`](https://docs.python.org/3/library/stdtypes.html#str "(in Python v3.9)") s (which were treated as binary). * The objects produced by [`cocotb.generators.byte`](https://docs.cocotb.org/en/v1.5.2/library_reference.html#module-cocotb.generators.byte "cocotb.generators.byte") , which means that single bytes are represented by [`int`](https://docs.python.org/3/library/functions.html#int "(in Python v3.9)") instead of 1-character [`str`](https://docs.python.org/3/library/stdtypes.html#str "(in Python v3.9)") s. * The packets produced by the `AvalonSTPkts`. Code working with these objects may find it needs to switch from creating [`str`](https://docs.python.org/3/library/stdtypes.html#str "(in Python v3.9)") objects like `"this"` to [`bytes`](https://docs.python.org/3/library/stdtypes.html#bytes "(in Python v3.9)") objects like `b"this"`. This change is a consequence of the move to Python 3. ([#1514](https://github.com/cocotb/cocotb/pull/1514) ) * There’s no longer any need to set the `PYTHON_BIN` makefile variable, the Python executable automatically matches the one cocotb was installed into. ([#1574](https://github.com/cocotb/cocotb/pull/1574) ) * The [`SIM`](https://docs.cocotb.org/en/v1.5.2/building.html#var-SIM) setting for Aldec Riviera-PRO has changed from `aldec` to `riviera`. ([#1691](https://github.com/cocotb/cocotb/pull/1691) ) * Certain methods on the [`cocotb.simulator`](https://docs.cocotb.org/en/v1.5.2/library_reference.html#module-cocotb.simulator "cocotb.simulator") Python module now throw a [`RuntimeError`](https://docs.python.org/3/library/exceptions.html#RuntimeError "(in Python v3.9)") when no simulator is present, making it safe to use `cocotb` without a simulator present. ([#1843](https://github.com/cocotb/cocotb/pull/1843) ) * Invalid values of the environment variable [`COCOTB_LOG_LEVEL`](https://docs.cocotb.org/en/v1.5.2/building.html#envvar-COCOTB_LOG_LEVEL) are no longer ignored. They now raise an exception with instructions how to fix the problem. ([#1898](https://github.com/cocotb/cocotb/pull/1898) ) cocotb 1.3.2[¶](https://docs.cocotb.org/en/v1.5.2/release_notes.html#cocotb-1-3-2 "Permalink to this headline") ---------------------------------------------------------------------------------------------------------------- Released on 08 July 2020 ### Notable changes and bug fixes[¶](https://docs.cocotb.org/en/v1.5.2/release_notes.html#notable-changes-and-bug-fixes "Permalink to this headline") * Iterating over `for generate` statements using VHPI has been fixed. This bug caused some simulators to crash, and was a regression in version 1.3.1. ([#1882](https://github.com/cocotb/cocotb/pull/1882) ) cocotb 1.3.1[¶](https://docs.cocotb.org/en/v1.5.2/release_notes.html#cocotb-1-3-1 "Permalink to this headline") ---------------------------------------------------------------------------------------------------------------- Released on 15 March 2020 ### Notable changes and bug fixes[¶](https://docs.cocotb.org/en/v1.5.2/release_notes.html#id9 "Permalink to this headline") * The Makefiles for the Aldec Riviera and Cadence Incisive simulators have been fixed to use the correct name of the VHPI library (`libcocotbvhpi`). This bug prevented VHDL designs from being simulated, and was a regression in 1.3.0. ([#1472](https://github.com/cocotb/cocotb/pull/1472) ) cocotb 1.3.0[¶](https://docs.cocotb.org/en/v1.5.2/release_notes.html#cocotb-1-3-0 "Permalink to this headline") ---------------------------------------------------------------------------------------------------------------- Released on 08 January 2020 This will likely be the last release to support Python 2.7. ### New features[¶](https://docs.cocotb.org/en/v1.5.2/release_notes.html#new-features "Permalink to this headline") * Initial support for the [Verilator](https://docs.cocotb.org/en/v1.5.2/simulator_support.html#sim-verilator) simulator (version 4.020 and above). The integration of Verilator into cocotb is not yet as fast or as powerful as it is for other simulators. Please use the latest version of Verilator, and [report bugs](https://github.com/cocotb/cocotb/issues/new) if you experience problems. * New makefile variables [`COCOTB_HDL_TIMEUNIT`](https://docs.cocotb.org/en/v1.5.2/building.html#var-COCOTB_HDL_TIMEUNIT) and [`COCOTB_HDL_TIMEPRECISION`](https://docs.cocotb.org/en/v1.5.2/building.html#var-COCOTB_HDL_TIMEPRECISION) for setting the default time unit and precision that should be assumed for simulation when not specified by modules in the design. ([#1113](https://github.com/cocotb/cocotb/pull/1113) ) * New `timeout_time` and `timeout_unit` arguments to [`cocotb.test()`](https://docs.cocotb.org/en/v1.5.2/library_reference.html#cocotb.test "cocotb.test") , for adding test timeouts. ([#1119](https://github.com/cocotb/cocotb/pull/1119) ) * [`cocotb.triggers.with_timeout()`](https://docs.cocotb.org/en/v1.5.2/triggers.html#cocotb.triggers.with_timeout "cocotb.triggers.with_timeout") , for a shorthand for waiting for a trigger with a timeout. ([#1119](https://github.com/cocotb/cocotb/pull/1119) ) * The `expect_error` argument to [`cocotb.test()`](https://docs.cocotb.org/en/v1.5.2/library_reference.html#cocotb.test "cocotb.test") now accepts a specific exception type. ([#1116](https://github.com/cocotb/cocotb/pull/1116) ) * New environment variable [`COCOTB_RESULTS_FILE`](https://docs.cocotb.org/en/v1.5.2/building.html#envvar-COCOTB_RESULTS_FILE) , to allow configuration of the xUnit XML output filename. ([#1053](https://github.com/cocotb/cocotb/pull/1053) ) * A new `bus_separator` argument to `cocotb.drivers.BusDriver`. ([#1160](https://github.com/cocotb/cocotb/pull/1160) ) * A new `start_high` argument to [`cocotb.clock.Clock.start()`](https://docs.cocotb.org/en/v1.5.2/library_reference.html#cocotb.clock.Clock.start "cocotb.clock.Clock.start") . ([#1036](https://github.com/cocotb/cocotb/pull/1036) ) * A new `cocotb.__version__` constant, which contains the version number of the running cocotb. ([#1196](https://github.com/cocotb/cocotb/pull/1196) ) ### Notable changes and bug fixes[¶](https://docs.cocotb.org/en/v1.5.2/release_notes.html#id10 "Permalink to this headline") * `DeprecationWarning`s are now shown in the output by default. * Tracebacks are now preserved correctly for exceptions in Python 2. The tracebacks in all Python versions are now a little shorter. * [`cocotb.external()`](https://docs.cocotb.org/en/v1.5.2/library_reference.html#cocotb.external "cocotb.external") and [`cocotb.function()`](https://docs.cocotb.org/en/v1.5.2/library_reference.html#cocotb.function "cocotb.function") now work more reliably and with fewer race conditions. * A failing `assert` will be considered a test failure. Previously, it was considered a test _error_. * [`drivers()`](https://docs.cocotb.org/en/v1.5.2/library_reference.html#cocotb.handle.NonConstantObject.drivers "cocotb.handle.NonConstantObject.drivers") and [`loads()`](https://docs.cocotb.org/en/v1.5.2/library_reference.html#cocotb.handle.NonConstantObject.loads "cocotb.handle.NonConstantObject.loads") now also work correctly in Python 3.7 onwards. * [`cocotb.triggers.Timer`](https://docs.cocotb.org/en/v1.5.2/triggers.html#cocotb.triggers.Timer "cocotb.triggers.Timer") can now be used with [`decimal.Decimal`](https://docs.python.org/3/library/decimal.html#decimal.Decimal "(in Python v3.9)") instances, allowing constructs like `Timer(Decimal('1e-9'), units='sec')` as an alternate spelling for `Timer(100, units='us')`. ([#1114](https://github.com/cocotb/cocotb/pull/1114) ) * Many (editorial) documentation improvements. ### Deprecations[¶](https://docs.cocotb.org/en/v1.5.2/release_notes.html#deprecations "Permalink to this headline") * `cocotb.result.raise_error` and `cocotb.result.create_error` are deprecated in favor of using Python exceptions directly. [`TestError`](https://docs.cocotb.org/en/v1.5.2/library_reference.html#cocotb.result.TestError "cocotb.result.TestError") can still be used if the same exception type is desired. ([#1109](https://github.com/cocotb/cocotb/pull/1109) ) * The `AvalonSTPktsWithChannel` type is deprecated. Use the `report_channel` argument to `AvalonSTPkts` instead. * The `colour` attribute of log objects like `cocotb.log` or `some_coro.log` is deprecated. Use [`cocotb.utils.want_color_output()`](https://docs.cocotb.org/en/v1.5.2/library_reference.html#cocotb.utils.want_color_output "cocotb.utils.want_color_output") instead. ([#1231](https://github.com/cocotb/cocotb/pull/1231) ) ### Other news[¶](https://docs.cocotb.org/en/v1.5.2/release_notes.html#other-news "Permalink to this headline") * cocotb is now packaged for Fedora Linux and available as [python-cocotb](https://apps.fedoraproject.org/packages/python-cocotb) . ([Fedora bug #1747574](https://bugzilla.redhat.com/show_bug.cgi?id=1747574) ) (thanks Ben Rosser) cocotb 1.2.0[¶](https://docs.cocotb.org/en/v1.5.2/release_notes.html#cocotb-1-2-0 "Permalink to this headline") ---------------------------------------------------------------------------------------------------------------- Released on 24 July 2019 ### New features[¶](https://docs.cocotb.org/en/v1.5.2/release_notes.html#id11 "Permalink to this headline") * cocotb is now built as Python package and installable through pip. ([#517](https://github.com/cocotb/cocotb/pull/517) , [#799](https://github.com/cocotb/cocotb/pull/799) , [#800](https://github.com/cocotb/cocotb/pull/800) , [#803](https://github.com/cocotb/cocotb/pull/803) , [#805](https://github.com/cocotb/cocotb/pull/805) ) * Support for `async` functions and generators was added (Python 3 only). Please have a look at [Coroutines](https://docs.cocotb.org/en/v1.5.2/coroutines.html#async-functions) for an example how to use this new feature. * VHDL block statements can be traversed. ([#850](https://github.com/cocotb/cocotb/pull/850) ) * Support for Python 3.7 was added. ### Notable changes and bug fixes[¶](https://docs.cocotb.org/en/v1.5.2/release_notes.html#id12 "Permalink to this headline") * The heart of cocotb, its scheduler, is now even more robust. Many small bugs, inconsistencies and unreliable behavior have been ironed out. * Exceptions are now correctly propagated between coroutines, giving users the “natural” behavior they’d expect with exceptions. ([#633](https://github.com/cocotb/cocotb/pull/633) ) * The `setimmediatevalue()` function now works for values larger than 32 bit. ([#768](https://github.com/cocotb/cocotb/pull/768) ) * The documentation was cleaned up, improved and extended in various places, making it more consistent and complete. * Tab completion in newer versions of IPython is fixed. ([#825](https://github.com/cocotb/cocotb/pull/825) ) * Python 2.6 is officially not supported any more. cocotb supports Python 2.7 and Python 3.5+. * The cocotb GitHub project moved from `potentialventures/cocotb` to `cocotb/cocotb`. Redirects for old URLs are in place. ### Deprecations[¶](https://docs.cocotb.org/en/v1.5.2/release_notes.html#id13 "Permalink to this headline") * The bits argument to [`BinaryValue`](https://docs.cocotb.org/en/v1.5.2/library_reference.html#cocotb.binary.BinaryValue "cocotb.binary.BinaryValue") , which is now called n\_bits. * The logger attribute of log objects like `cocotb.log` or `some_coro.log`, which is now just an alias for `self`. * The `cocotb.utils.get_python_integer_types` function, which was intended to be private. ### Known issues[¶](https://docs.cocotb.org/en/v1.5.2/release_notes.html#known-issues "Permalink to this headline") * Depending on your simulation, cocotb 1.2 might be roughly 20 percent slower than cocotb 1.1. Much of the work in this release cycle went into fixing correctness bugs in the scheduler, sometimes at the cost of performance. We are continuing to investigate this in issue [#961](https://github.com/cocotb/cocotb/issues/961) . Independent of the cocotb version, we recommend using the latest Python 3 version, which is shown to be significantly faster than previous Python 3 versions, and slightly faster than Python 2.7. Please have a look at the [issue tracker](https://github.com/cocotb/cocotb/issues) for more outstanding issues and contribution opportunities. cocotb 1.1[¶](https://docs.cocotb.org/en/v1.5.2/release_notes.html#cocotb-1-1 "Permalink to this headline") ------------------------------------------------------------------------------------------------------------ Released on 24 January 2019. This release is the result of four years of work with too many bug fixes, improvements and refactorings to name them all. Please have a look at the release announcement [on the mailing list](https://lists.librecores.org/pipermail/cocotb/2019-January/000053.html) for further information. cocotb 1.0[¶](https://docs.cocotb.org/en/v1.5.2/release_notes.html#cocotb-1-0 "Permalink to this headline") ------------------------------------------------------------------------------------------------------------ Released on 15 February 2015. ### New features[¶](https://docs.cocotb.org/en/v1.5.2/release_notes.html#id14 "Permalink to this headline") * FLI support for ModelSim * Mixed Language, Verilog and VHDL * Windows * 300% performance improvement with VHPI interface * WaveDrom support for wave diagrams. cocotb 0.4[¶](https://docs.cocotb.org/en/v1.5.2/release_notes.html#cocotb-0-4 "Permalink to this headline") ------------------------------------------------------------------------------------------------------------ Released on 25 February 2014. ### New features[¶](https://docs.cocotb.org/en/v1.5.2/release_notes.html#id15 "Permalink to this headline") * Issue [#101](https://github.com/cocotb/cocotb/issues/101) : Implement Lock primitive to support mutex * Issue [#105](https://github.com/cocotb/cocotb/issues/105) : Compatibility with Aldec Riviera-Pro * Issue [#109](https://github.com/cocotb/cocotb/issues/109) : Combine multiple `results.xml` into a single results file * Issue [#111](https://github.com/cocotb/cocotb/issues/111) : XGMII drivers and monitors added * Issue [#113](https://github.com/cocotb/cocotb/issues/113) : Add operators to `BinaryValue` class * Issue [#116](https://github.com/cocotb/cocotb/issues/116) : Native VHDL support by implementing VHPI layer * Issue [#117](https://github.com/cocotb/cocotb/issues/117) : Added AXI4-Lite Master BFM ### Bugs fixed[¶](https://docs.cocotb.org/en/v1.5.2/release_notes.html#bugs-fixed "Permalink to this headline") * Issue [#100](https://github.com/cocotb/cocotb/issues/100) : Functional bug in endian\_swapper example RTL * Issue [#102](https://github.com/cocotb/cocotb/issues/102) : Only 1 coroutine wakes up of multiple coroutines wait() on an Event * Issue [#114](https://github.com/cocotb/cocotb/issues/114) : Fix build issues with Cadence IUS simulator ### New examples[¶](https://docs.cocotb.org/en/v1.5.2/release_notes.html#new-examples "Permalink to this headline") * Issue [#106](https://github.com/cocotb/cocotb/issues/106) : TUN/TAP example using ping cocotb 0.3[¶](https://docs.cocotb.org/en/v1.5.2/release_notes.html#cocotb-0-3 "Permalink to this headline") ------------------------------------------------------------------------------------------------------------ Released on 27 September 2013. This contains a raft of fixes and feature enhancements. cocotb 0.2[¶](https://docs.cocotb.org/en/v1.5.2/release_notes.html#cocotb-0-2 "Permalink to this headline") ------------------------------------------------------------------------------------------------------------ Released on 19 July 2013. ### New features[¶](https://docs.cocotb.org/en/v1.5.2/release_notes.html#id16 "Permalink to this headline") * Release 0.2 supports more simulators and increases robustness over 0.1. * A centralized installation is now supported (see documentation) with supporting libraries build when the simulation is run for the first time. cocotb 0.1[¶](https://docs.cocotb.org/en/v1.5.2/release_notes.html#cocotb-0-1 "Permalink to this headline") ------------------------------------------------------------------------------------------------------------ Released on 9 July 2013. * The first release of cocotb. * Allows installation and running against Icarus, VCS, Aldec simulators. --- # Search — cocotb 1.1 documentation * [Docs](https://docs.cocotb.org/en/v1.1/index.html) » * Search * [Edit on GitHub](https://github.com/cocotb/cocotb/blob/v1.1/documentation/source/search.rst) * * * --- # Coroutines — cocotb 1.1 documentation * [Docs](https://docs.cocotb.org/en/v1.2.0/index.html) » * Coroutines * [Edit on GitHub](https://github.com/cocotb/cocotb/blob/v1.2.0/documentation/source/coroutines.rst) * * * Coroutines[¶](https://docs.cocotb.org/en/v1.2.0/coroutines.html#coroutines "Permalink to this headline") ========================================================================================================= Testbenches built using cocotb use coroutines. While the coroutine is executing the simulation is paused. The coroutine uses the [`yield`](https://docs.python.org/3/reference/simple_stmts.html#yield "(in Python v3.8)") keyword to pass control of execution back to the simulator and simulation time can advance again. Typically coroutines [`yield`](https://docs.python.org/3/reference/simple_stmts.html#yield "(in Python v3.8)") a [`Trigger`](https://docs.cocotb.org/en/v1.2.0/library_reference.html#cocotb.triggers.Trigger "cocotb.triggers.Trigger") object which indicates to the simulator some event which will cause the coroutine to be woken when it occurs. For example: @cocotb.coroutine def wait\_10ns(): cocotb.log.info("About to wait for 10ns") yield Timer(10000) cocotb.log.info("Simulation time has advanced by 10 ns") Coroutines may also yield other coroutines: @cocotb.coroutine def wait\_100ns(): for i in range(10): yield wait\_10ns() Coroutines can return a value, so that they can be used by other coroutines. Before Python 3.3, this requires a [`ReturnValue`](https://docs.cocotb.org/en/v1.2.0/library_reference.html#cocotb.result.ReturnValue "cocotb.result.ReturnValue") to be raised. @cocotb.coroutine def get\_signal(clk, signal): yield RisingEdge(clk) raise ReturnValue(signal.value) @cocotb.coroutine def get\_signal\_python\_33(clk, signal): \# newer versions of Python can use return normally yield RisingEdge(clk) return signal.value @cocotb.coroutine def check\_signal\_changes(dut): first \= yield get\_signal(dut.clk, dut.signal) second \= yield get\_signal(dut.clk, dut.signal) if first \== second: raise TestFailure("Signal did not change") Coroutines may also yield a list of triggers and coroutines to indicate that execution should resume if _any_ of them fires: @cocotb.coroutine def packet\_with\_timeout(monitor, timeout): """Wait for a packet but time out if nothing arrives""" yield \[Timer(timeout), RisingEdge(dut.ready)\] The trigger that caused execution to resume is passed back to the coroutine, allowing them to distinguish which trigger fired: @cocotb.coroutine def packet\_with\_timeout(monitor, timeout): """Wait for a packet but time out if nothing arrives""" tout\_trigger \= Timer(timeout) result \= yield \[tout\_trigger, RisingEdge(dut.ready)\] if result is tout\_trigger: raise TestFailure("Timed out waiting for packet") Coroutines can be forked for parallel operation within a function of that code and the forked code. @cocotb.test() def test\_act\_during\_reset(dut): """While reset is active, toggle signals""" tb \= uart\_tb(dut) \# "Clock" is a built in class for toggling a clock signal cocotb.fork(Clock(dut.clk, 1000).start()) \# reset\_dut is a function - \# part of the user-generated "uart\_tb" class cocotb.fork(tb.reset\_dut(dut.rstn, 20000)) yield Timer(10000) print("Reset is still active: %d" % dut.rstn) yield Timer(15000) print("Reset has gone inactive: %d" % dut.rstn) Coroutines can be joined to end parallel operation within a function. @cocotb.test() def test\_count\_edge\_cycles(dut, period\=1000, clocks\=6): cocotb.fork(Clock(dut.clk, period).start()) yield RisingEdge(dut.clk) timer \= Timer(period + 10) task \= cocotb.fork(count\_edges\_cycles(dut.clk, clocks)) count \= 0 expect \= clocks \- 1 while True: result \= yield \[timer, task.join()\] if count \> expect: raise TestFailure("Task didn't complete in expected time") if result is timer: dut.\_log.info("Count %d: Task still running" % count) count += 1 else: break Coroutines can be killed before they complete, forcing their completion before they’d naturally end. @cocotb.test() def test\_different\_clocks(dut): clk\_1mhz \= Clock(dut.clk, 1.0, units\='us') clk\_250mhz \= Clock(dut.clk, 4.0, units\='ns') clk\_gen \= cocotb.fork(clk\_1mhz.start()) start\_time\_ns \= get\_sim\_time(units\='ns') yield Timer(1) yield RisingEdge(dut.clk) edge\_time\_ns \= get\_sim\_time(units\='ns') \# NOTE: isclose is a python 3.5+ feature if not isclose(edge\_time\_ns, start\_time\_ns + 1000.0): raise TestFailure("Expected a period of 1 us") clk\_gen.kill() clk\_gen \= cocotb.fork(clk\_250mhz.start()) start\_time\_ns \= get\_sim\_time(units\='ns') yield Timer(1) yield RisingEdge(dut.clk) edge\_time\_ns \= get\_sim\_time(units\='ns') \# NOTE: isclose is a python 3.5+ feature if not isclose(edge\_time\_ns, start\_time\_ns + 4.0): raise TestFailure("Expected a period of 4 ns") Async functions[¶](https://docs.cocotb.org/en/v1.2.0/coroutines.html#async-functions "Permalink to this headline") ------------------------------------------------------------------------------------------------------------------- Python 3.5 introduces [`async`](https://docs.python.org/3/reference/compound_stmts.html#async "(in Python v3.8)") functions, which provide an alternative syntax. For example: @cocotb.coroutine async def wait\_10ns(): cocotb.log.info("About to wait for 10 ns") await Timer(10000) cocotb.log.info("Simulation time has advanced by 10 ns") To wait on a trigger or a nested coroutine, these use [`await`](https://docs.python.org/3/reference/expressions.html#await "(in Python v3.8)") instead of [`yield`](https://docs.python.org/3/reference/simple_stmts.html#yield "(in Python v3.8)") . Provided they are decorated with `@cocotb.coroutine`, `async def` functions using [`await`](https://docs.python.org/3/reference/expressions.html#await "(in Python v3.8)") and regular functions using [`yield`](https://docs.python.org/3/reference/simple_stmts.html#yield "(in Python v3.8)") can be used interchangeable - the appropriate keyword to use is determined by which type of function it appears in, not by the sub-coroutinue being called. Note It is not legal to `await` a list of triggers as can be done in `yield`\-based coroutine with `yield [trig1, trig2]`. Use `await First(trig1, trig2)` instead. ### Async generators[¶](https://docs.cocotb.org/en/v1.2.0/coroutines.html#async-generators "Permalink to this headline") In Python 3.6, a `yield` statement within an `async` function has a new meaning (rather than being a `SyntaxError`) which matches the typical meaning of `yield` within regular python code. It can be used to create a special type of generator function that can be iterated with `async for`: async def ten\_samples\_of(clk, signal): for i in range(10): await RisingEdge(clk) yield signal.value \# this means "send back to the for loop" @cocotb.test() async def test\_samples\_are\_even(dut): async for sample in ten\_samples\_of(dut.clk, dut.signal): assert sample % 2 \== 0 More details on this type of generator can be found in [**PEP 525**](https://www.python.org/dev/peps/pep-0525) . --- # Triggers — cocotb 1.3.1 documentation * [Docs](https://docs.cocotb.org/en/v1.3.1/index.html) » * Triggers * [Edit on GitHub](https://github.com/cocotb/cocotb/blob/v1.3.1/documentation/source/triggers.rst) * * * Triggers[¶](https://docs.cocotb.org/en/v1.3.1/triggers.html#triggers "Permalink to this headline") =================================================================================================== Triggers are used to indicate when the cocotb scheduler should resume coroutine execution. To use a trigger, a coroutine should [`await`](https://docs.python.org/3/reference/expressions.html#await "(in Python v3.8)") or [`yield`](https://docs.python.org/3/reference/simple_stmts.html#yield "(in Python v3.8)") it. This will cause execution of the current coroutine to pause. When the trigger fires, execution of the paused coroutine will resume: @cocotb.coroutine def coro(): print("Some time before the edge") yield RisingEdge(clk) print("Immediately after the edge") Or using the syntax in Python 3.5 onwards: @cocotb.coroutine async def coro(): print("Some time before the edge") await RisingEdge(clk) print("Immediately after the edge") Simulator Triggers[¶](https://docs.cocotb.org/en/v1.3.1/triggers.html#simulator-triggers "Permalink to this headline") ----------------------------------------------------------------------------------------------------------------------- ### Signals[¶](https://docs.cocotb.org/en/v1.3.1/triggers.html#signals "Permalink to this headline") _class_ `cocotb.triggers.``Edge`(_signal_)[\[source\]](https://docs.cocotb.org/en/v1.3.1/_modules/cocotb/triggers.html#Edge) [¶](https://docs.cocotb.org/en/v1.3.1/triggers.html#cocotb.triggers.Edge "Permalink to this definition") Fires on any value change of _signal_. _class_ `cocotb.triggers.``RisingEdge`(_signal_)[\[source\]](https://docs.cocotb.org/en/v1.3.1/_modules/cocotb/triggers.html#RisingEdge) [¶](https://docs.cocotb.org/en/v1.3.1/triggers.html#cocotb.triggers.RisingEdge "Permalink to this definition") Fires on the rising edge of _signal_, on a transition from `0` to `1`. _class_ `cocotb.triggers.``FallingEdge`(_signal_)[\[source\]](https://docs.cocotb.org/en/v1.3.1/_modules/cocotb/triggers.html#FallingEdge) [¶](https://docs.cocotb.org/en/v1.3.1/triggers.html#cocotb.triggers.FallingEdge "Permalink to this definition") Fires on the falling edge of _signal_, on a transition from `1` to `0`. _class_ `cocotb.triggers.``ClockCycles`(_signal_, _num\_cycles_, _rising=True_)[\[source\]](https://docs.cocotb.org/en/v1.3.1/_modules/cocotb/triggers.html#ClockCycles) [¶](https://docs.cocotb.org/en/v1.3.1/triggers.html#cocotb.triggers.ClockCycles "Permalink to this definition") Fires after _num\_cycles_ transitions of _signal_ from `0` to `1`. Parameters * **signal** – The signal to monitor. * **num\_cycles** ([_int_](https://docs.python.org/3/library/functions.html#int "(in Python v3.8)") ) – The number of cycles to count. * **rising** ([_bool_](https://docs.python.org/3/library/functions.html#bool "(in Python v3.8)") _,_ _optional_) – If `True`, the default, count rising edges. Otherwise, count falling edges. ### Timing[¶](https://docs.cocotb.org/en/v1.3.1/triggers.html#timing "Permalink to this headline") _class_ `cocotb.triggers.``Timer`(_time\_ps_, _units=None_)[\[source\]](https://docs.cocotb.org/en/v1.3.1/_modules/cocotb/triggers.html#Timer) [¶](https://docs.cocotb.org/en/v1.3.1/triggers.html#cocotb.triggers.Timer "Permalink to this definition") Fires after the specified simulation time period has elapsed. Parameters * **time\_ps** ([_numbers.Real_](https://docs.python.org/3/library/numbers.html#numbers.Real "(in Python v3.8)") _or_ [_decimal.Decimal_](https://docs.python.org/3/library/decimal.html#decimal.Decimal "(in Python v3.8)") ) – The time value. Note that despite the name this is not actually in picoseconds but depends on the _units_ argument. * **units** ([_str_](https://docs.python.org/3/library/stdtypes.html#str "(in Python v3.8)") _or_ [_None_](https://docs.python.org/3/library/constants.html#None "(in Python v3.8)") _,_ _optional_) – One of `None`, `'fs'`, `'ps'`, `'ns'`, `'us'`, `'ms'`, `'sec'`. When no _units_ is given (`None`) the timestep is determined by the simulator. Examples \>>> yield Timer(100, units\='ps') The time can also be a `float`: \>>> yield Timer(100e-9, units\='sec') which is particularly convenient when working with frequencies: \>>> freq \= 10e6 \# 10 MHz \>>> yield Timer(1 / freq, units\='sec') Other builtin exact numeric types can be used too: \>>> from fractions import Fraction \>>> yield Timer(Fraction(1, 10), units\='ns') \>>> from decimal import Decimal \>>> yield Timer(Decimal('100e-9'), units\='sec') These are most useful when using computed durations while avoiding floating point inaccuracies. See also [`get_sim_steps()`](https://docs.cocotb.org/en/v1.3.1/library_reference.html#cocotb.utils.get_sim_steps "cocotb.utils.get_sim_steps") _class_ `cocotb.triggers.``ReadOnly`[\[source\]](https://docs.cocotb.org/en/v1.3.1/_modules/cocotb/triggers.html#ReadOnly) [¶](https://docs.cocotb.org/en/v1.3.1/triggers.html#cocotb.triggers.ReadOnly "Permalink to this definition") Fires when the current simulation timestep moves to the read-only phase. The read-only phase is entered when the current timestep no longer has any further delta steps. This will be a point where all the signal values are stable as there are no more RTL events scheduled for the timestep. The simulator will not allow scheduling of more events in this timestep. Useful for monitors which need to wait for all processes to execute (both RTL and cocotb) to ensure sampled signal values are final. _class_ `cocotb.triggers.``ReadWrite`[\[source\]](https://docs.cocotb.org/en/v1.3.1/_modules/cocotb/triggers.html#ReadWrite) [¶](https://docs.cocotb.org/en/v1.3.1/triggers.html#cocotb.triggers.ReadWrite "Permalink to this definition") Fires when the read-write portion of the sim cycles is reached. _class_ `cocotb.triggers.``NextTimeStep`[\[source\]](https://docs.cocotb.org/en/v1.3.1/_modules/cocotb/triggers.html#NextTimeStep) [¶](https://docs.cocotb.org/en/v1.3.1/triggers.html#cocotb.triggers.NextTimeStep "Permalink to this definition") Fires when the next time step is started. Python Triggers[¶](https://docs.cocotb.org/en/v1.3.1/triggers.html#python-triggers "Permalink to this headline") ----------------------------------------------------------------------------------------------------------------- _class_ `cocotb.triggers.``Combine`(_\*triggers_)[\[source\]](https://docs.cocotb.org/en/v1.3.1/_modules/cocotb/triggers.html#Combine) [¶](https://docs.cocotb.org/en/v1.3.1/triggers.html#cocotb.triggers.Combine "Permalink to this definition") Fires when all of _triggers_ have fired. Like most triggers, this simply returns itself. _class_ `cocotb.triggers.``First`(_\*triggers_)[\[source\]](https://docs.cocotb.org/en/v1.3.1/_modules/cocotb/triggers.html#First) [¶](https://docs.cocotb.org/en/v1.3.1/triggers.html#cocotb.triggers.First "Permalink to this definition") Fires when the first trigger in _triggers_ fires. Returns the result of the trigger that fired. As a shorthand, `t = yield [a, b]` can be used instead of `t = yield First(a, b)`. Note that this shorthand is not available when using [`await`](https://docs.python.org/3/reference/expressions.html#await "(in Python v3.8)") . Note The event loop is single threaded, so while events may be simultaneous in simulation time, they can never be simultaneous in real time. For this reason, the value of `t_ret is t1` in the following example is implementation-defined, and will vary by simulator: t1 \= Timer(10, units\='ps') t2 \= Timer(10, units\='ps') t\_ret \= yield First(t1, t2) _class_ `cocotb.triggers.``Join`(_coroutine_)[\[source\]](https://docs.cocotb.org/en/v1.3.1/_modules/cocotb/triggers.html#Join) [¶](https://docs.cocotb.org/en/v1.3.1/triggers.html#cocotb.triggers.Join "Permalink to this definition") Fires when a [`fork()`](https://docs.cocotb.org/en/v1.3.1/library_reference.html#cocotb.fork "cocotb.fork") ed coroutine completes. The result of blocking on the trigger can be used to get the coroutine result: @cocotb.coroutine() def coro\_inner(): yield Timer(1, units\='ns') raise ReturnValue("Hello world") task \= cocotb.fork(coro\_inner()) result \= yield Join(task) assert result \== "Hello world" Or using the syntax in Python 3.5 onwards: @cocotb.coroutine() async def coro\_inner(): await Timer(1, units\='ns') return "Hello world" task \= cocotb.fork(coro\_inner()) result \= await Join(task) assert result \== "Hello world" If the coroutine threw an exception, the [`await`](https://docs.python.org/3/reference/expressions.html#await "(in Python v3.8)") or [`yield`](https://docs.python.org/3/reference/simple_stmts.html#yield "(in Python v3.8)") will re-raise it. _property_ `retval`[¶](https://docs.cocotb.org/en/v1.3.1/triggers.html#cocotb.triggers.Join.retval "Permalink to this definition") The return value of the joined coroutine. Note Typically there is no need to use this attribute - the following code samples are equivalent: forked \= cocotb.fork(mycoro()) j \= Join(forked) yield j result \= j.retval forked \= cocotb.fork(mycoro()) result \= yield Join(forked) ### Synchronization[¶](https://docs.cocotb.org/en/v1.3.1/triggers.html#synchronization "Permalink to this headline") These are not `Trigger`s themselves, but contain methods that can be used as triggers. These are used to synchronize coroutines with each other. _class_ `cocotb.triggers.``Event`(_name=''_)[\[source\]](https://docs.cocotb.org/en/v1.3.1/_modules/cocotb/triggers.html#Event) [¶](https://docs.cocotb.org/en/v1.3.1/triggers.html#cocotb.triggers.Event "Permalink to this definition") Event to permit synchronization between two coroutines. Yielding [`wait()`](https://docs.cocotb.org/en/v1.3.1/triggers.html#cocotb.triggers.Event.wait "cocotb.triggers.Event.wait") from one coroutine will block the coroutine until [`set()`](https://docs.cocotb.org/en/v1.3.1/triggers.html#cocotb.triggers.Event.set "cocotb.triggers.Event.set") is called somewhere else. `set`(_data=None_)[\[source\]](https://docs.cocotb.org/en/v1.3.1/_modules/cocotb/triggers.html#Event.set) [¶](https://docs.cocotb.org/en/v1.3.1/triggers.html#cocotb.triggers.Event.set "Permalink to this definition") Wake up all coroutines blocked on this event. `wait`()[\[source\]](https://docs.cocotb.org/en/v1.3.1/_modules/cocotb/triggers.html#Event.wait) [¶](https://docs.cocotb.org/en/v1.3.1/triggers.html#cocotb.triggers.Event.wait "Permalink to this definition") Get a trigger which fires when another coroutine sets the event. If the event has already been set, the trigger will fire immediately. To reset the event (and enable the use of `wait` again), [`clear()`](https://docs.cocotb.org/en/v1.3.1/triggers.html#cocotb.triggers.Event.clear "cocotb.triggers.Event.clear") should be called. `clear`()[\[source\]](https://docs.cocotb.org/en/v1.3.1/_modules/cocotb/triggers.html#Event.clear) [¶](https://docs.cocotb.org/en/v1.3.1/triggers.html#cocotb.triggers.Event.clear "Permalink to this definition") Clear this event that has fired. Subsequent calls to [`wait()`](https://docs.cocotb.org/en/v1.3.1/triggers.html#cocotb.triggers.Event.wait "cocotb.triggers.Event.wait") will block until [`set()`](https://docs.cocotb.org/en/v1.3.1/triggers.html#cocotb.triggers.Event.set "cocotb.triggers.Event.set") is called again. _class_ `cocotb.triggers.``Lock`(_name=''_)[\[source\]](https://docs.cocotb.org/en/v1.3.1/_modules/cocotb/triggers.html#Lock) [¶](https://docs.cocotb.org/en/v1.3.1/triggers.html#cocotb.triggers.Lock "Permalink to this definition") Lock primitive (not re-entrant). This should be used as: yield lock.acquire() try: \# do some stuff finally: lock.release() `locked` _= None_[¶](https://docs.cocotb.org/en/v1.3.1/triggers.html#cocotb.triggers.Lock.locked "Permalink to this definition") `True` if the lock is held. `acquire`()[\[source\]](https://docs.cocotb.org/en/v1.3.1/_modules/cocotb/triggers.html#Lock.acquire) [¶](https://docs.cocotb.org/en/v1.3.1/triggers.html#cocotb.triggers.Lock.acquire "Permalink to this definition") Produce a trigger which fires when the lock is acquired. `release`()[\[source\]](https://docs.cocotb.org/en/v1.3.1/_modules/cocotb/triggers.html#Lock.release) [¶](https://docs.cocotb.org/en/v1.3.1/triggers.html#cocotb.triggers.Lock.release "Permalink to this definition") Release the lock. `cocotb.triggers.``with_timeout`()[\[source\]](https://docs.cocotb.org/en/v1.3.1/_modules/cocotb/triggers.html#with_timeout) [¶](https://docs.cocotb.org/en/v1.3.1/triggers.html#cocotb.triggers.with_timeout "Permalink to this definition") Waits on triggers, throws an exception if it waits longer than the given time. Usage: yield with\_timeout(coro, 100, 'ns') yield with\_timeout(First(coro, event.wait()), 100, 'ns') Parameters * **trigger** (_cocotb\_waitable_) – A single object that could be right of a [`yield`](https://docs.python.org/3/reference/simple_stmts.html#yield "(in Python v3.8)") (or [`await`](https://docs.python.org/3/reference/expressions.html#await "(in Python v3.8)") in Python 3) expression in cocotb. * **timeout\_time** ([_numbers.Real_](https://docs.python.org/3/library/numbers.html#numbers.Real "(in Python v3.8)") _or_ [_decimal.Decimal_](https://docs.python.org/3/library/decimal.html#decimal.Decimal "(in Python v3.8)") ) – Time duration. * **timeout\_unit** ([_str_](https://docs.python.org/3/library/stdtypes.html#str "(in Python v3.8)") _or_ [_None_](https://docs.python.org/3/library/constants.html#None "(in Python v3.8)") _,_ _optional_) – Units of duration, accepts any values that [`Timer`](https://docs.cocotb.org/en/v1.3.1/triggers.html#cocotb.triggers.Timer "cocotb.triggers.Timer") does. Returns First trigger that completed if timeout did not occur. Raises [**SimTimeoutError**](https://docs.cocotb.org/en/v1.3.1/library_reference.html#cocotb.result.SimTimeoutError "cocotb.result.SimTimeoutError") – If timeout occurs. New in version 1.3. --- # Triggers — cocotb 1.3.0 documentation * [Docs](https://docs.cocotb.org/en/v1.3.0/index.html) » * Triggers * [Edit on GitHub](https://github.com/cocotb/cocotb/blob/v1.3.0/documentation/source/triggers.rst) * * * Triggers[¶](https://docs.cocotb.org/en/v1.3.0/triggers.html#triggers "Permalink to this headline") =================================================================================================== Triggers are used to indicate when the cocotb scheduler should resume coroutine execution. To use a trigger, a coroutine should [`await`](https://docs.python.org/3/reference/expressions.html#await "(in Python v3.8)") or [`yield`](https://docs.python.org/3/reference/simple_stmts.html#yield "(in Python v3.8)") it. This will cause execution of the current coroutine to pause. When the trigger fires, execution of the paused coroutine will resume: @cocotb.coroutine def coro(): print("Some time before the edge") yield RisingEdge(clk) print("Immediately after the edge") Or using the syntax in Python 3.5 onwards: @cocotb.coroutine async def coro(): print("Some time before the edge") await RisingEdge(clk) print("Immediately after the edge") Simulator Triggers[¶](https://docs.cocotb.org/en/v1.3.0/triggers.html#simulator-triggers "Permalink to this headline") ----------------------------------------------------------------------------------------------------------------------- ### Signals[¶](https://docs.cocotb.org/en/v1.3.0/triggers.html#signals "Permalink to this headline") _class_ `cocotb.triggers.``Edge`(_signal_)[\[source\]](https://docs.cocotb.org/en/v1.3.0/_modules/cocotb/triggers.html#Edge) [¶](https://docs.cocotb.org/en/v1.3.0/triggers.html#cocotb.triggers.Edge "Permalink to this definition") Fires on any value change of _signal_. _class_ `cocotb.triggers.``RisingEdge`(_signal_)[\[source\]](https://docs.cocotb.org/en/v1.3.0/_modules/cocotb/triggers.html#RisingEdge) [¶](https://docs.cocotb.org/en/v1.3.0/triggers.html#cocotb.triggers.RisingEdge "Permalink to this definition") Fires on the rising edge of _signal_, on a transition from `0` to `1`. _class_ `cocotb.triggers.``FallingEdge`(_signal_)[\[source\]](https://docs.cocotb.org/en/v1.3.0/_modules/cocotb/triggers.html#FallingEdge) [¶](https://docs.cocotb.org/en/v1.3.0/triggers.html#cocotb.triggers.FallingEdge "Permalink to this definition") Fires on the falling edge of _signal_, on a transition from `1` to `0`. _class_ `cocotb.triggers.``ClockCycles`(_signal_, _num\_cycles_, _rising=True_)[\[source\]](https://docs.cocotb.org/en/v1.3.0/_modules/cocotb/triggers.html#ClockCycles) [¶](https://docs.cocotb.org/en/v1.3.0/triggers.html#cocotb.triggers.ClockCycles "Permalink to this definition") Fires after _num\_cycles_ transitions of _signal_ from `0` to `1`. Parameters * **signal** – The signal to monitor. * **num\_cycles** ([_int_](https://docs.python.org/3/library/functions.html#int "(in Python v3.8)") ) – The number of cycles to count. * **rising** ([_bool_](https://docs.python.org/3/library/functions.html#bool "(in Python v3.8)") _,_ _optional_) – If `True`, the default, count rising edges. Otherwise, count falling edges. ### Timing[¶](https://docs.cocotb.org/en/v1.3.0/triggers.html#timing "Permalink to this headline") _class_ `cocotb.triggers.``Timer`(_time\_ps_, _units=None_)[\[source\]](https://docs.cocotb.org/en/v1.3.0/_modules/cocotb/triggers.html#Timer) [¶](https://docs.cocotb.org/en/v1.3.0/triggers.html#cocotb.triggers.Timer "Permalink to this definition") Fires after the specified simulation time period has elapsed. Parameters * **time\_ps** ([_numbers.Real_](https://docs.python.org/3/library/numbers.html#numbers.Real "(in Python v3.8)") _or_ [_decimal.Decimal_](https://docs.python.org/3/library/decimal.html#decimal.Decimal "(in Python v3.8)") ) – The time value. Note that despite the name this is not actually in picoseconds but depends on the _units_ argument. * **units** ([_str_](https://docs.python.org/3/library/stdtypes.html#str "(in Python v3.8)") _or_ [_None_](https://docs.python.org/3/library/constants.html#None "(in Python v3.8)") _,_ _optional_) – One of `None`, `'fs'`, `'ps'`, `'ns'`, `'us'`, `'ms'`, `'sec'`. When no _units_ is given (`None`) the timestep is determined by the simulator. Examples \>>> yield Timer(100, units\='ps') The time can also be a `float`: \>>> yield Timer(100e-9, units\='sec') which is particularly convenient when working with frequencies: \>>> freq \= 10e6 \# 10 MHz \>>> yield Timer(1 / freq, units\='sec') Other builtin exact numeric types can be used too: \>>> from fractions import Fraction \>>> yield Timer(Fraction(1, 10), units\='ns') \>>> from decimal import Decimal \>>> yield Timer(Decimal('100e-9'), units\='sec') These are most useful when using computed durations while avoiding floating point inaccuracies. See also [`get_sim_steps()`](https://docs.cocotb.org/en/v1.3.0/library_reference.html#cocotb.utils.get_sim_steps "cocotb.utils.get_sim_steps") _class_ `cocotb.triggers.``ReadOnly`[\[source\]](https://docs.cocotb.org/en/v1.3.0/_modules/cocotb/triggers.html#ReadOnly) [¶](https://docs.cocotb.org/en/v1.3.0/triggers.html#cocotb.triggers.ReadOnly "Permalink to this definition") Fires when the current simulation timestep moves to the read-only phase. The read-only phase is entered when the current timestep no longer has any further delta steps. This will be a point where all the signal values are stable as there are no more RTL events scheduled for the timestep. The simulator will not allow scheduling of more events in this timestep. Useful for monitors which need to wait for all processes to execute (both RTL and cocotb) to ensure sampled signal values are final. _class_ `cocotb.triggers.``ReadWrite`[\[source\]](https://docs.cocotb.org/en/v1.3.0/_modules/cocotb/triggers.html#ReadWrite) [¶](https://docs.cocotb.org/en/v1.3.0/triggers.html#cocotb.triggers.ReadWrite "Permalink to this definition") Fires when the read-write portion of the sim cycles is reached. _class_ `cocotb.triggers.``NextTimeStep`[\[source\]](https://docs.cocotb.org/en/v1.3.0/_modules/cocotb/triggers.html#NextTimeStep) [¶](https://docs.cocotb.org/en/v1.3.0/triggers.html#cocotb.triggers.NextTimeStep "Permalink to this definition") Fires when the next time step is started. Python Triggers[¶](https://docs.cocotb.org/en/v1.3.0/triggers.html#python-triggers "Permalink to this headline") ----------------------------------------------------------------------------------------------------------------- _class_ `cocotb.triggers.``Combine`(_\*triggers_)[\[source\]](https://docs.cocotb.org/en/v1.3.0/_modules/cocotb/triggers.html#Combine) [¶](https://docs.cocotb.org/en/v1.3.0/triggers.html#cocotb.triggers.Combine "Permalink to this definition") Fires when all of _triggers_ have fired. Like most triggers, this simply returns itself. _class_ `cocotb.triggers.``First`(_\*triggers_)[\[source\]](https://docs.cocotb.org/en/v1.3.0/_modules/cocotb/triggers.html#First) [¶](https://docs.cocotb.org/en/v1.3.0/triggers.html#cocotb.triggers.First "Permalink to this definition") Fires when the first trigger in _triggers_ fires. Returns the result of the trigger that fired. As a shorthand, `t = yield [a, b]` can be used instead of `t = yield First(a, b)`. Note that this shorthand is not available when using [`await`](https://docs.python.org/3/reference/expressions.html#await "(in Python v3.8)") . Note The event loop is single threaded, so while events may be simultaneous in simulation time, they can never be simultaneous in real time. For this reason, the value of `t_ret is t1` in the following example is implementation-defined, and will vary by simulator: t1 \= Timer(10, units\='ps') t2 \= Timer(10, units\='ps') t\_ret \= yield First(t1, t2) _class_ `cocotb.triggers.``Join`(_coroutine_)[\[source\]](https://docs.cocotb.org/en/v1.3.0/_modules/cocotb/triggers.html#Join) [¶](https://docs.cocotb.org/en/v1.3.0/triggers.html#cocotb.triggers.Join "Permalink to this definition") Fires when a [`fork()`](https://docs.cocotb.org/en/v1.3.0/library_reference.html#cocotb.fork "cocotb.fork") ed coroutine completes. The result of blocking on the trigger can be used to get the coroutine result: @cocotb.coroutine() def coro\_inner(): yield Timer(1, units\='ns') raise ReturnValue("Hello world") task \= cocotb.fork(coro\_inner()) result \= yield Join(task) assert result \== "Hello world" Or using the syntax in Python 3.5 onwards: @cocotb.coroutine() async def coro\_inner(): await Timer(1, units\='ns') return "Hello world" task \= cocotb.fork(coro\_inner()) result \= await Join(task) assert result \== "Hello world" If the coroutine threw an exception, the [`await`](https://docs.python.org/3/reference/expressions.html#await "(in Python v3.8)") or [`yield`](https://docs.python.org/3/reference/simple_stmts.html#yield "(in Python v3.8)") will re-raise it. _property_ `retval`[¶](https://docs.cocotb.org/en/v1.3.0/triggers.html#cocotb.triggers.Join.retval "Permalink to this definition") The return value of the joined coroutine. Note Typically there is no need to use this attribute - the following code samples are equivalent: forked \= cocotb.fork(mycoro()) j \= Join(forked) yield j result \= j.retval forked \= cocotb.fork(mycoro()) result \= yield Join(forked) ### Synchronization[¶](https://docs.cocotb.org/en/v1.3.0/triggers.html#synchronization "Permalink to this headline") These are not `Trigger`s themselves, but contain methods that can be used as triggers. These are used to synchronize coroutines with each other. _class_ `cocotb.triggers.``Event`(_name=''_)[\[source\]](https://docs.cocotb.org/en/v1.3.0/_modules/cocotb/triggers.html#Event) [¶](https://docs.cocotb.org/en/v1.3.0/triggers.html#cocotb.triggers.Event "Permalink to this definition") Event to permit synchronization between two coroutines. Yielding [`wait()`](https://docs.cocotb.org/en/v1.3.0/triggers.html#cocotb.triggers.Event.wait "cocotb.triggers.Event.wait") from one coroutine will block the coroutine until [`set()`](https://docs.cocotb.org/en/v1.3.0/triggers.html#cocotb.triggers.Event.set "cocotb.triggers.Event.set") is called somewhere else. `set`(_data=None_)[\[source\]](https://docs.cocotb.org/en/v1.3.0/_modules/cocotb/triggers.html#Event.set) [¶](https://docs.cocotb.org/en/v1.3.0/triggers.html#cocotb.triggers.Event.set "Permalink to this definition") Wake up all coroutines blocked on this event. `wait`()[\[source\]](https://docs.cocotb.org/en/v1.3.0/_modules/cocotb/triggers.html#Event.wait) [¶](https://docs.cocotb.org/en/v1.3.0/triggers.html#cocotb.triggers.Event.wait "Permalink to this definition") Get a trigger which fires when another coroutine sets the event. If the event has already been set, the trigger will fire immediately. To reset the event (and enable the use of `wait` again), [`clear()`](https://docs.cocotb.org/en/v1.3.0/triggers.html#cocotb.triggers.Event.clear "cocotb.triggers.Event.clear") should be called. `clear`()[\[source\]](https://docs.cocotb.org/en/v1.3.0/_modules/cocotb/triggers.html#Event.clear) [¶](https://docs.cocotb.org/en/v1.3.0/triggers.html#cocotb.triggers.Event.clear "Permalink to this definition") Clear this event that has fired. Subsequent calls to [`wait()`](https://docs.cocotb.org/en/v1.3.0/triggers.html#cocotb.triggers.Event.wait "cocotb.triggers.Event.wait") will block until [`set()`](https://docs.cocotb.org/en/v1.3.0/triggers.html#cocotb.triggers.Event.set "cocotb.triggers.Event.set") is called again. _class_ `cocotb.triggers.``Lock`(_name=''_)[\[source\]](https://docs.cocotb.org/en/v1.3.0/_modules/cocotb/triggers.html#Lock) [¶](https://docs.cocotb.org/en/v1.3.0/triggers.html#cocotb.triggers.Lock "Permalink to this definition") Lock primitive (not re-entrant). This should be used as: yield lock.acquire() try: \# do some stuff finally: lock.release() `locked` _= None_[¶](https://docs.cocotb.org/en/v1.3.0/triggers.html#cocotb.triggers.Lock.locked "Permalink to this definition") `True` if the lock is held. `acquire`()[\[source\]](https://docs.cocotb.org/en/v1.3.0/_modules/cocotb/triggers.html#Lock.acquire) [¶](https://docs.cocotb.org/en/v1.3.0/triggers.html#cocotb.triggers.Lock.acquire "Permalink to this definition") Produce a trigger which fires when the lock is acquired. `release`()[\[source\]](https://docs.cocotb.org/en/v1.3.0/_modules/cocotb/triggers.html#Lock.release) [¶](https://docs.cocotb.org/en/v1.3.0/triggers.html#cocotb.triggers.Lock.release "Permalink to this definition") Release the lock. `cocotb.triggers.``with_timeout`()[\[source\]](https://docs.cocotb.org/en/v1.3.0/_modules/cocotb/triggers.html#with_timeout) [¶](https://docs.cocotb.org/en/v1.3.0/triggers.html#cocotb.triggers.with_timeout "Permalink to this definition") Waits on triggers, throws an exception if it waits longer than the given time. Usage: yield with\_timeout(coro, 100, 'ns') yield with\_timeout(First(coro, event.wait()), 100, 'ns') Parameters * **trigger** (_cocotb\_waitable_) – A single object that could be right of a [`yield`](https://docs.python.org/3/reference/simple_stmts.html#yield "(in Python v3.8)") (or [`await`](https://docs.python.org/3/reference/expressions.html#await "(in Python v3.8)") in Python 3) expression in cocotb. * **timeout\_time** ([_numbers.Real_](https://docs.python.org/3/library/numbers.html#numbers.Real "(in Python v3.8)") _or_ [_decimal.Decimal_](https://docs.python.org/3/library/decimal.html#decimal.Decimal "(in Python v3.8)") ) – Time duration. * **timeout\_unit** ([_str_](https://docs.python.org/3/library/stdtypes.html#str "(in Python v3.8)") _or_ [_None_](https://docs.python.org/3/library/constants.html#None "(in Python v3.8)") _,_ _optional_) – Units of duration, accepts any values that [`Timer`](https://docs.cocotb.org/en/v1.3.0/triggers.html#cocotb.triggers.Timer "cocotb.triggers.Timer") does. Returns First trigger that completed if timeout did not occur. Raises [**SimTimeoutError**](https://docs.cocotb.org/en/v1.3.0/library_reference.html#cocotb.result.SimTimeoutError "cocotb.result.SimTimeoutError") – If timeout occurs. New in version 1.3. --- # Further Resources — cocotb 1.6.0.dev0+gec99a877.d20210503 documentation * [](https://docs.cocotb.org/en/v1.5.2/index.html) » * Further Resources * [Edit on GitHub](https://github.com/cocotb/cocotb/blob/v1.5.2/documentation/source/further_resources.rst) * * * Further Resources[¶](https://docs.cocotb.org/en/v1.5.2/further_resources.html#further-resources "Permalink to this headline") ============================================================================================================================== We have a list of talks and papers, libraries and examples at our Wiki page [Further Resources](https://github.com/cocotb/cocotb/wiki/Further-Resources) . Feel free to add links to cocotb-related content that we are still missing! --- # Triggers — cocotb 1.1 documentation * [Docs](https://docs.cocotb.org/en/v1.2.0/index.html) » * Triggers * [Edit on GitHub](https://github.com/cocotb/cocotb/blob/v1.2.0/documentation/source/triggers.rst) * * * Triggers[¶](https://docs.cocotb.org/en/v1.2.0/triggers.html#triggers "Permalink to this headline") =================================================================================================== Triggers are used to indicate when the cocotb scheduler should resume coroutine execution. Typically a coroutine will [`yield`](https://docs.python.org/3/reference/simple_stmts.html#yield "(in Python v3.8)") a trigger or a list of triggers, while it is waiting for them to complete. Simulation Timing[¶](https://docs.cocotb.org/en/v1.2.0/triggers.html#simulation-timing "Permalink to this headline") --------------------------------------------------------------------------------------------------------------------- [`Timer(time)`](https://docs.cocotb.org/en/v1.2.0/library_reference.html#cocotb.triggers.Timer "cocotb.triggers.Timer") Registers a timed callback with the simulator to continue execution of the coroutine after a specified simulation time period has elapsed. [`ReadOnly()`](https://docs.cocotb.org/en/v1.2.0/library_reference.html#cocotb.triggers.ReadOnly "cocotb.triggers.ReadOnly") Registers a callback which will continue execution of the coroutine when the current simulation timestep moves to the [`ReadOnly`](https://docs.cocotb.org/en/v1.2.0/library_reference.html#cocotb.triggers.ReadOnly "cocotb.triggers.ReadOnly") phase of the RTL simulator. The [`ReadOnly`](https://docs.cocotb.org/en/v1.2.0/library_reference.html#cocotb.triggers.ReadOnly "cocotb.triggers.ReadOnly") phase is entered when the current timestep no longer has any further delta steps. This should be a point where all the signal values are stable as there are no more RTL events scheduled for the timestep. The simulator should not allow scheduling of more events in this timestep. Useful for monitors which need to wait for all processes to execute (both RTL and cocotb) to ensure sampled signal values are final. Signal related[¶](https://docs.cocotb.org/en/v1.2.0/triggers.html#signal-related "Permalink to this headline") --------------------------------------------------------------------------------------------------------------- [`Edge(signal)`](https://docs.cocotb.org/en/v1.2.0/library_reference.html#cocotb.triggers.Edge "cocotb.triggers.Edge") Registers a callback that will continue execution of the coroutine on any value change of _signal_. [`RisingEdge(signal)`](https://docs.cocotb.org/en/v1.2.0/library_reference.html#cocotb.triggers.RisingEdge "cocotb.triggers.RisingEdge") Registers a callback that will continue execution of the coroutine on a transition from `0` to `1` of _signal_. [`FallingEdge(signal)`](https://docs.cocotb.org/en/v1.2.0/library_reference.html#cocotb.triggers.FallingEdge "cocotb.triggers.FallingEdge") Registers a callback that will continue execution of the coroutine on a transition from `1` to `0` of _signal_. [`ClockCycles(signal, num_cycles)`](https://docs.cocotb.org/en/v1.2.0/library_reference.html#cocotb.triggers.ClockCycles "cocotb.triggers.ClockCycles") Registers a callback that will continue execution of the coroutine when _num\_cycles_ transitions from `0` to `1` have occured on _signal_. Python Triggers[¶](https://docs.cocotb.org/en/v1.2.0/triggers.html#python-triggers "Permalink to this headline") ----------------------------------------------------------------------------------------------------------------- [`Event()`](https://docs.cocotb.org/en/v1.2.0/library_reference.html#cocotb.triggers.Event "cocotb.triggers.Event") Can be used to synchronise between coroutines. Yielding [`Event.wait()`](https://docs.cocotb.org/en/v1.2.0/library_reference.html#cocotb.triggers.Event.wait "cocotb.triggers.Event.wait") will block the coroutine until [`Event.set()`](https://docs.cocotb.org/en/v1.2.0/library_reference.html#cocotb.triggers.Event.set "cocotb.triggers.Event.set") is called somewhere else. [`Join(coroutine_2)`](https://docs.cocotb.org/en/v1.2.0/library_reference.html#cocotb.triggers.Join "cocotb.triggers.Join") Will block the coroutine until _coroutine\_2_ has completed. --- # Testbench Tools — cocotb 1.3.1 documentation * [Docs](https://docs.cocotb.org/en/v1.3.1/index.html) » * Testbench Tools * [Edit on GitHub](https://github.com/cocotb/cocotb/blob/v1.3.1/documentation/source/testbench_tools.rst) * * * Testbench Tools[¶](https://docs.cocotb.org/en/v1.3.1/testbench_tools.html#testbench-tools "Permalink to this headline") ======================================================================================================================== Logging[¶](https://docs.cocotb.org/en/v1.3.1/testbench_tools.html#logging "Permalink to this headline") -------------------------------------------------------------------------------------------------------- Cocotb extends the Python logging library. Each DUT, monitor, driver, and scoreboard (as well as any other function using the coroutine decorator) implements its own `logging` object, and each can be set to its own logging level. Within a DUT, each hierarchical object can also have individual logging levels set. When logging HDL objects, beware that `_log` is the preferred way to use logging. This helps minimize the change of name collisions with an HDL log component with the Python logging functionality. Log printing levels can also be set on a per-object basis. class EndianSwapperTB(object): def \_\_init\_\_(self, dut, debug\=False): self.dut \= dut self.stream\_in \= AvalonSTDriver(dut, "stream\_in", dut.clk) self.stream\_in\_recovered \= AvalonSTMonitor(dut, "stream\_in", dut.clk, callback\=self.model) \# Set verbosity on our various interfaces level \= logging.DEBUG if debug else logging.WARNING self.stream\_in.log.setLevel(level) self.stream\_in\_recovered.log.setLevel(level) self.dut.reset\_n.\_log.setLevel(logging.DEBUG) And when the logging is actually called class AvalonSTPkts(BusMonitor): ... @coroutine def \_monitor\_recv(self): ... self.log.info("Received a packet of %d bytes" % len(pkt)) class Scoreboard(object): ... def add\_interface(self): ... self.log.info("Created with reorder\_depth %d" % reorder\_depth) class EndianSwapTB(object): ... @cocotb.coroutine def reset(): self.dut.\_log.debug("Resetting DUT") will display as something like 0.00ns INFO cocotb.scoreboard.endian\_swapper\_sv scoreboard.py:177 in add\_interface Created with reorder\_depth 0 0.00ns DEBUG cocotb.endian\_swapper\_sv ..\_endian\_swapper.py:106 in reset Resetting DUT 160000000000000.00ns INFO cocotb.endian\_swapper\_sv.stream\_out avalon.py:151 in \_monitor\_recv Received a packet of 125 bytes Buses[¶](https://docs.cocotb.org/en/v1.3.1/testbench_tools.html#buses "Permalink to this headline") ---------------------------------------------------------------------------------------------------- Buses are simply defined as collection of signals. The [`Bus`](https://docs.cocotb.org/en/v1.3.1/library_reference.html#cocotb.bus.Bus "cocotb.bus.Bus") class will automatically bundle any group of signals together that are named similar to `dut.`. For instance, dut.stream\_in\_valid dut.stream\_in\_data have a bus name of `stream_in`, a separator of `_`, and signal names of `valid` and `data`. A list of signal names, or a dictionary mapping attribute names to signal names is also passed into the [`Bus`](https://docs.cocotb.org/en/v1.3.1/library_reference.html#cocotb.bus.Bus "cocotb.bus.Bus") class. Buses can have values driven onto them, be captured (returning a dictionary), or sampled and stored into a similar object. stream\_in\_bus \= Bus(dut, "stream\_in", \["valid", "data"\]) \# '\_' is the default separator Driving Buses[¶](https://docs.cocotb.org/en/v1.3.1/testbench_tools.html#driving-buses "Permalink to this headline") -------------------------------------------------------------------------------------------------------------------- Examples and specific bus implementation bus drivers (AMBA, Avalon, XGMII, and others) exist in the [`Driver`](https://docs.cocotb.org/en/v1.3.1/library_reference.html#cocotb.drivers.Driver "cocotb.drivers.Driver") class enabling a test to append transactions to perform the serialization of transactions onto a physical interface. Here is an example using the Avalon bus driver in the `endian_swapper` example: class EndianSwapperTB(object): def \_\_init\_\_(self, dut, debug\=False): self.dut \= dut self.stream\_in \= AvalonSTDriver(dut, "stream\_in", dut.clk) def run\_test(dut, data\_in\=None, config\_coroutine\=None, idle\_inserter\=None, backpressure\_inserter\=None): cocotb.fork(Clock(dut.clk, 5000).start()) tb \= EndianSwapperTB(dut) yield tb.reset() dut.stream\_out\_ready <= 1 if idle\_inserter is not None: tb.stream\_in.set\_valid\_generator(idle\_inserter()) \# Send in the packets for transaction in data\_in(): yield tb.stream\_in.send(transaction) Monitoring Buses[¶](https://docs.cocotb.org/en/v1.3.1/testbench_tools.html#monitoring-buses "Permalink to this headline") -------------------------------------------------------------------------------------------------------------------------- For our testbenches to actually be useful, we have to monitor some of these buses, and not just drive them. That’s where the [`Monitor`](https://docs.cocotb.org/en/v1.3.1/library_reference.html#cocotb.monitors.Monitor "cocotb.monitors.Monitor") class comes in, with pre-built monitors for Avalon and XGMII buses. The Monitor class is a base class which you are expected to derive for your particular purpose. You must create a [`_monitor_recv()`](https://docs.cocotb.org/en/v1.3.1/library_reference.html#cocotb.monitors.Monitor._monitor_recv "cocotb.monitors.Monitor._monitor_recv") function which is responsible for determining 1) at what points in simulation to call the [`_recv()`](https://docs.cocotb.org/en/v1.3.1/library_reference.html#cocotb.monitors.Monitor._recv "cocotb.monitors.Monitor._recv") function, and 2) what transaction values to pass to be stored in the monitors receiving queue. Monitors are good for both outputs of the DUT for verification, and for the inputs of the DUT, to drive a test model of the DUT to be compared to the actual DUT. For this purpose, input monitors will often have a callback function passed that is a model. This model will often generate expected transactions, which are then compared using the [`Scoreboard`](https://docs.cocotb.org/en/v1.3.1/library_reference.html#cocotb.scoreboard.Scoreboard "cocotb.scoreboard.Scoreboard") class. \# ============================================================================== class BitMonitor(Monitor): """Observes single input or output of DUT.""" def \_\_init\_\_(self, name, signal, clock, callback\=None, event\=None): self.name \= name self.signal \= signal self.clock \= clock Monitor.\_\_init\_\_(self, callback, event) @coroutine def \_monitor\_recv(self): clkedge \= RisingEdge(self.clock) while True: \# Capture signal at rising edge of clock yield clkedge vec \= self.signal.value self.\_recv(vec) \# ============================================================================== def input\_gen(): """Generator for input data applied by BitDriver""" while True: yield random.randint(1,5), random.randint(1,5) \# ============================================================================== class DFF\_TB(object): def \_\_init\_\_(self, dut, init\_val): self.dut \= dut \# Create input driver and output monitor self.input\_drv \= BitDriver(dut.d, dut.c, input\_gen()) self.output\_mon \= BitMonitor("output", dut.q, dut.c) \# Create a scoreboard on the outputs self.expected\_output \= \[ init\_val \] \# Reconstruct the input transactions from the pins \# and send them to our 'model' self.input\_mon \= BitMonitor("input", dut.d, dut.c, callback\=self.model) def model(self, transaction): """Model the DUT based on the input transaction.""" \# Do not append an output transaction for the last clock cycle of the \# simulation, that is, after stop() has been called. if not self.stopped: self.expected\_output.append(transaction) Tracking testbench errors[¶](https://docs.cocotb.org/en/v1.3.1/testbench_tools.html#tracking-testbench-errors "Permalink to this headline") -------------------------------------------------------------------------------------------------------------------------------------------- The [`Scoreboard`](https://docs.cocotb.org/en/v1.3.1/library_reference.html#cocotb.scoreboard.Scoreboard "cocotb.scoreboard.Scoreboard") class is used to compare the actual outputs to expected outputs. Monitors are added to the scoreboard for the actual outputs, and the expected outputs can be either a simple list, or a function that provides a transaction. Here is some code from the `dff` example, similar to above with the scoreboard added. class DFF\_TB(object): def \_\_init\_\_(self, dut, init\_val): self.dut \= dut \# Create input driver and output monitor self.input\_drv \= BitDriver(dut.d, dut.c, input\_gen()) self.output\_mon \= BitMonitor("output", dut.q, dut.c) \# Create a scoreboard on the outputs self.expected\_output \= \[ init\_val \] self.scoreboard \= Scoreboard(dut) self.scoreboard.add\_interface(self.output\_mon, self.expected\_output) \# Reconstruct the input transactions from the pins \# and send them to our 'model' self.input\_mon \= BitMonitor("input", dut.d, dut.c,callback\=self.model) --- # Unknown \# This file is public domain, it can be freely copied without restrictions. # SPDX-License-Identifier: CC0-1.0 # test\_my\_design.py (simple) import cocotb from cocotb.triggers import Timer @cocotb.test() async def my\_first\_test(dut): """Try accessing the design.""" for cycle in range(10): dut.clk.value = 0 await Timer(1, units="ns") dut.clk.value = 1 await Timer(1, units="ns") dut.\_log.info("my\_signal\_1 is %s", dut.my\_signal\_1.value) assert dut.my\_signal\_2.value\[0\] == 0, "my\_signal\_2\[0\] is not 0!" # test\_my\_design.py (extended) import cocotb from cocotb.triggers import FallingEdge, Timer async def generate\_clock(dut): """Generate clock pulses.""" for cycle in range(10): dut.clk.value = 0 await Timer(1, units="ns") dut.clk.value = 1 await Timer(1, units="ns") @cocotb.test() async def my\_second\_test(dut): """Try accessing the design.""" await cocotb.start(generate\_clock(dut)) # run the clock "in the background" await Timer(5, units="ns") # wait a bit await FallingEdge(dut.clk) # wait for falling edge/"negedge" dut.\_log.info("my\_signal\_1 is %s", dut.my\_signal\_1.value) assert dut.my\_signal\_2.value\[0\] == 0, "my\_signal\_2\[0\] is not 0!" --- # Unknown .. \_install-devel: \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\* Installing the Development Version \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\* .. note:: If you want to follow the instructions on this page, make sure you are reading the \`development version \`\_. Once you install the development version, you should keep reading the \`matching documentation \`\_. The development version of cocotb has different prerequisites than the stable version (see below). Namely, it requires the Python development headers and a C/C++ compiler. \* Python 3.6.2+ \* Python development packages \* GCC 4.8.1+, Clang 3.3+ or Microsoft Visual C++ 14.21+ and associated development packages \* On Linux: A static build of the C++ standard library \`\`libstdc++\`\`. Some distributions include the static library in their default packages (e.g. Debian/Ubuntu), others (e.g. Red Hat) require the installation of a package typically named \`\`libstdc++-static\`\`. \* GNU Make \* A Verilog or VHDL simulator, depending on your :term:\`RTL\` source code .. note:: Type checking cocotb code requires Python 3.11+. The installation instructions vary depending on your operating system: .. tab-set:: .. tab-item:: Windows + Conda .. code-block:: conda install -c msys2 m2-base m2-make .. tab-item:: Linux - Debian/Ubuntu In a terminal, run .. code-block:: bash sudo apt-get install make gcc g++ python3 python3-dev python3-pip .. tab-item:: Linux - Red Hat If you are using RHEL9, it might be necessary to add the CodeReady Linux Builder repository to be able to install \`\`libstdc++-static\`\`. To add this repo, run in a terminal .. code-block:: bash sudo subscription-manager repos --enable codeready-builder-for-rhel-9-$(arch)-rpms Then, run .. code-block:: bash sudo yum install make gcc gcc-c++ libstdc++-devel libstdc++-static python3 python3-devel python3-pip .. tab-item:: macOS .. code-block:: bash brew install python The development version of cocotb can be installed by running .. code-block:: bash pip install git+https://github.com/cocotb/cocotb@master .. note:: If your user does not have permissions to install cocotb using the instructions above, try adding the \`\`--user\`\` option to \`\`pip\`\` (see \`the pip documentation \`\_). .. warning:: \`\`pip\`\` may belong to a different Python installation to what you expect. Use \`\`pip -V\`\` to check. If this prints "(python 2.7)", use \`\`pip3\`\` or \`\`python3 -m pip\`\` in place of \`\`pip\`\` in the command shown. After installation, you should be able to execute \`\`cocotb-config\`\`. If it is not found, you need to append its location to the \`\`PATH\`\` environment variable. --- # Unknown .. \_simulator-support: \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\* Simulator Support \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\* This page lists the simulators that cocotb can be used with and documents specifics, limitations, workarounds etc. In general, cocotb can be used with any simulator supporting the industry-standard VPI, VHPI or FLI interfaces. However, in practice simulators exhibit small differences in behavior that cocotb mostly takes care of. If a simulator you would like to use with cocotb is not listed on this page open an issue at the \`cocotb GitHub issue tracker \`\_. .. \_sim-icarus: Icarus Verilog ============== In order to use this simulator, set :make:var:\`SIM\` to \`\`icarus\`\`: .. code-block:: bash make SIM=icarus # or SIM=icarus \[...\] pytest \[...\] For simulator-specific limitations when running with the :ref:\`Python Runner \` flow, see :class:\`cocotb\_tools.runner.Icarus\`. .. note:: A working installation of \`Icarus Verilog \`\_ is required. You can find installation instructions \`in the Icarus Verilog Installation Guide \`\_. .. \_sim-icarus-waveforms: Waveforms --------- Icarus Verilog can produce waveform traces in the FST format. FST traces are much smaller and more efficient to write than VCD. They can be viewed with GTKWave or with \`Surfer \`\_. To enable FST tracing, set :make:var:\`WAVES\` to \`\`1\`\`. .. code-block:: bash make SIM=icarus WAVES=1 By default, the wave file will be named \`.fst\`. Unlike other simulators, it will be placed in the build directory, rather than the test directory. To redirect the wave file to a different location, use the plusarg \`dumpfile\_path\` when running the test. .. \_sim-icarus-issues: Reported Issues for this Simulator ---------------------------------- \* \`All issues with label category:simulators:icarus \`\_ .. \_sim-verilator: Verilator ========= .. warning:: \*\*cocotb supports Verilator 5.036+.\*\* In order to use this simulator, set :make:var:\`SIM\` to \`\`verilator\`\`: .. code-block:: bash make SIM=verilator # or SIM=verilator \[...\] pytest \[...\] For simulator-specific limitations when running with the :ref:\`Python Runner \` flow, see :class:\`cocotb\_tools.runner.Verilator\`. .. note:: A working installation of \`Verilator \`\_ is required. You can find installation instructions \`in the Verilator documentation \`\_. .. versionadded:: 1.3 .. versionchanged:: 1.5 Improved cocotb support and greatly improved performance when using a higher time precision. .. versionchanged:: 2.0 Reimplemented the Verilator evaluator loop used in cocotb tests. This allowed for better performance and behavior more consistent with event-based simulators. Additionally, added support for inertial writes, which noticeably improves performance. Coverage -------- To enable :term:\`HDL\` code coverage, add Verilator's coverage option(s) to the :make:var:\`EXTRA\_ARGS\` make variable, for example: .. code-block:: make EXTRA\_ARGS += --coverage This will result in coverage data being written to :file:\`coverage.dat\`. .. \_sim-verilator-waveforms: Waveforms --------- To get waveforms in VCD format, add Verilator's trace option(s) to the :make:var:\`EXTRA\_ARGS\` make variable, for example in a Makefile: .. code-block:: make EXTRA\_ARGS += --trace --trace-structs To set the same options on the command line, use \`\`EXTRA\_ARGS="--trace --trace-structs" make ...\`\`. A VCD file named \`\`dump.vcd\`\` will be generated in the current directory. Verilator can produce waveform traces in the FST format. FST traces are much smaller and more efficient to write. They can be viewed with GTKWave or with \`Surfer \`\_. To enable FST tracing, add \`\`--trace-fst\`\` to :make:var:\`EXTRA\_ARGS\` as shown below. .. code-block:: make EXTRA\_ARGS += --trace --trace-fst --trace-structs The resulting file will be :file:\`dump.fst\` and can be opened by \`\`gtkwave dump.fst\`\`. .. \_sim-verilator-issues: Reported Issues for this Simulator ---------------------------------- \* \`All issues with label category:simulators:verilator \`\_ .. \_sim-vcs: Synopsys VCS ============ In order to use this simulator, set :make:var:\`SIM\` to \`\`vcs\`\`: .. code-block:: bash make SIM=vcs # or SIM=vcs \[...\] pytest \[...\] For simulator-specific limitations when running with the :ref:\`Python Runner \` flow, see :class:\`cocotb\_tools.runner.Vcs\`. .. note:: A working installation of the simulator itself is required. cocotb currently only supports :term:\`VPI\` for Synopsys VCS, not :term:\`VHPI\`. .. \_sim-vcs-issues: Reported Issues for this Simulator ---------------------------------- \* \`All issues with label category:simulators:vcs \`\_ .. \_sim-aldec: .. \_sim-riviera: Aldec Riviera-PRO ================= In order to use this simulator, set :make:var:\`SIM\` to \`\`riviera\`\`: .. code-block:: bash make SIM=riviera # or SIM=riviera \[...\] pytest \[...\] For simulator-specific limitations when running with the :ref:\`Python Runner \` flow, see :class:\`cocotb\_tools.runner.Riviera\`. .. note:: A working installation of the simulator itself is required. .. note:: On Windows, do not install the C++ compiler, i.e. unselect it during the installation process of Riviera-PRO. (A workaround is to remove or rename the \`\`mingw\`\` directory located in the Riviera-PRO installation directory.) .. deprecated:: 1.4 Support for Riviera-PRO was previously available with \`\`SIM=aldec\`\`. The :envvar:\`LICENSE\_QUEUE\` environment variable can be used for this simulator – this setting will be mirrored in the TCL \`\`license\_queue\`\` variable to control runtime license checkouts. .. \_sim-aldec-issues: Reported Issues for this Simulator ---------------------------------- \* \`All issues with label category:simulators:riviera \`\_ .. \_sim-activehdl: Aldec Active-HDL ================ In order to use this simulator, set :make:var:\`SIM\` to \`\`activehdl\`\`: .. code-block:: bash make SIM=activehdl This simulator is not currently supported in the :ref:\`Python Runner \` flow. .. note:: A working installation of the simulator itself is required. .. warning:: cocotb does not work with some versions of Active-HDL (see :issue:\`1494\`). Known affected versions: - Aldec Active-HDL 10.4a - Aldec Active-HDL 10.5a .. \_sim-activehdl-issues: Reported Issues for this Simulator ---------------------------------- \* \`All issues with label category:simulators:activehdl \`\_ .. \_sim-questa: Mentor/Siemens EDA Questa ========================= In order to use this simulator, set :make:var:\`SIM\` to \`\`questa\`\`: .. code-block:: bash make SIM=questa # or SIM=questa \[...\] pytest \[...\] For simulator-specific limitations when running with the :ref:\`Python Runner \` flow, see :class:\`cocotb\_tools.runner.Questa\`. .. note:: A working installation of the simulator itself is required. Cocotb implements two flows for Questa. The most suitable flow is chosen based on the Questa version being used. The newer \*\*QIS/Qrun flow\*\* uses the Questa Information System (QIS) together with the \`\`qrun\`\` command. One of the most visible user-facing benefits of the \`\`qrun\`\` flow is the ability to automatically order VHDL sources. The use of the QIS should reduce the overhead from accessing design internals at runtime and mandates the use of Visualizer as GUI. The QIS/qrun flow is chosen automatically if Questa 2025.2 or newer is detected. Users can explicitly use the QIS/Qrun flow with :make:var:\`SIM=questa-qisqrun \`. If you are passing simulator-specific arguments to the Makefile, we recommend not relying on the automatic flow selection and instead explicitly selecting a flow by using either \`\`SIM=questa-qisqrun\`\` or \`\`SIM=questa-compat\`\` to ensure they are interpreted as expected. The \*\*compat flow\*\* uses the commands \`\`vlog\`\`, \`\`vopt\`\` and \`\`vsim\`\` to build and run the simulation, together with the \`\`+acc\`\` switch to enable design access for cocotb. The compat flow is used for ModelSim and Questa older than 2025.2. Users can explicitly use the compat flow with \`\`SIM=questa-compat\`\`. In order to start Questa with the graphical interface and for the simulator to remain active after the tests have completed, set :make:var:\`GUI=1\`. Users of the QIS/Qrun flow can set \`\`GUI=livesim\`\` to open Visualizer during the simulation in Live Simulation mode (an alias for \`\`GUI=1\`\`), or set \`\`GUI=postsim\`\` to open Visualizer after the simulation has ended (Post Simulation mode). Starting with Questa 2022.3 and cocotb 1.7 users with VHDL toplevels can choose between two communication interfaces between Questa and cocotb: the proprietary FLI and VHPI. For backwards-compatibility cocotb defaults to FLI. Users can choose VHPI instead by setting the :envvar:\`VHDL\_GPI\_INTERFACE\` environment variable to \`\`vhpi\`\` before running cocotb. For more information, see :ref:\`sim-modelsim\`. .. \_sim-questa-issues: Reported Issues for this Simulator ---------------------------------- \* \`All issues with label category:simulators:questa \`\_ .. \_sim-modelsim: Mentor/Siemens EDA ModelSim =========================== In order to use this simulator, set :make:var:\`SIM\` to \`\`modelsim\`\`: .. code-block:: bash make SIM=modelsim This simulator is not currently supported in the :ref:\`Python Runner \` flow. .. note:: A working installation of the simulator itself is required. Any ModelSim PE or ModelSim PE derivatives (like the ModelSim Microsemi, Intel, Lattice Editions) do not support the VHDL :term:\`FLI\` feature. If you try to use them with :term:\`FLI\`, you will see a \`\`vsim-FLI-3155\`\` error: .. code-block:: bash \*\* Error (suppressible): (vsim-FLI-3155) The FLI is not enabled in this version of ModelSim. ModelSim DE and SE (and Questa, of course) support the :term:\`FLI\`. In order to start ModelSim with the graphical interface and for the simulator to remain active after the tests have completed, set :make:var:\`GUI=1 \`. If you have previously launched a test without this setting, you might have to delete the :make:var:\`SIM\_BUILD\` directory (\`\`sim\_build\`\` by default) to get the correct behavior. .. \_sim-modelsim-issues: Reported Issues for this Simulator ---------------------------------- \* \`All issues with label category:simulators:modelsim \`\_ .. \_sim-incisive: Cadence Incisive ================ In order to use this simulator, set :make:var:\`SIM\` to \`\`ius\`\`: .. code-block:: bash make SIM=ius This simulator is not currently supported in the :ref:\`Python Runner \` flow. .. note:: A working installation of the simulator itself is required. For more information, see :ref:\`sim-xcelium\`. .. \_sim-incisive-issues: Reported Issues for this Simulator ---------------------------------- \* \`All issues with label category:simulators:ius \`\_ .. \_sim-xcelium: Cadence Xcelium =============== In order to use this simulator, set :make:var:\`SIM\` to \`\`xcelium\`\`: .. code-block:: bash make SIM=xcelium # or SIM=xcelium \[...\] pytest \[...\] For simulator-specific limitations when running with the :ref:\`Python Runner \` flow, see :class:\`cocotb\_tools.runner.Xcelium\`. .. note:: A working installation of the simulator itself is required. The simulator automatically loads :term:\`VPI\` even when only :term:\`VHPI\` is requested. Testing designs with VHDL toplevels is only supported with Xcelium 23.09.004 and newer. .. \_sim-xcelium-issues: Reported Issues for this Simulator ---------------------------------- \* \`All issues with label category:simulators:xcelium \`\_ .. \_sim-ghdl: GHDL ==== .. warning:: GHDL support in cocotb is experimental. Some features of cocotb may not work correctly or at all. At least GHDL 2.0 is required. In order to use this simulator, set :make:var:\`SIM\` to \`\`ghdl\`\`: .. code-block:: bash make SIM=ghdl # or SIM=ghdl \[...\] pytest \[...\] For simulator-specific limitations when running with the :ref:\`Python Runner \` flow, see :class:\`cocotb\_tools.runner.Ghdl\`. .. note:: A working installation of \`GHDL \`\_ is required. You can find installation instructions \`in the GHDL documentation \`\_. Noteworthy is that despite GHDL being a VHDL simulator, it implements the :term:\`VPI\` interface. This prevents cocotb from accessing some VHDL-specific constructs, like 9-value signals. To specify a VHDL architecture to simulate, set the \`\`ARCH\`\` make variable to the architecture name. .. \_sim-ghdl-issues: Reported Issues for this Simulator ---------------------------------- \* \`All issues with label category:simulators:ghdl \`\_ .. \_sim-ghdl-waveforms: Waveforms --------- To get waveforms in VCD format, set the :make:var:\`SIM\_ARGS\` option to \`\`--vcd=anyname.vcd\`\`, for example in a Makefile: .. code-block:: make SIM\_ARGS+=--vcd=anyname.vcd The option can be set on the command line, as shown in the following example. .. code-block:: bash SIM\_ARGS=--vcd=anyname.vcd make SIM=ghdl A VCD file named :file:\`anyname.vcd\` will be generated in the current directory. :make:var:\`SIM\_ARGS\` can also be used to pass command line arguments related to :ref:\`other waveform formats supported by GHDL \`. .. \_sim-nvc: NVC === .. note:: NVC version \*\*1.11.0\*\* or later is required. .. note:: Using NVC versions greater than \*\*1.16.0\*\* will automatically add the \`\`--preserve-case\`\` option build commands. This is standards-compliant behavior and may become default behavior in NVC, so think twice before overriding it. In order to use this simulator, set :make:var:\`SIM\` to \`\`nvc\`\`: .. code-block:: bash make SIM=nvc # or SIM=nvc \[...\] pytest \[...\] For simulator-specific limitations when running with the :ref:\`Python Runner \` flow, see :class:\`cocotb\_tools.runner.Nvc\`. .. \_sim-nvc-issues: Reported Issues for this Simulator ---------------------------------- \* \`All issues with label category:simulators:nvc \`\_ Coverage -------- To enable code coverage, add \`\`--cover\`\` to :make:var:\`SIM\_ARGS\`, for example in a Makefile: .. code-block:: make SIM\_ARGS += --cover Specifying types of coverage is also supported. For example, to collect statement and branch coverage: .. code-block:: make SIM\_ARGS += --cover=statement,branch The \`\`covdb\`\` files will be placed in the :make:var:\`RTL\_LIBRARY\` subdirectory of :make:var:\`SIM\_BUILD\`. For instructions on how to specify coverage types and produce a report, refer to \`NVC's code coverage documentation \`\_. .. \_sim-nvc-waveforms: Waveforms --------- To get waveforms in FST format, set the :make:var:\`SIM\_ARGS\` option to \`\`--wave=anyname.fst\`\`, for example in a Makefile: .. code-block:: make SIM\_ARGS += --wave=anyname.fst :make:var:\`SIM\_ARGS\` can also be used to set the waveform output to VCD by adding \`\`--format=vcd\`\`. .. \_sim-cvc: Tachyon DA CVC ============== In order to use \`Tachyon DA \`\_'s \`CVC \`\_ simulator, set :make:var:\`SIM\` to \`\`cvc\`\`: .. code-block:: bash make SIM=cvc This simulator is not currently supported in the :ref:\`Python Runner \` flow. .. note:: A working installation of the simulator itself is required. Note that cocotb's makefile is using CVC's interpreted mode. .. \_sim-cvc-issues: Reported Issues for this Simulator ---------------------------------- \* \`All issues with label category:simulators:cvc \`\_ .. \_sim-dsim: Siemens DSim ============ .. warning:: DSim support for cocotb is experimental. Some features of cocotb may not work correctly or at all. At least DSim version 2025 is required. In order to use this simulator, set :make:var:\`SIM\` to \`\`dsim\`\`: .. code-block:: bash make SIM=dsim # or SIM=dsim \[...\] pytest \[...\] For simulator-specific limitations when running with the :ref:\`Python Runner \` flow, see :class:\`cocotb\_tools.runner.DSim\`. .. note:: A working installation of \`DSim \`\_ is required. You can install DSim simulator directly from \`Altair Marketplace \`\_ and find information regarding getting a free license. .. \_sim-dsim-waveforms: Waveforms --------- DSim can produce waveform traces in the VCD format. They can be viewed with GTKWave or with \`Surfer \`\_. To enable VCD tracing, set :make:var:\`WAVES\` to \`\`1\`\`. .. code-block:: bash make SIM=dsim WAVES=1 .. \_sim-dsim-issues: Reported Issues for this Simulator ---------------------------------- \* \`All issues with label category:simulators:dsim \`\_ .. versionadded:: 2.0 --- # Unknown \# This file is public domain, it can be freely copied without restrictions. # SPDX-License-Identifier: CC0-1.0 # test\_runner.py import os from pathlib import Path from cocotb.runner import get\_runner def test\_my\_design\_runner(): sim = os.getenv("SIM", "icarus") proj\_path = Path(\_\_file\_\_).resolve().parent sources = \[proj\_path / "my\_design.sv"\] runner = get\_runner(sim) runner.build( sources=sources, hdl\_toplevel="my\_design", ) runner.test(hdl\_toplevel="my\_design", test\_module="test\_my\_design,") if \_\_name\_\_ == "\_\_main\_\_": test\_my\_design\_runner() --- # Unknown \# This file is public domain, it can be freely copied without restrictions. # SPDX-License-Identifier: CC0-1.0 # Makefile # defaults SIM ?= icarus TOPLEVEL\_LANG ?= verilog VERILOG\_SOURCES += $(PWD)/my\_design.sv # use VHDL\_SOURCES for VHDL files # TOPLEVEL is the name of the toplevel module in your Verilog or VHDL file TOPLEVEL = my\_design # MODULE is the basename of the Python test file MODULE = test\_my\_design # include cocotb's make rules to take care of the simulator setup include $(shell cocotb-config --makefiles)/Makefile.sim --- # Unknown \# This file is public domain, it can be freely copied without restrictions. # SPDX-License-Identifier: CC0-1.0 # Makefile # defaults SIM ?= icarus TOPLEVEL\_LANG ?= verilog VERILOG\_SOURCES += $(PWD)/my\_design.sv # use VHDL\_SOURCES for VHDL files # TOPLEVEL is the name of the toplevel module in your Verilog or VHDL file TOPLEVEL = my\_design # MODULE is the basename of the Python test file MODULE = test\_my\_design # include cocotb's make rules to take care of the simulator setup include $(shell cocotb-config --makefiles)/Makefile.sim --- # Unknown \# This file is public domain, it can be freely copied without restrictions. # SPDX-License-Identifier: CC0-1.0 # Makefile # defaults SIM ?= icarus TOPLEVEL\_LANG ?= verilog VERILOG\_SOURCES += $(PWD)/my\_design.sv # use VHDL\_SOURCES for VHDL files # COCOTB\_TOPLEVEL is the name of the toplevel module in your Verilog or VHDL file COCOTB\_TOPLEVEL = my\_design # COCOTB\_TEST\_MODULES is the basename of the Python test file(s) COCOTB\_TEST\_MODULES = test\_my\_design # include cocotb's make rules to take care of the simulator setup include $(shell cocotb-config --makefiles)/Makefile.sim --- # Class FliEnumObjHdl — cocotb 1.4.0 documentation * [](https://docs.cocotb.org/en/v1.4.0/index.html) » * [C Code Library Reference](https://docs.cocotb.org/en/v1.4.0/library_reference_c.html) » * [Class list](https://docs.cocotb.org/en/v1.4.0/generated/classlist.html) » * Class FliEnumObjHdl * [Edit on GitHub](https://github.com/cocotb/cocotb/blob/v1.4.0/documentation/source/generated/class/classFliEnumObjHdl.rst) * * * Class FliEnumObjHdl[¶](https://docs.cocotb.org/en/v1.4.0/generated/class/classFliEnumObjHdl.html#class-flienumobjhdl "Permalink to this headline") =================================================================================================================================================== _class_ `FliEnumObjHdl` : _public_ [FliValueObjHdl](https://docs.cocotb.org/en/v1.4.0/generated/class/classFliValueObjHdl.html#_CPPv414FliValueObjHdl "FliValueObjHdl") [¶](https://docs.cocotb.org/en/v1.4.0/generated/class/classFliEnumObjHdl.html#_CPPv413FliEnumObjHdl "Permalink to this definition") --- # Class FliImpl — cocotb 1.4.0 documentation * [](https://docs.cocotb.org/en/v1.4.0/index.html) » * [C Code Library Reference](https://docs.cocotb.org/en/v1.4.0/library_reference_c.html) » * [Class list](https://docs.cocotb.org/en/v1.4.0/generated/classlist.html) » * Class FliImpl * [Edit on GitHub](https://github.com/cocotb/cocotb/blob/v1.4.0/documentation/source/generated/class/classFliImpl.rst) * * * Class FliImpl[¶](https://docs.cocotb.org/en/v1.4.0/generated/class/classFliImpl.html#class-fliimpl "Permalink to this headline") ================================================================================================================================= _class_ `FliImpl` : _public_ [GpiImplInterface](https://docs.cocotb.org/en/v1.4.0/generated/class/classGpiImplInterface.html#_CPPv416GpiImplInterface "GpiImplInterface") [¶](https://docs.cocotb.org/en/v1.4.0/generated/class/classFliImpl.html#_CPPv47FliImpl "Permalink to this definition") Native Check Create Determine whether a simulation object is native to FLI and create a handle if it is Get current simulation time Get current simulation time NB units depend on the simulation configuration Find the root handle Find the root handle using an optional name Get a handle to the root simulator object. This is usually the toplevel. If no name is provided, we return the first root instance. If name is provided, we check the name against the available objects until we find a match. If no match is found we return NULL --- # Class FliIntObjHdl — cocotb 1.4.0 documentation * [](https://docs.cocotb.org/en/v1.4.0/index.html) » * [C Code Library Reference](https://docs.cocotb.org/en/v1.4.0/library_reference_c.html) » * [Class list](https://docs.cocotb.org/en/v1.4.0/generated/classlist.html) » * Class FliIntObjHdl * [Edit on GitHub](https://github.com/cocotb/cocotb/blob/v1.4.0/documentation/source/generated/class/classFliIntObjHdl.rst) * * * Class FliIntObjHdl[¶](https://docs.cocotb.org/en/v1.4.0/generated/class/classFliIntObjHdl.html#class-fliintobjhdl "Permalink to this headline") ================================================================================================================================================ _class_ `FliIntObjHdl` : _public_ [FliValueObjHdl](https://docs.cocotb.org/en/v1.4.0/generated/class/classFliValueObjHdl.html#_CPPv414FliValueObjHdl "FliValueObjHdl") [¶](https://docs.cocotb.org/en/v1.4.0/generated/class/classFliIntObjHdl.html#_CPPv412FliIntObjHdl "Permalink to this definition") --- # Class FliNextPhaseCbHdl — cocotb 1.4.0 documentation * [](https://docs.cocotb.org/en/v1.4.0/index.html) » * [C Code Library Reference](https://docs.cocotb.org/en/v1.4.0/library_reference_c.html) » * [Class list](https://docs.cocotb.org/en/v1.4.0/generated/classlist.html) » * Class FliNextPhaseCbHdl * [Edit on GitHub](https://github.com/cocotb/cocotb/blob/v1.4.0/documentation/source/generated/class/classFliNextPhaseCbHdl.rst) * * * Class FliNextPhaseCbHdl[¶](https://docs.cocotb.org/en/v1.4.0/generated/class/classFliNextPhaseCbHdl.html#class-flinextphasecbhdl "Permalink to this headline") =============================================================================================================================================================== _class_ `FliNextPhaseCbHdl` : _public_ [FliSimPhaseCbHdl](https://docs.cocotb.org/en/v1.4.0/generated/class/classFliSimPhaseCbHdl.html#_CPPv416FliSimPhaseCbHdl "FliSimPhaseCbHdl") [¶](https://docs.cocotb.org/en/v1.4.0/generated/class/classFliNextPhaseCbHdl.html#_CPPv417FliNextPhaseCbHdl "Permalink to this definition") --- # Class FliIterator — cocotb 1.4.0 documentation * [](https://docs.cocotb.org/en/v1.4.0/index.html) » * [C Code Library Reference](https://docs.cocotb.org/en/v1.4.0/library_reference_c.html) » * [Class list](https://docs.cocotb.org/en/v1.4.0/generated/classlist.html) » * Class FliIterator * [Edit on GitHub](https://github.com/cocotb/cocotb/blob/v1.4.0/documentation/source/generated/class/classFliIterator.rst) * * * Class FliIterator[¶](https://docs.cocotb.org/en/v1.4.0/generated/class/classFliIterator.html#class-fliiterator "Permalink to this headline") ============================================================================================================================================= _class_ `FliIterator` : _public_ [GpiIterator](https://docs.cocotb.org/en/v1.4.0/generated/class/classGpiIterator.html#_CPPv411GpiIterator "GpiIterator") [¶](https://docs.cocotb.org/en/v1.4.0/generated/class/classFliIterator.html#_CPPv411FliIterator "Permalink to this definition") Find the root handle Find the root handle using an optional name Get a handle to the root simulator object. This is usually the toplevel. If no name is provided, we return the first root instance. If name is provided, we check the name against the available objects until we find a match. If no match is found we return NULL --- # Class FliLogicObjHdl — cocotb 1.4.0 documentation * [](https://docs.cocotb.org/en/v1.4.0/index.html) » * [C Code Library Reference](https://docs.cocotb.org/en/v1.4.0/library_reference_c.html) » * [Class list](https://docs.cocotb.org/en/v1.4.0/generated/classlist.html) » * Class FliLogicObjHdl * [Edit on GitHub](https://github.com/cocotb/cocotb/blob/v1.4.0/documentation/source/generated/class/classFliLogicObjHdl.rst) * * * Class FliLogicObjHdl[¶](https://docs.cocotb.org/en/v1.4.0/generated/class/classFliLogicObjHdl.html#class-flilogicobjhdl "Permalink to this headline") ====================================================================================================================================================== _class_ `FliLogicObjHdl` : _public_ [FliValueObjHdl](https://docs.cocotb.org/en/v1.4.0/generated/class/classFliValueObjHdl.html#_CPPv414FliValueObjHdl "FliValueObjHdl") [¶](https://docs.cocotb.org/en/v1.4.0/generated/class/classFliLogicObjHdl.html#_CPPv414FliLogicObjHdl "Permalink to this definition") --- # Class FliObj — cocotb 1.4.0 documentation * [](https://docs.cocotb.org/en/v1.4.0/index.html) » * [C Code Library Reference](https://docs.cocotb.org/en/v1.4.0/library_reference_c.html) » * [Class list](https://docs.cocotb.org/en/v1.4.0/generated/classlist.html) » * Class FliObj * [Edit on GitHub](https://github.com/cocotb/cocotb/blob/v1.4.0/documentation/source/generated/class/classFliObj.rst) * * * Class FliObj[¶](https://docs.cocotb.org/en/v1.4.0/generated/class/classFliObj.html#class-fliobj "Permalink to this headline") ============================================================================================================================== _class_ `FliObj`[¶](https://docs.cocotb.org/en/v1.4.0/generated/class/classFliObj.html#_CPPv46FliObj "Permalink to this definition") Subclassed by [FliObjHdl](https://docs.cocotb.org/en/v1.4.0/generated/file/FliImpl_8h.html#classFliObjHdl) , [FliSignalObjHdl](https://docs.cocotb.org/en/v1.4.0/generated/file/FliImpl_8h.html#classFliSignalObjHdl) --- # Class FliObjHdl — cocotb 1.4.0 documentation * [](https://docs.cocotb.org/en/v1.4.0/index.html) » * [C Code Library Reference](https://docs.cocotb.org/en/v1.4.0/library_reference_c.html) » * [Class list](https://docs.cocotb.org/en/v1.4.0/generated/classlist.html) » * Class FliObjHdl * [Edit on GitHub](https://github.com/cocotb/cocotb/blob/v1.4.0/documentation/source/generated/class/classFliObjHdl.rst) * * * Class FliObjHdl[¶](https://docs.cocotb.org/en/v1.4.0/generated/class/classFliObjHdl.html#class-fliobjhdl "Permalink to this headline") ======================================================================================================================================= _class_ `FliObjHdl` : _public_ [GpiObjHdl](https://docs.cocotb.org/en/v1.4.0/generated/class/classGpiObjHdl.html#_CPPv49GpiObjHdl "GpiObjHdl") , _public_ [FliObj](https://docs.cocotb.org/en/v1.4.0/generated/class/classFliObj.html#_CPPv46FliObj "FliObj") [¶](https://docs.cocotb.org/en/v1.4.0/generated/class/classFliObjHdl.html#_CPPv49FliObjHdl "Permalink to this definition") --- # Class FliReadOnlyCbHdl — cocotb 1.4.0 documentation * [](https://docs.cocotb.org/en/v1.4.0/index.html) » * [C Code Library Reference](https://docs.cocotb.org/en/v1.4.0/library_reference_c.html) » * [Class list](https://docs.cocotb.org/en/v1.4.0/generated/classlist.html) » * Class FliReadOnlyCbHdl * [Edit on GitHub](https://github.com/cocotb/cocotb/blob/v1.4.0/documentation/source/generated/class/classFliReadOnlyCbHdl.rst) * * * Class FliReadOnlyCbHdl[¶](https://docs.cocotb.org/en/v1.4.0/generated/class/classFliReadOnlyCbHdl.html#class-flireadonlycbhdl "Permalink to this headline") ============================================================================================================================================================ _class_ `FliReadOnlyCbHdl` : _public_ [FliSimPhaseCbHdl](https://docs.cocotb.org/en/v1.4.0/generated/class/classFliSimPhaseCbHdl.html#_CPPv416FliSimPhaseCbHdl "FliSimPhaseCbHdl") [¶](https://docs.cocotb.org/en/v1.4.0/generated/class/classFliReadOnlyCbHdl.html#_CPPv416FliReadOnlyCbHdl "Permalink to this definition") --- # Class FliProcessCbHdl — cocotb 1.4.0 documentation * [](https://docs.cocotb.org/en/v1.4.0/index.html) » * [C Code Library Reference](https://docs.cocotb.org/en/v1.4.0/library_reference_c.html) » * [Class list](https://docs.cocotb.org/en/v1.4.0/generated/classlist.html) » * Class FliProcessCbHdl * [Edit on GitHub](https://github.com/cocotb/cocotb/blob/v1.4.0/documentation/source/generated/class/classFliProcessCbHdl.rst) * * * Class FliProcessCbHdl[¶](https://docs.cocotb.org/en/v1.4.0/generated/class/classFliProcessCbHdl.html#class-fliprocesscbhdl "Permalink to this headline") ========================================================================================================================================================= _class_ `FliProcessCbHdl` : _public_ _virtual_ [GpiCbHdl](https://docs.cocotb.org/en/v1.4.0/generated/class/classGpiCbHdl.html#_CPPv48GpiCbHdl "GpiCbHdl") [¶](https://docs.cocotb.org/en/v1.4.0/generated/class/classFliProcessCbHdl.html#_CPPv415FliProcessCbHdl "Permalink to this definition") Subclassed by [FliShutdownCbHdl](https://docs.cocotb.org/en/v1.4.0/generated/file/FliImpl_8h.html#classFliShutdownCbHdl) , [FliSignalCbHdl](https://docs.cocotb.org/en/v1.4.0/generated/file/FliImpl_8h.html#classFliSignalCbHdl) , [FliSimPhaseCbHdl](https://docs.cocotb.org/en/v1.4.0/generated/file/FliImpl_8h.html#classFliSimPhaseCbHdl) , [FliStartupCbHdl](https://docs.cocotb.org/en/v1.4.0/generated/file/FliImpl_8h.html#classFliStartupCbHdl) , [FliTimedCbHdl](https://docs.cocotb.org/en/v1.4.0/generated/file/FliImpl_8h.html#classFliTimedCbHdl) cleanup callback Called while unwinding after a GPI callback We keep the process but desensitize it NB: need a way to determine if should leave it sensitized… --- # Class FliRealObjHdl — cocotb 1.4.0 documentation * [](https://docs.cocotb.org/en/v1.4.0/index.html) » * [C Code Library Reference](https://docs.cocotb.org/en/v1.4.0/library_reference_c.html) » * [Class list](https://docs.cocotb.org/en/v1.4.0/generated/classlist.html) » * Class FliRealObjHdl * [Edit on GitHub](https://github.com/cocotb/cocotb/blob/v1.4.0/documentation/source/generated/class/classFliRealObjHdl.rst) * * * Class FliRealObjHdl[¶](https://docs.cocotb.org/en/v1.4.0/generated/class/classFliRealObjHdl.html#class-flirealobjhdl "Permalink to this headline") =================================================================================================================================================== _class_ `FliRealObjHdl` : _public_ [FliValueObjHdl](https://docs.cocotb.org/en/v1.4.0/generated/class/classFliValueObjHdl.html#_CPPv414FliValueObjHdl "FliValueObjHdl") [¶](https://docs.cocotb.org/en/v1.4.0/generated/class/classFliRealObjHdl.html#_CPPv413FliRealObjHdl "Permalink to this definition") --- # Class FliShutdownCbHdl — cocotb 1.4.0 documentation * [](https://docs.cocotb.org/en/v1.4.0/index.html) » * [C Code Library Reference](https://docs.cocotb.org/en/v1.4.0/library_reference_c.html) » * [Class list](https://docs.cocotb.org/en/v1.4.0/generated/classlist.html) » * Class FliShutdownCbHdl * [Edit on GitHub](https://github.com/cocotb/cocotb/blob/v1.4.0/documentation/source/generated/class/classFliShutdownCbHdl.rst) * * * Class FliShutdownCbHdl[¶](https://docs.cocotb.org/en/v1.4.0/generated/class/classFliShutdownCbHdl.html#class-flishutdowncbhdl "Permalink to this headline") ============================================================================================================================================================ _class_ `FliShutdownCbHdl` : _public_ [FliProcessCbHdl](https://docs.cocotb.org/en/v1.4.0/generated/class/classFliProcessCbHdl.html#_CPPv415FliProcessCbHdl "FliProcessCbHdl") [¶](https://docs.cocotb.org/en/v1.4.0/generated/class/classFliShutdownCbHdl.html#_CPPv416FliShutdownCbHdl "Permalink to this definition") cleanup callback Called while unwinding after a GPI callback We keep the process but desensitize it NB: need a way to determine if should leave it sensitized… --- # Class FliReadWriteCbHdl — cocotb 1.4.0 documentation * [](https://docs.cocotb.org/en/v1.4.0/index.html) » * [C Code Library Reference](https://docs.cocotb.org/en/v1.4.0/library_reference_c.html) » * [Class list](https://docs.cocotb.org/en/v1.4.0/generated/classlist.html) » * Class FliReadWriteCbHdl * [Edit on GitHub](https://github.com/cocotb/cocotb/blob/v1.4.0/documentation/source/generated/class/classFliReadWriteCbHdl.rst) * * * Class FliReadWriteCbHdl[¶](https://docs.cocotb.org/en/v1.4.0/generated/class/classFliReadWriteCbHdl.html#class-flireadwritecbhdl "Permalink to this headline") =============================================================================================================================================================== _class_ `FliReadWriteCbHdl` : _public_ [FliSimPhaseCbHdl](https://docs.cocotb.org/en/v1.4.0/generated/class/classFliSimPhaseCbHdl.html#_CPPv416FliSimPhaseCbHdl "FliSimPhaseCbHdl") [¶](https://docs.cocotb.org/en/v1.4.0/generated/class/classFliReadWriteCbHdl.html#_CPPv417FliReadWriteCbHdl "Permalink to this definition") --- # Class FliSignalObjHdl — cocotb 1.4.0 documentation * [](https://docs.cocotb.org/en/v1.4.0/index.html) » * [C Code Library Reference](https://docs.cocotb.org/en/v1.4.0/library_reference_c.html) » * [Class list](https://docs.cocotb.org/en/v1.4.0/generated/classlist.html) » * Class FliSignalObjHdl * [Edit on GitHub](https://github.com/cocotb/cocotb/blob/v1.4.0/documentation/source/generated/class/classFliSignalObjHdl.rst) * * * Class FliSignalObjHdl[¶](https://docs.cocotb.org/en/v1.4.0/generated/class/classFliSignalObjHdl.html#class-flisignalobjhdl "Permalink to this headline") ========================================================================================================================================================= _class_ `FliSignalObjHdl` : _public_ [GpiSignalObjHdl](https://docs.cocotb.org/en/v1.4.0/generated/class/classGpiSignalObjHdl.html#_CPPv415GpiSignalObjHdl "GpiSignalObjHdl") , _public_ [FliObj](https://docs.cocotb.org/en/v1.4.0/generated/class/classFliObj.html#_CPPv46FliObj "FliObj") [¶](https://docs.cocotb.org/en/v1.4.0/generated/class/classFliSignalObjHdl.html#_CPPv415FliSignalObjHdl "Permalink to this definition") Subclassed by [FliValueObjHdl](https://docs.cocotb.org/en/v1.4.0/generated/file/FliImpl_8h.html#classFliValueObjHdl) --- # Class FliStartupCbHdl — cocotb 1.4.0 documentation * [](https://docs.cocotb.org/en/v1.4.0/index.html) » * [C Code Library Reference](https://docs.cocotb.org/en/v1.4.0/library_reference_c.html) » * [Class list](https://docs.cocotb.org/en/v1.4.0/generated/classlist.html) » * Class FliStartupCbHdl * [Edit on GitHub](https://github.com/cocotb/cocotb/blob/v1.4.0/documentation/source/generated/class/classFliStartupCbHdl.rst) * * * Class FliStartupCbHdl[¶](https://docs.cocotb.org/en/v1.4.0/generated/class/classFliStartupCbHdl.html#class-flistartupcbhdl "Permalink to this headline") ========================================================================================================================================================= _class_ `FliStartupCbHdl` : _public_ [FliProcessCbHdl](https://docs.cocotb.org/en/v1.4.0/generated/class/classFliProcessCbHdl.html#_CPPv415FliProcessCbHdl "FliProcessCbHdl") [¶](https://docs.cocotb.org/en/v1.4.0/generated/class/classFliStartupCbHdl.html#_CPPv415FliStartupCbHdl "Permalink to this definition") cleanup callback Called while unwinding after a GPI callback We keep the process but desensitize it NB: need a way to determine if should leave it sensitized… --- # Class FliSignalCbHdl — cocotb 1.4.0 documentation * [](https://docs.cocotb.org/en/v1.4.0/index.html) » * [C Code Library Reference](https://docs.cocotb.org/en/v1.4.0/library_reference_c.html) » * [Class list](https://docs.cocotb.org/en/v1.4.0/generated/classlist.html) » * Class FliSignalCbHdl * [Edit on GitHub](https://github.com/cocotb/cocotb/blob/v1.4.0/documentation/source/generated/class/classFliSignalCbHdl.rst) * * * Class FliSignalCbHdl[¶](https://docs.cocotb.org/en/v1.4.0/generated/class/classFliSignalCbHdl.html#class-flisignalcbhdl "Permalink to this headline") ====================================================================================================================================================== _class_ `FliSignalCbHdl` : _public_ [FliProcessCbHdl](https://docs.cocotb.org/en/v1.4.0/generated/class/classFliProcessCbHdl.html#_CPPv415FliProcessCbHdl "FliProcessCbHdl") , _public_ [GpiValueCbHdl](https://docs.cocotb.org/en/v1.4.0/generated/class/classGpiValueCbHdl.html#_CPPv413GpiValueCbHdl "GpiValueCbHdl") [¶](https://docs.cocotb.org/en/v1.4.0/generated/class/classFliSignalCbHdl.html#_CPPv414FliSignalCbHdl "Permalink to this definition") cleanup callback Called while unwinding after a GPI callback We keep the process but desensitize it NB: need a way to determine if should leave it sensitized… --- # Class FliSimPhaseCbHdl — cocotb 1.4.0 documentation * [](https://docs.cocotb.org/en/v1.4.0/index.html) » * [C Code Library Reference](https://docs.cocotb.org/en/v1.4.0/library_reference_c.html) » * [Class list](https://docs.cocotb.org/en/v1.4.0/generated/classlist.html) » * Class FliSimPhaseCbHdl * [Edit on GitHub](https://github.com/cocotb/cocotb/blob/v1.4.0/documentation/source/generated/class/classFliSimPhaseCbHdl.rst) * * * Class FliSimPhaseCbHdl[¶](https://docs.cocotb.org/en/v1.4.0/generated/class/classFliSimPhaseCbHdl.html#class-flisimphasecbhdl "Permalink to this headline") ============================================================================================================================================================ _class_ `FliSimPhaseCbHdl` : _public_ [FliProcessCbHdl](https://docs.cocotb.org/en/v1.4.0/generated/class/classFliProcessCbHdl.html#_CPPv415FliProcessCbHdl "FliProcessCbHdl") [¶](https://docs.cocotb.org/en/v1.4.0/generated/class/classFliSimPhaseCbHdl.html#_CPPv416FliSimPhaseCbHdl "Permalink to this definition") Subclassed by [FliNextPhaseCbHdl](https://docs.cocotb.org/en/v1.4.0/generated/file/FliImpl_8h.html#classFliNextPhaseCbHdl) , [FliReadOnlyCbHdl](https://docs.cocotb.org/en/v1.4.0/generated/file/FliImpl_8h.html#classFliReadOnlyCbHdl) , [FliReadWriteCbHdl](https://docs.cocotb.org/en/v1.4.0/generated/file/FliImpl_8h.html#classFliReadWriteCbHdl) cleanup callback Called while unwinding after a GPI callback We keep the process but desensitize it NB: need a way to determine if should leave it sensitized… --- # Class FliTimedCbHdl — cocotb 1.4.0 documentation * [](https://docs.cocotb.org/en/v1.4.0/index.html) » * [C Code Library Reference](https://docs.cocotb.org/en/v1.4.0/library_reference_c.html) » * [Class list](https://docs.cocotb.org/en/v1.4.0/generated/classlist.html) » * Class FliTimedCbHdl * [Edit on GitHub](https://github.com/cocotb/cocotb/blob/v1.4.0/documentation/source/generated/class/classFliTimedCbHdl.rst) * * * Class FliTimedCbHdl[¶](https://docs.cocotb.org/en/v1.4.0/generated/class/classFliTimedCbHdl.html#class-flitimedcbhdl "Permalink to this headline") =================================================================================================================================================== _class_ `FliTimedCbHdl` : _public_ [FliProcessCbHdl](https://docs.cocotb.org/en/v1.4.0/generated/class/classFliProcessCbHdl.html#_CPPv415FliProcessCbHdl "FliProcessCbHdl") [¶](https://docs.cocotb.org/en/v1.4.0/generated/class/classFliTimedCbHdl.html#_CPPv413FliTimedCbHdl "Permalink to this definition") cleanup callback Called while unwinding after a GPI callback We keep the process but desensitize it NB: need a way to determine if should leave it sensitized… --- # Class FliStringObjHdl — cocotb 1.4.0 documentation * [](https://docs.cocotb.org/en/v1.4.0/index.html) » * [C Code Library Reference](https://docs.cocotb.org/en/v1.4.0/library_reference_c.html) » * [Class list](https://docs.cocotb.org/en/v1.4.0/generated/classlist.html) » * Class FliStringObjHdl * [Edit on GitHub](https://github.com/cocotb/cocotb/blob/v1.4.0/documentation/source/generated/class/classFliStringObjHdl.rst) * * * Class FliStringObjHdl[¶](https://docs.cocotb.org/en/v1.4.0/generated/class/classFliStringObjHdl.html#class-flistringobjhdl "Permalink to this headline") ========================================================================================================================================================= _class_ `FliStringObjHdl` : _public_ [FliValueObjHdl](https://docs.cocotb.org/en/v1.4.0/generated/class/classFliValueObjHdl.html#_CPPv414FliValueObjHdl "FliValueObjHdl") [¶](https://docs.cocotb.org/en/v1.4.0/generated/class/classFliStringObjHdl.html#_CPPv415FliStringObjHdl "Permalink to this definition") --- # Class FliTimerCache — cocotb 1.4.0 documentation * [](https://docs.cocotb.org/en/v1.4.0/index.html) » * [C Code Library Reference](https://docs.cocotb.org/en/v1.4.0/library_reference_c.html) » * [Class list](https://docs.cocotb.org/en/v1.4.0/generated/classlist.html) » * Class FliTimerCache * [Edit on GitHub](https://github.com/cocotb/cocotb/blob/v1.4.0/documentation/source/generated/class/classFliTimerCache.rst) * * * Class FliTimerCache[¶](https://docs.cocotb.org/en/v1.4.0/generated/class/classFliTimerCache.html#class-flitimercache "Permalink to this headline") =================================================================================================================================================== _class_ `FliTimerCache`[¶](https://docs.cocotb.org/en/v1.4.0/generated/class/classFliTimerCache.html#_CPPv413FliTimerCache "Permalink to this definition") Find the root handle Find the root handle using an optional name Get a handle to the root simulator object. This is usually the toplevel. If no name is provided, we return the first root instance. If name is provided, we check the name against the available objects until we find a match. If no match is found we return NULL --- # Class GpiCbHdl — cocotb 1.4.0 documentation * [](https://docs.cocotb.org/en/v1.4.0/index.html) » * [C Code Library Reference](https://docs.cocotb.org/en/v1.4.0/library_reference_c.html) » * [Class list](https://docs.cocotb.org/en/v1.4.0/generated/classlist.html) » * Class GpiCbHdl * [Edit on GitHub](https://github.com/cocotb/cocotb/blob/v1.4.0/documentation/source/generated/class/classGpiCbHdl.rst) * * * Class GpiCbHdl[¶](https://docs.cocotb.org/en/v1.4.0/generated/class/classGpiCbHdl.html#class-gpicbhdl "Permalink to this headline") ==================================================================================================================================== _class_ `GpiCbHdl` : _public_ [GpiHdl](https://docs.cocotb.org/en/v1.4.0/generated/class/classGpiHdl.html#_CPPv46GpiHdl "GpiHdl") [¶](https://docs.cocotb.org/en/v1.4.0/generated/class/classGpiCbHdl.html#_CPPv48GpiCbHdl "Permalink to this definition") Subclassed by [FliProcessCbHdl](https://docs.cocotb.org/en/v1.4.0/generated/file/FliImpl_8h.html#classFliProcessCbHdl) , [GpiValueCbHdl](https://docs.cocotb.org/en/v1.4.0/generated/file/gpi__priv_8h.html#classGpiValueCbHdl) , [VhpiCbHdl](https://docs.cocotb.org/en/v1.4.0/generated/file/VhpiImpl_8h.html#classVhpiCbHdl) , [VpiCbHdl](https://docs.cocotb.org/en/v1.4.0/generated/file/VpiImpl_8h.html#classVpiCbHdl) --- # Class FliValueObjHdl — cocotb 1.4.0 documentation * [](https://docs.cocotb.org/en/v1.4.0/index.html) » * [C Code Library Reference](https://docs.cocotb.org/en/v1.4.0/library_reference_c.html) » * [Class list](https://docs.cocotb.org/en/v1.4.0/generated/classlist.html) » * Class FliValueObjHdl * [Edit on GitHub](https://github.com/cocotb/cocotb/blob/v1.4.0/documentation/source/generated/class/classFliValueObjHdl.rst) * * * Class FliValueObjHdl[¶](https://docs.cocotb.org/en/v1.4.0/generated/class/classFliValueObjHdl.html#class-flivalueobjhdl "Permalink to this headline") ====================================================================================================================================================== _class_ `FliValueObjHdl` : _public_ [FliSignalObjHdl](https://docs.cocotb.org/en/v1.4.0/generated/class/classFliSignalObjHdl.html#_CPPv415FliSignalObjHdl "FliSignalObjHdl") [¶](https://docs.cocotb.org/en/v1.4.0/generated/class/classFliValueObjHdl.html#_CPPv414FliValueObjHdl "Permalink to this definition") Subclassed by [FliEnumObjHdl](https://docs.cocotb.org/en/v1.4.0/generated/file/FliImpl_8h.html#classFliEnumObjHdl) , [FliIntObjHdl](https://docs.cocotb.org/en/v1.4.0/generated/file/FliImpl_8h.html#classFliIntObjHdl) , [FliLogicObjHdl](https://docs.cocotb.org/en/v1.4.0/generated/file/FliImpl_8h.html#classFliLogicObjHdl) , [FliRealObjHdl](https://docs.cocotb.org/en/v1.4.0/generated/file/FliImpl_8h.html#classFliRealObjHdl) , [FliStringObjHdl](https://docs.cocotb.org/en/v1.4.0/generated/file/FliImpl_8h.html#classFliStringObjHdl) --- # Class GpiImplInterface — cocotb 1.4.0 documentation * [](https://docs.cocotb.org/en/v1.4.0/index.html) » * [C Code Library Reference](https://docs.cocotb.org/en/v1.4.0/library_reference_c.html) » * [Class list](https://docs.cocotb.org/en/v1.4.0/generated/classlist.html) » * Class GpiImplInterface * [Edit on GitHub](https://github.com/cocotb/cocotb/blob/v1.4.0/documentation/source/generated/class/classGpiImplInterface.rst) * * * Class GpiImplInterface[¶](https://docs.cocotb.org/en/v1.4.0/generated/class/classGpiImplInterface.html#class-gpiimplinterface "Permalink to this headline") ============================================================================================================================================================ _class_ `GpiImplInterface`[¶](https://docs.cocotb.org/en/v1.4.0/generated/class/classGpiImplInterface.html#_CPPv416GpiImplInterface "Permalink to this definition") Subclassed by [FliImpl](https://docs.cocotb.org/en/v1.4.0/generated/file/FliImpl_8h.html#classFliImpl) , [VhpiImpl](https://docs.cocotb.org/en/v1.4.0/generated/file/VhpiImpl_8h.html#classVhpiImpl) , [VpiImpl](https://docs.cocotb.org/en/v1.4.0/generated/file/VpiImpl_8h.html#classVpiImpl) --- # Class GpiHdl — cocotb 1.4.0 documentation * [](https://docs.cocotb.org/en/v1.4.0/index.html) » * [C Code Library Reference](https://docs.cocotb.org/en/v1.4.0/library_reference_c.html) » * [Class list](https://docs.cocotb.org/en/v1.4.0/generated/classlist.html) » * Class GpiHdl * [Edit on GitHub](https://github.com/cocotb/cocotb/blob/v1.4.0/documentation/source/generated/class/classGpiHdl.rst) * * * Class GpiHdl[¶](https://docs.cocotb.org/en/v1.4.0/generated/class/classGpiHdl.html#class-gpihdl "Permalink to this headline") ============================================================================================================================== _class_ `GpiHdl`[¶](https://docs.cocotb.org/en/v1.4.0/generated/class/classGpiHdl.html#_CPPv46GpiHdl "Permalink to this definition") Subclassed by [GpiCbHdl](https://docs.cocotb.org/en/v1.4.0/generated/file/gpi__priv_8h.html#classGpiCbHdl) , [GpiIterator](https://docs.cocotb.org/en/v1.4.0/generated/file/gpi__priv_8h.html#classGpiIterator) , [GpiObjHdl](https://docs.cocotb.org/en/v1.4.0/generated/file/gpi__priv_8h.html#classGpiObjHdl) --- # Class GpiIterator — cocotb 1.4.0 documentation * [](https://docs.cocotb.org/en/v1.4.0/index.html) » * [C Code Library Reference](https://docs.cocotb.org/en/v1.4.0/library_reference_c.html) » * [Class list](https://docs.cocotb.org/en/v1.4.0/generated/classlist.html) » * Class GpiIterator * [Edit on GitHub](https://github.com/cocotb/cocotb/blob/v1.4.0/documentation/source/generated/class/classGpiIterator.rst) * * * Class GpiIterator[¶](https://docs.cocotb.org/en/v1.4.0/generated/class/classGpiIterator.html#class-gpiiterator "Permalink to this headline") ============================================================================================================================================= _class_ `GpiIterator` : _public_ [GpiHdl](https://docs.cocotb.org/en/v1.4.0/generated/class/classGpiHdl.html#_CPPv46GpiHdl "GpiHdl") [¶](https://docs.cocotb.org/en/v1.4.0/generated/class/classGpiIterator.html#_CPPv411GpiIterator "Permalink to this definition") Subclassed by [FliIterator](https://docs.cocotb.org/en/v1.4.0/generated/file/FliImpl_8h.html#classFliIterator) , [VhpiIterator](https://docs.cocotb.org/en/v1.4.0/generated/file/VhpiImpl_8h.html#classVhpiIterator) , [VpiIterator](https://docs.cocotb.org/en/v1.4.0/generated/file/VpiImpl_8h.html#classVpiIterator) , [VpiSingleIterator](https://docs.cocotb.org/en/v1.4.0/generated/file/VpiImpl_8h.html#classVpiSingleIterator) --- # Class GpiIteratorMapping — cocotb 1.4.0 documentation * [](https://docs.cocotb.org/en/v1.4.0/index.html) » * [C Code Library Reference](https://docs.cocotb.org/en/v1.4.0/library_reference_c.html) » * [Class list](https://docs.cocotb.org/en/v1.4.0/generated/classlist.html) » * Class GpiIteratorMapping * [Edit on GitHub](https://github.com/cocotb/cocotb/blob/v1.4.0/documentation/source/generated/class/classGpiIteratorMapping.rst) * * * Class GpiIteratorMapping[¶](https://docs.cocotb.org/en/v1.4.0/generated/class/classGpiIteratorMapping.html#class-gpiiteratormapping "Permalink to this headline") ================================================================================================================================================================== template _class_ `GpiIteratorMapping`[¶](https://docs.cocotb.org/en/v1.4.0/generated/class/classGpiIteratorMapping.html#_CPPv4I00E18GpiIteratorMapping "Permalink to this definition") --- # Class GpiObjHdl — cocotb 1.4.0 documentation * [](https://docs.cocotb.org/en/v1.4.0/index.html) » * [C Code Library Reference](https://docs.cocotb.org/en/v1.4.0/library_reference_c.html) » * [Class list](https://docs.cocotb.org/en/v1.4.0/generated/classlist.html) » * Class GpiObjHdl * [Edit on GitHub](https://github.com/cocotb/cocotb/blob/v1.4.0/documentation/source/generated/class/classGpiObjHdl.rst) * * * Class GpiObjHdl[¶](https://docs.cocotb.org/en/v1.4.0/generated/class/classGpiObjHdl.html#class-gpiobjhdl "Permalink to this headline") ======================================================================================================================================= _class_ `GpiObjHdl` : _public_ [GpiHdl](https://docs.cocotb.org/en/v1.4.0/generated/class/classGpiHdl.html#_CPPv46GpiHdl "GpiHdl") [¶](https://docs.cocotb.org/en/v1.4.0/generated/class/classGpiObjHdl.html#_CPPv49GpiObjHdl "Permalink to this definition") Subclassed by [FliObjHdl](https://docs.cocotb.org/en/v1.4.0/generated/file/FliImpl_8h.html#classFliObjHdl) , [GpiSignalObjHdl](https://docs.cocotb.org/en/v1.4.0/generated/file/gpi__priv_8h.html#classGpiSignalObjHdl) , [VhpiArrayObjHdl](https://docs.cocotb.org/en/v1.4.0/generated/file/VhpiImpl_8h.html#classVhpiArrayObjHdl) , [VhpiObjHdl](https://docs.cocotb.org/en/v1.4.0/generated/file/VhpiImpl_8h.html#classVhpiObjHdl) , [VpiArrayObjHdl](https://docs.cocotb.org/en/v1.4.0/generated/file/VpiImpl_8h.html#classVpiArrayObjHdl) , [VpiObjHdl](https://docs.cocotb.org/en/v1.4.0/generated/file/VpiImpl_8h.html#classVpiObjHdl) --- # Class GpiValueCbHdl — cocotb 1.4.0 documentation * [](https://docs.cocotb.org/en/v1.4.0/index.html) » * [C Code Library Reference](https://docs.cocotb.org/en/v1.4.0/library_reference_c.html) » * [Class list](https://docs.cocotb.org/en/v1.4.0/generated/classlist.html) » * Class GpiValueCbHdl * [Edit on GitHub](https://github.com/cocotb/cocotb/blob/v1.4.0/documentation/source/generated/class/classGpiValueCbHdl.rst) * * * Class GpiValueCbHdl[¶](https://docs.cocotb.org/en/v1.4.0/generated/class/classGpiValueCbHdl.html#class-gpivaluecbhdl "Permalink to this headline") =================================================================================================================================================== _class_ `GpiValueCbHdl` : _public_ _virtual_ [GpiCbHdl](https://docs.cocotb.org/en/v1.4.0/generated/class/classGpiCbHdl.html#_CPPv48GpiCbHdl "GpiCbHdl") [¶](https://docs.cocotb.org/en/v1.4.0/generated/class/classGpiValueCbHdl.html#_CPPv413GpiValueCbHdl "Permalink to this definition") Subclassed by [FliSignalCbHdl](https://docs.cocotb.org/en/v1.4.0/generated/file/FliImpl_8h.html#classFliSignalCbHdl) , [VhpiValueCbHdl](https://docs.cocotb.org/en/v1.4.0/generated/file/VhpiImpl_8h.html#classVhpiValueCbHdl) , [VpiValueCbHdl](https://docs.cocotb.org/en/v1.4.0/generated/file/VpiImpl_8h.html#classVpiValueCbHdl) --- # Class GpiSignalObjHdl — cocotb 1.4.0 documentation * [](https://docs.cocotb.org/en/v1.4.0/index.html) » * [C Code Library Reference](https://docs.cocotb.org/en/v1.4.0/library_reference_c.html) » * [Class list](https://docs.cocotb.org/en/v1.4.0/generated/classlist.html) » * Class GpiSignalObjHdl * [Edit on GitHub](https://github.com/cocotb/cocotb/blob/v1.4.0/documentation/source/generated/class/classGpiSignalObjHdl.rst) * * * Class GpiSignalObjHdl[¶](https://docs.cocotb.org/en/v1.4.0/generated/class/classGpiSignalObjHdl.html#class-gpisignalobjhdl "Permalink to this headline") ========================================================================================================================================================= _class_ `GpiSignalObjHdl` : _public_ [GpiObjHdl](https://docs.cocotb.org/en/v1.4.0/generated/class/classGpiObjHdl.html#_CPPv49GpiObjHdl "GpiObjHdl") [¶](https://docs.cocotb.org/en/v1.4.0/generated/class/classGpiSignalObjHdl.html#_CPPv415GpiSignalObjHdl "Permalink to this definition") Subclassed by [FliSignalObjHdl](https://docs.cocotb.org/en/v1.4.0/generated/file/FliImpl_8h.html#classFliSignalObjHdl) , [VhpiSignalObjHdl](https://docs.cocotb.org/en/v1.4.0/generated/file/VhpiImpl_8h.html#classVhpiSignalObjHdl) , [VpiSignalObjHdl](https://docs.cocotb.org/en/v1.4.0/generated/file/VpiImpl_8h.html#classVpiSignalObjHdl) --- # Class VhpiArrayObjHdl — cocotb 1.4.0 documentation * [](https://docs.cocotb.org/en/v1.4.0/index.html) » * [C Code Library Reference](https://docs.cocotb.org/en/v1.4.0/library_reference_c.html) » * [Class list](https://docs.cocotb.org/en/v1.4.0/generated/classlist.html) » * Class VhpiArrayObjHdl * [Edit on GitHub](https://github.com/cocotb/cocotb/blob/v1.4.0/documentation/source/generated/class/classVhpiArrayObjHdl.rst) * * * Class VhpiArrayObjHdl[¶](https://docs.cocotb.org/en/v1.4.0/generated/class/classVhpiArrayObjHdl.html#class-vhpiarrayobjhdl "Permalink to this headline") ========================================================================================================================================================= _class_ `VhpiArrayObjHdl` : _public_ [GpiObjHdl](https://docs.cocotb.org/en/v1.4.0/generated/class/classGpiObjHdl.html#_CPPv49GpiObjHdl "GpiObjHdl") [¶](https://docs.cocotb.org/en/v1.4.0/generated/class/classVhpiArrayObjHdl.html#_CPPv415VhpiArrayObjHdl "Permalink to this definition") --- # Class VhpiCbHdl — cocotb 1.4.0 documentation * [](https://docs.cocotb.org/en/v1.4.0/index.html) » * [C Code Library Reference](https://docs.cocotb.org/en/v1.4.0/library_reference_c.html) » * [Class list](https://docs.cocotb.org/en/v1.4.0/generated/classlist.html) » * Class VhpiCbHdl * [Edit on GitHub](https://github.com/cocotb/cocotb/blob/v1.4.0/documentation/source/generated/class/classVhpiCbHdl.rst) * * * Class VhpiCbHdl[¶](https://docs.cocotb.org/en/v1.4.0/generated/class/classVhpiCbHdl.html#class-vhpicbhdl "Permalink to this headline") ======================================================================================================================================= _class_ `VhpiCbHdl` : _public_ _virtual_ [GpiCbHdl](https://docs.cocotb.org/en/v1.4.0/generated/class/classGpiCbHdl.html#_CPPv48GpiCbHdl "GpiCbHdl") [¶](https://docs.cocotb.org/en/v1.4.0/generated/class/classVhpiCbHdl.html#_CPPv49VhpiCbHdl "Permalink to this definition") Subclassed by [VhpiNextPhaseCbHdl](https://docs.cocotb.org/en/v1.4.0/generated/file/VhpiImpl_8h.html#classVhpiNextPhaseCbHdl) , [VhpiReadOnlyCbHdl](https://docs.cocotb.org/en/v1.4.0/generated/file/VhpiImpl_8h.html#classVhpiReadOnlyCbHdl) , [VhpiReadwriteCbHdl](https://docs.cocotb.org/en/v1.4.0/generated/file/VhpiImpl_8h.html#classVhpiReadwriteCbHdl) , [VhpiShutdownCbHdl](https://docs.cocotb.org/en/v1.4.0/generated/file/VhpiImpl_8h.html#classVhpiShutdownCbHdl) , [VhpiStartupCbHdl](https://docs.cocotb.org/en/v1.4.0/generated/file/VhpiImpl_8h.html#classVhpiStartupCbHdl) , [VhpiTimedCbHdl](https://docs.cocotb.org/en/v1.4.0/generated/file/VhpiImpl_8h.html#classVhpiTimedCbHdl) , [VhpiValueCbHdl](https://docs.cocotb.org/en/v1.4.0/generated/file/VhpiImpl_8h.html#classVhpiValueCbHdl) --- # Class VhpiImpl — cocotb 1.4.0 documentation * [](https://docs.cocotb.org/en/v1.4.0/index.html) » * [C Code Library Reference](https://docs.cocotb.org/en/v1.4.0/library_reference_c.html) » * [Class list](https://docs.cocotb.org/en/v1.4.0/generated/classlist.html) » * Class VhpiImpl * [Edit on GitHub](https://github.com/cocotb/cocotb/blob/v1.4.0/documentation/source/generated/class/classVhpiImpl.rst) * * * Class VhpiImpl[¶](https://docs.cocotb.org/en/v1.4.0/generated/class/classVhpiImpl.html#class-vhpiimpl "Permalink to this headline") ==================================================================================================================================== _class_ `VhpiImpl` : _public_ [GpiImplInterface](https://docs.cocotb.org/en/v1.4.0/generated/class/classGpiImplInterface.html#_CPPv416GpiImplInterface "GpiImplInterface") [¶](https://docs.cocotb.org/en/v1.4.0/generated/class/classVhpiImpl.html#_CPPv48VhpiImpl "Permalink to this definition") --- # Class VhpiIterator — cocotb 1.4.0 documentation * [](https://docs.cocotb.org/en/v1.4.0/index.html) » * [C Code Library Reference](https://docs.cocotb.org/en/v1.4.0/library_reference_c.html) » * [Class list](https://docs.cocotb.org/en/v1.4.0/generated/classlist.html) » * Class VhpiIterator * [Edit on GitHub](https://github.com/cocotb/cocotb/blob/v1.4.0/documentation/source/generated/class/classVhpiIterator.rst) * * * Class VhpiIterator[¶](https://docs.cocotb.org/en/v1.4.0/generated/class/classVhpiIterator.html#class-vhpiiterator "Permalink to this headline") ================================================================================================================================================ _class_ `VhpiIterator` : _public_ [GpiIterator](https://docs.cocotb.org/en/v1.4.0/generated/class/classGpiIterator.html#_CPPv411GpiIterator "GpiIterator") [¶](https://docs.cocotb.org/en/v1.4.0/generated/class/classVhpiIterator.html#_CPPv412VhpiIterator "Permalink to this definition") --- # Class VhpiLogicSignalObjHdl — cocotb 1.4.0 documentation * [](https://docs.cocotb.org/en/v1.4.0/index.html) » * [C Code Library Reference](https://docs.cocotb.org/en/v1.4.0/library_reference_c.html) » * [Class list](https://docs.cocotb.org/en/v1.4.0/generated/classlist.html) » * Class VhpiLogicSignalObjHdl * [Edit on GitHub](https://github.com/cocotb/cocotb/blob/v1.4.0/documentation/source/generated/class/classVhpiLogicSignalObjHdl.rst) * * * Class VhpiLogicSignalObjHdl[¶](https://docs.cocotb.org/en/v1.4.0/generated/class/classVhpiLogicSignalObjHdl.html#class-vhpilogicsignalobjhdl "Permalink to this headline") =========================================================================================================================================================================== _class_ `VhpiLogicSignalObjHdl` : _public_ [VhpiSignalObjHdl](https://docs.cocotb.org/en/v1.4.0/generated/class/classVhpiSignalObjHdl.html#_CPPv416VhpiSignalObjHdl "VhpiSignalObjHdl") [¶](https://docs.cocotb.org/en/v1.4.0/generated/class/classVhpiLogicSignalObjHdl.html#_CPPv421VhpiLogicSignalObjHdl "Permalink to this definition") --- # Class VhpiObjHdl — cocotb 1.4.0 documentation * [](https://docs.cocotb.org/en/v1.4.0/index.html) » * [C Code Library Reference](https://docs.cocotb.org/en/v1.4.0/library_reference_c.html) » * [Class list](https://docs.cocotb.org/en/v1.4.0/generated/classlist.html) » * Class VhpiObjHdl * [Edit on GitHub](https://github.com/cocotb/cocotb/blob/v1.4.0/documentation/source/generated/class/classVhpiObjHdl.rst) * * * Class VhpiObjHdl[¶](https://docs.cocotb.org/en/v1.4.0/generated/class/classVhpiObjHdl.html#class-vhpiobjhdl "Permalink to this headline") ========================================================================================================================================== _class_ `VhpiObjHdl` : _public_ [GpiObjHdl](https://docs.cocotb.org/en/v1.4.0/generated/class/classGpiObjHdl.html#_CPPv49GpiObjHdl "GpiObjHdl") [¶](https://docs.cocotb.org/en/v1.4.0/generated/class/classVhpiObjHdl.html#_CPPv410VhpiObjHdl "Permalink to this definition") --- # Class VhpiNextPhaseCbHdl — cocotb 1.4.0 documentation * [](https://docs.cocotb.org/en/v1.4.0/index.html) » * [C Code Library Reference](https://docs.cocotb.org/en/v1.4.0/library_reference_c.html) » * [Class list](https://docs.cocotb.org/en/v1.4.0/generated/classlist.html) » * Class VhpiNextPhaseCbHdl * [Edit on GitHub](https://github.com/cocotb/cocotb/blob/v1.4.0/documentation/source/generated/class/classVhpiNextPhaseCbHdl.rst) * * * Class VhpiNextPhaseCbHdl[¶](https://docs.cocotb.org/en/v1.4.0/generated/class/classVhpiNextPhaseCbHdl.html#class-vhpinextphasecbhdl "Permalink to this headline") ================================================================================================================================================================== _class_ `VhpiNextPhaseCbHdl` : _public_ [VhpiCbHdl](https://docs.cocotb.org/en/v1.4.0/generated/class/classVhpiCbHdl.html#_CPPv49VhpiCbHdl "VhpiCbHdl") [¶](https://docs.cocotb.org/en/v1.4.0/generated/class/classVhpiNextPhaseCbHdl.html#_CPPv418VhpiNextPhaseCbHdl "Permalink to this definition") --- # Class VhpiReadOnlyCbHdl — cocotb 1.4.0 documentation * [](https://docs.cocotb.org/en/v1.4.0/index.html) » * [C Code Library Reference](https://docs.cocotb.org/en/v1.4.0/library_reference_c.html) » * [Class list](https://docs.cocotb.org/en/v1.4.0/generated/classlist.html) » * Class VhpiReadOnlyCbHdl * [Edit on GitHub](https://github.com/cocotb/cocotb/blob/v1.4.0/documentation/source/generated/class/classVhpiReadOnlyCbHdl.rst) * * * Class VhpiReadOnlyCbHdl[¶](https://docs.cocotb.org/en/v1.4.0/generated/class/classVhpiReadOnlyCbHdl.html#class-vhpireadonlycbhdl "Permalink to this headline") =============================================================================================================================================================== _class_ `VhpiReadOnlyCbHdl` : _public_ [VhpiCbHdl](https://docs.cocotb.org/en/v1.4.0/generated/class/classVhpiCbHdl.html#_CPPv49VhpiCbHdl "VhpiCbHdl") [¶](https://docs.cocotb.org/en/v1.4.0/generated/class/classVhpiReadOnlyCbHdl.html#_CPPv417VhpiReadOnlyCbHdl "Permalink to this definition") --- # Class VhpiReadwriteCbHdl — cocotb 1.4.0 documentation * [](https://docs.cocotb.org/en/v1.4.0/index.html) » * [C Code Library Reference](https://docs.cocotb.org/en/v1.4.0/library_reference_c.html) » * [Class list](https://docs.cocotb.org/en/v1.4.0/generated/classlist.html) » * Class VhpiReadwriteCbHdl * [Edit on GitHub](https://github.com/cocotb/cocotb/blob/v1.4.0/documentation/source/generated/class/classVhpiReadwriteCbHdl.rst) * * * Class VhpiReadwriteCbHdl[¶](https://docs.cocotb.org/en/v1.4.0/generated/class/classVhpiReadwriteCbHdl.html#class-vhpireadwritecbhdl "Permalink to this headline") ================================================================================================================================================================== _class_ `VhpiReadwriteCbHdl` : _public_ [VhpiCbHdl](https://docs.cocotb.org/en/v1.4.0/generated/class/classVhpiCbHdl.html#_CPPv49VhpiCbHdl "VhpiCbHdl") [¶](https://docs.cocotb.org/en/v1.4.0/generated/class/classVhpiReadwriteCbHdl.html#_CPPv418VhpiReadwriteCbHdl "Permalink to this definition") --- # Class VhpiShutdownCbHdl — cocotb 1.4.0 documentation * [](https://docs.cocotb.org/en/v1.4.0/index.html) » * [C Code Library Reference](https://docs.cocotb.org/en/v1.4.0/library_reference_c.html) » * [Class list](https://docs.cocotb.org/en/v1.4.0/generated/classlist.html) » * Class VhpiShutdownCbHdl * [Edit on GitHub](https://github.com/cocotb/cocotb/blob/v1.4.0/documentation/source/generated/class/classVhpiShutdownCbHdl.rst) * * * Class VhpiShutdownCbHdl[¶](https://docs.cocotb.org/en/v1.4.0/generated/class/classVhpiShutdownCbHdl.html#class-vhpishutdowncbhdl "Permalink to this headline") =============================================================================================================================================================== _class_ `VhpiShutdownCbHdl` : _public_ [VhpiCbHdl](https://docs.cocotb.org/en/v1.4.0/generated/class/classVhpiCbHdl.html#_CPPv49VhpiCbHdl "VhpiCbHdl") [¶](https://docs.cocotb.org/en/v1.4.0/generated/class/classVhpiShutdownCbHdl.html#_CPPv417VhpiShutdownCbHdl "Permalink to this definition") --- # Class VhpiSignalObjHdl — cocotb 1.4.0 documentation * [](https://docs.cocotb.org/en/v1.4.0/index.html) » * [C Code Library Reference](https://docs.cocotb.org/en/v1.4.0/library_reference_c.html) » * [Class list](https://docs.cocotb.org/en/v1.4.0/generated/classlist.html) » * Class VhpiSignalObjHdl * [Edit on GitHub](https://github.com/cocotb/cocotb/blob/v1.4.0/documentation/source/generated/class/classVhpiSignalObjHdl.rst) * * * Class VhpiSignalObjHdl[¶](https://docs.cocotb.org/en/v1.4.0/generated/class/classVhpiSignalObjHdl.html#class-vhpisignalobjhdl "Permalink to this headline") ============================================================================================================================================================ _class_ `VhpiSignalObjHdl` : _public_ [GpiSignalObjHdl](https://docs.cocotb.org/en/v1.4.0/generated/class/classGpiSignalObjHdl.html#_CPPv415GpiSignalObjHdl "GpiSignalObjHdl") [¶](https://docs.cocotb.org/en/v1.4.0/generated/class/classVhpiSignalObjHdl.html#_CPPv416VhpiSignalObjHdl "Permalink to this definition") Subclassed by [VhpiLogicSignalObjHdl](https://docs.cocotb.org/en/v1.4.0/generated/file/VhpiImpl_8h.html#classVhpiLogicSignalObjHdl) --- # Class VhpiTimedCbHdl — cocotb 1.4.0 documentation * [](https://docs.cocotb.org/en/v1.4.0/index.html) » * [C Code Library Reference](https://docs.cocotb.org/en/v1.4.0/library_reference_c.html) » * [Class list](https://docs.cocotb.org/en/v1.4.0/generated/classlist.html) » * Class VhpiTimedCbHdl * [Edit on GitHub](https://github.com/cocotb/cocotb/blob/v1.4.0/documentation/source/generated/class/classVhpiTimedCbHdl.rst) * * * Class VhpiTimedCbHdl[¶](https://docs.cocotb.org/en/v1.4.0/generated/class/classVhpiTimedCbHdl.html#class-vhpitimedcbhdl "Permalink to this headline") ====================================================================================================================================================== _class_ `VhpiTimedCbHdl` : _public_ [VhpiCbHdl](https://docs.cocotb.org/en/v1.4.0/generated/class/classVhpiCbHdl.html#_CPPv49VhpiCbHdl "VhpiCbHdl") [¶](https://docs.cocotb.org/en/v1.4.0/generated/class/classVhpiTimedCbHdl.html#_CPPv414VhpiTimedCbHdl "Permalink to this definition") --- # Class VhpiStartupCbHdl — cocotb 1.4.0 documentation * [](https://docs.cocotb.org/en/v1.4.0/index.html) » * [C Code Library Reference](https://docs.cocotb.org/en/v1.4.0/library_reference_c.html) » * [Class list](https://docs.cocotb.org/en/v1.4.0/generated/classlist.html) » * Class VhpiStartupCbHdl * [Edit on GitHub](https://github.com/cocotb/cocotb/blob/v1.4.0/documentation/source/generated/class/classVhpiStartupCbHdl.rst) * * * Class VhpiStartupCbHdl[¶](https://docs.cocotb.org/en/v1.4.0/generated/class/classVhpiStartupCbHdl.html#class-vhpistartupcbhdl "Permalink to this headline") ============================================================================================================================================================ _class_ `VhpiStartupCbHdl` : _public_ [VhpiCbHdl](https://docs.cocotb.org/en/v1.4.0/generated/class/classVhpiCbHdl.html#_CPPv49VhpiCbHdl "VhpiCbHdl") [¶](https://docs.cocotb.org/en/v1.4.0/generated/class/classVhpiStartupCbHdl.html#_CPPv416VhpiStartupCbHdl "Permalink to this definition") --- # File FliCbHdl.cpp — cocotb 1.4.0 documentation * [](https://docs.cocotb.org/en/v1.4.0/index.html) » * [C Code Library Reference](https://docs.cocotb.org/en/v1.4.0/library_reference_c.html) » * [File list](https://docs.cocotb.org/en/v1.4.0/generated/filelist.html) » * File FliCbHdl.cpp * [Edit on GitHub](https://github.com/cocotb/cocotb/blob/v1.4.0/documentation/source/generated/file/FliCbHdl_8cpp.rst) * * * File FliCbHdl.cpp[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/FliCbHdl_8cpp.html#file-flicbhdl-cpp "Permalink to this headline") ========================================================================================================================================= cleanup callback Called while unwinding after a GPI callback We keep the process but desensitize it NB: need a way to determine if should leave it sensitized… [std](https://docs.cocotb.org/en/v1.4.0/generated/file/GpiCommon_8cpp.html#_CPPv4St "std") ::vector<[std](https://docs.cocotb.org/en/v1.4.0/generated/file/GpiCommon_8cpp.html#_CPPv4St "std") ::string> `get_argv`()[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/FliCbHdl_8cpp.html#_CPPv48get_argvv "Permalink to this definition") --- # File FliImpl.cpp — cocotb 1.4.0 documentation * [](https://docs.cocotb.org/en/v1.4.0/index.html) » * [C Code Library Reference](https://docs.cocotb.org/en/v1.4.0/library_reference_c.html) » * [File list](https://docs.cocotb.org/en/v1.4.0/generated/filelist.html) » * File FliImpl.cpp * [Edit on GitHub](https://github.com/cocotb/cocotb/blob/v1.4.0/documentation/source/generated/file/FliImpl_8cpp.rst) * * * File FliImpl.cpp[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/FliImpl_8cpp.html#file-fliimpl-cpp "Permalink to this headline") ====================================================================================================================================== Find the root handle Find the root handle using an optional name Get a handle to the root simulator object. This is usually the toplevel. If no name is provided, we return the first root instance. If name is provided, we check the name against the available objects until we find a match. If no match is found we return NULL void `fli_mappings`([GpiIteratorMapping](https://docs.cocotb.org/en/v1.4.0/generated/class/classGpiIteratorMapping.html#_CPPv4I00E18GpiIteratorMapping "GpiIteratorMapping") &_map_)[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/FliImpl_8cpp.html#_CPPv412fli_mappingsR18GpiIteratorMappingIiN11FliIterator9OneToManyEE "Permalink to this definition") void `handle_fli_callback`(void \*_data_)[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/FliImpl_8cpp.html#_CPPv419handle_fli_callbackPv "Permalink to this definition") void `register_initial_callback`()[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/FliImpl_8cpp.html#_CPPv425register_initial_callbackv "Permalink to this definition") void `register_final_callback`()[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/FliImpl_8cpp.html#_CPPv423register_final_callbackv "Permalink to this definition") void `register_embed`()[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/FliImpl_8cpp.html#_CPPv414register_embedv "Permalink to this definition") void `cocotb_init`()[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/FliImpl_8cpp.html#_CPPv411cocotb_initv "Permalink to this definition") `GPI_ENTRY_POINT`(cocotbfli, [register\_embed](https://docs.cocotb.org/en/v1.4.0/generated/file/FliImpl_8cpp.html#_CPPv414register_embedv "register_embed") )[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/FliImpl_8cpp.html#_CPPv415GPI_ENTRY_POINT9cocotbfli14register_embed "Permalink to this definition") Variables [FliProcessCbHdl](https://docs.cocotb.org/en/v1.4.0/generated/class/classFliProcessCbHdl.html#_CPPv415FliProcessCbHdl "FliProcessCbHdl") \*`sim_init_cb`[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/FliImpl_8cpp.html#_CPPv411sim_init_cb "Permalink to this definition") [FliProcessCbHdl](https://docs.cocotb.org/en/v1.4.0/generated/class/classFliProcessCbHdl.html#_CPPv415FliProcessCbHdl "FliProcessCbHdl") \*`sim_finish_cb`[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/FliImpl_8cpp.html#_CPPv413sim_finish_cb "Permalink to this definition") [FliImpl](https://docs.cocotb.org/en/v1.4.0/generated/class/classFliImpl.html#_CPPv47FliImpl "FliImpl") \*`fli_table`[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/FliImpl_8cpp.html#_CPPv49fli_table "Permalink to this definition") --- # File FliImpl.h — cocotb 1.4.0 documentation * [](https://docs.cocotb.org/en/v1.4.0/index.html) » * [C Code Library Reference](https://docs.cocotb.org/en/v1.4.0/library_reference_c.html) » * [File list](https://docs.cocotb.org/en/v1.4.0/generated/filelist.html) » * File FliImpl.h * [Edit on GitHub](https://github.com/cocotb/cocotb/blob/v1.4.0/documentation/source/generated/file/FliImpl_8h.rst) * * * File FliImpl.h[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/FliImpl_8h.html#file-fliimpl-h "Permalink to this headline") ================================================================================================================================ Functions void `cocotb_init`() void `handle_fli_callback`(void \*_data_) _class_ `FliProcessCbHdl` : _public_ _virtual_ [GpiCbHdl](https://docs.cocotb.org/en/v1.4.0/generated/class/classGpiCbHdl.html#_CPPv48GpiCbHdl "GpiCbHdl") Subclassed by [FliShutdownCbHdl](https://docs.cocotb.org/en/v1.4.0/generated/file/FliImpl_8h.html#classFliShutdownCbHdl) , [FliSignalCbHdl](https://docs.cocotb.org/en/v1.4.0/generated/file/FliImpl_8h.html#classFliSignalCbHdl) , [FliSimPhaseCbHdl](https://docs.cocotb.org/en/v1.4.0/generated/file/FliImpl_8h.html#classFliSimPhaseCbHdl) , [FliStartupCbHdl](https://docs.cocotb.org/en/v1.4.0/generated/file/FliImpl_8h.html#classFliStartupCbHdl) , [FliTimedCbHdl](https://docs.cocotb.org/en/v1.4.0/generated/file/FliImpl_8h.html#classFliTimedCbHdl) cleanup callback Called while unwinding after a GPI callback We keep the process but desensitize it NB: need a way to determine if should leave it sensitized… int `cleanup_callback`() _override_[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/FliImpl_8h.html#_CPPv4N15FliProcessCbHdl16cleanup_callbackEv "Permalink to this definition") Public Functions `FliProcessCbHdl`([GpiImplInterface](https://docs.cocotb.org/en/v1.4.0/generated/class/classGpiImplInterface.html#_CPPv416GpiImplInterface "GpiImplInterface") \*_impl_)[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/FliImpl_8h.html#_CPPv4N15FliProcessCbHdl15FliProcessCbHdlEP16GpiImplInterface "Permalink to this definition") Protected Attributes mtiProcessIdT `m_proc_hdl`[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/FliImpl_8h.html#_CPPv4N15FliProcessCbHdl10m_proc_hdlE "Permalink to this definition") bool `m_sensitised`[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/FliImpl_8h.html#_CPPv4N15FliProcessCbHdl12m_sensitisedE "Permalink to this definition") _class_ `FliSignalCbHdl` : _public_ [FliProcessCbHdl](https://docs.cocotb.org/en/v1.4.0/generated/class/classFliProcessCbHdl.html#_CPPv415FliProcessCbHdl "FliProcessCbHdl") , _public_ [GpiValueCbHdl](https://docs.cocotb.org/en/v1.4.0/generated/class/classGpiValueCbHdl.html#_CPPv413GpiValueCbHdl "GpiValueCbHdl") cleanup callback Called while unwinding after a GPI callback We keep the process but desensitize it NB: need a way to determine if should leave it sensitized… `FliSignalCbHdl`([GpiImplInterface](https://docs.cocotb.org/en/v1.4.0/generated/class/classGpiImplInterface.html#_CPPv416GpiImplInterface "GpiImplInterface") \*_impl_, [FliSignalObjHdl](https://docs.cocotb.org/en/v1.4.0/generated/class/classFliSignalObjHdl.html#_CPPv415FliSignalObjHdl "FliSignalObjHdl") \*_sig\_hdl_, int _edge_)[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/FliImpl_8h.html#_CPPv4N14FliSignalCbHdl14FliSignalCbHdlEP16GpiImplInterfaceP15FliSignalObjHdli "Permalink to this definition") int `arm_callback`() _override_[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/FliImpl_8h.html#_CPPv4N14FliSignalCbHdl12arm_callbackEv "Permalink to this definition") Public Functions int `cleanup_callback`() _override_[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/FliImpl_8h.html#_CPPv4N14FliSignalCbHdl16cleanup_callbackEv "Permalink to this definition") Private Members mtiSignalIdT `m_sig_hdl`[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/FliImpl_8h.html#_CPPv4N14FliSignalCbHdl9m_sig_hdlE "Permalink to this definition") _class_ `FliSimPhaseCbHdl` : _public_ [FliProcessCbHdl](https://docs.cocotb.org/en/v1.4.0/generated/class/classFliProcessCbHdl.html#_CPPv415FliProcessCbHdl "FliProcessCbHdl") Subclassed by [FliNextPhaseCbHdl](https://docs.cocotb.org/en/v1.4.0/generated/file/FliImpl_8h.html#classFliNextPhaseCbHdl) , [FliReadOnlyCbHdl](https://docs.cocotb.org/en/v1.4.0/generated/file/FliImpl_8h.html#classFliReadOnlyCbHdl) , [FliReadWriteCbHdl](https://docs.cocotb.org/en/v1.4.0/generated/file/FliImpl_8h.html#classFliReadWriteCbHdl) cleanup callback Called while unwinding after a GPI callback We keep the process but desensitize it NB: need a way to determine if should leave it sensitized… int `arm_callback`() _override_[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/FliImpl_8h.html#_CPPv4N16FliSimPhaseCbHdl12arm_callbackEv "Permalink to this definition") Public Functions `FliSimPhaseCbHdl`([GpiImplInterface](https://docs.cocotb.org/en/v1.4.0/generated/class/classGpiImplInterface.html#_CPPv416GpiImplInterface "GpiImplInterface") \*_impl_, mtiProcessPriorityT _priority_)[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/FliImpl_8h.html#_CPPv4N16FliSimPhaseCbHdl16FliSimPhaseCbHdlEP16GpiImplInterface19mtiProcessPriorityT "Permalink to this definition") Protected Attributes mtiProcessPriorityT `m_priority`[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/FliImpl_8h.html#_CPPv4N16FliSimPhaseCbHdl10m_priorityE "Permalink to this definition") _class_ `FliReadWriteCbHdl` : _public_ [FliSimPhaseCbHdl](https://docs.cocotb.org/en/v1.4.0/generated/class/classFliSimPhaseCbHdl.html#_CPPv416FliSimPhaseCbHdl "FliSimPhaseCbHdl") Public Functions `FliReadWriteCbHdl`([GpiImplInterface](https://docs.cocotb.org/en/v1.4.0/generated/class/classGpiImplInterface.html#_CPPv416GpiImplInterface "GpiImplInterface") \*_impl_)[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/FliImpl_8h.html#_CPPv4N17FliReadWriteCbHdl17FliReadWriteCbHdlEP16GpiImplInterface "Permalink to this definition") _class_ `FliNextPhaseCbHdl` : _public_ [FliSimPhaseCbHdl](https://docs.cocotb.org/en/v1.4.0/generated/class/classFliSimPhaseCbHdl.html#_CPPv416FliSimPhaseCbHdl "FliSimPhaseCbHdl") Public Functions `FliNextPhaseCbHdl`([GpiImplInterface](https://docs.cocotb.org/en/v1.4.0/generated/class/classGpiImplInterface.html#_CPPv416GpiImplInterface "GpiImplInterface") \*_impl_)[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/FliImpl_8h.html#_CPPv4N17FliNextPhaseCbHdl17FliNextPhaseCbHdlEP16GpiImplInterface "Permalink to this definition") _class_ `FliReadOnlyCbHdl` : _public_ [FliSimPhaseCbHdl](https://docs.cocotb.org/en/v1.4.0/generated/class/classFliSimPhaseCbHdl.html#_CPPv416FliSimPhaseCbHdl "FliSimPhaseCbHdl") Public Functions `FliReadOnlyCbHdl`([GpiImplInterface](https://docs.cocotb.org/en/v1.4.0/generated/class/classGpiImplInterface.html#_CPPv416GpiImplInterface "GpiImplInterface") \*_impl_)[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/FliImpl_8h.html#_CPPv4N16FliReadOnlyCbHdl16FliReadOnlyCbHdlEP16GpiImplInterface "Permalink to this definition") _class_ `FliStartupCbHdl` : _public_ [FliProcessCbHdl](https://docs.cocotb.org/en/v1.4.0/generated/class/classFliProcessCbHdl.html#_CPPv415FliProcessCbHdl "FliProcessCbHdl") cleanup callback Called while unwinding after a GPI callback We keep the process but desensitize it NB: need a way to determine if should leave it sensitized… int `arm_callback`() _override_[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/FliImpl_8h.html#_CPPv4N15FliStartupCbHdl12arm_callbackEv "Permalink to this definition") int `run_callback`() _override_[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/FliImpl_8h.html#_CPPv4N15FliStartupCbHdl12run_callbackEv "Permalink to this definition") Public Functions `FliStartupCbHdl`([GpiImplInterface](https://docs.cocotb.org/en/v1.4.0/generated/class/classGpiImplInterface.html#_CPPv416GpiImplInterface "GpiImplInterface") \*_impl_)[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/FliImpl_8h.html#_CPPv4N15FliStartupCbHdl15FliStartupCbHdlEP16GpiImplInterface "Permalink to this definition") _class_ `FliShutdownCbHdl` : _public_ [FliProcessCbHdl](https://docs.cocotb.org/en/v1.4.0/generated/class/classFliProcessCbHdl.html#_CPPv415FliProcessCbHdl "FliProcessCbHdl") cleanup callback Called while unwinding after a GPI callback We keep the process but desensitize it NB: need a way to determine if should leave it sensitized… int `arm_callback`() _override_[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/FliImpl_8h.html#_CPPv4N16FliShutdownCbHdl12arm_callbackEv "Permalink to this definition") int `run_callback`() _override_[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/FliImpl_8h.html#_CPPv4N16FliShutdownCbHdl12run_callbackEv "Permalink to this definition") Public Functions `FliShutdownCbHdl`([GpiImplInterface](https://docs.cocotb.org/en/v1.4.0/generated/class/classGpiImplInterface.html#_CPPv416GpiImplInterface "GpiImplInterface") \*_impl_)[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/FliImpl_8h.html#_CPPv4N16FliShutdownCbHdl16FliShutdownCbHdlEP16GpiImplInterface "Permalink to this definition") _class_ `FliTimedCbHdl` : _public_ [FliProcessCbHdl](https://docs.cocotb.org/en/v1.4.0/generated/class/classFliProcessCbHdl.html#_CPPv415FliProcessCbHdl "FliProcessCbHdl") cleanup callback Called while unwinding after a GPI callback We keep the process but desensitize it NB: need a way to determine if should leave it sensitized… `FliTimedCbHdl`([GpiImplInterface](https://docs.cocotb.org/en/v1.4.0/generated/class/classGpiImplInterface.html#_CPPv416GpiImplInterface "GpiImplInterface") \*_impl_, uint64\_t _time\_ps_)[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/FliImpl_8h.html#_CPPv4N13FliTimedCbHdl13FliTimedCbHdlEP16GpiImplInterface8uint64_t "Permalink to this definition") int `arm_callback`() _override_[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/FliImpl_8h.html#_CPPv4N13FliTimedCbHdl12arm_callbackEv "Permalink to this definition") int `cleanup_callback`() _override_[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/FliImpl_8h.html#_CPPv4N13FliTimedCbHdl16cleanup_callbackEv "Permalink to this definition") Public Functions void `reset_time`(uint64\_t _new\_time_)[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/FliImpl_8h.html#_CPPv4N13FliTimedCbHdl10reset_timeE8uint64_t "Permalink to this definition") Private Members uint64\_t `m_time_ps`[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/FliImpl_8h.html#_CPPv4N13FliTimedCbHdl9m_time_psE "Permalink to this definition") _class_ `FliObj` Subclassed by [FliObjHdl](https://docs.cocotb.org/en/v1.4.0/generated/file/FliImpl_8h.html#classFliObjHdl) , [FliSignalObjHdl](https://docs.cocotb.org/en/v1.4.0/generated/file/FliImpl_8h.html#classFliSignalObjHdl) Public Functions `FliObj`(int _acc\_type_, int _acc\_full\_type_)[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/FliImpl_8h.html#_CPPv4N6FliObj6FliObjEii "Permalink to this definition") `~FliObj`() = default[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/FliImpl_8h.html#_CPPv4N6FliObjD0Ev "Permalink to this definition") int `get_acc_type`()[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/FliImpl_8h.html#_CPPv4N6FliObj12get_acc_typeEv "Permalink to this definition") int `get_acc_full_type`()[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/FliImpl_8h.html#_CPPv4N6FliObj17get_acc_full_typeEv "Permalink to this definition") Protected Attributes int `m_acc_type`[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/FliImpl_8h.html#_CPPv4N6FliObj10m_acc_typeE "Permalink to this definition") int `m_acc_full_type`[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/FliImpl_8h.html#_CPPv4N6FliObj15m_acc_full_typeE "Permalink to this definition") _class_ `FliObjHdl` : _public_ [GpiObjHdl](https://docs.cocotb.org/en/v1.4.0/generated/class/classGpiObjHdl.html#_CPPv49GpiObjHdl "GpiObjHdl") , _public_ [FliObj](https://docs.cocotb.org/en/v1.4.0/generated/class/classFliObj.html#_CPPv46FliObj "FliObj") Public Functions `FliObjHdl`([GpiImplInterface](https://docs.cocotb.org/en/v1.4.0/generated/class/classGpiImplInterface.html#_CPPv416GpiImplInterface "GpiImplInterface") \*_impl_, void \*_hdl_, [gpi\_objtype\_t](https://docs.cocotb.org/en/v1.4.0/generated/file/gpi_8h.html#_CPPv413gpi_objtype_t "gpi_objtype_t") _objtype_, int _acc\_type_, int _acc\_full\_type_, bool _is\_const_ = false)[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/FliImpl_8h.html#_CPPv4N9FliObjHdl9FliObjHdlEP16GpiImplInterfacePv13gpi_objtype_tiib "Permalink to this definition") int `initialise`([std](https://docs.cocotb.org/en/v1.4.0/generated/file/GpiCommon_8cpp.html#_CPPv4St "std") ::string &_name_, [std](https://docs.cocotb.org/en/v1.4.0/generated/file/GpiCommon_8cpp.html#_CPPv4St "std") ::string &_fq\_name_) _override_[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/FliImpl_8h.html#_CPPv4N9FliObjHdl10initialiseERNSt6stringERNSt6stringE "Permalink to this definition") _class_ `FliSignalObjHdl` : _public_ [GpiSignalObjHdl](https://docs.cocotb.org/en/v1.4.0/generated/class/classGpiSignalObjHdl.html#_CPPv415GpiSignalObjHdl "GpiSignalObjHdl") , _public_ [FliObj](https://docs.cocotb.org/en/v1.4.0/generated/class/classFliObj.html#_CPPv46FliObj "FliObj") Subclassed by [FliValueObjHdl](https://docs.cocotb.org/en/v1.4.0/generated/file/FliImpl_8h.html#classFliValueObjHdl) Public Functions `FliSignalObjHdl`([GpiImplInterface](https://docs.cocotb.org/en/v1.4.0/generated/class/classGpiImplInterface.html#_CPPv416GpiImplInterface "GpiImplInterface") \*_impl_, void \*_hdl_, [gpi\_objtype\_t](https://docs.cocotb.org/en/v1.4.0/generated/file/gpi_8h.html#_CPPv413gpi_objtype_t "gpi_objtype_t") _objtype_, bool _is\_const_, int _acc\_type_, int _acc\_full\_type_, bool _is\_var_)[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/FliImpl_8h.html#_CPPv4N15FliSignalObjHdl15FliSignalObjHdlEP16GpiImplInterfacePv13gpi_objtype_tbiib "Permalink to this definition") [GpiCbHdl](https://docs.cocotb.org/en/v1.4.0/generated/class/classGpiCbHdl.html#_CPPv48GpiCbHdl "GpiCbHdl") \*`value_change_cb`(int _edge_) _override_[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/FliImpl_8h.html#_CPPv4N15FliSignalObjHdl15value_change_cbEi "Permalink to this definition") int `initialise`([std](https://docs.cocotb.org/en/v1.4.0/generated/file/GpiCommon_8cpp.html#_CPPv4St "std") ::string &_name_, [std](https://docs.cocotb.org/en/v1.4.0/generated/file/GpiCommon_8cpp.html#_CPPv4St "std") ::string &_fq\_name_) _override_[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/FliImpl_8h.html#_CPPv4N15FliSignalObjHdl10initialiseERNSt6stringERNSt6stringE "Permalink to this definition") bool `is_var`()[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/FliImpl_8h.html#_CPPv4N15FliSignalObjHdl6is_varEv "Permalink to this definition") Protected Attributes bool `m_is_var`[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/FliImpl_8h.html#_CPPv4N15FliSignalObjHdl8m_is_varE "Permalink to this definition") [FliSignalCbHdl](https://docs.cocotb.org/en/v1.4.0/generated/class/classFliSignalCbHdl.html#_CPPv414FliSignalCbHdl "FliSignalCbHdl") `m_rising_cb`[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/FliImpl_8h.html#_CPPv4N15FliSignalObjHdl11m_rising_cbE "Permalink to this definition") [FliSignalCbHdl](https://docs.cocotb.org/en/v1.4.0/generated/class/classFliSignalCbHdl.html#_CPPv414FliSignalCbHdl "FliSignalCbHdl") `m_falling_cb`[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/FliImpl_8h.html#_CPPv4N15FliSignalObjHdl12m_falling_cbE "Permalink to this definition") [FliSignalCbHdl](https://docs.cocotb.org/en/v1.4.0/generated/class/classFliSignalCbHdl.html#_CPPv414FliSignalCbHdl "FliSignalCbHdl") `m_either_cb`[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/FliImpl_8h.html#_CPPv4N15FliSignalObjHdl11m_either_cbE "Permalink to this definition") _class_ `FliValueObjHdl` : _public_ [FliSignalObjHdl](https://docs.cocotb.org/en/v1.4.0/generated/class/classFliSignalObjHdl.html#_CPPv415FliSignalObjHdl "FliSignalObjHdl") Subclassed by [FliEnumObjHdl](https://docs.cocotb.org/en/v1.4.0/generated/file/FliImpl_8h.html#classFliEnumObjHdl) , [FliIntObjHdl](https://docs.cocotb.org/en/v1.4.0/generated/file/FliImpl_8h.html#classFliIntObjHdl) , [FliLogicObjHdl](https://docs.cocotb.org/en/v1.4.0/generated/file/FliImpl_8h.html#classFliLogicObjHdl) , [FliRealObjHdl](https://docs.cocotb.org/en/v1.4.0/generated/file/FliImpl_8h.html#classFliRealObjHdl) , [FliStringObjHdl](https://docs.cocotb.org/en/v1.4.0/generated/file/FliImpl_8h.html#classFliStringObjHdl) Public Functions `FliValueObjHdl`([GpiImplInterface](https://docs.cocotb.org/en/v1.4.0/generated/class/classGpiImplInterface.html#_CPPv416GpiImplInterface "GpiImplInterface") \*_impl_, void \*_hdl_, [gpi\_objtype\_t](https://docs.cocotb.org/en/v1.4.0/generated/file/gpi_8h.html#_CPPv413gpi_objtype_t "gpi_objtype_t") _objtype_, bool _is\_const_, int _acc\_type_, int _acc\_full\_type_, bool _is\_var_, mtiTypeIdT _valType_, mtiTypeKindT _typeKind_)[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/FliImpl_8h.html#_CPPv4N14FliValueObjHdl14FliValueObjHdlEP16GpiImplInterfacePv13gpi_objtype_tbiib10mtiTypeIdT12mtiTypeKindT "Permalink to this definition") `~FliValueObjHdl`() _override_[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/FliImpl_8h.html#_CPPv4N14FliValueObjHdlD0Ev "Permalink to this definition") _const_ char \*`get_signal_value_binstr`() _override_[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/FliImpl_8h.html#_CPPv4N14FliValueObjHdl23get_signal_value_binstrEv "Permalink to this definition") _const_ char \*`get_signal_value_str`() _override_[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/FliImpl_8h.html#_CPPv4N14FliValueObjHdl20get_signal_value_strEv "Permalink to this definition") double `get_signal_value_real`() _override_[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/FliImpl_8h.html#_CPPv4N14FliValueObjHdl21get_signal_value_realEv "Permalink to this definition") long `get_signal_value_long`() _override_[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/FliImpl_8h.html#_CPPv4N14FliValueObjHdl21get_signal_value_longEv "Permalink to this definition") int `set_signal_value`(long _value_, [gpi\_set\_action\_t](https://docs.cocotb.org/en/v1.4.0/generated/file/gpi_8h.html#_CPPv416gpi_set_action_t "gpi_set_action_t") _action_) _override_[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/FliImpl_8h.html#_CPPv4N14FliValueObjHdl16set_signal_valueEl16gpi_set_action_t "Permalink to this definition") int `set_signal_value`(double _value_, [gpi\_set\_action\_t](https://docs.cocotb.org/en/v1.4.0/generated/file/gpi_8h.html#_CPPv416gpi_set_action_t "gpi_set_action_t") _action_) _override_[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/FliImpl_8h.html#_CPPv4N14FliValueObjHdl16set_signal_valueEd16gpi_set_action_t "Permalink to this definition") int `set_signal_value_str`([std](https://docs.cocotb.org/en/v1.4.0/generated/file/GpiCommon_8cpp.html#_CPPv4St "std") ::string &_value_, [gpi\_set\_action\_t](https://docs.cocotb.org/en/v1.4.0/generated/file/gpi_8h.html#_CPPv416gpi_set_action_t "gpi_set_action_t") _action_) _override_[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/FliImpl_8h.html#_CPPv4N14FliValueObjHdl20set_signal_value_strERNSt6stringE16gpi_set_action_t "Permalink to this definition") int `set_signal_value_binstr`([std](https://docs.cocotb.org/en/v1.4.0/generated/file/GpiCommon_8cpp.html#_CPPv4St "std") ::string &_value_, [gpi\_set\_action\_t](https://docs.cocotb.org/en/v1.4.0/generated/file/gpi_8h.html#_CPPv416gpi_set_action_t "gpi_set_action_t") _action_) _override_[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/FliImpl_8h.html#_CPPv4N14FliValueObjHdl23set_signal_value_binstrERNSt6stringE16gpi_set_action_t "Permalink to this definition") void \*`get_sub_hdl`(int _index_)[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/FliImpl_8h.html#_CPPv4N14FliValueObjHdl11get_sub_hdlEi "Permalink to this definition") int `initialise`([std](https://docs.cocotb.org/en/v1.4.0/generated/file/GpiCommon_8cpp.html#_CPPv4St "std") ::string &_name_, [std](https://docs.cocotb.org/en/v1.4.0/generated/file/GpiCommon_8cpp.html#_CPPv4St "std") ::string &_fq\_name_) _override_[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/FliImpl_8h.html#_CPPv4N14FliValueObjHdl10initialiseERNSt6stringERNSt6stringE "Permalink to this definition") mtiTypeKindT `get_fli_typekind`()[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/FliImpl_8h.html#_CPPv4N14FliValueObjHdl16get_fli_typekindEv "Permalink to this definition") mtiTypeIdT `get_fli_typeid`()[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/FliImpl_8h.html#_CPPv4N14FliValueObjHdl14get_fli_typeidEv "Permalink to this definition") Protected Attributes mtiTypeKindT `m_fli_type`[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/FliImpl_8h.html#_CPPv4N14FliValueObjHdl10m_fli_typeE "Permalink to this definition") mtiTypeIdT `m_val_type`[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/FliImpl_8h.html#_CPPv4N14FliValueObjHdl10m_val_typeE "Permalink to this definition") char \*`m_val_buff` = nullptr[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/FliImpl_8h.html#_CPPv4N14FliValueObjHdl10m_val_buffE "Permalink to this definition") void \*\*`m_sub_hdls` = nullptr[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/FliImpl_8h.html#_CPPv4N14FliValueObjHdl10m_sub_hdlsE "Permalink to this definition") _class_ `FliEnumObjHdl` : _public_ [FliValueObjHdl](https://docs.cocotb.org/en/v1.4.0/generated/class/classFliValueObjHdl.html#_CPPv414FliValueObjHdl "FliValueObjHdl") Public Functions `FliEnumObjHdl`([GpiImplInterface](https://docs.cocotb.org/en/v1.4.0/generated/class/classGpiImplInterface.html#_CPPv416GpiImplInterface "GpiImplInterface") \*_impl_, void \*_hdl_, [gpi\_objtype\_t](https://docs.cocotb.org/en/v1.4.0/generated/file/gpi_8h.html#_CPPv413gpi_objtype_t "gpi_objtype_t") _objtype_, bool _is\_const_, int _acc\_type_, int _acc\_full\_type_, bool _is\_var_, mtiTypeIdT _valType_, mtiTypeKindT _typeKind_)[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/FliImpl_8h.html#_CPPv4N13FliEnumObjHdl13FliEnumObjHdlEP16GpiImplInterfacePv13gpi_objtype_tbiib10mtiTypeIdT12mtiTypeKindT "Permalink to this definition") _const_ char \*`get_signal_value_str`() _override_[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/FliImpl_8h.html#_CPPv4N13FliEnumObjHdl20get_signal_value_strEv "Permalink to this definition") long `get_signal_value_long`() _override_[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/FliImpl_8h.html#_CPPv4N13FliEnumObjHdl21get_signal_value_longEv "Permalink to this definition") int `set_signal_value`(long _value_, [gpi\_set\_action\_t](https://docs.cocotb.org/en/v1.4.0/generated/file/gpi_8h.html#_CPPv416gpi_set_action_t "gpi_set_action_t") _action_) _override_[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/FliImpl_8h.html#_CPPv4N13FliEnumObjHdl16set_signal_valueEl16gpi_set_action_t "Permalink to this definition") int `initialise`([std](https://docs.cocotb.org/en/v1.4.0/generated/file/GpiCommon_8cpp.html#_CPPv4St "std") ::string &_name_, [std](https://docs.cocotb.org/en/v1.4.0/generated/file/GpiCommon_8cpp.html#_CPPv4St "std") ::string &_fq\_name_) _override_[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/FliImpl_8h.html#_CPPv4N13FliEnumObjHdl10initialiseERNSt6stringERNSt6stringE "Permalink to this definition") Private Members char \*\*`m_value_enum` = nullptr[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/FliImpl_8h.html#_CPPv4N13FliEnumObjHdl12m_value_enumE "Permalink to this definition") mtiInt32T `m_num_enum` = 0[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/FliImpl_8h.html#_CPPv4N13FliEnumObjHdl10m_num_enumE "Permalink to this definition") _class_ `FliLogicObjHdl` : _public_ [FliValueObjHdl](https://docs.cocotb.org/en/v1.4.0/generated/class/classFliValueObjHdl.html#_CPPv414FliValueObjHdl "FliValueObjHdl") Public Functions `FliLogicObjHdl`([GpiImplInterface](https://docs.cocotb.org/en/v1.4.0/generated/class/classGpiImplInterface.html#_CPPv416GpiImplInterface "GpiImplInterface") \*_impl_, void \*_hdl_, [gpi\_objtype\_t](https://docs.cocotb.org/en/v1.4.0/generated/file/gpi_8h.html#_CPPv413gpi_objtype_t "gpi_objtype_t") _objtype_, bool _is\_const_, int _acc\_type_, int _acc\_full\_type_, bool _is\_var_, mtiTypeIdT _valType_, mtiTypeKindT _typeKind_)[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/FliImpl_8h.html#_CPPv4N14FliLogicObjHdl14FliLogicObjHdlEP16GpiImplInterfacePv13gpi_objtype_tbiib10mtiTypeIdT12mtiTypeKindT "Permalink to this definition") `~FliLogicObjHdl`() _override_[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/FliImpl_8h.html#_CPPv4N14FliLogicObjHdlD0Ev "Permalink to this definition") _const_ char \*`get_signal_value_binstr`() _override_[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/FliImpl_8h.html#_CPPv4N14FliLogicObjHdl23get_signal_value_binstrEv "Permalink to this definition") int `set_signal_value`(long _value_, [gpi\_set\_action\_t](https://docs.cocotb.org/en/v1.4.0/generated/file/gpi_8h.html#_CPPv416gpi_set_action_t "gpi_set_action_t") _action_) _override_[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/FliImpl_8h.html#_CPPv4N14FliLogicObjHdl16set_signal_valueEl16gpi_set_action_t "Permalink to this definition") int `set_signal_value_binstr`([std](https://docs.cocotb.org/en/v1.4.0/generated/file/GpiCommon_8cpp.html#_CPPv4St "std") ::string &_value_, [gpi\_set\_action\_t](https://docs.cocotb.org/en/v1.4.0/generated/file/gpi_8h.html#_CPPv416gpi_set_action_t "gpi_set_action_t") _action_) _override_[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/FliImpl_8h.html#_CPPv4N14FliLogicObjHdl23set_signal_value_binstrERNSt6stringE16gpi_set_action_t "Permalink to this definition") int `initialise`([std](https://docs.cocotb.org/en/v1.4.0/generated/file/GpiCommon_8cpp.html#_CPPv4St "std") ::string &_name_, [std](https://docs.cocotb.org/en/v1.4.0/generated/file/GpiCommon_8cpp.html#_CPPv4St "std") ::string &_fq\_name_) _override_[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/FliImpl_8h.html#_CPPv4N14FliLogicObjHdl10initialiseERNSt6stringERNSt6stringE "Permalink to this definition") Private Members char \*`m_mti_buff` = nullptr[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/FliImpl_8h.html#_CPPv4N14FliLogicObjHdl10m_mti_buffE "Permalink to this definition") char \*\*`m_value_enum` = nullptr[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/FliImpl_8h.html#_CPPv4N14FliLogicObjHdl12m_value_enumE "Permalink to this definition") mtiInt32T `m_num_enum` = 0[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/FliImpl_8h.html#_CPPv4N14FliLogicObjHdl10m_num_enumE "Permalink to this definition") [std](https://docs.cocotb.org/en/v1.4.0/generated/file/GpiCommon_8cpp.html#_CPPv4St "std") ::map `m_enum_map`[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/FliImpl_8h.html#_CPPv4N14FliLogicObjHdl10m_enum_mapE "Permalink to this definition") _class_ `FliIntObjHdl` : _public_ [FliValueObjHdl](https://docs.cocotb.org/en/v1.4.0/generated/class/classFliValueObjHdl.html#_CPPv414FliValueObjHdl "FliValueObjHdl") Public Functions `FliIntObjHdl`([GpiImplInterface](https://docs.cocotb.org/en/v1.4.0/generated/class/classGpiImplInterface.html#_CPPv416GpiImplInterface "GpiImplInterface") \*_impl_, void \*_hdl_, [gpi\_objtype\_t](https://docs.cocotb.org/en/v1.4.0/generated/file/gpi_8h.html#_CPPv413gpi_objtype_t "gpi_objtype_t") _objtype_, bool _is\_const_, int _acc\_type_, int _acc\_full\_type_, bool _is\_var_, mtiTypeIdT _valType_, mtiTypeKindT _typeKind_)[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/FliImpl_8h.html#_CPPv4N12FliIntObjHdl12FliIntObjHdlEP16GpiImplInterfacePv13gpi_objtype_tbiib10mtiTypeIdT12mtiTypeKindT "Permalink to this definition") _const_ char \*`get_signal_value_binstr`() _override_[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/FliImpl_8h.html#_CPPv4N12FliIntObjHdl23get_signal_value_binstrEv "Permalink to this definition") long `get_signal_value_long`() _override_[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/FliImpl_8h.html#_CPPv4N12FliIntObjHdl21get_signal_value_longEv "Permalink to this definition") int `set_signal_value`(long _value_, [gpi\_set\_action\_t](https://docs.cocotb.org/en/v1.4.0/generated/file/gpi_8h.html#_CPPv416gpi_set_action_t "gpi_set_action_t") _action_) _override_[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/FliImpl_8h.html#_CPPv4N12FliIntObjHdl16set_signal_valueEl16gpi_set_action_t "Permalink to this definition") int `initialise`([std](https://docs.cocotb.org/en/v1.4.0/generated/file/GpiCommon_8cpp.html#_CPPv4St "std") ::string &_name_, [std](https://docs.cocotb.org/en/v1.4.0/generated/file/GpiCommon_8cpp.html#_CPPv4St "std") ::string &_fq\_name_) _override_[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/FliImpl_8h.html#_CPPv4N12FliIntObjHdl10initialiseERNSt6stringERNSt6stringE "Permalink to this definition") _class_ `FliRealObjHdl` : _public_ [FliValueObjHdl](https://docs.cocotb.org/en/v1.4.0/generated/class/classFliValueObjHdl.html#_CPPv414FliValueObjHdl "FliValueObjHdl") Public Functions `FliRealObjHdl`([GpiImplInterface](https://docs.cocotb.org/en/v1.4.0/generated/class/classGpiImplInterface.html#_CPPv416GpiImplInterface "GpiImplInterface") \*_impl_, void \*_hdl_, [gpi\_objtype\_t](https://docs.cocotb.org/en/v1.4.0/generated/file/gpi_8h.html#_CPPv413gpi_objtype_t "gpi_objtype_t") _objtype_, bool _is\_const_, int _acc\_type_, int _acc\_full\_type_, bool _is\_var_, mtiTypeIdT _valType_, mtiTypeKindT _typeKind_)[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/FliImpl_8h.html#_CPPv4N13FliRealObjHdl13FliRealObjHdlEP16GpiImplInterfacePv13gpi_objtype_tbiib10mtiTypeIdT12mtiTypeKindT "Permalink to this definition") `~FliRealObjHdl`() _override_[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/FliImpl_8h.html#_CPPv4N13FliRealObjHdlD0Ev "Permalink to this definition") double `get_signal_value_real`() _override_[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/FliImpl_8h.html#_CPPv4N13FliRealObjHdl21get_signal_value_realEv "Permalink to this definition") int `set_signal_value`(double _value_, [gpi\_set\_action\_t](https://docs.cocotb.org/en/v1.4.0/generated/file/gpi_8h.html#_CPPv416gpi_set_action_t "gpi_set_action_t") _action_) _override_[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/FliImpl_8h.html#_CPPv4N13FliRealObjHdl16set_signal_valueEd16gpi_set_action_t "Permalink to this definition") int `initialise`([std](https://docs.cocotb.org/en/v1.4.0/generated/file/GpiCommon_8cpp.html#_CPPv4St "std") ::string &_name_, [std](https://docs.cocotb.org/en/v1.4.0/generated/file/GpiCommon_8cpp.html#_CPPv4St "std") ::string &_fq\_name_) _override_[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/FliImpl_8h.html#_CPPv4N13FliRealObjHdl10initialiseERNSt6stringERNSt6stringE "Permalink to this definition") Private Members double \*`m_mti_buff` = nullptr[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/FliImpl_8h.html#_CPPv4N13FliRealObjHdl10m_mti_buffE "Permalink to this definition") _class_ `FliStringObjHdl` : _public_ [FliValueObjHdl](https://docs.cocotb.org/en/v1.4.0/generated/class/classFliValueObjHdl.html#_CPPv414FliValueObjHdl "FliValueObjHdl") Public Functions `FliStringObjHdl`([GpiImplInterface](https://docs.cocotb.org/en/v1.4.0/generated/class/classGpiImplInterface.html#_CPPv416GpiImplInterface "GpiImplInterface") \*_impl_, void \*_hdl_, [gpi\_objtype\_t](https://docs.cocotb.org/en/v1.4.0/generated/file/gpi_8h.html#_CPPv413gpi_objtype_t "gpi_objtype_t") _objtype_, bool _is\_const_, int _acc\_type_, int _acc\_full\_type_, bool _is\_var_, mtiTypeIdT _valType_, mtiTypeKindT _typeKind_)[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/FliImpl_8h.html#_CPPv4N15FliStringObjHdl15FliStringObjHdlEP16GpiImplInterfacePv13gpi_objtype_tbiib10mtiTypeIdT12mtiTypeKindT "Permalink to this definition") `~FliStringObjHdl`() _override_[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/FliImpl_8h.html#_CPPv4N15FliStringObjHdlD0Ev "Permalink to this definition") _const_ char \*`get_signal_value_str`() _override_[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/FliImpl_8h.html#_CPPv4N15FliStringObjHdl20get_signal_value_strEv "Permalink to this definition") int `set_signal_value_str`([std](https://docs.cocotb.org/en/v1.4.0/generated/file/GpiCommon_8cpp.html#_CPPv4St "std") ::string &_value_, [gpi\_set\_action\_t](https://docs.cocotb.org/en/v1.4.0/generated/file/gpi_8h.html#_CPPv416gpi_set_action_t "gpi_set_action_t") _action_) _override_[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/FliImpl_8h.html#_CPPv4N15FliStringObjHdl20set_signal_value_strERNSt6stringE16gpi_set_action_t "Permalink to this definition") int `initialise`([std](https://docs.cocotb.org/en/v1.4.0/generated/file/GpiCommon_8cpp.html#_CPPv4St "std") ::string &_name_, [std](https://docs.cocotb.org/en/v1.4.0/generated/file/GpiCommon_8cpp.html#_CPPv4St "std") ::string &_fq\_name_) _override_[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/FliImpl_8h.html#_CPPv4N15FliStringObjHdl10initialiseERNSt6stringERNSt6stringE "Permalink to this definition") Private Members char \*`m_mti_buff` = nullptr[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/FliImpl_8h.html#_CPPv4N15FliStringObjHdl10m_mti_buffE "Permalink to this definition") _class_ `FliTimerCache` Find the root handle Find the root handle using an optional name Get a handle to the root simulator object. This is usually the toplevel. If no name is provided, we return the first root instance. If name is provided, we check the name against the available objects until we find a match. If no match is found we return NULL [FliTimedCbHdl](https://docs.cocotb.org/en/v1.4.0/generated/class/classFliTimedCbHdl.html#_CPPv413FliTimedCbHdl "FliTimedCbHdl") \*`get_timer`(uint64\_t _time\_ps_)[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/FliImpl_8h.html#_CPPv4N13FliTimerCache9get_timerE8uint64_t "Permalink to this definition") void `put_timer`([FliTimedCbHdl](https://docs.cocotb.org/en/v1.4.0/generated/class/classFliTimedCbHdl.html#_CPPv413FliTimedCbHdl "FliTimedCbHdl") \*)[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/FliImpl_8h.html#_CPPv4N13FliTimerCache9put_timerEP13FliTimedCbHdl "Permalink to this definition") Public Functions `FliTimerCache`([FliImpl](https://docs.cocotb.org/en/v1.4.0/generated/class/classFliImpl.html#_CPPv47FliImpl "FliImpl") \*_impl_)[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/FliImpl_8h.html#_CPPv4N13FliTimerCache13FliTimerCacheEP7FliImpl "Permalink to this definition") Private Members [std](https://docs.cocotb.org/en/v1.4.0/generated/file/GpiCommon_8cpp.html#_CPPv4St "std") ::queue<[FliTimedCbHdl](https://docs.cocotb.org/en/v1.4.0/generated/class/classFliTimedCbHdl.html#_CPPv413FliTimedCbHdl "FliTimedCbHdl") \*> `free_list`[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/FliImpl_8h.html#_CPPv4N13FliTimerCache9free_listE "Permalink to this definition") [FliImpl](https://docs.cocotb.org/en/v1.4.0/generated/class/classFliImpl.html#_CPPv47FliImpl "FliImpl") \*`impl`[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/FliImpl_8h.html#_CPPv4N13FliTimerCache4implE "Permalink to this definition") _class_ `FliIterator` : _public_ [GpiIterator](https://docs.cocotb.org/en/v1.4.0/generated/class/classGpiIterator.html#_CPPv411GpiIterator "GpiIterator") Find the root handle Find the root handle using an optional name Get a handle to the root simulator object. This is usually the toplevel. If no name is provided, we return the first root instance. If name is provided, we check the name against the available objects until we find a match. If no match is found we return NULL [GpiIteratorMapping](https://docs.cocotb.org/en/v1.4.0/generated/class/classGpiIteratorMapping.html#_CPPv4I00E18GpiIteratorMapping "GpiIteratorMapping") `iterate_over`[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/FliImpl_8h.html#_CPPv4N11FliIterator12iterate_overE "Permalink to this definition") `FliIterator`([GpiImplInterface](https://docs.cocotb.org/en/v1.4.0/generated/class/classGpiImplInterface.html#_CPPv416GpiImplInterface "GpiImplInterface") \*_impl_, [GpiObjHdl](https://docs.cocotb.org/en/v1.4.0/generated/class/classGpiObjHdl.html#_CPPv49GpiObjHdl "GpiObjHdl") \*_hdl_)[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/FliImpl_8h.html#_CPPv4N11FliIterator11FliIteratorEP16GpiImplInterfaceP9GpiObjHdl "Permalink to this definition") Status `next_handle`([std](https://docs.cocotb.org/en/v1.4.0/generated/file/GpiCommon_8cpp.html#_CPPv4St "std") ::string &_name_, [GpiObjHdl](https://docs.cocotb.org/en/v1.4.0/generated/class/classGpiObjHdl.html#_CPPv49GpiObjHdl "GpiObjHdl") \*\*_hdl_, void \*\*_raw\_hdl_) _override_[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/FliImpl_8h.html#_CPPv4N11FliIterator11next_handleERNSt6stringEPP9GpiObjHdlPPv "Permalink to this definition") void `populate_handle_list`([OneToMany](https://docs.cocotb.org/en/v1.4.0/generated/file/FliImpl_8h.html#_CPPv4N11FliIterator9OneToManyE "FliIterator::OneToMany") _childType_)[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/FliImpl_8h.html#_CPPv4N11FliIterator20populate_handle_listE9OneToMany "Permalink to this definition") Public Types _enum_ `OneToMany`[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/FliImpl_8h.html#_CPPv4N11FliIterator9OneToManyE "Permalink to this definition") _Values:_ _enumerator_ `OTM_END` = 0[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/FliImpl_8h.html#_CPPv4N11FliIterator9OneToMany7OTM_ENDE "Permalink to this definition") _enumerator_ `OTM_CONSTANTS`[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/FliImpl_8h.html#_CPPv4N11FliIterator9OneToMany13OTM_CONSTANTSE "Permalink to this definition") _enumerator_ `OTM_SIGNALS`[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/FliImpl_8h.html#_CPPv4N11FliIterator9OneToMany11OTM_SIGNALSE "Permalink to this definition") _enumerator_ `OTM_REGIONS`[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/FliImpl_8h.html#_CPPv4N11FliIterator9OneToMany11OTM_REGIONSE "Permalink to this definition") _enumerator_ `OTM_SIGNAL_SUB_ELEMENTS`[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/FliImpl_8h.html#_CPPv4N11FliIterator9OneToMany23OTM_SIGNAL_SUB_ELEMENTSE "Permalink to this definition") _enumerator_ `OTM_VARIABLE_SUB_ELEMENTS`[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/FliImpl_8h.html#_CPPv4N11FliIterator9OneToMany25OTM_VARIABLE_SUB_ELEMENTSE "Permalink to this definition") Private Members [std](https://docs.cocotb.org/en/v1.4.0/generated/file/GpiCommon_8cpp.html#_CPPv4St "std") ::vector<[OneToMany](https://docs.cocotb.org/en/v1.4.0/generated/file/FliImpl_8h.html#_CPPv4N11FliIterator9OneToManyE "FliIterator::OneToMany") \> \*`selected`[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/FliImpl_8h.html#_CPPv4N11FliIterator8selectedE "Permalink to this definition") [std](https://docs.cocotb.org/en/v1.4.0/generated/file/GpiCommon_8cpp.html#_CPPv4St "std") ::vector<[OneToMany](https://docs.cocotb.org/en/v1.4.0/generated/file/FliImpl_8h.html#_CPPv4N11FliIterator9OneToManyE "FliIterator::OneToMany") \>::iterator `one2many`[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/FliImpl_8h.html#_CPPv4N11FliIterator8one2manyE "Permalink to this definition") [std](https://docs.cocotb.org/en/v1.4.0/generated/file/GpiCommon_8cpp.html#_CPPv4St "std") ::vector `m_vars`[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/FliImpl_8h.html#_CPPv4N11FliIterator6m_varsE "Permalink to this definition") [std](https://docs.cocotb.org/en/v1.4.0/generated/file/GpiCommon_8cpp.html#_CPPv4St "std") ::vector `m_sigs`[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/FliImpl_8h.html#_CPPv4N11FliIterator6m_sigsE "Permalink to this definition") [std](https://docs.cocotb.org/en/v1.4.0/generated/file/GpiCommon_8cpp.html#_CPPv4St "std") ::vector `m_regs`[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/FliImpl_8h.html#_CPPv4N11FliIterator6m_regsE "Permalink to this definition") [std](https://docs.cocotb.org/en/v1.4.0/generated/file/GpiCommon_8cpp.html#_CPPv4St "std") ::vector \*`m_currentHandles`[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/FliImpl_8h.html#_CPPv4N11FliIterator16m_currentHandlesE "Permalink to this definition") [std](https://docs.cocotb.org/en/v1.4.0/generated/file/GpiCommon_8cpp.html#_CPPv4St "std") ::vector::iterator `m_iterator`[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/FliImpl_8h.html#_CPPv4N11FliIterator10m_iteratorE "Permalink to this definition") _class_ `FliImpl` : _public_ [GpiImplInterface](https://docs.cocotb.org/en/v1.4.0/generated/class/classGpiImplInterface.html#_CPPv416GpiImplInterface "GpiImplInterface") Native Check Create Determine whether a simulation object is native to FLI and create a handle if it is [GpiObjHdl](https://docs.cocotb.org/en/v1.4.0/generated/class/classGpiObjHdl.html#_CPPv49GpiObjHdl "GpiObjHdl") \*`native_check_create`([std](https://docs.cocotb.org/en/v1.4.0/generated/file/GpiCommon_8cpp.html#_CPPv4St "std") ::string &_name_, [GpiObjHdl](https://docs.cocotb.org/en/v1.4.0/generated/class/classGpiObjHdl.html#_CPPv49GpiObjHdl "GpiObjHdl") \*_parent_) _override_[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/FliImpl_8h.html#_CPPv4N7FliImpl19native_check_createERNSt6stringEP9GpiObjHdl "Permalink to this definition") [GpiObjHdl](https://docs.cocotb.org/en/v1.4.0/generated/class/classGpiObjHdl.html#_CPPv49GpiObjHdl "GpiObjHdl") \*`native_check_create`(int32\_t _index_, [GpiObjHdl](https://docs.cocotb.org/en/v1.4.0/generated/class/classGpiObjHdl.html#_CPPv49GpiObjHdl "GpiObjHdl") \*_parent_) _override_[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/FliImpl_8h.html#_CPPv4N7FliImpl19native_check_createE7int32_tP9GpiObjHdl "Permalink to this definition") _const_ char \*`reason_to_string`(int _reason_) _override_[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/FliImpl_8h.html#_CPPv4N7FliImpl16reason_to_stringEi "Permalink to this definition") Get current simulation time Get current simulation time NB units depend on the simulation configuration void `get_sim_time`(uint32\_t \*_high_, uint32\_t \*_low_) _override_[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/FliImpl_8h.html#_CPPv4N7FliImpl12get_sim_timeEP8uint32_tP8uint32_t "Permalink to this definition") void `get_sim_precision`(int32\_t \*_precision_) _override_[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/FliImpl_8h.html#_CPPv4N7FliImpl17get_sim_precisionEP7int32_t "Permalink to this definition") _const_ char \*`get_simulator_product`() _override_[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/FliImpl_8h.html#_CPPv4N7FliImpl21get_simulator_productEv "Permalink to this definition") _const_ char \*`get_simulator_version`() _override_[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/FliImpl_8h.html#_CPPv4N7FliImpl21get_simulator_versionEv "Permalink to this definition") Find the root handle Find the root handle using an optional name Get a handle to the root simulator object. This is usually the toplevel. If no name is provided, we return the first root instance. If name is provided, we check the name against the available objects until we find a match. If no match is found we return NULL [GpiObjHdl](https://docs.cocotb.org/en/v1.4.0/generated/class/classGpiObjHdl.html#_CPPv49GpiObjHdl "GpiObjHdl") \*`get_root_handle`(_const_ char \*_name_) _override_[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/FliImpl_8h.html#_CPPv4N7FliImpl15get_root_handleEPKc "Permalink to this definition") [GpiIterator](https://docs.cocotb.org/en/v1.4.0/generated/class/classGpiIterator.html#_CPPv411GpiIterator "GpiIterator") \*`iterate_handle`([GpiObjHdl](https://docs.cocotb.org/en/v1.4.0/generated/class/classGpiObjHdl.html#_CPPv49GpiObjHdl "GpiObjHdl") \*_obj\_hdl_, [gpi\_iterator\_sel\_t](https://docs.cocotb.org/en/v1.4.0/generated/file/gpi_8h.html#_CPPv418gpi_iterator_sel_t "gpi_iterator_sel_t") _type_) _override_[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/FliImpl_8h.html#_CPPv4N7FliImpl14iterate_handleEP9GpiObjHdl18gpi_iterator_sel_t "Permalink to this definition") [GpiCbHdl](https://docs.cocotb.org/en/v1.4.0/generated/class/classGpiCbHdl.html#_CPPv48GpiCbHdl "GpiCbHdl") \*`register_timed_callback`(uint64\_t _time\_ps_) _override_[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/FliImpl_8h.html#_CPPv4N7FliImpl23register_timed_callbackE8uint64_t "Permalink to this definition") [GpiCbHdl](https://docs.cocotb.org/en/v1.4.0/generated/class/classGpiCbHdl.html#_CPPv48GpiCbHdl "GpiCbHdl") \*`register_readonly_callback`() _override_[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/FliImpl_8h.html#_CPPv4N7FliImpl26register_readonly_callbackEv "Permalink to this definition") [GpiCbHdl](https://docs.cocotb.org/en/v1.4.0/generated/class/classGpiCbHdl.html#_CPPv48GpiCbHdl "GpiCbHdl") \*`register_nexttime_callback`() _override_[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/FliImpl_8h.html#_CPPv4N7FliImpl26register_nexttime_callbackEv "Permalink to this definition") [GpiCbHdl](https://docs.cocotb.org/en/v1.4.0/generated/class/classGpiCbHdl.html#_CPPv48GpiCbHdl "GpiCbHdl") \*`register_readwrite_callback`() _override_[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/FliImpl_8h.html#_CPPv4N7FliImpl27register_readwrite_callbackEv "Permalink to this definition") int `deregister_callback`([GpiCbHdl](https://docs.cocotb.org/en/v1.4.0/generated/class/classGpiCbHdl.html#_CPPv48GpiCbHdl "GpiCbHdl") \*_obj\_hdl_) _override_[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/FliImpl_8h.html#_CPPv4N7FliImpl19deregister_callbackEP8GpiCbHdl "Permalink to this definition") Public Functions `FliImpl`(_const_ [std](https://docs.cocotb.org/en/v1.4.0/generated/file/GpiCommon_8cpp.html#_CPPv4St "std") ::string &_name_)[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/FliImpl_8h.html#_CPPv4N7FliImpl7FliImplERKNSt6stringE "Permalink to this definition") void `sim_end`() _override_[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/FliImpl_8h.html#_CPPv4N7FliImpl7sim_endEv "Permalink to this definition") [GpiObjHdl](https://docs.cocotb.org/en/v1.4.0/generated/class/classGpiObjHdl.html#_CPPv49GpiObjHdl "GpiObjHdl") \*`native_check_create`(void \*_raw\_hdl_, [GpiObjHdl](https://docs.cocotb.org/en/v1.4.0/generated/class/classGpiObjHdl.html#_CPPv49GpiObjHdl "GpiObjHdl") \*_paret_) _override_[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/FliImpl_8h.html#_CPPv4N7FliImpl19native_check_createEPvP9GpiObjHdl "Permalink to this definition") [GpiObjHdl](https://docs.cocotb.org/en/v1.4.0/generated/class/classGpiObjHdl.html#_CPPv49GpiObjHdl "GpiObjHdl") \*`create_gpi_obj_from_handle`(void \*_hdl_, [std](https://docs.cocotb.org/en/v1.4.0/generated/file/GpiCommon_8cpp.html#_CPPv4St "std") ::string &_name_, [std](https://docs.cocotb.org/en/v1.4.0/generated/file/GpiCommon_8cpp.html#_CPPv4St "std") ::string &_fq\_name_, int _accType_, int _accFullType_)[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/FliImpl_8h.html#_CPPv4N7FliImpl26create_gpi_obj_from_handleEPvRNSt6stringERNSt6stringEii "Permalink to this definition") Public Members [FliTimerCache](https://docs.cocotb.org/en/v1.4.0/generated/class/classFliTimerCache.html#_CPPv413FliTimerCache "FliTimerCache") `cache`[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/FliImpl_8h.html#_CPPv4N7FliImpl5cacheE "Permalink to this definition") Private Functions bool `isValueConst`(int _kind_)[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/FliImpl_8h.html#_CPPv4N7FliImpl12isValueConstEi "Permalink to this definition") bool `isValueLogic`(mtiTypeIdT _type_)[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/FliImpl_8h.html#_CPPv4N7FliImpl12isValueLogicE10mtiTypeIdT "Permalink to this definition") bool `isValueChar`(mtiTypeIdT _type_)[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/FliImpl_8h.html#_CPPv4N7FliImpl11isValueCharE10mtiTypeIdT "Permalink to this definition") bool `isValueBoolean`(mtiTypeIdT _type_)[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/FliImpl_8h.html#_CPPv4N7FliImpl14isValueBooleanE10mtiTypeIdT "Permalink to this definition") bool `isTypeValue`(int _type_)[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/FliImpl_8h.html#_CPPv4N7FliImpl11isTypeValueEi "Permalink to this definition") bool `isTypeSignal`(int _type_, int _full\_type_)[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/FliImpl_8h.html#_CPPv4N7FliImpl12isTypeSignalEii "Permalink to this definition") Private Members [FliReadOnlyCbHdl](https://docs.cocotb.org/en/v1.4.0/generated/class/classFliReadOnlyCbHdl.html#_CPPv416FliReadOnlyCbHdl "FliReadOnlyCbHdl") `m_readonly_cbhdl`[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/FliImpl_8h.html#_CPPv4N7FliImpl16m_readonly_cbhdlE "Permalink to this definition") [FliNextPhaseCbHdl](https://docs.cocotb.org/en/v1.4.0/generated/class/classFliNextPhaseCbHdl.html#_CPPv417FliNextPhaseCbHdl "FliNextPhaseCbHdl") `m_nexttime_cbhdl`[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/FliImpl_8h.html#_CPPv4N7FliImpl16m_nexttime_cbhdlE "Permalink to this definition") [FliReadWriteCbHdl](https://docs.cocotb.org/en/v1.4.0/generated/class/classFliReadWriteCbHdl.html#_CPPv417FliReadWriteCbHdl "FliReadWriteCbHdl") `m_readwrite_cbhdl`[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/FliImpl_8h.html#_CPPv4N7FliImpl17m_readwrite_cbhdlE "Permalink to this definition") --- # Class VhpiValueCbHdl — cocotb 1.4.0 documentation * [](https://docs.cocotb.org/en/v1.4.0/index.html) » * [C Code Library Reference](https://docs.cocotb.org/en/v1.4.0/library_reference_c.html) » * [Class list](https://docs.cocotb.org/en/v1.4.0/generated/classlist.html) » * Class VhpiValueCbHdl * [Edit on GitHub](https://github.com/cocotb/cocotb/blob/v1.4.0/documentation/source/generated/class/classVhpiValueCbHdl.rst) * * * Class VhpiValueCbHdl[¶](https://docs.cocotb.org/en/v1.4.0/generated/class/classVhpiValueCbHdl.html#class-vhpivaluecbhdl "Permalink to this headline") ====================================================================================================================================================== _class_ `VhpiValueCbHdl` : _public_ [VhpiCbHdl](https://docs.cocotb.org/en/v1.4.0/generated/class/classVhpiCbHdl.html#_CPPv49VhpiCbHdl "VhpiCbHdl") , _public_ [GpiValueCbHdl](https://docs.cocotb.org/en/v1.4.0/generated/class/classGpiValueCbHdl.html#_CPPv413GpiValueCbHdl "GpiValueCbHdl") [¶](https://docs.cocotb.org/en/v1.4.0/generated/class/classVhpiValueCbHdl.html#_CPPv414VhpiValueCbHdl "Permalink to this definition") --- # Class VpiArrayObjHdl — cocotb 1.4.0 documentation * [](https://docs.cocotb.org/en/v1.4.0/index.html) » * [C Code Library Reference](https://docs.cocotb.org/en/v1.4.0/library_reference_c.html) » * [Class list](https://docs.cocotb.org/en/v1.4.0/generated/classlist.html) » * Class VpiArrayObjHdl * [Edit on GitHub](https://github.com/cocotb/cocotb/blob/v1.4.0/documentation/source/generated/class/classVpiArrayObjHdl.rst) * * * Class VpiArrayObjHdl[¶](https://docs.cocotb.org/en/v1.4.0/generated/class/classVpiArrayObjHdl.html#class-vpiarrayobjhdl "Permalink to this headline") ====================================================================================================================================================== _class_ `VpiArrayObjHdl` : _public_ [GpiObjHdl](https://docs.cocotb.org/en/v1.4.0/generated/class/classGpiObjHdl.html#_CPPv49GpiObjHdl "GpiObjHdl") [¶](https://docs.cocotb.org/en/v1.4.0/generated/class/classVpiArrayObjHdl.html#_CPPv414VpiArrayObjHdl "Permalink to this definition") --- # Class VpiCbHdl — cocotb 1.4.0 documentation * [](https://docs.cocotb.org/en/v1.4.0/index.html) » * [C Code Library Reference](https://docs.cocotb.org/en/v1.4.0/library_reference_c.html) » * [Class list](https://docs.cocotb.org/en/v1.4.0/generated/classlist.html) » * Class VpiCbHdl * [Edit on GitHub](https://github.com/cocotb/cocotb/blob/v1.4.0/documentation/source/generated/class/classVpiCbHdl.rst) * * * Class VpiCbHdl[¶](https://docs.cocotb.org/en/v1.4.0/generated/class/classVpiCbHdl.html#class-vpicbhdl "Permalink to this headline") ==================================================================================================================================== _class_ `VpiCbHdl` : _public_ _virtual_ [GpiCbHdl](https://docs.cocotb.org/en/v1.4.0/generated/class/classGpiCbHdl.html#_CPPv48GpiCbHdl "GpiCbHdl") [¶](https://docs.cocotb.org/en/v1.4.0/generated/class/classVpiCbHdl.html#_CPPv48VpiCbHdl "Permalink to this definition") Subclassed by [VpiNextPhaseCbHdl](https://docs.cocotb.org/en/v1.4.0/generated/file/VpiImpl_8h.html#classVpiNextPhaseCbHdl) , [VpiReadOnlyCbHdl](https://docs.cocotb.org/en/v1.4.0/generated/file/VpiImpl_8h.html#classVpiReadOnlyCbHdl) , [VpiReadwriteCbHdl](https://docs.cocotb.org/en/v1.4.0/generated/file/VpiImpl_8h.html#classVpiReadwriteCbHdl) , [VpiShutdownCbHdl](https://docs.cocotb.org/en/v1.4.0/generated/file/VpiImpl_8h.html#classVpiShutdownCbHdl) , [VpiStartupCbHdl](https://docs.cocotb.org/en/v1.4.0/generated/file/VpiImpl_8h.html#classVpiStartupCbHdl) , [VpiTimedCbHdl](https://docs.cocotb.org/en/v1.4.0/generated/file/VpiImpl_8h.html#classVpiTimedCbHdl) , [VpiValueCbHdl](https://docs.cocotb.org/en/v1.4.0/generated/file/VpiImpl_8h.html#classVpiValueCbHdl) --- # Class VpiImpl — cocotb 1.4.0 documentation * [](https://docs.cocotb.org/en/v1.4.0/index.html) » * [C Code Library Reference](https://docs.cocotb.org/en/v1.4.0/library_reference_c.html) » * [Class list](https://docs.cocotb.org/en/v1.4.0/generated/classlist.html) » * Class VpiImpl * [Edit on GitHub](https://github.com/cocotb/cocotb/blob/v1.4.0/documentation/source/generated/class/classVpiImpl.rst) * * * Class VpiImpl[¶](https://docs.cocotb.org/en/v1.4.0/generated/class/classVpiImpl.html#class-vpiimpl "Permalink to this headline") ================================================================================================================================= _class_ `VpiImpl` : _public_ [GpiImplInterface](https://docs.cocotb.org/en/v1.4.0/generated/class/classGpiImplInterface.html#_CPPv416GpiImplInterface "GpiImplInterface") [¶](https://docs.cocotb.org/en/v1.4.0/generated/class/classVpiImpl.html#_CPPv47VpiImpl "Permalink to this definition") --- # File GpiCbHdl.cpp — cocotb 1.4.0 documentation * [](https://docs.cocotb.org/en/v1.4.0/index.html) » * [C Code Library Reference](https://docs.cocotb.org/en/v1.4.0/library_reference_c.html) » * [File list](https://docs.cocotb.org/en/v1.4.0/generated/filelist.html) » * File GpiCbHdl.cpp * [Edit on GitHub](https://github.com/cocotb/cocotb/blob/v1.4.0/documentation/source/generated/file/GpiCbHdl_8cpp.rst) * * * File GpiCbHdl.cpp[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/GpiCbHdl_8cpp.html#file-gpicbhdl-cpp "Permalink to this headline") ========================================================================================================================================= Defines `CASE_OPTION`(_\_X_) case \_X: \\ ret = #\_X; \\ break [¶](https://docs.cocotb.org/en/v1.4.0/generated/file/GpiCbHdl_8cpp.html#c.CASE_OPTION "Permalink to this definition") --- # Class VpiIterator — cocotb 1.4.0 documentation * [](https://docs.cocotb.org/en/v1.4.0/index.html) » * [C Code Library Reference](https://docs.cocotb.org/en/v1.4.0/library_reference_c.html) » * [Class list](https://docs.cocotb.org/en/v1.4.0/generated/classlist.html) » * Class VpiIterator * [Edit on GitHub](https://github.com/cocotb/cocotb/blob/v1.4.0/documentation/source/generated/class/classVpiIterator.rst) * * * Class VpiIterator[¶](https://docs.cocotb.org/en/v1.4.0/generated/class/classVpiIterator.html#class-vpiiterator "Permalink to this headline") ============================================================================================================================================= _class_ `VpiIterator` : _public_ [GpiIterator](https://docs.cocotb.org/en/v1.4.0/generated/class/classGpiIterator.html#_CPPv411GpiIterator "GpiIterator") [¶](https://docs.cocotb.org/en/v1.4.0/generated/class/classVpiIterator.html#_CPPv411VpiIterator "Permalink to this definition") --- # Class VpiNextPhaseCbHdl — cocotb 1.4.0 documentation * [](https://docs.cocotb.org/en/v1.4.0/index.html) » * [C Code Library Reference](https://docs.cocotb.org/en/v1.4.0/library_reference_c.html) » * [Class list](https://docs.cocotb.org/en/v1.4.0/generated/classlist.html) » * Class VpiNextPhaseCbHdl * [Edit on GitHub](https://github.com/cocotb/cocotb/blob/v1.4.0/documentation/source/generated/class/classVpiNextPhaseCbHdl.rst) * * * Class VpiNextPhaseCbHdl[¶](https://docs.cocotb.org/en/v1.4.0/generated/class/classVpiNextPhaseCbHdl.html#class-vpinextphasecbhdl "Permalink to this headline") =============================================================================================================================================================== _class_ `VpiNextPhaseCbHdl` : _public_ [VpiCbHdl](https://docs.cocotb.org/en/v1.4.0/generated/class/classVpiCbHdl.html#_CPPv48VpiCbHdl "VpiCbHdl") [¶](https://docs.cocotb.org/en/v1.4.0/generated/class/classVpiNextPhaseCbHdl.html#_CPPv417VpiNextPhaseCbHdl "Permalink to this definition") --- # File FliObjHdl.cpp — cocotb 1.4.0 documentation * [](https://docs.cocotb.org/en/v1.4.0/index.html) » * [C Code Library Reference](https://docs.cocotb.org/en/v1.4.0/library_reference_c.html) » * [File list](https://docs.cocotb.org/en/v1.4.0/generated/filelist.html) » * File FliObjHdl.cpp * [Edit on GitHub](https://github.com/cocotb/cocotb/blob/v1.4.0/documentation/source/generated/file/FliObjHdl_8cpp.rst) * * * File FliObjHdl.cpp[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/FliObjHdl_8cpp.html#file-fliobjhdl-cpp "Permalink to this headline") ============================================================================================================================================ --- # Class VpiReadOnlyCbHdl — cocotb 1.4.0 documentation * [](https://docs.cocotb.org/en/v1.4.0/index.html) » * [C Code Library Reference](https://docs.cocotb.org/en/v1.4.0/library_reference_c.html) » * [Class list](https://docs.cocotb.org/en/v1.4.0/generated/classlist.html) » * Class VpiReadOnlyCbHdl * [Edit on GitHub](https://github.com/cocotb/cocotb/blob/v1.4.0/documentation/source/generated/class/classVpiReadOnlyCbHdl.rst) * * * Class VpiReadOnlyCbHdl[¶](https://docs.cocotb.org/en/v1.4.0/generated/class/classVpiReadOnlyCbHdl.html#class-vpireadonlycbhdl "Permalink to this headline") ============================================================================================================================================================ _class_ `VpiReadOnlyCbHdl` : _public_ [VpiCbHdl](https://docs.cocotb.org/en/v1.4.0/generated/class/classVpiCbHdl.html#_CPPv48VpiCbHdl "VpiCbHdl") [¶](https://docs.cocotb.org/en/v1.4.0/generated/class/classVpiReadOnlyCbHdl.html#_CPPv416VpiReadOnlyCbHdl "Permalink to this definition") --- # Class VpiObjHdl — cocotb 1.4.0 documentation * [](https://docs.cocotb.org/en/v1.4.0/index.html) » * [C Code Library Reference](https://docs.cocotb.org/en/v1.4.0/library_reference_c.html) » * [Class list](https://docs.cocotb.org/en/v1.4.0/generated/classlist.html) » * Class VpiObjHdl * [Edit on GitHub](https://github.com/cocotb/cocotb/blob/v1.4.0/documentation/source/generated/class/classVpiObjHdl.rst) * * * Class VpiObjHdl[¶](https://docs.cocotb.org/en/v1.4.0/generated/class/classVpiObjHdl.html#class-vpiobjhdl "Permalink to this headline") ======================================================================================================================================= _class_ `VpiObjHdl` : _public_ [GpiObjHdl](https://docs.cocotb.org/en/v1.4.0/generated/class/classGpiObjHdl.html#_CPPv49GpiObjHdl "GpiObjHdl") [¶](https://docs.cocotb.org/en/v1.4.0/generated/class/classVpiObjHdl.html#_CPPv49VpiObjHdl "Permalink to this definition") --- # Class VpiSignalObjHdl — cocotb 1.4.0 documentation * [](https://docs.cocotb.org/en/v1.4.0/index.html) » * [C Code Library Reference](https://docs.cocotb.org/en/v1.4.0/library_reference_c.html) » * [Class list](https://docs.cocotb.org/en/v1.4.0/generated/classlist.html) » * Class VpiSignalObjHdl * [Edit on GitHub](https://github.com/cocotb/cocotb/blob/v1.4.0/documentation/source/generated/class/classVpiSignalObjHdl.rst) * * * Class VpiSignalObjHdl[¶](https://docs.cocotb.org/en/v1.4.0/generated/class/classVpiSignalObjHdl.html#class-vpisignalobjhdl "Permalink to this headline") ========================================================================================================================================================= _class_ `VpiSignalObjHdl` : _public_ [GpiSignalObjHdl](https://docs.cocotb.org/en/v1.4.0/generated/class/classGpiSignalObjHdl.html#_CPPv415GpiSignalObjHdl "GpiSignalObjHdl") [¶](https://docs.cocotb.org/en/v1.4.0/generated/class/classVpiSignalObjHdl.html#_CPPv415VpiSignalObjHdl "Permalink to this definition") --- # Class VpiReadwriteCbHdl — cocotb 1.4.0 documentation * [](https://docs.cocotb.org/en/v1.4.0/index.html) » * [C Code Library Reference](https://docs.cocotb.org/en/v1.4.0/library_reference_c.html) » * [Class list](https://docs.cocotb.org/en/v1.4.0/generated/classlist.html) » * Class VpiReadwriteCbHdl * [Edit on GitHub](https://github.com/cocotb/cocotb/blob/v1.4.0/documentation/source/generated/class/classVpiReadwriteCbHdl.rst) * * * Class VpiReadwriteCbHdl[¶](https://docs.cocotb.org/en/v1.4.0/generated/class/classVpiReadwriteCbHdl.html#class-vpireadwritecbhdl "Permalink to this headline") =============================================================================================================================================================== _class_ `VpiReadwriteCbHdl` : _public_ [VpiCbHdl](https://docs.cocotb.org/en/v1.4.0/generated/class/classVpiCbHdl.html#_CPPv48VpiCbHdl "VpiCbHdl") [¶](https://docs.cocotb.org/en/v1.4.0/generated/class/classVpiReadwriteCbHdl.html#_CPPv417VpiReadwriteCbHdl "Permalink to this definition") --- # Class VpiShutdownCbHdl — cocotb 1.4.0 documentation * [](https://docs.cocotb.org/en/v1.4.0/index.html) » * [C Code Library Reference](https://docs.cocotb.org/en/v1.4.0/library_reference_c.html) » * [Class list](https://docs.cocotb.org/en/v1.4.0/generated/classlist.html) » * Class VpiShutdownCbHdl * [Edit on GitHub](https://github.com/cocotb/cocotb/blob/v1.4.0/documentation/source/generated/class/classVpiShutdownCbHdl.rst) * * * Class VpiShutdownCbHdl[¶](https://docs.cocotb.org/en/v1.4.0/generated/class/classVpiShutdownCbHdl.html#class-vpishutdowncbhdl "Permalink to this headline") ============================================================================================================================================================ _class_ `VpiShutdownCbHdl` : _public_ [VpiCbHdl](https://docs.cocotb.org/en/v1.4.0/generated/class/classVpiCbHdl.html#_CPPv48VpiCbHdl "VpiCbHdl") [¶](https://docs.cocotb.org/en/v1.4.0/generated/class/classVpiShutdownCbHdl.html#_CPPv416VpiShutdownCbHdl "Permalink to this definition") --- # Class VpiSingleIterator — cocotb 1.4.0 documentation * [](https://docs.cocotb.org/en/v1.4.0/index.html) » * [C Code Library Reference](https://docs.cocotb.org/en/v1.4.0/library_reference_c.html) » * [Class list](https://docs.cocotb.org/en/v1.4.0/generated/classlist.html) » * Class VpiSingleIterator * [Edit on GitHub](https://github.com/cocotb/cocotb/blob/v1.4.0/documentation/source/generated/class/classVpiSingleIterator.rst) * * * Class VpiSingleIterator[¶](https://docs.cocotb.org/en/v1.4.0/generated/class/classVpiSingleIterator.html#class-vpisingleiterator "Permalink to this headline") =============================================================================================================================================================== _class_ `VpiSingleIterator` : _public_ [GpiIterator](https://docs.cocotb.org/en/v1.4.0/generated/class/classGpiIterator.html#_CPPv411GpiIterator "GpiIterator") [¶](https://docs.cocotb.org/en/v1.4.0/generated/class/classVpiSingleIterator.html#_CPPv417VpiSingleIterator "Permalink to this definition") --- # Class VpiTimedCbHdl — cocotb 1.4.0 documentation * [](https://docs.cocotb.org/en/v1.4.0/index.html) » * [C Code Library Reference](https://docs.cocotb.org/en/v1.4.0/library_reference_c.html) » * [Class list](https://docs.cocotb.org/en/v1.4.0/generated/classlist.html) » * Class VpiTimedCbHdl * [Edit on GitHub](https://github.com/cocotb/cocotb/blob/v1.4.0/documentation/source/generated/class/classVpiTimedCbHdl.rst) * * * Class VpiTimedCbHdl[¶](https://docs.cocotb.org/en/v1.4.0/generated/class/classVpiTimedCbHdl.html#class-vpitimedcbhdl "Permalink to this headline") =================================================================================================================================================== _class_ `VpiTimedCbHdl` : _public_ [VpiCbHdl](https://docs.cocotb.org/en/v1.4.0/generated/class/classVpiCbHdl.html#_CPPv48VpiCbHdl "VpiCbHdl") [¶](https://docs.cocotb.org/en/v1.4.0/generated/class/classVpiTimedCbHdl.html#_CPPv413VpiTimedCbHdl "Permalink to this definition") --- # Class VpiStartupCbHdl — cocotb 1.4.0 documentation * [](https://docs.cocotb.org/en/v1.4.0/index.html) » * [C Code Library Reference](https://docs.cocotb.org/en/v1.4.0/library_reference_c.html) » * [Class list](https://docs.cocotb.org/en/v1.4.0/generated/classlist.html) » * Class VpiStartupCbHdl * [Edit on GitHub](https://github.com/cocotb/cocotb/blob/v1.4.0/documentation/source/generated/class/classVpiStartupCbHdl.rst) * * * Class VpiStartupCbHdl[¶](https://docs.cocotb.org/en/v1.4.0/generated/class/classVpiStartupCbHdl.html#class-vpistartupcbhdl "Permalink to this headline") ========================================================================================================================================================= _class_ `VpiStartupCbHdl` : _public_ [VpiCbHdl](https://docs.cocotb.org/en/v1.4.0/generated/class/classVpiCbHdl.html#_CPPv48VpiCbHdl "VpiCbHdl") [¶](https://docs.cocotb.org/en/v1.4.0/generated/class/classVpiStartupCbHdl.html#_CPPv415VpiStartupCbHdl "Permalink to this definition") --- # Class VpiValueCbHdl — cocotb 1.4.0 documentation * [](https://docs.cocotb.org/en/v1.4.0/index.html) » * [C Code Library Reference](https://docs.cocotb.org/en/v1.4.0/library_reference_c.html) » * [Class list](https://docs.cocotb.org/en/v1.4.0/generated/classlist.html) » * Class VpiValueCbHdl * [Edit on GitHub](https://github.com/cocotb/cocotb/blob/v1.4.0/documentation/source/generated/class/classVpiValueCbHdl.rst) * * * Class VpiValueCbHdl[¶](https://docs.cocotb.org/en/v1.4.0/generated/class/classVpiValueCbHdl.html#class-vpivaluecbhdl "Permalink to this headline") =================================================================================================================================================== _class_ `VpiValueCbHdl` : _public_ [VpiCbHdl](https://docs.cocotb.org/en/v1.4.0/generated/class/classVpiCbHdl.html#_CPPv48VpiCbHdl "VpiCbHdl") , _public_ [GpiValueCbHdl](https://docs.cocotb.org/en/v1.4.0/generated/class/classGpiValueCbHdl.html#_CPPv413GpiValueCbHdl "GpiValueCbHdl") [¶](https://docs.cocotb.org/en/v1.4.0/generated/class/classVpiValueCbHdl.html#_CPPv413VpiValueCbHdl "Permalink to this definition") --- # File GpiCommon.cpp — cocotb 1.4.0 documentation * [](https://docs.cocotb.org/en/v1.4.0/index.html) » * [C Code Library Reference](https://docs.cocotb.org/en/v1.4.0/library_reference_c.html) » * [File list](https://docs.cocotb.org/en/v1.4.0/generated/filelist.html) » * File GpiCommon.cpp * [Edit on GitHub](https://github.com/cocotb/cocotb/blob/v1.4.0/documentation/source/generated/file/GpiCommon_8cpp.rst) * * * File GpiCommon.cpp[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/GpiCommon_8cpp.html#file-gpicommon-cpp "Permalink to this headline") ============================================================================================================================================ Defines `CHECK_AND_STORE`(_\_x_) \_x[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/GpiCommon_8cpp.html#c.CHECK_AND_STORE "Permalink to this definition") `CLEAR_STORE`() (void)0[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/GpiCommon_8cpp.html#c.CLEAR_STORE "Permalink to this definition") `DOT_LIB_EXT` "." xstr(LIB\_EXT)[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/GpiCommon_8cpp.html#c.DOT_LIB_EXT "Permalink to this definition") Functions size\_t `gpi_print_registered_impl`()[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/GpiCommon_8cpp.html#_CPPv425gpi_print_registered_implv "Permalink to this definition") int `gpi_register_impl`([GpiImplInterface](https://docs.cocotb.org/en/v1.4.0/generated/class/classGpiImplInterface.html#_CPPv416GpiImplInterface "GpiImplInterface") \*_func\_tbl_)[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/GpiCommon_8cpp.html#_CPPv417gpi_register_implP16GpiImplInterface "Permalink to this definition") bool `gpi_has_registered_impl`()[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/GpiCommon_8cpp.html#_CPPv423gpi_has_registered_implv "Permalink to this definition") Returns 1 if there is a registered GPI implementation, 0 otherwise. Useful for checking if a simulator is running. void `gpi_embed_init`(int _argc_, char _const_ \*_const_ \*_argv_)[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/GpiCommon_8cpp.html#_CPPv414gpi_embed_initiPPCKc "Permalink to this definition") void `gpi_embed_end`()[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/GpiCommon_8cpp.html#_CPPv413gpi_embed_endv "Permalink to this definition") void `gpi_sim_end`()[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/GpiCommon_8cpp.html#_CPPv411gpi_sim_endv "Permalink to this definition") void `gpi_cleanup`(void)[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/GpiCommon_8cpp.html#_CPPv411gpi_cleanupv "Permalink to this definition") void `gpi_embed_event`(gpi\_event\_t _level_, _const_ char \*_msg_)[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/GpiCommon_8cpp.html#_CPPv415gpi_embed_event11gpi_event_tPKc "Permalink to this definition") void `gpi_load_libs`([std](https://docs.cocotb.org/en/v1.4.0/generated/file/GpiCommon_8cpp.html#_CPPv4St "std") ::vector<[std](https://docs.cocotb.org/en/v1.4.0/generated/file/GpiCommon_8cpp.html#_CPPv4St "std") ::string> _to\_load_)[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/GpiCommon_8cpp.html#_CPPv413gpi_load_libsNSt6vectorINSt6stringEEE "Permalink to this definition") void `gpi_load_extra_libs`()[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/GpiCommon_8cpp.html#_CPPv419gpi_load_extra_libsv "Permalink to this definition") void `gpi_get_sim_time`(uint32\_t \*_high_, uint32\_t \*_low_)[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/GpiCommon_8cpp.html#_CPPv416gpi_get_sim_timeP8uint32_tP8uint32_t "Permalink to this definition") void `gpi_get_sim_precision`(int32\_t \*_precision_)[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/GpiCommon_8cpp.html#_CPPv421gpi_get_sim_precisionP7int32_t "Permalink to this definition") _const_ char \*`gpi_get_simulator_product`()[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/GpiCommon_8cpp.html#_CPPv425gpi_get_simulator_productv "Permalink to this definition") Returns a string with the running simulator product information. **Return** simulator product string _const_ char \*`gpi_get_simulator_version`()[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/GpiCommon_8cpp.html#_CPPv425gpi_get_simulator_versionv "Permalink to this definition") Returns a string with the running simulator version. **Return** simulator version string [gpi\_sim\_hdl](https://docs.cocotb.org/en/v1.4.0/generated/file/gpi_8h.html#_CPPv411gpi_sim_hdl "gpi_sim_hdl") `gpi_get_root_handle`(_const_ char \*_name_)[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/GpiCommon_8cpp.html#_CPPv419gpi_get_root_handlePKc "Permalink to this definition") [GpiObjHdl](https://docs.cocotb.org/en/v1.4.0/generated/class/classGpiObjHdl.html#_CPPv49GpiObjHdl "GpiObjHdl") \*`__gpi_get_handle_by_name`([GpiObjHdl](https://docs.cocotb.org/en/v1.4.0/generated/class/classGpiObjHdl.html#_CPPv49GpiObjHdl "GpiObjHdl") \*_parent_, [std](https://docs.cocotb.org/en/v1.4.0/generated/file/GpiCommon_8cpp.html#_CPPv4St "std") ::string _name_, [GpiImplInterface](https://docs.cocotb.org/en/v1.4.0/generated/class/classGpiImplInterface.html#_CPPv416GpiImplInterface "GpiImplInterface") \*_skip\_impl_)[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/GpiCommon_8cpp.html#_CPPv424__gpi_get_handle_by_nameP9GpiObjHdlNSt6stringEP16GpiImplInterface "Permalink to this definition") [GpiObjHdl](https://docs.cocotb.org/en/v1.4.0/generated/class/classGpiObjHdl.html#_CPPv49GpiObjHdl "GpiObjHdl") \*`__gpi_get_handle_by_raw`([GpiObjHdl](https://docs.cocotb.org/en/v1.4.0/generated/class/classGpiObjHdl.html#_CPPv49GpiObjHdl "GpiObjHdl") \*_parent_, void \*_raw\_hdl_, [GpiImplInterface](https://docs.cocotb.org/en/v1.4.0/generated/class/classGpiImplInterface.html#_CPPv416GpiImplInterface "GpiImplInterface") \*_skip\_impl_)[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/GpiCommon_8cpp.html#_CPPv423__gpi_get_handle_by_rawP9GpiObjHdlPvP16GpiImplInterface "Permalink to this definition") [gpi\_sim\_hdl](https://docs.cocotb.org/en/v1.4.0/generated/file/gpi_8h.html#_CPPv411gpi_sim_hdl "gpi_sim_hdl") `gpi_get_handle_by_name`([gpi\_sim\_hdl](https://docs.cocotb.org/en/v1.4.0/generated/file/gpi_8h.html#_CPPv411gpi_sim_hdl "gpi_sim_hdl") _base_, _const_ char \*_name_)[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/GpiCommon_8cpp.html#_CPPv422gpi_get_handle_by_name11gpi_sim_hdlPKc "Permalink to this definition") [gpi\_sim\_hdl](https://docs.cocotb.org/en/v1.4.0/generated/file/gpi_8h.html#_CPPv411gpi_sim_hdl "gpi_sim_hdl") `gpi_get_handle_by_index`([gpi\_sim\_hdl](https://docs.cocotb.org/en/v1.4.0/generated/file/gpi_8h.html#_CPPv411gpi_sim_hdl "gpi_sim_hdl") _base_, int32\_t _index_)[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/GpiCommon_8cpp.html#_CPPv423gpi_get_handle_by_index11gpi_sim_hdl7int32_t "Permalink to this definition") [gpi\_iterator\_hdl](https://docs.cocotb.org/en/v1.4.0/generated/file/gpi_8h.html#_CPPv416gpi_iterator_hdl "gpi_iterator_hdl") `gpi_iterate`([gpi\_sim\_hdl](https://docs.cocotb.org/en/v1.4.0/generated/file/gpi_8h.html#_CPPv411gpi_sim_hdl "gpi_sim_hdl") _obj\_hdl_, [gpi\_iterator\_sel\_t](https://docs.cocotb.org/en/v1.4.0/generated/file/gpi_8h.html#_CPPv418gpi_iterator_sel_t "gpi_iterator_sel_t") _type_)[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/GpiCommon_8cpp.html#_CPPv411gpi_iterate11gpi_sim_hdl18gpi_iterator_sel_t "Permalink to this definition") [gpi\_sim\_hdl](https://docs.cocotb.org/en/v1.4.0/generated/file/gpi_8h.html#_CPPv411gpi_sim_hdl "gpi_sim_hdl") `gpi_next`([gpi\_iterator\_hdl](https://docs.cocotb.org/en/v1.4.0/generated/file/gpi_8h.html#_CPPv416gpi_iterator_hdl "gpi_iterator_hdl") _iter_)[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/GpiCommon_8cpp.html#_CPPv48gpi_next16gpi_iterator_hdl "Permalink to this definition") _const_ char \*`gpi_get_definition_name`([gpi\_sim\_hdl](https://docs.cocotb.org/en/v1.4.0/generated/file/gpi_8h.html#_CPPv411gpi_sim_hdl "gpi_sim_hdl") _obj\_hdl_)[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/GpiCommon_8cpp.html#_CPPv423gpi_get_definition_name11gpi_sim_hdl "Permalink to this definition") _const_ char \*`gpi_get_definition_file`([gpi\_sim\_hdl](https://docs.cocotb.org/en/v1.4.0/generated/file/gpi_8h.html#_CPPv411gpi_sim_hdl "gpi_sim_hdl") _obj\_hdl_)[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/GpiCommon_8cpp.html#_CPPv423gpi_get_definition_file11gpi_sim_hdl "Permalink to this definition") _const_ char \*`gpi_get_signal_value_binstr`([gpi\_sim\_hdl](https://docs.cocotb.org/en/v1.4.0/generated/file/gpi_8h.html#_CPPv411gpi_sim_hdl "gpi_sim_hdl") _sig\_hdl_)[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/GpiCommon_8cpp.html#_CPPv427gpi_get_signal_value_binstr11gpi_sim_hdl "Permalink to this definition") _const_ char \*`gpi_get_signal_value_str`([gpi\_sim\_hdl](https://docs.cocotb.org/en/v1.4.0/generated/file/gpi_8h.html#_CPPv411gpi_sim_hdl "gpi_sim_hdl") _sig\_hdl_)[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/GpiCommon_8cpp.html#_CPPv424gpi_get_signal_value_str11gpi_sim_hdl "Permalink to this definition") double `gpi_get_signal_value_real`([gpi\_sim\_hdl](https://docs.cocotb.org/en/v1.4.0/generated/file/gpi_8h.html#_CPPv411gpi_sim_hdl "gpi_sim_hdl") _sig\_hdl_)[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/GpiCommon_8cpp.html#_CPPv425gpi_get_signal_value_real11gpi_sim_hdl "Permalink to this definition") long `gpi_get_signal_value_long`([gpi\_sim\_hdl](https://docs.cocotb.org/en/v1.4.0/generated/file/gpi_8h.html#_CPPv411gpi_sim_hdl "gpi_sim_hdl") _sig\_hdl_)[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/GpiCommon_8cpp.html#_CPPv425gpi_get_signal_value_long11gpi_sim_hdl "Permalink to this definition") _const_ char \*`gpi_get_signal_name_str`([gpi\_sim\_hdl](https://docs.cocotb.org/en/v1.4.0/generated/file/gpi_8h.html#_CPPv411gpi_sim_hdl "gpi_sim_hdl") _sig\_hdl_)[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/GpiCommon_8cpp.html#_CPPv423gpi_get_signal_name_str11gpi_sim_hdl "Permalink to this definition") _const_ char \*`gpi_get_signal_type_str`([gpi\_sim\_hdl](https://docs.cocotb.org/en/v1.4.0/generated/file/gpi_8h.html#_CPPv411gpi_sim_hdl "gpi_sim_hdl") _obj\_hdl_)[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/GpiCommon_8cpp.html#_CPPv423gpi_get_signal_type_str11gpi_sim_hdl "Permalink to this definition") [gpi\_objtype\_t](https://docs.cocotb.org/en/v1.4.0/generated/file/gpi_8h.html#_CPPv413gpi_objtype_t "gpi_objtype_t") `gpi_get_object_type`([gpi\_sim\_hdl](https://docs.cocotb.org/en/v1.4.0/generated/file/gpi_8h.html#_CPPv411gpi_sim_hdl "gpi_sim_hdl") _obj\_hdl_)[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/GpiCommon_8cpp.html#_CPPv419gpi_get_object_type11gpi_sim_hdl "Permalink to this definition") int `gpi_is_constant`([gpi\_sim\_hdl](https://docs.cocotb.org/en/v1.4.0/generated/file/gpi_8h.html#_CPPv411gpi_sim_hdl "gpi_sim_hdl") _obj\_hdl_)[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/GpiCommon_8cpp.html#_CPPv415gpi_is_constant11gpi_sim_hdl "Permalink to this definition") int `gpi_is_indexable`([gpi\_sim\_hdl](https://docs.cocotb.org/en/v1.4.0/generated/file/gpi_8h.html#_CPPv411gpi_sim_hdl "gpi_sim_hdl") _obj\_hdl_)[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/GpiCommon_8cpp.html#_CPPv416gpi_is_indexable11gpi_sim_hdl "Permalink to this definition") void `gpi_set_signal_value_long`([gpi\_sim\_hdl](https://docs.cocotb.org/en/v1.4.0/generated/file/gpi_8h.html#_CPPv411gpi_sim_hdl "gpi_sim_hdl") _sig\_hdl_, long _value_, [gpi\_set\_action\_t](https://docs.cocotb.org/en/v1.4.0/generated/file/gpi_8h.html#_CPPv416gpi_set_action_t "gpi_set_action_t") _action_)[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/GpiCommon_8cpp.html#_CPPv425gpi_set_signal_value_long11gpi_sim_hdll16gpi_set_action_t "Permalink to this definition") void `gpi_set_signal_value_binstr`([gpi\_sim\_hdl](https://docs.cocotb.org/en/v1.4.0/generated/file/gpi_8h.html#_CPPv411gpi_sim_hdl "gpi_sim_hdl") _sig\_hdl_, _const_ char \*_binstr_, [gpi\_set\_action\_t](https://docs.cocotb.org/en/v1.4.0/generated/file/gpi_8h.html#_CPPv416gpi_set_action_t "gpi_set_action_t") _action_)[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/GpiCommon_8cpp.html#_CPPv427gpi_set_signal_value_binstr11gpi_sim_hdlPKc16gpi_set_action_t "Permalink to this definition") void `gpi_set_signal_value_str`([gpi\_sim\_hdl](https://docs.cocotb.org/en/v1.4.0/generated/file/gpi_8h.html#_CPPv411gpi_sim_hdl "gpi_sim_hdl") _sig\_hdl_, _const_ char \*_str_, [gpi\_set\_action\_t](https://docs.cocotb.org/en/v1.4.0/generated/file/gpi_8h.html#_CPPv416gpi_set_action_t "gpi_set_action_t") _action_)[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/GpiCommon_8cpp.html#_CPPv424gpi_set_signal_value_str11gpi_sim_hdlPKc16gpi_set_action_t "Permalink to this definition") void `gpi_set_signal_value_real`([gpi\_sim\_hdl](https://docs.cocotb.org/en/v1.4.0/generated/file/gpi_8h.html#_CPPv411gpi_sim_hdl "gpi_sim_hdl") _sig\_hdl_, double _value_, [gpi\_set\_action\_t](https://docs.cocotb.org/en/v1.4.0/generated/file/gpi_8h.html#_CPPv416gpi_set_action_t "gpi_set_action_t") _action_)[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/GpiCommon_8cpp.html#_CPPv425gpi_set_signal_value_real11gpi_sim_hdld16gpi_set_action_t "Permalink to this definition") int `gpi_get_num_elems`([gpi\_sim\_hdl](https://docs.cocotb.org/en/v1.4.0/generated/file/gpi_8h.html#_CPPv411gpi_sim_hdl "gpi_sim_hdl") _obj\_hdl_)[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/GpiCommon_8cpp.html#_CPPv417gpi_get_num_elems11gpi_sim_hdl "Permalink to this definition") int `gpi_get_range_left`([gpi\_sim\_hdl](https://docs.cocotb.org/en/v1.4.0/generated/file/gpi_8h.html#_CPPv411gpi_sim_hdl "gpi_sim_hdl") _obj\_hdl_)[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/GpiCommon_8cpp.html#_CPPv418gpi_get_range_left11gpi_sim_hdl "Permalink to this definition") int `gpi_get_range_right`([gpi\_sim\_hdl](https://docs.cocotb.org/en/v1.4.0/generated/file/gpi_8h.html#_CPPv411gpi_sim_hdl "gpi_sim_hdl") _obj\_hdl_)[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/GpiCommon_8cpp.html#_CPPv419gpi_get_range_right11gpi_sim_hdl "Permalink to this definition") [gpi\_cb\_hdl](https://docs.cocotb.org/en/v1.4.0/generated/file/gpi_8h.html#_CPPv410gpi_cb_hdl "gpi_cb_hdl") `gpi_register_value_change_callback`(int (\*_gpi\_function_)(_const_ void\*), void \*_gpi\_cb\_data_, [gpi\_sim\_hdl](https://docs.cocotb.org/en/v1.4.0/generated/file/gpi_8h.html#_CPPv411gpi_sim_hdl "gpi_sim_hdl") _sig\_hdl_, int _edge_, )[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/GpiCommon_8cpp.html#_CPPv434gpi_register_value_change_callbackPFiPKvEPv11gpi_sim_hdli "Permalink to this definition") [gpi\_cb\_hdl](https://docs.cocotb.org/en/v1.4.0/generated/file/gpi_8h.html#_CPPv410gpi_cb_hdl "gpi_cb_hdl") `gpi_register_timed_callback`(int (\*_gpi\_function_)(_const_ void\*), void \*_gpi\_cb\_data_, uint64\_t _time\_ps_, )[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/GpiCommon_8cpp.html#_CPPv427gpi_register_timed_callbackPFiPKvEPv8uint64_t "Permalink to this definition") [gpi\_cb\_hdl](https://docs.cocotb.org/en/v1.4.0/generated/file/gpi_8h.html#_CPPv410gpi_cb_hdl "gpi_cb_hdl") `gpi_register_readonly_callback`(int (\*_gpi\_function_)(_const_ void\*), void \*_gpi\_cb\_data_, )[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/GpiCommon_8cpp.html#_CPPv430gpi_register_readonly_callbackPFiPKvEPv "Permalink to this definition") [gpi\_cb\_hdl](https://docs.cocotb.org/en/v1.4.0/generated/file/gpi_8h.html#_CPPv410gpi_cb_hdl "gpi_cb_hdl") `gpi_register_nexttime_callback`(int (\*_gpi\_function_)(_const_ void\*), void \*_gpi\_cb\_data_, )[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/GpiCommon_8cpp.html#_CPPv430gpi_register_nexttime_callbackPFiPKvEPv "Permalink to this definition") [gpi\_cb\_hdl](https://docs.cocotb.org/en/v1.4.0/generated/file/gpi_8h.html#_CPPv410gpi_cb_hdl "gpi_cb_hdl") `gpi_register_readwrite_callback`(int (\*_gpi\_function_)(_const_ void\*), void \*_gpi\_cb\_data_, )[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/GpiCommon_8cpp.html#_CPPv431gpi_register_readwrite_callbackPFiPKvEPv "Permalink to this definition") void `gpi_deregister_callback`([gpi\_cb\_hdl](https://docs.cocotb.org/en/v1.4.0/generated/file/gpi_8h.html#_CPPv410gpi_cb_hdl "gpi_cb_hdl") _cb\_hdl_)[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/GpiCommon_8cpp.html#_CPPv423gpi_deregister_callback10gpi_cb_hdl "Permalink to this definition") Variables vector<[GpiImplInterface](https://docs.cocotb.org/en/v1.4.0/generated/class/classGpiImplInterface.html#_CPPv416GpiImplInterface "GpiImplInterface") \*> `registered_impls`[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/GpiCommon_8cpp.html#_CPPv416registered_impls "Permalink to this definition") _namespace_ `std`[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/GpiCommon_8cpp.html#_CPPv4St "Permalink to this definition") --- # File VhpiCbHdl.cpp — cocotb 1.4.0 documentation * [](https://docs.cocotb.org/en/v1.4.0/index.html) » * [C Code Library Reference](https://docs.cocotb.org/en/v1.4.0/library_reference_c.html) » * [File list](https://docs.cocotb.org/en/v1.4.0/generated/filelist.html) » * File VhpiCbHdl.cpp * [Edit on GitHub](https://github.com/cocotb/cocotb/blob/v1.4.0/documentation/source/generated/file/VhpiCbHdl_8cpp.rst) * * * File VhpiCbHdl.cpp[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/VhpiCbHdl_8cpp.html#file-vhpicbhdl-cpp "Permalink to this headline") ============================================================================================================================================ Defines `VHPI_TYPE_MIN` (1000)[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/VhpiCbHdl_8cpp.html#c.VHPI_TYPE_MIN "Permalink to this definition") Functions void `handle_vhpi_callback`(_const_ [vhpiCbDataT](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#_CPPv411vhpiCbDataT "vhpiCbDataT") \*_cb\_data_)[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/VhpiCbHdl_8cpp.html#_CPPv420handle_vhpi_callbackPK11vhpiCbDataT "Permalink to this definition") bool `get_range`([vhpiHandleT](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#_CPPv411vhpiHandleT "vhpiHandleT") _hdl_, [vhpiIntT](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#_CPPv48vhpiIntT "vhpiIntT") _dim_, int \*_left_, int \*_right_)[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/VhpiCbHdl_8cpp.html#_CPPv49get_range11vhpiHandleT8vhpiIntTPiPi "Permalink to this definition") [vhpiPutValueModeT](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#_CPPv417vhpiPutValueModeT "vhpiPutValueModeT") `map_put_value_mode`([gpi\_set\_action\_t](https://docs.cocotb.org/en/v1.4.0/generated/file/gpi_8h.html#_CPPv416gpi_set_action_t "gpi_set_action_t") _action_)[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/VhpiCbHdl_8cpp.html#_CPPv418map_put_value_mode16gpi_set_action_t "Permalink to this definition") void `vhpi_mappings`([GpiIteratorMapping](https://docs.cocotb.org/en/v1.4.0/generated/class/classGpiIteratorMapping.html#_CPPv4I00E18GpiIteratorMapping "GpiIteratorMapping") <[vhpiClassKindT](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#_CPPv414vhpiClassKindT "vhpiClassKindT") , [vhpiOneToManyT](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#_CPPv414vhpiOneToManyT "vhpiOneToManyT") \> &_map_)[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/VhpiCbHdl_8cpp.html#_CPPv413vhpi_mappingsR18GpiIteratorMappingI14vhpiClassKindT14vhpiOneToManyTE "Permalink to this definition") --- # File VhpiImpl.cpp — cocotb 1.4.0 documentation * [](https://docs.cocotb.org/en/v1.4.0/index.html) » * [C Code Library Reference](https://docs.cocotb.org/en/v1.4.0/library_reference_c.html) » * [File list](https://docs.cocotb.org/en/v1.4.0/generated/filelist.html) » * File VhpiImpl.cpp * [Edit on GitHub](https://github.com/cocotb/cocotb/blob/v1.4.0/documentation/source/generated/file/VhpiImpl_8cpp.rst) * * * File VhpiImpl.cpp[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/VhpiImpl_8cpp.html#file-vhpiimpl-cpp "Permalink to this headline") ========================================================================================================================================= Defines `CASE_STR`(_\_X_) case \_X: return #\_X[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/VhpiImpl_8cpp.html#c.CASE_STR "Permalink to this definition") Functions int32\_t `log10int`(uint64\_t _v_)[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/VhpiImpl_8cpp.html#_CPPv48log10int8uint64_t "Permalink to this definition") bool `is_const`([vhpiHandleT](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#_CPPv411vhpiHandleT "vhpiHandleT") _hdl_)[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/VhpiImpl_8cpp.html#_CPPv48is_const11vhpiHandleT "Permalink to this definition") bool `is_enum_logic`([vhpiHandleT](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#_CPPv411vhpiHandleT "vhpiHandleT") _hdl_)[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/VhpiImpl_8cpp.html#_CPPv413is_enum_logic11vhpiHandleT "Permalink to this definition") bool `is_enum_char`([vhpiHandleT](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#_CPPv411vhpiHandleT "vhpiHandleT") _hdl_)[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/VhpiImpl_8cpp.html#_CPPv412is_enum_char11vhpiHandleT "Permalink to this definition") bool `is_enum_boolean`([vhpiHandleT](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#_CPPv411vhpiHandleT "vhpiHandleT") _hdl_)[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/VhpiImpl_8cpp.html#_CPPv415is_enum_boolean11vhpiHandleT "Permalink to this definition") void `handle_vhpi_callback`(_const_ [vhpiCbDataT](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#_CPPv411vhpiCbDataT "vhpiCbDataT") \*_cb\_data_) void `register_initial_callback`() void `register_final_callback`() void `register_embed`() void `vhpi_startup_routines_bootstrap`()[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/VhpiImpl_8cpp.html#_CPPv431vhpi_startup_routines_bootstrapv "Permalink to this definition") Variables [VhpiCbHdl](https://docs.cocotb.org/en/v1.4.0/generated/class/classVhpiCbHdl.html#_CPPv49VhpiCbHdl "VhpiCbHdl") \*`sim_init_cb` [VhpiCbHdl](https://docs.cocotb.org/en/v1.4.0/generated/class/classVhpiCbHdl.html#_CPPv49VhpiCbHdl "VhpiCbHdl") \*`sim_finish_cb` [VhpiImpl](https://docs.cocotb.org/en/v1.4.0/generated/class/classVhpiImpl.html#_CPPv48VhpiImpl "VhpiImpl") \*`vhpi_table`[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/VhpiImpl_8cpp.html#_CPPv410vhpi_table "Permalink to this definition") void (\*`vhpi_startup_routines`\[\])() = {[register\_embed](https://docs.cocotb.org/en/v1.4.0/generated/file/FliImpl_8cpp.html#_CPPv414register_embedv "register_embed") , [gpi\_load\_extra\_libs](https://docs.cocotb.org/en/v1.4.0/generated/file/GpiCommon_8cpp.html#_CPPv419gpi_load_extra_libsv "gpi_load_extra_libs") , [register\_initial\_callback](https://docs.cocotb.org/en/v1.4.0/generated/file/FliImpl_8cpp.html#_CPPv425register_initial_callbackv "register_initial_callback") , [register\_final\_callback](https://docs.cocotb.org/en/v1.4.0/generated/file/FliImpl_8cpp.html#_CPPv423register_final_callbackv "register_final_callback") , nullptr}[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/VhpiImpl_8cpp.html#_CPPv421vhpi_startup_routines "Permalink to this definition") --- # File VhpiImpl.h — cocotb 1.4.0 documentation * [](https://docs.cocotb.org/en/v1.4.0/index.html) » * [C Code Library Reference](https://docs.cocotb.org/en/v1.4.0/library_reference_c.html) » * [File list](https://docs.cocotb.org/en/v1.4.0/generated/filelist.html) » * File VhpiImpl.h * [Edit on GitHub](https://github.com/cocotb/cocotb/blob/v1.4.0/documentation/source/generated/file/VhpiImpl_8h.rst) * * * File VhpiImpl.h[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/VhpiImpl_8h.html#file-vhpiimpl-h "Permalink to this headline") =================================================================================================================================== Defines `GEN_IDX_SEP_LHS` "\_\_"[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/VhpiImpl_8h.html#c.GEN_IDX_SEP_LHS "Permalink to this definition") `GEN_IDX_SEP_RHS` ""[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/VhpiImpl_8h.html#c.GEN_IDX_SEP_RHS "Permalink to this definition") `check_vhpi_error`() do { \\ \_\_check\_vhpi\_error(\_\_FILE\_\_, \_\_func\_\_, \_\_LINE\_\_); \\ } while (0) [¶](https://docs.cocotb.org/en/v1.4.0/generated/file/VhpiImpl_8h.html#c.check_vhpi_error "Permalink to this definition") Functions int `__check_vhpi_error`(_const_ char \*_file_, _const_ char \*_func_, long _line_)[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/VhpiImpl_8h.html#_CPPv418__check_vhpi_errorPKcPKcl "Permalink to this definition") _class_ `VhpiCbHdl` : _public_ _virtual_ [GpiCbHdl](https://docs.cocotb.org/en/v1.4.0/generated/class/classGpiCbHdl.html#_CPPv48GpiCbHdl "GpiCbHdl") Subclassed by [VhpiNextPhaseCbHdl](https://docs.cocotb.org/en/v1.4.0/generated/file/VhpiImpl_8h.html#classVhpiNextPhaseCbHdl) , [VhpiReadOnlyCbHdl](https://docs.cocotb.org/en/v1.4.0/generated/file/VhpiImpl_8h.html#classVhpiReadOnlyCbHdl) , [VhpiReadwriteCbHdl](https://docs.cocotb.org/en/v1.4.0/generated/file/VhpiImpl_8h.html#classVhpiReadwriteCbHdl) , [VhpiShutdownCbHdl](https://docs.cocotb.org/en/v1.4.0/generated/file/VhpiImpl_8h.html#classVhpiShutdownCbHdl) , [VhpiStartupCbHdl](https://docs.cocotb.org/en/v1.4.0/generated/file/VhpiImpl_8h.html#classVhpiStartupCbHdl) , [VhpiTimedCbHdl](https://docs.cocotb.org/en/v1.4.0/generated/file/VhpiImpl_8h.html#classVhpiTimedCbHdl) , [VhpiValueCbHdl](https://docs.cocotb.org/en/v1.4.0/generated/file/VhpiImpl_8h.html#classVhpiValueCbHdl) Public Functions `VhpiCbHdl`([GpiImplInterface](https://docs.cocotb.org/en/v1.4.0/generated/class/classGpiImplInterface.html#_CPPv416GpiImplInterface "GpiImplInterface") \*_impl_)[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/VhpiImpl_8h.html#_CPPv4N9VhpiCbHdl9VhpiCbHdlEP16GpiImplInterface "Permalink to this definition") int `arm_callback`() _override_[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/VhpiImpl_8h.html#_CPPv4N9VhpiCbHdl12arm_callbackEv "Permalink to this definition") int `cleanup_callback`() _override_[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/VhpiImpl_8h.html#_CPPv4N9VhpiCbHdl16cleanup_callbackEv "Permalink to this definition") Protected Attributes [vhpiCbDataT](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#_CPPv411vhpiCbDataT "vhpiCbDataT") `cb_data`[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/VhpiImpl_8h.html#_CPPv4N9VhpiCbHdl7cb_dataE "Permalink to this definition") [vhpiTimeT](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#_CPPv49vhpiTimeT "vhpiTimeT") `vhpi_time`[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/VhpiImpl_8h.html#_CPPv4N9VhpiCbHdl9vhpi_timeE "Permalink to this definition") _class_ `VhpiValueCbHdl` : _public_ [VhpiCbHdl](https://docs.cocotb.org/en/v1.4.0/generated/class/classVhpiCbHdl.html#_CPPv49VhpiCbHdl "VhpiCbHdl") , _public_ [GpiValueCbHdl](https://docs.cocotb.org/en/v1.4.0/generated/class/classGpiValueCbHdl.html#_CPPv413GpiValueCbHdl "GpiValueCbHdl") Public Functions `VhpiValueCbHdl`([GpiImplInterface](https://docs.cocotb.org/en/v1.4.0/generated/class/classGpiImplInterface.html#_CPPv416GpiImplInterface "GpiImplInterface") \*_impl_, [VhpiSignalObjHdl](https://docs.cocotb.org/en/v1.4.0/generated/class/classVhpiSignalObjHdl.html#_CPPv416VhpiSignalObjHdl "VhpiSignalObjHdl") \*_sig_, int _edge_)[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/VhpiImpl_8h.html#_CPPv4N14VhpiValueCbHdl14VhpiValueCbHdlEP16GpiImplInterfaceP16VhpiSignalObjHdli "Permalink to this definition") int `cleanup_callback`() _override_[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/VhpiImpl_8h.html#_CPPv4N14VhpiValueCbHdl16cleanup_callbackEv "Permalink to this definition") Private Members [std](https://docs.cocotb.org/en/v1.4.0/generated/file/GpiCommon_8cpp.html#_CPPv4St "std") ::string `initial_value`[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/VhpiImpl_8h.html#_CPPv4N14VhpiValueCbHdl13initial_valueE "Permalink to this definition") _class_ `VhpiTimedCbHdl` : _public_ [VhpiCbHdl](https://docs.cocotb.org/en/v1.4.0/generated/class/classVhpiCbHdl.html#_CPPv49VhpiCbHdl "VhpiCbHdl") Public Functions `VhpiTimedCbHdl`([GpiImplInterface](https://docs.cocotb.org/en/v1.4.0/generated/class/classGpiImplInterface.html#_CPPv416GpiImplInterface "GpiImplInterface") \*_impl_, uint64\_t _time\_ps_)[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/VhpiImpl_8h.html#_CPPv4N14VhpiTimedCbHdl14VhpiTimedCbHdlEP16GpiImplInterface8uint64_t "Permalink to this definition") int `cleanup_callback`() _override_[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/VhpiImpl_8h.html#_CPPv4N14VhpiTimedCbHdl16cleanup_callbackEv "Permalink to this definition") _class_ `VhpiReadOnlyCbHdl` : _public_ [VhpiCbHdl](https://docs.cocotb.org/en/v1.4.0/generated/class/classVhpiCbHdl.html#_CPPv49VhpiCbHdl "VhpiCbHdl") Public Functions `VhpiReadOnlyCbHdl`([GpiImplInterface](https://docs.cocotb.org/en/v1.4.0/generated/class/classGpiImplInterface.html#_CPPv416GpiImplInterface "GpiImplInterface") \*_impl_)[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/VhpiImpl_8h.html#_CPPv4N17VhpiReadOnlyCbHdl17VhpiReadOnlyCbHdlEP16GpiImplInterface "Permalink to this definition") _class_ `VhpiNextPhaseCbHdl` : _public_ [VhpiCbHdl](https://docs.cocotb.org/en/v1.4.0/generated/class/classVhpiCbHdl.html#_CPPv49VhpiCbHdl "VhpiCbHdl") Public Functions `VhpiNextPhaseCbHdl`([GpiImplInterface](https://docs.cocotb.org/en/v1.4.0/generated/class/classGpiImplInterface.html#_CPPv416GpiImplInterface "GpiImplInterface") \*_impl_)[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/VhpiImpl_8h.html#_CPPv4N18VhpiNextPhaseCbHdl18VhpiNextPhaseCbHdlEP16GpiImplInterface "Permalink to this definition") _class_ `VhpiStartupCbHdl` : _public_ [VhpiCbHdl](https://docs.cocotb.org/en/v1.4.0/generated/class/classVhpiCbHdl.html#_CPPv49VhpiCbHdl "VhpiCbHdl") Public Functions `VhpiStartupCbHdl`([GpiImplInterface](https://docs.cocotb.org/en/v1.4.0/generated/class/classGpiImplInterface.html#_CPPv416GpiImplInterface "GpiImplInterface") \*_impl_)[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/VhpiImpl_8h.html#_CPPv4N16VhpiStartupCbHdl16VhpiStartupCbHdlEP16GpiImplInterface "Permalink to this definition") int `run_callback`() _override_[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/VhpiImpl_8h.html#_CPPv4N16VhpiStartupCbHdl12run_callbackEv "Permalink to this definition") int `cleanup_callback`() _override_[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/VhpiImpl_8h.html#_CPPv4N16VhpiStartupCbHdl16cleanup_callbackEv "Permalink to this definition") _class_ `VhpiShutdownCbHdl` : _public_ [VhpiCbHdl](https://docs.cocotb.org/en/v1.4.0/generated/class/classVhpiCbHdl.html#_CPPv49VhpiCbHdl "VhpiCbHdl") Public Functions `VhpiShutdownCbHdl`([GpiImplInterface](https://docs.cocotb.org/en/v1.4.0/generated/class/classGpiImplInterface.html#_CPPv416GpiImplInterface "GpiImplInterface") \*_impl_)[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/VhpiImpl_8h.html#_CPPv4N17VhpiShutdownCbHdl17VhpiShutdownCbHdlEP16GpiImplInterface "Permalink to this definition") int `run_callback`() _override_[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/VhpiImpl_8h.html#_CPPv4N17VhpiShutdownCbHdl12run_callbackEv "Permalink to this definition") int `cleanup_callback`() _override_[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/VhpiImpl_8h.html#_CPPv4N17VhpiShutdownCbHdl16cleanup_callbackEv "Permalink to this definition") _class_ `VhpiReadwriteCbHdl` : _public_ [VhpiCbHdl](https://docs.cocotb.org/en/v1.4.0/generated/class/classVhpiCbHdl.html#_CPPv49VhpiCbHdl "VhpiCbHdl") Public Functions `VhpiReadwriteCbHdl`([GpiImplInterface](https://docs.cocotb.org/en/v1.4.0/generated/class/classGpiImplInterface.html#_CPPv416GpiImplInterface "GpiImplInterface") \*_impl_)[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/VhpiImpl_8h.html#_CPPv4N18VhpiReadwriteCbHdl18VhpiReadwriteCbHdlEP16GpiImplInterface "Permalink to this definition") _class_ `VhpiArrayObjHdl` : _public_ [GpiObjHdl](https://docs.cocotb.org/en/v1.4.0/generated/class/classGpiObjHdl.html#_CPPv49GpiObjHdl "GpiObjHdl") Public Functions `VhpiArrayObjHdl`([GpiImplInterface](https://docs.cocotb.org/en/v1.4.0/generated/class/classGpiImplInterface.html#_CPPv416GpiImplInterface "GpiImplInterface") \*_impl_, [vhpiHandleT](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#_CPPv411vhpiHandleT "vhpiHandleT") _hdl_, [gpi\_objtype\_t](https://docs.cocotb.org/en/v1.4.0/generated/file/gpi_8h.html#_CPPv413gpi_objtype_t "gpi_objtype_t") _objtype_)[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/VhpiImpl_8h.html#_CPPv4N15VhpiArrayObjHdl15VhpiArrayObjHdlEP16GpiImplInterface11vhpiHandleT13gpi_objtype_t "Permalink to this definition") `~VhpiArrayObjHdl`() _override_[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/VhpiImpl_8h.html#_CPPv4N15VhpiArrayObjHdlD0Ev "Permalink to this definition") int `initialise`([std](https://docs.cocotb.org/en/v1.4.0/generated/file/GpiCommon_8cpp.html#_CPPv4St "std") ::string &_name_, [std](https://docs.cocotb.org/en/v1.4.0/generated/file/GpiCommon_8cpp.html#_CPPv4St "std") ::string &_fq\_name_) _override_[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/VhpiImpl_8h.html#_CPPv4N15VhpiArrayObjHdl10initialiseERNSt6stringERNSt6stringE "Permalink to this definition") _class_ `VhpiObjHdl` : _public_ [GpiObjHdl](https://docs.cocotb.org/en/v1.4.0/generated/class/classGpiObjHdl.html#_CPPv49GpiObjHdl "GpiObjHdl") Public Functions `VhpiObjHdl`([GpiImplInterface](https://docs.cocotb.org/en/v1.4.0/generated/class/classGpiImplInterface.html#_CPPv416GpiImplInterface "GpiImplInterface") \*_impl_, [vhpiHandleT](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#_CPPv411vhpiHandleT "vhpiHandleT") _hdl_, [gpi\_objtype\_t](https://docs.cocotb.org/en/v1.4.0/generated/file/gpi_8h.html#_CPPv413gpi_objtype_t "gpi_objtype_t") _objtype_)[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/VhpiImpl_8h.html#_CPPv4N10VhpiObjHdl10VhpiObjHdlEP16GpiImplInterface11vhpiHandleT13gpi_objtype_t "Permalink to this definition") `~VhpiObjHdl`() _override_[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/VhpiImpl_8h.html#_CPPv4N10VhpiObjHdlD0Ev "Permalink to this definition") int `initialise`([std](https://docs.cocotb.org/en/v1.4.0/generated/file/GpiCommon_8cpp.html#_CPPv4St "std") ::string &_name_, [std](https://docs.cocotb.org/en/v1.4.0/generated/file/GpiCommon_8cpp.html#_CPPv4St "std") ::string &_fq\_name_) _override_[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/VhpiImpl_8h.html#_CPPv4N10VhpiObjHdl10initialiseERNSt6stringERNSt6stringE "Permalink to this definition") _class_ `VhpiSignalObjHdl` : _public_ [GpiSignalObjHdl](https://docs.cocotb.org/en/v1.4.0/generated/class/classGpiSignalObjHdl.html#_CPPv415GpiSignalObjHdl "GpiSignalObjHdl") Subclassed by [VhpiLogicSignalObjHdl](https://docs.cocotb.org/en/v1.4.0/generated/file/VhpiImpl_8h.html#classVhpiLogicSignalObjHdl) Public Functions `VhpiSignalObjHdl`([GpiImplInterface](https://docs.cocotb.org/en/v1.4.0/generated/class/classGpiImplInterface.html#_CPPv416GpiImplInterface "GpiImplInterface") \*_impl_, [vhpiHandleT](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#_CPPv411vhpiHandleT "vhpiHandleT") _hdl_, [gpi\_objtype\_t](https://docs.cocotb.org/en/v1.4.0/generated/file/gpi_8h.html#_CPPv413gpi_objtype_t "gpi_objtype_t") _objtype_, bool _is\_const_)[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/VhpiImpl_8h.html#_CPPv4N16VhpiSignalObjHdl16VhpiSignalObjHdlEP16GpiImplInterface11vhpiHandleT13gpi_objtype_tb "Permalink to this definition") `~VhpiSignalObjHdl`() _override_[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/VhpiImpl_8h.html#_CPPv4N16VhpiSignalObjHdlD0Ev "Permalink to this definition") _const_ char \*`get_signal_value_binstr`() _override_[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/VhpiImpl_8h.html#_CPPv4N16VhpiSignalObjHdl23get_signal_value_binstrEv "Permalink to this definition") _const_ char \*`get_signal_value_str`() _override_[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/VhpiImpl_8h.html#_CPPv4N16VhpiSignalObjHdl20get_signal_value_strEv "Permalink to this definition") double `get_signal_value_real`() _override_[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/VhpiImpl_8h.html#_CPPv4N16VhpiSignalObjHdl21get_signal_value_realEv "Permalink to this definition") long `get_signal_value_long`() _override_[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/VhpiImpl_8h.html#_CPPv4N16VhpiSignalObjHdl21get_signal_value_longEv "Permalink to this definition") int `set_signal_value`(long _value_, [gpi\_set\_action\_t](https://docs.cocotb.org/en/v1.4.0/generated/file/gpi_8h.html#_CPPv416gpi_set_action_t "gpi_set_action_t") _action_) _override_[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/VhpiImpl_8h.html#_CPPv4N16VhpiSignalObjHdl16set_signal_valueEl16gpi_set_action_t "Permalink to this definition") int `set_signal_value`(double _value_, [gpi\_set\_action\_t](https://docs.cocotb.org/en/v1.4.0/generated/file/gpi_8h.html#_CPPv416gpi_set_action_t "gpi_set_action_t") _action_) _override_[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/VhpiImpl_8h.html#_CPPv4N16VhpiSignalObjHdl16set_signal_valueEd16gpi_set_action_t "Permalink to this definition") int `set_signal_value_str`([std](https://docs.cocotb.org/en/v1.4.0/generated/file/GpiCommon_8cpp.html#_CPPv4St "std") ::string &_value_, [gpi\_set\_action\_t](https://docs.cocotb.org/en/v1.4.0/generated/file/gpi_8h.html#_CPPv416gpi_set_action_t "gpi_set_action_t") _action_) _override_[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/VhpiImpl_8h.html#_CPPv4N16VhpiSignalObjHdl20set_signal_value_strERNSt6stringE16gpi_set_action_t "Permalink to this definition") int `set_signal_value_binstr`([std](https://docs.cocotb.org/en/v1.4.0/generated/file/GpiCommon_8cpp.html#_CPPv4St "std") ::string &_value_, [gpi\_set\_action\_t](https://docs.cocotb.org/en/v1.4.0/generated/file/gpi_8h.html#_CPPv416gpi_set_action_t "gpi_set_action_t") _action_) _override_[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/VhpiImpl_8h.html#_CPPv4N16VhpiSignalObjHdl23set_signal_value_binstrERNSt6stringE16gpi_set_action_t "Permalink to this definition") [GpiCbHdl](https://docs.cocotb.org/en/v1.4.0/generated/class/classGpiCbHdl.html#_CPPv48GpiCbHdl "GpiCbHdl") \*`value_change_cb`(int _edge_) _override_[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/VhpiImpl_8h.html#_CPPv4N16VhpiSignalObjHdl15value_change_cbEi "Permalink to this definition") int `initialise`([std](https://docs.cocotb.org/en/v1.4.0/generated/file/GpiCommon_8cpp.html#_CPPv4St "std") ::string &_name_, [std](https://docs.cocotb.org/en/v1.4.0/generated/file/GpiCommon_8cpp.html#_CPPv4St "std") ::string &_fq\_name_) _override_[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/VhpiImpl_8h.html#_CPPv4N16VhpiSignalObjHdl10initialiseERNSt6stringERNSt6stringE "Permalink to this definition") Protected Functions [vhpiEnumT](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#_CPPv49vhpiEnumT "vhpiEnumT") `chr2vhpi`(char _value_)[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/VhpiImpl_8h.html#_CPPv4N16VhpiSignalObjHdl8chr2vhpiEc "Permalink to this definition") Protected Attributes [vhpiValueT](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#_CPPv410vhpiValueT "vhpiValueT") `m_value`[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/VhpiImpl_8h.html#_CPPv4N16VhpiSignalObjHdl7m_valueE "Permalink to this definition") [vhpiValueT](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#_CPPv410vhpiValueT "vhpiValueT") `m_binvalue`[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/VhpiImpl_8h.html#_CPPv4N16VhpiSignalObjHdl10m_binvalueE "Permalink to this definition") [VhpiValueCbHdl](https://docs.cocotb.org/en/v1.4.0/generated/class/classVhpiValueCbHdl.html#_CPPv414VhpiValueCbHdl "VhpiValueCbHdl") `m_rising_cb`[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/VhpiImpl_8h.html#_CPPv4N16VhpiSignalObjHdl11m_rising_cbE "Permalink to this definition") [VhpiValueCbHdl](https://docs.cocotb.org/en/v1.4.0/generated/class/classVhpiValueCbHdl.html#_CPPv414VhpiValueCbHdl "VhpiValueCbHdl") `m_falling_cb`[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/VhpiImpl_8h.html#_CPPv4N16VhpiSignalObjHdl12m_falling_cbE "Permalink to this definition") [VhpiValueCbHdl](https://docs.cocotb.org/en/v1.4.0/generated/class/classVhpiValueCbHdl.html#_CPPv414VhpiValueCbHdl "VhpiValueCbHdl") `m_either_cb`[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/VhpiImpl_8h.html#_CPPv4N16VhpiSignalObjHdl11m_either_cbE "Permalink to this definition") _class_ `VhpiLogicSignalObjHdl` : _public_ [VhpiSignalObjHdl](https://docs.cocotb.org/en/v1.4.0/generated/class/classVhpiSignalObjHdl.html#_CPPv416VhpiSignalObjHdl "VhpiSignalObjHdl") Public Functions `VhpiLogicSignalObjHdl`([GpiImplInterface](https://docs.cocotb.org/en/v1.4.0/generated/class/classGpiImplInterface.html#_CPPv416GpiImplInterface "GpiImplInterface") \*_impl_, [vhpiHandleT](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#_CPPv411vhpiHandleT "vhpiHandleT") _hdl_, [gpi\_objtype\_t](https://docs.cocotb.org/en/v1.4.0/generated/file/gpi_8h.html#_CPPv413gpi_objtype_t "gpi_objtype_t") _objtype_, bool _is\_const_)[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/VhpiImpl_8h.html#_CPPv4N21VhpiLogicSignalObjHdl21VhpiLogicSignalObjHdlEP16GpiImplInterface11vhpiHandleT13gpi_objtype_tb "Permalink to this definition") int `set_signal_value`(long _value_, [gpi\_set\_action\_t](https://docs.cocotb.org/en/v1.4.0/generated/file/gpi_8h.html#_CPPv416gpi_set_action_t "gpi_set_action_t") _action_) _override_[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/VhpiImpl_8h.html#_CPPv4N21VhpiLogicSignalObjHdl16set_signal_valueEl16gpi_set_action_t "Permalink to this definition") int `set_signal_value_binstr`([std](https://docs.cocotb.org/en/v1.4.0/generated/file/GpiCommon_8cpp.html#_CPPv4St "std") ::string &_value_, [gpi\_set\_action\_t](https://docs.cocotb.org/en/v1.4.0/generated/file/gpi_8h.html#_CPPv416gpi_set_action_t "gpi_set_action_t") _action_) _override_[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/VhpiImpl_8h.html#_CPPv4N21VhpiLogicSignalObjHdl23set_signal_value_binstrERNSt6stringE16gpi_set_action_t "Permalink to this definition") int `initialise`([std](https://docs.cocotb.org/en/v1.4.0/generated/file/GpiCommon_8cpp.html#_CPPv4St "std") ::string &_name_, [std](https://docs.cocotb.org/en/v1.4.0/generated/file/GpiCommon_8cpp.html#_CPPv4St "std") ::string &_fq\_name_) _override_[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/VhpiImpl_8h.html#_CPPv4N21VhpiLogicSignalObjHdl10initialiseERNSt6stringERNSt6stringE "Permalink to this definition") _class_ `VhpiIterator` : _public_ [GpiIterator](https://docs.cocotb.org/en/v1.4.0/generated/class/classGpiIterator.html#_CPPv411GpiIterator "GpiIterator") Public Functions `VhpiIterator`([GpiImplInterface](https://docs.cocotb.org/en/v1.4.0/generated/class/classGpiImplInterface.html#_CPPv416GpiImplInterface "GpiImplInterface") \*_impl_, [GpiObjHdl](https://docs.cocotb.org/en/v1.4.0/generated/class/classGpiObjHdl.html#_CPPv49GpiObjHdl "GpiObjHdl") \*_hdl_)[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/VhpiImpl_8h.html#_CPPv4N12VhpiIterator12VhpiIteratorEP16GpiImplInterfaceP9GpiObjHdl "Permalink to this definition") `~VhpiIterator`() _override_[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/VhpiImpl_8h.html#_CPPv4N12VhpiIteratorD0Ev "Permalink to this definition") Status `next_handle`([std](https://docs.cocotb.org/en/v1.4.0/generated/file/GpiCommon_8cpp.html#_CPPv4St "std") ::string &_name_, [GpiObjHdl](https://docs.cocotb.org/en/v1.4.0/generated/class/classGpiObjHdl.html#_CPPv49GpiObjHdl "GpiObjHdl") \*\*_hdl_, void \*\*_raw\_hdl_) _override_[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/VhpiImpl_8h.html#_CPPv4N12VhpiIterator11next_handleERNSt6stringEPP9GpiObjHdlPPv "Permalink to this definition") Private Members [vhpiHandleT](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#_CPPv411vhpiHandleT "vhpiHandleT") `m_iterator`[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/VhpiImpl_8h.html#_CPPv4N12VhpiIterator10m_iteratorE "Permalink to this definition") [vhpiHandleT](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#_CPPv411vhpiHandleT "vhpiHandleT") `m_iter_obj`[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/VhpiImpl_8h.html#_CPPv4N12VhpiIterator10m_iter_objE "Permalink to this definition") [std](https://docs.cocotb.org/en/v1.4.0/generated/file/GpiCommon_8cpp.html#_CPPv4St "std") ::vector<[vhpiOneToManyT](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#_CPPv414vhpiOneToManyT "vhpiOneToManyT") \> \*`selected`[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/VhpiImpl_8h.html#_CPPv4N12VhpiIterator8selectedE "Permalink to this definition") [std](https://docs.cocotb.org/en/v1.4.0/generated/file/GpiCommon_8cpp.html#_CPPv4St "std") ::vector<[vhpiOneToManyT](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#_CPPv414vhpiOneToManyT "vhpiOneToManyT") \>::iterator `one2many`[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/VhpiImpl_8h.html#_CPPv4N12VhpiIterator8one2manyE "Permalink to this definition") Private Static Attributes [GpiIteratorMapping](https://docs.cocotb.org/en/v1.4.0/generated/class/classGpiIteratorMapping.html#_CPPv4I00E18GpiIteratorMapping "GpiIteratorMapping") <[vhpiClassKindT](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#_CPPv414vhpiClassKindT "vhpiClassKindT") , [vhpiOneToManyT](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#_CPPv414vhpiOneToManyT "vhpiOneToManyT") \> `iterate_over`[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/VhpiImpl_8h.html#_CPPv4N12VhpiIterator12iterate_overE "Permalink to this definition") _class_ `VhpiImpl` : _public_ [GpiImplInterface](https://docs.cocotb.org/en/v1.4.0/generated/class/classGpiImplInterface.html#_CPPv416GpiImplInterface "GpiImplInterface") Public Functions `VhpiImpl`(_const_ [std](https://docs.cocotb.org/en/v1.4.0/generated/file/GpiCommon_8cpp.html#_CPPv4St "std") ::string &_name_)[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/VhpiImpl_8h.html#_CPPv4N8VhpiImpl8VhpiImplERKNSt6stringE "Permalink to this definition") void `sim_end`() _override_[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/VhpiImpl_8h.html#_CPPv4N8VhpiImpl7sim_endEv "Permalink to this definition") void `get_sim_time`(uint32\_t \*_high_, uint32\_t \*_low_) _override_[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/VhpiImpl_8h.html#_CPPv4N8VhpiImpl12get_sim_timeEP8uint32_tP8uint32_t "Permalink to this definition") void `get_sim_precision`(int32\_t \*_precision_) _override_[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/VhpiImpl_8h.html#_CPPv4N8VhpiImpl17get_sim_precisionEP7int32_t "Permalink to this definition") _const_ char \*`get_simulator_product`() _override_[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/VhpiImpl_8h.html#_CPPv4N8VhpiImpl21get_simulator_productEv "Permalink to this definition") _const_ char \*`get_simulator_version`() _override_[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/VhpiImpl_8h.html#_CPPv4N8VhpiImpl21get_simulator_versionEv "Permalink to this definition") [GpiObjHdl](https://docs.cocotb.org/en/v1.4.0/generated/class/classGpiObjHdl.html#_CPPv49GpiObjHdl "GpiObjHdl") \*`get_root_handle`(_const_ char \*_name_) _override_[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/VhpiImpl_8h.html#_CPPv4N8VhpiImpl15get_root_handleEPKc "Permalink to this definition") [GpiIterator](https://docs.cocotb.org/en/v1.4.0/generated/class/classGpiIterator.html#_CPPv411GpiIterator "GpiIterator") \*`iterate_handle`([GpiObjHdl](https://docs.cocotb.org/en/v1.4.0/generated/class/classGpiObjHdl.html#_CPPv49GpiObjHdl "GpiObjHdl") \*_obj\_hdl_, [gpi\_iterator\_sel\_t](https://docs.cocotb.org/en/v1.4.0/generated/file/gpi_8h.html#_CPPv418gpi_iterator_sel_t "gpi_iterator_sel_t") _type_) _override_[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/VhpiImpl_8h.html#_CPPv4N8VhpiImpl14iterate_handleEP9GpiObjHdl18gpi_iterator_sel_t "Permalink to this definition") [GpiCbHdl](https://docs.cocotb.org/en/v1.4.0/generated/class/classGpiCbHdl.html#_CPPv48GpiCbHdl "GpiCbHdl") \*`register_timed_callback`(uint64\_t _time\_ps_) _override_[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/VhpiImpl_8h.html#_CPPv4N8VhpiImpl23register_timed_callbackE8uint64_t "Permalink to this definition") [GpiCbHdl](https://docs.cocotb.org/en/v1.4.0/generated/class/classGpiCbHdl.html#_CPPv48GpiCbHdl "GpiCbHdl") \*`register_readonly_callback`() _override_[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/VhpiImpl_8h.html#_CPPv4N8VhpiImpl26register_readonly_callbackEv "Permalink to this definition") [GpiCbHdl](https://docs.cocotb.org/en/v1.4.0/generated/class/classGpiCbHdl.html#_CPPv48GpiCbHdl "GpiCbHdl") \*`register_nexttime_callback`() _override_[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/VhpiImpl_8h.html#_CPPv4N8VhpiImpl26register_nexttime_callbackEv "Permalink to this definition") [GpiCbHdl](https://docs.cocotb.org/en/v1.4.0/generated/class/classGpiCbHdl.html#_CPPv48GpiCbHdl "GpiCbHdl") \*`register_readwrite_callback`() _override_[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/VhpiImpl_8h.html#_CPPv4N8VhpiImpl27register_readwrite_callbackEv "Permalink to this definition") int `deregister_callback`([GpiCbHdl](https://docs.cocotb.org/en/v1.4.0/generated/class/classGpiCbHdl.html#_CPPv48GpiCbHdl "GpiCbHdl") \*_obj\_hdl_) _override_[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/VhpiImpl_8h.html#_CPPv4N8VhpiImpl19deregister_callbackEP8GpiCbHdl "Permalink to this definition") [GpiObjHdl](https://docs.cocotb.org/en/v1.4.0/generated/class/classGpiObjHdl.html#_CPPv49GpiObjHdl "GpiObjHdl") \*`native_check_create`([std](https://docs.cocotb.org/en/v1.4.0/generated/file/GpiCommon_8cpp.html#_CPPv4St "std") ::string &_name_, [GpiObjHdl](https://docs.cocotb.org/en/v1.4.0/generated/class/classGpiObjHdl.html#_CPPv49GpiObjHdl "GpiObjHdl") \*_parent_) _override_[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/VhpiImpl_8h.html#_CPPv4N8VhpiImpl19native_check_createERNSt6stringEP9GpiObjHdl "Permalink to this definition") [GpiObjHdl](https://docs.cocotb.org/en/v1.4.0/generated/class/classGpiObjHdl.html#_CPPv49GpiObjHdl "GpiObjHdl") \*`native_check_create`(int32\_t _index_, [GpiObjHdl](https://docs.cocotb.org/en/v1.4.0/generated/class/classGpiObjHdl.html#_CPPv49GpiObjHdl "GpiObjHdl") \*_parent_) _override_[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/VhpiImpl_8h.html#_CPPv4N8VhpiImpl19native_check_createE7int32_tP9GpiObjHdl "Permalink to this definition") [GpiObjHdl](https://docs.cocotb.org/en/v1.4.0/generated/class/classGpiObjHdl.html#_CPPv49GpiObjHdl "GpiObjHdl") \*`native_check_create`(void \*_raw\_hdl_, [GpiObjHdl](https://docs.cocotb.org/en/v1.4.0/generated/class/classGpiObjHdl.html#_CPPv49GpiObjHdl "GpiObjHdl") \*_parent_) _override_[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/VhpiImpl_8h.html#_CPPv4N8VhpiImpl19native_check_createEPvP9GpiObjHdl "Permalink to this definition") _const_ char \*`reason_to_string`(int _reason_) _override_[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/VhpiImpl_8h.html#_CPPv4N8VhpiImpl16reason_to_stringEi "Permalink to this definition") _const_ char \*`format_to_string`(int _format_)[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/VhpiImpl_8h.html#_CPPv4N8VhpiImpl16format_to_stringEi "Permalink to this definition") [GpiObjHdl](https://docs.cocotb.org/en/v1.4.0/generated/class/classGpiObjHdl.html#_CPPv49GpiObjHdl "GpiObjHdl") \*`create_gpi_obj_from_handle`([vhpiHandleT](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#_CPPv411vhpiHandleT "vhpiHandleT") _new\_hdl_, [std](https://docs.cocotb.org/en/v1.4.0/generated/file/GpiCommon_8cpp.html#_CPPv4St "std") ::string &_name_, [std](https://docs.cocotb.org/en/v1.4.0/generated/file/GpiCommon_8cpp.html#_CPPv4St "std") ::string &_fq\_name_)[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/VhpiImpl_8h.html#_CPPv4N8VhpiImpl26create_gpi_obj_from_handleE11vhpiHandleTRNSt6stringERNSt6stringE "Permalink to this definition") Private Members [VhpiReadwriteCbHdl](https://docs.cocotb.org/en/v1.4.0/generated/class/classVhpiReadwriteCbHdl.html#_CPPv418VhpiReadwriteCbHdl "VhpiReadwriteCbHdl") `m_read_write`[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/VhpiImpl_8h.html#_CPPv4N8VhpiImpl12m_read_writeE "Permalink to this definition") [VhpiNextPhaseCbHdl](https://docs.cocotb.org/en/v1.4.0/generated/class/classVhpiNextPhaseCbHdl.html#_CPPv418VhpiNextPhaseCbHdl "VhpiNextPhaseCbHdl") `m_next_phase`[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/VhpiImpl_8h.html#_CPPv4N8VhpiImpl12m_next_phaseE "Permalink to this definition") [VhpiReadOnlyCbHdl](https://docs.cocotb.org/en/v1.4.0/generated/class/classVhpiReadOnlyCbHdl.html#_CPPv417VhpiReadOnlyCbHdl "VhpiReadOnlyCbHdl") `m_read_only`[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/VhpiImpl_8h.html#_CPPv4N8VhpiImpl11m_read_onlyE "Permalink to this definition") --- # File VpiCbHdl.cpp — cocotb 1.4.0 documentation * [](https://docs.cocotb.org/en/v1.4.0/index.html) » * [C Code Library Reference](https://docs.cocotb.org/en/v1.4.0/library_reference_c.html) » * [File list](https://docs.cocotb.org/en/v1.4.0/generated/filelist.html) » * File VpiCbHdl.cpp * [Edit on GitHub](https://github.com/cocotb/cocotb/blob/v1.4.0/documentation/source/generated/file/VpiCbHdl_8cpp.rst) * * * File VpiCbHdl.cpp[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/VpiCbHdl_8cpp.html#file-vpicbhdl-cpp "Permalink to this headline") ========================================================================================================================================= Defines `VPI_TYPE_MAX` (1000)[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/VpiCbHdl_8cpp.html#c.VPI_TYPE_MAX "Permalink to this definition") Functions int32\_t `handle_vpi_callback`([p\_cb\_data](https://docs.cocotb.org/en/v1.4.0/generated/file/vpi__user_8h.html#_CPPv49p_cb_data "p_cb_data") _cb\_data_)[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/VpiCbHdl_8cpp.html#_CPPv419handle_vpi_callback9p_cb_data "Permalink to this definition") void `vpi_mappings`([GpiIteratorMapping](https://docs.cocotb.org/en/v1.4.0/generated/class/classGpiIteratorMapping.html#_CPPv4I00E18GpiIteratorMapping "GpiIteratorMapping") &_map_)[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/VpiCbHdl_8cpp.html#_CPPv412vpi_mappingsR18GpiIteratorMappingI7int32_t7int32_tE "Permalink to this definition") --- # File VpiImpl.cpp — cocotb 1.4.0 documentation * [](https://docs.cocotb.org/en/v1.4.0/index.html) » * [C Code Library Reference](https://docs.cocotb.org/en/v1.4.0/library_reference_c.html) » * [File list](https://docs.cocotb.org/en/v1.4.0/generated/filelist.html) » * File VpiImpl.cpp * [Edit on GitHub](https://github.com/cocotb/cocotb/blob/v1.4.0/documentation/source/generated/file/VpiImpl_8cpp.rst) * * * File VpiImpl.cpp[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/VpiImpl_8cpp.html#file-vpiimpl-cpp "Permalink to this headline") ====================================================================================================================================== Defines `CASE_STR`(_\_X_) case \_X: return #\_X Functions [gpi\_objtype\_t](https://docs.cocotb.org/en/v1.4.0/generated/file/gpi_8h.html#_CPPv413gpi_objtype_t "gpi_objtype_t") `to_gpi_objtype`(int32\_t _vpitype_)[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/VpiImpl_8cpp.html#_CPPv414to_gpi_objtype7int32_t "Permalink to this definition") int32\_t `handle_vpi_callback`([p\_cb\_data](https://docs.cocotb.org/en/v1.4.0/generated/file/vpi__user_8h.html#_CPPv49p_cb_data "p_cb_data") _cb\_data_) void `register_embed`() void `register_initial_callback`() void `register_final_callback`() int `system_function_compiletf`(char \*_userdata_)[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/VpiImpl_8cpp.html#_CPPv425system_function_compiletfPc "Permalink to this definition") int `system_function_overload`(char \*_userdata_)[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/VpiImpl_8cpp.html#_CPPv424system_function_overloadPc "Permalink to this definition") void `register_system_functions`()[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/VpiImpl_8cpp.html#_CPPv425register_system_functionsv "Permalink to this definition") void `vlog_startup_routines_bootstrap`()[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/VpiImpl_8cpp.html#_CPPv431vlog_startup_routines_bootstrapv "Permalink to this definition") Variables [VpiCbHdl](https://docs.cocotb.org/en/v1.4.0/generated/class/classVpiCbHdl.html#_CPPv48VpiCbHdl "VpiCbHdl") \*`sim_init_cb` [VpiCbHdl](https://docs.cocotb.org/en/v1.4.0/generated/class/classVpiCbHdl.html#_CPPv48VpiCbHdl "VpiCbHdl") \*`sim_finish_cb` [VpiImpl](https://docs.cocotb.org/en/v1.4.0/generated/class/classVpiImpl.html#_CPPv47VpiImpl "VpiImpl") \*`vpi_table`[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/VpiImpl_8cpp.html#_CPPv49vpi_table "Permalink to this definition") int `systf_info_level` = [GPIInfo](https://docs.cocotb.org/en/v1.4.0/generated/file/gpi__logging_8h.html#_CPPv4N14gpi_log_levels7GPIInfoE "GPIInfo") [¶](https://docs.cocotb.org/en/v1.4.0/generated/file/VpiImpl_8cpp.html#_CPPv416systf_info_level "Permalink to this definition") int `systf_warning_level` = [GPIWarning](https://docs.cocotb.org/en/v1.4.0/generated/file/gpi__logging_8h.html#_CPPv4N14gpi_log_levels10GPIWarningE "GPIWarning") [¶](https://docs.cocotb.org/en/v1.4.0/generated/file/VpiImpl_8cpp.html#_CPPv419systf_warning_level "Permalink to this definition") int `systf_error_level` = [GPIError](https://docs.cocotb.org/en/v1.4.0/generated/file/gpi__logging_8h.html#_CPPv4N14gpi_log_levels8GPIErrorE "GPIError") [¶](https://docs.cocotb.org/en/v1.4.0/generated/file/VpiImpl_8cpp.html#_CPPv417systf_error_level "Permalink to this definition") int `systf_fatal_level` = [GPICritical](https://docs.cocotb.org/en/v1.4.0/generated/file/gpi__logging_8h.html#_CPPv4N14gpi_log_levels11GPICriticalE "GPICritical") [¶](https://docs.cocotb.org/en/v1.4.0/generated/file/VpiImpl_8cpp.html#_CPPv417systf_fatal_level "Permalink to this definition") void (\*`vlog_startup_routines`\[\])() = {[register\_embed](https://docs.cocotb.org/en/v1.4.0/generated/file/FliImpl_8cpp.html#_CPPv414register_embedv "register_embed") , [gpi\_load\_extra\_libs](https://docs.cocotb.org/en/v1.4.0/generated/file/GpiCommon_8cpp.html#_CPPv419gpi_load_extra_libsv "gpi_load_extra_libs") , [register\_system\_functions](https://docs.cocotb.org/en/v1.4.0/generated/file/VpiImpl_8cpp.html#_CPPv425register_system_functionsv "register_system_functions") , [register\_initial\_callback](https://docs.cocotb.org/en/v1.4.0/generated/file/FliImpl_8cpp.html#_CPPv425register_initial_callbackv "register_initial_callback") , [register\_final\_callback](https://docs.cocotb.org/en/v1.4.0/generated/file/FliImpl_8cpp.html#_CPPv423register_final_callbackv "register_final_callback") , nullptr}[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/VpiImpl_8cpp.html#_CPPv421vlog_startup_routines "Permalink to this definition") --- # File cocotb_utils.cpp — cocotb 1.4.0 documentation * [](https://docs.cocotb.org/en/v1.4.0/index.html) » * [C Code Library Reference](https://docs.cocotb.org/en/v1.4.0/library_reference_c.html) » * [File list](https://docs.cocotb.org/en/v1.4.0/generated/filelist.html) » * File cocotb\_utils.cpp * [Edit on GitHub](https://github.com/cocotb/cocotb/blob/v1.4.0/documentation/source/generated/file/cocotb__utils_8cpp.rst) * * * File cocotb\_utils.cpp[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/cocotb__utils_8cpp.html#file-cocotb-utils-cpp "Permalink to this headline") ======================================================================================================================================================= Functions void \*`utils_dyn_open`(_const_ char \*_lib\_name_)[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/cocotb__utils_8cpp.html#_CPPv414utils_dyn_openPKc "Permalink to this definition") void \*`utils_dyn_sym`(void \*_handle_, _const_ char \*_sym\_name_)[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/cocotb__utils_8cpp.html#_CPPv413utils_dyn_symPvPKc "Permalink to this definition") Variables int `is_python_context` = 0[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/cocotb__utils_8cpp.html#_CPPv417is_python_context "Permalink to this definition") --- # File VpiImpl.h — cocotb 1.4.0 documentation * [](https://docs.cocotb.org/en/v1.4.0/index.html) » * [C Code Library Reference](https://docs.cocotb.org/en/v1.4.0/library_reference_c.html) » * [File list](https://docs.cocotb.org/en/v1.4.0/generated/filelist.html) » * File VpiImpl.h * [Edit on GitHub](https://github.com/cocotb/cocotb/blob/v1.4.0/documentation/source/generated/file/VpiImpl_8h.rst) * * * File VpiImpl.h[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/VpiImpl_8h.html#file-vpiimpl-h "Permalink to this headline") ================================================================================================================================ Defines `check_vpi_error`() do { \\ \_\_check\_vpi\_error(\_\_FILE\_\_, \_\_func\_\_, \_\_LINE\_\_); \\ } while (0) [¶](https://docs.cocotb.org/en/v1.4.0/generated/file/VpiImpl_8h.html#c.check_vpi_error "Permalink to this definition") Functions int `__check_vpi_error`(_const_ char \*_file_, _const_ char \*_func_, long _line_)[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/VpiImpl_8h.html#_CPPv417__check_vpi_errorPKcPKcl "Permalink to this definition") _class_ `VpiCbHdl` : _public_ _virtual_ [GpiCbHdl](https://docs.cocotb.org/en/v1.4.0/generated/class/classGpiCbHdl.html#_CPPv48GpiCbHdl "GpiCbHdl") Subclassed by [VpiNextPhaseCbHdl](https://docs.cocotb.org/en/v1.4.0/generated/file/VpiImpl_8h.html#classVpiNextPhaseCbHdl) , [VpiReadOnlyCbHdl](https://docs.cocotb.org/en/v1.4.0/generated/file/VpiImpl_8h.html#classVpiReadOnlyCbHdl) , [VpiReadwriteCbHdl](https://docs.cocotb.org/en/v1.4.0/generated/file/VpiImpl_8h.html#classVpiReadwriteCbHdl) , [VpiShutdownCbHdl](https://docs.cocotb.org/en/v1.4.0/generated/file/VpiImpl_8h.html#classVpiShutdownCbHdl) , [VpiStartupCbHdl](https://docs.cocotb.org/en/v1.4.0/generated/file/VpiImpl_8h.html#classVpiStartupCbHdl) , [VpiTimedCbHdl](https://docs.cocotb.org/en/v1.4.0/generated/file/VpiImpl_8h.html#classVpiTimedCbHdl) , [VpiValueCbHdl](https://docs.cocotb.org/en/v1.4.0/generated/file/VpiImpl_8h.html#classVpiValueCbHdl) Public Functions `VpiCbHdl`([GpiImplInterface](https://docs.cocotb.org/en/v1.4.0/generated/class/classGpiImplInterface.html#_CPPv416GpiImplInterface "GpiImplInterface") \*_impl_)[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/VpiImpl_8h.html#_CPPv4N8VpiCbHdl8VpiCbHdlEP16GpiImplInterface "Permalink to this definition") int `arm_callback`() _override_[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/VpiImpl_8h.html#_CPPv4N8VpiCbHdl12arm_callbackEv "Permalink to this definition") int `cleanup_callback`() _override_[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/VpiImpl_8h.html#_CPPv4N8VpiCbHdl16cleanup_callbackEv "Permalink to this definition") Protected Attributes [s\_cb\_data](https://docs.cocotb.org/en/v1.4.0/generated/file/vpi__user_8h.html#_CPPv49s_cb_data "s_cb_data") `cb_data`[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/VpiImpl_8h.html#_CPPv4N8VpiCbHdl7cb_dataE "Permalink to this definition") [s\_vpi\_time](https://docs.cocotb.org/en/v1.4.0/generated/file/vpi__user_8h.html#_CPPv410s_vpi_time "s_vpi_time") `vpi_time`[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/VpiImpl_8h.html#_CPPv4N8VpiCbHdl8vpi_timeE "Permalink to this definition") _class_ `VpiValueCbHdl` : _public_ [VpiCbHdl](https://docs.cocotb.org/en/v1.4.0/generated/class/classVpiCbHdl.html#_CPPv48VpiCbHdl "VpiCbHdl") , _public_ [GpiValueCbHdl](https://docs.cocotb.org/en/v1.4.0/generated/class/classGpiValueCbHdl.html#_CPPv413GpiValueCbHdl "GpiValueCbHdl") Public Functions `VpiValueCbHdl`([GpiImplInterface](https://docs.cocotb.org/en/v1.4.0/generated/class/classGpiImplInterface.html#_CPPv416GpiImplInterface "GpiImplInterface") \*_impl_, [VpiSignalObjHdl](https://docs.cocotb.org/en/v1.4.0/generated/class/classVpiSignalObjHdl.html#_CPPv415VpiSignalObjHdl "VpiSignalObjHdl") \*_sig_, int _edge_)[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/VpiImpl_8h.html#_CPPv4N13VpiValueCbHdl13VpiValueCbHdlEP16GpiImplInterfaceP15VpiSignalObjHdli "Permalink to this definition") int `cleanup_callback`() _override_[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/VpiImpl_8h.html#_CPPv4N13VpiValueCbHdl16cleanup_callbackEv "Permalink to this definition") Private Members [s\_vpi\_value](https://docs.cocotb.org/en/v1.4.0/generated/file/vpi__user_8h.html#_CPPv411s_vpi_value "s_vpi_value") `m_vpi_value`[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/VpiImpl_8h.html#_CPPv4N13VpiValueCbHdl11m_vpi_valueE "Permalink to this definition") _class_ `VpiTimedCbHdl` : _public_ [VpiCbHdl](https://docs.cocotb.org/en/v1.4.0/generated/class/classVpiCbHdl.html#_CPPv48VpiCbHdl "VpiCbHdl") Public Functions `VpiTimedCbHdl`([GpiImplInterface](https://docs.cocotb.org/en/v1.4.0/generated/class/classGpiImplInterface.html#_CPPv416GpiImplInterface "GpiImplInterface") \*_impl_, uint64\_t _time\_ps_)[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/VpiImpl_8h.html#_CPPv4N13VpiTimedCbHdl13VpiTimedCbHdlEP16GpiImplInterface8uint64_t "Permalink to this definition") int `cleanup_callback`() _override_[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/VpiImpl_8h.html#_CPPv4N13VpiTimedCbHdl16cleanup_callbackEv "Permalink to this definition") _class_ `VpiReadOnlyCbHdl` : _public_ [VpiCbHdl](https://docs.cocotb.org/en/v1.4.0/generated/class/classVpiCbHdl.html#_CPPv48VpiCbHdl "VpiCbHdl") Public Functions `VpiReadOnlyCbHdl`([GpiImplInterface](https://docs.cocotb.org/en/v1.4.0/generated/class/classGpiImplInterface.html#_CPPv416GpiImplInterface "GpiImplInterface") \*_impl_)[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/VpiImpl_8h.html#_CPPv4N16VpiReadOnlyCbHdl16VpiReadOnlyCbHdlEP16GpiImplInterface "Permalink to this definition") _class_ `VpiNextPhaseCbHdl` : _public_ [VpiCbHdl](https://docs.cocotb.org/en/v1.4.0/generated/class/classVpiCbHdl.html#_CPPv48VpiCbHdl "VpiCbHdl") Public Functions `VpiNextPhaseCbHdl`([GpiImplInterface](https://docs.cocotb.org/en/v1.4.0/generated/class/classGpiImplInterface.html#_CPPv416GpiImplInterface "GpiImplInterface") \*_impl_)[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/VpiImpl_8h.html#_CPPv4N17VpiNextPhaseCbHdl17VpiNextPhaseCbHdlEP16GpiImplInterface "Permalink to this definition") _class_ `VpiReadwriteCbHdl` : _public_ [VpiCbHdl](https://docs.cocotb.org/en/v1.4.0/generated/class/classVpiCbHdl.html#_CPPv48VpiCbHdl "VpiCbHdl") Public Functions `VpiReadwriteCbHdl`([GpiImplInterface](https://docs.cocotb.org/en/v1.4.0/generated/class/classGpiImplInterface.html#_CPPv416GpiImplInterface "GpiImplInterface") \*_impl_)[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/VpiImpl_8h.html#_CPPv4N17VpiReadwriteCbHdl17VpiReadwriteCbHdlEP16GpiImplInterface "Permalink to this definition") _class_ `VpiStartupCbHdl` : _public_ [VpiCbHdl](https://docs.cocotb.org/en/v1.4.0/generated/class/classVpiCbHdl.html#_CPPv48VpiCbHdl "VpiCbHdl") Public Functions `VpiStartupCbHdl`([GpiImplInterface](https://docs.cocotb.org/en/v1.4.0/generated/class/classGpiImplInterface.html#_CPPv416GpiImplInterface "GpiImplInterface") \*_impl_)[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/VpiImpl_8h.html#_CPPv4N15VpiStartupCbHdl15VpiStartupCbHdlEP16GpiImplInterface "Permalink to this definition") int `run_callback`() _override_[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/VpiImpl_8h.html#_CPPv4N15VpiStartupCbHdl12run_callbackEv "Permalink to this definition") int `cleanup_callback`() _override_[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/VpiImpl_8h.html#_CPPv4N15VpiStartupCbHdl16cleanup_callbackEv "Permalink to this definition") _class_ `VpiShutdownCbHdl` : _public_ [VpiCbHdl](https://docs.cocotb.org/en/v1.4.0/generated/class/classVpiCbHdl.html#_CPPv48VpiCbHdl "VpiCbHdl") Public Functions `VpiShutdownCbHdl`([GpiImplInterface](https://docs.cocotb.org/en/v1.4.0/generated/class/classGpiImplInterface.html#_CPPv416GpiImplInterface "GpiImplInterface") \*_impl_)[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/VpiImpl_8h.html#_CPPv4N16VpiShutdownCbHdl16VpiShutdownCbHdlEP16GpiImplInterface "Permalink to this definition") int `run_callback`() _override_[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/VpiImpl_8h.html#_CPPv4N16VpiShutdownCbHdl12run_callbackEv "Permalink to this definition") int `cleanup_callback`() _override_[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/VpiImpl_8h.html#_CPPv4N16VpiShutdownCbHdl16cleanup_callbackEv "Permalink to this definition") _class_ `VpiArrayObjHdl` : _public_ [GpiObjHdl](https://docs.cocotb.org/en/v1.4.0/generated/class/classGpiObjHdl.html#_CPPv49GpiObjHdl "GpiObjHdl") Public Functions `VpiArrayObjHdl`([GpiImplInterface](https://docs.cocotb.org/en/v1.4.0/generated/class/classGpiImplInterface.html#_CPPv416GpiImplInterface "GpiImplInterface") \*_impl_, [vpiHandle](https://docs.cocotb.org/en/v1.4.0/generated/file/vpi__user_8h.html#_CPPv49vpiHandle "vpiHandle") _hdl_, [gpi\_objtype\_t](https://docs.cocotb.org/en/v1.4.0/generated/file/gpi_8h.html#_CPPv413gpi_objtype_t "gpi_objtype_t") _objtype_)[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/VpiImpl_8h.html#_CPPv4N14VpiArrayObjHdl14VpiArrayObjHdlEP16GpiImplInterface9vpiHandle13gpi_objtype_t "Permalink to this definition") int `initialise`([std](https://docs.cocotb.org/en/v1.4.0/generated/file/GpiCommon_8cpp.html#_CPPv4St "std") ::string &_name_, [std](https://docs.cocotb.org/en/v1.4.0/generated/file/GpiCommon_8cpp.html#_CPPv4St "std") ::string &_fq\_name_) _override_[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/VpiImpl_8h.html#_CPPv4N14VpiArrayObjHdl10initialiseERNSt6stringERNSt6stringE "Permalink to this definition") _class_ `VpiObjHdl` : _public_ [GpiObjHdl](https://docs.cocotb.org/en/v1.4.0/generated/class/classGpiObjHdl.html#_CPPv49GpiObjHdl "GpiObjHdl") Public Functions `VpiObjHdl`([GpiImplInterface](https://docs.cocotb.org/en/v1.4.0/generated/class/classGpiImplInterface.html#_CPPv416GpiImplInterface "GpiImplInterface") \*_impl_, [vpiHandle](https://docs.cocotb.org/en/v1.4.0/generated/file/vpi__user_8h.html#_CPPv49vpiHandle "vpiHandle") _hdl_, [gpi\_objtype\_t](https://docs.cocotb.org/en/v1.4.0/generated/file/gpi_8h.html#_CPPv413gpi_objtype_t "gpi_objtype_t") _objtype_)[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/VpiImpl_8h.html#_CPPv4N9VpiObjHdl9VpiObjHdlEP16GpiImplInterface9vpiHandle13gpi_objtype_t "Permalink to this definition") int `initialise`([std](https://docs.cocotb.org/en/v1.4.0/generated/file/GpiCommon_8cpp.html#_CPPv4St "std") ::string &_name_, [std](https://docs.cocotb.org/en/v1.4.0/generated/file/GpiCommon_8cpp.html#_CPPv4St "std") ::string &_fq\_name_) _override_[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/VpiImpl_8h.html#_CPPv4N9VpiObjHdl10initialiseERNSt6stringERNSt6stringE "Permalink to this definition") _class_ `VpiSignalObjHdl` : _public_ [GpiSignalObjHdl](https://docs.cocotb.org/en/v1.4.0/generated/class/classGpiSignalObjHdl.html#_CPPv415GpiSignalObjHdl "GpiSignalObjHdl") Public Functions `VpiSignalObjHdl`([GpiImplInterface](https://docs.cocotb.org/en/v1.4.0/generated/class/classGpiImplInterface.html#_CPPv416GpiImplInterface "GpiImplInterface") \*_impl_, [vpiHandle](https://docs.cocotb.org/en/v1.4.0/generated/file/vpi__user_8h.html#_CPPv49vpiHandle "vpiHandle") _hdl_, [gpi\_objtype\_t](https://docs.cocotb.org/en/v1.4.0/generated/file/gpi_8h.html#_CPPv413gpi_objtype_t "gpi_objtype_t") _objtype_, bool _is\_const_)[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/VpiImpl_8h.html#_CPPv4N15VpiSignalObjHdl15VpiSignalObjHdlEP16GpiImplInterface9vpiHandle13gpi_objtype_tb "Permalink to this definition") _const_ char \*`get_signal_value_binstr`() _override_[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/VpiImpl_8h.html#_CPPv4N15VpiSignalObjHdl23get_signal_value_binstrEv "Permalink to this definition") _const_ char \*`get_signal_value_str`() _override_[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/VpiImpl_8h.html#_CPPv4N15VpiSignalObjHdl20get_signal_value_strEv "Permalink to this definition") double `get_signal_value_real`() _override_[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/VpiImpl_8h.html#_CPPv4N15VpiSignalObjHdl21get_signal_value_realEv "Permalink to this definition") long `get_signal_value_long`() _override_[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/VpiImpl_8h.html#_CPPv4N15VpiSignalObjHdl21get_signal_value_longEv "Permalink to this definition") int `set_signal_value`(_const_ long _value_, [gpi\_set\_action\_t](https://docs.cocotb.org/en/v1.4.0/generated/file/gpi_8h.html#_CPPv416gpi_set_action_t "gpi_set_action_t") _action_) _override_[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/VpiImpl_8h.html#_CPPv4N15VpiSignalObjHdl16set_signal_valueEKl16gpi_set_action_t "Permalink to this definition") int `set_signal_value`(_const_ double _value_, [gpi\_set\_action\_t](https://docs.cocotb.org/en/v1.4.0/generated/file/gpi_8h.html#_CPPv416gpi_set_action_t "gpi_set_action_t") _action_) _override_[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/VpiImpl_8h.html#_CPPv4N15VpiSignalObjHdl16set_signal_valueEKd16gpi_set_action_t "Permalink to this definition") int `set_signal_value_binstr`([std](https://docs.cocotb.org/en/v1.4.0/generated/file/GpiCommon_8cpp.html#_CPPv4St "std") ::string &_value_, [gpi\_set\_action\_t](https://docs.cocotb.org/en/v1.4.0/generated/file/gpi_8h.html#_CPPv416gpi_set_action_t "gpi_set_action_t") _action_) _override_[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/VpiImpl_8h.html#_CPPv4N15VpiSignalObjHdl23set_signal_value_binstrERNSt6stringE16gpi_set_action_t "Permalink to this definition") int `set_signal_value_str`([std](https://docs.cocotb.org/en/v1.4.0/generated/file/GpiCommon_8cpp.html#_CPPv4St "std") ::string &_value_, [gpi\_set\_action\_t](https://docs.cocotb.org/en/v1.4.0/generated/file/gpi_8h.html#_CPPv416gpi_set_action_t "gpi_set_action_t") _action_) _override_[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/VpiImpl_8h.html#_CPPv4N15VpiSignalObjHdl20set_signal_value_strERNSt6stringE16gpi_set_action_t "Permalink to this definition") [GpiCbHdl](https://docs.cocotb.org/en/v1.4.0/generated/class/classGpiCbHdl.html#_CPPv48GpiCbHdl "GpiCbHdl") \*`value_change_cb`(int _edge_) _override_[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/VpiImpl_8h.html#_CPPv4N15VpiSignalObjHdl15value_change_cbEi "Permalink to this definition") int `initialise`([std](https://docs.cocotb.org/en/v1.4.0/generated/file/GpiCommon_8cpp.html#_CPPv4St "std") ::string &_name_, [std](https://docs.cocotb.org/en/v1.4.0/generated/file/GpiCommon_8cpp.html#_CPPv4St "std") ::string &_fq\_name_) _override_[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/VpiImpl_8h.html#_CPPv4N15VpiSignalObjHdl10initialiseERNSt6stringERNSt6stringE "Permalink to this definition") Private Functions int `set_signal_value`([s\_vpi\_value](https://docs.cocotb.org/en/v1.4.0/generated/file/vpi__user_8h.html#_CPPv411s_vpi_value "s_vpi_value") _value_, [gpi\_set\_action\_t](https://docs.cocotb.org/en/v1.4.0/generated/file/gpi_8h.html#_CPPv416gpi_set_action_t "gpi_set_action_t") _action_)[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/VpiImpl_8h.html#_CPPv4N15VpiSignalObjHdl16set_signal_valueE11s_vpi_value16gpi_set_action_t "Permalink to this definition") Private Members [VpiValueCbHdl](https://docs.cocotb.org/en/v1.4.0/generated/class/classVpiValueCbHdl.html#_CPPv413VpiValueCbHdl "VpiValueCbHdl") `m_rising_cb`[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/VpiImpl_8h.html#_CPPv4N15VpiSignalObjHdl11m_rising_cbE "Permalink to this definition") [VpiValueCbHdl](https://docs.cocotb.org/en/v1.4.0/generated/class/classVpiValueCbHdl.html#_CPPv413VpiValueCbHdl "VpiValueCbHdl") `m_falling_cb`[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/VpiImpl_8h.html#_CPPv4N15VpiSignalObjHdl12m_falling_cbE "Permalink to this definition") [VpiValueCbHdl](https://docs.cocotb.org/en/v1.4.0/generated/class/classVpiValueCbHdl.html#_CPPv413VpiValueCbHdl "VpiValueCbHdl") `m_either_cb`[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/VpiImpl_8h.html#_CPPv4N15VpiSignalObjHdl11m_either_cbE "Permalink to this definition") _class_ `VpiIterator` : _public_ [GpiIterator](https://docs.cocotb.org/en/v1.4.0/generated/class/classGpiIterator.html#_CPPv411GpiIterator "GpiIterator") Public Functions `VpiIterator`([GpiImplInterface](https://docs.cocotb.org/en/v1.4.0/generated/class/classGpiImplInterface.html#_CPPv416GpiImplInterface "GpiImplInterface") \*_impl_, [GpiObjHdl](https://docs.cocotb.org/en/v1.4.0/generated/class/classGpiObjHdl.html#_CPPv49GpiObjHdl "GpiObjHdl") \*_hdl_)[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/VpiImpl_8h.html#_CPPv4N11VpiIterator11VpiIteratorEP16GpiImplInterfaceP9GpiObjHdl "Permalink to this definition") `~VpiIterator`() _override_[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/VpiImpl_8h.html#_CPPv4N11VpiIteratorD0Ev "Permalink to this definition") Status `next_handle`([std](https://docs.cocotb.org/en/v1.4.0/generated/file/GpiCommon_8cpp.html#_CPPv4St "std") ::string &_name_, [GpiObjHdl](https://docs.cocotb.org/en/v1.4.0/generated/class/classGpiObjHdl.html#_CPPv49GpiObjHdl "GpiObjHdl") \*\*_hdl_, void \*\*_raw\_hdl_) _override_[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/VpiImpl_8h.html#_CPPv4N11VpiIterator11next_handleERNSt6stringEPP9GpiObjHdlPPv "Permalink to this definition") Private Members [vpiHandle](https://docs.cocotb.org/en/v1.4.0/generated/file/vpi__user_8h.html#_CPPv49vpiHandle "vpiHandle") `m_iterator`[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/VpiImpl_8h.html#_CPPv4N11VpiIterator10m_iteratorE "Permalink to this definition") [std](https://docs.cocotb.org/en/v1.4.0/generated/file/GpiCommon_8cpp.html#_CPPv4St "std") ::vector \*`selected`[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/VpiImpl_8h.html#_CPPv4N11VpiIterator8selectedE "Permalink to this definition") [std](https://docs.cocotb.org/en/v1.4.0/generated/file/GpiCommon_8cpp.html#_CPPv4St "std") ::vector::iterator `one2many`[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/VpiImpl_8h.html#_CPPv4N11VpiIterator8one2manyE "Permalink to this definition") Private Static Attributes [GpiIteratorMapping](https://docs.cocotb.org/en/v1.4.0/generated/class/classGpiIteratorMapping.html#_CPPv4I00E18GpiIteratorMapping "GpiIteratorMapping") `iterate_over`[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/VpiImpl_8h.html#_CPPv4N11VpiIterator12iterate_overE "Permalink to this definition") _class_ `VpiSingleIterator` : _public_ [GpiIterator](https://docs.cocotb.org/en/v1.4.0/generated/class/classGpiIterator.html#_CPPv411GpiIterator "GpiIterator") Public Functions `VpiSingleIterator`([GpiImplInterface](https://docs.cocotb.org/en/v1.4.0/generated/class/classGpiImplInterface.html#_CPPv416GpiImplInterface "GpiImplInterface") \*_impl_, [GpiObjHdl](https://docs.cocotb.org/en/v1.4.0/generated/class/classGpiObjHdl.html#_CPPv49GpiObjHdl "GpiObjHdl") \*_hdl_, int32\_t _vpitype_)[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/VpiImpl_8h.html#_CPPv4N17VpiSingleIterator17VpiSingleIteratorEP16GpiImplInterfaceP9GpiObjHdl7int32_t "Permalink to this definition") Status `next_handle`([std](https://docs.cocotb.org/en/v1.4.0/generated/file/GpiCommon_8cpp.html#_CPPv4St "std") ::string &_name_, [GpiObjHdl](https://docs.cocotb.org/en/v1.4.0/generated/class/classGpiObjHdl.html#_CPPv49GpiObjHdl "GpiObjHdl") \*\*_hdl_, void \*\*_raw\_hdl_) _override_[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/VpiImpl_8h.html#_CPPv4N17VpiSingleIterator11next_handleERNSt6stringEPP9GpiObjHdlPPv "Permalink to this definition") Protected Attributes [vpiHandle](https://docs.cocotb.org/en/v1.4.0/generated/file/vpi__user_8h.html#_CPPv49vpiHandle "vpiHandle") `m_iterator` = nullptr[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/VpiImpl_8h.html#_CPPv4N17VpiSingleIterator10m_iteratorE "Permalink to this definition") _class_ `VpiImpl` : _public_ [GpiImplInterface](https://docs.cocotb.org/en/v1.4.0/generated/class/classGpiImplInterface.html#_CPPv416GpiImplInterface "GpiImplInterface") Public Functions `VpiImpl`(_const_ [std](https://docs.cocotb.org/en/v1.4.0/generated/file/GpiCommon_8cpp.html#_CPPv4St "std") ::string &_name_)[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/VpiImpl_8h.html#_CPPv4N7VpiImpl7VpiImplERKNSt6stringE "Permalink to this definition") void `sim_end`(void) _override_[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/VpiImpl_8h.html#_CPPv4N7VpiImpl7sim_endEv "Permalink to this definition") void `get_sim_time`(uint32\_t \*_high_, uint32\_t \*_low_) _override_[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/VpiImpl_8h.html#_CPPv4N7VpiImpl12get_sim_timeEP8uint32_tP8uint32_t "Permalink to this definition") void `get_sim_precision`(int32\_t \*_precision_) _override_[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/VpiImpl_8h.html#_CPPv4N7VpiImpl17get_sim_precisionEP7int32_t "Permalink to this definition") _const_ char \*`get_simulator_product`() _override_[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/VpiImpl_8h.html#_CPPv4N7VpiImpl21get_simulator_productEv "Permalink to this definition") _const_ char \*`get_simulator_version`() _override_[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/VpiImpl_8h.html#_CPPv4N7VpiImpl21get_simulator_versionEv "Permalink to this definition") [GpiObjHdl](https://docs.cocotb.org/en/v1.4.0/generated/class/classGpiObjHdl.html#_CPPv49GpiObjHdl "GpiObjHdl") \*`get_root_handle`(_const_ char \*_name_) _override_[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/VpiImpl_8h.html#_CPPv4N7VpiImpl15get_root_handleEPKc "Permalink to this definition") [GpiIterator](https://docs.cocotb.org/en/v1.4.0/generated/class/classGpiIterator.html#_CPPv411GpiIterator "GpiIterator") \*`iterate_handle`([GpiObjHdl](https://docs.cocotb.org/en/v1.4.0/generated/class/classGpiObjHdl.html#_CPPv49GpiObjHdl "GpiObjHdl") \*_obj\_hdl_, [gpi\_iterator\_sel\_t](https://docs.cocotb.org/en/v1.4.0/generated/file/gpi_8h.html#_CPPv418gpi_iterator_sel_t "gpi_iterator_sel_t") _type_) _override_[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/VpiImpl_8h.html#_CPPv4N7VpiImpl14iterate_handleEP9GpiObjHdl18gpi_iterator_sel_t "Permalink to this definition") [GpiObjHdl](https://docs.cocotb.org/en/v1.4.0/generated/class/classGpiObjHdl.html#_CPPv49GpiObjHdl "GpiObjHdl") \*`next_handle`([GpiIterator](https://docs.cocotb.org/en/v1.4.0/generated/class/classGpiIterator.html#_CPPv411GpiIterator "GpiIterator") \*_iter_)[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/VpiImpl_8h.html#_CPPv4N7VpiImpl11next_handleEP11GpiIterator "Permalink to this definition") [GpiCbHdl](https://docs.cocotb.org/en/v1.4.0/generated/class/classGpiCbHdl.html#_CPPv48GpiCbHdl "GpiCbHdl") \*`register_timed_callback`(uint64\_t _time\_ps_) _override_[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/VpiImpl_8h.html#_CPPv4N7VpiImpl23register_timed_callbackE8uint64_t "Permalink to this definition") [GpiCbHdl](https://docs.cocotb.org/en/v1.4.0/generated/class/classGpiCbHdl.html#_CPPv48GpiCbHdl "GpiCbHdl") \*`register_readonly_callback`() _override_[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/VpiImpl_8h.html#_CPPv4N7VpiImpl26register_readonly_callbackEv "Permalink to this definition") [GpiCbHdl](https://docs.cocotb.org/en/v1.4.0/generated/class/classGpiCbHdl.html#_CPPv48GpiCbHdl "GpiCbHdl") \*`register_nexttime_callback`() _override_[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/VpiImpl_8h.html#_CPPv4N7VpiImpl26register_nexttime_callbackEv "Permalink to this definition") [GpiCbHdl](https://docs.cocotb.org/en/v1.4.0/generated/class/classGpiCbHdl.html#_CPPv48GpiCbHdl "GpiCbHdl") \*`register_readwrite_callback`() _override_[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/VpiImpl_8h.html#_CPPv4N7VpiImpl27register_readwrite_callbackEv "Permalink to this definition") int `deregister_callback`([GpiCbHdl](https://docs.cocotb.org/en/v1.4.0/generated/class/classGpiCbHdl.html#_CPPv48GpiCbHdl "GpiCbHdl") \*_obj\_hdl_) _override_[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/VpiImpl_8h.html#_CPPv4N7VpiImpl19deregister_callbackEP8GpiCbHdl "Permalink to this definition") [GpiObjHdl](https://docs.cocotb.org/en/v1.4.0/generated/class/classGpiObjHdl.html#_CPPv49GpiObjHdl "GpiObjHdl") \*`native_check_create`([std](https://docs.cocotb.org/en/v1.4.0/generated/file/GpiCommon_8cpp.html#_CPPv4St "std") ::string &_name_, [GpiObjHdl](https://docs.cocotb.org/en/v1.4.0/generated/class/classGpiObjHdl.html#_CPPv49GpiObjHdl "GpiObjHdl") \*_parent_) _override_[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/VpiImpl_8h.html#_CPPv4N7VpiImpl19native_check_createERNSt6stringEP9GpiObjHdl "Permalink to this definition") [GpiObjHdl](https://docs.cocotb.org/en/v1.4.0/generated/class/classGpiObjHdl.html#_CPPv49GpiObjHdl "GpiObjHdl") \*`native_check_create`(int32\_t _index_, [GpiObjHdl](https://docs.cocotb.org/en/v1.4.0/generated/class/classGpiObjHdl.html#_CPPv49GpiObjHdl "GpiObjHdl") \*_parent_) _override_[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/VpiImpl_8h.html#_CPPv4N7VpiImpl19native_check_createE7int32_tP9GpiObjHdl "Permalink to this definition") [GpiObjHdl](https://docs.cocotb.org/en/v1.4.0/generated/class/classGpiObjHdl.html#_CPPv49GpiObjHdl "GpiObjHdl") \*`native_check_create`(void \*_raw\_hdl_, [GpiObjHdl](https://docs.cocotb.org/en/v1.4.0/generated/class/classGpiObjHdl.html#_CPPv49GpiObjHdl "GpiObjHdl") \*_parent_) _override_[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/VpiImpl_8h.html#_CPPv4N7VpiImpl19native_check_createEPvP9GpiObjHdl "Permalink to this definition") _const_ char \*`reason_to_string`(int _reason_) _override_[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/VpiImpl_8h.html#_CPPv4N7VpiImpl16reason_to_stringEi "Permalink to this definition") [GpiObjHdl](https://docs.cocotb.org/en/v1.4.0/generated/class/classGpiObjHdl.html#_CPPv49GpiObjHdl "GpiObjHdl") \*`create_gpi_obj_from_handle`([vpiHandle](https://docs.cocotb.org/en/v1.4.0/generated/file/vpi__user_8h.html#_CPPv49vpiHandle "vpiHandle") _new\_hdl_, [std](https://docs.cocotb.org/en/v1.4.0/generated/file/GpiCommon_8cpp.html#_CPPv4St "std") ::string &_name_, [std](https://docs.cocotb.org/en/v1.4.0/generated/file/GpiCommon_8cpp.html#_CPPv4St "std") ::string &_fq\_name_)[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/VpiImpl_8h.html#_CPPv4N7VpiImpl26create_gpi_obj_from_handleE9vpiHandleRNSt6stringERNSt6stringE "Permalink to this definition") Private Members [VpiReadwriteCbHdl](https://docs.cocotb.org/en/v1.4.0/generated/class/classVpiReadwriteCbHdl.html#_CPPv417VpiReadwriteCbHdl "VpiReadwriteCbHdl") `m_read_write`[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/VpiImpl_8h.html#_CPPv4N7VpiImpl12m_read_writeE "Permalink to this definition") [VpiNextPhaseCbHdl](https://docs.cocotb.org/en/v1.4.0/generated/class/classVpiNextPhaseCbHdl.html#_CPPv417VpiNextPhaseCbHdl "VpiNextPhaseCbHdl") `m_next_phase`[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/VpiImpl_8h.html#_CPPv4N7VpiImpl12m_next_phaseE "Permalink to this definition") [VpiReadOnlyCbHdl](https://docs.cocotb.org/en/v1.4.0/generated/class/classVpiReadOnlyCbHdl.html#_CPPv416VpiReadOnlyCbHdl "VpiReadOnlyCbHdl") `m_read_only`[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/VpiImpl_8h.html#_CPPv4N7VpiImpl11m_read_onlyE "Permalink to this definition") --- # File cocotb_utils.h — cocotb 1.4.0 documentation * [](https://docs.cocotb.org/en/v1.4.0/index.html) » * [C Code Library Reference](https://docs.cocotb.org/en/v1.4.0/library_reference_c.html) » * [File list](https://docs.cocotb.org/en/v1.4.0/generated/filelist.html) » * File cocotb\_utils.h * [Edit on GitHub](https://github.com/cocotb/cocotb/blob/v1.4.0/documentation/source/generated/file/cocotb__utils_8h.rst) * * * File cocotb\_utils.h[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/cocotb__utils_8h.html#file-cocotb-utils-h "Permalink to this headline") ================================================================================================================================================= Defines `xstr`(_a_) str(a)[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/cocotb__utils_8h.html#c.xstr "Permalink to this definition") `str`(_a_) #a[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/cocotb__utils_8h.html#c.str "Permalink to this definition") `to_python`() do { \\ if (is\_python\_context) { \\ LOG\_ERROR(“FATAL: We are calling up again”); \\ exit(1); \\ } \\ ++is\_python\_context; \\ LOG\_DEBUG(“Returning to Python”); \\ } while (0) [¶](https://docs.cocotb.org/en/v1.4.0/generated/file/cocotb__utils_8h.html#c.to_python "Permalink to this definition") `to_simulator`() do { \\ if (!is\_python\_context) { \\ LOG\_ERROR(“FATAL: We have returned twice from python\\n”); \\ exit(1); \\ } \\ –is\_python\_context; \\ LOG\_DEBUG(“Returning to simulator”); \\ } while (0) [¶](https://docs.cocotb.org/en/v1.4.0/generated/file/cocotb__utils_8h.html#c.to_simulator "Permalink to this definition") `COCOTB_UNUSED`(_x_) ((void)x)[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/cocotb__utils_8h.html#c.COCOTB_UNUSED "Permalink to this definition") Functions void \*`utils_dyn_open`(_const_ char \*_lib\_name_) void \*`utils_dyn_sym`(void \*_handle_, _const_ char \*_sym\_name_) Variables int `is_python_context` --- # File embed.h — cocotb 1.4.0 documentation * [](https://docs.cocotb.org/en/v1.4.0/index.html) » * [C Code Library Reference](https://docs.cocotb.org/en/v1.4.0/library_reference_c.html) » * [File list](https://docs.cocotb.org/en/v1.4.0/generated/filelist.html) » * File embed.h * [Edit on GitHub](https://github.com/cocotb/cocotb/blob/v1.4.0/documentation/source/generated/file/embed_8h.rst) * * * File embed.h[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/embed_8h.html#file-embed-h "Permalink to this headline") ========================================================================================================================== Functions void `embed_init_python`(void)[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/embed_8h.html#_CPPv417embed_init_pythonv "Permalink to this definition") void `embed_sim_cleanup`(void)[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/embed_8h.html#_CPPv417embed_sim_cleanupv "Permalink to this definition") int `embed_sim_init`(int _argc_, char _const_ \*_const_ \*_argv_)[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/embed_8h.html#_CPPv414embed_sim_initiPPCKc "Permalink to this definition") void `embed_sim_event`(gpi\_event\_t _level_, _const_ char \*_msg_)[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/embed_8h.html#_CPPv415embed_sim_event11gpi_event_tPKc "Permalink to this definition") --- # File gpi.h — cocotb 1.4.0 documentation * [](https://docs.cocotb.org/en/v1.4.0/index.html) » * [C Code Library Reference](https://docs.cocotb.org/en/v1.4.0/library_reference_c.html) » * [File list](https://docs.cocotb.org/en/v1.4.0/generated/filelist.html) » * File gpi.h * [Edit on GitHub](https://github.com/cocotb/cocotb/blob/v1.4.0/documentation/source/generated/file/gpi_8h.rst) * * * File gpi.h[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/gpi_8h.html#file-gpi-h "Permalink to this headline") ==================================================================================================================== Defines `EXTERN_C_START`[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/gpi_8h.html#c.EXTERN_C_START "Permalink to this definition") `EXTERN_C_END`[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/gpi_8h.html#c.EXTERN_C_END "Permalink to this definition") `__attribute__`(_x_)[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/gpi_8h.html#c.__attribute__ "Permalink to this definition") `GPI_RET`(_\_code_) if (\_code == 1) \\ return 0; \\ else \\ return -1 [¶](https://docs.cocotb.org/en/v1.4.0/generated/file/gpi_8h.html#c.GPI_RET "Permalink to this definition") Typedefs _typedef_ _struct_ [GpiObjHdl](https://docs.cocotb.org/en/v1.4.0/generated/class/classGpiObjHdl.html#_CPPv49GpiObjHdl "GpiObjHdl") \*`gpi_sim_hdl`[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/gpi_8h.html#_CPPv411gpi_sim_hdl "Permalink to this definition") _typedef_ _struct_ [GpiCbHdl](https://docs.cocotb.org/en/v1.4.0/generated/class/classGpiCbHdl.html#_CPPv48GpiCbHdl "GpiCbHdl") \*`gpi_cb_hdl`[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/gpi_8h.html#_CPPv410gpi_cb_hdl "Permalink to this definition") _typedef_ _struct_ [GpiIterator](https://docs.cocotb.org/en/v1.4.0/generated/class/classGpiIterator.html#_CPPv411GpiIterator "GpiIterator") \*`gpi_iterator_hdl`[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/gpi_8h.html#_CPPv416gpi_iterator_hdl "Permalink to this definition") `EXTERN_C_START enum gpi_event_e gpi_event_t` _typedef_ _enum_ [gpi\_objtype\_e](https://docs.cocotb.org/en/v1.4.0/generated/file/gpi_8h.html#_CPPv413gpi_objtype_e "gpi_objtype_e") `gpi_objtype_t`[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/gpi_8h.html#_CPPv413gpi_objtype_t "Permalink to this definition") _typedef_ _enum_ [gpi\_iterator\_sel\_e](https://docs.cocotb.org/en/v1.4.0/generated/file/gpi_8h.html#_CPPv418gpi_iterator_sel_e "gpi_iterator_sel_e") `gpi_iterator_sel_t`[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/gpi_8h.html#_CPPv418gpi_iterator_sel_t "Permalink to this definition") _typedef_ _enum_ [gpi\_set\_action\_e](https://docs.cocotb.org/en/v1.4.0/generated/file/gpi_8h.html#_CPPv416gpi_set_action_e "gpi_set_action_e") `gpi_set_action_t`[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/gpi_8h.html#_CPPv416gpi_set_action_t "Permalink to this definition") _typedef_ _enum_ [gpi\_edge](https://docs.cocotb.org/en/v1.4.0/generated/file/gpi_8h.html#_CPPv48gpi_edge "gpi_edge") `gpi_edge_e`[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/gpi_8h.html#_CPPv410gpi_edge_e "Permalink to this definition") Enums _enum_ `gpi_event_e`[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/gpi_8h.html#_CPPv411gpi_event_e "Permalink to this definition") _Values:_ _enumerator_ `SIM_INFO` = 0[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/gpi_8h.html#_CPPv4N11gpi_event_e8SIM_INFOE "Permalink to this definition") _enumerator_ `SIM_TEST_FAIL` = 1[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/gpi_8h.html#_CPPv4N11gpi_event_e13SIM_TEST_FAILE "Permalink to this definition") _enumerator_ `SIM_FAIL` = 2[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/gpi_8h.html#_CPPv4N11gpi_event_e8SIM_FAILE "Permalink to this definition") _enum_ `gpi_objtype_e`[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/gpi_8h.html#_CPPv413gpi_objtype_e "Permalink to this definition") _Values:_ _enumerator_ `GPI_UNKNOWN` = 0[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/gpi_8h.html#_CPPv4N13gpi_objtype_e11GPI_UNKNOWNE "Permalink to this definition") _enumerator_ `GPI_MEMORY` = 1[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/gpi_8h.html#_CPPv4N13gpi_objtype_e10GPI_MEMORYE "Permalink to this definition") _enumerator_ `GPI_MODULE` = 2[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/gpi_8h.html#_CPPv4N13gpi_objtype_e10GPI_MODULEE "Permalink to this definition") _enumerator_ `GPI_NET` = 3[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/gpi_8h.html#_CPPv4N13gpi_objtype_e7GPI_NETE "Permalink to this definition") _enumerator_ `GPI_PARAMETER` = 4[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/gpi_8h.html#_CPPv4N13gpi_objtype_e13GPI_PARAMETERE "Permalink to this definition") _enumerator_ `GPI_REGISTER` = 5[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/gpi_8h.html#_CPPv4N13gpi_objtype_e12GPI_REGISTERE "Permalink to this definition") _enumerator_ `GPI_ARRAY` = 6[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/gpi_8h.html#_CPPv4N13gpi_objtype_e9GPI_ARRAYE "Permalink to this definition") _enumerator_ `GPI_ENUM` = 7[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/gpi_8h.html#_CPPv4N13gpi_objtype_e8GPI_ENUME "Permalink to this definition") _enumerator_ `GPI_STRUCTURE` = 8[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/gpi_8h.html#_CPPv4N13gpi_objtype_e13GPI_STRUCTUREE "Permalink to this definition") _enumerator_ `GPI_REAL` = 9[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/gpi_8h.html#_CPPv4N13gpi_objtype_e8GPI_REALE "Permalink to this definition") _enumerator_ `GPI_INTEGER` = 10[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/gpi_8h.html#_CPPv4N13gpi_objtype_e11GPI_INTEGERE "Permalink to this definition") _enumerator_ `GPI_STRING` = 11[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/gpi_8h.html#_CPPv4N13gpi_objtype_e10GPI_STRINGE "Permalink to this definition") _enumerator_ `GPI_GENARRAY` = 12[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/gpi_8h.html#_CPPv4N13gpi_objtype_e12GPI_GENARRAYE "Permalink to this definition") _enum_ `gpi_iterator_sel_e`[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/gpi_8h.html#_CPPv418gpi_iterator_sel_e "Permalink to this definition") _Values:_ _enumerator_ `GPI_OBJECTS` = 1[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/gpi_8h.html#_CPPv4N18gpi_iterator_sel_e11GPI_OBJECTSE "Permalink to this definition") _enumerator_ `GPI_DRIVERS` = 2[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/gpi_8h.html#_CPPv4N18gpi_iterator_sel_e11GPI_DRIVERSE "Permalink to this definition") _enumerator_ `GPI_LOADS` = 3[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/gpi_8h.html#_CPPv4N18gpi_iterator_sel_e9GPI_LOADSE "Permalink to this definition") _enum_ `gpi_set_action_e`[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/gpi_8h.html#_CPPv416gpi_set_action_e "Permalink to this definition") _Values:_ _enumerator_ `GPI_DEPOSIT` = 0[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/gpi_8h.html#_CPPv4N16gpi_set_action_e11GPI_DEPOSITE "Permalink to this definition") _enumerator_ `GPI_FORCE` = 1[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/gpi_8h.html#_CPPv4N16gpi_set_action_e9GPI_FORCEE "Permalink to this definition") _enumerator_ `GPI_RELEASE` = 2[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/gpi_8h.html#_CPPv4N16gpi_set_action_e11GPI_RELEASEE "Permalink to this definition") _enum_ `gpi_edge`[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/gpi_8h.html#_CPPv48gpi_edge "Permalink to this definition") _Values:_ _enumerator_ `GPI_RISING` = 1[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/gpi_8h.html#_CPPv4N8gpi_edge10GPI_RISINGE "Permalink to this definition") _enumerator_ `GPI_FALLING` = 2[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/gpi_8h.html#_CPPv4N8gpi_edge11GPI_FALLINGE "Permalink to this definition") Functions bool `gpi_has_registered_impl`(void) Returns 1 if there is a registered GPI implementation, 0 otherwise. Useful for checking if a simulator is running. void `gpi_sim_end`(void) void `gpi_cleanup`(void) void `gpi_get_sim_time`(uint32\_t \*_high_, uint32\_t \*_low_) void `gpi_get_sim_precision`(int32\_t \*_precision_) _const_ char \*`gpi_get_simulator_product`(void) Returns a string with the running simulator product information. **Return** simulator product string _const_ char \*`gpi_get_simulator_version`(void) Returns a string with the running simulator version. **Return** simulator version string [gpi\_sim\_hdl](https://docs.cocotb.org/en/v1.4.0/generated/file/gpi_8h.html#_CPPv411gpi_sim_hdl "gpi_sim_hdl") `gpi_get_root_handle`(_const_ char \*_name_) [gpi\_sim\_hdl](https://docs.cocotb.org/en/v1.4.0/generated/file/gpi_8h.html#_CPPv411gpi_sim_hdl "gpi_sim_hdl") `gpi_get_handle_by_name`([gpi\_sim\_hdl](https://docs.cocotb.org/en/v1.4.0/generated/file/gpi_8h.html#_CPPv411gpi_sim_hdl "gpi_sim_hdl") _parent_, _const_ char \*_name_) [gpi\_sim\_hdl](https://docs.cocotb.org/en/v1.4.0/generated/file/gpi_8h.html#_CPPv411gpi_sim_hdl "gpi_sim_hdl") `gpi_get_handle_by_index`([gpi\_sim\_hdl](https://docs.cocotb.org/en/v1.4.0/generated/file/gpi_8h.html#_CPPv411gpi_sim_hdl "gpi_sim_hdl") _parent_, int32\_t _index_) void `gpi_free_handle`([gpi\_sim\_hdl](https://docs.cocotb.org/en/v1.4.0/generated/file/gpi_8h.html#_CPPv411gpi_sim_hdl "gpi_sim_hdl") _gpi\_hdl_)[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/gpi_8h.html#_CPPv415gpi_free_handle11gpi_sim_hdl "Permalink to this definition") [gpi\_iterator\_hdl](https://docs.cocotb.org/en/v1.4.0/generated/file/gpi_8h.html#_CPPv416gpi_iterator_hdl "gpi_iterator_hdl") `gpi_iterate`([gpi\_sim\_hdl](https://docs.cocotb.org/en/v1.4.0/generated/file/gpi_8h.html#_CPPv411gpi_sim_hdl "gpi_sim_hdl") _base_, [gpi\_iterator\_sel\_t](https://docs.cocotb.org/en/v1.4.0/generated/file/gpi_8h.html#_CPPv418gpi_iterator_sel_t "gpi_iterator_sel_t") _type_) [gpi\_sim\_hdl](https://docs.cocotb.org/en/v1.4.0/generated/file/gpi_8h.html#_CPPv411gpi_sim_hdl "gpi_sim_hdl") `gpi_next`([gpi\_iterator\_hdl](https://docs.cocotb.org/en/v1.4.0/generated/file/gpi_8h.html#_CPPv416gpi_iterator_hdl "gpi_iterator_hdl") _iterator_) int `gpi_get_num_elems`([gpi\_sim\_hdl](https://docs.cocotb.org/en/v1.4.0/generated/file/gpi_8h.html#_CPPv411gpi_sim_hdl "gpi_sim_hdl") _gpi\_sim\_hdl_) int `gpi_get_range_left`([gpi\_sim\_hdl](https://docs.cocotb.org/en/v1.4.0/generated/file/gpi_8h.html#_CPPv411gpi_sim_hdl "gpi_sim_hdl") _gpi\_sim\_hdl_) int `gpi_get_range_right`([gpi\_sim\_hdl](https://docs.cocotb.org/en/v1.4.0/generated/file/gpi_8h.html#_CPPv411gpi_sim_hdl "gpi_sim_hdl") _gpi\_sim\_hdl_) _const_ char \*`gpi_get_signal_value_binstr`([gpi\_sim\_hdl](https://docs.cocotb.org/en/v1.4.0/generated/file/gpi_8h.html#_CPPv411gpi_sim_hdl "gpi_sim_hdl") _gpi\_hdl_) _const_ char \*`gpi_get_signal_value_str`([gpi\_sim\_hdl](https://docs.cocotb.org/en/v1.4.0/generated/file/gpi_8h.html#_CPPv411gpi_sim_hdl "gpi_sim_hdl") _gpi\_hdl_) double `gpi_get_signal_value_real`([gpi\_sim\_hdl](https://docs.cocotb.org/en/v1.4.0/generated/file/gpi_8h.html#_CPPv411gpi_sim_hdl "gpi_sim_hdl") _gpi\_hdl_) long `gpi_get_signal_value_long`([gpi\_sim\_hdl](https://docs.cocotb.org/en/v1.4.0/generated/file/gpi_8h.html#_CPPv411gpi_sim_hdl "gpi_sim_hdl") _gpi\_hdl_) _const_ char \*`gpi_get_signal_name_str`([gpi\_sim\_hdl](https://docs.cocotb.org/en/v1.4.0/generated/file/gpi_8h.html#_CPPv411gpi_sim_hdl "gpi_sim_hdl") _gpi\_hdl_) _const_ char \*`gpi_get_signal_type_str`([gpi\_sim\_hdl](https://docs.cocotb.org/en/v1.4.0/generated/file/gpi_8h.html#_CPPv411gpi_sim_hdl "gpi_sim_hdl") _gpi\_hdl_) [gpi\_objtype\_t](https://docs.cocotb.org/en/v1.4.0/generated/file/gpi_8h.html#_CPPv413gpi_objtype_t "gpi_objtype_t") `gpi_get_object_type`([gpi\_sim\_hdl](https://docs.cocotb.org/en/v1.4.0/generated/file/gpi_8h.html#_CPPv411gpi_sim_hdl "gpi_sim_hdl") _gpi\_hdl_) _const_ char \*`gpi_get_definition_name`([gpi\_sim\_hdl](https://docs.cocotb.org/en/v1.4.0/generated/file/gpi_8h.html#_CPPv411gpi_sim_hdl "gpi_sim_hdl") _gpi\_hdl_) _const_ char \*`gpi_get_definition_file`([gpi\_sim\_hdl](https://docs.cocotb.org/en/v1.4.0/generated/file/gpi_8h.html#_CPPv411gpi_sim_hdl "gpi_sim_hdl") _gpi\_hdl_) int `gpi_is_constant`([gpi\_sim\_hdl](https://docs.cocotb.org/en/v1.4.0/generated/file/gpi_8h.html#_CPPv411gpi_sim_hdl "gpi_sim_hdl") _gpi\_hdl_) int `gpi_is_indexable`([gpi\_sim\_hdl](https://docs.cocotb.org/en/v1.4.0/generated/file/gpi_8h.html#_CPPv411gpi_sim_hdl "gpi_sim_hdl") _gpi\_hdl_) void `gpi_set_signal_value_real`([gpi\_sim\_hdl](https://docs.cocotb.org/en/v1.4.0/generated/file/gpi_8h.html#_CPPv411gpi_sim_hdl "gpi_sim_hdl") _gpi\_hdl_, double _value_, [gpi\_set\_action\_t](https://docs.cocotb.org/en/v1.4.0/generated/file/gpi_8h.html#_CPPv416gpi_set_action_t "gpi_set_action_t") _action_) void `gpi_set_signal_value_long`([gpi\_sim\_hdl](https://docs.cocotb.org/en/v1.4.0/generated/file/gpi_8h.html#_CPPv411gpi_sim_hdl "gpi_sim_hdl") _gpi\_hdl_, long _value_, [gpi\_set\_action\_t](https://docs.cocotb.org/en/v1.4.0/generated/file/gpi_8h.html#_CPPv416gpi_set_action_t "gpi_set_action_t") _action_) void `gpi_set_signal_value_binstr`([gpi\_sim\_hdl](https://docs.cocotb.org/en/v1.4.0/generated/file/gpi_8h.html#_CPPv411gpi_sim_hdl "gpi_sim_hdl") _gpi\_hdl_, _const_ char \*_str_, [gpi\_set\_action\_t](https://docs.cocotb.org/en/v1.4.0/generated/file/gpi_8h.html#_CPPv416gpi_set_action_t "gpi_set_action_t") _action_) void `gpi_set_signal_value_str`([gpi\_sim\_hdl](https://docs.cocotb.org/en/v1.4.0/generated/file/gpi_8h.html#_CPPv411gpi_sim_hdl "gpi_sim_hdl") _gpi\_hdl_, _const_ char \*_str_, [gpi\_set\_action\_t](https://docs.cocotb.org/en/v1.4.0/generated/file/gpi_8h.html#_CPPv416gpi_set_action_t "gpi_set_action_t") _action_) [gpi\_cb\_hdl](https://docs.cocotb.org/en/v1.4.0/generated/file/gpi_8h.html#_CPPv410gpi_cb_hdl "gpi_cb_hdl") `gpi_register_timed_callback`(int (\*_gpi\_function_)(_const_ void\*), void \*_gpi\_cb\_data_, uint64\_t _time\_ps_, ) [gpi\_cb\_hdl](https://docs.cocotb.org/en/v1.4.0/generated/file/gpi_8h.html#_CPPv410gpi_cb_hdl "gpi_cb_hdl") `gpi_register_value_change_callback`(int (\*_gpi\_function_)(_const_ void\*), void \*_gpi\_cb\_data_, [gpi\_sim\_hdl](https://docs.cocotb.org/en/v1.4.0/generated/file/gpi_8h.html#_CPPv411gpi_sim_hdl "gpi_sim_hdl") _gpi\_hdl_, int _edge_, ) [gpi\_cb\_hdl](https://docs.cocotb.org/en/v1.4.0/generated/file/gpi_8h.html#_CPPv410gpi_cb_hdl "gpi_cb_hdl") `gpi_register_readonly_callback`(int (\*_gpi\_function_)(_const_ void\*), void \*_gpi\_cb\_data_, ) [gpi\_cb\_hdl](https://docs.cocotb.org/en/v1.4.0/generated/file/gpi_8h.html#_CPPv410gpi_cb_hdl "gpi_cb_hdl") `gpi_register_nexttime_callback`(int (\*_gpi\_function_)(_const_ void\*), void \*_gpi\_cb\_data_, ) [gpi\_cb\_hdl](https://docs.cocotb.org/en/v1.4.0/generated/file/gpi_8h.html#_CPPv410gpi_cb_hdl "gpi_cb_hdl") `gpi_register_readwrite_callback`(int (\*_gpi\_function_)(_const_ void\*), void \*_gpi\_cb\_data_, ) void `gpi_deregister_callback`([gpi\_cb\_hdl](https://docs.cocotb.org/en/v1.4.0/generated/file/gpi_8h.html#_CPPv410gpi_cb_hdl "gpi_cb_hdl") _gpi\_hdl_) void \*`gpi_get_callback_data`([gpi\_cb\_hdl](https://docs.cocotb.org/en/v1.4.0/generated/file/gpi_8h.html#_CPPv410gpi_cb_hdl "gpi_cb_hdl") _gpi\_hdl_)[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/gpi_8h.html#_CPPv421gpi_get_callback_data10gpi_cb_hdl "Permalink to this definition") size\_t `gpi_print_registered_impl`(void) --- # File gpi_embed.cpp — cocotb 1.4.0 documentation * [](https://docs.cocotb.org/en/v1.4.0/index.html) » * [C Code Library Reference](https://docs.cocotb.org/en/v1.4.0/library_reference_c.html) » * [File list](https://docs.cocotb.org/en/v1.4.0/generated/filelist.html) » * File gpi\_embed.cpp * [Edit on GitHub](https://github.com/cocotb/cocotb/blob/v1.4.0/documentation/source/generated/file/gpi__embed_8cpp.rst) * * * File gpi\_embed.cpp[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/gpi__embed_8cpp.html#file-gpi-embed-cpp "Permalink to this headline") ============================================================================================================================================== Initialize the Python interpreter Create and initialize the Python interpreter GILState before calling: N/A GILState after calling: released Stores the thread state for cocotb in static variable gtstate void `embed_init_python`(void) Simulator cleanup Called by the simulator on shutdown. GILState before calling: Not held GILState after calling: Not held Makes one call to PyGILState\_Ensure and one call to Py\_Finalize. Cleans up reference counts for Python objects and calls Py\_Finalize function. void `embed_sim_cleanup`(void) Initialization Called by the simulator on initialization. Load cocotb Python module GILState before calling: Not held GILState after calling: Not held Makes one call to PyGILState\_Ensure and one call to PyGILState\_Release Loads the Python module called cocotb and calls the \_initialise\_testbench function int `get_module_ref`(_const_ char \*_modname_, PyObject \*\*_mod_)[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/gpi__embed_8cpp.html#_CPPv414get_module_refPKcPP8PyObject "Permalink to this definition") int `embed_sim_init`(int _argc_, char _const_ \*_const_ \*_argv_) void `embed_sim_event`(gpi\_event\_t _level_, _const_ char \*_msg_) Functions void `set_program_name_in_venv`(void)[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/gpi__embed_8cpp.html#_CPPv424set_program_name_in_venvv "Permalink to this definition") Variables PyThreadState \*`gtstate` = NULL[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/gpi__embed_8cpp.html#_CPPv47gtstate "Permalink to this definition") `wchar_t progname [] = L"cocotb"` wchar\_t \*`argv`\[\] = {progname}[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/gpi__embed_8cpp.html#_CPPv44argv "Permalink to this definition") _const_ char \*`PYTHON_INTERPRETER_PATH` = "/bin/python"[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/gpi__embed_8cpp.html#_CPPv423PYTHON_INTERPRETER_PATH "Permalink to this definition") PyObject \*`pEventFn` = NULL[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/gpi__embed_8cpp.html#_CPPv48pEventFn "Permalink to this definition") --- # File gpi_logging.cpp — cocotb 1.4.0 documentation * [](https://docs.cocotb.org/en/v1.4.0/index.html) » * [C Code Library Reference](https://docs.cocotb.org/en/v1.4.0/library_reference_c.html) » * [File list](https://docs.cocotb.org/en/v1.4.0/generated/filelist.html) » * File gpi\_logging.cpp * [Edit on GitHub](https://github.com/cocotb/cocotb/blob/v1.4.0/documentation/source/generated/file/gpi__logging_8cpp.rst) * * * File gpi\_logging.cpp[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/gpi__logging_8cpp.html#file-gpi-logging-cpp "Permalink to this headline") ==================================================================================================================================================== GPI logging Write a log message using cocotb SimLog class GILState before calling: Unknown GILState after calling: Unknown Makes one call to PyGILState\_Ensure and one call to PyGILState\_Release If the Python logging mechanism is not initialised, dumps to `stderr`. void `gpi_log_v`(_const_ char \*_name_, _enum_ [gpi\_log\_levels](https://docs.cocotb.org/en/v1.4.0/generated/file/gpi__logging_8h.html#_CPPv414gpi_log_levels "gpi_log_levels") _level_, _const_ char \*_pathname_, _const_ char \*_funcname_, long _lineno_, _const_ char \*_msg_, va\_list _argp_)[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/gpi__logging_8cpp.html#_CPPv49gpi_log_vPKc14gpi_log_levelsPKcPKclPKc7va_list "Permalink to this definition") void `gpi_log`(_const_ char \*_name_, _enum_ [gpi\_log\_levels](https://docs.cocotb.org/en/v1.4.0/generated/file/gpi__logging_8h.html#_CPPv414gpi_log_levels "gpi_log_levels") _level_, _const_ char \*_pathname_, _const_ char \*_funcname_, long _lineno_, _const_ char \*_msg_, ...)[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/gpi__logging_8cpp.html#_CPPv47gpi_logPKc14gpi_log_levelsPKcPKclPKcz "Permalink to this definition") Defines `LOG_SIZE` 512[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/gpi__logging_8cpp.html#c.LOG_SIZE "Permalink to this definition") Functions void `set_log_handler`(void \*_handler_)[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/gpi__logging_8cpp.html#_CPPv415set_log_handlerPv "Permalink to this definition") void `clear_log_handler`(void)[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/gpi__logging_8cpp.html#_CPPv417clear_log_handlerv "Permalink to this definition") void `set_log_filter`(void \*_filter_)[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/gpi__logging_8cpp.html#_CPPv414set_log_filterPv "Permalink to this definition") void `clear_log_filter`(void)[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/gpi__logging_8cpp.html#_CPPv416clear_log_filterv "Permalink to this definition") void `set_log_level`(_enum_ [gpi\_log\_levels](https://docs.cocotb.org/en/v1.4.0/generated/file/gpi__logging_8h.html#_CPPv414gpi_log_levels "gpi_log_levels") _new\_level_)[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/gpi__logging_8cpp.html#_CPPv413set_log_level14gpi_log_levels "Permalink to this definition") _const_ char \*`log_level`(long _level_)[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/gpi__logging_8cpp.html#_CPPv49log_levell "Permalink to this definition") void `gpi_log_native_v`(_const_ char \*_name_, _enum_ [gpi\_log\_levels](https://docs.cocotb.org/en/v1.4.0/generated/file/gpi__logging_8h.html#_CPPv414gpi_log_levels "gpi_log_levels") _level_, _const_ char \*_pathname_, _const_ char \*_funcname_, long _lineno_, _const_ char \*_msg_, va\_list _argp_)[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/gpi__logging_8cpp.html#_CPPv416gpi_log_native_vPKc14gpi_log_levelsPKcPKclPKc7va_list "Permalink to this definition") Log without going through the python hook. This is needed for both when the hook isn’t connected yet, and for when a python exception occurs while trying to use the hook. void `gpi_log_native`(_const_ char \*_name_, _enum_ [gpi\_log\_levels](https://docs.cocotb.org/en/v1.4.0/generated/file/gpi__logging_8h.html#_CPPv414gpi_log_levels "gpi_log_levels") _level_, _const_ char \*_pathname_, _const_ char \*_funcname_, long _lineno_, _const_ char \*_msg_, ...)[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/gpi__logging_8cpp.html#_CPPv414gpi_log_nativePKc14gpi_log_levelsPKcPKclPKcz "Permalink to this definition") Variables PyObject \*`pLogHandler` = NULL[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/gpi__logging_8cpp.html#_CPPv411pLogHandler "Permalink to this definition") PyObject \*`pLogFilter` = NULL[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/gpi__logging_8cpp.html#_CPPv410pLogFilter "Permalink to this definition") _enum_ [gpi\_log\_levels](https://docs.cocotb.org/en/v1.4.0/generated/file/gpi__logging_8h.html#_CPPv414gpi_log_levels "gpi_log_levels") `local_level` = [GPIInfo](https://docs.cocotb.org/en/v1.4.0/generated/file/gpi__logging_8h.html#_CPPv4N14gpi_log_levels7GPIInfoE "GPIInfo") [¶](https://docs.cocotb.org/en/v1.4.0/generated/file/gpi__logging_8cpp.html#_CPPv411local_level "Permalink to this definition") _struct_ [\_log\_level\_table](https://docs.cocotb.org/en/v1.4.0/generated/file/gpi__logging_8cpp.html#_CPPv416_log_level_table "_log_level_table") `log_level_table`\[\] = {{10, "DEBUG"}, {20, "INFO"}, {30, "WARNING"}, {40, "ERROR"}, {50, "CRITICAL"}, {0, NULL}}[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/gpi__logging_8cpp.html#_CPPv415log_level_table "Permalink to this definition") char `log_buff`\[`LOG_SIZE`\][¶](https://docs.cocotb.org/en/v1.4.0/generated/file/gpi__logging_8cpp.html#_CPPv48log_buff "Permalink to this definition") _struct_ `_log_level_table`[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/gpi__logging_8cpp.html#_CPPv416_log_level_table "Permalink to this definition") Public Members long `level`[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/gpi__logging_8cpp.html#_CPPv4N16_log_level_table5levelE "Permalink to this definition") _const_ char \*`levelname`[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/gpi__logging_8cpp.html#_CPPv4N16_log_level_table9levelnameE "Permalink to this definition") --- # File gpi_logging.h — cocotb 1.4.0 documentation * [](https://docs.cocotb.org/en/v1.4.0/index.html) » * [C Code Library Reference](https://docs.cocotb.org/en/v1.4.0/library_reference_c.html) » * [File list](https://docs.cocotb.org/en/v1.4.0/generated/filelist.html) » * File gpi\_logging.h * [Edit on GitHub](https://github.com/cocotb/cocotb/blob/v1.4.0/documentation/source/generated/file/gpi__logging_8h.rst) * * * File gpi\_logging.h[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/gpi__logging_8h.html#file-gpi-logging-h "Permalink to this headline") ============================================================================================================================================== Defines `EXTERN_C_START` `EXTERN_C_END` `LOG_DEBUG`(...) gpi\_log("cocotb.gpi", GPIDebug, \_\_FILE\_\_, \_\_func\_\_, \_\_LINE\_\_, \_\_VA\_ARGS\_\_);[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/gpi__logging_8h.html#c.LOG_DEBUG "Permalink to this definition") `LOG_INFO`(...) gpi\_log("cocotb.gpi", GPIInfo, \_\_FILE\_\_, \_\_func\_\_, \_\_LINE\_\_, \_\_VA\_ARGS\_\_);[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/gpi__logging_8h.html#c.LOG_INFO "Permalink to this definition") `LOG_WARN`(...) gpi\_log("cocotb.gpi", GPIWarning, \_\_FILE\_\_, \_\_func\_\_, \_\_LINE\_\_, \_\_VA\_ARGS\_\_);[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/gpi__logging_8h.html#c.LOG_WARN "Permalink to this definition") `LOG_ERROR`(...) gpi\_log("cocotb.gpi", GPIError, \_\_FILE\_\_, \_\_func\_\_, \_\_LINE\_\_, \_\_VA\_ARGS\_\_);[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/gpi__logging_8h.html#c.LOG_ERROR "Permalink to this definition") `LOG_CRITICAL`(...) gpi\_log("cocotb.gpi", GPICritical, \_\_FILE\_\_, \_\_func\_\_, \_\_LINE\_\_, \_\_VA\_ARGS\_\_);[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/gpi__logging_8h.html#c.LOG_CRITICAL "Permalink to this definition") Enums _enum_ `gpi_log_levels`[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/gpi__logging_8h.html#_CPPv414gpi_log_levels "Permalink to this definition") _Values:_ _enumerator_ `GPIDebug` = 10[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/gpi__logging_8h.html#_CPPv4N14gpi_log_levels8GPIDebugE "Permalink to this definition") _enumerator_ `GPIInfo` = 20[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/gpi__logging_8h.html#_CPPv4N14gpi_log_levels7GPIInfoE "Permalink to this definition") _enumerator_ `GPIWarning` = 30[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/gpi__logging_8h.html#_CPPv4N14gpi_log_levels10GPIWarningE "Permalink to this definition") _enumerator_ `GPIError` = 40[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/gpi__logging_8h.html#_CPPv4N14gpi_log_levels8GPIErrorE "Permalink to this definition") _enumerator_ `GPICritical` = 50[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/gpi__logging_8h.html#_CPPv4N14gpi_log_levels11GPICriticalE "Permalink to this definition") Functions void `set_log_handler`(void \*_handler_) void `clear_log_handler`(void) void `set_log_filter`(void \*_filter_) void `clear_log_filter`(void) void `set_log_level`(_enum_ [gpi\_log\_levels](https://docs.cocotb.org/en/v1.4.0/generated/file/gpi__logging_8h.html#_CPPv414gpi_log_levels "gpi_log_levels") _new\_level_) void `gpi_log`(_const_ char \*_name_, _enum_ [gpi\_log\_levels](https://docs.cocotb.org/en/v1.4.0/generated/file/gpi__logging_8h.html#_CPPv414gpi_log_levels "gpi_log_levels") _level_, _const_ char \*_pathname_, _const_ char \*_funcname_, long _lineno_, _const_ char \*_msg_, ...) --- # File gpi_priv.h — cocotb 1.4.0 documentation * [](https://docs.cocotb.org/en/v1.4.0/index.html) » * [C Code Library Reference](https://docs.cocotb.org/en/v1.4.0/library_reference_c.html) » * [File list](https://docs.cocotb.org/en/v1.4.0/generated/filelist.html) » * File gpi\_priv.h * [Edit on GitHub](https://github.com/cocotb/cocotb/blob/v1.4.0/documentation/source/generated/file/gpi__priv_8h.rst) * * * File gpi\_priv.h[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/gpi__priv_8h.html#file-gpi-priv-h "Permalink to this headline") ===================================================================================================================================== Defines `GPI_ENTRY_POINT`(_NAME_, _func_) extern “C” { \\ void NAME##\_entry\_point() \\ { \\ func(); \\ } \\ } [¶](https://docs.cocotb.org/en/v1.4.0/generated/file/gpi__priv_8h.html#c.GPI_ENTRY_POINT "Permalink to this definition") Typedefs _typedef_ _enum_ [gpi\_cb\_state](https://docs.cocotb.org/en/v1.4.0/generated/file/gpi__priv_8h.html#_CPPv412gpi_cb_state "gpi_cb_state") `gpi_cb_state_e`[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/gpi__priv_8h.html#_CPPv414gpi_cb_state_e "Permalink to this definition") _typedef_ void (\*`layer_entry_func`)()[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/gpi__priv_8h.html#_CPPv416layer_entry_func "Permalink to this definition") Enums _enum_ `gpi_cb_state`[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/gpi__priv_8h.html#_CPPv412gpi_cb_state "Permalink to this definition") _Values:_ _enumerator_ `GPI_FREE` = 0[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/gpi__priv_8h.html#_CPPv4N12gpi_cb_state8GPI_FREEE "Permalink to this definition") _enumerator_ `GPI_PRIMED` = 1[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/gpi__priv_8h.html#_CPPv4N12gpi_cb_state10GPI_PRIMEDE "Permalink to this definition") _enumerator_ `GPI_CALL` = 2[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/gpi__priv_8h.html#_CPPv4N12gpi_cb_state8GPI_CALLE "Permalink to this definition") _enumerator_ `GPI_REPRIME` = 3[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/gpi__priv_8h.html#_CPPv4N12gpi_cb_state11GPI_REPRIMEE "Permalink to this definition") _enumerator_ `GPI_DELETE` = 4[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/gpi__priv_8h.html#_CPPv4N12gpi_cb_state10GPI_DELETEE "Permalink to this definition") Functions int `gpi_register_impl`([GpiImplInterface](https://docs.cocotb.org/en/v1.4.0/generated/class/classGpiImplInterface.html#_CPPv416GpiImplInterface "GpiImplInterface") \*_func\_tbl_) void `gpi_embed_init`(int _argc_, char _const_ \*_const_ \*_argv_) void `gpi_cleanup`() void `gpi_embed_end`() void `gpi_embed_event`(gpi\_event\_t _level_, _const_ char \*_msg_) void `gpi_load_extra_libs`() _class_ `GpiHdl` Subclassed by [GpiCbHdl](https://docs.cocotb.org/en/v1.4.0/generated/file/gpi__priv_8h.html#classGpiCbHdl) , [GpiIterator](https://docs.cocotb.org/en/v1.4.0/generated/file/gpi__priv_8h.html#classGpiIterator) , [GpiObjHdl](https://docs.cocotb.org/en/v1.4.0/generated/file/gpi__priv_8h.html#classGpiObjHdl) Public Functions `GpiHdl`([GpiImplInterface](https://docs.cocotb.org/en/v1.4.0/generated/class/classGpiImplInterface.html#_CPPv416GpiImplInterface "GpiImplInterface") \*_impl_, void \*_hdl_ = NULL)[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/gpi__priv_8h.html#_CPPv4N6GpiHdl6GpiHdlEP16GpiImplInterfacePv "Permalink to this definition") `~GpiHdl`() = default[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/gpi__priv_8h.html#_CPPv4N6GpiHdlD0Ev "Permalink to this definition") template [T](https://docs.cocotb.org/en/v1.4.0/generated/file/gpi__priv_8h.html#_CPPv4I0ENK6GpiHdl10get_handleE1Tv "GpiHdl::get_handle::T") `get_handle`() _const_[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/gpi__priv_8h.html#_CPPv4I0ENK6GpiHdl10get_handleE1Tv "Permalink to this definition") bool `is_this_impl`([GpiImplInterface](https://docs.cocotb.org/en/v1.4.0/generated/class/classGpiImplInterface.html#_CPPv416GpiImplInterface "GpiImplInterface") \*_impl_)[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/gpi__priv_8h.html#_CPPv4N6GpiHdl12is_this_implEP16GpiImplInterface "Permalink to this definition") Public Members [GpiImplInterface](https://docs.cocotb.org/en/v1.4.0/generated/class/classGpiImplInterface.html#_CPPv416GpiImplInterface "GpiImplInterface") \*`m_impl`[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/gpi__priv_8h.html#_CPPv4N6GpiHdl6m_implE "Permalink to this definition") Protected Attributes void \*`m_obj_hdl`[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/gpi__priv_8h.html#_CPPv4N6GpiHdl9m_obj_hdlE "Permalink to this definition") Private Functions `GpiHdl`()[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/gpi__priv_8h.html#_CPPv4N6GpiHdl6GpiHdlEv "Permalink to this definition") _class_ `GpiObjHdl` : _public_ [GpiHdl](https://docs.cocotb.org/en/v1.4.0/generated/class/classGpiHdl.html#_CPPv46GpiHdl "GpiHdl") Subclassed by [FliObjHdl](https://docs.cocotb.org/en/v1.4.0/generated/file/FliImpl_8h.html#classFliObjHdl) , [GpiSignalObjHdl](https://docs.cocotb.org/en/v1.4.0/generated/file/gpi__priv_8h.html#classGpiSignalObjHdl) , [VhpiArrayObjHdl](https://docs.cocotb.org/en/v1.4.0/generated/file/VhpiImpl_8h.html#classVhpiArrayObjHdl) , [VhpiObjHdl](https://docs.cocotb.org/en/v1.4.0/generated/file/VhpiImpl_8h.html#classVhpiObjHdl) , [VpiArrayObjHdl](https://docs.cocotb.org/en/v1.4.0/generated/file/VpiImpl_8h.html#classVpiArrayObjHdl) , [VpiObjHdl](https://docs.cocotb.org/en/v1.4.0/generated/file/VpiImpl_8h.html#classVpiObjHdl) Public Functions `GpiObjHdl`([GpiImplInterface](https://docs.cocotb.org/en/v1.4.0/generated/class/classGpiImplInterface.html#_CPPv416GpiImplInterface "GpiImplInterface") \*_impl_, void \*_hdl_ = nullptr, [gpi\_objtype\_t](https://docs.cocotb.org/en/v1.4.0/generated/file/gpi_8h.html#_CPPv413gpi_objtype_t "gpi_objtype_t") _objtype_ = [GPI\_UNKNOWN](https://docs.cocotb.org/en/v1.4.0/generated/file/gpi_8h.html#_CPPv4N13gpi_objtype_e11GPI_UNKNOWNE "GPI_UNKNOWN") , bool _is\_const_ = false)[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/gpi__priv_8h.html#_CPPv4N9GpiObjHdl9GpiObjHdlEP16GpiImplInterfacePv13gpi_objtype_tb "Permalink to this definition") `~GpiObjHdl`() = default[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/gpi__priv_8h.html#_CPPv4N9GpiObjHdlD0Ev "Permalink to this definition") _const_ char \*`get_name_str`()[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/gpi__priv_8h.html#_CPPv4N9GpiObjHdl12get_name_strEv "Permalink to this definition") _const_ char \*`get_fullname_str`()[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/gpi__priv_8h.html#_CPPv4N9GpiObjHdl16get_fullname_strEv "Permalink to this definition") _const_ char \*`get_type_str`()[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/gpi__priv_8h.html#_CPPv4N9GpiObjHdl12get_type_strEv "Permalink to this definition") [gpi\_objtype\_t](https://docs.cocotb.org/en/v1.4.0/generated/file/gpi_8h.html#_CPPv413gpi_objtype_t "gpi_objtype_t") `get_type`()[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/gpi__priv_8h.html#_CPPv4N9GpiObjHdl8get_typeEv "Permalink to this definition") bool `get_const`()[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/gpi__priv_8h.html#_CPPv4N9GpiObjHdl9get_constEv "Permalink to this definition") int `get_num_elems`()[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/gpi__priv_8h.html#_CPPv4N9GpiObjHdl13get_num_elemsEv "Permalink to this definition") int `get_range_left`()[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/gpi__priv_8h.html#_CPPv4N9GpiObjHdl14get_range_leftEv "Permalink to this definition") int `get_range_right`()[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/gpi__priv_8h.html#_CPPv4N9GpiObjHdl15get_range_rightEv "Permalink to this definition") int `get_indexable`()[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/gpi__priv_8h.html#_CPPv4N9GpiObjHdl13get_indexableEv "Permalink to this definition") _const_ [std](https://docs.cocotb.org/en/v1.4.0/generated/file/GpiCommon_8cpp.html#_CPPv4St "std") ::string &`get_name`()[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/gpi__priv_8h.html#_CPPv4N9GpiObjHdl8get_nameEv "Permalink to this definition") _const_ [std](https://docs.cocotb.org/en/v1.4.0/generated/file/GpiCommon_8cpp.html#_CPPv4St "std") ::string &`get_fullname`()[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/gpi__priv_8h.html#_CPPv4N9GpiObjHdl12get_fullnameEv "Permalink to this definition") _const_ char \*`get_definition_name`()[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/gpi__priv_8h.html#_CPPv4N9GpiObjHdl19get_definition_nameEv "Permalink to this definition") _const_ char \*`get_definition_file`()[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/gpi__priv_8h.html#_CPPv4N9GpiObjHdl19get_definition_fileEv "Permalink to this definition") bool `is_native_impl`([GpiImplInterface](https://docs.cocotb.org/en/v1.4.0/generated/class/classGpiImplInterface.html#_CPPv416GpiImplInterface "GpiImplInterface") \*_impl_)[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/gpi__priv_8h.html#_CPPv4N9GpiObjHdl14is_native_implEP16GpiImplInterface "Permalink to this definition") int `initialise`([std](https://docs.cocotb.org/en/v1.4.0/generated/file/GpiCommon_8cpp.html#_CPPv4St "std") ::string &_name_, [std](https://docs.cocotb.org/en/v1.4.0/generated/file/GpiCommon_8cpp.html#_CPPv4St "std") ::string &_full\_name_)[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/gpi__priv_8h.html#_CPPv4N9GpiObjHdl10initialiseERNSt6stringERNSt6stringE "Permalink to this definition") Protected Attributes int `m_num_elems` = 0[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/gpi__priv_8h.html#_CPPv4N9GpiObjHdl11m_num_elemsE "Permalink to this definition") bool `m_indexable` = false[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/gpi__priv_8h.html#_CPPv4N9GpiObjHdl11m_indexableE "Permalink to this definition") int `m_range_left` = -1[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/gpi__priv_8h.html#_CPPv4N9GpiObjHdl12m_range_leftE "Permalink to this definition") int `m_range_right` = -1[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/gpi__priv_8h.html#_CPPv4N9GpiObjHdl13m_range_rightE "Permalink to this definition") [std](https://docs.cocotb.org/en/v1.4.0/generated/file/GpiCommon_8cpp.html#_CPPv4St "std") ::string `m_name`[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/gpi__priv_8h.html#_CPPv4N9GpiObjHdl6m_nameE "Permalink to this definition") [std](https://docs.cocotb.org/en/v1.4.0/generated/file/GpiCommon_8cpp.html#_CPPv4St "std") ::string `m_fullname` = "unknown"[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/gpi__priv_8h.html#_CPPv4N9GpiObjHdl10m_fullnameE "Permalink to this definition") [std](https://docs.cocotb.org/en/v1.4.0/generated/file/GpiCommon_8cpp.html#_CPPv4St "std") ::string `m_definition_name`[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/gpi__priv_8h.html#_CPPv4N9GpiObjHdl17m_definition_nameE "Permalink to this definition") [std](https://docs.cocotb.org/en/v1.4.0/generated/file/GpiCommon_8cpp.html#_CPPv4St "std") ::string `m_definition_file`[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/gpi__priv_8h.html#_CPPv4N9GpiObjHdl17m_definition_fileE "Permalink to this definition") [gpi\_objtype\_t](https://docs.cocotb.org/en/v1.4.0/generated/file/gpi_8h.html#_CPPv413gpi_objtype_t "gpi_objtype_t") `m_type`[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/gpi__priv_8h.html#_CPPv4N9GpiObjHdl6m_typeE "Permalink to this definition") bool `m_const`[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/gpi__priv_8h.html#_CPPv4N9GpiObjHdl7m_constE "Permalink to this definition") _class_ `GpiSignalObjHdl` : _public_ [GpiObjHdl](https://docs.cocotb.org/en/v1.4.0/generated/class/classGpiObjHdl.html#_CPPv49GpiObjHdl "GpiObjHdl") Subclassed by [FliSignalObjHdl](https://docs.cocotb.org/en/v1.4.0/generated/file/FliImpl_8h.html#classFliSignalObjHdl) , [VhpiSignalObjHdl](https://docs.cocotb.org/en/v1.4.0/generated/file/VhpiImpl_8h.html#classVhpiSignalObjHdl) , [VpiSignalObjHdl](https://docs.cocotb.org/en/v1.4.0/generated/file/VpiImpl_8h.html#classVpiSignalObjHdl) Public Functions `~GpiSignalObjHdl`() = default[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/gpi__priv_8h.html#_CPPv4N15GpiSignalObjHdlD0Ev "Permalink to this definition") _const_ char \*`get_signal_value_binstr`() = 0[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/gpi__priv_8h.html#_CPPv4N15GpiSignalObjHdl23get_signal_value_binstrEv "Permalink to this definition") _const_ char \*`get_signal_value_str`() = 0[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/gpi__priv_8h.html#_CPPv4N15GpiSignalObjHdl20get_signal_value_strEv "Permalink to this definition") double `get_signal_value_real`() = 0[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/gpi__priv_8h.html#_CPPv4N15GpiSignalObjHdl21get_signal_value_realEv "Permalink to this definition") long `get_signal_value_long`() = 0[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/gpi__priv_8h.html#_CPPv4N15GpiSignalObjHdl21get_signal_value_longEv "Permalink to this definition") int `set_signal_value`(_const_ long _value_, [gpi\_set\_action\_t](https://docs.cocotb.org/en/v1.4.0/generated/file/gpi_8h.html#_CPPv416gpi_set_action_t "gpi_set_action_t") _action_) = 0[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/gpi__priv_8h.html#_CPPv4N15GpiSignalObjHdl16set_signal_valueEKl16gpi_set_action_t "Permalink to this definition") int `set_signal_value`(_const_ double _value_, [gpi\_set\_action\_t](https://docs.cocotb.org/en/v1.4.0/generated/file/gpi_8h.html#_CPPv416gpi_set_action_t "gpi_set_action_t") _action_) = 0[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/gpi__priv_8h.html#_CPPv4N15GpiSignalObjHdl16set_signal_valueEKd16gpi_set_action_t "Permalink to this definition") int `set_signal_value_str`([std](https://docs.cocotb.org/en/v1.4.0/generated/file/GpiCommon_8cpp.html#_CPPv4St "std") ::string &_value_, [gpi\_set\_action\_t](https://docs.cocotb.org/en/v1.4.0/generated/file/gpi_8h.html#_CPPv416gpi_set_action_t "gpi_set_action_t") _action_) = 0[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/gpi__priv_8h.html#_CPPv4N15GpiSignalObjHdl20set_signal_value_strERNSt6stringE16gpi_set_action_t "Permalink to this definition") int `set_signal_value_binstr`([std](https://docs.cocotb.org/en/v1.4.0/generated/file/GpiCommon_8cpp.html#_CPPv4St "std") ::string &_value_, [gpi\_set\_action\_t](https://docs.cocotb.org/en/v1.4.0/generated/file/gpi_8h.html#_CPPv416gpi_set_action_t "gpi_set_action_t") _action_) = 0[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/gpi__priv_8h.html#_CPPv4N15GpiSignalObjHdl23set_signal_value_binstrERNSt6stringE16gpi_set_action_t "Permalink to this definition") [GpiCbHdl](https://docs.cocotb.org/en/v1.4.0/generated/class/classGpiCbHdl.html#_CPPv48GpiCbHdl "GpiCbHdl") \*`value_change_cb`(int _edge_) = 0[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/gpi__priv_8h.html#_CPPv4N15GpiSignalObjHdl15value_change_cbEi "Permalink to this definition") Public Members int `m_length` = 0[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/gpi__priv_8h.html#_CPPv4N15GpiSignalObjHdl8m_lengthE "Permalink to this definition") _class_ `GpiCbHdl` : _public_ [GpiHdl](https://docs.cocotb.org/en/v1.4.0/generated/class/classGpiHdl.html#_CPPv46GpiHdl "GpiHdl") Subclassed by [FliProcessCbHdl](https://docs.cocotb.org/en/v1.4.0/generated/file/FliImpl_8h.html#classFliProcessCbHdl) , [GpiValueCbHdl](https://docs.cocotb.org/en/v1.4.0/generated/file/gpi__priv_8h.html#classGpiValueCbHdl) , [VhpiCbHdl](https://docs.cocotb.org/en/v1.4.0/generated/file/VhpiImpl_8h.html#classVhpiCbHdl) , [VpiCbHdl](https://docs.cocotb.org/en/v1.4.0/generated/file/VpiImpl_8h.html#classVpiCbHdl) Public Functions `GpiCbHdl`([GpiImplInterface](https://docs.cocotb.org/en/v1.4.0/generated/class/classGpiImplInterface.html#_CPPv416GpiImplInterface "GpiImplInterface") \*_impl_)[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/gpi__priv_8h.html#_CPPv4N8GpiCbHdl8GpiCbHdlEP16GpiImplInterface "Permalink to this definition") int `arm_callback`() = 0[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/gpi__priv_8h.html#_CPPv4N8GpiCbHdl12arm_callbackEv "Permalink to this definition") int `run_callback`()[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/gpi__priv_8h.html#_CPPv4N8GpiCbHdl12run_callbackEv "Permalink to this definition") int `cleanup_callback`() = 0[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/gpi__priv_8h.html#_CPPv4N8GpiCbHdl16cleanup_callbackEv "Permalink to this definition") int `set_user_data`(int (\*_gpi\_function_)(_const_ void\*), _const_ void \*_data_, )[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/gpi__priv_8h.html#_CPPv4N8GpiCbHdl13set_user_dataEPFiPKvEPKv "Permalink to this definition") _const_ void \*`get_user_data`()[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/gpi__priv_8h.html#_CPPv4N8GpiCbHdl13get_user_dataEv "Permalink to this definition") void `set_call_state`([gpi\_cb\_state\_e](https://docs.cocotb.org/en/v1.4.0/generated/file/gpi__priv_8h.html#_CPPv414gpi_cb_state_e "gpi_cb_state_e") _new\_state_)[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/gpi__priv_8h.html#_CPPv4N8GpiCbHdl14set_call_stateE14gpi_cb_state_e "Permalink to this definition") [gpi\_cb\_state\_e](https://docs.cocotb.org/en/v1.4.0/generated/file/gpi__priv_8h.html#_CPPv414gpi_cb_state_e "gpi_cb_state_e") `get_call_state`()[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/gpi__priv_8h.html#_CPPv4N8GpiCbHdl14get_call_stateEv "Permalink to this definition") `~GpiCbHdl`()[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/gpi__priv_8h.html#_CPPv4N8GpiCbHdlD0Ev "Permalink to this definition") Protected Attributes `int(* gpi_function )(const void *) = nullptr` _const_ void \*`m_cb_data` = nullptr[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/gpi__priv_8h.html#_CPPv4N8GpiCbHdl9m_cb_dataE "Permalink to this definition") [gpi\_cb\_state\_e](https://docs.cocotb.org/en/v1.4.0/generated/file/gpi__priv_8h.html#_CPPv414gpi_cb_state_e "gpi_cb_state_e") `m_state` = [GPI\_FREE](https://docs.cocotb.org/en/v1.4.0/generated/file/gpi__priv_8h.html#_CPPv4N12gpi_cb_state8GPI_FREEE "GPI_FREE") [¶](https://docs.cocotb.org/en/v1.4.0/generated/file/gpi__priv_8h.html#_CPPv4N8GpiCbHdl7m_stateE "Permalink to this definition") _class_ `GpiValueCbHdl` : _public_ _virtual_ [GpiCbHdl](https://docs.cocotb.org/en/v1.4.0/generated/class/classGpiCbHdl.html#_CPPv48GpiCbHdl "GpiCbHdl") Subclassed by [FliSignalCbHdl](https://docs.cocotb.org/en/v1.4.0/generated/file/FliImpl_8h.html#classFliSignalCbHdl) , [VhpiValueCbHdl](https://docs.cocotb.org/en/v1.4.0/generated/file/VhpiImpl_8h.html#classVhpiValueCbHdl) , [VpiValueCbHdl](https://docs.cocotb.org/en/v1.4.0/generated/file/VpiImpl_8h.html#classVpiValueCbHdl) Public Functions `GpiValueCbHdl`([GpiImplInterface](https://docs.cocotb.org/en/v1.4.0/generated/class/classGpiImplInterface.html#_CPPv416GpiImplInterface "GpiImplInterface") \*_impl_, [GpiSignalObjHdl](https://docs.cocotb.org/en/v1.4.0/generated/class/classGpiSignalObjHdl.html#_CPPv415GpiSignalObjHdl "GpiSignalObjHdl") \*_signal_, int _edge_)[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/gpi__priv_8h.html#_CPPv4N13GpiValueCbHdl13GpiValueCbHdlEP16GpiImplInterfaceP15GpiSignalObjHdli "Permalink to this definition") int `run_callback`() _override_[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/gpi__priv_8h.html#_CPPv4N13GpiValueCbHdl12run_callbackEv "Permalink to this definition") Protected Attributes [std](https://docs.cocotb.org/en/v1.4.0/generated/file/GpiCommon_8cpp.html#_CPPv4St "std") ::string `required_value`[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/gpi__priv_8h.html#_CPPv4N13GpiValueCbHdl14required_valueE "Permalink to this definition") [GpiSignalObjHdl](https://docs.cocotb.org/en/v1.4.0/generated/class/classGpiSignalObjHdl.html#_CPPv415GpiSignalObjHdl "GpiSignalObjHdl") \*`m_signal`[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/gpi__priv_8h.html#_CPPv4N13GpiValueCbHdl8m_signalE "Permalink to this definition") _class_ `GpiIterator` : _public_ [GpiHdl](https://docs.cocotb.org/en/v1.4.0/generated/class/classGpiHdl.html#_CPPv46GpiHdl "GpiHdl") Subclassed by [FliIterator](https://docs.cocotb.org/en/v1.4.0/generated/file/FliImpl_8h.html#classFliIterator) , [VhpiIterator](https://docs.cocotb.org/en/v1.4.0/generated/file/VhpiImpl_8h.html#classVhpiIterator) , [VpiIterator](https://docs.cocotb.org/en/v1.4.0/generated/file/VpiImpl_8h.html#classVpiIterator) , [VpiSingleIterator](https://docs.cocotb.org/en/v1.4.0/generated/file/VpiImpl_8h.html#classVpiSingleIterator) Public Types _enum_ `Status`[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/gpi__priv_8h.html#_CPPv4N11GpiIterator6StatusE "Permalink to this definition") _Values:_ _enumerator_ `NATIVE`[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/gpi__priv_8h.html#_CPPv4N11GpiIterator6Status6NATIVEE "Permalink to this definition") _enumerator_ `NATIVE_NO_NAME`[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/gpi__priv_8h.html#_CPPv4N11GpiIterator6Status14NATIVE_NO_NAMEE "Permalink to this definition") _enumerator_ `NOT_NATIVE`[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/gpi__priv_8h.html#_CPPv4N11GpiIterator6Status10NOT_NATIVEE "Permalink to this definition") _enumerator_ `NOT_NATIVE_NO_NAME`[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/gpi__priv_8h.html#_CPPv4N11GpiIterator6Status18NOT_NATIVE_NO_NAMEE "Permalink to this definition") _enumerator_ `END`[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/gpi__priv_8h.html#_CPPv4N11GpiIterator6Status3ENDE "Permalink to this definition") Public Functions `GpiIterator`([GpiImplInterface](https://docs.cocotb.org/en/v1.4.0/generated/class/classGpiImplInterface.html#_CPPv416GpiImplInterface "GpiImplInterface") \*_impl_, [GpiObjHdl](https://docs.cocotb.org/en/v1.4.0/generated/class/classGpiObjHdl.html#_CPPv49GpiObjHdl "GpiObjHdl") \*_hdl_)[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/gpi__priv_8h.html#_CPPv4N11GpiIterator11GpiIteratorEP16GpiImplInterfaceP9GpiObjHdl "Permalink to this definition") `~GpiIterator`() = default[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/gpi__priv_8h.html#_CPPv4N11GpiIteratorD0Ev "Permalink to this definition") [Status](https://docs.cocotb.org/en/v1.4.0/generated/file/gpi__priv_8h.html#_CPPv4N11GpiIterator6StatusE "GpiIterator::Status") `next_handle`([std](https://docs.cocotb.org/en/v1.4.0/generated/file/GpiCommon_8cpp.html#_CPPv4St "std") ::string &_name_, [GpiObjHdl](https://docs.cocotb.org/en/v1.4.0/generated/class/classGpiObjHdl.html#_CPPv49GpiObjHdl "GpiObjHdl") \*\*_hdl_, void \*\*_raw\_hdl_)[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/gpi__priv_8h.html#_CPPv4N11GpiIterator11next_handleERNSt6stringEPP9GpiObjHdlPPv "Permalink to this definition") [GpiObjHdl](https://docs.cocotb.org/en/v1.4.0/generated/class/classGpiObjHdl.html#_CPPv49GpiObjHdl "GpiObjHdl") \*`get_parent`()[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/gpi__priv_8h.html#_CPPv4N11GpiIterator10get_parentEv "Permalink to this definition") Protected Attributes [GpiObjHdl](https://docs.cocotb.org/en/v1.4.0/generated/class/classGpiObjHdl.html#_CPPv49GpiObjHdl "GpiObjHdl") \*`m_parent`[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/gpi__priv_8h.html#_CPPv4N11GpiIterator8m_parentE "Permalink to this definition") template _class_ `GpiIteratorMapping` Public Functions `GpiIteratorMapping`(void (\*_populate_)([GpiIteratorMapping](https://docs.cocotb.org/en/v1.4.0/generated/file/gpi__priv_8h.html#_CPPv4N18GpiIteratorMapping18GpiIteratorMappingEPFvR18GpiIteratorMappingI2Ti2TmEE "GpiIteratorMapping::GpiIteratorMapping") <[Ti](https://docs.cocotb.org/en/v1.4.0/generated/class/classGpiIteratorMapping.html#_CPPv4I00E18GpiIteratorMapping "GpiIteratorMapping::Ti") , [Tm](https://docs.cocotb.org/en/v1.4.0/generated/class/classGpiIteratorMapping.html#_CPPv4I00E18GpiIteratorMapping "GpiIteratorMapping::Tm") \>&))[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/gpi__priv_8h.html#_CPPv4N18GpiIteratorMapping18GpiIteratorMappingEPFvR18GpiIteratorMappingI2Ti2TmEE "Permalink to this definition") [std](https://docs.cocotb.org/en/v1.4.0/generated/file/GpiCommon_8cpp.html#_CPPv4St "std") ::vector<[Tm](https://docs.cocotb.org/en/v1.4.0/generated/class/classGpiIteratorMapping.html#_CPPv4I00E18GpiIteratorMapping "GpiIteratorMapping::Tm") \> \*`get_options`([Ti](https://docs.cocotb.org/en/v1.4.0/generated/class/classGpiIteratorMapping.html#_CPPv4I00E18GpiIteratorMapping "GpiIteratorMapping::Ti") _type_)[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/gpi__priv_8h.html#_CPPv4N18GpiIteratorMapping11get_optionsE2Ti "Permalink to this definition") void `add_to_options`([Ti](https://docs.cocotb.org/en/v1.4.0/generated/class/classGpiIteratorMapping.html#_CPPv4I00E18GpiIteratorMapping "GpiIteratorMapping::Ti") _type_, [Tm](https://docs.cocotb.org/en/v1.4.0/generated/class/classGpiIteratorMapping.html#_CPPv4I00E18GpiIteratorMapping "GpiIteratorMapping::Tm") \*_options_)[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/gpi__priv_8h.html#_CPPv4N18GpiIteratorMapping14add_to_optionsE2TiP2Tm "Permalink to this definition") Private Members [std](https://docs.cocotb.org/en/v1.4.0/generated/file/GpiCommon_8cpp.html#_CPPv4St "std") ::map<[Ti](https://docs.cocotb.org/en/v1.4.0/generated/class/classGpiIteratorMapping.html#_CPPv4I00E18GpiIteratorMapping "GpiIteratorMapping::Ti") , [std](https://docs.cocotb.org/en/v1.4.0/generated/file/GpiCommon_8cpp.html#_CPPv4St "std") ::vector<[Tm](https://docs.cocotb.org/en/v1.4.0/generated/class/classGpiIteratorMapping.html#_CPPv4I00E18GpiIteratorMapping "GpiIteratorMapping::Tm") \>> `options_map`[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/gpi__priv_8h.html#_CPPv4N18GpiIteratorMapping11options_mapE "Permalink to this definition") _class_ `GpiImplInterface` Subclassed by [FliImpl](https://docs.cocotb.org/en/v1.4.0/generated/file/FliImpl_8h.html#classFliImpl) , [VhpiImpl](https://docs.cocotb.org/en/v1.4.0/generated/file/VhpiImpl_8h.html#classVhpiImpl) , [VpiImpl](https://docs.cocotb.org/en/v1.4.0/generated/file/VpiImpl_8h.html#classVpiImpl) Public Functions `GpiImplInterface`(_const_ [std](https://docs.cocotb.org/en/v1.4.0/generated/file/GpiCommon_8cpp.html#_CPPv4St "std") ::string &_name_)[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/gpi__priv_8h.html#_CPPv4N16GpiImplInterface16GpiImplInterfaceERKNSt6stringE "Permalink to this definition") _const_ char \*`get_name_c`()[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/gpi__priv_8h.html#_CPPv4N16GpiImplInterface10get_name_cEv "Permalink to this definition") _const_ [std](https://docs.cocotb.org/en/v1.4.0/generated/file/GpiCommon_8cpp.html#_CPPv4St "std") ::string &`get_name_s`()[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/gpi__priv_8h.html#_CPPv4N16GpiImplInterface10get_name_sEv "Permalink to this definition") `~GpiImplInterface`() = default[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/gpi__priv_8h.html#_CPPv4N16GpiImplInterfaceD0Ev "Permalink to this definition") void `sim_end`() = 0[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/gpi__priv_8h.html#_CPPv4N16GpiImplInterface7sim_endEv "Permalink to this definition") void `get_sim_time`(uint32\_t \*_high_, uint32\_t \*_low_) = 0[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/gpi__priv_8h.html#_CPPv4N16GpiImplInterface12get_sim_timeEP8uint32_tP8uint32_t "Permalink to this definition") void `get_sim_precision`(int32\_t \*_precision_) = 0[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/gpi__priv_8h.html#_CPPv4N16GpiImplInterface17get_sim_precisionEP7int32_t "Permalink to this definition") _const_ char \*`get_simulator_product`() = 0[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/gpi__priv_8h.html#_CPPv4N16GpiImplInterface21get_simulator_productEv "Permalink to this definition") _const_ char \*`get_simulator_version`() = 0[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/gpi__priv_8h.html#_CPPv4N16GpiImplInterface21get_simulator_versionEv "Permalink to this definition") [GpiObjHdl](https://docs.cocotb.org/en/v1.4.0/generated/class/classGpiObjHdl.html#_CPPv49GpiObjHdl "GpiObjHdl") \*`native_check_create`([std](https://docs.cocotb.org/en/v1.4.0/generated/file/GpiCommon_8cpp.html#_CPPv4St "std") ::string &_name_, [GpiObjHdl](https://docs.cocotb.org/en/v1.4.0/generated/class/classGpiObjHdl.html#_CPPv49GpiObjHdl "GpiObjHdl") \*_parent_) = 0[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/gpi__priv_8h.html#_CPPv4N16GpiImplInterface19native_check_createERNSt6stringEP9GpiObjHdl "Permalink to this definition") [GpiObjHdl](https://docs.cocotb.org/en/v1.4.0/generated/class/classGpiObjHdl.html#_CPPv49GpiObjHdl "GpiObjHdl") \*`native_check_create`(int32\_t _index_, [GpiObjHdl](https://docs.cocotb.org/en/v1.4.0/generated/class/classGpiObjHdl.html#_CPPv49GpiObjHdl "GpiObjHdl") \*_parent_) = 0[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/gpi__priv_8h.html#_CPPv4N16GpiImplInterface19native_check_createE7int32_tP9GpiObjHdl "Permalink to this definition") [GpiObjHdl](https://docs.cocotb.org/en/v1.4.0/generated/class/classGpiObjHdl.html#_CPPv49GpiObjHdl "GpiObjHdl") \*`native_check_create`(void \*_raw\_hdl_, [GpiObjHdl](https://docs.cocotb.org/en/v1.4.0/generated/class/classGpiObjHdl.html#_CPPv49GpiObjHdl "GpiObjHdl") \*_parent_) = 0[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/gpi__priv_8h.html#_CPPv4N16GpiImplInterface19native_check_createEPvP9GpiObjHdl "Permalink to this definition") [GpiObjHdl](https://docs.cocotb.org/en/v1.4.0/generated/class/classGpiObjHdl.html#_CPPv49GpiObjHdl "GpiObjHdl") \*`get_root_handle`(_const_ char \*_name_) = 0[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/gpi__priv_8h.html#_CPPv4N16GpiImplInterface15get_root_handleEPKc "Permalink to this definition") [GpiIterator](https://docs.cocotb.org/en/v1.4.0/generated/class/classGpiIterator.html#_CPPv411GpiIterator "GpiIterator") \*`iterate_handle`([GpiObjHdl](https://docs.cocotb.org/en/v1.4.0/generated/class/classGpiObjHdl.html#_CPPv49GpiObjHdl "GpiObjHdl") \*_obj\_hdl_, [gpi\_iterator\_sel\_t](https://docs.cocotb.org/en/v1.4.0/generated/file/gpi_8h.html#_CPPv418gpi_iterator_sel_t "gpi_iterator_sel_t") _type_) = 0[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/gpi__priv_8h.html#_CPPv4N16GpiImplInterface14iterate_handleEP9GpiObjHdl18gpi_iterator_sel_t "Permalink to this definition") [GpiCbHdl](https://docs.cocotb.org/en/v1.4.0/generated/class/classGpiCbHdl.html#_CPPv48GpiCbHdl "GpiCbHdl") \*`register_timed_callback`(uint64\_t _time\_ps_) = 0[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/gpi__priv_8h.html#_CPPv4N16GpiImplInterface23register_timed_callbackE8uint64_t "Permalink to this definition") [GpiCbHdl](https://docs.cocotb.org/en/v1.4.0/generated/class/classGpiCbHdl.html#_CPPv48GpiCbHdl "GpiCbHdl") \*`register_readonly_callback`() = 0[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/gpi__priv_8h.html#_CPPv4N16GpiImplInterface26register_readonly_callbackEv "Permalink to this definition") [GpiCbHdl](https://docs.cocotb.org/en/v1.4.0/generated/class/classGpiCbHdl.html#_CPPv48GpiCbHdl "GpiCbHdl") \*`register_nexttime_callback`() = 0[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/gpi__priv_8h.html#_CPPv4N16GpiImplInterface26register_nexttime_callbackEv "Permalink to this definition") [GpiCbHdl](https://docs.cocotb.org/en/v1.4.0/generated/class/classGpiCbHdl.html#_CPPv48GpiCbHdl "GpiCbHdl") \*`register_readwrite_callback`() = 0[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/gpi__priv_8h.html#_CPPv4N16GpiImplInterface27register_readwrite_callbackEv "Permalink to this definition") int `deregister_callback`([GpiCbHdl](https://docs.cocotb.org/en/v1.4.0/generated/class/classGpiCbHdl.html#_CPPv48GpiCbHdl "GpiCbHdl") \*_obj\_hdl_) = 0[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/gpi__priv_8h.html#_CPPv4N16GpiImplInterface19deregister_callbackEP8GpiCbHdl "Permalink to this definition") _const_ char \*`reason_to_string`(int _reason_) = 0[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/gpi__priv_8h.html#_CPPv4N16GpiImplInterface16reason_to_stringEi "Permalink to this definition") Protected Attributes [std](https://docs.cocotb.org/en/v1.4.0/generated/file/GpiCommon_8cpp.html#_CPPv4St "std") ::string `m_product`[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/gpi__priv_8h.html#_CPPv4N16GpiImplInterface9m_productE "Permalink to this definition") [std](https://docs.cocotb.org/en/v1.4.0/generated/file/GpiCommon_8cpp.html#_CPPv4St "std") ::string `m_version`[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/gpi__priv_8h.html#_CPPv4N16GpiImplInterface9m_versionE "Permalink to this definition") Private Members [std](https://docs.cocotb.org/en/v1.4.0/generated/file/GpiCommon_8cpp.html#_CPPv4St "std") ::string `m_name`[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/gpi__priv_8h.html#_CPPv4N16GpiImplInterface6m_nameE "Permalink to this definition") --- # File simulatormodule.cpp — cocotb 1.4.0 documentation * [](https://docs.cocotb.org/en/v1.4.0/index.html) » * [C Code Library Reference](https://docs.cocotb.org/en/v1.4.0/library_reference_c.html) » * [File list](https://docs.cocotb.org/en/v1.4.0/generated/filelist.html) » * File simulatormodule.cpp * [Edit on GitHub](https://github.com/cocotb/cocotb/blob/v1.4.0/documentation/source/generated/file/simulatormodule_8cpp.rst) * * * File simulatormodule.cpp[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/simulatormodule_8cpp.html#file-simulatormodule-cpp "Permalink to this headline") ============================================================================================================================================================== Callback Handling Handle a callback coming from GPI GILState before calling: Unknown GILState after calling: Unknown Makes one call to TAKE\_GIL and one call to DROP\_GIL Returns 0 on success or 1 on a failure. Handles a callback from the simulator, all of which call this function. We extract the associated context and find the Python function (usually cocotb.scheduler.react) calling it with a reference to the trigger that fired. The scheduler can then call next() on all the coroutines that are waiting on that particular trigger. TODO: * Tidy up return values * Ensure cleanup correctly in exception cases _struct_ PyModuleDef `moduledef` = {PyModuleDef\_HEAD\_INIT, MODULE\_NAME, NULL, -1, [SimulatorMethods](https://docs.cocotb.org/en/v1.4.0/generated/file/simulatormodule_8h.html#_CPPv416SimulatorMethods "SimulatorMethods") , NULL, NULL, NULL, NULL}[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/simulatormodule_8cpp.html#_CPPv49moduledef "Permalink to this definition") PyMethodDef `gpi_sim_hdl_methods`\[\][¶](https://docs.cocotb.org/en/v1.4.0/generated/file/simulatormodule_8cpp.html#_CPPv419gpi_sim_hdl_methods "Permalink to this definition") `PyMethodDef gpi_cb_hdl_methods [] = { {"deregister", (PyCFunction)deregister, METH_NOARGS, PyDoc_STR( "deregister($self)\n" "--\n\n" "deregister() -> None\n" "De-register this callback." )}, {NULL, NULL, 0, NULL} }` int `handle_gpi_callback`(void \*_user\_data_)[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/simulatormodule_8cpp.html#_CPPv419handle_gpi_callbackPv "Permalink to this definition") PyObject \*`log_msg`(PyObject \*_self_, PyObject \*_args_)[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/simulatormodule_8cpp.html#_CPPv47log_msgP8PyObjectP8PyObject "Permalink to this definition") [callback\_data](https://docs.cocotb.org/en/v1.4.0/generated/file/simulatormodule_8h.html#_CPPv413callback_data "callback_data") \*`callback_data_new`(PyObject \*_func_, PyObject \*_args_, PyObject \*_kwargs_)[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/simulatormodule_8cpp.html#_CPPv417callback_data_newP8PyObjectP8PyObjectP8PyObject "Permalink to this definition") PyObject \*`register_readonly_callback`(PyObject \*_self_, PyObject \*_args_)[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/simulatormodule_8cpp.html#_CPPv426register_readonly_callbackP8PyObjectP8PyObject "Permalink to this definition") PyObject \*`register_rwsynch_callback`(PyObject \*_self_, PyObject \*_args_)[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/simulatormodule_8cpp.html#_CPPv425register_rwsynch_callbackP8PyObjectP8PyObject "Permalink to this definition") PyObject \*`register_nextstep_callback`(PyObject \*_self_, PyObject \*_args_)[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/simulatormodule_8cpp.html#_CPPv426register_nextstep_callbackP8PyObjectP8PyObject "Permalink to this definition") PyObject \*`register_timed_callback`(PyObject \*_self_, PyObject \*_args_)[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/simulatormodule_8cpp.html#_CPPv423register_timed_callbackP8PyObjectP8PyObject "Permalink to this definition") PyObject \*`register_value_change_callback`(PyObject \*_self_, PyObject \*_args_)[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/simulatormodule_8cpp.html#_CPPv430register_value_change_callbackP8PyObjectP8PyObject "Permalink to this definition") PyObject \*`iterate`(gpi\_hdl\_Object<[gpi\_sim\_hdl](https://docs.cocotb.org/en/v1.4.0/generated/file/gpi_8h.html#_CPPv411gpi_sim_hdl "gpi_sim_hdl") \> \*_self_, PyObject \*_args_)[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/simulatormodule_8cpp.html#_CPPv47iterateP14gpi_hdl_ObjectI11gpi_sim_hdlEP8PyObject "Permalink to this definition") PyObject \*`next`(gpi\_hdl\_Object<[gpi\_iterator\_hdl](https://docs.cocotb.org/en/v1.4.0/generated/file/gpi_8h.html#_CPPv416gpi_iterator_hdl "gpi_iterator_hdl") \> \*_self_)[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/simulatormodule_8cpp.html#_CPPv44nextP14gpi_hdl_ObjectI16gpi_iterator_hdlE "Permalink to this definition") PyObject \*`get_signal_val_binstr`(gpi\_hdl\_Object<[gpi\_sim\_hdl](https://docs.cocotb.org/en/v1.4.0/generated/file/gpi_8h.html#_CPPv411gpi_sim_hdl "gpi_sim_hdl") \> \*_self_, PyObject \*_args_)[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/simulatormodule_8cpp.html#_CPPv421get_signal_val_binstrP14gpi_hdl_ObjectI11gpi_sim_hdlEP8PyObject "Permalink to this definition") PyObject \*`get_signal_val_str`(gpi\_hdl\_Object<[gpi\_sim\_hdl](https://docs.cocotb.org/en/v1.4.0/generated/file/gpi_8h.html#_CPPv411gpi_sim_hdl "gpi_sim_hdl") \> \*_self_, PyObject \*_args_)[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/simulatormodule_8cpp.html#_CPPv418get_signal_val_strP14gpi_hdl_ObjectI11gpi_sim_hdlEP8PyObject "Permalink to this definition") PyObject \*`get_signal_val_real`(gpi\_hdl\_Object<[gpi\_sim\_hdl](https://docs.cocotb.org/en/v1.4.0/generated/file/gpi_8h.html#_CPPv411gpi_sim_hdl "gpi_sim_hdl") \> \*_self_, PyObject \*_args_)[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/simulatormodule_8cpp.html#_CPPv419get_signal_val_realP14gpi_hdl_ObjectI11gpi_sim_hdlEP8PyObject "Permalink to this definition") PyObject \*`get_signal_val_long`(gpi\_hdl\_Object<[gpi\_sim\_hdl](https://docs.cocotb.org/en/v1.4.0/generated/file/gpi_8h.html#_CPPv411gpi_sim_hdl "gpi_sim_hdl") \> \*_self_, PyObject \*_args_)[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/simulatormodule_8cpp.html#_CPPv419get_signal_val_longP14gpi_hdl_ObjectI11gpi_sim_hdlEP8PyObject "Permalink to this definition") PyObject \*`set_signal_val_binstr`(gpi\_hdl\_Object<[gpi\_sim\_hdl](https://docs.cocotb.org/en/v1.4.0/generated/file/gpi_8h.html#_CPPv411gpi_sim_hdl "gpi_sim_hdl") \> \*_self_, PyObject \*_args_)[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/simulatormodule_8cpp.html#_CPPv421set_signal_val_binstrP14gpi_hdl_ObjectI11gpi_sim_hdlEP8PyObject "Permalink to this definition") PyObject \*`set_signal_val_str`(gpi\_hdl\_Object<[gpi\_sim\_hdl](https://docs.cocotb.org/en/v1.4.0/generated/file/gpi_8h.html#_CPPv411gpi_sim_hdl "gpi_sim_hdl") \> \*_self_, PyObject \*_args_)[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/simulatormodule_8cpp.html#_CPPv418set_signal_val_strP14gpi_hdl_ObjectI11gpi_sim_hdlEP8PyObject "Permalink to this definition") PyObject \*`set_signal_val_real`(gpi\_hdl\_Object<[gpi\_sim\_hdl](https://docs.cocotb.org/en/v1.4.0/generated/file/gpi_8h.html#_CPPv411gpi_sim_hdl "gpi_sim_hdl") \> \*_self_, PyObject \*_args_)[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/simulatormodule_8cpp.html#_CPPv419set_signal_val_realP14gpi_hdl_ObjectI11gpi_sim_hdlEP8PyObject "Permalink to this definition") PyObject \*`set_signal_val_long`(gpi\_hdl\_Object<[gpi\_sim\_hdl](https://docs.cocotb.org/en/v1.4.0/generated/file/gpi_8h.html#_CPPv411gpi_sim_hdl "gpi_sim_hdl") \> \*_self_, PyObject \*_args_)[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/simulatormodule_8cpp.html#_CPPv419set_signal_val_longP14gpi_hdl_ObjectI11gpi_sim_hdlEP8PyObject "Permalink to this definition") PyObject \*`get_definition_name`(gpi\_hdl\_Object<[gpi\_sim\_hdl](https://docs.cocotb.org/en/v1.4.0/generated/file/gpi_8h.html#_CPPv411gpi_sim_hdl "gpi_sim_hdl") \> \*_self_, PyObject \*_args_)[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/simulatormodule_8cpp.html#_CPPv419get_definition_nameP14gpi_hdl_ObjectI11gpi_sim_hdlEP8PyObject "Permalink to this definition") PyObject \*`get_definition_file`(gpi\_hdl\_Object<[gpi\_sim\_hdl](https://docs.cocotb.org/en/v1.4.0/generated/file/gpi_8h.html#_CPPv411gpi_sim_hdl "gpi_sim_hdl") \> \*_self_, PyObject \*_args_)[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/simulatormodule_8cpp.html#_CPPv419get_definition_fileP14gpi_hdl_ObjectI11gpi_sim_hdlEP8PyObject "Permalink to this definition") PyObject \*`get_handle_by_name`(gpi\_hdl\_Object<[gpi\_sim\_hdl](https://docs.cocotb.org/en/v1.4.0/generated/file/gpi_8h.html#_CPPv411gpi_sim_hdl "gpi_sim_hdl") \> \*_self_, PyObject \*_args_)[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/simulatormodule_8cpp.html#_CPPv418get_handle_by_nameP14gpi_hdl_ObjectI11gpi_sim_hdlEP8PyObject "Permalink to this definition") PyObject \*`get_handle_by_index`(gpi\_hdl\_Object<[gpi\_sim\_hdl](https://docs.cocotb.org/en/v1.4.0/generated/file/gpi_8h.html#_CPPv411gpi_sim_hdl "gpi_sim_hdl") \> \*_self_, PyObject \*_args_)[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/simulatormodule_8cpp.html#_CPPv419get_handle_by_indexP14gpi_hdl_ObjectI11gpi_sim_hdlEP8PyObject "Permalink to this definition") PyObject \*`get_root_handle`(PyObject \*_self_, PyObject \*_args_)[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/simulatormodule_8cpp.html#_CPPv415get_root_handleP8PyObjectP8PyObject "Permalink to this definition") PyObject \*`get_name_string`(gpi\_hdl\_Object<[gpi\_sim\_hdl](https://docs.cocotb.org/en/v1.4.0/generated/file/gpi_8h.html#_CPPv411gpi_sim_hdl "gpi_sim_hdl") \> \*_self_, PyObject \*_args_)[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/simulatormodule_8cpp.html#_CPPv415get_name_stringP14gpi_hdl_ObjectI11gpi_sim_hdlEP8PyObject "Permalink to this definition") PyObject \*`get_type`(gpi\_hdl\_Object<[gpi\_sim\_hdl](https://docs.cocotb.org/en/v1.4.0/generated/file/gpi_8h.html#_CPPv411gpi_sim_hdl "gpi_sim_hdl") \> \*_self_, PyObject \*_args_)[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/simulatormodule_8cpp.html#_CPPv48get_typeP14gpi_hdl_ObjectI11gpi_sim_hdlEP8PyObject "Permalink to this definition") PyObject \*`get_const`(gpi\_hdl\_Object<[gpi\_sim\_hdl](https://docs.cocotb.org/en/v1.4.0/generated/file/gpi_8h.html#_CPPv411gpi_sim_hdl "gpi_sim_hdl") \> \*_self_, PyObject \*_args_)[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/simulatormodule_8cpp.html#_CPPv49get_constP14gpi_hdl_ObjectI11gpi_sim_hdlEP8PyObject "Permalink to this definition") PyObject \*`get_type_string`(gpi\_hdl\_Object<[gpi\_sim\_hdl](https://docs.cocotb.org/en/v1.4.0/generated/file/gpi_8h.html#_CPPv411gpi_sim_hdl "gpi_sim_hdl") \> \*_self_, PyObject \*_args_)[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/simulatormodule_8cpp.html#_CPPv415get_type_stringP14gpi_hdl_ObjectI11gpi_sim_hdlEP8PyObject "Permalink to this definition") PyObject \*`is_running`(PyObject \*_self_, PyObject \*_args_)[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/simulatormodule_8cpp.html#_CPPv410is_runningP8PyObjectP8PyObject "Permalink to this definition") PyObject \*`get_sim_time`(PyObject \*_self_, PyObject \*_args_)[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/simulatormodule_8cpp.html#_CPPv412get_sim_timeP8PyObjectP8PyObject "Permalink to this definition") PyObject \*`get_precision`(PyObject \*_self_, PyObject \*_args_)[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/simulatormodule_8cpp.html#_CPPv413get_precisionP8PyObjectP8PyObject "Permalink to this definition") PyObject \*`get_simulator_product`(PyObject \*_m_, PyObject \*_args_)[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/simulatormodule_8cpp.html#_CPPv421get_simulator_productP8PyObjectP8PyObject "Permalink to this definition") PyObject \*`get_simulator_version`(PyObject \*_m_, PyObject \*_args_)[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/simulatormodule_8cpp.html#_CPPv421get_simulator_versionP8PyObjectP8PyObject "Permalink to this definition") PyObject \*`get_num_elems`(gpi\_hdl\_Object<[gpi\_sim\_hdl](https://docs.cocotb.org/en/v1.4.0/generated/file/gpi_8h.html#_CPPv411gpi_sim_hdl "gpi_sim_hdl") \> \*_self_, PyObject \*_args_)[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/simulatormodule_8cpp.html#_CPPv413get_num_elemsP14gpi_hdl_ObjectI11gpi_sim_hdlEP8PyObject "Permalink to this definition") PyObject \*`get_range`(gpi\_hdl\_Object<[gpi\_sim\_hdl](https://docs.cocotb.org/en/v1.4.0/generated/file/gpi_8h.html#_CPPv411gpi_sim_hdl "gpi_sim_hdl") \> \*_self_, PyObject \*_args_)[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/simulatormodule_8cpp.html#_CPPv49get_rangeP14gpi_hdl_ObjectI11gpi_sim_hdlEP8PyObject "Permalink to this definition") PyObject \*`stop_simulator`(PyObject \*_self_, PyObject \*_args_)[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/simulatormodule_8cpp.html#_CPPv414stop_simulatorP8PyObjectP8PyObject "Permalink to this definition") PyObject \*`deregister`(gpi\_hdl\_Object<[gpi\_cb\_hdl](https://docs.cocotb.org/en/v1.4.0/generated/file/gpi_8h.html#_CPPv410gpi_cb_hdl "gpi_cb_hdl") \> \*_self_, PyObject \*_args_)[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/simulatormodule_8cpp.html#_CPPv410deregisterP14gpi_hdl_ObjectI10gpi_cb_hdlEP8PyObject "Permalink to this definition") PyObject \*`log_level`(PyObject \*_self_, PyObject \*_args_)[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/simulatormodule_8cpp.html#_CPPv49log_levelP8PyObjectP8PyObject "Permalink to this definition") int `add_module_constants`(PyObject \*_simulator_)[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/simulatormodule_8cpp.html#_CPPv420add_module_constantsP8PyObject "Permalink to this definition") int `add_module_types`(PyObject \*_simulator_)[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/simulatormodule_8cpp.html#_CPPv416add_module_typesP8PyObject "Permalink to this definition") PyMODINIT\_FUNC `PyInit_simulator`(void)[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/simulatormodule_8cpp.html#_CPPv416PyInit_simulatorv "Permalink to this definition") Typedefs _typedef_ int (\*`gpi_function_t`)(_const_ void\*)[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/simulatormodule_8cpp.html#_CPPv414gpi_function_t "Permalink to this definition") Functions PyGILState\_STATE `TAKE_GIL`(void)[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/simulatormodule_8cpp.html#_CPPv48TAKE_GILv "Permalink to this definition") void `DROP_GIL`(PyGILState\_STATE _state_)[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/simulatormodule_8cpp.html#_CPPv48DROP_GIL16PyGILState_STATE "Permalink to this definition") Variables int `takes` = 0[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/simulatormodule_8cpp.html#_CPPv45takes "Permalink to this definition") int `releases` = 0[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/simulatormodule_8cpp.html#_CPPv48releases "Permalink to this definition") int `sim_ending` = 0[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/simulatormodule_8cpp.html#_CPPv410sim_ending "Permalink to this definition") _struct_ [sim\_time](https://docs.cocotb.org/en/v1.4.0/generated/file/simulatormodule_8cpp.html#_CPPv48sim_time "sim_time") `cache_time`[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/simulatormodule_8cpp.html#_CPPv410cache_time "Permalink to this definition") _struct_ `sim_time`[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/simulatormodule_8cpp.html#_CPPv48sim_time "Permalink to this definition") Public Members uint32\_t `high`[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/simulatormodule_8cpp.html#_CPPv4N8sim_time4highE "Permalink to this definition") uint32\_t `low`[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/simulatormodule_8cpp.html#_CPPv4N8sim_time3lowE "Permalink to this definition") --- # File simulatormodule.h — cocotb 1.4.0 documentation * [](https://docs.cocotb.org/en/v1.4.0/index.html) » * [C Code Library Reference](https://docs.cocotb.org/en/v1.4.0/library_reference_c.html) » * [File list](https://docs.cocotb.org/en/v1.4.0/generated/filelist.html) » * File simulatormodule.h * [Edit on GitHub](https://github.com/cocotb/cocotb/blob/v1.4.0/documentation/source/generated/file/simulatormodule_8h.rst) * * * File simulatormodule.h[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/simulatormodule_8h.html#file-simulatormodule-h "Permalink to this headline") ======================================================================================================================================================== Defines `COCOTB_ACTIVE_ID` 0xC0C07B[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/simulatormodule_8h.html#c.COCOTB_ACTIVE_ID "Permalink to this definition") `COCOTB_INACTIVE_ID` 0xDEADB175[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/simulatormodule_8h.html#c.COCOTB_INACTIVE_ID "Permalink to this definition") `MODULE_NAME` "simulator"[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/simulatormodule_8h.html#c.MODULE_NAME "Permalink to this definition") Functions PyObject \*`log_msg`(PyObject \*_self_, PyObject \*_args_) PyObject \*`register_timed_callback`(PyObject \*_self_, PyObject \*_args_) PyObject \*`register_value_change_callback`(PyObject \*_self_, PyObject \*_args_) PyObject \*`register_readonly_callback`(PyObject \*_self_, PyObject \*_args_) PyObject \*`register_nextstep_callback`(PyObject \*_self_, PyObject \*_args_) PyObject \*`register_rwsynch_callback`(PyObject \*_self_, PyObject \*_args_) PyObject \*`get_root_handle`(PyObject \*_self_, PyObject \*_args_) PyObject \*`stop_simulator`(PyObject \*_self_, PyObject \*_args_) PyObject \*`is_running`(PyObject \*_self_, PyObject \*_args_) PyObject \*`get_sim_time`(PyObject \*_self_, PyObject \*_args_) PyObject \*`get_precision`(PyObject \*_self_, PyObject \*_args_) PyObject \*`get_simulator_product`(PyObject \*_self_, PyObject \*_args_) PyObject \*`get_simulator_version`(PyObject \*_self_, PyObject \*_args_) PyObject \*`log_level`(PyObject \*_self_, PyObject \*_args_) Variables PyMethodDef `SimulatorMethods`\[\][¶](https://docs.cocotb.org/en/v1.4.0/generated/file/simulatormodule_8h.html#_CPPv416SimulatorMethods "Permalink to this definition") _struct_ `callback_data`[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/simulatormodule_8h.html#_CPPv413callback_data "Permalink to this definition") Public Members PyThreadState \*`_saved_thread_state`[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/simulatormodule_8h.html#_CPPv4N13callback_data19_saved_thread_stateE "Permalink to this definition") uint32\_t `id_value`[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/simulatormodule_8h.html#_CPPv4N13callback_data8id_valueE "Permalink to this definition") PyObject \*`function`[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/simulatormodule_8h.html#_CPPv4N13callback_data8functionE "Permalink to this definition") PyObject \*`args`[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/simulatormodule_8h.html#_CPPv4N13callback_data4argsE "Permalink to this definition") PyObject \*`kwargs`[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/simulatormodule_8h.html#_CPPv4N13callback_data6kwargsE "Permalink to this definition") [gpi\_sim\_hdl](https://docs.cocotb.org/en/v1.4.0/generated/file/gpi_8h.html#_CPPv411gpi_sim_hdl "gpi_sim_hdl") `cb_hdl`[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/simulatormodule_8h.html#_CPPv4N13callback_data6cb_hdlE "Permalink to this definition") --- # File sv_vpi_user.h — cocotb 1.4.0 documentation * [](https://docs.cocotb.org/en/v1.4.0/index.html) » * [C Code Library Reference](https://docs.cocotb.org/en/v1.4.0/library_reference_c.html) » * [File list](https://docs.cocotb.org/en/v1.4.0/generated/filelist.html) » * File sv\_vpi\_user.h * [Edit on GitHub](https://github.com/cocotb/cocotb/blob/v1.4.0/documentation/source/generated/file/sv__vpi__user_8h.rst) * * * File sv\_vpi\_user.h[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/sv__vpi__user_8h.html#file-sv-vpi-user-h "Permalink to this headline") ================================================================================================================================================ Defines `vpiPackage` 600[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/sv__vpi__user_8h.html#c.vpiPackage "Permalink to this definition") `vpiInterface` 601[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/sv__vpi__user_8h.html#c.vpiInterface "Permalink to this definition") `vpiProgram` 602[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/sv__vpi__user_8h.html#c.vpiProgram "Permalink to this definition") `vpiInterfaceArray` 603[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/sv__vpi__user_8h.html#c.vpiInterfaceArray "Permalink to this definition") `vpiProgramArray` 604[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/sv__vpi__user_8h.html#c.vpiProgramArray "Permalink to this definition") `vpiTypespec` 605[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/sv__vpi__user_8h.html#c.vpiTypespec "Permalink to this definition") `vpiModport` 606[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/sv__vpi__user_8h.html#c.vpiModport "Permalink to this definition") `vpiInterfaceTfDecl` 607[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/sv__vpi__user_8h.html#c.vpiInterfaceTfDecl "Permalink to this definition") `vpiRefObj` 608[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/sv__vpi__user_8h.html#c.vpiRefObj "Permalink to this definition") `vpiTypeParameter` 609[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/sv__vpi__user_8h.html#c.vpiTypeParameter "Permalink to this definition") `vpiVarBit` vpiRegBit[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/sv__vpi__user_8h.html#c.vpiVarBit "Permalink to this definition") `vpiLongIntVar` 610[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/sv__vpi__user_8h.html#c.vpiLongIntVar "Permalink to this definition") `vpiShortIntVar` 611[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/sv__vpi__user_8h.html#c.vpiShortIntVar "Permalink to this definition") `vpiIntVar` 612[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/sv__vpi__user_8h.html#c.vpiIntVar "Permalink to this definition") `vpiShortRealVar` 613[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/sv__vpi__user_8h.html#c.vpiShortRealVar "Permalink to this definition") `vpiByteVar` 614[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/sv__vpi__user_8h.html#c.vpiByteVar "Permalink to this definition") `vpiClassVar` 615[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/sv__vpi__user_8h.html#c.vpiClassVar "Permalink to this definition") `vpiStringVar` 616[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/sv__vpi__user_8h.html#c.vpiStringVar "Permalink to this definition") `vpiEnumVar` 617[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/sv__vpi__user_8h.html#c.vpiEnumVar "Permalink to this definition") `vpiStructVar` 618[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/sv__vpi__user_8h.html#c.vpiStructVar "Permalink to this definition") `vpiUnionVar` 619[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/sv__vpi__user_8h.html#c.vpiUnionVar "Permalink to this definition") `vpiBitVar` 620[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/sv__vpi__user_8h.html#c.vpiBitVar "Permalink to this definition") `vpiLogicVar` vpiReg[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/sv__vpi__user_8h.html#c.vpiLogicVar "Permalink to this definition") `vpiArrayVar` vpiRegArray[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/sv__vpi__user_8h.html#c.vpiArrayVar "Permalink to this definition") `vpiClassObj` 621[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/sv__vpi__user_8h.html#c.vpiClassObj "Permalink to this definition") `vpiChandleVar` 622[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/sv__vpi__user_8h.html#c.vpiChandleVar "Permalink to this definition") `vpiPackedArrayVar` 623[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/sv__vpi__user_8h.html#c.vpiPackedArrayVar "Permalink to this definition") `vpiVirtualInterfaceVar` 728[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/sv__vpi__user_8h.html#c.vpiVirtualInterfaceVar "Permalink to this definition") `vpiLongIntTypespec` 625[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/sv__vpi__user_8h.html#c.vpiLongIntTypespec "Permalink to this definition") `vpiShortRealTypespec` 626[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/sv__vpi__user_8h.html#c.vpiShortRealTypespec "Permalink to this definition") `vpiByteTypespec` 627[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/sv__vpi__user_8h.html#c.vpiByteTypespec "Permalink to this definition") `vpiShortIntTypespec` 628[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/sv__vpi__user_8h.html#c.vpiShortIntTypespec "Permalink to this definition") `vpiIntTypespec` 629[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/sv__vpi__user_8h.html#c.vpiIntTypespec "Permalink to this definition") `vpiClassTypespec` 630[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/sv__vpi__user_8h.html#c.vpiClassTypespec "Permalink to this definition") `vpiStringTypespec` 631[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/sv__vpi__user_8h.html#c.vpiStringTypespec "Permalink to this definition") `vpiChandleTypespec` 632[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/sv__vpi__user_8h.html#c.vpiChandleTypespec "Permalink to this definition") `vpiEnumTypespec` 633[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/sv__vpi__user_8h.html#c.vpiEnumTypespec "Permalink to this definition") `vpiEnumConst` 634[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/sv__vpi__user_8h.html#c.vpiEnumConst "Permalink to this definition") `vpiIntegerTypespec` 635[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/sv__vpi__user_8h.html#c.vpiIntegerTypespec "Permalink to this definition") `vpiTimeTypespec` 636[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/sv__vpi__user_8h.html#c.vpiTimeTypespec "Permalink to this definition") `vpiRealTypespec` 637[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/sv__vpi__user_8h.html#c.vpiRealTypespec "Permalink to this definition") `vpiStructTypespec` 638[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/sv__vpi__user_8h.html#c.vpiStructTypespec "Permalink to this definition") `vpiUnionTypespec` 639[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/sv__vpi__user_8h.html#c.vpiUnionTypespec "Permalink to this definition") `vpiBitTypespec` 640[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/sv__vpi__user_8h.html#c.vpiBitTypespec "Permalink to this definition") `vpiLogicTypespec` 641[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/sv__vpi__user_8h.html#c.vpiLogicTypespec "Permalink to this definition") `vpiArrayTypespec` 642[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/sv__vpi__user_8h.html#c.vpiArrayTypespec "Permalink to this definition") `vpiVoidTypespec` 643[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/sv__vpi__user_8h.html#c.vpiVoidTypespec "Permalink to this definition") `vpiTypespecMember` 644[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/sv__vpi__user_8h.html#c.vpiTypespecMember "Permalink to this definition") `vpiPackedArrayTypespec` 692[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/sv__vpi__user_8h.html#c.vpiPackedArrayTypespec "Permalink to this definition") `vpiSequenceTypespec` 696[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/sv__vpi__user_8h.html#c.vpiSequenceTypespec "Permalink to this definition") `vpiPropertyTypespec` 697[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/sv__vpi__user_8h.html#c.vpiPropertyTypespec "Permalink to this definition") `vpiEventTypespec` 698[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/sv__vpi__user_8h.html#c.vpiEventTypespec "Permalink to this definition") `vpiClockingBlock` 650[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/sv__vpi__user_8h.html#c.vpiClockingBlock "Permalink to this definition") `vpiClockingIODecl` 651[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/sv__vpi__user_8h.html#c.vpiClockingIODecl "Permalink to this definition") `vpiClassDefn` 652[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/sv__vpi__user_8h.html#c.vpiClassDefn "Permalink to this definition") `vpiConstraint` 653[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/sv__vpi__user_8h.html#c.vpiConstraint "Permalink to this definition") `vpiConstraintOrdering` 654[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/sv__vpi__user_8h.html#c.vpiConstraintOrdering "Permalink to this definition") `vpiDistItem` 645[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/sv__vpi__user_8h.html#c.vpiDistItem "Permalink to this definition") `vpiAliasStmt` 646[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/sv__vpi__user_8h.html#c.vpiAliasStmt "Permalink to this definition") `vpiThread` 647[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/sv__vpi__user_8h.html#c.vpiThread "Permalink to this definition") `vpiMethodFuncCall` 648[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/sv__vpi__user_8h.html#c.vpiMethodFuncCall "Permalink to this definition") `vpiMethodTaskCall` 649[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/sv__vpi__user_8h.html#c.vpiMethodTaskCall "Permalink to this definition") `vpiAssert` 686[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/sv__vpi__user_8h.html#c.vpiAssert "Permalink to this definition") `vpiAssume` 687[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/sv__vpi__user_8h.html#c.vpiAssume "Permalink to this definition") `vpiCover` 688[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/sv__vpi__user_8h.html#c.vpiCover "Permalink to this definition") `vpiRestrict` 901[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/sv__vpi__user_8h.html#c.vpiRestrict "Permalink to this definition") `vpiDisableCondition` 689[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/sv__vpi__user_8h.html#c.vpiDisableCondition "Permalink to this definition") `vpiClockingEvent` 690[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/sv__vpi__user_8h.html#c.vpiClockingEvent "Permalink to this definition") `vpiPropertyDecl` 655[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/sv__vpi__user_8h.html#c.vpiPropertyDecl "Permalink to this definition") `vpiPropertySpec` 656[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/sv__vpi__user_8h.html#c.vpiPropertySpec "Permalink to this definition") `vpiPropertyExpr` 657[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/sv__vpi__user_8h.html#c.vpiPropertyExpr "Permalink to this definition") `vpiMulticlockSequenceExpr` 658[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/sv__vpi__user_8h.html#c.vpiMulticlockSequenceExpr "Permalink to this definition") `vpiClockedSeq` 659[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/sv__vpi__user_8h.html#c.vpiClockedSeq "Permalink to this definition") `vpiClockedProp` 902[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/sv__vpi__user_8h.html#c.vpiClockedProp "Permalink to this definition") `vpiPropertyInst` 660[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/sv__vpi__user_8h.html#c.vpiPropertyInst "Permalink to this definition") `vpiSequenceDecl` 661[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/sv__vpi__user_8h.html#c.vpiSequenceDecl "Permalink to this definition") `vpiCaseProperty` 662 /\* property case \*/[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/sv__vpi__user_8h.html#c.vpiCaseProperty "Permalink to this definition") `vpiCasePropertyItem` 905 /\* property case item \*/[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/sv__vpi__user_8h.html#c.vpiCasePropertyItem "Permalink to this definition") `vpiSequenceInst` 664[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/sv__vpi__user_8h.html#c.vpiSequenceInst "Permalink to this definition") `vpiImmediateAssert` 665[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/sv__vpi__user_8h.html#c.vpiImmediateAssert "Permalink to this definition") `vpiImmediateAssume` 694[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/sv__vpi__user_8h.html#c.vpiImmediateAssume "Permalink to this definition") `vpiImmediateCover` 695[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/sv__vpi__user_8h.html#c.vpiImmediateCover "Permalink to this definition") `vpiReturn` 666[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/sv__vpi__user_8h.html#c.vpiReturn "Permalink to this definition") `vpiAnyPattern` 667[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/sv__vpi__user_8h.html#c.vpiAnyPattern "Permalink to this definition") `vpiTaggedPattern` 668[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/sv__vpi__user_8h.html#c.vpiTaggedPattern "Permalink to this definition") `vpiStructPattern` 669[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/sv__vpi__user_8h.html#c.vpiStructPattern "Permalink to this definition") `vpiDoWhile` 670[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/sv__vpi__user_8h.html#c.vpiDoWhile "Permalink to this definition") `vpiOrderedWait` 671[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/sv__vpi__user_8h.html#c.vpiOrderedWait "Permalink to this definition") `vpiWaitFork` 672[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/sv__vpi__user_8h.html#c.vpiWaitFork "Permalink to this definition") `vpiDisableFork` 673[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/sv__vpi__user_8h.html#c.vpiDisableFork "Permalink to this definition") `vpiExpectStmt` 674[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/sv__vpi__user_8h.html#c.vpiExpectStmt "Permalink to this definition") `vpiForeachStmt` 675[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/sv__vpi__user_8h.html#c.vpiForeachStmt "Permalink to this definition") `vpiReturnStmt` 691[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/sv__vpi__user_8h.html#c.vpiReturnStmt "Permalink to this definition") `vpiFinal` 676[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/sv__vpi__user_8h.html#c.vpiFinal "Permalink to this definition") `vpiExtends` 677[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/sv__vpi__user_8h.html#c.vpiExtends "Permalink to this definition") `vpiDistribution` 678[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/sv__vpi__user_8h.html#c.vpiDistribution "Permalink to this definition") `vpiSeqFormalDecl` 679[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/sv__vpi__user_8h.html#c.vpiSeqFormalDecl "Permalink to this definition") `vpiPropFormalDecl` 699[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/sv__vpi__user_8h.html#c.vpiPropFormalDecl "Permalink to this definition") `vpiArrayNet` vpiNetArray[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/sv__vpi__user_8h.html#c.vpiArrayNet "Permalink to this definition") `vpiEnumNet` 680[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/sv__vpi__user_8h.html#c.vpiEnumNet "Permalink to this definition") `vpiIntegerNet` 681[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/sv__vpi__user_8h.html#c.vpiIntegerNet "Permalink to this definition") `vpiLogicNet` vpiNet[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/sv__vpi__user_8h.html#c.vpiLogicNet "Permalink to this definition") `vpiTimeNet` 682[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/sv__vpi__user_8h.html#c.vpiTimeNet "Permalink to this definition") `vpiStructNet` 683[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/sv__vpi__user_8h.html#c.vpiStructNet "Permalink to this definition") `vpiBreak` 684[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/sv__vpi__user_8h.html#c.vpiBreak "Permalink to this definition") `vpiContinue` 685[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/sv__vpi__user_8h.html#c.vpiContinue "Permalink to this definition") `vpiPackedArrayNet` 693[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/sv__vpi__user_8h.html#c.vpiPackedArrayNet "Permalink to this definition") `vpiConstraintExpr` 747[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/sv__vpi__user_8h.html#c.vpiConstraintExpr "Permalink to this definition") `vpiElseConst` 748[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/sv__vpi__user_8h.html#c.vpiElseConst "Permalink to this definition") `vpiImplication` 749[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/sv__vpi__user_8h.html#c.vpiImplication "Permalink to this definition") `vpiConstrIf` 738[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/sv__vpi__user_8h.html#c.vpiConstrIf "Permalink to this definition") `vpiConstrIfElse` 739[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/sv__vpi__user_8h.html#c.vpiConstrIfElse "Permalink to this definition") `vpiConstrForEach` 736[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/sv__vpi__user_8h.html#c.vpiConstrForEach "Permalink to this definition") `vpiLetDecl` 903[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/sv__vpi__user_8h.html#c.vpiLetDecl "Permalink to this definition") `vpiLetExpr` 904[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/sv__vpi__user_8h.html#c.vpiLetExpr "Permalink to this definition") `vpiActual` 700[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/sv__vpi__user_8h.html#c.vpiActual "Permalink to this definition") `vpiTypedefAlias` 701[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/sv__vpi__user_8h.html#c.vpiTypedefAlias "Permalink to this definition") `vpiIndexTypespec` 702[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/sv__vpi__user_8h.html#c.vpiIndexTypespec "Permalink to this definition") `vpiBaseTypespec` 703[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/sv__vpi__user_8h.html#c.vpiBaseTypespec "Permalink to this definition") `vpiElemTypespec` 704[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/sv__vpi__user_8h.html#c.vpiElemTypespec "Permalink to this definition") `vpiInputSkew` 706[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/sv__vpi__user_8h.html#c.vpiInputSkew "Permalink to this definition") `vpiOutputSkew` 707[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/sv__vpi__user_8h.html#c.vpiOutputSkew "Permalink to this definition") `vpiGlobalClocking` 708[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/sv__vpi__user_8h.html#c.vpiGlobalClocking "Permalink to this definition") `vpiDefaultClocking` 709[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/sv__vpi__user_8h.html#c.vpiDefaultClocking "Permalink to this definition") `vpiDefaultDisableIff` 710[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/sv__vpi__user_8h.html#c.vpiDefaultDisableIff "Permalink to this definition") `vpiOrigin` 713[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/sv__vpi__user_8h.html#c.vpiOrigin "Permalink to this definition") `vpiPrefix` 714[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/sv__vpi__user_8h.html#c.vpiPrefix "Permalink to this definition") `vpiWith` 715[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/sv__vpi__user_8h.html#c.vpiWith "Permalink to this definition") `vpiProperty` 718[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/sv__vpi__user_8h.html#c.vpiProperty "Permalink to this definition") `vpiValueRange` 720[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/sv__vpi__user_8h.html#c.vpiValueRange "Permalink to this definition") `vpiPattern` 721[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/sv__vpi__user_8h.html#c.vpiPattern "Permalink to this definition") `vpiWeight` 722[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/sv__vpi__user_8h.html#c.vpiWeight "Permalink to this definition") `vpiConstraintItem` 746[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/sv__vpi__user_8h.html#c.vpiConstraintItem "Permalink to this definition") `vpiTypedef` 725[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/sv__vpi__user_8h.html#c.vpiTypedef "Permalink to this definition") `vpiImport` 726[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/sv__vpi__user_8h.html#c.vpiImport "Permalink to this definition") `vpiDerivedClasses` 727[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/sv__vpi__user_8h.html#c.vpiDerivedClasses "Permalink to this definition") `vpiInterfaceDecl` vpiVirtualInterfaceVar /\* interface decl deprecated \*/[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/sv__vpi__user_8h.html#c.vpiInterfaceDecl "Permalink to this definition") `vpiMethods` 730[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/sv__vpi__user_8h.html#c.vpiMethods "Permalink to this definition") `vpiSolveBefore` 731[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/sv__vpi__user_8h.html#c.vpiSolveBefore "Permalink to this definition") `vpiSolveAfter` 732[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/sv__vpi__user_8h.html#c.vpiSolveAfter "Permalink to this definition") `vpiWaitingProcesses` 734[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/sv__vpi__user_8h.html#c.vpiWaitingProcesses "Permalink to this definition") `vpiMessages` 735[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/sv__vpi__user_8h.html#c.vpiMessages "Permalink to this definition") `vpiLoopVars` 737[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/sv__vpi__user_8h.html#c.vpiLoopVars "Permalink to this definition") `vpiConcurrentAssertions` 740[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/sv__vpi__user_8h.html#c.vpiConcurrentAssertions "Permalink to this definition") `vpiMatchItem` 741[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/sv__vpi__user_8h.html#c.vpiMatchItem "Permalink to this definition") `vpiMember` 742[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/sv__vpi__user_8h.html#c.vpiMember "Permalink to this definition") `vpiElement` 743[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/sv__vpi__user_8h.html#c.vpiElement "Permalink to this definition") `vpiAssertion` 744[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/sv__vpi__user_8h.html#c.vpiAssertion "Permalink to this definition") `vpiInstance` 745[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/sv__vpi__user_8h.html#c.vpiInstance "Permalink to this definition") `vpiTop` 600[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/sv__vpi__user_8h.html#c.vpiTop "Permalink to this definition") `vpiUnit` 602[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/sv__vpi__user_8h.html#c.vpiUnit "Permalink to this definition") `vpiJoinType` 603[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/sv__vpi__user_8h.html#c.vpiJoinType "Permalink to this definition") `vpiJoin` 0[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/sv__vpi__user_8h.html#c.vpiJoin "Permalink to this definition") `vpiJoinNone` 1[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/sv__vpi__user_8h.html#c.vpiJoinNone "Permalink to this definition") `vpiJoinAny` 2[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/sv__vpi__user_8h.html#c.vpiJoinAny "Permalink to this definition") `vpiAccessType` 604[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/sv__vpi__user_8h.html#c.vpiAccessType "Permalink to this definition") `vpiForkJoinAcc` 1[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/sv__vpi__user_8h.html#c.vpiForkJoinAcc "Permalink to this definition") `vpiExternAcc` 2[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/sv__vpi__user_8h.html#c.vpiExternAcc "Permalink to this definition") `vpiDPIExportAcc` 3[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/sv__vpi__user_8h.html#c.vpiDPIExportAcc "Permalink to this definition") `vpiDPIImportAcc` 4[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/sv__vpi__user_8h.html#c.vpiDPIImportAcc "Permalink to this definition") `vpiArrayType` 606[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/sv__vpi__user_8h.html#c.vpiArrayType "Permalink to this definition") `vpiStaticArray` 1[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/sv__vpi__user_8h.html#c.vpiStaticArray "Permalink to this definition") `vpiDynamicArray` 2[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/sv__vpi__user_8h.html#c.vpiDynamicArray "Permalink to this definition") `vpiAssocArray` 3[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/sv__vpi__user_8h.html#c.vpiAssocArray "Permalink to this definition") `vpiQueueArray` 4[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/sv__vpi__user_8h.html#c.vpiQueueArray "Permalink to this definition") `vpiArrayMember` 607[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/sv__vpi__user_8h.html#c.vpiArrayMember "Permalink to this definition") `vpiIsRandomized` 608[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/sv__vpi__user_8h.html#c.vpiIsRandomized "Permalink to this definition") `vpiLocalVarDecls` 609[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/sv__vpi__user_8h.html#c.vpiLocalVarDecls "Permalink to this definition") `vpiOpStrong` 656 /\* strength of temporal operator \*/[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/sv__vpi__user_8h.html#c.vpiOpStrong "Permalink to this definition") `vpiRandType` 610[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/sv__vpi__user_8h.html#c.vpiRandType "Permalink to this definition") `vpiNotRand` 1[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/sv__vpi__user_8h.html#c.vpiNotRand "Permalink to this definition") `vpiRand` 2[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/sv__vpi__user_8h.html#c.vpiRand "Permalink to this definition") `vpiRandC` 3[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/sv__vpi__user_8h.html#c.vpiRandC "Permalink to this definition") `vpiPortType` 611[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/sv__vpi__user_8h.html#c.vpiPortType "Permalink to this definition") `vpiInterfacePort` 1[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/sv__vpi__user_8h.html#c.vpiInterfacePort "Permalink to this definition") `vpiModportPort` 2[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/sv__vpi__user_8h.html#c.vpiModportPort "Permalink to this definition") `vpiConstantVariable` 612[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/sv__vpi__user_8h.html#c.vpiConstantVariable "Permalink to this definition") `vpiStructUnionMember` 615[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/sv__vpi__user_8h.html#c.vpiStructUnionMember "Permalink to this definition") `vpiVisibility` 620[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/sv__vpi__user_8h.html#c.vpiVisibility "Permalink to this definition") `vpiPublicVis` 1[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/sv__vpi__user_8h.html#c.vpiPublicVis "Permalink to this definition") `vpiProtectedVis` 2[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/sv__vpi__user_8h.html#c.vpiProtectedVis "Permalink to this definition") `vpiLocalVis` 3[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/sv__vpi__user_8h.html#c.vpiLocalVis "Permalink to this definition") `vpiOneStepConst` 9[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/sv__vpi__user_8h.html#c.vpiOneStepConst "Permalink to this definition") `vpiUnboundedConst` 10[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/sv__vpi__user_8h.html#c.vpiUnboundedConst "Permalink to this definition") `vpiNullConst` 11[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/sv__vpi__user_8h.html#c.vpiNullConst "Permalink to this definition") `vpiAlwaysType` 624[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/sv__vpi__user_8h.html#c.vpiAlwaysType "Permalink to this definition") `vpiAlwaysComb` 2[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/sv__vpi__user_8h.html#c.vpiAlwaysComb "Permalink to this definition") `vpiAlwaysFF` 3[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/sv__vpi__user_8h.html#c.vpiAlwaysFF "Permalink to this definition") `vpiAlwaysLatch` 4[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/sv__vpi__user_8h.html#c.vpiAlwaysLatch "Permalink to this definition") `vpiDistType` 625[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/sv__vpi__user_8h.html#c.vpiDistType "Permalink to this definition") `vpiEqualDist` 1 /\* constraint equal distribution \*/[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/sv__vpi__user_8h.html#c.vpiEqualDist "Permalink to this definition") `vpiDivDist` 2 /\* constraint divided distribution \*/[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/sv__vpi__user_8h.html#c.vpiDivDist "Permalink to this definition") `vpiPacked` 630[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/sv__vpi__user_8h.html#c.vpiPacked "Permalink to this definition") `vpiTagged` 632[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/sv__vpi__user_8h.html#c.vpiTagged "Permalink to this definition") `vpiRef` 6 /\* Return value for vpiDirection property \*/[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/sv__vpi__user_8h.html#c.vpiRef "Permalink to this definition") `vpiVirtual` 635[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/sv__vpi__user_8h.html#c.vpiVirtual "Permalink to this definition") `vpiHasActual` 636[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/sv__vpi__user_8h.html#c.vpiHasActual "Permalink to this definition") `vpiIsConstraintEnabled` 638[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/sv__vpi__user_8h.html#c.vpiIsConstraintEnabled "Permalink to this definition") `vpiSoft` 639[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/sv__vpi__user_8h.html#c.vpiSoft "Permalink to this definition") `vpiClassType` 640[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/sv__vpi__user_8h.html#c.vpiClassType "Permalink to this definition") `vpiMailboxClass` 1[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/sv__vpi__user_8h.html#c.vpiMailboxClass "Permalink to this definition") `vpiSemaphoreClass` 2[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/sv__vpi__user_8h.html#c.vpiSemaphoreClass "Permalink to this definition") `vpiUserDefinedClass` 3[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/sv__vpi__user_8h.html#c.vpiUserDefinedClass "Permalink to this definition") `vpiProcessClass` 4[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/sv__vpi__user_8h.html#c.vpiProcessClass "Permalink to this definition") `vpiMethod` 645[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/sv__vpi__user_8h.html#c.vpiMethod "Permalink to this definition") `vpiIsClockInferred` 649[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/sv__vpi__user_8h.html#c.vpiIsClockInferred "Permalink to this definition") `vpiIsDeferred` 657[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/sv__vpi__user_8h.html#c.vpiIsDeferred "Permalink to this definition") `vpiIsFinal` 658[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/sv__vpi__user_8h.html#c.vpiIsFinal "Permalink to this definition") `vpiIsCoverSequence` 659[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/sv__vpi__user_8h.html#c.vpiIsCoverSequence "Permalink to this definition") `vpiQualifier` 650[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/sv__vpi__user_8h.html#c.vpiQualifier "Permalink to this definition") `vpiNoQualifier` 0[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/sv__vpi__user_8h.html#c.vpiNoQualifier "Permalink to this definition") `vpiUniqueQualifier` 1[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/sv__vpi__user_8h.html#c.vpiUniqueQualifier "Permalink to this definition") `vpiPriorityQualifier` 2[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/sv__vpi__user_8h.html#c.vpiPriorityQualifier "Permalink to this definition") `vpiTaggedQualifier` 4[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/sv__vpi__user_8h.html#c.vpiTaggedQualifier "Permalink to this definition") `vpiRandQualifier` 8[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/sv__vpi__user_8h.html#c.vpiRandQualifier "Permalink to this definition") `vpiInsideQualifier` 16[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/sv__vpi__user_8h.html#c.vpiInsideQualifier "Permalink to this definition") `vpiInputEdge` 651 /\* returns vpiNoEdge, vpiPosedge, vpiNegedge \*/ [¶](https://docs.cocotb.org/en/v1.4.0/generated/file/sv__vpi__user_8h.html#c.vpiInputEdge "Permalink to this definition") `vpiOutputEdge` 652 /\* returns vpiNoEdge, vpiPosedge, vpiNegedge \*/ [¶](https://docs.cocotb.org/en/v1.4.0/generated/file/sv__vpi__user_8h.html#c.vpiOutputEdge "Permalink to this definition") `vpiGeneric` 653[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/sv__vpi__user_8h.html#c.vpiGeneric "Permalink to this definition") `vpiCompatibilityMode` 654[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/sv__vpi__user_8h.html#c.vpiCompatibilityMode "Permalink to this definition") `vpiMode1364v1995` 1[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/sv__vpi__user_8h.html#c.vpiMode1364v1995 "Permalink to this definition") `vpiMode1364v2001` 2[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/sv__vpi__user_8h.html#c.vpiMode1364v2001 "Permalink to this definition") `vpiMode1364v2005` 3[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/sv__vpi__user_8h.html#c.vpiMode1364v2005 "Permalink to this definition") `vpiMode1800v2005` 4[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/sv__vpi__user_8h.html#c.vpiMode1800v2005 "Permalink to this definition") `vpiMode1800v2009` 5[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/sv__vpi__user_8h.html#c.vpiMode1800v2009 "Permalink to this definition") `vpiPackedArrayMember` 655[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/sv__vpi__user_8h.html#c.vpiPackedArrayMember "Permalink to this definition") `vpiStartLine` 661[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/sv__vpi__user_8h.html#c.vpiStartLine "Permalink to this definition") `vpiColumn` 662[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/sv__vpi__user_8h.html#c.vpiColumn "Permalink to this definition") `vpiEndLine` 663[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/sv__vpi__user_8h.html#c.vpiEndLine "Permalink to this definition") `vpiEndColumn` 664[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/sv__vpi__user_8h.html#c.vpiEndColumn "Permalink to this definition") `vpiAllocScheme` 658[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/sv__vpi__user_8h.html#c.vpiAllocScheme "Permalink to this definition") `vpiAutomaticScheme` 1[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/sv__vpi__user_8h.html#c.vpiAutomaticScheme "Permalink to this definition") `vpiDynamicScheme` 2[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/sv__vpi__user_8h.html#c.vpiDynamicScheme "Permalink to this definition") `vpiOtherScheme` 3[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/sv__vpi__user_8h.html#c.vpiOtherScheme "Permalink to this definition") `vpiObjId` 660[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/sv__vpi__user_8h.html#c.vpiObjId "Permalink to this definition") `vpiDPIPure` 665[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/sv__vpi__user_8h.html#c.vpiDPIPure "Permalink to this definition") `vpiDPIContext` 666[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/sv__vpi__user_8h.html#c.vpiDPIContext "Permalink to this definition") `vpiDPICStr` 667[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/sv__vpi__user_8h.html#c.vpiDPICStr "Permalink to this definition") `vpiDPI` 1[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/sv__vpi__user_8h.html#c.vpiDPI "Permalink to this definition") `vpiDPIC` 2[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/sv__vpi__user_8h.html#c.vpiDPIC "Permalink to this definition") `vpiDPICIdentifier` 668[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/sv__vpi__user_8h.html#c.vpiDPICIdentifier "Permalink to this definition") `vpiImplyOp` 50 /\* -> implication operator \*/[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/sv__vpi__user_8h.html#c.vpiImplyOp "Permalink to this definition") `vpiNonOverlapImplyOp` 51 /\* |=> nonoverlapped implication \*/[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/sv__vpi__user_8h.html#c.vpiNonOverlapImplyOp "Permalink to this definition") `vpiOverlapImplyOp` 52 /\* |-> overlapped implication operator \*/[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/sv__vpi__user_8h.html#c.vpiOverlapImplyOp "Permalink to this definition") `vpiAcceptOnOp` 83 /\* accept\_on operator \*/[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/sv__vpi__user_8h.html#c.vpiAcceptOnOp "Permalink to this definition") `vpiRejectOnOp` 84 /\* reject\_on operator \*/[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/sv__vpi__user_8h.html#c.vpiRejectOnOp "Permalink to this definition") `vpiSyncAcceptOnOp` 85 /\* sync\_accept\_on operator \*/[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/sv__vpi__user_8h.html#c.vpiSyncAcceptOnOp "Permalink to this definition") `vpiSyncRejectOnOp` 86 /\* sync\_reject\_on operator \*/[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/sv__vpi__user_8h.html#c.vpiSyncRejectOnOp "Permalink to this definition") `vpiOverlapFollowedByOp` 87 /\* overlapped followed\_by operator \*/[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/sv__vpi__user_8h.html#c.vpiOverlapFollowedByOp "Permalink to this definition") `vpiNonOverlapFollowedByOp` 88 /\* nonoverlapped followed\_by operator \*/[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/sv__vpi__user_8h.html#c.vpiNonOverlapFollowedByOp "Permalink to this definition") `vpiNexttimeOp` 89 /\* nexttime operator \*/[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/sv__vpi__user_8h.html#c.vpiNexttimeOp "Permalink to this definition") `vpiAlwaysOp` 90 /\* always operator \*/[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/sv__vpi__user_8h.html#c.vpiAlwaysOp "Permalink to this definition") `vpiEventuallyOp` 91 /\* eventually operator \*/[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/sv__vpi__user_8h.html#c.vpiEventuallyOp "Permalink to this definition") `vpiUntilOp` 92 /\* until operator \*/[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/sv__vpi__user_8h.html#c.vpiUntilOp "Permalink to this definition") `vpiUntilWithOp` 93 /\* until\_with operator \*/[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/sv__vpi__user_8h.html#c.vpiUntilWithOp "Permalink to this definition") `vpiUnaryCycleDelayOp` 53 /\* binary cycle delay (##) operator \*/[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/sv__vpi__user_8h.html#c.vpiUnaryCycleDelayOp "Permalink to this definition") `vpiCycleDelayOp` 54 /\* binary cycle delay (##) operator \*/[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/sv__vpi__user_8h.html#c.vpiCycleDelayOp "Permalink to this definition") `vpiIntersectOp` 55 /\* intersection operator \*/[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/sv__vpi__user_8h.html#c.vpiIntersectOp "Permalink to this definition") `vpiFirstMatchOp` 56 /\* first\_match operator \*/[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/sv__vpi__user_8h.html#c.vpiFirstMatchOp "Permalink to this definition") `vpiThroughoutOp` 57 /\* throughout operator \*/[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/sv__vpi__user_8h.html#c.vpiThroughoutOp "Permalink to this definition") `vpiWithinOp` 58 /\* within operator \*/[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/sv__vpi__user_8h.html#c.vpiWithinOp "Permalink to this definition") `vpiRepeatOp` 59 /\* \[=\] nonconsecutive repetition \*/[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/sv__vpi__user_8h.html#c.vpiRepeatOp "Permalink to this definition") `vpiConsecutiveRepeatOp` 60 /\* \[\*\] consecutive repetition \*/[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/sv__vpi__user_8h.html#c.vpiConsecutiveRepeatOp "Permalink to this definition") `vpiGotoRepeatOp` 61 /\* \[->\] goto repetition \*/[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/sv__vpi__user_8h.html#c.vpiGotoRepeatOp "Permalink to this definition") `vpiPostIncOp` 62 /\* ++ post-increment \*/[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/sv__vpi__user_8h.html#c.vpiPostIncOp "Permalink to this definition") `vpiPreIncOp` 63 /\* ++ pre-increment \*/[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/sv__vpi__user_8h.html#c.vpiPreIncOp "Permalink to this definition") `vpiPostDecOp` 64 /\* -- post-decrement \*/[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/sv__vpi__user_8h.html#c.vpiPostDecOp "Permalink to this definition") `vpiPreDecOp` 65 /\* -- pre-decrement \*/[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/sv__vpi__user_8h.html#c.vpiPreDecOp "Permalink to this definition") `vpiMatchOp` 66 /\* match() operator \*/[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/sv__vpi__user_8h.html#c.vpiMatchOp "Permalink to this definition") `vpiCastOp` 67 /\* type'() operator \*/[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/sv__vpi__user_8h.html#c.vpiCastOp "Permalink to this definition") `vpiIffOp` 68 /\* iff operator \*/[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/sv__vpi__user_8h.html#c.vpiIffOp "Permalink to this definition") `vpiWildEqOp` 69 /\* ==? operator \*/[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/sv__vpi__user_8h.html#c.vpiWildEqOp "Permalink to this definition") `vpiWildNeqOp` 70 /\* !=? operator \*/[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/sv__vpi__user_8h.html#c.vpiWildNeqOp "Permalink to this definition") `vpiStreamLROp` 71 /\* left-to-right streaming {>>} operator \*/[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/sv__vpi__user_8h.html#c.vpiStreamLROp "Permalink to this definition") `vpiStreamRLOp` 72 /\* right-to-left streaming {<<} operator \*/[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/sv__vpi__user_8h.html#c.vpiStreamRLOp "Permalink to this definition") `vpiMatchedOp` 73 /\* the .matched sequence operation \*/[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/sv__vpi__user_8h.html#c.vpiMatchedOp "Permalink to this definition") `vpiTriggeredOp` 74 /\* the .triggered sequence operation \*/[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/sv__vpi__user_8h.html#c.vpiTriggeredOp "Permalink to this definition") `vpiAssignmentPatternOp` 75 /\* '{} assignment pattern \*/[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/sv__vpi__user_8h.html#c.vpiAssignmentPatternOp "Permalink to this definition") `vpiMultiAssignmentPatternOp` 76 /\* '{n{}} multi assignment pattern \*/[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/sv__vpi__user_8h.html#c.vpiMultiAssignmentPatternOp "Permalink to this definition") `vpiIfOp` 77 /\* if operator \*/[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/sv__vpi__user_8h.html#c.vpiIfOp "Permalink to this definition") `vpiIfElseOp` 78 /\* if/else operator \*/[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/sv__vpi__user_8h.html#c.vpiIfElseOp "Permalink to this definition") `vpiCompAndOp` 79 /\* Composite and operator \*/[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/sv__vpi__user_8h.html#c.vpiCompAndOp "Permalink to this definition") `vpiCompOrOp` 80 /\* Composite or operator \*/[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/sv__vpi__user_8h.html#c.vpiCompOrOp "Permalink to this definition") `vpiImpliesOp` 94 /\* implies operator \*/[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/sv__vpi__user_8h.html#c.vpiImpliesOp "Permalink to this definition") `vpiInsideOp` 95 /\* inside operator \*/[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/sv__vpi__user_8h.html#c.vpiInsideOp "Permalink to this definition") `vpiTypeOp` 81 /\* type operator \*/[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/sv__vpi__user_8h.html#c.vpiTypeOp "Permalink to this definition") `vpiAssignmentOp` 82 /\* Normal assignment \*/[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/sv__vpi__user_8h.html#c.vpiAssignmentOp "Permalink to this definition") `vpiOtherFunc` 6 /\* returns other types; for property vpiFuncType \*/[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/sv__vpi__user_8h.html#c.vpiOtherFunc "Permalink to this definition") `vpiValidUnknown` 2 /\* Validity of variable is unknown \*/[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/sv__vpi__user_8h.html#c.vpiValidUnknown "Permalink to this definition") `cbStartOfThread` 600 /\* callback on thread creation \*/[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/sv__vpi__user_8h.html#c.cbStartOfThread "Permalink to this definition") `cbEndOfThread` 601 /\* callback on thread termination \*/[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/sv__vpi__user_8h.html#c.cbEndOfThread "Permalink to this definition") `cbEnterThread` 602 /\* callback on reentering thread \*/[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/sv__vpi__user_8h.html#c.cbEnterThread "Permalink to this definition") `cbStartOfFrame` 603 /\* callback on frame creation \*/[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/sv__vpi__user_8h.html#c.cbStartOfFrame "Permalink to this definition") `cbEndOfFrame` 604 /\* callback on frame exit \*/[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/sv__vpi__user_8h.html#c.cbEndOfFrame "Permalink to this definition") `cbSizeChange` 605 /\* callback on array variable size change \*/[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/sv__vpi__user_8h.html#c.cbSizeChange "Permalink to this definition") `cbCreateObj` 700 /\* callback on class object creation \*/[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/sv__vpi__user_8h.html#c.cbCreateObj "Permalink to this definition") `cbReclaimObj` 701 /\* callback on class object reclaimed by automatic memory management \*/[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/sv__vpi__user_8h.html#c.cbReclaimObj "Permalink to this definition") `cbEndOfObject` 702 /\* callback on transient object deletion \*/[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/sv__vpi__user_8h.html#c.cbEndOfObject "Permalink to this definition") `vpiCoverageStart` 750[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/sv__vpi__user_8h.html#c.vpiCoverageStart "Permalink to this definition") `vpiCoverageStOp` 751[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/sv__vpi__user_8h.html#c.vpiCoverageStOp "Permalink to this definition") `vpiCoverageReset` 752[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/sv__vpi__user_8h.html#c.vpiCoverageReset "Permalink to this definition") `vpiCoverageCheck` 753[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/sv__vpi__user_8h.html#c.vpiCoverageCheck "Permalink to this definition") `vpiCoverageMerge` 754[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/sv__vpi__user_8h.html#c.vpiCoverageMerge "Permalink to this definition") `vpiCoverageSave` 755[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/sv__vpi__user_8h.html#c.vpiCoverageSave "Permalink to this definition") `vpiAssertCoverage` 760[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/sv__vpi__user_8h.html#c.vpiAssertCoverage "Permalink to this definition") `vpiFsmStateCoverage` 761[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/sv__vpi__user_8h.html#c.vpiFsmStateCoverage "Permalink to this definition") `vpiStatementCoverage` 762[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/sv__vpi__user_8h.html#c.vpiStatementCoverage "Permalink to this definition") `vpiToggleCoverage` 763[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/sv__vpi__user_8h.html#c.vpiToggleCoverage "Permalink to this definition") `vpiCovered` 765[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/sv__vpi__user_8h.html#c.vpiCovered "Permalink to this definition") `vpiCoverMax` 766[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/sv__vpi__user_8h.html#c.vpiCoverMax "Permalink to this definition") `vpiCoveredCount` 767[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/sv__vpi__user_8h.html#c.vpiCoveredCount "Permalink to this definition") `vpiAssertAttemptCovered` 770[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/sv__vpi__user_8h.html#c.vpiAssertAttemptCovered "Permalink to this definition") `vpiAssertSuccessCovered` 771[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/sv__vpi__user_8h.html#c.vpiAssertSuccessCovered "Permalink to this definition") `vpiAssertFailureCovered` 772[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/sv__vpi__user_8h.html#c.vpiAssertFailureCovered "Permalink to this definition") `vpiAssertVacuousSuccessCovered` 773[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/sv__vpi__user_8h.html#c.vpiAssertVacuousSuccessCovered "Permalink to this definition") `vpiAssertDisableCovered` 774[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/sv__vpi__user_8h.html#c.vpiAssertDisableCovered "Permalink to this definition") `vpiAssertKillCovered` 777[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/sv__vpi__user_8h.html#c.vpiAssertKillCovered "Permalink to this definition") `vpiFsmStates` 775[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/sv__vpi__user_8h.html#c.vpiFsmStates "Permalink to this definition") `vpiFsmStateExpression` 776[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/sv__vpi__user_8h.html#c.vpiFsmStateExpression "Permalink to this definition") `vpiFsm` 758[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/sv__vpi__user_8h.html#c.vpiFsm "Permalink to this definition") `vpiFsmHandle` 759[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/sv__vpi__user_8h.html#c.vpiFsmHandle "Permalink to this definition") `cbAssertionStart` 606[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/sv__vpi__user_8h.html#c.cbAssertionStart "Permalink to this definition") `cbAssertionSuccess` 607[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/sv__vpi__user_8h.html#c.cbAssertionSuccess "Permalink to this definition") `cbAssertionFailure` 608[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/sv__vpi__user_8h.html#c.cbAssertionFailure "Permalink to this definition") `cbAssertionVacuousSuccess` 657[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/sv__vpi__user_8h.html#c.cbAssertionVacuousSuccess "Permalink to this definition") `cbAssertionDisabledEvaluation` 658[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/sv__vpi__user_8h.html#c.cbAssertionDisabledEvaluation "Permalink to this definition") `cbAssertionStepSuccess` 609[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/sv__vpi__user_8h.html#c.cbAssertionStepSuccess "Permalink to this definition") `cbAssertionStepFailure` 610[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/sv__vpi__user_8h.html#c.cbAssertionStepFailure "Permalink to this definition") `cbAssertionLock` 661[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/sv__vpi__user_8h.html#c.cbAssertionLock "Permalink to this definition") `cbAssertionUnlock` 662[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/sv__vpi__user_8h.html#c.cbAssertionUnlock "Permalink to this definition") `cbAssertionDisable` 611[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/sv__vpi__user_8h.html#c.cbAssertionDisable "Permalink to this definition") `cbAssertionEnable` 612[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/sv__vpi__user_8h.html#c.cbAssertionEnable "Permalink to this definition") `cbAssertionReset` 613[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/sv__vpi__user_8h.html#c.cbAssertionReset "Permalink to this definition") `cbAssertionKill` 614[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/sv__vpi__user_8h.html#c.cbAssertionKill "Permalink to this definition") `cbAssertionEnablePassAction` 645[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/sv__vpi__user_8h.html#c.cbAssertionEnablePassAction "Permalink to this definition") `cbAssertionEnableFailAction` 646[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/sv__vpi__user_8h.html#c.cbAssertionEnableFailAction "Permalink to this definition") `cbAssertionDisablePassAction` 647[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/sv__vpi__user_8h.html#c.cbAssertionDisablePassAction "Permalink to this definition") `cbAssertionDisableFailAction` 648[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/sv__vpi__user_8h.html#c.cbAssertionDisableFailAction "Permalink to this definition") `cbAssertionEnableNonvacuousAction` 649[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/sv__vpi__user_8h.html#c.cbAssertionEnableNonvacuousAction "Permalink to this definition") `cbAssertionDisableVacuousAction` 650[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/sv__vpi__user_8h.html#c.cbAssertionDisableVacuousAction "Permalink to this definition") `cbAssertionSysInitialized` 615[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/sv__vpi__user_8h.html#c.cbAssertionSysInitialized "Permalink to this definition") `cbAssertionSysOn` 616[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/sv__vpi__user_8h.html#c.cbAssertionSysOn "Permalink to this definition") `cbAssertionSysOff` 617[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/sv__vpi__user_8h.html#c.cbAssertionSysOff "Permalink to this definition") `cbAssertionSysKill` 631[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/sv__vpi__user_8h.html#c.cbAssertionSysKill "Permalink to this definition") `cbAssertionSysLock` 659[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/sv__vpi__user_8h.html#c.cbAssertionSysLock "Permalink to this definition") `cbAssertionSysUnlock` 660[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/sv__vpi__user_8h.html#c.cbAssertionSysUnlock "Permalink to this definition") `cbAssertionSysEnd` 618[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/sv__vpi__user_8h.html#c.cbAssertionSysEnd "Permalink to this definition") `cbAssertionSysReset` 619[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/sv__vpi__user_8h.html#c.cbAssertionSysReset "Permalink to this definition") `cbAssertionSysEnablePassAction` 651[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/sv__vpi__user_8h.html#c.cbAssertionSysEnablePassAction "Permalink to this definition") `cbAssertionSysEnableFailAction` 652[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/sv__vpi__user_8h.html#c.cbAssertionSysEnableFailAction "Permalink to this definition") `cbAssertionSysDisablePassAction` 653[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/sv__vpi__user_8h.html#c.cbAssertionSysDisablePassAction "Permalink to this definition") `cbAssertionSysDisableFailAction` 654[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/sv__vpi__user_8h.html#c.cbAssertionSysDisableFailAction "Permalink to this definition") `cbAssertionSysEnableNonvacuousAction` 655[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/sv__vpi__user_8h.html#c.cbAssertionSysEnableNonvacuousAction "Permalink to this definition") `cbAssertionSysDisableVacuousAction` 656[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/sv__vpi__user_8h.html#c.cbAssertionSysDisableVacuousAction "Permalink to this definition") `vpiAssertionLock` 645[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/sv__vpi__user_8h.html#c.vpiAssertionLock "Permalink to this definition") `vpiAssertionUnlock` 646[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/sv__vpi__user_8h.html#c.vpiAssertionUnlock "Permalink to this definition") `vpiAssertionDisable` 620[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/sv__vpi__user_8h.html#c.vpiAssertionDisable "Permalink to this definition") `vpiAssertionEnable` 621[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/sv__vpi__user_8h.html#c.vpiAssertionEnable "Permalink to this definition") `vpiAssertionReset` 622[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/sv__vpi__user_8h.html#c.vpiAssertionReset "Permalink to this definition") `vpiAssertionKill` 623[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/sv__vpi__user_8h.html#c.vpiAssertionKill "Permalink to this definition") `vpiAssertionEnableStep` 624[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/sv__vpi__user_8h.html#c.vpiAssertionEnableStep "Permalink to this definition") `vpiAssertionDisableStep` 625[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/sv__vpi__user_8h.html#c.vpiAssertionDisableStep "Permalink to this definition") `vpiAssertionClockSteps` 626[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/sv__vpi__user_8h.html#c.vpiAssertionClockSteps "Permalink to this definition") `vpiAssertionSysLock` 647[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/sv__vpi__user_8h.html#c.vpiAssertionSysLock "Permalink to this definition") `vpiAssertionSysUnlock` 648[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/sv__vpi__user_8h.html#c.vpiAssertionSysUnlock "Permalink to this definition") `vpiAssertionSysOn` 627[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/sv__vpi__user_8h.html#c.vpiAssertionSysOn "Permalink to this definition") `vpiAssertionSysOff` 628[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/sv__vpi__user_8h.html#c.vpiAssertionSysOff "Permalink to this definition") `vpiAssertionSysKill` 632[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/sv__vpi__user_8h.html#c.vpiAssertionSysKill "Permalink to this definition") `vpiAssertionSysEnd` 629[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/sv__vpi__user_8h.html#c.vpiAssertionSysEnd "Permalink to this definition") `vpiAssertionSysReset` 630[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/sv__vpi__user_8h.html#c.vpiAssertionSysReset "Permalink to this definition") `vpiAssertionDisablePassAction` 633[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/sv__vpi__user_8h.html#c.vpiAssertionDisablePassAction "Permalink to this definition") `vpiAssertionEnablePassAction` 634[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/sv__vpi__user_8h.html#c.vpiAssertionEnablePassAction "Permalink to this definition") `vpiAssertionDisableFailAction` 635[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/sv__vpi__user_8h.html#c.vpiAssertionDisableFailAction "Permalink to this definition") `vpiAssertionEnableFailAction` 636[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/sv__vpi__user_8h.html#c.vpiAssertionEnableFailAction "Permalink to this definition") `vpiAssertionDisableVacuousAction` 637[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/sv__vpi__user_8h.html#c.vpiAssertionDisableVacuousAction "Permalink to this definition") `vpiAssertionEnableNonvacuousAction` 638[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/sv__vpi__user_8h.html#c.vpiAssertionEnableNonvacuousAction "Permalink to this definition") `vpiAssertionSysEnablePassAction` 639[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/sv__vpi__user_8h.html#c.vpiAssertionSysEnablePassAction "Permalink to this definition") `vpiAssertionSysEnableFailAction` 640[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/sv__vpi__user_8h.html#c.vpiAssertionSysEnableFailAction "Permalink to this definition") `vpiAssertionSysDisablePassAction` 641[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/sv__vpi__user_8h.html#c.vpiAssertionSysDisablePassAction "Permalink to this definition") `vpiAssertionSysDisableFailAction` 642[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/sv__vpi__user_8h.html#c.vpiAssertionSysDisableFailAction "Permalink to this definition") `vpiAssertionSysEnableNonvacuousAction` 643[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/sv__vpi__user_8h.html#c.vpiAssertionSysEnableNonvacuousAction "Permalink to this definition") `vpiAssertionSysDisableVacuousAction` 644[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/sv__vpi__user_8h.html#c.vpiAssertionSysDisableVacuousAction "Permalink to this definition") Typedefs _typedef_ _struct_ [t\_vpi\_assertion\_step\_info](https://docs.cocotb.org/en/v1.4.0/generated/file/sv__vpi__user_8h.html#_CPPv425t_vpi_assertion_step_info "t_vpi_assertion_step_info") `s_vpi_assertion_step_info`[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/sv__vpi__user_8h.html#_CPPv425s_vpi_assertion_step_info "Permalink to this definition") _typedef_ _struct_ [t\_vpi\_assertion\_step\_info](https://docs.cocotb.org/en/v1.4.0/generated/file/sv__vpi__user_8h.html#_CPPv425t_vpi_assertion_step_info "t_vpi_assertion_step_info") \*`p_vpi_assertion_step_info`[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/sv__vpi__user_8h.html#_CPPv425p_vpi_assertion_step_info "Permalink to this definition") _typedef_ _struct_ [t\_vpi\_attempt\_info](https://docs.cocotb.org/en/v1.4.0/generated/file/sv__vpi__user_8h.html#_CPPv418t_vpi_attempt_info "t_vpi_attempt_info") `s_vpi_attempt_info`[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/sv__vpi__user_8h.html#_CPPv418s_vpi_attempt_info "Permalink to this definition") _typedef_ _struct_ [t\_vpi\_attempt\_info](https://docs.cocotb.org/en/v1.4.0/generated/file/sv__vpi__user_8h.html#_CPPv418t_vpi_attempt_info "t_vpi_attempt_info") \*`p_vpi_attempt_info`[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/sv__vpi__user_8h.html#_CPPv418p_vpi_attempt_info "Permalink to this definition") `PLI_INT32() vpi_assertion_callback_func (PLI_INT32 reason, p_vpi_time cb_time, vpiHandle assertion, p_vpi_attempt_info info, PLI_BYTE8 *user_data)` Functions [vpiHandle](https://docs.cocotb.org/en/v1.4.0/generated/file/vpi__user_8h.html#_CPPv49vpiHandle "vpiHandle") `vpi_register_assertion_cb`([vpiHandle](https://docs.cocotb.org/en/v1.4.0/generated/file/vpi__user_8h.html#_CPPv49vpiHandle "vpiHandle") _assertion_, [PLI\_INT32](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#_CPPv49PLI_INT32 "PLI_INT32") _reason_, vpi\_assertion\_callback\_func \*_cb\_rtn_, [PLI\_BYTE8](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#_CPPv49PLI_BYTE8 "PLI_BYTE8") \*_user\_data_)[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/sv__vpi__user_8h.html#_CPPv425vpi_register_assertion_cb9vpiHandle9PLI_INT32P27vpi_assertion_callback_funcP9PLI_BYTE8 "Permalink to this definition") _struct_ `t_vpi_assertion_step_info`[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/sv__vpi__user_8h.html#_CPPv425t_vpi_assertion_step_info "Permalink to this definition") Public Members [PLI\_INT32](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#_CPPv49PLI_INT32 "PLI_INT32") `matched_expression_count`[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/sv__vpi__user_8h.html#_CPPv4N25t_vpi_assertion_step_info24matched_expression_countE "Permalink to this definition") [vpiHandle](https://docs.cocotb.org/en/v1.4.0/generated/file/vpi__user_8h.html#_CPPv49vpiHandle "vpiHandle") \*`matched_exprs`[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/sv__vpi__user_8h.html#_CPPv4N25t_vpi_assertion_step_info13matched_exprsE "Permalink to this definition") [PLI\_INT32](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#_CPPv49PLI_INT32 "PLI_INT32") `stateFrom`[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/sv__vpi__user_8h.html#_CPPv4N25t_vpi_assertion_step_info9stateFromE "Permalink to this definition") [PLI\_INT32](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#_CPPv49PLI_INT32 "PLI_INT32") `stateTo`[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/sv__vpi__user_8h.html#_CPPv4N25t_vpi_assertion_step_info7stateToE "Permalink to this definition") _struct_ `t_vpi_attempt_info`[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/sv__vpi__user_8h.html#_CPPv418t_vpi_attempt_info "Permalink to this definition") Public Members [vpiHandle](https://docs.cocotb.org/en/v1.4.0/generated/file/vpi__user_8h.html#_CPPv49vpiHandle "vpiHandle") `failExpr`[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/sv__vpi__user_8h.html#_CPPv4N18t_vpi_attempt_info8failExprE "Permalink to this definition") [p\_vpi\_assertion\_step\_info](https://docs.cocotb.org/en/v1.4.0/generated/file/sv__vpi__user_8h.html#_CPPv425p_vpi_assertion_step_info "p_vpi_assertion_step_info") `step`[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/sv__vpi__user_8h.html#_CPPv4N18t_vpi_attempt_info4stepE "Permalink to this definition") _union_ [t\_vpi\_attempt\_info](https://docs.cocotb.org/en/v1.4.0/generated/file/sv__vpi__user_8h.html#_CPPv418t_vpi_attempt_info "t_vpi_attempt_info") ::**\[anonymous\]** `detail`[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/sv__vpi__user_8h.html#_CPPv4N18t_vpi_attempt_info6detailE "Permalink to this definition") [s\_vpi\_time](https://docs.cocotb.org/en/v1.4.0/generated/file/vpi__user_8h.html#_CPPv410s_vpi_time "s_vpi_time") `attemptStartTime`[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/sv__vpi__user_8h.html#_CPPv4N18t_vpi_attempt_info16attemptStartTimeE "Permalink to this definition") --- # Unknown \# This file is public domain, it can be freely copied without restrictions. # SPDX-License-Identifier: CC0-1.0 # test\_runner.py import os from pathlib import Path from cocotb\_tools.runner import get\_runner def test\_my\_design\_runner(): sim = os.getenv("SIM", "icarus") proj\_path = Path(\_\_file\_\_).resolve().parent sources = \[proj\_path / "my\_design.sv"\] runner = get\_runner(sim) runner.build( sources=sources, hdl\_toplevel="my\_design", ) runner.test(hdl\_toplevel="my\_design", test\_module="test\_my\_design,") if \_\_name\_\_ == "\_\_main\_\_": test\_my\_design\_runner() --- # Unknown \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\* Getting Involved \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\* Welcome to the cocotb development! We are an inclusive community with the common goal of improving the cocotb, a coroutine based cosimulation library for writing VHDL and Verilog testbenches in Python. This guide explains how to contribute to cocotb, and documents the processes we agreed on to manage the project. All processes in this document are designed to streamline the development effort, to avoid bottlenecks, and to ultimately give a pleasant experience to all involved. Feeling lost? ============= Cocotb is a diverse and challenging project to contribute to. If you ever feel lost, out of your depth, or simply want to know more, the \`cocotb Gitter channel \`\_\_ is actively watched by many cocotb users, contributors, and maintainers. It is a good idea if you are unsure whether your problem or question is worthy of a Github Issue to first post it to the Gitter channel. You may also ask questions in \`Github issues \`\_. If you don't receive any response on the Gitter channel or a Github issue, or you want help privately, you may directly contact a maintainer. Architecture and Scope of Cocotb ================================ Cocotb has seen adoption in a wide variety of scenarios with sometimes conflicting requirements. To foster experimentation and to decentralize the development process the architecture of cocotb is highly modular. A solid core forms the foundation upon which extensions can provide higher-level functionality. The core of cocotb are - the infrastructure to write testbenches with coroutines, threads, etc., - the abstraction and interaction with simulators through interfaces like VPI, GPI, etc., - tooling to run tests, and - core primitives to interact with the simulation: triggers, data access classes, etc. As a general rule, functionality beyond this core set should go into extensions. However, none of these rules are set in stone. They can and should be challenged at times to ensure the project stays relevant to the majority of its users. What to Work On =============== There is \*a lot\* of work to do on this project, no matter your area of expertise or skill level. If you are a beginner there are several \`Github issues \`\_\_ marked \`good first issue \`\_\_ you can look at. There are also a number of things you can work on that aren't in Github issues and don't require in-depth knowledge of the cocotb internals. They including the following: - Documentation improvements - Managing Github issues and the Gitter channel - Testing and coverage improvements Cocotb is still not perfect. There are plenty of \`bug fixes \`\_\_ and \`features \`\_\_ that can be worked on. Most of these are recorded as Github issues. Documentation ------------- Cocotb's documentation is always open to improvements. Improving documentation will help users better understand and use cocotb; and may decrease the number of questions the Gitter channel and Github issue page. Updating documentation requires knowledge of: - \`reStructuredText \`\_\_ - \`Sphinx documentation generator \`\_\_ - \`Markdown \`\_\_ - \`How to architect documentation \`\_\_ Some documentation should be located in the official documentation on \`Read the Docs/RTD \`\_\_, while the rest belongs on the \`Wiki \`\_\_. There are several ways to improve the documentation: - Better documenting core functionality (RTD) - Documenting common "gotchas" (RTD) - Documenting difficult and niche use cases (Wiki) - Documenting common design patterns (Wiki) - Documenting internal components (Wiki) See the documentation on \`building the documentation <#building-documentation-locally>\`\_\_ and the \`guidelines on submitting pull requests <#patch-requirements>\`\_\_. Documentation improvements typically require no maintainer pre-approval; you can simply work on the documentation and open a pull request. Documentation on the Wiki does not require a pull request; any user with a Github account can contribute to it. Please be responsible with that power. Project Management ------------------ The cocotb project is \`fairly popular \`\_\_ and the \`Gitter channel \`\_\_ and \`Github issues \`\_\_ page receive a fair amount of traffic; which is only expected to increase. People are needed to categorize issues and pull requests, and respond to questions. Working this task is the quickest way to learn how cocotb works. Tending to this task requires the following: - people skills - an understanding of the scope of cocotb - general understanding about how cocotb works Someone working this task should set notifications on the Gitter channel to be notified of any new comments. They should also "watch" the Github repo by selecting the "Watching" notification level button in the upper right corner of the main Github page. Finally, they should notify the maintainers that they are able and willing to accept questions. To be able to add labels and close issues and PRs you will need special permissions. Contact a \`maintainer <#maintainer>\`\_\_ if you are interested in receiving these permissions. They will be granted according to the project's need and the requestor's familiarity with cocotb. Once you have those permissions, see the guidelines on \`managing issues and pull requests <#Managing-of-Issues-and-Pull-Requests>\`\_\_. This task can also be done without special repo permissions, by just commenting on the issue or PR. This is especially helpful for Github issues about bugs. If you can duplicate the bug or confirm the bug report is invalid, that helps maintainers \*a lot\*. Tests and Coverage ------------------ Cocotb has a suite of unit tests (located in the \`\`tests\`\` directory) and examples (located in the \`\`examples\`\` directory) which are functional acceptance tests. If a pull request cannot pass \*all\* of these tests, it will likely be rejected. To ensure cocotb only includes the highest quality code, these test should be exhaustive. We use code coverage as a quantifiable metric of the "exhaustiveness" of these tests, and wish to improve this metric. Working on this task requires a familiarity with: - Cocotb's core functionality - How to write Verilog and VHDL - How to write cocotb tests in Python - (Optionally) \`codecov \`\_\_; coverage aggregator and Github bot - (Optionally) the \`coverage \`\_\_ module, for Python code coverage - (Optionally) \`gcov \`\_\_, for C++ code coverage - (Optionally) \`Github Actions \`\_\_, for automatic acceptance testing Cocotb's regression tests can be improved by: - Testing more of cocotb's core functionality - Testing corner cases left out of the current set of tests (identified by looking at code coverage) - Increasing the matrix of simulators, operating system, and Python installations tested in CI Testing improvements don't require maintainer pre-approval, but require a pull request. Please see the \`guidelines on submitting pull requests <#patch-requirements>\`\_\_. Features -------- Cocotb is still in development and new features are still welcome and appreciated; as long as they stay \`in scope <#Architecture-and-Scope-of-Cocotb>\`\_\_. Cocotb is comprised of several major codebases, each requiring different sets of skills and development process. Instead of including that breakdown here, it is done in the \`internal documentation \`\_\_. Small improvements to existing features generally do not require maintainer pre-approval. Large changes, approximately >150 LOC changed, and new features generally require maintainer pre-approval. If a change is deemed too large for the main repo, or out of scope, please feel free to make it an \`extension \`\_\_. \*\*New features must not break existing features.\*\* Feature changes require full coverage of the added feature. This likely requires adding new unit tests to the \`\`tests\`\` directory. Issue-specific test directories will not be accepted, unless a special HDL entity is required. Instead, place the test in an existing test suite (\`\`test\_cocotb\`\`, \`\`test\_discovery\`\`, etc.). Features should generally follow the following design principles: - Something the user cannot do without assistance of cocotb-specific code - Orthogonal to existing features - Easily composed with existing features - Limited in scope and impervious to scope creep Bugfixes -------- .. warning:: Bugfixing cocotb is not for the faint of heart! Bugs happen. cocotb supports many simulators that have inconsistent support for the procedural interfaces cocotb depends on, and it has a number of features that aren't wholly tested yet. There are likely many bugs lurking, waiting to be found; which is why increasing testing and code coverage is important. Working on bugfixing can be very challenging, depending on the cause of the bug. In general, bugfixing requires knowledge of: - How cocotb works - \`cocotb's debugging utilities \`\_\_ - (Optional) Simulator interfaces (VPI, VHPI, and FLI) - (Optional) Python debugging tools (\`pdb \`\_\_, \`dowser \`\_\_) - (Optional) C/C++ debugging tools (\`gdb \`\_\_, \`valgrind \`\_\_) - (Optional) Specific simulators (sometimes the bug exists in the simulator and not cocotb) Fixing a bug follows the procedure: 1. Locate buggy behavior, make a Github issue - Maintainers may be able to offer more information, confirm it as a bug, or confirm it as expected behavior 2. Make a Minimum Reproducible Failing Example (MRFE, pronounced like Murphy, like the law :) - Confirms the bug - Add to \`regressions <#running-tests-locally>\`\_\_ 3. Open a new draft pull request with the MRFE test - It should cause CI to fail 4. Determine scope of the bug, and add that detail to the pull request - Which simulators/interfaces are affected? - Which Python versions? - Which operating systems? 5. Determine the cause of the bug, and add that detail to the pull request - May require Python or C debugging, or the built-in cocotb debugging utilities 6. Make a fix, and push it up on the PR branch - It should cause the CI to pass - The fix should not break other existing functionality Details on how to debug cocotb can be found on the \`Wiki \`\_\_. Deprecations and Removals ------------------------- Cocotb's treatment of deprecations and removal follows guidelines laid out \`here \`\_\_. Deprecations serve the following purposes: - Remove legacy code that has been deemed out of scope - Remove support for a simulator, OS, or Python version that is past end-of-life - Remove potentially dangerous, broken, and misunderstood interfaces (usually accompanied with a superior alternative) Deprecations can be incorporated at any time. They are implemented in Python by issuing a :class:\`DeprecationWarning\` or using the \`\`@deprecated\`\` decorator. In C++ code, deprecations are implemented by \`issuing a LOG\_WARN \`\_\_ with \`\`DEPRECATED\`\` in the message. Removals only occur on major version bumps. One can create removal pull requests at any time, on the condition they will not be accepted until the next release is known to be a major version release. Breaking Changes ---------------- Breaking changes are changes to the interface or behavior of a user-facing entity. They are necessary when a user-facing interfaces are broken in a way that cannot be changed without changing the behavior of user's code. In these situations it is ideal to be able to implement a switch between new better behavior and the old broken behavior. On major version bumps, this switch will be deprecated and the new behavior will become the default. In cases where behavioral switches are not easy to implement, breaking changes will attempt to be broadcasted to user by :class:\`DeprecationWarning\` when the to-be-changed behavior is invoked. Before major releases, pending breaking changes will be incorporated. One can create pull requests with breaking changes at any time, on the condition they will not be accepted until the next release is known to be a major version release. How to Get Changes Merged ========================= Have you fixed a bug in cocotb, or want to add new functionality to it? Cocotb follows the typical \`GitHub flow \`\_\_ and makes use of pull requests and reviews. Follow the steps below to get your changes merged, i.e. integrated into the main cocotb codebase. 1. Create an issue ticket on \`cocotb's GitHub issue tracker \`\_\_ describing the problem. Issues are also a good place to discuss design options with others before writing code. 2. \`Fork \`\_\_ the \`cocotb GitHub repository \`\_\_ into your personal namespace. 3. Create a new branch off the \`\`master\`\` branch for your set of changes. Use one branch per "topic," i.e. per set of changes which belong together. 4. Create one or multiple commits to address the issue. Make sure to read and follow the \`Patch Requirements <#patch-requirements>\`\_\_ when preparing your commits. 5. Create new \`pull request (PR) \`\_\_. 6. When you submit (or update) the pull request, a suite of regression tests will run. If any of them turns "red," i.e. reports a failure, you most likely need to fix your code before it can be merged. 7. The pull request needs to be reviewed by at least one of the :ref:\`maintainers\`. We aim to give feedback to all pull requests within a week, but as so often, life can get in the way. If you receive no feedback from a maintainer within that time, please contact them directly (e.g. on \`Gitter \`\_\_ or email). If a maintainer asks you to explain or modify code, try to do so. 8. Once your code has at least one positive review from a maintainer and no maintainer strongly objects it your code is ready to be merged into the \`\`master\`\` branch. Maintainer Pre-approval ----------------------- After making changes to cocotb, changes must be approved by at least one maintainer before being included. Out-of-scope and breaking changes \*\*will not be accepted\*\*. Also a maintainer could object to a change due to implementation approach or code quality reasons. To potentially save you frustration and time, it is a good idea to get maintainer pre-approval on the task before starting it. The best way to get maintainer pre-approval is to make a \`Github issue \`\_\_. These issues can be a place for maintainers, as well as other users, to voice opinions on a proposed change before the task is worked. You may also propose changes on the \`Gitter channel \`\_\_ or by directly contacting one of the :ref:\`maintainers\`. Patch Requirements ------------------ All changes which should go into the main codebase of cocotb must follow this set of requirements. - The code must be within the \`scope of cocotb <#architecture-and-scope-of-cocotb>\`\_\_. - All code must be licensed under the \`Revised BSD License \`\_\_. By contributing to this project you signal your agreement with these license terms. - All code must follow the established coding standards: - For Python code, follow the \`PEP 8 \`\_\_ style guide. - For C++ code, follow the \`Google C++ Style Guide \`\_\_ but with 4 space indentation. You can run the following command to automatically format the modified file to match the standard: .. code:: bash clang-format -i \- All code must pass existing tests. New functionality must be accompanied by tests, and bug fixes should add tests to increase the test coverage and prevent regressions. - If code changes or enhances documented behavior the documentation should be updated. - If a change is user-visible, a newsfragment should be added to \`\`docs/source/newsfragments\`\`. - All pull requests must be accepted by at least one maintainer, with no maintainer strongly objecting. Reviews must be performed by a person other than the primary author of the code. - All commits should follow established best practices when creating a commit message: - The first line of the commit message is the short summary of what the code change does. Keep this line below 50 characters. - Then have one blank line. - Now comes the long description of the commit. Use this text to discuss things which are not obvious from the code, especially \*why\* changes were made. Include the GitHub issue number (if one exists) in the form "Fixes #nnn" (\`read more about that \`\_\_). Keep each description line below 72 characters. - Use the following header for new non-example files: .. code:: python # Copyright cocotb contributors # Licensed under the Revised BSD License, see LICENSE for details. # SPDX-License-Identifier: BSD-3-Clause - Use the following header for new example files: .. code:: python # This file is public domain, it can be freely copied without restrictions. # SPDX-License-Identifier: CC0-1.0 --- # Unknown \# This file is public domain, it can be freely copied without restrictions. # SPDX-License-Identifier: CC0-1.0 # Makefile # defaults SIM ?= icarus TOPLEVEL\_LANG ?= verilog VERILOG\_SOURCES += $(PWD)/my\_design.sv # use VHDL\_SOURCES for VHDL files # TOPLEVEL is the name of the toplevel module in your Verilog or VHDL file TOPLEVEL = my\_design # MODULE is the basename of the Python test file MODULE = test\_my\_design # include cocotb's make rules to take care of the simulator setup include $(shell cocotb-config --makefiles)/Makefile.sim --- # Unknown \# This file is public domain, it can be freely copied without restrictions. # SPDX-License-Identifier: CC0-1.0 # test\_runner.py import os from pathlib import Path from cocotb.runner import get\_runner def test\_my\_design\_runner(): sim = os.getenv("SIM", "icarus") proj\_path = Path(\_\_file\_\_).resolve().parent sources = \[proj\_path / "my\_design.sv"\] runner = get\_runner(sim) runner.build( sources=sources, hdl\_toplevel="my\_design", ) runner.test(hdl\_toplevel="my\_design", test\_module="test\_my\_design,") if \_\_name\_\_ == "\_\_main\_\_": test\_my\_design\_runner() --- # Unknown \# This file is public domain, it can be freely copied without restrictions. # SPDX-License-Identifier: CC0-1.0 # test\_my\_design.py (simple) import cocotb from cocotb.triggers import Timer @cocotb.test() async def my\_first\_test(dut): """Try accessing the design.""" for \_ in range(10): dut.clk.value = 0 await Timer(1, unit="ns") dut.clk.value = 1 await Timer(1, unit="ns") dut.\_log.info("my\_signal\_1 is %s", dut.my\_signal\_1.value) assert dut.my\_signal\_2.value == 0, "my\_signal\_2 is not 0!" # test\_my\_design.py (extended) import cocotb from cocotb.triggers import FallingEdge, Timer async def generate\_clock(dut): """Generate clock pulses.""" for \_ in range(10): dut.clk.value = 0 await Timer(1, unit="ns") dut.clk.value = 1 await Timer(1, unit="ns") @cocotb.test() async def my\_second\_test(dut): """Try accessing the design.""" cocotb.start\_soon(generate\_clock(dut)) # run the clock "in the background" await Timer(5, unit="ns") # wait a bit await FallingEdge(dut.clk) # wait for falling edge/"negedge" dut.\_log.info("my\_signal\_1 is %s", dut.my\_signal\_1.value) assert dut.my\_signal\_2.value == 0, "my\_signal\_2 is not 0!" --- # Unknown \# This file is public domain, it can be freely copied without restrictions. # SPDX-License-Identifier: CC0-1.0 # Makefile # defaults SIM ?= icarus TOPLEVEL\_LANG ?= verilog VERILOG\_SOURCES += $(PWD)/my\_design.sv # use VHDL\_SOURCES for VHDL files # TOPLEVEL is the name of the toplevel module in your Verilog or VHDL file TOPLEVEL = my\_design # MODULE is the basename of the Python test file MODULE = test\_my\_design # include cocotb's make rules to take care of the simulator setup include $(shell cocotb-config --makefiles)/Makefile.sim --- # Unknown .. \_building: \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\* Build Options and Environment Variables \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\* Make System =========== Makefiles are provided for a variety of simulators in :file:\`src/cocotb/share/makefiles/simulators\`. The common Makefile :file:\`src/cocotb/share/makefiles/Makefile.sim\` includes the appropriate simulator Makefile based on the contents of the :make:var:\`SIM\` variable. Make Targets ------------ Makefiles defines the targets \`\`regression\`\` and \`\`sim\`\`, the default target is \`\`sim\`\`. Both rules create a results file with the name taken from :envvar:\`COCOTB\_RESULTS\_FILE\`, defaulting to \`\`results.xml\`\`. This file is a xUnit-compatible output file suitable for use with e.g. \`Jenkins \`\_. The \`\`sim\`\` targets unconditionally re-runs the simulator whereas the \`\`regression\`\` target only re-builds if any dependencies have changed. In addition, the target \`\`clean\`\` can be used to remove build and simulation artifacts. The target \`\`help\`\` lists these available targets and the variables described below. Make Phases ----------- Typically the makefiles provided with cocotb for various simulators use a separate \`\`compile\`\` and \`\`run\`\` target. This allows for a rapid re-running of a simulator if none of the :term:\`RTL\` source files have changed and therefore the simulator does not need to recompile the :term:\`RTL\`. Variables ========= The following sections document environment variables and makefile variables according to their owner/consumer. Of the environment variables, only :envvar:\`COCOTB\_TEST\_MODULES\` is mandatory to be set (typically done in a makefile or run script), all others are optional. .. If you edit the following sections, please also update the "helpmsg" text in ../../src/cocotb\_tools/config.py Cocotb ------ .. envvar:: COCOTB\_TOPLEVEL Use this to indicate the instance in the hierarchy to use as the :term:\`DUT\`. If this isn't defined then the first root instance is used. Leading and trailing whitespace are automatically discarded. The DUT is available in cocotb tests as a Python object at :data:\`cocotb.top\`; and is also passed to all cocotb tests as the :ref:\`first and only parameter \`. .. versionchanged:: 1.6 Strip leading and trailing whitespace .. versionchanged:: 2.0 :envvar:\`TOPLEVEL\` is renamed to :envvar:\`COCOTB\_TOPLEVEL\`. .. deprecated:: 2.0 :envvar:\`TOPLEVEL\` is a deprecated alias and will be removed. .. envvar:: COCOTB\_RANDOM\_SEED Seed the Python random module to recreate a previous test stimulus. At the beginning of every test a message is displayed with the seed used for that execution: .. code-block:: bash INFO cocotb.gpi \_\_init\_\_.py:89 in \_initialise\_testbench Seeding Python random module with 1377424946 To recreate the same stimuli use the following: .. code-block:: bash make COCOTB\_RANDOM\_SEED=1377424946 See also: :make:var:\`COCOTB\_PLUSARGS\` .. versionchanged:: 2.0 :envvar:\`RANDOM\_SEED\` is renamed to :envvar:\`COCOTB\_RANDOM\_SEED\`. .. deprecated:: 2.0 :envvar:\`RANDOM\_SEED\` is a deprecated alias and will be removed. .. envvar:: COCOTB\_PLUSARGS "Plusargs" are options that are starting with a plus (\`\`+\`\`) sign. They are passed to the simulator and are also available within cocotb as :data:\`cocotb.plusargs\`. In the simulator, they can be read by the Verilog/SystemVerilog system functions \`\`$test$plusargs\`\` and \`\`$value$plusargs\`\`. The special plusargs \`\`+ntb\_random\_seed\`\` and \`\`+seed\`\`, if present, are evaluated to set the random seed value if :envvar:\`COCOTB\_RANDOM\_SEED\` is not set. If both \`\`+ntb\_random\_seed\`\` and \`\`+seed\`\` are set, \`\`+ntb\_random\_seed\`\` is used. .. versionchanged:: 2.0 :envvar:\`PLUSARGS\` is renamed to :envvar:\`COCOTB\_PLUSARGS\`. .. deprecated:: 2.0 :envvar:\`PLUSARGS\` is a deprecated alias and will be removed. .. envvar:: COCOTB\_ANSI\_OUTPUT Use this to override the default behavior of annotating cocotb output with ANSI color codes if the output is a terminal (\`\`isatty()\`\`). \`\`COCOTB\_ANSI\_OUTPUT=1\`\` forces output to be ANSI-colored regardless of the type of \`\`stdout\`\` or the presence of :envvar:\`NO\_COLOR\` \`\`COCOTB\_ANSI\_OUTPUT=0\`\` suppresses the ANSI color output in the log messages .. envvar:: NO\_COLOR From http://no-color.org, All command-line software which outputs text with ANSI color added should check for the presence of a \`\`NO\_COLOR\`\` environment variable that, when present (regardless of its value), prevents the addition of ANSI color. .. envvar:: COCOTB\_REDUCED\_LOG\_FMT Defaults to \`\`1\`\`. Logs will include simulation time, message type (\`\`INFO\`\`, \`\`WARNING\`\`, \`\`ERROR\`\`, ...), logger name, and the log message itself. If the value is set to \`\`0\`\`, the filename and line number where a log function was called will be added between the logger name and the log message. .. envvar:: COCOTB\_ATTACH In order to give yourself time to attach a debugger to the simulator process before it starts to run, you can set the environment variable :envvar:\`COCOTB\_ATTACH\` to a pause time value in seconds. If set, cocotb will print the process ID (PID) to attach to and wait the specified time before actually letting the simulator run. .. envvar:: COCOTB\_ENABLE\_PROFILING Enable performance analysis of the Python portion of cocotb. When set, a file :file:\`test\_profile.pstat\` will be written which contains statistics about the cumulative time spent in the functions. From this, a callgraph diagram can be generated with \`gprof2dot \`\_ and \`\`graphviz\`\`. .. envvar:: COCOTB\_LOG\_LEVEL The default log level of all \`\`"cocotb"\`\` Python loggers. Valid values are \`\`TRACE\`\`, \`\`DEBUG\`\`, \`\`INFO\`\`, \`\`WARNING\`\`, \`\`ERROR\`\`, \`\`CRITICAL\`\`. The default is unset, which means that the log level is inherited from the root logger. This behaves similarly to \`\`INFO\`\`. .. versionchanged:: 2.0 The root \`\`"gpi"\`\` logger level is no longer set when this environment variable is used. Use :envvar:\`GPI\_LOG\_LEVEL\` instead. .. envvar:: GPI\_LOG\_LEVEL The default log level of all \`\`"gpi"\`\` (the low-level simulator interface) loggers, including both Python and the native GPI logger. Valid values are \`\`TRACE\`\`, \`\`DEBUG\`\`, \`\`INFO\`\`, \`\`WARNING\`\`, \`\`ERROR\`\`, \`\`CRITICAL\`\`. The default is unset, which means that the log level is inherited from the root logger. This behaves similarly to \`\`INFO\`\`. .. versionadded:: 2.0 .. envvar:: COCOTB\_RESOLVE\_X Defines how to resolve bits with a value of \`\`X\`\`, \`\`Z\`\`, \`\`U\`\`, \`\`W\`\`, or \`\`-\`\` when being converted to integer. Valid settings are: \`\`error\`\` Resolves nothing. \`\`weak\`\` Resolves \`\`L\`\` to \`\`0\`\` and \`\`H\`\` to \`\`1\`\`. \`\`zeros\`\` Like \`\`weak\`\`, but resolves all other non-\\ \`\`0\`\`\\ /\\ \`\`1\`\` values to \`\`0\`\`. \`\`ones\`\` Like \`\`weak\`\`, but resolves all other non-\\ \`\`0\`\`\\ /\\ \`\`1\`\` values to \`\`1\`\`. \`\`random\`\` Like \`\`weak\`\`, but resolves all other non-\\ \`\`0\`\`\\ /\\ \`\`1\`\` values randomly to either \`\`0\`\` or \`\`1\`\`. There is also a slight difference in behavior of \`\`bool(logic)\`\` when this environment variable is set. When this variable is set, \`\`bool(logic)\`\` treats all non-\\ \`\`0\`\`\\ /\\ \`\`1\`\` values as equivalent to \`\`0\`\`. When this variable is \*not\* set, \`\`bool(logic)\`\` will fail on non-\\ \`\`0\`\`\\ /\\ \`\`1\`\` values. .. warning:: Using this feature is \*not\* recommended. .. deprecated:: 2.0 The previously accepted values \`\`VALUE\_ERROR\`\`, \`\`ZEROS\`\`, \`\`ONES\`\`, and \`\`RANDOM\`\` are deprecated. .. envvar:: LIBPYTHON\_LOC The absolute path to the Python library associated with the current Python installation; i.e. \`\`libpython.so\`\` or \`\`python.dll\`\` on Windows. This is determined with \`\`cocotb-config --libpython\`\` in cocotb's makefiles. .. envvar:: COCOTB\_TRUST\_INERTIAL\_WRITES Defining this variable enables a mode which allows cocotb to trust that VPI/VHPI/FLI inertial writes are applied properly according to the respective standards. This mode can lead to noticeable performance improvements, and also includes some behavioral difference that are considered by the cocotb maintainers to be "better". Not all simulators handle inertial writes properly, so use with caution. This is achieved by \*not\* scheduling writes to occur at the beginning of the \`\`ReadWrite\`\` mode, but instead trusting that the simulator's inertial write mechanism is correct. This allows cocotb to avoid a VPI callback into Python to apply writes. .. note:: This flag is enabled by default for the GHDL, NVC and Verilator simulators. More simulators may enable this flag by default in the future as they are gradually updated to properly apply inertial writes according to the respective standard. .. note:: To test if your simulator behaves correctly with your simulator and version, first clone the cocotb github repo and run: .. code-block:: cd tests/test\_cases/test\_inertial\_writes make simulator\_test SIM= TOPLEVEL\_LANG= If the tests pass, your simulator and version apply inertial writes as expected and you can turn on :envvar:\`COCOTB\_TRUST\_INERTIAL\_WRITES\`. Regression Manager ~~~~~~~~~~~~~~~~~~ .. envvar:: COCOTB\_TEST\_MODULES The name of the Python module(s) to search for test functions - if your tests are in a file called \`\`test\_mydesign.py\`\`, \`\`COCOTB\_TEST\_MODULES\`\` would be set to \`\`test\_mydesign\`\`. Multiple modules can be specified using a comma-separated string. For example: \`\`COCOTB\_TEST\_MODULES="directed\_tests,random\_tests,error\_injection\_tests"\`\`. All tests will be run from each specified module in order of the module's appearance in this list. The is the only environment variable that is \*\*required\*\* for cocotb, all others are optional. .. versionchanged:: 2.0 :envvar:\`MODULE\` is renamed to :envvar:\`COCOTB\_TEST\_MODULES\`. .. deprecated:: 2.0 :envvar:\`MODULE\` is a deprecated alias and will be removed. .. \_testcase: .. envvar:: COCOTB\_TESTCASE A comma-separated list of tests to run. Does an exact match on the test name. .. versionchanged:: 2.0 :envvar:\`TESTCASE\` is renamed to :envvar:\`COCOTB\_TESTCASE\`. .. deprecated:: 2.0 :envvar:\`TESTCASE\` is a deprecated alias and will be removed. .. deprecated:: 2.0 Use :envvar:\`COCOTB\_TEST\_FILTER\` instead. If matching only the exact test name is desired, use the regular expression anchor character \`\`$\`\`. For example, \`\`my\_test$\`\` will match \`\`my\_test\`\`, but not \`\`my\_test\_2\`\`. To run multiple tests, use regular expression alternations. For example, \`\`my\_test|my\_other\_test\`\`. .. versionchanged:: 2.0 Previously, if more than one test matched a test name in the :envvar:\`TESTCASE\` list, only the first test that matched that test name in the :envvar:\`COCOTB\_TEST\_MODULES\` list was run. Now, all tests that match the test name across all :envvar:\`COCOTB\_TEST\_MODULES\`\\ s are run. .. warning:: Only one of :envvar:\`COCOTB\_TESTCASE\` or :envvar:\`COCOTB\_TEST\_FILTER\` should be used. .. envvar:: COCOTB\_TEST\_FILTER A regular expression matching names of test function(s) to run. If this variable is not defined cocotb discovers and executes all functions decorated with the :class:\`cocotb.test\` decorator in the supplied :envvar:\`COCOTB\_TEST\_MODULES\` list. .. versionadded:: 2.0 .. warning:: Only one of :envvar:\`COCOTB\_TESTCASE\` or :envvar:\`COCOTB\_TEST\_FILTER\` should be used. .. envvar:: COCOTB\_RESULTS\_FILE The file name where xUnit XML tests results are stored. If not provided, the default is :file:\`results.xml\`. .. versionadded:: 1.3 .. envvar:: COCOTB\_USER\_COVERAGE Enable to collect Python coverage data for user code. For some simulators, this will also report :term:\`HDL\` coverage. If :envvar:\`COCOTB\_COVERAGE\_RCFILE\` is not set, branch coverage is collected and files in the cocotb package directory are excluded. This needs the :mod:\`coverage\` Python module to be installed. .. versionchanged:: 2.0 :envvar:\`COVERAGE\` is renamed to :envvar:\`COCOTB\_USER\_COVERAGE\`. .. deprecated:: 2.0 :envvar:\`COVERAGE\` is a deprecated alias and will be removed. .. envvar:: COCOTB\_COVERAGE\_RCFILE Location of a configuration file for coverage collection of Python user code using the the :mod:\`coverage\` module. See https://coverage.readthedocs.io/en/latest/config.html for documentation of this file. If this environment variable is set, cocotb will \*not\* apply its own default coverage collection settings, like enabling branch coverage and excluding files in the cocotb package directory. .. versionadded:: 1.7 .. versionchanged:: 2.0 :envvar:\`COVERAGE\_RCFILE\` is renamed to :envvar:\`COCOTB\_COVERAGE\_RCFILE\`. .. deprecated:: 2.0 :envvar:\`COVERAGE\_RCFILE\` is a deprecated alias and will be removed. .. envvar:: COCOTB\_PDB\_ON\_EXCEPTION If defined, cocotb will drop into the Python debugger (:mod:\`pdb\`) if a test fails with an exception. See also the :ref:\`troubleshooting-attaching-debugger-python\` subsection of :ref:\`troubleshooting-attaching-debugger\`. .. envvar:: COCOTB\_REWRITE\_ASSERTION\_FILES Select the Python files to apply \`\`pytest\`\`'s assertion rewriting to. This is useful to get more informative assertion error messages in cocotb tests. Specify using a space-separated list of file globs, e.g. \`\`test\_\*.py testbench\_common/\*\*/\*.py\`\`. Set to the empty string to disable assertion rewriting. Defaults to \`\`\*.py\`\` (all Python files, even third-party modules like \`\`scipy\`\`). Scheduler ~~~~~~~~~ .. envvar:: COCOTB\_SCHEDULER\_DEBUG Enable additional log output of the coroutine scheduler. GPI --- .. envvar:: GPI\_EXTRA A comma-separated list of extra libraries that are dynamically loaded at runtime. A function from each of these libraries will be called as an entry point prior to elaboration, allowing these libraries to register system functions and callbacks. Note that :term:\`HDL\` objects cannot be accessed at this time. An entry point function must be named following a \`\`:\`\` separator, which follows an existing simulator convention. For example: \* \`\`GPI\_EXTRA=libnameA.so:entryA,libnameB.so:entryB\`\` will first load \`\`libnameA.so\`\` with entry point \`\`entryA\`\` , then load \`\`libnameB.so\`\` with entry point \`\`entryB\`\`. .. versionchanged:: 1.4 Support for the custom entry point via \`\`:\`\` was added. Previously \`\`:\`\` was used as a separator between libraries instead of \`\`,\`\`. .. versionchanged:: 1.5 Library name must be fully specified. This allows using relative or absolute paths in library names, and loading from libraries that \`aren't\` prefixed with "lib". Paths \`should not\` contain commas. PyGPI ----- .. envvar:: PYGPI\_PYTHON\_BIN The Python binary in the Python environment to use with cocotb. This is set to the result of \`\`cocotb-config --python-bin\`\` in the Makefiles and :ref:\`Python Runner \`. You will likely only need to set this variable manually if you are using a Python environment other than the currently activated environment, or if you are using a :ref:\`custom flow \`. .. envvar:: PYGPI\_USERS The Python module and callable that starts up the Python cosimulation environment. User overloads can be used to enter alternative Python frameworks or to hook existing cocotb functionality. The variable is formatted as \`\`path.to.entry.module:entry\_point.function,other\_module:other\_func\`\`. The string before the colon is the Python module to import and the string following the colon is the object to call as the entry function. Multiple entry points can be specified by separating them with a comma. The entry function must be a callable matching this form: \* \`\`entry\_function(argv: List\[str\]) -> None\`\` .. versionchanged:: 1.8 \`\`level\`\` argument to \`\`\_sim\_event\`\` is no longer passed, it is assumed to be \`SIM\_FAIL\` (2). .. versionchanged:: 2.0 The entry-module-level functions \`\`\_sim\_event\`\`, \`\`\_log\_from\_c\`\`, and \`\`\_filter\_from\_c\`\` are no longer required. .. versionchanged:: 2.0 Multiple entry points can be specified by separating them with a comma. .. versionchanged:: 2.0 Renamed from \`\`PYGPI\_ENTRY\_POINT\`\`. Makefile-based Test Scripts --------------------------- The following variables are makefile variables, not environment variables. .. make:var:: GUI Set this to 1 to enable the GUI mode in the simulator (if supported). .. make:var:: SIM In the makefile flow, selects which simulator Makefile to use. Attempts to include a simulator specific makefile from :file:\`src/cocotb/share/makefiles/simulators/makefile.$(SIM)\` In the :ref:\`Python Runner \` flow, selects the :ref:\`Simulator Runner \` to use. .. make:var:: WAVES Set this to 1 to enable wave traces dump for the Aldec Riviera-PRO, Mentor Graphics Questa, and Icarus Verilog simulators. To get wave traces in Verilator see :ref:\`sim-verilator-waveforms\`. .. make:var:: TOPLEVEL\_LANG Used to inform the makefile scripts which :term:\`HDL\` language the top-level design element is written in. Currently it supports the values \`\`verilog\`\` for Verilog or SystemVerilog tops, and \`\`vhdl\`\` for VHDL tops. This is used by simulators that support more than one interface (:term:\`VPI\`, :term:\`VHPI\`, or :term:\`FLI\`) to select the appropriate interface to start cocotb. .. make:var:: VHDL\_GPI\_INTERFACE Explicitly sets the simulator interface to use when :make:var:\`TOPLEVEL\_LANG\` is \`\`vhdl\`\`. This includes the initial GPI interface loaded, and :envvar:\`GPI\_EXTRA\` library loaded in mixed language simulations. Valid values are \`\`vpi\`\`, \`\`vhpi\`\`, or \`\`fli\`\`. Not all simulators support all values; refer to the :ref:\`simulator-support\` section for details. Setting this variable is rarely needed as cocotb chooses a suitable default value depending on the simulator used. .. make:var:: VERILOG\_SOURCES A list of the Verilog source files to include. Paths can be absolute or relative; if relative, they are interpreted as relative to the location where \`\`make\`\` was invoked. .. make:var:: VERILOG\_INCLUDE\_DIRS A list of the Verilog directories to search for include files. Paths can be absolute or relative; if relative, they are interpreted as relative to the location where \`\`make\`\` was invoked. .. make:var:: VHDL\_SOURCES A list of the VHDL source files to include. Paths can be absolute or relative; if relative, they are interpreted as relative to the location where \`\`make\`\` was invoked. .. make:var:: VHDL\_SOURCES\_ A list of the VHDL source files to include in the VHDL library \*lib\* (currently for GHDL/ModelSim/Questa/Xcelium/Incisive/Riviera-PRO only). .. make:var:: VHDL\_LIB\_ORDER A space-separated list defining the order in which VHDL libraries should be compiled (needed for ModelSim/Questa/Xcelium/Incisive, GHDL determines the order automatically). .. make:var:: COMPILE\_ARGS Any arguments or flags to pass to the compile (analysis) stage of the simulation. .. make:var:: SIM\_ARGS Any arguments or flags to pass to the execution of the compiled simulation. .. make:var:: RUN\_ARGS Any argument to be passed to the "first" invocation of a simulator that runs via a TCL script. One motivating usage is to pass \`-noautoldlibpath\` to Questa to prevent it from loading the out-of-date libraries it ships with. Used by Aldec Riviera-PRO and Mentor Graphics Questa simulator. .. make:var:: EXTRA\_ARGS Passed to both the compile and execute phases of simulators with two rules, or passed to the single compile and run command for simulators which don't have a distinct compilation stage. .. make:var:: SIM\_CMD\_PREFIX Prefix for simulation command invocations. This can be used to add environment variables or other commands before the invocations of simulation commands. For example, \`\`SIM\_CMD\_PREFIX := LD\_PRELOAD="foo.so bar.so"\`\` can be used to force a particular library to load. Or, \`\`SIM\_CMD\_PREFIX := gdb --args\`\` to run the simulation with the GDB debugger. .. versionadded:: 1.6 .. make:var:: SIM\_CMD\_SUFFIX Suffix for simulation command invocations. Typically used to redirect simulator \`\`stdout\`\` and \`\`stderr\`\`: .. code-block:: Makefile # Prints simulator stdout and stderr to the terminal # as well as capture it all in a log file "sim.log". SIM\_CMD\_SUFFIX := 2>&1 | tee sim.log .. versionadded:: 2.0 .. make:var:: COCOTB\_HDL\_TIMEUNIT The default time unit that should be assumed for simulation when not specified by modules in the design. If this isn't specified then it is assumed to be \`\`1ns\`\`. Allowed values are 1, 10, and 100. Allowed units are \`\`s\`\`, \`\`ms\`\`, \`\`us\`\`, \`\`ns\`\`, \`\`ps\`\`, \`\`fs\`\`. .. versionadded:: 1.3 .. make:var:: COCOTB\_HDL\_TIMEPRECISION The default time precision that should be assumed for simulation when not specified by modules in the design. If this isn't specified then it is assumed to be \`\`1ps\`\`. Allowed values are 1, 10, and 100. Allowed units are \`\`s\`\`, \`\`ms\`\`, \`\`us\`\`, \`\`ns\`\`, \`\`ps\`\`, \`\`fs\`\`. .. versionadded:: 1.3 .. make:var:: CUSTOM\_COMPILE\_DEPS Use to add additional dependencies to the compilation target; useful for defining additional rules to run pre-compilation or if the compilation phase depends on files other than the :term:\`RTL\` sources listed in :make:var:\`VERILOG\_SOURCES\` or :make:var:\`VHDL\_SOURCES\`. .. make:var:: CUSTOM\_SIM\_DEPS Use to add additional dependencies to the simulation target. .. make:var:: SIM\_BUILD Use to define a scratch directory for use by the simulator. The path is relative to the location where \`\`make\`\` was invoked. If not provided, the default scratch directory is :file:\`sim\_build\`. .. envvar:: SCRIPT\_FILE The name of a simulator script that is run as part of the simulation, e.g. for setting up wave traces. You can usually write out such a file from the simulator's GUI. This is currently supported for the Mentor Questa, Mentor ModelSim and Aldec Riviera simulators. .. make:var:: TOPLEVEL\_LIBRARY The name of the library that contains the :envvar:\`COCOTB\_TOPLEVEL\` module/entity. Only supported by the Aldec Riviera-PRO, Aldec Active-HDL, and Siemens EDA Questa simulators. .. make:var:: PYTHON\_BIN The path to the Python binary. Set to the result of \`\`cocotb-config --python-bin\`\` if \`\`cocotb-config\`\` is present on the \`\`PATH\`\`. Otherwise defaults to \`\`python3\`\`. Library Build Process --------------------- You can pass additional options to the library build process (which is usually happening as part of the installation with \`\`pip\`\`) using the \`conventional variables \`\_ for C and C++ compilation and linking: \`CFLAGS\`, \`CPPFLAGS\`, and \`LDFLAGS\`. .. \`CXXFLAGS\`, \`LDLIBS\` are not supported by distutils/pip --- # Unknown \======================= Upgrading to cocotb 2.0 ======================= cocotb 2.0 makes testbenches easier to understand and write. Some of these improvements require updates to existing testbenches. This guide helps you port existing testbenches to cocotb 2.0. \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\* Step-by-step to cocotb 2.0 \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\* The migration to cocotb 2.0 is a two-step process. The first step is a gradual migration that can be performed in small increments as time permits and keeps the testbench fully operational. The second step is a flag-day migration to switch outdated APIs to their new counterparts. Step 1: Upgrade to cocotb 1.9 and resolve all deprecation warnings ================================================================== Many of the new features in cocotb 2.0 were already introduced in cocotb 1.x, while keeping existing functionality in place. Deprecation warnings highlight where functionality is used that will be gone in cocotb 2.0. Resolving all deprecations is therefore the first step in upgrading. 1. Upgrade to the latest version of cocotb 1.9. 2. Resolve all deprecation warnings. With every warning resolved, your code will be better prepared for cocotb 2.0. Step 2: Move to cocotb 2.0 ========================== After step 1 your testbenches are ready for the final migration to cocotb 2.0. 1. Start from a known-good state. Ensure all tests are passing, the logic is stable, and all code is committed. 2. Upgrade to cocotb 2.0. 3. Run the testbench to see where it fails. Replace outdated constructs as needed. Rinse and repeat. 4. Your testbenches are now running on cocotb 2.0! Continue reading on this page for common migration steps. Also have a look at the :doc:\`release\_notes\` for cocotb 2.0 and the linked GitHub pull requests or issues, which often also include changes to the cocotb tests that show the before and after of a change. You might see some new deprecation warnings in your code after the upgrade. As in step one, address those at your convenience (the sooner the better, of course). If you get lost or have questions, :doc:\`reach out through one of our support channels \`, we're happy to help! \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\* Use :func:\`!cocotb.start\_soon\` instead of :func:\`!cocotb.fork\` \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\* Change ====== :external+cocotb19:py:func:\`cocotb.fork\` was removed and replaced with :func:\`cocotb.start\_soon\`. How to Upgrade ============== \* Replace all instances of :func:\`!cocotb.fork\` with :func:\`!cocotb.start\_soon\`. \* Run tests to check for any changes in behavior. .. code-block:: python :caption: Old way with :func:\`!cocotb.fork\` :class: removed task = cocotb.fork(drive\_clk()) .. code-block:: python :caption: New way with :func:\`!cocotb.start\_soon\` :class: new task = cocotb.start\_soon(drive\_clk()) Rationale ========= :func:\`!cocotb.fork\` would turn :term:\`coroutine\`\\s into :class:\`~cocotb.task.Task\`\\s that would run concurrently to the current :term:\`task\`. However, it would immediately run the coroutine until the first :keyword:\`await\` was seen. This made the scheduler re-entrant and caused a series of hard to diagnose bugs and required extra state/sanity checking leading to runtime overhead. For these reasons :func:\`!cocotb.fork\` was deprecated in cocotb 1.7 and replaced with :func:\`!cocotb.start\_soon\`. :func:\`!cocotb.start\_soon\` does not start the coroutine immediately, but rather "soon", preventing scheduler re-entrancy and sidestepping an entire class of bugs and runtime overhead. \`The cocotb blog post on this change \`\_ is very illustrative of how :func:\`!cocotb.start\_soon\` and :func:\`!cocotb.fork\` are different. Additional Details ================== Coroutines run immediately -------------------------- There is a slight change in behavior due to :func:\`!cocotb.start\_soon\` not running the given coroutine immediately. This will not matter in most cases, but cases where it does matter are difficult to spot. If you have a coroutine (the parent) which :func:\`!cocotb.fork\`\\ s another coroutine (the child) and expects the child coroutine to run to a point before allowing the parent to continue running, you will have to add additional code to ensure that happens. In general, the easiest way to fix this is to add an :class:\`await NullTrigger() \` after the call to :func:\`!cocotb.start\_soon\`. .. code-block:: python :caption: Set up example... async def hello\_world(): cocotb.log.info("Hello, world!") .. code-block:: python :caption: Behavior of the old :func:\`!cocotb.fork\` :class: removed cocotb.fork(hello\_world()) # "Hello, world!" .. code-block:: python :caption: Behavior of the new :func:\`!cocotb.start\_soon\` :class: new cocotb.start\_soon(hello\_world()) # No print... await NullTrigger() # "Hello, world!" One caveat of this approach is that :class:\`!NullTrigger\` also allows every other scheduled coroutine to run as well. But this should generally not be an issue. If you require the "runs immediately" behavior of :func:\`!cocotb.fork\`, but are not calling it from a :term:\`coroutine function\`, update the function to be a coroutine function and add an \`\`await NullTrigger\`\`, if possible. Otherwise, more serious refactorings will be necessary. Exceptions before the first :keyword:\`!await\` --------------------------------------------- Also worth noting is that with :func:\`!cocotb.fork\`, if there was an exception before the first :keyword:\`!await\`, that exception would be thrown back to the caller of :func:\`!cocotb.fork\` and the \`\`Task\`\` object would not be successfully constructed. .. code-block:: python :caption: Set up example... async def has\_exception(): if variable\_does\_not\_exist: # throws NameError await Timer(1, 'ns') .. code-block:: python :caption: Behavior of the old :func:\`!cocotb.fork\` :class: removed try: task = cocotb.fork(has\_exception()) # NameError comes out here except NameError: cocotb.log.info("Got expected NameError!") # no task object exists .. code-block:: python :caption: Behavior of the new :func:\`!cocotb.start\_soon\` :class: new task = cocotb.start\_soon(has\_exception()) # no exception here try: await task # NameError comes out here except NameError: cocotb.log.info("Got expected NameError!") \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\* Move away from :deco:\`!cocotb.coroutine\` \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\* Change ====== Support for generator-based coroutines using the :external+cocotb19:py:class:\`@cocotb.coroutine \` decorator with Python :term:\`generator functions \` was removed. How to Upgrade ============== \* Remove the :deco:\`!cocotb.coroutine\` decorator. \* Add :keyword:\`async\` keyword directly before the :keyword:\`def\` keyword in the function definition. \* Replace any \`\`yield \[triggers, ...\]\`\` with :class:\`await First(triggers, ...) \`. \* Replace all \`\`yield\`\`\\ s in the function with :keyword:\`await\`\\ s. \* Remove all imports of the :deco:\`!cocotb.coroutine\` decorator .. code-block:: python :caption: Old way with :deco:\`!cocotb.coroutine\` :class: removed @cocotb.coroutine def my\_driver(): yield \[RisingEdge(dut.clk), FallingEdge(dut.areset\_n)\] yield Timer(random.randint(10), 'ns') .. code-block:: python :caption: New way with :keyword:\`!async\`\\ /:keyword:\`!await\` :class: new async def my\_driver(): # async instead of @cocotb.coroutine await First(RisingEdge(dut.clk), FallingEdge(dut.areset\_n)) # await First() instead of yield \[...\] await Timer(random.randint(10), 'ns') # await instead of yield Rationale ========= These existed to support defining coroutines in Python 2 and early versions of Python 3 before :term:\`coroutine functions \` using the :keyword:\`!async\`\\ /:keyword:\`!await\` syntax was added in Python 3.5. We no longer support versions of Python that don't support :keyword:\`!async\`\\ /:keyword:\`!await\`. Python coroutines are noticeably faster than :deco:\`!cocotb.coroutine\`'s implementation, and the behavior of :deco:\`!cocotb.coroutine\` would have had to be changed to support changes to the scheduler. For all those reasons the :deco:\`!cocotb.coroutine\` decorator and generator-based coroutine support was removed. .. \_logic-array-over-binary-value: \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\* Use :class:\`!LogicArray\` instead of :class:\`!BinaryValue\` \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\* Change ====== :external+cocotb19:py:class:\`~cocotb.binary.BinaryValue\` and :external+cocotb19:py:class:\`~cocotb.binary.BinaryRepresentation\` were removed and replaced with the existing :class:\`.Logic\` and :class:\`.LogicArray\`. How to Upgrade ============== Change all constructions of :class:\`!BinaryValue\` to :class:\`!LogicArray\`. Replace construction from :class:\`int\` with :meth:\`.LogicArray.from\_unsigned\` or :meth:\`.LogicArray.from\_signed\`. Replace construction from :class:\`bytes\` with :meth:\`.LogicArray.from\_bytes\` and pass the appropriate \`\`byteorder\`\` argument. .. code-block:: python :caption: Old way with :class:\`!BinaryValue\` :class: removed BinaryValue(10, 10) BinaryValue("1010", n\_bits=4) BinaryValue(-10, 8, binaryRepresentation=BinaryRepresentation.SIGNED) BinaryValue(b"1234", bigEndian=True) .. code-block:: python :caption: New way with :class:\`!LogicArray\` :class: new LogicArray.from\_unsigned(10, 10) LogicArray("1010") LogicArray.from\_signed(-10, 8) BinaryValue.from\_bytes(b"1234", byteorder="big") ---- Replace usage of :external+cocotb19:py:attr:\`BinaryValue.integer \` and :external+cocotb19:py:attr:\`BinaryValue.signed\_integer \` with :meth:\`.LogicArray.to\_unsigned\` or :meth:\`.LogicArray.to\_signed\`, respectively. Replace usage of :external+cocotb19:py:attr:\`BinaryValue.binstr \` with the :class:\`str\` cast (this works with :class:\`!BinaryValue\` as well). Replace conversion to :class:\`!bytes\` with :meth:\`.LogicArray.to\_bytes\` and pass the appropriate \`\`byteorder\`\` argument. .. code-block:: python :caption: Old way with :class:\`!BinaryValue\` :class: removed val = BinaryValue(10, 4) assert val.integer == 10 assert val.signed\_integer == -6 assert val.binstr == "1010" assert val.buff == b"\\x0a" .. code-block:: python :caption: New way with :class:\`!LogicArray\` :class: new val = LogicArray(10, 4) assert val.to\_unsigned() == 10 assert val.to\_signed() == -6 assert str(val) == "1010" assert val.to\_bytes(byteorder="big") == b"\\x0a" ---- Remove setting of the :attr:\`!BinaryValue.big\_endian\` attribute to change endianness. .. code-block:: python :caption: Old way with :class:\`!BinaryValue\` :class: removed val = BinaryValue(b"12", bigEndian=True) assert val.buff == b"12" val.big\_endian = False assert val.buff == b"21" .. code-block:: python :caption: New way with :class:\`!LogicArray\` :class: new val = LogicArray.from\_bytes(b"12", byteorder="big") assert val.to\_bytes(byteorder="big") == b"12" assert val.to\_bytes(byteorder="little") == b"21" ---- Convert all objects to an unsigned :class:\`!int\` before doing any arithmetic operation, such as \`\`+\`\`, \`\`-\`\`, \`\`/\`\`, \`\`//\`\`, \`\`%\`\`, \`\`\*\*\`\`, \`\`- (unary)\`\`, \`\`+ (unary)\`\`, \`\`abs(value)\`\`, \`\`>>\`\`, or \`\`<<\`\`. .. code-block:: python :caption: Old way with :class:\`!BinaryValue\` :class: removed val = BinaryValue(12, 8) assert 8 \* val == 96 assert val << 2 == 48 assert val / 6 == 2.0 assert -val == -12 # inplace modification val \*= 3 assert val == 36 .. code-block:: python :caption: New way with :class:\`!LogicArray\` :class: new val = LogicArray(12, 8) val\_int = b.to\_unsigned() assert 8 \* val\_int == 96 assert val\_int << 2 == 48 assert val\_int / 6 == 2.0 assert -val\_int == -12 # inplace modification val\[:\] = val\_int \* 3 assert val == 36 ---- Change bit indexing and slicing to use the indexing provided by the \`\`range\`\` argument to the constructor. .. note:: Passing an :class:\`!int\` as the \`\`range\`\` argument will default the range to :class:\`Range(range-1, "downto", 0) \`. This means index \`\`0\`\` will be the rightmost bit and not the leftmost bit like in :class:\`BinaryValue\`. Pass \`\`Range(0, range-1)\`\` when constructing :class:\`!LogicArray\` to retain the old indexing scheme, or update the indexing and slicing usage. .. code-block:: python :caption: Old way with :class:\`!BinaryValue\` :class: removed val = BinaryValue(10, 4) assert val\[0\] == 1 assert val\[3\] == 0 .. code-block:: python :caption: New way with :class:\`!LogicArray\`, specifying an ascending range :class: new val = LogicArray(10, Range(0, 3)) assert val\[0\] == 1 assert val\[3\] == 0 .. code-block:: python :caption: New way with :class:\`!LogicArray\`, changing indexing :class: new val = LogicArray(10, 4) assert val\[3\] == 1 assert val\[0\] == 0 See :ref:\`update-indexing\` for more details on how to update indexing and slicing. ---- Change all uses of the :attr:\`.LogicArray.binstr\`, :attr:\`.LogicArray.integer\`, :attr:\`.LogicArray.signed\_integer\`, and :attr:\`.LogicArray.buff\` setters, as well as calls to :external+cocotb19:py:meth:\`BinaryValue.assign() \`, to use :class:\`!LogicArray\`'s setitem syntax. .. code-block:: python :caption: Old way with :class:\`!BinaryValue\` :class: removed val = BinaryValue(10, 8) val.binstr = "00001111" val.integer = 0b11 val.signed\_integer = -123 val.buff = b"a" .. code-block:: python :caption: New way with :class:\`!LogicArray\` :class: new val = LogicArray(10, 8) val\[:\] = "00001111" val\[:\] = LogicArray.from\_unsigned(3, 8) # or val\[:\] = 0b00000011 val\[:\] = LogicArray.from\_signed(-123, 8) val\[:\] = LogicArray.from\_bytes(b"a", byteorder="big") .. note:: Alternatively, don't modify the whole value in place, but instead modify the variable with a new value. ---- Change expected type of single indexes to :class:\`.Logic\` and slices to :class:\`.LogicArray\`. .. code-block:: python :caption: Old way with :class:\`!BinaryValue\` :class: removed val = BinaryValue(10, 4) assert isinstance(val\[0\], BinaryValue) assert isinstance(val\[0:3\], BinaryValue) .. code-block:: python :caption: New way with :class:\`!LogicArray\` :class: new val = LogicArray(10, 4) assert isinstance(val\[0\], Logic) assert isinstance(val\[0:3\], LogicArray) .. note:: :class:\`Logic\` supports usage in conditional expressions (e.g. \`\`if val: ...\`\`), equality with :class:\`!str\`, :class:\`!bool\`, or :class:\`!int\`, and casting to :class:\`!str\`, :class:\`!bool\`, or :class:\`!int\`; so many behaviors overlap with :class:\`!LogicArray\` or how these values would be used previously with :class:\`!BinaryValue\`. .. note:: This also implies a change to type annotations. Rationale ========= In many cases :class:\`!BinaryValue\` would behave in unexpected ways that were often reported as errors. These unexpected behaviors were either an unfortunate product of its design or done purposefully. They could not necessarily be "fixed" and any fix would invariably break the API. So rather than attempt to fix it, it was outright replaced. Unfortunately, a gradual change is not possible with such core functionality, so it was replaced in one step. Additional Details ================== There are some behaviors of :class:\`!BinaryValue\` that are \*not\* supported anymore. They were deliberately not added to :class:\`!LogicArray\` because they were unnecessary, unintuitive, or had bugs. Dynamic-sized :class:\`!BinaryValue\`\\ s -------------------------------------- The above examples all pass the \`\`n\_bits\`\` argument to the :class:\`!BinaryValue\` constructor. However, it is possible to construct a :class:\`!BinaryValue\` without a set size. Doing so would allow the size of the :class:\`!BinaryValue\` to change whenever the value was set. :class:\`!LogicArray\`\\ s are fixed size. Instead of modifying the :class:\`!LogicArray\` in-place with a different sized value, modify the variable holding the :class:\`!LogicArray\` to point to a different value. .. code-block:: python :caption: Old way with :class:\`!BinaryValue\` :class: removed val = BinaryValue(0, binaryRepresentation=BinaryRepresentation.TWOS\_COMPLEMENT) assert len(val) == 0 val.binstr = "1100" assert len(val) == 4 val.integer = 100 assert len(val) == 8 # minimum size in two's complement representation .. code-block:: python :caption: New way with :class:\`!LogicArray\` :class: new val = LogicArray(0, 0) # must provide size! assert len(val) == 0 val = LogicArray("1100") assert len(val) == 4 val = LogicArray.from\_signed(100, 8) # must provide size! assert len(val) == 8 Assigning with partial values and "bit-endianness" -------------------------------------------------- Previously, when modifying a :class:\`!BinaryValue\` in-place using :external+cocotb19:py:meth:\`BinaryValue.assign \` or the :external+cocotb19:py:attr:\`BinaryValue.buff \`, :external+cocotb19:py:attr:\`BinaryValue.binstr \`, :external+cocotb19:py:attr:\`BinaryValue.integer \`, or :external+cocotb19:py:attr:\`BinaryValue.signed\_integer \` setters, if the provided value was smaller than the :class:\`!BinaryValue\`, the value would be zero-extended based on the endianness of :class:\`!BinaryValue\`. :class:\`!LogicArray\` has no concept of "bit-endianness" as the indexing scheme is arbitrary. When partially setting a :class:\`!LogicArray\`, you are expected to explicitly provide the slice you want to set, and it must match the size of the value it's being set with. .. code-block:: python :caption: Old way with :class:\`!BinaryValue\` :class: removed b = BinaryValue(0, 4, bigEndian=True) b.binstr = "1" assert b == "1000" b.integer = 2 assert b == "1000" # Surprise! c = BinaryValue(0, 4, bigEndian=False) c.binstr = "1" assert c == "0001" c.integer = 2 assert c == "0010" .. code-block:: python :caption: New way with :class:\`!LogicArray\` :class: new val = LogicArray(0, Range(0, 3)) val\[0\] = "1" assert val == "1000" val\[0:1\] = 0b01 assert val == "0100" .. note:: :class:\`!LogicArray\` supports setting its value with the deprecated :attr:\`.LogicArray.buff\`, :attr:\`.LogicArray.binstr\`, :attr:\`.LogicArray.integer\` and :attr:\`.LogicArray.signed\_integer\` setters, but assumes the value matches the width of the whole :class:\`!LogicArray\`. Values that are too big or too small will result in a :exc:\`ValueError\`. Implicit truncation ------------------- Conversely, when modifying a :class:\`!BinaryValue\` in-place, if the provided value is too large, it would be implicitly truncated and issue a :exc:\`RuntimeWarning\`. In certain circumstances, the :exc:\`!RuntimeWarning\` wouldn't be issued. :class:\`LogicArray\`, as stated in the previous section, requires the user to provide a value the same size as the slice to be set. Failure to do so will result in a :exc:\`ValueError\`. .. code-block:: python :caption: Old way with :class:\`!BinaryValue\` :class: removed b = BinaryValue(0, 4, bigEndian=True) b.binstr = "00001111" # RuntimeWarning: 4-bit value requested, truncating value '00001111' (8 bits) to '1111' assert b == "1111" b.integer = 100 # RuntimeWarning: 4-bit value requested, truncating value '1100100' (7 bits) to '0100' assert b == "0100" c = BinaryValue(0, 4, bigEndian=False) c.binstr = "00001111" # No RuntimeWarning? assert c == "1111" # Surprise! c.integer = 100 # RuntimeWarning: 4-bit value requested, truncating value '1100100' (7 bits) to '110' assert c == "110" # ??? .. code-block:: python :caption: New way with :class:\`!LogicArray\` :class: new val = LogicArray(0, 4) # val\[:\] = "00001111" # ValueError: Value of length 8 will not fit in Range(3, 'downto', 0) # val\[:\] = 100 # ValueError: 100 will not fit in a LogicArray with bounds: Range(3, 'downto', 0) val\[3:0\] = "00001111"\[:4\] assert val == "0000" val\[3:0\] = LogicArray.from\_unsigned(100, 8)\[3:0\] assert val == "0100" .. note:: :class:\`!LogicArray\` supports setting its value with the deprecated :attr:\`.LogicArray.buff\`, :attr:\`.LogicArray.binstr\`, :attr:\`.LogicArray.integer\` and :attr:\`.LogicArray.signed\_integer\` setters, but assumes the value matches the width of the whole :class:\`!LogicArray\`. Values that are too big or too small will result in a :exc:\`ValueError\`. Integer representation ---------------------- :class:\`!BinaryValue\` could be constructed with a \`\`binaryRepresentation\`\` argument of the type :external+cocotb19:py:class:\`~cocotb.binary.BinaryRepresentation\` which would select how that :class:\`!BinaryValue\` would interpret any integer being used to set its value. :external+cocotb19:py:meth:\`BinaryValue.assign \` and the :external+cocotb19:py:attr:\`BinaryValue.integer \` and :external+cocotb19:py:attr:\`BinaryValue.signed\_integer \` setters all behaved the same when given an integer. Unlike endianness, this could not be changed after construction (setting :attr:\`!BinaryValue.binaryRepresentation\` has no effect). :class:\`!LogicArray\` does not have a concept of integer representation as a part of its value, its value is just an array of :class:\`!Logic\`. Integer representation is provided when converting to and from an integer. .. note:: :class:\`!LogicArray\` interfaces that can take integers are expected to take them as "bit array literals", e.g. \`\`0b110101\`\` or \`\`0xFACE\`\`. That is, they are interpreted as if they are unsigned integer values. .. note:: :class:\`!LogicArray\` supports setting its value with the deprecated :attr:\`.LogicArray.integer\` and :attr:\`.LogicArray.signed\_integer\` setters, but assumes an unsigned and two's complement representation, respectively. .. \_logic-handle-value-changes: \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\* Expect :class:\`!LogicArray\` and :class:\`!Logic\` instead of :class:\`!BinaryValue\` when getting values from logic-like simulator objects \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\* Change ====== Handles to logic-like simulator objects now return :class:\`.LogicArray\` or :class:\`.Logic\` instead of :external+cocotb19:py:class:\`~cocotb.binary.BinaryValue\` when getting their value with the :attr:\`value \` getter. Scalar logic-like simulator objects return :class:\`!Logic\`, and array-of-logic-like simulator objects return :class:\`!LogicArray\`. How to Upgrade ============== :ref:\`logic-array-over-binary-value\` when dealing with array-of-logic-like simulator objects. Change code when dealing with scalar logic-like simulator objects to work with :class:\`!Logic\`. Change indexing assumptions from always being \`\`0\`\` to \`\`length-1\`\` left-to-right, to following the arbitrary indexing scheme of the logic array as defined in HDL. See :ref:\`update-indexing\` for more details on how to update indexing and slicing. Rationale ========= See the rationale for switching from :class:\`!BinaryValue\` to :class:\`!LogicArray\`. The change to use the HDL indexing scheme makes usage more intuitive for new users and eases debugging. Scalars and arrays of logic handles were split into two types with different value types so that handles to arrays could support getting :func:\`length \` and indexing information: :meth:\`.LogicArrayObject.left\`, :meth:\`.LogicArrayObject.right\`, :meth:\`.LogicArrayObject.direction\`, and :meth:\`.LogicArrayObject.range\`, which cause errors when applied to scalar objects. Additional Details ================== Operations such as equality with and conversion to :class:\`int\`, :class:\`str\`, and :class:\`bool\`, as well as getting the :func:\`length \`, work the same for :class:\`!Logic\`, :class:\`!LogicArray\`, and :class:\`!BinaryValue\`. This was done deliberately to reduce the number of changes required, while also providing a common API to enable writing backwards-compatible and higher-order APIs. .. code-block:: python :caption: Works with :class:\`!BinaryValue\` in cocotb 1.x and both :class:\`!Logic\` and :class:\`!LogicArray\` in cocotb 2.x. assert len(dut.signal.value) == 1 assert dut.signal.value == 1 assert dut.signal.value == "1" assert dut.signal.value == True assert int(dut.signal.value) == 1 assert str(dut.signal.value) == "1" assert bool(dut.signal.value) is True dut.signal.value = 1 dut.signal.value = "1" dut.signal.value = True .. \_array-handle-value-changes: \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\* Expect :class:\`!Array\` instead of :class:\`!list\` when getting values from arrayed simulator objects \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\* Change ====== Handles to arrayed simulator objects now return :class:\`.Array\` instead of :class:\`list\` when getting values with the :attr:\`value \` getter. How to Upgrade ============== Change indexing assumptions from always being \`\`0\`\` to \`\`length-1\`\` left-to-right, to following the arbitrary indexing scheme of the array as defined in HDL. See :ref:\`update-indexing\` for more details on how to update indexing and slicing. Rationale ========= :class:\`!Array\` provides most features of :class:\`!list\` besides the fact that it is immutable in size and uses arbitrary indexing, like :class:\`.LogicArray\`. The change to use the HDL indexing scheme makes usage more intuitive for new users and eases debugging. Additional Details ================== Equality with and conversion to :class:\`!list\`, getting the :func:\`length \`, and iteration, works the same for both the old way and the new way using :class:\`!Array\`. This was done deliberately to reduce the number of changes required. .. code-block:: python :caption: Works with both :class:\`!list\` in cocotb 1.x and :class:\`!Array\` in cocotb 2.x. assert dut.array.value == \[1, 2, 3, 4\] as\_list = list(dut.array.value) assert as\_list\[0\] == 1 assert len(dut.array.value) == 4 for actual, expected in zip(dut.array.value, \[1, 2, 3, 4\]): assert actual == expected --- # Unknown \# This file is public domain, it can be freely copied without restrictions. # SPDX-License-Identifier: CC0-1.0 # Makefile # defaults SIM ?= icarus TOPLEVEL\_LANG ?= verilog VERILOG\_SOURCES += $(PWD)/my\_design.sv # use VHDL\_SOURCES for VHDL files # TOPLEVEL is the name of the toplevel module in your Verilog or VHDL file TOPLEVEL = my\_design # MODULE is the basename of the Python test file MODULE = test\_my\_design # include cocotb's make rules to take care of the simulator setup include $(shell cocotb-config --makefiles)/Makefile.sim --- # Unknown \# This file is public domain, it can be freely copied without restrictions. # SPDX-License-Identifier: CC0-1.0 # test\_my\_design.py (simple) import cocotb from cocotb.triggers import Timer @cocotb.test() async def my\_first\_test(dut): """Try accessing the design.""" for cycle in range(10): dut.clk.value = 0 await Timer(1, units="ns") dut.clk.value = 1 await Timer(1, units="ns") dut.\_log.info("my\_signal\_1 is %s", dut.my\_signal\_1.value) assert dut.my\_signal\_2.value\[0\] == 0, "my\_signal\_2\[0\] is not 0!" # test\_my\_design.py (extended) import cocotb from cocotb.triggers import FallingEdge, Timer async def generate\_clock(dut): """Generate clock pulses.""" for cycle in range(10): dut.clk.value = 0 await Timer(1, units="ns") dut.clk.value = 1 await Timer(1, units="ns") @cocotb.test() async def my\_second\_test(dut): """Try accessing the design.""" await cocotb.start(generate\_clock(dut)) # run the clock "in the background" await Timer(5, units="ns") # wait a bit await FallingEdge(dut.clk) # wait for falling edge/"negedge" dut.\_log.info("my\_signal\_1 is %s", dut.my\_signal\_1.value) assert dut.my\_signal\_2.value\[0\] == 0, "my\_signal\_2\[0\] is not 0!" --- # Unknown \# This file is public domain, it can be freely copied without restrictions. # SPDX-License-Identifier: CC0-1.0 # test\_my\_design.py (simple) import cocotb from cocotb.triggers import Timer @cocotb.test() async def my\_first\_test(dut): """Try accessing the design.""" for cycle in range(10): dut.clk.value = 0 await Timer(1, units="ns") dut.clk.value = 1 await Timer(1, units="ns") dut.\_log.info("my\_signal\_1 is %s", dut.my\_signal\_1.value) assert dut.my\_signal\_2.value\[0\] == 0, "my\_signal\_2\[0\] is not 0!" # test\_my\_design.py (extended) import cocotb from cocotb.triggers import FallingEdge, Timer async def generate\_clock(dut): """Generate clock pulses.""" for cycle in range(10): dut.clk.value = 0 await Timer(1, units="ns") dut.clk.value = 1 await Timer(1, units="ns") @cocotb.test() async def my\_second\_test(dut): """Try accessing the design.""" await cocotb.start(generate\_clock(dut)) # run the clock "in the background" await Timer(5, units="ns") # wait a bit await FallingEdge(dut.clk) # wait for falling edge/"negedge" dut.\_log.info("my\_signal\_1 is %s", dut.my\_signal\_1.value) assert dut.my\_signal\_2.value\[0\] == 0, "my\_signal\_2\[0\] is not 0!" --- # Struct _log_level_table — cocotb 1.4.0 documentation * [](https://docs.cocotb.org/en/v1.4.0/index.html) » * [C Code Library Reference](https://docs.cocotb.org/en/v1.4.0/library_reference_c.html) » * [Struct list](https://docs.cocotb.org/en/v1.4.0/generated/structlist.html) » * Struct \_log\_level\_table * [Edit on GitHub](https://github.com/cocotb/cocotb/blob/v1.4.0/documentation/source/generated/struct/struct__log__level__table.rst) * * * Struct \_log\_level\_table[¶](https://docs.cocotb.org/en/v1.4.0/generated/struct/struct__log__level__table.html#struct-log-level-table "Permalink to this headline") ===================================================================================================================================================================== _struct_ `_log_level_table` --- # Struct t_vpi_arrayvalue — cocotb 1.4.0 documentation * [](https://docs.cocotb.org/en/v1.4.0/index.html) » * [C Code Library Reference](https://docs.cocotb.org/en/v1.4.0/library_reference_c.html) » * [Struct list](https://docs.cocotb.org/en/v1.4.0/generated/structlist.html) » * Struct t\_vpi\_arrayvalue * [Edit on GitHub](https://github.com/cocotb/cocotb/blob/v1.4.0/documentation/source/generated/struct/structt__vpi__arrayvalue.rst) * * * Struct t\_vpi\_arrayvalue[¶](https://docs.cocotb.org/en/v1.4.0/generated/struct/structt__vpi__arrayvalue.html#struct-t-vpi-arrayvalue "Permalink to this headline") ==================================================================================================================================================================== _struct_ `t_vpi_arrayvalue` --- # Struct t_vpi_attempt_info — cocotb 1.4.0 documentation * [](https://docs.cocotb.org/en/v1.4.0/index.html) » * [C Code Library Reference](https://docs.cocotb.org/en/v1.4.0/library_reference_c.html) » * [Struct list](https://docs.cocotb.org/en/v1.4.0/generated/structlist.html) » * Struct t\_vpi\_attempt\_info * [Edit on GitHub](https://github.com/cocotb/cocotb/blob/v1.4.0/documentation/source/generated/struct/structt__vpi__attempt__info.rst) * * * Struct t\_vpi\_attempt\_info[¶](https://docs.cocotb.org/en/v1.4.0/generated/struct/structt__vpi__attempt__info.html#struct-t-vpi-attempt-info "Permalink to this headline") ============================================================================================================================================================================ _struct_ `t_vpi_attempt_info` --- # Struct sim_time — cocotb 1.4.0 documentation * [](https://docs.cocotb.org/en/v1.4.0/index.html) » * [C Code Library Reference](https://docs.cocotb.org/en/v1.4.0/library_reference_c.html) » * [Struct list](https://docs.cocotb.org/en/v1.4.0/generated/structlist.html) » * Struct sim\_time * [Edit on GitHub](https://github.com/cocotb/cocotb/blob/v1.4.0/documentation/source/generated/struct/structsim__time.rst) * * * Struct sim\_time[¶](https://docs.cocotb.org/en/v1.4.0/generated/struct/structsim__time.html#struct-sim-time "Permalink to this headline") ========================================================================================================================================== _struct_ `sim_time` --- # Struct t_vpi_delay — cocotb 1.4.0 documentation * [](https://docs.cocotb.org/en/v1.4.0/index.html) » * [C Code Library Reference](https://docs.cocotb.org/en/v1.4.0/library_reference_c.html) » * [Struct list](https://docs.cocotb.org/en/v1.4.0/generated/structlist.html) » * Struct t\_vpi\_delay * [Edit on GitHub](https://github.com/cocotb/cocotb/blob/v1.4.0/documentation/source/generated/struct/structt__vpi__delay.rst) * * * Struct t\_vpi\_delay[¶](https://docs.cocotb.org/en/v1.4.0/generated/struct/structt__vpi__delay.html#struct-t-vpi-delay "Permalink to this headline") ===================================================================================================================================================== _struct_ `t_vpi_delay` --- # Struct t_vpi_error_info — cocotb 1.4.0 documentation * [](https://docs.cocotb.org/en/v1.4.0/index.html) » * [C Code Library Reference](https://docs.cocotb.org/en/v1.4.0/library_reference_c.html) » * [Struct list](https://docs.cocotb.org/en/v1.4.0/generated/structlist.html) » * Struct t\_vpi\_error\_info * [Edit on GitHub](https://github.com/cocotb/cocotb/blob/v1.4.0/documentation/source/generated/struct/structt__vpi__error__info.rst) * * * Struct t\_vpi\_error\_info[¶](https://docs.cocotb.org/en/v1.4.0/generated/struct/structt__vpi__error__info.html#struct-t-vpi-error-info "Permalink to this headline") ====================================================================================================================================================================== _struct_ `t_vpi_error_info` --- # Struct callback_data — cocotb 1.4.0 documentation * [](https://docs.cocotb.org/en/v1.4.0/index.html) » * [C Code Library Reference](https://docs.cocotb.org/en/v1.4.0/library_reference_c.html) » * [Struct list](https://docs.cocotb.org/en/v1.4.0/generated/structlist.html) » * Struct callback\_data * [Edit on GitHub](https://github.com/cocotb/cocotb/blob/v1.4.0/documentation/source/generated/struct/structcallback__data.rst) * * * Struct callback\_data[¶](https://docs.cocotb.org/en/v1.4.0/generated/struct/structcallback__data.html#struct-callback-data "Permalink to this headline") ========================================================================================================================================================= _struct_ `callback_data` --- # Struct t_vpi_assertion_step_info — cocotb 1.4.0 documentation * [](https://docs.cocotb.org/en/v1.4.0/index.html) » * [C Code Library Reference](https://docs.cocotb.org/en/v1.4.0/library_reference_c.html) » * [Struct list](https://docs.cocotb.org/en/v1.4.0/generated/structlist.html) » * Struct t\_vpi\_assertion\_step\_info * [Edit on GitHub](https://github.com/cocotb/cocotb/blob/v1.4.0/documentation/source/generated/struct/structt__vpi__assertion__step__info.rst) * * * Struct t\_vpi\_assertion\_step\_info[¶](https://docs.cocotb.org/en/v1.4.0/generated/struct/structt__vpi__assertion__step__info.html#struct-t-vpi-assertion-step-info "Permalink to this headline") =================================================================================================================================================================================================== _struct_ `t_vpi_assertion_step_info` --- # Struct t_cb_data — cocotb 1.4.0 documentation * [](https://docs.cocotb.org/en/v1.4.0/index.html) » * [C Code Library Reference](https://docs.cocotb.org/en/v1.4.0/library_reference_c.html) » * [Struct list](https://docs.cocotb.org/en/v1.4.0/generated/structlist.html) » * Struct t\_cb\_data * [Edit on GitHub](https://github.com/cocotb/cocotb/blob/v1.4.0/documentation/source/generated/struct/structt__cb__data.rst) * * * Struct t\_cb\_data[¶](https://docs.cocotb.org/en/v1.4.0/generated/struct/structt__cb__data.html#struct-t-cb-data "Permalink to this headline") =============================================================================================================================================== _struct_ `t_cb_data` --- # Unknown .. \_platform-support: \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\* Platform Support \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\* cocotb supports Windows, Linux, and macOS, with a wide range of Python versions. This page describes which platform combinations we test and support. The :ref:\`platform-support-policy\` discusses the underlying policy. .. note:: In many cases cocotb will work on platforms not listed on this page, and we aim to fix compatibility issues as we become aware of them. However, we encourage less experienced users to stick with one of the supported options for a good user experience. Please reach out to the cocotb team if you would like to see support for a different platform, and are willing to contribute to maintaining it. Supported Python Versions ========================= The following versions of Python, and all associated patch releases (except where noted) are supported by cocotb. cocotb depends on CPython APIs; alternative Python implementations like PyPy or Jython are not supported. \* CPython 3.6 (requires 3.6.2+) \* CPython 3.7 \* CPython 3.8 \* CPython 3.9 \* CPython 3.10 \* CPython 3.11 \* CPython 3.12 \* CPython 3.13 Supported Linux Distributions and Versions ========================================== Linux users are in the privileged position of being able to choose from huge variety of distributions. While most of them are compatible with each other, some subtle differences exist. Even though cocotb aims to be agnostic to the distribution, and generally works well on most of them, we are explicitly supporting and testing on a limited subset of distributions which are common in EDA environments. We encourage especially users less experienced with Linux to use one of the supported and tested distributions listed below to ensure a smooth cocotb experience. Linux distributions typically ship a default version of Python called "system Python". This version of Python can be used with cocotb unless noted otherwise. \* \*\*Red Hat Enterprise Linux (RHEL) 8 amd64\*\*, shipping with Python 3.6 (newer versions of Python are available), pip 9, and glibc 2.28. \`Upstream support until May 2029 \`\_. \* \*\*Red Hat Enterprise Linux (RHEL) 9 amd64\*\*, shipping with Python 3.9 (newer versions of Python are available), pip 21, and glibc 2.34. \`Upstream support until May 2032 \`\_. \* \*\*Red Hat Enterprise Linux (RHEL) 10 amd64\*\*, shipping with Python 3.12, pip 23.3, and glibc 2.39. \`Upstream support until May 2035 \`\_. \* \*\*Ubuntu 22.04 LTS amd64\*\*, shipping with Python 3.10, pip 22, glibc 2.35. \`Upstream support until April 2027 \`\_. \* \*\*Ubuntu 24.04 LTS amd64\*\*, shipping with Python 3.12, pip 24, glibc 2.39. \`Upstream support until June 2029 \`\_. .. note:: \* Binary-compatible RHEL-clones, such as CentOS, AlmaLinux or Rocky Linux, are equally supported. \* For RHEL only Red Hat-supported minor versions are supported by cocotb. \* Compatible Ubuntu derivatives, such as Kubuntu, Xubuntu, etc., are equally supported. Supported Windows Versions ========================== \* \*\*Windows 10 x86\_64\*\* \* \*\*Windows 11 x86\_64\*\* Supported macOS Versions ======================== \* \*\*macOS 13 (Ventura) x86\_64\*\* \* \*\*macOS 14 (Sonoma) x86\_64\*\* \* \*\*macOS 15 (Sequoia) x86\_64\*\* .. \_platform-support-policy: cocotb Platform Support Policy ============================== cocotb's platform support policy is driven by two main considerations. 1. Support cocotb on the platforms our users are using. 2. Allow our users to use the latest cocotb release. The first item is obvious, but comes with interesting implications: for hardware projects it is common to use "mature" platforms such as the previous version of RHEL, and stay on that for the duration of a chip project, which might last multiple years. For cocotb, this means supporting rather old Python and operating system versions. The second item is less obvious. One might argue that users of older Python or operating system versions should simply use an old version of cocotb. There are two reasons against applying this rule too aggressively. First of all, we want to give users the benefit of using the latest and greatest version of cocotb on the platform they are on (and are typically unable to change). But even more importantly, every user who is on the latest release is beneficial for the cocotb project. Supporting multiple older cocotb releases comes a cost: users report bugs which have been fixed in later releases, patch releases need to be supplied (e.g. for security problems), and integrating improvements our users made becomes harder. When determining the list of supported operating systems and Python versions we are trying to balance those two main considerations. The guidance below adds a bit more color to the policy we apply for choosing supported Python and operating system versions. Python Support -------------- cocotb aims to support a wide range of Python versions as long as they are supported either by the upstream Python project, or by another entity. In general, cocotb aims to support all versions of Python \`supported by the Python upstream community \`\_ at the time a cocotb release was made. Additionally, the Python version a supported Linux distribution ships with (system Python) is typically supported as well, as long as it receives updates by the operating system vendor (e.g. Red Hat, Debian, or Canonical). Only the standard CPython implementation is supported, the alternatives are not supported. Operating System Support ------------------------ cocotb aims to support all operating systems commonly used by our users. As such, we try to match the support matrix of major EDA tools to enable a seamless interaction between simulators and cocotb. Additionally, cocotb should work on the latest version of Windows, Linux, and macOS to ensure users can update their operating system freely without being blocked by cocotb. cocotb only supports x86\_64 architectures and requires a 64-bit operating system. (Note: 32-bit x86 applications can be run on 64-bit operating systems.) --- # File vhpi_user_ext.h — cocotb 1.4.0 documentation * [](https://docs.cocotb.org/en/v1.4.0/index.html) » * [C Code Library Reference](https://docs.cocotb.org/en/v1.4.0/library_reference_c.html) » * [File list](https://docs.cocotb.org/en/v1.4.0/generated/filelist.html) » * File vhpi\_user\_ext.h * [Edit on GitHub](https://github.com/cocotb/cocotb/blob/v1.4.0/documentation/source/generated/file/vhpi__user__ext_8h.rst) * * * File vhpi\_user\_ext.h[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user__ext_8h.html#file-vhpi-user-ext-h "Permalink to this headline") ====================================================================================================================================================== Enums _enum_ `vhpiDiagT`[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user__ext_8h.html#_CPPv49vhpiDiagT "Permalink to this definition") _Values:_ _enumerator_ `vhpiDiagNone` = 0[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user__ext_8h.html#_CPPv4N9vhpiDiagT12vhpiDiagNoneE "Permalink to this definition") _enumerator_ `vhpiDiagTimeLoc` = 1[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user__ext_8h.html#_CPPv4N9vhpiDiagT15vhpiDiagTimeLocE "Permalink to this definition") _enumerator_ `vhpiDiagTimeLocCPUMem` = 2[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user__ext_8h.html#_CPPv4N9vhpiDiagT21vhpiDiagTimeLocCPUMemE "Permalink to this definition") --- # File verilator.cpp — cocotb 1.4.0 documentation * [](https://docs.cocotb.org/en/v1.4.0/index.html) » * [C Code Library Reference](https://docs.cocotb.org/en/v1.4.0/library_reference_c.html) » * [File list](https://docs.cocotb.org/en/v1.4.0/generated/filelist.html) » * File verilator.cpp * [Edit on GitHub](https://github.com/cocotb/cocotb/blob/v1.4.0/documentation/source/generated/file/verilator_8cpp.rst) * * * File verilator.cpp[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/verilator_8cpp.html#file-verilator-cpp "Permalink to this headline") ============================================================================================================================================ Functions double `sc_time_stamp`()[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/verilator_8cpp.html#_CPPv413sc_time_stampv "Permalink to this definition") void `vlog_startup_routines_bootstrap`(void) int `main`(int _argc_, char \*\*_argv_)[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/verilator_8cpp.html#_CPPv44mainiPPc "Permalink to this definition") Variables vluint64\_t `main_time` = 0[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/verilator_8cpp.html#_CPPv49main_time "Permalink to this definition") --- # File vpi_user_ext.h — cocotb 1.4.0 documentation * [](https://docs.cocotb.org/en/v1.4.0/index.html) » * [C Code Library Reference](https://docs.cocotb.org/en/v1.4.0/library_reference_c.html) » * [File list](https://docs.cocotb.org/en/v1.4.0/generated/filelist.html) » * File vpi\_user\_ext.h * [Edit on GitHub](https://github.com/cocotb/cocotb/blob/v1.4.0/documentation/source/generated/file/vpi__user__ext_8h.rst) * * * File vpi\_user\_ext.h[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vpi__user__ext_8h.html#file-vpi-user-ext-h "Permalink to this headline") =================================================================================================================================================== Defines `vpiRealNet` 526[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vpi__user__ext_8h.html#c.vpiRealNet "Permalink to this definition") `vpiInterconnectNet` 533[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vpi__user__ext_8h.html#c.vpiInterconnectNet "Permalink to this definition") `vpiInterconnectArray` 534[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vpi__user__ext_8h.html#c.vpiInterconnectArray "Permalink to this definition") `vpiDiagNone` 0 /\* prints nothing \*/[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vpi__user__ext_8h.html#c.vpiDiagNone "Permalink to this definition") `vpiDiagTimeLoc` 1 /\* prints simulation time and location \*/[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vpi__user__ext_8h.html#c.vpiDiagTimeLoc "Permalink to this definition") `vpiDiagTimeLocCPUMem` 2 /\* prints simulation time, location and statistics about CPU and memory usage \*/ [¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vpi__user__ext_8h.html#c.vpiDiagTimeLocCPUMem "Permalink to this definition") --- # File vhpi_user.h — cocotb 1.4.0 documentation * [](https://docs.cocotb.org/en/v1.4.0/index.html) » * [C Code Library Reference](https://docs.cocotb.org/en/v1.4.0/library_reference_c.html) » * [File list](https://docs.cocotb.org/en/v1.4.0/generated/filelist.html) » * File vhpi\_user.h * [Edit on GitHub](https://github.com/cocotb/cocotb/blob/v1.4.0/documentation/source/generated/file/vhpi__user_8h.rst) * * * File vhpi\_user.h[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#file-vhpi-user-h "Permalink to this headline") ======================================================================================================================================== Defines `PLI_DLLISPEC`[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#c.PLI_DLLISPEC "Permalink to this definition") `PLI_DLLESPEC`[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#c.PLI_DLLESPEC "Permalink to this definition") `PLI_EXTERN`[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#c.PLI_EXTERN "Permalink to this definition") `PLI_VEXTERN` extern[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#c.PLI_VEXTERN "Permalink to this definition") `PLI_PROTOTYPES`[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#c.PLI_PROTOTYPES "Permalink to this definition") `XXTERN` PLI\_EXTERN PLI\_DLLISPEC[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#c.XXTERN "Permalink to this definition") `EETERN` PLI\_EXTERN PLI\_DLLESPEC[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#c.EETERN "Permalink to this definition") `VHPI_TYPES`[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#c.VHPI_TYPES "Permalink to this definition") `PLI_TYPES`[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#c.PLI_TYPES "Permalink to this definition") `vhpiUndefined` -1[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#c.vhpiUndefined "Permalink to this definition") `vhpiU` 0 /\* uninitialized \*/[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#c.vhpiU "Permalink to this definition") `vhpiX` 1 /\* unknown \*/[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#c.vhpiX "Permalink to this definition") `vhpi0` 2 /\* forcing 0 \*/[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#c.vhpi0 "Permalink to this definition") `vhpi1` 3 /\* forcing 1 \*/[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#c.vhpi1 "Permalink to this definition") `vhpiZ` 4 /\* high impedance \*/[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#c.vhpiZ "Permalink to this definition") `vhpiW` 5 /\* weak unknown \*/[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#c.vhpiW "Permalink to this definition") `vhpiL` 6 /\* weak 0 \*/[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#c.vhpiL "Permalink to this definition") `vhpiH` 7 /\* weak 1 \*/[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#c.vhpiH "Permalink to this definition") `vhpiDontCare` 8 /\* don't care \*/[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#c.vhpiDontCare "Permalink to this definition") `vhpibit0` 0 /\* bit 0 \*/[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#c.vhpibit0 "Permalink to this definition") `vhpibit1` 1 /\* bit 1 \*/[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#c.vhpibit1 "Permalink to this definition") `vhpiFalse` 0 /\* false \*/[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#c.vhpiFalse "Permalink to this definition") `vhpiTrue` 1 /\* true \*/[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#c.vhpiTrue "Permalink to this definition") `vhpiCbValueChange` 1001[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#c.vhpiCbValueChange "Permalink to this definition") `vhpiCbForce` 1002[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#c.vhpiCbForce "Permalink to this definition") `vhpiCbRelease` 1003[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#c.vhpiCbRelease "Permalink to this definition") `vhpiCbTransaction` 1004 /\* optional callback reason \*/[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#c.vhpiCbTransaction "Permalink to this definition") `vhpiCbStmt` 1005[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#c.vhpiCbStmt "Permalink to this definition") `vhpiCbResume` 1006[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#c.vhpiCbResume "Permalink to this definition") `vhpiCbSuspend` 1007[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#c.vhpiCbSuspend "Permalink to this definition") `vhpiCbStartOfSubpCall` 1008[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#c.vhpiCbStartOfSubpCall "Permalink to this definition") `vhpiCbEndOfSubpCall` 1009[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#c.vhpiCbEndOfSubpCall "Permalink to this definition") `vhpiCbAfterDelay` 1010[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#c.vhpiCbAfterDelay "Permalink to this definition") `vhpiCbRepAfterDelay` 1011[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#c.vhpiCbRepAfterDelay "Permalink to this definition") `vhpiCbNextTimeStep` 1012[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#c.vhpiCbNextTimeStep "Permalink to this definition") `vhpiCbRepNextTimeStep` 1013[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#c.vhpiCbRepNextTimeStep "Permalink to this definition") `vhpiCbStartOfNextCycle` 1014[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#c.vhpiCbStartOfNextCycle "Permalink to this definition") `vhpiCbRepStartOfNextCycle` 1015[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#c.vhpiCbRepStartOfNextCycle "Permalink to this definition") `vhpiCbStartOfProcesses` 1016[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#c.vhpiCbStartOfProcesses "Permalink to this definition") `vhpiCbRepStartOfProcesses` 1017[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#c.vhpiCbRepStartOfProcesses "Permalink to this definition") `vhpiCbEndOfProcesses` 1018[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#c.vhpiCbEndOfProcesses "Permalink to this definition") `vhpiCbRepEndOfProcesses` 1019[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#c.vhpiCbRepEndOfProcesses "Permalink to this definition") `vhpiCbLastKnownDeltaCycle` 1020[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#c.vhpiCbLastKnownDeltaCycle "Permalink to this definition") `vhpiCbRepLastKnownDeltaCycle` 1021[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#c.vhpiCbRepLastKnownDeltaCycle "Permalink to this definition") `vhpiCbStartOfPostponed` 1022[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#c.vhpiCbStartOfPostponed "Permalink to this definition") `vhpiCbRepStartOfPostponed` 1023[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#c.vhpiCbRepStartOfPostponed "Permalink to this definition") `vhpiCbEndOfTimeStep` 1024[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#c.vhpiCbEndOfTimeStep "Permalink to this definition") `vhpiCbRepEndOfTimeStep` 1025[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#c.vhpiCbRepEndOfTimeStep "Permalink to this definition") `vhpiCbStartOfTool` 1026[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#c.vhpiCbStartOfTool "Permalink to this definition") `vhpiCbEndOfTool` 1027[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#c.vhpiCbEndOfTool "Permalink to this definition") `vhpiCbStartOfAnalysis` 1028[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#c.vhpiCbStartOfAnalysis "Permalink to this definition") `vhpiCbEndOfAnalysis` 1029[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#c.vhpiCbEndOfAnalysis "Permalink to this definition") `vhpiCbStartOfElaboration` 1030[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#c.vhpiCbStartOfElaboration "Permalink to this definition") `vhpiCbEndOfElaboration` 1031[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#c.vhpiCbEndOfElaboration "Permalink to this definition") `vhpiCbStartOfInitialization` 1032[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#c.vhpiCbStartOfInitialization "Permalink to this definition") `vhpiCbEndOfInitialization` 1033[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#c.vhpiCbEndOfInitialization "Permalink to this definition") `vhpiCbStartOfSimulation` 1034[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#c.vhpiCbStartOfSimulation "Permalink to this definition") `vhpiCbEndOfSimulation` 1035[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#c.vhpiCbEndOfSimulation "Permalink to this definition") `vhpiCbQuiescense` 1036 /\* repetitive \*/[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#c.vhpiCbQuiescense "Permalink to this definition") `vhpiCbPLIError` 1037 /\* repetitive \*/[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#c.vhpiCbPLIError "Permalink to this definition") `vhpiCbStartOfSave` 1038[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#c.vhpiCbStartOfSave "Permalink to this definition") `vhpiCbEndOfSave` 1039[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#c.vhpiCbEndOfSave "Permalink to this definition") `vhpiCbStartOfRestart` 1040[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#c.vhpiCbStartOfRestart "Permalink to this definition") `vhpiCbEndOfRestart` 1041[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#c.vhpiCbEndOfRestart "Permalink to this definition") `vhpiCbStartOfReset` 1042[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#c.vhpiCbStartOfReset "Permalink to this definition") `vhpiCbEndOfReset` 1043[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#c.vhpiCbEndOfReset "Permalink to this definition") `vhpiCbEnterInteractive` 1044 /\* repetitive \*/[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#c.vhpiCbEnterInteractive "Permalink to this definition") `vhpiCbExitInteractive` 1045 /\* repetitive \*/[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#c.vhpiCbExitInteractive "Permalink to this definition") `vhpiCbSigInterrupt` 1046 /\* repetitive \*/[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#c.vhpiCbSigInterrupt "Permalink to this definition") `vhpiCbTimeOut` 1047 /\* non repetitive \*/[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#c.vhpiCbTimeOut "Permalink to this definition") `vhpiCbRepTimeOut` 1048 /\* repetitive \*/[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#c.vhpiCbRepTimeOut "Permalink to this definition") `vhpiCbSensitivity` 1049 /\* repetitive \*/[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#c.vhpiCbSensitivity "Permalink to this definition") `vhpiReturnCb` 0x00000001[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#c.vhpiReturnCb "Permalink to this definition") `vhpiDisableCb` 0x00000010[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#c.vhpiDisableCb "Permalink to this definition") `VHPI_SENS_ZERO`(_sens_) vhpi\_sens\_zero(sens)[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#c.VHPI_SENS_ZERO "Permalink to this definition") `VHPI_SENS_SET`(_obj_, _sens_) vhpi\_sens\_set(obj, sens)[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#c.VHPI_SENS_SET "Permalink to this definition") `VHPI_SENS_CLR`(_obj_, _sens_) vhpi\_sens\_clr(obj, sens)[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#c.VHPI_SENS_CLR "Permalink to this definition") `VHPI_SENS_ISSET`(_obj_, _sens_) vhpi\_sens\_isset(obj, sens)[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#c.VHPI_SENS_ISSET "Permalink to this definition") `VHPI_SENS_FIRST`(_sens_) vhpi\_sens\_first(sens)[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#c.VHPI_SENS_FIRST "Permalink to this definition") `vhpiNoActivity` -1[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#c.vhpiNoActivity "Permalink to this definition") Typedefs _typedef_ uint32\_t \*`vhpiHandleT`[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#_CPPv411vhpiHandleT "Permalink to this definition") _typedef_ uint32\_t `vhpiEnumT`[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#_CPPv49vhpiEnumT "Permalink to this definition") _typedef_ uint8\_t `vhpiSmallEnumT`[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#_CPPv414vhpiSmallEnumT "Permalink to this definition") _typedef_ uint32\_t `vhpiIntT`[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#_CPPv48vhpiIntT "Permalink to this definition") _typedef_ uint64\_t `vhpiLongIntT`[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#_CPPv412vhpiLongIntT "Permalink to this definition") _typedef_ char `vhpiCharT`[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#_CPPv49vhpiCharT "Permalink to this definition") _typedef_ double `vhpiRealT`[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#_CPPv49vhpiRealT "Permalink to this definition") _typedef_ uint32\_t `vhpiSmallPhysT`[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#_CPPv414vhpiSmallPhysT "Permalink to this definition") _typedef_ _struct_ [vhpiPhysS](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#_CPPv49vhpiPhysS "vhpiPhysS") `vhpiPhysT`[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#_CPPv49vhpiPhysT "Permalink to this definition") _typedef_ int `PLI_INT32`[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#_CPPv49PLI_INT32 "Permalink to this definition") _typedef_ unsigned int `PLI_UINT32`[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#_CPPv410PLI_UINT32 "Permalink to this definition") _typedef_ short `PLI_INT16`[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#_CPPv49PLI_INT16 "Permalink to this definition") _typedef_ unsigned short `PLI_UINT16`[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#_CPPv410PLI_UINT16 "Permalink to this definition") _typedef_ char `PLI_BYTE8`[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#_CPPv49PLI_BYTE8 "Permalink to this definition") _typedef_ unsigned char `PLI_UBYTE8`[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#_CPPv410PLI_UBYTE8 "Permalink to this definition") _typedef_ void `PLI_VOID`[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#_CPPv48PLI_VOID "Permalink to this definition") _typedef_ _struct_ [vhpiTimeS](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#_CPPv49vhpiTimeS "vhpiTimeS") `vhpiTimeT`[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#_CPPv49vhpiTimeT "Permalink to this definition") _typedef_ _struct_ [vhpiValueS](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#_CPPv410vhpiValueS "vhpiValueS") `vhpiValueT`[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#_CPPv410vhpiValueT "Permalink to this definition") _typedef_ _struct_ [vhpiErrorInfoS](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#_CPPv414vhpiErrorInfoS "vhpiErrorInfoS") `vhpiErrorInfoT`[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#_CPPv414vhpiErrorInfoT "Permalink to this definition") _typedef_ _struct_ [vhpiCbDataS](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#_CPPv411vhpiCbDataS "vhpiCbDataS") `vhpiCbDataT`[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#_CPPv411vhpiCbDataT "Permalink to this definition") _typedef_ int (\*`vhpiUserFctT`)(void)[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#_CPPv412vhpiUserFctT "Permalink to this definition") _typedef_ _struct_ [vhpiForeignDataS](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#_CPPv416vhpiForeignDataS "vhpiForeignDataS") `vhpiForeignDataT`[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#_CPPv416vhpiForeignDataT "Permalink to this definition") _typedef_ void (\*`vhpiBootstrapFctT`)(void)[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#_CPPv417vhpiBootstrapFctT "Permalink to this definition") Enums _enum_ `vhpiFormatT`[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#_CPPv411vhpiFormatT "Permalink to this definition") _Values:_ _enumerator_ `vhpiBinStrVal` = 1[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#_CPPv4N11vhpiFormatT13vhpiBinStrValE "Permalink to this definition") _enumerator_ `vhpiOctStrVal` = 2[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#_CPPv4N11vhpiFormatT13vhpiOctStrValE "Permalink to this definition") _enumerator_ `vhpiDecStrVal` = 3[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#_CPPv4N11vhpiFormatT13vhpiDecStrValE "Permalink to this definition") _enumerator_ `vhpiHexStrVal` = 4[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#_CPPv4N11vhpiFormatT13vhpiHexStrValE "Permalink to this definition") _enumerator_ `vhpiEnumVal` = 5[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#_CPPv4N11vhpiFormatT11vhpiEnumValE "Permalink to this definition") _enumerator_ `vhpiIntVal` = 6[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#_CPPv4N11vhpiFormatT10vhpiIntValE "Permalink to this definition") _enumerator_ `vhpiLogicVal` = 7[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#_CPPv4N11vhpiFormatT12vhpiLogicValE "Permalink to this definition") _enumerator_ `vhpiRealVal` = 8[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#_CPPv4N11vhpiFormatT11vhpiRealValE "Permalink to this definition") _enumerator_ `vhpiStrVal` = 9[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#_CPPv4N11vhpiFormatT10vhpiStrValE "Permalink to this definition") _enumerator_ `vhpiCharVal` = 10[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#_CPPv4N11vhpiFormatT11vhpiCharValE "Permalink to this definition") _enumerator_ `vhpiTimeVal` = 11[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#_CPPv4N11vhpiFormatT11vhpiTimeValE "Permalink to this definition") _enumerator_ `vhpiPhysVal` = 12[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#_CPPv4N11vhpiFormatT11vhpiPhysValE "Permalink to this definition") _enumerator_ `vhpiObjTypeVal` = 13[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#_CPPv4N11vhpiFormatT14vhpiObjTypeValE "Permalink to this definition") _enumerator_ `vhpiPtrVal` = 14[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#_CPPv4N11vhpiFormatT10vhpiPtrValE "Permalink to this definition") _enumerator_ `vhpiEnumVecVal` = 15[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#_CPPv4N11vhpiFormatT14vhpiEnumVecValE "Permalink to this definition") _enumerator_ `vhpiIntVecVal` = 16[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#_CPPv4N11vhpiFormatT13vhpiIntVecValE "Permalink to this definition") _enumerator_ `vhpiLogicVecVal` = 17[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#_CPPv4N11vhpiFormatT15vhpiLogicVecValE "Permalink to this definition") _enumerator_ `vhpiRealVecVal` = 18[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#_CPPv4N11vhpiFormatT14vhpiRealVecValE "Permalink to this definition") _enumerator_ `vhpiTimeVecVal` = 19[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#_CPPv4N11vhpiFormatT14vhpiTimeVecValE "Permalink to this definition") _enumerator_ `vhpiPhysVecVal` = 20[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#_CPPv4N11vhpiFormatT14vhpiPhysVecValE "Permalink to this definition") _enumerator_ `vhpiPtrVecVal` = 21[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#_CPPv4N11vhpiFormatT13vhpiPtrVecValE "Permalink to this definition") _enumerator_ `vhpiRawDataVal` = 22[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#_CPPv4N11vhpiFormatT14vhpiRawDataValE "Permalink to this definition") _enumerator_ `vhpiSmallEnumVal` = 23[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#_CPPv4N11vhpiFormatT16vhpiSmallEnumValE "Permalink to this definition") _enumerator_ `vhpiSmallEnumVecVal` = 24[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#_CPPv4N11vhpiFormatT19vhpiSmallEnumVecValE "Permalink to this definition") _enumerator_ `vhpiLongIntVal` = 25[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#_CPPv4N11vhpiFormatT14vhpiLongIntValE "Permalink to this definition") _enumerator_ `vhpiLongIntVecVal` = 26[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#_CPPv4N11vhpiFormatT17vhpiLongIntVecValE "Permalink to this definition") _enumerator_ `vhpiSmallPhysVal` = 27[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#_CPPv4N11vhpiFormatT16vhpiSmallPhysValE "Permalink to this definition") _enumerator_ `vhpiSmallPhysVecVal` = 28[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#_CPPv4N11vhpiFormatT19vhpiSmallPhysVecValE "Permalink to this definition") _enum_ `vhpiClassKindT`[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#_CPPv414vhpiClassKindT "Permalink to this definition") _Values:_ _enumerator_ `vhpiAccessTypeDeclK` = 1001[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#_CPPv4N14vhpiClassKindT19vhpiAccessTypeDeclKE "Permalink to this definition") _enumerator_ `vhpiAggregateK` = 1002[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#_CPPv4N14vhpiClassKindT14vhpiAggregateKE "Permalink to this definition") _enumerator_ `vhpiAliasDeclK` = 1003[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#_CPPv4N14vhpiClassKindT14vhpiAliasDeclKE "Permalink to this definition") _enumerator_ `vhpiAllK` = 1004[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#_CPPv4N14vhpiClassKindT8vhpiAllKE "Permalink to this definition") _enumerator_ `vhpiAllocatorK` = 1005[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#_CPPv4N14vhpiClassKindT14vhpiAllocatorKE "Permalink to this definition") _enumerator_ `vhpiAnyCollectionK` = 1006[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#_CPPv4N14vhpiClassKindT18vhpiAnyCollectionKE "Permalink to this definition") _enumerator_ `vhpiArchBodyK` = 1007[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#_CPPv4N14vhpiClassKindT13vhpiArchBodyKE "Permalink to this definition") _enumerator_ `vhpiArgvK` = 1008[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#_CPPv4N14vhpiClassKindT9vhpiArgvKE "Permalink to this definition") _enumerator_ `vhpiArrayTypeDeclK` = 1009[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#_CPPv4N14vhpiClassKindT18vhpiArrayTypeDeclKE "Permalink to this definition") _enumerator_ `vhpiAssertStmtK` = 1010[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#_CPPv4N14vhpiClassKindT15vhpiAssertStmtKE "Permalink to this definition") _enumerator_ `vhpiAssocElemK` = 1011[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#_CPPv4N14vhpiClassKindT14vhpiAssocElemKE "Permalink to this definition") _enumerator_ `vhpiAttrDeclK` = 1012[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#_CPPv4N14vhpiClassKindT13vhpiAttrDeclKE "Permalink to this definition") _enumerator_ `vhpiAttrSpecK` = 1013[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#_CPPv4N14vhpiClassKindT13vhpiAttrSpecKE "Permalink to this definition") _enumerator_ `vhpiBinaryExprK` = 1014[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#_CPPv4N14vhpiClassKindT15vhpiBinaryExprKE "Permalink to this definition") _enumerator_ `vhpiBitStringLiteralK` = 1015[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#_CPPv4N14vhpiClassKindT21vhpiBitStringLiteralKE "Permalink to this definition") _enumerator_ `vhpiBlockConfigK` = 1016[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#_CPPv4N14vhpiClassKindT16vhpiBlockConfigKE "Permalink to this definition") _enumerator_ `vhpiBlockStmtK` = 1017[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#_CPPv4N14vhpiClassKindT14vhpiBlockStmtKE "Permalink to this definition") _enumerator_ `vhpiBranchK` = 1018[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#_CPPv4N14vhpiClassKindT11vhpiBranchKE "Permalink to this definition") _enumerator_ `vhpiCallbackK` = 1019[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#_CPPv4N14vhpiClassKindT13vhpiCallbackKE "Permalink to this definition") _enumerator_ `vhpiCaseStmtK` = 1020[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#_CPPv4N14vhpiClassKindT13vhpiCaseStmtKE "Permalink to this definition") _enumerator_ `vhpiCharLiteralK` = 1021[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#_CPPv4N14vhpiClassKindT16vhpiCharLiteralKE "Permalink to this definition") _enumerator_ `vhpiCompConfigK` = 1022[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#_CPPv4N14vhpiClassKindT15vhpiCompConfigKE "Permalink to this definition") _enumerator_ `vhpiCompDeclK` = 1023[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#_CPPv4N14vhpiClassKindT13vhpiCompDeclKE "Permalink to this definition") _enumerator_ `vhpiCompInstStmtK` = 1024[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#_CPPv4N14vhpiClassKindT17vhpiCompInstStmtKE "Permalink to this definition") _enumerator_ `vhpiCondSigAssignStmtK` = 1025[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#_CPPv4N14vhpiClassKindT22vhpiCondSigAssignStmtKE "Permalink to this definition") _enumerator_ `vhpiCondWaveformK` = 1026[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#_CPPv4N14vhpiClassKindT17vhpiCondWaveformKE "Permalink to this definition") _enumerator_ `vhpiConfigDeclK` = 1027[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#_CPPv4N14vhpiClassKindT15vhpiConfigDeclKE "Permalink to this definition") _enumerator_ `vhpiConstDeclK` = 1028[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#_CPPv4N14vhpiClassKindT14vhpiConstDeclKE "Permalink to this definition") _enumerator_ `vhpiConstParamDeclK` = 1029[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#_CPPv4N14vhpiClassKindT19vhpiConstParamDeclKE "Permalink to this definition") _enumerator_ `vhpiConvFuncK` = 1030[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#_CPPv4N14vhpiClassKindT13vhpiConvFuncKE "Permalink to this definition") _enumerator_ `vhpiDerefObjK` = 1031[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#_CPPv4N14vhpiClassKindT13vhpiDerefObjKE "Permalink to this definition") _enumerator_ `vhpiDisconnectSpecK` = 1032[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#_CPPv4N14vhpiClassKindT19vhpiDisconnectSpecKE "Permalink to this definition") _enumerator_ `vhpiDriverK` = 1033[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#_CPPv4N14vhpiClassKindT11vhpiDriverKE "Permalink to this definition") _enumerator_ `vhpiDriverCollectionK` = 1034[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#_CPPv4N14vhpiClassKindT21vhpiDriverCollectionKE "Permalink to this definition") _enumerator_ `vhpiElemAssocK` = 1035[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#_CPPv4N14vhpiClassKindT14vhpiElemAssocKE "Permalink to this definition") _enumerator_ `vhpiElemDeclK` = 1036[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#_CPPv4N14vhpiClassKindT13vhpiElemDeclKE "Permalink to this definition") _enumerator_ `vhpiEntityClassEntryK` = 1037[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#_CPPv4N14vhpiClassKindT21vhpiEntityClassEntryKE "Permalink to this definition") _enumerator_ `vhpiEntityDeclK` = 1038[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#_CPPv4N14vhpiClassKindT15vhpiEntityDeclKE "Permalink to this definition") _enumerator_ `vhpiEnumLiteralK` = 1039[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#_CPPv4N14vhpiClassKindT16vhpiEnumLiteralKE "Permalink to this definition") _enumerator_ `vhpiEnumRangeK` = 1040[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#_CPPv4N14vhpiClassKindT14vhpiEnumRangeKE "Permalink to this definition") _enumerator_ `vhpiEnumTypeDeclK` = 1041[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#_CPPv4N14vhpiClassKindT17vhpiEnumTypeDeclKE "Permalink to this definition") _enumerator_ `vhpiExitStmtK` = 1042[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#_CPPv4N14vhpiClassKindT13vhpiExitStmtKE "Permalink to this definition") _enumerator_ `vhpiFileDeclK` = 1043[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#_CPPv4N14vhpiClassKindT13vhpiFileDeclKE "Permalink to this definition") _enumerator_ `vhpiFileParamDeclK` = 1044[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#_CPPv4N14vhpiClassKindT18vhpiFileParamDeclKE "Permalink to this definition") _enumerator_ `vhpiFileTypeDeclK` = 1045[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#_CPPv4N14vhpiClassKindT17vhpiFileTypeDeclKE "Permalink to this definition") _enumerator_ `vhpiFloatRangeK` = 1046[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#_CPPv4N14vhpiClassKindT15vhpiFloatRangeKE "Permalink to this definition") _enumerator_ `vhpiFloatTypeDeclK` = 1047[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#_CPPv4N14vhpiClassKindT18vhpiFloatTypeDeclKE "Permalink to this definition") _enumerator_ `vhpiForGenerateK` = 1048[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#_CPPv4N14vhpiClassKindT16vhpiForGenerateKE "Permalink to this definition") _enumerator_ `vhpiForLoopK` = 1049[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#_CPPv4N14vhpiClassKindT12vhpiForLoopKE "Permalink to this definition") _enumerator_ `vhpiForeignfK` = 1050[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#_CPPv4N14vhpiClassKindT13vhpiForeignfKE "Permalink to this definition") _enumerator_ `vhpiFuncCallK` = 1051[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#_CPPv4N14vhpiClassKindT13vhpiFuncCallKE "Permalink to this definition") _enumerator_ `vhpiFuncDeclK` = 1052[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#_CPPv4N14vhpiClassKindT13vhpiFuncDeclKE "Permalink to this definition") _enumerator_ `vhpiGenericDeclK` = 1053[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#_CPPv4N14vhpiClassKindT16vhpiGenericDeclKE "Permalink to this definition") _enumerator_ `vhpiGroupDeclK` = 1054[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#_CPPv4N14vhpiClassKindT14vhpiGroupDeclKE "Permalink to this definition") _enumerator_ `vhpiGroupTempDeclK` = 1055[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#_CPPv4N14vhpiClassKindT18vhpiGroupTempDeclKE "Permalink to this definition") _enumerator_ `vhpiIfGenerateK` = 1056[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#_CPPv4N14vhpiClassKindT15vhpiIfGenerateKE "Permalink to this definition") _enumerator_ `vhpiIfStmtK` = 1057[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#_CPPv4N14vhpiClassKindT11vhpiIfStmtKE "Permalink to this definition") _enumerator_ `vhpiInPortK` = 1058[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#_CPPv4N14vhpiClassKindT11vhpiInPortKE "Permalink to this definition") _enumerator_ `vhpiIndexedNameK` = 1059[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#_CPPv4N14vhpiClassKindT16vhpiIndexedNameKE "Permalink to this definition") _enumerator_ `vhpiIntLiteralK` = 1060[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#_CPPv4N14vhpiClassKindT15vhpiIntLiteralKE "Permalink to this definition") _enumerator_ `vhpiIntRangeK` = 1061[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#_CPPv4N14vhpiClassKindT13vhpiIntRangeKE "Permalink to this definition") _enumerator_ `vhpiIntTypeDeclK` = 1062[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#_CPPv4N14vhpiClassKindT16vhpiIntTypeDeclKE "Permalink to this definition") _enumerator_ `vhpiIteratorK` = 1063[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#_CPPv4N14vhpiClassKindT13vhpiIteratorKE "Permalink to this definition") _enumerator_ `vhpiLibraryDeclK` = 1064[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#_CPPv4N14vhpiClassKindT16vhpiLibraryDeclKE "Permalink to this definition") _enumerator_ `vhpiLoopStmtK` = 1065[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#_CPPv4N14vhpiClassKindT13vhpiLoopStmtKE "Permalink to this definition") _enumerator_ `vhpiNextStmtK` = 1066[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#_CPPv4N14vhpiClassKindT13vhpiNextStmtKE "Permalink to this definition") _enumerator_ `vhpiNullLiteralK` = 1067[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#_CPPv4N14vhpiClassKindT16vhpiNullLiteralKE "Permalink to this definition") _enumerator_ `vhpiNullStmtK` = 1068[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#_CPPv4N14vhpiClassKindT13vhpiNullStmtKE "Permalink to this definition") _enumerator_ `vhpiOperatorK` = 1069[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#_CPPv4N14vhpiClassKindT13vhpiOperatorKE "Permalink to this definition") _enumerator_ `vhpiOthersK` = 1070[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#_CPPv4N14vhpiClassKindT11vhpiOthersKE "Permalink to this definition") _enumerator_ `vhpiOutPortK` = 1071[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#_CPPv4N14vhpiClassKindT12vhpiOutPortKE "Permalink to this definition") _enumerator_ `vhpiPackBodyK` = 1072[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#_CPPv4N14vhpiClassKindT13vhpiPackBodyKE "Permalink to this definition") _enumerator_ `vhpiPackDeclK` = 1073[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#_CPPv4N14vhpiClassKindT13vhpiPackDeclKE "Permalink to this definition") _enumerator_ `vhpiPackInstK` = 1074[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#_CPPv4N14vhpiClassKindT13vhpiPackInstKE "Permalink to this definition") _enumerator_ `vhpiParamAttrNameK` = 1075[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#_CPPv4N14vhpiClassKindT18vhpiParamAttrNameKE "Permalink to this definition") _enumerator_ `vhpiPhysLiteralK` = 1076[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#_CPPv4N14vhpiClassKindT16vhpiPhysLiteralKE "Permalink to this definition") _enumerator_ `vhpiPhysRangeK` = 1077[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#_CPPv4N14vhpiClassKindT14vhpiPhysRangeKE "Permalink to this definition") _enumerator_ `vhpiPhysTypeDeclK` = 1078[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#_CPPv4N14vhpiClassKindT17vhpiPhysTypeDeclKE "Permalink to this definition") _enumerator_ `vhpiPortDeclK` = 1079[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#_CPPv4N14vhpiClassKindT13vhpiPortDeclKE "Permalink to this definition") _enumerator_ `vhpiProcCallStmtK` = 1080[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#_CPPv4N14vhpiClassKindT17vhpiProcCallStmtKE "Permalink to this definition") _enumerator_ `vhpiProcDeclK` = 1081[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#_CPPv4N14vhpiClassKindT13vhpiProcDeclKE "Permalink to this definition") _enumerator_ `vhpiProcessStmtK` = 1082[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#_CPPv4N14vhpiClassKindT16vhpiProcessStmtKE "Permalink to this definition") _enumerator_ `vhpiProtectedTypeK` = 1083[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#_CPPv4N14vhpiClassKindT18vhpiProtectedTypeKE "Permalink to this definition") _enumerator_ `vhpiProtectedTypeBodyK` = 1084[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#_CPPv4N14vhpiClassKindT22vhpiProtectedTypeBodyKE "Permalink to this definition") _enumerator_ `vhpiProtectedTypeDeclK` = 1085[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#_CPPv4N14vhpiClassKindT22vhpiProtectedTypeDeclKE "Permalink to this definition") _enumerator_ `vhpiRealLiteralK` = 1086[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#_CPPv4N14vhpiClassKindT16vhpiRealLiteralKE "Permalink to this definition") _enumerator_ `vhpiRecordTypeDeclK` = 1087[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#_CPPv4N14vhpiClassKindT19vhpiRecordTypeDeclKE "Permalink to this definition") _enumerator_ `vhpiReportStmtK` = 1088[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#_CPPv4N14vhpiClassKindT15vhpiReportStmtKE "Permalink to this definition") _enumerator_ `vhpiReturnStmtK` = 1089[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#_CPPv4N14vhpiClassKindT15vhpiReturnStmtKE "Permalink to this definition") _enumerator_ `vhpiRootInstK` = 1090[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#_CPPv4N14vhpiClassKindT13vhpiRootInstKE "Permalink to this definition") _enumerator_ `vhpiSelectSigAssignStmtK` = 1091[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#_CPPv4N14vhpiClassKindT24vhpiSelectSigAssignStmtKE "Permalink to this definition") _enumerator_ `vhpiSelectWaveformK` = 1092[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#_CPPv4N14vhpiClassKindT19vhpiSelectWaveformKE "Permalink to this definition") _enumerator_ `vhpiSelectedNameK` = 1093[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#_CPPv4N14vhpiClassKindT17vhpiSelectedNameKE "Permalink to this definition") _enumerator_ `vhpiSigDeclK` = 1094[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#_CPPv4N14vhpiClassKindT12vhpiSigDeclKE "Permalink to this definition") _enumerator_ `vhpiSigParamDeclK` = 1095[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#_CPPv4N14vhpiClassKindT17vhpiSigParamDeclKE "Permalink to this definition") _enumerator_ `vhpiSimpAttrNameK` = 1096[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#_CPPv4N14vhpiClassKindT17vhpiSimpAttrNameKE "Permalink to this definition") _enumerator_ `vhpiSimpleSigAssignStmtK` = 1097[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#_CPPv4N14vhpiClassKindT24vhpiSimpleSigAssignStmtKE "Permalink to this definition") _enumerator_ `vhpiSliceNameK` = 1098[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#_CPPv4N14vhpiClassKindT14vhpiSliceNameKE "Permalink to this definition") _enumerator_ `vhpiStringLiteralK` = 1099[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#_CPPv4N14vhpiClassKindT18vhpiStringLiteralKE "Permalink to this definition") _enumerator_ `vhpiSubpBodyK` = 1100[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#_CPPv4N14vhpiClassKindT13vhpiSubpBodyKE "Permalink to this definition") _enumerator_ `vhpiSubtypeDeclK` = 1101[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#_CPPv4N14vhpiClassKindT16vhpiSubtypeDeclKE "Permalink to this definition") _enumerator_ `vhpiSubtypeIndicK` = 1102[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#_CPPv4N14vhpiClassKindT17vhpiSubtypeIndicKE "Permalink to this definition") _enumerator_ `vhpiToolK` = 1103[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#_CPPv4N14vhpiClassKindT9vhpiToolKE "Permalink to this definition") _enumerator_ `vhpiTransactionK` = 1104[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#_CPPv4N14vhpiClassKindT16vhpiTransactionKE "Permalink to this definition") _enumerator_ `vhpiTypeConvK` = 1105[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#_CPPv4N14vhpiClassKindT13vhpiTypeConvKE "Permalink to this definition") _enumerator_ `vhpiUnaryExprK` = 1106[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#_CPPv4N14vhpiClassKindT14vhpiUnaryExprKE "Permalink to this definition") _enumerator_ `vhpiUnitDeclK` = 1107[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#_CPPv4N14vhpiClassKindT13vhpiUnitDeclKE "Permalink to this definition") _enumerator_ `vhpiUserAttrNameK` = 1108[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#_CPPv4N14vhpiClassKindT17vhpiUserAttrNameKE "Permalink to this definition") _enumerator_ `vhpiVarAssignStmtK` = 1109[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#_CPPv4N14vhpiClassKindT18vhpiVarAssignStmtKE "Permalink to this definition") _enumerator_ `vhpiVarDeclK` = 1110[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#_CPPv4N14vhpiClassKindT12vhpiVarDeclKE "Permalink to this definition") _enumerator_ `vhpiVarParamDeclK` = 1111[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#_CPPv4N14vhpiClassKindT17vhpiVarParamDeclKE "Permalink to this definition") _enumerator_ `vhpiWaitStmtK` = 1112[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#_CPPv4N14vhpiClassKindT13vhpiWaitStmtKE "Permalink to this definition") _enumerator_ `vhpiWaveformElemK` = 1113[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#_CPPv4N14vhpiClassKindT17vhpiWaveformElemKE "Permalink to this definition") _enumerator_ `vhpiWhileLoopK` = 1114[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#_CPPv4N14vhpiClassKindT14vhpiWhileLoopKE "Permalink to this definition") _enumerator_ `vhpiQualifiedExprK` = 1115[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#_CPPv4N14vhpiClassKindT18vhpiQualifiedExprKE "Permalink to this definition") _enumerator_ `vhpiUseClauseK` = 1116[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#_CPPv4N14vhpiClassKindT14vhpiUseClauseKE "Permalink to this definition") _enumerator_ `vhpiVerilog` = 1117[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#_CPPv4N14vhpiClassKindT11vhpiVerilogE "Permalink to this definition") _enumerator_ `vhpiEdifUnit` = 1118[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#_CPPv4N14vhpiClassKindT12vhpiEdifUnitE "Permalink to this definition") _enumerator_ `vhpiCollectionK` = 1119[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#_CPPv4N14vhpiClassKindT15vhpiCollectionKE "Permalink to this definition") _enumerator_ `vhpiVHDL` = 1120[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#_CPPv4N14vhpiClassKindT8vhpiVHDLE "Permalink to this definition") _enumerator_ `vhpiSystemC` = 1121[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#_CPPv4N14vhpiClassKindT11vhpiSystemCE "Permalink to this definition") _enum_ `vhpiOneToOneT`[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#_CPPv413vhpiOneToOneT "Permalink to this definition") _Values:_ _enumerator_ `vhpiAbstractLiteral` = 1301[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#_CPPv4N13vhpiOneToOneT19vhpiAbstractLiteralE "Permalink to this definition") _enumerator_ `vhpiActual` = 1302[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#_CPPv4N13vhpiOneToOneT10vhpiActualE "Permalink to this definition") _enumerator_ `vhpiAll` = 1303[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#_CPPv4N13vhpiOneToOneT7vhpiAllE "Permalink to this definition") _enumerator_ `vhpiAttrDecl` = 1304[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#_CPPv4N13vhpiOneToOneT12vhpiAttrDeclE "Permalink to this definition") _enumerator_ `vhpiAttrSpec` = 1305[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#_CPPv4N13vhpiOneToOneT12vhpiAttrSpecE "Permalink to this definition") _enumerator_ `vhpiBaseType` = 1306[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#_CPPv4N13vhpiOneToOneT12vhpiBaseTypeE "Permalink to this definition") _enumerator_ `vhpiBaseUnit` = 1307[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#_CPPv4N13vhpiOneToOneT12vhpiBaseUnitE "Permalink to this definition") _enumerator_ `vhpiBasicSignal` = 1308[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#_CPPv4N13vhpiOneToOneT15vhpiBasicSignalE "Permalink to this definition") _enumerator_ `vhpiBlockConfig` = 1309[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#_CPPv4N13vhpiOneToOneT15vhpiBlockConfigE "Permalink to this definition") _enumerator_ `vhpiCaseExpr` = 1310[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#_CPPv4N13vhpiOneToOneT12vhpiCaseExprE "Permalink to this definition") _enumerator_ `vhpiCondExpr` = 1311[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#_CPPv4N13vhpiOneToOneT12vhpiCondExprE "Permalink to this definition") _enumerator_ `vhpiConfigDecl` = 1312[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#_CPPv4N13vhpiOneToOneT14vhpiConfigDeclE "Permalink to this definition") _enumerator_ `vhpiConfigSpec` = 1313[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#_CPPv4N13vhpiOneToOneT14vhpiConfigSpecE "Permalink to this definition") _enumerator_ `vhpiConstraint` = 1314[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#_CPPv4N13vhpiOneToOneT14vhpiConstraintE "Permalink to this definition") _enumerator_ `vhpiContributor` = 1315[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#_CPPv4N13vhpiOneToOneT15vhpiContributorE "Permalink to this definition") _enumerator_ `vhpiCurCallback` = 1316[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#_CPPv4N13vhpiOneToOneT15vhpiCurCallbackE "Permalink to this definition") _enumerator_ `vhpiCurEqProcess` = 1317[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#_CPPv4N13vhpiOneToOneT16vhpiCurEqProcessE "Permalink to this definition") _enumerator_ `vhpiCurStackFrame` = 1318[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#_CPPv4N13vhpiOneToOneT17vhpiCurStackFrameE "Permalink to this definition") _enumerator_ `vhpiDerefObj` = 1319[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#_CPPv4N13vhpiOneToOneT12vhpiDerefObjE "Permalink to this definition") _enumerator_ `vhpiDecl` = 1320[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#_CPPv4N13vhpiOneToOneT8vhpiDeclE "Permalink to this definition") _enumerator_ `vhpiDesignUnit` = 1321[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#_CPPv4N13vhpiOneToOneT14vhpiDesignUnitE "Permalink to this definition") _enumerator_ `vhpiDownStack` = 1322[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#_CPPv4N13vhpiOneToOneT13vhpiDownStackE "Permalink to this definition") _enumerator_ `vhpiElemSubtype` = 1323[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#_CPPv4N13vhpiOneToOneT15vhpiElemSubtypeE "Permalink to this definition") _enumerator_ `vhpiEntityAspect` = 1324[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#_CPPv4N13vhpiOneToOneT16vhpiEntityAspectE "Permalink to this definition") _enumerator_ `vhpiEntityDecl` = 1325[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#_CPPv4N13vhpiOneToOneT14vhpiEntityDeclE "Permalink to this definition") _enumerator_ `vhpiEqProcessStmt` = 1326[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#_CPPv4N13vhpiOneToOneT17vhpiEqProcessStmtE "Permalink to this definition") _enumerator_ `vhpiExpr` = 1327[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#_CPPv4N13vhpiOneToOneT8vhpiExprE "Permalink to this definition") _enumerator_ `vhpiFormal` = 1328[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#_CPPv4N13vhpiOneToOneT10vhpiFormalE "Permalink to this definition") _enumerator_ `vhpiFuncDecl` = 1329[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#_CPPv4N13vhpiOneToOneT12vhpiFuncDeclE "Permalink to this definition") _enumerator_ `vhpiGroupTempDecl` = 1330[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#_CPPv4N13vhpiOneToOneT17vhpiGroupTempDeclE "Permalink to this definition") _enumerator_ `vhpiGuardExpr` = 1331[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#_CPPv4N13vhpiOneToOneT13vhpiGuardExprE "Permalink to this definition") _enumerator_ `vhpiGuardSig` = 1332[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#_CPPv4N13vhpiOneToOneT12vhpiGuardSigE "Permalink to this definition") _enumerator_ `vhpiImmRegion` = 1333[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#_CPPv4N13vhpiOneToOneT13vhpiImmRegionE "Permalink to this definition") _enumerator_ `vhpiInPort` = 1334[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#_CPPv4N13vhpiOneToOneT10vhpiInPortE "Permalink to this definition") _enumerator_ `vhpiInitExpr` = 1335[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#_CPPv4N13vhpiOneToOneT12vhpiInitExprE "Permalink to this definition") _enumerator_ `vhpiIterScheme` = 1336[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#_CPPv4N13vhpiOneToOneT14vhpiIterSchemeE "Permalink to this definition") _enumerator_ `vhpiLeftExpr` = 1337[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#_CPPv4N13vhpiOneToOneT12vhpiLeftExprE "Permalink to this definition") _enumerator_ `vhpiLexicalScope` = 1338[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#_CPPv4N13vhpiOneToOneT16vhpiLexicalScopeE "Permalink to this definition") _enumerator_ `vhpiLhsExpr` = 1339[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#_CPPv4N13vhpiOneToOneT11vhpiLhsExprE "Permalink to this definition") _enumerator_ `vhpiLocal` = 1340[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#_CPPv4N13vhpiOneToOneT9vhpiLocalE "Permalink to this definition") _enumerator_ `vhpiLogicalExpr` = 1341[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#_CPPv4N13vhpiOneToOneT15vhpiLogicalExprE "Permalink to this definition") _enumerator_ `vhpiName` = 1342[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#_CPPv4N13vhpiOneToOneT8vhpiNameE "Permalink to this definition") _enumerator_ `vhpiOperator` = 1343[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#_CPPv4N13vhpiOneToOneT12vhpiOperatorE "Permalink to this definition") _enumerator_ `vhpiOthers` = 1344[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#_CPPv4N13vhpiOneToOneT10vhpiOthersE "Permalink to this definition") _enumerator_ `vhpiOutPort` = 1345[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#_CPPv4N13vhpiOneToOneT11vhpiOutPortE "Permalink to this definition") _enumerator_ `vhpiParamDecl` = 1346[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#_CPPv4N13vhpiOneToOneT13vhpiParamDeclE "Permalink to this definition") _enumerator_ `vhpiParamExpr` = 1347[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#_CPPv4N13vhpiOneToOneT13vhpiParamExprE "Permalink to this definition") _enumerator_ `vhpiParent` = 1348[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#_CPPv4N13vhpiOneToOneT10vhpiParentE "Permalink to this definition") _enumerator_ `vhpiPhysLiteral` = 1349[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#_CPPv4N13vhpiOneToOneT15vhpiPhysLiteralE "Permalink to this definition") _enumerator_ `vhpiPrefix` = 1350[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#_CPPv4N13vhpiOneToOneT10vhpiPrefixE "Permalink to this definition") _enumerator_ `vhpiPrimaryUnit` = 1351[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#_CPPv4N13vhpiOneToOneT15vhpiPrimaryUnitE "Permalink to this definition") _enumerator_ `vhpiProtectedTypeBody` = 1352[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#_CPPv4N13vhpiOneToOneT21vhpiProtectedTypeBodyE "Permalink to this definition") _enumerator_ `vhpiProtectedTypeDecl` = 1353[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#_CPPv4N13vhpiOneToOneT21vhpiProtectedTypeDeclE "Permalink to this definition") _enumerator_ `vhpiRejectTime` = 1354[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#_CPPv4N13vhpiOneToOneT14vhpiRejectTimeE "Permalink to this definition") _enumerator_ `vhpiReportExpr` = 1355[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#_CPPv4N13vhpiOneToOneT14vhpiReportExprE "Permalink to this definition") _enumerator_ `vhpiResolFunc` = 1356[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#_CPPv4N13vhpiOneToOneT13vhpiResolFuncE "Permalink to this definition") _enumerator_ `vhpiReturnExpr` = 1357[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#_CPPv4N13vhpiOneToOneT14vhpiReturnExprE "Permalink to this definition") _enumerator_ `vhpiReturnTypeMark` = 1358[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#_CPPv4N13vhpiOneToOneT18vhpiReturnTypeMarkE "Permalink to this definition") _enumerator_ `vhpiRhsExpr` = 1359[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#_CPPv4N13vhpiOneToOneT11vhpiRhsExprE "Permalink to this definition") _enumerator_ `vhpiRightExpr` = 1360[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#_CPPv4N13vhpiOneToOneT13vhpiRightExprE "Permalink to this definition") _enumerator_ `vhpiRootInst` = 1361[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#_CPPv4N13vhpiOneToOneT12vhpiRootInstE "Permalink to this definition") _enumerator_ `vhpiSelectExpr` = 1362[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#_CPPv4N13vhpiOneToOneT14vhpiSelectExprE "Permalink to this definition") _enumerator_ `vhpiSeverityExpr` = 1363[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#_CPPv4N13vhpiOneToOneT16vhpiSeverityExprE "Permalink to this definition") _enumerator_ `vhpiSimpleName` = 1364[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#_CPPv4N13vhpiOneToOneT14vhpiSimpleNameE "Permalink to this definition") _enumerator_ `vhpiSubpBody` = 1365[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#_CPPv4N13vhpiOneToOneT12vhpiSubpBodyE "Permalink to this definition") _enumerator_ `vhpiSubpDecl` = 1366[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#_CPPv4N13vhpiOneToOneT12vhpiSubpDeclE "Permalink to this definition") _enumerator_ `vhpiSubtype` = 1367[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#_CPPv4N13vhpiOneToOneT11vhpiSubtypeE "Permalink to this definition") _enumerator_ `vhpiSuffix` = 1368[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#_CPPv4N13vhpiOneToOneT10vhpiSuffixE "Permalink to this definition") _enumerator_ `vhpiTimeExpr` = 1369[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#_CPPv4N13vhpiOneToOneT12vhpiTimeExprE "Permalink to this definition") _enumerator_ `vhpiTimeOutExpr` = 1370[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#_CPPv4N13vhpiOneToOneT15vhpiTimeOutExprE "Permalink to this definition") _enumerator_ `vhpiTool` = 1371[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#_CPPv4N13vhpiOneToOneT8vhpiToolE "Permalink to this definition") _enumerator_ `vhpiType` = 1372[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#_CPPv4N13vhpiOneToOneT8vhpiTypeE "Permalink to this definition") _enumerator_ `vhpiTypeMark` = 1373[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#_CPPv4N13vhpiOneToOneT12vhpiTypeMarkE "Permalink to this definition") _enumerator_ `vhpiTypespec`[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#_CPPv4N13vhpiOneToOneT12vhpiTypespecE "Permalink to this definition") _enumerator_ `vhpiUnitDecl` = 1374[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#_CPPv4N13vhpiOneToOneT12vhpiUnitDeclE "Permalink to this definition") _enumerator_ `vhpiUpStack` = 1375[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#_CPPv4N13vhpiOneToOneT11vhpiUpStackE "Permalink to this definition") _enumerator_ `vhpiUpperRegion` = 1376[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#_CPPv4N13vhpiOneToOneT15vhpiUpperRegionE "Permalink to this definition") _enumerator_ `vhpiUse` = 1377[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#_CPPv4N13vhpiOneToOneT7vhpiUseE "Permalink to this definition") _enumerator_ `vhpiValExpr` = 1378[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#_CPPv4N13vhpiOneToOneT11vhpiValExprE "Permalink to this definition") _enumerator_ `vhpiValSubtype` = 1379[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#_CPPv4N13vhpiOneToOneT14vhpiValSubtypeE "Permalink to this definition") _enumerator_ `vhpiElemType` = 1380[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#_CPPv4N13vhpiOneToOneT12vhpiElemTypeE "Permalink to this definition") _enumerator_ `vhpiFirstNamedType` = 1381[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#_CPPv4N13vhpiOneToOneT18vhpiFirstNamedTypeE "Permalink to this definition") _enumerator_ `vhpiReturnType` = 1382[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#_CPPv4N13vhpiOneToOneT14vhpiReturnTypeE "Permalink to this definition") _enumerator_ `vhpiValType` = 1383[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#_CPPv4N13vhpiOneToOneT11vhpiValTypeE "Permalink to this definition") _enumerator_ `vhpiCurRegion` = 1384[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#_CPPv4N13vhpiOneToOneT13vhpiCurRegionE "Permalink to this definition") _enum_ `vhpiOneToManyT`[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#_CPPv414vhpiOneToManyT "Permalink to this definition") _Values:_ _enumerator_ `vhpiAliasDecls` = 1501[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#_CPPv4N14vhpiOneToManyT14vhpiAliasDeclsE "Permalink to this definition") _enumerator_ `vhpiArgvs` = 1502[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#_CPPv4N14vhpiOneToManyT9vhpiArgvsE "Permalink to this definition") _enumerator_ `vhpiAttrDecls` = 1503[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#_CPPv4N14vhpiOneToManyT13vhpiAttrDeclsE "Permalink to this definition") _enumerator_ `vhpiAttrSpecs` = 1504[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#_CPPv4N14vhpiOneToManyT13vhpiAttrSpecsE "Permalink to this definition") _enumerator_ `vhpiBasicSignals` = 1505[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#_CPPv4N14vhpiOneToManyT16vhpiBasicSignalsE "Permalink to this definition") _enumerator_ `vhpiBlockStmts` = 1506[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#_CPPv4N14vhpiOneToManyT14vhpiBlockStmtsE "Permalink to this definition") _enumerator_ `vhpiBranchs` = 1507[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#_CPPv4N14vhpiOneToManyT11vhpiBranchsE "Permalink to this definition") _enumerator_ `vhpiChoices` = 1509[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#_CPPv4N14vhpiOneToManyT11vhpiChoicesE "Permalink to this definition") _enumerator_ `vhpiCompInstStmts` = 1510[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#_CPPv4N14vhpiOneToManyT17vhpiCompInstStmtsE "Permalink to this definition") _enumerator_ `vhpiCondExprs` = 1511[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#_CPPv4N14vhpiOneToManyT13vhpiCondExprsE "Permalink to this definition") _enumerator_ `vhpiCondWaveforms` = 1512[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#_CPPv4N14vhpiOneToManyT17vhpiCondWaveformsE "Permalink to this definition") _enumerator_ `vhpiConfigItems` = 1513[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#_CPPv4N14vhpiOneToManyT15vhpiConfigItemsE "Permalink to this definition") _enumerator_ `vhpiConfigSpecs` = 1514[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#_CPPv4N14vhpiOneToManyT15vhpiConfigSpecsE "Permalink to this definition") _enumerator_ `vhpiConstDecls` = 1515[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#_CPPv4N14vhpiOneToManyT14vhpiConstDeclsE "Permalink to this definition") _enumerator_ `vhpiConstraints` = 1516[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#_CPPv4N14vhpiOneToManyT15vhpiConstraintsE "Permalink to this definition") _enumerator_ `vhpiContributors` = 1517[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#_CPPv4N14vhpiOneToManyT16vhpiContributorsE "Permalink to this definition") _enumerator_ `vhpiDecls` = 1519[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#_CPPv4N14vhpiOneToManyT9vhpiDeclsE "Permalink to this definition") _enumerator_ `vhpiDepUnits` = 1520[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#_CPPv4N14vhpiOneToManyT12vhpiDepUnitsE "Permalink to this definition") _enumerator_ `vhpiDesignUnits` = 1521[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#_CPPv4N14vhpiOneToManyT15vhpiDesignUnitsE "Permalink to this definition") _enumerator_ `vhpiDrivenSigs` = 1522[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#_CPPv4N14vhpiOneToManyT14vhpiDrivenSigsE "Permalink to this definition") _enumerator_ `vhpiDrivers` = 1523[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#_CPPv4N14vhpiOneToManyT11vhpiDriversE "Permalink to this definition") _enumerator_ `vhpiElemAssocs` = 1524[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#_CPPv4N14vhpiOneToManyT14vhpiElemAssocsE "Permalink to this definition") _enumerator_ `vhpiEntityClassEntrys` = 1525[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#_CPPv4N14vhpiOneToManyT21vhpiEntityClassEntrysE "Permalink to this definition") _enumerator_ `vhpiEntityDesignators` = 1526[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#_CPPv4N14vhpiOneToManyT21vhpiEntityDesignatorsE "Permalink to this definition") _enumerator_ `vhpiEnumLiterals` = 1527[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#_CPPv4N14vhpiOneToManyT16vhpiEnumLiteralsE "Permalink to this definition") _enumerator_ `vhpiForeignfs` = 1528[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#_CPPv4N14vhpiOneToManyT13vhpiForeignfsE "Permalink to this definition") _enumerator_ `vhpiGenericAssocs` = 1529[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#_CPPv4N14vhpiOneToManyT17vhpiGenericAssocsE "Permalink to this definition") _enumerator_ `vhpiGenericDecls` = 1530[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#_CPPv4N14vhpiOneToManyT16vhpiGenericDeclsE "Permalink to this definition") _enumerator_ `vhpiIndexExprs` = 1531[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#_CPPv4N14vhpiOneToManyT14vhpiIndexExprsE "Permalink to this definition") _enumerator_ `vhpiIndexedNames` = 1532[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#_CPPv4N14vhpiOneToManyT16vhpiIndexedNamesE "Permalink to this definition") _enumerator_ `vhpiInternalRegions` = 1533[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#_CPPv4N14vhpiOneToManyT19vhpiInternalRegionsE "Permalink to this definition") _enumerator_ `vhpiMembers` = 1534[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#_CPPv4N14vhpiOneToManyT11vhpiMembersE "Permalink to this definition") _enumerator_ `vhpiPackInsts` = 1535[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#_CPPv4N14vhpiOneToManyT13vhpiPackInstsE "Permalink to this definition") _enumerator_ `vhpiParamAssocs` = 1536[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#_CPPv4N14vhpiOneToManyT15vhpiParamAssocsE "Permalink to this definition") _enumerator_ `vhpiParamDecls` = 1537[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#_CPPv4N14vhpiOneToManyT14vhpiParamDeclsE "Permalink to this definition") _enumerator_ `vhpiPortAssocs` = 1538[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#_CPPv4N14vhpiOneToManyT14vhpiPortAssocsE "Permalink to this definition") _enumerator_ `vhpiPortDecls` = 1539[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#_CPPv4N14vhpiOneToManyT13vhpiPortDeclsE "Permalink to this definition") _enumerator_ `vhpiRecordElems` = 1540[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#_CPPv4N14vhpiOneToManyT15vhpiRecordElemsE "Permalink to this definition") _enumerator_ `vhpiSelectWaveforms` = 1541[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#_CPPv4N14vhpiOneToManyT19vhpiSelectWaveformsE "Permalink to this definition") _enumerator_ `vhpiSelectedNames` = 1542[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#_CPPv4N14vhpiOneToManyT17vhpiSelectedNamesE "Permalink to this definition") _enumerator_ `vhpiSensitivitys` = 1543[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#_CPPv4N14vhpiOneToManyT16vhpiSensitivitysE "Permalink to this definition") _enumerator_ `vhpiSeqStmts` = 1544[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#_CPPv4N14vhpiOneToManyT12vhpiSeqStmtsE "Permalink to this definition") _enumerator_ `vhpiSigAttrs` = 1545[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#_CPPv4N14vhpiOneToManyT12vhpiSigAttrsE "Permalink to this definition") _enumerator_ `vhpiSigDecls` = 1546[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#_CPPv4N14vhpiOneToManyT12vhpiSigDeclsE "Permalink to this definition") _enumerator_ `vhpiSigNames` = 1547[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#_CPPv4N14vhpiOneToManyT12vhpiSigNamesE "Permalink to this definition") _enumerator_ `vhpiSignals` = 1548[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#_CPPv4N14vhpiOneToManyT11vhpiSignalsE "Permalink to this definition") _enumerator_ `vhpiSpecNames` = 1549[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#_CPPv4N14vhpiOneToManyT13vhpiSpecNamesE "Permalink to this definition") _enumerator_ `vhpiSpecs` = 1550[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#_CPPv4N14vhpiOneToManyT9vhpiSpecsE "Permalink to this definition") _enumerator_ `vhpiStmts` = 1551[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#_CPPv4N14vhpiOneToManyT9vhpiStmtsE "Permalink to this definition") _enumerator_ `vhpiTransactions` = 1552[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#_CPPv4N14vhpiOneToManyT16vhpiTransactionsE "Permalink to this definition") _enumerator_ `vhpiTypeMarks` = 1553[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#_CPPv4N14vhpiOneToManyT13vhpiTypeMarksE "Permalink to this definition") _enumerator_ `vhpiUnitDecls` = 1554[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#_CPPv4N14vhpiOneToManyT13vhpiUnitDeclsE "Permalink to this definition") _enumerator_ `vhpiUses` = 1555[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#_CPPv4N14vhpiOneToManyT8vhpiUsesE "Permalink to this definition") _enumerator_ `vhpiVarDecls` = 1556[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#_CPPv4N14vhpiOneToManyT12vhpiVarDeclsE "Permalink to this definition") _enumerator_ `vhpiWaveformElems` = 1557[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#_CPPv4N14vhpiOneToManyT17vhpiWaveformElemsE "Permalink to this definition") _enumerator_ `vhpiLibraryDecls` = 1558[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#_CPPv4N14vhpiOneToManyT16vhpiLibraryDeclsE "Permalink to this definition") _enumerator_ `vhpiLocalLoads` = 1559[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#_CPPv4N14vhpiOneToManyT14vhpiLocalLoadsE "Permalink to this definition") _enumerator_ `vhpiOptimizedLoads` = 1560[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#_CPPv4N14vhpiOneToManyT18vhpiOptimizedLoadsE "Permalink to this definition") _enumerator_ `vhpiTypes` = 1561[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#_CPPv4N14vhpiOneToManyT9vhpiTypesE "Permalink to this definition") _enumerator_ `vhpiUseClauses` = 1562[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#_CPPv4N14vhpiOneToManyT14vhpiUseClausesE "Permalink to this definition") _enumerator_ `vhpiCallbacks` = 1563[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#_CPPv4N14vhpiOneToManyT13vhpiCallbacksE "Permalink to this definition") _enumerator_ `vhpiCurRegions` = 1564[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#_CPPv4N14vhpiOneToManyT14vhpiCurRegionsE "Permalink to this definition") _enum_ `vhpiIntPropertyT`[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#_CPPv416vhpiIntPropertyT "Permalink to this definition") _Values:_ _enumerator_ `vhpiAccessP` = 1001[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#_CPPv4N16vhpiIntPropertyT11vhpiAccessPE "Permalink to this definition") _enumerator_ `vhpiArgcP` = 1002[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#_CPPv4N16vhpiIntPropertyT9vhpiArgcPE "Permalink to this definition") _enumerator_ `vhpiAttrKindP` = 1003[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#_CPPv4N16vhpiIntPropertyT13vhpiAttrKindPE "Permalink to this definition") _enumerator_ `vhpiBaseIndexP` = 1004[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#_CPPv4N16vhpiIntPropertyT14vhpiBaseIndexPE "Permalink to this definition") _enumerator_ `vhpiBeginLineNoP` = 1005[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#_CPPv4N16vhpiIntPropertyT16vhpiBeginLineNoPE "Permalink to this definition") _enumerator_ `vhpiEndLineNoP` = 1006[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#_CPPv4N16vhpiIntPropertyT14vhpiEndLineNoPE "Permalink to this definition") _enumerator_ `vhpiEntityClassP` = 1007[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#_CPPv4N16vhpiIntPropertyT16vhpiEntityClassPE "Permalink to this definition") _enumerator_ `vhpiForeignKindP` = 1008[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#_CPPv4N16vhpiIntPropertyT16vhpiForeignKindPE "Permalink to this definition") _enumerator_ `vhpiFrameLevelP` = 1009[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#_CPPv4N16vhpiIntPropertyT15vhpiFrameLevelPE "Permalink to this definition") _enumerator_ `vhpiGenerateIndexP` = 1010[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#_CPPv4N16vhpiIntPropertyT18vhpiGenerateIndexPE "Permalink to this definition") _enumerator_ `vhpiIntValP` = 1011[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#_CPPv4N16vhpiIntPropertyT11vhpiIntValPE "Permalink to this definition") _enumerator_ `vhpiIsAnonymousP` = 1012[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#_CPPv4N16vhpiIntPropertyT16vhpiIsAnonymousPE "Permalink to this definition") _enumerator_ `vhpiIsBasicP` = 1013[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#_CPPv4N16vhpiIntPropertyT12vhpiIsBasicPE "Permalink to this definition") _enumerator_ `vhpiIsCompositeP` = 1014[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#_CPPv4N16vhpiIntPropertyT16vhpiIsCompositePE "Permalink to this definition") _enumerator_ `vhpiIsDefaultP` = 1015[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#_CPPv4N16vhpiIntPropertyT14vhpiIsDefaultPE "Permalink to this definition") _enumerator_ `vhpiIsDeferredP` = 1016[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#_CPPv4N16vhpiIntPropertyT15vhpiIsDeferredPE "Permalink to this definition") _enumerator_ `vhpiIsDiscreteP` = 1017[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#_CPPv4N16vhpiIntPropertyT15vhpiIsDiscretePE "Permalink to this definition") _enumerator_ `vhpiIsForcedP` = 1018[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#_CPPv4N16vhpiIntPropertyT13vhpiIsForcedPE "Permalink to this definition") _enumerator_ `vhpiIsForeignP` = 1019[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#_CPPv4N16vhpiIntPropertyT14vhpiIsForeignPE "Permalink to this definition") _enumerator_ `vhpiIsGuardedP` = 1020[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#_CPPv4N16vhpiIntPropertyT14vhpiIsGuardedPE "Permalink to this definition") _enumerator_ `vhpiIsImplicitDeclP` = 1021[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#_CPPv4N16vhpiIntPropertyT19vhpiIsImplicitDeclPE "Permalink to this definition") _enumerator_ `vhpiIsInvalidP` = 1022[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#_CPPv4N16vhpiIntPropertyT14vhpiIsInvalidPE "Permalink to this definition") _enumerator_ `vhpiIsLocalP` = 1023[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#_CPPv4N16vhpiIntPropertyT12vhpiIsLocalPE "Permalink to this definition") _enumerator_ `vhpiIsNamedP` = 1024[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#_CPPv4N16vhpiIntPropertyT12vhpiIsNamedPE "Permalink to this definition") _enumerator_ `vhpiIsNullP` = 1025[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#_CPPv4N16vhpiIntPropertyT11vhpiIsNullPE "Permalink to this definition") _enumerator_ `vhpiIsOpenP` = 1026[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#_CPPv4N16vhpiIntPropertyT11vhpiIsOpenPE "Permalink to this definition") _enumerator_ `vhpiIsPLIP` = 1027[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#_CPPv4N16vhpiIntPropertyT10vhpiIsPLIPE "Permalink to this definition") _enumerator_ `vhpiIsPassiveP` = 1028[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#_CPPv4N16vhpiIntPropertyT14vhpiIsPassivePE "Permalink to this definition") _enumerator_ `vhpiIsPostponedP` = 1029[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#_CPPv4N16vhpiIntPropertyT16vhpiIsPostponedPE "Permalink to this definition") _enumerator_ `vhpiIsProtectedTypeP` = 1030[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#_CPPv4N16vhpiIntPropertyT20vhpiIsProtectedTypePE "Permalink to this definition") _enumerator_ `vhpiIsPureP` = 1031[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#_CPPv4N16vhpiIntPropertyT11vhpiIsPurePE "Permalink to this definition") _enumerator_ `vhpiIsResolvedP` = 1032[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#_CPPv4N16vhpiIntPropertyT15vhpiIsResolvedPE "Permalink to this definition") _enumerator_ `vhpiIsScalarP` = 1033[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#_CPPv4N16vhpiIntPropertyT13vhpiIsScalarPE "Permalink to this definition") _enumerator_ `vhpiIsSeqStmtP` = 1034[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#_CPPv4N16vhpiIntPropertyT14vhpiIsSeqStmtPE "Permalink to this definition") _enumerator_ `vhpiIsSharedP` = 1035[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#_CPPv4N16vhpiIntPropertyT13vhpiIsSharedPE "Permalink to this definition") _enumerator_ `vhpiIsTransportP` = 1036[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#_CPPv4N16vhpiIntPropertyT16vhpiIsTransportPE "Permalink to this definition") _enumerator_ `vhpiIsUnaffectedP` = 1037[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#_CPPv4N16vhpiIntPropertyT17vhpiIsUnaffectedPE "Permalink to this definition") _enumerator_ `vhpiIsUnconstrainedP` = 1038[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#_CPPv4N16vhpiIntPropertyT20vhpiIsUnconstrainedPE "Permalink to this definition") _enumerator_ `vhpiIsUninstantiatedP` = 1039[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#_CPPv4N16vhpiIntPropertyT21vhpiIsUninstantiatedPE "Permalink to this definition") _enumerator_ `vhpiIsUpP` = 1040[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#_CPPv4N16vhpiIntPropertyT9vhpiIsUpPE "Permalink to this definition") _enumerator_ `vhpiIsVitalP` = 1041[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#_CPPv4N16vhpiIntPropertyT12vhpiIsVitalPE "Permalink to this definition") _enumerator_ `vhpiIteratorTypeP` = 1042[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#_CPPv4N16vhpiIntPropertyT17vhpiIteratorTypePE "Permalink to this definition") _enumerator_ `vhpiKindP` = 1043[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#_CPPv4N16vhpiIntPropertyT9vhpiKindPE "Permalink to this definition") _enumerator_ `vhpiLeftBoundP` = 1044[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#_CPPv4N16vhpiIntPropertyT14vhpiLeftBoundPE "Permalink to this definition") _enumerator_ `vhpiLevelP` = 1045[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#_CPPv4N16vhpiIntPropertyT10vhpiLevelPE "Permalink to this definition") _enumerator_ `vhpiLineNoP` = 1046[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#_CPPv4N16vhpiIntPropertyT11vhpiLineNoPE "Permalink to this definition") _enumerator_ `vhpiLineOffsetP` = 1047[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#_CPPv4N16vhpiIntPropertyT15vhpiLineOffsetPE "Permalink to this definition") _enumerator_ `vhpiLoopIndexP` = 1048[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#_CPPv4N16vhpiIntPropertyT14vhpiLoopIndexPE "Permalink to this definition") _enumerator_ `vhpiModeP` = 1049[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#_CPPv4N16vhpiIntPropertyT9vhpiModePE "Permalink to this definition") _enumerator_ `vhpiNumDimensionsP` = 1050[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#_CPPv4N16vhpiIntPropertyT18vhpiNumDimensionsPE "Permalink to this definition") _enumerator_ `vhpiNumFieldsP` = 1051[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#_CPPv4N16vhpiIntPropertyT14vhpiNumFieldsPE "Permalink to this definition") _enumerator_ `vhpiNumGensP` = 1052[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#_CPPv4N16vhpiIntPropertyT12vhpiNumGensPE "Permalink to this definition") _enumerator_ `vhpiNumLiteralsP` = 1053[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#_CPPv4N16vhpiIntPropertyT16vhpiNumLiteralsPE "Permalink to this definition") _enumerator_ `vhpiNumMembersP` = 1054[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#_CPPv4N16vhpiIntPropertyT15vhpiNumMembersPE "Permalink to this definition") _enumerator_ `vhpiNumParamsP` = 1055[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#_CPPv4N16vhpiIntPropertyT14vhpiNumParamsPE "Permalink to this definition") _enumerator_ `vhpiNumPortsP` = 1056[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#_CPPv4N16vhpiIntPropertyT13vhpiNumPortsPE "Permalink to this definition") _enumerator_ `vhpiOpenModeP` = 1057[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#_CPPv4N16vhpiIntPropertyT13vhpiOpenModePE "Permalink to this definition") _enumerator_ `vhpiPhaseP` = 1058[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#_CPPv4N16vhpiIntPropertyT10vhpiPhasePE "Permalink to this definition") _enumerator_ `vhpiPositionP` = 1059[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#_CPPv4N16vhpiIntPropertyT13vhpiPositionPE "Permalink to this definition") _enumerator_ `vhpiPredefAttrP` = 1060[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#_CPPv4N16vhpiIntPropertyT15vhpiPredefAttrPE "Permalink to this definition") _enumerator_ `vhpiReasonP` = 1062[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#_CPPv4N16vhpiIntPropertyT11vhpiReasonPE "Permalink to this definition") _enumerator_ `vhpiRightBoundP` = 1063[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#_CPPv4N16vhpiIntPropertyT15vhpiRightBoundPE "Permalink to this definition") _enumerator_ `vhpiSigKindP` = 1064[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#_CPPv4N16vhpiIntPropertyT12vhpiSigKindPE "Permalink to this definition") _enumerator_ `vhpiSizeP` = 1065[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#_CPPv4N16vhpiIntPropertyT9vhpiSizePE "Permalink to this definition") _enumerator_ `vhpiStartLineNoP` = 1066[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#_CPPv4N16vhpiIntPropertyT16vhpiStartLineNoPE "Permalink to this definition") _enumerator_ `vhpiStateP` = 1067[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#_CPPv4N16vhpiIntPropertyT10vhpiStatePE "Permalink to this definition") _enumerator_ `vhpiStaticnessP` = 1068[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#_CPPv4N16vhpiIntPropertyT15vhpiStaticnessPE "Permalink to this definition") _enumerator_ `vhpiVHDLversionP` = 1069[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#_CPPv4N16vhpiIntPropertyT16vhpiVHDLversionPE "Permalink to this definition") _enumerator_ `vhpiIdP` = 1070[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#_CPPv4N16vhpiIntPropertyT7vhpiIdPE "Permalink to this definition") _enumerator_ `vhpiCapabilitiesP` = 1071[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#_CPPv4N16vhpiIntPropertyT17vhpiCapabilitiesPE "Permalink to this definition") _enumerator_ `vhpiIsStdLogicP` = 1072[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#_CPPv4N16vhpiIntPropertyT15vhpiIsStdLogicPE "Permalink to this definition") _enumerator_ `vhpiIsStdULogicP` = 1073[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#_CPPv4N16vhpiIntPropertyT16vhpiIsStdULogicPE "Permalink to this definition") _enumerator_ `vhpiIsStdLogicVectorP` = 1074[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#_CPPv4N16vhpiIntPropertyT21vhpiIsStdLogicVectorPE "Permalink to this definition") _enumerator_ `vhpiIsStdULogicVectorP` = 1075[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#_CPPv4N16vhpiIntPropertyT22vhpiIsStdULogicVectorPE "Permalink to this definition") _enumerator_ `vhpiLanguageP` = 1200[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#_CPPv4N16vhpiIntPropertyT13vhpiLanguagePE "Permalink to this definition") _enum_ `vhpiStrPropertyT`[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#_CPPv416vhpiStrPropertyT "Permalink to this definition") _Values:_ _enumerator_ `vhpiCaseNameP` = 1301[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#_CPPv4N16vhpiStrPropertyT13vhpiCaseNamePE "Permalink to this definition") _enumerator_ `vhpiCompNameP` = 1302[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#_CPPv4N16vhpiStrPropertyT13vhpiCompNamePE "Permalink to this definition") _enumerator_ `vhpiDefNameP` = 1303[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#_CPPv4N16vhpiStrPropertyT12vhpiDefNamePE "Permalink to this definition") _enumerator_ `vhpiFileNameP` = 1304[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#_CPPv4N16vhpiStrPropertyT13vhpiFileNamePE "Permalink to this definition") _enumerator_ `vhpiFullCaseNameP` = 1305[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#_CPPv4N16vhpiStrPropertyT17vhpiFullCaseNamePE "Permalink to this definition") _enumerator_ `vhpiFullNameP` = 1306[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#_CPPv4N16vhpiStrPropertyT13vhpiFullNamePE "Permalink to this definition") _enumerator_ `vhpiKindStrP` = 1307[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#_CPPv4N16vhpiStrPropertyT12vhpiKindStrPE "Permalink to this definition") _enumerator_ `vhpiLabelNameP` = 1308[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#_CPPv4N16vhpiStrPropertyT14vhpiLabelNamePE "Permalink to this definition") _enumerator_ `vhpiLibLogicalNameP` = 1309[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#_CPPv4N16vhpiStrPropertyT19vhpiLibLogicalNamePE "Permalink to this definition") _enumerator_ `vhpiLibPhysicalNameP` = 1310[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#_CPPv4N16vhpiStrPropertyT20vhpiLibPhysicalNamePE "Permalink to this definition") _enumerator_ `vhpiLogicalNameP` = 1311[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#_CPPv4N16vhpiStrPropertyT16vhpiLogicalNamePE "Permalink to this definition") _enumerator_ `vhpiLoopLabelNameP` = 1312[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#_CPPv4N16vhpiStrPropertyT18vhpiLoopLabelNamePE "Permalink to this definition") _enumerator_ `vhpiNameP` = 1313[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#_CPPv4N16vhpiStrPropertyT9vhpiNamePE "Permalink to this definition") _enumerator_ `vhpiOpNameP` = 1314[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#_CPPv4N16vhpiStrPropertyT11vhpiOpNamePE "Permalink to this definition") _enumerator_ `vhpiStrValP` = 1315[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#_CPPv4N16vhpiStrPropertyT11vhpiStrValPE "Permalink to this definition") _enumerator_ `vhpiToolVersionP` = 1316[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#_CPPv4N16vhpiStrPropertyT16vhpiToolVersionPE "Permalink to this definition") _enumerator_ `vhpiUnitNameP` = 1317[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#_CPPv4N16vhpiStrPropertyT13vhpiUnitNamePE "Permalink to this definition") _enumerator_ `vhpiSaveRestartLocationP` = 1318[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#_CPPv4N16vhpiStrPropertyT24vhpiSaveRestartLocationPE "Permalink to this definition") _enumerator_ `vhpiFullVlogNameP` = 1500[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#_CPPv4N16vhpiStrPropertyT17vhpiFullVlogNamePE "Permalink to this definition") _enumerator_ `vhpiFullVHDLNameP` = 1501[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#_CPPv4N16vhpiStrPropertyT17vhpiFullVHDLNamePE "Permalink to this definition") _enumerator_ `vhpiFullLSNameP` = 1502[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#_CPPv4N16vhpiStrPropertyT15vhpiFullLSNamePE "Permalink to this definition") _enumerator_ `vhpiFullLSCaseNameP` = 1503[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#_CPPv4N16vhpiStrPropertyT19vhpiFullLSCaseNamePE "Permalink to this definition") _enum_ `vhpiRealPropertyT`[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#_CPPv417vhpiRealPropertyT "Permalink to this definition") _Values:_ _enumerator_ `vhpiFloatLeftBoundP` = 1601[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#_CPPv4N17vhpiRealPropertyT19vhpiFloatLeftBoundPE "Permalink to this definition") _enumerator_ `vhpiFloatRightBoundP` = 1602[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#_CPPv4N17vhpiRealPropertyT20vhpiFloatRightBoundPE "Permalink to this definition") _enumerator_ `vhpiRealValP` = 1603[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#_CPPv4N17vhpiRealPropertyT12vhpiRealValPE "Permalink to this definition") _enum_ `vhpiPhysPropertyT`[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#_CPPv417vhpiPhysPropertyT "Permalink to this definition") _Values:_ _enumerator_ `vhpiPhysLeftBoundP` = 1651[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#_CPPv4N17vhpiPhysPropertyT18vhpiPhysLeftBoundPE "Permalink to this definition") _enumerator_ `vhpiPhysPositionP` = 1652[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#_CPPv4N17vhpiPhysPropertyT17vhpiPhysPositionPE "Permalink to this definition") _enumerator_ `vhpiPhysRightBoundP` = 1653[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#_CPPv4N17vhpiPhysPropertyT19vhpiPhysRightBoundPE "Permalink to this definition") _enumerator_ `vhpiPhysValP` = 1654[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#_CPPv4N17vhpiPhysPropertyT12vhpiPhysValPE "Permalink to this definition") _enumerator_ `vhpiPrecisionP` = 1655[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#_CPPv4N17vhpiPhysPropertyT14vhpiPrecisionPE "Permalink to this definition") _enumerator_ `vhpiSimTimeUnitP` = 1656[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#_CPPv4N17vhpiPhysPropertyT16vhpiSimTimeUnitPE "Permalink to this definition") _enumerator_ `vhpiResolutionLimitP` = 1657[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#_CPPv4N17vhpiPhysPropertyT20vhpiResolutionLimitPE "Permalink to this definition") _enum_ `vhpiCapabibilityT`[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#_CPPv417vhpiCapabibilityT "Permalink to this definition") _Values:_ _enumerator_ `vhpiProvidesHierarchy` = 1[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#_CPPv4N17vhpiCapabibilityT21vhpiProvidesHierarchyE "Permalink to this definition") _enumerator_ `vhpiProvidesStaticAccess` = 2[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#_CPPv4N17vhpiCapabibilityT24vhpiProvidesStaticAccessE "Permalink to this definition") _enumerator_ `vhpiProvidesConnectivity` = 4[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#_CPPv4N17vhpiCapabibilityT24vhpiProvidesConnectivityE "Permalink to this definition") _enumerator_ `vhpiProvidesPostAnalysis` = 8[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#_CPPv4N17vhpiCapabibilityT24vhpiProvidesPostAnalysisE "Permalink to this definition") _enumerator_ `vhpiProvidesForeignModel` = 16[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#_CPPv4N17vhpiCapabibilityT24vhpiProvidesForeignModelE "Permalink to this definition") _enumerator_ `vhpiProvidesAdvancedForeignModel` = 32[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#_CPPv4N17vhpiCapabibilityT32vhpiProvidesAdvancedForeignModelE "Permalink to this definition") _enumerator_ `vhpiProvidesSaveRestart` = 64[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#_CPPv4N17vhpiCapabibilityT23vhpiProvidesSaveRestartE "Permalink to this definition") _enumerator_ `vhpiProvidesReset` = 128[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#_CPPv4N17vhpiCapabibilityT17vhpiProvidesResetE "Permalink to this definition") _enumerator_ `vhpiProvidesDebugRuntime` = 256[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#_CPPv4N17vhpiCapabibilityT24vhpiProvidesDebugRuntimeE "Permalink to this definition") _enumerator_ `vhpiProvidesAdvancedDebugRuntime` = 512[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#_CPPv4N17vhpiCapabibilityT32vhpiProvidesAdvancedDebugRuntimeE "Permalink to this definition") _enumerator_ `vhpiProvidesDynamicElab` = 1024[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#_CPPv4N17vhpiCapabibilityT23vhpiProvidesDynamicElabE "Permalink to this definition") _enum_ `vhpiOpenModeT`[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#_CPPv413vhpiOpenModeT "Permalink to this definition") _Values:_ _enumerator_ `vhpiInOpen` = 1001[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#_CPPv4N13vhpiOpenModeT10vhpiInOpenE "Permalink to this definition") _enumerator_ `vhpiOutOpen` = 1002[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#_CPPv4N13vhpiOpenModeT11vhpiOutOpenE "Permalink to this definition") _enumerator_ `vhpiReadOpen` = 1003[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#_CPPv4N13vhpiOpenModeT12vhpiReadOpenE "Permalink to this definition") _enumerator_ `vhpiWriteOpen` = 1004[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#_CPPv4N13vhpiOpenModeT13vhpiWriteOpenE "Permalink to this definition") _enumerator_ `vhpiAppendOpen` = 1005[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#_CPPv4N13vhpiOpenModeT14vhpiAppendOpenE "Permalink to this definition") _enum_ `vhpiModeT`[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#_CPPv49vhpiModeT "Permalink to this definition") _Values:_ _enumerator_ `vhpiInMode` = 1001[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#_CPPv4N9vhpiModeT10vhpiInModeE "Permalink to this definition") _enumerator_ `vhpiOutMode` = 1002[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#_CPPv4N9vhpiModeT11vhpiOutModeE "Permalink to this definition") _enumerator_ `vhpiInoutMode` = 1003[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#_CPPv4N9vhpiModeT13vhpiInoutModeE "Permalink to this definition") _enumerator_ `vhpiBufferMode` = 1004[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#_CPPv4N9vhpiModeT14vhpiBufferModeE "Permalink to this definition") _enumerator_ `vhpiLinkageMode` = 1005[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#_CPPv4N9vhpiModeT15vhpiLinkageModeE "Permalink to this definition") _enum_ `vhpiSigKindT`[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#_CPPv412vhpiSigKindT "Permalink to this definition") _Values:_ _enumerator_ `vhpiRegister` = 1001[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#_CPPv4N12vhpiSigKindT12vhpiRegisterE "Permalink to this definition") _enumerator_ `vhpiBus` = 1002[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#_CPPv4N12vhpiSigKindT7vhpiBusE "Permalink to this definition") _enumerator_ `vhpiNormal` = 1003[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#_CPPv4N12vhpiSigKindT10vhpiNormalE "Permalink to this definition") _enum_ `vhpiStaticnessT`[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#_CPPv415vhpiStaticnessT "Permalink to this definition") _Values:_ _enumerator_ `vhpiLocallyStatic` = 1001[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#_CPPv4N15vhpiStaticnessT17vhpiLocallyStaticE "Permalink to this definition") _enumerator_ `vhpiGloballyStatic` = 1002[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#_CPPv4N15vhpiStaticnessT18vhpiGloballyStaticE "Permalink to this definition") _enumerator_ `vhpiDynamic` = 1003[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#_CPPv4N15vhpiStaticnessT11vhpiDynamicE "Permalink to this definition") _enum_ `vhpiPredefAttrT`[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#_CPPv415vhpiPredefAttrT "Permalink to this definition") _Values:_ _enumerator_ `vhpiActivePA` = 1001[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#_CPPv4N15vhpiPredefAttrT12vhpiActivePAE "Permalink to this definition") _enumerator_ `vhpiAscendingPA` = 1002[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#_CPPv4N15vhpiPredefAttrT15vhpiAscendingPAE "Permalink to this definition") _enumerator_ `vhpiBasePA` = 1003[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#_CPPv4N15vhpiPredefAttrT10vhpiBasePAE "Permalink to this definition") _enumerator_ `vhpiDelayedPA` = 1004[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#_CPPv4N15vhpiPredefAttrT13vhpiDelayedPAE "Permalink to this definition") _enumerator_ `vhpiDrivingPA` = 1005[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#_CPPv4N15vhpiPredefAttrT13vhpiDrivingPAE "Permalink to this definition") _enumerator_ `vhpiDriving_valuePA` = 1006[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#_CPPv4N15vhpiPredefAttrT19vhpiDriving_valuePAE "Permalink to this definition") _enumerator_ `vhpiEventPA` = 1007[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#_CPPv4N15vhpiPredefAttrT11vhpiEventPAE "Permalink to this definition") _enumerator_ `vhpiHighPA` = 1008[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#_CPPv4N15vhpiPredefAttrT10vhpiHighPAE "Permalink to this definition") _enumerator_ `vhpiImagePA` = 1009[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#_CPPv4N15vhpiPredefAttrT11vhpiImagePAE "Permalink to this definition") _enumerator_ `vhpiInstance_namePA` = 1010[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#_CPPv4N15vhpiPredefAttrT19vhpiInstance_namePAE "Permalink to this definition") _enumerator_ `vhpiLast_activePA` = 1011[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#_CPPv4N15vhpiPredefAttrT17vhpiLast_activePAE "Permalink to this definition") _enumerator_ `vhpiLast_eventPA` = 1012[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#_CPPv4N15vhpiPredefAttrT16vhpiLast_eventPAE "Permalink to this definition") _enumerator_ `vhpiLast_valuePA` = 1013[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#_CPPv4N15vhpiPredefAttrT16vhpiLast_valuePAE "Permalink to this definition") _enumerator_ `vhpiLeftPA` = 1014[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#_CPPv4N15vhpiPredefAttrT10vhpiLeftPAE "Permalink to this definition") _enumerator_ `vhpiLeftofPA` = 1015[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#_CPPv4N15vhpiPredefAttrT12vhpiLeftofPAE "Permalink to this definition") _enumerator_ `vhpiLengthPA` = 1016[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#_CPPv4N15vhpiPredefAttrT12vhpiLengthPAE "Permalink to this definition") _enumerator_ `vhpiLowPA` = 1017[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#_CPPv4N15vhpiPredefAttrT9vhpiLowPAE "Permalink to this definition") _enumerator_ `vhpiPath_namePA` = 1018[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#_CPPv4N15vhpiPredefAttrT15vhpiPath_namePAE "Permalink to this definition") _enumerator_ `vhpiPosPA` = 1019[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#_CPPv4N15vhpiPredefAttrT9vhpiPosPAE "Permalink to this definition") _enumerator_ `vhpiPredPA` = 1020[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#_CPPv4N15vhpiPredefAttrT10vhpiPredPAE "Permalink to this definition") _enumerator_ `vhpiQuietPA` = 1021[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#_CPPv4N15vhpiPredefAttrT11vhpiQuietPAE "Permalink to this definition") _enumerator_ `vhpiRangePA` = 1022[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#_CPPv4N15vhpiPredefAttrT11vhpiRangePAE "Permalink to this definition") _enumerator_ `vhpiReverse_rangePA` = 1023[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#_CPPv4N15vhpiPredefAttrT19vhpiReverse_rangePAE "Permalink to this definition") _enumerator_ `vhpiRightPA` = 1024[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#_CPPv4N15vhpiPredefAttrT11vhpiRightPAE "Permalink to this definition") _enumerator_ `vhpiRightofPA` = 1025[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#_CPPv4N15vhpiPredefAttrT13vhpiRightofPAE "Permalink to this definition") _enumerator_ `vhpiSimple_namePA` = 1026[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#_CPPv4N15vhpiPredefAttrT17vhpiSimple_namePAE "Permalink to this definition") _enumerator_ `vhpiStablePA` = 1027[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#_CPPv4N15vhpiPredefAttrT12vhpiStablePAE "Permalink to this definition") _enumerator_ `vhpiSuccPA` = 1028[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#_CPPv4N15vhpiPredefAttrT10vhpiSuccPAE "Permalink to this definition") _enumerator_ `vhpiTransactionPA` = 1029[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#_CPPv4N15vhpiPredefAttrT17vhpiTransactionPAE "Permalink to this definition") _enumerator_ `vhpiValPA` = 1030[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#_CPPv4N15vhpiPredefAttrT9vhpiValPAE "Permalink to this definition") _enumerator_ `vhpiValuePA` = 1031[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#_CPPv4N15vhpiPredefAttrT11vhpiValuePAE "Permalink to this definition") _enum_ `vhpiAttrKindT`[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#_CPPv413vhpiAttrKindT "Permalink to this definition") _Values:_ _enumerator_ `vhpiFunctionAK` = 1[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#_CPPv4N13vhpiAttrKindT14vhpiFunctionAKE "Permalink to this definition") _enumerator_ `vhpiRangeAK` = 2[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#_CPPv4N13vhpiAttrKindT11vhpiRangeAKE "Permalink to this definition") _enumerator_ `vhpiSignalAK` = 3[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#_CPPv4N13vhpiAttrKindT12vhpiSignalAKE "Permalink to this definition") _enumerator_ `vhpiTypeAK` = 4[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#_CPPv4N13vhpiAttrKindT10vhpiTypeAKE "Permalink to this definition") _enumerator_ `vhpiValueAK` = 5[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#_CPPv4N13vhpiAttrKindT11vhpiValueAKE "Permalink to this definition") _enum_ `vhpiEntityClassT`[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#_CPPv416vhpiEntityClassT "Permalink to this definition") _Values:_ _enumerator_ `vhpiEntityEC` = 1001[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#_CPPv4N16vhpiEntityClassT12vhpiEntityECE "Permalink to this definition") _enumerator_ `vhpiArchitectureEC` = 1002[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#_CPPv4N16vhpiEntityClassT18vhpiArchitectureECE "Permalink to this definition") _enumerator_ `vhpiConfigurationEC` = 1003[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#_CPPv4N16vhpiEntityClassT19vhpiConfigurationECE "Permalink to this definition") _enumerator_ `vhpiProcedureEC` = 1004[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#_CPPv4N16vhpiEntityClassT15vhpiProcedureECE "Permalink to this definition") _enumerator_ `vhpiFunctionEC` = 1005[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#_CPPv4N16vhpiEntityClassT14vhpiFunctionECE "Permalink to this definition") _enumerator_ `vhpiPackageEC` = 1006[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#_CPPv4N16vhpiEntityClassT13vhpiPackageECE "Permalink to this definition") _enumerator_ `vhpiTypeEC` = 1007[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#_CPPv4N16vhpiEntityClassT10vhpiTypeECE "Permalink to this definition") _enumerator_ `vhpiSubtypeEC` = 1008[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#_CPPv4N16vhpiEntityClassT13vhpiSubtypeECE "Permalink to this definition") _enumerator_ `vhpiConstantEC` = 1009[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#_CPPv4N16vhpiEntityClassT14vhpiConstantECE "Permalink to this definition") _enumerator_ `vhpiSignalEC` = 1010[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#_CPPv4N16vhpiEntityClassT12vhpiSignalECE "Permalink to this definition") _enumerator_ `vhpiVariableEC` = 1011[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#_CPPv4N16vhpiEntityClassT14vhpiVariableECE "Permalink to this definition") _enumerator_ `vhpiComponentEC` = 1012[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#_CPPv4N16vhpiEntityClassT15vhpiComponentECE "Permalink to this definition") _enumerator_ `vhpiLabelEC` = 1013[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#_CPPv4N16vhpiEntityClassT11vhpiLabelECE "Permalink to this definition") _enumerator_ `vhpiLiteralEC` = 1014[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#_CPPv4N16vhpiEntityClassT13vhpiLiteralECE "Permalink to this definition") _enumerator_ `vhpiUnitsEC` = 1015[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#_CPPv4N16vhpiEntityClassT11vhpiUnitsECE "Permalink to this definition") _enumerator_ `vhpiFileEC` = 1016[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#_CPPv4N16vhpiEntityClassT10vhpiFileECE "Permalink to this definition") _enumerator_ `vhpiGroupEC` = 1017[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#_CPPv4N16vhpiEntityClassT11vhpiGroupECE "Permalink to this definition") _enum_ `vhpiAccessT`[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#_CPPv411vhpiAccessT "Permalink to this definition") _Values:_ _enumerator_ `vhpiRead` = 1[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#_CPPv4N11vhpiAccessT8vhpiReadE "Permalink to this definition") _enumerator_ `vhpiWrite` = 2[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#_CPPv4N11vhpiAccessT9vhpiWriteE "Permalink to this definition") _enumerator_ `vhpiConnectivity` = 4[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#_CPPv4N11vhpiAccessT16vhpiConnectivityE "Permalink to this definition") _enumerator_ `vhpiNoAccess` = 8[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#_CPPv4N11vhpiAccessT12vhpiNoAccessE "Permalink to this definition") _enum_ `vhpiStateT`[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#_CPPv410vhpiStateT "Permalink to this definition") _Values:_ _enumerator_ `vhpiEnable`[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#_CPPv4N10vhpiStateT10vhpiEnableE "Permalink to this definition") _enumerator_ `vhpiDisable`[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#_CPPv4N10vhpiStateT11vhpiDisableE "Permalink to this definition") _enumerator_ `vhpiMature`[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#_CPPv4N10vhpiStateT10vhpiMatureE "Permalink to this definition") _enum_ `vhpiCompInstKindT`[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#_CPPv417vhpiCompInstKindT "Permalink to this definition") _Values:_ _enumerator_ `vhpiDirect`[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#_CPPv4N17vhpiCompInstKindT10vhpiDirectE "Permalink to this definition") _enumerator_ `vhpiComp`[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#_CPPv4N17vhpiCompInstKindT8vhpiCompE "Permalink to this definition") _enumerator_ `vhpiConfig`[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#_CPPv4N17vhpiCompInstKindT10vhpiConfigE "Permalink to this definition") _enum_ `vhpiPhaseT`[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#_CPPv410vhpiPhaseT "Permalink to this definition") _Values:_ _enumerator_ `vhpiRegistrationPhase` = 1[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#_CPPv4N10vhpiPhaseT21vhpiRegistrationPhaseE "Permalink to this definition") _enumerator_ `vhpiAnalysisPhase` = 2[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#_CPPv4N10vhpiPhaseT17vhpiAnalysisPhaseE "Permalink to this definition") _enumerator_ `vhpiElaborationPhase` = 3[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#_CPPv4N10vhpiPhaseT20vhpiElaborationPhaseE "Permalink to this definition") _enumerator_ `vhpiInitializationPhase` = 4[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#_CPPv4N10vhpiPhaseT23vhpiInitializationPhaseE "Permalink to this definition") _enumerator_ `vhpiSimulationPhase` = 5[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#_CPPv4N10vhpiPhaseT19vhpiSimulationPhaseE "Permalink to this definition") _enumerator_ `vhpiTerminationPhase` = 6[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#_CPPv4N10vhpiPhaseT20vhpiTerminationPhaseE "Permalink to this definition") _enumerator_ `vhpiSavePhase` = 7[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#_CPPv4N10vhpiPhaseT13vhpiSavePhaseE "Permalink to this definition") _enumerator_ `vhpiRestartPhase` = 8[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#_CPPv4N10vhpiPhaseT16vhpiRestartPhaseE "Permalink to this definition") _enumerator_ `vhpiResetPhase` = 9[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#_CPPv4N10vhpiPhaseT14vhpiResetPhaseE "Permalink to this definition") _enum_ `vhpiSeverityT`[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#_CPPv413vhpiSeverityT "Permalink to this definition") _Values:_ _enumerator_ `vhpiNote` = 1[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#_CPPv4N13vhpiSeverityT8vhpiNoteE "Permalink to this definition") _enumerator_ `vhpiWarning` = 2[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#_CPPv4N13vhpiSeverityT11vhpiWarningE "Permalink to this definition") _enumerator_ `vhpiError` = 3[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#_CPPv4N13vhpiSeverityT9vhpiErrorE "Permalink to this definition") _enumerator_ `vhpiFailure` = 6[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#_CPPv4N13vhpiSeverityT11vhpiFailureE "Permalink to this definition") _enumerator_ `vhpiSystem` = 4[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#_CPPv4N13vhpiSeverityT10vhpiSystemE "Permalink to this definition") _enumerator_ `vhpiInternal` = 5[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#_CPPv4N13vhpiSeverityT12vhpiInternalE "Permalink to this definition") _enum_ `vhpiAutomaticRestoreT`[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#_CPPv421vhpiAutomaticRestoreT "Permalink to this definition") _Values:_ _enumerator_ `vhpiRestoreAll` = 1[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#_CPPv4N21vhpiAutomaticRestoreT14vhpiRestoreAllE "Permalink to this definition") _enumerator_ `vhpiRestoreUserData` = 2[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#_CPPv4N21vhpiAutomaticRestoreT19vhpiRestoreUserDataE "Permalink to this definition") _enumerator_ `vhpiRestoreHandles` = 4[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#_CPPv4N21vhpiAutomaticRestoreT18vhpiRestoreHandlesE "Permalink to this definition") _enumerator_ `vhpiRestoreCallbacks` = 8[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#_CPPv4N21vhpiAutomaticRestoreT20vhpiRestoreCallbacksE "Permalink to this definition") _enum_ `vhpiPutValueModeT`[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#_CPPv417vhpiPutValueModeT "Permalink to this definition") _Values:_ _enumerator_ `vhpiDeposit`[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#_CPPv4N17vhpiPutValueModeT11vhpiDepositE "Permalink to this definition") _enumerator_ `vhpiDepositPropagate`[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#_CPPv4N17vhpiPutValueModeT20vhpiDepositPropagateE "Permalink to this definition") _enumerator_ `vhpiForce`[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#_CPPv4N17vhpiPutValueModeT9vhpiForceE "Permalink to this definition") _enumerator_ `vhpiForcePropagate`[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#_CPPv4N17vhpiPutValueModeT18vhpiForcePropagateE "Permalink to this definition") _enumerator_ `vhpiRelease`[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#_CPPv4N17vhpiPutValueModeT11vhpiReleaseE "Permalink to this definition") _enumerator_ `vhpiSizeConstraint`[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#_CPPv4N17vhpiPutValueModeT18vhpiSizeConstraintE "Permalink to this definition") _enum_ `vhpiDelayModeT`[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#_CPPv414vhpiDelayModeT "Permalink to this definition") _Values:_ _enumerator_ `vhpiInertial`[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#_CPPv4N14vhpiDelayModeT12vhpiInertialE "Permalink to this definition") _enumerator_ `vhpiTransport`[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#_CPPv4N14vhpiDelayModeT13vhpiTransportE "Permalink to this definition") _enum_ `vhpiSimControlT`[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#_CPPv415vhpiSimControlT "Permalink to this definition") _Values:_ _enumerator_ `vhpiStop` = 0[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#_CPPv4N15vhpiSimControlT8vhpiStopE "Permalink to this definition") _enumerator_ `vhpiFinish` = 1[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#_CPPv4N15vhpiSimControlT10vhpiFinishE "Permalink to this definition") _enumerator_ `vhpiReset` = 2[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#_CPPv4N15vhpiSimControlT9vhpiResetE "Permalink to this definition") _enum_ `vhpiForeignT`[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#_CPPv412vhpiForeignT "Permalink to this definition") _Values:_ _enumerator_ `vhpiArchF` = 1[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#_CPPv4N12vhpiForeignT9vhpiArchFE "Permalink to this definition") _enumerator_ `vhpiArchFK` = 1[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#_CPPv4N12vhpiForeignT10vhpiArchFKE "Permalink to this definition") _enumerator_ `vhpiFuncF` = 2[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#_CPPv4N12vhpiForeignT9vhpiFuncFE "Permalink to this definition") _enumerator_ `vhpiFuncFK` = 2[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#_CPPv4N12vhpiForeignT10vhpiFuncFKE "Permalink to this definition") _enumerator_ `vhpiProcF` = 3[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#_CPPv4N12vhpiForeignT9vhpiProcFE "Permalink to this definition") _enumerator_ `vhpiProcFK` = 3[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#_CPPv4N12vhpiForeignT10vhpiProcFKE "Permalink to this definition") _enumerator_ `vhpiLibF` = 4[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#_CPPv4N12vhpiForeignT8vhpiLibFE "Permalink to this definition") _enumerator_ `vhpiAppF` = 5[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#_CPPv4N12vhpiForeignT8vhpiAppFE "Permalink to this definition") Functions `XXTERN int vhpi_assert (vhpiSeverityT severity, const char *formatmsg,...)` `XXTERN vhpiHandleT vhpi_register_cb (vhpiCbDataT *cb_data_p, int32_t flags)` `XXTERN int vhpi_remove_cb (vhpiHandleT cb_obj)` `XXTERN int vhpi_disable_cb (vhpiHandleT cb_obj)` `XXTERN int vhpi_enable_cb (vhpiHandleT cb_obj)` `XXTERN int vhpi_get_cb_info (vhpiHandleT object, vhpiCbDataT *cb_data_p)` `XXTERN int vhpi_sens_first (vhpiValueT *sens)` `XXTERN int vhpi_sens_zero (vhpiValueT *sens)` `XXTERN int vhpi_sens_clr (int obj, vhpiValueT *sens)` `XXTERN int vhpi_sens_set (int obj, vhpiValueT *sens)` `XXTERN int vhpi_sens_isset (int obj, vhpiValueT *sens)` `XXTERN vhpiHandleT vhpi_handle_by_name (const char *name, vhpiHandleT scope)` `XXTERN vhpiHandleT vhpi_handle_by_index (vhpiOneToManyT itRel, vhpiHandleT parent, int32_t indx)` `XXTERN vhpiHandleT vhpi_handle (vhpiOneToOneT type, vhpiHandleT referenceHandle)` `XXTERN vhpiHandleT vhpi_iterator (vhpiOneToManyT type, vhpiHandleT referenceHandle)` `XXTERN vhpiHandleT vhpi_scan (vhpiHandleT iterator)` `XXTERN vhpiIntT vhpi_get (vhpiIntPropertyT property, vhpiHandleT object)` `XXTERN const vhpiCharT * vhpi_get_str (vhpiStrPropertyT property, vhpiHandleT object)` `XXTERN vhpiRealT vhpi_get_real (vhpiRealPropertyT property, vhpiHandleT object)` `XXTERN vhpiPhysT vhpi_get_phys (vhpiPhysPropertyT property, vhpiHandleT object)` `XXTERN int vhpi_protected_call (vhpiHandleT varHdl, vhpiUserFctT userFct, void *userData)` `XXTERN int vhpi_get_value (vhpiHandleT expr, vhpiValueT *value_p)` `XXTERN int vhpi_put_value (vhpiHandleT object, vhpiValueT *value_p, vhpiPutValueModeT flags)` `XXTERN int vhpi_schedule_transaction (vhpiHandleT drivHdl, vhpiValueT *value_p, uint32_t numValues, vhpiTimeT *delayp, vhpiDelayModeT delayMode, vhpiTimeT *pulseRejp)` `XXTERN int vhpi_format_value (const vhpiValueT *in_value_p, vhpiValueT *out_value_p)` `XXTERN void vhpi_get_time (vhpiTimeT *time_p, long *cycles)` `XXTERN int vhpi_get_next_time (vhpiTimeT *time_p)` `XXTERN int vhpi_control (vhpiSimControlT command,...)` `XXTERN int vhpi_sim_control (vhpiSimControlT command)` `XXTERN int vhpi_printf (const char *format,...)` `XXTERN int vhpi_vprintf (const char *format, va_list args)` `XXTERN int vhpi_is_printable (char ch)` `XXTERN int vhpi_compare_handles (vhpiHandleT handle1, vhpiHandleT handle2)` `XXTERN int vhpi_check_error (vhpiErrorInfoT *error_info_p)` `XXTERN int vhpi_release_handle (vhpiHandleT object)` `XXTERN vhpiHandleT vhpi_create (vhpiClassKindT kind, vhpiHandleT handle1, vhpiHandleT handle2)` `XXTERN vhpiHandleT vhpi_register_foreignf (vhpiForeignDataT *foreignDatap)` `XXTERN int vhpi_get_foreignf_info (vhpiHandleT hdl, vhpiForeignDataT *foreignDatap)` `XXTERN int vhpi_get_foreign_info (vhpiHandleT hdl, vhpiForeignDataT *foreignDatap)` `XXTERN size_t vhpi_get_data (int32_t id, void *dataLoc, size_t numBytes)` `XXTERN size_t vhpi_put_data (int32_t id, void *dataLoc, size_t numBytes)` `XXTERN vhpiHandleT vhpi_get_cause_instance (vhpiHandleT sigHandle)` `XXTERN int vhpi_get_cause (vhpiHandleT sigHandle, unsigned int **p2MagicNumbersBuffer)` `XXTERN int vhpi_get_cause_info (const unsigned int **pn2MagicNumbers, int nBufLen, char *pszHierScopeBuf, int nFilePathBufLen, char *pszSourceFilePathBuf, int *pnLineNr)` `XXTERN vhpiIntT vhpi_value_size (vhpiHandleT objHdl, vhpiFormatT format)` Variables `PLI_VEXTERN PLI_DLLISPEC const vhpiPhysT vhpiFS` `PLI_VEXTERN PLI_DLLISPEC const vhpiPhysT vhpiPS` `PLI_VEXTERN PLI_DLLISPEC const vhpiPhysT vhpiNS` `PLI_VEXTERN PLI_DLLISPEC const vhpiPhysT vhpiUS` `PLI_VEXTERN PLI_DLLISPEC const vhpiPhysT vhpiMS` `PLI_VEXTERN PLI_DLLISPEC const vhpiPhysT vhpiS` `PLI_VEXTERN PLI_DLLISPEC const vhpiPhysT vhpiMN` `PLI_VEXTERN PLI_DLLISPEC const vhpiPhysT vhpiHR` _struct_ `vhpiPhysS`[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#_CPPv49vhpiPhysS "Permalink to this definition") Public Members int32\_t `high`[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#_CPPv4N9vhpiPhysS4highE "Permalink to this definition") uint32\_t `low`[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#_CPPv4N9vhpiPhysS3lowE "Permalink to this definition") _struct_ `vhpiTimeS`[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#_CPPv49vhpiTimeS "Permalink to this definition") Public Members uint32\_t `high`[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#_CPPv4N9vhpiTimeS4highE "Permalink to this definition") uint32\_t `low`[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#_CPPv4N9vhpiTimeS3lowE "Permalink to this definition") _struct_ `vhpiValueS`[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#_CPPv410vhpiValueS "Permalink to this definition") Public Members [vhpiFormatT](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#_CPPv411vhpiFormatT "vhpiFormatT") `format`[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#_CPPv4N10vhpiValueS6formatE "Permalink to this definition") size\_t `bufSize`[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#_CPPv4N10vhpiValueS7bufSizeE "Permalink to this definition") int32\_t `numElems`[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#_CPPv4N10vhpiValueS8numElemsE "Permalink to this definition") [vhpiPhysT](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#_CPPv49vhpiPhysT "vhpiPhysT") `unit`[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#_CPPv4N10vhpiValueS4unitE "Permalink to this definition") [vhpiEnumT](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#_CPPv49vhpiEnumT "vhpiEnumT") `enumv`[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#_CPPv4N10vhpiValueS5enumvE "Permalink to this definition") [vhpiEnumT](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#_CPPv49vhpiEnumT "vhpiEnumT") \*`enumvs`[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#_CPPv4N10vhpiValueS6enumvsE "Permalink to this definition") [vhpiSmallEnumT](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#_CPPv414vhpiSmallEnumT "vhpiSmallEnumT") `smallenumv`[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#_CPPv4N10vhpiValueS10smallenumvE "Permalink to this definition") [vhpiSmallEnumT](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#_CPPv414vhpiSmallEnumT "vhpiSmallEnumT") \*`smallenumvs`[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#_CPPv4N10vhpiValueS11smallenumvsE "Permalink to this definition") [vhpiIntT](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#_CPPv48vhpiIntT "vhpiIntT") `intg`[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#_CPPv4N10vhpiValueS4intgE "Permalink to this definition") [vhpiIntT](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#_CPPv48vhpiIntT "vhpiIntT") \*`intgs`[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#_CPPv4N10vhpiValueS5intgsE "Permalink to this definition") [vhpiLongIntT](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#_CPPv412vhpiLongIntT "vhpiLongIntT") `longintg`[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#_CPPv4N10vhpiValueS8longintgE "Permalink to this definition") [vhpiLongIntT](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#_CPPv412vhpiLongIntT "vhpiLongIntT") \*`longintgs`[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#_CPPv4N10vhpiValueS9longintgsE "Permalink to this definition") [vhpiRealT](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#_CPPv49vhpiRealT "vhpiRealT") `real`[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#_CPPv4N10vhpiValueS4realE "Permalink to this definition") [vhpiRealT](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#_CPPv49vhpiRealT "vhpiRealT") \*`reals`[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#_CPPv4N10vhpiValueS5realsE "Permalink to this definition") [vhpiSmallPhysT](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#_CPPv414vhpiSmallPhysT "vhpiSmallPhysT") `smallphys`[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#_CPPv4N10vhpiValueS9smallphysE "Permalink to this definition") [vhpiSmallPhysT](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#_CPPv414vhpiSmallPhysT "vhpiSmallPhysT") \*`smallphyss`[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#_CPPv4N10vhpiValueS10smallphyssE "Permalink to this definition") [vhpiPhysT](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#_CPPv49vhpiPhysT "vhpiPhysT") `phys`[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#_CPPv4N10vhpiValueS4physE "Permalink to this definition") [vhpiPhysT](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#_CPPv49vhpiPhysT "vhpiPhysT") \*`physs`[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#_CPPv4N10vhpiValueS5physsE "Permalink to this definition") [vhpiTimeT](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#_CPPv49vhpiTimeT "vhpiTimeT") `time`[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#_CPPv4N10vhpiValueS4timeE "Permalink to this definition") [vhpiTimeT](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#_CPPv49vhpiTimeT "vhpiTimeT") \*`times`[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#_CPPv4N10vhpiValueS5timesE "Permalink to this definition") [vhpiCharT](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#_CPPv49vhpiCharT "vhpiCharT") `ch`[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#_CPPv4N10vhpiValueS2chE "Permalink to this definition") [vhpiCharT](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#_CPPv49vhpiCharT "vhpiCharT") \*`str`[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#_CPPv4N10vhpiValueS3strE "Permalink to this definition") void \*`ptr`[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#_CPPv4N10vhpiValueS3ptrE "Permalink to this definition") void \*\*`ptrs`[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#_CPPv4N10vhpiValueS4ptrsE "Permalink to this definition") _union_ [vhpiValueS](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#_CPPv410vhpiValueS "vhpiValueS") ::**\[anonymous\]** `value`[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#_CPPv4N10vhpiValueS5valueE "Permalink to this definition") _struct_ `vhpiErrorInfoS`[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#_CPPv414vhpiErrorInfoS "Permalink to this definition") Public Members [vhpiSeverityT](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#_CPPv413vhpiSeverityT "vhpiSeverityT") `severity`[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#_CPPv4N14vhpiErrorInfoS8severityE "Permalink to this definition") char \*`message`[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#_CPPv4N14vhpiErrorInfoS7messageE "Permalink to this definition") char \*`str`[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#_CPPv4N14vhpiErrorInfoS3strE "Permalink to this definition") char \*`file`[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#_CPPv4N14vhpiErrorInfoS4fileE "Permalink to this definition") int32\_t `line`[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#_CPPv4N14vhpiErrorInfoS4lineE "Permalink to this definition") _struct_ `vhpiCbDataS`[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#_CPPv411vhpiCbDataS "Permalink to this definition") Public Members int32\_t `reason`[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#_CPPv4N11vhpiCbDataS6reasonE "Permalink to this definition") void (\*`cb_rtn`)(_const_ _struct_ [vhpiCbDataS](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#_CPPv411vhpiCbDataS "vhpiCbDataS") \*)[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#_CPPv4N11vhpiCbDataS6cb_rtnE "Permalink to this definition") [vhpiHandleT](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#_CPPv411vhpiHandleT "vhpiHandleT") `obj`[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#_CPPv4N11vhpiCbDataS3objE "Permalink to this definition") [vhpiTimeT](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#_CPPv49vhpiTimeT "vhpiTimeT") \*`time`[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#_CPPv4N11vhpiCbDataS4timeE "Permalink to this definition") [vhpiValueT](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#_CPPv410vhpiValueT "vhpiValueT") \*`value`[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#_CPPv4N11vhpiCbDataS5valueE "Permalink to this definition") void \*`user_data`[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#_CPPv4N11vhpiCbDataS9user_dataE "Permalink to this definition") _struct_ `vhpiForeignDataS`[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#_CPPv416vhpiForeignDataS "Permalink to this definition") Public Members [vhpiForeignT](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#_CPPv412vhpiForeignT "vhpiForeignT") `kind`[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#_CPPv4N16vhpiForeignDataS4kindE "Permalink to this definition") char \*`libraryName`[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#_CPPv4N16vhpiForeignDataS11libraryNameE "Permalink to this definition") char \*`modelName`[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#_CPPv4N16vhpiForeignDataS9modelNameE "Permalink to this definition") void (\*`elabf`)(_const_ _struct_ [vhpiCbDataS](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#_CPPv411vhpiCbDataS "vhpiCbDataS") \*cb\_data\_p)[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#_CPPv4N16vhpiForeignDataS5elabfE "Permalink to this definition") void (\*`execf`)(_const_ _struct_ [vhpiCbDataS](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#_CPPv411vhpiCbDataS "vhpiCbDataS") \*cb\_data\_p)[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#_CPPv4N16vhpiForeignDataS5execfE "Permalink to this definition") --- # Unknown \# This file is public domain, it can be freely copied without restrictions. # SPDX-License-Identifier: CC0-1.0 # test\_my\_design.py (simple) import cocotb from cocotb.triggers import Timer @cocotb.test() async def my\_first\_test(dut): """Try accessing the design.""" for cycle in range(10): dut.clk.value = 0 await Timer(1, units="ns") dut.clk.value = 1 await Timer(1, units="ns") dut.\_log.info("my\_signal\_1 is %s", dut.my\_signal\_1.value) assert dut.my\_signal\_2.value\[0\] == 0, "my\_signal\_2\[0\] is not 0!" # test\_my\_design.py (extended) import cocotb from cocotb.triggers import Timer from cocotb.triggers import FallingEdge async def generate\_clock(dut): """Generate clock pulses.""" for cycle in range(10): dut.clk.value = 0 await Timer(1, units="ns") dut.clk.value = 1 await Timer(1, units="ns") @cocotb.test() async def my\_second\_test(dut): """Try accessing the design.""" await cocotb.start(generate\_clock(dut)) # run the clock "in the background" await Timer(5, units="ns") # wait a bit await FallingEdge(dut.clk) # wait for falling edge/"negedge" dut.\_log.info("my\_signal\_1 is %s", dut.my\_signal\_1.value) assert dut.my\_signal\_2.value\[0\] == 0, "my\_signal\_2\[0\] is not 0!" --- # Unknown \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\* The Timing Model \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\* cocotb's timing model is a simplification of the :term:\`VPI\`\\ 's, :term:\`VHPI\`\\ 's, and :term:\`FLI\`\\ 's timing model, made by choosing the common subset of the most important aspects of those timing models. Like the aforementioned timing models, cocotb's is organized around :term:\`time steps \`. A time step is a single point in simulated time, comprised of one or more :term:\`evaluation cycles \`. For example, there is a time step that occurs on a rising clock edge, and the next time step is typically on the falling clock edge. Moving between time steps will advance simulated time. Evaluation cycles occur when HDL or cocotb code is executed in reaction to events, such as simulated time advancing or a signal or variable changing value. The executed code tends to create more events, leading to the next evaluation cycle. Evaluation cycles don't advance simulated time. cocotb provides Python timing :term:\`triggers \` allowing users to move through time steps and evaluation cycles. :keyword:\`await\`\\ ing these triggers will cause the current cocotb coroutine to block until simulation reaches the specific point in time. The Time Step ============= Time steps are split into five phases in the cocotb timing model, some of which are repeated many times. The time step starts in the :ref:\`beginning-of-time-step\` phase and ends in the :ref:\`end-of-time-step\` phase. Evaluation cycles occur between these two points, with the simulator running in the :ref:\`evaluation\` phases, and cocotb code reacting in the :ref:\`values-change\` and :ref:\`values-settle\` phases. .. figure:: diagrams/svg/timing\_model.svg :align: center The phases of a time step .. \_beginning-of-time-step: Beginning of Time Step ---------------------- This is the phase where the :class:\`.NextTimeStep\` and :class:\`.Timer\` triggers will return. This phase begins the time step before any HDL code has executed or any signal or variable have changed value. In this phase, users are allowed to read and write any signal or variable. Once control returns to the simulator, it will enter the :ref:\`evaluation\` phase. Users can :keyword:\`await\` the following triggers in this phase: \* :class:\`.NextTimeStep\` to move to the :ref:\`beginning of the next time step \`. \* :class:\`.Timer\` to move to the :ref:\`beginning of any following time step \`. \* :class:\`.ValueChange\`, :class:\`.RisingEdge\` or :class:\`.FallingEdge\` to move to the next :ref:\`values-change\` phase where the requested value changes. \* :class:\`.ReadWrite\` to move to the :ref:\`end of the first evaluation cycle \`. \* :class:\`.ReadOnly\` to move to the :ref:\`end of the current time step \`. .. \_evaluation: HDL Evaluation -------------- This phase represents the time spent in the simulator evaluating \`\`always\`\` or \`\`process\`\` blocks, continuous assignments, or other HDL code. If a signal or variable passed to a :class:\`.ValueChange\`, :class:\`.RisingEdge\`, or :class:\`.FallingEdge\` trigger changes value accordingly, the simulator will enter the :ref:\`values-change\` phase. Alternatively, after all values have changed and all HDL has finished executing, it will enter the :ref:\`values-settle\` phase. .. note:: cocotb is not executing during this phase. .. \_values-change: Values Change ------------- This is the phase where the :class:\`.ValueChange\`, :class:\`.RisingEdge\`, or :class:\`.FallingEdge\` triggers will return. The signal or variable given to the trigger will have changed value, but no HDL that reacts to that value change will have executed; meaning "downstream" signals and variables will not have updated values. In this phase, users can read and write values on any signal or variable. After control returns to the simulator, it will re-enter the :ref:\`evaluation\` phase. There are 0 or more of these phases in a time step and they are not distinguishable from cocotb. There is no way to jump to any particular one of these phases in a time step. Users can :keyword:\`await\` the following triggers in this phase: \* :class:\`.NextTimeStep\` to move to the :ref:\`beginning of the next time step \`. \* :class:\`.Timer\` to move to the :ref:\`beginning of any following time step \`. \* :class:\`.ValueChange\`, :class:\`.RisingEdge\`, or :class:\`.FallingEdge\` to move to the next :ref:\`values-change\` phase where the requested value changes. \* :class:\`.ReadWrite\` to move to the :ref:\`end of the current evaluation cycle \`. \* :class:\`.ReadOnly\` to move to the :ref:\`end of the current time step \`. .. \_values-settle: Values Settle ------------- This is the phase where the :class:\`.ReadWrite\` trigger will return. All signals and variables will have their final values and all HDL will have executed for the time step. In this phase, users can read and write values on any signal or variable. If they do write, the simulator will re-enter the :ref:\`evaluation\` phase. Alternatively, the simulator will enter the :ref:\`end-of-time-step\` phase. There are 0 or more of these phases in a time step and they are not distinguishable from cocotb. There is no way to jump to any particular one of these phases in a time step. Users can :keyword:\`await\` the following triggers in this phase: \* :class:\`.NextTimeStep\` to move to the :ref:\`beginning of the next time step \`. \* :class:\`.Timer\` to move to the :ref:\`beginning of any following time step \`. \* :class:\`.ValueChange\`, :class:\`.RisingEdge\`, or :class:\`.FallingEdge\` to move to the next :ref:\`values-change\` phase where the requested value changes. \* :class:\`.ReadWrite\` to move to the :ref:\`end of the next evaluation cycle \`. \* :class:\`.ReadOnly\` to move to the :ref:\`end of the current time step \`. .. \_end-of-time-step: End of Time Step ---------------- This is the phase where the :class:\`.ReadOnly\` trigger will return. All signals and variables will have their final values and all HDL will have executed for the time step. However, unlike the :ref:\`values-settle\` phase, no writes are allowed in this phase; meaning no new evaluation cycles can occur. Users can still freely read in this phase. Once control returns to the simulator, it will move to the :ref:\`beginning of the next time step \`. Users can :keyword:\`await\` the following triggers in this phase: \* :class:\`.NextTimeStep\` to move to the :ref:\`beginning of the next time step \`. \* :class:\`.Timer\` to move to the :ref:\`beginning of any following time step \`. \* :class:\`.ValueChange\`, :class:\`.RisingEdge\`, or :class:\`.FallingEdge\` to move to the next :ref:\`values-change\` phase where the requested value changes. .. note:: \`\`await ReadWrite()\`\` or \`\`await ReadOnly()\`\` in this phase \*\*are not\*\* well defined behaviors and will result in a :exc:\`RuntimeError\` being raised. Triggers ======== :class:\`!Timer\` --------------- The :class:\`.Timer\` trigger allows users to jump forward in simulated time arbitrarily. It will always return at the :ref:\`beginning of time step \`. Simulated time cannot move backwards, meaning negative and \`\`0\`\` time values are not valid. :class:\`!Timer\` cannot be used to move between evaluation cycles, only between time steps. :class:\`!NextTimeStep\` ---------------------- :class:\`.NextTimeStep\` is like :class:\`.Timer\`, except that it always returns at the :ref:\`beginning of the next time step \`. The next time step could be at any simulated time thereafter, \*\*or never\*\*. It is only safe to use if there is scheduled behavior that will cause another time step to occur. Using :class:\`.NextTimeStep\` in other situations will result in undefined behavior. :class:\`!ValueChange\` / :class:\`!RisingEdge\` / :class:\`!FallingEdge\` -------------------------------------------------------------------- The edge triggers (:class:\`.ValueChange\`, :class:\`.RisingEdge\`, and :class:\`.FallingEdge\`) allow users to block a cocotb coroutine until a signal or variable changes value at some point in the future. That point in the future may be in a different evaluation cycle in the same time step, in a different time step, \*\*or never\*\*. Using an edge trigger on a signal or variable that will never change value will result in undefined behavior. After returning, an edge trigger returns at the point where the signal or variable given to the trigger will have changed value, but no HDL that reacts to that value change will have executed; meaning "downstream" signals and variables will not have updated values. Using a flip-flop for example, after an \`\`await RisingEdge(dut.clk)\`\`, \`\`dut.clk\`\` will be \`\`1\`\`, but the output of the flip-flop will remain the previous value. Wait until :class:\`.ReadWrite\` or :class:\`.ReadOnly\` to see the output change. :class:\`!ReadWrite\` ------------------- :class:\`.ReadWrite\` allows users to synchronize with the :ref:\`end of the current evaluation cycle \`. At the end of the evaluation cycle, all signals and variables will have their final values and all HDL will have executed for the time step. However, users are still allowed to write. This can be useful when trying to react combinationally to a registered signal. For example, to set \`\`dut.valid\`\` high in reaction to \`\`dut.ready\`\` going high as a combinational circuit would, users could write the following. .. code-block:: python while True: await RisingEdge(dut.clk) await ReadWrite() dut.valid.value = 0 if dut.ready.value == 1: dut.valid.value = 1 :class:\`!ReadOnly\` ------------------ :class:\`.ReadOnly\` allows users to jump to the :ref:\`end of the time step \`; allowing them to read the final values of signals or variables before more simulated time is consumed. This may be necessary if they wish to sample a signal or variable whose value glitches (changes value in multiple evaluation cycles). .. note:: \`\`await ReadWrite()\`\` or \`\`await ReadOnly()\`\` after an \`\`await ReadOnly()\`\` \*\*is not\*\* well defined and will result in a :exc:\`RuntimeError\` being raised. State Transitions ================= .. parsed-literal:: N := time step M := evaluation cycle BEGIN{N} -> BEGIN{>N} : Timer BEGIN{N+1} : NextTimeStep CHANGE{N,>=0} : ValueChange/RisingEdge/FallingEdge CHANGE{>N,>=0} : ValueChange/RisingEdge/FallingEdge SETTLE{N,0} : ReadWrite END{N} : ReadOnly CHANGE{N,M} -> BEGIN{>N} : Timer BEGIN{N+1} : NextTimeStep CHANGE{N,>M} : ValueChange/RisingEdge/FallingEdge CHANGE{>N,>=0} : ValueChange/RisingEdge/FallingEdge SETTLE{N,M} : ReadWrite END{N} : ReadOnly SETTLE{N,M} -> BEGIN{>N} : Timer BEGIN{N+1} : NextTimeStep CHANGE{N,>M} : ValueChange/RisingEdge/FallingEdge CHANGE{>N,>=0} : ValueChange/RisingEdge/FallingEdge SETTLE{N,M+1} : ReadWrite END{N} : ReadOnly END{N} -> BEGIN{>N} : Timer BEGIN{N+1} : NextTimeStep Differences in Verilator ======================== Verilator is a cycle-based simulator, meaning it does not have discrete events like "value changed." Instead it has "cycles", meaning it evaluates all HDL code in a time step iteratively until quiescence, without stopping. This frees the simulator to evaluate the HDL however it sees fit, as long as it can maintain correctness, allowing for optimizations. In Verilator, the timing triggers (:class:\`.Timer\`, :class:\`.NextTimeStep\`, :class:\`.ReadWrite\`, and :class:\`.ReadOnly\`) work as intended, as these map to "cycles" well. However, the value change triggers (:class:\`.ValueChange\`, :class:\`.RisingEdge\`, and :class:\`.FallingEdge\`) can not be handled in the middle of a cycle, so they are handled after the cycle has ended (equivalent to the :ref:\`values-settle\` phase). The easiest way to think of the behavior is as if the value change triggers all have an implicit :class:\`await ReadWrite() \` after them. --- # Unknown .. \_refcard: \*\*\*\*\*\*\*\*\*\*\*\*\*\* Reference Card \*\*\*\*\*\*\*\*\*\*\*\*\*\* .. Document "best practice"; leave out detail. Keep format as 1/3rd width of A4/Letter for taping to monitor frames. The "| " syntax is a "Line Block", see https://docutils.sourceforge.io/docs/ref/rst/restructuredtext.html#line-blocks .. spelling:word-list:: coro coros func metavalue TestFactory \*coro\*: a coroutine; \*task\*: a concurrently-running coroutine; \*trigger\*: a trigger +------------------------+-----------------------------------------------------------------+ | Assign | \`\`dut.mysignal.value = 0xFF00\`\` | +------------------------+-----------------------------------------------------------------+ | Assign immediately | \`\`dut.mysignal.value = Immediate(0xFF00)\`\` | +------------------------+-----------------------------------------------------------------+ | Assign metavalue | | \`\`dut.mysignal.value = Logic("X")\`\` | | | | \`\`dut.mysignal.value = LogicArray("01XZ")\`\` | +------------------------+-----------------------------------------------------------------+ | Read | | \`\`val = dut.mysignal.value\`\` | | | | (\`\`mysig = dut.mysignal\`\` \*creates an alias/reference\*) | +------------------------+-----------------------------------------------------------------+ | Bit slice | | \`\`mybit = dut.mysignal.value\[0\]\`\` | | | | \`\`mybits = dut.mysignal.value\[3:1\]\`\` | +------------------------+-----------------------------------------------------------------+ | Convert | | \`\`val = dut.mysignal.value.to\_unsigned()\`\` | | | | \`\`val = dut.mysignal.value.to\_signed()\`\` | | | | \`\`val = dut.mysignal.value.to\_bytes(byteorder="little")\`\` | | | | \`\`val = str(dut.mysignal.value)\`\` | +------------------------+-----------------------------------------------------------------+ | Vector length | \`\`num\_bits = len(dut.mysignal)\`\` | +------------------------+-----------------------------------------------------------------+ | Check | \`\`assert dut.mysignal.value == exp, "Not as expected!"\`\` | +------------------------+---------------+-------------------------------------------------+ | Access Extended / Escaped Identifiers | \`\`dut\["\\\\!Hello!\\\\"\]\`\` | +----------------------------------------+-------------------------------------------------+ | | +------------------------+-----------------------------------------------------------------+ | Wait time | \`\`await cocotb.triggers.Timer(12, "ns")\`\` | +------------------------+-----------------------------------------------------------------+ | Wait for signal edge | | \`\`await cocotb.triggers.RisingEdge(dut.mysignal)\`\` | | | | \`\`await cocotb.triggers.FallingEdge(dut.mysignal)\`\` | | | | \`\`await cocotb.triggers.Edge(dut.mysignal)\`\` | +------------------------+-----------------------------------------------------------------+ | | +------------------------+-----------------------------------------------------------------+ | Run coros concurrently | | \`\`task\_0 = await cocotb.start(coro\_0())\`\` (start coro now) | | | | \`\`task\_1 = cocotb.start\_soon(coro)\`\` | | | | \`\`result = await task\_0\`\` | +------------------------+-----------------------------------------------------------------+ | Cancel task | \`\`task\_0.cancel()\`\` | +------------------------++----------------------------------------------------------------+ | Wait for task to finish | \`\`await task\_0.complete\`\` | +------------------------++----------------------------------------------------------------+ | | +-------------------------------+----------------------------------------------------------+ | Resume on any Task or Trigger | \`\`await cocotb.triggers.First(task\_0, trigger\_1)\`\` | +-------------------------------+----------------------------------------------------------+ | Resume on all Task or Trigger | \`\`await cocotb.triggers.Combine(task\_0, trigger\_1)\`\` | +-------------------------------+----------------------------------------------------------+ | | +------------------------+-----------------------------------------------------------------+ | Generate clock | \`\`clk = Clock(dut.clk, 12, "ns").start()\`\` | +------------------------+-----------------------------------------------------------------+ | | +------------------------+-----------------------------------------------------------------+ | Queue write | | \`\`await cocotb.queue.Queue.put(item)\`\` | | | | \`\`cocotb.queue.Queue.put\_nowait(item)\`\` | +------------------------+-----------------------------------------------------------------+ | Queue read | | \`\`item = await cocotb.queue.Queue.get()\`\` | | | | \`\`item = cocotb.queue.Queue.get\_nowait()\`\` | +------------------------+-----------------------------------------------------------------+ | Queue attributes | | \`\`queue.maxsize\`\` (\`\`None\`\` \*== unlimited\*) | | | | \`\`queue.qsize()\`\` | | | | \`\`queue.empty()\`\` | | | | \`\`queue.full()\`\` | +------------------------+-----------------------------------------------------------------+ | Specialized queues | \`\`.PriorityQueue\`\`, \`\`.LifoQueue\`\` | +------------------------+-----------------------------------------------------------------+ | | +------------------------+-----------------------------------------------------------------+ | Set up event | \`\`e = cocotb.triggers.Event()\`\` | +------------------------+-----------------------------------------------------------------+ | Wake up waiters | \`\`e.set()\`\` | +------------------------+-----------------------------------------------------------------+ | Wait until \`\`set()\`\` | \`\`await e.wait()\`\` | +------------------------+-----------------------------------------------------------------+ | Reset after \`\`set()\`\` | \`\`e.clear()\`\` | +------------------------+-----------------------------------------------------------------+ | Timeout | \`\`await cocotb.triggers.with\_timeout(coro, 1, "us")\`\` | +------------------------+-----------------------------------------------------------------+ | | +------------------------+-----------------------------------------------------------------+ | Force value | \`\`dut.mysignal.value = cocotb.handle.Force(0xFF00)\`\` | +------------------------+-----------------------------------------------------------------+ | Keep value | \`\`dut.mysignal.value = cocotb.handle.Freeze()\`\` | +------------------------+-----------------------------------------------------------------+ | Release Force/Freeze | \`\`dut.mysignal.value = cocotb.handle.Release()\`\` | +------------------------+-----------------------------------------------------------------+ | \*Normal assignment is a "deposit"\* (\`\`cocotb.handle.Deposit()\`\`) | +------------------------+-----------------------------------------------------------------+ | | +------------------------+-----------------------------------------------------------------+ | Mark as test | \`\`@cocotb.test(skip, expect\_fail, timeout\_time, timeout\_unit)\`\` | +------------------------+-----------+-----------------------------------------------------+ | | +------------------------+-----------------------------------------------------------------+ | Set up TestFactory | \`\`tf = cocotb.regression.TestFactory(coro)\`\` | +------------------------+-----------------------------------------------------------------+ | Add test option | \`\`tf.add\_option("arg", \["val0", "val1"\])\`\` | +------------------------+-----------------------------------------------------------------+ | Generate tests | \`\`tf.generate\_tests()\`\` | +----------------------+-+-----------------------------------------------------------------+ | Parametrize test | | \`\`@cocotb.parametrize(arg1=\[1, 2\], arg2=\["yes", "no"\])\`\` | | | | \`\`@cocotb.parametrize(("arg1", "arg2"), \[(1, "a"), (3, "b")\])\`\` | +----------------------+-------------------------------------------------------------------+ --- # Unknown \*\*\*\*\*\*\*\*\*\*\*\* Getting Help \*\*\*\*\*\*\*\*\*\*\*\* Getting in Contact with a Maintainer ==================================== All of the :ref:\`maintainers \` are active on the \`Gitter channel \`\_\_. They prefer inquiries go through direct messages on Gitter, or by mentioning them in the main \`cocotb Gitter channel \`\_\_ using \`\`@{maintainer name}\`\`. Maintainers are unpaid volunteers, so it might take a while for a maintainer to get back to you. Code of Conduct =============== The cocotb development community aims to be welcoming to everyone. The \`FOSSi Foundation Code of Conduct \`\_\_ applies. Please contact any of the maintainers if you feel uncomfortable in the cocotb development community. --- # Unknown \*\*\*\*\*\*\* Roadmap \*\*\*\*\*\*\* cocotb is under development; however there is no "master plan". We depend upon users to contribute new features and improvements while maintainers focus mostly on reviewing PRs, project management, and bugfixes. Releases will occur approximately every 6 months. We use GitHub issues to track our pending tasks. Take a look at the \`open feature list \`\_ to see the work that's lined up, or the \`list of good first issues \`\_ to get your feet wet. If you have a GitHub account you can also \`raise an enhancement request \`\_ to suggest new features. You may be interested in discussions about \`planned deprecations \`\_ or review the \`list of already applied deprecations \`\_. --- # Unknown \*\*\*\*\*\*\*\*\*\*\*\*\*\*\* Troubleshooting \*\*\*\*\*\*\*\*\*\*\*\*\*\*\* Simulation Hangs ================ Did you call an :keyword:\`async def\` function or create a trigger without :keyword:\`await\`\\ ing it? If you want to exit cocotb and the simulator using :kbd:\`Control-C\` (the Unix signal \`\`SIGINT\`\`) but this doesn't work, you can try :kbd:\`Control-\\\\\` (the Unix signal \`\`SIGQUIT\`\`). Increasing Verbosity ==================== If things fail in the :term:\`VPI\`/:term:\`VHPI\`/:term:\`FLI\` area, check your simulator's documentation to see if it has options to increase its verbosity about what may be wrong. You can then set these options on the :command:\`make\` command line as :make:var:\`COMPILE\_ARGS\`, :make:var:\`SIM\_ARGS\` or :make:var:\`EXTRA\_ARGS\` (see :doc:\`building\` for details). If things fail from within Python, or coroutines aren't being called when you expect, the :envvar:\`COCOTB\_SCHEDULER\_DEBUG\` variable can be used to (greatly) increase the verbosity of the scheduler. Building cocotb In Development Mode =================================== By default cocotb binaries installed from PyPi are stripped, i.e. they do not contain debug symbols. Rebuilding cocotb from source can add this information back, making it significantly easier to debug cocotb code. In the following, we'll assume the use of a Linux machine for debugging cocotb, which simplifies the process significantly. First, install all build requirements as listed at :ref:\`install-devel\`. Then execute the following commands to download a development version of cocotb and prepare a shell environment with this a development build of cocotb available: .. code-block:: shell-session $ # Obtain the latest development version of cocotb through git $ git clone https://github.com/cocotb/cocotb.git $ # Build cocotb in debug mode, and enter a bash shell $ cd cocotb $ nox -s dev -- /bin/bash .. \_troubleshooting-attaching-debugger: Attaching a Debugger ==================== .. \_troubleshooting-attaching-debugger-c: C and C++ --------- The most convenient way to debug the cocotb C code and the interaction between cocotb and the simulator is using GDB. This is a two-step process: 1. Run the simulation with :envvar:\`COCOTB\_ATTACH\` set. 2. Use \`\`gdb -p\`\` to attach to the simulator process. Have a look at :ref:\`building\` for various useful variables related to debugging. Example: Debug the test \`\`test\_array\_simple\`\` with Questa, using the VHDL toplevel and the VHPI. 1. Run the simulation and take note of the process identifier (PID) displayed after the simulator starts up. .. code-block:: shell-session $ make -C tests/test\_cases/test\_array\_simple SIM=questa TOPLEVEL\_LANG=vhdl VHDL\_GPI\_INTERFACE=vhpi COCOTB\_ATTACH=300 COCOTB\_LOG\_LEVEL=trace ... # -.--ns ERROR gpi ..mbed/gpi\_embed.cpp:154 in \_embed\_init\_python Waiting for 300 seconds - attach to PID 9583 with your debugger 2. Open a new terminal window or tab, and attach GDB to the running process. .. code-block:: $ gdb -p 9583 ... 48 r = INTERNAL\_SYSCALL\_CANCEL (clock\_nanosleep\_time64, clock\_id, flags, req, (gdb) # Set breakpoints or do anything else you'd like to do. Finally, let the simulation run: (gdb) continue Continuing. \[Inferior 1 (process 9583) exited normally\] (gdb) quit .. \_troubleshooting-attaching-debugger-python: Python ------ When executing the Makefile to run a cocotb test, a Python shell interpreter is called from within the :term:\`VPI\`/:term:\`VHPI\`/:term:\`FLI\` library. Hence it is not possible to directly attach a Python debugger to the Python process being part of the simulator that uses the aforementioned library. Using \`\`import pdb; pdb.set\_trace()\`\` directly is also frequently not possible, due to the way that simulators interfere with \`\`stdin\`\`. To successfully debug your Python code use the \`remote\_pdb\`\_ Python package to create a :command:\`pdb\` instance accessible via a TCP socket: .. \_remote\_pdb: https://pypi.org/project/remote-pdb/ 1. In your code insert the line: .. code:: python from remote\_pdb import RemotePdb; rpdb = RemotePdb("127.0.0.1", 4000) 2. Then before the line of code you want the debugger to stop the execution, add a breakpoint: .. code:: python rpdb.set\_trace() # <-- debugger stops execution after this line 3. Run the Makefile so that the interpreter hits the breakpoint line and \*hangs\*. 4. Connect to the freshly created socket, for instance through :command:\`telnet\`: .. code:: shell telnet 127.0.0.1 4000 Embedding an IPython shell ========================== .. module:: cocotb\_tools.ipython\_support :synopsis: Support for embedding an IPython shell. .. versionadded:: 1.4 A prebuilt test is included to easily launch an IPython shell in an existing design. .. autofunction:: run\_ipython To embed a shell within an existing test, where it can inspect local variables, the :func:\`embed\` function can be used. .. autofunction:: embed .. \_troubleshooting-make-vars: Setting make variables on the command line ========================================== When trying to set one of the make variables listed in :ref:\`building\` from the command line, it is strongly recommended to use an environment variable, i.e. \`\`EXTRA\_ARGS="..." make\`\` (for the \`\`fish\`\` and \`\`csh\`\` shells: \`\`env EXTRA\_ARGS="..." make\`\`) and \*not\* \`\`make EXTRA\_ARGS=...\`\`. This is because in the case of the discouraged \`\`make EXTRA\_ARGS=...\`\`, if one of the involved Makefiles contains lines to assign (\`\`=\`\`) or append (\`\`+=\`\`) to :make:var:\`EXTRA\_ARGS\` internally, such lines will be ignored. These lines are needed for the operation of cocotb however, and having them ignored is likely to lead to strange errors. As a side note, when you need to \*clear\* a Makefile variable from the command line, use the syntax \`\`make EXTRA\_ARGS=\`\`. \`\`GLIBCXX\_3.4.XX\`\` not found ============================ This error can occur on Linux, and will raise \`\`ImportError: /some/libstdc++.so.6: version \`GLIBCXX\_3.4.XX' not found\`\`. This occurs because an older non-C++11 version of \`\`libstdc++\`\` is being loaded by the simulator or cocotb. It is usually an issue with your environment, but sometimes can occur when using a very old version of certain simulators. Check your environment ---------------------- To see if your environment is the issue, look at the value of the :envvar:\`LD\_LIBRARY\_PATH\` environment variable. Ensure the first path in the colon-delimited list is the path to the \`\`libstdc++\`\` that shipped with the compiler you used to build cocotb. .. code:: shell echo $LD\_LIBRARY\_PATH This variable might be empty, in which case the loader looks in the system's libraries. If the library you built cocotb with is not first, prepend that path to the list. .. code:: shell export LD\_LIBRARY\_PATH=/path/to/newer/libraries/:$LD\_LIBRARY\_PATH Check your simulator -------------------- Sometimes, simulators modify the :envvar:\`LD\_LIBRARY\_PATH\` so they point to the libraries that are shipped with instead of the system libraries. If you are running an old simulator, the packaged libraries may include a pre-C++11 \`\`libstdc++\`\`. To see if your simulator is modifying the :envvar:\`LD\_LIBRARY\_PATH\`, open the simulator up to an internal console and obtain the environment variable. For example, with Mentor Questa and Cadence Xcelium, one could open a Tcl console and run the :command:\`env\` command to list the current environment. The :envvar:\`LD\_LIBRARY\_PATH\` should appear in the list. If the simulator does modify the :envvar:\`LD\_LIBRARY\_PATH\`, refer to the simulator documentation on how to prevent or work around this issue. For example, Questa ships with GCC. Sometimes that version of GCC is old enough to not support C++11 (<4.8). When you install cocotb, :command:\`pip\` uses the system (or some other) compiler that supports C++11. But when you try to run cocotb with the older Questa, it prepends the older libraries Questa ships with to :envvar:\`LD\_LIBRARY\_PATH\`. This causes the older \`\`libstdc++\`\` Questa ships with to be loaded, resulting in the error message. For Questa, you can use the \`\`-noautoldlibpath\`\` option to turn off the :envvar:\`LD\_LIBRARY\_PATH\` prepend to resolve this issue. Using cocotb with more than one Python installation =================================================== Users of cocotb with more than one installation of a single Python version (including \`\`conda env\`\` users) must take care not to reuse cached versions of the installed cocotb package. If this isn't done, running simulations fails with errors like \`\`libpython3.7m.so.1.0: cannot open shared object file: No such file or directory\`\`. Cocotb builds binary libraries during its installation process. These libraries are tailored to the installation of Python used when installing cocotb. When switching between Python installations, cocotb needs to be re-installed without using cached build artifacts, e.g. with \`\`pip install --no-cache-dir cocotb\`\`. On Linux distributions, setting \`\`LD\_DEBUG=libs\`\` (example: \`\`LD\_DEBUG=libs make SIM=verilator\`\`) prints detailed output about which libraries are loaded from where. On Mac OS, you can use \`\`DYLD\_PRINT\_LIBRARIES=1\`\` instead of \`\`LD\_DEBUG=libs\`\` to get similar information. On Windows, use \`Process Explorer \`\_. Further details are available in :issue:\`1943\`. --- # Unknown \*\*\*\*\*\*\*\*\*\*\*\* Contributors \*\*\*\*\*\*\*\*\*\*\*\* .. spelling:word-list:: McGregor Grimwood FOSSi Solarflare cocotb is developed and maintained by an active community. Our GitHub repository contains a list of the \`contributors \`\_. Since mid-2018 cocotb is an independent project under the umbrella of the \`FOSSi Foundation \`\_. The FOSSi Foundation provides the cocotb project with financial, legal and administrative support, and holds cocotb assets. .. \_maintainers: Maintainers =========== Cocotb uses a shared maintainer model. Most maintainers are experts in part of the cocotb codebase, and are primarily responsible for reviews in this area. - Kaleb Barrett (@ktbarrett) - Tomasz Hemperek (@themperek) - Marlon James (@marlonjames) - Colin Marquardt (@cmarqu) - Philipp Wagner (@imphil) - Eric Wieser (@eric-wieser) cocotb was originally developed by Stuart Hodgson and Chris Higgs of Potential Ventures with the support of Solarflare Communications Ltd. and contributions from Gordon McGregor and Finn Grimwood. --- # Struct t_vpi_value — cocotb 1.4.0 documentation * [](https://docs.cocotb.org/en/v1.4.0/index.html) » * [C Code Library Reference](https://docs.cocotb.org/en/v1.4.0/library_reference_c.html) » * [Struct list](https://docs.cocotb.org/en/v1.4.0/generated/structlist.html) » * Struct t\_vpi\_value * [Edit on GitHub](https://github.com/cocotb/cocotb/blob/v1.4.0/documentation/source/generated/struct/structt__vpi__value.rst) * * * Struct t\_vpi\_value[¶](https://docs.cocotb.org/en/v1.4.0/generated/struct/structt__vpi__value.html#struct-t-vpi-value "Permalink to this headline") ===================================================================================================================================================== _struct_ `t_vpi_value` --- # Struct t_vpi_strengthval — cocotb 1.4.0 documentation * [](https://docs.cocotb.org/en/v1.4.0/index.html) » * [C Code Library Reference](https://docs.cocotb.org/en/v1.4.0/library_reference_c.html) » * [Struct list](https://docs.cocotb.org/en/v1.4.0/generated/structlist.html) » * Struct t\_vpi\_strengthval * [Edit on GitHub](https://github.com/cocotb/cocotb/blob/v1.4.0/documentation/source/generated/struct/structt__vpi__strengthval.rst) * * * Struct t\_vpi\_strengthval[¶](https://docs.cocotb.org/en/v1.4.0/generated/struct/structt__vpi__strengthval.html#struct-t-vpi-strengthval "Permalink to this headline") ======================================================================================================================================================================= _struct_ `t_vpi_strengthval` --- # Struct t_vpi_systf_data — cocotb 1.4.0 documentation * [](https://docs.cocotb.org/en/v1.4.0/index.html) » * [C Code Library Reference](https://docs.cocotb.org/en/v1.4.0/library_reference_c.html) » * [Struct list](https://docs.cocotb.org/en/v1.4.0/generated/structlist.html) » * Struct t\_vpi\_systf\_data * [Edit on GitHub](https://github.com/cocotb/cocotb/blob/v1.4.0/documentation/source/generated/struct/structt__vpi__systf__data.rst) * * * Struct t\_vpi\_systf\_data[¶](https://docs.cocotb.org/en/v1.4.0/generated/struct/structt__vpi__systf__data.html#struct-t-vpi-systf-data "Permalink to this headline") ====================================================================================================================================================================== _struct_ `t_vpi_systf_data` --- # Struct t_vpi_time — cocotb 1.4.0 documentation * [](https://docs.cocotb.org/en/v1.4.0/index.html) » * [C Code Library Reference](https://docs.cocotb.org/en/v1.4.0/library_reference_c.html) » * [Struct list](https://docs.cocotb.org/en/v1.4.0/generated/structlist.html) » * Struct t\_vpi\_time * [Edit on GitHub](https://github.com/cocotb/cocotb/blob/v1.4.0/documentation/source/generated/struct/structt__vpi__time.rst) * * * Struct t\_vpi\_time[¶](https://docs.cocotb.org/en/v1.4.0/generated/struct/structt__vpi__time.html#struct-t-vpi-time "Permalink to this headline") ================================================================================================================================================== _struct_ `t_vpi_time` --- # File vpi_user.h — cocotb 1.4.0 documentation * [](https://docs.cocotb.org/en/v1.4.0/index.html) » * [C Code Library Reference](https://docs.cocotb.org/en/v1.4.0/library_reference_c.html) » * [File list](https://docs.cocotb.org/en/v1.4.0/generated/filelist.html) » * File vpi\_user.h * [Edit on GitHub](https://github.com/cocotb/cocotb/blob/v1.4.0/documentation/source/generated/file/vpi__user_8h.rst) * * * File vpi\_user.h[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vpi__user_8h.html#file-vpi-user-h "Permalink to this headline") ===================================================================================================================================== Defines `SVPI_TYPES`[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vpi__user_8h.html#c.SVPI_TYPES "Permalink to this definition") `PLI_TYPES` `PLI_DLLISPEC` `PLI_DLLESPEC` `PLI_EXTERN` `PLI_VEXTERN` extern `PLI_PROTOTYPES` `PROTO_PARAMS`(_params_) params[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vpi__user_8h.html#c.PROTO_PARAMS "Permalink to this definition") `XXTERN` PLI\_EXTERN PLI\_DLLISPEC `EETERN` PLI\_EXTERN PLI\_DLLESPEC `vpiAlways` 1 /\* always construct \*/[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vpi__user_8h.html#c.vpiAlways "Permalink to this definition") `vpiAssignStmt` 2 /\* quasi-continuous assignment \*/[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vpi__user_8h.html#c.vpiAssignStmt "Permalink to this definition") `vpiAssignment` 3 /\* procedural assignment \*/[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vpi__user_8h.html#c.vpiAssignment "Permalink to this definition") `vpiBegin` 4 /\* block statement \*/[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vpi__user_8h.html#c.vpiBegin "Permalink to this definition") `vpiCase` 5 /\* case statement \*/[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vpi__user_8h.html#c.vpiCase "Permalink to this definition") `vpiCaseItem` 6 /\* case statement item \*/[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vpi__user_8h.html#c.vpiCaseItem "Permalink to this definition") `vpiConstant` 7 /\* numerical constant or literal string \*/[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vpi__user_8h.html#c.vpiConstant "Permalink to this definition") `vpiContAssign` 8 /\* continuous assignment \*/[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vpi__user_8h.html#c.vpiContAssign "Permalink to this definition") `vpiDeassign` 9 /\* deassignment statement \*/[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vpi__user_8h.html#c.vpiDeassign "Permalink to this definition") `vpiDefParam` 10 /\* defparam \*/[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vpi__user_8h.html#c.vpiDefParam "Permalink to this definition") `vpiDelayControl` 11 /\* delay statement (e.g. #10) \*/[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vpi__user_8h.html#c.vpiDelayControl "Permalink to this definition") `vpiDisable` 12 /\* named block disable statement \*/[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vpi__user_8h.html#c.vpiDisable "Permalink to this definition") `vpiEventControl` 13 /\* wait on event, e.g. @e \*/[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vpi__user_8h.html#c.vpiEventControl "Permalink to this definition") `vpiEventStmt` 14 /\* event trigger, e.g. ->e \*/[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vpi__user_8h.html#c.vpiEventStmt "Permalink to this definition") `vpiFor` 15 /\* for statement \*/[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vpi__user_8h.html#c.vpiFor "Permalink to this definition") `vpiForce` 16 /\* force statement \*/[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vpi__user_8h.html#c.vpiForce "Permalink to this definition") `vpiForever` 17 /\* forever statement \*/[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vpi__user_8h.html#c.vpiForever "Permalink to this definition") `vpiFork` 18 /\* fork-join block \*/[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vpi__user_8h.html#c.vpiFork "Permalink to this definition") `vpiFuncCall` 19 /\* HDL function call \*/[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vpi__user_8h.html#c.vpiFuncCall "Permalink to this definition") `vpiFunction` 20 /\* HDL function \*/[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vpi__user_8h.html#c.vpiFunction "Permalink to this definition") `vpiGate` 21 /\* primitive gate \*/[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vpi__user_8h.html#c.vpiGate "Permalink to this definition") `vpiIf` 22 /\* if statement \*/[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vpi__user_8h.html#c.vpiIf "Permalink to this definition") `vpiIfElse` 23 /\* if-else statement \*/[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vpi__user_8h.html#c.vpiIfElse "Permalink to this definition") `vpiInitial` 24 /\* initial construct \*/[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vpi__user_8h.html#c.vpiInitial "Permalink to this definition") `vpiIntegerVar` 25 /\* integer variable \*/[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vpi__user_8h.html#c.vpiIntegerVar "Permalink to this definition") `vpiInterModPath` 26 /\* intermodule wire delay \*/[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vpi__user_8h.html#c.vpiInterModPath "Permalink to this definition") `vpiIterator` 27 /\* iterator \*/[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vpi__user_8h.html#c.vpiIterator "Permalink to this definition") `vpiIODecl` 28 /\* input/output declaration \*/[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vpi__user_8h.html#c.vpiIODecl "Permalink to this definition") `vpiMemory` 29 /\* behavioral memory \*/[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vpi__user_8h.html#c.vpiMemory "Permalink to this definition") `vpiMemoryWord` 30 /\* single word of memory \*/[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vpi__user_8h.html#c.vpiMemoryWord "Permalink to this definition") `vpiModPath` 31 /\* module path for path delays \*/[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vpi__user_8h.html#c.vpiModPath "Permalink to this definition") `vpiModule` 32 /\* module instance \*/[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vpi__user_8h.html#c.vpiModule "Permalink to this definition") `vpiNamedBegin` 33 /\* named block statement \*/[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vpi__user_8h.html#c.vpiNamedBegin "Permalink to this definition") `vpiNamedEvent` 34 /\* event variable \*/[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vpi__user_8h.html#c.vpiNamedEvent "Permalink to this definition") `vpiNamedFork` 35 /\* named fork-join block \*/[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vpi__user_8h.html#c.vpiNamedFork "Permalink to this definition") `vpiNet` 36 /\* scalar or vector net \*/[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vpi__user_8h.html#c.vpiNet "Permalink to this definition") `vpiNetBit` 37 /\* bit of vector net \*/[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vpi__user_8h.html#c.vpiNetBit "Permalink to this definition") `vpiNullStmt` 38 /\* a semicolon. Ie. #10 ; \*/[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vpi__user_8h.html#c.vpiNullStmt "Permalink to this definition") `vpiOperation` 39 /\* behavioral operation \*/[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vpi__user_8h.html#c.vpiOperation "Permalink to this definition") `vpiParamAssign` 40 /\* module parameter assignment \*/[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vpi__user_8h.html#c.vpiParamAssign "Permalink to this definition") `vpiParameter` 41 /\* module parameter \*/[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vpi__user_8h.html#c.vpiParameter "Permalink to this definition") `vpiPartSelect` 42 /\* part-select \*/[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vpi__user_8h.html#c.vpiPartSelect "Permalink to this definition") `vpiPathTerm` 43 /\* terminal of module path \*/[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vpi__user_8h.html#c.vpiPathTerm "Permalink to this definition") `vpiPort` 44 /\* module port \*/[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vpi__user_8h.html#c.vpiPort "Permalink to this definition") `vpiPortBit` 45 /\* bit of vector module port \*/[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vpi__user_8h.html#c.vpiPortBit "Permalink to this definition") `vpiPrimTerm` 46 /\* primitive terminal \*/[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vpi__user_8h.html#c.vpiPrimTerm "Permalink to this definition") `vpiRealVar` 47 /\* real variable \*/[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vpi__user_8h.html#c.vpiRealVar "Permalink to this definition") `vpiReg` 48 /\* scalar or vector reg \*/[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vpi__user_8h.html#c.vpiReg "Permalink to this definition") `vpiRegBit` 49 /\* bit of vector reg \*/[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vpi__user_8h.html#c.vpiRegBit "Permalink to this definition") `vpiRelease` 50 /\* release statement \*/[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vpi__user_8h.html#c.vpiRelease "Permalink to this definition") `vpiRepeat` 51 /\* repeat statement \*/[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vpi__user_8h.html#c.vpiRepeat "Permalink to this definition") `vpiRepeatControl` 52 /\* repeat control in an assign stmt \*/[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vpi__user_8h.html#c.vpiRepeatControl "Permalink to this definition") `vpiSchedEvent` 53 /\* vpi\_put\_value() event \*/[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vpi__user_8h.html#c.vpiSchedEvent "Permalink to this definition") `vpiSpecParam` 54 /\* specparam \*/[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vpi__user_8h.html#c.vpiSpecParam "Permalink to this definition") `vpiSwitch` 55 /\* transistor switch \*/[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vpi__user_8h.html#c.vpiSwitch "Permalink to this definition") `vpiSysFuncCall` 56 /\* system function call \*/[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vpi__user_8h.html#c.vpiSysFuncCall "Permalink to this definition") `vpiSysTaskCall` 57 /\* system task call \*/[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vpi__user_8h.html#c.vpiSysTaskCall "Permalink to this definition") `vpiTableEntry` 58 /\* UDP state table entry \*/[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vpi__user_8h.html#c.vpiTableEntry "Permalink to this definition") `vpiTask` 59 /\* HDL task \*/[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vpi__user_8h.html#c.vpiTask "Permalink to this definition") `vpiTaskCall` 60 /\* HDL task call \*/[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vpi__user_8h.html#c.vpiTaskCall "Permalink to this definition") `vpiTchk` 61 /\* timing check \*/[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vpi__user_8h.html#c.vpiTchk "Permalink to this definition") `vpiTchkTerm` 62 /\* terminal of timing check \*/[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vpi__user_8h.html#c.vpiTchkTerm "Permalink to this definition") `vpiTimeVar` 63 /\* time variable \*/[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vpi__user_8h.html#c.vpiTimeVar "Permalink to this definition") `vpiTimeQueue` 64 /\* simulation event queue \*/[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vpi__user_8h.html#c.vpiTimeQueue "Permalink to this definition") `vpiUdp` 65 /\* user-defined primitive \*/[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vpi__user_8h.html#c.vpiUdp "Permalink to this definition") `vpiUdpDefn` 66 /\* UDP definition \*/[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vpi__user_8h.html#c.vpiUdpDefn "Permalink to this definition") `vpiUserSystf` 67 /\* user defined system task or function \*/[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vpi__user_8h.html#c.vpiUserSystf "Permalink to this definition") `vpiVarSelect` 68 /\* variable array selection \*/[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vpi__user_8h.html#c.vpiVarSelect "Permalink to this definition") `vpiWait` 69 /\* wait statement \*/[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vpi__user_8h.html#c.vpiWait "Permalink to this definition") `vpiWhile` 70 /\* while statement \*/[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vpi__user_8h.html#c.vpiWhile "Permalink to this definition") `vpiAttribute` 105 /\* attribute of an object \*/[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vpi__user_8h.html#c.vpiAttribute "Permalink to this definition") `vpiBitSelect` 106 /\* Bit-select of parameter, var select \*/[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vpi__user_8h.html#c.vpiBitSelect "Permalink to this definition") `vpiCallback` 107 /\* callback object \*/[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vpi__user_8h.html#c.vpiCallback "Permalink to this definition") `vpiDelayTerm` 108 /\* Delay term which is a load or driver \*/[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vpi__user_8h.html#c.vpiDelayTerm "Permalink to this definition") `vpiDelayDevice` 109 /\* Delay object within a net \*/[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vpi__user_8h.html#c.vpiDelayDevice "Permalink to this definition") `vpiFrame` 110 /\* reentrant task/func frame \*/[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vpi__user_8h.html#c.vpiFrame "Permalink to this definition") `vpiGateArray` 111 /\* gate instance array \*/[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vpi__user_8h.html#c.vpiGateArray "Permalink to this definition") `vpiModuleArray` 112 /\* module instance array \*/[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vpi__user_8h.html#c.vpiModuleArray "Permalink to this definition") `vpiPrimitiveArray` 113 /\* vpiprimitiveArray type \*/[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vpi__user_8h.html#c.vpiPrimitiveArray "Permalink to this definition") `vpiNetArray` 114 /\* multidimensional net \*/[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vpi__user_8h.html#c.vpiNetArray "Permalink to this definition") `vpiRange` 115 /\* range declaration \*/[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vpi__user_8h.html#c.vpiRange "Permalink to this definition") `vpiRegArray` 116 /\* multidimensional reg \*/[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vpi__user_8h.html#c.vpiRegArray "Permalink to this definition") `vpiSwitchArray` 117 /\* switch instance array \*/[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vpi__user_8h.html#c.vpiSwitchArray "Permalink to this definition") `vpiUdpArray` 118 /\* UDP instance array \*/[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vpi__user_8h.html#c.vpiUdpArray "Permalink to this definition") `vpiContAssignBit` 128 /\* Bit of a vector continuous assignment \*/[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vpi__user_8h.html#c.vpiContAssignBit "Permalink to this definition") `vpiNamedEventArray` 129 /\* multidimensional named event \*/[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vpi__user_8h.html#c.vpiNamedEventArray "Permalink to this definition") `vpiIndexedPartSelect` 130 /\* Indexed part-select object \*/[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vpi__user_8h.html#c.vpiIndexedPartSelect "Permalink to this definition") `vpiGenScopeArray` 133 /\* array of generated scopes \*/[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vpi__user_8h.html#c.vpiGenScopeArray "Permalink to this definition") `vpiGenScope` 134 /\* A generated scope \*/[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vpi__user_8h.html#c.vpiGenScope "Permalink to this definition") `vpiGenVar` 135 /\* Object used to instantiate gen scopes \*/[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vpi__user_8h.html#c.vpiGenVar "Permalink to this definition") `vpiCondition` 71 /\* condition expression \*/[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vpi__user_8h.html#c.vpiCondition "Permalink to this definition") `vpiDelay` 72 /\* net or gate delay \*/[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vpi__user_8h.html#c.vpiDelay "Permalink to this definition") `vpiElseStmt` 73 /\* else statement \*/[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vpi__user_8h.html#c.vpiElseStmt "Permalink to this definition") `vpiForIncStmt` 74 /\* increment statement in for loop \*/[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vpi__user_8h.html#c.vpiForIncStmt "Permalink to this definition") `vpiForInitStmt` 75 /\* initialization statement in for loop \*/[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vpi__user_8h.html#c.vpiForInitStmt "Permalink to this definition") `vpiHighConn` 76 /\* higher connection to port \*/[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vpi__user_8h.html#c.vpiHighConn "Permalink to this definition") `vpiLhs` 77 /\* left-hand side of assignment \*/[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vpi__user_8h.html#c.vpiLhs "Permalink to this definition") `vpiIndex` 78 /\* index of var select, bit-select, etc. \*/[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vpi__user_8h.html#c.vpiIndex "Permalink to this definition") `vpiLeftRange` 79 /\* left range of vector or part-select \*/[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vpi__user_8h.html#c.vpiLeftRange "Permalink to this definition") `vpiLowConn` 80 /\* lower connection to port \*/[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vpi__user_8h.html#c.vpiLowConn "Permalink to this definition") `vpiParent` 81 /\* parent object \*/[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vpi__user_8h.html#c.vpiParent "Permalink to this definition") `vpiRhs` 82 /\* right-hand side of assignment \*/[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vpi__user_8h.html#c.vpiRhs "Permalink to this definition") `vpiRightRange` 83 /\* right range of vector or part-select \*/[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vpi__user_8h.html#c.vpiRightRange "Permalink to this definition") `vpiScope` 84 /\* containing scope object \*/[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vpi__user_8h.html#c.vpiScope "Permalink to this definition") `vpiSysTfCall` 85 /\* task function call \*/[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vpi__user_8h.html#c.vpiSysTfCall "Permalink to this definition") `vpiTchkDataTerm` 86 /\* timing check data term \*/[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vpi__user_8h.html#c.vpiTchkDataTerm "Permalink to this definition") `vpiTchkNotifier` 87 /\* timing check notifier \*/[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vpi__user_8h.html#c.vpiTchkNotifier "Permalink to this definition") `vpiTchkRefTerm` 88 /\* timing check reference term \*/[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vpi__user_8h.html#c.vpiTchkRefTerm "Permalink to this definition") `vpiArgument` 89 /\* argument to (system) task/function \*/[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vpi__user_8h.html#c.vpiArgument "Permalink to this definition") `vpiBit` 90 /\* bit of vector net or port \*/[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vpi__user_8h.html#c.vpiBit "Permalink to this definition") `vpiDriver` 91 /\* driver for a net \*/[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vpi__user_8h.html#c.vpiDriver "Permalink to this definition") `vpiInternalScope` 92 /\* internal scope in module \*/[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vpi__user_8h.html#c.vpiInternalScope "Permalink to this definition") `vpiLoad` 93 /\* load on net or reg \*/[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vpi__user_8h.html#c.vpiLoad "Permalink to this definition") `vpiModDataPathIn` 94 /\* data terminal of a module path \*/[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vpi__user_8h.html#c.vpiModDataPathIn "Permalink to this definition") `vpiModPathIn` 95 /\* Input terminal of a module path \*/[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vpi__user_8h.html#c.vpiModPathIn "Permalink to this definition") `vpiModPathOut` 96 /\* output terminal of a module path \*/[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vpi__user_8h.html#c.vpiModPathOut "Permalink to this definition") `vpiOperand` 97 /\* operand of expression \*/[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vpi__user_8h.html#c.vpiOperand "Permalink to this definition") `vpiPortInst` 98 /\* connected port instance \*/[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vpi__user_8h.html#c.vpiPortInst "Permalink to this definition") `vpiProcess` 99 /\* process in module \*/[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vpi__user_8h.html#c.vpiProcess "Permalink to this definition") `vpiVariables` 100 /\* variables in module \*/[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vpi__user_8h.html#c.vpiVariables "Permalink to this definition") `vpiUse` 101 /\* usage \*/[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vpi__user_8h.html#c.vpiUse "Permalink to this definition") `vpiExpr` 102 /\* connected expression \*/[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vpi__user_8h.html#c.vpiExpr "Permalink to this definition") `vpiPrimitive` 103 /\* primitive (gate, switch, UDP) \*/[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vpi__user_8h.html#c.vpiPrimitive "Permalink to this definition") `vpiStmt` 104 /\* statement in process or task \*/[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vpi__user_8h.html#c.vpiStmt "Permalink to this definition") `vpiActiveTimeFormat` 119 /\* active $timeformat() system task \*/[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vpi__user_8h.html#c.vpiActiveTimeFormat "Permalink to this definition") `vpiInTerm` 120 /\* To get to a delay device's drivers. \*/[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vpi__user_8h.html#c.vpiInTerm "Permalink to this definition") `vpiInstanceArray` 121 /\* vpiInstance arrays \*/[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vpi__user_8h.html#c.vpiInstanceArray "Permalink to this definition") `vpiLocalDriver` 122 /\* local drivers (within a module \*/[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vpi__user_8h.html#c.vpiLocalDriver "Permalink to this definition") `vpiLocalLoad` 123 /\* local loads (within a module \*/[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vpi__user_8h.html#c.vpiLocalLoad "Permalink to this definition") `vpiOutTerm` 124 /\* To get to a delay device's loads. \*/[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vpi__user_8h.html#c.vpiOutTerm "Permalink to this definition") `vpiPorts` 125 /\* Module port \*/[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vpi__user_8h.html#c.vpiPorts "Permalink to this definition") `vpiSimNet` 126 /\* simulated net after collapsing \*/[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vpi__user_8h.html#c.vpiSimNet "Permalink to this definition") `vpiTaskFunc` 127 /\* HDL task or function \*/[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vpi__user_8h.html#c.vpiTaskFunc "Permalink to this definition") `vpiBaseExpr` 131 /\* Indexed part-select's base expression \*/[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vpi__user_8h.html#c.vpiBaseExpr "Permalink to this definition") `vpiWidthExpr` 132 /\* Indexed part-select's width expression \*/[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vpi__user_8h.html#c.vpiWidthExpr "Permalink to this definition") `vpiAutomatics` 136 /\* Automatic variables of a frame \*/[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vpi__user_8h.html#c.vpiAutomatics "Permalink to this definition") `vpiUndefined` -1 /\* undefined property \*/[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vpi__user_8h.html#c.vpiUndefined "Permalink to this definition") `vpiType` 1 /\* type of object \*/[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vpi__user_8h.html#c.vpiType "Permalink to this definition") `vpiName` 2 /\* local name of object \*/[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vpi__user_8h.html#c.vpiName "Permalink to this definition") `vpiFullName` 3 /\* full hierarchical name \*/[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vpi__user_8h.html#c.vpiFullName "Permalink to this definition") `vpiSize` 4 /\* size of gate, net, port, etc. \*/[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vpi__user_8h.html#c.vpiSize "Permalink to this definition") `vpiFile` 5 /\* File name in which the object is used\*/[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vpi__user_8h.html#c.vpiFile "Permalink to this definition") `vpiLineNo` 6 /\* line number where the object is used \*/[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vpi__user_8h.html#c.vpiLineNo "Permalink to this definition") `vpiTopModule` 7 /\* top-level module (boolean) \*/[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vpi__user_8h.html#c.vpiTopModule "Permalink to this definition") `vpiCellInstance` 8 /\* cell (boolean) \*/[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vpi__user_8h.html#c.vpiCellInstance "Permalink to this definition") `vpiDefName` 9 /\* module definition name \*/[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vpi__user_8h.html#c.vpiDefName "Permalink to this definition") `vpiProtected` 10 /\* source protected module (boolean) \*/[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vpi__user_8h.html#c.vpiProtected "Permalink to this definition") `vpiTimeUnit` 11 /\* module time unit \*/[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vpi__user_8h.html#c.vpiTimeUnit "Permalink to this definition") `vpiTimePrecision` 12 /\* module time precision \*/[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vpi__user_8h.html#c.vpiTimePrecision "Permalink to this definition") `vpiDefNetType` 13 /\* default net type \*/[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vpi__user_8h.html#c.vpiDefNetType "Permalink to this definition") `vpiUnconnDrive` 14 /\* unconnected port drive strength \*/[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vpi__user_8h.html#c.vpiUnconnDrive "Permalink to this definition") `vpiHighZ` 1 /\* No default drive given \*/[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vpi__user_8h.html#c.vpiHighZ "Permalink to this definition") `vpiPull1` 2 /\* default pull1 drive \*/[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vpi__user_8h.html#c.vpiPull1 "Permalink to this definition") `vpiPull0` 3 /\* default pull0 drive \*/[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vpi__user_8h.html#c.vpiPull0 "Permalink to this definition") `vpiDefFile` 15 /\* File name where the module is defined\*/[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vpi__user_8h.html#c.vpiDefFile "Permalink to this definition") `vpiDefLineNo` 16 /\* line number for module definition \*/[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vpi__user_8h.html#c.vpiDefLineNo "Permalink to this definition") `vpiDefDelayMode` 47 /\* Default delay mode for a module \*/[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vpi__user_8h.html#c.vpiDefDelayMode "Permalink to this definition") `vpiDelayModeNone` 1 /\* no delay mode specified \*/[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vpi__user_8h.html#c.vpiDelayModeNone "Permalink to this definition") `vpiDelayModePath` 2 /\* path delay mode \*/[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vpi__user_8h.html#c.vpiDelayModePath "Permalink to this definition") `vpiDelayModeDistrib` 3 /\* distributed delay mode \*/[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vpi__user_8h.html#c.vpiDelayModeDistrib "Permalink to this definition") `vpiDelayModeUnit` 4 /\* unit delay mode \*/[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vpi__user_8h.html#c.vpiDelayModeUnit "Permalink to this definition") `vpiDelayModeZero` 5 /\* zero delay mode \*/[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vpi__user_8h.html#c.vpiDelayModeZero "Permalink to this definition") `vpiDelayModeMTM` 6 /\* min:typ:max delay mode \*/[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vpi__user_8h.html#c.vpiDelayModeMTM "Permalink to this definition") `vpiDefDecayTime` 48 /\* Default decay time for a module \*/[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vpi__user_8h.html#c.vpiDefDecayTime "Permalink to this definition") `vpiScalar` 17 /\* scalar (boolean) \*/[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vpi__user_8h.html#c.vpiScalar "Permalink to this definition") `vpiVector` 18 /\* vector (boolean) \*/[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vpi__user_8h.html#c.vpiVector "Permalink to this definition") `vpiExplicitName` 19 /\* port is explicitly named \*/[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vpi__user_8h.html#c.vpiExplicitName "Permalink to this definition") `vpiDirection` 20 /\* direction of port: \*/[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vpi__user_8h.html#c.vpiDirection "Permalink to this definition") `vpiInput` 1 /\* input \*/[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vpi__user_8h.html#c.vpiInput "Permalink to this definition") `vpiOutput` 2 /\* output \*/[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vpi__user_8h.html#c.vpiOutput "Permalink to this definition") `vpiInout` 3 /\* inout \*/[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vpi__user_8h.html#c.vpiInout "Permalink to this definition") `vpiMixedIO` 4 /\* mixed input-output \*/[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vpi__user_8h.html#c.vpiMixedIO "Permalink to this definition") `vpiNoDirection` 5 /\* no direction \*/[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vpi__user_8h.html#c.vpiNoDirection "Permalink to this definition") `vpiConnByName` 21 /\* connected by name (boolean) \*/[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vpi__user_8h.html#c.vpiConnByName "Permalink to this definition") `vpiNetType` 22 /\* net subtypes: \*/[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vpi__user_8h.html#c.vpiNetType "Permalink to this definition") `vpiWire` 1 /\* wire net \*/[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vpi__user_8h.html#c.vpiWire "Permalink to this definition") `vpiWand` 2 /\* wire-and net \*/[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vpi__user_8h.html#c.vpiWand "Permalink to this definition") `vpiWor` 3 /\* wire-or net \*/[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vpi__user_8h.html#c.vpiWor "Permalink to this definition") `vpiTri` 4 /\* three-state net \*/[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vpi__user_8h.html#c.vpiTri "Permalink to this definition") `vpiTri0` 5 /\* pull-down net \*/[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vpi__user_8h.html#c.vpiTri0 "Permalink to this definition") `vpiTri1` 6 /\* pull-up net \*/[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vpi__user_8h.html#c.vpiTri1 "Permalink to this definition") `vpiTriReg` 7 /\* tri state reg net \*/[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vpi__user_8h.html#c.vpiTriReg "Permalink to this definition") `vpiTriAnd` 8 /\* three-state wire-and net \*/[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vpi__user_8h.html#c.vpiTriAnd "Permalink to this definition") `vpiTriOr` 9 /\* three-state wire-or net \*/[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vpi__user_8h.html#c.vpiTriOr "Permalink to this definition") `vpiSupply1` 10 /\* supply 1 net \*/[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vpi__user_8h.html#c.vpiSupply1 "Permalink to this definition") `vpiSupply0` 11 /\* supply zero net \*/[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vpi__user_8h.html#c.vpiSupply0 "Permalink to this definition") `vpiNone` 12 /\* no default net type (1364-2001) \*/[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vpi__user_8h.html#c.vpiNone "Permalink to this definition") `vpiUwire` 13 /\* unresolved wire net (1364-2005) \*/[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vpi__user_8h.html#c.vpiUwire "Permalink to this definition") `vpiExplicitScalared` 23 /\* explicitly scalared (boolean) \*/[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vpi__user_8h.html#c.vpiExplicitScalared "Permalink to this definition") `vpiExplicitVectored` 24 /\* explicitly vectored (boolean) \*/[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vpi__user_8h.html#c.vpiExplicitVectored "Permalink to this definition") `vpiExpanded` 25 /\* expanded vector net (boolean) \*/[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vpi__user_8h.html#c.vpiExpanded "Permalink to this definition") `vpiImplicitDecl` 26 /\* implicitly declared net (boolean) \*/[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vpi__user_8h.html#c.vpiImplicitDecl "Permalink to this definition") `vpiChargeStrength` 27 /\* charge decay strength of net \*/[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vpi__user_8h.html#c.vpiChargeStrength "Permalink to this definition") `vpiArray` 28 /\* variable array (boolean) \*/[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vpi__user_8h.html#c.vpiArray "Permalink to this definition") `vpiPortIndex` 29 /\* Port index \*/[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vpi__user_8h.html#c.vpiPortIndex "Permalink to this definition") `vpiTermIndex` 30 /\* Index of a primitive terminal \*/[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vpi__user_8h.html#c.vpiTermIndex "Permalink to this definition") `vpiStrength0` 31 /\* 0-strength of net or gate \*/[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vpi__user_8h.html#c.vpiStrength0 "Permalink to this definition") `vpiStrength1` 32 /\* 1-strength of net or gate \*/[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vpi__user_8h.html#c.vpiStrength1 "Permalink to this definition") `vpiPrimType` 33 /\* prmitive subtypes: \*/[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vpi__user_8h.html#c.vpiPrimType "Permalink to this definition") `vpiAndPrim` 1 /\* and gate \*/[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vpi__user_8h.html#c.vpiAndPrim "Permalink to this definition") `vpiNandPrim` 2 /\* nand gate \*/[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vpi__user_8h.html#c.vpiNandPrim "Permalink to this definition") `vpiNorPrim` 3 /\* nor gate \*/[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vpi__user_8h.html#c.vpiNorPrim "Permalink to this definition") `vpiOrPrim` 4 /\* or gate \*/[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vpi__user_8h.html#c.vpiOrPrim "Permalink to this definition") `vpiXorPrim` 5 /\* xor gate \*/[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vpi__user_8h.html#c.vpiXorPrim "Permalink to this definition") `vpiXnorPrim` 6 /\* xnor gate \*/[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vpi__user_8h.html#c.vpiXnorPrim "Permalink to this definition") `vpiBufPrim` 7 /\* buffer \*/[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vpi__user_8h.html#c.vpiBufPrim "Permalink to this definition") `vpiNotPrim` 8 /\* not gate \*/[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vpi__user_8h.html#c.vpiNotPrim "Permalink to this definition") `vpiBufif0Prim` 9 /\* zero-enabled buffer \*/[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vpi__user_8h.html#c.vpiBufif0Prim "Permalink to this definition") `vpiBufif1Prim` 10 /\* one-enabled buffer \*/[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vpi__user_8h.html#c.vpiBufif1Prim "Permalink to this definition") `vpiNotif0Prim` 11 /\* zero-enabled not gate \*/[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vpi__user_8h.html#c.vpiNotif0Prim "Permalink to this definition") `vpiNotif1Prim` 12 /\* one-enabled not gate \*/[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vpi__user_8h.html#c.vpiNotif1Prim "Permalink to this definition") `vpiNmosPrim` 13 /\* nmos switch \*/[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vpi__user_8h.html#c.vpiNmosPrim "Permalink to this definition") `vpiPmosPrim` 14 /\* pmos switch \*/[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vpi__user_8h.html#c.vpiPmosPrim "Permalink to this definition") `vpiCmosPrim` 15 /\* cmos switch \*/[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vpi__user_8h.html#c.vpiCmosPrim "Permalink to this definition") `vpiRnmosPrim` 16 /\* resistive nmos switch \*/[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vpi__user_8h.html#c.vpiRnmosPrim "Permalink to this definition") `vpiRpmosPrim` 17 /\* resistive pmos switch \*/[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vpi__user_8h.html#c.vpiRpmosPrim "Permalink to this definition") `vpiRcmosPrim` 18 /\* resistive cmos switch \*/[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vpi__user_8h.html#c.vpiRcmosPrim "Permalink to this definition") `vpiRtranPrim` 19 /\* resistive bidirectional \*/[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vpi__user_8h.html#c.vpiRtranPrim "Permalink to this definition") `vpiRtranif0Prim` 20 /\* zero-enable resistive bidirectional \*/[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vpi__user_8h.html#c.vpiRtranif0Prim "Permalink to this definition") `vpiRtranif1Prim` 21 /\* one-enable resistive bidirectional \*/[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vpi__user_8h.html#c.vpiRtranif1Prim "Permalink to this definition") `vpiTranPrim` 22 /\* bidirectional \*/[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vpi__user_8h.html#c.vpiTranPrim "Permalink to this definition") `vpiTranif0Prim` 23 /\* zero-enabled bidirectional \*/[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vpi__user_8h.html#c.vpiTranif0Prim "Permalink to this definition") `vpiTranif1Prim` 24 /\* one-enabled bidirectional \*/[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vpi__user_8h.html#c.vpiTranif1Prim "Permalink to this definition") `vpiPullupPrim` 25 /\* pullup \*/[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vpi__user_8h.html#c.vpiPullupPrim "Permalink to this definition") `vpiPulldownPrim` 26 /\* pulldown \*/[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vpi__user_8h.html#c.vpiPulldownPrim "Permalink to this definition") `vpiSeqPrim` 27 /\* sequential UDP \*/[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vpi__user_8h.html#c.vpiSeqPrim "Permalink to this definition") `vpiCombPrim` 28 /\* combinational UDP \*/[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vpi__user_8h.html#c.vpiCombPrim "Permalink to this definition") `vpiPolarity` 34 /\* polarity of module path... \*/[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vpi__user_8h.html#c.vpiPolarity "Permalink to this definition") `vpiDataPolarity` 35 /\* ...or data path: \*/[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vpi__user_8h.html#c.vpiDataPolarity "Permalink to this definition") `vpiPositive` 1 /\* positive \*/[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vpi__user_8h.html#c.vpiPositive "Permalink to this definition") `vpiNegative` 2 /\* negative \*/[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vpi__user_8h.html#c.vpiNegative "Permalink to this definition") `vpiUnknown` 3 /\* unknown (unspecified) \*/[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vpi__user_8h.html#c.vpiUnknown "Permalink to this definition") `vpiEdge` 36 /\* edge type of module path: \*/[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vpi__user_8h.html#c.vpiEdge "Permalink to this definition") `vpiNoEdge` 0x00 /\* no edge \*/[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vpi__user_8h.html#c.vpiNoEdge "Permalink to this definition") `vpiEdge01` 0x01 /\* 0 -> 1 \*/[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vpi__user_8h.html#c.vpiEdge01 "Permalink to this definition") `vpiEdge10` 0x02 /\* 1 -> 0 \*/[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vpi__user_8h.html#c.vpiEdge10 "Permalink to this definition") `vpiEdge0x` 0x04 /\* 0 -> x \*/[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vpi__user_8h.html#c.vpiEdge0x "Permalink to this definition") `vpiEdgex1` 0x08 /\* x -> 1 \*/[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vpi__user_8h.html#c.vpiEdgex1 "Permalink to this definition") `vpiEdge1x` 0x10 /\* 1 -> x \*/[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vpi__user_8h.html#c.vpiEdge1x "Permalink to this definition") `vpiEdgex0` 0x20 /\* x -> 0 \*/[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vpi__user_8h.html#c.vpiEdgex0 "Permalink to this definition") `vpiPosedge` (vpiEdgex1 | vpiEdge01 | vpiEdge0x)[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vpi__user_8h.html#c.vpiPosedge "Permalink to this definition") `vpiNegedge` (vpiEdgex0 | vpiEdge10 | vpiEdge1x)[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vpi__user_8h.html#c.vpiNegedge "Permalink to this definition") `vpiAnyEdge` (vpiPosedge | vpiNegedge)[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vpi__user_8h.html#c.vpiAnyEdge "Permalink to this definition") `vpiPathType` 37 /\* path delay connection subtypes: \*/[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vpi__user_8h.html#c.vpiPathType "Permalink to this definition") `vpiPathFull` 1 /\* ( a \*> b ) \*/[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vpi__user_8h.html#c.vpiPathFull "Permalink to this definition") `vpiPathParallel` 2 /\* ( a => b ) \*/[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vpi__user_8h.html#c.vpiPathParallel "Permalink to this definition") `vpiTchkType` 38 /\* timing check subtypes: \*/[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vpi__user_8h.html#c.vpiTchkType "Permalink to this definition") `vpiSetup` 1 /\* $setup \*/[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vpi__user_8h.html#c.vpiSetup "Permalink to this definition") `vpiHold` 2 /\* $hold \*/[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vpi__user_8h.html#c.vpiHold "Permalink to this definition") `vpiPeriod` 3 /\* $period \*/[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vpi__user_8h.html#c.vpiPeriod "Permalink to this definition") `vpiWidth` 4 /\* $width \*/[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vpi__user_8h.html#c.vpiWidth "Permalink to this definition") `vpiSkew` 5 /\* $skew \*/[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vpi__user_8h.html#c.vpiSkew "Permalink to this definition") `vpiRecovery` 6 /\* $recovery \*/[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vpi__user_8h.html#c.vpiRecovery "Permalink to this definition") `vpiNoChange` 7 /\* $nochange \*/[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vpi__user_8h.html#c.vpiNoChange "Permalink to this definition") `vpiSetupHold` 8 /\* $setuphold \*/[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vpi__user_8h.html#c.vpiSetupHold "Permalink to this definition") `vpiFullskew` 9 /\* $fullskew -- added for 1364-2001 \*/[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vpi__user_8h.html#c.vpiFullskew "Permalink to this definition") `vpiRecrem` 10 /\* $recrem -- added for 1364-2001 \*/[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vpi__user_8h.html#c.vpiRecrem "Permalink to this definition") `vpiRemoval` 11 /\* $removal -- added for 1364-2001 \*/[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vpi__user_8h.html#c.vpiRemoval "Permalink to this definition") `vpiTimeskew` 12 /\* $timeskew -- added for 1364-2001 \*/[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vpi__user_8h.html#c.vpiTimeskew "Permalink to this definition") `vpiOpType` 39 /\* operation subtypes: \*/[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vpi__user_8h.html#c.vpiOpType "Permalink to this definition") `vpiMinusOp` 1 /\* unary minus \*/[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vpi__user_8h.html#c.vpiMinusOp "Permalink to this definition") `vpiPlusOp` 2 /\* unary plus \*/[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vpi__user_8h.html#c.vpiPlusOp "Permalink to this definition") `vpiNotOp` 3 /\* unary not \*/[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vpi__user_8h.html#c.vpiNotOp "Permalink to this definition") `vpiBitNegOp` 4 /\* bitwise negation \*/[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vpi__user_8h.html#c.vpiBitNegOp "Permalink to this definition") `vpiUnaryAndOp` 5 /\* bitwise reduction and \*/[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vpi__user_8h.html#c.vpiUnaryAndOp "Permalink to this definition") `vpiUnaryNandOp` 6 /\* bitwise reduction nand \*/[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vpi__user_8h.html#c.vpiUnaryNandOp "Permalink to this definition") `vpiUnaryOrOp` 7 /\* bitwise reduction or \*/[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vpi__user_8h.html#c.vpiUnaryOrOp "Permalink to this definition") `vpiUnaryNorOp` 8 /\* bitwise reduction nor \*/[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vpi__user_8h.html#c.vpiUnaryNorOp "Permalink to this definition") `vpiUnaryXorOp` 9 /\* bitwise reduction xor \*/[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vpi__user_8h.html#c.vpiUnaryXorOp "Permalink to this definition") `vpiUnaryXNorOp` 10 /\* bitwise reduction xnor \*/[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vpi__user_8h.html#c.vpiUnaryXNorOp "Permalink to this definition") `vpiSubOp` 11 /\* binary subtraction \*/[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vpi__user_8h.html#c.vpiSubOp "Permalink to this definition") `vpiDivOp` 12 /\* binary division \*/[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vpi__user_8h.html#c.vpiDivOp "Permalink to this definition") `vpiModOp` 13 /\* binary modulus \*/[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vpi__user_8h.html#c.vpiModOp "Permalink to this definition") `vpiEqOp` 14 /\* binary equality \*/[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vpi__user_8h.html#c.vpiEqOp "Permalink to this definition") `vpiNeqOp` 15 /\* binary inequality \*/[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vpi__user_8h.html#c.vpiNeqOp "Permalink to this definition") `vpiCaseEqOp` 16 /\* case (x and z) equality \*/[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vpi__user_8h.html#c.vpiCaseEqOp "Permalink to this definition") `vpiCaseNeqOp` 17 /\* case inequality \*/[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vpi__user_8h.html#c.vpiCaseNeqOp "Permalink to this definition") `vpiGtOp` 18 /\* binary greater than \*/[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vpi__user_8h.html#c.vpiGtOp "Permalink to this definition") `vpiGeOp` 19 /\* binary greater than or equal \*/[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vpi__user_8h.html#c.vpiGeOp "Permalink to this definition") `vpiLtOp` 20 /\* binary less than \*/[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vpi__user_8h.html#c.vpiLtOp "Permalink to this definition") `vpiLeOp` 21 /\* binary less than or equal \*/[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vpi__user_8h.html#c.vpiLeOp "Permalink to this definition") `vpiLShiftOp` 22 /\* binary left shift \*/[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vpi__user_8h.html#c.vpiLShiftOp "Permalink to this definition") `vpiRShiftOp` 23 /\* binary right shift \*/[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vpi__user_8h.html#c.vpiRShiftOp "Permalink to this definition") `vpiAddOp` 24 /\* binary addition \*/[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vpi__user_8h.html#c.vpiAddOp "Permalink to this definition") `vpiMultOp` 25 /\* binary multiplication \*/[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vpi__user_8h.html#c.vpiMultOp "Permalink to this definition") `vpiLogAndOp` 26 /\* binary logical and \*/[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vpi__user_8h.html#c.vpiLogAndOp "Permalink to this definition") `vpiLogOrOp` 27 /\* binary logical or \*/[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vpi__user_8h.html#c.vpiLogOrOp "Permalink to this definition") `vpiBitAndOp` 28 /\* binary bitwise and \*/[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vpi__user_8h.html#c.vpiBitAndOp "Permalink to this definition") `vpiBitOrOp` 29 /\* binary bitwise or \*/[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vpi__user_8h.html#c.vpiBitOrOp "Permalink to this definition") `vpiBitXorOp` 30 /\* binary bitwise xor \*/[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vpi__user_8h.html#c.vpiBitXorOp "Permalink to this definition") `vpiBitXNorOp` 31 /\* binary bitwise xnor \*/[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vpi__user_8h.html#c.vpiBitXNorOp "Permalink to this definition") `vpiBitXnorOp` vpiBitXNorOp /\* added with 1364-2001 \*/[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vpi__user_8h.html#c.vpiBitXnorOp "Permalink to this definition") `vpiConditionOp` 32 /\* ternary conditional \*/[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vpi__user_8h.html#c.vpiConditionOp "Permalink to this definition") `vpiConcatOp` 33 /\* n-ary concatenation \*/[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vpi__user_8h.html#c.vpiConcatOp "Permalink to this definition") `vpiMultiConcatOp` 34 /\* repeated concatenation \*/[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vpi__user_8h.html#c.vpiMultiConcatOp "Permalink to this definition") `vpiEventOrOp` 35 /\* event or \*/[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vpi__user_8h.html#c.vpiEventOrOp "Permalink to this definition") `vpiNullOp` 36 /\* null operation \*/[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vpi__user_8h.html#c.vpiNullOp "Permalink to this definition") `vpiListOp` 37 /\* list of expressions \*/[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vpi__user_8h.html#c.vpiListOp "Permalink to this definition") `vpiMinTypMaxOp` 38 /\* min:typ:max: delay expression \*/[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vpi__user_8h.html#c.vpiMinTypMaxOp "Permalink to this definition") `vpiPosedgeOp` 39 /\* posedge \*/[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vpi__user_8h.html#c.vpiPosedgeOp "Permalink to this definition") `vpiNegedgeOp` 40 /\* negedge \*/[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vpi__user_8h.html#c.vpiNegedgeOp "Permalink to this definition") `vpiArithLShiftOp` 41 /\* arithmetic left shift (1364-2001) \*/[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vpi__user_8h.html#c.vpiArithLShiftOp "Permalink to this definition") `vpiArithRShiftOp` 42 /\* arithmetic right shift (1364-2001) \*/[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vpi__user_8h.html#c.vpiArithRShiftOp "Permalink to this definition") `vpiPowerOp` 43 /\* arithmetic power op (1364-2001) \*/[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vpi__user_8h.html#c.vpiPowerOp "Permalink to this definition") `vpiConstType` 40 /\* constant subtypes: \*/[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vpi__user_8h.html#c.vpiConstType "Permalink to this definition") `vpiDecConst` 1 /\* decimal integer \*/[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vpi__user_8h.html#c.vpiDecConst "Permalink to this definition") `vpiRealConst` 2 /\* real \*/[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vpi__user_8h.html#c.vpiRealConst "Permalink to this definition") `vpiBinaryConst` 3 /\* binary integer \*/[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vpi__user_8h.html#c.vpiBinaryConst "Permalink to this definition") `vpiOctConst` 4 /\* octal integer \*/[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vpi__user_8h.html#c.vpiOctConst "Permalink to this definition") `vpiHexConst` 5 /\* hexadecimal integer \*/[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vpi__user_8h.html#c.vpiHexConst "Permalink to this definition") `vpiStringConst` 6 /\* string literal \*/[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vpi__user_8h.html#c.vpiStringConst "Permalink to this definition") `vpiIntConst` 7 /\* HDL integer constant (1364-2001) \*/[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vpi__user_8h.html#c.vpiIntConst "Permalink to this definition") `vpiTimeConst` 8 /\* time constant \*/[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vpi__user_8h.html#c.vpiTimeConst "Permalink to this definition") `vpiBlocking` 41 /\* blocking assignment (boolean) \*/[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vpi__user_8h.html#c.vpiBlocking "Permalink to this definition") `vpiCaseType` 42 /\* case statement subtypes: \*/[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vpi__user_8h.html#c.vpiCaseType "Permalink to this definition") `vpiCaseExact` 1 /\* exact match \*/[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vpi__user_8h.html#c.vpiCaseExact "Permalink to this definition") `vpiCaseX` 2 /\* ignore X's \*/[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vpi__user_8h.html#c.vpiCaseX "Permalink to this definition") `vpiCaseZ` 3 /\* ignore Z's \*/[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vpi__user_8h.html#c.vpiCaseZ "Permalink to this definition") `vpiNetDeclAssign` 43 /\* assign part of decl (boolean) \*/[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vpi__user_8h.html#c.vpiNetDeclAssign "Permalink to this definition") `vpiFuncType` 44 /\* HDL function & system function type \*/[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vpi__user_8h.html#c.vpiFuncType "Permalink to this definition") `vpiIntFunc` 1 /\* returns integer \*/[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vpi__user_8h.html#c.vpiIntFunc "Permalink to this definition") `vpiRealFunc` 2 /\* returns real \*/[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vpi__user_8h.html#c.vpiRealFunc "Permalink to this definition") `vpiTimeFunc` 3 /\* returns time \*/[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vpi__user_8h.html#c.vpiTimeFunc "Permalink to this definition") `vpiSizedFunc` 4 /\* returns an arbitrary size \*/[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vpi__user_8h.html#c.vpiSizedFunc "Permalink to this definition") `vpiSizedSignedFunc` 5 /\* returns sized signed value \*/[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vpi__user_8h.html#c.vpiSizedSignedFunc "Permalink to this definition") `vpiSysFuncType` vpiFuncType[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vpi__user_8h.html#c.vpiSysFuncType "Permalink to this definition") alias 1364-1995 system function subtypes to 1364-2001 function subtypes `vpiSysFuncInt` vpiIntFunc[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vpi__user_8h.html#c.vpiSysFuncInt "Permalink to this definition") `vpiSysFuncReal` vpiRealFunc[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vpi__user_8h.html#c.vpiSysFuncReal "Permalink to this definition") `vpiSysFuncTime` vpiTimeFunc[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vpi__user_8h.html#c.vpiSysFuncTime "Permalink to this definition") `vpiSysFuncSized` vpiSizedFunc[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vpi__user_8h.html#c.vpiSysFuncSized "Permalink to this definition") `vpiUserDefn` 45 /\*user defined system task/func(boolean)\*/[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vpi__user_8h.html#c.vpiUserDefn "Permalink to this definition") `vpiScheduled` 46 /\* object still scheduled (boolean) \*/[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vpi__user_8h.html#c.vpiScheduled "Permalink to this definition") `vpiActive` 49 /\* reentrant task/func frame is active \*/[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vpi__user_8h.html#c.vpiActive "Permalink to this definition") `vpiAutomatic` 50 /\* task/func obj is automatic \*/[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vpi__user_8h.html#c.vpiAutomatic "Permalink to this definition") `vpiCell` 51 /\* configuration cell \*/[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vpi__user_8h.html#c.vpiCell "Permalink to this definition") `vpiConfig` 52 /\* configuration config file \*/[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vpi__user_8h.html#c.vpiConfig "Permalink to this definition") `vpiConstantSelect` 53 /\* (boolean) bit-select or part-select indices are constant expressions \*/ [¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vpi__user_8h.html#c.vpiConstantSelect "Permalink to this definition") `vpiDecompile` 54 /\* decompile the object \*/[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vpi__user_8h.html#c.vpiDecompile "Permalink to this definition") `vpiDefAttribute` 55 /\* Attribute defined for the obj \*/[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vpi__user_8h.html#c.vpiDefAttribute "Permalink to this definition") `vpiDelayType` 56 /\* delay subtype \*/[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vpi__user_8h.html#c.vpiDelayType "Permalink to this definition") `vpiModPathDelay` 1 /\* module path delay \*/[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vpi__user_8h.html#c.vpiModPathDelay "Permalink to this definition") `vpiInterModPathDelay` 2 /\* intermodule path delay \*/[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vpi__user_8h.html#c.vpiInterModPathDelay "Permalink to this definition") `vpiMIPDelay` 3 /\* module input port delay \*/[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vpi__user_8h.html#c.vpiMIPDelay "Permalink to this definition") `vpiIteratorType` 57 /\* object type of an iterator \*/[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vpi__user_8h.html#c.vpiIteratorType "Permalink to this definition") `vpiLibrary` 58 /\* configuration library \*/[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vpi__user_8h.html#c.vpiLibrary "Permalink to this definition") `vpiMultiArray` 59 /\* Object is a multidimensional array \*/[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vpi__user_8h.html#c.vpiMultiArray "Permalink to this definition") `vpiOffset` 60 /\* offset from LSB \*/[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vpi__user_8h.html#c.vpiOffset "Permalink to this definition") `vpiResolvedNetType` 61 /\* net subtype after resolution, returns same subtypes as vpiNetType \*/ [¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vpi__user_8h.html#c.vpiResolvedNetType "Permalink to this definition") `vpiSaveRestartID` 62 /\* unique ID for save/restart data \*/[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vpi__user_8h.html#c.vpiSaveRestartID "Permalink to this definition") `vpiSaveRestartLocation` 63 /\* name of save/restart data file \*/[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vpi__user_8h.html#c.vpiSaveRestartLocation "Permalink to this definition") `vpiValid` 64 /\* reentrant task/func frame or automatic variable is valid \*/ [¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vpi__user_8h.html#c.vpiValid "Permalink to this definition") `vpiValidFalse` 0[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vpi__user_8h.html#c.vpiValidFalse "Permalink to this definition") `vpiValidTrue` 1[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vpi__user_8h.html#c.vpiValidTrue "Permalink to this definition") `vpiSigned` 65 /\* TRUE for vpiIODecl and any object in the expression class if the object has the signed attribute \*/ [¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vpi__user_8h.html#c.vpiSigned "Permalink to this definition") `vpiLocalParam` 70 /\* TRUE when a param is declared as a localparam \*/ [¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vpi__user_8h.html#c.vpiLocalParam "Permalink to this definition") `vpiModPathHasIfNone` 71 /\* Mod path has an ifnone statement \*/[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vpi__user_8h.html#c.vpiModPathHasIfNone "Permalink to this definition") `vpiIndexedPartSelectType` 72 /\* Indexed part-select type \*/[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vpi__user_8h.html#c.vpiIndexedPartSelectType "Permalink to this definition") `vpiPosIndexed` 1 /\* +: \*/[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vpi__user_8h.html#c.vpiPosIndexed "Permalink to this definition") `vpiNegIndexed` 2 /\* -: \*/[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vpi__user_8h.html#c.vpiNegIndexed "Permalink to this definition") `vpiIsMemory` 73 /\* TRUE for a one-dimensional reg array \*/[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vpi__user_8h.html#c.vpiIsMemory "Permalink to this definition") `vpiIsProtected` 74 /\* TRUE for protected design information \*/[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vpi__user_8h.html#c.vpiIsProtected "Permalink to this definition") `vpiStop` 66 /\* execute simulator's $stop \*/[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vpi__user_8h.html#c.vpiStop "Permalink to this definition") `vpiFinish` 67 /\* execute simulator's $finish \*/[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vpi__user_8h.html#c.vpiFinish "Permalink to this definition") `vpiReset` 68 /\* execute simulator's $reset \*/[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vpi__user_8h.html#c.vpiReset "Permalink to this definition") `vpiSetInteractiveScope` 69 /\* set simulator's interactive scope \*/[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vpi__user_8h.html#c.vpiSetInteractiveScope "Permalink to this definition") `VPI_MCD_STDOUT` 0x00000001[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vpi__user_8h.html#c.VPI_MCD_STDOUT "Permalink to this definition") `vpiScaledRealTime` 1[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vpi__user_8h.html#c.vpiScaledRealTime "Permalink to this definition") `vpiSimTime` 2[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vpi__user_8h.html#c.vpiSimTime "Permalink to this definition") `vpiSuppressTime` 3[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vpi__user_8h.html#c.vpiSuppressTime "Permalink to this definition") `VPI_VECVAL`[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vpi__user_8h.html#c.VPI_VECVAL "Permalink to this definition") `vpiSupplyDrive` 0x80[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vpi__user_8h.html#c.vpiSupplyDrive "Permalink to this definition") `vpiStrongDrive` 0x40[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vpi__user_8h.html#c.vpiStrongDrive "Permalink to this definition") `vpiPullDrive` 0x20[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vpi__user_8h.html#c.vpiPullDrive "Permalink to this definition") `vpiWeakDrive` 0x08[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vpi__user_8h.html#c.vpiWeakDrive "Permalink to this definition") `vpiLargeCharge` 0x10[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vpi__user_8h.html#c.vpiLargeCharge "Permalink to this definition") `vpiMediumCharge` 0x04[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vpi__user_8h.html#c.vpiMediumCharge "Permalink to this definition") `vpiSmallCharge` 0x02[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vpi__user_8h.html#c.vpiSmallCharge "Permalink to this definition") `vpiHiZ` 0x01[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vpi__user_8h.html#c.vpiHiZ "Permalink to this definition") `vpiBinStrVal` 1[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vpi__user_8h.html#c.vpiBinStrVal "Permalink to this definition") `vpiOctStrVal` 2[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vpi__user_8h.html#c.vpiOctStrVal "Permalink to this definition") `vpiDecStrVal` 3[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vpi__user_8h.html#c.vpiDecStrVal "Permalink to this definition") `vpiHexStrVal` 4[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vpi__user_8h.html#c.vpiHexStrVal "Permalink to this definition") `vpiScalarVal` 5[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vpi__user_8h.html#c.vpiScalarVal "Permalink to this definition") `vpiIntVal` 6[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vpi__user_8h.html#c.vpiIntVal "Permalink to this definition") `vpiRealVal` 7[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vpi__user_8h.html#c.vpiRealVal "Permalink to this definition") `vpiStringVal` 8[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vpi__user_8h.html#c.vpiStringVal "Permalink to this definition") `vpiVectorVal` 9[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vpi__user_8h.html#c.vpiVectorVal "Permalink to this definition") `vpiStrengthVal` 10[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vpi__user_8h.html#c.vpiStrengthVal "Permalink to this definition") `vpiTimeVal` 11[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vpi__user_8h.html#c.vpiTimeVal "Permalink to this definition") `vpiObjTypeVal` 12[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vpi__user_8h.html#c.vpiObjTypeVal "Permalink to this definition") `vpiSuppressVal` 13[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vpi__user_8h.html#c.vpiSuppressVal "Permalink to this definition") `vpiShortIntVal` 14[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vpi__user_8h.html#c.vpiShortIntVal "Permalink to this definition") `vpiLongIntVal` 15[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vpi__user_8h.html#c.vpiLongIntVal "Permalink to this definition") `vpiShortRealVal` 16[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vpi__user_8h.html#c.vpiShortRealVal "Permalink to this definition") `vpiRawTwoStateVal` 17[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vpi__user_8h.html#c.vpiRawTwoStateVal "Permalink to this definition") `vpiRawFourStateVal` 18[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vpi__user_8h.html#c.vpiRawFourStateVal "Permalink to this definition") `vpiNoDelay` 1[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vpi__user_8h.html#c.vpiNoDelay "Permalink to this definition") `vpiInertialDelay` 2[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vpi__user_8h.html#c.vpiInertialDelay "Permalink to this definition") `vpiTransportDelay` 3[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vpi__user_8h.html#c.vpiTransportDelay "Permalink to this definition") `vpiPureTransportDelay` 4[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vpi__user_8h.html#c.vpiPureTransportDelay "Permalink to this definition") `vpiForceFlag` 5[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vpi__user_8h.html#c.vpiForceFlag "Permalink to this definition") `vpiReleaseFlag` 6[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vpi__user_8h.html#c.vpiReleaseFlag "Permalink to this definition") `vpiCancelEvent` 7[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vpi__user_8h.html#c.vpiCancelEvent "Permalink to this definition") `vpiReturnEvent` 0x1000[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vpi__user_8h.html#c.vpiReturnEvent "Permalink to this definition") `vpiUserAllocFlag` 0x2000[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vpi__user_8h.html#c.vpiUserAllocFlag "Permalink to this definition") `vpiOneValue` 0x4000[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vpi__user_8h.html#c.vpiOneValue "Permalink to this definition") `vpiPropagateOff` 0x8000[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vpi__user_8h.html#c.vpiPropagateOff "Permalink to this definition") `vpi0` 0[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vpi__user_8h.html#c.vpi0 "Permalink to this definition") `vpi1` 1[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vpi__user_8h.html#c.vpi1 "Permalink to this definition") `vpiZ` 2[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vpi__user_8h.html#c.vpiZ "Permalink to this definition") `vpiX` 3[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vpi__user_8h.html#c.vpiX "Permalink to this definition") `vpiH` 4[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vpi__user_8h.html#c.vpiH "Permalink to this definition") `vpiL` 5[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vpi__user_8h.html#c.vpiL "Permalink to this definition") `vpiDontCare` 6[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vpi__user_8h.html#c.vpiDontCare "Permalink to this definition") `vpiSysTask` 1[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vpi__user_8h.html#c.vpiSysTask "Permalink to this definition") `vpiSysFunc` 2[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vpi__user_8h.html#c.vpiSysFunc "Permalink to this definition") `vpiCompile` 1[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vpi__user_8h.html#c.vpiCompile "Permalink to this definition") `vpiPLI` 2[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vpi__user_8h.html#c.vpiPLI "Permalink to this definition") `vpiRun` 3[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vpi__user_8h.html#c.vpiRun "Permalink to this definition") `vpiNotice` 1[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vpi__user_8h.html#c.vpiNotice "Permalink to this definition") `vpiWarning` 2[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vpi__user_8h.html#c.vpiWarning "Permalink to this definition") `vpiError` 3[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vpi__user_8h.html#c.vpiError "Permalink to this definition") `vpiSystem` 4[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vpi__user_8h.html#c.vpiSystem "Permalink to this definition") `vpiInternal` 5[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vpi__user_8h.html#c.vpiInternal "Permalink to this definition") `vpiTimePrecision` 12 /\* module time precision \*/ `cbValueChange` 1[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vpi__user_8h.html#c.cbValueChange "Permalink to this definition") `cbStmt` 2[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vpi__user_8h.html#c.cbStmt "Permalink to this definition") `cbForce` 3[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vpi__user_8h.html#c.cbForce "Permalink to this definition") `cbRelease` 4[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vpi__user_8h.html#c.cbRelease "Permalink to this definition") `cbAtStartOfSimTime` 5[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vpi__user_8h.html#c.cbAtStartOfSimTime "Permalink to this definition") `cbReadWriteSynch` 6[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vpi__user_8h.html#c.cbReadWriteSynch "Permalink to this definition") `cbReadOnlySynch` 7[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vpi__user_8h.html#c.cbReadOnlySynch "Permalink to this definition") `cbNextSimTime` 8[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vpi__user_8h.html#c.cbNextSimTime "Permalink to this definition") `cbAfterDelay` 9[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vpi__user_8h.html#c.cbAfterDelay "Permalink to this definition") `cbEndOfCompile` 10[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vpi__user_8h.html#c.cbEndOfCompile "Permalink to this definition") `cbStartOfSimulation` 11[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vpi__user_8h.html#c.cbStartOfSimulation "Permalink to this definition") `cbEndOfSimulation` 12[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vpi__user_8h.html#c.cbEndOfSimulation "Permalink to this definition") `cbError` 13[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vpi__user_8h.html#c.cbError "Permalink to this definition") `cbTchkViolation` 14[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vpi__user_8h.html#c.cbTchkViolation "Permalink to this definition") `cbStartOfSave` 15[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vpi__user_8h.html#c.cbStartOfSave "Permalink to this definition") `cbEndOfSave` 16[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vpi__user_8h.html#c.cbEndOfSave "Permalink to this definition") `cbStartOfRestart` 17[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vpi__user_8h.html#c.cbStartOfRestart "Permalink to this definition") `cbEndOfRestart` 18[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vpi__user_8h.html#c.cbEndOfRestart "Permalink to this definition") `cbStartOfReset` 19[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vpi__user_8h.html#c.cbStartOfReset "Permalink to this definition") `cbEndOfReset` 20[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vpi__user_8h.html#c.cbEndOfReset "Permalink to this definition") `cbEnterInteractive` 21[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vpi__user_8h.html#c.cbEnterInteractive "Permalink to this definition") `cbExitInteractive` 22[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vpi__user_8h.html#c.cbExitInteractive "Permalink to this definition") `cbInteractiveScopeChange` 23[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vpi__user_8h.html#c.cbInteractiveScopeChange "Permalink to this definition") `cbUnresolvedSystf` 24[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vpi__user_8h.html#c.cbUnresolvedSystf "Permalink to this definition") `cbAssign` 25[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vpi__user_8h.html#c.cbAssign "Permalink to this definition") `cbDeassign` 26[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vpi__user_8h.html#c.cbDeassign "Permalink to this definition") `cbDisable` 27[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vpi__user_8h.html#c.cbDisable "Permalink to this definition") `cbPLIError` 28[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vpi__user_8h.html#c.cbPLIError "Permalink to this definition") `cbSignal` 29[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vpi__user_8h.html#c.cbSignal "Permalink to this definition") `cbNBASynch` 30[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vpi__user_8h.html#c.cbNBASynch "Permalink to this definition") `cbAtEndOfSimTime` 31[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vpi__user_8h.html#c.cbAtEndOfSimTime "Permalink to this definition") Typedefs _typedef_ int64\_t `PLI_INT64`[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vpi__user_8h.html#_CPPv49PLI_INT64 "Permalink to this definition") _typedef_ uint64\_t `PLI_UINT64`[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vpi__user_8h.html#_CPPv410PLI_UINT64 "Permalink to this definition") _typedef_ int `PLI_INT32` _typedef_ unsigned int `PLI_UINT32` _typedef_ short `PLI_INT16` _typedef_ unsigned short `PLI_UINT16` _typedef_ char `PLI_BYTE8` _typedef_ unsigned char `PLI_UBYTE8` _typedef_ [PLI\_UINT32](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#_CPPv410PLI_UINT32 "PLI_UINT32") \*`vpiHandle`[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vpi__user_8h.html#_CPPv49vpiHandle "Permalink to this definition") _typedef_ _struct_ [t\_vpi\_time](https://docs.cocotb.org/en/v1.4.0/generated/file/vpi__user_8h.html#_CPPv410t_vpi_time "t_vpi_time") `s_vpi_time`[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vpi__user_8h.html#_CPPv410s_vpi_time "Permalink to this definition") _typedef_ _struct_ [t\_vpi\_time](https://docs.cocotb.org/en/v1.4.0/generated/file/vpi__user_8h.html#_CPPv410t_vpi_time "t_vpi_time") \*`p_vpi_time`[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vpi__user_8h.html#_CPPv410p_vpi_time "Permalink to this definition") _typedef_ _struct_ [t\_vpi\_delay](https://docs.cocotb.org/en/v1.4.0/generated/file/vpi__user_8h.html#_CPPv411t_vpi_delay "t_vpi_delay") `s_vpi_delay`[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vpi__user_8h.html#_CPPv411s_vpi_delay "Permalink to this definition") _typedef_ _struct_ [t\_vpi\_delay](https://docs.cocotb.org/en/v1.4.0/generated/file/vpi__user_8h.html#_CPPv411t_vpi_delay "t_vpi_delay") \*`p_vpi_delay`[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vpi__user_8h.html#_CPPv411p_vpi_delay "Permalink to this definition") _typedef_ _struct_ [t\_vpi\_vecval](https://docs.cocotb.org/en/v1.4.0/generated/file/vpi__user_8h.html#_CPPv412t_vpi_vecval "t_vpi_vecval") `s_vpi_vecval`[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vpi__user_8h.html#_CPPv412s_vpi_vecval "Permalink to this definition") _typedef_ _struct_ [t\_vpi\_vecval](https://docs.cocotb.org/en/v1.4.0/generated/file/vpi__user_8h.html#_CPPv412t_vpi_vecval "t_vpi_vecval") \*`p_vpi_vecval`[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vpi__user_8h.html#_CPPv412p_vpi_vecval "Permalink to this definition") _typedef_ _struct_ [t\_vpi\_strengthval](https://docs.cocotb.org/en/v1.4.0/generated/file/vpi__user_8h.html#_CPPv417t_vpi_strengthval "t_vpi_strengthval") `s_vpi_strengthval`[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vpi__user_8h.html#_CPPv417s_vpi_strengthval "Permalink to this definition") _typedef_ _struct_ [t\_vpi\_strengthval](https://docs.cocotb.org/en/v1.4.0/generated/file/vpi__user_8h.html#_CPPv417t_vpi_strengthval "t_vpi_strengthval") \*`p_vpi_strengthval`[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vpi__user_8h.html#_CPPv417p_vpi_strengthval "Permalink to this definition") _typedef_ _struct_ [t\_vpi\_value](https://docs.cocotb.org/en/v1.4.0/generated/file/vpi__user_8h.html#_CPPv411t_vpi_value "t_vpi_value") `s_vpi_value`[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vpi__user_8h.html#_CPPv411s_vpi_value "Permalink to this definition") _typedef_ _struct_ [t\_vpi\_value](https://docs.cocotb.org/en/v1.4.0/generated/file/vpi__user_8h.html#_CPPv411t_vpi_value "t_vpi_value") \*`p_vpi_value`[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vpi__user_8h.html#_CPPv411p_vpi_value "Permalink to this definition") _typedef_ _struct_ [t\_vpi\_arrayvalue](https://docs.cocotb.org/en/v1.4.0/generated/file/vpi__user_8h.html#_CPPv416t_vpi_arrayvalue "t_vpi_arrayvalue") `s_vpi_arrayvalue`[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vpi__user_8h.html#_CPPv416s_vpi_arrayvalue "Permalink to this definition") _typedef_ _struct_ [t\_vpi\_arrayvalue](https://docs.cocotb.org/en/v1.4.0/generated/file/vpi__user_8h.html#_CPPv416t_vpi_arrayvalue "t_vpi_arrayvalue") \*`p_vpi_arrayvalue`[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vpi__user_8h.html#_CPPv416p_vpi_arrayvalue "Permalink to this definition") _typedef_ _struct_ [t\_vpi\_systf\_data](https://docs.cocotb.org/en/v1.4.0/generated/file/vpi__user_8h.html#_CPPv416t_vpi_systf_data "t_vpi_systf_data") `s_vpi_systf_data`[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vpi__user_8h.html#_CPPv416s_vpi_systf_data "Permalink to this definition") _typedef_ _struct_ [t\_vpi\_systf\_data](https://docs.cocotb.org/en/v1.4.0/generated/file/vpi__user_8h.html#_CPPv416t_vpi_systf_data "t_vpi_systf_data") \*`p_vpi_systf_data`[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vpi__user_8h.html#_CPPv416p_vpi_systf_data "Permalink to this definition") _typedef_ _struct_ [t\_vpi\_vlog\_info](https://docs.cocotb.org/en/v1.4.0/generated/file/vpi__user_8h.html#_CPPv415t_vpi_vlog_info "t_vpi_vlog_info") `s_vpi_vlog_info`[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vpi__user_8h.html#_CPPv415s_vpi_vlog_info "Permalink to this definition") _typedef_ _struct_ [t\_vpi\_vlog\_info](https://docs.cocotb.org/en/v1.4.0/generated/file/vpi__user_8h.html#_CPPv415t_vpi_vlog_info "t_vpi_vlog_info") \*`p_vpi_vlog_info`[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vpi__user_8h.html#_CPPv415p_vpi_vlog_info "Permalink to this definition") _typedef_ _struct_ [t\_vpi\_error\_info](https://docs.cocotb.org/en/v1.4.0/generated/file/vpi__user_8h.html#_CPPv416t_vpi_error_info "t_vpi_error_info") `s_vpi_error_info`[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vpi__user_8h.html#_CPPv416s_vpi_error_info "Permalink to this definition") _typedef_ _struct_ [t\_vpi\_error\_info](https://docs.cocotb.org/en/v1.4.0/generated/file/vpi__user_8h.html#_CPPv416t_vpi_error_info "t_vpi_error_info") \*`p_vpi_error_info`[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vpi__user_8h.html#_CPPv416p_vpi_error_info "Permalink to this definition") _typedef_ _struct_ [t\_cb\_data](https://docs.cocotb.org/en/v1.4.0/generated/file/vpi__user_8h.html#_CPPv49t_cb_data "t_cb_data") `s_cb_data`[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vpi__user_8h.html#_CPPv49s_cb_data "Permalink to this definition") _typedef_ _struct_ [t\_cb\_data](https://docs.cocotb.org/en/v1.4.0/generated/file/vpi__user_8h.html#_CPPv49t_cb_data "t_cb_data") \*`p_cb_data`[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vpi__user_8h.html#_CPPv49p_cb_data "Permalink to this definition") Functions `XXTERN vpiHandle vpi_register_cb PROTO_PARAMS ((p_cb_data cb_data_p))` `XXTERN PLI_INT32 vpi_remove_cb PROTO_PARAMS ((vpiHandle cb_obj))` `XXTERN void vpi_get_cb_info PROTO_PARAMS ((vpiHandle object, p_cb_data cb_data_p))` `XXTERN vpiHandle vpi_register_systf PROTO_PARAMS ((p_vpi_systf_data systf_data_p))` `XXTERN void vpi_get_systf_info PROTO_PARAMS ((vpiHandle object, p_vpi_systf_data systf_data_p))` `XXTERN vpiHandle vpi_handle_by_name PROTO_PARAMS ((PLI_BYTE8 *name, vpiHandle scope))` `XXTERN vpiHandle vpi_handle_by_index PROTO_PARAMS ((vpiHandle object, PLI_INT32 indx))` `XXTERN vpiHandle vpi_handle PROTO_PARAMS ((PLI_INT32 type, vpiHandle refHandle))` `XXTERN vpiHandle vpi_handle_multi PROTO_PARAMS ((PLI_INT32 type, vpiHandle refHandle1, vpiHandle refHandle2,...))` `XXTERN vpiHandle vpi_scan PROTO_PARAMS ((vpiHandle iterator))` `XXTERN PLI_INT32 vpi_get PROTO_PARAMS ((PLI_INT32 property, vpiHandle object))` `XXTERN void vpi_get_delays PROTO_PARAMS ((vpiHandle object, p_vpi_delay delay_p))` `XXTERN void vpi_get_value PROTO_PARAMS ((vpiHandle expr, p_vpi_value value_p))` `XXTERN vpiHandle vpi_put_value PROTO_PARAMS ((vpiHandle object, p_vpi_value value_p, p_vpi_time time_p, PLI_INT32 flags))` `XXTERN void vpi_get_value_array PROTO_PARAMS ((vpiHandle expr, p_vpi_arrayvalue arrayvalue_p, PLI_INT32 *index_p, PLI_UINT32 num))` `XXTERN void vpi_put_value_array PROTO_PARAMS ((vpiHandle object, p_vpi_arrayvalue arrayvalue_p, PLI_INT32 *index_p, PLI_UINT32 num))` `XXTERN void vpi_get_time PROTO_PARAMS ((vpiHandle object, p_vpi_time time_p))` `XXTERN PLI_UINT32 vpi_mcd_open PROTO_PARAMS ((const PLI_BYTE8 *fileName))` `XXTERN PLI_UINT32 vpi_mcd_close PROTO_PARAMS ((PLI_UINT32 mcd))` `XXTERN PLI_BYTE8 *vpi_mcd_name PROTO_PARAMS ((PLI_UINT32 cd))` `XXTERN PLI_INT32 vpi_mcd_printf PROTO_PARAMS ((PLI_UINT32 mcd, const PLI_BYTE8 *format,...))` `XXTERN PLI_INT32 vpi_printf PROTO_PARAMS ((const PLI_BYTE8 *format,...))` `XXTERN PLI_INT32 vpi_compare_objects PROTO_PARAMS ((vpiHandle object1, vpiHandle object2))` `XXTERN PLI_INT32 vpi_chk_error PROTO_PARAMS ((p_vpi_error_info error_info_p))` `XXTERN PLI_INT32 vpi_free_object PROTO_PARAMS ((vpiHandle object))` `XXTERN PLI_INT32 vpi_get_vlog_info PROTO_PARAMS ((p_vpi_vlog_info vlog_info_p))` `XXTERN PLI_INT32 vpi_get_data PROTO_PARAMS ((PLI_INT32 id, PLI_BYTE8 *dataLoc, PLI_INT32 numOfBytes))` `XXTERN void *vpi_get_userdata PROTO_PARAMS ((vpiHandle obj))` `XXTERN PLI_INT32 vpi_put_userdata PROTO_PARAMS ((vpiHandle obj, void *userdata))` `XXTERN PLI_INT32 vpi_vprintf PROTO_PARAMS ((const PLI_BYTE8 *format, va_list ap))` `XXTERN PLI_INT32 vpi_mcd_vprintf PROTO_PARAMS ((PLI_UINT32 mcd, const PLI_BYTE8 *format, va_list ap))` `XXTERN PLI_INT32 vpi_flush PROTO_PARAMS ((void))` `XXTERN PLI_INT32 vpi_control PROTO_PARAMS ((PLI_INT32 operation,...))` `XXTERN vpiHandle vpi_handle_by_multi_index PROTO_PARAMS ((vpiHandle obj, PLI_INT32 num_index, PLI_INT32 *index_array))` Variables `PLI_VEXTERN PLI_DLLESPEC void(* vlog_startup_routines [])(void)` _struct_ `t_vpi_time`[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vpi__user_8h.html#_CPPv410t_vpi_time "Permalink to this definition") Public Members [PLI\_INT32](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#_CPPv49PLI_INT32 "PLI_INT32") `type`[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vpi__user_8h.html#_CPPv4N10t_vpi_time4typeE "Permalink to this definition") [PLI\_UINT32](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#_CPPv410PLI_UINT32 "PLI_UINT32") `high`[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vpi__user_8h.html#_CPPv4N10t_vpi_time4highE "Permalink to this definition") [PLI\_UINT32](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#_CPPv410PLI_UINT32 "PLI_UINT32") `low`[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vpi__user_8h.html#_CPPv4N10t_vpi_time3lowE "Permalink to this definition") double `real`[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vpi__user_8h.html#_CPPv4N10t_vpi_time4realE "Permalink to this definition") _struct_ `t_vpi_delay`[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vpi__user_8h.html#_CPPv411t_vpi_delay "Permalink to this definition") Public Members _struct_ [t\_vpi\_time](https://docs.cocotb.org/en/v1.4.0/generated/file/vpi__user_8h.html#_CPPv410t_vpi_time "t_vpi_time") \*`da`[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vpi__user_8h.html#_CPPv4N11t_vpi_delay2daE "Permalink to this definition") [PLI\_INT32](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#_CPPv49PLI_INT32 "PLI_INT32") `no_of_delays`[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vpi__user_8h.html#_CPPv4N11t_vpi_delay12no_of_delaysE "Permalink to this definition") [PLI\_INT32](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#_CPPv49PLI_INT32 "PLI_INT32") `time_type`[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vpi__user_8h.html#_CPPv4N11t_vpi_delay9time_typeE "Permalink to this definition") [PLI\_INT32](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#_CPPv49PLI_INT32 "PLI_INT32") `mtm_flag`[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vpi__user_8h.html#_CPPv4N11t_vpi_delay8mtm_flagE "Permalink to this definition") [PLI\_INT32](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#_CPPv49PLI_INT32 "PLI_INT32") `append_flag`[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vpi__user_8h.html#_CPPv4N11t_vpi_delay11append_flagE "Permalink to this definition") [PLI\_INT32](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#_CPPv49PLI_INT32 "PLI_INT32") `pulsere_flag`[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vpi__user_8h.html#_CPPv4N11t_vpi_delay12pulsere_flagE "Permalink to this definition") _struct_ `t_vpi_vecval`[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vpi__user_8h.html#_CPPv412t_vpi_vecval "Permalink to this definition") Public Members [PLI\_INT32](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#_CPPv49PLI_INT32 "PLI_INT32") `aval`[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vpi__user_8h.html#_CPPv4N12t_vpi_vecval4avalE "Permalink to this definition") [PLI\_INT32](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#_CPPv49PLI_INT32 "PLI_INT32") `bval`[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vpi__user_8h.html#_CPPv4N12t_vpi_vecval4bvalE "Permalink to this definition") _struct_ `t_vpi_strengthval`[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vpi__user_8h.html#_CPPv417t_vpi_strengthval "Permalink to this definition") Public Members [PLI\_INT32](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#_CPPv49PLI_INT32 "PLI_INT32") `logic`[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vpi__user_8h.html#_CPPv4N17t_vpi_strengthval5logicE "Permalink to this definition") [PLI\_INT32](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#_CPPv49PLI_INT32 "PLI_INT32") `s0`[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vpi__user_8h.html#_CPPv4N17t_vpi_strengthval2s0E "Permalink to this definition") [PLI\_INT32](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#_CPPv49PLI_INT32 "PLI_INT32") `s1`[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vpi__user_8h.html#_CPPv4N17t_vpi_strengthval2s1E "Permalink to this definition") _struct_ `t_vpi_value`[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vpi__user_8h.html#_CPPv411t_vpi_value "Permalink to this definition") Public Members [PLI\_INT32](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#_CPPv49PLI_INT32 "PLI_INT32") `format`[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vpi__user_8h.html#_CPPv4N11t_vpi_value6formatE "Permalink to this definition") [PLI\_BYTE8](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#_CPPv49PLI_BYTE8 "PLI_BYTE8") \*`str`[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vpi__user_8h.html#_CPPv4N11t_vpi_value3strE "Permalink to this definition") [PLI\_INT32](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#_CPPv49PLI_INT32 "PLI_INT32") `scalar`[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vpi__user_8h.html#_CPPv4N11t_vpi_value6scalarE "Permalink to this definition") [PLI\_INT32](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#_CPPv49PLI_INT32 "PLI_INT32") `integer`[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vpi__user_8h.html#_CPPv4N11t_vpi_value7integerE "Permalink to this definition") double `real`[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vpi__user_8h.html#_CPPv4N11t_vpi_value4realE "Permalink to this definition") _struct_ [t\_vpi\_time](https://docs.cocotb.org/en/v1.4.0/generated/file/vpi__user_8h.html#_CPPv410t_vpi_time "t_vpi_time") \*`time`[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vpi__user_8h.html#_CPPv4N11t_vpi_value4timeE "Permalink to this definition") _struct_ [t\_vpi\_vecval](https://docs.cocotb.org/en/v1.4.0/generated/file/vpi__user_8h.html#_CPPv412t_vpi_vecval "t_vpi_vecval") \*`vector`[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vpi__user_8h.html#_CPPv4N11t_vpi_value6vectorE "Permalink to this definition") _struct_ [t\_vpi\_strengthval](https://docs.cocotb.org/en/v1.4.0/generated/file/vpi__user_8h.html#_CPPv417t_vpi_strengthval "t_vpi_strengthval") \*`strength`[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vpi__user_8h.html#_CPPv4N11t_vpi_value8strengthE "Permalink to this definition") [PLI\_BYTE8](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#_CPPv49PLI_BYTE8 "PLI_BYTE8") \*`misc`[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vpi__user_8h.html#_CPPv4N11t_vpi_value4miscE "Permalink to this definition") _union_ [t\_vpi\_value](https://docs.cocotb.org/en/v1.4.0/generated/file/vpi__user_8h.html#_CPPv411t_vpi_value "t_vpi_value") ::**\[anonymous\]** `value`[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vpi__user_8h.html#_CPPv4N11t_vpi_value5valueE "Permalink to this definition") _struct_ `t_vpi_arrayvalue`[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vpi__user_8h.html#_CPPv416t_vpi_arrayvalue "Permalink to this definition") Public Members [PLI\_UINT32](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#_CPPv410PLI_UINT32 "PLI_UINT32") `format`[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vpi__user_8h.html#_CPPv4N16t_vpi_arrayvalue6formatE "Permalink to this definition") [PLI\_UINT32](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#_CPPv410PLI_UINT32 "PLI_UINT32") `flags`[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vpi__user_8h.html#_CPPv4N16t_vpi_arrayvalue5flagsE "Permalink to this definition") [PLI\_INT32](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#_CPPv49PLI_INT32 "PLI_INT32") \*`integers`[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vpi__user_8h.html#_CPPv4N16t_vpi_arrayvalue8integersE "Permalink to this definition") [PLI\_INT16](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#_CPPv49PLI_INT16 "PLI_INT16") \*`shortints`[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vpi__user_8h.html#_CPPv4N16t_vpi_arrayvalue9shortintsE "Permalink to this definition") [PLI\_INT64](https://docs.cocotb.org/en/v1.4.0/generated/file/vpi__user_8h.html#_CPPv49PLI_INT64 "PLI_INT64") \*`longints`[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vpi__user_8h.html#_CPPv4N16t_vpi_arrayvalue8longintsE "Permalink to this definition") [PLI\_BYTE8](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#_CPPv49PLI_BYTE8 "PLI_BYTE8") \*`rawvals`[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vpi__user_8h.html#_CPPv4N16t_vpi_arrayvalue7rawvalsE "Permalink to this definition") _struct_ [t\_vpi\_vecval](https://docs.cocotb.org/en/v1.4.0/generated/file/vpi__user_8h.html#_CPPv412t_vpi_vecval "t_vpi_vecval") \*`vectors`[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vpi__user_8h.html#_CPPv4N16t_vpi_arrayvalue7vectorsE "Permalink to this definition") _struct_ [t\_vpi\_time](https://docs.cocotb.org/en/v1.4.0/generated/file/vpi__user_8h.html#_CPPv410t_vpi_time "t_vpi_time") \*`times`[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vpi__user_8h.html#_CPPv4N16t_vpi_arrayvalue5timesE "Permalink to this definition") double \*`reals`[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vpi__user_8h.html#_CPPv4N16t_vpi_arrayvalue5realsE "Permalink to this definition") float \*`shortreals`[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vpi__user_8h.html#_CPPv4N16t_vpi_arrayvalue10shortrealsE "Permalink to this definition") _union_ [t\_vpi\_arrayvalue](https://docs.cocotb.org/en/v1.4.0/generated/file/vpi__user_8h.html#_CPPv416t_vpi_arrayvalue "t_vpi_arrayvalue") ::**\[anonymous\]** `value`[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vpi__user_8h.html#_CPPv4N16t_vpi_arrayvalue5valueE "Permalink to this definition") _struct_ `t_vpi_systf_data`[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vpi__user_8h.html#_CPPv416t_vpi_systf_data "Permalink to this definition") Public Members [PLI\_INT32](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#_CPPv49PLI_INT32 "PLI_INT32") `type`[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vpi__user_8h.html#_CPPv4N16t_vpi_systf_data4typeE "Permalink to this definition") [PLI\_INT32](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#_CPPv49PLI_INT32 "PLI_INT32") `sysfunctype`[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vpi__user_8h.html#_CPPv4N16t_vpi_systf_data11sysfunctypeE "Permalink to this definition") _const_ [PLI\_BYTE8](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#_CPPv49PLI_BYTE8 "PLI_BYTE8") \*`tfname`[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vpi__user_8h.html#_CPPv4N16t_vpi_systf_data6tfnameE "Permalink to this definition") [PLI\_INT32](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#_CPPv49PLI_INT32 "PLI_INT32") (\*`calltf`)([PLI\_BYTE8](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#_CPPv49PLI_BYTE8 "PLI_BYTE8") \*)[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vpi__user_8h.html#_CPPv4N16t_vpi_systf_data6calltfE "Permalink to this definition") [PLI\_INT32](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#_CPPv49PLI_INT32 "PLI_INT32") (\*`compiletf`)([PLI\_BYTE8](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#_CPPv49PLI_BYTE8 "PLI_BYTE8") \*)[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vpi__user_8h.html#_CPPv4N16t_vpi_systf_data9compiletfE "Permalink to this definition") [PLI\_INT32](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#_CPPv49PLI_INT32 "PLI_INT32") (\*`sizetf`)([PLI\_BYTE8](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#_CPPv49PLI_BYTE8 "PLI_BYTE8") \*)[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vpi__user_8h.html#_CPPv4N16t_vpi_systf_data6sizetfE "Permalink to this definition") [PLI\_BYTE8](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#_CPPv49PLI_BYTE8 "PLI_BYTE8") \*`user_data`[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vpi__user_8h.html#_CPPv4N16t_vpi_systf_data9user_dataE "Permalink to this definition") _struct_ `t_vpi_vlog_info`[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vpi__user_8h.html#_CPPv415t_vpi_vlog_info "Permalink to this definition") Public Members [PLI\_INT32](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#_CPPv49PLI_INT32 "PLI_INT32") `argc`[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vpi__user_8h.html#_CPPv4N15t_vpi_vlog_info4argcE "Permalink to this definition") [PLI\_BYTE8](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#_CPPv49PLI_BYTE8 "PLI_BYTE8") \*\*`argv`[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vpi__user_8h.html#_CPPv4N15t_vpi_vlog_info4argvE "Permalink to this definition") [PLI\_BYTE8](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#_CPPv49PLI_BYTE8 "PLI_BYTE8") \*`product`[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vpi__user_8h.html#_CPPv4N15t_vpi_vlog_info7productE "Permalink to this definition") [PLI\_BYTE8](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#_CPPv49PLI_BYTE8 "PLI_BYTE8") \*`version`[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vpi__user_8h.html#_CPPv4N15t_vpi_vlog_info7versionE "Permalink to this definition") _struct_ `t_vpi_error_info`[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vpi__user_8h.html#_CPPv416t_vpi_error_info "Permalink to this definition") Public Members [PLI\_INT32](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#_CPPv49PLI_INT32 "PLI_INT32") `state`[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vpi__user_8h.html#_CPPv4N16t_vpi_error_info5stateE "Permalink to this definition") [PLI\_INT32](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#_CPPv49PLI_INT32 "PLI_INT32") `level`[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vpi__user_8h.html#_CPPv4N16t_vpi_error_info5levelE "Permalink to this definition") [PLI\_BYTE8](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#_CPPv49PLI_BYTE8 "PLI_BYTE8") \*`message`[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vpi__user_8h.html#_CPPv4N16t_vpi_error_info7messageE "Permalink to this definition") [PLI\_BYTE8](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#_CPPv49PLI_BYTE8 "PLI_BYTE8") \*`product`[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vpi__user_8h.html#_CPPv4N16t_vpi_error_info7productE "Permalink to this definition") [PLI\_BYTE8](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#_CPPv49PLI_BYTE8 "PLI_BYTE8") \*`code`[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vpi__user_8h.html#_CPPv4N16t_vpi_error_info4codeE "Permalink to this definition") [PLI\_BYTE8](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#_CPPv49PLI_BYTE8 "PLI_BYTE8") \*`file`[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vpi__user_8h.html#_CPPv4N16t_vpi_error_info4fileE "Permalink to this definition") [PLI\_INT32](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#_CPPv49PLI_INT32 "PLI_INT32") `line`[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vpi__user_8h.html#_CPPv4N16t_vpi_error_info4lineE "Permalink to this definition") _struct_ `t_cb_data`[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vpi__user_8h.html#_CPPv49t_cb_data "Permalink to this definition") Public Members [PLI\_INT32](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#_CPPv49PLI_INT32 "PLI_INT32") `reason`[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vpi__user_8h.html#_CPPv4N9t_cb_data6reasonE "Permalink to this definition") [PLI\_INT32](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#_CPPv49PLI_INT32 "PLI_INT32") (\*`cb_rtn`)(_struct_ [t\_cb\_data](https://docs.cocotb.org/en/v1.4.0/generated/file/vpi__user_8h.html#_CPPv49t_cb_data "t_cb_data") \*)[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vpi__user_8h.html#_CPPv4N9t_cb_data6cb_rtnE "Permalink to this definition") [vpiHandle](https://docs.cocotb.org/en/v1.4.0/generated/file/vpi__user_8h.html#_CPPv49vpiHandle "vpiHandle") `obj`[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vpi__user_8h.html#_CPPv4N9t_cb_data3objE "Permalink to this definition") [p\_vpi\_time](https://docs.cocotb.org/en/v1.4.0/generated/file/vpi__user_8h.html#_CPPv410p_vpi_time "p_vpi_time") `time`[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vpi__user_8h.html#_CPPv4N9t_cb_data4timeE "Permalink to this definition") [p\_vpi\_value](https://docs.cocotb.org/en/v1.4.0/generated/file/vpi__user_8h.html#_CPPv411p_vpi_value "p_vpi_value") `value`[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vpi__user_8h.html#_CPPv4N9t_cb_data5valueE "Permalink to this definition") [PLI\_INT32](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#_CPPv49PLI_INT32 "PLI_INT32") `index`[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vpi__user_8h.html#_CPPv4N9t_cb_data5indexE "Permalink to this definition") [PLI\_BYTE8](https://docs.cocotb.org/en/v1.4.0/generated/file/vhpi__user_8h.html#_CPPv49PLI_BYTE8 "PLI_BYTE8") \*`user_data`[¶](https://docs.cocotb.org/en/v1.4.0/generated/file/vpi__user_8h.html#_CPPv4N9t_cb_data9user_dataE "Permalink to this definition") --- # Unknown \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\* Further Resources \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\* We have a list of talks and papers, libraries and examples at our Wiki page \`Further Resources \`\_. Feel free to add links to cocotb-related content that we are still missing! --- # Struct t_vpi_vecval — cocotb 1.4.0 documentation * [](https://docs.cocotb.org/en/v1.4.0/index.html) » * [C Code Library Reference](https://docs.cocotb.org/en/v1.4.0/library_reference_c.html) » * [Struct list](https://docs.cocotb.org/en/v1.4.0/generated/structlist.html) » * Struct t\_vpi\_vecval * [Edit on GitHub](https://github.com/cocotb/cocotb/blob/v1.4.0/documentation/source/generated/struct/structt__vpi__vecval.rst) * * * Struct t\_vpi\_vecval[¶](https://docs.cocotb.org/en/v1.4.0/generated/struct/structt__vpi__vecval.html#struct-t-vpi-vecval "Permalink to this headline") ======================================================================================================================================================== _struct_ `t_vpi_vecval` --- # Unknown .. \_glossary: Glossary ======== .. glossary:: BFM Bus Functional Model blocking function A function that blocks the caller until the function finishes. This is typically a regular function, but sometimes involves calls to threaded code which blocks execution for an indeterminate amount of time. See also the :term:\`Python glossary \`. coroutine function The definition of a function that, when called, returns a coroutine object. Implemented using :keyword:\`async\` functions. See also the :term:\`Python glossary \`. coroutine The result of calling a :term:\`coroutine function\`. Coroutines are not run immediately, you must either :keyword:\`await\` on them which blocks the awaiting coroutine until it is finished; or turn them into a :term:\`task\`, which can be run concurrently. See also the :term:\`Python glossary \`. task A :term:\`coroutine\` that can be run concurrently to other tasks. trigger An :term:\`awaitable\` object which when :keyword:\`awaited \` will block the current :term:\`task\` until its condition is met. For example, a :class:\`RisingEdge(dut.clk) \` trigger will block until the next rising edge of the \`\`dut.clk\`\` signal. DUT Design under Test DUV Design under Verification FLI Foreign Language Interface. Mentor Graphics' equivalent to :term:\`VHPI\`. GPI Generic Procedural Interface, cocotb's abstraction over :term:\`VPI\`, :term:\`VHPI\`, and :term:\`FLI\`. HAL Hardware Abstraction Layer HDL Hardware Description Language MDV Metric-driven Verification RTL Register Transfer Level UVM Universal Verification Methodology VHPI The VHDL Procedural Interface, an application-programming interface to VHDL tools. VIP Verification IP VPI The Verilog Procedural Interface, an application-programming interface to (System)Verilog tools. Its original name was "PLI 2.0". time step A single point in simulated time, comprised of a series of one or more :term:\`evaluation cycles \`. evaluation cycle One iteration of the evaluation loop in a :term:\`time step\`. Occurs when HDL or cocotb code is executed in reaction to events, such as simulated time advancing or signal or variable values changing. The executed code tends to create more events, leading to the next evaluation cycle. inertial deposit :term:\`Depositing \` a value on a signal or variable at the end of the current delta cycle. no-delay deposit :term:\`Depositing \` a value on a signal or variable immediately. driving Continuously :term:\`depositing \` a value to a signal. cocotb cannot drive signals. deposit Setting the value of a signal or variable once. May be :term:\`inertial \` or :term:\`no-delay \`. force Setting the value to a signal or variable once immediately, then locking it so the value can't change. release Setting the value to a signal or variable once immediately, then unlocking it from a previous :term:\`force\`. simulator object An addressable object from the :term:\`DUT\`. Corresponds to a signal, variable, or hierarchical element in the :term:\`HDL\` code. --- # Struct t_vpi_vlog_info — cocotb 1.4.0 documentation * [](https://docs.cocotb.org/en/v1.4.0/index.html) » * [C Code Library Reference](https://docs.cocotb.org/en/v1.4.0/library_reference_c.html) » * [Struct list](https://docs.cocotb.org/en/v1.4.0/generated/structlist.html) » * Struct t\_vpi\_vlog\_info * [Edit on GitHub](https://github.com/cocotb/cocotb/blob/v1.4.0/documentation/source/generated/struct/structt__vpi__vlog__info.rst) * * * Struct t\_vpi\_vlog\_info[¶](https://docs.cocotb.org/en/v1.4.0/generated/struct/structt__vpi__vlog__info.html#struct-t-vpi-vlog-info "Permalink to this headline") =================================================================================================================================================================== _struct_ `t_vpi_vlog_info` --- # Struct vhpiPhysS — cocotb 1.4.0 documentation * [](https://docs.cocotb.org/en/v1.4.0/index.html) » * [C Code Library Reference](https://docs.cocotb.org/en/v1.4.0/library_reference_c.html) » * [Struct list](https://docs.cocotb.org/en/v1.4.0/generated/structlist.html) » * Struct vhpiPhysS * [Edit on GitHub](https://github.com/cocotb/cocotb/blob/v1.4.0/documentation/source/generated/struct/structvhpiPhysS.rst) * * * Struct vhpiPhysS[¶](https://docs.cocotb.org/en/v1.4.0/generated/struct/structvhpiPhysS.html#struct-vhpiphyss "Permalink to this headline") =========================================================================================================================================== _struct_ `vhpiPhysS` --- # Struct vhpiErrorInfoS — cocotb 1.4.0 documentation * [](https://docs.cocotb.org/en/v1.4.0/index.html) » * [C Code Library Reference](https://docs.cocotb.org/en/v1.4.0/library_reference_c.html) » * [Struct list](https://docs.cocotb.org/en/v1.4.0/generated/structlist.html) » * Struct vhpiErrorInfoS * [Edit on GitHub](https://github.com/cocotb/cocotb/blob/v1.4.0/documentation/source/generated/struct/structvhpiErrorInfoS.rst) * * * Struct vhpiErrorInfoS[¶](https://docs.cocotb.org/en/v1.4.0/generated/struct/structvhpiErrorInfoS.html#struct-vhpierrorinfos "Permalink to this headline") ========================================================================================================================================================== _struct_ `vhpiErrorInfoS` --- # Struct vhpiCbDataS — cocotb 1.4.0 documentation * [](https://docs.cocotb.org/en/v1.4.0/index.html) » * [C Code Library Reference](https://docs.cocotb.org/en/v1.4.0/library_reference_c.html) » * [Struct list](https://docs.cocotb.org/en/v1.4.0/generated/structlist.html) » * Struct vhpiCbDataS * [Edit on GitHub](https://github.com/cocotb/cocotb/blob/v1.4.0/documentation/source/generated/struct/structvhpiCbDataS.rst) * * * Struct vhpiCbDataS[¶](https://docs.cocotb.org/en/v1.4.0/generated/struct/structvhpiCbDataS.html#struct-vhpicbdatas "Permalink to this headline") ================================================================================================================================================= _struct_ `vhpiCbDataS` --- # Struct vhpiTimeS — cocotb 1.4.0 documentation * [](https://docs.cocotb.org/en/v1.4.0/index.html) » * [C Code Library Reference](https://docs.cocotb.org/en/v1.4.0/library_reference_c.html) » * [Struct list](https://docs.cocotb.org/en/v1.4.0/generated/structlist.html) » * Struct vhpiTimeS * [Edit on GitHub](https://github.com/cocotb/cocotb/blob/v1.4.0/documentation/source/generated/struct/structvhpiTimeS.rst) * * * Struct vhpiTimeS[¶](https://docs.cocotb.org/en/v1.4.0/generated/struct/structvhpiTimeS.html#struct-vhpitimes "Permalink to this headline") =========================================================================================================================================== _struct_ `vhpiTimeS` --- # Struct vhpiForeignDataS — cocotb 1.4.0 documentation * [](https://docs.cocotb.org/en/v1.4.0/index.html) » * [C Code Library Reference](https://docs.cocotb.org/en/v1.4.0/library_reference_c.html) » * [Struct list](https://docs.cocotb.org/en/v1.4.0/generated/structlist.html) » * Struct vhpiForeignDataS * [Edit on GitHub](https://github.com/cocotb/cocotb/blob/v1.4.0/documentation/source/generated/struct/structvhpiForeignDataS.rst) * * * Struct vhpiForeignDataS[¶](https://docs.cocotb.org/en/v1.4.0/generated/struct/structvhpiForeignDataS.html#struct-vhpiforeigndatas "Permalink to this headline") ================================================================================================================================================================ _struct_ `vhpiForeignDataS` --- # Struct list — cocotb 1.4.0 documentation * [](https://docs.cocotb.org/en/v1.4.0/index.html) » * [C Code Library Reference](https://docs.cocotb.org/en/v1.4.0/library_reference_c.html) » * Struct list * [Edit on GitHub](https://github.com/cocotb/cocotb/blob/v1.4.0/documentation/source/generated/structlist.rst) * * * Struct list[¶](https://docs.cocotb.org/en/v1.4.0/generated/structlist.html#struct-list "Permalink to this headline") ===================================================================================================================== * [Struct \_log\_level\_table](https://docs.cocotb.org/en/v1.4.0/generated/struct/struct__log__level__table.html) * [Struct callback\_data](https://docs.cocotb.org/en/v1.4.0/generated/struct/structcallback__data.html) * [Struct sim\_time](https://docs.cocotb.org/en/v1.4.0/generated/struct/structsim__time.html) * [Struct t\_cb\_data](https://docs.cocotb.org/en/v1.4.0/generated/struct/structt__cb__data.html) * [Struct t\_vpi\_arrayvalue](https://docs.cocotb.org/en/v1.4.0/generated/struct/structt__vpi__arrayvalue.html) * [Struct t\_vpi\_assertion\_step\_info](https://docs.cocotb.org/en/v1.4.0/generated/struct/structt__vpi__assertion__step__info.html) * [Struct t\_vpi\_attempt\_info](https://docs.cocotb.org/en/v1.4.0/generated/struct/structt__vpi__attempt__info.html) * [Struct t\_vpi\_delay](https://docs.cocotb.org/en/v1.4.0/generated/struct/structt__vpi__delay.html) * [Struct t\_vpi\_error\_info](https://docs.cocotb.org/en/v1.4.0/generated/struct/structt__vpi__error__info.html) * [Struct t\_vpi\_strengthval](https://docs.cocotb.org/en/v1.4.0/generated/struct/structt__vpi__strengthval.html) * [Struct t\_vpi\_systf\_data](https://docs.cocotb.org/en/v1.4.0/generated/struct/structt__vpi__systf__data.html) * [Struct t\_vpi\_time](https://docs.cocotb.org/en/v1.4.0/generated/struct/structt__vpi__time.html) * [Struct t\_vpi\_value](https://docs.cocotb.org/en/v1.4.0/generated/struct/structt__vpi__value.html) * [Struct t\_vpi\_vecval](https://docs.cocotb.org/en/v1.4.0/generated/struct/structt__vpi__vecval.html) * [Struct t\_vpi\_vlog\_info](https://docs.cocotb.org/en/v1.4.0/generated/struct/structt__vpi__vlog__info.html) * [Struct vhpiCbDataS](https://docs.cocotb.org/en/v1.4.0/generated/struct/structvhpiCbDataS.html) * [Struct vhpiErrorInfoS](https://docs.cocotb.org/en/v1.4.0/generated/struct/structvhpiErrorInfoS.html) * [Struct vhpiForeignDataS](https://docs.cocotb.org/en/v1.4.0/generated/struct/structvhpiForeignDataS.html) * [Struct vhpiPhysS](https://docs.cocotb.org/en/v1.4.0/generated/struct/structvhpiPhysS.html) * [Struct vhpiTimeS](https://docs.cocotb.org/en/v1.4.0/generated/struct/structvhpiTimeS.html) * [Struct vhpiValueS](https://docs.cocotb.org/en/v1.4.0/generated/struct/structvhpiValueS.html) --- # Unknown \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\* Maintaining cocotb \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\* This section describes how to maintain cocotb, i.e., the more or less frequent tasks performed by the :ref:\`cocotb maintainers \`. Managing of Issues and Pull Requests ==================================== The cocotb project makes use of GitHub labels attached to issues and pull requests to structure the development process. Each issue and pull request can have multiple labels assigned. The \`\`type\`\` labels define the type of issue or PR: - \`\`type:bug\`\`: a bug in existing functionality - \`\`type:feature\`\`: new functionality - \`\`type:cleanup\`\`: cleanup or refactoring on code, documentation, or other areas - \`\`type:deprecation\`\`: API that should warn and eventually be removed - \`\`type:change\`\`: an API breaking change that isn't a deprecation or removal - \`\`type:backport\`\`: a backport of another PR from master onto a stable branch - \`\`type:task\`\`: a generic label for anything that doesn't fall into the above The \`\`status\`\` labels give a quick impression of the current status of the issue or PR: - \`\`status:worksforme\`\`: the issue it not reproducible, or intended behavior (i.e. not a bug) - \`\`status:blocked\`\`: further progress is blocked by a dependency, e.g. other code which must be committed first. - \`\`status:needs-info\`\`: feedback from someone is required. The issue/PR text gives more details. - \`\`status:duplicate\`\`: the same issue is already being handled in another issue/PR. - \`\`status:close?\`\`: issues which can probably be closed, but need a second pair of eyes - \`\`status:needs-proprietary-testing\`\`: Help needed testing on a proprietary tool - \`\`status:out-of-scope\`\`: An issue or PR that was closed because the feature or bug was deemed to be out of scope For the use in pull requests the following additional status labels are defined: - \`\`status:needs-review\`\`: this PR needs at least one review - \`\`status:ready-for-merge\`\`: this PR is ready (according to the \`Patch Requirements <#patch-requirements>\`\_\_) to be merged - \`\`status:needs-rebase\`\`: needs a git rebase - \`\`status:needs-newsfragment\`\`: Needs a towncrier newsfragment for the changelog - \`\`status:needs-test\`\`: needs tests written - \`\`status:needs-proprietary-testing\`\`: needs testing the change in a simulator we don't have access to We occasionally find bugs in upstream projects, such as simulators, Python dependencies, CI tools, etc. The following labels are used for those issues. - \`\`upstream\`\`: marks the issue as being a issue with an upstream project - \`\`status:needs-upstream-report\`\`: the issue has been diagnosed as an upstream issue, but no upstream report has been filed - \`\`status:upstream-report-filed\`\`: the issue has been reported upstream The \`\`category\`\` labels help maintainers to filter issues which are relevant to their area of expertise: - \`\`category:OS:MacOS\`\`: Mac OS/OS X specific issues - \`\`category:OS:Linux\`\`: Linux specific issues - \`\`category:OS:Windows\`\`: Microsoft Windows-specific issues - \`\`category:simulators\`\`: simulator support, including VPI/GPI/etc. - \`\`category:simulators:activehdl\`\`: Aldec Active-HDL - \`\`category:simulators:cvc\`\`: Tachyon CVC - \`\`category:simulators:ghdl\`\`: GHDL - \`\`category:simulators:icarus\`\`: Icarus Verilog (iverilog) - \`\`category:simulators:ius\`\`: Cadence Incisive (IUS) - \`\`category:simulators:modelsim\`\`: Mentor Modelsim - \`\`category:simulators:nvc\`\`: NVC - \`\`category:simulators:questa\`\`: Mentor Questa - \`\`category:simulators:riviera\`\`: Aldec Riviera-PRO - \`\`category:simulators:vcs\`\`: Synopsys VCS - \`\`category:simulators:verilator\`\`: Verilator - \`\`category:simulators:xcelium\`\`: Cadence Xcelium - \`\`category:codebase:gpi\`\`: relating to the GPI or one of the implementation - \`\`category:codebase:pygpi\`\`: relating to the Python wrapper around the GPI (embed library and simulator module) - \`\`category:codebase:scheduler\`\`: relating to the coroutine scheduler - \`\`category:codebase:triggers\`\`: related to triggers - \`\`category:codebase:tasks\`\`: related to tasks or coroutines - \`\`category:codebase:tests\`\`: relating to code for automating test runs (regression manager) - \`\`category:codebase:handle\`\`: relating to handles - \`\`category:codebase:types\`\`: relating to modelling types - \`\`category:codebase:project-automation\`\`: relating to included project automation (makefiles, Python runner) - \`\`category:building\`\`: relating to build C/C++ libraries and extension modules - \`\`category:packaging\`\`: issues related to (PyPi) packaging, etc. - \`\`category:docs\`\`: documentation issues and fixes - \`\`category:hardware-in-the-loop\`\`: relating to real-life hardware (HIL) - \`\`category:performance\`\`: performance topics - \`\`category:ci-free\`\`: continuous integration and unit tests - \`\`category:meta\`\`: cocotb repo, maintainers, or community - \`\`category:extensions\`\`: cocotb extension modules - \`\`category:debugging\`\`: debugging features To help new contributors find a good issue to work on one more label is used (following \`GitHub standard practices <#https://help.github.com/articles/helping-new-contributors-find-your-project-with-labels/>\`\_\_): - \`\`good first issue\`\`: this issue is a good starting point for new contributors. The issue should give an actionable description of what to do to complete this task, along with contact information of a mentor for this task. cocotb explicitly uses no priority labels, as experience indicates that they provide little value. Issues and pull requests which are invalid, or where feedback is lacking for four weeks, should be closed. Cocotb Releases =============== cocotb aims to keep the \`\`master\`\` branch always in a releasable state. At least four times a year an official release should be created. It is the job of the maintainers to find a suitable time for a release, to communicate it to the community, and to coordinate it. Backport Changes ================ All changes should generally be merged into the \`\`master\`\` branch first. If those changes are also needed in a different branch, e.g., a stable branch, they need to be backported. PRs can be backported fully automated through GitHub, or semi-automated with the ability to resolve merge conflicts. Start with the automated backport process, and fall back to the manual one if necessary. Automated PR Backports ---------------------- The backporting process starts from an open or already merged PR, typically targeting the \`\`master\`\` branch. This PR can then be ported over to any of the \`\`stable/\*\`\` branches. 1. Open the \*source PR\* you'd like to backport on GitHub. 2. Add the label \`\`backport-to:STABLE\_BRANCH\_NAME\`\`, e.g. \`\`backport-to:1.9\`\` to backport a change to the branch \`\`stable/1.9\`\`. 3. If not done yet: Merge the source PR. Once the source PR is merged, backport automation (in GitHub Actions) will kick in. \* If the backport can be performed automatically (i.e., there are no merge conflicts), a new PR is opened against the stable branch. \* Otherwise, a comment is left in the source PR with instructions how to perform a manual backport. Follow the instructions below to continue. Manual PR Backport ------------------ The most convenient way to backport a PR is using the \`Backport CLI Tool \`\_, which also powers the automated backport process. 1. Install \`npx\` on your machine. 2. Configure authentication for Backport, as described at \`in their documentation \`\_. 3. In the \*master\* branch of the cocotb source tree run \`\`npx backport --pr MY\_SOURCE\_PR\`\`. Answer questions as necessary. In case of a merge conflict, Backport will ask for a manual conflict resolution. This resolution needs to happen in the separate backport repository, typically located at \`\`~/.backport/repositories/cocotb/cocotb\`\`. Backport will create a branch in your fork of the cocotb repository, and create a pull request to merge this branch into the selected stable branch, just like in the automated process. --- # Unknown \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\* Developing cocotb \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\* Setting Up a Development Environment ==================================== :ref:\`Install prerequisites to build the development version of cocotb \` and standard development tools (editor, shell, git, etc.). .. note:: Type checking and documentation generation require Python 3.11+. First, you should \`fork and clone \`\_\_ the cocotb repo to your machine. This will allow you to make changes to the cocotb source code, create pull requests, and run regressions and build documentation locally. Additionally, you will need \`doxygen \`\_\_, for building documentation; \`nox \`\_\_, for building documentation and running regression tests; and \`pre-commit \`\_\_, to check your changes before committing them. We recommend if you are using a Linux distribution to use your system package manager to install doxygen. Likewise, doxygen can be installed using the homebrew package manager on Mac OS. Windows contributors should download a binary distribution installer from the main website. \`\`nox\`\` and \`\`pre-commit\`\` are Python projects and can be installed with \`\`pip\`\`: .. code:: bash pip install nox pre-commit To enable pre-commit run the following command at the root of the cloned project to install the git hooks. The first run of pre-commit will build an environment for you, so it may take a while. Following runs should be much quicker. .. code:: bash pre-commit install When committing, pre-commit's hook will run, checking your changes for formatting, code smells, etc. You will see the lists of checks printed and whether they passed, were skipped, or failed. If any of the checks fail, it is recommended to fix them before opening a pull request, otherwise the pull request checks will fail as well. Now you are ready to contribute! Running Tests Locally ===================== First, \`set up your development environment <#setting-up-a-development-environment>\`\_\_. Our tests are managed by \`\`nox\`\`, which runs both \`\`pytest\`\` tests and our system of makefiles. The regression does not end on the first failure, but continues until all tests in the \`\`/tests\`\` and \`\`/examples\`\` directories have been run. To run the tests locally with \`\`nox\`\`, issue the following command. .. code:: bash nox -s dev\_test At the end of the regression, if there were any test failures, the tests that failed will be printed. If the tests succeed you will see the message \`\`Session tests was successful\`\` printed in green. By default the \`\`dev\_test\`\` nox session runs all simulator-agnostic tests, as well as all tests which require a simulator and can be run against Icarus Verilog. Icarus Verilog must be installed. The simulator and the toplevel language can be changed by setting the environment variables :make:var:\`SIM\` and :make:var:\`TOPLEVEL\_LANG\`. Alternatively, the simulator-specific nox sessions can be used, as described below. Selecting a Language and Simulator for Regression ================================================= cocotb can be used with multiple simulators, and can run tests against all of them. Nox provides a session for each valid simulator/language/GPI interface combination, from which one or multiple sessions can be selected. The following examples are good starting points; refer to the \`nox command-line usage documentation \`\_\_ for more information. .. code:: bash # List all available sessions. nox -l # Run all simulator-agnostic tests. nox -s dev\_test\_nosim # Run the simulator-specific tests against Xcelium, using a VHDL toplevel and # the VHPI interface. nox -s "dev\_test\_sim(sim='xcelium', toplevel\_lang='vhdl', gpi\_interface='vhpi')" # Run all simulator-specific tests against Icarus Verilog and GHDL. # Both simulators must be installed locally. nox -k "dev\_test\_sim and (icarus or ghdl)" Running Individual Tests Locally ================================ Each test under \`\`/tests/test\_cases/\*/\`\` and \`\`/examples/\*/tests/\`\` can be run individually. This is particularly useful if you want to run a particular test that fails the regression. First you must install cocotb from source by navigating to the project root directory and issuing the following command: .. code:: bash python -m pip install . On Windows, you must instead install cocotb from source like so: .. code:: bash python -m pip install --global-option build\_ext --global-option --compiler=mingw32 . Once that has been done, you can navigate to the directory containing the test you wish to run. Then you may issue an :ref:\`make \` command. For example, if you want to test with Icarus using Verilog sources: .. code:: bash make SIM=icarus TOPLEVEL\_LANG=verilog Building Documentation Locally ============================== First, \`set up your development environment <#setting-up-a-development-environment>\`\_\_. Documentation is built locally using \`\`nox\`\`. The last message in the output will contain a URL to the documentation you just built. Simply copy and paste the link into your browser to view it. The documentation will be built in the same location on your hard drive on every run, so you only have to refresh the page to see new changes. To build the documentation locally on Linux or Mac, issue the following command: .. code:: bash nox -e docs Building the documentation is not currently supported on Windows. --- # Unknown \# This file is public domain, it can be freely copied without restrictions. # SPDX-License-Identifier: CC0-1.0 # Makefile # defaults SIM ?= icarus TOPLEVEL\_LANG ?= verilog VERILOG\_SOURCES += $(PWD)/my\_design.sv # use VHDL\_SOURCES for VHDL files # TOPLEVEL is the name of the toplevel module in your Verilog or VHDL file TOPLEVEL = my\_design # MODULE is the basename of the Python test file MODULE = test\_my\_design # include cocotb's make rules to take care of the simulator setup include $(shell cocotb-config --makefiles)/Makefile.sim --- # Unknown .. \_update-indexing: \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\* Update Indexing for cocotb 2.0 \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\* cocotb 2.0 changes what types are returned when getting a value from a :ref:\`Logic-like \` or :ref:\`Array-like \` simulator object. This can require a change to the testbench code in how those values are indexed. Because this change breaks backwards compatibility silently, this document and the following set of features were added to assist users in updating the indexing in their existing tests built against cocotb 1.x. .. autoclass:: cocotb.types.IndexingChangedWarning .. envvar:: COCOTB\_INDEXING\_CHANGED\_WARNING Set this environment variable to \`\`1\`\` to cause a warning to be emitted on all :class:\`.LogicArray\` and :class:\`.Array\` indexing and slicing operations if the indexing would have changed between cocotb 1.x and 2.x. How to Find Indexing Changes ============================ Set the :envvar:\`!COCOTB\_INDEXING\_CHANGED\_WARNING\` environment variable to \`\`1\`\` and run your test. You should see warnings emitted on every line of your testbench that indices or slices a :class:\`.LogicArray\` or :class:\`.Array\` where the indexing has changed. The warning will tell you what index you used and what the new index should be. .. code-block:: console $ export COCOTB\_INDEXING\_CHANGED\_WARNING=1 $ make ... /home/user/project/tests/unit\_tests.py:160: IndexingChangedWarning: Index 0 is now 7 left\_bit = dut.signal.value\[0\] ... /home/user/project/tests/unit\_tests.py:543: IndexingChangedWarning: Index 0 is now 3 if handle.value\[i\]: /home/user/project/tests/unit\_tests.py:543: IndexingChangedWarning: Index 1 is now 2 if handle.value\[i\]: /home/user/project/tests/unit\_tests.py:543: IndexingChangedWarning: Index 2 is now 1 if handle.value\[i\]: /home/user/project/tests/unit\_tests.py:543: IndexingChangedWarning: Index 3 is now 0 if handle.value\[i\]: ... /home/user/project/tests/unit\_tests.py:232: IndexingChangedWarning: Slice 0:3 is now 7:4 field = dut.signal.value\[:3\] How to Update Indexing ====================== For static indices or slices, simply change the index or slice to the new value. .. code-block:: verilog :caption: Signal definition logic \[3:0\] signal; logic \[3:0\] array \[1:4\]; .. code-block:: python :caption: Old 0-based indexing :class: removed dut.signal.value = "1010" ... assert dut.signal.value\[0\] == 1 # index 0 is always left-most dut.array.value = \[100, 101, 102, 103\] ... assert dut.array.value\[0\] == 100 # index 0 is always left-most .. code-block:: python :caption: New HDL-based indexing (packed object / logic array) :class: new dut.signal.value = "1010" ... assert dut.signal.value\[3\] == 1 # index 3 is now the left-most dut.array.value = \[100, 101, 102, 103\] ... assert dut.array.value\[1\] == 100 # index 1 is now the left-most .. note:: If you previously used the static indices \`\`0\`\` or \`\`-1\`\` to refer to the first or last element in an array, \`\`array\[array.left\]\`\` or \`\`array\[array.right\]\`\`, respectively, may be a better spelling. When dealing with loops involving indices, there are several options, depending on your needs. If you are looping over the indices to then index each element, you can instead iterate over the array directly. This can be combined with :func:\`enumerate\` to get the \`\`0\`\`-based index of each element, if needed. .. code-block:: python :caption: Looping over indices :class: removed for i in range(len(dut.signal.value)): bit = dut.signal.value\[i\] ... .. code-block:: python :caption: Looping over elements directly :class: new for i, bit in enumerate(dut.signal.value): ... If you need to use the index value, you can loop over the \`\`array.range\`\` object to get the indices in left-to-right order. .. code-block:: verilog :caption: HDL signal being used // Two arrays using the same indices logic \[3:0\] array \[1:4\]; logic \[4:0\] doubled\_array \[1:4\]; .. code-block:: python :caption: Looping over indices :class: removed for i in range(len(dut.array.value)): # 0, 1, 2, 3 dut.doubled\_array\[i\].value = 2 \* dut.array.value\[i\] .. code-block:: python :caption: Looping over \`\`range\`\` :class: new array\_value = dut.array.value for i in array\_value.range: # 1, 2, 3, 4 dut.doubled\_array\[i\].value = 2 \* array\_value\[i\] You can also use the \`\`array.range\`\` object to translate \`\`0\`\` to \`\`len()-1\`\` indexing to the one used by :class:\`!LogicArray\` and :class:\`!Array\`. Use this as a last resort, as it is less readable and has runtime overhead compared to the other options. .. code-block:: python :class: new val = LogicArray("1010", Range(3, 0)) assert val\[0\] == 0 # index 0 is right-most ind = val.range\[0\] # 0th range value is 3 assert val\[ind\] == "1" # index 3 is left-most Gradual Update ============== The recommended approach is to update one module at a time. This is done by using the :envvar:\`PYTHONWARNINGS\` environment variable to limit which modules can emit an :class:\`!IndexingChangedWarning\`. The :envvar:\`!PYTHONWARNINGS\` value below will ignore all :class:\`!IndexingChangedWarning\` except those from the \`\`unit\_tests\`\` module. .. code-block:: console $ export PYTHONWARNINGS=ignore::cocotb.types.IndexingChangedWarning,default::cocotb.types.IndexingChangedWarning:unit\_tests $ export COCOTB\_INDEXING\_CHANGED\_WARNING=1 $ make After eliminating all warnings from one module, update the :envvar:\`!PYTHONWARNINGS\` environment variable to the next module and repeat until all modules are updated. Then rerun all tests with :envvar:\`!PYTHONWARNINGS\` unset to ensure all warnings are gone. --- # Unknown \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\* Writing cocotb Extensions \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\* This guide explains how to write cocotb extensions, with a focus on the conventions that should be followed. Cocotb gives its users a framework to build Python testbenches for hardware designs. But sometimes the functionality provided by cocotb is too low-level. One common example are bus drivers and monitors: instead of creating a bus adapter from scratch for each new project, wouldn't it be nice to share this component, and build on top it? In the verification world, such extensions are often called "verification IP" (VIP). In cocotb, such functionality can be packaged and distributed as extensions. Technically, cocotb extensions are normal Python packages, and all standard Python packaging and distribution techniques can be used. Additionally, the cocotb community has agreed on a set of conventions to make extensions easier to use and to discover. .. \_extensions-naming-conventions: Naming conventions ================== Cocotb extensions are normal Python modules which follow these naming conventions. Assuming an extension named \`\`EXTNAME\`\` (all lower-case), - the package is in the \`\`cocotbext.EXTNAME\`\` namespace, and - the distribution (package) name is prefixed with \`\`cocotbext-EXTNAME\`\`. Example: An SPI bus extension might be packaged as \`\`cocotbext-spi\`\`, and its functionality would live in the \`\`cocotbext.spi\`\` namespace. The module can then be installed with \`\`pip3 install cocotbext-spi\`\`, and used with \`\`import cocotbext.spi\`\`. Types of cocotb extensions ========================== For some types of cocotb extensions we have developed conventions which go beyond naming. These conventions help to achieve a consistent behavior across extensions of the same type. Bus extensions -------------- A cocotb extension which interacts with a bus or an interface (such as SPI or AXI) should build on top of a common set of classes to provide a uniform interface for its users. Typically, a bus extension provides three pieces of functionality: an abstraction of the bus itself, a bus driver, and a bus monitor. A bus driver is the "active" part, it drives the signals that make up the bus to request reads or writes from the bus. A bus monitor is the "passive" part, it observes signal changes on the bus and assigns meaning to them. Monitors can also check the bus behavior against a standard to ensure no invalid states are being observed. The signals which make up the bus should be grouped in a class inheriting from :class:\`cocotb\_bus.bus.Bus\`. Bus drivers should inherit from the :class:\`cocotb\_bus.drivers.BusDriver\` class. Bus monitors should inherit from the :class:\`cocotb\_bus.monitors.BusMonitor\` class. Packaging extensions ==================== To package a cocotb extension as Python package follow the :ref:\`extensions-naming-conventions\`, and the \`normal Python packaging rules \`\_. Extensions namespaced packages, implemented using the \`native namespacing \`\_ approach discussed in :pep:\`420\`. The module file hierarchy should be as follows (replace \`\`EXTNAME\`\` with the name of the extension, e.g. \`\`spi\`\`). .. code-block:: # file structure of the cocotbext-EXTNAME repository ├── cocotbext/ │ │ # No \_\_init\_\_.py here. │   └── EXTNAME/ │   └── \_\_init\_\_.py ├── README.md └── setup.py The Python source code should go into the :file:\`EXTNAME\` directory, next to the :file:\`\_\_init\_\_.py\` file. All packaging metadata goes into :file:\`setup.py\`. .. code-block:: python # Minimal setup.py. Extend as needed. from setuptools import setup, find\_namespace\_packages setup(name = 'cocotbext-EXTNAME', version = '0.1', packages = find\_namespace\_packages(include=\['cocotbext.\*'\]), install\_requires = \['cocotb'\], python\_requires = '>=3.6.2', classifiers = \[ "Programming Language :: Python :: 3", "Operating System :: OS Independent", "Topic :: Scientific/Engineering :: Electronic Design Automation (EDA)", "Framework :: cocotb"\]) With this file structure in place the cocotb extension can be installed through \`\`pip\`\` in development mode :: $ python3 -m pip install -e . Once the extension has been \`uploaded to PyPi \`\_, it can be installed by name. .. code-block: command $ python3 -m pip install cocotbext-EXTNAME To use the functionality in the extension module, import it into your testbench. .. code-block:: python # Examples for importing (parts of) the extension import cocotbext.EXTNAME from cocotbext import EXTNAME from cocotbext.EXTNAME import MyVerificationClass Code hosting ============ The source code of cocotb extensions can be hosted anywhere. If authors wish to do so, extensions can also be hosted on GitHub in the \`cocotb GitHub organization \`\_ (e.g. \`\`github.com/cocotb/cocotbext-EXTNAME\`\`). Please file a \`GitHub issue in the cocotb repository \`\_ if you'd like to discuss that. Note that hosting extensions within the cocotb organization is decided on a case-by-case basis by the cocotb maintainers. At least, a cocotb-hosted extension needs to fulfill the following requirements: \* It needs tests that can be run in order to see that the extension works and continues to work as cocotb itself changes, especially when a new release is upcoming. \* It needs documentation (preferably in Sphinx) so that users know how to use the extension. \* We must have access to the PyPi project so that we can continue to upload new releases in case the extension maintainer ("Owner") becomes unresponsive. --- # Unknown .. \_coroutines: .. \_async\_functions: .. spelling:word-list:: Async \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\* Coroutines and Tasks \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\* Testbenches built using cocotb use Python coroutines. \*Tasks\* are cocotb objects that wrap coroutines and are used to schedule concurrent execution of the testbench coroutines. While active tasks are executing, the simulation is paused. The coroutine uses the :keyword:\`await\` keyword to block on another coroutine's execution or pass control of execution back to the simulator, allowing simulation time to advance. Typically coroutines await a :class:\`~cocotb.triggers.Trigger\` object which pauses the task, and indicates to the simulator some event which will cause the task to resume execution. For example: .. code-block:: python async def wait\_10ns(): cocotb.log.info("About to wait for 10 ns") await Timer(10, unit='ns') cocotb.log.info("Simulation time has advanced by 10 ns") Coroutines may also await on other coroutines: .. code-block:: python async def wait\_100ns(): for i in range(10): await wait\_10ns() Coroutines can :keyword:\`return\` a value, so that they can be used by other coroutines. .. code-block:: python async def get\_signal(clk, signal): await RisingEdge(clk) return signal.value async def check\_signal\_changes(dut): first = await get\_signal(dut.clk, dut.signal) second = await get\_signal(dut.clk, dut.signal) assert first != second, "Signal did not change" Concurrent Execution ==================== Coroutines can be scheduled for concurrent execution with :func:\`~cocotb.start\_soon\`. These concurrently running coroutines are called :class:\`~cocotb.task.Task\`\\ s. :func:\`~cocotb.start\_soon\` schedules the coroutine for \*future\* execution, some time after the current Task yields control. .. code-block:: python @cocotb.test() async def test\_act\_during\_reset(dut): """While reset is active, toggle signals""" tb = uart\_tb(dut) # "Clock" is a built in class for toggling a clock signal Clock(dut.clk, 1, unit='ns').start() # reset\_dut is a function - # part of the user-generated "uart\_tb" class # run reset\_dut immediately before continuing await tb.reset\_dut(dut.rstn, 20) await Timer(10, unit='ns') print("Reset is still active: %d" % dut.rstn) await Timer(15, unit='ns') print("Reset has gone inactive: %d" % dut.rstn) Other tasks can be used in an await statement to suspend the current task until the other task finishes. .. code-block:: python @cocotb.test() async def test\_count\_edge\_cycles(dut, period\_ns=1, clocks=6): Clock(dut.clk, period\_ns, unit='ns').start() await RisingEdge(dut.clk) timer = Timer(period\_ns + 10, 'ns') task = cocotb.start\_soon(count\_edges\_cycles(dut.clk, clocks)) count = 0 expect = clocks - 1 while True: result = await First(timer, task) assert count <= expect, "Task didn't complete in expected time" if result is timer: cocotb.log.info("Count %d: Task still running", count) count += 1 else: break Tasks can be killed before they complete, forcing their completion before they would naturally end. .. code-block:: python @cocotb.test() async def test\_different\_clocks(dut): clk\_1mhz = Clock(dut.clk, 1.0, unit='us') clk\_250mhz = Clock(dut.clk, 4.0, unit='ns') clk\_1mhz.start() start\_time\_ns = get\_sim\_time(unit='ns') await Timer(1, unit='ns') await RisingEdge(dut.clk) edge\_time\_ns = get\_sim\_time(unit='ns') assert isclose(edge\_time\_ns, start\_time\_ns + 1000.0), "Expected a period of 1 us" clk\_1mhz.stop() # stop 1MHz clock here clk\_250mhz.start() start\_time\_ns = get\_sim\_time(unit='ns') await Timer(1, unit='ns') await RisingEdge(dut.clk) edge\_time\_ns = get\_sim\_time(unit='ns') assert isclose(edge\_time\_ns, start\_time\_ns + 4.0), "Expected a period of 4 ns" .. versionchanged:: 1.4 The \`\`cocotb.coroutine\`\` decorator is no longer necessary for :keyword:\`async def\` coroutines. :keyword:\`async def\` coroutines can be used, without the \`\`@cocotb.coroutine\`\` decorator, wherever decorated coroutines are accepted, including :keyword:\`yield\` statements and \`\`cocotb.fork\`\` (since replaced with :func:\`~cocotb.start\_soon\`). .. versionchanged:: 1.6 Added :func:\`cocotb.start\` and :func:\`cocotb.start\_soon\` scheduling functions. .. versionchanged:: 1.7 Deprecated \`\`cocotb.fork\`\`. .. versionchanged:: 2.0 Removed \`\`cocotb.fork\`\`. .. versionchanged:: 2.0 Removed \`\`cocotb.coroutine\`\`. .. versionremoved:: 2.0 Removed references to the deprecated :func:\`cocotb.start\`. Waiting For Multiple Events Simultaneously ========================================== Occasionally you'll need to wait for either one of many Tasks or Triggers to fire, or a collection of Tasks or Triggers to fire. This is what :class:\`~cocotb.triggers.First\` and :class:\`~cocotb.triggers.Combine\` provide, respectively. .. \_first-tutorial: Waiting For One Of Multiple Events ---------------------------------- :class:\`~cocotb.triggers.First\` is like awaiting multiple Triggers or Tasks at the same time, and resumes after one of the Triggers or Tasks fires. It returns the result of awaiting the Task or Trigger that fired first. Below we see it used to implement a timeout. .. code-block:: python @cocotb.test async def test\_quiesce\_or\_timeout(dut): # generate stimulus and drive it to the design for trans in generate\_transactions(): await drive(dut.intf, trans) # wait for the design to quiesce or timeout timeout = Timer(10, "us") quiesce\_task = cocotb.start\_soon(quiesce()) result = await First(timeout, quiesce\_task) assert result is not timeout, "Design has hung!" Fortunately for users timeouts are a common operation and cocotb provides :func:\`~cocotb.triggers.with\_timeout\`. The second section in the above code using it would be \`\`await with\_timeout(quiesce(), 10, "us")\`\`. .. note:: :class:\`~cocotb.triggers.First\` does \*not\* cancel Tasks that did not complete after it returns. This means that Tasks passed to it are \*still running\*. You may need to cancel those Tasks with :meth:\`.Task.cancel\`. Determining Which Task Finishes First ------------------------------------- :class:\`~cocotb.triggers.First\` can be used to determine which of multiple Tasks :meth:\`complete \` first using the following idiom. .. code-block:: python @cocotb.test async def test\_which\_finished\_first(dut): task\_A = cocotb.start\_soon(drive\_A()) task\_B = cocotb.start\_soon(drive\_B()) # Pass Task.complete rather than the Task directly. result = await First(task\_A.complete, task\_B.complete) # Compare the result against the Task's "complete" object. if result is task\_A.complete: cocotb.log.info("Input A finished first") else: cocotb.log.info("Input B finished first") .. \_combine-tutorial: Waiting For Multiple Events --------------------------- :class:\`~cocotb.triggers.Combine\` is like awaiting multiple Triggers or Tasks at the same time, but it resumes after \*all\* the listed Triggers or Tasks fire. Using the example from the previous section, we can use it to wait until both the driving and quiesce are done. .. code-block:: python @cocotb.test async def test\_wait\_for\_both(dut): # generate stimulus and drive it to the design async def drive\_transactions(): for trans in generate\_transactions(): await drive(dut.intf, trans) # wait for both the driving and quiescing to complete before continuing await Combine( cocotb.start\_soon(drive\_transactions()), cocotb.start\_soon(quiesce()) ) And of course, the sky is the limit when you compose the two. .. code-block:: python @cocotb.test async def test\_wait\_for\_both\_with\_timeout(dut): # wait for both the driving and quiescing to complete before continuing # but timeout if \*either\* the driving or settling take too long await Combine( cocotb.start\_soon(with\_timeout(drive\_transactions(), 1, "us")), cocotb.start\_soon(with\_timeout(quiesce(), 10, "us")), ) .. note:: :class:\`~cocotb.triggers.Combine\` does \*not\* cancel Tasks that did not complete if it fails with an exception. This means that Tasks passed to it are \*still running\*. You may need to cancel those Tasks with :meth:\`.Task.cancel\`. Async generators ================ Starting with Python 3.6, a :keyword:\`yield\` statement within an async function has a new meaning which matches the typical meaning of yield within regular Python code. It can be used to create a special type of generator function that can be iterated with :keyword:\`async for\`: .. code-block:: python async def ten\_samples\_of(clk, signal): for i in range(10): await RisingEdge(clk) yield signal.value # this means "send back to the for loop" @cocotb.test() async def test\_samples\_are\_even(dut): async for sample in ten\_samples\_of(dut.clk, dut.signal): assert sample % 2 == 0 More details on this type of generator can be found in :pep:\`525\`. .. \_yield-syntax: Generator-based coroutines ========================== .. versionchanged:: 2.0 This style, which used the \`\`cocotb.coroutine\`\` decorator and the yield syntax, was removed. --- # Unknown .. \_writing\_tbs: \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\* Writing Testbenches \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\* Logging ======= Cocotb uses Python's :mod:\`logging\` library, with the configuration described in :ref:\`logging-reference-section\` to provide some sensible defaults. \`\`cocotb.log.info\`\` is a good stand-in for :func:\`print\`, but user are encouraged to create their own loggers and logger hierarchy by calling :func:\`logging.getLogger\` and/or :meth:\`.Logger.getChild\`. Logging functions \`only\` log messages, they do not cause the test to fail. See :ref:\`passing\_and\_failing\_tests\` for more information on how to fail a test. .. code-block:: python import logging import cocotb @cocotb.test() async def test(dut): # Create a logger for this testbench logger = logging.getLogger("my\_testbench") logger.debug("This is a debug message") logger.info("This is an info message") logger.warning("This is a warning message") logger.error("This is an error message") logger.critical("This is a critical message") .. note:: Writing messages to the log/console using the built-in function :func:\`print\` is not recommended in cocotb testbenches. :func:\`print\` defaults to writing to \`\`stdout\`\`, which is often buffered; not only by the Python runtime, but sometimes by the simulator as well. This can make messages appear out-of-order compared to messages coming from the simulator or the :term:\`DUT\`. .. warning:: The \`\`"cocotb"\`\` and \`\`"gpi"\`\` logger namespaces and all :class:\`~logging.Logger\`\\ s on cocotb-created objects are reserved for internal use only. .. \_writing\_tbs\_accessing\_design: Accessing the design ==================== When cocotb initializes it finds the toplevel instantiation in the simulator and creates a \*handle\* called \`\`dut\`\`. Toplevel signals can be accessed using the "dot" notation used for accessing object attributes in Python. The same mechanism can be used to access signals inside the design. .. code-block:: python # Get a reference to the "clk" signal on the toplevel clk = dut.clk # Get a reference to a register "count" # in a sub-block "inst\_sub\_block" # (the instance name of a Verilog module or VHDL entity/component) count = dut.inst\_sub\_block.count .. \_writing\_tbs\_finding\_elements: Finding elements in the design ============================== To find elements of the DUT (for example, instances, signals, constants or Verilog packages) at a certain hierarchy level, you can use the :func:\`dir\` function on a handle. .. code-block:: python # Print the instances and signals (which includes the ports) of the design's toplevel cocotb.log.info(dir(dut)) # Print the instances and signals of "inst\_sub\_block" under the toplevel # which is the instance name of a Verilog module or VHDL entity/component cocotb.log.info(dir(dut.inst\_sub\_block)) # Print the packages cocotb.log.info(dir(cocotb.packages)) .. \_writing\_tbs\_assigning\_values: Assigning values to signals =========================== Values can be assigned to signals using either the :attr:\`~cocotb.handle.ValueObjectBase.value\` property of a handle object or :meth:\`~cocotb.handle.ValueObjectBase.set\` method of a handle object. .. code-block:: python # Get a reference to the "clk" signal and assign a value clk = dut.clk clk.value = 1 # Direct assignment through the hierarchy dut.input\_signal.value = 12 # Assign a value to a memory deeper in the hierarchy # ("inst\_sub\_block" and "inst\_memory" are instance names of the # respective Verilog modules or VHDL entity/components in the DUT) dut.inst\_sub\_block.inst\_memory.mem\_array\[4\].value = 2 The assignment syntax \`\`sig.value = new\_value\`\` has the same semantics as :term:\`HDL\`: writes are not applied immediately, but delayed until the next write cycle. Use :class:\`~cocotb.handle.Immediate\` to set a new value immediately. .. \_writing\_tbs\_assigning\_values\_signed\_unsigned: Signed and unsigned values -------------------------- Both signed and unsigned values can be assigned to signals using a Python int. Cocotb makes no assumptions regarding the signedness of the signal. It only considers the width of the signal, so it will allow values in the range from the minimum negative value for a signed number up to the maximum positive value for an unsigned number: \`\`-2\*\*(Nbits - 1) <= value <= 2\*\*Nbits - 1\`\` Note: assigning out-of-range values will raise an :exc:\`ValueError\`. A :class:\`~cocotb.types.LogicArray\` object can be used instead of a Python int to assign a value to signals with more fine-grained control (e.g. signed values only). .. code-block:: verilog module my\_module ( input logic clk, input logic rst, input logic \[2:0\] data\_in, output logic \[2:0\] data\_out ); .. code-block:: python # assignment of negative value dut.data\_in.value = -4 # assignment of positive value dut.data\_in.value = 7 # assignment of out-of-range values dut.data\_in.value = 8 # raises ValueError dut.data\_in.value = -5 # raises ValueError .. \_writing\_tbs\_reading\_values: Reading values from signals =========================== Values in the DUT can be accessed with the :attr:\`~cocotb.handle.ValueObjectBase.value\` property of a handle object. A common mistake is forgetting the \`\`.value\`\` which just gives you a reference to a handle (useful for defining an alias name), not the value. The Python type of a value depends on the handle's HDL type: \* Arrays of \`\`logic\`\` and subtypes of that (\`\`sfixed\`\`, \`\`unsigned\`\`, etc.) are of type :class:\`~cocotb.types.LogicArray\`. \* Integer nets and constants (\`\`integer\`\`, \`\`natural\`\`, etc.) return :class:\`int\`. \* Floating point nets and constants (\`\`real\`\`) return :class:\`float\`. \* Boolean nets and constants (\`\`boolean\`\`) return :class:\`bool\`. \* String nets and constants (\`\`string\`\`) return :class:\`bytes\`. .. todo:: Add simple example of how to use LogicArray .. \_writing\_tbs\_identifying\_tests: Identifying tests ================= Cocotb tests are identified using the :deco:\`cocotb.test\` decorator. Using this decorator will tell cocotb that this function is a special type of coroutine that is meant to either pass or fail. The :deco:\`cocotb.test\` decorator supports several keyword arguments (see section :ref:\`writing-tests\`). In most cases no arguments are passed to the decorator so cocotb tests can be written as: .. code-block:: python # A valid cocotb test @cocotb.test async def test(dut): ... # Also a valid cocotb test @cocotb.test() # added () async def test(dut): ... # Another valid cocotb test @cocotb.test( skip=cocotb.top.feature.value != 1 # skip if feature disabled ) async def test(dut): ... .. \_writing\_tbs\_concurrent\_sequential: Concurrent and sequential execution =================================== An :keyword:\`await\` will run an :keyword:\`async\` coroutine and wait for it to complete. The called coroutine "blocks" the execution of the current coroutine. Wrapping the call in :func:\`~cocotb.start\_soon\` runs the coroutine concurrently, allowing the current coroutine to continue executing. At any time you can await the result of a :class:\`~cocotb.task.Task\`, which will block the current coroutine's execution until the task finishes. The following example shows these in action: .. code-block:: python # A coroutine async def reset\_dut(reset\_n, duration\_ns): reset\_n.value = 0 await Timer(duration\_ns, unit="ns") reset\_n.value = 1 cocotb.log.debug("Reset complete") @cocotb.test() async def parallel\_example(dut): reset\_n = dut.reset # Execution will block until reset\_dut has completed await reset\_dut(reset\_n, 500) cocotb.log.debug("After reset") # Run reset\_dut concurrently reset\_thread = cocotb.start\_soon(reset\_dut(reset\_n, duration\_ns=500)) # This timer will complete before the timer in the concurrently executing "reset\_thread" await Timer(250, unit="ns") cocotb.log.debug("During reset (reset\_n = %s)" % reset\_n.value) # Wait for the other thread to complete await reset\_thread cocotb.log.debug("After reset") See :ref:\`coroutines\` for more examples of what can be done with coroutines. .. \_writing\_tbs\_assigning\_values\_forcing\_freezing: Forcing and freezing signals ============================ In addition to regular value assignments (deposits), signals can be forced to a predetermined value or frozen at their current value. To achieve this, the various actions described in :ref:\`assignment-methods\` can be used. .. autolink-preface:: from cocotb.handle import Deposit, Force, Freeze, Release .. code-block:: python # Deposit action dut.my\_signal.value = 12 dut.my\_signal.value = Deposit(12) # equivalent syntax # Force action dut.my\_signal.value = Force(12) # my\_signal stays 12 until released # Release action dut.my\_signal.value = Release() # Reverts any force/freeze assignments # Freeze action dut.my\_signal.value = Freeze() # my\_signal stays at current value until released .. warning:: Not all simulators support these features; refer to the :ref:\`simulator-support\` section for details or to \`issues with label "upstream" \`\_ .. \_writing\_tbs\_accessing\_underscore\_identifiers: Accessing identifiers starting with an underscore or invalid Python names ========================================================================= The attribute syntax of \`\`dut.\_some\_signal\`\` cannot be used to access an identifier that starts with an underscore (\`\`\_\`\`, as is valid in Verilog) because we reserve such names for cocotb-internals, thus the access will raise an :exc:\`AttributeError\`. Both SystemVerilog and VHDL allow developers to create signals or nets with non-standard characters by using special syntax. These objects are generally not accessible using attribute syntax since attributes in Python must follow a strict form. All named objects, including those with the aforementioned limitations, can be accessed using index syntax. .. code-block:: python dut\["\_some\_signal"\] # begins with underscore dut\["\\\\!WOOOOW!\\\\"\] # escaped identifier (Verilog), extended identifier (VHDL) .. \_writing\_tbs\_accessing\_verilog\_packages: Accessing Verilog packages ========================== Verilog packages are accessible via :data:\`cocotb.packages\`. Depending on the simulator, packages may need to be imported in the compilation unit scope or inside a module in order to be discoverable. Also note, the \`\`$unit\`\` pseudo-package is implemented differently between simulators. It may appear as one or more attributes here depending on the number of compilation units. .. code-block:: verilog package my\_package; parameter int foo = 7 endpackage .. code-block:: python # prints "7" cocotb.log.info(cocotb.packages.my\_package.foo.value) .. \_passing\_and\_failing\_tests: Passing and failing tests ========================= When cocotb tests complete execution, they have either \`passed\` or \`failed\`. In general, if a test coroutine completes without raising an :exc:\`!Exception\`, or if the test coroutine or any running :class:\`~cocotb.task.Task\` calls :func:\`cocotb.pass\_test\`, the test is considered to have \`passed\`. Also, if a test raises a :exc:\`~asyncio.CancelledError\`, or is :keyword:\`await\`\\ ing a :class:\`!Task\` that is cancelled and does not handle it (or re-raises it), the test will end immediately but it will have \`passed\`. Below are examples of \`passing\` tests. .. code-block:: python @cocotb.test() async def test(dut): assert 2 > 1 # assertion is correct, then the coroutine ends @cocotb.test() async def test(dut): cocotb.pass\_test("Reason") # ends test with success early assert 1 > 2 # this would fail, but it isn't run because the test was ended early @cocotb.test() async def test(dut): async def ends\_test\_with\_pass(): cocotb.pass\_test("Reason") cocotb.start\_soon(ends\_test\_with\_pass()) await Timer(10, 'ns') @cocotb.test() async def test(dut): async def cancelled\_after\_time(): await Timer(1, unit='ns') raise CancelledError t = cocotb.start\_soon(cancelled\_after\_time()) await t A passing test will print the following output. .. code-block:: 0.00ns INFO Test Passed: test A cocotb test is considered to have \`failed\` if the test coroutine or any running :class:\`~cocotb.task.Task\` fails an :keyword:\`assert\` statement, fails :func:\`pytest.raises\` or :func:\`pytest.warns\` checks, or raises any other :exc:\`!Exception\` besides :exc:\`!CancelledError\`. Below are examples of \`failed\` tests that failed assertion statements. .. code-block:: python @cocotb.test() async def test(dut): assert 1 > 2, "Testing the obvious" @cocotb.test() async def test(dut): async def fails\_test(): assert 1 > 2 cocotb.start\_soon(fails\_test()) await Timer(10, 'ns') When a test fails, a stacktrace is printed. If :mod:\`pytest\` is installed and assert statements are used, a more informative stacktrace is printed which includes the values that caused the assert to fail. For example, see the output for the first test from above. .. code-block:: 0.00ns ERROR Test Failed: test (result was AssertionError) Traceback (most recent call last): File "test.py", line 3, in test assert 1 > 2, "Testing the obvious" AssertionError: Testing the obvious Below are examples of \`failed\` tests that raised an :exc:\`!Exception\`. .. code-block:: python @cocotb.test() async def test(dut): await coro\_that\_does\_not\_exist() # NameError @cocotb.test() async def test(dut): async def coro\_with\_an\_error(): dut.signal\_that\_does\_not\_exist.value = 1 # AttributeError cocotb.start\_soon(coro\_with\_an\_error()) await Timer(10, 'ns') When a test ends with an :exc:\`!Exception\`, a stacktrace is printed. For example, see the below output for the first test from above. .. code-block:: 0.00ns ERROR Test Failed: test (result was NameError) Traceback (most recent call last): File "test.py", line 3, in test await coro\_that\_does\_not\_exist() # NameError NameError: name 'coro\_that\_does\_not\_exist' is not defined In summary: +--------------+--------------------------------------------------------------------------+ || Test Passed || Test ends without raising :exc:\`!Exception\`. | || || Test or Task calls :func:\`cocotb.pass\_test\`. | || || Test raises :exc:\`~asyncio.CancelledError\`. | +--------------+--------------------------------------------------------------------------+ || Test Failed || Test fails an :keyword:\`assert\` statement. | || || Test or Task raises :exc:\`AssertionError\`. | || || Test or Task fails :func:\`pytest.raises\` or :func:\`pytest.warns\` check. | || || Test or Task raises any other :exc:\`!Exception\`. | +--------------+--------------------------------------------------------------------------+ .. note:: For the purpose of denoting expected test failures that should be marked as passed, and differentiating between specific types of failures, see the \`\`expect\_fail\`\` and \`\`expect\_error\`\` arguments of the :func:\`cocotb.test\` decorator. Cleaning up resources ===================== When you call :meth:\`.Task.cancel\` on a Task, a :exc:\`~asyncio.CancelledError\` will be raised which can be caught to run cleanup or end-of-test code. This will also trigger the finalization routine of any :term:\`context manager\`. When a test ends, the cocotb runtime will call :meth:\`.Task.cancel\` on all running tasks started with :func:\`cocotb.start\_soon\`, allowing for end-of-test cleanup. .. code-block:: python @cocotb.test() async def test(dut): async def drive\_data\_valid(intf, sequence): try: intf.valid.value = 1 for data in sequence: intf.data.value = data finally: # Ensure that valid is brought back to 0 when the test ends, # the Task is explicitly cancelled, or if the Task ends normally. intf.valid.value = 0 # Generate sequence sequence = ... # Run driver Task concurrently cocotb.start\_soon(drive\_data\_valid(dut.data\_in, sequence)) # Do other stuff .. note:: If a :exc:\`!CancelledError\` is handled in a Task and not re-raised, the test will be considered to have :ref:\`errored \`. This is to prevent Tasks from attempting to ignore cancellation. For that reason, it is recommended to use :keyword:\`finally\` rather than specifically catching :exc:\`!CancelledError\`. --- # Unknown \# This file is public domain, it can be freely copied without restrictions. # SPDX-License-Identifier: CC0-1.0 # test\_my\_design.py (simple) import cocotb from cocotb.triggers import Timer @cocotb.test() async def my\_first\_test(dut): """Try accessing the design.""" for cycle in range(10): dut.clk.value = 0 await Timer(1, units="ns") dut.clk.value = 1 await Timer(1, units="ns") dut.\_log.info("my\_signal\_1 is %s", dut.my\_signal\_1.value) assert dut.my\_signal\_2.value\[0\] == 0, "my\_signal\_2\[0\] is not 0!" # test\_my\_design.py (extended) import cocotb from cocotb.triggers import Timer from cocotb.triggers import FallingEdge async def generate\_clock(dut): """Generate clock pulses.""" for cycle in range(10): dut.clk.value = 0 await Timer(1, units="ns") dut.clk.value = 1 await Timer(1, units="ns") @cocotb.test() async def my\_second\_test(dut): """Try accessing the design.""" await cocotb.start(generate\_clock(dut)) # run the clock "in the background" await Timer(5, units="ns") # wait a bit await FallingEdge(dut.clk) # wait for falling edge/"negedge" dut.\_log.info("my\_signal\_1 is %s", dut.my\_signal\_1.value) assert dut.my\_signal\_2.value\[0\] == 0, "my\_signal\_2\[0\] is not 0!" --- # Unknown // This file is public domain, it can be freely copied without restrictions. // SPDX-License-Identifier: CC0-1.0 module my\_design(input logic clk); timeunit 1ns; timeprecision 1ns; logic my\_signal\_1; logic my\_signal\_2; assign my\_signal\_1 = 1'bx; assign my\_signal\_2 = 0; endmodule --- # Unknown \*\*\*\*\*\*\*\* Triggers \*\*\*\*\*\*\*\* Triggers are used to indicate when the cocotb scheduler should resume coroutine execution. To use a trigger, a coroutine should :keyword:\`await\` it. This will cause execution of the current coroutine to pause. When the trigger fires, execution of the paused coroutine will resume: .. code-block:: python async def coro(): print("Some time before a clock edge") await RisingEdge(clk) print("Immediately after the rising clock edge") See :ref:\`triggers\` for a list of available triggers. --- # Unknown .. \_rotating-logger: \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\* Rotating Log Files \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\* The following is an example of how to support rotation of log files. It will keep the newest 3 files which are at most 5 MiB in size. See also :ref:\`logging-reference-section\`, and the Python documentation for :class:\`logging.handlers.RotatingFileHandler\`. .. code-block:: python from logging.handlers import RotatingFileHandler from cocotb.logging import SimLogFormatter root\_logger = logging.getLogger() # undo the setup cocotb did for handler in root\_logger.handlers: root\_logger.removeHandler(handler) handler.close() # do whatever configuration you want instead file\_handler = RotatingFileHandler("rotating.log", maxBytes=(5 \* 1024 \* 1024), backupCount=2) file\_handler.setFormatter(SimLogFormatter()) root\_logger.addHandler(file\_handler) --- # Unknown .. \_custom-flows: \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\* Extending Existing Build Flows \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\* In order to extend an existing build flow for use with cocotb, this chapter shows the minimum settings to be done. .. note:: These instructions are an unsupported alternative to using the Makefiles provided by cocotb. The \`\`$(cocotb-config ...)\`\` syntax for executing \`\`cocotb-config\`\` works in the bash shell; adapt for your scripting language as needed. For all simulators, the following environment variables need to be set: \* Define :envvar:\`LIBPYTHON\_LOC\` using \`\`$(cocotb-config --libpython)\`\`. \* Define :envvar:\`PYGPI\_PYTHON\_BIN\` using \`\`$(cocotb-config --python-bin)\`\`. \* Define :envvar:\`COCOTB\_TEST\_MODULES\` with the name of the Python module(s) containing your testcases. See the sections below for additional settings to be done, depending on the simulator. .. \_custom-flows-icarus: Icarus Verilog ============== \* Call the \`\`vvp\`\` executable with the options \`\`-M $(cocotb-config --lib-dir) -m $(cocotb-config --lib-name vpi icarus)\`\`. Verilator ========= \* Extend the call to \`\`verilator\`\` with these options: .. code-block:: --vpi --public-flat-rw --prefix Vtop \\ -LDFLAGS "-Wl,-rpath,$(cocotb-config --lib-dir) \\ -L$(cocotb-config --lib-dir) \\ -lcocotbvpi\_verilator" \\ $(cocotb-config --share)/lib/verilator/verilator.cpp \* Run Verilator's makefile as follows: \`\`CPPFLAGS="-std=c++11" make -f Vtop.mk\`\` .. \_custom-flows-vcs: Synopsys VCS ============ \* Create a file :file:\`pli.tab\` with the content \`\`acc+=rw,wn:\*\`\` (or equivalent) to allow cocotb to access values in the design. \* Extend the \`\`vcs\`\` call with the options \`\`+vpi -P pli.tab -load $(cocotb-config --lib-name-path vpi vcs)\`\`. .. \_custom-flows-aldec: .. \_custom-flows-riviera: Aldec Riviera-PRO ================= \* The \`\`asim\`\` call needs the \`\`+access +w\_nets\`\` option set to allow cocotb to access values in the design. .. tab-set:: .. tab-item:: Design with a VHDL Toplevel For a design with a VHDL toplevel, call \`\`asim\`\` with the option \`\`-loadvhpi $(cocotb-config --lib-name-path vhpi riviera):vhpi\_startup\_routines\_bootstrap\`\`. Set the :envvar:\`GPI\_EXTRA\` environment variable to \`\`$(cocotb-config --lib-name-path vpi riviera):cocotbvpi\_entry\_point\`\` if there are also (System)Verilog modules in the design. .. tab-item:: Design with a (System)Verilog Toplevel For a design with a (System)Verilog toplevel, call \`\`alog\`\` and \`\`asim\`\` with the option \`\`-pli $(cocotb-config --lib-name-path vpi riviera)\`\`. Set the :envvar:\`GPI\_EXTRA\` environment variable to \`\`$(cocotb-config --lib-name-path vhpi riviera):cocotbvhpi\_entry\_point\`\` if there are also VHDL modules in the design. .. \_custom-flows-activehdl: Aldec Active-HDL ================ \* The \`\`asim\`\` call needs the \`\`+access +w\_nets\`\` option set to allow cocotb to access values in the design. .. tab-set:: .. tab-item:: Design with a VHDL Toplevel For a design with a VHDL toplevel, call \`\`asim\`\` with the option \`\`-loadvhpi $(cocotb-config --lib-name-path vhpi activehdl):vhpi\_startup\_routines\_bootstrap\`\`. Set the :envvar:\`GPI\_EXTRA\` environment variable to \`\`$(cocotb-config --lib-name-path vpi activehdl):cocotbvpi\_entry\_point\`\` if there are also (System)Verilog modules in the design. .. tab-item:: Design with a (System)Verilog Toplevel For a design with a (System)Verilog toplevel, call \`\`alog\`\` and \`\`asim\`\` with the option \`\`-pli $(cocotb-config --lib-name-path vpi activehdl)\`\`. Set the :envvar:\`GPI\_EXTRA\` environment variable to \`\`$(cocotb-config --lib-name-path vhpi activehdl):cocotbvhpi\_entry\_point\`\` if there are also VHDL modules in the design. .. \_custom-flows-siemens: Mentor/Siemens EDA Questa and Modelsim ====================================== .. tab-set:: Questa supports two different flows: the traditional flow using \`\`vsim\`\`, which is also used by ModelSim, and a modern alternative using \`\`qrun\`\`. .. tab-item:: Design with a VHDL Toplevel For a design with a VHDL toplevel, call the \`\`vsim\`\` or \`\`qrun\`\` executable with the option \`\`-foreign "cocotb\_init $(cocotb-config --lib-name-path fli questa)"\`\`. Set the :envvar:\`GPI\_EXTRA\` environment variable to \`\`$(cocotb-config --lib-name-path vpi questa):cocotbvpi\_entry\_point\`\` if there are also (System)Verilog modules in the design. .. tab-item:: Design with a (System)Verilog Toplevel For a design with a (System)Verilog toplevel, call the \`\`vsim\`\` or \`\`qrun\`\` executable with the option \`\`-pli $(cocotb-config --lib-name-path vpi questa)\`\`. Set the :envvar:\`GPI\_EXTRA\` environment variable to \`\`$(cocotb-config --lib-name-path fli questa):cocotbfli\_entry\_point\`\` if there are also VHDL modules in the design. .. \_custom-flows-cadence: Cadence Incisive and Xcelium ============================ \* The \`\`xrun\`\` call (or \`\`xmelab\`\` in multi-step mode) needs the \`\`-access +rwc\`\` (or equivalent, e.g. :samp:\`-afile {afile}\`) option set to allow cocotb to access values in the design. .. tab-set:: .. tab-item:: Design with a VHDL Toplevel For a design with a VHDL toplevel, call the \`\`xrun\`\` or \`\`xmelab\`\` executable with the options \`\`-NEW\_VHPI\_PROPAGATE\_DELAY -loadvpi $(cocotb-config --lib-name-path vpi xcelium):vlog\_startup\_routines\_bootstrap\`\`. Set the :envvar:\`GPI\_EXTRA\` environment variable to \`\`$(cocotb-config --lib-name-path vhpi xcelium):cocotbvhpi\_entry\_point\`\`. This is because directly loading the VHPI library causes an error in Xcelium, so always load the VPI library and supply VHPI via \`\`GPI\_EXTRA\`\`. .. tab-item:: Design with a (System)Verilog Toplevel For a design with a (System)Verilog toplevel, call the \`\`xrun\`\` or \`\`xmelab\`\` executable with the option \`\`-loadvpi $(cocotb-config --lib-name-path vpi xcelium):vlog\_startup\_routines\_bootstrap\`\`. Set the :envvar:\`GPI\_EXTRA\` environment variable to \`\`$(cocotb-config --lib-name-path vhpi xcelium):cocotbvhpi\_entry\_point\`\` if there are also VHDL modules in the design. .. \_custom-flows-ghdl: GHDL ==== \* Extend the \`\`ghdl -r\`\` call with the option \`\`--vpi=$(cocotb-config --lib-name-path vpi ghdl)\`\`. .. \_custom-flows-nvc: NVC === \* Extend the \`\`nvc -r\`\` call with the option \`\`--load=$(cocotb-config --lib-name-path vhpi nvc)\`\`. .. note:: It is recommended to add \`\`--preserve-case\`\` to build arguments. This is standards-compliant behavior and may become default behavior in NVC. .. \_custom-flows-cvc: Tachyon DA CVC ============== \* Extend the \`\`cvc64\`\` call with the option \`\`+interp +acc+2 +loadvpi=$(cocotb-config --lib-name-path vpi cvc):vlog\_startup\_routines\_bootstrap\`\`. .. \_custom-flows-dsim: Siemens DSim ============ \* Extend the \`\`dsim\`\` call with the option \`\`-pli\_lib $(cocotb-config --lib-name-path vpi dsim) +acc+rwcbfsWF\`\`. --- # Unknown ################################## The cocotb \`\`regulator\`\` Testbench ################################## .. versionadded:: 1.5 This is the testbench :mod:\`test\_regulator\` for the design \`\`regulator\`\` showing how cocotb can be used in an analog-mixed signal (AMS) simulation. .. note:: The analog probe module used in this testcase is currently only implemented for the Cadence Incisive and Xcelium simulators (with the AMS option available). Help is appreciated to provide equivalent modules for other simulators. \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\* Overview Schematic \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\* .. image:: diagrams/svg/example\_regulator.svg :width: 100% \*\*\*\*\*\*\*\*\*\* The Design \*\*\*\*\*\*\*\*\*\* The design \`\`i\_regulator\`\` consists of a trimmable regulator model written in Verilog-AMS (instance name \`\`i\_regulator\_block\`\`), and load resistor (instance name \`\`i\_resistor\`\`). .. literalinclude:: ../../examples/mixed\_signal/hdl/regulator.sv :caption: regulator.sv :language: systemverilog :start-at: module regulator The regulator block itself is modeled as shown below: .. literalinclude:: ../../examples/mixed\_signal/hdl/regulator\_block.vams :caption: regulator\_block.vams :language: systemverilog :start-at: \`include "disciplines.vams" \*\*\*\*\*\*\*\*\*\*\*\*\* The Testbench \*\*\*\*\*\*\*\*\*\*\*\*\* The testbench consists of both an :term:\`HDL\` part and a Python/cocotb part. While having HDL as part of the testbench is not common with cocotb, it is perfectly possible. The HDL part of the Testbench ============================= The testbench HDL part is written in SystemVerilog and instantiates the design described above as \`\`i\_regulator\`\`. It also contains a probe module for analog values as instance \`\`i\_analog\_probe\`\` — imagine this being a multimeter that you quickly connect to different nodes in the design, measuring either voltage or current. .. literalinclude:: ../../examples/mixed\_signal/hdl/tb\_regulator.sv :caption: tb\_regulator.sv :language: systemverilog :start-at: import nettypes\_pkg The probe module can capture voltage and current of a node specified by \`\`node\_to\_probe\`\` (a string in this module containing a hierarchical path). The capturing occurs whenever there is an edge on the logic signals \`\`probe\_voltage\_toggle\`\` or \`\`probe\_current\_toggle\`\`. The captured values can be read on real-value signals \`\`voltage\`\` and \`\`current\`\` in this module. Here is the capture code for \`\`voltage\`\` with the "user-interface" highlighted: .. literalinclude:: ../../examples/mixed\_signal/hdl/analog\_probe\_cadence.sv :caption: analog\_probe\_cadence.sv :language: systemverilog :start-at: var string node\_to\_probe :end-at: end // probe\_voltage :emphasize-lines: 1-4 :dedent: 2 The cocotb part of the Testbench ================================ test\_regulator\_plot ------------------- The testcase first sets a \`\`vdd\`\` voltage and three different trim values, saving the resulting output voltage \`\`vout\`\` for each. The saved data is written as a PNG file containing a graph. .. note:: This testcase depends on \`matplotlib \`\_. .. image:: regulator.png To run this testcase, call: .. code-block:: bash make SIM=xcelium COCOTB\_TOPLEVEL=tb\_regulator COCOTB\_TEST\_MODULES=test\_regulator\_plot test\_regulator\_trim ------------------- This testcase runs an automatic trimming routine :meth:\`~test\_regulator.Regulator\_TB.find\_trim\_val()\` to find the best trim value for a given target voltage. The determined trim value and the resulting regulator output voltage are printed to the console. .. code-block:: bash 0.00ns INFO Running trimming algorithm for target voltage 3.013 V 3.00ns INFO Best trimming value is -1 --> voltage is 3.1 V (difference to target is 0.087 V) Note that the output voltage does not exactly hit the target value because of the discrete nature of the trim steps. To run this testcase, call: .. code-block:: bash make SIM=xcelium COCOTB\_TOPLEVEL=tb\_regulator COCOTB\_TEST\_MODULES=test\_regulator\_trim --- # Unknown .. \_analog\_model: ######################### Models of Analog Circuits ######################### .. versionadded:: 1.6 This is the example :mod:\`analog\_model\` showing how to use Python models for analog circuits together with a digital part. For an FPGA, these analog circuits would be implemented off-chip, while for an ASIC, they would usually co-exist with the digital part on the same die. The Python model consists of an Analog Front-End (AFE) in file :file:\`afe.py\` containing a Programmable Gain Amplifier (PGA) with a selectable gain of \`\`5.0\`\` and \`\`10.0\`\`, and a 13-bit Analog-to-Digital Converter (ADC) with a reference voltage of \`\`2.0 V\`\`. These analog models hand over data via a blocking :class:\`cocotb.queue.Queue\`. The digital part (in :file:\`digital.sv\`) monitors the measurement value converted by the ADC and selects the gain of the PGA based on the received value. A test :file:\`test\_analog\_model.py\` exercises these submodules. When running the example, you will get the following output: .. code-block:: none 0.00ns INFO ...test\_analog\_model.0x7ff913700490 decorators.py:313 in \_advance Starting test: "test\_analog\_model" Description: Exercise an Analog Front-end and its digital controller. 1001.00ns INFO cocotb.digital test\_analog\_model.py:55 in test\_analog\_model AFE converted input value 0.1V to 2047 3000.00ns (digital) HDL got meas\_val=2047 (0x07ff) 3000.00ns (digital) PGA gain select was 0 --> calculated AFE input value back to 0.099963 3000.00ns (digital) Measurement value is less than 30% of max, switching PGA gain from 5.0 to 10.0 7301.00ns INFO cocotb.digital test\_analog\_model.py:55 in test\_analog\_model AFE converted input value 0.1V to 4095 9000.00ns (digital) HDL got meas\_val=4095 (0x0fff) 9000.00ns (digital) PGA gain select was 1 --> calculated AFE input value back to 0.099988 13301.00ns INFO cocotb.digital test\_analog\_model.py:55 in test\_analog\_model AFE converted input value 0.0V to 0 15000.00ns (digital) HDL got meas\_val=0 (0x0000) 15000.00ns (digital) PGA gain select was 1 --> calculated AFE input value back to 0.000000 Saturating measurement value 10238 to \[0:8191\]! 19301.00ns INFO cocotb.digital test\_analog\_model.py:55 in test\_analog\_model AFE converted input value 0.25V to 8191 21000.00ns (digital) HDL got meas\_val=8191 (0x1fff) 21000.00ns (digital) PGA gain select was 1 --> calculated AFE input value back to 0.200000 21000.00ns (digital) Measurement value is more than 70% of max, switching PGA gain from 10.0 to 5.0 25301.00ns INFO cocotb.digital test\_analog\_model.py:55 in test\_analog\_model AFE converted input value 0.25V to 5119 27000.00ns (digital) HDL got meas\_val=5119 (0x13ff) 27000.00ns (digital) PGA gain select was 0 --> calculated AFE input value back to 0.249982 30301.00ns INFO cocotb.regression regression.py:364 in \_score\_test Test Passed: test\_analog\_model You can view the source code of the example by clicking the file names below. .. dropdown:: :file:\`afe.py\` :icon: file .. literalinclude:: ../../examples/analog\_model/afe.py :language: python .. dropdown:: :file:\`digital.sv\` :icon: file .. literalinclude:: ../../examples/analog\_model/digital.sv :language: systemverilog .. dropdown:: :file:\`test\_analog\_model.py\` :icon: file .. literalinclude:: ../../examples/analog\_model/test\_analog\_model.py :language: python .. dropdown:: :file:\`Makefile\` :icon: file .. literalinclude:: ../../examples/analog\_model/Makefile :language: make --- # Unknown ############################### The cocotb \`\`rescap\`\` Testbench ############################### .. versionadded:: 1.5 This is the testbench :mod:\`test\_rescap\` for the design \`\`rescap\`\` showing how cocotb can be used in an analog-mixed signal (AMS) simulation. .. note:: The analog probe module used in this testcase is currently only implemented for the Cadence Incisive and Xcelium simulators (with the AMS option available). Help is appreciated to provide equivalent modules for other simulators. \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\* Overview Schematic \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\* .. image:: diagrams/svg/example\_rescap.svg :width: 100% \*\*\*\*\*\*\*\*\*\* The Design \*\*\*\*\*\*\*\*\*\* The design consists of a resistor and capacitor model (both written in Verilog-AMS) connected in series in a SystemVerilog module: .. literalinclude:: ../../examples/mixed\_signal/hdl/rescap.sv :caption: rescap.sv :language: systemverilog :start-at: // the design-under-test \*\*\*\*\*\*\*\*\*\*\*\*\* The Testbench \*\*\*\*\*\*\*\*\*\*\*\*\* The testbench consists of both an :term:\`HDL\` part and a Python/cocotb part. While having HDL as part of the testbench is not common with cocotb, it is perfectly possible. The HDL part of the Testbench ============================= The testbench :term:\`HDL\` part is written in SystemVerilog and instantiates the design described above as \`\`i\_rescap\`\`. It also contains a probe module for analog values as instance \`\`i\_analog\_probe\`\` — imagine this being a multimeter that you quickly connect to different nodes in the design, measuring either voltage or current. .. literalinclude:: ../../examples/mixed\_signal/hdl/tb\_rescap.sv :caption: tb\_rescap.sv :language: systemverilog :start-at: import nettypes\_pkg The probe module can capture voltage and current of a node specified by \`\`node\_to\_probe\`\` (a string in this module containing a hierarchical path). The capturing occurs whenever there is an edge on the logic signals \`\`probe\_voltage\_toggle\`\` or \`\`probe\_current\_toggle\`\`. The captured values can be read on real-value signals \`\`voltage\`\` and \`\`current\`\` in this module. Here is the capture code for \`\`voltage\`\` with the "user-interface" highlighted: .. literalinclude:: ../../examples/mixed\_signal/hdl/analog\_probe\_cadence.sv :caption: analog\_probe\_cadence.sv :language: systemverilog :start-at: var string node\_to\_probe :end-at: end // probe\_voltage :emphasize-lines: 1-4 :dedent: 2 The cocotb part of the Testbench ================================ \`\`test\_rescap\_minimalist\`\` -------------------------- This is a very minimalist testcase. To run it, call: .. code-block:: bash make SIM=xcelium COCOTB\_TOPLEVEL=tb\_rescap COCOTB\_TEST\_MODULES=test\_rescap\_minimalist The testcase supplies \`\`vdd\`\`, measures some pairs of voltage and current at \`\`vout\`\` (same as the \`\`p\`\` terminal of the capacitor), spaced 50 ns apart, and prints the values as shown below. .. code-block:: bash 50.00ns INFO tb\_hdl.i\_analog\_probe@tb\_rescap.i\_rescap.vout=2.03e-14 V -2.996e-07 A 100.00ns INFO tb\_hdl.i\_analog\_probe@tb\_rescap.i\_rescap.vout=3.029 V 2.67e-18 A 150.00ns INFO tb\_hdl.i\_analog\_probe@tb\_rescap.i\_rescap.vout=4.862 V 3.574e-18 A 200.00ns INFO tb\_hdl.i\_analog\_probe@tb\_rescap.i\_rescap.vout=5.975 V 6.285e-18 A 250.00ns INFO tb\_hdl.i\_analog\_probe@tb\_rescap.i\_rescap.vout=6.652 V 6.171e-18 A 300.01ns INFO tb\_hdl.i\_analog\_probe@tb\_rescap.i\_rescap.vout=7.063 V 6.033e-18 A There is no current flowing out of the \`\`vout\`\` terminal, so the current measurement always yields zero (within the accuracy of the analog solver). \`\`test\_rescap\`\` --------------- This is a more advanced testcase. .. note:: This testcase depends on \`matplotlib \`\_. The cocotb part of the testbench provides functions to: \* do the sampling of voltage and current of a given node (:meth:\`~test\_rescap.ResCap\_TB.get\_sample\_data()\`), \* plot the sampled data to a file (:meth:\`~test\_rescap.ResCap\_TB.plot\_data()\`). The testcase supplies first a positive voltage to the circuit at \`\`vdd\`\`, followed by a negative voltage, thus charging the capacitor in opposite directions. The following graph shows the charge curve. .. image:: rescap.png There is no current flowing out of this output voltage terminal, so the current measurement always yields zero. To run this testcase, call: .. code-block:: bash make SIM=xcelium COCOTB\_TOPLEVEL=tb\_rescap COCOTB\_TEST\_MODULES=test\_rescap --- # Unknown \# This file is public domain, it can be freely copied without restrictions. # SPDX-License-Identifier: CC0-1.0 # Makefile # defaults SIM ?= icarus TOPLEVEL\_LANG ?= verilog VERILOG\_SOURCES += $(PWD)/my\_design.sv # use VHDL\_SOURCES for VHDL files # TOPLEVEL is the name of the toplevel module in your Verilog or VHDL file TOPLEVEL = my\_design # MODULE is the basename of the Python test file MODULE = test\_my\_design # include cocotb's make rules to take care of the simulator setup include $(shell cocotb-config --makefiles)/Makefile.sim --- # Unknown \# This file is public domain, it can be freely copied without restrictions. # SPDX-License-Identifier: CC0-1.0 # Makefile # defaults SIM ?= icarus TOPLEVEL\_LANG ?= verilog VERILOG\_SOURCES += $(PWD)/my\_design.sv # use VHDL\_SOURCES for VHDL files # TOPLEVEL is the name of the toplevel module in your Verilog or VHDL file TOPLEVEL = my\_design # MODULE is the basename of the Python test file MODULE = test\_my\_design # include cocotb's make rules to take care of the simulator setup include $(shell cocotb-config --makefiles)/Makefile.sim --- # Unknown \# This file is public domain, it can be freely copied without restrictions. # SPDX-License-Identifier: CC0-1.0 # test\_my\_design.py (simple) import cocotb from cocotb.triggers import Timer @cocotb.test() async def my\_first\_test(dut): """Try accessing the design.""" for cycle in range(10): dut.clk.value = 0 await Timer(1, units="ns") dut.clk.value = 1 await Timer(1, units="ns") dut.\_log.info("my\_signal\_1 is %s", dut.my\_signal\_1.value) assert dut.my\_signal\_2.value\[0\] == 0, "my\_signal\_2\[0\] is not 0!" # test\_my\_design.py (extended) import cocotb from cocotb.triggers import Timer from cocotb.triggers import FallingEdge async def generate\_clock(dut): """Generate clock pulses.""" for cycle in range(10): dut.clk.value = 0 await Timer(1, units="ns") dut.clk.value = 1 await Timer(1, units="ns") @cocotb.test() async def my\_second\_test(dut): """Try accessing the design.""" await cocotb.start(generate\_clock(dut)) # run the clock "in the background" await Timer(5, units="ns") # wait a bit await FallingEdge(dut.clk) # wait for falling edge/"negedge" dut.\_log.info("my\_signal\_1 is %s", dut.my\_signal\_1.value) assert dut.my\_signal\_2.value\[0\] == 0, "my\_signal\_2\[0\] is not 0!" --- # Unknown .. \_howto-python-runner: \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\* Building HDL and Running Tests \*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\*\* .. versionadded:: 1.8 .. warning:: Python runners and associated APIs are an experimental feature and subject to change. The Python Test Runner (short: "runner") described here is a replacement for cocotb's traditional Makefile flow. It builds the :term:\`HDL\` for the simulator and runs the tests. It is not meant to be the ideal solution for everyone. You can easily integrate cocotb into your custom flow, see :ref:\`custom-flows\`. Usage with pytest ================= The runner can be used with \`pytest \`\_ which is Python's go-to testing tool. For an example on how to set up the runner with pytest, see the file :file:\`{cocotb-root}/examples/simple\_dff/test\_dff.py\`, with the relevant part shown here: .. autolink-preface:: from cocotb\_tools.runner import get\_runner .. literalinclude:: ../../examples/simple\_dff/test\_dff.py :language: python :start-at: def test\_simple\_dff\_runner(): :end-at: runner.test(hdl\_toplevel="dff", test\_module="test\_dff,") You run this file with pytest like .. code-block:: bash SIM=questa HDL\_TOPLEVEL\_LANG=vhdl pytest examples/simple\_dff/test\_dff.py Note that the environment variables \`\`SIM\`\` and \`\`HDL\_TOPLEVEL\_LANG\`\` are defined in this test file to set arguments to the runner's :meth:\`Runner.build \` and :meth:\`Runner.test \` functions; they are not directly handled by the runner itself. Test filenames and functions have to follow the \`pytest discovery \`\_ convention in order to be automatically found. By default, pytest will only show you a terse "pass/fail" information. To see more details of the simulation run, including the output produced by cocotb, add the \`\`-s\`\` option to the \`\`pytest\`\` call: .. code-block:: bash SIM=questa HDL\_TOPLEVEL\_LANG=vhdl pytest examples/simple\_dff/test\_dff.py -s .. note:: Take a look at the :ref:\`list of command line flags \` in pytest's official documentation. Direct usage ============ You can also run the test directly, that is, without using pytest, like so .. code-block:: bash python examples/simple\_dff/test\_dff.py This requires that you define the test to run in the testcase file itself. For example, add the following code at the end: .. code-block:: bash if \_\_name\_\_ == "\_\_main\_\_": test\_simple\_dff\_runner() Generate waveforms ================== For many simulators it is possible to generate simulation waveforms. This can be done by setting the \*waves\* argument to True in the :meth:\`Runner.build \` and :meth:\`Runner.test \` functions. It is also possible to set the environment variable \`\`WAVES\`\` to a non-zero value to generate waveform files at run-time without modifying the test code, e.g., .. code-block:: bash WAVES=1 pytest examples/simple\_dff/test\_dff.py Similarly, it is possible to disable the waveform generation set in the test code by setting \`\`WAVES\`\` to 0. Starting in GUI mode/viewing waveforms ====================================== To start the simulator GUI or, for simulators not having a GUI, view the waveform file in a waveform viewer after the simulation, it is possible to set the \*gui\* argument to True in :meth:\`Runner.test \`. It is also possible to set the \`\`GUI\`\` environment variable to a non-zero value, e.g., .. code-block:: bash GUI=1 pytest examples/simple\_dff/test\_dff.py For simulators without a GUI, cocotb will open a waveform viewer. Either \`Surfer \`\_ or \`GTKWave \`, in that order, if available in the system path. To specify preferred waveform viewer, the \`\`COCOTB\_WAVEFORM\_VIEWER\`\` environment variable can be used. This can also be used to set, e.g., the \`\`surfer.sh\`\` startup script for WSL. API === The API of the Python runner is documented in section :ref:\`api-runner\`. --- # Struct vhpiValueS — cocotb 1.4.0 documentation * [](https://docs.cocotb.org/en/v1.4.0/index.html) » * [C Code Library Reference](https://docs.cocotb.org/en/v1.4.0/library_reference_c.html) » * [Struct list](https://docs.cocotb.org/en/v1.4.0/generated/structlist.html) » * Struct vhpiValueS * [Edit on GitHub](https://github.com/cocotb/cocotb/blob/v1.4.0/documentation/source/generated/struct/structvhpiValueS.rst) * * * Struct vhpiValueS[¶](https://docs.cocotb.org/en/v1.4.0/generated/struct/structvhpiValueS.html#struct-vhpivalues "Permalink to this headline") ============================================================================================================================================== _struct_ `vhpiValueS` --- # Testbench Tools — cocotb 1.1 documentation * [Docs](https://docs.cocotb.org/en/v1.2.0/index.html) » * Testbench Tools * [Edit on GitHub](https://github.com/cocotb/cocotb/blob/v1.2.0/documentation/source/testbench_tools.rst) * * * Testbench Tools[¶](https://docs.cocotb.org/en/v1.2.0/testbench_tools.html#testbench-tools "Permalink to this headline") ======================================================================================================================== Logging[¶](https://docs.cocotb.org/en/v1.2.0/testbench_tools.html#logging "Permalink to this headline") -------------------------------------------------------------------------------------------------------- Cocotb extends the Python logging library. Each DUT, monitor, driver, and scoreboard (as well as any other function using the coroutine decorator) implements its own `logging` object, and each can be set to its own logging level. Within a DUT, each hierarchical object can also have individual logging levels set. When logging HDL objects, beware that `_log` is the preferred way to use logging. This helps minimize the change of name collisions with an HDL log component with the Python logging functionality. Log printing levels can also be set on a per-object basis. class EndianSwapperTB(object): def \_\_init\_\_(self, dut, debug\=False): self.dut \= dut self.stream\_in \= AvalonSTDriver(dut, "stream\_in", dut.clk) self.stream\_in\_recovered \= AvalonSTMonitor(dut, "stream\_in", dut.clk, callback\=self.model) \# Set verbosity on our various interfaces level \= logging.DEBUG if debug else logging.WARNING self.stream\_in.log.setLevel(level) self.stream\_in\_recovered.log.setLevel(level) self.dut.reset\_n.\_log.setLevel(logging.DEBUG) And when the logging is actually called class AvalonSTPkts(BusMonitor): ... @coroutine def \_monitor\_recv(self): ... self.log.info("Received a packet of %d bytes" % len(pkt)) class Scoreboard(object): ... def add\_interface(self): ... self.log.info("Created with reorder\_depth %d" % reorder\_depth) class EndianSwapTB(object): ... @cocotb.coroutine def reset(): self.dut.\_log.debug("Resetting DUT") will display as something like 0.00ns INFO cocotb.scoreboard.endian\_swapper\_sv scoreboard.py:177 in add\_interface Created with reorder\_depth 0 0.00ns DEBUG cocotb.endian\_swapper\_sv ..\_endian\_swapper.py:106 in reset Resetting DUT 160000000000000.00ns INFO cocotb.endian\_swapper\_sv.stream\_out avalon.py:151 in \_monitor\_recv Received a packet of 125 bytes Busses[¶](https://docs.cocotb.org/en/v1.2.0/testbench_tools.html#busses "Permalink to this headline") ------------------------------------------------------------------------------------------------------ Busses are simply defined as collection of signals. The [`Bus`](https://docs.cocotb.org/en/v1.2.0/library_reference.html#cocotb.bus.Bus "cocotb.bus.Bus") class will automatically bundle any group of signals together that are named similar to `dut.`. For instance, dut.stream\_in\_valid dut.stream\_in\_data have a bus name of `stream_in`, a separator of `_`, and signal names of `valid` and `data`. A list of signal names, or a dictionary mapping attribute names to signal names is also passed into the [`Bus`](https://docs.cocotb.org/en/v1.2.0/library_reference.html#cocotb.bus.Bus "cocotb.bus.Bus") class. Busses can have values driven onto them, be captured (returning a dictionary), or sampled and stored into a similar object. stream\_in\_bus \= Bus(dut, "stream\_in", \["valid", "data"\]) \# '\_' is the default separator Driving Busses[¶](https://docs.cocotb.org/en/v1.2.0/testbench_tools.html#driving-busses "Permalink to this headline") ---------------------------------------------------------------------------------------------------------------------- Examples and specific bus implementation bus drivers (AMBA, Avalon, XGMII, and others) exist in the [`Driver`](https://docs.cocotb.org/en/v1.2.0/library_reference.html#cocotb.drivers.Driver "cocotb.drivers.Driver") class enabling a test to append transactions to perform the serialization of transactions onto a physical interface. Here is an example using the Avalon bus driver in the `endian_swapper` example: class EndianSwapperTB(object): def \_\_init\_\_(self, dut, debug\=False): self.dut \= dut self.stream\_in \= AvalonSTDriver(dut, "stream\_in", dut.clk) def run\_test(dut, data\_in\=None, config\_coroutine\=None, idle\_inserter\=None, backpressure\_inserter\=None): cocotb.fork(Clock(dut.clk, 5000).start()) tb \= EndianSwapperTB(dut) yield tb.reset() dut.stream\_out\_ready <= 1 if idle\_inserter is not None: tb.stream\_in.set\_valid\_generator(idle\_inserter()) \# Send in the packets for transaction in data\_in(): yield tb.stream\_in.send(transaction) Monitoring Busses[¶](https://docs.cocotb.org/en/v1.2.0/testbench_tools.html#monitoring-busses "Permalink to this headline") ---------------------------------------------------------------------------------------------------------------------------- For our testbenches to actually be useful, we have to monitor some of these busses, and not just drive them. That’s where the [`Monitor`](https://docs.cocotb.org/en/v1.2.0/library_reference.html#cocotb.monitors.Monitor "cocotb.monitors.Monitor") class comes in, with prebuilt monitors for Avalon and XGMII busses. The Monitor class is a base class which you are expected to derive for your particular purpose. You must create a [`_monitor_recv()`](https://docs.cocotb.org/en/v1.2.0/library_reference.html#cocotb.monitors.Monitor._monitor_recv "cocotb.monitors.Monitor._monitor_recv") function which is responsible for determining 1) at what points in simulation to call the [`_recv()`](https://docs.cocotb.org/en/v1.2.0/library_reference.html#cocotb.monitors.Monitor._recv "cocotb.monitors.Monitor._recv") function, and 2) what transaction values to pass to be stored in the monitors receiving queue. Monitors are good for both outputs of the DUT for verification, and for the inputs of the DUT, to drive a test model of the DUT to be compared to the actual DUT. For this purpose, input monitors will often have a callback function passed that is a model. This model will often generate expected transactions, which are then compared using the [`Scoreboard`](https://docs.cocotb.org/en/v1.2.0/library_reference.html#cocotb.scoreboard.Scoreboard "cocotb.scoreboard.Scoreboard") class. \# ============================================================================== class BitMonitor(Monitor): """Observes single input or output of DUT.""" def \_\_init\_\_(self, name, signal, clock, callback\=None, event\=None): self.name \= name self.signal \= signal self.clock \= clock Monitor.\_\_init\_\_(self, callback, event) @coroutine def \_monitor\_recv(self): clkedge \= RisingEdge(self.clock) while True: \# Capture signal at rising edge of clock yield clkedge vec \= self.signal.value self.\_recv(vec) \# ============================================================================== def input\_gen(): """Generator for input data applied by BitDriver""" while True: yield random.randint(1,5), random.randint(1,5) \# ============================================================================== class DFF\_TB(object): def \_\_init\_\_(self, dut, init\_val): self.dut \= dut \# Create input driver and output monitor self.input\_drv \= BitDriver(dut.d, dut.c, input\_gen()) self.output\_mon \= BitMonitor("output", dut.q, dut.c) \# Create a scoreboard on the outputs self.expected\_output \= \[ init\_val \] \# Reconstruct the input transactions from the pins \# and send them to our 'model' self.input\_mon \= BitMonitor("input", dut.d, dut.c, callback\=self.model) def model(self, transaction): """Model the DUT based on the input transaction.""" \# Do not append an output transaction for the last clock cycle of the \# simulation, that is, after stop() has been called. if not self.stopped: self.expected\_output.append(transaction) Tracking testbench errors[¶](https://docs.cocotb.org/en/v1.2.0/testbench_tools.html#tracking-testbench-errors "Permalink to this headline") -------------------------------------------------------------------------------------------------------------------------------------------- The [`Scoreboard`](https://docs.cocotb.org/en/v1.2.0/library_reference.html#cocotb.scoreboard.Scoreboard "cocotb.scoreboard.Scoreboard") class is used to compare the actual outputs to expected outputs. Monitors are added to the scoreboard for the actual outputs, and the expected outputs can be either a simple list, or a function that provides a transaction. Here is some code from the `dff` example, similar to above with the scoreboard added. class DFF\_TB(object): def \_\_init\_\_(self, dut, init\_val): self.dut \= dut \# Create input driver and output monitor self.input\_drv \= BitDriver(dut.d, dut.c, input\_gen()) self.output\_mon \= BitMonitor("output", dut.q, dut.c) \# Create a scoreboard on the outputs self.expected\_output \= \[ init\_val \] self.scoreboard \= Scoreboard(dut) self.scoreboard.add\_interface(self.output\_mon, self.expected\_output) \# Reconstruct the input transactions from the pins \# and send them to our 'model' self.input\_mon \= BitMonitor("input", dut.d, dut.c,callback\=self.model) --- # Testbench Tools — cocotb 1.3.0 documentation * [Docs](https://docs.cocotb.org/en/v1.3.0/index.html) » * Testbench Tools * [Edit on GitHub](https://github.com/cocotb/cocotb/blob/v1.3.0/documentation/source/testbench_tools.rst) * * * Testbench Tools[¶](https://docs.cocotb.org/en/v1.3.0/testbench_tools.html#testbench-tools "Permalink to this headline") ======================================================================================================================== Logging[¶](https://docs.cocotb.org/en/v1.3.0/testbench_tools.html#logging "Permalink to this headline") -------------------------------------------------------------------------------------------------------- Cocotb extends the Python logging library. Each DUT, monitor, driver, and scoreboard (as well as any other function using the coroutine decorator) implements its own `logging` object, and each can be set to its own logging level. Within a DUT, each hierarchical object can also have individual logging levels set. When logging HDL objects, beware that `_log` is the preferred way to use logging. This helps minimize the change of name collisions with an HDL log component with the Python logging functionality. Log printing levels can also be set on a per-object basis. class EndianSwapperTB(object): def \_\_init\_\_(self, dut, debug\=False): self.dut \= dut self.stream\_in \= AvalonSTDriver(dut, "stream\_in", dut.clk) self.stream\_in\_recovered \= AvalonSTMonitor(dut, "stream\_in", dut.clk, callback\=self.model) \# Set verbosity on our various interfaces level \= logging.DEBUG if debug else logging.WARNING self.stream\_in.log.setLevel(level) self.stream\_in\_recovered.log.setLevel(level) self.dut.reset\_n.\_log.setLevel(logging.DEBUG) And when the logging is actually called class AvalonSTPkts(BusMonitor): ... @coroutine def \_monitor\_recv(self): ... self.log.info("Received a packet of %d bytes" % len(pkt)) class Scoreboard(object): ... def add\_interface(self): ... self.log.info("Created with reorder\_depth %d" % reorder\_depth) class EndianSwapTB(object): ... @cocotb.coroutine def reset(): self.dut.\_log.debug("Resetting DUT") will display as something like 0.00ns INFO cocotb.scoreboard.endian\_swapper\_sv scoreboard.py:177 in add\_interface Created with reorder\_depth 0 0.00ns DEBUG cocotb.endian\_swapper\_sv ..\_endian\_swapper.py:106 in reset Resetting DUT 160000000000000.00ns INFO cocotb.endian\_swapper\_sv.stream\_out avalon.py:151 in \_monitor\_recv Received a packet of 125 bytes Buses[¶](https://docs.cocotb.org/en/v1.3.0/testbench_tools.html#buses "Permalink to this headline") ---------------------------------------------------------------------------------------------------- Buses are simply defined as collection of signals. The [`Bus`](https://docs.cocotb.org/en/v1.3.0/library_reference.html#cocotb.bus.Bus "cocotb.bus.Bus") class will automatically bundle any group of signals together that are named similar to `dut.`. For instance, dut.stream\_in\_valid dut.stream\_in\_data have a bus name of `stream_in`, a separator of `_`, and signal names of `valid` and `data`. A list of signal names, or a dictionary mapping attribute names to signal names is also passed into the [`Bus`](https://docs.cocotb.org/en/v1.3.0/library_reference.html#cocotb.bus.Bus "cocotb.bus.Bus") class. Buses can have values driven onto them, be captured (returning a dictionary), or sampled and stored into a similar object. stream\_in\_bus \= Bus(dut, "stream\_in", \["valid", "data"\]) \# '\_' is the default separator Driving Buses[¶](https://docs.cocotb.org/en/v1.3.0/testbench_tools.html#driving-buses "Permalink to this headline") -------------------------------------------------------------------------------------------------------------------- Examples and specific bus implementation bus drivers (AMBA, Avalon, XGMII, and others) exist in the [`Driver`](https://docs.cocotb.org/en/v1.3.0/library_reference.html#cocotb.drivers.Driver "cocotb.drivers.Driver") class enabling a test to append transactions to perform the serialization of transactions onto a physical interface. Here is an example using the Avalon bus driver in the `endian_swapper` example: class EndianSwapperTB(object): def \_\_init\_\_(self, dut, debug\=False): self.dut \= dut self.stream\_in \= AvalonSTDriver(dut, "stream\_in", dut.clk) def run\_test(dut, data\_in\=None, config\_coroutine\=None, idle\_inserter\=None, backpressure\_inserter\=None): cocotb.fork(Clock(dut.clk, 5000).start()) tb \= EndianSwapperTB(dut) yield tb.reset() dut.stream\_out\_ready <= 1 if idle\_inserter is not None: tb.stream\_in.set\_valid\_generator(idle\_inserter()) \# Send in the packets for transaction in data\_in(): yield tb.stream\_in.send(transaction) Monitoring Buses[¶](https://docs.cocotb.org/en/v1.3.0/testbench_tools.html#monitoring-buses "Permalink to this headline") -------------------------------------------------------------------------------------------------------------------------- For our testbenches to actually be useful, we have to monitor some of these buses, and not just drive them. That’s where the [`Monitor`](https://docs.cocotb.org/en/v1.3.0/library_reference.html#cocotb.monitors.Monitor "cocotb.monitors.Monitor") class comes in, with pre-built monitors for Avalon and XGMII buses. The Monitor class is a base class which you are expected to derive for your particular purpose. You must create a [`_monitor_recv()`](https://docs.cocotb.org/en/v1.3.0/library_reference.html#cocotb.monitors.Monitor._monitor_recv "cocotb.monitors.Monitor._monitor_recv") function which is responsible for determining 1) at what points in simulation to call the [`_recv()`](https://docs.cocotb.org/en/v1.3.0/library_reference.html#cocotb.monitors.Monitor._recv "cocotb.monitors.Monitor._recv") function, and 2) what transaction values to pass to be stored in the monitors receiving queue. Monitors are good for both outputs of the DUT for verification, and for the inputs of the DUT, to drive a test model of the DUT to be compared to the actual DUT. For this purpose, input monitors will often have a callback function passed that is a model. This model will often generate expected transactions, which are then compared using the [`Scoreboard`](https://docs.cocotb.org/en/v1.3.0/library_reference.html#cocotb.scoreboard.Scoreboard "cocotb.scoreboard.Scoreboard") class. \# ============================================================================== class BitMonitor(Monitor): """Observes single input or output of DUT.""" def \_\_init\_\_(self, name, signal, clock, callback\=None, event\=None): self.name \= name self.signal \= signal self.clock \= clock Monitor.\_\_init\_\_(self, callback, event) @coroutine def \_monitor\_recv(self): clkedge \= RisingEdge(self.clock) while True: \# Capture signal at rising edge of clock yield clkedge vec \= self.signal.value self.\_recv(vec) \# ============================================================================== def input\_gen(): """Generator for input data applied by BitDriver""" while True: yield random.randint(1,5), random.randint(1,5) \# ============================================================================== class DFF\_TB(object): def \_\_init\_\_(self, dut, init\_val): self.dut \= dut \# Create input driver and output monitor self.input\_drv \= BitDriver(dut.d, dut.c, input\_gen()) self.output\_mon \= BitMonitor("output", dut.q, dut.c) \# Create a scoreboard on the outputs self.expected\_output \= \[ init\_val \] \# Reconstruct the input transactions from the pins \# and send them to our 'model' self.input\_mon \= BitMonitor("input", dut.d, dut.c, callback\=self.model) def model(self, transaction): """Model the DUT based on the input transaction.""" \# Do not append an output transaction for the last clock cycle of the \# simulation, that is, after stop() has been called. if not self.stopped: self.expected\_output.append(transaction) Tracking testbench errors[¶](https://docs.cocotb.org/en/v1.3.0/testbench_tools.html#tracking-testbench-errors "Permalink to this headline") -------------------------------------------------------------------------------------------------------------------------------------------- The [`Scoreboard`](https://docs.cocotb.org/en/v1.3.0/library_reference.html#cocotb.scoreboard.Scoreboard "cocotb.scoreboard.Scoreboard") class is used to compare the actual outputs to expected outputs. Monitors are added to the scoreboard for the actual outputs, and the expected outputs can be either a simple list, or a function that provides a transaction. Here is some code from the `dff` example, similar to above with the scoreboard added. class DFF\_TB(object): def \_\_init\_\_(self, dut, init\_val): self.dut \= dut \# Create input driver and output monitor self.input\_drv \= BitDriver(dut.d, dut.c, input\_gen()) self.output\_mon \= BitMonitor("output", dut.q, dut.c) \# Create a scoreboard on the outputs self.expected\_output \= \[ init\_val \] self.scoreboard \= Scoreboard(dut) self.scoreboard.add\_interface(self.output\_mon, self.expected\_output) \# Reconstruct the input transactions from the pins \# and send them to our 'model' self.input\_mon \= BitMonitor("input", dut.d, dut.c,callback\=self.model) --- # Index — cocotb 1.6.0.dev0+gec99a877.d20210503 documentation * [](https://docs.cocotb.org/en/v1.5.2/index.html) » * Index * [Edit on GitHub](https://github.com/cocotb/cocotb/blob/v1.5.2/documentation/source/genindex.rst) * * * Index ===== [**\_**](https://docs.cocotb.org/en/v1.5.2/genindex.html#_) | [**A**](https://docs.cocotb.org/en/v1.5.2/genindex.html#A) | [**B**](https://docs.cocotb.org/en/v1.5.2/genindex.html#B) | [**C**](https://docs.cocotb.org/en/v1.5.2/genindex.html#C) | [**D**](https://docs.cocotb.org/en/v1.5.2/genindex.html#D) | [**E**](https://docs.cocotb.org/en/v1.5.2/genindex.html#E) | [**F**](https://docs.cocotb.org/en/v1.5.2/genindex.html#F) | [**G**](https://docs.cocotb.org/en/v1.5.2/genindex.html#G) | [**H**](https://docs.cocotb.org/en/v1.5.2/genindex.html#H) | [**I**](https://docs.cocotb.org/en/v1.5.2/genindex.html#I) | [**J**](https://docs.cocotb.org/en/v1.5.2/genindex.html#J) | [**K**](https://docs.cocotb.org/en/v1.5.2/genindex.html#K) | [**L**](https://docs.cocotb.org/en/v1.5.2/genindex.html#L) | [**M**](https://docs.cocotb.org/en/v1.5.2/genindex.html#M) | [**N**](https://docs.cocotb.org/en/v1.5.2/genindex.html#N) | [**O**](https://docs.cocotb.org/en/v1.5.2/genindex.html#O) | [**P**](https://docs.cocotb.org/en/v1.5.2/genindex.html#P) | [**Q**](https://docs.cocotb.org/en/v1.5.2/genindex.html#Q) | [**R**](https://docs.cocotb.org/en/v1.5.2/genindex.html#R) | [**S**](https://docs.cocotb.org/en/v1.5.2/genindex.html#S) | [**T**](https://docs.cocotb.org/en/v1.5.2/genindex.html#T) | [**U**](https://docs.cocotb.org/en/v1.5.2/genindex.html#U) | [**V**](https://docs.cocotb.org/en/v1.5.2/genindex.html#V) | [**W**](https://docs.cocotb.org/en/v1.5.2/genindex.html#W) | [**X**](https://docs.cocotb.org/en/v1.5.2/genindex.html#X) \_ -- | | | | --- | --- | | * [\_def\_file (cocotb.handle.SimHandleBase attribute)](https://docs.cocotb.org/en/v1.5.2/library_reference.html#cocotb.handle.SimHandleBase._def_file)

* [\_def\_name (cocotb.handle.SimHandleBase attribute)](https://docs.cocotb.org/en/v1.5.2/library_reference.html#cocotb.handle.SimHandleBase._def_name)

* [\_driver\_send() (cocotb\_bus.drivers.BusDriver method)](https://docs.cocotb.org/en/v1.5.2/library_reference.html#cocotb_bus.drivers.BusDriver._driver_send)
* [(cocotb\_bus.drivers.Driver method)](https://docs.cocotb.org/en/v1.5.2/library_reference.html#cocotb_bus.drivers.Driver._driver_send)

* [\_id() (cocotb.handle.HierarchyObject method)](https://docs.cocotb.org/en/v1.5.2/library_reference.html#cocotb.handle.HierarchyObject._id)

* [\_monitor\_recv() (cocotb\_bus.monitors.Monitor method)](https://docs.cocotb.org/en/v1.5.2/library_reference.html#cocotb_bus.monitors.Monitor._monitor_recv)

* [\_name (cocotb.handle.SimHandleBase attribute)](https://docs.cocotb.org/en/v1.5.2/library_reference.html#cocotb.handle.SimHandleBase._name) | * [\_next\_valids() (cocotb\_bus.drivers.ValidatedBusDriver method)](https://docs.cocotb.org/en/v1.5.2/library_reference.html#cocotb_bus.drivers.ValidatedBusDriver._next_valids)

* [\_path (cocotb.handle.SimHandleBase attribute)](https://docs.cocotb.org/en/v1.5.2/library_reference.html#cocotb.handle.SimHandleBase._path)

* [\_recv() (cocotb\_bus.monitors.Monitor method)](https://docs.cocotb.org/en/v1.5.2/library_reference.html#cocotb_bus.monitors.Monitor._recv)

* [\_send() (cocotb\_bus.drivers.Driver method)](https://docs.cocotb.org/en/v1.5.2/library_reference.html#cocotb_bus.drivers.Driver._send)

* [\_type (cocotb.handle.SimHandleBase attribute)](https://docs.cocotb.org/en/v1.5.2/library_reference.html#cocotb.handle.SimHandleBase._type)

* [\_wait() (cocotb.triggers.Waitable method)](https://docs.cocotb.org/en/v1.5.2/library_reference.html#cocotb.triggers.Waitable._wait)

* [\_wait\_for\_nsignal() (cocotb\_bus.drivers.BusDriver method)](https://docs.cocotb.org/en/v1.5.2/library_reference.html#cocotb_bus.drivers.BusDriver._wait_for_nsignal)

* [\_wait\_for\_signal() (cocotb\_bus.drivers.BusDriver method)](https://docs.cocotb.org/en/v1.5.2/library_reference.html#cocotb_bus.drivers.BusDriver._wait_for_signal) | A - | | | | --- | --- | | * [acquire() (cocotb.triggers.Lock method)](https://docs.cocotb.org/en/v1.5.2/triggers.html#cocotb.triggers.Lock.acquire)

* [add() (cocotb.scheduler.Scheduler method)](https://docs.cocotb.org/en/v1.5.2/library_reference.html#cocotb.scheduler.Scheduler.add)

* [add\_callback() (cocotb\_bus.monitors.Monitor method)](https://docs.cocotb.org/en/v1.5.2/library_reference.html#cocotb_bus.monitors.Monitor.add_callback)

* [add\_interface() (cocotb\_bus.scoreboard.Scoreboard method)](https://docs.cocotb.org/en/v1.5.2/library_reference.html#cocotb_bus.scoreboard.Scoreboard.add_interface)

* [add\_option() (cocotb.regression.TestFactory method)](https://docs.cocotb.org/en/v1.5.2/library_reference.html#cocotb.regression.TestFactory.add_option)

* [add\_test() (cocotb.scheduler.Scheduler method)](https://docs.cocotb.org/en/v1.5.2/library_reference.html#cocotb.scheduler.Scheduler.add_test)

* [append() (cocotb\_bus.drivers.Driver method)](https://docs.cocotb.org/en/v1.5.2/library_reference.html#cocotb_bus.drivers.Driver.append)

* [argv (in module cocotb)](https://docs.cocotb.org/en/v1.5.2/library_reference.html#cocotb.argv)

* [assign() (cocotb.binary.BinaryValue method)](https://docs.cocotb.org/en/v1.5.2/library_reference.html#cocotb.binary.BinaryValue.assign) | * [AvalonMaster (class in cocotb\_bus.drivers.avalon)](https://docs.cocotb.org/en/v1.5.2/library_reference.html#cocotb_bus.drivers.avalon.AvalonMaster)

* [AvalonMemory (class in cocotb\_bus.drivers.avalon)](https://docs.cocotb.org/en/v1.5.2/library_reference.html#cocotb_bus.drivers.avalon.AvalonMemory)

* [AvalonMM (class in cocotb\_bus.drivers.avalon)](https://docs.cocotb.org/en/v1.5.2/library_reference.html#cocotb_bus.drivers.avalon.AvalonMM)

* [AvalonST (class in cocotb\_bus.drivers.avalon)](https://docs.cocotb.org/en/v1.5.2/library_reference.html#cocotb_bus.drivers.avalon.AvalonST)
* [(class in cocotb\_bus.monitors.avalon)](https://docs.cocotb.org/en/v1.5.2/library_reference.html#cocotb_bus.monitors.avalon.AvalonST)

* [AvalonSTPkts (class in cocotb\_bus.drivers.avalon)](https://docs.cocotb.org/en/v1.5.2/library_reference.html#cocotb_bus.drivers.avalon.AvalonSTPkts)
* [(class in cocotb\_bus.monitors.avalon)](https://docs.cocotb.org/en/v1.5.2/library_reference.html#cocotb_bus.monitors.avalon.AvalonSTPkts)

* [AXI4LiteMaster (class in cocotb\_bus.drivers.amba)](https://docs.cocotb.org/en/v1.5.2/library_reference.html#cocotb_bus.drivers.amba.AXI4LiteMaster)

* [AXI4Master (class in cocotb\_bus.drivers.amba)](https://docs.cocotb.org/en/v1.5.2/library_reference.html#cocotb_bus.drivers.amba.AXI4Master)

* [AXI4Slave (class in cocotb\_bus.drivers.amba)](https://docs.cocotb.org/en/v1.5.2/library_reference.html#cocotb_bus.drivers.amba.AXI4Slave) | B - | | | | --- | --- | | * [**BFM**](https://docs.cocotb.org/en/v1.5.2/glossary.html#term-BFM)

* [BinaryRepresentation (class in cocotb.binary)](https://docs.cocotb.org/en/v1.5.2/library_reference.html#cocotb.binary.BinaryRepresentation)

* [BinaryValue (class in cocotb.binary)](https://docs.cocotb.org/en/v1.5.2/library_reference.html#cocotb.binary.BinaryValue)

* [binstr() (cocotb.binary.BinaryValue property)](https://docs.cocotb.org/en/v1.5.2/library_reference.html#cocotb.binary.BinaryValue.binstr) | * [BitDriver (class in cocotb\_bus.drivers)](https://docs.cocotb.org/en/v1.5.2/library_reference.html#cocotb_bus.drivers.BitDriver)

* [buff() (cocotb.binary.BinaryValue property)](https://docs.cocotb.org/en/v1.5.2/library_reference.html#cocotb.binary.BinaryValue.buff)

* [Bus (class in cocotb\_bus.bus)](https://docs.cocotb.org/en/v1.5.2/library_reference.html#cocotb_bus.bus.Bus)

* [BusDriver (class in cocotb\_bus.drivers)](https://docs.cocotb.org/en/v1.5.2/library_reference.html#cocotb_bus.drivers.BusDriver)

* [BusMonitor (class in cocotb\_bus.monitors)](https://docs.cocotb.org/en/v1.5.2/library_reference.html#cocotb_bus.monitors.BusMonitor) | C - | | | | --- | --- | | * [capture() (cocotb\_bus.bus.Bus method)](https://docs.cocotb.org/en/v1.5.2/library_reference.html#cocotb_bus.bus.Bus.capture)

* [cleanup() (cocotb.scheduler.Scheduler method)](https://docs.cocotb.org/en/v1.5.2/library_reference.html#cocotb.scheduler.Scheduler.cleanup)

* [clear() (cocotb.triggers.Event method)](https://docs.cocotb.org/en/v1.5.2/triggers.html#cocotb.triggers.Event.clear)
* [(cocotb.wavedrom.Wavedrom method)](https://docs.cocotb.org/en/v1.5.2/library_reference.html#cocotb.wavedrom.Wavedrom.clear)

* [(cocotb\_bus.drivers.Driver method)](https://docs.cocotb.org/en/v1.5.2/library_reference.html#cocotb_bus.drivers.Driver.clear)

* [Clock (class in cocotb.clock)](https://docs.cocotb.org/en/v1.5.2/library_reference.html#cocotb.clock.Clock)

* [ClockCycles (class in cocotb.triggers)](https://docs.cocotb.org/en/v1.5.2/triggers.html#cocotb.triggers.ClockCycles)

* cocotb.generators
* [module](https://docs.cocotb.org/en/v1.5.2/library_reference.html#module-cocotb.generators)

* cocotb.generators.bit
* [module](https://docs.cocotb.org/en/v1.5.2/library_reference.html#module-cocotb.generators.bit)

* cocotb.generators.byte
* [module](https://docs.cocotb.org/en/v1.5.2/library_reference.html#module-cocotb.generators.byte)

* cocotb.handle
* [module](https://docs.cocotb.org/en/v1.5.2/library_reference.html#module-cocotb.handle)

* cocotb.ipython\_support
* [module](https://docs.cocotb.org/en/v1.5.2/troubleshooting.html#module-cocotb.ipython_support)

* cocotb.queue
* [module](https://docs.cocotb.org/en/v1.5.2/library_reference.html#module-cocotb.queue)

* cocotb.result
* [module](https://docs.cocotb.org/en/v1.5.2/library_reference.html#module-cocotb.result)

* cocotb.simulator
* [module](https://docs.cocotb.org/en/v1.5.2/library_reference.html#module-cocotb.simulator)

* cocotb.utils
* [module](https://docs.cocotb.org/en/v1.5.2/library_reference.html#module-cocotb.utils)

* cocotb.wavedrom
* [module](https://docs.cocotb.org/en/v1.5.2/library_reference.html#module-cocotb.wavedrom)

* [COCOTB\_ANSI\_OUTPUT](https://docs.cocotb.org/en/v1.5.2/library_reference.html#index-1) | * [COCOTB\_ATTACH](https://docs.cocotb.org/en/v1.5.2/building.html#index-3)
, [\[1\]](https://docs.cocotb.org/en/v1.5.2/troubleshooting.html#index-1)

* cocotb\_bus.scoreboard
* [module](https://docs.cocotb.org/en/v1.5.2/library_reference.html#module-cocotb_bus.scoreboard)

* COCOTB\_HDL\_TIMEPRECISION
* [Make Variable](https://docs.cocotb.org/en/v1.5.2/building.html#var-COCOTB_HDL_TIMEPRECISION)

* COCOTB\_HDL\_TIMEUNIT
* [Make Variable](https://docs.cocotb.org/en/v1.5.2/building.html#var-COCOTB_HDL_TIMEUNIT)

* [COCOTB\_HOOKS](https://docs.cocotb.org/en/v1.5.2/release_notes.html#index-2)

* [COCOTB\_LOG\_LEVEL](https://docs.cocotb.org/en/v1.5.2/library_reference.html#index-2)
, [\[1\]](https://docs.cocotb.org/en/v1.5.2/release_notes.html#index-10)

* [COCOTB\_PDB\_ON\_EXCEPTION](https://docs.cocotb.org/en/v1.5.2/release_notes.html#index-5)

* [COCOTB\_RESOLVE\_X](https://docs.cocotb.org/en/v1.5.2/library_reference.html#index-0)

* [COCOTB\_RESULTS\_FILE](https://docs.cocotb.org/en/v1.5.2/building.html#index-0)
, [\[1\]](https://docs.cocotb.org/en/v1.5.2/release_notes.html#index-11)

* [COCOTB\_SCHEDULER\_DEBUG](https://docs.cocotb.org/en/v1.5.2/troubleshooting.html#index-0)

* [Combine (class in cocotb.triggers)](https://docs.cocotb.org/en/v1.5.2/triggers.html#cocotb.triggers.Combine)

* [combine() (in module cocotb.generators)](https://docs.cocotb.org/en/v1.5.2/library_reference.html#cocotb.generators.combine)

* [compare() (cocotb\_bus.scoreboard.Scoreboard method)](https://docs.cocotb.org/en/v1.5.2/library_reference.html#cocotb_bus.scoreboard.Scoreboard.compare)

* COMPILE\_ARGS
* [Make Variable](https://docs.cocotb.org/en/v1.5.2/building.html#var-COMPILE_ARGS)

* [ConstantObject (class in cocotb.handle)](https://docs.cocotb.org/en/v1.5.2/library_reference.html#cocotb.handle.ConstantObject)

* [**coroutine**](https://docs.cocotb.org/en/v1.5.2/glossary.html#term-coroutine)
* [(class in cocotb)](https://docs.cocotb.org/en/v1.5.2/library_reference.html#cocotb.coroutine)

* [**coroutine function**](https://docs.cocotb.org/en/v1.5.2/glossary.html#term-coroutine-function)

* [create\_error() (in module cocotb.result)](https://docs.cocotb.org/en/v1.5.2/library_reference.html#cocotb.result.create_error)

* [create\_task() (cocotb.scheduler.Scheduler static method)](https://docs.cocotb.org/en/v1.5.2/library_reference.html#cocotb.scheduler.Scheduler.create_task)

* [created\_sim\_time (logging.LogRecord attribute)](https://docs.cocotb.org/en/v1.5.2/library_reference.html#logging.LogRecord.created_sim_time)

* CUSTOM\_COMPILE\_DEPS
* [Make Variable](https://docs.cocotb.org/en/v1.5.2/building.html#var-CUSTOM_COMPILE_DEPS)

* CUSTOM\_SIM\_DEPS
* [Make Variable](https://docs.cocotb.org/en/v1.5.2/building.html#var-CUSTOM_SIM_DEPS) | D - | | | | --- | --- | | * [default\_config() (in module cocotb.log)](https://docs.cocotb.org/en/v1.5.2/library_reference.html#cocotb.log.default_config)

* [Deposit (class in cocotb.handle)](https://docs.cocotb.org/en/v1.5.2/library_reference.html#cocotb.handle.Deposit)

* [deregister() (cocotb.simulator.gpi\_cb\_hdl method)](https://docs.cocotb.org/en/v1.5.2/library_reference.html#cocotb.simulator.gpi_cb_hdl.deregister)

* [drive() (cocotb\_bus.bus.Bus method)](https://docs.cocotb.org/en/v1.5.2/library_reference.html#cocotb_bus.bus.Bus.drive) | * [Driver (class in cocotb\_bus.drivers)](https://docs.cocotb.org/en/v1.5.2/library_reference.html#cocotb_bus.drivers.Driver)

* [drivers() (cocotb.handle.NonConstantObject method)](https://docs.cocotb.org/en/v1.5.2/library_reference.html#cocotb.handle.NonConstantObject.drivers)

* [**DUT**](https://docs.cocotb.org/en/v1.5.2/glossary.html#term-DUT)

* [**DUV**](https://docs.cocotb.org/en/v1.5.2/glossary.html#term-DUV) | E - | | | | --- | --- | | * [Edge (class in cocotb.triggers)](https://docs.cocotb.org/en/v1.5.2/triggers.html#cocotb.triggers.Edge)

* [embed() (in module cocotb.ipython\_support)](https://docs.cocotb.org/en/v1.5.2/troubleshooting.html#cocotb.ipython_support.embed)

* [empty() (cocotb.queue.Queue method)](https://docs.cocotb.org/en/v1.5.2/library_reference.html#cocotb.queue.Queue.empty)

* [EnumObject (class in cocotb.handle)](https://docs.cocotb.org/en/v1.5.2/library_reference.html#cocotb.handle.EnumObject)

* environment variable
* [COCOTB\_ANSI\_OUTPUT](https://docs.cocotb.org/en/v1.5.2/building.html#envvar-COCOTB_ANSI_OUTPUT)
, [\[1\]](https://docs.cocotb.org/en/v1.5.2/library_reference.html#index-1)

* [COCOTB\_ATTACH](https://docs.cocotb.org/en/v1.5.2/building.html#envvar-COCOTB_ATTACH)
, [\[1\]](https://docs.cocotb.org/en/v1.5.2/building.html#index-3)
, [\[2\]](https://docs.cocotb.org/en/v1.5.2/troubleshooting.html#index-1)

* [COCOTB\_ENABLE\_PROFILING](https://docs.cocotb.org/en/v1.5.2/building.html#envvar-COCOTB_ENABLE_PROFILING)

* [COCOTB\_HOOKS](https://docs.cocotb.org/en/v1.5.2/building.html#envvar-COCOTB_HOOKS)
, [\[1\]](https://docs.cocotb.org/en/v1.5.2/release_notes.html#index-2)

* [COCOTB\_LIBRARY\_COVERAGE](https://docs.cocotb.org/en/v1.5.2/building.html#envvar-COCOTB_LIBRARY_COVERAGE)

* [COCOTB\_LOG\_LEVEL](https://docs.cocotb.org/en/v1.5.2/building.html#envvar-COCOTB_LOG_LEVEL)
, [\[1\]](https://docs.cocotb.org/en/v1.5.2/library_reference.html#index-2)
, [\[2\]](https://docs.cocotb.org/en/v1.5.2/release_notes.html#index-10)

* [COCOTB\_PDB\_ON\_EXCEPTION](https://docs.cocotb.org/en/v1.5.2/building.html#envvar-COCOTB_PDB_ON_EXCEPTION)
, [\[1\]](https://docs.cocotb.org/en/v1.5.2/release_notes.html#index-5)

* [COCOTB\_PY\_DIR](https://docs.cocotb.org/en/v1.5.2/building.html#envvar-COCOTB_PY_DIR)

* [COCOTB\_REDUCED\_LOG\_FMT](https://docs.cocotb.org/en/v1.5.2/building.html#envvar-COCOTB_REDUCED_LOG_FMT)

* [COCOTB\_RESOLVE\_X](https://docs.cocotb.org/en/v1.5.2/building.html#envvar-COCOTB_RESOLVE_X)
, [\[1\]](https://docs.cocotb.org/en/v1.5.2/library_reference.html#index-0)

* [COCOTB\_RESULTS\_FILE](https://docs.cocotb.org/en/v1.5.2/building.html#envvar-COCOTB_RESULTS_FILE)
, [\[1\]](https://docs.cocotb.org/en/v1.5.2/building.html#index-0)
, [\[2\]](https://docs.cocotb.org/en/v1.5.2/release_notes.html#index-11)

* [COCOTB\_SCHEDULER\_DEBUG](https://docs.cocotb.org/en/v1.5.2/building.html#envvar-COCOTB_SCHEDULER_DEBUG)
, [\[1\]](https://docs.cocotb.org/en/v1.5.2/troubleshooting.html#index-0)

* [COCOTB\_SHARE\_DIR](https://docs.cocotb.org/en/v1.5.2/building.html#envvar-COCOTB_SHARE_DIR)

* [COVERAGE](https://docs.cocotb.org/en/v1.5.2/building.html#envvar-COVERAGE)

* [GPI\_EXTRA](https://docs.cocotb.org/en/v1.5.2/building.html#envvar-GPI_EXTRA)
, [\[1\]](https://docs.cocotb.org/en/v1.5.2/custom_flows.html#index-2)
, [\[2\]](https://docs.cocotb.org/en/v1.5.2/custom_flows.html#index-3)
, [\[3\]](https://docs.cocotb.org/en/v1.5.2/custom_flows.html#index-4)
, [\[4\]](https://docs.cocotb.org/en/v1.5.2/custom_flows.html#index-5)
, [\[5\]](https://docs.cocotb.org/en/v1.5.2/custom_flows.html#index-6)
, [\[6\]](https://docs.cocotb.org/en/v1.5.2/custom_flows.html#index-7)
, [\[7\]](https://docs.cocotb.org/en/v1.5.2/custom_flows.html#index-8)
, [\[8\]](https://docs.cocotb.org/en/v1.5.2/custom_flows.html#index-9)
, [\[9\]](https://docs.cocotb.org/en/v1.5.2/release_notes.html#index-4)
, [\[10\]](https://docs.cocotb.org/en/v1.5.2/release_notes.html#index-8)

* [LD\_LIBRARY\_PATH](https://docs.cocotb.org/en/v1.5.2/troubleshooting.html#index-2)
, [\[1\]](https://docs.cocotb.org/en/v1.5.2/troubleshooting.html#index-3)
, [\[2\]](https://docs.cocotb.org/en/v1.5.2/troubleshooting.html#index-4)
, [\[3\]](https://docs.cocotb.org/en/v1.5.2/troubleshooting.html#index-5)
, [\[4\]](https://docs.cocotb.org/en/v1.5.2/troubleshooting.html#index-6)
, [\[5\]](https://docs.cocotb.org/en/v1.5.2/troubleshooting.html#index-7)
, [\[6\]](https://docs.cocotb.org/en/v1.5.2/troubleshooting.html#index-8)

* [LIBPYTHON\_LOC](https://docs.cocotb.org/en/v1.5.2/building.html#envvar-LIBPYTHON_LOC)
, [\[1\]](https://docs.cocotb.org/en/v1.5.2/custom_flows.html#index-0)

* [LICENSE\_QUEUE](https://docs.cocotb.org/en/v1.5.2/simulator_support.html#index-0)

* [MEMCHECK](https://docs.cocotb.org/en/v1.5.2/building.html#envvar-MEMCHECK)

* [MODULE](https://docs.cocotb.org/en/v1.5.2/building.html#envvar-MODULE)
, [\[1\]](https://docs.cocotb.org/en/v1.5.2/building.html#index-1)
, [\[2\]](https://docs.cocotb.org/en/v1.5.2/building.html#index-4)
, [\[3\]](https://docs.cocotb.org/en/v1.5.2/custom_flows.html#index-1)
, [\[4\]](https://docs.cocotb.org/en/v1.5.2/library_reference.html#index-5)
, [\[5\]](https://docs.cocotb.org/en/v1.5.2/quickstart.html#index-1)
, [\[6\]](https://docs.cocotb.org/en/v1.5.2/release_notes.html#index-9)

* [NO\_COLOR](https://docs.cocotb.org/en/v1.5.2/building.html#envvar-NO_COLOR)
, [\[1\]](https://docs.cocotb.org/en/v1.5.2/building.html#index-2)
, [\[2\]](https://docs.cocotb.org/en/v1.5.2/release_notes.html#index-6)

* [PATH](https://docs.cocotb.org/en/v1.5.2/install.html#index-0)
, [\[1\]](https://docs.cocotb.org/en/v1.5.2/install.html#index-1)

* [PLUSARGS](https://docs.cocotb.org/en/v1.5.2/release_notes.html#index-7)

* [RANDOM\_SEED](https://docs.cocotb.org/en/v1.5.2/building.html#envvar-RANDOM_SEED)
, [\[1\]](https://docs.cocotb.org/en/v1.5.2/building.html#index-5)
, [\[2\]](https://docs.cocotb.org/en/v1.5.2/library_reference.html#index-3)

* [SCRIPT\_FILE](https://docs.cocotb.org/en/v1.5.2/building.html#envvar-SCRIPT_FILE)

* [TESTCASE](https://docs.cocotb.org/en/v1.5.2/building.html#envvar-TESTCASE)
, [\[1\]](https://docs.cocotb.org/en/v1.5.2/library_reference.html#index-6)
, [\[2\]](https://docs.cocotb.org/en/v1.5.2/release_notes.html#index-1)

* [TOPLEVEL](https://docs.cocotb.org/en/v1.5.2/building.html#envvar-TOPLEVEL)
, [\[1\]](https://docs.cocotb.org/en/v1.5.2/library_reference.html#index-4)
, [\[2\]](https://docs.cocotb.org/en/v1.5.2/quickstart.html#index-0)
, [\[3\]](https://docs.cocotb.org/en/v1.5.2/release_notes.html#index-0) | * [Event (class in cocotb.triggers)](https://docs.cocotb.org/en/v1.5.2/triggers.html#cocotb.triggers.Event)

* [external (class in cocotb)](https://docs.cocotb.org/en/v1.5.2/library_reference.html#cocotb.external)

* [ExternalException](https://docs.cocotb.org/en/v1.5.2/library_reference.html#cocotb.result.ExternalException)

* EXTRA\_ARGS
* [Make Variable](https://docs.cocotb.org/en/v1.5.2/building.html#var-EXTRA_ARGS)

* [extract\_coro\_stack() (in module cocotb.utils)](https://docs.cocotb.org/en/v1.5.2/library_reference.html#cocotb.utils.extract_coro_stack) | F - | | | | --- | --- | | * [FallingEdge (class in cocotb.triggers)](https://docs.cocotb.org/en/v1.5.2/triggers.html#cocotb.triggers.FallingEdge)

* [finish\_scheduler() (cocotb.scheduler.Scheduler method)](https://docs.cocotb.org/en/v1.5.2/library_reference.html#cocotb.scheduler.Scheduler.finish_scheduler)

* [finish\_test() (cocotb.scheduler.Scheduler method)](https://docs.cocotb.org/en/v1.5.2/library_reference.html#cocotb.scheduler.Scheduler.finish_test)

* [First (class in cocotb.triggers)](https://docs.cocotb.org/en/v1.5.2/triggers.html#cocotb.triggers.First)

* [**FLI**](https://docs.cocotb.org/en/v1.5.2/glossary.html#term-FLI) | * [Force (class in cocotb.handle)](https://docs.cocotb.org/en/v1.5.2/library_reference.html#cocotb.handle.Force)

* [fork() (in module cocotb)](https://docs.cocotb.org/en/v1.5.2/library_reference.html#cocotb.fork)

* [Freeze (class in cocotb.handle)](https://docs.cocotb.org/en/v1.5.2/library_reference.html#cocotb.handle.Freeze)

* [from\_discovery() (cocotb.regression.RegressionManager class method)](https://docs.cocotb.org/en/v1.5.2/library_reference.html#cocotb.regression.RegressionManager.from_discovery)

* [full() (cocotb.queue.Queue method)](https://docs.cocotb.org/en/v1.5.2/library_reference.html#cocotb.queue.Queue.full)

* [function (class in cocotb)](https://docs.cocotb.org/en/v1.5.2/library_reference.html#cocotb.function) | G - | | | | --- | --- | | * [gaussian() (in module cocotb.generators)](https://docs.cocotb.org/en/v1.5.2/library_reference.html#cocotb.generators.gaussian)

* [generate\_tests() (cocotb.regression.TestFactory method)](https://docs.cocotb.org/en/v1.5.2/library_reference.html#cocotb.regression.TestFactory.generate_tests)

* [get() (cocotb.queue.Queue method)](https://docs.cocotb.org/en/v1.5.2/library_reference.html#cocotb.queue.Queue.get)
* [(cocotb.wavedrom.Wavedrom method)](https://docs.cocotb.org/en/v1.5.2/library_reference.html#cocotb.wavedrom.Wavedrom.get)

* [get\_bytes() (in module cocotb.generators.byte)](https://docs.cocotb.org/en/v1.5.2/library_reference.html#cocotb.generators.byte.get_bytes)

* [get\_const() (cocotb.simulator.gpi\_sim\_hdl method)](https://docs.cocotb.org/en/v1.5.2/library_reference.html#cocotb.simulator.gpi_sim_hdl.get_const)

* [get\_definition\_file() (cocotb.simulator.gpi\_sim\_hdl method)](https://docs.cocotb.org/en/v1.5.2/library_reference.html#cocotb.simulator.gpi_sim_hdl.get_definition_file)

* [get\_definition\_name() (cocotb.simulator.gpi\_sim\_hdl method)](https://docs.cocotb.org/en/v1.5.2/library_reference.html#cocotb.simulator.gpi_sim_hdl.get_definition_name)

* [get\_handle\_by\_index() (cocotb.simulator.gpi\_sim\_hdl method)](https://docs.cocotb.org/en/v1.5.2/library_reference.html#cocotb.simulator.gpi_sim_hdl.get_handle_by_index)

* [get\_handle\_by\_name() (cocotb.simulator.gpi\_sim\_hdl method)](https://docs.cocotb.org/en/v1.5.2/library_reference.html#cocotb.simulator.gpi_sim_hdl.get_handle_by_name)

* [get\_name\_string() (cocotb.simulator.gpi\_sim\_hdl method)](https://docs.cocotb.org/en/v1.5.2/library_reference.html#cocotb.simulator.gpi_sim_hdl.get_name_string)

* [get\_nowait() (cocotb.queue.Queue method)](https://docs.cocotb.org/en/v1.5.2/library_reference.html#cocotb.queue.Queue.get_nowait)

* [get\_num\_elems() (cocotb.simulator.gpi\_sim\_hdl method)](https://docs.cocotb.org/en/v1.5.2/library_reference.html#cocotb.simulator.gpi_sim_hdl.get_num_elems)

* [get\_precision() (in module cocotb.simulator)](https://docs.cocotb.org/en/v1.5.2/library_reference.html#cocotb.simulator.get_precision)

* [get\_range() (cocotb.simulator.gpi\_sim\_hdl method)](https://docs.cocotb.org/en/v1.5.2/library_reference.html#cocotb.simulator.gpi_sim_hdl.get_range)

* [get\_root\_handle() (in module cocotb.simulator)](https://docs.cocotb.org/en/v1.5.2/library_reference.html#cocotb.simulator.get_root_handle)

* [get\_signal\_val\_binstr() (cocotb.simulator.gpi\_sim\_hdl method)](https://docs.cocotb.org/en/v1.5.2/library_reference.html#cocotb.simulator.gpi_sim_hdl.get_signal_val_binstr)

* [get\_signal\_val\_long() (cocotb.simulator.gpi\_sim\_hdl method)](https://docs.cocotb.org/en/v1.5.2/library_reference.html#cocotb.simulator.gpi_sim_hdl.get_signal_val_long)

* [get\_signal\_val\_real() (cocotb.simulator.gpi\_sim\_hdl method)](https://docs.cocotb.org/en/v1.5.2/library_reference.html#cocotb.simulator.gpi_sim_hdl.get_signal_val_real)

* [get\_signal\_val\_str() (cocotb.simulator.gpi\_sim\_hdl method)](https://docs.cocotb.org/en/v1.5.2/library_reference.html#cocotb.simulator.gpi_sim_hdl.get_signal_val_str)

* [get\_sim\_steps() (in module cocotb.utils)](https://docs.cocotb.org/en/v1.5.2/library_reference.html#cocotb.utils.get_sim_steps)

* [get\_sim\_time() (in module cocotb.simulator)](https://docs.cocotb.org/en/v1.5.2/library_reference.html#cocotb.simulator.get_sim_time)
* [(in module cocotb.utils)](https://docs.cocotb.org/en/v1.5.2/library_reference.html#cocotb.utils.get_sim_time)

* [get\_simulator\_product() (in module cocotb.simulator)](https://docs.cocotb.org/en/v1.5.2/library_reference.html#cocotb.simulator.get_simulator_product)

* [get\_simulator\_version() (in module cocotb.simulator)](https://docs.cocotb.org/en/v1.5.2/library_reference.html#cocotb.simulator.get_simulator_version)

* [get\_time\_from\_sim\_steps() (in module cocotb.utils)](https://docs.cocotb.org/en/v1.5.2/library_reference.html#cocotb.utils.get_time_from_sim_steps)

* [get\_type() (cocotb.simulator.gpi\_sim\_hdl method)](https://docs.cocotb.org/en/v1.5.2/library_reference.html#cocotb.simulator.gpi_sim_hdl.get_type)

* [get\_type\_string() (cocotb.simulator.gpi\_sim\_hdl method)](https://docs.cocotb.org/en/v1.5.2/library_reference.html#cocotb.simulator.gpi_sim_hdl.get_type_string)

* [**GPI**](https://docs.cocotb.org/en/v1.5.2/glossary.html#term-GPI)

* [gpi\_cb\_hdl (C++ type)](https://docs.cocotb.org/en/v1.5.2/library_reference_c.html#_CPPv410gpi_cb_hdl)
* [(class in cocotb.simulator)](https://docs.cocotb.org/en/v1.5.2/library_reference.html#cocotb.simulator.gpi_cb_hdl)

* [gpi\_cleanup (C++ function)](https://docs.cocotb.org/en/v1.5.2/library_reference_c.html#_CPPv411gpi_cleanupv)

* [gpi\_deregister\_callback (C++ function)](https://docs.cocotb.org/en/v1.5.2/library_reference_c.html#_CPPv423gpi_deregister_callback10gpi_cb_hdl)

* [gpi\_edge (C++ enum)](https://docs.cocotb.org/en/v1.5.2/library_reference_c.html#_CPPv48gpi_edge)

* [gpi\_edge::GPI\_FALLING (C++ enumerator)](https://docs.cocotb.org/en/v1.5.2/library_reference_c.html#_CPPv4N8gpi_edge11GPI_FALLINGE)

* [gpi\_edge::GPI\_RISING (C++ enumerator)](https://docs.cocotb.org/en/v1.5.2/library_reference_c.html#_CPPv4N8gpi_edge10GPI_RISINGE)

* [gpi\_edge\_e (C++ type)](https://docs.cocotb.org/en/v1.5.2/library_reference_c.html#_CPPv410gpi_edge_e)

* [gpi\_event\_e (C++ enum)](https://docs.cocotb.org/en/v1.5.2/library_reference_c.html#_CPPv411gpi_event_e)

* [gpi\_event\_e::SIM\_FAIL (C++ enumerator)](https://docs.cocotb.org/en/v1.5.2/library_reference_c.html#_CPPv4N11gpi_event_e8SIM_FAILE)

* [gpi\_event\_e::SIM\_INFO (C++ enumerator)](https://docs.cocotb.org/en/v1.5.2/library_reference_c.html#_CPPv4N11gpi_event_e8SIM_INFOE)

* [gpi\_event\_e::SIM\_TEST\_FAIL (C++ enumerator)](https://docs.cocotb.org/en/v1.5.2/library_reference_c.html#_CPPv4N11gpi_event_e13SIM_TEST_FAILE)

* [gpi\_event\_t (C++ type)](https://docs.cocotb.org/en/v1.5.2/library_reference_c.html#_CPPv411gpi_event_t)

* [GPI\_EXPORT (C macro)](https://docs.cocotb.org/en/v1.5.2/library_reference_c.html#c.GPI_EXPORT)

* [GPI\_EXTRA](https://docs.cocotb.org/en/v1.5.2/custom_flows.html#index-2)
, [\[1\]](https://docs.cocotb.org/en/v1.5.2/custom_flows.html#index-3)
, [\[2\]](https://docs.cocotb.org/en/v1.5.2/custom_flows.html#index-4)
, [\[3\]](https://docs.cocotb.org/en/v1.5.2/custom_flows.html#index-5)
, [\[4\]](https://docs.cocotb.org/en/v1.5.2/custom_flows.html#index-6)
, [\[5\]](https://docs.cocotb.org/en/v1.5.2/custom_flows.html#index-7)
, [\[6\]](https://docs.cocotb.org/en/v1.5.2/custom_flows.html#index-8)
, [\[7\]](https://docs.cocotb.org/en/v1.5.2/custom_flows.html#index-9)
, [\[8\]](https://docs.cocotb.org/en/v1.5.2/release_notes.html#index-4)
, [\[9\]](https://docs.cocotb.org/en/v1.5.2/release_notes.html#index-8)

* [gpi\_free\_handle (C++ function)](https://docs.cocotb.org/en/v1.5.2/library_reference_c.html#_CPPv415gpi_free_handle11gpi_sim_hdl)

* [gpi\_get\_callback\_data (C++ function)](https://docs.cocotb.org/en/v1.5.2/library_reference_c.html#_CPPv421gpi_get_callback_data10gpi_cb_hdl)

* [gpi\_get\_definition\_file (C++ function)](https://docs.cocotb.org/en/v1.5.2/library_reference_c.html#_CPPv423gpi_get_definition_file11gpi_sim_hdl)

* [gpi\_get\_definition\_name (C++ function)](https://docs.cocotb.org/en/v1.5.2/library_reference_c.html#_CPPv423gpi_get_definition_name11gpi_sim_hdl)

* [gpi\_get\_handle\_by\_index (C++ function)](https://docs.cocotb.org/en/v1.5.2/library_reference_c.html#_CPPv423gpi_get_handle_by_index11gpi_sim_hdl7int32_t)

* [gpi\_get\_handle\_by\_name (C++ function)](https://docs.cocotb.org/en/v1.5.2/library_reference_c.html#_CPPv422gpi_get_handle_by_name11gpi_sim_hdlPKc)

* [gpi\_get\_num\_elems (C++ function)](https://docs.cocotb.org/en/v1.5.2/library_reference_c.html#_CPPv417gpi_get_num_elems11gpi_sim_hdl)

* [gpi\_get\_object\_type (C++ function)](https://docs.cocotb.org/en/v1.5.2/library_reference_c.html#_CPPv419gpi_get_object_type11gpi_sim_hdl)

* [gpi\_get\_range\_left (C++ function)](https://docs.cocotb.org/en/v1.5.2/library_reference_c.html#_CPPv418gpi_get_range_left11gpi_sim_hdl)

* [gpi\_get\_range\_right (C++ function)](https://docs.cocotb.org/en/v1.5.2/library_reference_c.html#_CPPv419gpi_get_range_right11gpi_sim_hdl)

* [gpi\_get\_root\_handle (C++ function)](https://docs.cocotb.org/en/v1.5.2/library_reference_c.html#_CPPv419gpi_get_root_handlePKc)

* [gpi\_get\_signal\_name\_str (C++ function)](https://docs.cocotb.org/en/v1.5.2/library_reference_c.html#_CPPv423gpi_get_signal_name_str11gpi_sim_hdl) | * [gpi\_get\_signal\_type\_str (C++ function)](https://docs.cocotb.org/en/v1.5.2/library_reference_c.html#_CPPv423gpi_get_signal_type_str11gpi_sim_hdl)

* [gpi\_get\_signal\_value\_binstr (C++ function)](https://docs.cocotb.org/en/v1.5.2/library_reference_c.html#_CPPv427gpi_get_signal_value_binstr11gpi_sim_hdl)

* [gpi\_get\_signal\_value\_long (C++ function)](https://docs.cocotb.org/en/v1.5.2/library_reference_c.html#_CPPv425gpi_get_signal_value_long11gpi_sim_hdl)

* [gpi\_get\_signal\_value\_real (C++ function)](https://docs.cocotb.org/en/v1.5.2/library_reference_c.html#_CPPv425gpi_get_signal_value_real11gpi_sim_hdl)

* [gpi\_get\_signal\_value\_str (C++ function)](https://docs.cocotb.org/en/v1.5.2/library_reference_c.html#_CPPv424gpi_get_signal_value_str11gpi_sim_hdl)

* [gpi\_get\_sim\_precision (C++ function)](https://docs.cocotb.org/en/v1.5.2/library_reference_c.html#_CPPv421gpi_get_sim_precisionP7int32_t)

* [gpi\_get\_sim\_time (C++ function)](https://docs.cocotb.org/en/v1.5.2/library_reference_c.html#_CPPv416gpi_get_sim_timeP8uint32_tP8uint32_t)

* [gpi\_get\_simulator\_product (C++ function)](https://docs.cocotb.org/en/v1.5.2/library_reference_c.html#_CPPv425gpi_get_simulator_productv)

* [gpi\_get\_simulator\_version (C++ function)](https://docs.cocotb.org/en/v1.5.2/library_reference_c.html#_CPPv425gpi_get_simulator_versionv)

* [gpi\_has\_registered\_impl (C++ function)](https://docs.cocotb.org/en/v1.5.2/library_reference_c.html#_CPPv423gpi_has_registered_implv)

* [gpi\_is\_constant (C++ function)](https://docs.cocotb.org/en/v1.5.2/library_reference_c.html#_CPPv415gpi_is_constant11gpi_sim_hdl)

* [gpi\_is\_indexable (C++ function)](https://docs.cocotb.org/en/v1.5.2/library_reference_c.html#_CPPv416gpi_is_indexable11gpi_sim_hdl)

* [gpi\_iterate (C++ function)](https://docs.cocotb.org/en/v1.5.2/library_reference_c.html#_CPPv411gpi_iterate11gpi_sim_hdl18gpi_iterator_sel_t)

* [gpi\_iterator\_hdl (C++ type)](https://docs.cocotb.org/en/v1.5.2/library_reference_c.html#_CPPv416gpi_iterator_hdl)
* [(class in cocotb.simulator)](https://docs.cocotb.org/en/v1.5.2/library_reference.html#cocotb.simulator.gpi_iterator_hdl)

* [gpi\_iterator\_sel\_e (C++ enum)](https://docs.cocotb.org/en/v1.5.2/library_reference_c.html#_CPPv418gpi_iterator_sel_e)

* [gpi\_iterator\_sel\_e::GPI\_DRIVERS (C++ enumerator)](https://docs.cocotb.org/en/v1.5.2/library_reference_c.html#_CPPv4N18gpi_iterator_sel_e11GPI_DRIVERSE)

* [gpi\_iterator\_sel\_e::GPI\_LOADS (C++ enumerator)](https://docs.cocotb.org/en/v1.5.2/library_reference_c.html#_CPPv4N18gpi_iterator_sel_e9GPI_LOADSE)

* [gpi\_iterator\_sel\_e::GPI\_OBJECTS (C++ enumerator)](https://docs.cocotb.org/en/v1.5.2/library_reference_c.html#_CPPv4N18gpi_iterator_sel_e11GPI_OBJECTSE)

* [gpi\_iterator\_sel\_t (C++ type)](https://docs.cocotb.org/en/v1.5.2/library_reference_c.html#_CPPv418gpi_iterator_sel_t)

* [gpi\_next (C++ function)](https://docs.cocotb.org/en/v1.5.2/library_reference_c.html#_CPPv48gpi_next16gpi_iterator_hdl)

* [gpi\_objtype\_e (C++ enum)](https://docs.cocotb.org/en/v1.5.2/library_reference_c.html#_CPPv413gpi_objtype_e)

* [gpi\_objtype\_e::GPI\_ARRAY (C++ enumerator)](https://docs.cocotb.org/en/v1.5.2/library_reference_c.html#_CPPv4N13gpi_objtype_e9GPI_ARRAYE)

* [gpi\_objtype\_e::GPI\_ENUM (C++ enumerator)](https://docs.cocotb.org/en/v1.5.2/library_reference_c.html#_CPPv4N13gpi_objtype_e8GPI_ENUME)

* [gpi\_objtype\_e::GPI\_GENARRAY (C++ enumerator)](https://docs.cocotb.org/en/v1.5.2/library_reference_c.html#_CPPv4N13gpi_objtype_e12GPI_GENARRAYE)

* [gpi\_objtype\_e::GPI\_INTEGER (C++ enumerator)](https://docs.cocotb.org/en/v1.5.2/library_reference_c.html#_CPPv4N13gpi_objtype_e11GPI_INTEGERE)

* [gpi\_objtype\_e::GPI\_MEMORY (C++ enumerator)](https://docs.cocotb.org/en/v1.5.2/library_reference_c.html#_CPPv4N13gpi_objtype_e10GPI_MEMORYE)

* [gpi\_objtype\_e::GPI\_MODULE (C++ enumerator)](https://docs.cocotb.org/en/v1.5.2/library_reference_c.html#_CPPv4N13gpi_objtype_e10GPI_MODULEE)

* [gpi\_objtype\_e::GPI\_NET (C++ enumerator)](https://docs.cocotb.org/en/v1.5.2/library_reference_c.html#_CPPv4N13gpi_objtype_e7GPI_NETE)

* [gpi\_objtype\_e::GPI\_REAL (C++ enumerator)](https://docs.cocotb.org/en/v1.5.2/library_reference_c.html#_CPPv4N13gpi_objtype_e8GPI_REALE)

* [gpi\_objtype\_e::GPI\_REGISTER (C++ enumerator)](https://docs.cocotb.org/en/v1.5.2/library_reference_c.html#_CPPv4N13gpi_objtype_e12GPI_REGISTERE)

* [gpi\_objtype\_e::GPI\_STRING (C++ enumerator)](https://docs.cocotb.org/en/v1.5.2/library_reference_c.html#_CPPv4N13gpi_objtype_e10GPI_STRINGE)

* [gpi\_objtype\_e::GPI\_STRUCTURE (C++ enumerator)](https://docs.cocotb.org/en/v1.5.2/library_reference_c.html#_CPPv4N13gpi_objtype_e13GPI_STRUCTUREE)

* [gpi\_objtype\_e::GPI\_UNKNOWN (C++ enumerator)](https://docs.cocotb.org/en/v1.5.2/library_reference_c.html#_CPPv4N13gpi_objtype_e11GPI_UNKNOWNE)

* [gpi\_objtype\_t (C++ type)](https://docs.cocotb.org/en/v1.5.2/library_reference_c.html#_CPPv413gpi_objtype_t)

* [gpi\_print\_registered\_impl (C++ function)](https://docs.cocotb.org/en/v1.5.2/library_reference_c.html#_CPPv425gpi_print_registered_implv)

* [gpi\_register\_nexttime\_callback (C++ function)](https://docs.cocotb.org/en/v1.5.2/library_reference_c.html#_CPPv430gpi_register_nexttime_callbackPFiPKvEPv)

* [gpi\_register\_readonly\_callback (C++ function)](https://docs.cocotb.org/en/v1.5.2/library_reference_c.html#_CPPv430gpi_register_readonly_callbackPFiPKvEPv)

* [gpi\_register\_readwrite\_callback (C++ function)](https://docs.cocotb.org/en/v1.5.2/library_reference_c.html#_CPPv431gpi_register_readwrite_callbackPFiPKvEPv)

* [gpi\_register\_timed\_callback (C++ function)](https://docs.cocotb.org/en/v1.5.2/library_reference_c.html#_CPPv427gpi_register_timed_callbackPFiPKvEPv8uint64_t)

* [gpi\_register\_value\_change\_callback (C++ function)](https://docs.cocotb.org/en/v1.5.2/library_reference_c.html#_CPPv434gpi_register_value_change_callbackPFiPKvEPv11gpi_sim_hdli)

* [gpi\_set\_action\_e (C++ enum)](https://docs.cocotb.org/en/v1.5.2/library_reference_c.html#_CPPv416gpi_set_action_e)

* [gpi\_set\_action\_e::GPI\_DEPOSIT (C++ enumerator)](https://docs.cocotb.org/en/v1.5.2/library_reference_c.html#_CPPv4N16gpi_set_action_e11GPI_DEPOSITE)

* [gpi\_set\_action\_e::GPI\_FORCE (C++ enumerator)](https://docs.cocotb.org/en/v1.5.2/library_reference_c.html#_CPPv4N16gpi_set_action_e9GPI_FORCEE)

* [gpi\_set\_action\_e::GPI\_RELEASE (C++ enumerator)](https://docs.cocotb.org/en/v1.5.2/library_reference_c.html#_CPPv4N16gpi_set_action_e11GPI_RELEASEE)

* [gpi\_set\_action\_t (C++ type)](https://docs.cocotb.org/en/v1.5.2/library_reference_c.html#_CPPv416gpi_set_action_t)

* [gpi\_set\_signal\_value\_binstr (C++ function)](https://docs.cocotb.org/en/v1.5.2/library_reference_c.html#_CPPv427gpi_set_signal_value_binstr11gpi_sim_hdlPKc16gpi_set_action_t)

* [gpi\_set\_signal\_value\_int (C++ function)](https://docs.cocotb.org/en/v1.5.2/library_reference_c.html#_CPPv424gpi_set_signal_value_int11gpi_sim_hdl7int32_t16gpi_set_action_t)

* [gpi\_set\_signal\_value\_real (C++ function)](https://docs.cocotb.org/en/v1.5.2/library_reference_c.html#_CPPv425gpi_set_signal_value_real11gpi_sim_hdld16gpi_set_action_t)

* [gpi\_set\_signal\_value\_str (C++ function)](https://docs.cocotb.org/en/v1.5.2/library_reference_c.html#_CPPv424gpi_set_signal_value_str11gpi_sim_hdlPKc16gpi_set_action_t)

* [gpi\_sim\_end (C++ function)](https://docs.cocotb.org/en/v1.5.2/library_reference_c.html#_CPPv411gpi_sim_endv)

* [gpi\_sim\_hdl (C++ type)](https://docs.cocotb.org/en/v1.5.2/library_reference_c.html#_CPPv411gpi_sim_hdl)
* [(class in cocotb.simulator)](https://docs.cocotb.org/en/v1.5.2/library_reference.html#cocotb.simulator.gpi_sim_hdl)

* [GPITrigger (class in cocotb.triggers)](https://docs.cocotb.org/en/v1.5.2/library_reference.html#cocotb.triggers.GPITrigger)

* GUI
* [Make Variable](https://docs.cocotb.org/en/v1.5.2/building.html#var-GUI) | H - | | | | --- | --- | | * [**HAL**](https://docs.cocotb.org/en/v1.5.2/glossary.html#term-HAL)

* [handle\_result() (cocotb.regression.RegressionManager method)](https://docs.cocotb.org/en/v1.5.2/library_reference.html#cocotb.regression.RegressionManager.handle_result)

* [**HDL**](https://docs.cocotb.org/en/v1.5.2/glossary.html#term-HDL)

* [hexdiffs() (in module cocotb.utils)](https://docs.cocotb.org/en/v1.5.2/library_reference.html#cocotb.utils.hexdiffs) | * [hexdump() (in module cocotb.utils)](https://docs.cocotb.org/en/v1.5.2/library_reference.html#cocotb.utils.hexdump)

* [HierarchyArrayObject (class in cocotb.handle)](https://docs.cocotb.org/en/v1.5.2/library_reference.html#cocotb.handle.HierarchyArrayObject)

* [HierarchyObject (class in cocotb.handle)](https://docs.cocotb.org/en/v1.5.2/library_reference.html#cocotb.handle.HierarchyObject)

* [hook (class in cocotb)](https://docs.cocotb.org/en/v1.5.2/library_reference.html#cocotb.hook) | I - | | | | --- | --- | | * [idle() (cocotb\_bus.drivers.xgmii.XGMII method)](https://docs.cocotb.org/en/v1.5.2/library_reference.html#cocotb_bus.drivers.xgmii.XGMII.idle)

* [in\_reset() (cocotb\_bus.monitors.BusMonitor property)](https://docs.cocotb.org/en/v1.5.2/library_reference.html#cocotb_bus.monitors.BusMonitor.in_reset)

* [incrementing\_data() (in module cocotb.generators.byte)](https://docs.cocotb.org/en/v1.5.2/library_reference.html#cocotb.generators.byte.incrementing_data)

* [integer() (cocotb.binary.BinaryValue property)](https://docs.cocotb.org/en/v1.5.2/library_reference.html#cocotb.binary.BinaryValue.integer)

* [IntegerObject (class in cocotb.handle)](https://docs.cocotb.org/en/v1.5.2/library_reference.html#cocotb.handle.IntegerObject) | * [intermittent\_single\_cycles() (in module cocotb.generators.bit)](https://docs.cocotb.org/en/v1.5.2/library_reference.html#cocotb.generators.bit.intermittent_single_cycles)

* [is\_resolvable() (cocotb.binary.BinaryValue property)](https://docs.cocotb.org/en/v1.5.2/library_reference.html#cocotb.binary.BinaryValue.is_resolvable)

* [is\_running() (in module cocotb.simulator)](https://docs.cocotb.org/en/v1.5.2/library_reference.html#cocotb.simulator.is_running)

* [is\_set() (cocotb.triggers.Event method)](https://docs.cocotb.org/en/v1.5.2/triggers.html#cocotb.triggers.Event.is_set)

* [iterate() (cocotb.simulator.gpi\_sim\_hdl method)](https://docs.cocotb.org/en/v1.5.2/library_reference.html#cocotb.simulator.gpi_sim_hdl.iterate) | J - | | | | --- | --- | | * [Join (class in cocotb.triggers)](https://docs.cocotb.org/en/v1.5.2/triggers.html#cocotb.triggers.Join) | * [join() (in module cocotb.decorators.RunningTask)](https://docs.cocotb.org/en/v1.5.2/library_reference.html#cocotb.decorators.RunningTask.join) | K - * [kill() (cocotb\_bus.drivers.Driver method)](https://docs.cocotb.org/en/v1.5.2/library_reference.html#cocotb_bus.drivers.Driver.kill) * [(cocotb\_bus.monitors.Monitor method)](https://docs.cocotb.org/en/v1.5.2/library_reference.html#cocotb_bus.monitors.Monitor.kill) * [(in module cocotb.decorators.RunningTask)](https://docs.cocotb.org/en/v1.5.2/library_reference.html#cocotb.decorators.RunningTask.kill) L - | | | | --- | --- | | * [LANGUAGE (in module cocotb)](https://docs.cocotb.org/en/v1.5.2/library_reference.html#cocotb.LANGUAGE)

* [layer1() (cocotb\_bus.drivers.xgmii.XGMII static method)](https://docs.cocotb.org/en/v1.5.2/library_reference.html#cocotb_bus.drivers.xgmii.XGMII.layer1)

* [lazy\_property (class in cocotb.utils)](https://docs.cocotb.org/en/v1.5.2/library_reference.html#cocotb.utils.lazy_property)

* [LD\_LIBRARY\_PATH](https://docs.cocotb.org/en/v1.5.2/troubleshooting.html#index-2)
, [\[1\]](https://docs.cocotb.org/en/v1.5.2/troubleshooting.html#index-3)
, [\[2\]](https://docs.cocotb.org/en/v1.5.2/troubleshooting.html#index-4)
, [\[3\]](https://docs.cocotb.org/en/v1.5.2/troubleshooting.html#index-5)
, [\[4\]](https://docs.cocotb.org/en/v1.5.2/troubleshooting.html#index-6)
, [\[5\]](https://docs.cocotb.org/en/v1.5.2/troubleshooting.html#index-7)
, [\[6\]](https://docs.cocotb.org/en/v1.5.2/troubleshooting.html#index-8)

* [LIBPYTHON\_LOC](https://docs.cocotb.org/en/v1.5.2/custom_flows.html#index-0)

* [LICENSE\_QUEUE](https://docs.cocotb.org/en/v1.5.2/simulator_support.html#index-0) | * [LifoQueue (class in cocotb.queue)](https://docs.cocotb.org/en/v1.5.2/library_reference.html#cocotb.queue.LifoQueue)

* [loads() (cocotb.handle.NonConstantObject method)](https://docs.cocotb.org/en/v1.5.2/library_reference.html#cocotb.handle.NonConstantObject.loads)

* [Lock (class in cocotb.triggers)](https://docs.cocotb.org/en/v1.5.2/triggers.html#cocotb.triggers.Lock)

* [locked (cocotb.triggers.Lock attribute)](https://docs.cocotb.org/en/v1.5.2/triggers.html#cocotb.triggers.Lock.locked)

* [log\_level() (in module cocotb.simulator)](https://docs.cocotb.org/en/v1.5.2/library_reference.html#cocotb.simulator.log_level)

* [log\_msg() (in module cocotb.simulator)](https://docs.cocotb.org/en/v1.5.2/library_reference.html#cocotb.simulator.log_msg) | M - | | | | --- | --- | | * Make Variable
* [COCOTB\_HDL\_TIMEPRECISION](https://docs.cocotb.org/en/v1.5.2/building.html#var-COCOTB_HDL_TIMEPRECISION)

* [COCOTB\_HDL\_TIMEUNIT](https://docs.cocotb.org/en/v1.5.2/building.html#var-COCOTB_HDL_TIMEUNIT)

* [COMPILE\_ARGS](https://docs.cocotb.org/en/v1.5.2/building.html#var-COMPILE_ARGS)

* [CUSTOM\_COMPILE\_DEPS](https://docs.cocotb.org/en/v1.5.2/building.html#var-CUSTOM_COMPILE_DEPS)

* [CUSTOM\_SIM\_DEPS](https://docs.cocotb.org/en/v1.5.2/building.html#var-CUSTOM_SIM_DEPS)

* [EXTRA\_ARGS](https://docs.cocotb.org/en/v1.5.2/building.html#var-EXTRA_ARGS)

* [GUI](https://docs.cocotb.org/en/v1.5.2/building.html#var-GUI)

* [PLUSARGS](https://docs.cocotb.org/en/v1.5.2/building.html#var-PLUSARGS)

* [RUN\_ARGS](https://docs.cocotb.org/en/v1.5.2/building.html#var-RUN_ARGS)

* [SIM](https://docs.cocotb.org/en/v1.5.2/building.html#var-SIM)

* [SIM\_ARGS](https://docs.cocotb.org/en/v1.5.2/building.html#var-SIM_ARGS)

* [SIM\_BUILD](https://docs.cocotb.org/en/v1.5.2/building.html#var-SIM_BUILD)

* [TOPLEVEL\_LANG](https://docs.cocotb.org/en/v1.5.2/building.html#var-TOPLEVEL_LANG)

* [VERILOG\_SOURCES](https://docs.cocotb.org/en/v1.5.2/building.html#var-VERILOG_SOURCES)

* [VHDL\_GPI\_INTERFACE](https://docs.cocotb.org/en/v1.5.2/building.html#var-VHDL_GPI_INTERFACE)

* [VHDL\_SOURCES](https://docs.cocotb.org/en/v1.5.2/building.html#var-VHDL_SOURCES)

* [VHDL\_SOURCES\_](https://docs.cocotb.org/en/v1.5.2/building.html#var-VHDL_SOURCES_%3Clib%3E)

* [WAVES](https://docs.cocotb.org/en/v1.5.2/building.html#var-WAVES) | * [maxsize() (cocotb.queue.Queue property)](https://docs.cocotb.org/en/v1.5.2/library_reference.html#cocotb.queue.Queue.maxsize)

* [**MDV**](https://docs.cocotb.org/en/v1.5.2/glossary.html#term-MDV)

* [ModifiableObject (class in cocotb.handle)](https://docs.cocotb.org/en/v1.5.2/library_reference.html#cocotb.handle.ModifiableObject)

* [MODULE](https://docs.cocotb.org/en/v1.5.2/building.html#index-1)
, [\[1\]](https://docs.cocotb.org/en/v1.5.2/building.html#index-4)
, [\[2\]](https://docs.cocotb.org/en/v1.5.2/custom_flows.html#index-1)
, [\[3\]](https://docs.cocotb.org/en/v1.5.2/library_reference.html#index-5)
, [\[4\]](https://docs.cocotb.org/en/v1.5.2/quickstart.html#index-1)
, [\[5\]](https://docs.cocotb.org/en/v1.5.2/release_notes.html#index-9)

* module
* [cocotb.generators](https://docs.cocotb.org/en/v1.5.2/library_reference.html#module-cocotb.generators)

* [cocotb.generators.bit](https://docs.cocotb.org/en/v1.5.2/library_reference.html#module-cocotb.generators.bit)

* [cocotb.generators.byte](https://docs.cocotb.org/en/v1.5.2/library_reference.html#module-cocotb.generators.byte)

* [cocotb.handle](https://docs.cocotb.org/en/v1.5.2/library_reference.html#module-cocotb.handle)

* [cocotb.ipython\_support](https://docs.cocotb.org/en/v1.5.2/troubleshooting.html#module-cocotb.ipython_support)

* [cocotb.queue](https://docs.cocotb.org/en/v1.5.2/library_reference.html#module-cocotb.queue)

* [cocotb.result](https://docs.cocotb.org/en/v1.5.2/library_reference.html#module-cocotb.result)

* [cocotb.simulator](https://docs.cocotb.org/en/v1.5.2/library_reference.html#module-cocotb.simulator)

* [cocotb.utils](https://docs.cocotb.org/en/v1.5.2/library_reference.html#module-cocotb.utils)

* [cocotb.wavedrom](https://docs.cocotb.org/en/v1.5.2/library_reference.html#module-cocotb.wavedrom)

* [cocotb\_bus.scoreboard](https://docs.cocotb.org/en/v1.5.2/library_reference.html#module-cocotb_bus.scoreboard)

* [Monitor (class in cocotb\_bus.monitors)](https://docs.cocotb.org/en/v1.5.2/library_reference.html#cocotb_bus.monitors.Monitor) | N - | | | | --- | --- | | * [n\_bits() (cocotb.binary.BinaryValue property)](https://docs.cocotb.org/en/v1.5.2/library_reference.html#cocotb.binary.BinaryValue.n_bits)

* [next\_test() (cocotb.regression.RegressionManager method)](https://docs.cocotb.org/en/v1.5.2/library_reference.html#cocotb.regression.RegressionManager.next_test)

* [NextTimeStep (class in cocotb.triggers)](https://docs.cocotb.org/en/v1.5.2/triggers.html#cocotb.triggers.NextTimeStep) | * [NO\_COLOR](https://docs.cocotb.org/en/v1.5.2/building.html#index-2)
, [\[1\]](https://docs.cocotb.org/en/v1.5.2/release_notes.html#index-6)

* [NonConstantObject (class in cocotb.handle)](https://docs.cocotb.org/en/v1.5.2/library_reference.html#cocotb.handle.NonConstantObject)

* [NonHierarchyIndexableObject (class in cocotb.handle)](https://docs.cocotb.org/en/v1.5.2/library_reference.html#cocotb.handle.NonHierarchyIndexableObject)

* [NonHierarchyObject (class in cocotb.handle)](https://docs.cocotb.org/en/v1.5.2/library_reference.html#cocotb.handle.NonHierarchyObject) | O - * [OPBMaster (class in cocotb\_bus.drivers.opb)](https://docs.cocotb.org/en/v1.5.2/library_reference.html#cocotb_bus.drivers.opb.OPBMaster) P - | | | | --- | --- | | * [pack() (in module cocotb.utils)](https://docs.cocotb.org/en/v1.5.2/library_reference.html#cocotb.utils.pack)

* [ParametrizedSingleton (class in cocotb.utils)](https://docs.cocotb.org/en/v1.5.2/library_reference.html#cocotb.utils.ParametrizedSingleton)

* [PATH](https://docs.cocotb.org/en/v1.5.2/install.html#index-0)
, [\[1\]](https://docs.cocotb.org/en/v1.5.2/install.html#index-1)

* [PLUSARGS](https://docs.cocotb.org/en/v1.5.2/release_notes.html#index-7)
* [Make Variable](https://docs.cocotb.org/en/v1.5.2/building.html#var-PLUSARGS)

* [plusargs (in module cocotb)](https://docs.cocotb.org/en/v1.5.2/library_reference.html#cocotb.plusargs)

* [prime() (cocotb.triggers.Trigger method)](https://docs.cocotb.org/en/v1.5.2/library_reference.html#cocotb.triggers.Trigger.prime) | * [PriorityQueue (class in cocotb.queue)](https://docs.cocotb.org/en/v1.5.2/library_reference.html#cocotb.queue.PriorityQueue)

* [put() (cocotb.queue.Queue method)](https://docs.cocotb.org/en/v1.5.2/library_reference.html#cocotb.queue.Queue.put)

* [put\_nowait() (cocotb.queue.Queue method)](https://docs.cocotb.org/en/v1.5.2/library_reference.html#cocotb.queue.Queue.put_nowait)

* Python Enhancement Proposals
* [PEP 420](https://docs.cocotb.org/en/v1.5.2/extensions.html#index-0)

* [PEP 517](https://docs.cocotb.org/en/v1.5.2/release_notes.html#index-3)

* [PEP 525](https://docs.cocotb.org/en/v1.5.2/coroutines.html#index-0) | Q - | | | | --- | --- | | * [qsize() (cocotb.queue.Queue method)](https://docs.cocotb.org/en/v1.5.2/library_reference.html#cocotb.queue.Queue.qsize)

* [Queue (class in cocotb.queue)](https://docs.cocotb.org/en/v1.5.2/library_reference.html#cocotb.queue.Queue) | * [queue() (cocotb.scheduler.Scheduler method)](https://docs.cocotb.org/en/v1.5.2/library_reference.html#cocotb.scheduler.Scheduler.queue)

* [queue\_function() (cocotb.scheduler.Scheduler method)](https://docs.cocotb.org/en/v1.5.2/library_reference.html#cocotb.scheduler.Scheduler.queue_function) | R - | | | | --- | --- | | * [raise\_error() (in module cocotb.result)](https://docs.cocotb.org/en/v1.5.2/library_reference.html#cocotb.result.raise_error)

* [random\_50\_percent() (in module cocotb.generators.bit)](https://docs.cocotb.org/en/v1.5.2/library_reference.html#cocotb.generators.bit.random_50_percent)

* [random\_data() (in module cocotb.generators.byte)](https://docs.cocotb.org/en/v1.5.2/library_reference.html#cocotb.generators.byte.random_data)

* [RANDOM\_SEED](https://docs.cocotb.org/en/v1.5.2/building.html#index-5)
, [\[1\]](https://docs.cocotb.org/en/v1.5.2/library_reference.html#index-3)
* [(in module cocotb)](https://docs.cocotb.org/en/v1.5.2/library_reference.html#cocotb.RANDOM_SEED)

* [react() (cocotb.scheduler.Scheduler method)](https://docs.cocotb.org/en/v1.5.2/library_reference.html#cocotb.scheduler.Scheduler.react)

* [read() (cocotb\_bus.drivers.amba.AXI4LiteMaster method)](https://docs.cocotb.org/en/v1.5.2/library_reference.html#cocotb_bus.drivers.amba.AXI4LiteMaster.read)
* [(cocotb\_bus.drivers.amba.AXI4Master method)](https://docs.cocotb.org/en/v1.5.2/library_reference.html#cocotb_bus.drivers.amba.AXI4Master.read)

* [(cocotb\_bus.drivers.avalon.AvalonMaster method)](https://docs.cocotb.org/en/v1.5.2/library_reference.html#cocotb_bus.drivers.avalon.AvalonMaster.read)

* [(cocotb\_bus.drivers.opb.OPBMaster method)](https://docs.cocotb.org/en/v1.5.2/library_reference.html#cocotb_bus.drivers.opb.OPBMaster.read)

* [ReadOnly (class in cocotb.triggers)](https://docs.cocotb.org/en/v1.5.2/triggers.html#cocotb.triggers.ReadOnly)

* [ReadWrite (class in cocotb.triggers)](https://docs.cocotb.org/en/v1.5.2/triggers.html#cocotb.triggers.ReadWrite)

* [RealObject (class in cocotb.handle)](https://docs.cocotb.org/en/v1.5.2/library_reference.html#cocotb.handle.RealObject)

* [RegionObject (class in cocotb.handle)](https://docs.cocotb.org/en/v1.5.2/library_reference.html#cocotb.handle.RegionObject)

* [register\_nextstep\_callback() (in module cocotb.simulator)](https://docs.cocotb.org/en/v1.5.2/library_reference.html#cocotb.simulator.register_nextstep_callback)

* [register\_readonly\_callback() (in module cocotb.simulator)](https://docs.cocotb.org/en/v1.5.2/library_reference.html#cocotb.simulator.register_readonly_callback)

* [register\_rwsynch\_callback() (in module cocotb.simulator)](https://docs.cocotb.org/en/v1.5.2/library_reference.html#cocotb.simulator.register_rwsynch_callback)

* [register\_timed\_callback() (in module cocotb.simulator)](https://docs.cocotb.org/en/v1.5.2/library_reference.html#cocotb.simulator.register_timed_callback) | * [register\_value\_change\_callback() (in module cocotb.simulator)](https://docs.cocotb.org/en/v1.5.2/library_reference.html#cocotb.simulator.register_value_change_callback)

* [regression\_manager (in module cocotb)](https://docs.cocotb.org/en/v1.5.2/library_reference.html#cocotb.regression_manager)

* [RegressionManager (class in cocotb.regression)](https://docs.cocotb.org/en/v1.5.2/library_reference.html#cocotb.regression.RegressionManager)

* [reject\_remaining\_kwargs() (in module cocotb.utils)](https://docs.cocotb.org/en/v1.5.2/library_reference.html#cocotb.utils.reject_remaining_kwargs)

* [Release (class in cocotb.handle)](https://docs.cocotb.org/en/v1.5.2/library_reference.html#cocotb.handle.Release)

* [release() (cocotb.triggers.Lock method)](https://docs.cocotb.org/en/v1.5.2/triggers.html#cocotb.triggers.Lock.release)

* [remove\_traceback\_frames() (in module cocotb.utils)](https://docs.cocotb.org/en/v1.5.2/library_reference.html#cocotb.utils.remove_traceback_frames)

* [repeat() (in module cocotb.generators)](https://docs.cocotb.org/en/v1.5.2/library_reference.html#cocotb.generators.repeat)

* [repeating\_bytes() (in module cocotb.generators.byte)](https://docs.cocotb.org/en/v1.5.2/library_reference.html#cocotb.generators.byte.repeating_bytes)

* [result() (cocotb\_bus.scoreboard.Scoreboard property)](https://docs.cocotb.org/en/v1.5.2/library_reference.html#cocotb_bus.scoreboard.Scoreboard.result)

* [ReturnValue](https://docs.cocotb.org/en/v1.5.2/library_reference.html#cocotb.result.ReturnValue)

* [retval() (cocotb.triggers.Join property)](https://docs.cocotb.org/en/v1.5.2/triggers.html#cocotb.triggers.Join.retval)

* [RisingEdge (class in cocotb.triggers)](https://docs.cocotb.org/en/v1.5.2/triggers.html#cocotb.triggers.RisingEdge)

* [**RTL**](https://docs.cocotb.org/en/v1.5.2/glossary.html#term-RTL)

* RUN\_ARGS
* [Make Variable](https://docs.cocotb.org/en/v1.5.2/building.html#var-RUN_ARGS)

* [run\_in\_executor() (cocotb.scheduler.Scheduler method)](https://docs.cocotb.org/en/v1.5.2/library_reference.html#cocotb.scheduler.Scheduler.run_in_executor)

* [run\_ipython() (in module cocotb.ipython\_support)](https://docs.cocotb.org/en/v1.5.2/troubleshooting.html#cocotb.ipython_support.run_ipython) | S - | | | | --- | --- | | * [sample() (cocotb.wavedrom.Wavedrom method)](https://docs.cocotb.org/en/v1.5.2/library_reference.html#cocotb.wavedrom.Wavedrom.sample)
* [(cocotb\_bus.bus.Bus method)](https://docs.cocotb.org/en/v1.5.2/library_reference.html#cocotb_bus.bus.Bus.sample)

* [schedule() (cocotb.scheduler.Scheduler method)](https://docs.cocotb.org/en/v1.5.2/library_reference.html#cocotb.scheduler.Scheduler.schedule)

* [Scheduler (class in cocotb.scheduler)](https://docs.cocotb.org/en/v1.5.2/library_reference.html#cocotb.scheduler.Scheduler)

* [scheduler (in module cocotb)](https://docs.cocotb.org/en/v1.5.2/library_reference.html#cocotb.scheduler)

* [Scoreboard (class in cocotb\_bus.scoreboard)](https://docs.cocotb.org/en/v1.5.2/library_reference.html#cocotb_bus.scoreboard.Scoreboard)

* [send() (cocotb\_bus.drivers.Driver method)](https://docs.cocotb.org/en/v1.5.2/library_reference.html#cocotb_bus.drivers.Driver.send)

* [set() (cocotb.triggers.Event method)](https://docs.cocotb.org/en/v1.5.2/triggers.html#cocotb.triggers.Event.set)

* [set\_signal\_val\_binstr() (cocotb.simulator.gpi\_sim\_hdl method)](https://docs.cocotb.org/en/v1.5.2/library_reference.html#cocotb.simulator.gpi_sim_hdl.set_signal_val_binstr)

* [set\_signal\_val\_int() (cocotb.simulator.gpi\_sim\_hdl method)](https://docs.cocotb.org/en/v1.5.2/library_reference.html#cocotb.simulator.gpi_sim_hdl.set_signal_val_int)

* [set\_signal\_val\_real() (cocotb.simulator.gpi\_sim\_hdl method)](https://docs.cocotb.org/en/v1.5.2/library_reference.html#cocotb.simulator.gpi_sim_hdl.set_signal_val_real)

* [set\_signal\_val\_str() (cocotb.simulator.gpi\_sim\_hdl method)](https://docs.cocotb.org/en/v1.5.2/library_reference.html#cocotb.simulator.gpi_sim_hdl.set_signal_val_str)

* [set\_valid\_generator() (cocotb\_bus.drivers.ValidatedBusDriver method)](https://docs.cocotb.org/en/v1.5.2/library_reference.html#cocotb_bus.drivers.ValidatedBusDriver.set_valid_generator)

* [setimmediatevalue() (cocotb.handle.NonHierarchyObject method)](https://docs.cocotb.org/en/v1.5.2/library_reference.html#cocotb.handle.NonHierarchyObject.setimmediatevalue)

* [signed\_integer() (cocotb.binary.BinaryValue property)](https://docs.cocotb.org/en/v1.5.2/library_reference.html#cocotb.binary.BinaryValue.signed_integer)

* [SIGNED\_MAGNITUDE (cocotb.binary.BinaryRepresentation attribute)](https://docs.cocotb.org/en/v1.5.2/library_reference.html#cocotb.binary.BinaryRepresentation.SIGNED_MAGNITUDE)

* SIM
* [Make Variable](https://docs.cocotb.org/en/v1.5.2/building.html#var-SIM)

* SIM\_ARGS
* [Make Variable](https://docs.cocotb.org/en/v1.5.2/building.html#var-SIM_ARGS) | * SIM\_BUILD
* [Make Variable](https://docs.cocotb.org/en/v1.5.2/building.html#var-SIM_BUILD)

* [SIM\_NAME (in module cocotb)](https://docs.cocotb.org/en/v1.5.2/library_reference.html#cocotb.SIM_NAME)

* [SIM\_VERSION (in module cocotb)](https://docs.cocotb.org/en/v1.5.2/library_reference.html#cocotb.SIM_VERSION)

* [SimColourLogFormatter (class in cocotb.log)](https://docs.cocotb.org/en/v1.5.2/library_reference.html#cocotb.log.SimColourLogFormatter)

* [SimFailure](https://docs.cocotb.org/en/v1.5.2/library_reference.html#cocotb.result.SimFailure)

* [SimHandle() (in module cocotb.handle)](https://docs.cocotb.org/en/v1.5.2/library_reference.html#cocotb.handle.SimHandle)

* [SimHandleBase (class in cocotb.handle)](https://docs.cocotb.org/en/v1.5.2/library_reference.html#cocotb.handle.SimHandleBase)

* [SimLogFormatter (class in cocotb.log)](https://docs.cocotb.org/en/v1.5.2/library_reference.html#cocotb.log.SimLogFormatter)

* [SimTimeContextFilter (class in cocotb.log)](https://docs.cocotb.org/en/v1.5.2/library_reference.html#cocotb.log.SimTimeContextFilter)

* [SimTimeoutError](https://docs.cocotb.org/en/v1.5.2/library_reference.html#cocotb.result.SimTimeoutError)

* [sine\_wave() (in module cocotb.generators)](https://docs.cocotb.org/en/v1.5.2/library_reference.html#cocotb.generators.sine_wave)

* [start() (cocotb.clock.Clock method)](https://docs.cocotb.org/en/v1.5.2/library_reference.html#cocotb.clock.Clock.start)
* [(cocotb\_bus.drivers.BitDriver method)](https://docs.cocotb.org/en/v1.5.2/library_reference.html#cocotb_bus.drivers.BitDriver.start)

* [start\_soon() (cocotb.scheduler.Scheduler method)](https://docs.cocotb.org/en/v1.5.2/library_reference.html#cocotb.scheduler.Scheduler.start_soon)

* [stop() (cocotb\_bus.drivers.BitDriver method)](https://docs.cocotb.org/en/v1.5.2/library_reference.html#cocotb_bus.drivers.BitDriver.stop)

* [stop\_simulator() (in module cocotb.simulator)](https://docs.cocotb.org/en/v1.5.2/library_reference.html#cocotb.simulator.stop_simulator)

* [StringObject (class in cocotb.handle)](https://docs.cocotb.org/en/v1.5.2/library_reference.html#cocotb.handle.StringObject) | T - | | | | --- | --- | | * [**task**](https://docs.cocotb.org/en/v1.5.2/glossary.html#term-task)

* [terminate() (cocotb\_bus.drivers.xgmii.XGMII method)](https://docs.cocotb.org/en/v1.5.2/library_reference.html#cocotb_bus.drivers.xgmii.XGMII.terminate)

* [test (class in cocotb)](https://docs.cocotb.org/en/v1.5.2/library_reference.html#cocotb.test)

* [TESTCASE](https://docs.cocotb.org/en/v1.5.2/library_reference.html#index-6)
, [\[1\]](https://docs.cocotb.org/en/v1.5.2/release_notes.html#index-1)

* [TestComplete](https://docs.cocotb.org/en/v1.5.2/library_reference.html#cocotb.result.TestComplete)

* [TestError](https://docs.cocotb.org/en/v1.5.2/library_reference.html#cocotb.result.TestError)

* [TestFactory (class in cocotb.regression)](https://docs.cocotb.org/en/v1.5.2/library_reference.html#cocotb.regression.TestFactory)

* [TestFailure](https://docs.cocotb.org/en/v1.5.2/library_reference.html#cocotb.result.TestFailure) | * [TestSuccess](https://docs.cocotb.org/en/v1.5.2/library_reference.html#cocotb.result.TestSuccess)

* [Timer (class in cocotb.triggers)](https://docs.cocotb.org/en/v1.5.2/triggers.html#cocotb.triggers.Timer)

* [top (in module cocotb)](https://docs.cocotb.org/en/v1.5.2/library_reference.html#cocotb.top)

* [TOPLEVEL](https://docs.cocotb.org/en/v1.5.2/library_reference.html#index-4)
, [\[1\]](https://docs.cocotb.org/en/v1.5.2/quickstart.html#index-0)
, [\[2\]](https://docs.cocotb.org/en/v1.5.2/release_notes.html#index-0)

* TOPLEVEL\_LANG
* [Make Variable](https://docs.cocotb.org/en/v1.5.2/building.html#var-TOPLEVEL_LANG)

* [trace (class in cocotb.wavedrom)](https://docs.cocotb.org/en/v1.5.2/library_reference.html#cocotb.wavedrom.trace)

* [Trigger (class in cocotb.triggers)](https://docs.cocotb.org/en/v1.5.2/library_reference.html#cocotb.triggers.Trigger)

* [TWOS\_COMPLEMENT (cocotb.binary.BinaryRepresentation attribute)](https://docs.cocotb.org/en/v1.5.2/library_reference.html#cocotb.binary.BinaryRepresentation.TWOS_COMPLEMENT) | U - | | | | --- | --- | | * [unpack() (in module cocotb.utils)](https://docs.cocotb.org/en/v1.5.2/library_reference.html#cocotb.utils.unpack)

* [unprime() (cocotb.triggers.GPITrigger method)](https://docs.cocotb.org/en/v1.5.2/library_reference.html#cocotb.triggers.GPITrigger.unprime)
* [(cocotb.triggers.Trigger method)](https://docs.cocotb.org/en/v1.5.2/library_reference.html#cocotb.triggers.Trigger.unprime) | * [unschedule() (cocotb.scheduler.Scheduler method)](https://docs.cocotb.org/en/v1.5.2/library_reference.html#cocotb.scheduler.Scheduler.unschedule)

* [UNSIGNED (cocotb.binary.BinaryRepresentation attribute)](https://docs.cocotb.org/en/v1.5.2/library_reference.html#cocotb.binary.BinaryRepresentation.UNSIGNED)

* [**UVM**](https://docs.cocotb.org/en/v1.5.2/glossary.html#term-UVM) | V - | | | | --- | --- | | * [ValidatedBusDriver (class in cocotb\_bus.drivers)](https://docs.cocotb.org/en/v1.5.2/library_reference.html#cocotb_bus.drivers.ValidatedBusDriver)

* [value() (cocotb.binary.BinaryValue property)](https://docs.cocotb.org/en/v1.5.2/library_reference.html#cocotb.binary.BinaryValue.value)
* [(cocotb.handle.ConstantObject property)](https://docs.cocotb.org/en/v1.5.2/library_reference.html#cocotb.handle.ConstantObject.value)

* [(cocotb.handle.EnumObject property)](https://docs.cocotb.org/en/v1.5.2/library_reference.html#cocotb.handle.EnumObject.value)

* [(cocotb.handle.IntegerObject property)](https://docs.cocotb.org/en/v1.5.2/library_reference.html#cocotb.handle.IntegerObject.value)

* [(cocotb.handle.ModifiableObject property)](https://docs.cocotb.org/en/v1.5.2/library_reference.html#cocotb.handle.ModifiableObject.value)

* [(cocotb.handle.NonHierarchyIndexableObject property)](https://docs.cocotb.org/en/v1.5.2/library_reference.html#cocotb.handle.NonHierarchyIndexableObject.value)

* [(cocotb.handle.NonHierarchyObject property)](https://docs.cocotb.org/en/v1.5.2/library_reference.html#cocotb.handle.NonHierarchyObject.value)

* [(cocotb.handle.RealObject property)](https://docs.cocotb.org/en/v1.5.2/library_reference.html#cocotb.handle.RealObject.value)

* [(cocotb.handle.StringObject property)](https://docs.cocotb.org/en/v1.5.2/library_reference.html#cocotb.handle.StringObject.value) | * VERILOG\_SOURCES
* [Make Variable](https://docs.cocotb.org/en/v1.5.2/building.html#var-VERILOG_SOURCES)

* VHDL\_GPI\_INTERFACE
* [Make Variable](https://docs.cocotb.org/en/v1.5.2/building.html#var-VHDL_GPI_INTERFACE)

* VHDL\_SOURCES
* [Make Variable](https://docs.cocotb.org/en/v1.5.2/building.html#var-VHDL_SOURCES)

* VHDL\_SOURCES\_
* [Make Variable](https://docs.cocotb.org/en/v1.5.2/building.html#var-VHDL_SOURCES_%3Clib%3E)

* [**VHPI**](https://docs.cocotb.org/en/v1.5.2/glossary.html#term-VHPI)

* [**VIP**](https://docs.cocotb.org/en/v1.5.2/glossary.html#term-VIP)

* [**VPI**](https://docs.cocotb.org/en/v1.5.2/glossary.html#term-VPI) | W - | | | | --- | --- | | * [wait() (cocotb.triggers.Event method)](https://docs.cocotb.org/en/v1.5.2/triggers.html#cocotb.triggers.Event.wait)

* [wait\_for\_recv() (cocotb\_bus.monitors.Monitor method)](https://docs.cocotb.org/en/v1.5.2/library_reference.html#cocotb_bus.monitors.Monitor.wait_for_recv)

* [Waitable (class in cocotb.triggers)](https://docs.cocotb.org/en/v1.5.2/library_reference.html#cocotb.triggers.Waitable)

* [walk\_coro\_stack() (in module cocotb.utils)](https://docs.cocotb.org/en/v1.5.2/library_reference.html#cocotb.utils.walk_coro_stack)

* [want\_color\_output() (in module cocotb.utils)](https://docs.cocotb.org/en/v1.5.2/library_reference.html#cocotb.utils.want_color_output)

* [wave() (in module cocotb.generators.bit)](https://docs.cocotb.org/en/v1.5.2/library_reference.html#cocotb.generators.bit.wave)

* [Wavedrom (class in cocotb.wavedrom)](https://docs.cocotb.org/en/v1.5.2/library_reference.html#cocotb.wavedrom.Wavedrom) | * WAVES
* [Make Variable](https://docs.cocotb.org/en/v1.5.2/building.html#var-WAVES)

* [with\_timeout() (in module cocotb.triggers)](https://docs.cocotb.org/en/v1.5.2/triggers.html#cocotb.triggers.with_timeout)

* [write() (cocotb\_bus.drivers.amba.AXI4LiteMaster method)](https://docs.cocotb.org/en/v1.5.2/library_reference.html#cocotb_bus.drivers.amba.AXI4LiteMaster.write)
* [(cocotb\_bus.drivers.amba.AXI4Master method)](https://docs.cocotb.org/en/v1.5.2/library_reference.html#cocotb_bus.drivers.amba.AXI4Master.write)

* [(cocotb\_bus.drivers.avalon.AvalonMaster method)](https://docs.cocotb.org/en/v1.5.2/library_reference.html#cocotb_bus.drivers.avalon.AvalonMaster.write)

* [(cocotb\_bus.drivers.opb.OPBMaster method)](https://docs.cocotb.org/en/v1.5.2/library_reference.html#cocotb_bus.drivers.opb.OPBMaster.write) | X - * [XGMII (class in cocotb\_bus.drivers.xgmii)](https://docs.cocotb.org/en/v1.5.2/library_reference.html#cocotb_bus.drivers.xgmii.XGMII) * [(class in cocotb\_bus.monitors.xgmii)](https://docs.cocotb.org/en/v1.5.2/library_reference.html#cocotb_bus.monitors.xgmii.XGMII) ---