Line 371... |
Line 371... |
variable pltbv : inout pltbv_t;
|
variable pltbv : inout pltbv_t;
|
signal pltbs : out pltbs_t
|
signal pltbs : out pltbs_t
|
);
|
);
|
procedure check(
|
procedure check(
|
constant rpt : in string;
|
constant rpt : in string;
|
|
constant actual : in string;
|
|
constant expected : in string;
|
|
variable pltbv : inout pltbv_t;
|
|
signal pltbs : out pltbs_t
|
|
);
|
|
procedure check(
|
|
constant rpt : in string;
|
constant expr : in boolean;
|
constant expr : in boolean;
|
variable pltbv : inout pltbv_t;
|
variable pltbv : inout pltbv_t;
|
signal pltbs : out pltbs_t
|
signal pltbs : out pltbs_t
|
);
|
);
|
procedure check(
|
procedure check(
|
Line 1231... |
Line 1238... |
----------------------------------------------------------------------------
|
----------------------------------------------------------------------------
|
-- check
|
-- check
|
--
|
--
|
-- procedure check(
|
-- procedure check(
|
-- constant rpt : in string;
|
-- constant rpt : in string;
|
-- constant actual : in integer|std_logic|std_logic_vector|unsigned|signed;
|
-- constant actual : in integer|std_logic|std_logic_vector|unsigned|signed|string;
|
-- constant expected : in integer|std_logic|std_logic_vector|unsigned|signed;
|
-- constant expected : in integer|std_logic|std_logic_vector|unsigned|signed|string;
|
-- variable pltbv : inout pltbv_t;
|
-- variable pltbv : inout pltbv_t;
|
-- signal pltbs : out pltbs_t
|
-- signal pltbs : out pltbs_t
|
-- )
|
-- )
|
--
|
--
|
-- procedure check(
|
-- procedure check(
|
Line 1430... |
Line 1437... |
) is
|
) is
|
begin
|
begin
|
check(rpt, actual, to_signed(expected, actual'length), pltbv, pltbs);
|
check(rpt, actual, to_signed(expected, actual'length), pltbv, pltbs);
|
end procedure check;
|
end procedure check;
|
|
|
|
-- check string
|
|
procedure check(
|
|
constant rpt : in string;
|
|
constant actual : in string;
|
|
constant expected : in string;
|
|
variable pltbv : inout pltbv_t;
|
|
signal pltbs : out pltbs_t
|
|
) is
|
|
variable mismatch : boolean := false;
|
|
begin
|
|
if actual'length /= expected'length then
|
|
mismatch := true;
|
|
else
|
|
for i in 0 to actual'length-1 loop
|
|
if actual(i+actual'low) /= expected(i+expected'low) then
|
|
mismatch := true;
|
|
exit;
|
|
end if;
|
|
end loop;
|
|
end if;
|
|
check(rpt, not mismatch, actual, expected, "", pltbv, pltbs);
|
|
end procedure check;
|
|
|
-- check with boolean expression
|
-- check with boolean expression
|
-- Check signal or variable with a boolean expression as argument C_EXPR.
|
-- Check signal or variable with a boolean expression as argument C_EXPR.
|
-- This allowes any kind of check.
|
-- This allowes any kind of check.
|
procedure check(
|
procedure check(
|
constant rpt : in string;
|
constant rpt : in string;
|
Line 1759... |
Line 1789... |
constant test_num : in integer;
|
constant test_num : in integer;
|
constant test_name : in string;
|
constant test_name : in string;
|
constant check_num : in integer;
|
constant check_num : in integer;
|
constant err_cnt_in_test : in integer
|
constant err_cnt_in_test : in integer
|
) is
|
) is
|
variable comparison_str : string(1 to 32) := (others => ' ');
|
|
variable comparison_str_len : integer := 1;
|
|
variable actual_str : string(1 to 32) := (others => ' ');
|
|
variable actual_str_len : integer := 1;
|
variable actual_str_len : integer := 1;
|
variable expected_str : string(1 to 32) := (others => ' ');
|
variable actual_str : string(1 to actual'length+8) := (others => ' ');
|
|
variable expected_str : string(1 to expected'length+10) := (others => ' ');
|
variable expected_str_len : integer := 1;
|
variable expected_str_len : integer := 1;
|
variable mask_str : string(1 to 32) := (others => ' ');
|
variable mask_str : string(1 to mask'length+6) := (others => ' ');
|
variable mask_str_len : integer := 1;
|
variable mask_str_len : integer := 1;
|
begin
|
begin
|
if not expr then -- Output message only if the check fails
|
if not expr then -- Output message only if the check fails
|
if actual /= "" then
|
if actual /= "" then
|
actual_str_len := 8 + actual'length;
|
actual_str_len := 8 + actual'length;
|
actual_str(1 to actual_str_len) := " Actual=" & actual;
|
actual_str := " Actual=" & actual;
|
end if;
|
end if;
|
if expected /= "" then
|
if expected /= "" then
|
expected_str_len := 10 + expected'length;
|
expected_str_len := 10 + expected'length;
|
expected_str(1 to expected_str_len) := " Expected=" & expected;
|
expected_str := " Expected=" & expected;
|
end if;
|
end if;
|
if mask /= "" then
|
if mask /= "" then
|
mask_str_len := 6 + mask'length;
|
mask_str_len := 6 + mask'length;
|
mask_str(1 to mask_str_len) := " Mask=" & mask;
|
mask_str := " Mask=" & mask;
|
end if;
|
end if;
|
assert false
|
assert false
|
report "Check " & str(check_num) & "; " & rpt & "; " &
|
report "Check " & str(check_num) & "; " & rpt & "; " &
|
actual_str(1 to actual_str_len) &
|
actual_str(1 to actual_str_len) &
|
expected_str(1 to expected_str_len) &
|
expected_str(1 to expected_str_len) &
|