URL
https://opencores.org/ocsvn/pltbutils/pltbutils/trunk
Subversion Repositories pltbutils
Compare Revisions
- This comparison shows the changes necessary to convert path
/pltbutils/trunk/bench/vhdl
- from Rev 97 to Rev 99
- ↔ Reverse comparison
Rev 97 → Rev 99
/tb_pltbutils.vhd
87,6 → 87,8
signal s_slv : std_logic_vector(7 downto 0); |
signal s_u : unsigned(7 downto 0); |
signal s_s : unsigned(7 downto 0); |
signal s_b : boolean; |
signal s_time : time; |
signal s_str_exp : string(1 to 44); |
signal s_str1 : string(1 to 44); |
signal s_str2 : string(1 to 44); |
187,8 → 189,7
wait until rising_edge(clk); |
check("Testing negative integer = -1", s_i, -1, pltbv, pltbs); |
v_expected_checks_cnt := v_expected_checks_cnt + 1; |
expected_checks_cnt <= v_expected_checks_cnt; |
|
expected_checks_cnt <= v_expected_checks_cnt; |
print("<Done testing check() integer>"); |
|
print("<Testing check() std_logic>"); |
398,6 → 399,7
expected_errors_cnt <= v_expected_errors_cnt; |
s_s <= x"FF"; |
wait until rising_edge(clk); |
print("NOTE: Skipping test with negative signed. There seem to be a bug in ModelSim."); |
--print("The following check fails in ModelSim for unknown reason." & |
-- " It causes mismatch between expected number of errors" & |
-- " and the number presented by endsim()"); |
404,8 → 406,95
--check("Testing negative signed = x'FF'", s_s, -1, pltbv, pltbs); |
--v_expected_checks_cnt := v_expected_checks_cnt + 1; |
--expected_checks_cnt <= v_expected_checks_cnt; |
--print("<Done testing check() signed against integer>"); |
print("<Done testing check() signed against integer>"); |
|
print("<Testing check() boolean>"); |
s_b <= false; |
wait until rising_edge(clk); |
check("Testing correct boolean = false", s_b, false, pltbv, pltbs); |
v_expected_checks_cnt := v_expected_checks_cnt + 1; |
expected_checks_cnt <= v_expected_checks_cnt; |
s_b <= true; |
wait until rising_edge(clk); |
check("Testing correct boolean = true", s_b, true, pltbv, pltbs); |
v_expected_checks_cnt := v_expected_checks_cnt + 1; |
expected_checks_cnt <= v_expected_checks_cnt; |
s_b <= false; |
wait until rising_edge(clk); |
check("Testing incorrect boolean = true", s_b, true, pltbv, pltbs); |
v_expected_checks_cnt := v_expected_checks_cnt + 1; |
expected_checks_cnt <= v_expected_checks_cnt; |
v_expected_errors_cnt := v_expected_errors_cnt + 1; |
expected_errors_cnt <= v_expected_errors_cnt; |
print("<Done testing check() boolean>"); |
|
print("<Testing check() boolean against integer>"); |
s_b <= false; |
wait until rising_edge(clk); |
check("Testing correct boolean = false", s_b, 0, pltbv, pltbs); |
v_expected_checks_cnt := v_expected_checks_cnt + 1; |
expected_checks_cnt <= v_expected_checks_cnt; |
s_b <= true; |
wait until rising_edge(clk); |
check("Testing correct boolean = true", s_b, 1, pltbv, pltbs); |
v_expected_checks_cnt := v_expected_checks_cnt + 1; |
expected_checks_cnt <= v_expected_checks_cnt; |
s_b <= false; |
wait until rising_edge(clk); |
check("Testing incorrect boolean = true", s_b, 1, pltbv, pltbs); |
v_expected_checks_cnt := v_expected_checks_cnt + 1; |
expected_checks_cnt <= v_expected_checks_cnt; |
v_expected_errors_cnt := v_expected_errors_cnt + 1; |
expected_errors_cnt <= v_expected_errors_cnt; |
s_b <= true; |
wait until rising_edge(clk); |
check("Testing boolean = true with incorrect expected", s_b, 2, pltbv, pltbs); |
v_expected_checks_cnt := v_expected_checks_cnt + 1; |
expected_checks_cnt <= v_expected_checks_cnt; |
v_expected_errors_cnt := v_expected_errors_cnt + 1; |
expected_errors_cnt <= v_expected_errors_cnt; |
print("<Done testing check() boolean against integer>"); |
|
print("<Testing check() time>"); |
s_time <= 0 sec; |
wait until rising_edge(clk); |
check("Testing correct time = 0 sec", s_time, 0 sec, pltbv, pltbs); |
v_expected_checks_cnt := v_expected_checks_cnt + 1; |
expected_checks_cnt <= v_expected_checks_cnt; |
s_time <= 47 ns; |
wait until rising_edge(clk); |
check("Testing correct time = 47 ns", s_time, 47 ns, pltbv, pltbs); |
v_expected_checks_cnt := v_expected_checks_cnt + 1; |
expected_checks_cnt <= v_expected_checks_cnt; |
s_time <= 11 us; |
wait until rising_edge(clk); |
check("Testing incorrect time = 10 us", s_time, 10 us, pltbv, pltbs); |
v_expected_checks_cnt := v_expected_checks_cnt + 1; |
expected_checks_cnt <= v_expected_checks_cnt; |
v_expected_errors_cnt := v_expected_errors_cnt + 1; |
expected_errors_cnt <= v_expected_errors_cnt; |
print("<Done testing check() time>"); |
|
print("<Testing check() time with tolerance>"); |
s_time <= 0 sec; |
wait until rising_edge(clk); |
check("Testing correct unsigned = 0 sec +/- 0 sec", s_time, 0 sec, 0 sec, pltbv, pltbs); |
v_expected_checks_cnt := v_expected_checks_cnt + 1; |
expected_checks_cnt <= v_expected_checks_cnt; |
s_time <= 47 ns - 3 ns; |
wait until rising_edge(clk); |
check("Testing correct time = 47 ns +/- 5 ns", s_time, 47 ns, 5 ns, pltbv, pltbs); |
v_expected_checks_cnt := v_expected_checks_cnt + 1; |
expected_checks_cnt <= v_expected_checks_cnt; |
s_time <= 10 us + 7 us; |
wait until rising_edge(clk); |
check("Testing incorrect time = 10 us +/- 5 us", s_time, 10 us, 5 us, pltbv, pltbs); |
v_expected_checks_cnt := v_expected_checks_cnt + 1; |
expected_checks_cnt <= v_expected_checks_cnt; |
v_expected_errors_cnt := v_expected_errors_cnt + 1; |
expected_errors_cnt <= v_expected_errors_cnt; |
print("<Done testing check() time with tolerance>"); |
|
print("<Testing check() string>"); |
s_str_exp <= string'("The quick brown fox jumps over the lazy dog."); |
s_str1 <= string'("The quick brown fox jumps over the lazy dog."); |
459,9 → 548,15
|
wait until rising_edge(clk); |
print("<Testing endsim()>"); |
print(""); |
print("Expected number of tests: " & str(v_expected_tests_cnt)); |
print("Expected number of checks: " & str(v_expected_checks_cnt)); |
print("Expected number of errors: " & str(v_expected_errors_cnt)); |
if v_expected_errors_cnt = 0 then |
print("Expected result: SUCCESS"); |
else |
print("Expected result: FAIL"); |
end if; |
wait until rising_edge(clk); |
endsim(pltbv, pltbs, true); |
wait until rising_edge(clk); |