diff options
-rw-r--r-- | testsuite/synth/issue1703/blinker.vhdl | 30 | ||||
-rwxr-xr-x | testsuite/synth/issue1703/testsuite.sh | 14 |
2 files changed, 44 insertions, 0 deletions
diff --git a/testsuite/synth/issue1703/blinker.vhdl b/testsuite/synth/issue1703/blinker.vhdl new file mode 100644 index 000000000..4c96099e9 --- /dev/null +++ b/testsuite/synth/issue1703/blinker.vhdl @@ -0,0 +1,30 @@ +library ieee; +use ieee.std_logic_1164.all; + +entity Blinker is + port( + clk_i : in std_logic; + rst_i : in std_logic; + led_o : out std_logic + ); +end Blinker; + +architecture RTL of Blinker is + constant N : natural := 25e6; + signal count_reg : natural range 0 to N - 1; +begin + process(rst_i, clk_i) + begin + if rst_i = '1' then + count_reg <= 0; + elsif rising_edge(clk_i) then + if count_reg = N - 1 then + count_reg <= 0; + else + count_reg <= count_reg + 1; + end if; + end if; + end process; + + led_o <= '1' when count_reg < N / 2 else '0'; +end RTL; diff --git a/testsuite/synth/issue1703/testsuite.sh b/testsuite/synth/issue1703/testsuite.sh new file mode 100755 index 000000000..082777db5 --- /dev/null +++ b/testsuite/synth/issue1703/testsuite.sh @@ -0,0 +1,14 @@ +#! /bin/sh + +. ../../testenv.sh + +synth_analyze blinker +count=$(grep -c _edge syn_blinker.vhdl) +if [ $count -ne 1 ]; then + echo "edge gate present" + exit 1 +fi + +clean + +echo "Test successful" |