Release Notes
All releases are available from the GitHub Releases Page.
cocotb 1.9.1 (2024-08-29)
Bugfixes
Improve the Verilator Makefile to pass on
--traceat runtime as well. (#4088)Pass
EXTRA_ARGSin the Verilator Makefile to both the compilation and the simulation step.
Changes
Support setuptools 72.2.0
cocotb 1.9.0 (2024-07-14)
Features
Not using parentheses on
@cocotb.testdecorator is now supported. (#2731)The
cocotb.runner.Simulator.build()method now accepts acleanargument to removebuild_dircompletely during build stage. (#3351)Added
SIM_CMD_SUFFIXto allow users to redirect simulator output or otherwise suffix the simulation command invocation. (#3561)Added
--tracecommand line argument to Verilator simulation binaries for run-time trace generation. This new argument is passed to the binary when thewavesargument tococotb.runner.Simulator.test()isTrue. (#3667)The
cocotb.runner.Simulator.build()andcocotb.runner.Simulator.test()methods now accept alog_fileargument to redirect stdout and stderr to the specified file. (#3668)The
results_xmlargument tococotb.runner.Simulator.test()can now be an absolute path. (#3669)Added
--trace-filecommand line argument to Verilator simulation binaries which specifies the trace file name. This can be passed to the binary by using thetest_argsargument tococotb.runner.Simulator.test(). (#3683)The
cocotb.runner.Simulator.test()method now accepts apre_cmdargument 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)The
sourcesoption was added tococotb.runner.Simulator.build()to better support building mixed-language designs. (#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)Added support for comparing
BinaryValuewithLogic,LogicArray, andstr. (#3845)Riviera-PRO now supports compilation into (multiple) VHDL libraries using
VHDL_SOURCES_. (#3922)
Bugfixes
Xcelium 23.09.004 and newer can now be used to test designs with a VHDL toplevel. (#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)
Support
wavesargument tococotb.runner.Simulator.build()for Verilator. (#3681)The
test_argsargument tococotb.runner.Simulator.test()is now passed to the Verilator simulation binary when running the simulation, which was previously missing. (#3682)
Deprecations and Removals
Join.retvalis deprecated. UseTask.result()to get the result of a joined Task. (#3871)Passing the outcome argument to
NullTrigger- which allowed the user to inject arbitrary outcomes when the trigger wasawaited - is deprecated. There is no alternative. (#3871)
Changes
For Aldec simulators, the -dbg and -O2 options are no longer passed by default, as they reduce simulation speed. Pass these options in
COMPILE_ARGSandSIM_ARGSif you need them for increased observability. (#3490)awaiting aJointrigger will yield the Join trigger and not the result of the task in the 2.0 release. (#3871)Lock.lockedis now a method rather than an attribute to mirrorasyncio.Lock.locked(). (#3871)
cocotb 1.8.1 (2023-10-06)
Features
Python 3.12 is now supported.
Bugfixes
Fix incorrect cleanup of pending Tasks (queued by
cocotb.start_soon()but not started yet) when a test ends. (#3354)
cocotb 1.8.0 (2023-06-15)
Features
cocotb.types.LogicArraynow supports a default value construction if arangeis given. (#3031)Add support for
fraction.Fractionanddecimal.Decimalto theperiodargument ofcocotb.clock.Clock. (#3045)This release adds the Python Test Runner, an experimental replacement for the traditional Makefile-based build and run flow. (#3103)
Incisive now supports compilation into a named VHDL library
libusingVHDL_SOURCES_<lib>. (#3261)Cocotb can now correctly drive Verilator when its new
--timingflag is used. (#3316)Creating an FST waveform dump in Icarus Verilog can now be done by setting the
WAVESenvironment variable. Icarus-specific Verilog code is no longer required. (#3324)
Bugfixes
Fixed Verilator not writing coverage files in some cases. (#1478)
The
Regression Managernow correctly handles exceptions raised in tests when the exceptions inherit from BaseException. (#3196)Fix a performance regression when using Questa with FLI introduced in cocotb 1.7.0. (#3229)
Adds support for packed union in SystemVerilog when using Cadence Xcelium. (#3239)
Fixed
RecursionErrorcaused by certain corner cases in the scheduler. (#3267)Fixed cleanup in scheduler which caused sporadic warning messages and bugs in some corner cases. (#3270)
Fix “use after free” bug in VHPI implementation causing Riviera to fail to discover some simulation objects. (#3307)
Changes
Removed
levelarg from_sim_eventfunction in thePYGPI_ENTRY_POINTinterface. This function can only indicate a request to shutdown from the simulator or GPI. (#3066)Moved
cocotb.task.Taskand friends tococotb.taskmodule to alleviate internal cylic import dependency. Users should update imports of theTaskto import from the top-levelcocotbnamespace. (#3067)Added support for
VERILOG_INCLUDE_DIRSin the Makefiles. (#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)
Changes
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)
Bugfixes
Fixed a segmentation fault in Aldec Riviera-PRO that prevented mixed-language simulation from running. (#3078)
cocotb 1.7.1 (2022-09-17)
Bugfixes
cocotb 1.7.0 (2022-09-06)
Features
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)
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_INTERFACEenvironment variable tovhpibefore running cocotb. (#2803)cocotb tests are now more reproducible. (#2721)
Force,Freeze, andReleaseare now supported when using the FLI, Questa’s traditional method to access VHDL. (#2775)cocotb binaries now statically link libstdc++ on Linux, which prevents library load errors even if the simulator ships its own libstdc++. (#3002)
Bugfixes
Fixed write scheduling to apply writes oldest to newest. (#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)
Fixed FLI issue where unprimed triggers were still firing. (#3010)
Deprecations and Removals
cocotb.fork()has been deprecated in favor ofcocotb.start_soon()orcocotb.start(). (#2663)
Changes
Passing coroutines to
with_timeout()is now supported. (#2494)Renamed
RunningTasktoTask. (#2876)Made
Taskinterface more likeasyncio.Task’s. (#2876)When code coverage is enabled with
COVERAGEand a configuration file is specified withCOVERAGE_RCFILE, default coverage configuration is not applied to avoid overriding the user-defined configuration. (#3014)
cocotb 1.6.2 (2022-02-07)
Bugfixes
Fix regression in
TestFactorywhen using generator-based test coroutines. (#2839)
Changes
Change how
PYTHONHOMEis populated to work with broken mingw environments. (#2739)
cocotb 1.6.1 (2021-12-07)
Bugfixes
Fix regression in
TestFactorywrt unique test names. (#2781)
cocotb 1.6.0 (2021-10-20)
Features
Support a custom entry point from C to Python with
PYGPI_ENTRY_POINT. (#1225)ModelSim and Questa now support compilation into a named VHDL library
libusingVHDL_SOURCES_<lib>. (#2465)Added the
LogicArraymodeling datatype. (#2514)Xcelium now supports compilation into a named VHDL library
libusingVHDL_SOURCES_<lib>. (#2614)Add the
SIM_CMD_PREFIXto supported Makefile variables, allowing users to pass environment variables and other command prefixes to simulators. (#2615)To support VHDL libraries in ModelSim/Questa/Xcelium,
VHDL_LIB_ORDERhas been added to specify a library compilation order. (#2635)cocotb.fork(),cocotb.start(),cocotb.start_soon(), andcocotb.create_task()now accept any object that implements thecollections.abc.Coroutineprotocol. (#2647)TestFactoryandcocotb.testnow accept anycollections.abc.Callableobject which returns acollections.abc.Coroutineas a test function. (#2647)Added
cocotb.start()andcocotb.start_soon()scheduling functions. (#2660)Add
cocotb.create_task()API for creating a Task from a Coroutine without scheduling. (#2665)Support rounding modes in
cocotb.utils.get_sim_steps(). (#2684)Support passing
'step'as a time unit incocotb.utils.get_sim_time(). (#2691)
Bugfixes
VHDL signals that are zero bits in width now read as the integer
0, instead of raising an exception. (#2294)Correctly parse plusargs with
=s in the value. (#2483)COCOTB_RESULTS_FILEnow properly communicates with theRegression Managerto allow overloading the result filename. (#2487)Fixed several scheduling issues related to the use of
cocotb.scheduler.start_soon. (#2504)Verilator and Icarus now support running without specifying a
TOPLEVEL. (#2547)Fixed discovery of signals inside SystemVerilog interfaces. (#2683)
Improved Documentation
The Models of Analog Circuits example has been added, showing how to use Python models for analog circuits together with a digital part. (#2438)
Deprecations and Removals
Setting values on indexed handles using the
handle[i] = valuesyntax is deprecated. Instead use thehandle[i].value = valuesyntax. (#2490)Setting values on handles using the
dut.handle = valuesyntax is deprecated. Instead use thehandle.value = valuesyntax. (#2490)Setting values on handles using the
signal <= newvalsyntax is deprecated. Instead, use thesignal.value = newvalsyntax. (#2681)cocotb.utils.hexdump()is deprecated; usescapy.utils.hexdump()instead. (#2691)cocotb.utils.hexdiffs()is deprecated; usescapy.utils.hexdiff()instead. (#2691)Passing
Nonetococotb.utils.get_sim_time()is deprecated; use'step'as the time unit instead. (#2691)The
stdoutandstderrattributes oncocotb.result.TestCompleteand subclasses are deprecated. (#2692)cocotb.result.TestFailureis deprecated, use anassertstatement instead. (#2692)
Changes
Assigning out-of-range Python integers to signals will now raise an
OverflowError. (#2316)cocotb now requires Python 3.6+. (#2422)
Selecting tests using
TESTCASEwill now search for the first occurrence of a test of that name in order of modules listed inMODULEs, and not just the first module in that list. (#2434)The environment variable
COCOTB_LOG_LEVELnow supportsTRACEvalue, which is used for verbose low-level logging that was previously inDEBUGlogs. (#2502)Improves formatting on test-related logging outputs. (#2564)
Shorter log lines (configurable with
COCOTB_REDUCED_LOG_FMT) are now the default. For wider log output, similar to previous cocotb releases, set theCOCOTB_REDUCED_LOG_FMTenvironment variable to0. (#2564)
cocotb 1.5.2 (2021-05-03)
Bugfixes
cocotb 1.5.1 (2021-03-20)
Bugfixes
Prevent pytest assertion rewriting (#2028) from capturing stdin, which causes problems with IPython support. (#1649) (#2462)
Add dependency on cocotb_bus to prevent breaking users that were previously using the bus and testbenching objects. (#2477)
Add back functionality to
cocotb.binary.BinaryValuethat allows the user to changebinaryRepresentationafter object creation. (#2480)
cocotb 1.5.0 (2021-03-11)
Features
Support for building with Microsoft Visual C++ has been added. See Installation for more details. (#1798)
Makefiles now automatically deduce
TOPLEVEL_LANGbased on the value ofVERILOG_SOURCESandVHDL_SOURCES. Makefiles also detect incorrect usage ofTOPLEVEL_LANGfor simulators that only support one language. (#1982)cocotb.fork()will now raise a descriptiveTypeErrorif a coroutine function is passed into them. (#2006)Added
cocotb.scheduler.start_soonwhich schedules a coroutine to start after the current coroutine yields control. This behavior is distinct fromcocotb.fork()which schedules the given coroutine immediately. (#2023)If
pytestis installed, its assertion-rewriting framework will be used to produce more informative tracebacks from theassertstatement. (#2028)The handle to
TOPLEVEL, typically seen as the first argument to a cocotb test function, is now available globally ascocotb.top. (#2134)The
unitsargument toTimer,Clockandget_sim_steps(), and thetimeout_unitargument towith_timeout()andcocotb.testnow accepts'step'to mean the simulator time step. This used to be expressed usingNone, which is now deprecated. (#2171)TestFactory.add_option()now supports groups of options when a full Cartesian product is not desired. (#2175)Added asyncio-style queues,
Queue,PriorityQueue, andLifoQueue. (#2297)Support for the SystemVerilog type
bithas been added. (#2322)Added the
--lib-dir,--lib-nameand--lib-name-pathoptions to thecocotb-configcommand to make cocotb integration into existing flows easier. (#2387)Support for using Questa’s VHPI has been added. Use
VHDL_GPI_INTERFACEto 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)
Bugfixes
Assigning Python integers to signals greater than 32 bits wide will now work correctly for negative values. (#913)
Fix GHDL’s library search path, allowing libraries other than work to be used in simulation. (#2038)
Tests skipped by default (created with skip=True) can again be run manually by setting the
TESTCASEvariable. (#2045)In Icarus Verilog, generate blocks are now accessible directly via lookup without having to iterate over parent handle. (#2079, #2143)
# Example pseudo-region dut.genblk1 #<class 'cocotb.handle.HierarchyArrayObject'>
Fixed an issue with VHPI on Mac OS and Linux where negative integers were returned as large positive values. (#2129)
Improved Documentation
The Mixed-signal (analog/digital) 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)
New example Matrix Multiplier. (#1502)
A Reference Card showing the most used features of cocotb has been added. (#2321)
A chapter Extending existing build flows has been added. (#2340)
Deprecations and Removals
The contents of
cocotb.generatorshave been deprecated. (#2047)The outdated “Sorter” example has been removed from the documentation. (#2049)
Passing
boolvalues toexpect_erroroption ofcocotb.testis deprecated. Pass a specificExceptionor a tuple of Exceptions instead. (#2117)The system task overloads for
$info,$warn,$errorand$fatalin Verilog and mixed language testbenches have been removed. (#2133)TestErrorhas been deprecated, use Built-in Exceptions. (#2177)The undocumented class
cocotb.xunit_reporter.Filehas been removed. (#2200)Deprecated
cocotb.hookandCOCOTB_HOOKS. See the documentation forcocotb.hookfor suggestions on alternatives. (#2201)Deprecate
pack()andunpack()and the use ofctypes.Structurein signal assignments. (#2203)The outdated “ping” example has been removed from the documentation and repository. (#2232)
Using the undocumented custom format
dictobject in signal assignments has been deprecated. (#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. In the future, the deprecated names will be removed. (#2278)The bus and testbenching components in cocotb have been officially moved to the cocotb-bus package. This includes
Bus,Scoreboard, everything incocotb_bus.drivers, and everything incocotb_bus.monitors. Documentation will remain in the main cocotb repository for now. Old names will continue to exist, but their use will cause aDeprecationWarning, and will be removed in the future. (#2289)
Changes
Assigning negative Python integers to handles does an implicit two’s compliment conversion. (#913)
Updated
Driver,Monitor, and all their subclasses to use theasync/awaitsyntax instead of theyieldsyntax. (#2022)The package build process is now fully PEP 517 compliant. (#2091)
Improved support and performance for Verilator (version 4.106 or later now required). (#2105)
Changed how libraries are specified in
GPI_EXTRAto allow specifying libraries with paths, and names that don’t start with “lib”. (#2341)
Cocotb 1.4.0 (2020-07-08)
Features
Lockcan now be used inasync withstatements. (#1031)Add support for distinguishing between
net(vpiNet) andreg(vpiReg) type when using the VPI interface. (#1107)Support for dropping into
pdbupon failure, via the newCOCOTB_PDB_ON_EXCEPTIONenvironment variable. (#1180)Simulators run through a Tcl script (Aldec Riviera Pro and Mentor simulators) now support a new
RUN_ARGSMakefile variable, which is passed to the first invocation of the tool during runtime. (#1244)Cocotb now supports the following example of forking a non-decorated async coroutine.
async def example(): for i in range(10): await cocotb.triggers.Timer(10, "ns") cocotb.fork(example())
Issue (#1255)
The cocotb log configuration is now less intrusive, and only configures the root logger instance,
logging.getLogger(), as part ofcocotb.log.default_config()(#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)The colored output can now be disabled by the
NO_COLORenvironment variable. (#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)
Custom logging handlers can now access the simulator time using
logging.LogRecord.created_sim_time, provided theSimTimeContextFilterfilter added bydefault_config()is not removed from the logger instance. (#1411)Questa now supports
PLUSARGS. This requires thattcl.hbe present on the system. This is likely included in your installation of Questa, otherwise, specifyCFLAGS=-I/path/to/tcl/includedir. (#1424)The name of the entry point symbol for libraries in
GPI_EXTRAcan now be customized. The delimiter between each library in the list has changed from:to,. (#1457)New methods for setting the value of a
NonHierarchyIndexableObject(HDL arrays). (#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)
Including
Makefile.incfrom user makefiles is now a no-op and deprecated. Lines likeinclude $(shell cocotb-config --makefiles)/Makefile.inccan be removed from user makefiles without loss in functionality. (#1629)Support for using
awaitinside an embedded IPython terminal, usingcocotb.ipython_support. (#1649)Added
is_set(), so users may check if anEventhas fired. (#1723)The
cocotb.simulator.is_running()function was added so a user of cocotb could determine if they are running within a simulator. (#1843)
Bugfixes
Tests which fail at initialization, for instance due to no
yieldbeing present, are no longer silently ignored. (#1253)Tests that were not run because predecessors threw
cocotb.result.SimFailure, and caused the simulator to exit, are now recorded with an outcome ofcocotb.result.SimFailure. Previously, these tests were ignored. (#1279)Makefiles now correctly fail if the simulation crashes before a
results.xmlfile can be written. (#1314)Logging of non-string messages with colored log output is now working. (#1410)
Getting and setting the value of a
NonHierarchyIndexableObjectnow iterates through the correct range of the simulation object, so arrays that do not start/end at index 0 are supported. (#1507)The
XGMIImonitor no longer crashes on Python 3, and now assembles packets asbytesinstead ofstr. TheXGMIIdriver has expectedbytessince cocotb 1.2.0. (#1545)signal <= value_of_wrong_typeno longer breaks the scheduler, and throws an error immediately. (#1661)Scheduling behavior is now consistent before and after the first
awaitof aGPITrigger. (#1705)Iterating over
for generatestatements using VHPI has been fixed. This bug caused some simulators to crash, and was a regression in version 1.3. (#1882)The
XGMIIdriver no longer emits a corrupted word on the first transfer. (#1905)
Improved Documentation
If a makefile uses cocotb’s
Makefile.sim,make helpnow lists the supported targets and variables. (#1318)A new section Rotating Log Files has been added. (#1400)
The documentation at http://docs.cocotb.org/ has been restructured, making it easier to find relevant information. (#1482)
Deprecations and Removals
cocotb.utils.reject_remaining_kwargs()is deprecated, as it is no longer needed now that we only support Python 3.5 and newer. (#1339)The value of
cocotb.handle.StringObjects is now of typebytes, instead ofstrwith an implied ASCII encoding scheme. (#1381)ReturnValueis now deprecated. Use areturnstatement instead; this works in all supported versions of Python. (#1489)The makefile variable
VERILATOR_TRACEthat was not supported for all simulators has been deprecated. Using it prints a deprecation warning and points to the documentation section Simulator Support explaining how to get the same effect by other means. (#1495)BinaryValue.get_hex_buffproduced nonsense and has been removed. (#1511)Passing
strinstances tococotb.utils.hexdump()andcocotb.utils.hexdiffs()is deprecated.bytesobjects should be passed instead. (#1519)Makefile.pylib, which provided helpers for building C extension modules for Python, has been removed. Users of thePYTHON_LIBDIRandPYTHON_INCLUDEDIRvariables will now have to compute these values themselves. See theendian_swapperexample for how to do this. (#1632)Makefile and documentation for the NVC simulator which has never worked have been removed. (#1693)
Changes
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)
Mentor Questa, Aldec Riviera-PRO and GHDL are now started in the directory containing the Makefile and also save
results.xmlthere, bringing them in line with the behavior used by other simulators. (#1598) (#1599) (#1063)Tests are now evaluated in order of their appearance in the
MODULEenvironment variable, their stage, and the order of invocation of thecocotb.testdecorator within a module. (#1380)All libraries are compiled during installation to the
cocotb/libsdirectory. The interface librarieslibcocotbvpiandlibcocotbvhpihave been renamed to have a_simulator_namepostfix. Thesimulatormodule has moved tococotb.simulator. TheLD_LIBRARY_PATHenvironment variable no longer needs to be set by the makefiles, as the libraries now discover each other viaRPATHsettings. (#1425)cocotb.handle.NonHierarchyIndexableObject.valueis now a list in left-to-right range order of the underlying simulation object. Previously the list was always ordered low-to-high. (#1507)Various binary representations have changed type from
strtobytes. These include:cocotb.binary.BinaryValue.buff, which as a consequence meanscocotb.binary.BinaryValue.assign()no longer accepts malformed10xz-stylestrs (which were treated as binary).The objects produced by
cocotb.generators.byte, which means that single bytes are represented byintinstead of 1-characterstrs.The packets produced by the
AvalonSTPkts.
Code working with these objects may find it needs to switch from creating
strobjects like"this"tobytesobjects likeb"this". This change is a consequence of the move to Python 3. (#1514)There’s no longer any need to set the
PYTHON_BINmakefile variable, the Python executable automatically matches the one cocotb was installed into. (#1574)The
SIMsetting for Aldec Riviera-PRO has changed fromaldectoriviera. (#1691)Certain methods on the
cocotb.simulatorPython module now throw aRuntimeErrorwhen no simulator is present, making it safe to usecocotbwithout a simulator present. (#1843)Invalid values of the environment variable
COCOTB_LOG_LEVELare no longer ignored. They now raise an exception with instructions how to fix the problem. (#1898)
cocotb 1.3.2
Released on 08 July 2020
Notable changes and bug fixes
Iterating over
for generatestatements using VHPI has been fixed. This bug caused some simulators to crash, and was a regression in version 1.3.1. (#1882)
cocotb 1.3.1
Released on 15 March 2020
Notable changes and bug fixes
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)
cocotb 1.3.0
Released on 08 January 2020
This will likely be the last release to support Python 2.7.
New features
Initial support for the 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 if you experience problems.
New makefile variables
COCOTB_HDL_TIMEUNITandCOCOTB_HDL_TIMEPRECISIONfor setting the default time unit and precision that should be assumed for simulation when not specified by modules in the design. (#1113)New
timeout_timeandtimeout_unitarguments tococotb.test(), for adding test timeouts. (#1119)with_timeout(), for a shorthand for waiting for a trigger with a timeout. (#1119)The
expect_errorargument tococotb.test()now accepts a specific exception type. (#1116)New environment variable
COCOTB_RESULTS_FILE, to allow configuration of the xUnit XML output filename. (#1053)A new
bus_separatorargument tococotb.drivers.BusDriver. (#1160)A new
start_highargument tococotb.clock.Clock.start(). (#1036)A new
cocotb.__version__constant, which contains the version number of the running cocotb. (#1196)
Notable changes and bug fixes
DeprecationWarnings 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()andcocotb.function()now work more reliably and with fewer race conditions.A failing
assertwill be considered a test failure. Previously, it was considered a test error.drivers()andloads()now also work correctly in Python 3.7 onwards.Timercan now be used withdecimal.Decimalinstances, allowing constructs likeTimer(Decimal("1e-9"), units="sec")as an alternate spelling forTimer(100, units="us"). (#1114)Many (editorial) documentation improvements.
Deprecations
cocotb.result.raise_errorandcocotb.result.create_errorare deprecated in favor of using Python exceptions directly.TestErrorcan still be used if the same exception type is desired. (#1109)The
AvalonSTPktsWithChanneltype is deprecated. Use thereport_channelargument toAvalonSTPktsinstead.The
colourattribute of log objects likecocotb.logorsome_coro.logis deprecated. Usecocotb.utils.want_color_output()instead. (#1231)
Other news
cocotb is now packaged for Fedora Linux and available as python-cocotb. (Fedora bug #1747574) (thanks Ben Rosser)
cocotb 1.2.0
Released on 24 July 2019
New features
cocotb is now built as Python package and installable through pip. (#517, #799, #800, #803, #805)
Support for
asyncfunctions and generators was added (Python 3 only). Please have a look at Coroutines and Tasks for an example how to use this new feature.VHDL block statements can be traversed. (#850)
Support for Python 3.7 was added.
Notable changes and bug fixes
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)
The
setimmediatevalue()function now works for values larger than 32 bit. (#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)
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/cocotbtococotb/cocotb. Redirects for old URLs are in place.
Deprecations
The bits argument to
BinaryValue, which is now called n_bits.The logger attribute of log objects like
cocotb.logorsome_coro.log, which is now just an alias forself.The
cocotb.utils.get_python_integer_typesfunction, which was intended to be private.
Known issues
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. 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 for more outstanding issues and contribution opportunities.
cocotb 1.1
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 for further information.
cocotb 1.0
Released on 15 February 2015.
New features
FLI support for ModelSim
Mixed Language, Verilog and VHDL
Windows
300% performance improvement with VHPI interface
WaveDrom support for wave diagrams.
cocotb 0.4
Released on 25 February 2014.
New features
Issue #101: Implement Lock primitive to support mutex
Issue #105: Compatibility with Aldec Riviera-Pro
Issue #109: Combine multiple
results.xmlinto a single results fileIssue #111: XGMII drivers and monitors added
Issue #113: Add operators to
BinaryValueclassIssue #116: Native VHDL support by implementing VHPI layer
Issue #117: Added AXI4-Lite Master BFM
Bugs fixed
New examples
Issue #106: TUN/TAP example using ping
cocotb 0.3
Released on 27 September 2013.
This contains a raft of fixes and feature enhancements.
cocotb 0.2
Released on 19 July 2013.
New features
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
Released on 9 July 2013.
The first release of cocotb.
Allows installation and running against Icarus, VCS, Aldec simulators.