Browse Source

add new procedures assert_true(boolean) and assert_false(boolean)

pull/1/head
T. Meissner 10 years ago
parent
commit
1dcf8fb9d4
1 changed files with 17 additions and 0 deletions
  1. +17
    -0
      sim/AssertP.vhd

+ 17
- 0
sim/AssertP.vhd View File

@ -8,6 +8,9 @@ use work.StringP.all;
package AssertP is
procedure assert_true (a : boolean);
procedure assert_false (a : boolean);
procedure assert_equal (a : in integer; b : in integer);
procedure assert_equal (a : in std_logic_vector; b : in std_logic_vector);
procedure assert_equal (a : in string; b : in string);
@ -23,6 +26,20 @@ end package AssertP;
package body AssertP is
procedure assert_true (a : boolean) is
begin
assert a
report "FAILURE: a should be evaluate to true"
severity failure;
end procedure assert_true;
procedure assert_false (a : boolean) is
begin
assert not(a)
report "FAILURE: a should be evaluate to false"
severity failure;
end procedure assert_false;
procedure assert_equal (a : in integer; b : in integer) is
begin
assert a = b


Loading…
Cancel
Save