diff options
author | Tristan Gingold <tgingold@free.fr> | 2021-03-27 08:45:00 +0100 |
---|---|---|
committer | Tristan Gingold <tgingold@free.fr> | 2021-03-27 08:45:00 +0100 |
commit | 98f4594b67ef650b115653185022e46876fb08ce (patch) | |
tree | 6c29b9bcdc5906e8034cf9b93a695b265cb2d7ff /testsuite/ghdl-issues | |
parent | 266028e098b53b41e381fb982b6fef35c8aabe02 (diff) | |
download | ghdl-yosys-plugin-98f4594b67ef650b115653185022e46876fb08ce.tar.gz ghdl-yosys-plugin-98f4594b67ef650b115653185022e46876fb08ce.tar.bz2 ghdl-yosys-plugin-98f4594b67ef650b115653185022e46876fb08ce.zip |
testsuite: add a test for ghdl/ghdl#1699
Diffstat (limited to 'testsuite/ghdl-issues')
-rw-r--r-- | testsuite/ghdl-issues/issue1699/test2.vhdl | 41 | ||||
-rwxr-xr-x | testsuite/ghdl-issues/issue1699/testsuite.sh | 9 |
2 files changed, 50 insertions, 0 deletions
diff --git a/testsuite/ghdl-issues/issue1699/test2.vhdl b/testsuite/ghdl-issues/issue1699/test2.vhdl new file mode 100644 index 0000000..ec330e5 --- /dev/null +++ b/testsuite/ghdl-issues/issue1699/test2.vhdl @@ -0,0 +1,41 @@ +library ieee; +use ieee.std_logic_1164.all; +use ieee.numeric_std.all; + +entity test2 is + port ( + clk : in std_ulogic; + addr : in std_ulogic_vector(4 downto 0); + data : out std_ulogic_vector(2 downto 0) + ); +end entity test2; + +architecture rtl of test2 is + type result_t is array(integer range 0 to 15) of std_ulogic_vector(2 downto 0); + + constant result_select : result_t := ( + 0 => "001", + 1 => "001", + 2 => "001", + 3 => "001", + 4 => "001", + 5 => "001", + 6 => "001", + 7 => "001", + others => "000" + ); +begin + + --lookup_0: process(all) + --begin + --data <= result_select(to_integer(unsigned(addr))); + --end process; + + lookup_0: process(clk) + begin + if rising_edge(clk) then + data <= result_select(to_integer(unsigned(addr))); + end if; + end process; +end; + diff --git a/testsuite/ghdl-issues/issue1699/testsuite.sh b/testsuite/ghdl-issues/issue1699/testsuite.sh new file mode 100755 index 0000000..2636855 --- /dev/null +++ b/testsuite/ghdl-issues/issue1699/testsuite.sh @@ -0,0 +1,9 @@ +#!/bin/sh + +topdir=../.. +. $topdir/testenv.sh + +run_yosys -p "ghdl --std=08 test2.vhdl -e; write_verilog test2.v" + +clean +echo OK |