diff options
Diffstat (limited to 'testsuite/gna/issue1440/tb2.vhdl')
-rw-r--r-- | testsuite/gna/issue1440/tb2.vhdl | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/testsuite/gna/issue1440/tb2.vhdl b/testsuite/gna/issue1440/tb2.vhdl new file mode 100644 index 000000000..9d656bfa9 --- /dev/null +++ b/testsuite/gna/issue1440/tb2.vhdl @@ -0,0 +1,39 @@ +library ieee; +use ieee.std_logic_1164.all; +use ieee.numeric_std.all; + +entity tb2 is +end; + +architecture tb of tb2 is + signal cnt, prev : std_logic_vector(3 downto 0) := (others=>'0'); + + function tostr (v : std_logic_vector) return string + is + alias av : std_logic_vector (1 to v'length) is v; + variable res : string (1 to v'length); + begin + for i in av'range loop + case av (i) is + when '0' => res (i) := '0'; + when '1' => res (i) := '1'; + when others => res (i) := '?'; + end case; + end loop; + return res; + end tostr; +begin + process + begin + for i in 0 to 20 loop + wait for 1 ns; + cnt <= std_logic_vector(unsigned(cnt) + 1); + prev <= cnt; + assert false + report "value=" & tostr(cnt) & " last_value=" & tostr(cnt'last_value) + severity note; + assert prev = cnt'last_value severity failure; + end loop; + wait; + end process; +end; |