[go: up one dir, main page]

JP2004021742A - USB device controller - Google Patents

USB device controller Download PDF

Info

Publication number
JP2004021742A
JP2004021742A JP2002177649A JP2002177649A JP2004021742A JP 2004021742 A JP2004021742 A JP 2004021742A JP 2002177649 A JP2002177649 A JP 2002177649A JP 2002177649 A JP2002177649 A JP 2002177649A JP 2004021742 A JP2004021742 A JP 2004021742A
Authority
JP
Japan
Prior art keywords
data
sram
transfer
usb device
device controller
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
JP2002177649A
Other languages
Japanese (ja)
Inventor
Hiroyuki Abe
阿部 宏幸
Koji Oshikiri
押切 幸治
Sunao Nakabachi
中鉢 直
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Ricoh Co Ltd
Original Assignee
Ricoh Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Ricoh Co Ltd filed Critical Ricoh Co Ltd
Priority to JP2002177649A priority Critical patent/JP2004021742A/en
Publication of JP2004021742A publication Critical patent/JP2004021742A/en
Pending legal-status Critical Current

Links

Images

Landscapes

  • Information Transfer Systems (AREA)

Abstract

【課題】小さい回路規模であって且つUSB規格におけるインターパケットディレイ時間の制約を満足することが可能なUSBデバイスコントローラを提供する。
【解決手段】USB規格に規定されたエンドポイントFIFOにSRAMを使用したUSBデバイスコントローラにおいて、イン転送用エンドポイントFIFOとして機能するSRAM11とシリアルインターフェイスエンジン(SIE)2間のデータ転送経路に転送データ格納用のレジスタ12を設けた
【選択図】    図1
Provided is a USB device controller having a small circuit scale and capable of satisfying a restriction on an inter-packet delay time in the USB standard.
Kind Code: A1 In a USB device controller using an SRAM as an end point FIFO defined by a USB standard, transfer data is stored in a data transfer path between an SRAM 11 functioning as an end point FIFO for in-transfer and a serial interface engine (SIE) 2. [Selection] FIG. 1

Description

【0001】
【発明の属する技術分野】
本発明は、複数の機器間のデータ通信システムにおけるUSBデバイスコントローラに関するものである。
【0002】
【従来の技術】
複数の機器間のデータ通信システムにおけるUSBデバイスコントローラに関連する従来技術として、特開平11−328069号公報が存在する。該公報では、エンドポイントFIFOにデュアルポートメモリを使用することにより、回路規模の小さいUSBインターフェイス装置を提供する。
【0003】
【発明が解決しようとする課題】
Universal Serial Bus(USB)は、パーソナルコンピュータ(PC)と複数のPC周辺機器を接続しデータ通信を行うために策定されたシリアルバスインターフェース規格である。従来のインターフェース規格には無い簡便な接続性や拡張性を特長としており、マウスやキーボード、プリンタ、スキャナ、モデム等のPC周辺機器の多くが近年USBに対応するようになってきている。
【0004】
USB規格ではコントロール転送/バルク転送/インタラプト転送/アイソクロナス転送の4種類の転送モードが定められており、周辺機器(USBデバイス)の用途に応じて転送モードと転送方向を選択することができる。USBにおけるデータ転送方向は、ホストPCから周辺機器(USBデバイス)にデータを転送するものがアウト転送と定義され、USBデバイスからホストPCにデータ転送を行なうものがイン転送と定義されており、データ転送は周辺機器側のUSBデバイスコントローラに設けられたエンドポイントと呼ばれるバッファを介して行なわれることがUSB仕様書に定められている。基本的にはUSBデバイスがサポートする転送モードと転送方向の数と同数のエンドポイントバッファを備える必要がある。
【0005】
図1にUSBデバイスコントローラの構成例を示す。大きくはPHYブロック1、SIE(シリアルインターフェイスエンジン)ブロック2、エンドポイントブロック3、内部レジスタブロック4、ユーザーインターフェイスブロック(I/Fブロック)5に分類される。
【0006】
PHYブロック1は、USBケーブルを介したホストPCとのシリアルデータ送受信及びシリアル/パラレル相互変換等を行なうブロックである。SIEブロック2は、パケットIDデコード/エンコード、CRCの生成/検出等のUSB通信プロトコルに関係した処理を行なうブロックである。
【0007】
エンドポイントブロック3は、エンドポイントFIFO及びその周辺回路により構成され、USB送受信データのバッファリングを行なうブロックである。内部レジスタブロック4は、USBコントローラの制御及び状態確認のためにプリンタ等のデバイス側CPU或いは他のブロックからアクセスされるブロックである。
【0008】
ユーザーインターフェイスブロック5は、プリンタ等のデバイス側メモリとエンドポイントFIFO間のデータ転送及び内部レジスタのアクセスを行なうためのインターフェイスブロックである。
【0009】
ホストPCとUSBデバイス間のデータ送受信は、トランザクションと呼ばれるパケット送受信のシーケンスを使用して実行される。USB仕様においては複数のUSBデバイスが接続可能であるが、1つのトランザクションにおいてデータ送受信の対象となるUSBデバイスはただ1つである。
【0010】
複数デバイスのデータ通信は複数のトランザクションにより可能となるが、各トランザクションが時間的に重複することを防ぐ目的で、トランザクションを構成する各パケット間の時間間隔(インターパケットディレイ時間)とホストPCがトランザクション成立を判断するための時間間隔(タイムアウト時間)がUSB仕様書において厳密に規定されている。
【0011】
インターパケットディレイ時間とタイムアウト時間に関して、イン転送の場合を例に図2を使用して説明する。USB規格において、ホストPCとデバイス接続は最大5個のハブを介して接続された場合でも正常に動作することが要求されており、図2はその最も厳しい場合を示している。イン転送におけるトランザクションは以下に示す様に3つのパケットの正常送受信で成立する。
【0012】
▲1▼ホストPCは特定デバイスに対してデータ送信を要求するためのINトークンパケットを発行する(t=t0)。INトークンパケットには、特定デバイスのUSBアドレス番号とデバイスの持つエンドポイント番号の情報が含まれている。
【0013】
▲2▼INトークンは、ハブとUSBケーブルによる遅延時間(Td=t2−t0)の分だけデバイスに遅れて到着する(t=t2)。特定デバイスのエンドポイントFIFOに送信すべき転送データの準備ができている場合、デバイスは転送データをホストPCに対して送信する(t=t4)。図中のt3とt4の時間間隔(Tipd)がインターパケットディレイ時間の1つである。但し、転送データの準備ができていない場合は転送データの代わりにNAKパケット(図2では示していない)を送信し、該トランザクションは2つのパケット(IN−NAK)で完了する。
【0014】
▲3▼デバイスからの転送データは、ハブとUSBケーブルによる遅延時間(Td’ =t5−t4)の分だけデバイスに遅れて到着する(T=t5)。ホストPCが転送データを正常に受け取った場合、デバイスに対してACKパケットを送信し(t=t8)、トランザクションの成立を通知する。ホストがACKパケットを送信するのはUSB規格に定められたタイムアウト時間(Ttout)以内にデバイスからのデータパケットが到着し、且つ受信したデータにエラーが検出されない場合である。ホストがデータ受信を完了してからACK送信するまでの時間間隔(Tipd’ =t8−t7)もインターパケットディレイ時間である。
【0015】
t3とt4の間隔がインターパケットディレイ時間の最大許容値を超えた場合、t1とt5の間隔もそれに応じて長くなり、タイムアウト時間(Ttout)を越えることになってしまう。この場合、ホストはACKを送信することなく該トランザクションを中断し、ある一定時間経過後に再度INトークンパケットを発行するが、ホストPC間とデバイス間のハブ段数を減らすかエンドポイントFIFOの構成自体をを変更するかしない限り同様なタイムアウトを繰り返すことになるため、対象エンドポイントを使用したデータ転送は不可能になってしまう。
【0016】
USB2.0規格書の場合、HSモードのインターパケットディレイは最大192ビット時間、タイムアウト時間は816ビット時間と定められている。HSモードのデータ転送速度は480Mbpsであることから1ビット時間は約2.08nsである。これらの値はホストPC或いはデバイスのUSBポート上の値を示している。
【0017】
USB2.0規格に準ずる規格として、USB2.0におけるPHYブロックとSIEブロック間のインターフェイス仕様がUTMI(USB Transceiver Macrocell INterface)として定められている。PHYブロックとSIEブロック間はパラレルデータ通信であり、データ幅8ビット/クロック周波数60MHzの仕様とデータ幅16ビット/クロック周波数30MHzの仕様が選択可能である。
【0018】
UTMI仕様においてもUSB2.0規格と同じインターパケットディレイ時間が適用される。例えば16ビット/30MHz仕様の場合、図2のTipd(最大192ビット時間)は7CLKに相当する。UTMI規格のPHYブロックにおいては、USBバス側の480MHzクロックで動作する部分とUTMI側の30MHzで動作する部分に分けられるが、インターパケットディレイ時間制約に関する設計が厳しくなるのはUTMI側である。
【0019】
PHYとSIEはUTMIを介して接続されており、INトークンに対してNAK応答する場合はSIEがNAKパケットを発行することになるため、UTMI上での制約(7CLK以内)を満たすようにUSBコントローラを設計することは比較的容易である。
【0020】
一方、INトークンに対してデータパケットを送信する場合はエンドポイントFIFOに格納されたデータを読み出す必要があるため、その読み出し時間が遅い場合にはUTMI上での制約が満足できなくなる場合がある。
【0021】
エンドポイントFIFOとしては、レジスタを使用するかSRAM等のメモリセルを使用するのが一般的である。エンドポイントFIFOをレジスタで構成する場合、データ読み出し要求から最初のデータが出力される迄の時間は比較的短いため、インターパケットディレイ時間制約を満足する設計は容易であるが回路規模が大きくなるためコスト増大を招いてしまう。
【0022】
一方、SRAM等のメモリセルを使用する場合、回路規模は小さくなるもののレジスタを使用した場合に比べて最初のデータが出力される迄の時間が長くなってしまうため、インターパケットディレイ時間の制約を満足する構成にするのが困難になる。
【0023】
前記特開平11−328069号公報においては、USBデバイスコントローラの送受信メモリ(エンドポイントFIFO)にデュアルポートメモリを使用することで回路規模の縮小を図っているが、上記インターパケットディレイ時間制約に起因する問題に関しては何ら考慮されていない。
【0024】
本発明の目的は、小さい回路規模であって且つUSB規格におけるインターパケットディレイ時間の制約を満足することが可能なUSBデバイスコントローラを提供することにある。
【0025】
【課題を解決するための手段】
上記目的を達成するために、請求項1記載の発明は、USB規格に規定されたエンドポイントFIFOにSRAMを使用したUSBデバイスコントローラにおいて、イン転送用エンドポイントFIFOとして機能するSRAMとシリアルインターフェイスエンジン(SIE)間のデータ転送経路に転送データ格納用のレジスタを設けたUSBデバイスコントローラを最も主要な特徴とする。
【0026】
請求項2記載の発明は、請求項1記載のUSBデバイスコントローラにおいて、SRAMに対するデータ書き込みが始まる時点から完了する時点までの任意のタイミングで、SRAM内のデータの一部を前記レジスタに書き込むUSBデバイスコントローラを主要な特徴とする。
【0027】
請求項3記載の発明は、請求項1または2記載のUSBデバイスコントローラにおいて、シリアルインターフェイスエンジンと物理層ブロック間のインターフェイス仕様がUTMI(USB Transceiver MacrocellINterface)であるUSBデバイスコントローラを主要な特徴とする。
【0028】
請求項4記載の発明は、請求項1記載のUSBデバイスコントローラにおいて、前記レジスタのビット幅は、イン転送用エンドポイントFIFOとして機能するSRAMとシリアルインターフェイスエンジン間のデータ転送のバス幅と同じであるUSBデバイスコントローラを主要な特徴とする。
【0029】
請求項5記載の発明は、USB規格に規定されたエンドポイントFIFOにSRAMを使用したUSBデバイスコントローラにおいて、アウト転送用エンドポイントFIFOとして機能するSRAMとUSBデバイス側インターフェイス間のデータ転送経路に転送データ格納用のレジスタを設けたUSBデバイスコントローラを最も主要な特徴とする。
【0030】
請求項6記載の発明は、請求項5記載のUSBデバイスコントローラにおいて、SRAMに対するデータ書き込みが完了しデータにエラーが無いことを確認した時点でSRAM内のデータの一部を前記レジスタに書き込むUSBデバイスコントローラを主要な特徴とする。
【0031】
請求項7記載の発明は、請求項5記載のUSBデバイスコントローラにおいて、前記レジスタのビット幅は、アウト転送用エンドポイントFIFOとして機能するSRAMとUSBデバイス側インターフェイス間のデータ転送経路のバス幅と同じであるUSBデバイスコントローラを主要な特徴とする。
【0032】
【発明の実施の形態】
以下、図面により本発明の実施の形態を詳細に説明する。図3は本発明の第1の実施の形態に係るUSBデバイスコントローラの構成図である。本発明の特徴は、USBデバイスコントローラのエンドポイントFIFO(図1のエンドポイントブロック3)にSRAM11を使用する場合、SIEブロック2とイン転送用エンドポイントFIFO(SRAM)11間のデータバスライン上に、レジスタで構成されるデータ格納バッファ(先読みレジスタ)12を設けたことにある。
【0033】
図4は本発明の第2の実施の形態に係るUSBデバイスコントローラの構成図である。本発明の特徴は、I/Fブロック5とアウト転送用エンドポイントFIFO(SRAM)13間のデータバスライン上に、レジスタで構成されるデータ格納バッファ(先読みレジスタ)12を設けたことにある。
【0034】
本発明の構成と動作を以下の実施例で説明する。
[実施例1]
イン転送用エンドポイントFIFOには、図1のI/Fブロック5経由でホストに転送すべきデータの書き込みが行なわれる。転送データはUSB規格に定められた最大データパケット単位に区切られることになるため、エンドポイントFIFOへのデータ書き込みも最大データパケット単位となる。
【0035】
例えばバルクイン転送の場合、HSモードの最大データパケットは512バイトであり、FSモードの最大データパケットは64バイトである。バルク転送おいては大容量データを高速で転送する必要があるため、FIFOはダブルバッファ構成にするのが一般的である。
【0036】
例えば1024バイトのデュアルポートSRAMを使用し、512バイト2面の構成とするのが回路規模縮小上有利である。FS動作の場合はSRAM周辺回路の設定により、64バイトの2面バッファとして使用することが可能である。
【0037】
本発明におけるIN転送の構成では、データ書き込み開始時点からSRAM内のデータが有効化された時点の任意のタイミングで、SRAM内のデータの一部(レジスタ容量分)を先読みレジスタに転送する。但し、SRAMへのデータ書き込みと先読みレジスタへのデータ転送の両方が完了するまでの間は、INトークンに対してSIEはNAKパケットで応答することになる。
【0038】
先読みレジスタへのデータ転送が完了後のINトークンに対して、SIEは転送データにパケットIDとデータエラー検出用のCRCデータを付加したデータパケットを生成して応答することになるが、最初のデータは先読みレジスタに格納されたものから順次読み出すことになるため、インターパケットディレイ時間制約を満足するタイミングでデータパケット送信を開始することが可能となる。
【0039】
SIEがデータパケット送信を開始され先読みレジスタに空きができる度にSRAMから先読みレジスタへのデータ転送を実施することになるが、この場合のSRAMからのデータ出力時間は読み出し開始時の出力時間よりも短いため、先読みレジスタからSIEへのデータ転送に追従したデータ転送が可能であり、USB規格を満たしたデータパケットの送信(インターパケットディレイ時間及びデータパケットの連続性)が可能となる。
【0040】
先読みレジスタを構成するFF(フリップフロップ)の並列数と段数は使用するSRAMのデータ出力時間とSIEブロックの構成に応じてインターパケットディレイ時間制約を満足するように適宜設定できるが、並列数に関してはSIEとSRAM間のデータバス幅と同じにすることにより、先読みレジスタを含むSRAM周辺回路及びSIEブロックの構成を単純にすることができる。
【0041】
例えばUTMI仕様の16ビット/30MHzを選択した場合、FFの並列数は16(2バイト)にすれば良い。段数に関しては、通常3段程度でインターパケットディレイ時間制約を満足することが可能であり、この場合の先読みレジスタ容量は6バイトとなる。レジスタ容量は適宜設定して構わないが、必要以上に大きく設定することは回路規模の増大を招くことになり好ましくない。
【0042】
上記はイン転送におけるUSBインターパケットディレイ時間制約に関する発明であるが、同じ構成をアウト転送エンドポイントFIFOからのUSBデバイス側へのデータ読み出しに使用することが可能である。
【0043】
[実施例2]
アウト転送において、ホストPCは特定デバイスに対してOUTトークンとDATAトークンを続けて送信してくる。特定デバイスのSIEはOUTトークンに含まれるUSBアドレス番号とエンドポイント番号をデコードし、対象となるエンドポイントFIFOの状態に応じて以下のように応答する。
【0044】
a)SRAMに最大パケットデータ数分の空きが無い場合、SIEはNAKパケットを送信することによりデータが受信できなかったことをホストPCに通知する。
【0045】
b)SRAMに最大パケットデータ数分の空きが有って、受信したデータにエラーが無いと判断された場合、SIEはACKパケットを送信することによりデータが正常に受信できたことをホストPCに通知する。
【0046】
c)受信したデータに何らかのエラーが検出された場合、或いはトランザクション自体がUSB規格のプロトコルを満たさない場合、SIEはNAKパケット/ACKパケットを送信することはない。
【0047】
上記a)とc)の場合、ホストPCは別のトランザクションを使用して同じデータを送信することになる。b)のデータを正常に受信できた場合、図1に示すI/Fブロック5を経由してUSBデバイス側メインメモリ等へのデータ転送が行なわれる。このデータ転送はDMA転送或いはPIO転送により行なわれるが、PIO転送の場合にSRAMアクセス時の最初のデータ出力が問題になる場合がある。
【0048】
PIO転送の場合、図1の内部レジスタのアドレスを使用してエンドポイントFIFOを指定することでSRAMにアクセスする方式が一般的である。I/Fブロックにおいては、CPU用バス/ATAPI/PCIバス等の汎用バスが使用されることになるが、これらの汎用バスにおけるリードアクセスにおいてもUSB規格と同じ様なタイムアウト時間が決められている。
【0049】
より具体的には、I/Fでアウト転送用エンドポイントFIFOに対するリードアクセス要求を開始してから、エンドポイントFIFOからの読み出しデータがI/F上に出力されるまでの時間が決められている。エンドポイントFIFOにSRAMを使用している場合、リード要求がSRAMに届いてからデータが出力されるまでの時間はレジスタに比較すると長いため、タイムアウトによりI/F上のデータ転送が成立しなくなる場合がある。特にエンドポイントFIFOを内部レジスタに割り当てた場合はアドレスデコードに要する時間分だけ更に制約が厳しくなる。
【0050】
実施例2においては、図4で前述したように、アウト転送用エンドポイントFIFOにSRAMを使用した場合において、I/Fブロック5とアウト転送用エンドポイントFIFO(SRAM)13間のデータバスライン上に、レジスタで構成されるデータ格納バッファ(先読みレジスタ)12を設けた。
【0051】
アウト転送用SRAMがSIE経由でデータを受信している際にはSRAMに対するアクセス権はSIE側にある。SRAMに1パケット分のデータが格納されデータにエラーが無いことが確認されると、SRAM内のデータが確定されSRAMに対するアクセス権はI/F側に引き渡される。
【0052】
その後でSRAMから先読みレジスタへのデータ転送が実行される。PIO転送によるデータ転送要求はデバイス側CPUに対する割り込みが使用されるのが一般的であり、先読みレジスタへのデータ転送が完了した時点で割り込みを発生する。
【0053】
デバイス側CPUは割り込み要求によりアウト転送用SRAMに読み出すべきデータが存在することを確認した後で、I/F経由でアウト転送用SRAMに対するリードアクセスを行なう。先読みレジスタに読み出しデータの一部が既に格納されているため、I/Fに使用された汎用バスのタイムアウト時間制約を満足する時間以内にデータを出力することが可能となる。
【0054】
実施例1の場合と同様に、先読みレジスタを構成するFF(フリップフロップ)の並列数と段数は使用するSRAMのデータ出力時間とI/Fブロックの構成に応じてタイムアウト時間時間制約を満足するように適宜設定できるが、並列数に関してはI/FブロックとSRAM間のデータバス幅と同じにすることにより、先読みレジスタを含むSRAM周辺回路及びI/Fブロックの構成を単純にすることができる。
【0055】
例えばPCI仕様の32ビット/33MHzである場合、FFの並列数は32(4バイト)にすれば良い。段数に関しては、通常2段程度でタイムアウト時間約を満足することが可能であり、この場合の先読みレジスタ容量は8バイトとなる。レジスタ容量は適宜設定して構わないが、必要以上に大きく設定することは回路規模の増大を招くことになり好ましくない。
【0056】
実施例1の場合と異なる点として、先読みレジスタへのデータ転送は、SRAMに1パケット分のデータが格納されデータにエラーが無いことが確認できた後(データ確定後)である必要がある。データ確定前に転送を行なう場合において、最終的にエラーが検出された場合には先読みレジスタ内のデータを消去する手段が必要になる分だけ回路と制御手順が複雑になることがその理由である。
【0057】
【発明の効果】
以上説明したように、本発明によれば、イン転送用エンドポイントFIFOとして機能するSRAMとシリアルインターフェイスエンジン(SIE)間のデータ転送経路に転送データ格納用のレジスタ(先読みレジスタ)を設け、SRAMに格納された転送データの一部を先読みレジスタに事前に転送しておくことによって、USB規格及びUTMI規格に規定されたINトークンパケット受信からデータパケット送信までのインターパケット時間制約を満足するUSBデバイスコントローラが実現可能となる。
【0058】
この場合に、エンドポイントFIFOにはSRAMを使用し、先読みレジスタには時間制約を満たすために必要最小限のレジスタサイズを設定することにより、回路規模の縮小を図ることができる(請求項1〜4)。
【0059】
また本発明によれば、アウト転送用エンドポイントFIFOとして機能するSRAMとUSBデバイス側インターフェイス間のデータ転送経路に転送データ格納用のレジスタ(先読みレジスタ)を設け、SRAMに格納された転送データの一部を先読みレジスタに事前に転送しておくことによって、USBデバイス側インターフェイス部分に使用される汎用バス規格のタイムアウト時間制約を満足するUSBデバイスコントローラが実現可能となる。
【0060】
この場合に、エンドポイントFIFOにはSRAMを使用し、先読みレジスタには時間制約を満たすために必要最小限のレジスタサイズを設定することにより、回路規模の縮小を図ることができる(請求項5〜7)。
【図面の簡単な説明】
【図1】USBデバイスコントローラの全体構成図である。
【図2】イン転送の場合のインターパケットディレイ時間とタイムアウト時間に関する説明図である。
【図3】本発明の第1の実施の形態に係るUSBデバイスコントローラの構成図である。
【図4】本発明の第2の実施の形態に係るUSBデバイスコントローラの構成図である。
【符号の説明】
2 SIEブロック
11 イン転送用エンドポイントFIFO(SRAM)
12 データ格納バッファ(先読みレジスタ)
[0001]
TECHNICAL FIELD OF THE INVENTION
The present invention relates to a USB device controller in a data communication system between a plurality of devices.
[0002]
[Prior art]
Japanese Patent Application Laid-Open No. H11-328069 is a related art related to a USB device controller in a data communication system between a plurality of devices. In this publication, a USB interface device having a small circuit scale is provided by using a dual port memory for an end point FIFO.
[0003]
[Problems to be solved by the invention]
Universal Serial Bus (USB) is a serial bus interface standard established for connecting a personal computer (PC) to a plurality of PC peripheral devices and performing data communication. It is characterized by simple connectivity and expandability not found in conventional interface standards, and many PC peripheral devices such as a mouse, keyboard, printer, scanner, and modem have recently become compatible with USB.
[0004]
The USB standard defines four transfer modes: control transfer / bulk transfer / interrupt transfer / isochronous transfer, and the transfer mode and transfer direction can be selected according to the purpose of the peripheral device (USB device). The data transfer direction in USB is defined as out transfer when data is transferred from the host PC to a peripheral device (USB device), and in transfer when data is transferred from the USB device to the host PC. It is specified in the USB specification that the transfer is performed via a buffer called an endpoint provided in a USB device controller on the peripheral device side. Basically, it is necessary to provide the same number of endpoint buffers as the number of transfer modes and transfer directions supported by the USB device.
[0005]
FIG. 1 shows a configuration example of a USB device controller. It is roughly classified into a PHY block 1, an SIE (serial interface engine) block 2, an end point block 3, an internal register block 4, and a user interface block (I / F block) 5.
[0006]
The PHY block 1 is a block for performing serial data transmission / reception with a host PC via a USB cable, serial / parallel mutual conversion, and the like. The SIE block 2 is a block that performs processes related to the USB communication protocol such as packet ID decoding / encoding and CRC generation / detection.
[0007]
The endpoint block 3 is composed of an endpoint FIFO and its peripheral circuits, and is a block that buffers USB transmission / reception data. The internal register block 4 is a block accessed by a device-side CPU such as a printer or another block for controlling the USB controller and checking the state.
[0008]
The user interface block 5 is an interface block for transferring data between a device-side memory such as a printer and an end point FIFO and accessing an internal register.
[0009]
Data transmission / reception between the host PC and the USB device is executed using a packet transmission / reception sequence called a transaction. In the USB specification, a plurality of USB devices can be connected, but there is only one USB device to be transmitted / received in one transaction.
[0010]
The data communication of a plurality of devices can be performed by a plurality of transactions. However, in order to prevent the transactions from overlapping in time, the time interval (inter-packet delay time) between each packet constituting the transaction and the host PC The time interval (timeout time) for determining the establishment is strictly defined in the USB specification.
[0011]
The inter-packet delay time and the timeout time will be described with reference to FIG. According to the USB standard, it is required that the host PC and the device connection operate normally even when connected via up to five hubs, and FIG. 2 shows the most severe case. A transaction in in-transfer is established by normal transmission and reception of three packets as shown below.
[0012]
{Circle around (1)} The host PC issues an IN token packet for requesting data transmission to a specific device (t = t0). The IN token packet contains information on the USB address number of the specific device and the endpoint number of the device.
[0013]
{Circle around (2)} The IN token arrives at the device with a delay of the delay time (Td = t2-t0) between the hub and the USB cable (t = t2). When the transfer data to be transmitted to the endpoint FIFO of the specific device is ready, the device transmits the transfer data to the host PC (t = t4). The time interval (Tipd) between t3 and t4 in the figure is one of the inter-packet delay times. However, if the transfer data is not ready, a NAK packet (not shown in FIG. 2) is transmitted instead of the transfer data, and the transaction is completed with two packets (IN-NAK).
[0014]
{Circle around (3)} Transfer data from the device arrives at the device delayed by the delay time (Td '= t5-t4) between the hub and the USB cable (T = t5). When the host PC normally receives the transfer data, the host PC transmits an ACK packet to the device (t = t8), and notifies the establishment of the transaction. The host transmits an ACK packet when a data packet arrives from a device within a timeout period (Ttout) specified by the USB standard and no error is detected in the received data. The time interval (Tipd ′ = t8−t7) from the completion of data reception by the host to the transmission of ACK is also the inter-packet delay time.
[0015]
If the interval between t3 and t4 exceeds the maximum allowable value of the inter-packet delay time, the interval between t1 and t5 will also be correspondingly longer, and will exceed the timeout time (Ttout). In this case, the host interrupts the transaction without sending an ACK, and issues an IN token packet again after a certain period of time. However, reduce the number of hub stages between the host PC and the device or change the configuration of the endpoint FIFO. Since the same timeout is repeated unless the data is changed, data transfer using the target endpoint becomes impossible.
[0016]
In the case of the USB 2.0 standard, the maximum inter-packet delay in the HS mode is 192 bits, and the timeout is 816 bits. Since the data transfer rate in the HS mode is 480 Mbps, one bit time is about 2.08 ns. These values indicate values on the USB port of the host PC or device.
[0017]
As a standard conforming to the USB 2.0 standard, an interface specification between a PHY block and an SIE block in USB 2.0 is defined as a UTMI (USB Transceiver Macrocell Interface). Parallel data communication is performed between the PHY block and the SIE block, and a specification of a data width of 8 bits / clock frequency of 60 MHz and a specification of a data width of 16 bits / clock frequency of 30 MHz can be selected.
[0018]
In the UTMI specification, the same inter-packet delay time as in the USB 2.0 standard is applied. For example, in the case of a 16-bit / 30-MHz specification, Tipd (up to 192 bit times) in FIG. 2 corresponds to 7 CLK. The UTMI-standard PHY block is divided into a part that operates at a 480 MHz clock on the USB bus side and a part that operates at 30 MHz on the UTMI side, but the UTMI side has a stricter design for the inter-packet delay time constraint.
[0019]
The PHY and the SIE are connected via the UTMI. If the NIE responds to the IN token, the SIE will issue a NAK packet. Therefore, the USB controller must satisfy the restriction (within 7 CLK) on the UTMI. It is relatively easy to design.
[0020]
On the other hand, when transmitting a data packet to the IN token, it is necessary to read data stored in the endpoint FIFO. If the reading time is slow, the restrictions on UTMI may not be satisfied.
[0021]
As the endpoint FIFO, it is common to use a register or a memory cell such as an SRAM. When the endpoint FIFO is configured by a register, the time from the data read request to the output of the first data is relatively short, so that it is easy to design to satisfy the inter-packet delay time constraint, but the circuit scale becomes large. This leads to an increase in cost.
[0022]
On the other hand, when a memory cell such as an SRAM is used, the circuit size is reduced, but the time until the first data is output becomes longer than when a register is used. It is difficult to achieve a satisfactory configuration.
[0023]
In JP-A-11-328069, the circuit scale is reduced by using a dual-port memory as a transmission / reception memory (endpoint FIFO) of a USB device controller. No consideration was given to the issue.
[0024]
An object of the present invention is to provide a USB device controller having a small circuit scale and capable of satisfying a restriction of an inter-packet delay time in the USB standard.
[0025]
[Means for Solving the Problems]
In order to achieve the above object, an invention according to claim 1 is a USB device controller using an SRAM as an endpoint FIFO defined by the USB standard, and a serial interface engine (SRAM) and an SRAM functioning as an endpoint FIFO for in-transfer. The most important feature is a USB device controller provided with a register for storing transfer data in a data transfer path between SIEs.
[0026]
According to a second aspect of the present invention, in the USB device controller according to the first aspect, the USB device that writes a part of data in the SRAM to the register at an arbitrary timing from a time point when data writing to the SRAM starts to a time point when the writing is completed. Controller is the main feature.
[0027]
According to a third aspect of the present invention, the USB device controller according to the first or second aspect is characterized in that the interface specification between the serial interface engine and the physical layer block is UTMI (USB Transceiver Macrocell Interface).
[0028]
According to a fourth aspect of the present invention, in the USB device controller according to the first aspect, a bit width of the register is the same as a bus width of data transfer between the SRAM functioning as an in-transfer end point FIFO and a serial interface engine. The main feature is a USB device controller.
[0029]
According to a fifth aspect of the present invention, in a USB device controller using an SRAM as an endpoint FIFO defined by the USB standard, a transfer data is transferred to a data transfer path between the SRAM functioning as an out-transfer endpoint FIFO and a USB device side interface. The most important feature is a USB device controller provided with a storage register.
[0030]
According to a sixth aspect of the present invention, in the USB device controller according to the fifth aspect, a part of the data in the SRAM is written to the register when the data writing to the SRAM is completed and there is no error in the data. Controller is the main feature.
[0031]
According to a seventh aspect of the present invention, in the USB device controller according to the fifth aspect, the bit width of the register is the same as the bus width of a data transfer path between the SRAM functioning as the end FIFO for out transfer and the USB device side interface. The main feature is a USB device controller.
[0032]
BEST MODE FOR CARRYING OUT THE INVENTION
Hereinafter, embodiments of the present invention will be described in detail with reference to the drawings. FIG. 3 is a configuration diagram of the USB device controller according to the first embodiment of the present invention. A feature of the present invention is that when the SRAM 11 is used for the end point FIFO (end point block 3 in FIG. 1) of the USB device controller, the data is transferred on the data bus line between the SIE block 2 and the end transfer end point FIFO (SRAM) 11 , A data storage buffer (prefetch register) 12 composed of a register.
[0033]
FIG. 4 is a configuration diagram of a USB device controller according to the second embodiment of the present invention. A feature of the present invention resides in that a data storage buffer (prefetch register) 12 composed of a register is provided on a data bus line between the I / F block 5 and the out-transfer end point FIFO (SRAM) 13.
[0034]
The configuration and operation of the present invention will be described in the following embodiments.
[Example 1]
Data to be transferred to the host is written to the in-transfer endpoint FIFO via the I / F block 5 in FIG. Since the transfer data is divided into the maximum data packet units defined in the USB standard, the data writing to the endpoint FIFO is also performed in the maximum data packet unit.
[0035]
For example, in the case of bulk-in transfer, the maximum data packet in the HS mode is 512 bytes, and the maximum data packet in the FS mode is 64 bytes. Since it is necessary to transfer a large amount of data at a high speed in bulk transfer, the FIFO is generally of a double buffer configuration.
[0036]
For example, using a dual port SRAM of 1024 bytes and having a configuration of two 512 bytes is advantageous in terms of circuit size reduction. In the case of the FS operation, it can be used as a 64-byte two-sided buffer by setting the SRAM peripheral circuit.
[0037]
In the IN transfer configuration according to the present invention, a part of the data in the SRAM (the amount corresponding to the register capacity) is transferred to the prefetch register at an arbitrary timing from the start of the data writing to the time when the data in the SRAM is validated. However, until both data writing to the SRAM and data transfer to the prefetch register are completed, the SIE responds to the IN token with a NAK packet.
[0038]
In response to the IN token after the data transfer to the look-ahead register is completed, the SIE generates a data packet in which a packet ID and CRC data for detecting a data error are added to the transfer data and responds. Are sequentially read from those stored in the look-ahead register, so that data packet transmission can be started at a timing that satisfies the inter-packet delay time constraint.
[0039]
The data transfer from the SRAM to the prefetch register is performed every time the SIE starts data packet transmission and the prefetch register becomes available. In this case, the data output time from the SRAM is longer than the output time at the start of reading. Because of the short length, data transfer following the data transfer from the prefetch register to the SIE is possible, and transmission of a data packet satisfying the USB standard (inter-packet delay time and continuity of the data packet) becomes possible.
[0040]
The parallel number and the number of stages of the FFs (flip-flops) constituting the look-ahead register can be appropriately set so as to satisfy the inter-packet delay time constraint according to the data output time of the SRAM used and the configuration of the SIE block. By making the data bus width the same as that between the SIE and the SRAM, the configuration of the SRAM peripheral circuit including the prefetch register and the SIE block can be simplified.
[0041]
For example, when 16 bits / 30 MHz of the UTMI specification is selected, the number of parallel FFs may be set to 16 (2 bytes). Regarding the number of stages, it is usually possible to satisfy the inter-packet delay time constraint with about three stages. In this case, the look-ahead register capacity is 6 bytes. The register capacity may be set as appropriate, but setting it larger than necessary undesirably increases the circuit scale.
[0042]
The above is the invention relating to the USB inter-packet delay time constraint in the in-transfer, but the same configuration can be used for reading data from the out-transfer endpoint FIFO to the USB device side.
[0043]
[Example 2]
In the out transfer, the host PC successively transmits an OUT token and a DATA token to a specific device. The SIE of the specific device decodes the USB address number and the endpoint number included in the OUT token, and responds as follows according to the state of the target endpoint FIFO.
[0044]
a) When there is no space for the maximum number of packet data in the SRAM, the SIE transmits a NAK packet to notify the host PC that data could not be received.
[0045]
b) If it is determined that the SRAM has free space for the maximum number of packet data and the received data has no error, the SIE transmits an ACK packet to notify the host PC that the data has been successfully received. Notice.
[0046]
c) If any error is detected in the received data, or if the transaction itself does not satisfy the protocol of the USB standard, the SIE does not transmit the NAK packet / ACK packet.
[0047]
In cases a) and c) above, the host PC will send the same data using another transaction. When the data b) is normally received, the data is transferred to the USB device side main memory or the like via the I / F block 5 shown in FIG. This data transfer is performed by DMA transfer or PIO transfer. In the case of PIO transfer, the first data output at the time of accessing the SRAM may be a problem.
[0048]
In the case of PIO transfer, a method of accessing an SRAM by designating an end point FIFO using an address of an internal register in FIG. 1 is generally used. In the I / F block, general-purpose buses such as a CPU bus / ATAPI / PCI bus are used. In read access on these general-purpose buses, a timeout time similar to the USB standard is determined. .
[0049]
More specifically, the time from when the I / F starts a read access request to the out-transfer endpoint FIFO to when the read data from the endpoint FIFO is output to the I / F is determined. . When the SRAM is used for the endpoint FIFO, the time from when the read request arrives at the SRAM until the data is output is longer than that of the register, so that the data transfer on the I / F cannot be established due to the timeout. There is. In particular, when the end point FIFO is assigned to the internal register, the restriction becomes more severe by the time required for address decoding.
[0050]
In the second embodiment, as described above with reference to FIG. 4, when the SRAM is used for the out-transfer endpoint FIFO, the data bus line between the I / F block 5 and the out-transfer endpoint FIFO (SRAM) 13 is used. A data storage buffer (look-ahead register) 12 composed of a register is provided.
[0051]
When the out-transfer SRAM is receiving data via the SIE, the access right to the SRAM is on the SIE side. When one packet of data is stored in the SRAM and it is confirmed that there is no error in the data, the data in the SRAM is determined and the access right to the SRAM is transferred to the I / F side.
[0052]
Thereafter, data transfer from the SRAM to the prefetch register is performed. Generally, an interrupt to the device-side CPU is used for a data transfer request by PIO transfer, and an interrupt is generated when data transfer to the prefetch register is completed.
[0053]
The device-side CPU performs read access to the out-transfer SRAM via the I / F after confirming that there is data to be read in the out-transfer SRAM by an interrupt request. Since a part of the read data is already stored in the prefetch register, it is possible to output the data within a time that satisfies the time-out time restriction of the general-purpose bus used for the I / F.
[0054]
As in the case of the first embodiment, the parallel number and the number of stages of the FFs (flip-flops) constituting the look-ahead register satisfy the time-out time constraint depending on the data output time of the SRAM used and the configuration of the I / F block. However, the configuration of the SRAM peripheral circuit including the look-ahead register and the configuration of the I / F block can be simplified by making the number of parallels the same as the data bus width between the I / F block and the SRAM.
[0055]
For example, when the PCI specification is 32 bits / 33 MHz, the number of parallel FFs may be 32 (4 bytes). Regarding the number of stages, it is usually possible to satisfy the timeout time about two stages, and in this case, the look-ahead register capacity is 8 bytes. Although the register capacity may be set as appropriate, setting it larger than necessary undesirably increases the circuit scale.
[0056]
As a difference from the first embodiment, the data transfer to the prefetch register needs to be performed after data of one packet is stored in the SRAM and it can be confirmed that there is no error in the data (after data is determined). The reason is that, in the case where the transfer is performed before the data is determined, if an error is finally detected, the circuit and the control procedure become complicated by the amount of means for erasing the data in the look-ahead register. .
[0057]
【The invention's effect】
As described above, according to the present invention, a transfer data storage register (look-ahead register) is provided in a data transfer path between an SRAM functioning as an in-transfer endpoint FIFO and a serial interface engine (SIE), and the SRAM is provided in the SRAM. A USB device controller that satisfies an inter-packet time constraint from reception of an IN token packet to transmission of a data packet specified by the USB standard and the UTMI standard by transferring a part of the stored transfer data to a look-ahead register in advance. Can be realized.
[0058]
In this case, the circuit scale can be reduced by using an SRAM for the end point FIFO and setting a minimum register size for the prefetch register to satisfy the time constraint. 4).
[0059]
According to the present invention, a transfer data storage register (prefetch register) is provided on a data transfer path between the SRAM functioning as an out-transfer endpoint FIFO and the USB device-side interface, and one of the transfer data stored in the SRAM is provided. By transferring the section in advance to the look-ahead register, a USB device controller that satisfies the timeout time restriction of the general-purpose bus standard used for the USB device-side interface can be realized.
[0060]
In this case, the circuit scale can be reduced by using an SRAM for the end point FIFO and setting a minimum register size necessary to satisfy the time constraint for the prefetch register. 7).
[Brief description of the drawings]
FIG. 1 is an overall configuration diagram of a USB device controller.
FIG. 2 is an explanatory diagram regarding an inter-packet delay time and a timeout time in the case of in-transfer.
FIG. 3 is a configuration diagram of a USB device controller according to the first embodiment of the present invention.
FIG. 4 is a configuration diagram of a USB device controller according to a second embodiment of the present invention.
[Explanation of symbols]
2 SIE block 11 In-transfer endpoint FIFO (SRAM)
12 Data storage buffer (prefetch register)

Claims (7)

USB規格に規定されたエンドポイントFIFOにSRAMを使用したUSBデバイスコントローラにおいて、イン転送用エンドポイントFIFOとして機能するSRAMとシリアルインターフェイスエンジン間のデータ転送経路に転送データ格納用のレジスタを設けたことを特徴とするUSBデバイスコントローラ。In a USB device controller using an SRAM as an end point FIFO defined in the USB standard, a transfer data storage register is provided on a data transfer path between the SRAM functioning as an end point FIFO for in-transfer and a serial interface engine. Characteristic USB device controller. 請求項1記載のUSBデバイスコントローラにおいて、SRAMに対するデータ書き込みが始まる時点から完了する時点までの任意のタイミングで、SRAM内のデータの一部を前記レジスタに書き込むことを特徴とするUSBデバイスコントローラ。2. The USB device controller according to claim 1, wherein a part of the data in the SRAM is written to the register at an arbitrary timing from a point in time when data writing to the SRAM starts to a point in time when the writing is completed. 請求項1または2記載のUSBデバイスコントローラにおいて、シリアルインターフェイスエンジンと物理層ブロック間のインターフェイス仕様がUTMIであることを特徴とするUSBデバイスコントローラ。3. The USB device controller according to claim 1, wherein an interface specification between the serial interface engine and the physical layer block is UTMI. 請求項1記載のUSBデバイスコントローラにおいて、前記レジスタのビット幅は、イン転送用エンドポイントFIFOとして機能するSRAMとシリアルインターフェイスエンジン間のデータ転送のバス幅と同じであることを特徴とするUSBデバイスコントローラ。2. The USB device controller according to claim 1, wherein a bit width of the register is the same as a bus width of data transfer between the SRAM functioning as an in-transfer endpoint FIFO and a serial interface engine. . USB規格に規定されたエンドポイントFIFOにSRAMを使用したUSBデバイスコントローラにおいて、アウト転送用エンドポイントFIFOとして機能するSRAMとUSBデバイス側インターフェイス間のデータ転送経路に転送データ格納用のレジスタを設けたことを特徴とするUSBデバイスコントローラ。In a USB device controller using an SRAM as an end point FIFO specified by the USB standard, a transfer data storage register is provided in a data transfer path between the SRAM functioning as an end FIFO for out transfer and a USB device side interface. A USB device controller, characterized in that: 請求項5記載のUSBデバイスコントローラにおいて、SRAMに対するデータ書き込みが完了しデータにエラーが無いことを確認した時点でSRAM内のデータの一部を前記レジスタに書き込むことを特徴とするUSBデバイスコントローラ。6. The USB device controller according to claim 5, wherein a part of the data in the SRAM is written to the register when it is confirmed that the writing of the data to the SRAM is completed and there is no error in the data. 請求項5記載のUSBデバイスコントローラにおいて、前記レジスタのビット幅は、アウト転送用エンドポイントFIFOとして機能するSRAMとUSBデバイス側インターフェイス間のデータ転送経路のバス幅と同じであることを特徴とするUSBデバイスコントローラ。6. The USB device controller according to claim 5, wherein a bit width of the register is the same as a bus width of a data transfer path between an SRAM functioning as an end FIFO for out transfer and a USB device side interface. Device controller.
JP2002177649A 2002-06-18 2002-06-18 USB device controller Pending JP2004021742A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2002177649A JP2004021742A (en) 2002-06-18 2002-06-18 USB device controller

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2002177649A JP2004021742A (en) 2002-06-18 2002-06-18 USB device controller

Publications (1)

Publication Number Publication Date
JP2004021742A true JP2004021742A (en) 2004-01-22

Family

ID=31175630

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2002177649A Pending JP2004021742A (en) 2002-06-18 2002-06-18 USB device controller

Country Status (1)

Country Link
JP (1) JP2004021742A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US8135872B2 (en) 2007-03-19 2012-03-13 Ricoh Company, Ltd. USB controller and a testing method of the USB controller

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US8135872B2 (en) 2007-03-19 2012-03-13 Ricoh Company, Ltd. USB controller and a testing method of the USB controller

Similar Documents

Publication Publication Date Title
US7930470B2 (en) System to enable a memory hub device to manage thermal conditions at a memory device level transparent to a memory controller
US7272676B2 (en) Data transmission controller that restarts data transmission when reconstruction is completed
TWI375890B (en) Electronic system, usb link, ulpi phy and method for transmitting an extended transaction
US6131131A (en) Computer system including an enhanced communication interface for an ACPI-compliant controller
US7069350B2 (en) Data transfer control system, electronic instrument, and data transfer control method
JP3632695B2 (en) Data transfer control device, electronic device, and data transfer control method
US20080065796A1 (en) High-Level Bridge From PCIE to Extended USB
JP3870717B2 (en) Data transfer control device and electronic device
JP2001236304A (en) Microcomputer
US20080162753A1 (en) Method for Performing Full Transfer Automation in a USB Controller
US7469304B2 (en) Data transfer control device, electronic equipment, and method for a data transfer through a bus, the data transfer control device including a register and a packet buffer that are commonly used during a host operation and a peripheral operation
US7620747B1 (en) Software based native command queuing
WO1998043173A1 (en) Emulation system and information processor
US6990550B2 (en) Transaction duration management in a USB host controller
JP4837659B2 (en) Bus controller for processing split transactions
US20080162737A1 (en) USB Controller with Full Transfer Automation
US20030217218A1 (en) Interface for devices having different data bus widths and data transfer method using the interface
US7162565B1 (en) Universal serial bus interface to mass storage device
WO2008082530A1 (en) Method and apparatus for performing full transfer automation in a usb controller
JP2004021742A (en) USB device controller
CN101071406A (en) Interface configurable universal series bus controller
US20070005847A1 (en) Data transfer control device and electronic instrument
US7509439B2 (en) Method for maintaining register integrity and receive packet protection during ULPI PHY to LINK bus transactions
CN114741345B (en) USB DMA data transmission device and method
EP1115052A2 (en) Storage device in an expansion slot of a computer input device

Legal Events

Date Code Title Description
A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20050223

RD02 Notification of acceptance of power of attorney

Effective date: 20050406

Free format text: JAPANESE INTERMEDIATE CODE: A7422

A131 Notification of reasons for refusal

Effective date: 20071221

Free format text: JAPANESE INTERMEDIATE CODE: A131

A02 Decision of refusal

Effective date: 20080616

Free format text: JAPANESE INTERMEDIATE CODE: A02