cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
diedrich
Visitor
Visitor
298 Views
Registered: ‎01-08-2021

Vivado Simulator does not verify length of string constant in array of structs

Jump to solution

Hi,

I have encountered a bug in the Vivado Simulator. Running the below file does not produce any errors during compilation or elaboration. Running the same file through ModelSim produces the error that the string constants "expected_result" in the array of structs "STIMULI" are not of the correct length (28 instead of 30). This is the first bug.

The second bug is that during simulation the Vivado Simulator produces an incorrect result. The assertion in the for loop should never be triggered. This is likely a direct consequence of the first bug. It also means that no type safety is guaranteed in the Vivado simulator. This seems like a problem.

Greetings,

diedrich

0 Kudos
Reply
1 Solution

Accepted Solutions
miti
Xilinx Employee
Xilinx Employee
189 Views
Registered: ‎06-10-2020

HI @diedrich , 

Thanks for the testcase, this is reported to development team. 

But as workaround please replace the constant like: 

constant STIMULI : testcase_vec (0 to 1) := ()

Here constant is created without creating any size of an array, if you specify the size ,Xsim will produce the expected behaviour.

-------------------------------------------------------------------------
Don't forget to reply, kudo, and accept as solution.
-------------------------------------------------------------------------

View solution in original post

3 Replies
richardhead
Scholar
Scholar
248 Views
Registered: ‎08-01-2012

What version of Vivado is this?

This is a pretty severe bug - and should be picked up at compile time.

Dont expect a fix anytime soon. VHDL development (particularly in the simulator) is slow to get any improvement or bugfixes. See how VHDL 2019 is out and they STILL dont have VHDL2008 support in the simulator.

I highly recommend you dont use it for VHDL.

0 Kudos
Reply
miti
Xilinx Employee
Xilinx Employee
190 Views
Registered: ‎06-10-2020

HI @diedrich , 

Thanks for the testcase, this is reported to development team. 

But as workaround please replace the constant like: 

constant STIMULI : testcase_vec (0 to 1) := ()

Here constant is created without creating any size of an array, if you specify the size ,Xsim will produce the expected behaviour.

-------------------------------------------------------------------------
Don't forget to reply, kudo, and accept as solution.
-------------------------------------------------------------------------

View solution in original post

diedrich
Visitor
Visitor
169 Views
Registered: ‎01-08-2021

I tested this in Vivado 2020.2 and 2018.3. I would expect this bug to be present in all version between these two.

0 Kudos
Reply