OpenCores
URL https://opencores.org/ocsvn/present/present/trunk

Subversion Repositories present

Compare Revisions

  • This comparison shows the changes necessary to convert path
    /present/trunk
    from Rev 11 to Rev 12
    Reverse comparison

Rev 11 → Rev 12

/Pure/bench/vhdl/sLayerTB.vhd
98,12 → 98,52
wait for 100ns;
reset <= '0';
wait for clk_period;
---- Preparation for test case 1 -----------------
-- inpput <= x"0";
-- expected_output <= x"";
--------------------------------------------------
input <= x"0";
wait for clk_period;
 
if output /= x"C" then
report "RESULT MISMATCH! Test case 1 failed" severity ERROR;
assert false severity failure;
else
report "Test case 1 successful" severity note;
end if;
 
---- Preparation for test case 2 -----------------
-- inpput <= x"0";
-- expected_output <= x"";
--------------------------------------------------
input <= x"A";
wait for clk_period;
 
if output /= x"F" then
report "RESULT MISMATCH! Test case 2 failed" severity ERROR;
assert false severity failure;
else
report "Test case 2 successful" severity note;
end if;
 
---- Preparation for test case 3 -----------------
-- inpput <= x"0";
-- expected_output <= x"";
--------------------------------------------------
input <= x"F";
wait for clk_period;
if output /= x"2" then
report "RESULT MISMATCH! Test case 3 failed" severity ERROR;
assert false severity failure;
else
report "Test case 3 successful" severity note;
end if;
-- insert stimulus here
assert false severity failure;
end process;
/Pure/bench/vhdl/PresentTB.vhd
115,10 → 115,31
wait for 100 ns;
reset <= '0';
---- Preparation for test case 1 -----------------
-- plaintext <= x"0000000000000000";
-- key <= x"00000000000000000000";
-- expected_ciphertext <= x"5579c1387b228445";
--------------------------------------------------
 
plaintext <= (others => '0');
key <= (others => '0');
start <= '1';
wait for clk_period*40;
wait until ready = '1' and clk = '0';
if ciphertext /= x"5579c1387b228445" then
report "RESULT MISMATCH! Test case 1 failed" severity ERROR;
assert false severity failure;
else
report "Test case 1 successful" severity note;
end if;
---- Preparation for test case 2 -----------------
-- plaintext <= x"0000000000000000";
-- key <= x"ffffffffffffffffffff";
-- expected_ciphertext <= x"e72c46c0f5945049";
--------------------------------------------------
start <= '0';
wait for clk_period;
125,7 → 146,21
plaintext <= (others => '0');
key <= (others => '1');
start <= '1';
wait for clk_period*40;
wait until ready = '1' and clk = '0';
if ciphertext /= x"e72c46c0f5945049" then
report "RESULT MISMATCH! Test case 2 failed" severity ERROR;
assert false severity failure;
else
report "Test case 2 successful" severity note;
end if;
 
---- Preparation for test case 3 -----------------
-- plaintext <= x"a112ffc72f68417b";
-- key <= x"00000000000000000000";
-- expected_ciphertext <= x"ffffffffffffffff";
--------------------------------------------------
start <= '0';
wait for clk_period;
132,7 → 167,21
plaintext <= (others => '1');
key <= (others => '0');
start <= '1';
wait for clk_period*40;
wait until ready = '1' and clk = '0';
if ciphertext /= x"a112ffc72f68417b" then
report "RESULT MISMATCH! Test case 3 failed" severity ERROR;
assert false severity failure;
else
report "Test case 3 successful" severity note;
end if;
 
---- Preparation for test case 4 -----------------
-- plaintext <= x"ffffffffffffffff";
-- key <= x"ffffffffffffffffffff";
-- expected_ciphertext <= x"3333dcd3213210d2";
--------------------------------------------------
start <= '0';
wait for clk_period;
139,10 → 188,15
plaintext <= (others => '1');
key <= (others => '1');
start <= '1';
wait for clk_period*40;
start <= '0';
wait for clk_period;
wait until ready = '1' and clk = '0';
if ciphertext /= x"3333dcd3213210d2" then
report "RESULT MISMATCH! Test case 4 failed" severity ERROR;
assert false severity failure;
else
report "Test case 4 successful" severity note;
end if;
assert false severity failure;
 
end process;
/Pure/bench/vhdl/keyupdTB.vhd
105,18 → 105,75
wait for 100ns;
reset <='0';
wait for clk_period;
key <= "00000000000000000000000000000000000000000000000000000000000000000000000000000000";
---- Preparation for test case 1 -----------------
-- key <= x"00000000000000000000";
-- num <= "00001";
-- expected_keyout <= x"c0000000000000008000";
--------------------------------------------------
key <= (others => '0');
num <= "00001";
wait for clk_period;
if keyout /= x"c0000000000000008000" then
report "RESULT MISMATCH! Test case 1 failed" severity ERROR;
assert false severity failure;
else
report "Test case 1 successful" severity note;
end if;
---- Preparation for test case 2 -----------------
-- key <= x"c0000000000000008000";
-- num <= "00010";
-- expected_keyout <= x"50001800000000010000";
--------------------------------------------------
key <= x"c0000000000000008000";
num <= "00010";
wait for clk_period;
if keyout /= x"50001800000000010000" then
report "RESULT MISMATCH! Test case 2 failed" severity ERROR;
assert false severity failure;
else
report "Test case 2 successful" severity note;
end if;
---- Preparation for test case 3 -----------------
-- key <= x"50001800000000010000";
-- num <= "00011";
-- expected_keyout <= x"60000a00030000018000";
--------------------------------------------------
key <= x"50001800000000010000";
num <= "00011";
wait for clk_period;
 
if keyout /= x"60000a00030000018000" then
report "RESULT MISMATCH! Test case 3 failed" severity ERROR;
assert false severity failure;
else
report "Test case 3 successful" severity note;
end if;
key <= x"8ba27a0eb8783ac96d59";
num <= "11111";
wait for clk_period;
---- Preparation for test case 4 -----------------
-- key <= x"8ba27a0eb8783ac96d59";
-- num <= "11111";
-- expected_keyout <= x"6dab31744f41d7008759";
--------------------------------------------------
if keyout /= x"6dab31744f41d7008759" then
report "RESULT MISMATCH! Test case 4 failed" severity ERROR;
assert false severity failure;
else
report "Test case 4 successful" severity note;
end if;
assert false severity failure;
end process;
END;

powered by: WebSVN 2.1.0

© copyright 1999-2024 OpenCores.org, equivalent to Oliscience, all rights reserved. OpenCores®, registered trademark.