From e393e8b7babd9d2dbe5e6bb7816b82036b857a1f Mon Sep 17 00:00:00 2001 From: Tristan Gingold Date: Tue, 2 Sep 2014 21:16:10 +0200 Subject: Add testcase for indexed image. --- testsuite/gna/bug01/foo.vhdl | 41 +++++++++++++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) create mode 100644 testsuite/gna/bug01/foo.vhdl (limited to 'testsuite/gna/bug01/foo.vhdl') diff --git a/testsuite/gna/bug01/foo.vhdl b/testsuite/gna/bug01/foo.vhdl new file mode 100644 index 0000000..5b597fa --- /dev/null +++ b/testsuite/gna/bug01/foo.vhdl @@ -0,0 +1,41 @@ +library ieee; +use ieee.std_logic_1164.all; +use ieee.numeric_std.all; + +entity foo is + constant m: integer := 3; + constant n: integer := 5; + constant h: integer := 4; + constant DATA_SIZE: integer :=5; +end entity; + +architecture fum of foo is + signal OUTPUT : SIGNED((DATA_SIZE+DATA_SIZE)+(m-1)-1 downto 0) := "000011110110" ; + + type Vector is record + OUTPUT_test : SIGNED((DATA_SIZE+DATA_SIZE)+(m-1)-1 downto 0); + end record; + + type VectorArray is array (natural range <>) of Vector; + + constant Vectors : VectorArray := ( + -- Values to be compaired to calculated output + (OUTPUT_test =>"000011110110"), -- 246 (CORRECT) + (OUTPUT_test =>"000101001000") -- 382 (INCORRECT) + ); + +begin +TEST: + process + begin + for i in Vectors'RANGE loop + assert OUTPUT = Vectors(i).OUTPUT_test + report "Incorrect Output on vector line " & integer'image(i) & +-- lf & "Expected:" & integer'image(i)(to_integer((Vectors(i).OUTPUT_test))) + lf & "Expected:" & integer'image(to_integer((Vectors(i).OUTPUT_test))) + severity error; + end loop; + wait; + end process; + +end architecture; -- cgit