playground/vhdl/formal/ripple-ca-tb.vhdl

41 lines
918 B
VHDL

library ieee;
use ieee.std_logic_1164.all;
use ieee.numeric_std.all;
entity rca_tb_e is
port(
t_clk : std_logic
);
end rca_tb_e;
architecture rca_tb_a of rca_tb_e is
signal t_a, t_b : std_logic_vector(3 downto 0);
signal t_cin : std_logic;
signal t_s : std_logic_vector(3 downto 0);
signal t_cout : std_logic;
begin
t_rca_e: entity work.rca_e port map(
t_a, t_b, t_cin, t_s, t_cout
);
-- clock for PSL directive
default clock is rising_edge(t_clk);
PROP1: assert always (
(t_a xor (t_b xor t_cin)) = "00"
);
--PROP2: assert always (((t_cin and (t_a xor t_b)) or (t_a and t_b)) = t_cout);
-- process
-- begin
-- t_a <= "0100";
-- t_b <= "0101";
-- t_cin <= '0';
-- wait for 10 ns;
-- assert t_s = "1001"
-- report "Expected 1001, got " & to_string(t_s)
-- severity error;
-- wait;
-- end process;
end architecture rca_tb_a;