diff options
author | Tristan Gingold <tgingold@free.fr> | 2021-01-25 18:32:14 +0100 |
---|---|---|
committer | Tristan Gingold <tgingold@free.fr> | 2021-01-25 18:32:41 +0100 |
commit | cba859cacf8c6631146dbdaa0f297c060b5a68cd (patch) | |
tree | c1301eae95be57f3b2cf998e85698884f0272bd0 /testsuite/ghdl-issues | |
parent | 26b67a045f3fe3a6d52a6d2588aa239202fb576c (diff) | |
download | ghdl-yosys-plugin-cba859cacf8c6631146dbdaa0f297c060b5a68cd.tar.gz ghdl-yosys-plugin-cba859cacf8c6631146dbdaa0f297c060b5a68cd.tar.bz2 ghdl-yosys-plugin-cba859cacf8c6631146dbdaa0f297c060b5a68cd.zip |
testsuite: add testcase for ghdl/ghdl#1610
Diffstat (limited to 'testsuite/ghdl-issues')
-rw-r--r-- | testsuite/ghdl-issues/issue1610/exp.vhdl | 32 | ||||
-rwxr-xr-x | testsuite/ghdl-issues/issue1610/testsuite.sh | 10 |
2 files changed, 42 insertions, 0 deletions
diff --git a/testsuite/ghdl-issues/issue1610/exp.vhdl b/testsuite/ghdl-issues/issue1610/exp.vhdl new file mode 100644 index 0000000..3d3ac38 --- /dev/null +++ b/testsuite/ghdl-issues/issue1610/exp.vhdl @@ -0,0 +1,32 @@ +library IEEE; +use IEEE.std_logic_1164.ALL; +use IEEE.numeric_std.ALL; + +entity exp is + port ( + clk : in std_logic + ); +end entity exp; + +architecture behav of exp is + + signal ver_clk : std_logic; + signal count : integer := 0; + + attribute gclk : boolean; + attribute gclk of ver_clk : signal is true; + +begin + + default Clock is rising_edge(clk); + + process (ver_clk) + begin + if rising_edge(ver_clk) then + count <= count + 1; + end if; + end process; + + assert always next count = prev(count) + 1; + +end architecture behav; diff --git a/testsuite/ghdl-issues/issue1610/testsuite.sh b/testsuite/ghdl-issues/issue1610/testsuite.sh new file mode 100755 index 0000000..9fef001 --- /dev/null +++ b/testsuite/ghdl-issues/issue1610/testsuite.sh @@ -0,0 +1,10 @@ +#!/bin/sh + +topdir=../.. +. $topdir/testenv.sh + +run_yosys -q -p "ghdl --std=08 exp.vhdl -e; write_rtlil exp.il" +fgrep 'cell $ff' exp.il + +clean +echo OK |