usb good info1
TRANSCRIPT
-
7/29/2019 USB Good Info1
1/18
USBUniversal Serial Bus
Basic Protocol
&
Verification Methodolgy of USB block
-
7/29/2019 USB Good Info1
2/18
USB
USB COMMUNICATION LAYERS
1. PHYISICAL LAYER
2. PROTOCOL ENGINE LAYER
3. APPLICATION LAYER
USB PROTOCOL
1. TRANSFER TYPE
2. PACKET FORMAT
-
7/29/2019 USB Good Info1
3/18
FRAMES
What is a Frame ?
-
7/29/2019 USB Good Info1
4/18
Frames
-
7/29/2019 USB Good Info1
5/18
The Fundamental Packet
All communications on the USB are organized into small packets.
Four types of packets:
Token, Data, Handshake, and Special.
Each packets consists of 3 parts:
Start (SYNC), information and end.
-
7/29/2019 USB Good Info1
6/18
Packet Types
NYET (No Response Yet)0110
STALL Handshake1110
NAK Handshake1010
ACK Handshake0010
Handshake
MDATA1111
DATA20111
DATA11011
DATA00011
Data
SETUP Token1101
SOF Token0101
IN Token1001
OUT Token0001
Token
Packet IdentifierPID ValueGroup
-
7/29/2019 USB Good Info1
7/18
Four Data flow Types
ExamplesMax size
HS
Max size
FS
Max size
LS
Importantattributes
Type
Systemcontrol
64648Quality +time
Control
Audio, video30721023-timeIsochronous
Printer,scanner
51264-QualityBulk
Mouse,keyboard
3072648Quality +time
Interrupt
-
7/29/2019 USB Good Info1
8/18
USB Data Transfer Types
Interrupt - A device like a mouse or a keyboard, which will be sending very
little data, would choose the interrupt mode.
Bulk - A device like a printer, which receives data in one big packet, uses t
bulk transfer mode. A block of data is sent to the printer (in 64-byte chunks)
and verified to make sure it is correct.
Isochronous - A streaming device (such as speakers) uses the isochronou
mode. Data streams between the device and the host in real-time, and ther
is no error correction.
As devices are enumerated, the host is keeping track of the total bandwidththat all of the isochronous and interrupt devices are requesting. They can
consume up to 90% of the 480 Mbps of bandwidth that is available. After 90
is used up, the host denies access to any other isochronous or interrupt
devices. Control packets for bulk transfers use any bandwidth left over.
-
7/29/2019 USB Good Info1
9/18
Control Transfer
-
7/29/2019 USB Good Info1
10/18
Bulk Transfer
IN transfer - in which the host asks for data from the device - data
flow direction is from the device into the host.
OUT transfer - in which the host whishes to send data to the device -
data flows from the host out to the device.
-
7/29/2019 USB Good Info1
11/18
Bulk Transfer - OUT
-
7/29/2019 USB Good Info1
12/18
Bulk IN transfer
-
7/29/2019 USB Good Info1
13/18
Interrupt Transfer
-
7/29/2019 USB Good Info1
14/18
Isochronous Transfer
-
7/29/2019 USB Good Info1
15/18
Enumeration
When a device is attached, the OS enumerates the device, identifiesits driver, and assigns an address to it.
In the numeration process, data structures (transfer descriptors)contain information needed by the host to generate transactions. Thisinformation includes:
USB device address.
Type of transfer.
Direction of transfer (write or read).
Transfer size (# of bytes).
Speed.
Address of the device drivers memory buffer.
-
7/29/2019 USB Good Info1
16/18
Enumeration Steps
Getting the device descriptor.
Setting an address.
Getting the device descriptor again.
Getting the configuration descriptor.
Selecting the device driver.
Setting the configuration.
-
7/29/2019 USB Good Info1
17/18
Transaction Format
Control Transfer
SET_ADDRESS : setting a permanent address to afunction.
GET_DEVICE_DESCRIPTOR: the host wishes to get thedevice descriptor, which contains details concerning the
device - how many configurations, interfaces it has, isthe device is self/ bus powered etc.
GET_CONFIGURATION_DESCRIPTOR: the host wishes tolearn about a specific configuration of a device.
GET_CONFIGURATION: the host detects whichconfiguration is active at the moment in the device.
SET_CONFIGURATION: the host sets a specificconfiguration on the device.
-
7/29/2019 USB Good Info1
18/18
USB Verification Diagram
DUT
USB_SLM
Denali
Testcase.in
USB IO
Flash Cache 8051
PHUB DMA
PFSUB
Testcase.c
tst.v