Expand description
Rust library for parsing PCI Express Transaction Layer Packets (TLPs).
Supports both non-flit (PCIe 1.0–5.0) and flit-mode (PCIe 6.0+) framing.
Structs§
- Completion
ReqD W23 - Config
Request - FlitDW0
- Parsed representation of a flit-mode DW0 (first 4 bytes of a flit TLP).
- Flit
OhcA - Parsed OHC-A word — the byte layout is shared by OHC-A1, OHC-A2, and OHC-A3.
- Flit
Stream Walker - Iterator over a packed stream of flit-mode TLPs.
- MemRequest3DW
- MemRequest4DW
- Message
ReqD W24 - TlpPacket
- TLP Packet structure is high level abstraction for entire TLP packet Contains Header and Data
- TlpPacket
Header - TLP Packet Header Contains bytes for Packet header and informations about TLP type
Enums§
- Atomic
Op - Atomic operation discriminant
- Atomic
Width - Operand width — derived from TLP format: 3DW → 32-bit, 4DW → 64-bit
- Flit
TlpType - TLP type codes used in Flit Mode DW0 byte 0.
- TlpError
- Errors that can occur when parsing TLP packets
- TlpFmt
- TLP format field encoding — encodes header size and whether a data payload is present.
- TlpMode
- Selects the framing mode used to interpret the raw byte buffer.
- TlpType
- High-level TLP transaction type decoded from the DW0 Format and Type fields.
Traits§
- Atomic
Request - Atomic Request trait: header fields and operand(s) for atomic op TLPs.
Use
new_atomic_req()to obtain a trait object from raw packet bytes. - Completion
Request - Completion Request Trait
Completions are always 3DW (for with data (fmt = b010) and without data (fmt = b000) )
This trait is provided to have same API as other headers with variable size
To obtain this trait
new_cmpl_req()function has to be used Trait release user from dealing with bitfield structures. - Configuration
Request - Configuration Request Trait: Configuration Requests Headers are always same size (3DW), this trait is provided to have same API as other headers with variable size
- MemRequest
- Memory Request Trait: Applies to 32 and 64 bits requests as well as legacy IO-Request (Legacy IO Request has the same structure as MemRead3DW) Software using the library may want to use trait instead of bitfield structures Both 3DW (32-bit) and 4DW (64-bit) headers implement this trait 3DW header is also used for all Legacy IO Requests.
- Message
Request - Message Request trait Provide method to access fields in DW2-4 header is handled by TlpHeader
Functions§
- new_
atomic_ req - Parse an atomic TLP request from a
TlpPacket. - new_
cmpl_ req - Obtain Completion Request dyn Trait:
- new_
conf_ req - Obtain Configuration Request trait from bytes in vector as dyn.
- new_
mem_ req - Obtain Memory Request trait from bytes in vector as dyn. This is the preferred way of dealing with TLP headers when the exact format (32-bit vs 64-bit) does not need to be known at the call site.
- new_
msg_ req - Obtain Message Request dyn Trait: