Questions tagged [cocotb]

Cocotb is a COroutine based COsimulation TestBench environment for verifying VHDL/Verilog RTL hardware designs using Python.

Cocotb is a COroutine based COsimulation TestBench environment for verifying / RTL using .

Documentation is at https://cocotb.readthedocs.io

Support via the Gitter channel https://gitter.im/cocotb or the mailing list at https://lists.librecores.org/listinfo/cocotb

44 questions
2
votes
2 answers

How do I specify the time resolution in Cocotb?

I am getting a different clock period, when I am simulating the Endian Swapper example of Cocotb in VHDL and Verilog mode using QuestaSim. The clock is generated in the same way for both modes in the provided example code: @cocotb.coroutine def…
Martin Zabel
  • 3,589
  • 3
  • 19
  • 34
1
vote
1 answer

How to use multi-processing in a Python cocotb test?

I have a working cocotb setup as below. I want to use multi-processing in Python to run iterations in the loop to parallelize the execution. Current setup: from cocotb.decorators import coroutine factory = TestFactory(Run) @coroutine def…
1
vote
2 answers

cocotb: access arrays of instances signals

I have modules that initialized like that RTL slave slaves[1:0] (some inputs / outputs) I need to access some internal data from slaves instances which have the following hdl hierarchy top.slaves[0].internal_data top.slaves[1].internal_data when…
1
vote
1 answer

pip install cocotb ask me for visual C++ compiler installation

I followed cocotb officials instructions to install package on windows with miniconda3 and : conda install -c msys2 m2-base m2-make but I'm blocked on this error : (base) PS C:\Users\me> pip install cocotb Collecting cocotb Using cached…
FabienM
  • 3,421
  • 23
  • 45
1
vote
1 answer

Python3.6 cocotb coroutine: calling asynchronous function containing ”yield“ in synchronous function

I encountered some problems while trying to make a synchronous function that calls asynchronous functions.(python 3.6.9, cocotb 1.4.0) As shown in the following example code. The read_cb function will call read function(in FakeDriver class). After…
1
vote
1 answer

installing development version of cocotb

I am trying to get my cocotb work with commercial simulators (either modelsim or activeHDL) and I would appreciate if someone could help me get them up and running. I have a Windows machine where I have installed MSYS2 and anaconda3 from where I can…
M.X
  • 195
  • 3
  • 12
1
vote
1 answer

trying to run a sanity test for SPI master but test did not get picked up

I am new to cocotb and want to run a sanity test for SPI master. I had coded a simple test without importing driver and monitor but calling all signals from DUT. I tried running a simple test , report showed no syntax or indentation error but test…
kmen595
  • 11
  • 2
1
vote
1 answer

Riviera PRO and cocotb possible bug (libcocotbvhpi.dll' cannot be found)

I am working with pyhton 3.7, Aldec Riviera Pro 2017, cocotb 1.3 and MSYS2. When I run this test on jenkins and on remote PC I'm getting getting this issue. My log file looks like this: VHPI: Loading library…
1
vote
2 answers

RisingEdge example doesn't work for module input signal in Chisel3

In Chisel documentation we have an example of rising edge detection method defined as following : def risingedge(x: Bool) = x && !RegNext(x) All example code is available on my github project blp. If I use it on an Input signal declared as…
FabienM
  • 3,421
  • 23
  • 45
1
vote
1 answer

How to use Xilinx's IP solutions based RTL design for simulation using Cocotb? Can Xilinx IP be verified using Icarus?

I have a design that has Xilinx FIFO IP. I am trying to verify the design using COCOTB based testbench. How can I include a Xilinx based IP for simulation using COCOTB? The simulation tool that I am using is Icarus. Any help is much appreciated.
warsal
  • 11
  • 3
1
vote
2 answers

Search for all the if conditions in a python file and adding a print statement in the next line

I have to edit a python file such that after every if condition, i need to add a line which says if condition_check: if self.debug == 1: print "COVERAGE CONDITION #8.3 True (condition_check)" #some other code else: if self.debug == 1:…
0
votes
0 answers

I have got cocotb,but i can not find the path of libpython?

[root@TTOOMM /home/root/ic_prjs/cocotb_test/cocotb/examples/simple_dff]$cocotb-config usage: cocotb-config [-h] [--prefix] [--share] [--makefiles] [--python-bin] [--help-vars] [--libpython] [--lib-dir] [--lib-name INTERFACE SIMULATOR]…
0
votes
0 answers

Driving DUT using PyUVM

I am trying to drive the DUT signals using PyUVM + COCOTB. But DUT signals are not getting driven from pyuvm. I am trying to drive DUT signals from PyUVM test . Test is passing but signals are not being driven with the expected values…
0
votes
3 answers

Function or script on LHS of the equation in python

I have a requirement on cocotb similar to below : x = "a" x = 2 => This should become a = 2 Can someone please help whether would it be possible to achieve this in python ? I need to assign values to DUT (like below) based on the above…
Somesh
  • 82
  • 8
0
votes
1 answer

Failed to call a function in Python, using Cocotb library

I am using Cocotb to verify an RTL design. I have problem calling the multi() function in Python, see the code and the error I get below..... Code: @cocotb.test() async def test(dut) for i in range(10): #something for j i in…
Neom5
  • 11
  • 2