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/Decode/bench/vhdl
    from Rev 6 to Rev 10
    Reverse comparison

Rev 6 → Rev 10

/PresentFullDecoderTB.vhd
110,6 → 110,12
stim_proc: process
begin
---- Preparation for test case 1 -----------------
-- ciphertext <= x"5579c1387b228445";
-- key <= x"00000000000000000000";
-- expected_plaintext <= x"0000000000000000";
--------------------------------------------------
reset <= '1';
start <= '0';
ciphertext <= x"5579c1387b228445";
120,7 → 126,21
ciphertext <= x"5579c1387b228445";
key <= (others => '0');
start <= '1';
wait for clk_period*80;
wait until ready = '1';
 
if plaintext /= x"0000000000000000" 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 -----------------
-- ciphertext <= x"e72c46c0f5945049";
-- key <= x"ffffffffffffffffffff";
-- expected_plaintext <= x"0000000000000000";
--------------------------------------------------
start <= '0';
wait for clk_period;
127,7 → 147,21
ciphertext <= x"e72c46c0f5945049";
key <= (others => '1');
start <= '1';
wait for clk_period*80;
wait until ready = '1';
 
if plaintext /= x"0000000000000000" 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 -----------------
-- ciphertext <= x"a112ffc72f68417b";
-- key <= x"00000000000000000000";
-- expected_plaintext <= x"ffffffffffffffff";
--------------------------------------------------
start <= '0';
wait for clk_period;
134,7 → 168,21
ciphertext <= x"a112ffc72f68417b";
key <= (others => '0');
start <= '1';
wait for clk_period*80;
wait until ready = '1';
if plaintext /= x"ffffffffffffffff" 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 -----------------
-- ciphertext <= x"3333dcd3213210d2";
-- key <= x"ffffffffffffffffffff";
-- expected_plaintext <= x"ffffffffffffffff";
--------------------------------------------------
start <= '0';
wait for clk_period;
141,10 → 189,18
ciphertext <= x"3333dcd3213210d2";
key <= (others => '1');
start <= '1';
wait for clk_period*80;
wait until ready = '1';
start <= '0';
wait for clk_period;
if plaintext /= x"ffffffffffffffff" 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;
/sLayer_invTB.vhd
98,13 → 98,53
wait for 100ns;
reset <= '0';
wait for clk_period;
 
------------- Test case 1 ------------------------
-- input <= x"0";
-- expected_output <= x"5";
--------------------------------------------------
 
input <= x"0";
wait for clk_period;
if output /= x"5" then
report "RESULT MISMATCH! Test case 1 failed" severity ERROR;
assert false severity failure;
else
report "Test case 1 successful" severity note;
end if;
------------- Test case 2 ------------------------
-- input <= x"A";
-- expected_output <= x"6";
--------------------------------------------------
input <= x"A";
wait for clk_period;
if output /= x"6" then
report "RESULT MISMATCH! Test case 2 failed" severity ERROR;
assert false severity failure;
else
report "Test case 2 successful" severity note;
end if;
 
------------- Test case 3 ------------------------
-- input <= x"F";
-- expected_output <= x"A";
--------------------------------------------------
input <= x"F";
wait for clk_period;
-- insert stimulus here
if output /= x"A" 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;
 
/PresentDecTB.vhd
109,6 → 109,12
-- Stimulus process
stim_proc: process
begin
---- Preparation for test case 1 -----------------
-- plaintext <= x"5579c1387b228445";
-- key <= x"6dab31744f41d7008759";
-- expected_ciphertext <= x"0000000000000000";
--------------------------------------------------
 
reset <= '1';
start <= '0';
120,7 → 126,21
plaintext <= x"5579c1387b228445";
key <= x"6dab31744f41d7008759";
start <= '1';
wait for clk_period*40;
wait until ready = '1';
if ciphertext /= x"0000000000000000" 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"e72c46c0f5945049";
-- key <= x"fe7a548fb60eb167c511";
-- expected_ciphertext <= x"0000000000000000";
--------------------------------------------------
start <= '0';
wait for clk_period;
127,7 → 147,21
plaintext <= x"e72c46c0f5945049";
key <= x"fe7a548fb60eb167c511";
start <= '1';
wait for clk_period*40;
wait until ready = '1';
if ciphertext /= x"0000000000000000" 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"6dab31744f41d7008759";
-- expected_ciphertext <= x"ffffffffffffffff";
--------------------------------------------------
 
start <= '0';
wait for clk_period;
134,7 → 168,21
plaintext <= x"a112ffc72f68417b";
key <= x"6dab31744f41d7008759";
start <= '1';
wait for clk_period*40;
wait until ready = '1';
if ciphertext /= x"ffffffffffffffff" 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"3333dcd3213210d2";
-- key <= x"fe7a548fb60eb167c511";
-- expected_ciphertext <= x"ffffffffffffffff";
--------------------------------------------------
 
start <= '0';
wait for clk_period;
141,10 → 189,15
plaintext <= x"3333dcd3213210d2";
key <= x"fe7a548fb60eb167c511";
start <= '1';
wait for clk_period*40;
start <= '0';
wait for clk_period;
wait until ready = '1';
if ciphertext /= x"ffffffffffffffff" 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;
/keyupd_invTB.vhd
106,18 → 106,71
wait for 100ns;
reset <='0';
wait for clk_period;
key <= "00000000000000000000000000000000000000000000000000000000000000000000000000000000";
------------- Test case 1 ------------------------
-- key <= x"00000000000000000000";
-- expected_keyout <= x"c0000000000000008000";
--------------------------------------------------
key <= x"c0000000000000008000";
num <= "00001";
wait for clk_period;
key <= x"c0000000000000008000";
if keyout /= x"00000000000000000000" then
report "RESULT MISMATCH! Test case 1 failed" severity ERROR;
assert false severity failure;
else
report "Test case 1 successful" severity note;
end if;
------------- Test case 2 ------------------------
-- key <= x"c0000000000000008000";
-- expected_keyout <= x"50001800000000010000";
--------------------------------------------------
key <= x"50001800000000010000";
num <= "00010";
wait for clk_period;
key <= x"50001800000000010000";
if keyout /= x"c0000000000000008000" then
report "RESULT MISMATCH! Test case 2 failed" severity ERROR;
assert false severity failure;
else
report "Test case 2 successful" severity note;
end if;
------------- Test case 3 ------------------------
-- key <= x"60000a00030000018000";
-- expected_keyout <= x"50001800000000010000";
--------------------------------------------------
key <= x"60000a00030000018000";
num <= "00011";
wait for clk_period;
key <= x"8ba27a0eb8783ac96d59";
if keyout /= x"50001800000000010000" then
report "RESULT MISMATCH! Test case 3 failed" severity ERROR;
assert false severity failure;
else
report "Test case 3 successful" severity note;
end if;
------------- Test case 4 ------------------------
-- key <= x"8ba27a0eb8783ac96d59";
-- expected_keyout <= x"8ba27a0eb8783ac96d59";
--------------------------------------------------
key <= x"6dab31744f41d7008759";
num <= "11111";
wait for clk_period;
if keyout /= x"8ba27a0eb8783ac96d59" 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;
/PresentKeyGenTB.vhd
105,6 → 105,11
stim_proc: process
begin
 
---- Preparation for test case 1 -----------------
-- key <= x"00000000000000000000";
-- expected_key_end <= x"6dab31744f41d7008759";
--------------------------------------------------
 
reset <= '1';
start <= '0';
wait for 100 ns;
112,30 → 117,75
key <= (others => '0');
start <= '1';
wait for clk_period*40;
wait until ready = '1';
if key_end /= x"6dab31744f41d7008759" 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"ffffffffffffffffffff";
-- expected_key_end <= x"fe7a548fb60eb167c511";
--------------------------------------------------
 
start <= '0';
wait for clk_period;
key <= (others => '1');
start <= '1';
wait for clk_period*40;
wait until ready = '1';
if key_end /= x"fe7a548fb60eb167c511" 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"00000000000000000000";
-- expected_key_end <= x"6dab31744f41d7008759";
-- same as test case 1
--------------------------------------------------
start <= '0';
wait for clk_period;
 
key <= (others => '0');
start <= '1';
wait for clk_period*40;
wait until ready = '1';
if key_end /= x"6dab31744f41d7008759" 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 -----------------
-- key <= x"ffffffffffffffffffff";
-- expected_key_end <= x"fe7a548fb60eb167c511";
--------------------------------------------------
start <= '0';
wait for clk_period;
key <= (others => '1');
start <= '1';
wait for clk_period*40;
start <= '0';
wait for clk_period;
wait until ready = '1';
 
if key_end /= x"fe7a548fb60eb167c511" 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;
END;

powered by: WebSVN 2.1.0

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