From 1cea5c116af6f659ac635a4ff9f26c857f86e455 Mon Sep 17 00:00:00 2001 From: Tristan Gingold Date: Wed, 22 Apr 2020 19:00:55 +0200 Subject: testsuite/synth: add a test for ghdl-yosys-plugin#108 --- testsuite/synth/synth108/mwe.vhdl | 20 ++++++++++++++++++++ testsuite/synth/synth108/testsuite.sh | 8 ++++++++ 2 files changed, 28 insertions(+) create mode 100644 testsuite/synth/synth108/mwe.vhdl create mode 100755 testsuite/synth/synth108/testsuite.sh 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" -- cgit v1.2.3