Line 118... |
Line 118... |
read_req.req <= '1';
|
read_req.req <= '1';
|
wait for clk_period*4;
|
wait for clk_period*4;
|
assert read_result.status = NOT_FOUND report "T1: expected NOT_FOUND";
|
assert read_result.status = NOT_FOUND report "T1: expected NOT_FOUND";
|
wait for clk_period;
|
wait for clk_period;
|
read_req.req <= '0';
|
read_req.req <= '0';
|
wait for clk_period;
|
wait for clk_period*2;
|
assert read_result.status = IDLE report "T1: expected IDLE";
|
assert read_result.status = IDLE report "T1: expected IDLE";
|
assert entry_count = x"00" report "T1: wrong entry count";
|
assert entry_count = x"00" report "T1: wrong entry count";
|
|
|
report "T2 - insert first entry into store";
|
report "T2 - insert first entry into store";
|
write_req.entry.ip <= x"12345678";
|
write_req.entry.ip <= x"12345678";
|
Line 142... |
Line 142... |
assert read_result.status = FOUND report "T3: expected FOUND";
|
assert read_result.status = FOUND report "T3: expected FOUND";
|
assert read_result.entry.ip = x"12345678" report "T3: wrong ip addr";
|
assert read_result.entry.ip = x"12345678" report "T3: wrong ip addr";
|
assert read_result.entry.mac = x"002398127645" report "T3: wrong mac addr";
|
assert read_result.entry.mac = x"002398127645" report "T3: wrong mac addr";
|
wait for clk_period;
|
wait for clk_period;
|
read_req.req <= '0';
|
read_req.req <= '0';
|
wait for clk_period*2;
|
wait for clk_period*3;
|
assert read_result.status = IDLE report "T3: expected IDLE";
|
assert read_result.status = IDLE report "T3: expected IDLE";
|
|
|
report "T4 - check unable to find missing entry with one entry in store";
|
report "T4 - check unable to find missing entry with one entry in store";
|
read_req.ip <= x"12345679";
|
read_req.ip <= x"12345679";
|
read_req.req <= '1';
|
read_req.req <= '1';
|
wait until read_result.status = FOUND or read_result.status = NOT_FOUND;
|
wait until read_result.status = FOUND or read_result.status = NOT_FOUND;
|
wait for clk_period;
|
wait for clk_period;
|
assert read_result.status = NOT_FOUND report "T4: expected NOT_FOUND";
|
assert read_result.status = NOT_FOUND report "T4: expected NOT_FOUND";
|
wait for clk_period;
|
wait for clk_period;
|
read_req.req <= '0';
|
read_req.req <= '0';
|
wait for clk_period*2;
|
wait for clk_period*3;
|
assert read_result.status = IDLE report "T4: expected IDLE";
|
assert read_result.status = IDLE report "T4: expected IDLE";
|
|
|
report "T5 - insert 2nd entry into store and check can find both entries";
|
report "T5 - insert 2nd entry into store and check can find both entries";
|
write_req.entry.ip <= x"12345679";
|
write_req.entry.ip <= x"12345679";
|
write_req.entry.mac <= x"101202303404";
|
write_req.entry.mac <= x"101202303404";
|
Line 173... |
Line 173... |
wait for clk_period;
|
wait for clk_period;
|
assert read_result.status = FOUND report "T5.1: expected FOUND";
|
assert read_result.status = FOUND report "T5.1: expected FOUND";
|
assert read_result.entry.ip = x"12345678" report "T5.1: wrong ip addr";
|
assert read_result.entry.ip = x"12345678" report "T5.1: wrong ip addr";
|
assert read_result.entry.mac = x"002398127645" report "T5.1: wrong mac addr";
|
assert read_result.entry.mac = x"002398127645" report "T5.1: wrong mac addr";
|
read_req.req <= '0';
|
read_req.req <= '0';
|
wait for clk_period*2;
|
wait for clk_period*3;
|
assert read_result.status = IDLE report "T5.1: expected IDLE";
|
assert read_result.status = IDLE report "T5.1: expected IDLE";
|
read_req.ip <= x"12345679";
|
read_req.ip <= x"12345679";
|
read_req.req <= '1';
|
read_req.req <= '1';
|
wait until read_result.status = FOUND or read_result.status = NOT_FOUND;
|
wait until read_result.status = FOUND or read_result.status = NOT_FOUND;
|
wait for clk_period;
|
wait for clk_period;
|
assert read_result.status = FOUND report "T5.2: expected FOUND";
|
assert read_result.status = FOUND report "T5.2: expected FOUND";
|
assert read_result.entry.ip = x"12345679" report "T5.2: wrong ip addr";
|
assert read_result.entry.ip = x"12345679" report "T5.2: wrong ip addr";
|
assert read_result.entry.mac = x"101202303404" report "T5.2: wrong mac addr";
|
assert read_result.entry.mac = x"101202303404" report "T5.2: wrong mac addr";
|
read_req.req <= '0';
|
read_req.req <= '0';
|
wait for clk_period*2;
|
wait for clk_period*3;
|
assert read_result.status = IDLE report "T5.2: expected IDLE";
|
assert read_result.status = IDLE report "T5.2: expected IDLE";
|
|
|
report "T6 - insert 2 more entries so that the store is full. check can find all";
|
report "T6 - insert 2 more entries so that the store is full. check can find all";
|
write_req.entry.ip <= x"1234567a";
|
write_req.entry.ip <= x"1234567a";
|
write_req.entry.mac <= x"10120230340a";
|
write_req.entry.mac <= x"10120230340a";
|
Line 210... |
Line 210... |
wait for clk_period;
|
wait for clk_period;
|
assert read_result.status = FOUND report "T6.1: expected FOUND";
|
assert read_result.status = FOUND report "T6.1: expected FOUND";
|
assert read_result.entry.ip = x"12345678" report "T6.1: wrong ip addr";
|
assert read_result.entry.ip = x"12345678" report "T6.1: wrong ip addr";
|
assert read_result.entry.mac = x"002398127645" report "T6.1: wrong mac addr";
|
assert read_result.entry.mac = x"002398127645" report "T6.1: wrong mac addr";
|
read_req.req <= '0';
|
read_req.req <= '0';
|
wait for clk_period*2;
|
wait for clk_period*3;
|
assert read_result.status = IDLE report "T6.1: expected IDLE";
|
assert read_result.status = IDLE report "T6.1: expected IDLE";
|
read_req.ip <= x"12345679";
|
read_req.ip <= x"12345679";
|
read_req.req <= '1';
|
read_req.req <= '1';
|
wait until read_result.status = FOUND or read_result.status = NOT_FOUND;
|
wait until read_result.status = FOUND or read_result.status = NOT_FOUND;
|
wait for clk_period;
|
wait for clk_period;
|
assert read_result.status = FOUND report "T6.2: expected FOUND";
|
assert read_result.status = FOUND report "T6.2: expected FOUND";
|
assert read_result.entry.ip = x"12345679" report "T6.2: wrong ip addr";
|
assert read_result.entry.ip = x"12345679" report "T6.2: wrong ip addr";
|
assert read_result.entry.mac = x"101202303404" report "T6.2: wrong mac addr";
|
assert read_result.entry.mac = x"101202303404" report "T6.2: wrong mac addr";
|
read_req.req <= '0';
|
read_req.req <= '0';
|
wait for clk_period*2;
|
wait for clk_period*3;
|
assert read_result.status = IDLE report "T6.2: expected IDLE";
|
assert read_result.status = IDLE report "T6.2: expected IDLE";
|
read_req.ip <= x"1234567a";
|
read_req.ip <= x"1234567a";
|
read_req.req <= '1';
|
read_req.req <= '1';
|
wait until read_result.status = FOUND or read_result.status = NOT_FOUND;
|
wait until read_result.status = FOUND or read_result.status = NOT_FOUND;
|
wait for clk_period;
|
wait for clk_period;
|
assert read_result.status = FOUND report "T6.3: expected FOUND";
|
assert read_result.status = FOUND report "T6.3: expected FOUND";
|
assert read_result.entry.ip = x"1234567a" report "T6.3: wrong ip addr";
|
assert read_result.entry.ip = x"1234567a" report "T6.3: wrong ip addr";
|
assert read_result.entry.mac = x"10120230340a" report "T6.3: wrong mac addr";
|
assert read_result.entry.mac = x"10120230340a" report "T6.3: wrong mac addr";
|
read_req.req <= '0';
|
read_req.req <= '0';
|
wait for clk_period*2;
|
wait for clk_period*3;
|
assert read_result.status = IDLE report "T6.3: expected IDLE";
|
assert read_result.status = IDLE report "T6.3: expected IDLE";
|
read_req.ip <= x"1234567b";
|
read_req.ip <= x"1234567b";
|
read_req.req <= '1';
|
read_req.req <= '1';
|
wait until read_result.status = FOUND or read_result.status = NOT_FOUND;
|
wait until read_result.status = FOUND or read_result.status = NOT_FOUND;
|
wait for clk_period;
|
wait for clk_period;
|
assert read_result.status = FOUND report "T6.4: expected FOUND";
|
assert read_result.status = FOUND report "T6.4: expected FOUND";
|
assert read_result.entry.ip = x"1234567b" report "T6.4: wrong ip addr";
|
assert read_result.entry.ip = x"1234567b" report "T6.4: wrong ip addr";
|
assert read_result.entry.mac = x"10120230340b" report "T6.4: wrong mac addr";
|
assert read_result.entry.mac = x"10120230340b" report "T6.4: wrong mac addr";
|
read_req.req <= '0';
|
read_req.req <= '0';
|
wait for clk_period*2;
|
wait for clk_period*3;
|
assert read_result.status = IDLE report "T6.4: expected IDLE";
|
assert read_result.status = IDLE report "T6.4: expected IDLE";
|
|
|
report "T7 - with store full, check that we dont find missing item";
|
report "T7 - with store full, check that we dont find missing item";
|
read_req.ip <= x"1233367b";
|
read_req.ip <= x"1233367b";
|
read_req.req <= '1';
|
read_req.req <= '1';
|
wait until read_result.status = FOUND or read_result.status = NOT_FOUND;
|
wait until read_result.status = FOUND or read_result.status = NOT_FOUND;
|
wait for clk_period;
|
wait for clk_period;
|
assert read_result.status = NOT_FOUND report "T7: expected NOT_FOUND";
|
assert read_result.status = NOT_FOUND report "T7: expected NOT_FOUND";
|
read_req.req <= '0';
|
read_req.req <= '0';
|
wait for clk_period*2;
|
wait for clk_period*3;
|
assert read_result.status = IDLE report "T7: expected IDLE";
|
assert read_result.status = IDLE report "T7: expected IDLE";
|
|
|
report "T8 - insert additional entry into store - will erase one of the others";
|
report "T8 - insert additional entry into store - will erase one of the others";
|
write_req.entry.ip <= x"12345699";
|
write_req.entry.ip <= x"12345699";
|
write_req.entry.mac <= x"992398127699";
|
write_req.entry.mac <= x"992398127699";
|
Line 270... |
Line 270... |
wait for clk_period;
|
wait for clk_period;
|
assert read_result.status = FOUND report "T8: expected FOUND";
|
assert read_result.status = FOUND report "T8: expected FOUND";
|
assert read_result.entry.ip = x"12345699" report "T8: wrong ip addr";
|
assert read_result.entry.ip = x"12345699" report "T8: wrong ip addr";
|
assert read_result.entry.mac = x"992398127699" report "T8: wrong mac addr";
|
assert read_result.entry.mac = x"992398127699" report "T8: wrong mac addr";
|
read_req.req <= '0';
|
read_req.req <= '0';
|
wait for clk_period*2;
|
wait for clk_period*3;
|
assert read_result.status = IDLE report "T8: expected IDLE";
|
assert read_result.status = IDLE report "T8: expected IDLE";
|
|
|
report "T9 - clear the store and ensure cant find something that was there";
|
report "T9 - clear the store and ensure cant find something that was there";
|
clear_store <= '1';
|
clear_store <= '1';
|
wait for clk_period;
|
wait for clk_period;
|
Line 285... |
Line 285... |
read_req.req <= '1';
|
read_req.req <= '1';
|
wait until read_result.status = FOUND or read_result.status = NOT_FOUND;
|
wait until read_result.status = FOUND or read_result.status = NOT_FOUND;
|
wait for clk_period;
|
wait for clk_period;
|
assert read_result.status = NOT_FOUND report "T9: expected NOT_FOUND";
|
assert read_result.status = NOT_FOUND report "T9: expected NOT_FOUND";
|
read_req.req <= '0';
|
read_req.req <= '0';
|
wait for clk_period*2;
|
wait for clk_period*3;
|
assert read_result.status = IDLE report "T9: expected IDLE";
|
assert read_result.status = IDLE report "T9: expected IDLE";
|
|
|
report "T10 - refill the store with three entries";
|
report "T10 - refill the store with three entries";
|
write_req.entry.ip <= x"12345675";
|
write_req.entry.ip <= x"12345675";
|
write_req.entry.mac <= x"10120230340a";
|
write_req.entry.mac <= x"10120230340a";
|
Line 321... |
Line 321... |
wait for clk_period;
|
wait for clk_period;
|
assert read_result.status = FOUND report "T11.1: expected FOUND";
|
assert read_result.status = FOUND report "T11.1: expected FOUND";
|
assert read_result.entry.ip = x"12345676" report "T11.1: wrong ip addr";
|
assert read_result.entry.ip = x"12345676" report "T11.1: wrong ip addr";
|
assert read_result.entry.mac = x"10120230340b" report "T11.1: wrong mac addr";
|
assert read_result.entry.mac = x"10120230340b" report "T11.1: wrong mac addr";
|
read_req.req <= '0';
|
read_req.req <= '0';
|
wait for clk_period*2;
|
wait for clk_period*3;
|
assert read_result.status = IDLE report "T11.1: expected IDLE";
|
assert read_result.status = IDLE report "T11.1: expected IDLE";
|
write_req.entry.ip <= x"12345676";
|
write_req.entry.ip <= x"12345676";
|
write_req.entry.mac <= x"10120990340b";
|
write_req.entry.mac <= x"10120990340b";
|
write_req.req <= '1';
|
write_req.req <= '1';
|
wait for clk_period;
|
wait for clk_period;
|
Line 338... |
Line 338... |
wait for clk_period;
|
wait for clk_period;
|
assert read_result.status = FOUND report "T11.2: expected FOUND";
|
assert read_result.status = FOUND report "T11.2: expected FOUND";
|
assert read_result.entry.ip = x"12345676" report "T11.2: wrong ip addr";
|
assert read_result.entry.ip = x"12345676" report "T11.2: wrong ip addr";
|
assert read_result.entry.mac = x"10120990340b" report "T11.2: wrong mac addr";
|
assert read_result.entry.mac = x"10120990340b" report "T11.2: wrong mac addr";
|
read_req.req <= '0';
|
read_req.req <= '0';
|
wait for clk_period*2;
|
wait for clk_period*3;
|
assert read_result.status = IDLE report "T11.2: expected IDLE";
|
assert read_result.status = IDLE report "T11.2: expected IDLE";
|
|
|
report "T12 - check 2nd write at beginning";
|
report "T12 - check 2nd write at beginning";
|
-- clear store, write 1st entry, overwrite the entry, and check
|
-- clear store, write 1st entry, overwrite the entry, and check
|
clear_store <= '1';
|
clear_store <= '1';
|
Line 372... |
Line 372... |
wait for clk_period;
|
wait for clk_period;
|
assert read_result.status = FOUND report "T12.4: expected FOUND";
|
assert read_result.status = FOUND report "T12.4: expected FOUND";
|
assert read_result.entry.ip = x"12345678" report "T12.4: wrong ip addr";
|
assert read_result.entry.ip = x"12345678" report "T12.4: wrong ip addr";
|
assert read_result.entry.mac = x"002398127647" report "T12.4: wrong mac addr";
|
assert read_result.entry.mac = x"002398127647" report "T12.4: wrong mac addr";
|
read_req.req <= '0';
|
read_req.req <= '0';
|
wait for clk_period*2;
|
wait for clk_period*3;
|
assert read_result.status = IDLE report "T12.5: expected IDLE";
|
assert read_result.status = IDLE report "T12.5: expected IDLE";
|
|
|
report "--- end of tests ---";
|
report "--- end of tests ---";
|
wait;
|
wait;
|
end process;
|
end process;
|