URL
https://opencores.org/ocsvn/present/present/trunk
Subversion Repositories present
Compare Revisions
- This comparison shows the changes necessary to convert path
/present/trunk/PureTesting/bench
- from Rev 13 to Rev 8
- ↔ Reverse comparison
Rev 13 → Rev 8
/vhdl/ShiftRegTB.vhd
111,7 → 111,7
end process; |
|
|
-- Stimulus process |
-- Stimulus process |
stim_proc: process |
begin |
reset <= '0'; |
121,41 → 121,14
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; |
|
------------- 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; |
assert false severity failure; |
end process; |
|
END; |
END; |
/vhdl/PresentCommTB.vhd
106,10 → 106,10
stim_proc: process |
|
-- Variables |
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"; |
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"; |
|
variable line_in : line; |
variable line_content : string(1 to 8); |
124,8 → 124,6
|
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 |
/vhdl/sLayerTB.vhd
98,52 → 98,12
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; |
/vhdl/PresentTB.vhd
115,31 → 115,10
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 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"; |
-------------------------------------------------- |
|
wait for clk_period*40; |
start <= '0'; |
wait for clk_period; |
|
146,21 → 125,7
plaintext <= (others => '0'); |
key <= (others => '1'); |
start <= '1'; |
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"; |
-------------------------------------------------- |
|
wait for clk_period*40; |
start <= '0'; |
wait for clk_period; |
|
167,21 → 132,7
plaintext <= (others => '1'); |
key <= (others => '0'); |
start <= '1'; |
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"; |
-------------------------------------------------- |
|
wait for clk_period*40; |
start <= '0'; |
wait for clk_period; |
|
188,17 → 139,12
plaintext <= (others => '1'); |
key <= (others => '1'); |
start <= '1'; |
wait until ready = '1' and clk = '0'; |
wait for clk_period*40; |
start <= '0'; |
wait for clk_period; |
|
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; |
/vhdl/keyupdTB.vhd
105,75 → 105,18
wait for 100ns; |
reset <='0'; |
wait for clk_period; |
|
---- Preparation for test case 1 ----------------- |
-- key <= x"00000000000000000000"; |
-- num <= "00001"; |
-- expected_keyout <= x"c0000000000000008000"; |
-------------------------------------------------- |
|
key <= (others => '0'); |
key <= "00000000000000000000000000000000000000000000000000000000000000000000000000000000"; |
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; |