GTS Ethernet Intel® FPGA Hard IP User Guide

ID 817676
Date 10/12/2024
Public
Document Table of Contents

8.3.1. Simulation Testbench Flow

The testbench executes the following activity for MAC with PTP enabled mode:

  1. Assert global reset (i_rst_n) to reset the GTS Ethernet Intel® FPGA Hard IP.
  2. Wait until reset acknowledgment. The o_rst_ack_n signal goes low.
  3. Deassert the global reset.
  4. Wait until o_tx_lanes_stable bit is set to 1, indicating TX path is ready.
  5. Wait until o_rx_pcs_ready bit is set to 1, indicating RX path is ready.
  6. Perform the PTP user flow until tx_ptp_ready and rx_ptp_ready signals are set to 1.
  7. Write to PTP Asymmetry Delay and peer-to-peer MeanPathDelay Avalon® memory-mapped interface registers.
  8. Reset the PTP monitor.
  9. Instruct packet client to transmit data. Write 0x1 to bit 0 of hardware packet client control hw_pc_ctrl register 0x00 to start packet generator.
  10. Read RX packet data information from 0x38 - 0x4C registers in sequential order.
    • 0x00: Set hw_pc_ctrl[6] = 1'b1 to enable snapshot bit to read the RX packet statistics.
    • 0x38/0x3C: RX start of packet counter (LSB/MSB)
    • 0x40/0x44: RX end of packet counter (LSB/MSB)
    • 0x48/0x4C: RX error counter (LSB/MSB)
    • 0x00: Set hw_pc_ctrl[6] = 1'b0 to disable snapshot bit.
  11. Read TX packet data information from 0x00 - 0x34 registers in sequential order.
    • 0x00: Set hw_pc_ctrl[6] = 1'b1 to enable snapshot bit to read the TX packet statistics.
    • 0x20/0x24: TX start of packet counter (LSB/MSB)
    • 0x28/0x2C: TX end of packet counter (LSB/MSB)
    • 0x30/0x34: TX error counter (LSB/MSB)
    • 0x00: Set hw_pc_ctrl[6] = 1'b0 to disable snapshot bit.
  12. Compare read counters to ensure 16 packets were sent and received.
  13. Instruct packet client to stop data transmission and clear the counters by writing hw_pc_ctrl[2:0]=3'b100 to stop the packet generator.
  14. Start the PTP checker.
    1. Wait until the packet transmission is complete. Poll the TX_PKT_VALID bit to monitor the transmission status.
    2. Read TX packet data information from 0x102 - 0x104 registers in sequential order, starting from the 0x102 register. The PTP monitor logic refreshes the 0x102 - 0x104 registers content to next data when read from 0x104 register.
    3. Repeat the previous step until the TX_PKT_EOP bit is set to 1 indicating the read operation reached the end of the packet.
    4. Read TX PTP command information from 0x105 - 0x10A registers in sequential order, starting from the 0x105 register. The PTP monitor logic refreshes the 0x105 - 0x10A registers content to next data when read from 0x10A register.
    5. If TX PTP command indicates a PTP packet:
      1. Wait until the TX egress timestamp is available. Use the TX_PTP_ETS_VALID signal to monitor the status.
      2. Read the TX egress timestamp from the 0x10C - 0x10F registers in sequential order, starting with the 0x10C register.
      The PTP monitor logic refreshes content of 0x10C - 0x10F registers to next data when read from the 0x10F register.
    6. Wait until the packets are looped backe in the RX data path. Poll the RX_PKT_VALID bit to monitor the transmission status.
    7. Read RX packet data information from 0x110 - 0x112 registers in sequential order, starting with the 0x110 register. The PTP monitor logic refreshes the 0x110 - 0x112 registers content to next data when read from 0x112 register.
    8. Repeat the previous step until the RX_PKT_EOP bit is set to 1 indicating the read operation reached the end of the packet.
    9. Read RX ingress timestamp.
      1. Read the RX ingress timestamp from the 0x114 - 0x116 registers in sequential order, starting with the 0x14 register. The PTP monitor logic refreshes the 0x114 - 0x116 registers content to next data when read from 0x116 register.
    10. Display the TX packet content, RX packet content, TX PTP commands, TX egress timestamp, and RX ingress timestamp information.
    11. Display the comparison information. Note that in 1-step commands, the TX/RX packets and PTP commands field content is the same.
    12. Repeat steps b through step k until the system processes all packets.
      Note: The design example simulation performs step 14 for only first six packets to reduce long simulation time.
  15. Perform Avalon® memory-mapped interface test on PTP-related registers.
    • Selective PTP Asymmetry Delay and P2P MeanPathDelay registers
    • Selective Master TOD Avalon® memory-mapped interface registers
  16. Perform Avalon® memory-mapped interface test. Write and read Ethernet IP registers.
    • 0x104: Scratch register
    • 0x108: Ethernet IP soft reset register
    • 0x214: TX MAC source address register [31:0]
    • 0x218: TX MAC source address register [47:32]
    • 0x21C: RX MAC frame size register
  17. Perform Avalon® memory-mapped interface 2 test. Write and read transceiver registers.