aboutsummaryrefslogtreecommitdiffstats
path: root/testsuite/synth/var01/tb_var01a.vhdl
diff options
context:
space:
mode:
authorTristan Gingold <tgingold@free.fr>2019-11-03 07:40:18 +0100
committerTristan Gingold <tgingold@free.fr>2019-11-03 21:15:07 +0100
commitf9102057180443575edcebe71edb6c3eb1fc571d (patch)
treefb79fd04913dc1bbc5f569ea842c20339b2e436d /testsuite/synth/var01/tb_var01a.vhdl
parent79c615e88dd652d7f2077ccdbef0487d74febd98 (diff)
downloadghdl-f9102057180443575edcebe71edb6c3eb1fc571d.tar.gz
ghdl-f9102057180443575edcebe71edb6c3eb1fc571d.tar.bz2
ghdl-f9102057180443575edcebe71edb6c3eb1fc571d.zip
testsuite/synth/var01: add more tests.
Diffstat (limited to 'testsuite/synth/var01/tb_var01a.vhdl')
-rw-r--r--testsuite/synth/var01/tb_var01a.vhdl51
1 files changed, 51 insertions, 0 deletions
diff --git a/testsuite/synth/var01/tb_var01a.vhdl b/testsuite/synth/var01/tb_var01a.vhdl
new file mode 100644
index 000000000..3712f1d8b
--- /dev/null
+++ b/testsuite/synth/var01/tb_var01a.vhdl
@@ -0,0 +1,51 @@
+entity tb_var01a is
+end tb_var01a;
+
+library ieee;
+use ieee.std_logic_1164.all;
+
+architecture behav of tb_var01a is
+ signal clk : std_logic;
+ signal mask : std_logic_vector (1 downto 0);
+ signal val : std_logic_vector (7 downto 0);
+ signal res : std_logic_vector (7 downto 0);
+begin
+ dut: entity work.var01a
+ port map (
+ clk => clk,
+ mask => mask,
+ val => val,
+ res => res);
+
+ process
+ procedure pulse is
+ begin
+ clk <= '0';
+ wait for 1 ns;
+ clk <= '1';
+ wait for 1 ns;
+ end pulse;
+ begin
+ mask <= "11";
+ val <= x"12";
+ pulse;
+ assert res = x"12" report "res=" & to_hstring (res) severity failure;
+
+ mask <= "10";
+ val <= x"9a";
+ pulse;
+ assert res = x"92" severity failure;
+
+ mask <= "00";
+ val <= x"00";
+ pulse;
+ assert res = x"92" severity failure;
+
+ mask <= "01";
+ val <= x"de";
+ pulse;
+ assert res = x"9e" severity failure;
+
+ wait;
+ end process;
+end behav;