03 29 PCI Express Basics

40
Copyright © 2007, PCI-SIG, All Rights Reserved 1 PCI Express ® Basics Ravi Budruk Senior Staff Engineer and Partner MindShare, Inc. Ravi Budruk Senior Staff Engineer and Partner MindShare, Inc.

description

PCI Express Basics

Transcript of 03 29 PCI Express Basics

Page 1: 03 29 PCI Express Basics

Copyright © 2007, PCI-SIG, All Rights Reserved 1

PCI Express® Basics

Ravi BudrukSenior Staff Engineer and Partner

MindShare, Inc.

Ravi BudrukSenior Staff Engineer and Partner

MindShare, Inc.

Page 2: 03 29 PCI Express Basics

Copyright © 2007, PCI-SIG, All Rights Reserved 2PCI-SIG Developers Conference

PCI Express architecture is a high performance, IO interconnect for peripherals in computing/communication platformsEvolved from PCI and PCI-X™ architectures

Yet PCI Express architecture is significantly different from itspredecessors PCI and PCI-X

PCI Express is a serial point-to-point interconnect between two devicesImplements packet based protocol for information transferScalable performance based on number of signal Lanes implemented on the PCI Express interconnect

PCI Express Introduction

Page 3: 03 29 PCI Express Basics

Copyright © 2007, PCI-SIG, All Rights Reserved 3PCI-SIG Developers Conference

Link

Lane

PCI Express Terminology

PCI Express Device A

PCI Express Device B

Signal

Wire

Page 4: 03 29 PCI Express Basics

Copyright © 2007, PCI-SIG, All Rights Reserved 4PCI-SIG Developers Conference

Assumes 2.5 GT/s signaling in each direction80% BW utilized due to 8b/10b encoding overheadAggregate bandwidth implies simultaneous traffic in both directionsPeak bandwidth is higher than any bus available

PCIe 2.0 PHYs may optionally support 5 GT/s signaling, thus doubling above bandwidth numbers

16864210.5Aggregate BW

(GBytes/s)

x32x16x12x8x4x2x1Link Width

PCI Express Throughput

Page 5: 03 29 PCI Express Basics

Copyright © 2007, PCI-SIG, All Rights Reserved 5PCI-SIG Developers Conference

PCI Express FeaturesPoint-to-point connectionSerial bus means fewer pinsScaleable: x1, x2, x4, x8, x12, x16, x32Dual Simplex connection2.5VGT/s transfer/direction/sPacket based transaction protocol

PCIe®

DeviceA

PCIeDevice

BLink (x1, x2, x4, x8, x12, x16 or x32)

Packet

Packet

Page 6: 03 29 PCI Express Basics

Copyright © 2007, PCI-SIG, All Rights Reserved 6PCI-SIG Developers Conference

Electrical characteristics of PCI Express signalDifferential 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

Vcm

Differential Signaling

Page 7: 03 29 PCI Express Basics

Copyright © 2007, PCI-SIG, All Rights Reserved 7PCI-SIG Developers Conference

Switch

PCIeEndpoint

LegacyEndpoint

PCIeEndpoint

Root Complex

CPU

PCIe

Memory

PCIeBridge To

PCIe PCIe

PCIe PCIe

LegendPCI Express Device Downstream PortPCI Express Device Upstream Port

PCIeEndpoint

PCI/PCI-X

PCI/PCI-X

Example PCI ExpressTopology

PCIe

Page 8: 03 29 PCI Express Basics

Copyright © 2007, PCI-SIG, All Rights Reserved 8PCI-SIG Developers Conference

Switch

PCIeEndpoint

LegacyEndpoint

PCIeEndpoint

Root Complex

CPU

PCIe

Memory

PCIeBridge To

PCIe PCIe

PCIe PCIe

LegendPCI Express Device Downstream PortPCI Express Device Upstream Port

PCIeEndpoint

PCI/PCI-X

PCI/PCI-X

Root

VirtualPCI

Bridge

VirtualPCI

Bridge

VirtualPCI

Bridge

RCRB

Bus 0

PCI Express Links

CPU Bus

Switch

VirtualPCI

Bridge

VirtualPCI

Bridge

VirtualPCI

Bridge

VirtualPCI

Bridge

Example PCI Express Topology – Root & Switch

PCIe

Page 9: 03 29 PCI Express Basics

Copyright © 2007, PCI-SIG, All Rights Reserved 9PCI-SIG Developers Conference

Processor

Root ComplexDDR

SDRAM

IO Controller Hub(ICH) IEEE

1394

PCI ExpressGFX

PCIPCI Express

Serial ATAHDD

USB 2.0

LPC

GBEthernet Add-In Add-In Add-In

PCI Express

GFX

FSB

PCI ExpressLink

SIO

COM1COM2

Slot

Slots

Example Low Cost PCI Express System

Page 10: 03 29 PCI Express Basics

Copyright © 2007, PCI-SIG, All Rights Reserved 10PCI-SIG Developers Conference

Processor Processor

Root ComplexGFX DDR SDRAM

10GbEthernet

PCI

InfiniBandSwitch

“Out-of-Box”

SCSI

RAID Disk array

IEEE1394

InfiniBand

GbEthernet

PCI ExpressLink

Switch Switch

Switch

PCI ExpressGFX

FSB

SIO

COM1COM2

Endpoint

Endpoint

Endpoint Endpoint

Endpoint

Endpoint

10GbEthernetEndpoint

Add-In

Add-In

FiberChannel

Slots

PCI Expressto-PCI

Example PCI Express Server System

Page 11: 03 29 PCI Express Basics

Copyright © 2007, PCI-SIG, All Rights Reserved 11PCI-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

Page 12: 03 29 PCI Express Basics

Copyright © 2007, PCI-SIG, All Rights Reserved 12PCI-SIG Developers Conference

CplDCompletion with Data (used for memory, IO and configuration read completions)

CplCompletion without Data (used for IO, configuration write completions and read completion with error completion status)

MRdMemory 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

Page 13: 03 29 PCI Express Basics

Copyright © 2007, PCI-SIG, All Rights Reserved 13PCI-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 RoutingID 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 ForPacket Routing

Page 14: 03 29 PCI Express Basics

Copyright © 2007, PCI-SIG, All Rights Reserved 14PCI-SIG Developers Conference

Programmed I/O TransactionProcessor Processor

Root ComplexDDR

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

Page 15: 03 29 PCI Express Basics

Copyright © 2007, PCI-SIG, All Rights Reserved 15PCI-SIG Developers Conference

Processor Processor

Root ComplexDDR

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

Page 16: 03 29 PCI Express Basics

Copyright © 2007, PCI-SIG, All Rights Reserved 16PCI-SIG Developers Conference

Processor Processor

Root ComplexDDR

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

Page 17: 03 29 PCI Express Basics

Copyright © 2007, PCI-SIG, All Rights Reserved 17PCI-SIG Developers Conference

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

Page 18: 03 29 PCI Express Basics

Copyright © 2007, PCI-SIG, All Rights Reserved 18PCI-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

TLPTransmitted

TLPReceived

TLP Origin and Destination

Page 19: 03 29 PCI Express Basics

Copyright © 2007, PCI-SIG, All Rights Reserved 19PCI-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 comesfrom Software Layer / Device Core

TLP Structure

Header Data Payload ECRCSequence LCRCStart End

1B 2B 1DW 1B1DW0-1024 DW3-4 DW

Page 20: 03 29 PCI Express Basics

Copyright © 2007, PCI-SIG, All Rights Reserved 20PCI-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

DLLPTransmitted

DLLPReceived

DLLP Origin and Destination

Page 21: 03 29 PCI Express Basics

Copyright © 2007, PCI-SIG, All Rights Reserved 21PCI-SIG Developers Conference

Start EndDLLP CRC

Data Link Layer

Appended by Physical Layer

Bit transmit direction

DLLP Structure

ACK / NAK PacketsFlow Control PacketsPower Management PacketsVendor Defined Packets

1B 4B 2B 1B

Page 22: 03 29 PCI Express Basics

Copyright © 2007, PCI-SIG, All Rights Reserved 22PCI-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-SetTransmitted

Ordered-SetReceived

Ordered-Set Origin and Destination

Page 23: 03 29 PCI Express Basics

Copyright © 2007, PCI-SIG, All Rights Reserved 23PCI-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

SKIP4 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

Page 24: 03 29 PCI Express Basics

Copyright © 2007, PCI-SIG, All Rights Reserved 24PCI-SIG Developers Conference

Processor Processor

Root ComplexGFX DDR SDRAM

10GbEthernet

PCI Expressto-PCI

PCI

InfiniBandSwitch

SCSI

RAID Disk array

IEEE1394

“Out-of-Box”

InfiniBand

SCSIPCI Express

Link

Switch Switch

Switch

PCI ExpressGFX

SIO

COM1COM2

Endpoint

Endpoint

Endpoint Endpoint

Endpoint

Endpoint

10GbEthernetEndpoint

Add-In

VideoCamera

FiberChannel

Slots

Slot

Quality of Service

Page 25: 03 29 PCI Express Basics

Copyright © 2007, PCI-SIG, All Rights Reserved 25PCI-SIG Developers Conference

Receiver Device B

Quality of Service (QoS) policy through Virtual Channel and Traffic Class tags

VC0

VC1

TC/V

C M

appi

ng

TC[7:0]

TC[2:0]maps to

VC0

TC[7:3]maps to

VC1

Transmitter Device A

Link

Buffers

Arb

itrat

ion

Buffers TC[7:0]

VC0

VC1

VC0

VC1

One physical Link,multiple virtual paths

TC/V

C M

appi

ng

Traffic Classes and Virtual Channels

Page 26: 03 29 PCI Express Basics

Copyright © 2007, PCI-SIG, All Rights Reserved 26PCI-SIG Developers Conference

VC0

0

1

2

VC1

TC[2:0] to VC0

TC[7:3] to VC1

LinkTC/VC M

appin

g

for Egre

ss Port

0

VC0

VC1

TC[2:0] to VC0

TC[7:3] to VC1

Link

VC0PortArb

VC1PortArb

VCArb

VC0

VC1

LinkTC/VC M

appin

g

for Egre

ss Port

0

VC0

VC1

Port Arbitration and VC Arbitration

Page 27: 03 29 PCI Express Basics

Copyright © 2007, PCI-SIG, All Rights Reserved 27PCI-SIG Developers Conference

Credit-based flow control is point-to-point based, not end-to-end

ReceiverTransmitter

Flow Control DLLP (FCx)

TLPVC 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

Page 28: 03 29 PCI Express Basics

Copyright © 2007, PCI-SIG, All Rights Reserved 28PCI-SIG Developers Conference

ReplayBuffer

ACK /NAK

DLLP

De-mux

Mux

FromTransaction Layer

Data Link Layer

Tx Rx

TLPSequence TLP LCRC

TransmitDevice A

ReceiverDevice B

Tx

ErrorCheck

TLPSequence TLP LCRC

De-mux

Mux

ToTransaction Layer

Data Link Layer

Tx Rx

ACK /NAK

DLLP

Rx

TLPSequence TLP LCRC

ACK /NAK

DLLP

Link

ACK/NAK Protocol Overview

Page 29: 03 29 PCI Express Basics

Copyright © 2007, PCI-SIG, All Rights Reserved 29PCI-SIG Developers Conference

ACK returned for good reception of Request or CompletionNAK returned for error reception of Request or Completion

Requester Completer

1a. Request

Switch

2a. Request

3a. Completion4a. Completion

1b. ACK 2b. ACK

4b. ACK 3b. ACK

ACK/NAK Protocol: Point-to-Point

Page 30: 03 29 PCI Express Basics

Copyright © 2007, PCI-SIG, All Rights Reserved 30PCI-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 implementation2. 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

Page 31: 03 29 PCI Express Basics

Copyright © 2007, PCI-SIG, All Rights Reserved 31PCI-SIG Developers Conference

x

PCIe

Native and Legacy Interrupts

PCIe

PCIe -

Page 32: 03 29 PCI Express Basics

Copyright © 2007, PCI-SIG, All Rights Reserved 32PCI-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 errorsNon-fatal uncorrectable errors.

PCI Express Error Handling

Page 33: 03 29 PCI Express Basics

Copyright © 2007, PCI-SIG, All Rights Reserved 33PCI-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

Page 34: 03 29 PCI Express Basics

Copyright © 2007, PCI-SIG, All Rights Reserved 34PCI-SIG Developers Conference

Errors classified as uncorrectable impair the functionality of the interface and there is no specification mechanism to correct these errorsThe 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-specific2. 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

Page 35: 03 29 PCI Express Basics

Copyright © 2007, PCI-SIG, All Rights Reserved 35PCI-SIG Developers Conference

Enabling/disabling error reportingProviding error statusProviding error status for Link TrainingInitiating Link Re-training

Registers provide control and status forCorrectable errorsNon-fatal uncorrectable errorsFatal uncorrectable errorsUnsupported request errors

Baseline Error Reporting

Page 36: 03 29 PCI Express Basics

Copyright © 2007, PCI-SIG, All Rights Reserved 36PCI-SIG Developers Conference

Finer granularity in defining error typeAbility 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 errorAbility to mask reporting of errorsEnable/disable root reporting of errorsIdentify source of errors

Advanced Error Reporting

Page 37: 03 29 PCI Express Basics

Copyright © 2007, PCI-SIG, All Rights Reserved 37PCI-SIG Developers Conference

PCI ExpressConfiguration Space

Page 38: 03 29 PCI Express Basics

Copyright © 2007, PCI-SIG, All Rights Reserved 38PCI-SIG Developers Conference

Summary of Changes for 2.0Higher speed (5.0 GT/s), supported by:

Selectable de-emphasis levelsSelectable transmitter voltage range

Dynamic speed and link width changesPower savings, higher bandwidth, reliability

Virtualization supportAccess Control Services

Other New FeaturesCompletion timeout controlFunction Level ResetModified Compliance Pattern for testing

Page 39: 03 29 PCI Express Basics

Copyright © 2007, PCI-SIG, All Rights Reserved 39PCI-SIG Developers Conference

Thank you for attending the PCI-SIG Developers Conference 2007.

For more information please go to www.pcisig.com

Page 40: 03 29 PCI Express Basics

Copyright © 2007, PCI-SIG, All Rights Reserved 40

PCI Express BasicsPCI Express Basics

Ravi BudrukSenior Staff Engineer and Partner

MindShare, Inc.

Ravi BudrukSenior Staff Engineer and Partner

MindShare, Inc.