aboutsummaryrefslogtreecommitdiffstats
path: root/testsuite/synth/synth108
diff options
context:
space:
mode:
authorTristan Gingold <tgingold@free.fr>2020-04-22 19:00:55 +0200
committerTristan Gingold <tgingold@free.fr>2020-04-22 21:31:27 +0200
commit1cea5c116af6f659ac635a4ff9f26c857f86e455 (patch)
tree8db6ac5de421cc17d5267cd3318ba6d3bd7a90cd /testsuite/synth/synth108
parentf1b30e039589a780c3cbf4ae24af18e8eb3f948d (diff)
downloadghdl-1cea5c116af6f659ac635a4ff9f26c857f86e455.tar.gz
ghdl-1cea5c116af6f659ac635a4ff9f26c857f86e455.tar.bz2
ghdl-1cea5c116af6f659ac635a4ff9f26c857f86e455.zip
testsuite/synth: add a test for ghdl-yosys-plugin#108
Diffstat (limited to 'testsuite/synth/synth108')
-rw-r--r--testsuite/synth/synth108/mwe.vhdl20
-rwxr-xr-xtestsuite/synth/synth108/testsuite.sh8
2 files changed, 28 insertions, 0 deletions
diff --git a/testsuite/synth/synth108/mwe.vhdl b/testsuite/synth/synth108/mwe.vhdl
new file mode 100644
index 000000000..af286bc9e
--- /dev/null
+++ b/testsuite/synth/synth108/mwe.vhdl
@@ -0,0 +1,20 @@
+library ieee;
+use ieee.std_logic_1164.all;
+use ieee.numeric_std.all;
+
+entity MWE is
+
+ port (
+ a : in std_logic_vector(0 to 3);
+ b : in std_logic_vector(0 to 3);
+ sel : in std_logic_vector(0 to 1);
+ o : out std_logic_vector(0 to 1)
+ );
+end MWE;
+
+architecture behavioral of MWE is
+ signal cnt : integer range 0 to 1;
+begin
+ cnt <= to_integer(unsigned(sel));
+ o <= a(cnt*o'length to (cnt + 1)*o'length - 1) xor b(cnt*o'length to (cnt + 1)*o'length - 1);
+end architecture behavioral;
diff --git a/testsuite/synth/synth108/testsuite.sh b/testsuite/synth/synth108/testsuite.sh
new file mode 100755
index 000000000..62b57fc6a
--- /dev/null
+++ b/testsuite/synth/synth108/testsuite.sh
@@ -0,0 +1,8 @@
+#! /bin/sh
+
+. ../../testenv.sh
+
+synth_analyze mwe
+clean
+
+echo "Test successful"