diff options
author | Tristan Gingold <tgingold@free.fr> | 2019-09-11 06:31:39 +0200 |
---|---|---|
committer | Tristan Gingold <tgingold@free.fr> | 2019-09-11 06:37:28 +0200 |
commit | 86480bfed6bce483936d585498e1498d8fde208d (patch) | |
tree | 66320d378a31c7ab467265f1f92bfbad8e004041 /testsuite/synth/ret01/ret02.vhdl | |
parent | db5c3b1cf051d215ee7f02064464b4b1088ea226 (diff) | |
download | ghdl-86480bfed6bce483936d585498e1498d8fde208d.tar.gz ghdl-86480bfed6bce483936d585498e1498d8fde208d.tar.bz2 ghdl-86480bfed6bce483936d585498e1498d8fde208d.zip |
testsuite/synth: add ret01 tests.
Diffstat (limited to 'testsuite/synth/ret01/ret02.vhdl')
-rw-r--r-- | testsuite/synth/ret01/ret02.vhdl | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/testsuite/synth/ret01/ret02.vhdl b/testsuite/synth/ret01/ret02.vhdl new file mode 100644 index 000000000..8da4f3012 --- /dev/null +++ b/testsuite/synth/ret01/ret02.vhdl @@ -0,0 +1,19 @@ +library ieee; +use ieee.std_logic_1164.all; + +entity ret02 is + port (di : std_logic_vector (7 downto 0); + res : out integer); +end ret02; + +architecture behav of ret02 is + function sign (v : std_logic_vector (7 downto 0)) return integer is + begin + if v (7) = '1' then + return -1; + end if; + return 1; + end sign; +begin + res <= sign (di); +end behav; |