aboutsummaryrefslogtreecommitdiffstats
path: root/testsuite/gna/bug05
diff options
context:
space:
mode:
authorTristan Gingold <tgingold@free.fr>2014-12-21 07:43:05 +0100
committerTristan Gingold <tgingold@free.fr>2014-12-21 07:43:05 +0100
commitcc8c7684219e99a4cea75ff4c7757de27b78c572 (patch)
tree8b3ab988a097947bd4f707496c0d686b1ce65a16 /testsuite/gna/bug05
parent9544c205ae35ba3d7fc6040e965dc207ec639cc7 (diff)
downloadghdl-cc8c7684219e99a4cea75ff4c7757de27b78c572.tar.gz
ghdl-cc8c7684219e99a4cea75ff4c7757de27b78c572.tar.bz2
ghdl-cc8c7684219e99a4cea75ff4c7757de27b78c572.zip
Add a testcase for vcd/fst dumps.
Diffstat (limited to 'testsuite/gna/bug05')
-rw-r--r--testsuite/gna/bug05/repro.vhdl35
-rwxr-xr-xtestsuite/gna/bug05/testsuite.sh12
2 files changed, 47 insertions, 0 deletions
diff --git a/testsuite/gna/bug05/repro.vhdl b/testsuite/gna/bug05/repro.vhdl
new file mode 100644
index 000000000..ec3177126
--- /dev/null
+++ b/testsuite/gna/bug05/repro.vhdl
@@ -0,0 +1,35 @@
+entity sub is
+ generic (l : natural);
+ port (a : out bit;
+ b : bit_vector (0 to 3);
+ c : bit_vector (0 to l - 1));
+end sub;
+
+architecture behav of sub is
+begin
+ a <= b (0) xor c (0);
+end behav;
+
+entity tb is
+end tb;
+
+architecture behav of tb is
+ signal a : bit;
+ signal b: bit_vector (0 to 3);
+ signal c: bit_vector (0 to 7);
+begin
+ my_sub: entity work.sub
+ generic map (l => c'length)
+ port map (a => a, b => b, c => c);
+
+ process
+ begin
+ wait for 1 ns;
+ assert a = '0';
+ b <= x"0";
+ c <= x"80";
+ wait for 1 ns;
+ assert a = '1';
+ wait;
+ end process;
+end behav;
diff --git a/testsuite/gna/bug05/testsuite.sh b/testsuite/gna/bug05/testsuite.sh
new file mode 100755
index 000000000..42a3e39af
--- /dev/null
+++ b/testsuite/gna/bug05/testsuite.sh
@@ -0,0 +1,12 @@
+#! /bin/sh
+
+. ../../testenv.sh
+
+analyze repro.vhdl
+elab_simulate tb --fst=tb.fst
+elab_simulate tb --vcd=tb.vcd
+
+clean
+rm -f tb.fst tb.vcd
+
+echo "Test successful"