aboutsummaryrefslogtreecommitdiffstats
path: root/testsuite/synth/func01/tb_func08.vhdl
diff options
context:
space:
mode:
Diffstat (limited to 'testsuite/synth/func01/tb_func08.vhdl')
-rw-r--r--testsuite/synth/func01/tb_func08.vhdl34
1 files changed, 34 insertions, 0 deletions
diff --git a/testsuite/synth/func01/tb_func08.vhdl b/testsuite/synth/func01/tb_func08.vhdl
new file mode 100644
index 000000000..792d91992
--- /dev/null
+++ b/testsuite/synth/func01/tb_func08.vhdl
@@ -0,0 +1,34 @@
+entity tb_func08 is
+end tb_func08;
+
+library ieee;
+use ieee.std_logic_1164.all;
+
+architecture behav of tb_func08 is
+ signal v : std_ulogic_vector(31 downto 0);
+ signal r : integer;
+begin
+ dut: entity work.func08
+ port map (v, r);
+
+ process
+ begin
+ v <= x"00000000";
+ wait for 1 ns;
+ assert r = 32 severity failure;
+
+ v <= x"0000_0001";
+ wait for 1 ns;
+ assert r = 31 severity failure;
+
+ v <= x"8000_0000";
+ wait for 1 ns;
+ assert r = 0 severity failure;
+
+ v <= x"0001_00f0";
+ wait for 1 ns;
+ assert r = 15 severity failure;
+
+ wait;
+ end process;
+end behav;