Components/Ethernet/IPs/MII Testbench
From UIT
|
MII Sender
The MII Sender can read a *.eth file and sends the stored packets over a 10/100Mpbs MII Interface to the Ethernet Receiver.
Inside the *.eth file several commands are possible
Command | Value1 | Value2 | Description | Example |
---|---|---|---|---|
at | integer | timebase | continue the file process at that absolut simulation time | at 1us
|
wait | integer | timebase | Wait processing the file for the given amount of time | wait 1 us
|
info | string | - | Prints string during simulation in Modelsim console | info Frame number
|
frame | data | - | Frame data to send | frame 00 01 02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E 0F
|
crc | data | - | (Optional) CRC Data if a wrong CRC should be send. If not given the CRC will be calculated automatically | crc 01020304
|
error | string | - | (Optional) Specify which error to generate (RX_ERR, RX_DV) | error RX_ERR
|
Example Frame File
Example Frame files with predefined packet can be found in the Simulation Fodler of the EDA VHDL project.
at 1 us info Correct packet frame 72 C1 14 7F 35 BC F9 EB 2C F6 wait 3 us info Wrong CRC frame 09 9D 7A 94 84 E0 48 BD 5A 54 DF F2 crc 435E14A3 wait 3 us info Frame Error RX_ERR error RX_err frame 35 26 9B 14 BB CC 0A D0 76 wait 3 us info Frame Valid RX_DV error RX_DV frame 53 96 2A 41 8C 18 41 87 B5 96 61 wait 3 us info bonjour request fpga01.local frame 01 00 5E 00 00 FB # destination MAC address 00 23 32 B1 21 52 # source MAC address 08 00 # IP Ethertype 45 00 00 3A 5F 11 00 00 FF 11 DC 98 # TTL, protocol:UDP, checksum 99 6D 05 A0 # source IP address E0 00 00 FB # destination IP address 14 E9 14 E9 # source and dest. UDP ports 00 26 10 F0 # length, checksum 00 00 00 00 00 01 00 00 00 00 00 00 06 66 70 67 61 30 31 05 6C 6F 63 61 6C 00 00 01 00 01 wait 20 us info Echo 2 192.168.111.0 frame E4 AF A1 39 02 00 # destination MAC address A0 A1 A2 A3 A4 A5 # source MAC address 08 00 # IP Ethertype 45 00 00 2A 00 00 40 00 10 11 97 75 # TTL, protocol:UDP, checksum D0 D1 D2 D3 # source IP address C0 A8 6F 00 # destination IP address 07 07 00 07 # source and dest. UDP ports 00 16 F2 93 # length, checksu 48 65 6C 6C 6F 20 77 6F 6C 64 21 0D 0A 00 wait 8 us
MII Receiver
The MII Receiver can receive ethernet packets send over the MII interface and writes them in *[Number].eth file. Each frame is stored in one file, to avoid filename conflicts, on each file a continuous number is added to the filename. the bloc itself doesn't interpret the output, it only separates the Ethernet CRC from the data.
Command | Description | Example |
---|---|---|
at | Absolute simulation time the frame was received | at 7996 ns
|
info | Continuous frame number since beginning of simulation | info frame 1
|
frame | Frame data received | frame 00 01 02 03 04 05 06 07 08 09 0A 0B 0C 0D 0E 0F
|
crc | CRC Data of the received frame | crc A6E55D6E
|
Example output file
at 7996 ns info frame 1 frame A0 A1 A2 A3 A4 A5 E4 AF A1 39 02 01 08 00 45 00 00 00 00 2A 00 00 40 00 10 11 97 74 C0 A8 6F 01 D0 D1 D2 D3 00 07 07 07 00 16 AC 73 48 65 6C 6C 6F 20 77 6F 6C 64 64 21 0D 0A 00 00 00 00 00 00 6C 64 21 20 48 65 6C 6C 4F 20 77 6F 72 6C crc A6E55D6E