We have detected your current browser version is not the latest one. Xilinx.com uses the latest web technologies to bring you the best online experience possible. Please upgrade to a Xilinx.com supported browser:Chrome, Firefox, Internet Explorer 11, Safari. Thank you!

Page Bookmarked

AR# 67551

Vivado Simulator does not give any warning or error message when an integer goes out of range


I have the following code in VHDL including a signal clk_count whose range is defined as integer range 0 to 4. 

This signal is going out of range at simulation. However, Vivado Simulator is not displaying any error message at the simulation stage.

signal clk_count : INTEGER range 0 to 4;
clk_gen_adc: process(clk,reset)
If(reset = ?1?) then
clk_count <= 0;
elsif rising_edge (clk) begin
If clk_count = 9 then
clk_count <= 0;
clk_count <= clk_count + 1;
end process;


Vivado Simulator does have a rangecheck option but it is disabled by default.

You will need to enable the rangecheck option in the simulation settings as shown in the below screen capture to turn on the error message.


After enabling the rangecheck option highlighted above, Vivado simulator stops when the value reaches 5 with the following error message:

ERROR: runtime range check value 5 is out of valid range 0 to 4.

Note: The rangecheck switch was disabled by default as it causes the compiler to generate extra code for the range check and slows down the simulation.

It is provided as an option which can be turned on in specific cases where you want the tool to perform rangecheck.

AR# 67551
Date 07/22/2016
Status Active
Type General Article
  • FPGA Device Families
  • Vivado Design Suite