Root Port Model TPI Task List - 4.4 English

UltraScale Devices Gen3 Integrated Block for PCI Express LogiCORE IP Product Guide (PG156)

Document ID
PG156
Release Date
2023-11-24
Version
4.4 English

The Root Port Model TPI tasks include these tasks, which are further defined in these tables.

Table: Test Setup Tasks , Test Setup Tasks

Table: TLP Tasks , TLP Tasks

Table: BAR Initialization Tasks , BAR Initialization Tasks

Table: Example PIO Design Tasks , Example PIO Design Tasks

Table: Expectation Tasks , Expectation Tasks

Table 6-2: Test Setup Tasks

Name

Input(s)

Description

TSK_SYSTEM_INITIALIZATION

None

Waits for transaction interface reset and link-up between the Root Port Model and the Endpoint DUT.

This task must be invoked prior to the Endpoint core initialization.

TSK_USR_DATA_SETUP_SEQ

None

Initializes global 4096 byte DATA_STORE array entries to sequential values from zero to 4095.

TSK_TX_CLK_EAT

clock count

31:30

Waits clock_count transaction interface clocks.

TSK_SIMULATION_TIMEOUT

timeout

31:0

Sets master simulation timeout value in units of transaction interface clocks. This task should be used to ensure that all DUT tests complete.

Table 6-3: TLP Tasks

Name

Input(s)

Description

TSK_TX_TYPE0_CONFIGURATION_READ

tag_

reg_addr_

first_dw_be_

7:0

11:0

3:0

Sends a Type 0 PCI Express Config Read TLP from Root Port Model to reg_addr of Endpoint DUT with tag_ and first_dw_be_ inputs.

Cpld returned from the Endpoint DUT uses the contents of global EP_BUS_DEV_FNS as the completer ID.

TSK_TX_TYPE1_CONFIGURATION_READ

tag_

reg_addr_

first_dw_be_

7:0

11:0

3:0

Sends a Type 1 PCI Express Config Read TLP from Root Port Model to reg_addr_ of Endpoint DUT with tag_ and first_dw_be_ inputs.

CplD returned from the Endpoint DUT uses the contents of global EP_BUS_DEV_FNS as the completer ID.

TSK_TX_TYPE0_CONFIGURATION_WRITE

tag_

reg_addr_

reg_data_

first_dw_be_

7:0

11:0

31:0

3:0

Sends a Type 0 PCI Express Config Write TLP from Root Port Model to reg_addr_ of Endpoint DUT with tag_ and first_dw_be_ inputs.

Cpl returned from the Endpoint DUT uses the contents of global EP_BUS_DEV_FNS as the completer ID.

TSK_TX_TYPE1_CONFIGURATION_WRITE

tag_

reg_addr_

reg_data_

first_dw_be_

7:0

11:0

31:0

3:0

Sends a Type 1 PCI Express Config Write TLP from Root Port Model to reg_addr_ of Endpoint DUT with tag_ and first_dw_be_ inputs.

Cpl returned from the Endpoint DUT uses the contents of global EP_BUS_DEV_FNS as the completer ID.

TSK_TX_MEMORY_READ_32

tag_

tc_

len_

addr_

last_dw_be_

first_dw_be_

7:0

2:0

10:0

31:0

3:0

3:0

Sends a PCI Express Memory Read TLP from Root Port to 32-bit memory address addr_ of Endpoint DUT.

The request uses the contents of global RP_BUS_DEV_FNS as the Requester ID.

TSK_TX_MEMORY_READ_64

tag_

tc_

len_

addr_

last_dw_be_

first_dw_be_

7:0

2:0

10:0

63:0

3:0

3:0

Sends a PCI Express Memory Read TLP from Root Port Model to 64-bit memory address addr_ of Endpoint DUT.

The request uses the contents of global RP_BUS_DEV_FNS as the Requester ID.

TSK_TX_MEMORY_WRITE_32

tag_

tc_

len_

addr_

last_dw_be_

first_dw_be_

ep_

7:0

2:0

10:0

31:0

3:0

3:0

Sends a PCI Express Memory Write TLP from Root Port Model to 32-bit memory address addr_ of Endpoint DUT.

The request uses the contents of global RP_BUS_DEV_FNS as the Requester ID.

The global DATA_STORE byte array is used to pass write data to task.

TSK_TX_MEMORY_WRITE_64

tag_

tc_

len_

addr_

last_dw_be_

first_dw_be_

ep_

7:0

2:0

10:0

63:0

3:0

3:0

Sends a PCI Express Memory Write TLP from Root Port Model to 64-bit memory address addr_ of Endpoint DUT.

The request uses the contents of global RP_BUS_DEV_FNS as the Requester ID.

The global DATA_STORE byte array is used to pass write data to task.

TSK_TX_COMPLETION

req_id_

tag_

tc_

len_

comp_status_

15:0

7:0

2:0

10:0

6:0

Sends a PCI Express Completion TLP from Root Port Model to the Endpoint DUT using global RP_BUS_DEV_FNS as the completer ID, req_id_ input as the requester ID.

comp_status_ input can be set to one of the following:

3'b000 = Successful Completion

3'b001 = Unsupported Request

3'b010 = Configuration Request Retry Status

3'b100 = Completer Abort

TSK_TX_COMPLETION_DATA

req_id_

tag_

tc_

len_

byte_count_

lower_addr_

comp_status_

ep_

15:0

7:0

2:0

10:0

11:0

6:0

2:0

Sends a PCI Express Completion with Data TLP from Root Port Model to the Endpoint DUT using global RP_BUS_DEV_FNS as the completer ID, req_id_ input as the requester ID.

TSK_TX_MESSAGE

tag_

tc_

len_

data_

message_rtg_

message_code_

7:0

2:0

10:0

63:0

2:0

7:0

Sends a PCI Express Message TLP from Root Port Model to Endpoint DUT.

The request uses the contents of global RP_BUS_DEV_FNS as the Requester ID.

TSK_TX_MESSAGE_DATA

tag_

tc_

len_

data_

message_rtg_

message_code_

7:0

2:0

10:0

63:0

2:0

7:0

Sends a PCI Express Message with Data TLP from Root Port Model to Endpoint DUT.

The global DATA_STORE byte array is used to pass message data to task.

The request uses the contents of global RP_BUS_DEV_FNS as the Requester ID.

TSK_TX_IO_READ

tag_

addr_

first_dw_be_

7:0

31:0

3:0

Sends a PCI Express I/O Read TLP from Root Port Model to I/O address addr_[31:2] of the Endpoint DUT.

The request uses the contents of global RP_BUS_DEV_FNS as the Requester ID.

TSK_TX_IO_WRITE

tag_

addr_

first_dw_be_

data

7:0

31:0

3:0

31:0

Sends a PCI Express I/O Write TLP from Root Port Model to I/O address addr_[31:2] of the Endpoint DUT.

The request uses the contents of global RP_BUS_DEV_FNS as the Requester ID.

TSK_TX_BAR_READ

bar_index

byte_offset

tag_

tc_

2:0

31:0

7:0

2:0

Sends a PCI Express one Dword Memory 32, Memory 64, or I/O Read TLP from the Root Port Model to the target address corresponding to offset byte_offset from BAR bar_index of the Endpoint DUT. This task sends the appropriate Read TLP based on how BAR bar_index has been configured during initialization. This task can only be called after TSK_BAR_INIT has successfully completed.

The request uses the contents of global RP_BUS_DEV_FNS as the Requester ID.

TSK_TX_BAR_WRITE

bar_index

byte_offset

tag_

tc_

data_

2:0

31:0

7:0

2:0

31:0

Sends a PCI Express one Dword Memory 32, Memory 64, or I/O Write TLP from the Root Port to the target address corresponding to offset byte_offset from BAR bar_index of the Endpoint DUT.

This task sends the appropriate Write TLP based on how BAR bar_index has been configured during initialization. This task can only be called after TSK_BAR_INIT has successfully completed.

TSK_WAIT_FOR_READ_DATA

None

Waits for the next completion with data TLP that was sent by the Endpoint DUT. On successful completion, the first Dword of data from the CplD is stored in the global P_READ_DATA. This task should be called immediately following any of the read tasks in the TPI that request Completion with Data TLPs to avoid any race conditions.

By default this task locally times out and terminate the simulation after 1000 transaction interface clocks. The global cpld_to_finish can be set to zero so that local timeout returns execution to the calling test and does not result in simulation timeout. For this case test programs should check the global cpld_to, which when set to one indicates that this task has timed out and that the contents of P_READ_DATA are invalid.

TSK_TX_SYNCHRONIZE

first_

active_

last_call_

tready_sw_

-

-

-

-

Waits for assertion of AXI4-Stream Requester Request or Completer Completion Interface Ready signal and synchronizes the output in the log file to each transaction currently active.

first_ input indicates start of packet.

active_ input indicates a transaction is currently in progress

last_call_ input indicates end of packet

tready_sw input selects Requester Request or Completer Completion Interface Ready signal

TSK_BUILD_RC_TO_PCIE_PKT

rc_data_QW0

rc_data_QW1

m_axis_rc_tkeep

m_axis_rc_tlast

63:0

63:0

KEEP_
WIDTH-1:0

-

Converts AXI4-Stream packet at Requester Completion Interface from a Descriptor packet format to PCIe TLP packet format for logging purposes.

TSK_BUILD_CQ_TO_PCIE_PKT

cq_data

cq_be

m_axis_cq_tdata

63:0

7:0

63:0

Converts AXI4-Stream packet at Completer Request Interface from a Descriptor packet format to PCIe TLP packet format for logging purposes.

TSK_BUILD_CPLD_PKT

cq_addr

cq_be

m_axis_cq_tdata

63:0

7:0

63:0

Returns Completion or Completion with Data for Memory Read received from the Endpoint DUT.

Table 6-4: BAR Initialization Tasks

Name

Input(s)

Description

TSK_BAR_INIT

None

Performs a standard sequence of Base Address Register initialization tasks to the Endpoint device using the PCI Express fabric. Performs a scan of the Endpoint PCI BAR range requirements, performs the necessary memory and I/O space mapping calculations, and finally programs the Endpoint so that it is ready to be accessed.

On completion, the user test program can begin memory and I/O transactions to the device. This function displays to standard output a memory and I/O table that details how the Endpoint has been initialized. This task also initializes global variables within the Root Port Model that are available for test program usage. This task should only be called after TSK_SYSTEM_INITIALIZATION.

TSK_BAR_SCAN

None

Performs a sequence of PCI Type 0 Configuration Writes and Configuration Reads using the PCI Express logic to determine the memory and I/O requirements for the Endpoint.

The task stores this information in the global array BAR_INIT_P_BAR_RANGE[]. This task should only be called after TSK_SYSTEM_INITIALIZATION.

TSK_BUILD_PCIE_MAP

None

Performs memory and I/O mapping algorithm and allocates Memory 32, Memory 64, and I/O space based on the Endpoint requirements.

This task has been customized to work in conjunction with the limitations of the PIO design and should only be called after completion of TSK_BAR_SCAN.

TSK_DISPLAY_PCIE_MAP

None

Displays the memory mapping information of the Endpoint core PCI Base Address Registers. For each BAR, the BAR value, the BAR range, and BAR type is given. This task should only be called after completion of TSK_BUILD_PCIE_MAP.

Table 6-5: Example PIO Design Tasks

Name

Input(s)

Description

TSK_TX_READBACK_CONFIG

None

Performs a sequence of PCI Type 0 Configuration Reads to the Endpoint device Base Address Registers, PCI Command register, and PCIe Device Control register using the PCI Express logic.

This task should only be called after TSK_SYSTEM_INITIALIZATION.

TSK_MEM_TEST_DATA_BUS

bar_index

2:0

Tests whether the PIO design FPGA block RAM data bus interface is correctly connected by performing a 32-bit walking ones data test to the I/O or memory address pointed to by the input bar_index.

For an exhaustive test, this task should be called four times, once for each block RAM used in the PIO design.

TSK_MEM_TEST_ADDR_BUS

bar_index

nBytes

2:0

31:0

Tests whether the PIO design FPGA block RAM address bus interface is accurately connected by performing a walking ones address test starting at the I/O or memory address pointed to by the input bar_index.

For an exhaustive test, this task should be called four times, once for each block RAM used in the PIO design. Additionally, the nBytes input should specify the entire size of the individual block RAM.

TSK_MEM_TEST_DEVICE

bar_index

nBytes

2:0

31:0

Tests the integrity of each bit of the PIO design FPGA block RAM by performing an increment/decrement test on all bits starting at the block RAM pointed to by the input bar_index with the range specified by input nBytes.

For an exhaustive test, this task should be called four times, once for each block RAM used in the PIO design. Additionally, the nBytes input should specify the entire size of the individual block RAM.

TSK_RESET

Reset

0

Initiates PERSTn . Forces the PERSTn signal to assert the reset. Use TSK_RESET (1’b1) to assert the reset and TSK_RESET (1’b0) to release the reset signal.

TSK_MALFORMED

malformed_bits

7:0

Control bits for creating malformed TLPs:

0001: Generate Malformed TLP for I/O Requests and Configuration Requests called immediately after this task

0010: Generate Malformed Completion TLPs for Memory Read requests received at the Root Port

Table 6-6: Expectation Tasks

Name

Input(s)

Output

Description

TSK_EXPECT_CPLD

traffic_class

td

ep

attr

length

completer_id

completer_status

bcm

byte_count

requester_id

tag

address_low

2:0

-

-

1:0

10:0

15:0

2:0

-

11:0

15:0

7:0

6:0

Expect
status

Waits for a Completion with Data TLP that matches traffic_class, td, ep, attr, length, and payload.

Returns a 1 on successful completion; 0 otherwise.

TSK_EXPECT_CPL

traffic_class

td

ep

attr

completer_id

completer_status

bcm

byte_count

requester_id

tag

address_low

2:0

-

-

1:0

15:0

2:0

-

11:0

15:0

7:0

6:0

Expect
status

Waits for a Completion without Data TLP that matches traffic_class, td, ep, attr, and length.

Returns a 1 on successful completion; 0 otherwise.

TSK_EXPECT_MEMRD

traffic_class

td

ep

attr

length

requester_id

tag

last_dw_be

first_dw_be

address

2:0

-

-

1:0

10:0

15:0

7:0

3:0

3:0

29:0

Expect
status

Waits for a 32-bit Address Memory Read TLP with matching header fields.

Returns a 1 on successful completion; 0 otherwise. This task can only be used in conjunction with Bus Master designs.

TSK_EXPECT_MEMRD64

traffic_class

td

ep

attr

length

requester_id

tag

last_dw_be

first_dw_be

address

2:0

-

-

1:0

10:0

15:0

7:0

3:0

3:0

61:0

Expect
status

Waits for a 64-bit Address Memory Read TLP with matching header fields. Returns a 1 on successful completion; 0 otherwise.

This task can only be used in conjunction with Bus Master designs.

TSK_EXPECT_MEMWR

traffic_class

td

ep

attr

length

requester_id

tag

last_dw_be

first_dw_be

address

2:0

-

-

1:0

10:0

15:0

7:0

3:0

3:0

29:0

Expect
status

Waits for a 32-bit Address Memory Write TLP with matching header fields. Returns a 1 on successful completion; 0 otherwise.

This task can only be used in conjunction with Bus Master designs.

TSK_EXPECT_MEMWR64

traffic_class

td

ep

attr

length

requester_id

tag

last_dw_be

first_dw_be

address

2:0

-

-

1:0

10:0

15:0

7:0

3:0

3:0

61:0

Expect
status

Waits for a 64-bit Address Memory Write TLP with matching header fields. Returns a 1 on successful completion; 0 otherwise.

This task can only be used in conjunction with Bus Master designs.

TSK_EXPECT_IOWR

td

ep

requester_id

tag

first_dw_be

address

data

-

-

15:0

7:0

3:0

31:0

31:0

Expect
status

Waits for an I/O Write TLP with matching header fields. Returns a 1 on successful completion; 0 otherwise.

This task can only be used in conjunction with Bus Master designs.