Sunteți pe pagina 1din 40

Copyright 2006, PCI-SIG, All Rights Reserved 1

PCI Express

Basics
PCI Express

Basics
Joe Winkles
Senior Staff Engineer
MindShare, Inc.
Joe Winkles
Senior Staff Engineer
MindShare, Inc.
Copyright 2006, PCI-SIG, All Rights Reserved 2 PCI-SIG Developers Conference
PCI Express architecture is a high performance, IO
interconnect for peripherals in
computing/communication platforms
Evolved from PCI and PCI-X

architectures
Yet PCI Express architecture is significantly different from its
predecessors PCI and PCI-X
PCI Express is a serial point-to-point interconnect
between two devices
Implements packet based protocol for information
transfer
Scalable performance based on number of signal
Lanes implemented on the PCI Express interconnect
PCI Express Introduction
PCI Express Introduction
Copyright 2006, PCI-SIG, All Rights Reserved 3 PCI-SIG Developers Conference
Link
Lane
PCI Express Terminology
PCI Express Terminology
PCI Express Device A
PCI Express Device B
Signal
Wire
Copyright 2006, PCI-SIG, All Rights Reserved 4 PCI-SIG Developers Conference
Assumes 2.5 Gbits/s signaling in each direction
80% BW utilized due to 8b/10b encoding overhead
Aggregate bandwidth implies simultaneous traffic in both directions
Peak bandwidth is higher than any bus available
PCIe

2.0 will support PHYs offering 5 Gbits/s signaling - doubling


above bandwidth numbers
16 8 6 4 2 1 0.5 Aggregate
BW
(GBytes/s)
x32 x16 x12 x8 x4 x2 x1 Link Width
PCI Express Throughput
PCI Express Throughput
Copyright 2006, PCI-SIG, All Rights Reserved 5 PCI-SIG Developers Conference
PCI Express Features
PCI Express Features
Point-to-point connection
Serial bus means fewer pins
Scaleable: x1, x2, x4, x8, x12, x16, x32
Dual Simplex connection
2.5Gbits/s transfer/direction/s
Packet based transaction protocol
PCIe
Device
A
PCIe
Device
B
Link (x1, x2, x4, x8, x12, x16 or x32)
Packet
Packet
Copyright 2006, PCI-SIG, All Rights Reserved 6 PCI-SIG Developers Conference
Electrical characteristics of PCI Express signal
Differential signaling
Transmitter Differential Peak voltage = 0.4 - 0.6 V
Transmitter Common mode voltage = 0 - 3.6 V
Two devices at opposite ends of a Link may support
different DC common mode voltages
D+
D-
V
Diffp
V
cm
Differential Signaling
Differential Signaling
Copyright 2006, PCI-SIG, All Rights Reserved 7 PCI-SIG Developers Conference
Switch
PCIe
Endpoint
Legacy
Endpoint
PCIe
Endpoint
Root Complex
CPU
PCIe
Memory
PCIe
Bridge To
PCIe PCIe
PCIe PCIe
Legend
PCI Express Device Downstream Port
PCI Express Device Upstream Port
PCIe
Endpoint
PCI/PCI-X
PCI/PCI-X
Example PCI Express
Topology
Example PCI Express
Topology
PCIe
Copyright 2006, PCI-SIG, All Rights Reserved 8 PCI-SIG Developers Conference
Switch
PCIe
Endpoint
Legacy
Endpoint
PCIe
Endpoint
Root Complex
CPU
PCIe
Memory
PCIe
Bridge To
PCIe PCIe
PCIe PCIe
Legend
PCI Express Device Downstream Port
PCI Express Device Upstream Port
PCIe
Endpoint
PCI/PCI-X
PCI/PCI-X
Root
Virtual
PCI
Bridge
Virtual
PCI
Bridge
Virtual
PCI
Bridge
RCRB
Bus 0
PCI Express Links
CPU Bus
Switch
Virtual
PCI
Bridge
Virtual
PCI
Bridge
Virtual
PCI
Bridge
Virtual
PCI
Bridge
Example PCI Express
Topology Root & Switch
Example PCI Express
Topology Root & Switch
PCIe
Copyright 2006, PCI-SIG, All Rights Reserved 9 PCI-SIG Developers Conference
Processor
Root Complex
DDR
SDRAM
IO Controller Hub
(ICH)
IEEE
1394
PCI Express
GFX
PCI
PCI Express
Serial ATA
HDD
USB 2.0
LPC
GB
Ethernet
Add-In Add-In Add-In
PCI Express
GFX
FSB
PCI Express
Link
S
IO
COM1
COM2
Slot
Slots
Example Low Cost
PCI Express System
Example Low Cost
PCI Express System
Copyright 2006, PCI-SIG, All Rights Reserved 10 PCI-SIG Developers Conference
Processor Processor
Root Complex
GFX
DDR
SDRAM
10Gb
Ethernet
PCI
InfiniBand
Switch
Out-of-Box
SCSI
RAID Disk array
IEEE
1394
InfiniBand
Gb
Ethernet
PCI Express
Link
Switch Switch
Switch
PCI Express
GFX
FSB
S
IO
COM1
COM2
Endpoint
Endpoint
Endpoint Endpoint
Endpoint
Endpoint
10Gb
Ethernet
Endpoint
Add-In
Add-In
Fiber
Channel
Slots
PCI Express
to-PCI
Example PCI Express
Server System
Example PCI Express
Server System
Copyright 2006, PCI-SIG, All Rights Reserved 11 PCI-SIG Developers Conference
Request are translated to one of four transaction types by
the Transaction Layer:
1. Memory Read or Memory Write. Used to transfer data from or to a
memory mapped location
The protocol also supports a locked memory read transaction variant.
2. I/O Read or I/O Write. Used to transfer data from or to an I/O location
These transactions are restricted to supporting legacy endpoint
devices.
3. Configuration Read or Configuration Write. Used to discover device
capabilities, program features, and check status in the 4KB PCI Express
configuration space.
4. Messages. Handled like posted writes. Used for event signaling and
general purpose messaging.
Transaction Types,
Address Spaces
Transaction Types,
Address Spaces
Copyright 2006, PCI-SIG, All Rights Reserved 12 PCI-SIG Developers Conference
CplD Completion with Data (used for memory, IO and configuration read completions)
Cpl Completion without Data (used for IO, configuration write completions and read
completion with error completion status)
MRd Memory Read Request
CplDLk
CplLk
MsgD
Msg
CfgWr0, CfgWr1
CfgRd0, CfgRd1
IOWr
IORd
MWr
MRdLk
Abbreviated
Name
Completion for Locked Memory Read with Data
Completion for Locked Memory Read without Data (used for error status)
Message Request with Data Payload
Message Request without Data Payload
Configuration Write Request Type 0 and Type 1
Configuration Read Request Type 0 and Type 1
IO Write Request
IO Read Request
Memory Write Request
Memory Read Request Locked Access
Description
PCI Express TLP Types
PCI Express TLP Types
Copyright 2006, PCI-SIG, All Rights Reserved 13 PCI-SIG Developers Conference
Each request or completion header is tagged as to its type, and
each of the packet types is routed based on one of three
schemes:
Address Routing
ID Routing
Implicit Routing
Memory and IO requests use address routing.
Completions and Configuration cycles use ID routing.
Message requests have selectable routing based on a 3-bit
code in the message routing sub-field of the header type field.
Three Methods For
Packet Routing
Three Methods For
Packet Routing
Copyright 2006, PCI-SIG, All Rights Reserved 14 PCI-SIG Developers Conference
Programmed I/O
Transaction
Programmed I/O
Transaction
Processor Processor
Root Complex
DDR
SDRAM
Endpoint Endpoint Endpoint
Endpoint Endpoint
Switch A Switch C
Switch B
FSB
MRd
MRd
MRd
CplD
CplD
CplD
Requester:
-Step 1: Root Complex (requester)
initiates Memory Read Request (MRd)
-Step 4: Root Complex receives CplD
Completer:
-Step 2: Endpoint (completer)
receives MRd
-Step 3: Endpoint returns
Completion with data (CplD)
MRd
Copyright 2006, PCI-SIG, All Rights Reserved 15 PCI-SIG Developers Conference
Processor Processor
Root Complex
DDR
SDRAM
Endpoint Endpoint Endpoint
Endpoint
Switch A Switch C
Switch B
FSB
Requester:
-Step 1: Endpoint (requester)
initiates Memory Read Request (MRd)
-Step 4: Endpoint receives CplD
MRd
MRd
MRd
Completer:
-Step 2: Root Complex (completer)
receives MRd
-Step 3: Root Complex returns
Completion with data (CplD)
CplD
CplD
CplD
Endpoint
DMA Transaction
DMA Transaction
Copyright 2006, PCI-SIG, All Rights Reserved 16 PCI-SIG Developers Conference
Processor Processor
Root Complex
DDR
SDRAM
Endpoint Endpoint Endpoint
Endpoint Endpoint
Switch A Switch C
Switch B
FSB
Requester:
-Step 1: Endpoint (requester)
initiates Memory Read Request (MRd)
-Step 4: Endpoint receives CplD
MRd
MRd
MRd
Completer:
-Step 2: Endpoint (completer)
receives MRd
-Step 3: Endpoint returns
Completion with data (CplD)
CplD
CplD
CplD MRd
MRd CplD
CplD
Peer-to-Peer Transaction
Peer-to-Peer Transaction
Copyright 2006, PCI-SIG, All Rights Reserved 17 PCI-SIG Developers Conference
PCI Express
Device Layers
PCI Express
Device Layers
Device Core
PCI Express Core
Logic Interface
Transaction Layer
Data Link Layer
Physical Layer
TX RX
PCI Express Device A
Device Core
PCI Express Core
Logic Interface
Transaction Layer
Data Link Layer
Physical Layer
TX RX
PCI Express Device B
Link
Copyright 2006, PCI-SIG, All Rights Reserved 18 PCI-SIG Developers Conference
Device Core
PCI Express Core
Logic Interface
Transaction Layer
Data Link Layer
Physical Layer
TX RX
PCI Express Device A
Device Core
PCI Express Core
Logic Interface
Transaction Layer
Data Link Layer
Physical Layer
TX RX
PCI Express Device B
Link
TLP
Transmitted
TLP
Received
TLP Origin
and Destination
TLP Origin
and Destination
Copyright 2006, PCI-SIG, All Rights Reserved 19 PCI-SIG Developers Conference
Created by Transaction Layer
Appended by Data Link Layer
Appended by Physical Layer
Bit transmit direction
Information in core section of TLP comes
from Software Layer / Device Core
TLP Structure
TLP Structure
Header Data Payload ECRC Sequence LCRC Start End
1B 2B 1DW 1B 1DW 0-1024 DW 3-4 DW
Copyright 2006, PCI-SIG, All Rights Reserved 20 PCI-SIG Developers Conference
Device Core
PCI Express Core
Logic Interface
Transaction Layer
Data Link Layer
Physical Layer
TX RX
PCI Express Device A
Device Core
PCI Express Core
Logic Interface
Transaction Layer
Data Link Layer
Physical Layer
TX RX
PCI Express Device B
Link
DLLP
Transmitted
DLLP
Received
DLLP Origin
and Destination
DLLP Origin
and Destination
Copyright 2006, PCI-SIG, All Rights Reserved 21 PCI-SIG Developers Conference
Start End DLLP CRC
Data Link Layer
Appended by Physical Layer
Bit transmit direction
DLLP Structure
DLLP Structure
ACK / NAK Packets
Flow Control Packets
Power Management Packets
Vendor Defined Packets
1B 4B 2B 1B
Copyright 2006, PCI-SIG, All Rights Reserved 22 PCI-SIG Developers Conference
Device Core
PCI Express Core
Logic Interface
Transaction Layer
Data Link Layer
Physical Layer
TX RX
PCI Express Device A
Device Core
PCI Express Core
Logic Interface
Transaction Layer
Data Link Layer
Physical Layer
TX RX
PCI Express Device B
Link
Ordered-Set
Transmitted
Ordered-Set
Received
Ordered-Set Origin
and Destination
Ordered-Set Origin
and Destination
Copyright 2006, PCI-SIG, All Rights Reserved 23 PCI-SIG Developers Conference
COM Identifier Identifier Identifier
Training Sequence One (TS1)
16 character set: 1 COM, 15 TS1 data characters
Training Sequence Two (TS2)
16 character set: 1 COM, 15 TS2 data characters
SKIP
4 character set: 1 COM followed by 3 SKP identifiers
Electrical Idle (IDLE)
4 characters: 1 COM followed by 3 IDL identifiers
Fast Training Sequence (FTS)
4 characters: 1 COM followed by 3 FTS identifiers
Ordered-Set Structure
Ordered-Set Structure
Copyright 2006, PCI-SIG, All Rights Reserved 24 PCI-SIG Developers Conference
Processor Processor
Root Complex
GFX
DDR
SDRAM
10Gb
Ethernet
PCI Express
to-PCI
PCI
InfiniBand
Switch
SCSI
RAID Disk array
IEEE
1394
Out-of-Box
InfiniBand
SCSI
PCI Express
Link
Switch Switch
Switch
PCI Express
GFX
S
IO
COM1
COM2
Endpoint
Endpoint
Endpoint Endpoint
Endpoint
Endpoint
10Gb
Ethernet
Endpoint
Add-In
Video
Camera
Fiber
Channel
Slots
Slot
Quality of Service
Quality of Service
Copyright 2006, PCI-SIG, All Rights Reserved 25 PCI-SIG Developers Conference
Receiver Device B
Quality of Service (QoS) policy through Virtual
Channel and Traffic Class tags
VC0
VC1
T
C
/
V
C

M
a
p
p
i
n
g
TC[7:0]
TC[2:0]
maps to
VC0
TC[7:3]
maps to
VC1
Transmitter Device A
Link
Buffers
A
r
b
i
t
r
a
t
i
o
n
Buffers TC[7:0]
VC0
VC1
VC0
VC1
One physical Link,
multiple virtual paths
T
C
/
V
C

M
a
p
p
i
n
g
Traffic Classes
and Virtual Channels
Traffic Classes
and Virtual Channels
Copyright 2006, PCI-SIG, All Rights Reserved 26 PCI-SIG Developers Conference
VC0
0
1
2
VC1
TC[2:0] to VC0
TC[7:3] to VC1
Link
T
C
/
V
C

M
a
p
p
i
n
g
f
o
r

E
g
r
e
s
s

P
o
r
t

0
VC0
VC1
TC[2:0] to VC0
TC[7:3] to VC1
Link
VC0
Port
Arb
VC1
Port
Arb
VC
Arb
VC0
VC1
Link
T
C
/
V
C

M
a
p
p
i
n
g
f
o
r

E
g
r
e
s
s

P
o
r
t

0
VC0
VC1
Port Arbitration
and VC Arbitration
Port Arbitration
and VC Arbitration
Copyright 2006, PCI-SIG, All Rights Reserved 27 PCI-SIG Developers Conference
Credit-based flow control is point-to-point
based, not end-to-end
Receiver Transmitter
Flow Control DLLP (FCx)
TLP
VC Buffer
Receiver sends Flow Control Packets (FCP) which are a type of DLLP (Data Link Layer Packet)
to provide the transmitter with credits so that it can transmit packets to the receiver
Buffer space
available
PCI Express
Flow Control
PCI Express
Flow Control
Copyright 2006, PCI-SIG, All Rights Reserved 28 PCI-SIG Developers Conference
Replay
Buffer
ACK /
NAK
DLLP
De-mux
Mux
From
Transaction Layer
Data Link Layer
Tx Rx
TLP
Sequence TLP LCRC
Transmit
Device A
Receiver
Device B
Tx
Error
Check
TLP
Sequence TLP LCRC
De-mux
Mux
To
Transaction Layer
Data Link Layer
Tx Rx
ACK /
NAK
DLLP
Rx
TLP
Sequence TLP LCRC
ACK /
NAK
DLLP
Link
ACK/NAK
Protocol Overview
ACK/NAK
Protocol Overview
Copyright 2006, PCI-SIG, All Rights Reserved 29 PCI-SIG Developers Conference
ACK returned for good reception of Request or Completion
NAK returned for error reception of Request or Completion
Requester Completer
1a. Request
Switch
2a. Request
3a. Completion 4a. Completion
1b. ACK 2b. ACK
4b. ACK 3b. ACK
ACK/NAK Protocol:
Point-to-Point
ACK/NAK Protocol:
Point-to-Point
Copyright 2006, PCI-SIG, All Rights Reserved 30 PCI-SIG Developers Conference
PCI Express supports three interrupt reporting
mechanisms:
1. Message Signaled Interrupts (MSI)
Legacy endpoints are required to support MSI (or MSI-X) with 32- or
64-bit MSI capability register implementation
Native PCI Express endpoints are required to support MSI with 64-bit MSI
capability register implementation
2. Message Signaled Interrupts - X (MSI-X)
Legacy and native endpoints are required to support MSI-X (or MSI)
and implement the associated MSI-X capability register
3. INTx Emulation.
Native and Legacy endpoints are required to support Legacy INTx
Emulation
PCI Express defines in-band messages which emulate the four
physical interrupt signals (INTA-INTD) routed between PCI devices
and the system interrupt controller
Forwarding support required by switches
Interrupt Model:
Three Methods
Interrupt Model:
Three Methods
Copyright 2006, PCI-SIG, All Rights Reserved 31 PCI-SIG Developers Conference
x
PCIe
Native and Legacy
Interrupts
Native and Legacy
Interrupts
PCIe
PCIe -
Copyright 2006, PCI-SIG, All Rights Reserved 32 PCI-SIG Developers Conference
All PCI Express devices are required to support some
combination of:
Existing software written for generic PCI error handling, and which
takes advantage of the fact that PCI Express has mapped many of
its error conditions to existing PCI error handling mechanisms.
Additional PCI Express-specific reporting mechanisms
Errors are classified as correctable and uncorrectable.
Uncorrectable errors are further divided into:
Fatal uncorrectable errors
Non-fatal uncorrectable errors.
PCI Express
Error Handling
PCI Express
Error Handling
Copyright 2006, PCI-SIG, All Rights Reserved 33 PCI-SIG Developers Conference
Errors classified as correctable, degrade system
performance, but recovery can occur with no loss of
information
Hardware is responsible for recovery from a correctable error and
no software intervention is required.
Even though hardware handles the correction, logging the
frequency of correctable errors may be useful if software is
monitoring link operations.
An example of a correctable error is the detection of a link
CRC (LCRC) error when a TLP is sent, resulting in a Data
Link Layer retry event.
Correctable Errors
Correctable Errors
Copyright 2006, PCI-SIG, All Rights Reserved 34 PCI-SIG Developers Conference
Errors classified as uncorrectable impair the functionality
of the interface and there is no specification mechanism
to correct these errors
The two subgroups are fatal and non-fatal
1. Fatal Uncorrectable Errors: Errors which render the link
unreliable
First-level strategy for recovery may involve a link reset by the
system
Handling of fatal errors is platform-specific
2. Non-Fatal Uncorrectable Errors: Uncorrectable errors
associated with a particular transaction, while the link itself is
reliable
Software may limit recovery strategy to the device(s) involved
Transactions between other devices are not affected
Uncorrectable Errors
Uncorrectable Errors
Copyright 2006, PCI-SIG, All Rights Reserved 35 PCI-SIG Developers Conference
Enabling/disabling error reporting
Providing error status
Providing error status for Link Training
Initiating Link Re-training
Registers provide control and status for
Correctable errors
Non-fatal uncorrectable errors
Fatal uncorrectable errors
Unsupported request errors
Baseline
Error Reporting
Baseline
Error Reporting
Copyright 2006, PCI-SIG, All Rights Reserved 36 PCI-SIG Developers Conference
Finer granularity in defining error type
Ability to define severity of uncorrectable errors
Either send ERR_FATAL or ERR_NONFATAL
message for a given error
Support for error logging of error type and TLP
header related to error
Ability to mask reporting of errors
Enable/disable root reporting of errors
Identify source of errors
Advanced
Error Reporting
Advanced
Error Reporting
Copyright 2006, PCI-SIG, All Rights Reserved 37 PCI-SIG Developers Conference
PCI Express
Configuration Space
PCI Express
Configuration Space
Copyright 2006, PCI-SIG, All Rights Reserved 38
Questions?
Questions?
THANK YOU!
THANK YOU!
Copyright 2006, PCI-SIG, All Rights Reserved 39 PCI-SIG Developers Conference
Thank you for attending the
PCI-SIG Developers Conference 2006.
For more information please go to
www.pcisig.com
Copyright 2006, PCI-SIG, All Rights Reserved 40
PCI Express Basics
PCI Express Basics
Joe Winkles
Senior Staff Engineer
MindShare, Inc.
Joe Winkles
Senior Staff Engineer
MindShare, Inc.

S-ar putea să vă placă și