JP2004185451A - Memory access arbitration method and memory access arbitration unit - Google Patents

Memory access arbitration method and memory access arbitration unit Download PDF

Info

Publication number
JP2004185451A
JP2004185451A JP2002353166A JP2002353166A JP2004185451A JP 2004185451 A JP2004185451 A JP 2004185451A JP 2002353166 A JP2002353166 A JP 2002353166A JP 2002353166 A JP2002353166 A JP 2002353166A JP 2004185451 A JP2004185451 A JP 2004185451A
Authority
JP
Japan
Prior art keywords
fifo
access
memory
area
data
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
JP2002353166A
Other languages
Japanese (ja)
Inventor
Tomokazu Nagai
智和 永井
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.)
Naltec Inc
Original Assignee
Naltec Inc
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 Naltec Inc filed Critical Naltec Inc
Priority to JP2002353166A priority Critical patent/JP2004185451A/en
Publication of JP2004185451A publication Critical patent/JP2004185451A/en
Pending legal-status Critical Current

Links

Images

Landscapes

  • Bus Control (AREA)

Abstract

<P>PROBLEM TO BE SOLVED: To provide a memory access arbitration method capable of maximally using an access speed of a memory for which an FIFO area is set. <P>SOLUTION: This arbitration unit 20 is provided with a counter 19a determining an accumulated data quantity N in the FIFO area 22, a first setting part 31 setting a condition D1, in which FIFO read access has higher priority to FIFO write access, when the accumulated data quantity N is larger than a first set value S1, and a second setting part 32 setting a condition D2, in which the FIFP write access has a higher priority to the FIFO read access, when the accumulated data quantity N is lower than a second set value S2. When change to the condition D1 or D2, in which the relationship based on the FIFO read access or the FIFO write access alone is carried out, is carried out, occurrence of buffer full or buffer underrun can be prevented surely, and reduction in performance of another memory access is also prevented. <P>COPYRIGHT: (C)2004,JPO&NCIPI

Description

【0001】
【発明の属する技術分野】
本発明は、FIFO用の領域が設定されたメモリに対するアクセスを調停する方法および装置に関するものである。
【0002】
【従来の技術】
RAMなどのメモリまたはメモリデバイスにFIFO用の領域を設定し、FIFOバッファおよびそれ以外の目的で共用したシステムが知られている。特開2001−175591号公報には、メモリをFIFOとして利用するデータバッファ装置および方法が開示されている。
【0003】
【特許文献1】
特開2001−175591号公報
【0004】
【発明が解決しようとする課題】
ところで、1つのメモリを幾つかの目的で使用する場合はメモリアクセスに対する調停処理が必須となる。オペレーティングシステム(OS)などのタスクスケジューリングとして使用されている調停処理のアルゴリズムとしてラウンドロビン方式やプライオリティー(優先順位)方式が知られている。これらの調停方式を利用することにより、メモリをFIFO領域やその他の目的のために共用したシステムを構築することが可能になる。
【0005】
調停方法においては、システムにおいて予想されるFIFOに対するアクセス頻度に基づきライトチャネルまたはリードチャネルの優先順位または頻度が設定される。しかしながら、FIFOに対するライト(ライトアクセスまたはライトチャネル)に関して優先順位の低い設計が採用されていると、FIFO領域に蓄積されたデータ量が少ないときにバッファアンダーランとなる確率が増加し、システム全体の能力低下を招く懸念がある。
【0006】
一方、FIFOに対するリード(リードアクセスまたはリードチャネル)に関して優先順位が低い設計が採用されていると、FIFO領域に蓄積されたデータ量が多い場合、バッファフル状態の時間的割合が増え、FIFOライトアクセスが待たされるためにシステム全体の性能が低下する懸念がある。
【0007】
メモリをFIFOとして有効利用することだけを考えれば、FIFOのライトアクセスおよびリードアクセスの優先順位を予め高めた設計とすることにより、バッファアンダーランやバッファフルを防止し、FIFOに関する性能を向上できるかもしれない。しかしながら、メモリをFIFO以外の他の目的でも共用する場合は、FIFOアクセス以外の他の目的でのメモリに対するアクセス性能が低下することになるので、システム全体として見ると、やはりシステム性能が低下する懸念がある。
【0008】
図7に、単純な加重付きラウンドロビン方式による調停方法を示してある。FIFOライトアクセスM1、FIFOリードアクセスM2、その他のジョブAのメモリアクセスM3、その他のジョブBのメモリアクセスM4、およびその他のジョブCのメモリアクセスM5の5チャネルのアクセスが調停対象として設定されている。調停ユニット90には、全体で7サイクルを1周期とするようにアクセス(チャネル)が割り当てられている。図7では、FIFOライトアクセスM1およびFIFOリードアクセスM2が共にメモリの全体のバンドレートの2/7を使用可能に設定されている。しかしながら、システムの通常動作における解析をおこなったところFIFOライトアクセスの頻度は小さくて良いとなったときは、FIFOライトアクセスM1の頻度がFIFOリードアクセスM2の頻度より小さく、すなわち、FIFOライトアクセスM1のバンドレートが1/7に設定される。このとき、FIFO領域のデータ容量が少なくなると、FIFOライトアクセスよりFIFOリードアクセスの方がバンドレートの高い設定が採用されているので、FIFO領域のデータは増えにくく、FIFOリードにより消費されるのでバッファアンダーランとなる。このため、本来FIFOライトアクセスよりFIFOリードアクセスが主体のシステムにおいてFIFOリードアクセスの性能が低下するので、システム性能が低くなる恐れがある。
【0009】
逆に、FIFOリードアクセスに対してFIFOライトアクセスの頻度が多いと判断された場合は、FIFOリードアクセスのバンドレートがFIFOライトアクセスのバンドレートより小さく設定される。このとき、FIFO領域のデータが多い場合は、FIFO領域のデータがさらに増加し、バッファフルの状態が発生し、FIFOライトアクセスが中断される。そして、FIFOリードアクセスよりFIFOライトアクセスが多いシステムでありながら、FIFOライトアクセスが阻害され、システムの性能が低下する。
【0010】
FIFOライトアクセスおよびFIFOリードアクセスの頻度を高くし、あるいは、最大転送レートを上げることにより、上記のような状態は発生し難い。しかしながら、メモリに対するアクセスがFIFO関係で独占されるので、他のジョブのアクセスが待たされることになり、システムの性能としては低下する可能性がある。したがって、FIFOとしても利用されるメモリに対するアクセスの条件を、リードアクセスの頻度が高いシステムだからといってリードアクセスを優先するように調停するとバッファアンダーランとなりシステムの性能を低下させる可能性がある。逆に、ライトアクセスの頻度が高いシステムだからといってライトアクセスを優先するように調停するとバッファフルとなり、はやりシステムの性能を低下させる可能性がある。
【0011】
そこで、本発明においては、FIFO用の領域として共用するメモリに対するアクセスを調停する方法およびユニットにおいて、リードアクセスの頻度が高いシステムであればリードアクセスの頻度を高くでき、また、ライトアクセスの頻度が高いシステムであればライトアクセスの頻度を高くできるメモリアクセス調停方法およびユニットを提供することを目的としている。一方、バッファアンダーランおよびバッファフルの発生を防止し、リードまたはライトのアクセス頻度を高めることによるシステム性能の低下も防止できるメモリアクセス調停方法およびユニットを提供することを目的としている。
【0012】
【課題を解決するための手段】
このため、本発明のメモリアクセス調停方法においては、FIFOリードアクセスが優先される条件と、FIFOライトアクセスが優先される条件とを設け、これらの条件をFIFO用の領域に蓄積されている蓄積データ量に応じて変更できるようにしている。すなわち、FIFO用の領域が設定されたメモリに対するアクセスを許可する本発明のメモリアクセス調停方法は、FIFO用の領域に蓄積されている蓄積データ量を判断する工程と、蓄積データ量が第1の設定値より大きいと判断されれば、FIFO用の領域からデータを読み出すFIFOリードアクセスが優先されるように、メモリに対するアクセスを許可する条件を設定する第1の工程と、FIFO用の領域の蓄積データ量が第2の設定値より小さいと判断されれば、FIFO用の領域にデータを書き込むFIFOライトアクセスが優先されるように、メモリに対するアクセスを許可する条件を設定する第2の工程とを有する。
【0013】
また、FIFO用の領域が設定されたメモリに対するアクセスを許可する本発明のメモリアクセス調停ユニットは、FIFO用の領域に蓄積されている蓄積データ量を判断する手段と、蓄積データ量が第1の設定値より大きいと判断されればFIFOリードアクセスが優先されるように、メモリに対するアクセスを許可する条件を設定する第1の設定手段と、蓄積データ量が第2の設定値より小さいと判断されれば、FIFOライトアクセスが優先されるように、メモリに対するアクセスを許可する条件を設定する第2の設定手段とを有する。また、本発明のメモリアクセス調停方法は、情報処理装置上で動作するプログラムとして提供することも可能である。すなわち、本発明は、情報処理装置であるCPUなどのプロセッサあるいはコンピュータに対して、上述したメモリアクセス調停方法の、判断する工程と、第1の工程と、第2の工程とを実行させることが可能な命令を有するプログラムを含む。このようなプログラムは、CD−ROMやシステム内のROMなどの適当な記録媒体に記録して提供することが可能であるし、コンピュータネットワークを介して提供することも可能である。
【0014】
本発明のメモリアクセス調停方法および調停ユニットでは、FIFO用の領域の蓄積データ量が第1の設定値より大きいと判断されると、FIFOリードアクセスが優先され、FIFOリードアクセスの頻度が増加する。したがって、FIFO領域内の蓄積データは読み出される頻度が高くなるので、バッファフルの発生を未然に防止できる。一方、FIFO用の領域の蓄積データ量が第2の設定値より小さいと判断されたときには、FIFOライトアクセスが優先される条件に設定されるので、FIFOライトアクセスの頻度が増加する。したがって、FIFO領域内にデータを書き込む頻度が高くなるので蓄積データ量が増え、バッファアンダーランの発生を未然に防止できる。このため、定常状態では、FIFOリードアクセスとFIFOライトアクセスの頻度をシステムに適した状態となるように調停していても、バッファアンダーランあるいはバッファフルというシステムの性能が低下する状態を防止することができ、システムの性能を高い状態で維持できる。
【0015】
したがって、本発明のメモリアクセス調停ユニットと、FIFO用の領域が設定されたメモリであって、メモリアクセス調停ユニットによりアクセスが許可されるメモリとを有するメモリユニットはシステムの要求に適したライトおよびリードの頻度を設定でき、その一方で、バッファアンダーランあるいはバッファフルというシステムの性能が低下する状態を防止する。このため、このメモリユニットと、メモリに設定されたFIFO用の領域にデータを供給するデータ供給装置と、FIFO用の領域に蓄えられたデータを読み出して消費するデータ消費装置とを有するデータ処理装置は高い性能で処理を実行できる。
【0016】
バッファフルおよびバッファアンダーランの発生を確実に防止するには、第1の工程および第1の設定手段において、FIFOリードアクセスの頻度がFIFOライトアクセスの頻度より高くなるように条件、すなわち、プライオリティー方式であれば優先順位、ラウンドロビン方式であればバンドレートを設定し、第2の工程および第2の設定手段において、FIFOリードアクセスの頻度が、FIFOライトアクセスの頻度より低くなるように条件を設定することが望ましい。このように条件を設定することにより、FIFO領域内のデータ量の増減を確実に制御できるので、バッファフルおよびバッファアンダーランの発生を確実に制御できる。
【0017】
第1および第2の工程、および第1および第2の設定手段において、FIFOリードアクセスおよびFIFOライトアクセスの関係のみを設定すれば、メモリに対する他のアクセスへの影響を与えずにバッファフルおよびバッファアンダーランの発生を抑制できる。一方、第1の工程および第1の設定手段では、FIFOリードアクセスがメモリに対する全てのアクセスに対して優先されるように設定し、第2の工程および第2の設定手段では、FIFOライトアクセスがメモリに対する全てのアクセスに対しても優先されるように設定することも可能である。この場合は、メモリに対する他のアクセスに影響を与えるが、FIFO領域内のデータ量を最も効率よく調整でき、バッファフルおよびバッファアンダーランの発生を効率良く抑制できる。
【0018】
第1および第2の設定値は、データの供給元のデータ量やデータの消費先の処理スピードを見越して決めておけば良く、たとえば、第1の設定値を蓄積データ量がFIFO領域の許容データ量の70%程度としておいたり、第2の設定値を蓄積データ量がFIFO領域の許容データ量の30%程度としておくことが可能である。また、第1および第2の設定値を、FIFO用の領域に蓄積可能な許容データ量の半分または50%としておくことも可能である。
【0019】
【発明の実施の形態】
以下に図面を参照して本発明をさらに詳しく説明する。図1にプリンタの概略構成を示してある。このプリンタ1は、本発明に係るメモリアクセス調停ユニットを備えたメモリユニットが搭載されている。プリンタ1は、ホスト装置8などから転送された印刷データφを画像処理して印刷機構4により用紙5に印刷するようになっており、画像処理や印刷機構4の制御を行うデータ処理装置2を備えている。このデータ処理装置2は、CPU11と、ファームウェアなどが記録されたROM12と、印刷データφを取得するインターフェイス13と、印刷データφを画像処理する画像処理ASIC14と、メモリユニット3とを備えており、これらがバス17を介して接続されている。メモリユニット3は、RAMなどのメモリまたはメモリデバイス21と、メモリ21に対するメモリアクセスを調停可能な調停ユニット20と、メモリコントローラ15を備えている。また、データ処理装置2は、印刷機構4を制御するメカ制御部16を備えている。
【0020】
メモリユニット3のメモリ21にはFIFO用の領域22が設定されており、画像処理ASIC14で画像処理されたデータがFIFO領域22に蓄積または格納され、この蓄積されたデータ(蓄積データ)がメカ制御部16を介して印刷機構4に出力されるようになっている。このため、画像処理ASIC14からFIFO領域22に供給されるデータ量または処理スピードと、メカ制御部16を介して印刷機構4で消費されるFIFO領域内のデータ量または処理スピードとの差をメモリ21に設定されたFIFO領域22で吸収される。したがって、本例では、画像処理ASIC14がFIFO領域22にデータを供給するデータ供給装置であり、メカ制御部16または印刷機能4がFIFO領域22の蓄積データを消費するデータ消費装置である。
【0021】
メモリユニット3のメモリ21は、ROM12に記録されたプログラムを実行する際に展開する領域や、プログラムを実行するためのデータの一時的な格納領域などとしても利用されるようになっており、1つのメモリ21または1つのメモリ21としてアクセスされるメモリブロックがFIFOとその他の目的として共用されている。
【0022】
メモリユニット3は、FIFO領域22が設定されたメモリ21と、メモリ21に対するアクセス要求を調停する調停ユニット20と、メモリ21に対して制御信号を出力して、調停ユニット20により許可されたアクセス要求に対応したメモリアクセス、すなわち、所定のアドレスへのデータの書き込みまたは読み込みを可能とするメモリコントローラ15とを備えている。
【0023】
調停ユニット20は、FIFO領域22からデータを読み出すFIFOリード要求(またはリードアクセス)、FIFO領域22にデータを書き込むFIFOライト要求(またはライトアクセス)、その他のジョブに関するメモリライト要求(またはメモリライトアクセス)、メモリリード要求(またはメモリリードアクセス)を受け付けて予め決められた条件または設定にしたがってメモリ21に対するアクセス要求を許可する調停回路24と、FIFO領域22に蓄積されているデータ量(蓄積データ量)Nをカウントする機能19aを備えたFIFOコントローラ19とを備えている。このため、FIFO領域22にデータを書き込んだり読み出したりするデータはFIFOコントローラ19を介して調停回路24により制御される。たとえば、FIFO領域22に書き込むデータはFIFOコントローラ19を介して調停回路24に供給され、FIFO領域22から読み出されたデータは調停回路24を介してFIFOコントローラ19に供給されてメカ制御部16に出力される。したがって、FIFOコントローラ19は、データの入出力に基づいてカウンタ19aを操作することによりFIFO領域22の蓄積データ量Nを把握できる。このカウンタ19aが、蓄積データ量Nを判断する手段に相当する。
【0024】
図2にメモリユニット3の詳細を、ブロック図を用いて示してある。メモリユニット3の調停回路24は、FIFOリード要求を受け付けるFIFOリードチャネル41、FIFOライト要求を受け付けるFIFOライトチャネル42、その他のメモリライト要求を受け付けるメモリライトチャネル43、およびその他のメモリリード要求を受け付けるメモリリードチャネル44を備えており、複数種類のアクセス要求を受け付けることが可能である。なお、FIFOに関するアクセス要求に関しては、FIFOコントローラ19に備わっている読み出しポインタや書き込みポインタによってデータのリードアドレスやライトアドレスが生成されて調停回路24に供給されるようになっており、FIFO領域22に書き込まれた順番でデータを読み出す動作が実現されている。
【0025】
この調停回路24は、メモリに対するアクセスの優先順位またはバンドレートを変更可能な設定部30と、この設定部30で設定された優先順位またはバンドレートにしたがって所定のメモリアクセスを許可し、その他のメモリアクセスを待ち状態にする調停部35とを備えている。設定部30は、カウンタ19aの出力、すなわち、FIFO領域22の蓄積データ量Nが第1の設定値S1より大きいと判断されればFIFO領域22からデータを読み出すFIFOリードアクセスM2が、FIFO領域22にデータを書き込むFIFOライトアクセスM1より優先されるように、メモリ21に対するアクセスを許可する条件D1を調停部35に設定する第1の設定部31と、蓄積データ量Nが第2の設定値S2より小さいと判断されれば、FIFOライトアクセスM1が、FIFOリードアクセスM2より優先されるように、メモリ21に対するアクセスを許可する条件D2を調停部35に設定する第2の設定部32とを備えている。本例では、第1および第2の設定値S1およびS2は、いずれもFIFO領域22で蓄積可能な許容データ量または容量Cの50%または半分(C/2)に設定されている。
【0026】
図3に第1の設定部31により調停部35の設定が変えられたときのメモリ21に対するアクセスが変化する様子を示してあり、図4に第2の設定部32により調停部35の設定が変えられたときの処理を示してある。なお、これらの図においても、図7に基づき説明したのと同様に、FIFOライトアクセスM1、FIFOリードアクセスM2、その他のジョブAのメモリアクセスM3、その他のジョブBのメモリアクセスM4、およびその他のジョブCのメモリアクセスM5の5チャネルのアクセスがあり、全体で7サイクルを1周期としてチャネルの割り当てが行われる。そして、予めFIFOライトアクセスM1およびFIFOリードアクセスM2が共にメモリ21の全体のバンドレートの2/7を使用可能な条件Dに設定されているとする。
【0027】
第1の設定部31および第2の設定部32は、基本的には、図7に基づいて説明したラウンドロビン方式のアルゴリズムを採用してメモリアクセスを調停するようになっているが、FIFO領域22の蓄積データ量Nに応じてFIFOライトアクセスM1とFIFOリードアクセスM2の頻度をフレキシブルに変更する。まず、図3(a)に示すように、第1の設定部31において、FIFOコントローラ19のカウンタ19aの出力から蓄積データ量NがC/2より大きいと判断されると、調停部35は、FIFOライトアクセスM1の頻度を減らし、この減らした分をFIFOリードアクセスM2に割り当てるように設定(条件D1)される。これにより、FIFOリードアクセスM2の頻度が高くなる。すなわち、FIFOライトアクセスM1はメモリ21の全体のバンドレートが2/7から1/7に減り、FIFOリードアクセスM2のバンドレートが2/7から3/7に増えるので、FIFOリードアクセスM2がFIFOライトアクセスM1より優先され、リードアクセスの頻度が高くなる。したがって、蓄積データ量Nが多い状態になっても、バッファフルになる可能性がなくなり、バッファフルの発生を未然に防止できる。
【0028】
一方、図4(a)に示すように、第2の設定部32において、FIFOコントローラ19のカウンタ19aの出力から蓄積データ量NがC/2より小さいと判断されると、調停部35は、FIFOリードアクセスM2の頻度を減らし、この減らした分をFIFOライトアクセスM1に割り当てるように設定(条件D2)される。これにより、FIFOライトアクセスM1の頻度が高くなる。すなわち、FIFOリードアクセスM2はメモリ21の全体のバンドレートが2/7から1/7に減り、FIFOライトアクセスM1のバンドレートが2/7から3/7に増えるので、FIFOライトアクセスM1がFIFOリードアクセスM2よりも優先され、ライトアクセスの頻度が高まる。このため、蓄積データ量Nが少ない状態のときには、FIFOライトがFIFOリードより優先して許可されるので、FIFO領域内のデータ量が増加し、バッファアンダーランの発生を未然に防止できる。
【0029】
以上の制御では、第1の設定部31および第2の設定部32は、FIFOライトアクセスM1およびFIFOリードアクセスM2の関係のみを変更した条件D1およびD2を設定し、その他のジョブのメモリアクセスM3〜M5の条件を変更しない。すなわち、他のメモリアクセスM3〜M5のバンドレートはそれぞれ1/7に維持されたままであり、他のメモリアクセスM3〜M5の優先度は変化しない。したがって、他のメモリアクセスに影響を与えることなく、バッファフルおよびバッファアンダーランの発生が確実に防止される。
【0030】
図5に調停ユニット20で行われる調停処理を、フローチャートを用いて示してある。まず、ステップ51で、調停ユニット20の調停回路24がいずれかのメモリアクセス要求M1〜M5を受け付けると、ステップ52において、設定されている条件にしたがってメモリアクセスを調停する。次に、ステップ53において、設定部30がFIFOコントローラ19のカウンタ19aを参照し、蓄積データ量Nを判断する。ステップ54において、蓄積データ量Nが第1の設定値S1より大きければ、第1の設定部31が、ステップ56において、調停部35の条件を変更する。本例では、FIFOライトアクセスM1の有効サイクルを減すと共に、FIFOリードアクセスM2の有効サイクルを増やように条件が変えられ、FIFOリードアクセスM2の頻度が高められる。すなわち、調停条件が条件D1に設定される。一方、ステップ55において、蓄積データ量Nが第2の設定値S2(本例では、第1の設定値S1および第2の設定値S2はいずれもC/2)より小さければ、第2の設定部32は、ステップ57において、調停部35の条件を変更する。調停部35は、FIFOリートアクセスM2の有効サイクルを減らすと共に、FIFOライトアクセスM1の有効サイクルを増やすように設定され、FIFOライトアクセスM1の頻度が高められる。すなわち、調停条件が条件D2に設定される。
【0031】
このような処理は調停ユニット20にハードウェアロジックとして組み込むことも可能であるし、ソフトウェアロジック(ファームウェア)として組み込むことも可能である。あるいは、調停ユニット20としての制御を専用のマイクロプロセッサで制御することも可能であり、ソフトウェア制御を行う場合は、マイクロプロセッサや他のコンピュータとして動作する情報処理装置に上記のステップを実行するような命令を備えたプログラム(プログラム製品)をROMなどの記録媒体に記録して提供する。プログラムは、コンピュータネットワークを介して提供することも可能である。
【0032】
本例の調停ユニット20は、FIFOリードサイクルおよびFIFOライトサイクルの頻度を、FIFO領域22の蓄積データ量Nに応じてフレキシブルに変更することが可能である。したがって、FIFOに対するアクセスの頻度をプリンタ1などのシステムに適した状態となるように予め設定し、通常状態においては、そのような条件で調停していても、バッファフルやバッファアンダーランが発生する可能性があるときは、それらの発生を防止するようにアクセスの優先度が自動的に変更されるので、バッファフルやバッファアンダーランの発生を未然に防止できる。このため、FIFOに対するアクセスの優先基準を、システム(プリンタ)において予想される最も適した優先基準に設定し、通常状態では、システムの性能を高く維持できる。そして、システム性能が低下するような事態が発生しそうになると、そのシステム性能が低下する状態を防止できるので、システム性能を常に高い状態で維持できる。したがって、印刷データの量や画像処理の種類などが異なる様々な印刷処理であっても、常にメモリへのアクセス効率を高く保て、高速な処理を実現できる。特に、図3(a)および図4(a)に示した調停方法では、調停ユニット20が、他のメモリアクセスM3〜M5の頻度は変更しないようにし、その他のジョブに係るメモリアクセスの性能を維持しているので、FIFO以外のジョブの処理速度は低下させずに、FIFO動作に伴う処理性能を効率良く向上できる。このため、システムの処理能力をフルに発揮させるのに最適である。一方、今まで過度に高速のメモリを使用して構築していた高性能なシステムを、低コストなそれほど高速でない(低速の)メモリを用いて同等の性能のシステムを構築できる可能性があり、本発明により低コストで高性能のシステムを提供できる。
【0033】
また、本例の調停ユニット20を用いることにより、CPU11に特別なジョブまたは処理を発生させることなく、データ供給装置(画像処理ASIC)14で処理されたデータがFIFO領域22に蓄積されるスピードと、データ消費装置(メカ制御部)16でデータが消費されるスピードとの差をメモリ21に設定されたFIFO領域22で吸収またはマッチングさせることができる。したがって、調停ユニット20を備えたメモリユニット3を用いることにより、メモリユニット3というクローズされた範囲でデータ供給装置とデータ消費装置との速度差をマッチングさせることが可能であり、調停ユニット20をプリンタやホスト装置などのシステムに組み込むだけで、RAMなどのメモリデバイスをFIFOとして共用した高速で低コストのシステムを容易に構築することが可能である。
【0034】
さらに、FIFO領域22の蓄積データ量Nはカウンタ19aを用いて簡単に捉えることができるので、CPUなどで専用の処理を行わなくても良い。したがって、過剰な処理が増えることがなく、システム性能を効率良く引き出すことが可能である。また、調停条件の変更は第1および第2の設定値に依存するので、この条件の変更に伴う処理負担が大きいときには、第1および第2の設定値を変更するだけで、その処理負担を簡単に緩和することも可能である。したがって、調停ユニット20またはメモリユニット3が組み込まれるシステムに応じて第1および第2の設定値を変更することで、そのシステムにマッチした、すなわち、システムの性能アップに直結するような調停条件の変更処理を実現することも可能である。
【0035】
なお、上記では、FIFOライトアクセスM1およびFIFOリードアクセスM2の関係のみを変更し、その他のメモリアクセスM3〜M5に影響を与えないようにしているが、他のメモリアクセスM3〜M5を含めてFIFOアクセスM1およびM2の関係を調停することも可能である。この場合は、他のメモリアクセスM3〜M5に影響を与えるが、FIFO領域22のデータ量を最も効率良く調整できる。このような場合は、第1の設定部31により、FIFOリードアクセスM2がメモリ21に対する他のアクセスに対しても優先されるように設定し、第2の設定部32により、FIFOライトアクセスM1が他のアクセスに対しても優先されるように設定すれば良い。
【0036】
そのような方法の1つは、図3(b)に示すように、第1の設定部31により、サイクルを1つ増やして8サイクルを1周期とし、増やしたサイクルに対してFIFOリードアクセスM2を割り当てることである。これにより、FIFOリードアクセスM2のバンドレートを3/8に高め、これ以外のメモリアクセスM1、M3〜M5のバンドレートを相対的に低下させた条件D3に設定できる。一方、図4(b)に示すように、第2の設定部32により、サイクルを1つ増やして8サイクルを1周期とし、増やしたサイクルにFIFOライトアクセスM1を割り当てる。これにより、FIFOライトアクセスM1のバンドレートを3/8に高め、これ以外のメモリアクセスM2、M3〜M5のバンドレートを相対的に低下させた条件D4に設定できる。
【0037】
さらに、このようなサイクルを増やす方法と、上述したようなFIFOリードアクセスとFIFOライトアクセスとの割り当てを変更する方法を併用することも可能である。これにより、FIFOリードアクセスやFIFOライトアクセスが優先されるような条件を他段階に制御することも可能になり、蓄積データ量に応じてリアルタイムに調停条件を変更することが可能になる。
【0038】
上記では、画像処理ASIC14が搭載され、このASIC14で処理されたデータがFIFO領域22に供給されるデータ処理装置2を例に説明した。さらに、ASIC14を用いず、ホスト8から供給されたデータを印刷機構にそのまま送って印刷するプリンタにおいても、本発明を適用することが可能である。そのようなプリンタ1およびそれに搭載されたデータ処理装置2aの概略を図6に示してある。このプリンタ1のデータ処理装置2aは、画像処理ASIC14が搭載されておらず、インターフェイス13で取得したホスト8からのデータφがインターフェイス13からFIFOコントローラ19に直接供給されるようになっている。このため、このデータ処理装置2aでは、インターフェイス13がFIFO領域22にデータを供給するデータ供給装置になる。
【0039】
このようなデータ処理装置2aでは、ホスト8から転送されたデータをインターフェイス13で取得しFIFO領域22に送られるので、FIFOライトアクセスはホスト8とインターフェイス13との間の通信速度に依存する。このため、バッファフルの状態になるとホスト8との通信の待ち時間(Busy時間)が多く発生することになる。このようなデータ処理装置2aに本発明に係る調停ユニット20を搭載しておけば、メモリアクセスの割り当てを変化させてバッファフルの発生を防ぐことができるので、ホスト8との通信の待ち時間(Busy時間)を少なく、または無くすことができ、ホスト−インターフェイス間のもつバンドレートを最大限に活用できる。
【0040】
なお、FIFO領域22の蓄積データ量Nは、データの入出力をインクリメントおよびデクリメントするカウンタ(アップダウンカウンタ)の代わりに、FIFO領域22に対するリードアドレスおよびライトアドレスの差分を算出することにより求めることも可能である。このため、データ処理装置2aにおいては、蓄積データ量Nを判断する手段として、これらのアドレスの差分を算出する機能19bが設けられている。
【0041】
上記では、第1および第2の設定値として、FIFO領域22の蓄積データ量Nが領域22の容量の半分の値を割り当てていたが、データ供給装置によりFIFO領域に供給されるデータ量や、データ消費装置で処理されるデータ量などに応じて第1および第2の設定値を他のシステムに適した値に定めておくことが可能である。
【0042】
また、各チャネルのアクセス要求を確認(サンプリング)する方法は、高優先なチャネルから順番に確認している方法と、ある時点で同時に確認する方法があるが、本発明はサンプリング方法に依存するものではない。
【0043】
そして、上記では、プリンタを例に説明したが、本発明の調停ユニットまたはメモリユニットを適用可能な装置またはシステムはプリンタに限定されるものではなく、メモリをFIFO領域として共用するシステムであれば、本発明の調停ユニットまたはメモリユニットを適用できる。
【0044】
【発明の効果】
以上に説明したように、本発明においては、FIFO領域の蓄積データ量に応じて、FIFOリードアクセスおよびFIFOライトアクセスの優先度をフレキシブルに変更するようにしている。したがって、FIFOリードアクセスとFIFOライトアクセスをシステムに適した状態となるように調停していても、システムの性能の低下に繋がるバッファアンダーランやバッファフルの発生を確実に防止することができ、システムの性能を常に最大限に引き出すことが可能である。すなわち、システム内のメモリをFIFOとして共用する場合であっても、メモリのアクセス速度を最大限に活用でき、過度の高速なメモリを搭載しなくても、高性能なシステムを低コストで構築できる。
【図面の簡単な説明】
【図1】本発明に係るデータ処理装置が搭載されたプリンタの概略を示す図である。
【図2】図1に示すデータ処理装置に搭載されたメモリユニットの詳細を示すブロック図である。
【図3】図3は第1の設定部により調停部の設定が変えられる様子を示す図であり、図3(a)はFIFOリードアクセスとFIFOライトアクセスの関係のみを変更する方法を示す図、図3(b)はサイクルを1つの増す方法を示す図である。
【図4】図4は第2の設定部により調停部の設定が変えられる様子を示す図であり、図4(a)はFIFOリードアクセスとFIFOライトアクセスの関係のみを変更する方法を示す図、図4(b)はサイクルを1つの増す方法を示す図である。
【図5】調停ユニットにおいてFIFOリードアクセスおよびFIFOライトアクセスの優先度を変更する処理を示すフローチャートである。
【図6】異なるデータ処理装置が搭載されたプリンタの概略を示す図である。
【図7】FIFO領域が設定されたメモリをラウンドロビン方式を用いて調停する方法を説明するための図である。
【符号の説明】
1 プリンタ
2、2a データ処理装置
3 メモリユニット
14 画像処理ASIC(データ供給装置)
15 メモリコントローラ
16 メカ制御部(データ消費装置)
19 FIFOコントローラ
19a カウンタ(蓄積データ量を判断する手段)
20 調停ユニット
21 メモリ
22 FIFO用の領域
24 調停回路
30 設定部
31 第1の設定部
32 第2の設定部
35 調停部
[0001]
TECHNICAL FIELD OF THE INVENTION
The present invention relates to a method and an apparatus for arbitrating access to a memory in which an area for a FIFO is set.
[0002]
[Prior art]
There is known a system in which an area for FIFO is set in a memory such as a RAM or a memory device, and is used for a FIFO buffer and other purposes. Japanese Patent Application Laid-Open No. 2001-175591 discloses a data buffer device and method using a memory as a FIFO.
[0003]
[Patent Document 1]
JP-A-2001-175591
[0004]
[Problems to be solved by the invention]
When one memory is used for several purposes, arbitration processing for memory access is indispensable. A round robin method and a priority (priority) method are known as arbitration processing algorithms used as task scheduling of an operating system (OS) or the like. By using these arbitration methods, it is possible to construct a system in which the memory is shared for the FIFO area and other purposes.
[0005]
In the arbitration method, the priority or the frequency of the write channel or the read channel is set based on the expected access frequency to the FIFO in the system. However, if a low-priority design is employed for writing to the FIFO (write access or write channel), the probability of buffer underrun increases when the amount of data stored in the FIFO area is small, and the overall system There is a concern that the capacity may be reduced.
[0006]
On the other hand, if a design with a low priority order for reading (read access or read channel) for the FIFO is adopted, when the amount of data stored in the FIFO area is large, the time ratio of the buffer full state increases, and the FIFO write access However, there is a concern that the performance of the entire system will be degraded due to waiting.
[0007]
Considering only that the memory is effectively used as a FIFO, a design in which the priority of write access and read access of the FIFO is increased in advance may prevent buffer underrun or buffer full and improve the performance of the FIFO. unknown. However, if the memory is shared for a purpose other than the FIFO, the performance of accessing the memory for purposes other than the FIFO access will be reduced. There is.
[0008]
FIG. 7 shows an arbitration method based on a simple weighted round robin method. Arbitration targets are FIFO write access M1, FIFO read access M2, memory access M3 of other job A, memory access M4 of other job B, and memory access M5 of other job C. . An access (channel) is assigned to the arbitration unit 90 such that seven cycles constitute one cycle in total. In FIG. 7, both the FIFO write access M1 and the FIFO read access M2 are set so that 2/7 of the entire band rate of the memory can be used. However, when the analysis of the normal operation of the system shows that the frequency of the FIFO write access is small, the frequency of the FIFO write access M1 is smaller than the frequency of the FIFO read access M2, that is, the frequency of the FIFO write access M1. The band rate is set to 1/7. At this time, if the data capacity of the FIFO area becomes smaller, the setting of the band rate is higher in the FIFO read access than in the FIFO write access. Therefore, the data in the FIFO area is hardly increased, and is consumed by the FIFO read. Underrun. For this reason, the performance of the FIFO read access is reduced in a system that mainly performs the FIFO read access rather than the FIFO write access, so that the system performance may be reduced.
[0009]
Conversely, when it is determined that the frequency of the FIFO write access is higher than that of the FIFO read access, the band rate of the FIFO read access is set to be smaller than the band rate of the FIFO write access. At this time, if there is much data in the FIFO area, the data in the FIFO area further increases, a buffer full state occurs, and the FIFO write access is interrupted. Then, in a system in which the FIFO write access is larger than the FIFO read access, the FIFO write access is hindered, and the performance of the system is reduced.
[0010]
By increasing the frequency of the FIFO write access and the FIFO read access or increasing the maximum transfer rate, the above-mentioned state hardly occurs. However, since access to the memory is dominated by the FIFO, access to other jobs is kept waiting, and the performance of the system may be degraded. Therefore, if arbitration is performed so that the read access is prioritized even if the condition of access to the memory also used as the FIFO is a system with a high read access frequency, a buffer underrun may occur and the performance of the system may be degraded. Conversely, arbitration so that write access is prioritized even for a system with a high frequency of write access will result in a buffer full, which may degrade the performance of the system.
[0011]
Therefore, in the present invention, in a method and a unit for arbitrating access to a memory shared as a FIFO area, the frequency of read access can be increased in a system having a high frequency of read access, and the frequency of write access can be increased. It is an object of the present invention to provide a memory access arbitration method and unit that can increase the frequency of write access in a high system. On the other hand, it is an object of the present invention to provide a memory access arbitration method and unit capable of preventing occurrence of buffer underrun and buffer full, and preventing a decrease in system performance due to an increase in read or write access frequency.
[0012]
[Means for Solving the Problems]
For this reason, in the memory access arbitration method of the present invention, conditions for giving priority to FIFO read access and conditions for giving priority to FIFO write access are provided, and these conditions are stored in the stored data stored in the FIFO area. It can be changed according to the amount. That is, in the memory access arbitration method of the present invention for permitting access to a memory in which a FIFO area is set, a step of determining the amount of stored data stored in the FIFO area; If it is determined that the value is larger than the set value, a first step of setting conditions for permitting access to the memory so that priority is given to FIFO read access for reading data from the FIFO area, and accumulation of the FIFO area If it is determined that the data amount is smaller than the second set value, a second step of setting conditions for permitting access to the memory so that FIFO write access for writing data to the FIFO area is prioritized. Have.
[0013]
The memory access arbitration unit of the present invention for permitting access to a memory in which a FIFO area is set includes means for determining the amount of stored data stored in the FIFO area, First setting means for setting conditions for permitting access to the memory so that the FIFO read access is prioritized if it is determined to be larger than the set value, and it is determined that the accumulated data amount is smaller than the second set value. Then, there is provided a second setting means for setting a condition for permitting access to the memory so that the FIFO write access is prioritized. Further, the memory access arbitration method of the present invention can be provided as a program that operates on an information processing device. That is, the present invention allows a processor such as a CPU or a computer, which is an information processing apparatus, to execute the determining step, the first step, and the second step of the above-described memory access arbitration method. Includes programs with possible instructions. Such a program can be provided by being recorded on a suitable recording medium such as a CD-ROM or a ROM in the system, or can be provided via a computer network.
[0014]
In the memory access arbitration method and arbitration unit of the present invention, when it is determined that the amount of data stored in the FIFO area is larger than the first set value, the FIFO read access is prioritized, and the frequency of the FIFO read access increases. Therefore, the frequency of reading the stored data in the FIFO area increases, so that the occurrence of buffer full can be prevented beforehand. On the other hand, when it is determined that the amount of data stored in the FIFO area is smaller than the second set value, the condition for giving priority to the FIFO write access is set, so that the frequency of the FIFO write access increases. Therefore, the frequency of writing data in the FIFO area increases, so that the amount of accumulated data increases, and the occurrence of buffer underrun can be prevented. For this reason, in a steady state, even if the frequency of FIFO read access and FIFO write access is arbitrated so as to be suitable for the system, it is possible to prevent a state in which the system performance is degraded such as buffer underrun or buffer full. And maintain high system performance.
[0015]
Therefore, a memory unit having the memory access arbitration unit of the present invention and a memory in which an area for a FIFO is set, and which is permitted to be accessed by the memory access arbitration unit, can be written and read in accordance with a system request. Can be set, and on the other hand, a situation in which the system performance is degraded, such as buffer underrun or buffer full, is prevented. Therefore, a data processing device having the memory unit, a data supply device for supplying data to a FIFO area set in the memory, and a data consuming device for reading and consuming data stored in the FIFO region Can perform processing with high performance.
[0016]
In order to reliably prevent the occurrence of buffer full and buffer underrun, in the first step and the first setting means, the condition that the frequency of the FIFO read access is higher than the frequency of the FIFO write access, that is, the priority is set. In the case of the system, the priority is set, and in the case of the round robin system, the band rate is set. In the second step and the second setting means, conditions are set such that the frequency of the FIFO read access is lower than the frequency of the FIFO write access. It is desirable to set. By setting the conditions in this manner, the increase and decrease of the data amount in the FIFO area can be reliably controlled, so that the occurrence of buffer full and buffer underrun can be reliably controlled.
[0017]
If only the relationship between the FIFO read access and the FIFO write access is set in the first and second steps and the first and second setting means, the buffer full and the buffer can be set without affecting other accesses to the memory. The occurrence of underrun can be suppressed. On the other hand, in the first step and the first setting means, the setting is made so that the FIFO read access is given priority over all accesses to the memory, and in the second step and the second setting means, the FIFO write access is performed. It is also possible to set so that priority is given to all accesses to the memory. In this case, although other accesses to the memory are affected, the amount of data in the FIFO area can be adjusted most efficiently, and the occurrence of buffer full and buffer underrun can be suppressed efficiently.
[0018]
The first and second set values may be determined in consideration of the data amount of the data supply source and the processing speed of the data consumption destination. It is possible to set the second set value to about 70% of the data amount or to set the second set value to about 30% of the allowable data amount of the FIFO area. Also, the first and second set values can be set to half or 50% of the allowable data amount that can be stored in the FIFO area.
[0019]
BEST MODE FOR CARRYING OUT THE INVENTION
Hereinafter, the present invention will be described in more detail with reference to the drawings. FIG. 1 shows a schematic configuration of the printer. The printer 1 has a memory unit provided with a memory access arbitration unit according to the present invention. The printer 1 performs image processing of print data φ transferred from the host device 8 or the like, and prints it on the paper 5 by the printing mechanism 4. The data processing apparatus 2 that performs image processing and controls the printing mechanism 4 is used. Have. The data processing device 2 includes a CPU 11, a ROM 12 in which firmware and the like are recorded, an interface 13 for acquiring print data φ, an image processing ASIC 14 for performing image processing on the print data φ, and a memory unit 3. These are connected via a bus 17. The memory unit 3 includes a memory or a memory device 21 such as a RAM, an arbitration unit 20 capable of arbitrating memory access to the memory 21, and a memory controller 15. Further, the data processing device 2 includes a mechanical control unit 16 that controls the printing mechanism 4.
[0020]
An area 22 for FIFO is set in the memory 21 of the memory unit 3, and data processed by the image processing ASIC 14 is stored or stored in the FIFO area 22, and the stored data (accumulated data) is controlled by mechanical control. The data is output to the printing mechanism 4 via the unit 16. For this reason, the difference between the amount of data or the processing speed supplied from the image processing ASIC 14 to the FIFO area 22 and the amount of data or the processing speed in the FIFO area consumed by the printing mechanism 4 via the mechanical control unit 16 is stored in the memory 21. Is absorbed by the FIFO area 22 set to the. Therefore, in this example, the image processing ASIC 14 is a data supply device that supplies data to the FIFO area 22, and the mechanical control unit 16 or the printing function 4 is a data consumption device that consumes accumulated data in the FIFO area 22.
[0021]
The memory 21 of the memory unit 3 is also used as an area developed when executing a program recorded in the ROM 12 and a temporary storage area for data for executing the program. One memory 21 or a memory block accessed as one memory 21 is shared with the FIFO for other purposes.
[0022]
The memory unit 3 includes a memory 21 in which a FIFO area 22 is set, an arbitration unit 20 for arbitrating an access request to the memory 21, and a control signal to the memory 21 to output an access request granted by the arbitration unit 20. And a memory controller 15 capable of writing or reading data to or from a predetermined address.
[0023]
The arbitration unit 20 includes a FIFO read request (or read access) for reading data from the FIFO area 22, a FIFO write request (or write access) for writing data to the FIFO area 22, and a memory write request (or memory write access) for other jobs. An arbitration circuit 24 that receives a memory read request (or memory read access) and permits an access request to the memory 21 in accordance with a predetermined condition or setting; and an amount of data stored in the FIFO area 22 (amount of stored data) A FIFO controller 19 having a function 19a for counting N. Therefore, data for writing and reading data to and from the FIFO area 22 is controlled by the arbitration circuit 24 via the FIFO controller 19. For example, data to be written into the FIFO area 22 is supplied to the arbitration circuit 24 via the FIFO controller 19, and data read from the FIFO area 22 is supplied to the FIFO controller 19 via the arbitration circuit 24 and transmitted to the mechanical control unit 16. Is output. Accordingly, the FIFO controller 19 can grasp the accumulated data amount N in the FIFO area 22 by operating the counter 19a based on the input / output of data. The counter 19a corresponds to a means for determining the accumulated data amount N.
[0024]
FIG. 2 shows details of the memory unit 3 using a block diagram. The arbitration circuit 24 of the memory unit 3 includes a FIFO read channel 41 that receives a FIFO read request, a FIFO write channel 42 that receives a FIFO write request, a memory write channel 43 that receives another memory write request, and a memory that receives another memory read request. It has a read channel 44 and can accept a plurality of types of access requests. For an access request related to the FIFO, a read address and a write address of data are generated by a read pointer and a write pointer provided in the FIFO controller 19 and supplied to the arbitration circuit 24. The operation of reading data in the written order is realized.
[0025]
The arbitration circuit 24 includes a setting unit 30 capable of changing the priority order or band rate of access to the memory, and permits a predetermined memory access according to the priority order or band rate set by the setting unit 30. And an arbitration unit 35 for waiting for access. If the output of the counter 19a, that is, if the accumulated data amount N of the FIFO area 22 is determined to be larger than the first set value S1, the FIFO read access M2 for reading data from the FIFO area 22 A first setting unit 31 that sets a condition D1 for permitting access to the memory 21 in the arbitration unit 35 so as to be prioritized over the FIFO write access M1 that writes data to the arbitration unit 35; A second setting unit 32 that sets a condition D2 for permitting access to the memory 21 in the arbitration unit 35 so that the FIFO write access M1 has a higher priority than the FIFO read access M2 if it is determined to be smaller. ing. In this example, the first and second set values S1 and S2 are both set to 50% or half (C / 2) of the allowable data amount or capacity C that can be stored in the FIFO area 22.
[0026]
FIG. 3 shows how the access to the memory 21 changes when the setting of the arbitration unit 35 is changed by the first setting unit 31, and FIG. 4 shows how the setting of the arbitration unit 35 is changed by the second setting unit 32. The processing when it is changed is shown. Note that, in these figures as well, as described with reference to FIG. 7, the FIFO write access M1, the FIFO read access M2, the memory access M3 of the other job A, the memory access M4 of the other job B, and the other There are five memory accesses of the memory access M5 of the job C, and channel assignment is performed with seven cycles as one cycle in total. Then, it is assumed that both the FIFO write access M1 and the FIFO read access M2 are set to the condition D in which 2/7 of the entire band rate of the memory 21 can be used.
[0027]
Basically, the first setting unit 31 and the second setting unit 32 are adapted to arbitrate the memory access by employing the round robin algorithm described with reference to FIG. The frequency of the FIFO write access M1 and the frequency of the FIFO read access M2 are flexibly changed in accordance with the accumulated data amount N of 22. First, as shown in FIG. 3A, when the first setting unit 31 determines that the accumulated data amount N is larger than C / 2 from the output of the counter 19a of the FIFO controller 19, the arbitrating unit 35 A setting is made so that the frequency of the FIFO write access M1 is reduced, and the reduced amount is assigned to the FIFO read access M2 (condition D1). As a result, the frequency of the FIFO read access M2 increases. That is, in the FIFO write access M1, the overall band rate of the memory 21 is reduced from 2/7 to 1/7, and the band rate of the FIFO read access M2 is increased from 2/7 to 3/7. Priority is given to the write access M1, and the frequency of read access is increased. Therefore, even if the accumulated data amount N becomes large, there is no possibility that the buffer becomes full, and the occurrence of the buffer full can be prevented beforehand.
[0028]
On the other hand, as shown in FIG. 4A, when the second setting unit 32 determines that the accumulated data amount N is smaller than C / 2 from the output of the counter 19a of the FIFO controller 19, the arbitrating unit 35 The frequency of the FIFO read access M2 is reduced, and the reduced amount is set to be assigned to the FIFO write access M1 (condition D2). As a result, the frequency of the FIFO write access M1 increases. That is, in the FIFO read access M2, the overall band rate of the memory 21 is reduced from 2/7 to 1/7, and the band rate of the FIFO write access M1 is increased from 2/7 to 3/7. This is prioritized over the read access M2, and the frequency of write access is increased. For this reason, when the accumulated data amount N is small, the FIFO write is permitted prior to the FIFO read, so that the data amount in the FIFO area increases and the occurrence of buffer underrun can be prevented beforehand.
[0029]
In the above control, the first setting unit 31 and the second setting unit 32 set the conditions D1 and D2 in which only the relationship between the FIFO write access M1 and the FIFO read access M2 has been changed, and set the memory access M3 for other jobs. The conditions of .about.M5 are not changed. That is, the band rates of the other memory accesses M3 to M5 are maintained at 1/7, and the priorities of the other memory accesses M3 to M5 do not change. Therefore, occurrence of buffer full and buffer underrun is reliably prevented without affecting other memory accesses.
[0030]
FIG. 5 shows the arbitration process performed by the arbitration unit 20 using a flowchart. First, in step 51, when the arbitration circuit 24 of the arbitration unit 20 receives any of the memory access requests M1 to M5, in step 52, it arbitrates memory access according to the set conditions. Next, in step 53, the setting unit 30 refers to the counter 19a of the FIFO controller 19 to determine the accumulated data amount N. If the accumulated data amount N is larger than the first set value S1 in step 54, the first setting unit 31 changes the condition of the arbitration unit 35 in step 56. In this example, the conditions are changed so that the number of valid cycles of the FIFO write access M1 is reduced and the number of valid cycles of the FIFO read access M2 is increased, so that the frequency of the FIFO read access M2 is increased. That is, the arbitration condition is set to the condition D1. On the other hand, in step 55, if the accumulated data amount N is smaller than the second set value S2 (in this example, both the first set value S1 and the second set value S2 are C / 2), the second set value is set. The unit 32 changes the condition of the arbitration unit 35 in Step 57. The arbitration unit 35 is set to reduce the number of valid cycles of the FIFO write access M2 and increase the number of valid cycles of the FIFO write access M1, thereby increasing the frequency of the FIFO write access M1. That is, the arbitration condition is set to the condition D2.
[0031]
Such processing can be incorporated in the arbitration unit 20 as hardware logic, or can be incorporated as software logic (firmware). Alternatively, the control as the arbitration unit 20 can be controlled by a dedicated microprocessor. In the case of performing software control, the above-described steps are executed by an information processing device that operates as a microprocessor or another computer. A program (program product) provided with instructions is recorded on a recording medium such as a ROM and provided. The program may be provided via a computer network.
[0032]
The arbitration unit 20 of this example can flexibly change the frequency of the FIFO read cycle and the FIFO write cycle in accordance with the amount N of data stored in the FIFO area 22. Therefore, the frequency of access to the FIFO is set in advance so as to be suitable for a system such as the printer 1, and in a normal state, even if arbitration is performed under such conditions, a buffer full or a buffer underrun occurs. When there is a possibility, the access priority is automatically changed so as to prevent such occurrence, so that occurrence of buffer full or buffer underrun can be prevented beforehand. For this reason, the priority criterion for access to the FIFO is set to the most suitable priority criterion expected in the system (printer), and the performance of the system can be maintained high in the normal state. When a situation in which the system performance is reduced is likely to occur, the state in which the system performance is reduced can be prevented, so that the system performance can always be maintained at a high level. Therefore, even in various printing processes having different amounts of print data, different types of image processing, and the like, high-speed processing can be realized while always maintaining high memory access efficiency. In particular, in the arbitration method shown in FIGS. 3A and 4A, the arbitration unit 20 keeps the frequency of the other memory accesses M3 to M5 unchanged, and improves the performance of the memory access related to other jobs. Since it is maintained, the processing performance of the FIFO operation can be efficiently improved without lowering the processing speed of jobs other than the FIFO. For this reason, it is optimal for making full use of the processing capacity of the system. On the other hand, a high-performance system that used to be built using excessively high-speed memory may be able to build a system with equivalent performance using low-cost, not so fast (slow) memory. According to the present invention, a high-performance system can be provided at low cost.
[0033]
Further, by using the arbitration unit 20 of this example, the speed at which the data processed by the data supply device (image processing ASIC) 14 is accumulated in the FIFO area 22 without causing the CPU 11 to perform a special job or processing. The difference from the speed at which data is consumed by the data consuming device (mechanical control unit) 16 can be absorbed or matched by the FIFO area 22 set in the memory 21. Therefore, by using the memory unit 3 including the arbitration unit 20, it is possible to match the speed difference between the data supply device and the data consuming device in the closed range of the memory unit 3, and to set the arbitration unit 20 to the printer. A high-speed, low-cost system in which a memory device such as a RAM is commonly used as a FIFO can be easily constructed simply by incorporating it into a system such as a host and a host device.
[0034]
Furthermore, since the accumulated data amount N in the FIFO area 22 can be easily grasped by using the counter 19a, it is not necessary to perform a dedicated process by a CPU or the like. Therefore, it is possible to efficiently extract system performance without increasing excessive processing. Further, since the change of the arbitration condition depends on the first and second set values, when the processing load accompanying the change of the condition is large, only changing the first and second set values reduces the processing load. It is also possible to ease it easily. Therefore, by changing the first and second set values according to the system in which the arbitration unit 20 or the memory unit 3 is incorporated, arbitration conditions that match the system, that is, are directly linked to an increase in the performance of the system. It is also possible to realize a change process.
[0035]
In the above description, only the relationship between the FIFO write access M1 and the FIFO read access M2 is changed so as not to affect the other memory accesses M3 to M5. It is also possible to arbitrate the relationship between accesses M1 and M2. In this case, the other memory accesses M3 to M5 are affected, but the data amount of the FIFO area 22 can be adjusted most efficiently. In such a case, the first setting unit 31 sets the FIFO read access M2 to be given priority over other accesses to the memory 21, and the second setting unit 32 sets the FIFO write access M1 to What is necessary is just to set so that priority may be given to other accesses.
[0036]
One such method is that, as shown in FIG. 3B, the first setting unit 31 increases the cycle by one to make eight cycles one cycle, and performs FIFO read access M2 for the increased cycle. Is to assign Thus, the condition D3 can be set in which the band rate of the FIFO read access M2 is increased to / and the band rates of the other memory accesses M1, M3 to M5 are relatively reduced. On the other hand, as shown in FIG. 4B, the second setting unit 32 adds one cycle to eight cycles as one cycle, and assigns the FIFO write access M1 to the increased cycle. Thus, the condition D4 can be set in which the band rate of the FIFO write access M1 is increased to 3/8 and the band rates of the other memory accesses M2 and M3 to M5 are relatively reduced.
[0037]
Further, it is possible to use both the method of increasing the number of cycles and the method of changing the assignment between the FIFO read access and the FIFO write access as described above. This makes it possible to control the condition in which the FIFO read access or the FIFO write access is prioritized in another stage, and to change the arbitration condition in real time according to the amount of stored data.
[0038]
In the above, the data processing device 2 in which the image processing ASIC 14 is mounted and the data processed by the ASIC 14 is supplied to the FIFO area 22 has been described as an example. Further, the present invention can be applied to a printer that sends the data supplied from the host 8 to the printing mechanism as it is, without using the ASIC 14, and prints the data. FIG. 6 schematically shows such a printer 1 and a data processing device 2a mounted thereon. The data processing device 2a of the printer 1 does not include the image processing ASIC 14, and the data φ from the host 8 acquired by the interface 13 is directly supplied from the interface 13 to the FIFO controller 19. Therefore, in the data processing device 2a, the interface 13 is a data supply device that supplies data to the FIFO area 22.
[0039]
In such a data processing device 2a, the data transferred from the host 8 is acquired by the interface 13 and sent to the FIFO area 22, so that the FIFO write access depends on the communication speed between the host 8 and the interface 13. Therefore, when the buffer becomes full, a long waiting time (Busy time) for communication with the host 8 occurs. If the arbitration unit 20 according to the present invention is mounted on such a data processing device 2a, the occurrence of buffer full can be prevented by changing the allocation of memory access, so that the waiting time for communication with the host 8 ( Busy time) can be reduced or eliminated, and the band rate between the host and the interface can be maximized.
[0040]
Note that the accumulated data amount N in the FIFO area 22 may be obtained by calculating a difference between a read address and a write address for the FIFO area 22 instead of a counter (up / down counter) for incrementing and decrementing data input / output. It is possible. For this reason, the data processing device 2a is provided with a function 19b for calculating the difference between these addresses as means for determining the accumulated data amount N.
[0041]
In the above description, as the first and second setting values, the accumulated data amount N of the FIFO area 22 is assigned a value that is half of the capacity of the area 22, but the data amount supplied to the FIFO area by the data supply device, The first and second set values can be set to values suitable for other systems according to the amount of data processed by the data consuming device.
[0042]
In addition, the method of checking (sampling) the access request of each channel includes a method of checking in order from the channel with the highest priority and a method of checking at the same time at a certain time. The present invention depends on the sampling method. is not.
[0043]
In the above description, the printer has been described as an example. However, the device or system to which the arbitration unit or the memory unit of the present invention can be applied is not limited to the printer. The arbitration unit or the memory unit of the present invention can be applied.
[0044]
【The invention's effect】
As described above, in the present invention, the priority of FIFO read access and FIFO write access is flexibly changed according to the amount of data stored in the FIFO area. Therefore, even if the FIFO read access and the FIFO write access are arbitrated so as to be in a state suitable for the system, it is possible to reliably prevent the occurrence of a buffer underrun or a buffer full, which leads to a decrease in system performance. It is possible to always bring out the maximum performance. That is, even when the memory in the system is shared as a FIFO, the access speed of the memory can be maximized, and a high-performance system can be constructed at low cost without mounting an excessively high-speed memory. .
[Brief description of the drawings]
FIG. 1 is a diagram schematically showing a printer equipped with a data processing device according to the present invention.
FIG. 2 is a block diagram showing details of a memory unit mounted on the data processing device shown in FIG. 1;
FIG. 3 is a diagram showing how the setting of an arbitration unit is changed by a first setting unit, and FIG. 3 (a) is a diagram showing a method of changing only the relationship between FIFO read access and FIFO write access; FIG. 3B is a diagram showing a method for increasing the number of cycles by one.
FIG. 4 is a diagram showing how the setting of an arbitration unit is changed by a second setting unit, and FIG. 4 (a) is a diagram showing a method of changing only the relationship between FIFO read access and FIFO write access; FIG. 4B is a diagram showing a method for increasing the number of cycles by one.
FIG. 5 is a flowchart showing a process of changing the priority of FIFO read access and FIFO write access in the arbitration unit.
FIG. 6 is a diagram schematically illustrating a printer on which a different data processing device is mounted.
FIG. 7 is a diagram for explaining a method of arbitrating a memory in which a FIFO area is set using a round robin method.
[Explanation of symbols]
1 Printer
2, 2a Data processing device
3 Memory unit
14. Image processing ASIC (data supply device)
15 Memory controller
16 Mechanical control unit (data consuming device)
19 FIFO controller
19a counter (means for judging the amount of accumulated data)
20 Mediation unit
21 memory
22 Area for FIFO
24 Arbitration circuit
30 Setting section
31 First setting unit
32 Second setting unit
35 Arbitration Department

Claims (15)

FIFO用の領域が設定されたメモリに対するアクセスを許可するメモリアクセス調停方法であって、
前記FIFO用の領域に蓄積されている蓄積データ量を判断する工程と、
前記蓄積データ量が第1の設定値より大きいと判断されれば、前記FIFO用の領域からデータを読み出すFIFOリードアクセスが優先されるように、前記メモリに対するアクセスを許可する条件を設定する第1の工程と、
前記蓄積データ量が第2の設定値より小さいと判断されれば、前記FIFO用の領域にデータを書き込むFIFOライトアクセスが優先されるように、前記メモリに対するアクセスを許可する条件を設定する第2の工程とを有するメモリアクセス調停方法。
A memory access arbitration method for permitting access to a memory in which a FIFO area is set,
Determining the amount of stored data stored in the FIFO area;
If it is determined that the accumulated data amount is larger than the first set value, a first condition for permitting access to the memory is set so that a FIFO read access for reading data from the FIFO area is prioritized. Process and
If it is determined that the accumulated data amount is smaller than the second set value, a second condition for permitting access to the memory is set so that FIFO write access for writing data to the FIFO area is prioritized. And a memory access arbitration method.
請求項1において、前記第1の工程では、前記FIFOリードアクセスの頻度が大きくなるように前記条件を設定し、
前記第2の工程では、前記FIFOライトアクセスの頻度が大きくなるように前記条件を設定するメモリアクセス調停方法。
2. The method according to claim 1, wherein in the first step, the condition is set such that a frequency of the FIFO read access increases.
In the second step, a memory access arbitration method for setting the condition so that the frequency of the FIFO write access increases.
請求項2において、前記第1の工程では、前記FIFOリードアクセスの頻度が、前記FIFOライトアクセスの頻度より大きくなるように前記条件を設定し、
前記第2の工程では、前記FIFOリードアクセスの頻度が、前記FIFOライトアクセスの頻度より小さくなるように前記条件を設定するメモリアクセス調停方法。
3. The condition according to claim 2, wherein in the first step, the condition is set such that a frequency of the FIFO read access is higher than a frequency of the FIFO write access.
In the second step, a memory access arbitration method for setting the condition such that a frequency of the FIFO read access is smaller than a frequency of the FIFO write access.
請求項1において、前記第1および第2の設定値は、前記FIFO用の領域に蓄積可能な許容データ量の半分であるメモリアクセス調停方法。2. The memory access arbitration method according to claim 1, wherein the first and second set values are half of an allowable data amount that can be stored in the FIFO area. 請求項1において、前記第1の工程では、前記FIFOリードアクセスが前記メモリに対する全てのアクセスに対しても優先されるように設定し、
前記第2の工程では、前記FIFOライトアクセスが前記メモリに対する全てのアクセスに対しても優先されるように設定するメモリアクセス調停方法。
2. The method according to claim 1, wherein in the first step, the FIFO read access is set to have priority over all accesses to the memory.
In the second step, a memory access arbitration method in which the FIFO write access is set to have priority over all accesses to the memory.
請求項1において、前記第1および第2の工程では、前記FIFOリードアクセスおよびFIFOライトアクセスの関係のみを設定するメモリアクセス調停方法。2. The memory access arbitration method according to claim 1, wherein in the first and second steps, only a relationship between the FIFO read access and the FIFO write access is set. FIFO用の領域が設定されたメモリに対するアクセスを許可するメモリアクセス調停ユニットであって、
前記FIFO用の領域に蓄積されている蓄積データ量を判断する手段と、
前記蓄積データ量が第1の設定値より大きいと判断されれば、前記FIFO用の領域からデータを読み出すFIFOリードアクセスが優先されるように、前記メモリに対するアクセスを許可する条件を設定する第1の設定手段と、
前記蓄積データ量が第2の設定値より小さいと判断されれば、前記FIFO用の領域にデータを書き込むFIFOライトアクセスが優先されるように、前記メモリに対するアクセスを許可する条件を設定する第2の設定手段とを有するメモリアクセス調停ユニット。
A memory access arbitration unit for permitting access to a memory in which a FIFO area is set,
Means for determining the amount of stored data stored in the FIFO area;
If it is determined that the accumulated data amount is larger than the first set value, a first condition for permitting access to the memory is set so that a FIFO read access for reading data from the FIFO area is prioritized. Setting means,
If it is determined that the accumulated data amount is smaller than the second set value, a second condition for permitting access to the memory is set so that FIFO write access for writing data to the FIFO area is prioritized. A memory access arbitration unit comprising:
請求項7において、前記第1の設定手段は、前記FIFOリードアクセスの頻度が大きくなるように前記条件を設定し、
前記第2の設定手段は、前記FIFOライトアクセスの頻度が大きくなるように前記条件を設定するメモリアクセス調停ユニット。
8. The method according to claim 7, wherein the first setting unit sets the condition so that a frequency of the FIFO read access increases.
The second setting unit is a memory access arbitration unit that sets the condition so that the frequency of the FIFO write access increases.
請求項8において、前記第1の設定手段は、前記FIFOリードアクセスの頻度が、前記FIFOライトアクセスの頻度より大きくなるように前記条件を設定し、
前記第2の設定手段は、前記FIFOリードアクセスの頻度が、前記FIFOライトアクセスの頻度より小さくなるように前記条件を設定するメモリアクセス調停ユニット。
9. The method according to claim 8, wherein the first setting unit sets the condition such that a frequency of the FIFO read access is higher than a frequency of the FIFO write access.
The second setting means is a memory access arbitration unit that sets the condition such that the frequency of the FIFO read access is lower than the frequency of the FIFO write access.
請求項7において、前記第1および第2の設定値は、前記FIFO用の領域に蓄積可能な許容データ量の半分であるメモリアクセス調停ユニット。8. The memory access arbitration unit according to claim 7, wherein the first and second set values are half of an allowable data amount that can be stored in the FIFO area. 請求項7において、前記第1の設定手段は、前記FIFOリードアクセスを前記メモリに対する全てのアクセスに対しても優先されるように設定し、
前記第2の設定手段は、前記FIFOライトアクセスを前記メモリに対する全てのアクセスに対しても優先されるように設定するメモリアクセス調停ユニット。
8. The method according to claim 7, wherein the first setting unit sets the FIFO read access such that the FIFO read access is prioritized over all accesses to the memory.
The second setting means is a memory access arbitration unit for setting the FIFO write access such that the FIFO write access is prioritized for all accesses to the memory.
請求項7において、前記第1および第2の設定手段は、前記FIFOリードアクセスおよびFIFOライトアクセスの関係のみを設定するメモリアクセス調停ユニット。8. The memory access arbitration unit according to claim 7, wherein the first and second setting units set only a relationship between the FIFO read access and the FIFO write access. 請求項7に記載のメモリアクセス調停ユニットと、FIFO用の領域が設定されたメモリであって、前記メモリアクセス調停ユニットによりアクセスが許可されるメモリとを有するメモリユニット。A memory unit comprising: the memory access arbitration unit according to claim 7; and a memory in which an area for FIFO is set, wherein the memory is permitted to be accessed by the memory access arbitration unit. 請求項13に記載のメモリユニットと、前記メモリに設定されたFIFO用の領域にデータを供給するデータ供給装置と、前記FIFO用の領域に蓄えられたデータを読み出して消費するデータ消費装置とを有するデータ処理装置。14. The memory unit according to claim 13, a data supply device that supplies data to an area for FIFO set in the memory, and a data consumption device that reads and consumes data stored in the area for FIFO. Data processing device. FIFO用の領域が設定されたメモリに対するアクセスを許可するメモリアクセスを調停するプログラムであって、
前記FIFO用の領域に蓄積されている蓄積データ量を判断する工程と、
前記蓄積データ量が第1の設定値より大きいと判断されれば、前記FIFO用の領域からデータを読み出すFIFOリードアクセスが優先されるように、前記メモリに対するアクセスを許可する条件を設定する第1の工程と、
前記蓄積データ量が第2の設定値より小さいと判断されれば、前記FIFO用の領域にデータを書き込むFIFOライトアクセスが優先されるように、前記メモリに対するアクセスを許可する条件を設定する第2の工程とを実行可能な命令を有するプログラム。
A program for arbitrating memory access for permitting access to a memory in which an area for FIFO is set,
Determining the amount of stored data stored in the FIFO area;
If it is determined that the accumulated data amount is larger than the first set value, a first condition for permitting access to the memory is set so that a FIFO read access for reading data from the FIFO area is prioritized. Process and
If it is determined that the accumulated data amount is smaller than the second set value, a second condition for permitting access to the memory is set so that FIFO write access for writing data to the FIFO area is prioritized. Having instructions capable of executing the steps of
JP2002353166A 2002-12-05 2002-12-05 Memory access arbitration method and memory access arbitration unit Pending JP2004185451A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2002353166A JP2004185451A (en) 2002-12-05 2002-12-05 Memory access arbitration method and memory access arbitration unit

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2002353166A JP2004185451A (en) 2002-12-05 2002-12-05 Memory access arbitration method and memory access arbitration unit

Publications (1)

Publication Number Publication Date
JP2004185451A true JP2004185451A (en) 2004-07-02

Family

ID=32754520

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2002353166A Pending JP2004185451A (en) 2002-12-05 2002-12-05 Memory access arbitration method and memory access arbitration unit

Country Status (1)

Country Link
JP (1) JP2004185451A (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2008134892A (en) * 2006-11-29 2008-06-12 Yamaha Corp Integrated circuit device
JP2012208790A (en) * 2011-03-30 2012-10-25 Renesas Electronics Corp Data transfer device

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2008134892A (en) * 2006-11-29 2008-06-12 Yamaha Corp Integrated circuit device
JP2012208790A (en) * 2011-03-30 2012-10-25 Renesas Electronics Corp Data transfer device

Similar Documents

Publication Publication Date Title
JP4847036B2 (en) Control device for arbitrating bus access and control method for data processing device
JP3699833B2 (en) Priority encoding and decoding for memory architecture
US6393506B1 (en) Virtual channel bus and system architecture
JP4457168B2 (en) Resource request arbitration device, resource request arbitration method, and computer program
US5903283A (en) Video memory controller with dynamic bus arbitration
JP4408263B2 (en) Data transfer system and data transfer method
US8095744B2 (en) Device for controlling access from a plurality of masters to shared memory composed of a plurality of banks each having a plurality of pages
AU687627B2 (en) Multiprocessor system bus protocol for optimized accessing of interleaved storage modules
JP2002530742A (en) Method and apparatus for prioritizing access to external devices
JP2002530731A (en) Method and apparatus for detecting data collision on a data bus during abnormal memory access or performing memory access at different times
US7617344B2 (en) Methods and apparatus for controlling access to resources in an information processing system
US20200213464A1 (en) Memory Control Method, Memory Control Apparatus, and Image Forming Method That Uses Memory Control Method
CN112559405B (en) Control method and device for multi-channel DMA (direct memory access) with token bucket structure
US20060179172A1 (en) Method and system for reducing power consumption of a direct memory access controller
US20060218313A1 (en) DMA circuit and computer system
JP2004185451A (en) Memory access arbitration method and memory access arbitration unit
JP4151362B2 (en) Bus arbitration method, data transfer device, and bus arbitration method
JP2009043089A (en) Bus control device and bus control method
US6122699A (en) Data processing apparatus with bus intervention means for controlling interconnection of plural busses
JP6036806B2 (en) Bus access arbitration circuit and bus access arbitration method
JP4847614B2 (en) Control device for arbitrating bus access
JP4327081B2 (en) Memory access control circuit
JPH09153009A (en) Arbitration method for hierarchical constitution bus
JP4344163B2 (en) Resource request arbitration device, resource request arbitration method, and computer program
JP2000250853A (en) Bus arbitration controller

Legal Events

Date Code Title Description
A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20051202

A977 Report on retrieval

Effective date: 20080711

Free format text: JAPANESE INTERMEDIATE CODE: A971007

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20080717

A02 Decision of refusal

Free format text: JAPANESE INTERMEDIATE CODE: A02

Effective date: 20081202