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

Subversion Repositories present

Compare Revisions

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

Rev 12 → Rev 13

/trunk/PureTesting/bench/vhdl/ShiftRegTB.vhd
111,7 → 111,7
end process;
 
-- Stimulus process
-- Stimulus process
stim_proc: process
begin
reset <= '0';
121,14 → 121,41
wait for 100 ns;
reset <= '1';
wait for clk_period*10;
reset <= '0';
en <= '1';
wait for clk_period*1;
en <= '0';
wait for clk_period*1;
 
------------- Test case 1 ------------------------
-- expected_output <= x"aa00000000000000";
--------------------------------------------------
if output /= x"aa00000000000000" then
report "RESULT MISMATCH! Test case 1 failed" severity ERROR;
assert false severity failure;
else
report "Test case 1 successful" severity note;
end if;
shift <= '1';
wait for clk_period*10;
assert false severity failure;
------------- Test case 2 ------------------------
-- expected_output <= x"002a800000000000";
--------------------------------------------------
if output /= x"002a800000000000" then
report "RESULT MISMATCH! Test case 2 failed" severity ERROR;
assert false severity failure;
else
report "Test case 2 successful" severity note;
end if;
assert false severity failure;
end process;
 
END;
END;
/trunk/PureTesting/bench/vhdl/PresentCommTB.vhd
106,10 → 106,10
stim_proc: process
-- Variables
file txt :text is in "../src/test/data.txt";
file key :text is in "../src/test/key.txt";
file txt2 :text is in "../src/test/data2.txt";
file key2 :text is in "../src/test/key2.txt";
file txt :text is in "./test/data.txt";
file key :text is in "./test/key.txt";
file txt2 :text is in "./test/data2.txt";
file key2 :text is in "./test/key2.txt";
variable line_in : line;
variable line_content : string(1 to 8);
124,6 → 124,8
wait for CLK_period*10;
 
-- All data are sent in direction from LSB to MSB
 
-- Reading first 'data' file each "segment" is one bit of serial data
while not (endfile(txt)) loop
readline(txt, line_in); -- info line
/trunk/PureTesting/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;
/trunk/PureTesting/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"ffffffffffffffff";
-- key <= x"00000000000000000000";
-- expected_ciphertext <= x"a112ffc72f68417b";
--------------------------------------------------
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,12 → 188,17
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;
 
END;
END;
/trunk/PureTesting/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.