GTS Transceiver PHY User Guide: Agilex™ 3 FPGAs and SoCs

ID 848344
Date 8/04/2025
Public
Document Table of Contents

6.9. Simulating the GTS PMA/FEC Direct PHY IP Dynamically Reconfigurable PHY Example Design Testbench

Follow these steps to simulate the testbench:
Figure 82. Steps to Simulate the Example Design
  1. At the command prompt, change to the testbench simulation directory <example_design/testbench>.
    cd <directphy_example_design>/example_design/testbench
  2. Run the simulation using the supported simulators by executing the simulation script file. To simulate with VCS* MX, change to the example_design/testbench directory and launch the simulation using the shell script:
    sh run_vcsmx.sh
    Note: For VCS* MX simulations, the simulator generates a synopsys/vcsmx folder upon a successful simulation run. You have to generate the simulation waveform from the synopsys/vcsmx folder.
    To run the simulation in QuestaSim* , run the following command:
    vsim -c -do run_vsim.tcl
    To run the simulation in Xcelium* , run the following command:
    sh run_xcelium.sh
    To run the simulation in Riviera-PRO* , run the following command:
    vsim -c -do run_rivierasim.do
    Note: Currently only Riviera-PRO* version 2024.04 is supported.
  3. The following steps show the simulation testbench flow for the Reconfigurable PHY example design:
    1. Wait for the DR controller bring up:
      1. Wait for the DR controller to be ready either by ensuring o_in_progress = 0 or poll stat.ready (0x70[0]) until it is 1’b1.
    2. For Base profile simulation:
      1. Assert the resets, tx_reset and rx_reset to reset the IP.
      2. Wait until resets are acknowledged, tx_reset_ack and rx_reset_ack go high.
      3. Deassert the resets, tx_reset and rx_reset.
      4. Monitor tx_ready bit is set to 1, indicating the TX path is ready.
      5. Monitor rx_ready bit is set to 1, indicating the RX path is ready.
      6. Monitor tx_pll_locked bit is set to 1, indicating TX PLL is locked to the reference clock within the PPM threshold status signal.
      7. Monitor rx_is_lockedtoref bit is set to 1, indicating the CDR is frequency locked to reference clock within the PPM threshold.
      8. Monitor rx_is_lockedtodata bit is set to 1, indicating that the CDR is in locked-to-data mode.
      9. Monitor tx_clkout_freq_valid bit is set to 1, indicating TX clock out frequency is within the upper and lower limits as expected in the definition file.
      10. Monitor rx_clkout_freq_valid bit is set to 1, indicating RX clock out frequency is within the upper and lower limits as expected in the definition file.
      11. Monitor verifier_lock bit is set to 1, indicating a lock to the RX data pattern after successfully predicting 16 consecutive patterns in RX data.
      12. Monitor verifier_error bit is not set to 1. If 1, this indicates the RX data is different than the expected result.
    3. To switch profiles:
      1. Assert the resets, tx_reset and rx_reset to reset the IP.
      2. Wait until resets are acknowledged, tx_reset_ack and rx_reset_ack go high.
      3. Configure the current profile ID and target profile ID. For example, the current profile ID is 0x1 and the target profile ID is 0x2:
        • Program the current profile to disable:
          1. next_id_cfg[0].next_id_lo (0x00[14:0]) = 0x1 (current profile)
          2. next_id_cfg[0].next_id_lo_act (0x00[15]) = 0x0 (neutral)
        • Program the target profiles to enable:
          1. next_id_cfg[0].next_id_hi (0x00[30:16]) = 0x2 (target profile)
          2. next_id_cfg[0].next_id_hi_act (0x00[31]) = 0x1 (active)
      4. Select the mode and trigger DR to start dynamic reconfiguration:
        1. Poll trigger.trigger (0x50[0]) until it is 1’b0.
        2. Wait for DR to be completed either by ensuring o_in_progress = 0 or poll stat.ready (0x70[0]) until it is 1’b1.
    4. For Secondary profile simulation:
      1. Program protocol IPs soft CSRs if required.
      2. Wait until resets are acknowledged, tx_reset_ack and rx_reset_ack go high.
      3. Deassert the resets, tx_reset and rx_reset.
      4. Monitor tx_ready bit is set to 1, indicating the TX path is ready.
      5. Monitor rx_ready bit is set to 1, indicating the RX path is ready.
      6. Monitor tx_pll_locked bit is set to 1, indicating TX PLL is locked to the reference clock within the PPM threshold status signal.
      7. Monitor rx_is_lockedtoref bit is set to 1, indicating CDR is frequency locked to reference clock within the PPM threshold.
      8. Monitor rx_is_lockedtodata bit is set to 1, indicating indicates that the CDR is in locked-to-data mode.
      9. Monitor tx_clkout_freq_valid bit is set to 1, indicating TX clock out frequency is within the upper and lower limits as expected in the definition file.
      10. Monitor rx_clkout_freq_valid bit is set to 1, indicating RX clock out frequency is within the upper and lower limits as expected in the definition file.
      11. Monitor verifier_lock bit is set to 1, indicating a lock to the RX data pattern after successfully predicting 16 consecutive patterns in RX data.
      12. Monitor verifier_error bit is not set to 1. If 1, this indicates the RX data is different than the expected result.
  4. To switch profiles use step 3. and repeat step 4.
  5. Analyze the results, a passing testbench displays the following messages in the simulation window, Test case Passed and Simulation Passed, as shown in the following figure.
    Figure 83. Sample Results for the Reconfigurable PHY Example Design Testbench