question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Readback of a signal with length 0 (VHDL2008)

See original GitHub issue

When I read back a signal of length 0, the conversion fails. I attached a minimal example. If the cntrlwidth is set to >0 it works. Signals with length 0 can for example be assigned to unused signals in buses. I expected the conversion to return 0.

Traceback (most recent call last):
#            File "binaryvalue_bug/binaryvaluetest.py", line 49, in test_cntrl
#            assert dut.Cntrl_in.value.integer == dut.Cntrl_out.value.integer
#            File "cocotb/cocotb/binary.py", line 294, in integer
#            return self._convert_from[self.binaryRepresentation](self._str)
#            File "cocotb/cocotb/binary.py", line 200, in _convert_from_unsigned
#            return int(resolve(x), 2)
#            ValueError: invalid literal for int() with base 2: ''

binaryValue.zip

Running on ModelSim DE version 2020.4 2020.10 (32bit) Running tests with cocotb v1.5.0.dev0 OS: CentOS 64bit

Issue Analytics

  • State:closed
  • Created 3 years ago
  • Comments:12 (12 by maintainers)

github_iconTop GitHub Comments

1reaction
ktbarrettcommented, Dec 16, 2020

Well as long as it’s consistent I guess I’m okay with it too. @Botnic @alexforencich Could one of you make the changes with a test for this case?

0reactions
eric-wiesercommented, Feb 23, 2021

How would you even write a null array with cocotb? Array writing is filled through python iteration, isn’t it?

Read more comments on GitHub >

github_iconTop Results From Across the Web

VHDL-2008, The End of Verbosity! - SynthWorks
VHDL-2008 allows the use of keyword "all" in place of signals. SynthWorks ... Lengths. Unsigned notation (default). Extend: 0 fill LHS.
Read more >
Why do we assign our outputs to signals first in VHDL?
I will tell you a scenario. Suppose you are creating an entity with. 2 input ports : A,B. 2 output ports : C,D....
Read more >
reg_file — VHDL-extras 1.0 documentation - GitHub Pages
The VHDL-2008 version uses unconstrained arrays-of-arrays for the Registers and Direct_read signals. This permits you to use any word size without needing ...
Read more >
Designing with VHDL
231-1) with predefined subtypes natural (≥0) and positive (>0) signal counter : Integer; signal timer : Natural;. • boolean has two possible values...
Read more >
VHDL 2008 calculate length of vector without leading zeros
For clarification: If the inputvector looks like "000100111", the output vector should also be (4 downto 0). That's why i just can't use...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found