JP5328833B2 - Direct memory access system and control method thereof - Google Patents

Direct memory access system and control method thereof Download PDF

Info

Publication number
JP5328833B2
JP5328833B2 JP2011084071A JP2011084071A JP5328833B2 JP 5328833 B2 JP5328833 B2 JP 5328833B2 JP 2011084071 A JP2011084071 A JP 2011084071A JP 2011084071 A JP2011084071 A JP 2011084071A JP 5328833 B2 JP5328833 B2 JP 5328833B2
Authority
JP
Japan
Prior art keywords
instruction
memory access
direct memory
program counter
output
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.)
Expired - Fee Related
Application number
JP2011084071A
Other languages
Japanese (ja)
Other versions
JP2011170873A (en
Inventor
愼二 白神
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.)
Canon Inc
Original Assignee
Canon Inc
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Canon Inc filed Critical Canon Inc
Priority to JP2011084071A priority Critical patent/JP5328833B2/en
Publication of JP2011170873A publication Critical patent/JP2011170873A/en
Application granted granted Critical
Publication of JP5328833B2 publication Critical patent/JP5328833B2/en
Expired - Fee Related legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Landscapes

  • Bus Control (AREA)

Abstract

<P>PROBLEM TO BE SOLVED: To attain high-function and high-performance direct memory access transfer without increasing load on a CPU or circuit scale. <P>SOLUTION: The system includes a direct memory access unit and a processor unit. The processor unit includes a memory and a processor which writes an instruction to be executed by the direct memory access unit to the direct memory access unit by reading the instruction from the memory and executing it. The direct memory access unit includes: a plurality of program counters, a selection means which successively selects the plurality of program counters, an instruction holding means which holds the instruction written by the processor, an output means which outputs an instruction stored at an address of the instruction holding means indicated by the program counter selected by the selection means; and an execution means which executes data transfer by direct memory access in response to the instruction output by the output means. <P>COPYRIGHT: (C)2011,JPO&amp;INPIT

Description

本発明はダイレクトメモリアクセスシステム及びその制御方法に関するものである。   The present invention relates to a direct memory access system and a control method thereof.

従来より、データを生成しメモリに書き込むデバイス、または、メモリからデータを読み出しデータ処理を行うデバイスと、メモリ間のデータ転送を、CPUに負荷をかけることなく実現するために、様々なダイレクトメモリアクセス装置が提案されている。代表的なダイレクトメモリアクセス装置においては、転送先または転送元のメモリアドレス、転送方向(デバイスからメモリ、メモリからデバイス)、転送するデータのサイズ等を予めCPUにより設定し起動をかけると、設定されたメモリアドレスを順次更新しながら設定されたサイズのデータを転送し終わるまでCPUの介在なしにデバイスとメモリ間のデータ転送を行う。データ転送が完了すると、ダイレクトメモリアクセス装置はCPUに割り込みを通知し、CPUはデータ転送完了を知り、転送されたデータの処理を行う。さらに、引き続き別のデータ転送を設定し起動するなどする(特許文献1参照)。   Various direct memory accesses have been used to realize data transfer between a device that generates data and writes it to memory, or a device that reads data from the memory and processes data without placing a load on the CPU. A device has been proposed. In a typical direct memory access device, the memory address of the transfer destination or transfer source, the transfer direction (device to memory, memory to device), the size of data to be transferred, etc. are set by the CPU in advance and set. The data transfer between the device and the memory is performed without intervention of the CPU until the data of the set size is transferred while sequentially updating the memory addresses. When the data transfer is completed, the direct memory access device notifies the CPU of an interrupt, and the CPU knows the completion of the data transfer and processes the transferred data. Furthermore, another data transfer is continuously set and activated (see Patent Document 1).

このようなダイレクトメモリアクセス装置を用いてデバイスからメモリにデータ転送を行いつつ、転送されたメモリ上のデータをさらに別のデバイスに転送してデータ処理を行うことも多い。つまり、メモリを、2つのデバイスの処理速度緩衝バッファとして用いたり、2つのデバイスのデータアクセス順が異なる場合の一時バッファとして用いたりする。例えば、撮像素子により取り込まれた画像を圧縮符号化する処理において、撮像素子により取り込まれた画像データをダイレクトメモリアクセス装置によりラスタ順にメモリに転送しつつ、転送された矩形領域データを異なるダイレクトメモリアクセス装置により読み出して圧縮符号化する。この場合、撮像素子のデータ取り込み速度と圧縮符号化装置の処理速度が異なり、かつラスタ・ブロック変換が必要であるため、画像データは一時的にメモリに格納される。   In many cases, data is transferred from the device to the memory using such a direct memory access device, and the transferred data on the memory is further transferred to another device for data processing. That is, the memory is used as a processing speed buffer buffer for two devices, or as a temporary buffer when the data access order of the two devices is different. For example, in the process of compressing and encoding the image captured by the image sensor, the image data captured by the image sensor is transferred to the memory in raster order by the direct memory access device, and the transferred rectangular area data is accessed by a different direct memory access. The data is read out by the apparatus and compressed and encoded. In this case, the image data is temporarily stored in the memory because the data capturing speed of the image sensor is different from the processing speed of the compression encoding apparatus and raster block conversion is necessary.

本データ転送例において、ダイレクトメモリアクセス装置の設定手順は以下のようになる。撮像素子のデータ取り込み用のダイレクトメモリアクセス装置をDMA1、圧縮符号化データ転送用のダイレクトメモリアクセス装置をDMA2とする。全画面分の画像データを格納するためのメモリサイズは巨大であり価格も高いため、通常、画像の一部分のみが格納可能なサイズのメモリを用い、ダブルバッファ動作させることによって間断ないデータ転送を実現する。   In this data transfer example, the setting procedure of the direct memory access device is as follows. The direct memory access device for capturing data in the image sensor is designated as DMA1, and the direct memory access device for transferring compression-coded data is designated as DMA2. Since the memory size for storing image data for all screens is huge and expensive, it is usually possible to transfer data continuously by using a double-buffered memory with a size that can store only a part of the image. To do.

CPUはまず、数ラスタ分の画像データを撮像素子からメモリ(バッファ1)に転送するための設定を、DMA1に対して行い、起動をかける。DMA1はデータ転送を完了すると、割り込みによりCPUに通知する。CPUはバッファ1に格納された数ラスタ分のデータを圧縮符号化処理部に転送するための設定を、DMA2に対して行い、起動をかけるとともに、次の数ラスタ分の画像データを撮像素子からメモリ(バッファ2)に転送するための設定を、DMA1に対して行い、起動をかける。この例では、圧縮符号処理の方が撮像素子からのデータ転送よりも常に早いものとする。そうすると、DMA2の完了割り込みは無視することができて、CPUはDMA1の完了割り込みを受信するたびに、DMA1,DMA2に対してバッファ1、バッファ2が交互に使用されるように設定を行い、起動をかければよい。   First, the CPU makes a setting for DMA1 to transfer image data for several rasters from the image sensor to the memory (buffer 1), and starts up. When DMA1 completes the data transfer, it notifies the CPU by an interrupt. The CPU makes a setting for transferring the data for several rasters stored in the buffer 1 to the compression encoding processing unit for the DMA 2, starts up, and sends image data for the next several rasters from the image sensor. A setting for transferring to the memory (buffer 2) is made to DMA1 to start up. In this example, the compression code processing is always faster than the data transfer from the image sensor. As a result, the completion interrupt of DMA2 can be ignored, and every time the completion interrupt of DMA1 is received, the CPU sets DMA1 and DMA2 so that buffers 1 and 2 are used alternately, and starts up. You can take it.

特開平5−73477号公報JP-A-5-73477

しかしながら、従来のダイレクトメモリアクセス装置によるダブルバッファ操作は、DMA完了毎にCPUによる2つのダイレクトメモリアクセス装置の設定、起動が必要となるためCPUの負荷が増大するという問題点があった。また、CPUの割り込みレイテンシによるオーバーヘッドのために、データ転送レートが低下するという問題もあった。さらに、ダブルバッファ動作の例においては、圧縮符号処理の方が撮像素子からのデータ転送よりも常に早いものと仮定したが、どちらの転送が早いのかが不確定である場合、CPUはDMA2の完了割り込みも処理する必要があり、どちらが早く終わったかによって処理を切り替える必要がある。この場合には、CPUの負荷はますます増大する。   However, the double buffer operation by the conventional direct memory access device has a problem that the load on the CPU increases because it is necessary to set and activate the two direct memory access devices by the CPU every time DMA is completed. There is also a problem that the data transfer rate is lowered due to the overhead due to the interrupt latency of the CPU. Further, in the example of the double buffer operation, it is assumed that the compression code processing is always faster than the data transfer from the image sensor. However, if it is uncertain which transfer is faster, the CPU completes the DMA2. Interrupts also need to be processed, and processing must be switched depending on which ended earlier. In this case, the load on the CPU increases more and more.

CPUの負荷を軽減するために、それぞれのダイレクトメモリアクセス装置の転送データ量を監視して、データ転送を中断、再開するための専用ハードウエアを装備する方法も考えられるが、様々なアクセスパターンによる複雑なデータ転送を実行するためには、専用ハードウエアが複雑化し回路規模が増大してしまうという問題点があった。また、ハードウエア開発後に新たなアクセスパターンに対応する必要が生じた場合に、ハードウエアを作り直す必要があるという問題点があった。   In order to reduce the load on the CPU, it is possible to monitor the transfer data amount of each direct memory access device, and to equip the dedicated hardware for interrupting and restarting the data transfer. In order to execute complicated data transfer, there is a problem that the dedicated hardware becomes complicated and the circuit scale increases. In addition, when it becomes necessary to cope with a new access pattern after hardware development, there is a problem that it is necessary to recreate the hardware.

本発明は上記従来例に鑑みてなされたもので、高機能かつ高性能のダイレクトメモリアクセス転送を、CPUに対する負荷を増大させることなく、かつ、回路規模を増大することなく実現することを目的とする。   The present invention has been made in view of the above-described conventional example, and has an object to realize high-function and high-performance direct memory access transfer without increasing the load on the CPU and without increasing the circuit scale. To do.

以上の目的を達成するために、本発明によるダイレクトメモリアクセス部とプロセッサ部とを有するダイレクトメモリアクセスシステムにおいては、前記プロセッサ部は、
メモリと、前記メモリから命令を読み出して実行することで、前記ダイレクトメモリアクセス部が実行する命令を当該ダイレクトメモリアクセス部に書き込むプロセッサとを備え、前記ダイレクトメモリアクセス部は、複数のプログラムカウンタと、前記複数のプログラムカウンタを順に選択する選択手段と、前記プロセッサによって書き込まれた命令を保持する命令保持手段と、前記選択手段で選択されたプログラムカウンタにより示される前記命令保持手段のアドレスに格納されている命令を出力する出力手段と、前記出力手段によって出力される命令に応じてダイレクトメモリアクセスによるデータ転送を実行する実行手段とを備えていることを特徴とする。
In order to achieve the above object, in a direct memory access system having a direct memory access unit and a processor unit according to the present invention, the processor unit includes:
A memory and a processor that reads and executes instructions from the memory to write instructions executed by the direct memory access unit to the direct memory access unit, and the direct memory access unit includes a plurality of program counters, A selection means for sequentially selecting the plurality of program counters, an instruction holding means for holding an instruction written by the processor, and an address of the instruction holding means indicated by the program counter selected by the selection means Output means for outputting a stored instruction, and execution means for executing data transfer by direct memory access in accordance with the instruction output by the output means.

本発明によれば、高機能かつ高性能のダイレクトメモリアクセス転送を、CPUに対する負荷を増大させることなく、かつ、回路規模を増大することなく実現可能である。特に、ダブルバッファ等を用いて複数のデータ転送を同期を取りながら実行する際に、CPUの関与を必要としないため、システム全体の性能が向上するという効果がある。   According to the present invention, high-performance and high-performance direct memory access transfer can be realized without increasing the load on the CPU and without increasing the circuit scale. In particular, there is an effect that the performance of the entire system is improved because the CPU is not involved when performing a plurality of data transfers using a double buffer or the like while synchronizing them.

本発明の一実施の形態のダイレクトメモリアクセス装置のブロック図である。1 is a block diagram of a direct memory access device according to an embodiment of the present invention. FIG. 命令メモリの構成図である。It is a block diagram of an instruction memory. プログラムカウンタ、プログラムカウンタ選択部、プログラムカウンタ更新部の詳細ブロック図である。It is a detailed block diagram of a program counter, a program counter selection part, and a program counter update part. プログラムカウンタ選択信号生成部の詳細ブロック図である。It is a detailed block diagram of a program counter selection signal generation unit. プログラムカウンタ選択許可信号のデコードと選択信号の関係を示す図である。It is a figure which shows the relationship between the decoding of a program counter selection permission signal, and a selection signal. 命令のデコードを示す図である。It is a figure which shows the decoding of an instruction | indication. サイズフィールドの意味を示す図である。It is a figure which shows the meaning of a size field. 内部リソースの識別子の意味を示す図である。It is a figure which shows the meaning of the identifier of an internal resource. sizeとpos_d/sと有効バイトレーンの関係を示す図である。It is a figure which shows the relationship between size, pos_d / s, and an effective byte lane. sizeとpos_d/sと有効バイトレーンの関係を示す図である。It is a figure which shows the relationship between size, pos_d / s, and an effective byte lane. 特殊命令のエンコーディングを示す図である。It is a figure which shows the encoding of a special instruction. 実行抑制・選択許可信号生成部の詳細なブロック図である。It is a detailed block diagram of an execution suppression / selection permission signal generation unit. 第2選択許可信号生成部の詳細なブロック図である。It is a detailed block diagram of a 2nd selection permission signal generation part. 本発明の一実施の形態のダイレクトメモリアクセス装置のダイレクトメモリアクセス動作を示すタイミング図である。It is a timing diagram which shows the direct memory access operation | movement of the direct memory access apparatus of one embodiment of this invention. 本発明の一実施の形態のダイレクトメモリアクセス装置のサスペンド・レジューム動作を示すタイミング図である。FIG. 5 is a timing chart showing a suspend / resume operation of the direct memory access device according to the embodiment of the present invention. 本発明の一実施の形態のダイレクトメモリアクセス装置を応用したJPEGエンコーダのブロック図である。1 is a block diagram of a JPEG encoder to which a direct memory access device according to an embodiment of the present invention is applied. FIG. 本発明の一実施の形態のJPEGエンコーダにおけるダイレクトメモリアクセス動作のシーケンス図である。It is a sequence diagram of the direct memory access operation | movement in the JPEG encoder of one embodiment of this invention.

以下に、図面を参照して、この発明の好適な実施の形態を例示的に詳しく説明する。ただし、この実施の形態に記載されている構成要素はあくまで例示であり、この発明の範囲をそれらのみに限定する趣旨のものではない。   Hereinafter, exemplary embodiments of the present invention will be described in detail with reference to the drawings. However, the constituent elements described in this embodiment are merely examples, and are not intended to limit the scope of the present invention only to them.

(概要)
本実施形態に係るダイレクトメモリアクセス装置は、簡易な構成で、様々なアクセスパターンによる複雑な複数のデータ転送をコンカレントにかつ同期を取りながら実行するためのものである。
(Overview)
The direct memory access device according to the present embodiment is for executing a plurality of complex data transfers with various access patterns in a concurrent manner while synchronizing with a simple configuration.

この目的のため、複数のプログラムカウンタを備え、プログラムカウンタが順次参照するデータ転送命令に従い、複数のDMA要求に対応するDMA転送が実行される。参照されるデータ転送命令列は予め所定のメモリに格納されている。   For this purpose, a plurality of program counters are provided, and DMA transfers corresponding to a plurality of DMA requests are executed in accordance with data transfer instructions sequentially referred to by the program counters. The data transfer instruction sequence to be referred to is stored in advance in a predetermined memory.

すなわち、1つのデータ転送実行部に対し、命令メモリを複数の領域に分け、複数の独立したプログラムを格納可能とし、それぞれの領域に対応する複数のプログラムカウンタを設けて、各プログラムの進行を独立に制御する。これにより、複数のデバイスからのデータ転送要求毎に異なるアクセスパターンをプログラム可能となっている。さらに、複数のプログラムカウンタをデータ転送毎に選択することで、複数のプログラムを時分割処理することができ、マルチタスクを可能としている。   That is, for one data transfer execution unit, the instruction memory is divided into a plurality of areas, a plurality of independent programs can be stored, a plurality of program counters corresponding to each area are provided, and the progress of each program is independent. To control. Thereby, different access patterns can be programmed for each data transfer request from a plurality of devices. Furthermore, by selecting a plurality of program counters for each data transfer, a plurality of programs can be processed in a time-sharing manner, thereby enabling multitasking.

また、あるプログラムカウンタの参照するデータ転送命令のソースまたはデスティネーションがDMAのデータポートでありかつDMA要求が無い場合、このプログラムカウンタは休眠状態となり、他のプログラムカウンタの参照する命令が実行される。DMAデータポートのDMA要求イベントが発生すると、休眠状態のプログラムカウンタは実行状態に復帰する。   When the source or destination of a data transfer instruction referred to by a program counter is a DMA data port and there is no DMA request, this program counter enters a sleep state, and an instruction referred to by another program counter is executed. . When a DMA request event of the DMA data port occurs, the dormant program counter returns to the execution state.

すなわち、ダイレクトメモリアクセスの対象となるデバイスからの転送要求信号を監視して、転送命令の可否を判断し、転送命令に対応する転送要求がデバイスから出力されていない場合には、データ転送を出口側(転送実行部)で抑制し、ノットレディーなデバイスに対するデータ転送を回避している。また、この場合更に、入口側(プログラムカウンタの選択)でも制限を加え、無駄な命令の実行を回避し全体としての処理速度の向上を図っている。   That is, the transfer request signal from the device subject to direct memory access is monitored to determine whether or not the transfer instruction is possible. If the transfer request corresponding to the transfer instruction is not output from the device, the data transfer is exited. Data transfer to a not-ready device is avoided. Further, in this case, a restriction is also imposed on the entrance side (selection of the program counter) to avoid the execution of useless instructions and improve the overall processing speed.

さらにデータ転送命令の他に、特定のプログラムカウンタを明示的に休眠させる命令と休眠中のプログラムカウンタを実行状態に復帰させる命令を備える。つまり、プログラムの中断、再開の命令を予めプログラム可能に用意しておき、そのような命令に応じて、プログラムカウンタの選択を制御する。   Further, in addition to the data transfer instruction, an instruction for explicitly sleeping a specific program counter and an instruction for returning a sleeping program counter to an execution state are provided. That is, program interruption and restart instructions are prepared in advance so as to be programmable, and the selection of the program counter is controlled in accordance with such instructions.

このようにすることで、命令メモリに対するプログラムの書き込み以外にCPUの関与無しに、複数のデータ転送を同期を取りながら実行することを実現する。特に、ダブルバッファ等を用いて複数のデータ転送を同期を取りながら実行する際に、CPUの関与を必要としないため、システム全体の性能が向上するという効果がある。   In this way, it is possible to execute a plurality of data transfers while synchronizing without any involvement of the CPU other than writing the program to the instruction memory. In particular, there is an effect that the performance of the entire system is improved because the CPU is not involved when performing a plurality of data transfers using a double buffer or the like while synchronizing them.

(具体的構成)
図1は本発明の実施形態であるダイレクトメモリアクセス装置の電気的な構成を示すブロック図である。
(Specific configuration)
FIG. 1 is a block diagram showing an electrical configuration of a direct memory access apparatus according to an embodiment of the present invention.

ブロック間を結合する線の表記は、データ系の接続を幅を持つ矢印で図示し、制御系の接続を幅を持たない矢印で図示した。ただし、すべての接続が図示されているわけではなく、説明に必要な代表的な接続のみを図示した。   In the notation of lines connecting the blocks, data system connections are indicated by arrows having a width, and control system connections are indicated by arrows having no width. However, not all the connections are illustrated, and only representative connections necessary for the description are illustrated.

本装置には、データ転送要求を行う2個のDMA(ダイレクトメモリアクセス)デバイス101、102、CPUバスに接続され、データを格納し、データ転送元またはデータ転送先となるメモリ2と、実行中の命令の命令メモリ5上のアドレスを示す3個のプログラムカウンタ(図中はPC)301、302、303と、選択信号に基づいて、複数のプログラムカウンタ301〜303のうちいずれかのプログラムカウンタに格納された値を、命令メモリ5のアドレスとして選択するプログラムカウンタ選択部4と、データ転送命令を格納する命令メモリ5と、命令メモリ5のデータ出力であるデータ転送命令を解読し転送方向、転送先・元等を判定する命令デコード部6とが含まれている。命令メモリ5は、プログラムカウンタ選択部4で選択されたプログラムカウンタが示すアドレスから命令を出力する。   This apparatus is connected to two DMA (direct memory access) devices 101 and 102 that perform data transfer requests, is connected to a CPU bus, stores data, and is a memory 2 that is a data transfer source or data transfer destination, and is being executed Based on three program counters (PCs in the figure) 301, 302, and 303 indicating the addresses of the instructions in the instruction memory 5 and a selection signal, any one of the program counters 301 to 303 is set as one of the program counters. The program counter selection unit 4 that selects the stored value as an address of the instruction memory 5, the instruction memory 5 that stores the data transfer instruction, and the data transfer instruction that is the data output of the instruction memory 5 is decoded to transfer direction and transfer An instruction decoding unit 6 for determining the destination and the source is included. The instruction memory 5 outputs an instruction from the address indicated by the program counter selected by the program counter selection unit 4.

また、解読された命令に従って2つのDMAポート701、702またはバスIF(インターフェース)703を駆動してデータ転送を実行するデータ転送実行部7を含む。更に、命令デコード部6の出力から転送元または先を検出する転送元/先検出部801、DMAデバイスからのデータ転送要求を検出するDMA要求検出部802、転送元/先検出部801で検出された転送元または先と、データ転送要求を出しているDMAデバイスとが一致しているか否かを判定する一致判定部803、判定結果が不一致であればデータ転送実行部7のデータ転送を抑制する信号を出力する実行抑制信号生成部804、及び、判定結果が不一致ならば現在実行中の命令に対応するプログラムカウンタを非選択とするための第1選択許可信号を生成する第1選択許可信号生成部805とを含む信号生成部8を含む。   Also included is a data transfer execution unit 7 that drives the two DMA ports 701 and 702 or the bus IF (interface) 703 according to the decoded instruction to execute data transfer. Further, a transfer source / destination detection unit 801 that detects the transfer source or destination from the output of the instruction decode unit 6, a DMA request detection unit 802 that detects a data transfer request from the DMA device, and a transfer source / destination detection unit 801 are detected. A match determination unit 803 that determines whether the transfer source or destination matches the DMA device that has issued the data transfer request. If the determination results do not match, data transfer of the data transfer execution unit 7 is suppressed. An execution suppression signal generation unit 804 that outputs a signal, and a first selection permission signal generation that generates a first selection permission signal for deselecting the program counter corresponding to the currently executing instruction if the determination results do not match A signal generation unit 8 including a unit 805.

実行抑制信号生成部804は、命令メモリ5から出力された命令の内容に対応した転送要求がダイレクトメモリアクセスデバイス101、102から出力されていない場合、データ転送実行部7のデータ転送を抑制する転送抑制部として機能する。また、第1選択許可信号生成部805及び選択信号生成部10は、命令メモリ5から出力された命令の内容に対応した転送要求がダイレクトメモリアクセスデバイス101、102から出力されている場合には、プログラムカウンタ選択部4による、出力された命令に対応するプログラムカウンタ301〜303の選択を許可し、命令メモリ5から出力された命令の内容に対応した転送要求がダイレクトメモリアクセスデバイス101、102から出力されていない場合には、出力された命令の内容に対応した転送要求が出力されるまで、プログラムカウンタ選択部4による、命令を出力するプログラムカウンタ301〜303の選択を不許可にする選択許可部として機能する。   When the transfer request corresponding to the content of the instruction output from the instruction memory 5 is not output from the direct memory access devices 101 and 102, the execution suppression signal generation unit 804 transfers the data that is suppressed by the data transfer execution unit 7 Functions as a suppression unit. In addition, the first selection permission signal generation unit 805 and the selection signal generation unit 10, when a transfer request corresponding to the content of the instruction output from the instruction memory 5 is output from the direct memory access devices 101 and 102, The program counter selection unit 4 permits selection of the program counters 301 to 303 corresponding to the output instruction, and a transfer request corresponding to the content of the instruction output from the instruction memory 5 is output from the direct memory access devices 101 and 102. If not, a selection permitting unit that disallows selection of the program counters 301 to 303 that output instructions by the program counter selecting unit 4 until a transfer request corresponding to the content of the output instruction is output. Function as.

また、命令デコード部6の出力がサスペンド命令かレジューム命令かを判定し、プログラムカウンタ301〜303を選択または非選択とするための第2選択許可信号を生成する第2選択信号生成部9と、第1および第2選択許可信号に基づきデータ転送実行毎にプログラムカウンタ選択部4に送出する選択信号を生成する選択信号生成部10と、選択信号に基づきデータ転送実行毎に選択されたプログラムカウンタの値を1ずつ更新するプログラムカウンタ更新部11と、図示しないデータポートを経由して命令メモリ5に命令を格納し、ダイレクトメモリアクセス装置の動作を制御するCPUバスに接続されたCPU12とを含む。   A second selection signal generation unit 9 that determines whether the output of the instruction decode unit 6 is a suspend instruction or a resume instruction, and generates a second selection permission signal for selecting or deselecting the program counters 301 to 303; A selection signal generation unit 10 that generates a selection signal to be sent to the program counter selection unit 4 for each data transfer execution based on the first and second selection permission signals, and a program counter selected for each data transfer execution based on the selection signal It includes a program counter update unit 11 that updates values one by one, and a CPU 12 that stores instructions in the instruction memory 5 via a data port (not shown) and is connected to a CPU bus that controls the operation of the direct memory access device.

第2選択信号生成部9及び選択信号生成部10は、命令メモリ5から出力された命令が、いずれかのプログラムカウンタ301〜303を指定した中断命令である場合には、プログラムカウンタ選択部4による、指定されたプログラムカウンタ301〜303の選択を不許可にし、前記命令メモリ5から出力された命令が、いずれかのプログラムカウンタ301〜303を指定した再開命令である場合には、プログラムカウンタ選択部4による、指定されたプログラムカウンタ301〜303の選択を許可にする第2の選択許可部として機能する。   The second selection signal generation unit 9 and the selection signal generation unit 10 are configured by the program counter selection unit 4 when the instruction output from the instruction memory 5 is an interruption instruction specifying any one of the program counters 301 to 303. When the designated program counters 301 to 303 are not allowed to be selected and the instruction output from the instruction memory 5 is a restart instruction designating one of the program counters 301 to 303, a program counter selection unit 4 functions as a second selection permission unit that permits selection of the designated program counters 301 to 303.

ここで、本装置内のブロックのうち、まずCPU12のリセットが解除され、CPU12は内蔵ROMから命令をフェッチし実行することにより、図示しないリセット信号を制御して順次各ブロックのリセットを解除することが可能である。CPU12以外のモジュールがすべてリセットの状態において、まずCPU12は、命令メモリ5に対し、ダイレクトメモリアクセス装置が実行する命令を書き込む。   Here, among the blocks in the apparatus, the reset of the CPU 12 is first released, and the CPU 12 fetches an instruction from the built-in ROM and executes it to control a reset signal (not shown) to sequentially release the reset of each block. Is possible. When all the modules other than the CPU 12 are reset, the CPU 12 first writes a command to be executed by the direct memory access device to the command memory 5.

図2は、本実施の形態において使用する命令メモリ5の構成および入出力ポートを示す。命令メモリ5は2ポート(1Read/1Write)のSRAMであり、データ幅は32ビット、ワード長は64である。読み出しアドレス(READ ADDRESS)は6ビットであり、読み出し許可信号(READ ENABLE)をアサートすると32ビットの読み出しデータがREAD DATAポートより読み出される。本実施の形態においては、読み出しアドレスはプログラムカウンタ選択部4から供給され、読み出しデータは命令デコード部6に供給される。書き込みアドレス(WRITE ADDRESS)は6ビットであり、書き込み許可信号(WRITE ENABLE)をアサートすると、32ビットの書き込みデータ(WRITE DATA)信号上にドライブされているデータがSRAMの書き込みアドレスに書き込まれる。本実施の形態では、書き込みアドレス、書き込みデータともにCPU12から供給される。   FIG. 2 shows the configuration of the instruction memory 5 and the input / output ports used in the present embodiment. The instruction memory 5 is a 2-port (1Read / 1Write) SRAM, and has a data width of 32 bits and a word length of 64. The read address (READ ADDRESS) is 6 bits. When a read enable signal (READ ENABLE) is asserted, 32-bit read data is read from the READ DATA port. In the present embodiment, the read address is supplied from the program counter selection unit 4 and the read data is supplied to the instruction decoding unit 6. The write address (WRITE ADDRESS) is 6 bits, and when the write enable signal (WRITE ENABLE) is asserted, the data driven on the 32-bit write data (WRITE DATA) signal is written to the write address of the SRAM. In this embodiment, both the write address and the write data are supplied from the CPU 12.

図1に戻り、命令メモリ5への命令データの書き込みが終わると、CPU12が順次各ブロックのリセットを解除し、これによりダイレクトメモリアクセス装置は動作を開始する。プログラムカウンタ301、302、303はおのおの6ビットのフリップフロップから構成されており、リセット時の初期値はおのおの"000000","010000","100000"となっている。すなわちプログラムカウンタ301は0x0番地からの命令を実行し、プログラムカウンタ302は0x10番地からの命令を実行し、プログラムカウンタ303は0x20番地からの命令を実行する。   Returning to FIG. 1, when the writing of the instruction data to the instruction memory 5 is completed, the CPU 12 sequentially releases the reset of each block, whereby the direct memory access device starts its operation. The program counters 301, 302, and 303 are each composed of a 6-bit flip-flop, and the initial values at the time of reset are "000000", "010000", and "100,000", respectively. That is, the program counter 301 executes an instruction from address 0x0, the program counter 302 executes an instruction from address 0x10, and the program counter 303 executes an instruction from address 0x20.

プログラムカウンタ301,302,303、プログラムカウンタ選択部4およびプログラムカウンタ更新部11の詳細ブロック図を図3に示す。プログラムカウンタ301にはセレクタ1101の出力が入力される。セレクタ1101は、プログラムカウンタの現在の値、現在の値に1を加算した値、LOAD命令によりローディングされる値(store_d)、LOOP命令によりループバックする際のプログラムカウンタの戻り値(lp_back_pc)、JUMP命令によるジャンプ先アドレス(jump_pc)のうちの1つを選択して出力する。セレクタ1102はプログラムカウンタの出力自身、プログラムカウンタの値に1を加えた値(+1加算器1103の出力)のうちの何れかをプログラムカウンタ選択信号pc_selに基づいて選択する。すなわち、当該クロックサイクルにおいて当該プログラムカウンタが選択されている場合は1を加えた値を選択し、非選択の場合は現在の値を選択する。プログラムカウンタ302および303においても同様の構成が取られており、プログラムカウンタの更新がなされる。プログラムカウンタ選択部4は3ビットのプログラム選択信号pc_sel[2:0]に応じてプログラムカウンタ301(PC(0))、302(PC(1))、303(PC(2))の出力のうちの1つを選択し、命令メモリの読み取りアドレスとして出力する。pc_sel[2:0]はone-hotの信号であり、"001"のときプログラムカウンタ301を選択し、"010"のときプログラムカウンタ302を選択し、"100"のときプログラムカウンタ303を選択する。すなわち、pc_sel[n]='1'のときPC(n)を選択する(ただしn=0,1,2)。   A detailed block diagram of the program counters 301, 302, 303, the program counter selection unit 4 and the program counter update unit 11 is shown in FIG. The output of the selector 1101 is input to the program counter 301. The selector 1101 includes the current value of the program counter, the value obtained by adding 1 to the current value, the value loaded by the LOAD instruction (store_d), the return value of the program counter when looping back by the LOOP instruction (lp_back_pc), JUMP Select and output one of the jump destination addresses (jump_pc) by the instruction. The selector 1102 selects either the output of the program counter itself or the value obtained by adding 1 to the value of the program counter (the output of the +1 adder 1103) based on the program counter selection signal pc_sel. That is, when the program counter is selected in the clock cycle, a value obtained by adding 1 is selected. When the program counter is not selected, the current value is selected. The program counters 302 and 303 have the same configuration, and the program counter is updated. The program counter selection unit 4 outputs the program counters 301 (PC (0)), 302 (PC (1)), and 303 (PC (2)) in response to a 3-bit program selection signal pc_sel [2: 0]. Is selected and output as a read address of the instruction memory. pc_sel [2: 0] is a one-hot signal. When it is “001”, the program counter 301 is selected, when it is “010”, the program counter 302 is selected, and when it is “100”, the program counter 303 is selected. . That is, PC (n) is selected when pc_sel [n] = '1' (where n = 0, 1, 2).

図4に選択信号生成部10の詳細ブロック図を示す。フリップフロップ1001、1002、1003は各々クロック信号とリセット信号に接続されており、出力がプログラムカウンタ選択信号となる。フリップフロップ1001はリセットにより"1"がセットされ、D入力にはセレクタ1004の出力が接続され、Q出力がpc_sel[0]となる。フリップフロップ1002はリセットにより"0"がセットされ、D入力にはセレクタ1005の出力が接続され、Q出力がpc_sel[1]となる。フリップフロップ1003はリセットにより"0"がセットされ、D入力にはセレクタ1006の出力が接続され、Q出力がpc_sel[2]となる。   FIG. 4 shows a detailed block diagram of the selection signal generator 10. The flip-flops 1001, 1002, and 1003 are connected to a clock signal and a reset signal, respectively, and the output is a program counter selection signal. The flip-flop 1001 is set to “1” by reset, the output of the selector 1004 is connected to the D input, and the Q output becomes pc_sel [0]. The flip-flop 1002 is set to “0” by reset, the output of the selector 1005 is connected to the D input, and the Q output becomes pc_sel [1]. The flip-flop 1003 is set to “0” by reset, the output of the selector 1006 is connected to the D input, and the Q output becomes pc_sel [2].

デコーダ1007は第1選択許可信号生成部805の出力する第1選択許可信号pc_en1[2:0]と第2選択許可信号生成部9の出力する第2選択許可信号pc_en2[2:0]のゲート1008、1009、1010による論理積演算出力pc_en[2:0]と、命令実行のストール指示を示すストール信号とをデコードし、セレクタ1004、1005、1006に対して選択信号を生成する。デコード方式を図5に示す。入力であるストール、論理積演算出力pc_en[2:0]に対する出力である選択信号sel_cnt[2:0]の関係を示す。例えば、ストールが"1"の場合、sel_cntは全て2となり、全フリップフロップは現在の値を保持する。すなわち、pc_selは更新されない。ストールが"0"でpc_en="111"の場合、sel_cntは全て0となり、pc_selはシフトレジスタ動作する。すなわち、"001"→"010"→"100"→"001"と遷移し、PC(0)→PC(1)→PC(2)→PC(0)の順に選択される。ストールが"0"でpc_en="011"の場合は、PC(2)が選択不許可となるように、sel_cnt="301"となり、pc_selは"001"→"010"→"001"→"010"→"001"と遷移し、PC(0)→PC(1)→PC(0)→PC(1)→PC(0)の順に選択される。   The decoder 1007 gates the first selection permission signal pc_en1 [2: 0] output from the first selection permission signal generation unit 805 and the second selection permission signal pc_en2 [2: 0] output from the second selection permission signal generation unit 9. The AND operation output pc_en [2: 0] by 1008, 1009, 1010 and the stall signal indicating the instruction execution stall instruction are decoded, and a selection signal is generated for the selectors 1004, 1005, 1006. The decoding method is shown in FIG. The relationship of the selection signal sel_cnt [2: 0], which is an output, with respect to the stall, which is an input, and the logical product operation output pc_en [2: 0] is shown. For example, when the stall is “1”, sel_cnt is all 2 and all flip-flops hold the current value. That is, pc_sel is not updated. When stall is "0" and pc_en = "111", sel_cnt is all 0 and pc_sel operates as a shift register. That is, transition is made from “001” → “010” → “100” → “001”, and PC (0) → PC (1) → PC (2) → PC (0) is selected in this order. When the stall is “0” and pc_en = “011”, sel_cnt = “301” is set so that selection of PC (2) is not permitted, and pc_sel is changed from “001” → “010” → “001” → ” Transition is made to “010” → “001”, and PC (0) → PC (1) → PC (0) → PC (1) → PC (0) is selected in this order.

プログラムカウンタ選択部4によって選択されたプログラムカウンタに対応する命令は命令メモリ5から読み出され、命令デコード部6に入力される。命令は32ビットからなり、図6に示すように解読される。   The instruction corresponding to the program counter selected by the program counter selection unit 4 is read from the instruction memory 5 and input to the instruction decoding unit 6. The instruction consists of 32 bits and is decoded as shown in FIG.

32ビット命令をInst[31:0]と表記すると、Inst[31:30]="00"のとき特殊命令(Special Instruction)、"01"のときロード命令(Load Instruction)、"10"のときストア命令(Store Instruction)、"11"は無効命令と解読する。ロード命令とは、メモリからダイレクトメモリアクセス装置の内部リソース(DMAポートを含む)へのデータ転送命令であり、ストア命令とは、内部リソースからメモリへのデータ転送命令である。特殊命令にはNOP命令(なにもしない命令)やループ命令(LOOP)、ジャンプ命令(JUMP)等の一般的なプロセッサに備わっている命令が含まれる。   When a 32-bit instruction is expressed as Inst [31: 0], when Inst [31:30] = "00", a special instruction (Special Instruction), when "01", a load instruction (Load Instruction), and when "10" A store instruction (Store Instruction) “11” is decoded as an invalid instruction. The load instruction is a data transfer instruction from the memory to internal resources (including the DMA port) of the direct memory access device, and the store instruction is a data transfer instruction from the internal resource to the memory. Special instructions include instructions provided in general processors such as NOP instructions (instructions that do nothing), loop instructions (LOOP), and jump instructions (JUMP).

Inst[29:27]はデータサイズを示すフィールドであり、詳細は図7に示されている。例えば"000"の場合は1バイト、"100"の場合は5バイトの転送であることを示す。   Inst [29:27] is a field indicating the data size, and details are shown in FIG. For example, “000” indicates transfer of 1 byte, and “100” indicates transfer of 5 bytes.

Inst[26:23]は転送元リソースのインデックスを示すフィールド、Inst[22:19]は転送先リソースのインデックスを示すフィールドであり、Inst[18:16]で示される内部リソースの識別子(ロード命令の場合は転送先、ストア命令の場合は転送元を示す)とともにどの内部リソースの何番目のリソースを転送対象にするかを示す。   Inst [26:23] is a field indicating the index of the transfer source resource, Inst [22:19] is a field indicating the index of the transfer destination resource, and the identifier (load command) of the internal resource indicated by Inst [18:16] Indicates the transfer destination, and in the case of a store instruction, indicates the transfer source of which internal resource.

内部リソース識別子の詳細は図8に示されている。"000"の場合PCすなわちプログラムカウンタを示し、"001"の場合ARすなわちアドレスレジスタを示し、"010"の場合GPRすなわち汎用レジスタを示し、"010"の場合IN/OUTすなわちDMAポートを示し(IN/OUTはロードかストアかにより識別される)、"100"の場合LPすなわちループレジスタを示し、"101"の場合OFSTすなわちオフセットレジスタを示す。   Details of the internal resource identifier are shown in FIG. "000" indicates a PC or program counter, "001" indicates an AR or address register, "010" indicates a GPR or general-purpose register, and "010" indicates an IN / OUT or DMA port ( IN / OUT is identified by whether it is a load or a store), “100” indicates an LP, that is, a loop register, and “101” indicates an OFST, that is, an offset register.

ロード命令の場合の転送元とストア命令の場合の転送先を示す内部リソース識別子はアドレスレジスタに固定されており、インデックスのみをそれぞれのインデックスフィールドにより指定する。   An internal resource identifier indicating a transfer source in the case of a load instruction and a transfer destination in the case of a store instruction is fixed in an address register, and only an index is designated by each index field.

Inst[15:13]はデータ転送元または先の有効バイトレーンを示すフィールドであり、データサイズフィールドとともに何バイトをどのバイトレーンにまたはどのバイトレーンから転送するかを示す。図9A、図9Bは、サイズとバイトレーンの組み合わせにより有効となるバイトレーンを詳細に示している。データは64ビットであり、バイトレーンは[63:56]、[55:48]、[47:40]、[39:32]、[31:24]、[23:16]、[15:8]、[7:0]の8レーンあり、有効レーンに"v"が表記されている。例えばサイズフィールド(size)が"000"すなわち1バイトで、バイトレーンフィールド(pos_d/s)が"011"すなわち第4バイトレーンの場合、データ[31:24]に1バイトのデータが転送される。   Inst [15:13] is a field indicating the valid byte lane of the data transfer source or destination, and indicates how many bytes are transferred to or from which byte lane together with the data size field. 9A and 9B show in detail the byte lanes that are valid depending on the combination of size and byte lane. The data is 64 bits, and the byte lanes are [63:56], [55:48], [47:40], [39:32], [31:24], [23:16], [15: 8]. ], [7: 0] are 8 lanes, and “v” is written in the effective lane. For example, when the size field (size) is “000”, that is, 1 byte, and the byte lane field (pos_d / s) is “011”, that is, the fourth byte lane, 1 byte of data is transferred to the data [31:24]. .

より理解を深めるために、いくつかの命令の実例を示す。   In order to better understand, some examples of instructions are given.

Inst="01_000_0001_0010_100_001_000000000000"の場合、ロード命令であり、アドレスレジスタAR(1)の示すメモリ上の1バイトデータを、ループレジスタLP(2)の[15:8]にロードする。   When Inst = "01_000_0001_0010_100_001_000000000000", this is a load instruction, and 1-byte data on the memory indicated by the address register AR (1) is loaded into [15: 8] of the loop register LP (2).

Inst="10_111_0001_0010_011_000_000000000000"の場合、ストア命令であり、DMA入力ポートIN(1)から読み込まれた8バイトデータを、アドレスレジスタAR(2)の示すメモリ上にストアする。   When Inst = "10_111_0001_0010_011_000_000000000000", this is a store instruction, and 8-byte data read from the DMA input port IN (1) is stored in the memory indicated by the address register AR (2).

図10は特殊命令のエンコーディングを示す。   FIG. 10 shows the encoding of special instructions.

EnableThreadは特定のプログラムカウンタを有効にする命令であり、当該プログラムカウンタ以外休眠中の他のプログラムカウンタを起動するときに使用できる。   EnableThread is an instruction for enabling a specific program counter, and can be used when other program counters other than the program counter are activated.

DisableThreadは特定のプログラムカウンタを無効にする命令であり、当該プログラムカウンタ以外の実行中の他のプログラムカウンタを休眠状態にする場合や、プログラムの実行が終了した際に自分自身を休眠状態にする際に使用できる。   DisableThread is a command that disables a specific program counter. When other program counters other than the program counter are put into a sleep state, or when execution of a program is finished, the program is put into a sleep state. Can be used for

SuspendThread、ResumeThread、WaitTrigger、EmitTriggerは、それぞれ、特定のプログラムカウンタをサスペンド(実行中断)状態にする命令、特定のプログラムカウンタをレジューム(実行再開)する命令、特定のトリガイベントを待って自プログラムカウンタをサスペンド(実行中断)状態にする命令、特定のトリガイベントを発生させる命令である。   SuspendThread, ResumeThread, WaitTrigger, and EmitTrigger are each an instruction to suspend (execute execution) a specific program counter, an instruction to resume (restart execution) a specific program counter, and wait for a specific trigger event to set its own program counter. This is an instruction to suspend (execute execution) state and an instruction to generate a specific trigger event.

JUMPはジャンプ命令であり、オペランドInst[23:12]を現在選択中のプログラムカウンタにコピーする。本実施の形態においてはプログラムカウンタは6ビットであるので、実際はInst[17:12]がコピーされる。   JUMP is a jump instruction and copies the operand Inst [23:12] to the currently selected program counter. In the present embodiment, since the program counter is 6 bits, Inst [17:12] is actually copied.

LoadImmidiateByteは即値を内部リソースにロードする命令であり、オペランドInst[7:0]で示される1バイトを、その他のオペランドにより特定される内部リソースにコピーする。   LoadImmidiateByte is an instruction for loading an immediate value into an internal resource, and 1 byte indicated by the operand Inst [7: 0] is copied to the internal resource specified by the other operand.

ClearResigerは内部リソースを0クリアする命令である。   ClearResiger is an instruction to clear internal resources to zero.

LoopInはループ突入命令であり、LoopIndicator(Inst[22:19])で指定されるループレジスタLPおよびオフセットレジスタOFSTの組み合わせによりループを実現する。   LoopIn is a loop entry command, and a loop is realized by a combination of the loop register LP and the offset register OFST specified by LoopIndicator (Inst [22:19]).

データ転送実行部7は命令デコード部6の命令解読結果に応じてデータ転送を実行する。また、内部リソースとして、図示しない汎用レジスタGPR、アドレスレジスタAR、ループレジスタLP、オフセットレジスタOFSTをそれぞれ4本ずつ備える。さらに、ダイレクトメモリアクセスデバイス101とのデータ転送のためにDMAポート701(IN(0)およびOUT(0))と、ダイレクトメモリアクセスデバイス102とのデータ転送のためにDMAポート702(IN(1)およびOUT(1))と、メモリ1とのデータ転送のためにバスインターフェース703を備える。   The data transfer execution unit 7 executes data transfer according to the instruction decoding result of the instruction decoding unit 6. In addition, four general-purpose registers GPR, address registers AR, loop registers LP, and offset registers OFST (not shown) are provided as internal resources. Further, the DMA port 701 (IN (0) and OUT (0)) is used for data transfer with the direct memory access device 101, and the DMA port 702 (IN (1)) is used for data transfer with the direct memory access device 102. And OUT (1)) and a bus interface 703 for data transfer with the memory 1.

汎用レジスタは、データを一時的に保持するレジスタであり、例えばメモリからロードしたデータを1バイトごとに別の内部リソースにコピーするなどに用いる。   The general-purpose register is a register that temporarily holds data. For example, the general-purpose register is used for copying data loaded from a memory to another internal resource for each byte.

ここで、アドレスレジスタARは、バスインターフェースに対して出力するアドレスを生成する。一般的なプロセッサと同様に1データ転送毎にアドレスレジスタARの値を更新するモード(自動更新アドレッシングモード)を備える構成も好ましい。ループレジスタLPは、命令のループ回数を示し、オフセットレジスタOFSTはループバックすべき命令アドレスを示す。ループレジスタLPとオフセットレジスタOFSTに所定値をロードし、ループ命令を実行することによりループ内に入る。プログラムカウンタが進行してオフセットレジスタOFSTに格納された値と一致したときにプログラムカウンタの値をループ命令の次の命令を示すアドレスに更新するとともにループレジスタの値を1減じる。ループレジスタLPが0になった場合は、ループを脱出する、すなわちプログラムカウンタの値にただ1加える。非常に単純なループを用いたプログラム例を示す。   Here, the address register AR generates an address to be output to the bus interface. Similarly to a general processor, a configuration including a mode (automatic update addressing mode) for updating the value of the address register AR for each data transfer is also preferable. The loop register LP indicates the number of instruction loops, and the offset register OFST indicates an instruction address to be looped back. A predetermined value is loaded into the loop register LP and the offset register OFST, and a loop instruction is executed to enter the loop. When the program counter advances and coincides with the value stored in the offset register OFST, the value of the program counter is updated to an address indicating the instruction next to the loop instruction and the value of the loop register is decremented by one. When the loop register LP becomes 0, the loop is exited, that is, only 1 is added to the value of the program counter. A program example using a very simple loop is shown.

=============================================================================
命令アドレス 命令
0x00 AR(0)[7:0]に即値0x20をロード
0x01 LP(0)にAR(0)の示すメモリ上の値をロード(メモリの0x20番地上のデータ=0x20)
0x02 OFST(0)に即値0x04をロード
0x03 LoopIn命令(インディケータ0)
0x04 DMAPort(0)から読み出したデータをAR(1)の示すメモリアドレスにストアしAR(1)++
0x05 DisableThreadにより自分自身を休眠させる。
=============================================================================
上記命令列によれば、0x03番地の命令実行によりループに入り、0x04番地に記述されているように、DMAポートからメモリへデータを転送し、プログラムカウンタがオフセットレジスタと一致するためループバックしLoopIn命令の次アドレスすなわち0x04にジャンプする。これをLP(0)の回数、すなわち32回繰り返してループを抜けて終了する。
================================================== ===========================
Instruction address Instruction 0x00 Load immediate value 0x20 to AR (0) [7: 0] 0x01 Load value in memory indicated by AR (0) to LP (0) (0x20 ground data = 0x20)
0x02 Load immediate value 0x04 to OFST (0) 0x03 LoopIn instruction (indicator 0)
0x04 Stores the data read from DMAPort (0) at the memory address indicated by AR (1) and stores AR (1) ++
0x05 Sleep yourself with DisableThread.
================================================== ===========================
According to the above instruction sequence, a loop is entered by executing an instruction at address 0x03, data is transferred from the DMA port to the memory as described in address 0x04, and loopback is performed because the program counter matches the offset register. Jump to the next address of the instruction, that is, 0x04. This is repeated the number of times LP (0), that is, 32 times, and the process exits from the loop.

信号生成部8は、命令デコード部4による命令デコード結果と、ダイレクトメモリアクセスデバイス101,102のダイレクトメモリアクセス要求とプログラムカウンタ選択信号生成部10からのプログラムカウンタ選択信号をもとに、データ転送実行部7への実行抑制信号とプログラムカウンタ選択信号生成部10への第1選択許可信号を生成する。   The signal generation unit 8 executes data transfer based on the instruction decode result by the instruction decode unit 4, the direct memory access request of the direct memory access devices 101 and 102, and the program counter selection signal from the program counter selection signal generation unit 10. An execution suppression signal to the unit 7 and a first selection permission signal to the program counter selection signal generation unit 10 are generated.

図11は信号生成部8の内部構成を示すブロック図である。601,602、603、604、605は命令デコード部6に含まれる比較器であるが、説明に好都合のため図11に示した。比較器601は命令がロード命令であるかどうかを判定する。ロード命令である場合にはload信号をアサートする。比較器602は命令がストア命令であるかどうかを判定する。ストア命令である場合にはstore信号をアサートする。比較器603は転送元または転送先インデックスが0であるかどうかを判定する。インデックスが0である場合にはPort0信号をアサートする。比較器604は転送元または転送先インデックスが1であるかどうかを判定する。インデックスが1である場合にはPort1信号をアサートする。比較器605は転送元または転送先がDMAポートであるかどうかを判定する。DMAポートである場合にはDMA信号をアサートする。   FIG. 11 is a block diagram showing the internal configuration of the signal generator 8. Reference numerals 601, 602, 603, 604, and 605 are comparators included in the instruction decode unit 6, but are shown in FIG. 11 for convenience of explanation. Comparator 601 determines whether the instruction is a load instruction. If it is a load instruction, the load signal is asserted. Comparator 602 determines whether the instruction is a store instruction. If it is a store instruction, the store signal is asserted. The comparator 603 determines whether the transfer source or transfer destination index is 0. If the index is 0, the Port0 signal is asserted. The comparator 604 determines whether the transfer source or transfer destination index is 1. When the index is 1, the Port1 signal is asserted. The comparator 605 determines whether the transfer source or transfer destination is a DMA port. If it is a DMA port, the DMA signal is asserted.

ゲート811、812、813、814は転送元・先検出部801を構成する。ゲート811にはload,Port0,DMA信号が入力され、3入力のANDがLD_OUT0信号として出力される。LD_OUT0信号はDMAポート0に対してデータをロードする命令が発行されていることを示す。ゲート812にはload,Port1,DMA信号が入力され、3入力のANDがLD_OUT1信号として出力される。LD_OUT1信号はDMAポート1に対してデータをロードする命令が発行されていることを示す。ゲート813にはstore,Port0,DMA信号が入力され、3入力のANDがST_IN0信号として出力される。ST_IN0信号はDMAポート0からデータを読み出してメモリにストアする命令が発行されていることを示す。ゲート814にはstore,Port1,DMA信号が入力され、3入力のANDがST_IN1信号として出力される。ST_IN1信号はDMAポート1からデータを読み出してメモリにストアする命令が発行されていることを示す。   The gates 811, 812, 813, and 814 constitute a transfer source / destination detection unit 801. The gate 811 receives the load, Port0, and DMA signals, and outputs a 3-input AND as the LD_OUT0 signal. The LD_OUT0 signal indicates that an instruction to load data to DMA port 0 has been issued. The gate 812 receives load, Port1, and DMA signals, and outputs a 3-input AND as an LD_OUT1 signal. The LD_OUT1 signal indicates that an instruction to load data to the DMA port 1 has been issued. The gate 813 receives the store, Port0, and DMA signals, and outputs a 3-input AND as the ST_IN0 signal. The ST_IN0 signal indicates that an instruction to read data from the DMA port 0 and store it in the memory has been issued. The gate 814 receives the store, Port1, and DMA signals, and outputs a 3-input AND as the ST_IN1 signal. The ST_IN1 signal indicates that an instruction to read data from the DMA port 1 and store it in the memory has been issued.

ゲート831、832、833、834は発行された命令に対応するダイレクトメモリアクセス要求がアサートされているかどうかを検出する一致判定部803を構成する。DMAOReq0はダイレクトメモリアクセスデバイス101がメモリからのデータ転送を要求しているときに"1"にアサートされ、DMAOReq1はダイレクトメモリアクセスデバイス102がメモリからのデータ転送を要求しているときに"1"にアサートされ、DMAIReq0はダイレクトメモリアクセスデバイス101がメモリへのデータ転送を要求しているときに"1"にアサートされ、DMAIReq1はダイレクトメモリアクセスデバイス102がメモリへのデータ転送を要求しているときに"1"にアサートされる。ゲート831、832、833、834の出力は、発行された命令がアクセスしようとしているDMAポートから、データ転送要求がない場合に、"0"レベルとなる。   Gates 831, 832, 833, and 834 constitute a coincidence determination unit 803 that detects whether or not a direct memory access request corresponding to the issued instruction is asserted. DMAOReq0 is asserted to "1" when the direct memory access device 101 requests data transfer from the memory, and DMAOReq1 is "1" when the direct memory access device 102 requests data transfer from the memory. DMAIReq0 is asserted to "1" when the direct memory access device 101 is requesting data transfer to the memory, and DMAIReq1 is when the direct memory access device 102 is requesting data transfer to the memory Is asserted to "1". The outputs of the gates 831, 832, 833, and 834 become “0” level when there is no data transfer request from the DMA port to which the issued instruction is to access.

ゲート841は、実行抑制信号生成部804を構成するゲートであり、ゲート831、832、833、834の出力のいずれか1つが"0"になると出力が"0"となる。従って、ゲート841の出力が実行抑制信号(抑制すべき時"0"レベル)となる。   The gate 841 is a gate constituting the execution suppression signal generation unit 804. When any one of the outputs of the gates 831, 832, 833, and 834 becomes “0”, the output becomes “0”. Therefore, the output of the gate 841 becomes an execution suppression signal (“0” level when it should be suppressed).

ゲート851、852、853、854は、ダイレクトメモリアクセス命令を発行したプログラムカウンタのどれが、どのDMAポートをアクセスしたときに実行抑制を受けたかを検出する。フリップフロップ855、856、857、858は実行抑制の検出結果を保持する。ゲート821、822、823、824は、実行抑制中のダイレクトメモリアクセス命令に対応するダイレクトメモリアクセス要求が発生したことを検出するDMA要求検出部802を構成する。実行抑制中のダイレクトメモリアクセス命令に対応するダイレクトメモリアクセス要求が発生したことを検出すると、フリップフロップ855、856、857、858はクリアされる。ゲート8591は実行抑制状態を生成し、ゲート8592は実行抑制解除状態を生成する。ゲート8593により、特定のプログラムカウンタの実行抑制状態が生成され、これを第1選択許可信号pc_en1[2:0]としてプログラム選択信号生成部10へ出力する。すなわちpc_en1[n]が"1"の場合、選択が許可され、"0"の場合、選択が不許可となる。   The gates 851, 852, 853, and 854 detect which program counter that issued the direct memory access instruction has received execution suppression when accessing which DMA port. The flip-flops 855, 856, 857, and 858 hold the execution suppression detection result. Gates 821, 822, 823, and 824 constitute a DMA request detection unit 802 that detects that a direct memory access request corresponding to a direct memory access instruction whose execution is being suppressed has occurred. When it is detected that a direct memory access request corresponding to the direct memory access instruction whose execution is being suppressed is generated, the flip-flops 855, 856, 857, and 858 are cleared. Gate 8591 generates an execution suppression state, and gate 8592 generates an execution suppression release state. The gate 8593 generates an execution suppression state of a specific program counter, and outputs this to the program selection signal generation unit 10 as the first selection permission signal pc_en1 [2: 0]. That is, when pc_en1 [n] is “1”, selection is permitted, and when it is “0”, selection is not permitted.

図11においてはどのプログラムカウンタであるかを整数nで示している。nは0,1,2の何れかであるので、本実施の形態においてはゲート821、822、823、824、851、852、853、854、8591、8592、8593およびフリップフロップ855、856、857、858はプログラムカウンタの数すなわち3セット存在するが図示を省略している。   In FIG. 11, which program counter is indicated by an integer n. Since n is 0, 1, or 2, in this embodiment, the gates 821, 822, 823, 824, 851, 852, 853, 854, 8591, 8592, 8593 and flip-flops 855, 856, 857 are used. 858, the number of program counters, that is, there are three sets, which are not shown.

第2選択許可信号生成部9は、命令デコード部4による命令デコード結果とプログラムカウンタ選択信号生成部10からのプログラムカウンタ選択信号をもとに、プログラムカウンタ選択信号生成部10への第2選択許可信号を生成する。図12は第2選択許可信号生成部9の内部構成を示すブロック図である。606,607、608、609、610は命令デコード部6に含まれる比較器であり、611、612、613、614は命令デコード部6に含まれるゲート(論理積)であるが、説明に好都合のため図12に示した。比較器606は命令の最上位2ビットをデコードして、命令が特殊命令であるかどうかを判定する。特殊命令である場合にはspecial信号をアサートする。比較器607、608、609、610は命令の続く上位6ビットをデコードして、命令がサスペンド命令(SuspendThread)、レジューム命令(ResumeThread)、トリガ待ちサスペンド命令(WaitTrigger),トリガ発生命令(EmitTrigger)であるかどうかを判定し、それぞれの出力信号をゲート611、612、613、614によりspecial信号と論理積をとることにより、それぞれSUSP信号、RESU信号、WAIT信号、EMIT信号を生成する。   The second selection permission signal generation unit 9 is configured to permit the second selection permission to the program counter selection signal generation unit 10 based on the instruction decoding result by the instruction decoding unit 4 and the program counter selection signal from the program counter selection signal generation unit 10. Generate a signal. FIG. 12 is a block diagram showing an internal configuration of the second selection permission signal generation unit 9. Reference numerals 606, 607, 608, 609, and 610 are comparators included in the instruction decode unit 6, and 611, 612, 613, and 614 are gates (logical products) included in the instruction decode unit 6. Therefore, it is shown in FIG. Comparator 606 decodes the most significant 2 bits of the instruction to determine whether the instruction is a special instruction. If it is a special instruction, the special signal is asserted. Comparators 607, 608, 609, and 610 decode the upper 6 bits following the instruction, and the instruction is a suspend instruction (SuspendThread), a resume instruction (ResumeThread), a trigger wait suspend instruction (WaitTrigger), or a trigger generation instruction (EmitTrigger). It is determined whether each output signal is present, and each output signal is ANDed with a special signal by gates 611, 612, 613, and 614, thereby generating a SUSP signal, a RESU signal, a WAIT signal, and an EMI signal, respectively.

命令のビット23から8は、サスペンド命令またはレジューム命令の場合に、どのプログラムカウンタをサスペンドまたはレジュームさせるかを示す識別子であり、本実施の形態の場合は3個のプログラムカウンタを備えるので、ビット10から8が有効となる。ビット8(Inst[8])、ビット9(Inst[9])、ビット10(Inst[10])は、それぞれプログラムカウンタPC(0)、PC(1)、PC(2)に対応する。   Bits 23 to 8 of the instruction are identifiers indicating which program counter is to be suspended or resumed in the case of a suspend instruction or a resume instruction. In the present embodiment, since three program counters are provided, bit 10 To 8 are valid. Bit 8 (Inst [8]), bit 9 (Inst [9]), and bit 10 (Inst [10]) correspond to the program counters PC (0), PC (1), and PC (2), respectively.

以下にサスペンド命令およびレジューム命令により選択許可信号を生成するロジックを解説する。   The logic for generating the selection permission signal by the suspend instruction and the resume instruction is explained below.

フリップフロップ9-1はPC(0)の動作状態(実行状態か、サスペンド状態か)を保持しており、リセット時の初期値は'1'、すなわち実行状態を示す。サスペンド命令が実行され(SUSP='1')、かつプログラムカウンタ識別子がPC(0)を示している場合(Inst[8]='1')、ゲート9-2の論理積出力が'1'となり、これがフリップフロップ9-1のクリア端子を駆動してフリップフロップ9-1の出力が'0'となる。すなわち、プログラムカウンタPC(0)をサスペンド状態とする一要因を生成する。   The flip-flop 9-1 holds the operation state (execution state or suspend state) of PC (0), and the initial value at the time of reset is “1”, that is, indicates the execution state. When the suspend instruction is executed (SUSP = '1') and the program counter identifier indicates PC (0) (Inst [8] = '1'), the logical product output of the gate 9-2 is '1'. This drives the clear terminal of the flip-flop 9-1, and the output of the flip-flop 9-1 becomes '0'. That is, one factor for causing the program counter PC (0) to be in the suspended state is generated.

一方、レジューム命令が実行され(RESU='1')、かつプログラムカウンタ識別子がPC(0)を示している場合(Inst[8]='1')、ゲート903の論理積出力が'1'となり、これがフリップフロップ9-1のセット端子を駆動してフリップフロップ9-1の出力が'1'となる。すなわち、プログラムカウンタPC(0)を実行状態とする一要因を生成する。   On the other hand, when the resume instruction is executed (RESU = '1') and the program counter identifier indicates PC (0) (Inst [8] = '1'), the logical product output of the gate 903 is '1'. This drives the set terminal of the flip-flop 9-1, and the output of the flip-flop 9-1 becomes "1". That is, one factor that causes the program counter PC (0) to be executed is generated.

同様に、フリップフロップ904はSUSP信号およびRESU信号とInst[9]の値に応じて、ゲート905、906によりセットまたはリセットされて、プログラムカウンタPC(1)の実行状態を制御する。   Similarly, the flip-flop 904 is set or reset by the gates 905 and 906 according to the value of SUSP signal and RESU signal and Inst [9], and controls the execution state of the program counter PC (1).

全く同様に、フリップフロップ907はSUSP信号およびRESU信号とInst[10]の値に応じて、ゲート908、909によりセットまたはリセットされて、プログラムカウンタPC(2)の実行状態を制御する。   In exactly the same manner, the flip-flop 907 is set or reset by the gates 908 and 909 in accordance with the SUSP signal and the RESU signal and the value of Inst [10] to control the execution state of the program counter PC (2).

次に、トリガ待ちサスペンド命令およびトリガ発生命令により選択許可信号を生成するロジックを解説する。   Next, the logic for generating the selection permission signal by the trigger wait suspend instruction and the trigger generation instruction will be described.

フリップフロップ群910はトリガ発生命令によるトリガ発生の履歴を保持する8ビットのフリップフロップからなり、リセット時の初期値は"00000000"である。トリガ発生命令が実行されると(EMIT='1')、ゲート911により、すでにトリガを保持している場合はそのままの値を保ち、トリガを保持していない場合はトリガ識別子であるInst[23:16]をロードする。   The flip-flop group 910 is composed of 8-bit flip-flops that hold a history of trigger generation by a trigger generation instruction, and the initial value at reset is “00000000”. When the trigger generation instruction is executed (EMIT = '1'), the gate 911 maintains the value as it is when the trigger is already held, and the trigger identifier Inst [23 when the trigger is not held. : 16] is loaded.

フリップフロップ912はPC(0)の動作状態(実行状態か、サスペンド状態か)を保持しており、リセット時の初期値は'1'、すなわち実行状態を示す。トリガ待ちサスペンド命令が実行され(WAIT='1')、プログラムカウンタ選択信号生成部10からのプログラムカウンタ選択信号がPC(0)を示している場合(pc_sel[0]='1')、ゲート913の論理積出力が'1'となる。さらに、フリップフロップ群910の保持するトリガ履歴とトリガ待ちサスペンド命令の待ち受けトリガ識別子Inst[23:16]がゲート914および915により比較され、1ビットも共に'1'であるビットがない場合は(ゲート915の出力='0')、トリガ待ちサスペンド命令実行以前にトリガが発行されていないと判定され、ゲート916によってフリップフロップ912のクリア信号が生成される。この結果、フリップフロップ912の出力が'0'となり、プログラムカウンタPC(0)をサスペンド状態とする一要因を生成する。この時、フリップフロップ群917にはトリガ待ちサスペンド命令の待ち受けトリガ識別子Inst[23:16]がロードされる。なお、フリップフロップ群917のリセット時の初期値は"00000000"である。ゲート914および915により比較された結果、1ビットでも共に'1'であるビットがある場合は、トリガ待ちサスペンド命令実行以前にトリガが発行されたと判定され、フリップフロップ912をクリアしない。すなわち、サスペンド状態には遷移しない(請求項2に対応)。   The flip-flop 912 holds the operation state (execution state or suspend state) of PC (0), and the initial value at the time of reset is “1”, that is, indicates the execution state. When the trigger wait suspend instruction is executed (WAIT = '1') and the program counter selection signal from the program counter selection signal generator 10 indicates PC (0) (pc_sel [0] = '1'), the gate The logical product output of 913 becomes “1”. Further, the trigger history held by the flip-flop group 910 and the standby trigger identifier Inst [23:16] of the trigger wait suspend instruction are compared by the gates 914 and 915, and if there is no bit that is both “1” ( The output of the gate 915 = “0”), it is determined that a trigger has not been issued before the execution of the trigger wait suspend instruction, and a clear signal for the flip-flop 912 is generated by the gate 916. As a result, the output of the flip-flop 912 becomes “0”, and one factor that causes the program counter PC (0) to be in the suspended state is generated. At this time, the wait trigger identifier Inst [23:16] of the trigger wait suspend instruction is loaded into the flip-flop group 917. Note that the initial value when the flip-flop group 917 is reset is “00000000”. As a result of comparison by the gates 914 and 915, if there is a bit that is both “1”, it is determined that the trigger has been issued before the trigger wait suspend instruction is executed, and the flip-flop 912 is not cleared. That is, no transition is made to the suspended state (corresponding to claim 2).

さて、トリガ発生命令が実行されると(EMIT='1')、トリガ識別子であるInst[23:16]と待ち受けトリガであるフリップフロップ群917の出力がゲート918および919により比較され、1ビットでも共に'1'のビットがあるならばゲート920の出力が'1'となる。この時、フリップフロップ912の出力が'0'すなわちプログラムカウンタPC(0)がサスペンド状態にある場合、ゲート921によりフリップフロップ912がセットされ、プログラムカウンタPC(0)を実行状態とする一要因を生成する。この時、同時に、フリップフロップ群910をクリアし、トリガ履歴をリセットする。   When the trigger generation instruction is executed (EMIT = '1'), the output of the trigger identifier Inst [23:16] and the flip-flop group 917 as the standby trigger is compared by the gates 918 and 919, and 1 bit is obtained. However, if there are both “1” bits, the output of the gate 920 becomes “1”. At this time, if the output of the flip-flop 912 is “0”, that is, the program counter PC (0) is in the suspended state, the flip-flop 912 is set by the gate 921 and one factor for causing the program counter PC (0) to be in the execution state. Generate. At the same time, the flip-flop group 910 is cleared and the trigger history is reset.

プログラムカウンタPC(1)およびPC(2)に関しても、PC(0)と全く同様に作用し、プログラムカウンタを実行状態とする一要因が生成される。PC(0)における910から921が、PC(1)における922から934にそれぞれ対応し、また、PC(2)における934から945にそれぞれ対応する。   The program counters PC (1) and PC (2) operate in exactly the same way as PC (0), and one factor is generated that causes the program counter to be in an execution state. 910 to 921 in PC (0) correspond to 922 to 934 in PC (1), respectively, and correspond to 934 to 945 in PC (2), respectively.

フリップフロップ901、904、907によって生成される、各々のプログラムカウンタの実行状態を制御する信号と、それぞれフリップフロップ912、924、936によって生成される、各々のプログラムカウンタの実行状態を制御する信号との論理積がゲート947、948、949により生成され、第2選択許可信号pc_en2[2:0]を形成し、プログラム選択信号生成部10へ出力される。   A signal that controls the execution state of each program counter generated by the flip-flops 901, 904, and 907, and a signal that controls the execution state of each program counter generated by the flip-flops 912, 924, and 936, respectively. Are generated by the gates 947, 948, and 949 to form the second selection permission signal pc_en2 [2: 0] and output to the program selection signal generator 10.

以上に説明した各ブロックの動作説明に基づいて、本実施の形態のダイレクトメモリアクセス装置の全体的な動作を説明する。   Based on the operation description of each block described above, the overall operation of the direct memory access device of the present embodiment will be described.

まず、サスペンド、レジューム操作を伴わない一般的なダイレクトメモリアクセス動作例を、図13に示すタイミング図を用いて説明する。基本的にプログラムカウンタPC(0)の示すプログラム(0x03番地および0x05番地の命令)がダイレクトメモリアクセスデバイス101のデータ転送を行い、プログラムカウンタPC(1)の示すプログラム(0x12番地および0x16番地の命令)がダイレクトメモリアクセスデバイス102のデータ転送を行うように設定されている。   First, an example of a general direct memory access operation that does not involve suspend and resume operations will be described with reference to a timing chart shown in FIG. Basically, the program indicated by the program counter PC (0) (instructions at addresses 0x03 and 0x05) transfers data to the direct memory access device 101, and the program indicated by the program counter PC (1) (instructions at addresses 0x12 and 0x16) ) Is set to perform data transfer of the direct memory access device 102.

クロックサイクル0はreset信号がアサート("1")されており、リセット状態である。リセット状態においては、プログラムカウンタ選択信号pc_selは"001"を出力し、プログラムカウンタ選択許可信号pc_enは"111"を出力している。また、プログラムカウンタの初期値はPC(0)=0x0、PC(1)=0x10、PC(2)=0x20である。クロックサイクル1においてリセットが解除され、まずプログラムカウンタPC(0)が選択され(selected PC = PC(0))、命令が実行される。クロックサイクル2ではpc_selが"010"となりPC(1)が選択され、クロックサイクル3ではpc_selが"100"となりPC(2)が選択される。このように順次PC(0)→PC(1)→PC(2)→PC(0)が選択されて命令が実行される。クロックサイクル4ではダイレクトメモリアクセスデバイス102のデータ転送要求DMAReq1がアサート("1")されるが、当該デバイスに対するデータ転送命令が実行されないため転送応答信号DMAAck1はアサートされない。クロックサイクル6においてPC(1)は0x12となり、このプログラムカウンタがダイレクトメモリアクセスデバイス102へのデータ転送命令を示している。実際に実行されるのは次にpc_selが"010"になるクロックサイクル8であり、このサイクルにおいてDMAAck1がアサートされる。   In clock cycle 0, the reset signal is asserted ("1") and is in a reset state. In the reset state, the program counter selection signal pc_sel outputs “001”, and the program counter selection permission signal pc_en outputs “111”. The initial values of the program counter are PC (0) = 0x0, PC (1) = 0x10, and PC (2) = 0x20. In clock cycle 1, the reset is released. First, the program counter PC (0) is selected (selected PC = PC (0)), and the instruction is executed. In clock cycle 2, pc_sel becomes “010” and PC (1) is selected, and in clock cycle 3, pc_sel becomes “100” and PC (2) is selected. In this way, PC (0) → PC (1) → PC (2) → PC (0) is sequentially selected and the instruction is executed. In clock cycle 4, the data transfer request DMAReq1 of the direct memory access device 102 is asserted ("1"). However, since the data transfer command for the device is not executed, the transfer response signal DMAAck1 is not asserted. In clock cycle 6, PC (1) becomes 0x12, and this program counter indicates a data transfer instruction to the direct memory access device 102. What is actually executed is clock cycle 8 in which pc_sel becomes “010” next, and DMAAck1 is asserted in this cycle.

一方、クロックサイクル10においてプログラムカウンタPC(0)が示すダイレクトメモリアクセスデバイス101へのデータ転送命令が発行されるが、当該サイクルにおいてDMAReq0がアサートされていないため、プログラムカウンタPC(0)の示す命令は実行を抑制される。すなわちpc_enの値は"110"となりPC(0)は0x03を示したまま更新されない。DMAReq0がアサートされるクロックサイクル14までの間、プログラムカウンタPC(1),PC(2)の示すプログラムが順に実行される。クロックサイクル14においてDMAReq0がアサートされるとpc_enは"111"に更新され、クロックサイクル15においてPC(0)が選択され実行される。すなわち転送応答信号DMAAck0がアサートされてデータ転送が完了する。   On the other hand, a data transfer instruction to the direct memory access device 101 indicated by the program counter PC (0) is issued in the clock cycle 10, but since DMAReq0 is not asserted in this cycle, the instruction indicated by the program counter PC (0) Execution is suppressed. That is, the value of pc_en is “110”, and PC (0) remains 0x03 and is not updated. Until the clock cycle 14 in which DMAReq0 is asserted, the programs indicated by the program counters PC (1) and PC (2) are executed in order. When DMAReq0 is asserted in clock cycle 14, pc_en is updated to "111", and PC (0) is selected and executed in clock cycle 15. That is, the transfer response signal DMAAck0 is asserted to complete the data transfer.

クロックサイクル19においてはPC(1)=0x16の示すデータ転送命令が発行されるが、当該サイクルにおいてDMAReq1がアサートされていないためpc_enは"101"となりPC(0),PC(2)の示す命令が順に実行される状態となる。PC(1)の実行が抑制されている間のクロックサイクル21においてPC(0)=0x05の示すデータ転送命令が発行されるが、当該サイクルにおいてはDMAReq0がすでにアサート状態のため直ちに実行され、DMAAck0がアサートされる。クロックサイクル23においてDAMReq1がアサートされるとpc_enは"111"に復帰し、クロックサイクル24においてデータ転送命令が実行されDMAAck1がアサートされる。   In clock cycle 19, a data transfer instruction indicated by PC (1) = 0x16 is issued, but since DMAReq1 is not asserted in this cycle, pc_en becomes "101" and instructions indicated by PC (0) and PC (2) Are sequentially executed. In clock cycle 21 while execution of PC (1) is suppressed, a data transfer instruction indicated by PC (0) = 0x05 is issued. In this cycle, DMAReq0 is already executed because it is already asserted, and DMAAck0 Is asserted. When DAMReq1 is asserted in clock cycle 23, pc_en returns to "111", a data transfer instruction is executed in clock cycle 24, and DMAAck1 is asserted.

以上の説明により、容易に理解できることは、各ダイレクトメモリアクセスデバイスのデータ転送要求レートが2サイクルだった場合、2つのプログラムカウンタをイネーブルにしておけば、毎クロックサイクルデータ転送が可能である。すなわち、命令デコード部やデータ転送実行部の回路は共通しながらインターリーブ的にダイレクトメモリアクセスデバイスとのデータ転送を行えるため、回路規模を大きくすることなく効率のよいデータ転送を行うことが可能である。しかも、2つのダイレクトメモリアクセスのメモリアドレスの生成パターンを全く異なるものに設定することが可能であるため、非常に柔軟なデータ転送が可能である。例えば、一方のプログラムカウンタでx方向の画像データ参照を行い、もう一方のプログラムカウンタでy方向のデータ参照を行うようにすればデータ処理を行いながら回転操作を行うことも可能である。   As can be easily understood from the above description, when the data transfer request rate of each direct memory access device is two cycles, data transfer can be performed every clock cycle if two program counters are enabled. In other words, since the instruction decode unit and the data transfer execution unit can share data with the direct memory access device in an interleaved manner, it is possible to perform efficient data transfer without increasing the circuit scale. . In addition, since the memory address generation patterns of the two direct memory accesses can be set to be completely different, very flexible data transfer is possible. For example, if one program counter refers to image data in the x direction and the other program counter refers to data in the y direction, the rotation operation can be performed while performing data processing.

次に、サスペンド、レジューム操作に着目した動作例を、図14に示すタイミング図を用いて説明する。   Next, an operation example focusing on the suspend and resume operations will be described with reference to the timing chart shown in FIG.

サイクル0からサイクル7までの動作は、データ転送要求DMAReq1がアサートされていない点を除いて図13に示した動作と同等である。サイクル8において、プログラムカウンタPC(1)の実行する命令はPC(0)を対象としたサスペンド命令(SUSP0)である。この結果、サイクル9においてpc_enは"111"から"110"に遷移する。そして、サイクル10において、pc_enが"111"であれば実行されるはずであったPC(0)は実行されず、代わりにPC(1)の命令が実行される。サイクル12において、プログラムカウンタPC(1)はPC(0)をレジュームする命令(RESU0)を実行する。この結果、サイクル13においてpc_enは"110"から"111"に遷移し、サイクル14においてサスペンドされていたPC(0)の命令が実行される。   The operations from cycle 0 to cycle 7 are the same as the operations shown in FIG. 13 except that the data transfer request DMAReq1 is not asserted. In cycle 8, the instruction executed by the program counter PC (1) is a suspend instruction (SUSP0) for PC (0). As a result, in cycle 9, pc_en transits from “111” to “110”. Then, in cycle 10, if PC_en is "111", PC (0) that should have been executed is not executed, but the instruction of PC (1) is executed instead. In cycle 12, the program counter PC (1) executes an instruction (RESU0) for resuming PC (0). As a result, pc_en transits from “110” to “111” in cycle 13, and the instruction of PC (0) suspended in cycle 14 is executed.

次に、サイクル16においてプログラムカウンタPC(2)はトリガ識別子1を待って自らをサスペンドする命令、すなわちトリガ待ちサスペンド命令(WAIT1)を実行する。この結果、サイクル17においてpc_enは"111"から"011"に遷移する。そして、サイクル19において、pc_enが"111"であれば実行されるはずであったPC(2)は実行されず、代わりにPC(0)の命令が実行される。このサイクル19において実行されるPC(0)の命令は、トリガ識別子1のトリガを発生するトリガ発生命令(EMIT1)である。この結果、サイクル20においてpc_enは"011"から"111"に遷移する。そして、サイクル21において、サスペンドされていたPC(2)の命令が実行される。   Next, in cycle 16, the program counter PC (2) waits for the trigger identifier 1 and executes an instruction to suspend itself, that is, a trigger wait suspend instruction (WAIT1). As a result, in cycle 17, pc_en transits from “111” to “011”. Then, in cycle 19, if PC_en is "111", PC (2) that should have been executed is not executed, but the instruction of PC (0) is executed instead. The instruction of PC (0) executed in this cycle 19 is a trigger generation instruction (EMIT1) that generates a trigger with a trigger identifier 1. As a result, in cycle 20, pc_en transitions from “011” to “111”. Then, in cycle 21, the suspended instruction of PC (2) is executed.

さらに、サイクル22においてPC(0)の実行する命令は、トリガ識別子2のトリガを発生するトリガ発生命令(EMIT2)である。この時点でトリガ待ちサスペンド命令によってサスペンドしているプログラムカウンタは存在しないため、前記第2選択許可信号生成部9内のフリップフロップ群910、922,934に"00000100"がロードされる。サイクル24において、プログラムカウンタPC(2)はトリガ識別子2を待って自らをサスペンドする命令、すなわちトリガ待ちサスペンド命令(WAIT2)を実行するが、トリガ待ちサスペンド命令に先立って(サイクル22)、同一トリガ識別子のトリガ発生命令が実行されているため、サイクル24におけるトリガ待ちサスペンド命令(WAIT2)は無効化され、pc_enは"111"のまま変化しない。その結果、サイクル27においてプログラムカウンタPC(2)の命令は順番通りに実行される。   Further, the instruction executed by PC (0) in cycle 22 is a trigger generation instruction (EMIT2) that generates a trigger with trigger identifier 2. Since there is no program counter suspended by the trigger wait suspend instruction at this time, “00000100” is loaded to the flip-flop groups 910, 922, and 934 in the second selection permission signal generation unit 9. In the cycle 24, the program counter PC (2) waits for the trigger identifier 2 and executes an instruction to suspend itself, that is, a trigger wait suspend instruction (WAIT2). Prior to the trigger wait suspend instruction (cycle 22), Since the identifier trigger generation instruction is executed, the trigger wait suspend instruction (WAIT2) in cycle 24 is invalidated, and pc_en remains "111". As a result, in the cycle 27, the instructions of the program counter PC (2) are executed in order.

本説明から容易に理解されるように、1つのトリガ発生命令は、トリガ待ちサスペンド命令によってサスペンド状態にある2つ以上のプログラムカウンタをレジュームすることも可能である。   As can be easily understood from this description, one trigger generation instruction can resume two or more program counters in a suspended state by a trigger wait suspend instruction.

(具体例)
本実施の形態のダイレクトメモリアクセス装置の応用への適用例として、JPEGエンコーダ装置のブロック図を図15に示す。ダイレクトメモリアクセスデバイスの実際例としてJPEGエンコーダモジュール13が適用されている。エンコーダモジュール13の入力部にDMAポート701が接続され、出力部にDMAポート702が接続されている。また、CPUバス上にメモリマップされたストレージ14が接続され、JPEG圧縮されたデータを格納することができる。このような構成の場合、プログラムカウンタPC(0)はメモリ2から画像データを読み出してJPEGエンコーダ13に入力するためのシーケンスを実行する。JPEGエンコーダ13は、入力された画像データをJPEG圧縮し、入力データのデータレートとは異なるデータレートを持った圧縮された符号データを生成し、データ転送要求をアサートする。この要求に応じてプログラムカウンタPC(1)が起動され、符号データをメモリ2に転送する。ストレージ14のアクセススピードはメモリ2に比べて遅い場合があるので、プログラムカウンタPC(2)により制御されるシーケンスは、符号データを、ダブルバッファを用いてバックグラウンドでストレージ14に転送する。このような動作においては、プログラムカウンタPC(0)は、メモリ上の画像データを8x8のブロック単位でロードアクセスし、プログラムカウンタPC(1)は、符号データを連続アドレスにストアアクセスし、プログラムカウンタPC(2)は、符号データを連続アドレスからロードアクセスしてストレージのデータポートである固定アドレスにストアアクセスする。
(Concrete example)
As an application example of the direct memory access device of this embodiment, a block diagram of a JPEG encoder device is shown in FIG. The JPEG encoder module 13 is applied as an actual example of the direct memory access device. A DMA port 701 is connected to the input section of the encoder module 13, and a DMA port 702 is connected to the output section. A memory-mapped storage 14 is connected to the CPU bus, and JPEG compressed data can be stored. In the case of such a configuration, the program counter PC (0) executes a sequence for reading image data from the memory 2 and inputting it to the JPEG encoder 13. The JPEG encoder 13 compresses input image data by JPEG, generates compressed code data having a data rate different from the data rate of the input data, and asserts a data transfer request. In response to this request, the program counter PC (1) is activated to transfer the code data to the memory 2. Since the access speed of the storage 14 may be slower than the memory 2, the sequence controlled by the program counter PC (2) transfers the code data to the storage 14 in the background using a double buffer. In such an operation, the program counter PC (0) loads and accesses the image data on the memory in units of 8 × 8 blocks, and the program counter PC (1) stores and accesses the code data to the continuous address, and the program counter The PC (2) loads and accesses the code data from the continuous address, and stores and accesses the fixed address which is the storage data port.

以上のようなデータ転送において重要なことは、データ転送間の同期である。例えば、プログラムカウンタPC(2)により制御されるシーケンス(メモリ2上の符号データのストレージ14への転送)は、プログラムカウンタPC(1)により制御されるシーケンス(生成された符号データのメモリ2上への転送)を追い越すことはできない。すなわち、生成されたデータ以上のデータをストレージに転送することがあってはならない。逆に、プログラムカウンタPC(1)により制御されるシーケンス(生成された符号データのメモリ2上への転送)は、確保されているメモリ領域の空き容量以上にデータを生成・転送してはならない。つまり、ストレージに転送されていないメモリ領域に符号データを生成・転送することがあってはならない。   What is important in data transfer as described above is the synchronization between data transfers. For example, the sequence controlled by the program counter PC (2) (transfer of the code data on the memory 2 to the storage 14) is controlled by the sequence controlled by the program counter PC (1) (the generated code data on the memory 2). Cannot be overtaken). In other words, data greater than the generated data should not be transferred to the storage. Conversely, the sequence controlled by the program counter PC (1) (transfer of the generated code data to the memory 2) must not generate / transfer data beyond the free capacity of the reserved memory area. . That is, code data should not be generated / transferred to a memory area that has not been transferred to the storage.

図16は、上述したダブルバッファの同期制御を、トリガ待ちサスペンド命令とトリガ発生命令により実現するための、プログラムカウンタPC(0)、PC(1)およびPC(2)のシーケンス図である。なお、プログラムカウンタPC(0)に関しては、プログラムカウンタPC(1)がサスペンドすることにより符号データ出力部が停止すると、JPEGエンコーダ13の画像データ入力部のデータ転送要求信号がアサートされないため、信号生成部8の作用により自動的にプログラムカウンタがサスペンドする。本動作の説明はシーケンス図からは省いた。   FIG. 16 is a sequence diagram of the program counters PC (0), PC (1), and PC (2) for realizing the above-described double buffer synchronization control by the trigger wait suspend instruction and the trigger generation instruction. As for the program counter PC (0), if the code data output unit is stopped by suspending the program counter PC (1), the data transfer request signal of the image data input unit of the JPEG encoder 13 is not asserted, so that signal generation is performed. The program counter is automatically suspended by the action of the unit 8. The description of this operation is omitted from the sequence diagram.

まず、デフォルトのプログラムカウンタであるPC(0)が起動し、プログラムカウンタPC(1)をイネーブルにする(ENABLE PC1)。次に、メモリ上の画像データをJPEGエンコーダ13に転送するダイレクトメモリアクセス転送をデータ転送要求信号に応じて実行する(シーケンス図中(1))。   First, the default program counter PC (0) is activated, and the program counter PC (1) is enabled (ENABLE PC1). Next, direct memory access transfer for transferring the image data on the memory to the JPEG encoder 13 is executed according to the data transfer request signal ((1) in the sequence diagram).

起動されたプログラムカウンタPC(1)はJPEGエンコーダ13の生成する符号データをデータ転送要求信号に応じてメモリ領域Aに転送する(シーケンス図中(2))。メモリ領域Aへのデータ転送が完了すると、プログラムカウンタPC(2)をイネーブルにし(ENABLE PC2)、引き続きJPEGエンコーダ13の生成する符号データをデータ転送要求信号に応じてメモリ領域Bに転送する(シーケンス図中(3))。   The activated program counter PC (1) transfers the code data generated by the JPEG encoder 13 to the memory area A according to the data transfer request signal ((2) in the sequence diagram). When the data transfer to the memory area A is completed, the program counter PC (2) is enabled (ENABLE PC2), and the code data generated by the JPEG encoder 13 is subsequently transferred to the memory area B in response to the data transfer request signal (sequence). (3) in the figure).

プログラムカウンタPC(2)は起動されると、メモリ領域A上の符号データをストレージ14に転送開始する(シーケンス図中(4))。プログラムカウンタPC(1)は符号データをメモリ領域Bに転送完了すると、トリガ識別子0のトリガ発生命令を発行する(EMIT0)。この時点で、トリガ待ちサスペンド状態にあるプログラムカウンタは存在しない。プログラムカウンタPC(1)は引き続きトリガ識別子1のトリガ待ちサスペンド命令を発行し(WAIT1)、自らサスペンド状態に遷移する。   When the program counter PC (2) is activated, it starts to transfer the code data in the memory area A to the storage 14 ((4) in the sequence diagram). When the program counter PC (1) completes the transfer of the code data to the memory area B, it issues a trigger generation instruction with the trigger identifier 0 (EMIT0). At this point, there is no program counter in the trigger wait suspend state. The program counter PC (1) continues to issue a trigger wait suspend instruction with a trigger identifier 1 (WAIT1) and transitions to the suspend state itself.

プログラムカウンタPC(2)はメモリ領域A上の符号データをストレージ14に転送し終わると、トリガ識別子1のトリガ発生命令を発行し(EMIT1)、続いてトリガ識別子0のトリガ待ちサスペンド命令を発行し(WAIT0)、自らサスペンド状態に遷移しようとするが、すでにトリガ識別子0のトリガ発生命令がプログラムカウンタPC(1)により発行されているため、サスペンドはキャンセルされ、引き続きメモリ領域B上の符号データをストレージ14に転送開始する(シーケンス図中(5))。   When the program counter PC (2) finishes transferring the code data in the memory area A to the storage 14, it issues a trigger generation command for trigger identifier 1 (EMIT1), and then issues a trigger wait suspend command for trigger identifier 0. (WAIT0) tries to transition to the suspend state by itself, but since the trigger generation instruction with the trigger identifier 0 has already been issued by the program counter PC (1), the suspend is canceled and the code data in the memory area B is continuously stored. Transfer to the storage 14 is started ((5) in the sequence diagram).

プログラムカウンタPC(2)の発行したトリガ識別子1のトリガにより、サスペンド中のプログラムカウンタPC(1)はレジュームし、JPEGエンコーダ13の生成する符号データをデータ転送要求信号に応じてメモリ領域Aに転送する(シーケンス図中(6))。プログラムカウンタPC(2)は、メモリ領域Bの符号データをストレージ14に転送し終わると、トリガ識別子1のトリガ発生命令を発行し(EMIT1)、続いてトリガ識別子0のトリガ待ちサスペンド命令を発行し(WAIT0)、自らサスペンド状態に遷移する。   The suspended program counter PC (1) is resumed by the trigger of the trigger identifier 1 issued by the program counter PC (2), and the code data generated by the JPEG encoder 13 is transferred to the memory area A according to the data transfer request signal. (Sequence diagram (6)). When the program counter PC (2) finishes transferring the code data in the memory area B to the storage 14, the program counter PC (2) issues a trigger generation instruction for the trigger identifier 1 (EMIT1), and then issues a trigger wait suspend instruction for the trigger identifier 0. (WAIT0) transitions to the suspend state by itself.

プログラムカウンタPC(1)は、JPEGエンコーダ13の生成する符号データをデータ転送要求信号に応じてメモリ領域Aに転送し終わると、トリガ識別子0のトリガ発生命令を発行し(EMIT0)、続いてトリガ識別子1のトリガ待ちサスペンド命令を発行し(WAIT1)、自らサスペンド状態に遷移しようとするが、すでにトリガ識別子1のトリガ発生命令がプログラムカウンタPC(2)により発行されているため、サスペンドはキャンセルされ、引き続きJPEGエンコーダ13の生成する符号データをデータ転送要求信号に応じてメモリ領域Bに転送開始する(シーケンス図中(7))。   When the program counter PC (1) finishes transferring the code data generated by the JPEG encoder 13 to the memory area A in response to the data transfer request signal, the program counter PC (1) issues a trigger generation instruction for the trigger identifier 0 (EMIT0), and then triggers The trigger wait suspend instruction with identifier 1 is issued (WAIT1), and it tries to transition to the suspend state by itself, but the suspend is canceled because the trigger generation instruction with trigger identifier 1 has already been issued by the program counter PC (2). Subsequently, transfer of the code data generated by the JPEG encoder 13 to the memory area B is started in response to the data transfer request signal ((7) in the sequence diagram).

プログラムカウンタPC(1)の発行したトリガ識別子0のトリガにより、サスペンド中のプログラムカウンタPC(2)はレジュームし、メモリ領域A上の符号データをストレージ14に転送開始する(シーケンス図中(8))。   The suspended program counter PC (2) is resumed by the trigger with the trigger identifier 0 issued by the program counter PC (1), and the transfer of the code data in the memory area A to the storage 14 is started ((8) in the sequence diagram). ).

以下同様に、プログラムカウンタPC(1)によるメモリ領域Aへの転送(シーケンス図中(9))、プログラムカウンタPC(2)によるメモリ領域Bからの転送(シーケンス図中(10))のように、順次メモリ領域AおよびBを交互に同期を取りながらアクセスする。   Similarly, transfer to the memory area A by the program counter PC (1) ((9) in the sequence diagram) and transfer from the memory area B by the program counter PC (2) ((10) in the sequence diagram) The memory areas A and B are sequentially accessed while being alternately synchronized.

本シーケンス図の例においては、符号データのメモリ領域への転送時間は、入力画像データに依存するためにまちまちであり、一方、ストレージへの転送時間もストレージのステータスに依存してまちまちであるため、2つの転送のどちらが早く終了するかは不確定である。このような例においても、本装置を適用することにより、非常に簡便にダブルバッファを用いて同期を取りながらデータ転送を行うことが可能となる。   In the example of this sequence diagram, the transfer time of the code data to the memory area varies depending on the input image data, and on the other hand, the transfer time to the storage also varies depending on the status of the storage. It is uncertain which of the two transfers will end earlier. Even in such an example, by applying the present apparatus, it is possible to transfer data while using the double buffer to synchronize very easily.

以上のように、それぞれ異なるデータレートとアクセスパターンをもつ3種類のデータ転送を、それぞれのデータ転送要求に応じて並列的に同期を取りながら実行することができる。また、命令デコード部やデータ転送実行部は時分割的に動作させることができるため、効率的かつ複雑なアクセスパターンのデータ転送を、比較的少ない回路規模によって実現することが可能となる。   As described above, three types of data transfer each having a different data rate and access pattern can be executed while being synchronized in parallel according to each data transfer request. In addition, since the instruction decoding unit and the data transfer execution unit can be operated in a time-sharing manner, it is possible to realize efficient and complicated data transfer with an access pattern with a relatively small circuit scale.

なお、上記実施形態では、DMA装置に3つのプログラムカウンタを設けたが、本発明はこれに限定されるものではなく、2つまたは4つ以上のプログラムカウンタを設けたDMA装置も本発明の範疇に含まれうる。ただし、DMAポートの数以上のプログラムカウンタが設けられていることが望ましい。   In the above embodiment, three program counters are provided in the DMA device. However, the present invention is not limited to this, and a DMA device provided with two or four or more program counters falls within the scope of the present invention. Can be included. However, it is desirable to provide more program counters than the number of DMA ports.

101、102・・・ダイレクトメモリアクセスデバイス
2・・・メモリ
301、302、303・・・プログラムカウンタ
4・・・プログラムカウンタ選択部
5・・・命令メモリ
6・・・命令デコード部
601、602、603、604、605、606、607、608、609、610・・・比較器
611、612、613、614・・・ゲート
7・・・データ転送実行部
8・・・実行抑制・選択許可信号生成部
801・・・命令デコード部の出力から転送元または先を検出するブロック
802・・・ダイレクトメモリアクセスデバイスからのデータ転送要求を検出するブロック
803・・・デバイスがデータ転送要求を出していることを判定するブロック
804・・・データ転送実行部のデータ転送を抑制する信号を出力するブロック
805・・・プログラムカウンタを非選択とするための信号を生成するブロック
811、812、813、814・・・ゲート
821、822、823、824・・・ゲート
831、832、833、834・・・ゲート
841・・・ゲート
851、852、853、854・・・ゲート
855、856、857、858・・・フリップフロップ
8591、8592、8593・・・ゲート
9・・・第2選択許可信号生成部
901、9-4、9-7、912、924、936・・・フリップフロップ
910、917、922、929、934、941・・・フリップフロップ群
902、903、905、906、908、909・・・ゲート
911、913、914、915、916、918、919、920、921・・・ゲート
923、925、926、927、928、930、931、932、933・・・ゲート
935、937、938、939、940、942、943、944、945・・・ゲート
946、947、948・・・ゲート
10・・・プログラムカウンタ選択信号生成部
1001、1002、1003・・・フリップフロップ
1004、1005、1006・・・セレクタ
1007・・・デコーダ
1008、1009、1010・・・ゲート
1100・・・プログラムカウンタ更新部
1101、1102・・・セレクタ
1103・・・+1加算器
12・・・CPU
13・・・JPEGエンコーダ
14・・・記憶装置
101, 102 ... Direct memory access device 2 ... Memory 301, 302, 303 ... Program counter 4 ... Program counter selection unit 5 ... Instruction memory 6 ... Instruction decode unit 601, 602, 603, 604, 605, 606, 607, 608, 609, 610... Comparators 611, 612, 613, 614... Gate 7... Data transfer execution unit 8. 801: Block for detecting the transfer source or destination from the output of the instruction decode unit 802: Block for detecting a data transfer request from the direct memory access device 803: The device issues a data transfer request Block 804... That outputs a signal for suppressing data transfer of the data transfer execution unit Block 805 ... Blocks for generating signals for deselecting the program counter 811, 812, 813, 814 ... Gates 821, 822, 823, 824 ... Gates 831, 832, 833, 834. ..Gate 841 ... Gates 851, 852, 853, 854 ... Gates 855, 856, 857, 858 ... Flip-flops 8591, 8592, 8593 ... Gate 9 ... Second selection permission signal generation Part 901, 9-4, 9-7, 912, 924, 936... Flip-flop 910, 917, 922, 929, 934, 941... Flip-flop group 902, 903, 905, 906, 908, 909 ..Gates 911, 913, 914, 915, 916, 918, 919, 920, 921 Gates 923, 925, 926, 927, 928, 930, 931, 932, 933 ... Gates 935, 937, 938, 939, 940, 942, 943, 944, 945 ... Gates 946, 947, 948,. Gate 10: Program counter selection signal generator 1001, 1002, 1003 ... Flip-flops 1004, 1005, 1006 ... Selector 1007 ... Decoder 1008, 1009, 1010 ... Gate 1100 ... Program Counter update unit 1101, 1102... Selector 1103... +1 adder 12.
13 ... JPEG encoder 14 ... Storage device

Claims (17)

ダイレクトメモリアクセス部とプロセッサ部とを有するダイレクトメモリアクセスシステムにおいて、
前記プロセッサ部は、
メモリと、
前記メモリから命令を読み出して実行することで、前記ダイレクトメモリアクセス部が実行する命令を当該ダイレクトメモリアクセス部に書き込むプロセッサとを備え、
前記ダイレクトメモリアクセス部は、
複数のプログラムカウンタと、
前記複数のプログラムカウンタを順に選択する選択手段と、
前記プロセッサによって書き込まれた命令を保持する命令保持手段と、
前記選択手段で選択されたプログラムカウンタにより示される前記命令保持手段のアドレスに格納されている前記命令を出力する出力手段と、
前記出力手段によって出力される命令に応じてダイレクトメモリアクセスによるデータ転送を実行する実行手段と
を備えていることを特徴とするダイレクトメモリアクセスシステム。
In a direct memory access system having a direct memory access unit and a processor unit,
The processor unit is
Memory,
A processor that reads and executes an instruction from the memory to write an instruction to be executed by the direct memory access unit to the direct memory access unit;
The direct memory access unit
Multiple program counters,
Selecting means for sequentially selecting the plurality of program counters;
Instruction holding means for holding an instruction written by the processor;
Output means for outputting the instruction stored at the address of the instruction holding means indicated by the program counter selected by the selection means;
And an execution means for executing data transfer by direct memory access in accordance with an instruction output by the output means.
前記出力手段によって前記命令保持手段から出力された命令に関するデバイスから当該命令に対応する要求が出力されていない場合、前記実行手段による前記命令の実行を抑制するとともに、対応する要求の出力されていない命令を示すプログラムカウンタの前記選択手段による選択を制限する制御手段を前記ダイレクトメモリアクセス部が更に備える
ことを特徴とする請求項1に記載のダイレクトメモリアクセスシステム。
When a request corresponding to the command is not output from the device related to the command output from the command holding unit by the output unit, execution of the command by the execution unit is suppressed and a corresponding request is not output 2. The direct memory access system according to claim 1, wherein the direct memory access unit further includes control means for restricting selection of the program counter indicating an instruction by the selection means.
前記制御手段は、前記出力手段によって前記命令保持手段から出力された命令の内容に対応した要求がデバイスから出力されている場合には、対応する要求が出力されている命令を保持するプログラムカウンタの前記選択手段による選択を許可し、前記出力された命令の内容に対応した要求がデバイスから出力されていない場合には、前記出力された命令の内容に対応した要求が前記デバイスから出力されるまで、該命令に対応するプログラムカウンタを前記選択手段が選択することを制限する
ことを特徴とする請求項2に記載のダイレクトメモリアクセスシステム。
When the request corresponding to the content of the instruction output from the instruction holding means by the output means is output from the device, the control means includes a program counter for holding the instruction for which the corresponding request is output. When selection by the selection unit is permitted and a request corresponding to the content of the output command is not output from the device, a request corresponding to the content of the output command is output from the device 3. The direct memory access system according to claim 2, wherein the selection unit restricts selection of a program counter corresponding to the instruction. 4.
前記制御手段は、前記出力手段によって前記命令保持手段から出力された命令が、当該命令の示すプログラムカウンタを中断させる中断命令である場合には、前記選択手段による当該中断命令の示すプログラムカウンタの選択を制限し、前記命令保持手段から出力された命令が、当該命令の示すプログラムカウンタを再開させる再開命令である場合には、前記選択手段による、当該再開命令の示すプログラムカウンタの選択を許可する
ことを特徴とする請求項2又は3に記載のダイレクトメモリアクセスシステム。
When the instruction output from the instruction holding means by the output means is an interruption instruction that interrupts the program counter indicated by the instruction, the control means selects the program counter indicated by the interruption instruction by the selection means. If the instruction output from the instruction holding means is a restart instruction that restarts the program counter indicated by the instruction, the selection means permits the selection of the program counter indicated by the restart instruction. The direct memory access system according to claim 2 or 3, wherein
前記制御手段は、前記出力手段によって前記命令保持手段から出力された命令が、当該命令の示すプログラムカウンタを当該命令の示すトリガ命令が発生するまで中断させるトリガ待ち中断命令である場合に、当該トリガ待ち中断命令以前にトリガが発行されていない際には、前記選択手段による前記トリガ待ち中断命令の示すプログラムカウンタの選択を制限し、当該トリガ待ち中断命令以前にトリガが発行されている際には、前記選択手段による前記トリガ待ち中断命令の示すプログラムカウンタの選択を制限しない
ことを特徴とする請求項4に記載のダイレクトメモリアクセスシステム。
The control means, when the instruction output from the instruction holding means by the output means is a trigger wait interruption instruction for interrupting the program counter indicated by the instruction until the trigger instruction indicated by the instruction is generated, When the trigger is not issued before the wait interruption instruction, the selection means limits the selection of the program counter indicated by the trigger wait interruption instruction, and when the trigger is issued before the trigger wait interruption instruction The direct memory access system according to claim 4, wherein selection of a program counter indicated by the trigger wait interruption instruction by the selection means is not limited.
前記実行手段は、レジスタを有し、前記出力手段により前記命令保持手段から出力された命令がストア命令である場合には前記実行手段が前記レジスタの保持するデータを外部メモリへ転送し、前記出力手段により前記命令保持手段から出力された命令がロード命令である場合には前記実行手段が前記外部メモリの保持するデータを前記レジスタに転送する
ことを特徴とする請求項1乃至5の何れか1項に記載のダイレクトメモリアクセスシステム。
The execution means includes a register, and when the instruction output from the instruction holding means by the output means is a store instruction, the execution means transfers data held in the register to an external memory, and the output 6. The method according to claim 1, wherein when the instruction output from the instruction holding means by the means is a load instruction, the execution means transfers the data held in the external memory to the register. The direct memory access system according to item.
前記出力手段により前記命令保持手段から出力された命令がループ命令である場合には、前記命令保持手段が前記ループ命令により示される範囲に格納している命令を、前記実行手段が繰り返し実行する
ことを特徴とする請求項1乃至6の何れか1項に記載のダイレクトメモリアクセスシステム。
When the instruction output from the instruction holding means by the output means is a loop instruction, the execution means repeatedly executes the instruction stored in the range indicated by the loop instruction by the instruction holding means. The direct memory access system according to any one of claims 1 to 6.
前記実行手段がデータ転送を実行する毎に、当該データ転送に関する命令を示すプログラムカウンタの値を更新するプログラムカウンタ更新手段を前記ダイレクトメモリアクセス部が更に備える
ことを特徴とする請求項1乃至7の何れか1項に記載のダイレクトメモリアクセスシステム。
8. The direct memory access unit further includes a program counter update unit that updates a value of a program counter indicating an instruction related to the data transfer each time the execution unit executes data transfer. The direct memory access system according to any one of the above.
前記再開命令が、当該再開命令の示すプログラムカウンタを指定した中断命令に先立って実行された場合、前記実行手段が該中断命令を無効にする
ことを特徴とする請求項4に記載のダイレクトメモリアクセスシステム。
5. The direct memory access according to claim 4, wherein when the restart instruction is executed prior to an interruption instruction specifying a program counter indicated by the restart instruction, the execution unit invalidates the interruption instruction. system.
前記命令保持手段は、複数の領域を有し、当該複数の領域のそれぞれに独立なプログラムを格納し、
前記複数のプログラムカウンタは、前記複数の領域のうち、それぞれ異なる領域のプログラムをカウントする
ことを特徴とする請求項1乃至9の何れか1項に記載のダイレクトメモリアクセスシステム。
The instruction holding means has a plurality of areas, stores an independent program in each of the plurality of areas,
The direct memory access system according to any one of claims 1 to 9, wherein the plurality of program counters count programs in different regions among the plurality of regions.
前記出力手段は、
前記命令保持手段からの命令を解釈して、当該命令の示す処理内容を示す信号を前記実行手段へ出力する
ことを特徴とする請求項1乃至10の何れか1項に記載のダイレクトメモリアクセスシステム。
The output means includes
11. The direct memory access system according to claim 1, wherein the instruction from the instruction holding unit is interpreted, and a signal indicating a processing content indicated by the instruction is output to the execution unit. .
前記実行手段により転送されるデータが画像データである場合、前記複数のプログラムカウンタの1つで当該画像データをx方向に参照し、他のプログラムカウンタのうちの1つで当該画像データをy方向に参照することで、前記実行手段によるデータの転送とともに前記画像データを回転させる
ことを特徴とする請求項1乃至11の何れか1項に記載のダイレクトメモリアクセスシステム。
When the data transferred by the execution means is image data, the image data is referred to in the x direction by one of the plurality of program counters, and the image data is referred to in the y direction by one of the other program counters. The direct memory access system according to any one of claims 1 to 11, wherein the image data is rotated together with the data transfer by the execution means.
前記デバイスは、前記実行手段によって転送されるデータを圧縮するためのエンコーダである
ことを特徴とする請求項2又は3に記載のダイレクトメモリアクセスシステム。
The direct memory access system according to claim 2 or 3, wherein the device is an encoder for compressing data transferred by the execution means.
ダイレクトメモリアクセス部とプロセッサ部とを有するダイレクトメモリアクセスシステムにおいて、
前記プロセッサ部は、
メモリと、
前記メモリから命令を読み出して実行することで、前記ダイレクトメモリアクセス部が実行する命令を当該ダイレクトメモリアクセス部に書き込むプロセッサとを備え、
前記ダイレクトメモリアクセス部は、
第1領域と第2領域とを有するダブルバッファと、
複数の命令を格納する命令保持手段と、
前記命令保持手段の格納する命令のうち、外部デバイスからのデータを前記第1領域又は前記第2領域へ転送させる第1転送命令と、前記第1転送命令の示す転送が完了したことを示す第1転送完了命令と、第2転送完了命令が発行されるまで自ら中断状態に遷移する第1中断命令とを順に示す第1プログラムカウンタと、
前記命令保持手段の格納する命令のうち、前記第1領域又は前記第2領域に格納しているデータを記憶装置へ転送させる第2転送命令と、前記第2転送命令の示す転送が完了したことを示す前記第2転送完了命令と、前記第1転送完了命令が発行されるまで自ら中断状態に遷移する第2中断命令と順に示す第2プログラムカウンタと、
前記第1又は第2プログラムカウンタの示す命令を時分割処理し、前記第1、第2中断命令を処理した際に当該第1、第2中断命令に対応する転送完了命令が発行されていなければ対応するプログラムカウンタを中断状態に遷移させ、前記第1、第2中断命令を処理した際に当該第1、第2中断命令に対応する転送完了命令が発行されていれば対応するプログラムカウンタを中断状態に遷移させない実行手段と
を備えることを特徴とするダイレクトメモリアクセスシステム。
In a direct memory access system having a direct memory access unit and a processor unit,
The processor unit is
Memory,
A processor that reads and executes an instruction from the memory to write an instruction to be executed by the direct memory access unit to the direct memory access unit;
The direct memory access unit
A double buffer having a first region and a second region;
Instruction holding means for storing a plurality of instructions;
Among the instructions stored in the instruction holding means, a first transfer instruction for transferring data from an external device to the first area or the second area, and a transfer indicating the transfer indicated by the first transfer instruction are completed. A first program counter sequentially indicating a 1 transfer completion instruction and a first interruption instruction that transitions to a suspended state until a second transfer completion instruction is issued;
Of the instructions stored in the instruction holding means, the second transfer instruction for transferring the data stored in the first area or the second area to the storage device and the transfer indicated by the second transfer instruction are completed. A second program counter sequentially indicating a second transfer completion instruction indicating a second interruption instruction that transitions to a suspended state until the first transfer completion instruction is issued;
If the instruction indicated by the first or second program counter is time-sharing processed and the first and second interruption instructions are processed, a transfer completion instruction corresponding to the first and second interruption instructions is not issued The corresponding program counter is shifted to the suspended state, and if the transfer completion instruction corresponding to the first and second suspension instructions is issued when the first and second suspension instructions are processed, the corresponding program counter is suspended. A direct memory access system comprising: an execution means that does not shift to a state.
前記命令保持手段の格納する命令のうち、外部デバイスの処理するデータを前記外部デバイスへ転送させる第3転送命令と、前記第1プログラムカウンタを起動する第1起動命令とを示す第3プログラムカウンタ
を更に有し、
前記第1プログラムカウンタは、前記第2プログラムカウンタを起動させる第2起動命令を示し、
前記実行手段は、前記第1プログラムカウンタを起動させ、前記第1転送命令を実行した際に前記第1転送完了命令の代わり前記第2起動命令を実行する
ことを特徴とする請求項14に記載のダイレクトメモリアクセスシステム。
A third program counter indicating a third transfer instruction for transferring data processed by an external device to the external device, and a first activation instruction for activating the first program counter, among the instructions stored in the instruction holding means; In addition,
The first program counter indicates a second start instruction for starting the second program counter,
The execution means starts the first program counter and executes the second start instruction instead of the first transfer completion instruction when the first transfer instruction is executed. Direct memory access system.
メモリと、前記メモリから命令を読み出して実行することで、ダイレクトメモリアクセス部が実行する命令を当該ダイレクトメモリアクセス部に書き込むプロセッサとを備えるプロセッサ部と、
複数のプログラムカウンタと、前記プロセッサによって書き込まれた命令を保持する命令保持手段と、を備えるダイレクトメモリアクセス部と
を有するダイレクトメモリアクセスシステムの制御方法であって、
前記複数のプログラムカウンタを順に選択する選択工程と、
前記選択工程で選択されたプログラムカウンタにより示される前記命令保持手段のアドレスに格納されている命令を出力する出力工程と、
前記出力工程において出力された命令に応じてダイレクトメモリアクセスによるデータ転送を実行する実行工程と
を有することを特徴とするダイレクトメモリアクセスシステムの制御方法。
A processor unit including a memory and a processor that reads and executes an instruction from the memory to write an instruction to be executed by the direct memory access unit into the direct memory access unit;
A direct memory access system control method comprising: a plurality of program counters; and a direct memory access unit including an instruction holding unit that holds an instruction written by the processor,
A selection step of sequentially selecting the plurality of program counters;
An output step of outputting an instruction stored in an address of the instruction holding means indicated by the program counter selected in the selection step;
A control method for a direct memory access system, comprising: an execution step of executing data transfer by direct memory access in accordance with an instruction output in the output step.
メモリと、前記メモリから命令を読み出して実行することで、ダイレクトメモリアクセス部が実行する命令を当該ダイレクトメモリアクセス部に書き込むプロセッサとを備えるプロセッサ部と、
第1領域と第2領域とを有するダブルバッファと、複数の命令を格納する命令保持手段と、前記命令保持手段の格納する命令のうち、外部デバイスからのデータを前記第1領域又は前記第2領域へ転送させる第1転送命令と、前記第1転送命令の示す転送が完了したことを示す第1転送完了命令と、第2転送完了命令が発行されるまで自ら中断状態に遷移する第1中断命令とを順に示す第1プログラムカウンタと、前記命令保持手段の格納する命令のうち、前記第1領域又は前記第2領域に格納しているデータを記憶装置へ転送させる第2転送命令と、前記第2転送命令の示す転送が完了したことを示す前記第2転送完了命令と、前記第1転送完了命令が発行されるまで自ら中断状態に遷移する第2中断命令と順に示す第2プログラムカウンタと、実行手段とを備えるダイレクトメモリアクセス部と、を有するダイレクトメモリアクセスシステムの制御方法であって、
前記実行手段が、前記第1又は第2プログラムカウンタの示す命令を時分割処理し、前記第1、第2中断命令を処理した際に当該第1、第2中断命令に対応する転送完了命令が発行されていなければ対応するプログラムカウンタを中断状態に遷移させ、前記第1、第2中断命令を処理した際に当該第1、第2中断命令に対応する転送完了命令が発行されていれば対応するプログラムカウンタを中断状態に遷移させない
ことを特徴とするダイレクトメモリアクセスシステムの制御方法。
A processor unit including a memory and a processor that reads and executes an instruction from the memory to write an instruction to be executed by the direct memory access unit into the direct memory access unit;
A double buffer having a first area and a second area; an instruction holding means for storing a plurality of instructions; and instructions stored in the instruction holding means for receiving data from an external device in the first area or the second area A first transfer instruction to be transferred to the area, a first transfer completion instruction indicating that the transfer indicated by the first transfer instruction has been completed, and a first interruption that transitions to a suspended state until a second transfer completion instruction is issued A first program counter sequentially indicating instructions; a second transfer instruction for transferring data stored in the first area or the second area to a storage device among the instructions stored in the instruction holding unit; A second program count sequentially indicating the second transfer completion instruction indicating that the transfer indicated by the second transfer instruction has been completed, and a second interruption instruction that transitions to a suspended state until the first transfer completion instruction is issued. When a control method for a direct memory access system having a direct memory access unit and a running unit,
When the execution means processes the instruction indicated by the first or second program counter in a time-sharing manner and processes the first and second interruption instructions, a transfer completion instruction corresponding to the first and second interruption instructions is received. If not issued, the corresponding program counter is shifted to the suspended state, and if the first and second suspended instructions are processed, the transfer completion instruction corresponding to the first and second suspended instructions is issued. The direct memory access system control method is characterized in that the program counter to be executed is not shifted to the suspended state.
JP2011084071A 2011-04-05 2011-04-05 Direct memory access system and control method thereof Expired - Fee Related JP5328833B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2011084071A JP5328833B2 (en) 2011-04-05 2011-04-05 Direct memory access system and control method thereof

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2011084071A JP5328833B2 (en) 2011-04-05 2011-04-05 Direct memory access system and control method thereof

Related Parent Applications (1)

Application Number Title Priority Date Filing Date
JP2004305703A Division JP5062950B2 (en) 2004-10-20 2004-10-20 Direct memory access device and control method thereof

Publications (2)

Publication Number Publication Date
JP2011170873A JP2011170873A (en) 2011-09-01
JP5328833B2 true JP5328833B2 (en) 2013-10-30

Family

ID=44684864

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2011084071A Expired - Fee Related JP5328833B2 (en) 2011-04-05 2011-04-05 Direct memory access system and control method thereof

Country Status (1)

Country Link
JP (1) JP5328833B2 (en)

Family Cites Families (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH0689349A (en) * 1992-09-07 1994-03-29 Hitachi Ltd Microprocessor
JPH08320797A (en) * 1995-05-24 1996-12-03 Fuji Xerox Co Ltd Program control system
US6519265B1 (en) * 1999-05-28 2003-02-11 Sony Corporation System and method for context switching in an electronic network

Also Published As

Publication number Publication date
JP2011170873A (en) 2011-09-01

Similar Documents

Publication Publication Date Title
TWI428763B (en) Method and system for supporting interaction of a plurality of graphics processing units
JP6243935B2 (en) Context switching method and apparatus
TWI423161B (en) Graphics processing units, metacommand processing systems and metacommand executing methods
KR100733943B1 (en) Processor system, dma control circuit, dma control method, control method for dma controller, graphic processing method, and graphic processing circuit
TWI251750B (en) An apparatus and method for selectable hardware accelerators in a data driven architecture
US20100110089A1 (en) Multiple GPU Context Synchronization Using Barrier Type Primitives
JPWO2008087779A1 (en) Array type processor and data processing system
US20090013323A1 (en) Synchronisation
JPWO2008023426A1 (en) Task processing device
JP2007219581A (en) Memory controller, and electronic equipment mounted therewith
TW201342225A (en) Method for determining instruction order using triggers
JP3669884B2 (en) Processing equipment
RU2375768C2 (en) Processor and method of indirect reading and recording into register
KR20080104177A (en) Firmware extendable commands for a microcontroller based flash memory digital controller
JP5328833B2 (en) Direct memory access system and control method thereof
US8896610B2 (en) Error recovery operations for a hardware accelerator
JP5062950B2 (en) Direct memory access device and control method thereof
WO2018171319A1 (en) Processor and instruction scheduling method
JP3628265B2 (en) Multiprocessor system unit
JP4641391B2 (en) Direct memory access device, control method therefor, and data processing device
JP7137058B2 (en) Arithmetic processing device, information processing device, and control method for information processing device
JPH11338735A (en) System lsi
JP6239212B1 (en) Simulation device, simulation method, and simulation program
JP2522257B2 (en) Image processing device
JP2008234270A (en) Information processing device and controlling method of information processing device

Legal Events

Date Code Title Description
A621 Written request for application examination

Free format text: JAPANESE INTERMEDIATE CODE: A621

Effective date: 20110405

TRDD Decision of grant or rejection written
A01 Written decision to grant a patent or to grant a registration (utility model)

Free format text: JAPANESE INTERMEDIATE CODE: A01

Effective date: 20130722

A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20130724

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20130723

R151 Written notification of patent or utility model registration

Ref document number: 5328833

Country of ref document: JP

Free format text: JAPANESE INTERMEDIATE CODE: R151

LAPS Cancellation because of no payment of annual fees