verify the IP filter using vhdl linked lists

Guest
IP TTL spoofed packet block implemented, design and verification, using vhdl


To verify the IP filter a reference model has to be build. Due to the DUT specific memory model, which allows any memory size (first packets to arrive are stored and served), the exact timing of DUT analysis is hardly predictable. Cycle accurate verification models are not good practice anyways.
Therefore an easy way to implement the reference model is to use some sort of lists.


At work, using c++ and DPI, I have a lot of flexibility of STL containers, vector, double ended queue, list etc... Where speed is traded with access features.
This project is coded, design and verification, using only VHDL. So I decided to use VHDL linked list feature.


--scorebaord item (IPV4)
type scbd_item;
type scbd_item_ptr is access scbd_item; -- pointer to item
type scbd_item is record -- full definition of item
--ignore flag if a packet starts and DUT is in freeze mode, ignore that packet
ignore : boolean;
ttl : std_logic_vector( 7 downto 0); --ttl
ips : std_logic_vector(31 downto 0); --source ip
cnt : std_logic_vector( 3 downto 0); --count
learning : boolean;
pkt_in_t : time; --packet in time (debug)
next_rec : scbd_item_ptr;
end record;

....

if(scbd_start) then --add to scoreboard
if(scbd_first) then
new_sbd.learning := true;
new_sbd.cnt := (others =>gt; '0');
scbd_ptr := new_sbd;
scbd_first := false;
else
tmp_ptr := scbd_ptr;
scbd_found := false;
scbd_loop := true;
while(scbd_loop) loop --find last
--check if this ip was stored before
if(not scbd_found) then
if(new_sbd.ips = tmp_ptr.ips) then
scbd_found := true;


Please take a look at the link and give comments.

http://bknpk.no-ip.biz/my_web/SDIO/ip_ttl_filter_main.html
 

Welcome to EDABoard.com

Sponsor

Back
Top