F-Tile Ethernet Intel® FPGA Hard IP Design Example User Guide

ID 683804
Date 10/11/2021
Public

A newer version of this document is available. Customers should click here to go to the newest version.

Document Table of Contents

4.3. Simulation

The testbench provides basic functionality such as the startup and waits for lock and send and receive a few packets using the ROM-based packet generator.
Important: Before the simulation, you must generate tile-related files described in Generating Tile Files and specify the location assignment in the .qsf file for successful simulation.
For selected OPN, aside from updating the .qsf assignments for your device, you must update the tile location in the example_testbench/basic_avl_tb_top.sv test bench file with the F-tile location for the selected OPN.
`define QUARTUS_TOP_LEVEL_ENTITY_INSTANCE_PATH eth_f_hw_tiles.<tile_location>
Then, you must also update the .qsf file to include both the F-Tile Auto-Negotiation and Link Training for Ethernet Intel® FPGA IP and the F-Tile Ethernet Intel FPGA Hard IP, instance to the same tile location as shown below:
set_instance_assigment -name IP_TILE_ASSIGNMENT <tile_location> -to <Ethernet IP INSTANCE>
set_instance_assigment -name IP_TILE_ASSIGNMENT <tile_location> -to <ANLT IP INSTANCE>
To find the tile location, in the Intel® Quartus® Prime software window, select Tools > Chip Planner and use the appropriate tile location as shown in the figure.
Figure 13. Chip Planner: Tile Location for the Selected OPN
For example, if you selected the AGIA027R29A1E2VR0 ordering part number (OPN), the .qsf assignments are defined in QSF Assignments. The following example depicts the selection of the Z1577A_X0_Y0_N0 tile location in the AGIA027R29A1E2VR0 ordering part number (OPN):
`define QUARTUS_TOP_LEVEL_ENTITY_INSTANCE_PATH eth_f_hw_tiles.z1577a_x0_y0_n0
set_instance_assigment -name IP_TILE_ASSIGNMENT Z1577A_X0_Y0_N0 -to IP_INST[0].hw_ip_top|dut
set_instance_assignment -name IP_TILE_ASSIGNMENT Z1577A_X0_Y0_N0 -to kr_dut
Important: If you use a different OPN, you must update your F-tile location for the selected OPN.

Figure 14.  F-Tile Ethernet Intel FPGA Hard IP Simulation Design Example Block Diagram with Enabled Auto-Negotiation and Link Training
The following steps show the simulation testbench flow:
  1. Assert global resets (i_rst_n and i_reconfig_rst) to reset the F-Tile Ethernet Intel FPGA Hard IP and F-Tile Auto-Negotiation and Link Training for Ethernet Intel® FPGA IP.
  2. Wait until configuration settings load.
  3. Wait until resets acknowledgment. The o_rst_ack_n signal goes low.
  4. Deasserts the global resets, i_rst_n and i_reconfig_rst.
  5. Reconfigure PLL for an auto-negotiation frequency by setting set_base_freq for the selected Ethernet variant.
  6. Wait until auto-negotiation is complete. The data mode begins.
  7. Reconfigure PLL for link training frequency by setting set_base_freq for the selected Ethernet variant.
  8. Wait until link training is complete.
  9. Wait until o_tx_lanes_stable bit is set to 1, indicating TX path is ready.
  10. Wait until o_rx_pcs_ready bit is set to 1, indicating RX path is ready.
  11. Instruct packet client to transmit data. Write hw_pc_ctrl[0]=1'b1 to start the packet generator.
  12. Read TX packet data information from 0x20 - 0x34 registers. Read register in sequencial order.
  13. Read RX packet data information from 0x38 - 0x4C registers. Read register in sequencial order.
  14. Compare the counters to ensure 16 packets were sent and received.
  15. Instruct packet client to stop data transmission. Write hw_pc_ctrl[2:0]=3'b100 to stop the packet generator. Clear counters.
  16. Perform Avalon® memory-mapped interface test. Write and read Ethernet IP registers.
    • 0x104: Scratch register
    • 0x108: IP soft reset register
    • 0x214: TX MAX source address register [31:0]
    • 0x218: TX MAX source address register [47:32]
    • 0x21C: RX MAX frame size register
  17. Perform Avalon® memory-mapped interface 2 test to read and write operation transceiver registers.
The following sample output illustrates a successful simulation test run.

---TX reset sequence completed -----
---RX reset sequence completed -----
---Starting Data mode after completing AN ----
---IP_INST[ 0] Test    0;   ---Total     16 packets to send-----
------IP_INST[ 0] Start pkt gen TX-----
------Checking Packet TX/RX result-----
------------  16 packets Sent;     0 packets Received--------
------ALL   16  packets Sent out---
------------  16 packets Sent;    16 packets Received--------
------ALL   16  packets Received---
------TX/RX packet check OK---
****Starting AVMM Read/Write****
====>MATCH!     ReaddataValid = 1 Readdata = abcdef01 Expected_Readdata = abcdef01 
====>MATCH!     ReaddataValid = 1 Readdata = 00000007 Expected_Readdata = 00000007 
====>MATCH!     ReaddataValid = 1 Readdata = 00000000 Expected_Readdata = 00000000 
====>MATCH!     ReaddataValid = 1 Readdata = 9d228c3a Expected_Readdata = 9d228c3a 
====>MATCH!     ReaddataValid = 1 Readdata = 4338b586 Expected_Readdata = 4338b586 
====>MATCH!     ReaddataValid = 1 Readdata = deadc0de Expected_Readdata = deadc0de 
====>MATCH!     ReaddataValid = 1 Readdata = deadc0de Expected_Readdata = deadc0de 
====>MATCH!     ReaddataValid = 1 Readdata = 00000000 Expected_Readdata = 00000000 
====>MATCH!     ReaddataValid = 1 Readdata = 22334455 Expected_Readdata = 22334455 
====>MATCH!     ReaddataValid = 1 Readdata = 00000011 Expected_Readdata = 00000011 
====>MATCH!     ReaddataValid = 1 Readdata = 000005ee Expected_Readdata = 000005ee 
====>MATCH!     ReaddataValid = 1 Readdata = 01234567 Expected_Readdata = 01234567 
====>MATCH!     ReaddataValid = 1 Readdata = 000089ab Expected_Readdata = 000089ab 
743830ns  Try to access AVMM2 begin...
743830ns  write 0x00000065 to xcvr  0 address 0x103c004
744795ns  Try to access AVMM2 end...
744890ns  read from address 0x103c004
====>MATCH!     ReaddataValid = 1 Readdata = 00000065 Expected_Readdata = 00000065 

...

758740ns  Try to access AVMM2 end...
758840ns  Try to access AVMM2 begin...
758840ns  write 0x0000006c to xcvr  7 address 0x103c00b
759825ns  Try to access AVMM2 end...
759920ns  read from address 0x103c00b
====>MATCH!     ReaddataValid = 1 Readdata = 0000006c Expected_Readdata = 0000006c 
760900ns  Try to access AVMM2 end...
**** AVMM Read/Write Operation Completed for IP_INST[ 0]****
** Testbench complete
**
Note: The simulation completion may take a longer time. To confirm the simulation is progressing successfully, verify the intermediate outputs from the System Console such as bringing the base and AN/LT IP out of resets, IP resetting sequence, Auto-negotiation and link training auto-connection completion, and others.