List of capability templates Extended Capabilities templates
PCIe Modeling Library  /  DML template reference  / 

Capabilities templates

These are templates for PCIe Capabilities. They are designed to be applied on a group. For convenience there exists a template defining_xyz_capability for each capability xyz which defines a group xyz with the xyz_capability applied. Most templates only define the registers with their standard access restrictions. If additional behavior is needed, the user of the template must implement this manually.

Each capability template uses the following parameters:

Power Management Capability registers

PCI Express Capability registers

Parameters:

Adds groups:

Device/port type constants for field exp.capability.dpt

PCIE_DP_Type_EP, PCIE_DP_Type_Legacy_EP, PCIE_DP_Type_RCiEP, PCIE_DP_Type_RCEC, PCIE_DP_Type_RP, PCIE_DP_Type_UP, PCIE_DP_Type_DP, PCIE_DP_Type_BridgeX, PCIE_DP_Type_XBridge

flit_mode_supported() -> (bool)

Returns true the Flit Mode Supported field is set

PCI Express Capability Device registers

set_status_error(uint8 error_type, bool is_ur) throws

Sets the bits in the status register related to error signaling.

Parameters:

Methods

Given a value in the Current Link Speed or Max Link Speed field, returns the corresponding link speed based on values in the Supported Link Speeds Vector field. Returns PCIE_Link_Speed_Undefined if the value of encoded_link_speed corresponds to an unset Supported Link Speed vector bit.

Sets the default link training target when do_link_training() is called with NULL.

This method handles pcie_link_negotiation atom after a link training transaction has completed. If there is no pcie_link_negotiation atom, the method does nothing.

This method handles pcie_link_flit_mode atom after a link training transaction has completed. If there is no pcie_link_flit_mode atom, the method does nothing.

This method handles any custom atoms after a link training transaction has completed. If there are no custom atoms in the transaction, this method should do nothing.

Calls all the link training result handlers. Returns false if at least one of the handlers return false.

Initiates link training by sending a link training transaction to either the to the target set with set_link_training_target(). Returns true if link negotiation was deemed successful.

Same as (do_link_training())[#do_link_training], but allows for adding extra atoms to the link training transaction.

Returns the Supported Link Speeds Vector.

Returns the target link speed. Note that this is not the value of the Target Link Speed field, but rather the decoded target link speed based on the value of the Target Link Speed field. Note that the Downstream component should not be using this during link negotiation, as it's only applicable in Enter Compliance mode in such components, which currently is not supported.

Returns the value of maximum link width

Returns the maximum link speed

Sets the status.ls and status.nlw fields.

flit_mode_supported() -> (bool)

Returns flit_mode_supported() of parent (exp_capability). Convenience method to check if Flit Mode is supported without retrieving an instance of exp_capability if an instance of exp_link is available.

flit_mode_disabled() -> (bool)

Returns true the Flit Mode Disable field is set

set_flit_mode_status(bool enabled)

Set the Flit Mode Status field

drs_supported() -> (bool)

Returns true if DRS is supported

send_drs_msg() -> (pcie_error_t)

Sends a Device Ready Status (DRS) message. This method can only be called from function 0 of a Downstream component. The DRS message is sent to the Upstream component.

drs_msg_received() -> (pcie_error_t)

This method can be called when a DRS message is received. It sets the DRS Message Received field and the Downstream Component Presence field in the Link Status 2 register

get_downstream_component_presence() -> (uint3)

Returns the value of the Downstream Component Presence field

set_downstream_component_presence(uint3 value)

Sets the value of the Downstream Component Presence field

PCI Express Capability Slot registers

Parameters:

Methods

presence_change_event(pcie_hotplug_pd_t state) -> (bool)

Sets the presence detect state field to state. If the state has changed, also sets the presence detect changed field and notifies software if applicable. Returns true if event was registered

mrl_sensor_event(pcie_hotplug_mrl_t state) -> (bool)

Sets the MRL sensor state field to state. If the state has changed, also sets the MRL sensor changed field and notifies software if applicable. Returns true if event was registered

Sets the Data Link Layer Link Active in the link status register to is_active. If this field changes value, also sets the Data Link Layer state changed field in the slot status register and notifies software if applicable. Returns true if event was registered

power_fault_event() -> (bool)

Sets the Power Fault Detected field and notifies software if applicable. Returns true if event was registered

attention_button_event() -> (bool)

Sets the Attention Button Pressed field and notifies software if applicable. Returns true if event was registered

hotplug_event_enabled(int type) -> (bool)

Returns true if slot has Hot-Plug event types of type type enabled. The available types are param:s defined in this file that have the prefix SLOT_ and LINK_.

hotplug_capable(int type)

Returns true if the slot is capable of handling Hot-Plug events of type type. The available types are param:s defined in this file that have the prefix SLOT_ and LINK_.

PCI Express Capability Root registers

VPD Capability registers

Message Signaled Interrupts (MSI) Capability registers

Parameters:

Methods

signal_all_pending()

Signals all pending MSI's

raise(uint8 i)

Raises MSI i if capable and enabled, and signals it if not masked

lower(uint8 i)

Lowers MSI i

Message Signaled Interrupts X (MSI-X) Capability registers

Parameters:

Methods

raise(uint16 i)

Raises MSI-X i if enabled, and signals it if not masked

lower(uint16 i)

Lowers MSI-X i

msix_table

Template to model the msix table data and pending bits.

Parameters:

Subsystem ID and Subsystem Vendor ID Capability registers

Conventional PCI Advanced Features Capability (AF) registers

Enhanced Allocation (EA) Capability registers

Flattening Portal Bridge (FPB) Capability registers

Fields and access restrictions to be added upon request.

Null Capability registers

List of capability templates Extended Capabilities templates