External Memory Interfaces Intel® Agilex™ FPGA IP User Guide

ID 683216
Date 12/19/2022
Public

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

Document Table of Contents

11.9.8.2. Claiming/Releasing the TG Config Interface

Before using the Traffic Generator (TG2) interface, you must claim the service to the TG Config interface. All the tabs in the traffic generator interface are disabled until you claim the service.

Graphical User Interface (GUI) Method

To claim the TG Config service, click CLAIM TG CONFIG INTERFACE. The tabs are enabled after you claim the service successfully.

Figure 228. Click CLAIM TG CONFIG INTERFACE Before Using the TG2 Interface

After you are finished using the TG2 interface, click RELEASE TG CONFIG INTERFACE to release the service instance and direct the System Console to make the resource available to other users.

Figure 229. Click RELEASE TG CONFIG INTERFACE to Release the Service for Other Users

Scripting Method

If you are writing your own script to access the traffic generator, you must claim the TG Config service. Refer to the example below for claiming and releasing the service.

The following is the service path for the TG2 traffic generator:

*/alt_sld_fab_0_alt_sld_fab_0_host_link_jtag.h2t/alt_sld_fab_0_alt_sld_fab_0_stfabric.h2t_0/alt_sld_fab_0_alt_sld_fab_0_memfabric_transacto.avalon_master/master_1_0.slave

Example code to claim and release the TG2 service:

#Example Code to claim/release the TG2 service 
#Check for available service paths.
set service_paths [get_service_paths slave]

#Set the TG2 service path. Assume index 2 is the TG2 service path in this example
#User needs to check the service_paths list to identify the index for the TG2 in your system
set tg_service_path [lindex $service_paths 2]

#Open the slave service.
set claimed_path [claim_service slave $tg_service_path mylib]

#User code to write/read to TG2
     #Read the TG Version
    puts "TG Version : [master_read_32 $claimed_path 0x0 1]" 
    
    #Clear the TG_STATUS before Retest with Default Traffic
    puts "\nClear TG_STATUS"
    master_write_32 $claimed_path 0x20 0xf
    
    #Read the Read_Count-Low
    puts "Read Count - Low  : [master_read_32 $claimed_path 0x1d8 1]"
    #Read the Read_Count-High
    puts "Read Count - High : [master_read_32 $claimed_path 0x1dc 1]"
    
    #Restart Default Traffic
    puts "\nWrite to TG_RESTART_DEFAULT_TRAFFIC"
    master_write_32 $claimed_path 0x1e8 1
   
    set TG_TEST_COMPLETE 0
    
    while { $TG_TEST_COMPLETE < 1 } {
    set TG_TEST_COMPLETE [expr [ master_read_32 $claimed_path 0x1e0 1] & 0x1 ]
    puts "\nTG_TEST_COMPLETE : $TG_TEST_COMPLETE" 
    }

    #Read the Read_Count-Low
    puts "Read Count - Low  : [master_read_32 $claimed_path 0x1d8 1]"
    #Read the Read_Count-High
    puts "Read Count - High : [master_read_32 $claimed_path 0x1dc 1]"
    #Read the TG_PASS
    puts "Pass : [expr [master_read_32 $claimed_path 0x1c0 1] & 0x1 ]"
    #Read the TG_FAIL
    puts "Fail : [expr [master_read_32 $claimed_path 0x1c4 1] & 0x1 ]" 
#End of write/read to TG2

#Close the slave service.
close_service slave $claimed_path