JP2004118298A - Data processing control device - Google Patents
Data processing control device Download PDFInfo
- Publication number
- JP2004118298A JP2004118298A JP2002277276A JP2002277276A JP2004118298A JP 2004118298 A JP2004118298 A JP 2004118298A JP 2002277276 A JP2002277276 A JP 2002277276A JP 2002277276 A JP2002277276 A JP 2002277276A JP 2004118298 A JP2004118298 A JP 2004118298A
- Authority
- JP
- Japan
- Prior art keywords
- register
- dma
- bit
- service
- counter
- 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
Links
- 230000000694 effects Effects 0.000 abstract description 3
- 238000000034 method Methods 0.000 description 49
- 230000004913 activation Effects 0.000 description 17
- 102100032919 Chromobox protein homolog 1 Human genes 0.000 description 15
- 101000797584 Homo sapiens Chromobox protein homolog 1 Proteins 0.000 description 15
- 101150110503 END3 gene Proteins 0.000 description 11
- 230000007704 transition Effects 0.000 description 11
- 101100394003 Butyrivibrio fibrisolvens end1 gene Proteins 0.000 description 10
- 101100174722 Saccharomyces cerevisiae (strain ATCC 204508 / S288c) GAA1 gene Proteins 0.000 description 10
- 101100296979 Saccharomyces cerevisiae (strain ATCC 204508 / S288c) PEP5 gene Proteins 0.000 description 10
- 101100533616 Saccharomyces cerevisiae (strain ATCC 204508 / S288c) SLA2 gene Proteins 0.000 description 9
- 101100533615 Schizosaccharomyces pombe (strain 972 / ATCC 24843) end4 gene Proteins 0.000 description 9
- 238000010586 diagram Methods 0.000 description 6
- 101100524346 Xenopus laevis req-a gene Proteins 0.000 description 4
- 101100524347 Xenopus laevis req-b gene Proteins 0.000 description 4
- 230000003111 delayed effect Effects 0.000 description 2
- 230000002093 peripheral effect Effects 0.000 description 1
- 239000002699 waste material Substances 0.000 description 1
Images
Landscapes
- Bus Control (AREA)
Abstract
Description
【0001】
【発明の属する技術分野】
本発明は、それぞれDMA転送等の所定のサービスを実行する複数のサービス実行手段に択一的にサービスを実行させるデータ処理制御装置に関するものである。
【0002】
【従来の技術】
DMAコントローラを例に挙げて従来のデータ処理制御装置について説明する。DMAコントローラは、周辺装置からデータ転送の要求を受けると、システムバスの使用権を要求し、システムバスの使用権が認可されると、予め設定された転送元から転送先へのデータ転送を開始するようになっている。そして、DMAコントローラの制御によるデータ転送(以下、「DMA転送」と称する)では、CPUの制御によるデータ転送とは違って、命令のリード及び解読が必要ないので、データの転送速度を高速にすることが可能となる。
【0003】
さて、複数のチャンネルを備えたDMAコントローラでは、DMA転送が要求されているチャンネルの中で優先順位が最も高いチャンネルにサービス(DMA転送)を実行させるようになっている。そして、ある特定のチャンネルが独占してサービスを実行するという問題を回避するために、1つのチャンネルが許可された量だけ連続してサービスを実行する毎に、そのチャンネルの優先順位が最も低くなるように各チャンネルの優先順位を更新するものがある。
【0004】
例えば、CH1、CH2、CH3、及び、CH4の4つのチャンネルがあり、チャンネルCH1、CH2、CH3、CH4が許可された量だけ連続してサービスを実行したとすると、それぞれ図11の(a)、(b)、(c)、(d)に示すように、各チャンネルの優先順位が更新される。
【0005】
【特許文献1】
特開平6−83642号公報
【0006】
【発明が解決しようとする課題】
しかしながら、従来は、1つのチャンネルが連続して実行することが許可されているサービス量が各チャンネルに共通な値に固定されていたので、上述したようにして各チャンネルの優先順位を更新すると、サービスの実行が要求されている各チャンネルに常に均等にサービスを実行させることになる。このため、以下に述べるような問題があった。
【0007】
例えば、全てのチャンネルに対してデータ転送が要求されており、そのうちの1つのチャンネルCH1に要求されたデータ転送については遅延が許容されず、他のチャンネルに要求されたデータ転送についてはある程度の遅延が許される場合、チャンネルCH1に優先的にデータ転送を実行させたいが、それを行うことはできないので、チャンネルCH1に要求されたデータ転送を定められた時間内に完了させることができない事態が発生する可能性があった。
【0008】
そこで、本発明は、特定のサービス実行手段が独占してサービスを実行するという問題を回避した上で、任意のサービス実行手段に優先的にサービスを実行させることができるようにしたデータ処理制御装置を提供することを目的とする。
【0009】
【課題を解決するための手段】
上記の目的を達成するため、本発明では、
それぞれ所定のサービスを実行する複数のサービス実行手段に択一的にサービスを実行させるデータ処理制御装置において、
サービスの実行が要求されているサービス実行手段の中で優先順位が最も高いものがサービスを実行するように制御する制御手段と、
1つのサービス実行手段が許可された量だけ連続してサービスを実行する毎に、そのサービス実行手段の優先順位が最も低くなるように各サービス実行手段の優先順位を更新する優先順位更新手段と、
1つのチャンネルにどれだけ連続してサービスを実行することを許可するかを示すデータを各サービス実行手段毎に書き込むための記憶手段と、
を備えている。
【0010】
この構成により、サービスの実行が要求されているサービス実行手段の中で優先順位が最も高いものがサービスの実行を開始することができるが、1つのサービス実行手段が許可された量だけ連続してサービスを実行する毎に、そのサービス実行手段の優先順位が最も低くなるので、特定のサービス実行手段が独占してサービスを実行するという問題は回避される。また、1つのサービス実行手段にどれだけ連続してサービスを実行することを許可するかを各サービス実行手段毎に自由に設定することができるようになるので、任意のサービス実行手段に優先的にサービスを実行させることができるようになる。
【0011】
【発明の実施の形態】
以下に、本発明の実施形態を図面を参照しながら説明する。本発明を適用したDMAコントローラについて説明する。そのブロック図を図1に示す。1は調停回路、2−1、2−2、2−3、2−4はそれぞれDMAチャンネルである。調停回路1は、DMA起動制御部101、チャンネル決定シーケンサ102、リクエストレジスタ103、エンドレジスタ104、起動チャンネルレジスタ105を備えている。
【0012】
各DMAチャンネル2−1、2−2、2−3、2−4は、その回路構成を図2に示すように、DMA実行シーケンサ201、レジスタコントローラ202、CTLレジスタ203、SRCレジスタ204、DSTレジスタ205、CYCレジスタ206、TRNレジスタ207、SETレジスタ208、SRCカウンタ209、DSTカウンタ210、TMP_CYCレジスタ211、CYCカウンタ212、TRNカウンタ213、CUR_SETレジスタ214、RLD_SRCレジスタ215、RLD_DSTレジスタ216、RLD_CYCレジスタ217、RLD_TRNレジスタ218、RLD_SETレジスタ219、マルチプレクサ220、221、222、223、及び、224、並びに、ACCカウンタ225を備えている。
【0013】
調停回路1では、DMA起動制御部101が、システムバス300の使用権の調停を行うとともに、DMAチャンネル2−1、2−2、2−3、及び、2−4が択一的にDMA転送を行うように制御する。チャンネル決定シーケンサ102は、リクエストレジスタ103及びエンドレジスタ104の値に基づいてDMA転送を実行させるべきDMAチャンネルを決定する。リクエストレジスタ103は、どのDMAチャンネルに対してDMA転送が要求されているかを記憶するためのレジスタである。エンドレジスタ104は、各DMAチャンネルの動作状況を示すデータが書き込まれるレジスタである。起動チャンネルレジスタ105はチャンネル決定シーケンサ102で決定されたDMAチャンネルを示すデータが書き込まれるレジスタである。
【0014】
DMA起動制御部101の動作を図3に示すフローチャートを用いて詳細に説明する。まず、起動チャンネルレジスタ105のDMA_CHビットの値が0でないか否かを判定する(#101)。DMA_CHビットの値が0でなければ(#101のY)、出力信号BUS_REQをアサートする(システムバス300の使用権を要求する)(#102)。次に、入力信号BUS_ACKがアサートされている(システムバス300の使用権が認可されている)か否かを判定する(#103)。
【0015】
入力信号BUS_ACKがアサートされていれば(#103のY)、DMAチャンネル2−1、2−2、2−3、2−4への各スタート信号のうち、起動チャンネルレジスタ105のDMA_CHビットの値に対応するDMAチャンネル2−k(k=1、2、3、または、4)へのスタート信号のみがアサートした状態にする(#104)。
【0016】
#104では、具体的には、DMA_CHビットの値が1であれば、DMAチャンネル2−1へのスタート信号のみがアサートした状態にし、また、DMA_CHビットの値が2であれば、DMAチャンネル2−2へのスタート信号のみをアサートした状態にし、また、DMA_CHビットの値が3であれば、DMAチャンネル2−3へのスタート信号のみをアサートした状態にし、また、DMA_CHビットの値が4であれば、DMAチャンネル2−4へのスタート信号のみをアサートした状態にする。
【0017】
#104を終えると、入力信号BUS_ACKがネゲートされている(システムバス300の使用権が取り下げられている)か否かを判定する(#105)。入力信号BUS_ACKがネゲートされていれば(#105のY)、DMAチャンネル2−1、2−2、2−3、2−4への各スタート信号がネゲートした状態にする(#106)。#106を終えると、前述した#103へ移行する。一方、入力信号BUS_ACKがネゲートされていなければ(#105のN)、#107へ移行する。
【0018】
#107では、許可されたサイクル数だけ連続してDMA転送を行った旨の通知、指定されたサイクル数だけDMA転送を行った旨の通知、または、DMA転送が終了した旨の通知をDMAチャンネル2−kから受けたか否かを判定する。#107での判定結果が肯定であれば(#107のY)、DMAチャンネル2−1、2−2、2−3、2−4への各スタート信号がネゲートした状態にする(#108)とともに、エンドレジスタ104のENDkビットを1にセットする(#109)。
【0019】
#109の後は、受けた通知が許可されたサイクル数だけ連続してDMA転送を行った旨の通知であったときには(#110のY)、後述する#111へ移行し、一方、受けた通知が許可されたサイクル数だけ連続してDMA転送を行った旨の通知でなかったときには(#110のN)、後述する#113へ移行する。
【0020】
#111では、起動チャンネルレジスタ105のDMA_CHビットの値が0でないか否かを判定する。DMA_CHビットの値が0でなければ(#111のY)、前述した#103へ移行し、一方、DMA_CHビットの値が0であれば(#111のN)、出力信号BUE_REQをネゲートする(システムバス300の使用権の要求を取り下げる)(#112)。#112を終えると、前述した#101へ移行する。
【0021】
#113では、リクエストレジスタ103のREQkビットを0にセットする。#113の後は、受けた通知が指定されたサイクル数だけDMA転送を行った旨の通知であったときには(#114のY)、前述した#111へ移行する。一方、受けた通知が指定されたサイクル数だけDMA転送を行った旨の通知でなかったとき(言い換えれば、受けた通知がDMA転送が終了した旨の通知であったとき)には(#114のN)、前述した#112へ移行する。
【0022】
以上の動作に加えて、DMA起動制御部101は、DMAチャンネル2−x(x=1、2、3、または、4)に対してDMA転送が要求されると(具体的な例としては、入力信号DMA_REQxがネゲートされた状態からアサートされた状態に変化すると)、リクエストレジスタ103のREQxビットを1にセットする。
【0023】
また、バスコントローラ(不図示)からDMA待機命令が発行されると(具体的には、入力信号DMA_WAITがアサートされると)、各DMAチャンネル2−1、2−2、2−3、2−4へのウエイト信号をアサートする。また、DMA待機命令が解除されると(具体的には、入力信号DMA_WAITがネゲートされると)、上記ウエイト信号をネゲートする。
【0024】
尚、バスコントローラは、DMAコントローラがアクセスしたアドレスに対するデータの読み出しあるいは書き込みが完了する前に次の動作に移行しないように、DMAコントローラがアクセスしたアドレスに応じて信号DMA_WAITを制御するようになっている。
【0025】
チャンネル決定シーケンサ102の動作を図4に示すフローチャートを用いて詳細に説明する。まず、リクエストレジスタ103のREQ1ビットが1であるか否かを判定する(#201)。REQ1ビットが1であれば(#201のY)、起動チャンネルレジスタ105のDMA_CHビットの値を1にセットするとともに(#202)、エンドレジスタ104のEND1ビット、END2ビット、END3ビット、及び、END4ビットを0にセットし(#203)、その後、END1ビットが1になると(#204のY)、後述する#208へ移行する。
【0026】
一方、REQ1ビットが1でなければ(#201のN)、エンドレジスタ104のEND1ビットが1であるか否かを判定する(#205)。END1ビットが1であれば(#205のY)、起動チャンネルレジスタ105のDMA_CHビットの値を0にセットする(#206)とともに、END1ビットを0にセットし(#207)、その後、#208へ移行する。一方、END1ビットが1でなければ(#205のN)、#208へそのまま移行する。
【0027】
#208では、リクエストレジスタ103のREQ2ビットが1であるか否かを判定する。REQ2ビットが1であれば(#208のY)、起動チャンネルレジスタ105のDMA_CHビットの値を2にセットする(#209)とともに、エンドレジスタ104のEND1ビット、END2ビット、END3ビット、及び、END4ビットを0にセットし(#210)、その後、END2ビットが1になると(#211のY)、後述する#215へ移行する。
【0028】
一方、REQ2ビットが1でなければ(#208のN)、エンドレジスタ104のEND2ビットが1であるか否かを判定する(#212)。END2ビットが1であれば(#212のY)、起動チャンネルレジスタ105のDMA_CHビットの値を0にセットする(#213)とともに、END2ビットを0にセットし(#214)、その後、#215へ移行する。一方、END2ビットが1でなければ(#212のN)、#215へそのまま移行する。
【0029】
#215では、リクエストレジスタ103のREQ3ビットが1であるか否かを判定する。REQ3ビットが1であれば(#215のY)、起動チャンネルレジスタ105のDMA_CHビットの値を3にセットする(#216)とともに、エンドレジスタ104のEND1ビット、END2ビット、END3ビット、及び、END4ビットを0にセットし(#217)、その後、END3ビットが1になると(#218のY)、後述する#222へ移行する。
【0030】
一方、REQ3ビットが1でなければ(#215のN)、エンドレジスタ104のEND3ビットが1であるか否かを判定する(#219)。END3ビットが1であれば(#219のY)、起動チャンネルレジスタ105のDMA_CHビットの値を0にセットする(#220)とともに、END3ビットを0にセットし(#221)、その後、#222へ移行する。一方、END3ビットが1でなければ(#219のN)、#222へそのまま移行する。
【0031】
#222では、リクエストレジスタ103のREQ4ビットが1であるか否かを判定する。REQ4ビットが1であれば(#222のY)、起動チャンネルレジスタ105のDMA_CHビットの値を4にセットする(#223)とともに、エンドレジスタ104のEND1ビット、END2ビット、END3ビット、及び、END4ビットを0にセットし(#224)、その後、END4ビットが1になると(#225のY)、前述した#201へ移行する。
【0032】
一方、REQ4ビットが1でなければ(#222のN)、エンドレジスタ104のEND4ビットが1であるか否かを判定する(#226)。END4ビットが1であれば(#226のY)、起動チャンネルレジスタ105のDMA_CHビットの値を0にセットする(#227)とともに、END4ビットを0にセットし(#228)、その後、前述した#201へ移行する。一方、END3ビットが1でなければ(#219のN)、前述した#201へそのまま移行する。
【0033】
尚、電源投入時には、レジスタの初期化が行われ、リクエストレジスタ103のREQ1、REQ2、REQ3、REQ4の各ビットが0に、エンドレジスタ104のEND1、END2、END3、END4の各ビットが0に、起動チャンネルレジスタ105のDMA_CHビットの値が0に、それぞれセットされるようになっている。
【0034】
各DMAチャンネル2−1、2−2、2−3、2−4では、DMA実行シーケンサ201が、調停回路1による制御の下で、CTLレジスタ203、SRCカウンタ209、DSTカウンタ210、CYCカウンタ212、CUR_SETレジスタ214、ACCカウンタ225、及び、レジスタコントローラ202内のレジスタ(不図示)の内容に基づいてDMA転送を実行する。
【0035】
レジスタコントローラ202は、DMA実行シーケンサ201からの指示、並びに、CTLレジスタ203、CYCカウンタ212、TRNカウンタ213、CUR_SETレジスタ214、ACCカウンタ225、及び、自身のレジスタの内容に基づいて、SRCカウンタ209、DSTカウンタ210、TMP_CYCレジスタ211、CYCカウンタ212、TRNカウンタ213、CUR_SETレジスタ214、及び、ACCカウンタ225の動作の制御、並びに、内部のレジスタの書き換えを行う。
【0036】
CTLレジスタ203、SRCレジスタ204、DSTレジスタ205、CYCレジスタ206、TRNレジスタ207、及び、SETレジスタ208には、DMA転送を実行するために必要な情報がCPUによって書き込まれる。具体的には、CTLレジスタ203には、DMA転送を制御するための情報が書き込まれる。SRCレジスタ204には、データの転送元の領域(データを読み出す領域)の先頭のアドレスが書き込まれる。DSTレジスタ205には、データの転送先の領域(データを書き込む領域)の先頭のアドレスが書き込まれる。
【0037】
CYCレジスタ206には、1回のDMA転送におけるサイクル数に応じた値が書き込まれる。TRNレジスタ207には、DMA転送を行う回数に応じた値が書き込まれる。SETレジスタ208には、DMA転送に関するその他の情報(1サイクルで転送するデータのサイズ、転送元アドレス及び転送先アドレスを1サイクル毎に更新する/しないなど)が書き込まれる。
【0038】
尚、SETレジスタ208にはCRビットが用意されており、CPUは、このCRビットに、当DMAチャンネルに何サイクル連続してDMA転送を行うことを許可するかを示すデータ(具体的には、許可するサイクル数−1)を書き込むようになっている。また、CUR_SETレジスタ214及びRLD_SETレジスタ219にもCRビットが用意されている。
【0039】
SRCカウンタ209は、転送元のアドレスを記憶するとともに、必要に応じて更新するためのカウンタである。DSTカウンタ210は、転送先のアドレスを記憶するとともに、必要に応じて更新するためのカウンタである。TMP_CYCレジスタ211は、1回のDMA転送で行うべきサイクル数を記憶しておくためのレジスタである。CYCカウンタ212は、1回のDMA転送で行ったサイクル数を計測するためのカウンタである。TRNカウンタ213は、DMA転送を行った回数を計測するためのカウンタである。CUR_SETレジスタ214は、SETレジスタ208に書き込まれた情報を記憶しておくためのレジスタである。ACCカウンタ225は、当DMAチャンネルが連続して行ったサイクル数を計測するためのカウンタである。
【0040】
ここで、本実施形態のDMAコントローラでは、後述するように、DMA転送を実行するにあたって、それに必要な情報をRAM400から自身にDMA転送するモード(リロードモード)が存在する。CPUは、このリロードモードを用いてDMA転送を実行させるときには、図5に一例を示すように、実行させたい各DMA転送毎に、当該DMA転送の次に実行させたいDMA転送に必要な情報が書き込まれているRAM400内の先頭のアドレス、並びに、当該DMA転送に必要な情報(転送元の先頭のアドレスを示す情報、転送先の先頭のアドレスを示す情報、1回のDMA転送で行うサイクル数を示す情報、DMA転送を行う回数を示す情報、その他の情報、及び、制御情報)を、RAM400の連続した領域に書き込むようになっている。尚、図5は2つのDMA転送を設定した場合のものである。
【0041】
RLD_SRCレジスタ215は、DMA転送に必要な情報が書き込まれているRAM400内の先頭のアドレスをCPUが書き込むためのものである。RLD_DSTレジスタ216、RLD_CYCレジスタ217、RLD_TRNレジスタ218、及び、RLD_SETレジスタ219には、DMA転送に必要な情報をRAM400からDMAチャンネルのレジスタ群(SRCレジスタ204、DSTレジスタ205、CYCレジスタ206、TRNレジスタ207、及び、SETレジスタ208)にDMA転送するために必要な情報が書き込まれている。
【0042】
マルチプレクサ220は、SRCレジスタ204に保持されているデータとRLD_SRCレジスタ215に保持されているデータとのどちらか一方をDMA実行シーケンサ201からの指示に応じて選択する。マルチプレクサ220で選択されたデータはSRCカウンタ209に与えられている。
【0043】
マルチプレクサ221は、DSTレジスタ205に保持されているデータとRLD_DSTレジスタ216に保持されているデータとのどちらか一方をDMA実行シーケンサ201からの指示に応じて選択する。マルチプレクサ221で選択されたデータはDSTカウンタ210に与えられている。
【0044】
マルチプレクサ222は、CYCレジスタ206に保持されているデータとRLD_CYCレジスタ217に保持されているデータとのどちらか一方をDMA実行シーケンサ201からの指示に応じて選択する。マルチプレクサ222で選択されたデータはTMP_CYCレジスタ211及びCYCカウンタ212に与えられている。尚、CYCカウンタ212には、TMP_CYCレジスタ211に保持されているデータも与えられている。
【0045】
マルチプレクサ223は、TRNレジスタ207に保持されているデータとRLD_TRNレジスタ218に保持されているデータとのどちらか一方をDMA実行シーケンサ201からの指示に応じて選択する。マルチプレクサ223で選択されたデータはTRNカウンタ213に与えられている。
【0046】
マルチプレクサ224は、TRNレジスタ208に保持されているデータとRLD_TRNレジスタ219に保持されているデータとのどちらか一方をDMA実行シーケンサ201からの指示に応じて選択する。マルチプレクサ224で選択されたデータはCUR_SETレジスタ214及びACCカウンタ225に与えられている。尚、ACCカウンタ225には、マルチプレクサ224で選択されたデータのうちのCRビットのデータのみが与えられている。また、ACCカウンタ225には、CUR_SETレジスタ214に保持されているデータのうちのCRビットのデータも与えられている。
【0047】
DMAチャンネルのDMA実行シーケンサ201の動作を図6及び図7に示すフローチャートを用いて詳細に説明する。まず、CTLレジスタ203のENBビットが1であるか否かを判定する(#301)。ENBビットが1であれば(#301のY)、#302へ移行する。
【0048】
尚、CPUは、使用中でないチャンネルに対して、DMA転送の設定を終えると、すなわち、CTLレジスタ203、SRCレジスタ204、DSTレジスタ205、CYCレジスタ206、TRNレジスタ207、及び、SETレジスタ208にDMA転送に必要な情報を書き込むと、CTLレジスタ203のENBビットを1にセットするようになっている。
【0049】
#302では、CTLレジスタ203のRESUMビットが1、MOD1ビットが1、MOD0ビットが0、かつ、レジスタコントローラ202内のレジスタのEOP_Oビットが1であるか否かを判定する。#302での判定結果が肯定であれば(#302のY)、前述した#301へ移行し、一方、否定であれば(#302のN)、#303へ移行する。
【0050】
尚、CPUは、CTLレジスタ203のENBビットを0にセットすることによりDMA転送を中断させ、その後、ENBビットを1にセットすることによりDMA転送を再開させるに先立って、CTLレジスタ203のRESUMビットを1にセットするようになっている。
【0051】
#303では、CTLレジスタ203のS/W_STARTビットが1、かつ、MOD1ビット、MOD0ビットが共に1であるか否かを判定する。#303での判定結果が肯定であれば(#303のY)、自身のレジスタのreloadビットを1にセットし(#304)、その後、#306へ移行する。一方、#303での判定結果が否定であれば(#303のN)、reloadビットを0にセットし(#305)、その後、#306へ移行する。
【0052】
尚、reloadビットに応じてマルチプレクサ220、221、222、223、224での選択が切り換わるようになっている。具体的には、マルチプレクサ220、221、222、223、224は、reloadビットが0であるときには、それぞれSRCレジスタ204、DSTレジスタ205、CYCレジスタ206、TRNレジスタ207、SETレジスタ208に保持されているデータを選択し、一方、reloadビットが1であるときには、それぞれRLD_SRCレジスタ215、RLD_DSTレジスタ216、RLD_CYCレジスタ217、RLD_TRNレジスタ218、RLD_SETレジスタ219に保持されているデータを選択するようになっている。
【0053】
#306では、アイドル状態からロード&ウエイト状態に遷移する旨をレジスタコントローラ202に通知する。#306を終えると、CTLレジスタ203のENBビットが1であるか否かを判定する(#307)。ENBビットが1であれば(#307のY)、#308へ移行し、一方、ENBビットが1でなければ(#307のN)、前述した#301へ移行する。
【0054】
#308では、調停回路1からのスタート信号がアサートされているか否かを判定する。スタート信号がアサートされていれば(#308のY)、後述する#310へ移行し、一方、スタート信号がアサートされていなければ(#308のN)、#309へ移行する。
【0055】
#309では、CTLレジスタ203のS/W_STARTビットが1であるか否かを判定する。S/W_STARTビットが1であれば(#309のY)、後述する#310へ移行し、一方、S/W_STARTビットが1でなければ(#309のN)、前述した#307へ移行する。
【0056】
#310では、SRCカウンタ209の値に対応するアドレスから自身のバッファにデータを読み込む。#310を終えると、調停回路1からのウエイト信号がアサートされているか否かを判定し(#311)、ウエイト信号がアサートされていなければ(#311のN)、#312へ移行する。
【0057】
#312では、リード状態からライト状態に遷移する旨をレジスタコントローラ202に通知する。#312を終えると、#310で読み込んだデータをDSTカウンタ210の値に対応するアドレスに書き込む(#313)。次に、ウエイト信号がアサートされているか否かを判定し(#314)、ウエイト信号がアサートされていなければ(#314のN)、#315へ移行する。
【0058】
#315では、レジスタコントローラ202内のレジスタのEOP_Oビットが1であるか否かを判定する。EOP_Oビットが1であれば(#315のY)、DMA転送が終了した旨を調停回路1に通知する(#316)。一方、EOP_Oビットが1でなければ(#315のN)、後述する#331へ移行する。
【0059】
#316を終えると、CTLレジスタ203のCEPEビットが1であるか否かを判定する(#317)。CEPEビットが1であれば(#317のY)、割り込み信号を用いてDMA転送が終了した旨をCPUに通知し(#318)、その後、#319へ移行する。一方、CEPEビットが1でなければ(#317のN)、#318を行うことなく、#319へ移行する。
【0060】
#319では、CTLレジスタ203のMOD1ビット、MOD0ビットが共に0であるか否かを判定する。#319での判定結果が肯定であれば(#319のY)、CTLレジスタ203のENBビットに0をセットする(#320)とともに、ライト状態からアイドル状態に遷移する旨をレジスタコントローラ202に通知する(#321)。#321を終えると、前述した#301へ移行する。一方、#319での判定結果が否定であれば(#319のN)、#322へ移行する。
【0061】
#322では、CTLレジスタ203のMOD1ビット、MOD0ビットが共に1であるか否かを判定する。#322での判定結果が肯定であれば(#322のY)、#323へ移行し、一方、#322での判定結果が否定であれば(#322のN)、後述する#326へ移行する。
【0062】
#323では、自身のレジスタのreloadビットを反転させる。#323を終えると、reloadビットが1であるか否かを判定する(#324)。reloadビットが1であれば(#324のY)、CTLレジスタ203のS/W_STARTビットを1にセットし(#325)、その後、後述する#329へ移行する。一方、reloadビットが1でなければ(#324のN)、#325を行うことなく、後述する#329へ移行する。
【0063】
#322での判定結果が否定であるとき(#322のN)に移行する#326では、自身のレジスタのreloadビットを0にセットする。#326を終えると、CTLレジスタ203のMOD1ビットが1、MOD0ビットが0であるか否かを判定する(#327)。
【0064】
#327での判定結果が肯定であれば(#327のY)、MOD1ビット、MOD0ビットを共に0にセットし(#328)、その後、#329へ移行する。一方、#327での判定結果が否定であれば(#327のN)、#328を行うことなく、#329へ移行する。
【0065】
#329では、CTLレジスタ203のCEPEビットの値をCTLレジスタ203のNEPEビットの値で更新する。#329を終えると、ライト状態からロード&ウエイト状態に遷移する旨をレジスタコントローラ202に通知する(#330)。#330を終えると、前述した#307へ移行する。
【0066】
#315での判定結果が否定であるとき(#315のN)に移行する#331では、CYCカウンタ212にアンダーフローが発生しているか否かを判定する。CYCカウンタ212にアンダーフローが発生していれば(#331のY)、指定されたサイクル数だけDMA転送を行った旨を調停回路1に通知する(#332)。#332の後は、前述した#330へ移行する。一方、CYCカウンタ212にアンダーフローが発生していなければ(#331のN)、#333へ移行する。
【0067】
#333では、ACCカウンタ225にアンダーフローが発生しているか否かを判定する。ACCカウンタ225にアンダーフローが発生していれば(#333のY)、許可されたサイクル数だけ連続してDMA転送を行った旨を調停回路1に通知する(#334)。#334の後は、前述した#330へ移行する。一方、ACCカウンタ225にアンダーフローが発生していなければ(#333のN)、ライト状態からリード状態に遷移する旨をレジスタコントローラ202に通知する(#335)。#335を終えると、前述した#307へ移行する。
【0068】
レジスタコントローラ202の動作を図8及び図9に示すフローチャートを用いて説明する。レジスタコントローラ202は、DMA実行シーケンサ201からの状態遷移の通知を監視している(#401、#405、#413、及び、#416)。
【0069】
まず、アイドル状態からロード&ウエイト状態に遷移する旨の通知をDMA実行シーケンサ201から受けた場合について説明する。このときには、#401での判定結果が肯定になり(#401のY)、自身のレジスタのEOP_Oビットが1、または、CTLレジスタ203のRESUMビットが0であるか否かを判定する(#402)。
【0070】
#402での判定結果が肯定であれば(#402のY)、SRCカウンタ209のデータをマルチプレクサ220から与えられるデータで、DSTカウンタ210のデータをマルチプレクサ221から与えられるデータで、TMP_CYCレジスタ211及びCYCカウンタ212のデータをマルチプレクサ222から与えられるデータで、TRNカウンタ213のデータをマルチプレクサ223から与えられるデータで、CUR_SETレジスタ214及びACCカウンタ225のデータをマルチプレクサ224から与えられるデータで、それぞれ更新する(#403)とともに、自身のレジスタのEOP_Oビットを0にセットする(#404)。
【0071】
次に、リード状態からライト状態に遷移する旨の通知をDMA実行シーケンサ201から受けた場合について説明する。このときには、#405での判定結果が肯定になり(#405のY)、CUR_SETレジスタ214のDSDIRビットが1であるか否かを判定する(#406)。
【0072】
DSDIRビットが1であれば(#406のY)、SRCカウンタ209の値を1だけインクリメントさせ(#407)、その後、#408へ移行する。一方、DSDIRビットが1でなければ(#406のN)、#407を行うことなく、#408へ移行する。
【0073】
#408では、CYCカウンタ212及びACCカウンタ225の値を1だけデクリメントさせる。#408を終えると、CYCカウンタ212にアンダーフローが発生しているか否かを判定する(#409)。CYCカウンタ212にアンダーフローが発生していれば(#409のY)、TRNカウンタ213の値が0であるか否かを判定する(#410)。
【0074】
TRNカウンタ213の値が0でなければ(#410のN)、TRNカウンタ213の値を1だけデクリメントさせる(#411)。一方、TRNカウンタ213の値が0であれば(#410のY)、自身のレジスタのEOP_Oビットを1にセットする(#412)。
【0075】
次に、ライト状態からアイドル状態に遷移する旨の通知、または、ライト状態からリード状態に遷移する旨の通知をシーケンサ201から受けた場合について説明する。このときには、#413での判定結果が肯定になり(#413のY)、CUR_SETレジスタ214のDDDIRビットが1であるか否かを判定する(#414)。DDDIRビットが1であれば(#414のY)、DSTカウンタ210の値を1だけインクリメントさせる(#415)。
【0076】
次に、ライト状態からロード&ウエイト状態に遷移する旨の通知をDMA実行シーケンサ201から受けた場合について説明する。このときには、#416での判定結果が肯定になり(#416のY)、自身のレジスタのEOP_Oビットが1であるか否かを判定する(#417)。
【0077】
EOP_Oビットが1であれば(#417のY)、前述した#403及び#404を行う。一方、EOP_Oビットが1でなければ(#417のN)、CYCカウンタ212にアンダーフローが発生しているか否かを判定する(#418)。
【0078】
CYCカウンタ212にアンダーフローが発生していれば(#418のY)、CYCカウンタ212の値をTMP_CYCレジスタ211の値で更新する(#419)とともに、ACCカウンタ225の値をCUR_SETレジスタ214のCRビットが示す値で更新する(#420)。#420を終えると、前述した#414へ移行する。一方、CYCカウンタ212にアンダーフローが発生していなければ(#418のN)、#421へ移行する。
【0079】
#421では、ACCカウンタ225にアンダーフローが発生しているか否かを判定する(#421)。ACCカウンタ225にアンダーフローが発生していれば(#421のY)、前述した#420へ移行する。一方、ACCカウンタ225にアンダーフローが発生していなければ(#421のN)、前述した#414へ移行する。
【0080】
以上に述べた調停回路1のDMA起動制御部101及びチャンネル決定シーケンサ102、並びに、各DMAチャンネル2−1、2−2、2−3、2−4のDMA実行シーケンサ201及びレジスタコントローラ202の動作により、DMA転送が要求されているDMAチャンネルの中で優先順位が最も高いものがDMA転送を行うが、1つのサービス実行手段が許可されたサイクル数だけ連続してDMA転送を行う毎に、そのサービス実行手段の優先順位が最も低くなる。
【0081】
そして、各DMAチャンネル2−1、2−2、2−3、2−4では、連続して行うことができるDMA転送のサイクル数がCUR_SETレジスタ214のCRビットの値によって決まる(具体的には、CUR_SETレジスタ214のCRビットの値+1になる)ので、CPUは、1つのDMAチャンネルが連続して行うことができるDMA転送のサイクル数を各DMAチャンネル2−1、2−2、2−3、2−4毎に自由に設定することができる。尚、あるDMAチャンネルが連続してDMA転送を行うことができるサイクル数を他のDMAチャンネルのそれよりも大きく設定することにより、そのDMAチャンネルに優先的にDMA転送を実行させることができる。
【0082】
したがって、特定のDMAチャンネルが独占してDMA転送を実行するという問題を回避した上で、任意のDMAチャンネルに優先的にDMA転送を実行させることができるようになる。
【0083】
例えば、DMAチャンネル2−1では、CYCカウンタ212の値が2、TRNカウンタ213の値が0、CUR_SETレジスタ214のCRビットの値が1であり、DMAチャンネル2−2では、CYCカウンタ212の値が4、TRNカウンタ213の値が0、CUR_SETレジスタ214のCRビットの値が2であり、DMAチャンネル2−3では、CYCカウンタ212の値が0、TRNカウンタ213の値が0、CUR_SETレジスタ214のCRビットの値が0であり、DMAチャンネル2−4では、CYCカウンタ212の値が0、TRNカウンタ213の値が0、CUR_SETレジスタ214のCRビットの値が0であるときに、図10に示すように、入力信号DMA_REQ1、DMA_REQ2、DMA_REQ3、DMA_REQ4が変化したとすると、DMA転送を行うDMAチャンネルACT.CHは同図に示すように変化する。
【0084】
尚、図10において、Tは1サイクルの期間を示しており、また、CH1、CH2、CH3、CH4はそれぞれDMAチャンネル2−1、2−2、2−3、2−4を示しており、また、NONはDMAチャンネル2−1、2−2、2−3、2−4のいずれもDMA転送を行っていないことを示している。また、図10は同図のt1〜t2の間でシステムバス300の使用権が取り下げられないものと仮定した場合のものである。
【0085】
また、各DMAチャンネル2−1、2−2、2−3、2−4では、DMA転送を開始するにあたって、設定用レジスタ群(SRCレジスタ204、DSTレジスタ205、CYCレジスタ206、TRNレジスタ207、及び、SETレジスタ208)の値を動作用レジスタ群(SRCカウンタ209、DSTカウンタ210、TMP_CYCレジスタ211、CYCカウンタ212、TRNカウンタ213、CUR_SETレジスタ214、及び、ACCカウンタ225)に書き込むとともに、動作用レジスタ群の値に基づいてDMA転送を実行する。
【0086】
したがって、DMA転送に必要な情報を設定用レジスタ群に書き込むことによって、使用中のDMAチャンネルに対してもDMA転送の設定を行うことができるようになる。これにより、あるタスクでDMA転送を行おうとしたときに、全てのDMAチャンネルが使用中であっても、DMA転送の終了を待つことなくDMA転送の設定を行うことができる可能性が生まれ、タスクスイッチング等によるCPUの処理時間の浪費を低減させることができる。
【0087】
また、CTLレジスタ203のMOD1ビット及びMOD0ビットに応じて動作が以下のように異なる。DMA転送が終了したときに、MOD1ビット、MOD0ビットが共に0にセットされていれば、アイドル状態(DMA転送が禁止された状態)になる(以下、「ノーマルモード」と称する)。
【0088】
DMA転送が終了したときに、MOD1ビットが0、MOD0ビットが1にそれぞれセットされていれば、ロード&ウエイト状態(動作用レジスタ群の値を設定用レジスタ群の値で更新してDMA転送が要求されるのを待っている状態)になるので、CPUの介在なしで次のDMA転送が開始される(以下、「オートリピートモード」と称する)。
【0089】
DMA転送が終了したときに、MOD1ビットが1、MOD0ビットが0にそれぞれセットされていれば、MOD1ビット、MOD0ビットを共に0にセットしてからロード&ウエイト状態になるので、CPUの介在なしで次のDMA転送が開始されるが、そのDMA転送が終了すると、アイドル状態になる(以下、「オートスタートモード」と称する)。
【0090】
したがって、CPUは、使用中でないDMAチャンネルに対してDMA転送を設定した場合にはノーマルモードに、設定したDMA転送が繰り返し行われるようにしたい場合にはオートリピートモードに、使用中のDMAチャンネルに対してDMA転送を設定した場合にはオートスタートモードに、それぞれDMAチャンネルの動作モードが切り換わるように、CTLレジスタ203のMOD1ビット及びMOD0ビットを書き換えればよい。
【0091】
また、DMA転送が実行可能になったとき(CTLレジスタ203のENBビットが1にセットされたとき)に、CTLレジスタ203のS/W_STARTビットが1、MOD1ビット、MOD0ビットが共に1である場合には、DMA転送に必要な情報をRAM400から設定用レジスタ群にDMA転送するために必要な情報をリロードレジスタ群(RLD_SRCレジスタ215、RLD_DSTレジスタ216、RLD_CYCレジスタ217、RLD_TRNレジスタ218、及び、RLD_SETレジスタ219)から動作用レジスタ群に書き込んだ後に、動作用レジスタ群の値に基づいてDMA転送を実行するので、DMA転送に必要な情報がRAM400から設定用レジスタ群にDMA転送される。その後、MOD1ビット、MOD0ビットが共に1である間は、DMA転送に必要な情報をRAM400から設定用レジスタ群にDMA転送するという動作と、RAM400から設定用レジスタ群にDMA転送された情報に基づいてDMA転送を行うという動作とが交互に行われる(以下、「リロードモード」と称する)。
【0092】
このリロードモードにおいては、希望する全てのDMA転送を実行させるためには、それらの各DMA転送に必要な情報を、一例として図5に示すように、RAM400に書き込んだ後に、CTLレジスタ203のS/W_STARTビットを1に、MOD1ビット、MOD0ビットを共に1にそれぞれセットするとともに、最初のDMA転送に関する情報が記憶されているRAM400の先頭のアドレス(図5の場合には、20000000H)をRLD_SRCレジスタ215に書き込んだ上で、CTLレジスタ203のENBビットを1にセットすればよく、複数のDMA転送を1度に設定することができるようになる。
【0093】
したがって、CPUは、DMAチャンネルに対して複数のDMA転送を設定したいときにはリロードモードを使用することによって、DMA転送の設定に割かれる処理時間を低減させることができるようになる。
【0094】
また、DMA転送が終了したときに、CTLレジスタ203のCEPEビットが0であれば、DMA転送が終了した旨を通知する割り込みをCPUに対して行わない。したがって、CPUは、次のDMA転送の設定を行ったときには、CEPEビットを0にセットしておけば、1つ前に設定したDMA転送が終了してもDMAコントローラから割り込みを受けないので、DMAコントローラからの無意味な割り込みがなくなり、その分だけ多くの時間を他の処理に費やすことができる。
【0095】
尚、CPUは、システムバスの使用権を持っているときには、CTLレジスタ203の値を書き換えることによって、DMAチャンネルの動作モード、及び、DMA転送終了時の割り込みの有無をいつでも切り換えることができるので、状況の変化に容易に対応することができる。
【0096】
その他には、CYCレジスタ206に設定された値をp、TRNレジスタ207に設定された値をqとすると、DMA転送が要求される毎に(p+1)サイクルのDMA転送を行い、その後、新たなDMA転送要求が発生するまで待機状態になる。そして、(q+1)回目のDMA転送の要求に対してDMA転送を行った時点で動作を終了する。すなわち、(p+1)サイクルのDMA転送を(q+1)回行うことになる。
【0097】
したがって、CPUは、AサイクルのDMA転送をB回だけ繰り返し行いたい場合、CYCレジスタ206の値をA−1に、TRNレジスタの値をB−1にそれぞれ設定するという作業を一度だけ行えばよく、これにより、CPUの負担が軽減するので、その分、システムの性能低下を抑制することができる。
【0098】
【発明の効果】
以上説明したように、本発明のデータ処理制御装置によれば、サービスの実行が要求されているサービス実行手段の中で優先順位が最も高いものがサービスの実行を開始することができるが、1つのサービス実行手段が許可された量だけ連続してサービスを実行する毎に、そのサービス実行手段の優先順位が最も低くなり、また、1つのサービス実行手段が連続して実行することができるサービス量を各サービス実行手段毎に自由に設定することができるので、特定のサービス実行手段が独占してサービスを実行するという問題を回避した上で、任意のサービス実行手段に優先的にサービスを実行させることができるようになる。
【図面の簡単な説明】
【図1】本発明の一実施形態であるDMAコントローラのブロック図である。
【図2】図1における各DMAチャンネルの回路構成を示す図である。
【図3】図1におけるDMA起動制御部の動作を説明するためのフローチャートである。
【図4】図1におけるチャンネル決定シーケンサの動作を説明するためのフローチャートである。
【図5】リロードモードを用いてDMA転送を行う場合に、CPUによってRAMに書き込まれる内容を説明するための図である。
【図6】図2におけるDMA実行シーケンサの動作を説明するためのフローチャートである。
【図7】図2におけるDMA実行シーケンサの動作を説明するためのフローチャートである。
【図8】図2におけるレジスタコントローラの動作を説明するためのフローチャートである。
【図9】図2におけるレジスタコントローラの動作を説明するためのフローチャートである。
【図10】本実施形態のDMAコントローラにおいて、DMA転送を行うDMAチャンネルが推移する様子の一例を示す図である。
【図11】1つのチャンネルが許可された量だけ連続してサービスを実行したときに、各チャンネルの優勢順位がどのように更新されるかを示す図である。
【符号の説明】
1 調停回路
2−1、2−2、2−3、2−4 DMAチャンネル
101 DMA起動制御部
102 チャンネル決定シーケンサ
103 リクエストレジスタ
104 エンドレジスタ
105 起動チャンネルレジスタ
201 シーケンサ
202 レジスタコントローラ
203 CTLレジスタ
204 SRCレジスタ
205 DSTレジスタ
206 CYCレジスタ
207 TRNレジスタ
208 SETレジスタ
209 SRCカウンタ
210 DSRカウンタ
211 TMP_CYCレジスタ
212 CYCカウンタ
213 TRNカウンタ
214 CUR_SETレジスタ
215 RLD_SRCレジスタ
216 RLD_DSTレジスタ
217 RLD_CYCレジスタ
218 RLD_TRNレジスタ
219 RLD_SETレジスタ
220、221、222、223、224 マルチプレクサ
225 ACCカウンタ
300 システムバス
400 RAM[0001]
TECHNICAL FIELD OF THE INVENTION
The present invention relates to a data processing control device that causes a plurality of service execution units, each of which executes a predetermined service such as a DMA transfer, to execute a service alternatively.
[0002]
[Prior art]
A conventional data processing control device will be described using a DMA controller as an example. Upon receiving a data transfer request from a peripheral device, the DMA controller requests the right to use the system bus. When the right to use the system bus is granted, the DMA controller starts data transfer from a preset transfer source to a transfer destination. It is supposed to. In data transfer under the control of the DMA controller (hereinafter, referred to as "DMA transfer"), unlike data transfer under the control of the CPU, reading and decoding of instructions are not required, so that the data transfer speed is increased. It becomes possible.
[0003]
By the way, in a DMA controller having a plurality of channels, a service (DMA transfer) is executed on a channel having the highest priority among the channels for which DMA transfer is requested. Then, in order to avoid the problem that a certain channel monopolizes and executes the service, each time one channel continuously performs the service by the permitted amount, the priority of the channel becomes lowest. Some of them update the priority of each channel.
[0004]
For example, if there are four channels, CH1, CH2, CH3, and CH4, and if the channels CH1, CH2, CH3, and CH4 continuously perform the service by the permitted amount, respectively, (a) in FIG. As shown in (b), (c), and (d), the priority of each channel is updated.
[0005]
[Patent Document 1]
JP-A-6-83642
[0006]
[Problems to be solved by the invention]
However, conventionally, the amount of service that one channel is permitted to execute continuously is fixed to a value common to each channel. Therefore, when the priority of each channel is updated as described above, Each channel for which the execution of the service is requested always performs the service equally. Therefore, there is a problem as described below.
[0007]
For example, data transfer is requested for all channels, of which data transfer requested for one channel CH1 is not allowed to be delayed, and data transfer requested for another channel is somewhat delayed. Is allowed, the data transfer is preferentially performed by the channel CH1. However, since the data transfer cannot be performed, the data transfer requested by the channel CH1 cannot be completed within a predetermined time. Could be.
[0008]
Therefore, the present invention avoids the problem that a specific service execution unit exclusively executes a service, and further allows a service execution unit to preferentially execute a service. The purpose is to provide.
[0009]
[Means for Solving the Problems]
In order to achieve the above object, in the present invention,
In a data processing control device that causes a plurality of service execution units that each execute a predetermined service to execute a service alternatively,
Control means for controlling a service execution means having the highest priority among the service execution means requested to execute the service to execute the service;
Priority update means for updating the priority of each service execution means so that each service execution means continuously executes the service by the permitted amount, so that the priority of the service execution means becomes lowest;
Storage means for writing, for each service execution means, data indicating how much continuous service execution is permitted on one channel;
It has.
[0010]
According to this configuration, the service execution unit having the highest priority among the service execution units requested to execute the service can start the execution of the service. However, one service execution unit continuously performs the permitted amount. Each time a service is executed, the priority of the service execution unit is the lowest, so that the problem that a specific service execution unit exclusively executes a service is avoided. In addition, since it is possible to freely set, for each service execution unit, how many consecutive service execution units are permitted to execute a service, so that any service execution unit can be given priority. Service can be executed.
[0011]
BEST MODE FOR CARRYING OUT THE INVENTION
Hereinafter, embodiments of the present invention will be described with reference to the drawings. A DMA controller to which the present invention is applied will be described. The block diagram is shown in FIG. 1 is an arbitration circuit, 2-1, 2-2, 2-3 and 2-4 are DMA channels, respectively. The
[0012]
As shown in FIG. 2, each of the DMA channels 2-1, 2-2, 2-3 and 2-4 has a
[0013]
In the
[0014]
The operation of the DMA
[0015]
If the input signal BUS_ACK is asserted (Y of # 103), the value of the DMA_CH bit of the
[0016]
In # 104, specifically, if the value of the DMA_CH bit is 1, only the start signal to the DMA channel 2-1 is asserted, and if the value of the DMA_CH bit is 2, the
[0017]
After finishing # 104, it is determined whether or not the input signal BUS_ACK is negated (the right to use the
[0018]
In # 107, a notification that the DMA transfer has been performed continuously for the permitted number of cycles, a notification that the DMA transfer has been performed for the specified number of cycles, or a notification that the DMA transfer has been completed are sent to the DMA channel. It is determined whether or not it has been received from 2-k. If the determination result in # 107 is affirmative (Y in # 107), the respective start signals to the DMA channels 2-1, 2-2, 2-3 and 2-4 are negated (# 108). At the same time, the ENDk bit of the
[0019]
After # 109, if the received notification is a notification indicating that DMA transfer has been performed continuously for the permitted number of cycles (Y in # 110), the process proceeds to # 111 described later, while the received notification is received. If the notification is not a notification that the DMA transfer has been performed continuously for the permitted number of cycles (N in # 110), the process proceeds to # 113 described later.
[0020]
In # 111, it is determined whether or not the value of the DMA_CH bit of the
[0021]
In # 113, the REQk bit of the
[0022]
In addition to the above operations, the DMA
[0023]
When a DMA standby command is issued from a bus controller (not shown) (specifically, when the input signal DMA_WAIT is asserted), each of the DMA channels 2-1, 2-2, 2-3, 2- Assert the wait signal to # 4. When the DMA standby command is released (specifically, when the input signal DMA_WAIT is negated), the wait signal is negated.
[0024]
Note that the bus controller controls the signal DMA_WAIT according to the address accessed by the DMA controller so that the operation does not shift to the next operation before data reading or writing to the address accessed by the DMA controller is completed. I have.
[0025]
The operation of the
[0026]
On the other hand, if the REQ1 bit is not 1 (N of # 201), it is determined whether the END1 bit of the
[0027]
In # 208, it is determined whether or not the REQ2 bit of the
[0028]
On the other hand, if the REQ2 bit is not 1 (N of # 208), it is determined whether the END2 bit of the
[0029]
In # 215, it is determined whether or not the REQ3 bit of the
[0030]
On the other hand, if the REQ3 bit is not 1 (N of # 215), it is determined whether the END3 bit of the
[0031]
In # 222, it is determined whether or not the REQ4 bit of the
[0032]
On the other hand, if the REQ4 bit is not 1 (N of # 222), it is determined whether or not the END4 bit of the
[0033]
When the power is turned on, the registers are initialized, and the REQ1, REQ2, REQ3, and REQ4 bits of the
[0034]
In each of the DMA channels 2-1, 2-2, 2-3, and 2-4, the
[0035]
The
[0036]
Information necessary for executing the DMA transfer is written by the CPU into the
[0037]
The CYC register 206 is written with a value corresponding to the number of cycles in one DMA transfer. A value corresponding to the number of times of performing the DMA transfer is written in the
[0038]
Note that a CR bit is prepared in the
[0039]
The
[0040]
Here, in the DMA controller of the present embodiment, as described later, there is a mode (reload mode) in which information necessary for executing the DMA transfer is DMA-transferred from the
[0041]
The
[0042]
The
[0043]
The
[0044]
The
[0045]
The
[0046]
The
[0047]
The operation of the
[0048]
When the CPU finishes the setting of the DMA transfer for the channel that is not being used, that is, the CPU stores the DMA transfer in the
[0049]
In # 302, it is determined whether the RESUM bit of the
[0050]
Note that the CPU suspends the DMA transfer by setting the ENB bit of the CTL register 203 to 0, and then resumes the DMA transfer by setting the ENB bit to 1 before resetting the RESUM bit of the
[0051]
In # 303, it is determined whether the S / W_START bit of the
[0052]
Note that the selection in the
[0053]
In
[0054]
In # 308, it is determined whether or not the start signal from the
[0055]
In # 309, it is determined whether the S / W_START bit of the
[0056]
In # 310, data is read from the address corresponding to the value of the
[0057]
In step # 312, the
[0058]
In # 315, it is determined whether or not the EOP_O bit of the register in the
[0059]
After finishing # 316, it is determined whether or not the CEPE bit of the
[0060]
In # 319, it is determined whether both the MOD1 bit and the MOD0 bit of the CTL register 203 are 0. If the determination result in # 319 is affirmative (Y in # 319), the ENB bit of the
[0061]
In # 322, it is determined whether both the MOD1 bit and the MOD0 bit of the CTL register 203 are “1”. If the determination result in # 322 is affirmative (Y in # 322), the process proceeds to # 323, while if the determination result in # 322 is negative (N in # 322), the process proceeds to # 326 described later. I do.
[0062]
In # 323, the reload bit of its own register is inverted. After finishing # 323, it is determined whether or not the reload bit is 1 (# 324). If the reload bit is 1 (Y in # 324), the S / W_START bit of the
[0063]
When the determination result in # 322 is negative (N in # 322), in # 326, the reload bit of its own register is set to 0. After finishing # 326, it is determined whether the MOD1 bit of the
[0064]
If the determination result in # 327 is affirmative (Y in # 327), both the MOD1 bit and the MOD0 bit are set to 0 (# 328), and thereafter, the process proceeds to # 329. On the other hand, if the determination result in # 327 is negative (N in # 327), the process proceeds to # 329 without performing # 328.
[0065]
In # 329, the value of the CEPE bit of the
[0066]
When the result of the determination in # 315 is negative (N in # 315), in # 331, it is determined whether or not an underflow has occurred in the
[0067]
In # 333, it is determined whether or not an underflow has occurred in the
[0068]
The operation of the
[0069]
First, a case will be described in which a notification that a transition from the idle state to the load & wait state is received from the
[0070]
If the determination result in # 402 is affirmative (Y in # 402), the data of the
[0071]
Next, a case will be described in which a notification of transition from the read state to the write state is received from the
[0072]
If the DSDIR bit is 1 (Y in # 406), the value of the
[0073]
In # 408, the values of the
[0074]
If the value of the
[0075]
Next, a case will be described in which a notification that transition from the write state to the idle state or a notification that transition from the write state to the read state is received from the
[0076]
Next, a case will be described in which a notification of transition from the write state to the load & wait state is received from the
[0077]
If the EOP_O bit is 1 (Y in # 417), the above-described steps # 403 and # 404 are performed. On the other hand, if the EOP_O bit is not 1 (N in # 417), it is determined whether an underflow has occurred in the CYC counter 212 (# 418).
[0078]
If an underflow has occurred in the CYC counter 212 (Y in # 418), the value of the
[0079]
In # 421, it is determined whether an underflow has occurred in the ACC counter 225 (# 421). If an underflow has occurred in the ACC counter 225 (Y in # 421), the process proceeds to # 420 described above. On the other hand, if the underflow has not occurred in the ACC counter 225 (N in # 421), the process proceeds to # 414 described above.
[0080]
Operations of the DMA
[0081]
In each of the DMA channels 2-1, 2-2, 2-3, and 2-4, the number of DMA transfer cycles that can be continuously performed is determined by the value of the CR bit of the CUR_SET register 214 (specifically, the number of cycles). , The value of the CR bit of the
[0082]
Therefore, it is possible to preferentially perform the DMA transfer on an arbitrary DMA channel while avoiding the problem that the DMA transfer is exclusively performed by the specific DMA channel.
[0083]
For example, in the DMA channel 2-1, the value of the
[0084]
In FIG. 10, T indicates a period of one cycle, and CH1, CH2, CH3, and CH4 indicate DMA channels 2-1, 2-2, 2-3, and 2-4, respectively. NON indicates that none of the DMA channels 2-1, 2-2, 2-3, and 2-4 are performing DMA transfer. FIG. 10 shows a case where it is assumed that the right to use the
[0085]
In each of the DMA channels 2-1, 2-2, 2-3, and 2-4, when starting the DMA transfer, a group of setting registers (
[0086]
Therefore, by writing the information necessary for the DMA transfer to the setting register group, the setting of the DMA transfer can be performed even for the DMA channel in use. As a result, when a certain task attempts to perform a DMA transfer, even if all DMA channels are in use, there is a possibility that the DMA transfer can be set without waiting for the end of the DMA transfer. Waste of processing time of the CPU due to switching or the like can be reduced.
[0087]
The operation differs according to the MOD1 bit and the MOD0 bit of the CTL register 203 as follows. At the end of the DMA transfer, if both the MOD1 bit and the MOD0 bit are set to 0, an idle state (a state in which DMA transfer is prohibited) is set (hereinafter, referred to as "normal mode").
[0088]
If the MOD1 bit is set to 0 and the MOD0 bit is set to 1 at the end of the DMA transfer, the load and wait state (the value of the operation register group is updated with the value of the setting register group and the DMA transfer is performed) (Waiting for a request), so that the next DMA transfer is started without the intervention of the CPU (hereinafter, referred to as “auto-repeat mode”).
[0089]
If the MOD1 bit is set to 1 and the MOD0 bit is set to 0 at the end of the DMA transfer, both the MOD1 bit and the MOD0 bit are set to 0 and then the load and wait state is entered. , The next DMA transfer is started. When the DMA transfer is completed, the system enters an idle state (hereinafter referred to as “auto-start mode”).
[0090]
Therefore, the CPU sets the DMA transfer to the normal mode when the DMA transfer is set to the DMA channel not being used, the auto repeat mode when the set DMA transfer is to be repeatedly performed, and the CPU to the used DMA channel. On the other hand, when the DMA transfer is set, the MOD1 bit and the MOD0 bit of the CTL register 203 may be rewritten so that the operation mode of the DMA channel is switched to the auto start mode.
[0091]
When the DMA transfer becomes executable (when the ENB bit of the
[0092]
In this reload mode, in order to execute all desired DMA transfers, information necessary for each DMA transfer is written into the
[0093]
Therefore, when the CPU wants to set a plurality of DMA transfers for the DMA channel, the CPU can use the reload mode to reduce the processing time for setting the DMA transfer.
[0094]
If the CEPE bit of the
[0095]
When the CPU has the right to use the system bus, the CPU can switch the operation mode of the DMA channel and the presence or absence of an interrupt at the end of the DMA transfer at any time by rewriting the value of the
[0096]
In addition, assuming that the value set in the
[0097]
Therefore, when the CPU wants to repeat the A-cycle DMA transfer only B times, the CPU only has to perform the operation of setting the value of the CYC register 206 to A-1 and the value of the TRN register to B-1 only once. As a result, the load on the CPU is reduced, and accordingly, a decrease in system performance can be suppressed.
[0098]
【The invention's effect】
As described above, according to the data processing control device of the present invention, the service execution unit having the highest priority among the service execution units requested to execute the service can start the execution of the service. Each time one service execution unit executes the service continuously by the permitted amount, the service execution unit has the lowest priority and the service amount that one service execution unit can execute continuously Can be set arbitrarily for each service execution means, so that the problem that a specific service execution means exclusively executes a service is avoided, and any service execution means is preferentially executed by a service. Will be able to do it.
[Brief description of the drawings]
FIG. 1 is a block diagram of a DMA controller according to an embodiment of the present invention.
FIG. 2 is a diagram showing a circuit configuration of each DMA channel in FIG.
FIG. 3 is a flowchart for explaining an operation of a DMA activation control unit in FIG. 1;
FIG. 4 is a flowchart for explaining the operation of the channel determination sequencer in FIG. 1;
FIG. 5 is a diagram for describing contents written to a RAM by a CPU when a DMA transfer is performed using a reload mode.
FIG. 6 is a flowchart for explaining the operation of the DMA execution sequencer in FIG. 2;
FIG. 7 is a flowchart for explaining the operation of the DMA execution sequencer in FIG. 2;
FIG. 8 is a flowchart for explaining the operation of the register controller in FIG. 2;
FIG. 9 is a flowchart for explaining the operation of the register controller in FIG. 2;
FIG. 10 is a diagram showing an example of a state in which a DMA channel performing a DMA transfer changes in the DMA controller of the embodiment.
FIG. 11 is a diagram showing how the dominance order of each channel is updated when one channel continuously performs a service by an allowed amount.
[Explanation of symbols]
1 Arbitration circuit
2-1, 2-2, 2-3, 2-4 DMA channels
101 DMA activation control unit
102 Channel decision sequencer
103 Request register
104 End register
105 Start channel register
201 PLC
202 Register controller
203 CTL register
204 SRC register
205 DST register
206 CYC register
207 TRN register
208 SET Register
209 SRC counter
210 DSR counter
211 TMP_CYC register
212 CYC counter
213 TRN counter
214 CUR_SET register
215 RLD_SRC register
216 RLD_DST register
217 RLD_CYC register
218 RLD_TRN register
219 RLD_SET register
220, 221, 222, 223, 224 multiplexer
225 ACC counter
300 system bus
400 RAM
Claims (1)
サービスの実行が要求されているサービス実行手段の中で優先順位が最も高いものがサービスを実行するように制御する制御手段と、
1つのサービス実行手段が許可された量だけ連続してサービスを実行する毎に、そのサービス実行手段の優先順位が最も低くなるように各サービス実行手段の優先順位を更新する優先順位更新手段と、
1つのチャンネルにどれだけ連続してサービスを実行することを許可するかを示すデータを各サービス実行手段毎に書き込むための記憶手段と、
を備えたことを特徴とするデータ処理制御装置。A data processing control device that causes a plurality of service execution units that each execute a predetermined service to execute a service alternatively,
Control means for controlling a service execution means having the highest priority among the service execution means requested to execute the service to execute the service;
Priority update means for updating the priority of each service execution means so that each service execution means continuously executes the service by the permitted amount, so that the priority of the service execution means becomes lowest;
Storage means for writing, for each service execution means, data indicating how much continuous service execution is permitted on one channel;
A data processing control device comprising:
Priority Applications (2)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| JP2002277276A JP2004118298A (en) | 2002-09-24 | 2002-09-24 | Data processing control device |
| US10/668,359 US20040093439A1 (en) | 2002-09-24 | 2003-09-24 | Data processing control apparatus and DMA controller |
Applications Claiming Priority (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| JP2002277276A JP2004118298A (en) | 2002-09-24 | 2002-09-24 | Data processing control device |
Publications (1)
| Publication Number | Publication Date |
|---|---|
| JP2004118298A true JP2004118298A (en) | 2004-04-15 |
Family
ID=32272920
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| JP2002277276A Pending JP2004118298A (en) | 2002-09-24 | 2002-09-24 | Data processing control device |
Country Status (1)
| Country | Link |
|---|---|
| JP (1) | JP2004118298A (en) |
Cited By (3)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| JP2005321842A (en) * | 2004-05-06 | 2005-11-17 | Nec Engineering Ltd | Dma transfer system and method |
| JP2011175621A (en) * | 2010-01-27 | 2011-09-08 | Fujitsu Semiconductor Ltd | Data transfer control device and data transfer control method |
| JP2012194693A (en) * | 2011-03-15 | 2012-10-11 | Ricoh Co Ltd | Interface circuit and image forming device |
-
2002
- 2002-09-24 JP JP2002277276A patent/JP2004118298A/en active Pending
Cited By (3)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| JP2005321842A (en) * | 2004-05-06 | 2005-11-17 | Nec Engineering Ltd | Dma transfer system and method |
| JP2011175621A (en) * | 2010-01-27 | 2011-09-08 | Fujitsu Semiconductor Ltd | Data transfer control device and data transfer control method |
| JP2012194693A (en) * | 2011-03-15 | 2012-10-11 | Ricoh Co Ltd | Interface circuit and image forming device |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| JP4480427B2 (en) | Resource management device | |
| KR100766732B1 (en) | Device and method for performing high-speed low overhead context switch | |
| US20060259662A1 (en) | Data trnasfer apparatus, data transfer method, and program | |
| JPWO2008087779A1 (en) | Array type processor and data processing system | |
| JP4715801B2 (en) | Memory access control device | |
| JP4996519B2 (en) | Virtual multiprocessor, system LSI, mobile phone device, and virtual multiprocessor control method | |
| JP6146128B2 (en) | Data processing device | |
| JP2006195823A (en) | DMA device | |
| JP5040050B2 (en) | Multi-channel DMA controller and processor system | |
| JP2004199698A (en) | Interruption controller and interruption control method for determining priority of interruption request generated from multiple interruption generation sources | |
| US7724984B2 (en) | Image processing apparatus | |
| JP2005057374A (en) | Analog/digital converter and micro controller | |
| JP2004118300A (en) | Dma controller | |
| JP2004118298A (en) | Data processing control device | |
| JP2005092780A (en) | Real-time processor system and control method | |
| JP4388005B2 (en) | Context switching device | |
| JP2005293427A (en) | Data transfer processing apparatus and data transfer processing method | |
| JP2004227501A (en) | Data transfer controller and method | |
| JP2004118299A (en) | Dma controller | |
| JP2010113414A (en) | Multicore system, thread scheduling method, program, and storage medium | |
| JP2005063358A (en) | Command supply control device and semiconductor device | |
| JPH08249269A (en) | Method and device for controlling dma transfer | |
| JP2012168725A (en) | Multi-thread processor | |
| JP3205992B2 (en) | Direct memory access transfer controller | |
| JP5087884B2 (en) | Data processing unit and data processing apparatus using the same |
Legal Events
| Date | Code | Title | Description |
|---|---|---|---|
| A977 | Report on retrieval |
Effective date: 20051212 Free format text: JAPANESE INTERMEDIATE CODE: A971007 |
|
| A131 | Notification of reasons for refusal |
Effective date: 20060117 Free format text: JAPANESE INTERMEDIATE CODE: A131 |
|
| A521 | Written amendment |
Effective date: 20060315 Free format text: JAPANESE INTERMEDIATE CODE: A523 |
|
| A02 | Decision of refusal |
Free format text: JAPANESE INTERMEDIATE CODE: A02 Effective date: 20061107 |