[go: up one dir, main page]

JP2004118298A - Data processing control device - Google Patents

Data processing control device Download PDF

Info

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
Application number
JP2002277276A
Other languages
Japanese (ja)
Inventor
Hiroshi Miura
三浦 弘
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.)
Rohm Co Ltd
Original Assignee
Rohm Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Rohm Co Ltd filed Critical Rohm Co Ltd
Priority to JP2002277276A priority Critical patent/JP2004118298A/en
Priority to US10/668,359 priority patent/US20040093439A1/en
Publication of JP2004118298A publication Critical patent/JP2004118298A/en
Pending legal-status Critical Current

Links

Images

Landscapes

  • Bus Control (AREA)

Abstract

<P>PROBLEM TO BE SOLVED: To provide a data processing control device for allowing an optional service executing means to preferentially execute a service by avoiding the problem that a specific service executing means preferentially executes the service. <P>SOLUTION: An arbitration circuit 1 allows a DMA channel required for DMA transfer and having a highest precedence order to execute the DMA transfer among DMA channels 2-1, 2-2, 2-3 and 2-4, and updates the precedence order of the respective DMA channels so that the precedence order of the DMA channel becomes lowest when receiving the notice of the effect of continuously executing the DMA transfer by the permitted cycle number from the DMA channels. The respective DMA channels 2-1, 2-2, 2-3 and 2-4 have registers for writing data for indicating whether or not to permit by which cycle the DMA transfer is continuously executed to these channels, and notify the arbitration circuit 1 of the effect of continuously executing the DMA transfer by the permitted cycle number every time when continuously executing the DMA transfer by the cycle number according to the data written in the register. <P>COPYRIGHT: (C)2004,JPO

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 arbitration circuit 1 includes a DMA start control unit 101, a channel determination sequencer 102, a request register 103, an end register 104, and a start channel register 105.
[0012]
As shown in FIG. 2, each of the DMA channels 2-1, 2-2, 2-3 and 2-4 has a DMA execution sequencer 201, a register controller 202, a CTL register 203, an SRC register 204, and a DST register. 205, CYC register 206, TRN register 207, SET register 208, SRC counter 209, DST counter 210, TMP_CYC register 211, CYC counter 212, TRN counter 213, CUR_SET register 214, RLD_SRC register 215, RLD_DST register 216, RLD_CYC register 217, RLD_TRN register 218, RLD_SET register 219, multiplexers 220, 221, 222, 223, and 224, and ACC counter 225 That.
[0013]
In the arbitration circuit 1, the DMA activation control unit 101 arbitrates the right to use the system bus 300, and alternatively, the DMA channels 2-1, 2-2, 2-3, and 2-4 are selectively DMA-transferred. Is controlled to be performed. The channel determination sequencer 102 determines a DMA channel on which DMA transfer is to be executed based on the values of the request register 103 and the end register 104. The request register 103 is a register for storing which DMA channel is requested for the DMA transfer. The end register 104 is a register in which data indicating the operation status of each DMA channel is written. The activation channel register 105 is a register in which data indicating the DMA channel determined by the channel determination sequencer 102 is written.
[0014]
The operation of the DMA activation control unit 101 will be described in detail with reference to the flowchart shown in FIG. First, it is determined whether or not the value of the DMA_CH bit of the activation channel register 105 is not 0 (# 101). If the value of the DMA_CH bit is not 0 (Y of # 101), the output signal BUS_REQ is asserted (requests the right to use the system bus 300) (# 102). Next, it is determined whether or not the input signal BUS_ACK is asserted (the right to use the system bus 300 is authorized) (# 103).
[0015]
If the input signal BUS_ACK is asserted (Y of # 103), the value of the DMA_CH bit of the start channel register 105 among the start signals to the DMA channels 2-1 2-2, 2-3 and 2-4 Is set to a state in which only the start signal to the DMA channel 2-k (k = 1, 2, 3, or 4) corresponding to is asserted (# 104).
[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 DMA channel 2 If the value of the DMA_CH bit is 3, only the start signal to the DMA channel 2-3 is asserted, and if the value of the DMA_CH bit is 4, If so, only the start signal to the DMA channel 2-4 is asserted.
[0017]
After finishing # 104, it is determined whether or not the input signal BUS_ACK is negated (the right to use the system bus 300 is withdrawn) (# 105). If the input signal BUS_ACK is negated (Y of # 105), the respective start signals to the DMA channels 2-1, 2-2, 2-3, 2-4 are negated (# 106). After the end of # 106, the process proceeds to # 103 described above. On the other hand, if the input signal BUS_ACK is not negated (N of # 105), the process proceeds to # 107.
[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 end register 104 is set to 1 (# 109).
[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 activation channel register 105 is not 0. If the value of the DMA_CH bit is not 0 (Y of # 111), the process proceeds to # 103 described above, while if the value of the DMA_CH bit is 0 (N of # 111), the output signal BUE_REQ is negated (system The request for the right to use the bus 300 is withdrawn (# 112). After finishing # 112, the process moves to # 101 described above.
[0021]
In # 113, the REQk bit of the request register 103 is set to 0. After # 113, if the received notification is a notification that DMA transfer has been performed for the specified number of cycles (Y of # 114), the process proceeds to # 111 described above. On the other hand, when the received notification is not a notification that the DMA transfer has been performed for the specified number of cycles (in other words, when the received notification is a notification that the DMA transfer has been completed) (# 114 N), the process proceeds to step # 112 described above.
[0022]
In addition to the above operations, the DMA activation control unit 101 requests a DMA transfer for the DMA channel 2-x (x = 1, 2, 3, or 4) (as a specific example, When the input signal DMA_REQx changes from a negated state to an asserted state), the REQx bit of the request register 103 is set to 1.
[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 channel determination sequencer 102 will be described in detail with reference to the flowchart shown in FIG. First, it is determined whether or not the REQ1 bit of the request register 103 is 1 (# 201). If the REQ1 bit is 1 (Y in # 201), the value of the DMA_CH bit of the activation channel register 105 is set to 1 (# 202), and the END1, END2, END3, and END4 bits of the end register 104 are set. The bit is set to 0 (# 203), and when the END1 bit becomes 1 (Y of # 204), the process proceeds to # 208 described later.
[0026]
On the other hand, if the REQ1 bit is not 1 (N of # 201), it is determined whether the END1 bit of the end register 104 is 1 (# 205). If the END1 bit is 1 (Y in # 205), the value of the DMA_CH bit of the activation channel register 105 is set to 0 (# 206), and the END1 bit is set to 0 (# 207). Move to. On the other hand, if the END1 bit is not 1 (N in # 205), the process directly proceeds to # 208.
[0027]
In # 208, it is determined whether or not the REQ2 bit of the request register 103 is 1. If the REQ2 bit is 1 (Y in # 208), the value of the DMA_CH bit of the activation channel register 105 is set to 2 (# 209), and the END1, END2, END3 and END4 bits of the end register 104 are set. The bit is set to 0 (# 210), and when the END2 bit becomes 1 (Y of # 211), the process proceeds to # 215 described later.
[0028]
On the other hand, if the REQ2 bit is not 1 (N of # 208), it is determined whether the END2 bit of the end register 104 is 1 (# 212). If the END2 bit is 1 (Y of # 212), the value of the DMA_CH bit of the activation channel register 105 is set to 0 (# 213), and the END2 bit is set to 0 (# 214). Move to. On the other hand, if the END2 bit is not 1 (N in # 212), the process directly proceeds to # 215.
[0029]
In # 215, it is determined whether or not the REQ3 bit of the request register 103 is 1. If the REQ3 bit is 1 (Y of # 215), the value of the DMA_CH bit of the activation channel register 105 is set to 3 (# 216), and the END1, END2, END3 and END4 bits of the end register 104 are set. The bit is set to 0 (# 217), and when the END3 bit becomes 1 (Y of # 218), the process proceeds to # 222 described later.
[0030]
On the other hand, if the REQ3 bit is not 1 (N of # 215), it is determined whether the END3 bit of the end register 104 is 1 (# 219). If the END3 bit is 1 (Y of # 219), the value of the DMA_CH bit of the activation channel register 105 is set to 0 (# 220), and the END3 bit is set to 0 (# 221). Move to. On the other hand, if the END3 bit is not 1 (N of # 219), the process directly proceeds to # 222.
[0031]
In # 222, it is determined whether or not the REQ4 bit of the request register 103 is 1. If the REQ4 bit is 1 (Y of # 222), the value of the DMA_CH bit of the activation channel register 105 is set to 4 (# 223), and the END1, END2, END3 and END4 bits of the end register 104 are set. The bit is set to 0 (# 224), and when the END4 bit becomes 1 (Y of # 225), the process proceeds to # 201 described above.
[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 end register 104 is 1 (# 226). If the END4 bit is 1 (Y of # 226), the value of the DMA_CH bit of the activation channel register 105 is set to 0 (# 227), and the END4 bit is set to 0 (# 228). Shift to # 201. On the other hand, if the END3 bit is not 1 (N of # 219), the process directly proceeds to # 201.
[0033]
When the power is turned on, the registers are initialized, and the REQ1, REQ2, REQ3, and REQ4 bits of the request register 103 are set to 0, and the END1, END2, END3, and END4 bits of the end register 104 are set to 0. The value of the DMA_CH bit of the activation channel register 105 is set to 0.
[0034]
In each of the DMA channels 2-1, 2-2, 2-3, and 2-4, the DMA execution sequencer 201 controls the CTL register 203, the SRC counter 209, the DST counter 210, and the CYC counter 212 under the control of the arbitration circuit 1. , A CUR_SET register 214, an ACC counter 225, and a register (not shown) in the register controller 202 to execute a DMA transfer.
[0035]
The register controller 202, based on the instruction from the DMA execution sequencer 201, and the contents of the CTL register 203, CYC counter 212, TRN counter 213, CUR_SET register 214, ACC counter 225, and its own register, It controls the operations of the DST counter 210, TMP_CYC register 211, CYC counter 212, TRN counter 213, CUR_SET register 214, and ACC counter 225, and rewrites internal registers.
[0036]
Information necessary for executing the DMA transfer is written by the CPU into the CTL register 203, the SRC register 204, the DST register 205, the CYC register 206, the TRN register 207, and the SET register 208. Specifically, information for controlling DMA transfer is written in the CTL register 203. In the SRC register 204, the head address of the data transfer source area (the area from which data is read) is written. In the DST register 205, the head address of the data transfer destination area (data write area) is written.
[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 TRN register 207. In the SET register 208, other information relating to the DMA transfer (such as the size of data to be transferred in one cycle, and whether or not the transfer source address and the transfer destination address are updated every cycle) are written.
[0038]
Note that a CR bit is prepared in the SET register 208, and the CPU uses this CR bit to indicate data indicating how many cycles of continuous DMA transfer to this DMA channel are permitted (specifically, The number of permitted cycles-1) is written. The CUR_SET register 214 and the RLD_SET register 219 also have CR bits.
[0039]
The SRC counter 209 is a counter for storing the address of the transfer source and updating as necessary. The DST counter 210 is a counter for storing the address of the transfer destination and updating it as necessary. The TMP_CYC register 211 is a register for storing the number of cycles to be performed in one DMA transfer. The CYC counter 212 is a counter for measuring the number of cycles performed in one DMA transfer. The TRN counter 213 is a counter for measuring the number of times the DMA transfer has been performed. The CUR_SET register 214 is a register for storing information written in the SET register 208. The ACC counter 225 is a counter for measuring the number of cycles continuously performed by the DMA channel.
[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 RAM 400 to itself. When the CPU executes the DMA transfer using the reload mode, as shown in an example in FIG. 5, for each DMA transfer to be executed, information necessary for the DMA transfer to be executed next to the DMA transfer is provided. The written start address in the RAM 400 and information necessary for the DMA transfer (information indicating the start address of the transfer source, information indicating the start address of the transfer destination, the number of cycles performed in one DMA transfer) , Information indicating the number of times of DMA transfer, other information, and control information) are written in a continuous area of the RAM 400. FIG. 5 shows a case where two DMA transfers are set.
[0041]
The RLD_SRC register 215 is for the CPU to write the first address in the RAM 400 in which information necessary for DMA transfer is written. RLD_DST register 216, RLD_CYC register 217, RLD_TRN register 218, and RLD_SET register 219 store information necessary for DMA transfer from RAM 400 to a group of DMA channel registers (SRC register 204, DST register 205, CYC register 206, TRN register 207). , And information necessary for DMA transfer are written in the SET register 208).
[0042]
The multiplexer 220 selects one of the data held in the SRC register 204 and the data held in the RLD_SRC register 215 in accordance with an instruction from the DMA execution sequencer 201. The data selected by the multiplexer 220 is given to the SRC counter 209.
[0043]
The multiplexer 221 selects one of the data held in the DST register 205 and the data held in the RLD_DST register 216 in accordance with an instruction from the DMA execution sequencer 201. The data selected by the multiplexer 221 is provided to the DST counter 210.
[0044]
The multiplexer 222 selects one of the data held in the CYC register 206 and the data held in the RLD_CYC register 217 in accordance with an instruction from the DMA execution sequencer 201. The data selected by the multiplexer 222 is given to the TMP_CYC register 211 and the CYC counter 212. Incidentally, the data held in the TMP_CYC register 211 is also given to the CYC counter 212.
[0045]
The multiplexer 223 selects one of the data held in the TRN register 207 and the data held in the RLD_TRN register 218 in accordance with an instruction from the DMA execution sequencer 201. The data selected by the multiplexer 223 is given to the TRN counter 213.
[0046]
The multiplexer 224 selects one of the data held in the TRN register 208 and the data held in the RLD_TRN register 219 in accordance with an instruction from the DMA execution sequencer 201. The data selected by the multiplexer 224 is given to the CUR_SET register 214 and the ACC counter 225. The ACC counter 225 receives only the data of the CR bit from the data selected by the multiplexer 224. The ACC counter 225 is also provided with CR bit data of the data held in the CUR_SET register 214.
[0047]
The operation of the DMA execution sequencer 201 of the DMA channel will be described in detail with reference to the flowcharts shown in FIGS. First, it is determined whether or not the ENB bit of the CTL register 203 is 1 (# 301). If the ENB bit is 1 (Y in # 301), the process proceeds to # 302.
[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 CTL register 203, SRC register 204, DST register 205, CYC register 206, TRN register 207, and SET register 208. When information necessary for transfer is written, the ENB bit of the CTL register 203 is set to 1.
[0049]
In # 302, it is determined whether the RESUM bit of the CTL register 203 is 1, the MOD1 bit is 1, the MOD0 bit is 0, and the EOP_O bit of the register in the register controller 202 is 1. If the determination result in # 302 is affirmative (Y in # 302), the process proceeds to # 301 described above, while if negative (N in # 302), the process proceeds to # 303.
[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 CTL register 203. Is set to 1.
[0051]
In # 303, it is determined whether the S / W_START bit of the CTL register 203 is 1 and both the MOD1 bit and the MOD0 bit are 1. If the determination result in # 303 is affirmative (Y in # 303), the reload bit of its own register is set to 1 (# 304), and thereafter, the process proceeds to # 306. On the other hand, if the determination result in # 303 is negative (N in # 303), the reload bit is set to 0 (# 305), and thereafter, the process proceeds to # 306.
[0052]
Note that the selection in the multiplexers 220, 221, 222, 223, and 224 is switched according to the reload bit. Specifically, when the reload bit is 0, the multiplexers 220, 221, 222, 223, and 224 are held in the SRC register 204, the DST register 205, the CYC register 206, the TRN register 207, and the SET register 208, respectively. When the data is selected and the reload bit is 1, the data held in the RLD_SRC register 215, RLD_DST register 216, RLD_CYC register 217, RLD_TRN register 218, and RLD_SET register 219 are selected.
[0053]
In step # 306, the register controller 202 is notified of the transition from the idle state to the load & wait state. After finishing # 306, it is determined whether or not the ENB bit of the CTL register 203 is 1 (# 307). If the ENB bit is 1 (Y in # 307), the process proceeds to # 308, while if the ENB bit is not 1 (N in # 307), the process proceeds to # 301.
[0054]
In # 308, it is determined whether or not the start signal from the arbitration circuit 1 is asserted. If the start signal has been asserted (Y in # 308), the process proceeds to # 310 described later, while if the start signal has not been asserted (N in # 308), the process proceeds to # 309.
[0055]
In # 309, it is determined whether the S / W_START bit of the CTL register 203 is “1”. If the S / W_START bit is 1 (Y in # 309), the process proceeds to # 310 described later, while if the S / W_START bit is not 1 (N in # 309), the process proceeds to # 307 described above.
[0056]
In # 310, data is read from the address corresponding to the value of the SRC counter 209 into its own buffer. After completing # 310, it is determined whether or not the wait signal from the arbitration circuit 1 is asserted (# 311). If the wait signal is not asserted (N of # 311), the process proceeds to # 312.
[0057]
In step # 312, the register controller 202 is notified of the transition from the read state to the write state. After finishing # 312, the data read in # 310 is written to the address corresponding to the value of the DST counter 210 (# 313). Next, it is determined whether or not the wait signal has been asserted (# 314). If the wait signal has not been asserted (N of # 314), the process proceeds to # 315.
[0058]
In # 315, it is determined whether or not the EOP_O bit of the register in the register controller 202 is “1”. If the EOP_O bit is 1 (Y of # 315), it notifies the arbitration circuit 1 that the DMA transfer has been completed (# 316). On the other hand, if the EOP_O bit is not 1 (N in # 315), the process proceeds to # 331 described later.
[0059]
After finishing # 316, it is determined whether or not the CEPE bit of the CTL register 203 is 1 (# 317). If the CEPE bit is 1 (Y in # 317), the CPU is notified of the end of the DMA transfer using an interrupt signal (# 318), and thereafter, the process proceeds to # 319. On the other hand, if the CEPE bit is not 1 (N of # 317), the process proceeds to # 319 without performing # 318.
[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 CTL register 203 is set to 0 (# 320), and the register controller 202 is notified of the transition from the write state to the idle state. (# 321). After the completion of step # 321, the process proceeds to step # 301. On the other hand, if the determination result in # 319 is negative (N in # 319), the process proceeds to # 322.
[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 CTL register 203 is set to 1 (# 325), and thereafter, the process proceeds to # 329 described later. On the other hand, if the reload bit is not 1 (N of # 324), the process proceeds to # 329 described below without performing # 325.
[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 CTL register 203 is 1 and the MOD0 bit is 0 (# 327).
[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 CTL register 203 is updated with the value of the NEPE bit of the CTL register 203. After the end of the step # 329, the register controller 202 is notified of the transition from the write state to the load & wait state (# 330). After the end of # 330, the process proceeds to # 307 described above.
[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 CYC counter 212. If an underflow has occurred in the CYC counter 212 (Y in # 331), the arbitration circuit 1 is notified that DMA transfer has been performed for the specified number of cycles (# 332). After step # 332, the process proceeds to step # 330. On the other hand, if an underflow has not occurred in the CYC counter 212 (N in # 331), the flow shifts to # 333.
[0067]
In # 333, it is determined whether or not an underflow has occurred in the ACC counter 225. If an underflow has occurred in the ACC counter 225 (Y of # 333), the arbitration circuit 1 is notified that DMA transfer has been performed continuously for the permitted number of cycles (# 334). After step # 334, the process proceeds to step # 330. On the other hand, if an underflow has not occurred in the ACC counter 225 (N in # 333), the register controller 202 is notified of the transition from the write state to the read state (# 335). After the end of # 335, the flow shifts to # 307 described above.
[0068]
The operation of the register controller 202 will be described with reference to the flowcharts shown in FIGS. The register controller 202 monitors the notification of the state transition from the DMA execution sequencer 201 (# 401, # 405, # 413, and # 416).
[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 DMA execution sequencer 201. At this time, the determination result in # 401 becomes positive (Y in # 401), and it is determined whether the EOP_O bit of its own register is 1 or the RESUM bit of the CTL register 203 is 0 (# 402). ).
[0070]
If the determination result in # 402 is affirmative (Y in # 402), the data of the SRC counter 209 is the data supplied from the multiplexer 220, and the data of the DST counter 210 is the data supplied from the multiplexer 221 and the TMP_CYC register 211 and The data of the CYC counter 212 is updated with the data supplied from the multiplexer 222, the data of the TRN counter 213 is updated with the data supplied from the multiplexer 223, and the data of the CUR_SET register 214 and the ACC counter 225 are updated with the data supplied from the multiplexer 224 ( Along with # 403), the EOP_O bit of its own register is set to 0 (# 404).
[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 DMA execution sequencer 201. At this time, the determination result in # 405 becomes positive (Y in # 405), and it is determined whether the DSDIR bit of the CUR_SET register 214 is 1 (# 406).
[0072]
If the DSDIR bit is 1 (Y in # 406), the value of the SRC counter 209 is incremented by 1 (# 407), and thereafter, the process proceeds to # 408. On the other hand, if the DSDIR bit is not 1 (N in # 406), the process proceeds to # 408 without performing # 407.
[0073]
In # 408, the values of the CYC counter 212 and the ACC counter 225 are decremented by one. After finishing # 408, it is determined whether or not an underflow has occurred in the CYC counter 212 (# 409). If an underflow has occurred in the CYC counter 212 (Y in # 409), it is determined whether the value of the TRN counter 213 is 0 (# 410).
[0074]
If the value of the TRN counter 213 is not 0 (N in # 410), the value of the TRN counter 213 is decremented by 1 (# 411). On the other hand, if the value of the TRN counter 213 is 0 (Y in # 410), the EOP_O bit of its own register is set to 1 (# 412).
[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 sequencer 201. At this time, the determination result in # 413 becomes affirmative (Y in # 413), and it is determined whether or not the DDDIR bit of the CUR_SET register 214 is 1 (# 414). If the DDDIR bit is 1 (Y in # 414), the value of the DST counter 210 is incremented by 1 (# 415).
[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 DMA execution sequencer 201. At this time, the determination result in # 416 becomes affirmative (Y in # 416), and it is determined whether or not the EOP_O bit of its own register is 1 (# 417).
[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 CYC counter 212 is updated with the value of the TMP_CYC register 211 (# 419), and the value of the ACC counter 225 is read from the CR of the CUR_SET register 214. Update with the value indicated by the bit (# 420). After the completion of step # 420, the process proceeds to step # 414. On the other hand, if an underflow has not occurred in the CYC counter 212 (N in # 418), the process proceeds to # 421.
[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 start control unit 101 and the channel determination sequencer 102 of the arbitration circuit 1 described above, and the DMA execution sequencer 201 and the register controller 202 of each of the DMA channels 2-1, 2-2, 2-3, and 2-4. As a result, among the DMA channels for which DMA transfer is requested, the DMA channel with the highest priority performs DMA transfer, but every time one service execution unit continuously performs DMA transfer for the permitted number of cycles, the The service execution means has the lowest priority.
[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 CUR_SET register 214 becomes +1), so that the CPU determines the number of DMA transfer cycles that one DMA channel can continuously perform in each of the DMA channels 2-1, 2-2, 2-3. , 2-4. By setting the number of cycles in which a certain DMA channel can continuously perform DMA transfer to be larger than that of another DMA channel, the DMA transfer can be preferentially executed by that DMA channel.
[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 CYC counter 212 is 2, the value of the TRN counter 213 is 0, the value of the CR bit of the CUR_SET register 214 is 1, and in the DMA channel 2-2, the value of the CYC counter 212 is Is 4, the value of the TRN counter 213 is 0, the value of the CR bit of the CUR_SET register 214 is 2, and in the DMA channel 2-3, the value of the CYC counter 212 is 0, the value of the TRN counter 213 is 0, and the CUR_SET register 214 Is 0, the value of the CYC counter 212 is 0, the value of the TRN counter 213 is 0, and the value of the CR bit of the CUR_SET register 214 is 0 in the DMA channel 2-4. As shown in the figure, the input signals DMA_REQ1, DMA_REQ2, DMA_REQ 3, when DMA_REQ4 has changed, DMA channels ACT performing DMA transfer. CH changes as shown in FIG.
[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 system bus 300 cannot be withdrawn between t1 and t2 in FIG.
[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 (SRC register 204, DST register 205, CYC register 206, TRN register 207, And the value of the SET register 208 is written into the operation register group (SRC counter 209, DST counter 210, TMP_CYC register 211, CYC counter 212, TRN counter 213, CUR_SET register 214, and ACC counter 225), and DMA transfer is performed based on the value of the register group.
[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 CTL register 203 is set to 1), the S / W_START bit of the CTL register 203 is 1, and the MOD1 and MOD0 bits are both 1. The information necessary for DMA transfer of the DMA transfer from the RAM 400 to the setting register group is stored in a reload register group (RLD_SRC register 215, RLD_DST register 216, RLD_CYC register 217, RLD_TRN register 218, and RLD_SET register). After writing in the operation register group from step 219), DMA transfer is performed based on the value of the operation register group, so that information necessary for DMA transfer is DMA-transferred from the RAM 400 to the setting register group. Thereafter, while both the MOD1 bit and the MOD0 bit are 1, information necessary for DMA transfer is DMA-transferred from the RAM 400 to the setting register group, and an operation is performed based on information DMA-transferred from the RAM 400 to the setting register group. The operation of performing the DMA transfer is performed alternately (hereinafter, referred to as “reload mode”).
[0092]
In this reload mode, in order to execute all desired DMA transfers, information necessary for each DMA transfer is written into the RAM 400 as shown in FIG. The / W_START bit is set to 1, the MOD1 bit and the MOD0 bit are both set to 1, and the first address (20000000H in FIG. 5) of the RAM 400 in which information on the first DMA transfer is stored is set in the RLD_SRC register. After writing to the H.215, the ENB bit of the CTL register 203 may be set to 1, and a plurality of DMA transfers can be set at once.
[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 CTL register 203 is 0 when the DMA transfer ends, the CPU does not perform an interrupt for notifying that the DMA transfer has ended. Therefore, when the CPU sets the CEPE bit to 0 when the next DMA transfer is set, the CPU does not receive an interrupt from the DMA controller even if the immediately preceding DMA transfer is completed. There is no meaningless interrupt from the controller, and more time can be spent on other processing.
[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 CTL register 203. It can easily respond to changes in the situation.
[0096]
In addition, assuming that the value set in the CYC register 206 is p and the value set in the TRN register 207 is q, every time a DMA transfer is requested, (p + 1) cycles of DMA transfer are performed. It is in a standby state until a DMA transfer request is generated. Then, when the DMA transfer is performed in response to the (q + 1) th DMA transfer request, the operation ends. That is, (p + 1) cycles of DMA transfer are performed (q + 1) times.
[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:
JP2002277276A 2002-09-24 2002-09-24 Data processing control device Pending JP2004118298A (en)

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)

* Cited by examiner, † Cited by third party
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

Cited By (3)

* Cited by examiner, † Cited by third party
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