cocotb 2.0.0.dev0+96035d9 (2024-04-21)

Features

Bugfixes

  • Xcelium 23.09.004 and newer can now be used to test designs with a VHDL toplevel. (#1076)

  • Fix 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)

  • Fix incorrect cleanup of pending Tasks (queued by cocotb.start_soon() but not started yet) when a test ends. (#3354)

  • Support waves argument to cocotb_tools.runner.Simulator.build() for Verilator. (#3681)

  • The test_args argument to cocotb_tools.runner.Simulator.test() is now passed to the Verilator simulation binary when running the simulation, which was previously missing. (#3682)

Deprecations and Removals

Changes

  • cocotb.handle.ConstantObject was removed. Constant value objects are now returned as their corresponding simulator value object subtype (e.g. integers in VHDL and Verilog are now IntegerObjects). You can check if the value object is constant using the is_const() method. (#2720)

  • All casts on simulator value objects have been deprecated. If you want to get the value from a simulator value object, use the value() property; then cast the value. (#2720)

  • All simulator objects when cast to a str now return the repr of the object and not the path. (#2720)

  • Testing equality of simulator value object subtypes no longer does a value equality, but an identity equality. All simulator objects can now be used in hashable collections like dict and set. (#2720)

  • std_(u)logic_vector and std_(u)logic signals and constants in VHDL, and logic and packed arrays of logic signals and parameters in Verilog are now LogicObjects. (#2720)

  • cocotb-bus can no longer be installed at the same time as cocotb using pip install cocotb[bus]. Use pip install cocotb-bus instead. (#3436)

  • cocotb.function() and cocotb.external() are now implemented as decorator functions and not types. All attributes, e.g. log, are no longer available. (#3461)

  • 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)

  • Use of the TESTCASE variable has been changed so that each element of TESTCASE will now select all tests with a matching name across all MODULEs instead of just the first one found. (#3578)

  • The cocotb.test() decorator now returns the decorated object instead of a Test object. (#3578)

  • The RegressionManager uses a new mechanism to discover tests. Typical uses of the cocotb.test() decorator and TestFactory should be unaffected, but atypical uses may not. (#3578)

  • Getting a value with LogicObject.value now returns a LogicArray with the appropriate Range set. (#3634)

  • cocotb.handle.RegionObject was renamed to HierarchyObjectBase. (#3655)

  • The module cocotb.xunit_reporter was made private. (#3672)

  • The module cocotb.outcomes was made private. (#3672)

  • The module cocotb.log was renamed to cocotb.logging to prevent clashing with cocotb.log. (#3673)

  • Moved cocotb.config to cocotb_tools.config and cocotb.runner to cocotb_tools.runner to improve startup speed. (#3731)

  • Renamed cocotb.handle.NonHierarchyIndexableObject to ArrayObject. (#3733)

  • Renamed cocotb.handle.NonHierarchyIndexableObjectBase to IndexableValueObjectBase. (#3733)

  • Renamed cocotb.handle.NonHierarchyObject to ValueObjectBase. (#3733)

  • Improved VHPI implementation of cocotb.simulator.get_root_handle(). The name parameter is now used for handle lookup only as the last fallback, after checking it against the name of the vhpiRootInst object and its associated entity object. Handle lookup by name now always includes the : prefix so that it matches the FullName of the instantiated object, and will not match objects in the library information model. (#3774)

  • When constructing a LogicArray, if the given value cannot fit in the given range, an OverflowError is now thrown, instead of a ValueError. (#3792)

  • The cocotb.scheduler module and cocotb.scheduler object have been made private. (#3806)