Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Activity
  • 01:30
    codecov[bot] commented #3151
  • 01:22
    codecov[bot] commented #3151
  • 01:13
    codecov[bot] commented #3151
  • 01:03
    codecov[bot] commented #3151
  • 00:57
    codecov[bot] commented #3151
  • 00:43
    codecov[bot] commented #3151
  • 00:42
    tianrui-wei synchronize #3151
  • Nov 28 15:45
    themperek review_requested #3150
  • Nov 28 05:29
    tianrui-wei commented #3151
  • Nov 28 05:29
    tianrui-wei converted_to_draft #3151
  • Nov 28 01:49
    codecov[bot] commented #3151
  • Nov 28 01:40
    codecov[bot] commented #3151
  • Nov 28 01:31
    codecov[bot] commented #3151
  • Nov 28 01:21
    codecov[bot] commented #3151
  • Nov 28 01:12
    codecov[bot] commented #3151
  • Nov 28 01:02
    codecov[bot] commented #3151
  • Nov 28 01:02
    codecov[bot] commented #3151
  • Nov 28 01:00
    tianrui-wei synchronize #3151
  • Nov 28 00:51
    codecov[bot] commented #3151
  • Nov 28 00:36
    tianrui-wei synchronize #3151
Leon Woestenberg
@likewise
@sjalloq Interesting, I just revived the TAP (ICMP ping) example which also has to read a socket for incoming Ethernet frames, and to pass them into the simulator, and vice versa. My use of @function and @external did not work for a blocking socket, so I moved towards non-blocking. Your solution looks much cleaner than my hacked up work. (I am new to CocoTB.)
4 replies
jwprice100
@jwprice100
When coctb thinks an input port type is unsigned, what is the recommended way to assign a signed value to it?
Ronan Rice
@ronancode
I just recently upgraded from cocotb 1.4 to 1.7.1, and I'm noticing that the print() statements in my cocotb test don't seem to be printing to the terminal when the event in the code happens anymore. I'm just getting a dump of all the print() statements all at once when the sim finishes. Should I be using a different method to print to the terminal?
1 reply
Kaleb Barrett
@ktbarrett
@ronancode stdout is no longer reopened as line buffered. If you want prints to flush, pass flush=True to your print calls.
Marlon James
@marlonjames
Mul needs to accept dut argument
MikeWylde
@MikeWylde
Hi guys,
Can you please explain how can you assert the ack signal for the wishbone driver?
Anton Babundin
@AntonBabundin
Hi everyone
There is a way to read the queue from the SystemVerilog with help cocotb ?
Nathan S
@slagernate
Is there a way to add a marker in any of the simulators?
Philipp Wagner
@imphil
Announcement: cocotb 1.7.2 has just been released with Python 3.11 support and two fixes (including one crash) that our users reported. Enjoy!
1 reply
Atheer-code
@Atheer-code
I am using numpy library in Cocotb to generate random numbers for A and B inputs which span from -2^32 to 0. The problem is I want python to be able to represent a negative value result within 32 bit register, no more than that, but I get an error that there is an Overflow......
1 reply
Ronan Rice
@ronancode
This is more of an xcelium question, but after scouring the docs I was unable to find an answer and hope maybe some of you can help me out. I used to save sim vars into VCD files using $dumpvars(), but am migrating to the native SHM databases using the $shm_open() command in my top level system verilog file. I notice this doesn't save any variables of type real, only digital signals. Is there a different command other than $shm_open() I have to use to save reals? I see in the documentation that .trn is for digital and .tran is for analog, but I am not seeing any .tran file in the database.
11 replies
Atheer-code
@Atheer-code

I have made a random function using numpy library that generate values in this range (-2^32 -0) to be used in input A and input B, the result is clearly a 64 bit value. Now my DUT accepts only 32 bit inputs and generates only 32 bits outputs, the operation is a multiplication that selects the lower 32 bit value of a 64 bits internal register (output register). for some reason I get an error of "Overflow" for my inputs received by the DUT...

this is the error message :
OverflowError: Int value (-3715553560) out of range for assignment of 32-bit signal ('opcode_ra_operand_i'). Notice "opcode_ra_operand_i" is the DUT input A....

My code is :

def generateRandom():
return np.random.randint(-2^32,0), np.random.randint(-2^32,0)

def NegativeNum(dut= None ,inputA = None, inputB = None):

inputA,inputB= generateRandom()

dut.A.value = inputA
dut.B.value = inputB
yield ClockCycles(dut.clk_i, 3, rising=True)

print("output = ")
print("inputA=",inputA," inputB=",inputB," (inputA*inputB)=",int(dut.result.value))
Neom5
@Neom5
I am starting to learn about coverage concept using Cocotb but I wish there is a simple example that performs simple coverage for say an adder ?
1 reply
Vijayvithal
@jahagirdar

I have opened PR #3137
This is an issue with generating reproducable test seed from RANDOM_SEED and qualname

I believed this issue was fixed in 7.0, has It resurfaced? or was my assumption incorrect.

Neom5
@Neom5
@jahagirdar In case I have 'a' and 'b' as randomly generated values, should it be the same ? what is coverage point in simple words ? Thx these videos are super helpful
5 replies
jwprice100
@jwprice100
Has anyone seen an issue with Riviera Pro and the latest cooctb and python 3.11 where Riviera crashes on a restart when using the GUI?
Well doesn't crash, hangs indefinitely to be more precise
imphil
@imphil:matrix.org
[m]
No I haven't seen that yet. Can you file an issue?
jwprice100
@jwprice100
yes sir
jwprice100
@jwprice100
Ah it's more of a python versin thing
jwprice100
@jwprice100
imphil
@imphil:matrix.org
[m]
Thanks a lot!
Leon Woestenberg
@likewise
Something regressed in my (pip3 user local) CocoTB installation, I'm getting these failures in all my previously working CocoTB tests.
To be sure it's not in my local projects, I cloned cocotbext-uart and ran make in tests/uart/
     0.00ns CRITICAL cocotb.regression                  Failed to import module test_uart: No module named 'cocotb._vendor.find_libpython'
~/cocotbext-uart/tests/uart$ ls -ald `cocotb-config --libpython`
-rw-r--r-- 1 root root 4683728 Jun 29 13:45 /usr/lib/x86_64-linux-gnu/libpython3.6m.so.1.0
Leon Woestenberg
@likewise
Disregard, I think the above comes up with a fix for cocotb-test.
Leon Woestenberg
@likewise

cocotb-test has this fixed in 0.2.3, but that requires Python 3.7+
Manually patching cocotb-test <0.2.3 as follows:

sed -i \
-e 's@import cocotb._vendor.find_libpython as find_libpython@import find_libpython@' \
-e 's@install_requires=["cocotb>=1.5", "pytest"],@install_requires=["cocotb>=1.5", "pytest", "find_libpython"],@' \
`find /usr/local/lib/python*/*-packages/cocotb_test/simulator.py`

or

sed -i \
-e 's@import cocotb._vendor.find_libpython as find_libpython@import find_libpython@' \
-e 's@install_requires=["cocotb>=1.5", "pytest"],@install_requires=["cocotb>=1.5", "pytest", "find_libpython"],@' \
`find ~/.local/lib/python*/*-packages/cocotb_test/simulator.py`

for pip3 user-local installs

Vladislav Borshch
@vborshch_gitlab

Hi there! Is there any chance to create AxiStreamSource/Sink by providing direct references to the signals?

I have something like that:

  input  logic      [W_TDATA-1:0] s_axis_tdata  [N_GRANTS] ,
  input  logic      [W_TDEST-1:0] s_axis_tdest  [N_GRANTS] ,
  input  logic                    s_axis_tvalid [N_GRANTS] ,
  output logic                    s_axis_tready [N_GRANTS] ,
  output logic                    s_axis_tlast  [N_GRANTS] ,

And I wanna go through the loop over N_GRANTS and get array of AxiStream objects like that:

for i in range(dut.N_GRANTS):
            self.axi_source = AxiStreamSource(AxiStreamBus.SOMEHOW(dut, s_axis*[i]), dut.i_clk, dut.i_rst_n, reset_active_level=False)
I definitely don't wanna go to the single-dimension arrays like: logic [N_GRANTS*W_TDATA-1:0] s_axis_tdata
Thanks!
Kaleb Barrett
@ktbarrett
@likewise you make an issue in cocotb-test about getting it to work with Python 3.6.
Kaleb Barrett
@ktbarrett
There should be a "could" in there. Sorry for the morning madlibs.
Vladislav Borshch
@vborshch_gitlab

I definitely don't wanna go to the single-dimension arrays like: logic [N_GRANTS*W_TDATA-1:0] s_axis_tdata

I found a solution for my previous messages about 2D AXIS ports. Looks like that:

self.axi_src_list = []
for i in range(N):
            self.axi_src_list.append(AxiStreamSource(AxiStreamBus.from_prefix(dut, "s_axis", array_idx=i), dut.i_clk, dut.i_rst))

Hope, it'll help somebody.

Leon Woestenberg
@likewise
@ktbarrett No problem, I interpreted it as +could :) I will drop an issue in cocotb-test.
jwprice100
@jwprice100
Does this make sense? If I reference dut.generic.value I get back an integer from Riviera, and a BinaryValue from GHDL
Kaleb Barrett
@ktbarrett
It doesn't make sense, but I'm not surprised. What's the type of the signal/constant being accessed?
jwprice100
@jwprice100
integer
Looks like GHDL support is still experimental, it doesn't seem to play nicely with timers (or I think more than one timer) and some other things
Kaleb Barrett
@ktbarrett
@jwprice100 Your problem: cocotb/cocotb#2596
jwprice100
@jwprice100
ah
not new issue :)
oh well, I was hoping it would work but not there yet
Kaleb Barrett
@ktbarrett
AFAIK there is no one working on improving the PLI support on GHDL. It currently offers the VPI, which is not an appropriate interface for a VHDL simulator. It could instead offer the VHPI. Although IMO we could and should improve and standardize the GPI (cocotb's abstraction over the various PLIs) and directly implement that in GHDL. However, there is little interest in that.
4 replies
jwprice100
@jwprice100
Yeah that is understandable but unfortunate
Dave Keeshan
@davekeeshan
Is it possible to test a variable result, have it fail, have the fact that the whole test fail at the end of the simulation. At the moment just raising an exception seems to stop the test dead at that point. I don't want to stop the test, I want to proceed so that I can see if the error persists or goes away.
4 replies
I also get the warning ".venv/Python-3.10.7/lib/python3.10/site-packages/cocotb/scheduler.py:585: FutureWarning: "Unwatched" tasks that throw exceptions will not cause the test to fail. See issue #2664 for more details.", after I raise an exception, great! But what does one do so that this FutureWarning is not issued?
2 replies
Vignesh Raja
@vigneshraja:matrix.org
[m]
hi, I am new to cocotb. How could I assign value to generic variable from cocotb?
Kaleb Barrett
@ktbarrett
@vigneshraja:matrix.org You cannot assign a generic value from a running simulation using the dut object. Instead, look up how to assign generics from your simulator's commandline and pass those flags to SIM_ARGS. For example, on Questa you would use -g/path/to/generic=value.