Skip to content

Commit

Permalink
testsuite/gna: add a test and close #1224
Browse files Browse the repository at this point in the history
  • Loading branch information
tgingold committed Aug 4, 2021
1 parent f9e7eba commit d41483d
Show file tree
Hide file tree
Showing 3 changed files with 59 additions and 0 deletions.
24 changes: 24 additions & 0 deletions testsuite/gna/issue1224/tb.vhdl
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
library ieee;
use ieee.std_logic_1164.all;

entity tb is
end;

architecture arch of tb is

type ulogic_mat_t is array(natural range <>) of std_logic_vector; --this requires vhdl08

begin
process
constant logic2D: ulogic_mat_t(0 to 1) := (('U', 'X', '0', '1', 'Z', 'W', 'L', 'H', '-'), ('U', 'X', '0', '1', 'Z', 'W', 'L', 'H', '-'));
begin

for i in logic2D'range loop
for j in logic2D'range(1) loop
report "2D [" & integer'image(i) & "," & integer'image(j) & "]: " & std_logic'image(logic2D(i)(j)) severity note;
end loop ;
end loop ;

wait;
end process;
end;
24 changes: 24 additions & 0 deletions testsuite/gna/issue1224/tb93.vhdl
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
library ieee;
use ieee.std_logic_1164.all;

entity tb is
end;

architecture arch of tb is

type ulogic_mat_t is array(natural range <>, natural range <>) of std_logic; --this requires vhdl08

begin
process
constant logic2D: ulogic_mat_t(0 to 1, 0 to 8) := (('U', 'X', '0', '1', 'Z', 'W', 'L', 'H', '-'), ('U', 'X', '0', '1', 'Z', 'W', 'L', 'H', '-'));
begin

for i in logic2D'range loop
for j in logic2D'range(2) loop
report "2D [" & integer'image(i) & "," & integer'image(j) & "]: " & std_logic'image(logic2D(i,j)) severity note;
end loop ;
end loop ;

wait;
end process;
end;
11 changes: 11 additions & 0 deletions testsuite/gna/issue1224/testsuite.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
#! /bin/sh

. ../../testenv.sh

export GHDL_STD_FLAGS=--std=08
analyze tb.vhdl
elab_simulate tb

clean

echo "Test successful"

0 comments on commit d41483d

Please sign in to comment.