aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTristan Gingold <tgingold@free.fr>2018-11-11 07:43:44 +0100
committerTristan Gingold <tgingold@free.fr>2018-11-11 07:43:44 +0100
commita0bbc7a199377e82bb3104783bf993986cade836 (patch)
tree8c46ce8e97470b27c7dacf3f5f9ddcc888135cfe
parent4ad7cbc7e7fc1c5bc24b541d9fbbb4f00abde93d (diff)
downloadghdl-a0bbc7a199377e82bb3104783bf993986cade836.tar.gz
ghdl-a0bbc7a199377e82bb3104783bf993986cade836.tar.bz2
ghdl-a0bbc7a199377e82bb3104783bf993986cade836.zip
Add testcase for #685
-rw-r--r--testsuite/gna/issue685/tb.ref15
-rw-r--r--testsuite/gna/issue685/tb.vhdl33
-rwxr-xr-xtestsuite/gna/issue685/testsuite.sh19
3 files changed, 67 insertions, 0 deletions
diff --git a/testsuite/gna/issue685/tb.ref b/testsuite/gna/issue685/tb.ref
new file mode 100644
index 000000000..55ebec176
--- /dev/null
+++ b/testsuite/gna/issue685/tb.ref
@@ -0,0 +1,15 @@
+.wb_demux_tb(bench).s.dat(1) e8 ---- last_event=-9223372036854775807fs last_active=-9223372036854775807fs val='U'; drv='U'
+.wb_demux_tb(bench).s.dat(0) e8 ---- last_event=-9223372036854775807fs last_active=-9223372036854775807fs val='U'; drv='U'
+.wb_demux_tb(bench).s.we e8 ---- last_event=-9223372036854775807fs last_active=-9223372036854775807fs val='U'; drv='U'
+.wb_demux_tb(bench).s.dat(1) e8 ---- last_event=-9223372036854775807fs last_active=-9223372036854775807fs val='U'; drv='U'
+.wb_demux_tb(bench).s.dat(0) e8 ---- last_event=-9223372036854775807fs last_active=-9223372036854775807fs val='U'; drv='U'
+.wb_demux_tb(bench).s.we e8 ---- last_event=-9223372036854775807fs last_active=-9223372036854775807fs val='U'; drv='U'
+.wb_demux_tb(bench).s.dat(1) e8 AE-- last_event=1ns last_active=1ns val='1'; drv='1'
+.wb_demux_tb(bench).s.dat(0) e8 AE-- last_event=1ns last_active=1ns val='1'; drv='1'
+.wb_demux_tb(bench).s.we e8 ---- last_event=-9223372036854775807fs last_active=-9223372036854775807fs val='U'; drv='U'
+.wb_demux_tb(bench).s.dat(1) e8 ---- last_event=1ns last_active=1ns val='1'; drv='1'
+.wb_demux_tb(bench).s.dat(0) e8 ---- last_event=1ns last_active=1ns val='1'; drv='1'
+.wb_demux_tb(bench).s.we e8 ---- last_event=-9223372036854775807fs last_active=-9223372036854775807fs val='U'; drv='U'
+.wb_demux_tb(bench).s.dat(1) e8 AE-- last_event=2ns last_active=2ns val='0'; drv='0'
+.wb_demux_tb(bench).s.dat(0) e8 AE-- last_event=2ns last_active=2ns val='0'; drv='0'
+.wb_demux_tb(bench).s.we e8 ---- last_event=-9223372036854775807fs last_active=-9223372036854775807fs val='U'; drv='U'
diff --git a/testsuite/gna/issue685/tb.vhdl b/testsuite/gna/issue685/tb.vhdl
new file mode 100644
index 000000000..3181eb3d4
--- /dev/null
+++ b/testsuite/gna/issue685/tb.vhdl
@@ -0,0 +1,33 @@
+library ieee;
+use ieee.std_logic_1164.all;
+
+package wishbone_pkg is
+ type t_wishbone_master_out is record
+ dat : std_logic_vector;
+ -- Works properly when field we is declared before dat
+ we : std_logic;
+ end record;
+end wishbone_pkg;
+
+library ieee;
+use ieee.std_logic_1164.all;
+use work.wishbone_pkg.all;
+
+entity wb_demux_tb is
+end entity;
+architecture bench of wb_demux_tb is
+ signal s : t_wishbone_master_out(
+ dat(1 downto 0)
+ );
+begin
+ stimulus : process
+ begin
+ wait for 1 ns;
+ s.dat <= "11";
+ wait for 1 ns;
+ s.dat <= "00";
+ wait for 1 ns;
+ report "pass";
+ std.env.finish;
+ end process;
+end architecture;
diff --git a/testsuite/gna/issue685/testsuite.sh b/testsuite/gna/issue685/testsuite.sh
new file mode 100755
index 000000000..80e646d99
--- /dev/null
+++ b/testsuite/gna/issue685/testsuite.sh
@@ -0,0 +1,19 @@
+#! /bin/sh
+
+. ../../testenv.sh
+
+export GHDL_STD_FLAGS=--std=08
+analyze tb.vhdl
+elab wb_demux_tb
+
+if ghdl_has_feature wb_demux_tb ghw; then
+ simulate wb_demux_tb --trace-signals |
+ grep wb_demux_tb | cut -d ' ' -f 1,3- > tb.out
+ diff --strip-trailing-cr tb.out tb.ref
+fi
+
+rm -f tb.out
+clean
+
+echo "Test successful"
+