pci - Ingeniería Eléctricaiie.fing.edu.uy/ense/asign/mp1/pci/pci.pdf · REQ[3:0]# I 5V PCI...
Transcript of pci - Ingeniería Eléctricaiie.fing.edu.uy/ense/asign/mp1/pci/pci.pdf · REQ[3:0]# I 5V PCI...
�
Bus PCI
J. P. Oliver
Instituto de Ingeniería EléctricaFacultad de Ingeniería
Universidad de la República
• ISA• EISA• VESA• Micro Channel• PCI• PCI PCI-X 64 bits 133MHz• PCI Special Interest Group.
– PCI Local Bus Specification Rev 2.2, Dec. 1998.– PCI to PCI Bridge Architecture Specification Rev 1.1, Dec. 1998.
– PCI System Design Guide
– PCI BIOS Specification
– www.pcisig.com
Introducción
32 bits, 33MHz64 bits, 66MHz
�
������������� ����� ���
� �������
� ���������
� ����������������������
� ��������������
� ��� ������������������
� ������������������� �!����"
� #����������$������%���� ��&���
� '(�)��*'(
�������������)�
����%����
��+�,
�-�.���-�+
���/��������
����� (����
-�+�-�+
������
+��
������0�1���+
+��
�����
��%��$
��%��$���
-�+���
�-����������
���+���
+�����
-�+���
�
Intel 430HX PCIsetSystem BlockDiagram
/�� 2��333*�����*��%��������/�
���������&��456758�*-#9
Memory SpaceOrganization
6
Name Type DescriptionAD[31:0] I/O
5VAddress/Data:�The�standard�PCI�address�and�data�lines.�Address�is�driven�with�FRAME#assertion,�data�is�driven�or�received�in�following�clocks.
C/BE[3:0]# I/O5V
Command/Byte�Enable:�The�command�is�driven�with�FRAME#�assertion,�byte�enablescorresponding�to�supplied�or�requested�data�is�driven�on�following�clocks.
FRAME# I/O5V
Frame:�Assertion�indicates�the�address�phase�of�a�PCI�transfer.�Negation�indicates�that�onemore�data�transfer�is�desired�by�the�cycle�initiator.
DEVSEL# I/O5V
Device�Select:�This�signal�is�driven�by�the�TXC�when�a�PCI�initiator�is�attempting�to�accessDRAM.�DEVSEL#�is�asserted�at�medium�decode�time.
IRDY# I/O5V Initiator�Ready:�Asserted�when�the�initiator�is�ready�for�a�data�transfer.
TRDY# I/O5V Target�Ready:�Asserted�when�the�target�is�ready�for�a�data�transfer.
STOP# I/O5V Stop:�Asserted�by�the�target�to�request�the�master�to�stop�the�current�transaction.
LOCK# I/O5V Lock:�Used�to�establish,�maintain,�and�release�resource�locks�on�PCI.
REQ[3:0]# I5V
PCI�Request:�PCI�master�requests�for�PCI.�Weak�external�pull-up�resistors�are�Required�onthese�signals.
GNT[3:0]# O5V
PCI�Grant:�Permission�is�given�to�the�master�to�use�PCI.�Weak�external�pull-up�resistors�arerequired�on�these�signals.
PHLD# I5V
PCI�Hold:�This�signal�comes�from�the�expansion�bridge.�It�is�the�bridge�request�for�PCI.�ThePHLD#�protocol�supports�passive�release.�A�weak�external�pull-up�resistor�is�required�on�thissignal.
PHLDA# O5V
PCI�Hold�Acknowledge:�This�signal� is�driven�by�the�TXC�to�grant�PCI�to�the�expansion�bridge.The�PHLDA#�protocol�supports�passive�release.�A�weak�external�pull-up�resistor�is�required�onthis�signal.
PAR I/O5V
Parity:�A�single�parity�bit�is�provided�over�AD[31:0]�and�C/BE[3:0].
SERR# O5V
SYSTEM�ERROR:�The�TXC�asserts�SERR#�to�signal�a�system�error.�A�system�error�can�beoptionally�generated�for�either�single�bit�error�(correctable)�events�or�any�ECC�bit�error(correctable�or�uncorrectable),�or�for�parity�error.
'
Master�/�Target
• Master�(Iniciator)– pide�el�bus
– inicia�transferencias�RD�o�WR
• Target– acepta�transf.�si�es�direccionado�RD�o�WR
– puede�terminar
PCI�bus�commandscben[3..0]��Bus�Command
0000� Interrupt�acknowledge0001� Special�cycle0010� I/O�read0011� I/O�write0100� Reserved0101� Reserved0110� Memory�read0111� Memory�write
cben[3..0]��Bus�Command
1000� Reserved1001� Reserved1010� Configuration�read1011� Configuration�write1100� Memory�read�multiple1101� Dual�address�cycle�(DAC)1110� Memory�read�line1111� Memory�write�and�
invalidate
7
PCI�configuration�registersAddress
3 2 1 0
00h
04h
08h Revision�ID
0Ch BIST Header�Type Latency�Timer Cache�Line�size
10h
14h
18h
1Ch
20h
24h
28h
2Ch
30h
34h Capabilities�Pointer
38h
3Ch Maximum�Latency Minimun�Grant Interrupt�Pin� Interrupt�Line
Byte
Device�ID Vendor�ID
Command�RegisterStatus�Register
Class�Code
Base�Address�Register�0
Base�Address�Register�1
Base�Address�Register�2
Base�Address�Register�3
Base�Address�Register�4
Base�Address�Register�5
Card�Bus�CIS�Pointer
Reserved
Subsystem�ID Subsystem�Vendor�ID
Expansion�ROM�Base�Address�Register
Reserved
Configuration�cycle
5
Burst-Read�cycle
Burst-Write�cycle
:
����3���
� ;�)%��������������� ����<�����-�+=
> ?������������!��%� ��������%�%����
> .�$���������������+,�� ���������������
������������ ����@��$�����������
����������*
> -�+�������������������
> .�$���������� ������ ���
� -�+��A�%�%����
� %�%�����A�-�+
����3���
� ����%��� �����@��B�������C2�0���&D�1�
> ������ ���������������������������������
� ?��#,�� ������������������������������
%�%�������������
> #-�+� #,��-��������������+��������"
> /�� 2��333*�������*��%��E� �
4
Problemas
• Lograr�burst�en�ambos�sentidos�en�plataformas�PC
• Velocidad�del�diseño
• Target�solo�ó�Master�Target�?
• DMA�?
• Software:�si�usamos�un�SO�de�“verdad”�es�necesarioimplementar�un�DEVICE�DRIVER
Guías�para�un�diseño�eficiente
• Las�elecciones�en�el�diseño�de�la�interfaz�PCI�son�devital�importancia�para�determinar�la�performance�delsistema.
• Las�diferencias�de�performance�en�diferentes�placasPCI�son�causadas�por�diferencias�en�laimplementación�de�la�interfaz�PCI.
• Hay�reglas�a�seguir�que�determinan�un�sistema
eficiente�y�de�alta�performance.
�8
Reglas�Para�Un�Diseño�PCIEficiente
Implementar�comandos�PCI�avanzados.• Usar�Memory�Read�Line�(MRL)�para�lecturas�menores�a�1
línea�de�cache�y�de�más�de�4�bytes�(en�lugar�de�realizar�unaLectura�Común).�En�porcesadores�Pentium�y�Pentium�pro�unalínea�de�cache�es�de�32�bytes�(8�Dwords).
• Usar�Memory�Read�Multiple�(MRM)�para�lecturas�de�untamáño�mayor�a�1�línea�de�cache.
• Usar�Memory�Write�Invalidate�(MWI)�para�escrituras�amúltiples�líneas�de�cache�(deben�estar�alineadas).�Noterminar�un�comando�Memory�Write�(MW)�largo�paraempezar�un�comando�MWI.
Reglas�Para�Un�Diseño�PCIEficiente
Usar�bursts�largos.• Para�lecturas,�es�necesario�utiliar�bursts�de�al�menos�64
Dwords�(32�bit�words)�para�obtener�buena�performanceen�algunas�plataformas.
• Para�escrituras,�los�bursts�deben�ser�al�menos�tan�largoscomo�el�cache�line.
Usar�comandos�de�memoria,�no�comandosde�I/O.
��
Reglas�Para�Un�Diseño�PCIEficiente
Minimizar�Latencia.– Responder�a�accessos�lo�más�rápido�posible�y
tratar�de�evitar�insertar�estados�de�WAIT�en�delas�transferencias�de�bloques.
Seguir las reglas, NO experimentar.– Es�posible�obtener�sistemas�de�buena�performance�sin
seguir�las�reglas,�pero�este�sistema�puede�nocomportarse�bien�en�sistemas�futuros.
PCICore�deAltera
��
Placa�ARC-PCI
Placa�ARC-PCI
��
Placa�ARC-PCI
Algunas�Conclusiones
• PCI�no�es�fácil�(comparado�con�ISA)• Un�core�PCI�requiere�gran�cantidad�de
celdas• Diseño�cuidadoso�para�cumplir
requisitos�de�tiempos�(con�los�chips�dela�ARC-PCI)
• Para�lograr�buena�velocidad�esnecesario�Master/Target�con�DMA
�6
¿En�Qué�Estamos?
• ARC-PCI– Desarrollar�una�interfaz�PCI�que�pueda�transferir
burts�sin�wait�en�ambos�sentidos– Desarrollar�una�biblioteca�hardware�transparente
al�programador– Desarrollar�un�driver�Linux– Desarrollar�un�core�PCI�propio
• Diseñar�una�nueva�placa�PCI�con�chips�másrápidos�y�SDRAM