Skip to content

Latest commit

 

History

History
201 lines (186 loc) · 8.59 KB

Exerciser_API_porting_guide.md

File metadata and controls

201 lines (186 loc) · 8.59 KB

Exerciser API Porting Guide

This document gives details of the various PCIe capabilities that exerciser device supports and how the exerciser is supposed to behave. It targets the Silicon partners and/or EDA vendors who are porting Exerciser API's on their platform.

Introduction to PCIe Exerciser Endpoint Device

PCIe Exerciser is a client device wrapped up by PCIe Endpoint. This device was created to generate custom stimuli to meet BSA (Base System Architecture) requirements for various PCIe capability validation tests.

Generating DMA

  • Before triggering DMA all the required DMA attribute fields like DMA bus address, DMA length, exerciser instance fields should be correctly set
    pal_exerciser_set_param(Type, Value1, Value2, Bdf)
    Type - DMA_ATTRIBUTES
    Value1 - Buffer containing the data or the Buffer where the data to be copied
    Value2 - Size of the data
    BDF - BDF of the exerciser
  • Trigger the DMA to/from the buffer
    pal_exerciser_ops(Ops, Param, Bdf)
    Ops - START_DMA
    Param - EDMA_TO_DEVICE or EDMA_FROM_DEVICE
    Bdf - BDF of the exerciser

Generating DMA with PASID TLP Prefixes

  • Program exerciser to start sending TLPs with PASID TLP Prefixes. This includes setting PASID Enable bit in exerciser PASID Control register and the implementation specific PASID Enable bit of the Root Port.
    pal_exerciser_ops(Ops, Param, Bdf)
    Ops - PASID_TLP_START
    Param - Substream ID
    Bdf - BDF of the exerciser
    pal_exerciser_set_param(Type, Value1, Value2, Bdf)
    Type - DMA_ATTRIBUTES
    Value1 - Buffer containing the data or the Buffer where the data to be copied
    Value2 - Size of the data
    BDF - BDF of the exerciser
  • Trigger the DMA to/from the buffer
    pal_exerciser_ops(Ops, Param, Bdf)
    Ops - START_DMA
    Param - EDMA_TO_DEVICE or EDMA_FROM_DEVICE
    Bdf - BDF of the exerciser
  • Disable exerciser to stop sending TLPs with PASID TLP Prefixes.
    pal_exerciser_ops(Ops, Param, Bdf)
    Ops - PASID_TLP_STOP
    Param - Substream ID
    Bdf - BDF of the exerciser

Generating DMA with No Snoop TLP

  • Program exerciser hierarchy to start sending/receiving TLPs with No Snoop attribute header. This includes disabling No snoop bit in exerciser control register.
    pal_exerciser_ops(Ops, Param, Bdf)
    Ops - TXN_NO_SNOOP_DISABLE
    Param - Null
    Bdf - BDF of the exerciser
    pal_exerciser_set_param(Type, Value1, Value2, Bdf)
    Type - DMA_ATTRIBUTES
    Value1 - Buffer containing the data or the Buffer where the data to be copied
    Value2 - Size of the data
    BDF - BDF of the exerciser
  • Trigger the DMA to/from the buffer
    pal_exerciser_ops(Ops, Param, Bdf)
    Ops - START_DMA
    Param - EDMA_TO_DEVICE or EDMA_FROM_DEVICE
    Bdf - BDF of the exerciser

ATS Request

  • Before starting an ATS request, untranslated input address for ATSRequest must be written onto Bus Address Register
    pal_exerciser_set_param(Type, Value1, Value2, Bdf)
    Type - DMA_ATTRIBUTES
    Value1 - Untranslated input address
    Value2 - Size
    BDF - BDF of the exerciser
  • Send an ATS Translation Request for the VA
    pal_exerciser_ops(Ops, Param, Bdf)
    Ops - ATS_TXN_REQ
    Param - VA
    Bdf - BDF of the exerciser
  • Get ATS Translation Response
    pal_exerciser_get_param(Type, Value1, Value2, Bdf)
    Type - ATS_RES_ATTRIBUTES
    Value1 - Buffer to store translated address
    Value2 - Null
    Bdf - BDF of the exerciser

Generating DMA with Address Translated(AT)

  • Configure Exerciser to issue subsequent DMA transactions with AT(Address Translated) bit Set
    pal_exerciser_set_param(Type, Value1, Value2, Bdf)
    Type - CFG_TXN_ATTRIBUTES
    Value1 - TXN_ADDR_TYPE
    Value2 - AT_TRANSLATED
    BDF - BDF of the exerciser
    pal_exerciser_set_param(Type, Value1, Value2, Bdf)
    Type - DMA_ATTRIBUTES
    Value1 - Buffer containing the data or the Buffer where the data to be copied
    Value2 - Size of the data
    BDF - BDF of the exerciser
  • Trigger the DMA to/from the buffer
    pal_exerciser_ops(Ops, Param, Bdf)
    Ops - START_DMA
    Param - EDMA_TO_DEVICE or EDMA_FROM_DEVICE
    Bdf - BDF of the exerciser

Trigerring MSI

  • Trigger the interrupt for this Exerciser instance
    pal_exerciser_ops(Ops, Param, Bdf)
    Ops - GENERATE_MSI
    Param - MSI index
    Bdf - BDF of the exerciser

Trigerring Legacy Interrupts

  • Clear any pending interrupts
    pal_exerciser_ops(Ops, Param, Bdf)
    Ops - CLEAR_INTR
    Param - Legacy interrupt IRQ
    Bdf - BDF of the exerciser
  • Trigger the interrupt for this Exerciser instance
    pal_exerciser_ops(Ops, Param, Bdf)
    Ops - GENERATE_L_INTR
    Param - Legacy interrupt IRQ
    Bdf - BDF of the exerciser

Transaction Monitoring

  • Transaction monitoring capabilities in the exerciser provides the ability to record the incoming transactions, for both config and memory transactions. This includes,
    • config read and write transactions serviced in PCIe endpoints.
    • memory transactions serviced in PCIe endpoint BARs.
    • memory transactions which are forwarded from PCIe endpoint to device(like exerciser).
  • To start transaction monitoring
    pal_exerciser_ops(Ops, Param, Bdf)
    Ops - START_TXN_MONITOR
    Param - CFG_READ
    Bdf - BDF of the exerciser
  • After the transactions are performed, stop the transaction monitoring
    pal_exerciser_ops(Ops, Param, Bdf)
    Ops - STOP_TXN_MONITOR
    Param - CFG_READ
    Bdf - BDF of the exerciser
  • Read the transaction trace
    pal_exerciser_get_param(Type, Value1, Value2, Bdf)
    Type -
    • CFG_TXN_ATTRIBUTES: Indicates transaction attributes. cfg or mem transaction
    • TRANSACTION_TYPE: Indicates transaction type. Read or Write transaction
    • ADDRESS_ATTRIBUTES: Config or memory address
    • DATA_ATTRIBUTES: Transaction data read or written to
      Value1 - Requested transaction data
      Value2 - Null
      Bdf - BDF of the exerciser

Error Injection

Error injection capability enables user to inject error in a PCIe endpoint.

  • The user can inject an error at that endpoint with the error configured using the error_code field. The error_codes are defined in Error Codes section. This bit is cleared once the error has been injected. pal_exerciser_get_param(Type, Value1, Value2, Bdf)
    Type - ERRR_INJECT_TYPE
    Value1 - Type of error to inject(Refer error code section)
    Value2 - Null
    Bdf - BDF of the exerciser
    pal_exerciser_ops(Ops, Param, Bdf)
    Ops - INJECT_ERROR
    Param - Type of error to inject(Refer error code section)
    Bdf - BDF of the exerciser

Error Codes

Error Name Error Code
Correctable Receiver Error 0x00
Correctable Bad TLP 0x01
Correctable Bad DLLP 0x02
Correctable Replay Num Rollover 0x03
Correctable Replay Timer Timeout 0x04
Correctable Advisory Non-Fatal Error 0x05
Correctable Internal Error 0x06
Correctable Header Log OverFlow 0x07
Uncorrectable Data Link Error 0x08
Uncorrectable Surprise Down Error 0x09
Uncorrectable Poisoned TLP Received 0x0A
Uncorrectable Flow Control Error 0x0B
Uncorrectable Completion Timeout 0x0C
Uncorrectable Completer Abort 0x0D
Uncorrectable Unexpected Completion 0x0E
Uncorrectable Receiver Overflow 0x0F
Uncorrectable Malformed TLP 0x10
Uncorrectable ECRC Error 0x11
Uncorrectable Unsupported Request 0x12
Uncorrectable ACS Violation 0x13
Uncorrectable Internal Error 0x14
Uncorrectable MultiCast Blocked TLP 0x15
Uncorrectable Atomic Op Egress Blocked 0x16
Uncorrectable TLP Prefix Blocked Egress 0x17
Uncorrectable Poisoned TLP Egress Blocked 0x18
Invalid configuration 0x19


License

Arm BSA ACS is distributed under Apache v2.0 License.


Copyright (c) 2022-2023, Arm Limited and Contributors. All rights reserved.