![]() |
Network Wizard for VHDL Test Benches
|
The UDP library provides functions for creating and manipulation UDP packets.
More details in nw_udpv4_pkg
Include the libraries:
Assume the variable v_payload contains the UDP payload. The variables are defined:
First setup the header, then calculate the total UDP packet length before creating the packet. Checksum is optional for UDP over IPv4. Here it will be set to x"0000".
If checksum is desired, the IPv4 header must be supplied for the pseudo header:
The variable v_udp_pkt is an 8-bit array. This can of course be rearranged to any word width with f_repack .
See further examples in the test bench nw_ipv4_tb.vhd.