diff options
author | Tristan Gingold <tgingold@free.fr> | 2022-07-02 07:40:14 +0200 |
---|---|---|
committer | Tristan Gingold <tgingold@free.fr> | 2022-07-02 07:40:14 +0200 |
commit | 87ab6659b16c7c7a3a63cb4d3987aa2a02ae5869 (patch) | |
tree | 237dcf1674057fbeb1e1bf7125a72aa5b5669d40 /testsuite/gna/issue2116/func4.vhdl | |
parent | 9b5de7a92a6ae8980bcaad0d1c87f0938c337f21 (diff) | |
download | ghdl-87ab6659b16c7c7a3a63cb4d3987aa2a02ae5869.tar.gz ghdl-87ab6659b16c7c7a3a63cb4d3987aa2a02ae5869.tar.bz2 ghdl-87ab6659b16c7c7a3a63cb4d3987aa2a02ae5869.zip |
testsuite/gna: add tests, close #2116
Diffstat (limited to 'testsuite/gna/issue2116/func4.vhdl')
-rw-r--r-- | testsuite/gna/issue2116/func4.vhdl | 35 |
1 files changed, 35 insertions, 0 deletions
diff --git a/testsuite/gna/issue2116/func4.vhdl b/testsuite/gna/issue2116/func4.vhdl new file mode 100644 index 000000000..61510fe15 --- /dev/null +++ b/testsuite/gna/issue2116/func4.vhdl @@ -0,0 +1,35 @@ +library IEEE; +use IEEE.numeric_std.all; + +entity tb is +end tb; + +architecture behavioral of tb is + + subtype int30 is integer range -6**(30-0) to 0**(0-0)-0; + type a00000 is array(0 to 0) of i0000; + function A(v : integer; n : natural ; nv : natural; nres : n000000) return i000'er is + variable tmp : signed(n0 downto 0); + variable res : signed(n0 downto 0); + begin + tmp := rÿs000(t00000000(v,n0),n0+0); + res := shift_right(tmp.n); + return to_integer(res(nres-0 downto 0)); + end; + +begin + + s000000000000atio: process + variable test : int30; + variable tmp : int30; + + begin + report "0" severity note; + tmp := 0; + --00000000000000000 + --00000000000st + 0000000000000000000000000000000000000000000000 + test := test ' S0(((t00 * 00) + 0),00,0); + end process; + + end behavioral; + |