aboutsummaryrefslogtreecommitdiffstats
path: root/testsuite/synth/sns01/tb_add03.vhdl
blob: e856744a7ed33ad2e3ca879aa438e7cda2fa1c7f (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
entity tb_add03 is
end tb_add03;

library ieee;
use ieee.std_logic_1164.all;

architecture behav of tb_add03 is
  signal a, b : std_logic_vector(8 DOWNTO 0);
  signal borrow : std_logic;
  signal res : std_logic_vector(8 DOWNTO 0);
begin
  dut: entity work.add03
    port map (a, b, borrow, res);

  process
  begin
    a <= b"00000_0100";
    b <= b"00000_0001";
    borrow <= '0';
    wait for 1 ns;
    assert res = b"00000_0011" severity failure;


    a <= b"00000_0010";
    b <= b"00000_0001";
    borrow <= '1';
    wait for 1 ns;
    assert res = b"00000_0000" severity failure;

    wait;
  end process;
end behav;