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:

Parameters:

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

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. Will set the status.ls and status.nlw fields if the negotiation was successful. Negotiation can only be successful if both the initiator and the link training target has the params max_link_speed and max_link_width in their respective link groups set. do_link_training will by default only send a link training transaction to device 0. This method can be overridden for custom functionality where support for bifurcation might for instance be necessary.

Returns the target link speed. This would be the maximum link speed if there is no target link speed.

Returns the maximum link width

Sets the status.ls and status.nlw fields.

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_.

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

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