diff options
author | Tristan Gingold <tgingold@free.fr> | 2020-04-22 19:00:55 +0200 |
---|---|---|
committer | Tristan Gingold <tgingold@free.fr> | 2020-04-22 21:31:27 +0200 |
commit | 1cea5c116af6f659ac635a4ff9f26c857f86e455 (patch) | |
tree | 8db6ac5de421cc17d5267cd3318ba6d3bd7a90cd /testsuite/synth/synth108 | |
parent | f1b30e039589a780c3cbf4ae24af18e8eb3f948d (diff) | |
download | ghdl-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.vhdl | 20 | ||||
-rwxr-xr-x | testsuite/synth/synth108/testsuite.sh | 8 |
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" |