From 6985d68bd34e2528a1a31a317225f131e7404536 Mon Sep 17 00:00:00 2001 From: Tristan Gingold Date: Sat, 25 Feb 2023 08:23:20 +0100 Subject: testsuite/synth: add a test for #2361 --- testsuite/synth/issue2361/jkff.vhdl | 19 +++++++++++++++++++ testsuite/synth/issue2361/testsuite.sh | 8 ++++++++ 2 files changed, 27 insertions(+) create mode 100644 testsuite/synth/issue2361/jkff.vhdl create mode 100755 testsuite/synth/issue2361/testsuite.sh diff --git a/testsuite/synth/issue2361/jkff.vhdl b/testsuite/synth/issue2361/jkff.vhdl new file mode 100644 index 000000000..0417089e2 --- /dev/null +++ b/testsuite/synth/issue2361/jkff.vhdl @@ -0,0 +1,19 @@ +entity jkff is + port ( + j_n, k_n, clk : in bit; + q, q_n : inout bit); +end entity; + +architecture behavioral of jkff is +begin + flip_flop : process (j_n, k_n, clk) is + begin + case j_n & k_n & clk is + when "010" | "011" => q <= '1'; + when "100" | "101" => q <= '0'; + when "001" => q <= q_n; + when others => q <= unaffected; + end case; + end process; + q_n <= not q; +end architecture; diff --git a/testsuite/synth/issue2361/testsuite.sh b/testsuite/synth/issue2361/testsuite.sh new file mode 100755 index 000000000..9ca84e726 --- /dev/null +++ b/testsuite/synth/issue2361/testsuite.sh @@ -0,0 +1,8 @@ +#! /bin/sh + +. ../../testenv.sh + +GHDL_STD_FLAGS=--std=08 +synth_only jkff + +echo "Test successful" -- cgit v1.2.3