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/DecodeTesting/bench/vhdl
    from Rev 11 to Rev 7
    Reverse comparison

Rev 11 → Rev 7

/ShiftRegTB.vhd
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;
/sLayer_invTB.vhd
89,6 → 89,7
wait for clk_period/2;
end process;
 
-- Stimulus process
stim_proc: process
begin
97,52 → 98,13
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;
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;
 
/PresentFullDecoderTB.vhd
110,12 → 110,6
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";
126,21 → 120,7
ciphertext <= x"5579c1387b228445";
key <= (others => '0');
start <= '1';
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";
--------------------------------------------------
wait for clk_period*80;
start <= '0';
wait for clk_period;
147,21 → 127,7
ciphertext <= x"e72c46c0f5945049";
key <= (others => '1');
start <= '1';
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";
--------------------------------------------------
wait for clk_period*80;
start <= '0';
wait for clk_period;
168,21 → 134,7
ciphertext <= x"a112ffc72f68417b";
key <= (others => '0');
start <= '1';
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";
--------------------------------------------------
wait for clk_period*80;
start <= '0';
wait for clk_period;
189,18 → 141,10
ciphertext <= x"3333dcd3213210d2";
key <= (others => '1');
start <= '1';
wait until ready = '1';
wait for clk_period*80;
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;
/PresentDecTB.vhd
110,12 → 110,6
stim_proc: process
begin
 
---- Preparation for test case 1 -----------------
-- plaintext <= x"5579c1387b228445";
-- key <= x"6dab31744f41d7008759";
-- expected_ciphertext <= x"0000000000000000";
--------------------------------------------------
 
reset <= '1';
start <= '0';
plaintext <= x"5579c1387b228445";
126,21 → 120,7
plaintext <= x"5579c1387b228445";
key <= x"6dab31744f41d7008759";
start <= '1';
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";
--------------------------------------------------
wait for clk_period*40;
start <= '0';
wait for clk_period;
147,21 → 127,7
plaintext <= x"e72c46c0f5945049";
key <= x"fe7a548fb60eb167c511";
start <= '1';
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";
--------------------------------------------------
 
wait for clk_period*40;
start <= '0';
wait for clk_period;
168,21 → 134,7
plaintext <= x"a112ffc72f68417b";
key <= x"6dab31744f41d7008759";
start <= '1';
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";
--------------------------------------------------
 
wait for clk_period*40;
start <= '0';
wait for clk_period;
189,15 → 141,10
plaintext <= x"3333dcd3213210d2";
key <= x"fe7a548fb60eb167c511";
start <= '1';
wait until ready = '1';
wait for clk_period*40;
start <= '0';
wait for clk_period;
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,71 → 106,18
wait for 100ns;
reset <='0';
wait for clk_period;
------------- Test case 1 ------------------------
-- key <= x"00000000000000000000";
-- expected_keyout <= x"c0000000000000008000";
--------------------------------------------------
key <= x"c0000000000000008000";
key <= "00000000000000000000000000000000000000000000000000000000000000000000000000000000";
num <= "00001";
wait for clk_period;
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";
key <= x"c0000000000000008000";
num <= "00010";
wait for clk_period;
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";
key <= x"50001800000000010000";
num <= "00011";
wait for clk_period;
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";
key <= x"8ba27a0eb8783ac96d59";
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;
/PresentDecodeCommTB.vhd
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
182,7 → 180,7
DATA_RXD <= data; -- parity bit
wait for 8.75 us;
report "End of byte";
report "Koniec bajtu";
DATA_RXD <= '1'; -- stop bit
wait for 100 us;
end loop;
241,7 → 239,7
DATA_RXD <= data; -- parity bit
wait for 8.75 us;
report "End of byte";
report "Koniec bajtu";
DATA_RXD <= '1'; -- stop bit
wait for 100 us;
end loop;
303,7 → 301,7
DATA_RXD <= data; -- parity bit
wait for 8.75 us;
report "End of byte";
report "Koniec bajtu";
DATA_RXD <= '1'; -- stop bit
wait for 100 us;
end loop;
362,7 → 360,7
DATA_RXD <= data; -- parity bit
wait for 8.75 us;
report "End of byte";
report "Koniec bajtu";
DATA_RXD <= '1'; -- stop bit
wait for 100 us;
end loop;
/PresentKeyGenTB.vhd
105,11 → 105,6
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;
117,72 → 112,27
key <= (others => '0');
start <= '1';
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";
--------------------------------------------------
 
wait for clk_period*40;
start <= '0';
wait for clk_period;
key <= (others => '1');
start <= '1';
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
--------------------------------------------------
wait for clk_period*40;
start <= '0';
wait for clk_period;
 
key <= (others => '0');
start <= '1';
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";
--------------------------------------------------
wait for clk_period*40;
start <= '0';
wait for clk_period;
key <= (others => '1');
start <= '1';
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;
wait for clk_period*40;
start <= '0';
wait for clk_period;
assert false severity failure;
 

powered by: WebSVN 2.1.0

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