JP2005084763A - Memory-to-memory copy control device and memory-to-memory copy processing program - Google Patents

Memory-to-memory copy control device and memory-to-memory copy processing program Download PDF

Info

Publication number
JP2005084763A
JP2005084763A JP2003313357A JP2003313357A JP2005084763A JP 2005084763 A JP2005084763 A JP 2005084763A JP 2003313357 A JP2003313357 A JP 2003313357A JP 2003313357 A JP2003313357 A JP 2003313357A JP 2005084763 A JP2005084763 A JP 2005084763A
Authority
JP
Japan
Prior art keywords
copy
size
memory
data
sub
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.)
Granted
Application number
JP2003313357A
Other languages
Japanese (ja)
Other versions
JP4040557B2 (en
Inventor
Fumihiko Hayakawa
文彦 早川
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.)
Fujitsu Ltd
Original Assignee
Fujitsu Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Fujitsu Ltd filed Critical Fujitsu Ltd
Priority to JP2003313357A priority Critical patent/JP4040557B2/en
Publication of JP2005084763A publication Critical patent/JP2005084763A/en
Application granted granted Critical
Publication of JP4040557B2 publication Critical patent/JP4040557B2/en
Anticipated expiration legal-status Critical
Expired - Fee Related legal-status Critical Current

Links

Images

Landscapes

  • Bus Control (AREA)

Abstract

<P>PROBLEM TO BE SOLVED: To reduce the time required for data copy between memory areas. <P>SOLUTION: A sub-copy size calculation means 11, a copy source address calculation means 13 and a copy destination address calculation means 14 are started to acquire a sub-copy size that is a data unit of copy processing, and a copy source address and copy destination address for this data unit. A reading request of data is transmitted to a request issuing means 15 with designation of the acquired sub-copy size and the copy source address to acquire the data concerned. A writing request of the read data is transmitted to the request issuing means 15 with designation of the sub-copy size and the copy destination address to copy the data. The sub-copy size is subtracted from the remaining copy size to update the copy size, and it is determined whether the copy processing is continued or ended based on the updated remaining copy size. <P>COPYRIGHT: (C)2005,JPO&NCIPI

Description

本発明はメモリ間複写制御装置およびメモリ間複写処理プログラムに関し、特に複写指示によって、複写元メモリ領域のデータを読み出し、複写先メモリ領域に読み出したデータを書き込むメモリ間複写制御装置およびメモリ間複写処理プログラムに関する。   The present invention relates to an inter-memory copy control device and an inter-memory copy processing program, and more particularly to an inter-memory copy control device and an inter-memory copy process that read data in a copy source memory area and write the read data in a copy destination memory area according to a copy instruction. Regarding the program.

従来、コンピュータシステムにおいて、ソフトウェアまたはDMA(Direct Memory Access)の制御によって、所定のメモリ領域に書き込まれたメモリ内容を他のメモリ領域に複写するメモリ領域間の複写処理が行われてきたが、複写されるメモリ領域に比例して増大する複写処理時間を短縮することが課題であった。   Conventionally, in a computer system, copying has been performed between memory areas in which memory contents written in a predetermined memory area are copied to another memory area under the control of software or DMA (Direct Memory Access). It has been a problem to shorten the copy processing time which increases in proportion to the memory area to be processed.

そこで、二重化されたコンピュータシステムなどでは、オンライン側のメモリ内容の待機側への複写処理効率を上げるため、所定のメモリ空間ごとに複写要否の判断を行うものもある(たとえば、特許文献1参照。)。   Therefore, in some computer systems, etc., there is a computer system that determines whether or not copying is required for each predetermined memory space in order to increase the efficiency of copying the online memory contents to the standby side (see, for example, Patent Document 1). .)

しかしながら、複写の際にはアライメント制約と呼ばれるアクセス制限がある。アライメント制約とは、読み出しや書き込みなど、メモリへのアクセスの際に生じるアクセスアドレスとアクセスサイズとの関係についての制約を言う。   However, when copying, there is an access restriction called an alignment constraint. The alignment constraint is a constraint on the relationship between the access address and the access size that occurs when accessing the memory, such as reading and writing.

図4は、アライメント制約について示した図である。図は、32ビットアドレス、64ビットデータ幅のプロセッサあるいはDSP(Digital Signal Processor)におけるアライメント制約の例である。なお、アドレスは、16進表記してある。   FIG. 4 is a diagram showing alignment constraints. The figure shows an example of alignment constraints in a processor or DSP (Digital Signal Processor) having a 32-bit address and 64-bit data width. The address is expressed in hexadecimal.

図の例では、最大は64ビット(8バイト)のデータ幅で、以下、4バイト、2バイト、1バイトのデータ幅でアクセスが可能である。一般的にも、8バイトを基準とした8の倍数あるいは約数がデータ幅に設定される。アクセスアドレスの最下位桁の値が0または8の場合、全てのデータ幅での読み出しまたは書き込みが可能である。ところが、最下位桁の値が4とcの場合は1、2、4バイト、2とeの場合は1、2バイト、それ以外の場合には、1バイト、のデータ幅でのアクセスのみが可能という制約がある。これは、アクセスサイズが1バイトであれば、すべてのアクセスアドレスの読み出し/書き込みが可能であるが、2バイトでは最下位桁の値が0、2、4、6、8、a、c、eについて、4バイトでは最下位桁の値が0、4、8、cについて、8バイトでは最下位桁の値が0、8についての読み出し/書き込みのみが可能であると言い換えることもできる。   In the example shown in the figure, the maximum is a data width of 64 bits (8 bytes), and access is possible with a data width of 4 bytes, 2 bytes, and 1 byte. Generally, a multiple or a divisor of 8 based on 8 bytes is set as the data width. When the value of the least significant digit of the access address is 0 or 8, reading or writing with all data widths is possible. However, if the value of the least significant digit is 4 and c, it is 1, 2, 4 bytes, if it is 2 and e, it is 1, 2 bytes, otherwise it is only accessed with a data width of 1 byte. There is a restriction that it is possible. If the access size is 1 byte, all access addresses can be read / written. However, in 2 bytes, the least significant digit value is 0, 2, 4, 6, 8, a, c, e. In other words, it is possible to read / write only the value of the least significant digit of 0, 4, 8, and c in 4 bytes and the value of 0 and 8 of the least significant digit in 8 bytes.

このような従来のアライメント制約がある場合のメモリ間複写処理手順について説明する。図5は、従来のメモリ間複写処理手順を示したフローチャートである。以下、処理の単位を8バイトとして説明する。   A memory-to-memory copying process procedure when there is such a conventional alignment constraint will be described. FIG. 5 is a flowchart showing a conventional inter-memory copying process procedure. Hereinafter, the processing unit will be described as 8 bytes.

複写処理が開始されると、複写サイズとアクセスアドレスに基づいてアライメント判定を行い(ステップS101)、判定に応じて複写処理を分岐させる(ステップS102)。複写処理では、複写元および複写先の両方のアクセスアドレスの最下位桁が0、8である場合には、8バイト読み出し、8バイト書き込みの複写処理を行う(ステップS103)。アクセスアドレスの最下位桁が、複写元0、8および複写先4、cの場合には、8バイト読み出し、4バイト書き込み2回の複写処理を行う(ステップS104)。逆に、アクセスアドレスの最下位桁が複写元で4、c、複写先で0、8の場合には、4バイト読み出し2回、8バイト書き込みの複写処理になる(ステップS105)。以下、アライメント制約に応じた複写処理が選択される。複写処理の種類は、読み出しまたは書き込みの少なくとも一方の処理のデータ幅が8バイトの複写処理だけで16通りある。続いて、この複写処理により全てのメモリ領域の複写処理が終了したかどうかが判定され、終了していない場合には、ステップS101からの処理を繰り返す(ステップS106)。
特開平6−161903号公報(段落番号〔0006〕〜〔0015〕、図1)
When the copy process is started, alignment determination is performed based on the copy size and the access address (step S101), and the copy process is branched according to the determination (step S102). In the copying process, when the least significant digits of the access addresses of both the copy source and the copy destination are 0 and 8, 8-byte read and 8-byte write are copied (step S103). When the least significant digit of the access address is the copy sources 0 and 8 and the copy destinations 4 and c, the 8-byte read and 4-byte write are performed twice (step S104). On the contrary, when the least significant digit of the access address is 4 and c at the copy source and 0 and 8 at the copy destination, the copy processing is performed by reading 4 bytes twice and writing 8 bytes (step S105). Hereinafter, a copy process corresponding to the alignment constraint is selected. There are 16 types of copy processing only for copy processing in which the data width of at least one of read and write processing is 8 bytes. Subsequently, it is determined whether or not the copying process has been completed for all the memory areas by this copying process. If the copying process has not been completed, the process from step S101 is repeated (step S106).
JP-A-6-161903 (paragraph numbers [0006] to [0015], FIG. 1)

しかし、従来のメモリ間複写制御装置およびそのメモリ間複写処理には、アライメント制約により複写処理に多大な時間がかかるという問題点があった。
上記の説明のように、メモリ領域間のデータ複写の際に、アライメント制約に合わせるため、複写元および複写先の両方のアクセスアドレスについてアライメント制約を満たす処理ルーチンを用意しなければならない。このため、処理ルーチンの数は多くなり、分岐のための判定条件の数も多くなる。例えば、図4に示したアライメント制約の場合、データ幅が8バイトで16通り、4バイトで6通り、2バイトで3通りの処理ルーチンを用意しなければならない。処理ルーチンが多岐になると、分岐のための処理に時間がかかるという問題が生じる。
However, the conventional inter-memory copy control device and the inter-memory copy process have a problem that the copy process takes a long time due to alignment restrictions.
As described above, in order to meet alignment constraints when copying data between memory areas, a processing routine that satisfies the alignment constraints must be prepared for both the copy source and copy destination access addresses. For this reason, the number of processing routines increases and the number of determination conditions for branching also increases. For example, in the case of the alignment constraint shown in FIG. 4, it is necessary to prepare 16 processing routines with a data width of 8 bytes, 6 processings with 4 bytes, and 3 processing routines with 2 bytes. When processing routines are diversified, there arises a problem that processing for branching takes time.

また、このようにアライメントケースごとに処理ルーチンを持つことにより、ケースが増えるため、ソフトウェアパイプラインなど、実行効率を向上させるための最適化が適用しにくくなるという問題や、命令コードが肥大化し、命令キャッシュのヒット率が下がるという問題もある。   In addition, by having a processing routine for each alignment case in this way, the number of cases increases, so it becomes difficult to apply optimization for improving execution efficiency such as software pipeline, and the instruction code becomes enlarged, There is also a problem that the instruction cache hit rate decreases.

さらに、アライメント制約により、複写処理自体にも時間がかかるという問題がある。例えば、8バイトのデータ幅でメモリへのアクセスが可能なメモリ間複写制御装置において、アクセスアドレス「00000001」から「00000022」に8バイトのデータを複写する場合の手順について説明する。まず、データの読み出しでは、アライメント制約により、(1)「00000001」から1バイトの読み出し、(2)「00000002」から2バイトの読み出し、(3)「00000004」から4バイトの読み出し、(4)「00000008」から1バイトの読み出し、の4つの手順が行われる。続く書き込みでは、(1)「00000022」から2バイトの書き込み、(2)「00000024」から4バイトの書き込み、(3)「00000028」から2バイトの書き込み、の3つの手順が行われる。このように、8バイト単位でアクセス可能な装置であっても、アライメント制約によって8バイト一括しての読み出し/書き込みができないため、複写処理に時間がかかる。   Furthermore, there is a problem that the copying process itself takes time due to the alignment constraint. For example, a procedure for copying 8-byte data from the access address “00000001” to “00000002” in the memory-to-memory copy control apparatus capable of accessing the memory with an 8-byte data width will be described. First, in data reading, due to alignment restrictions, (1) 1 byte is read from “00000001”, (2) 2 bytes are read from “00000002”, (3) 4 bytes are read from “00000004”, (4) Four procedures of reading one byte from “00000008” are performed. In the subsequent writing, three procedures are performed: (1) writing 2 bytes from “00000002”, (2) writing 4 bytes from “00000024”, and (3) writing 2 bytes from “00000028”. In this way, even a device that can be accessed in units of 8 bytes cannot be read / written in a batch of 8 bytes due to alignment restrictions, so that the copying process takes time.

また、複写の要否の判断を行う場合であっても、複写を実行する際には、同様の制約を受けるため、複写実行時の処理時間を短縮することは難しい。
以上、ソフトウェアによる複写処理について説明したが、DMAによる処理の場合も同様のアライメント制約を受ける。このため、DMAによる複写処理についても、その性能を上げることは難しかった。
Even when determining whether or not copying is necessary, it is difficult to reduce the processing time during copying because copying is subject to the same restrictions.
Although the copying process by software has been described above, the same alignment constraint is also applied to the process by DMA. For this reason, it has been difficult to improve the performance of copy processing by DMA.

本発明はこのような点に鑑みてなされたものであり、メモリ領域間のデータ複写に要する時間を削減することが可能なメモリ間複写制御装置およびメモリ間複写処理プログラムを提供することを目的とする。   The present invention has been made in view of these points, and an object thereof is to provide an inter-memory copy control device and an inter-memory copy processing program capable of reducing the time required for copying data between memory areas. To do.

本発明では上記問題を解決するために、図1に示すようなメモリ間複写制御装置が提供される。本発明に係るメモリ間複写制御装置1は、メモリ領域をアクセスアドレスとアクセスサイズに関するアライメント制約なしに読み出しあるいは書き込み制御を行うメモリアクセス装置2を介してメモリ3の所定の複写元メモリ領域31に格納されたデータを複写先メモリ領域32に複写する。   In order to solve the above problem, the present invention provides an inter-memory copy control apparatus as shown in FIG. The inter-memory copy control apparatus 1 according to the present invention stores a memory area in a predetermined copy source memory area 31 of the memory 3 via the memory access apparatus 2 that performs read or write control without alignment restrictions on the access address and the access size. The copied data is copied to the copy destination memory area 32.

メモリ間複写制御装置1は、外部から入力された複写指示に基づいて、複写元アドレスからのデータ読み出しおよび複写先アドレスへのデータ書き込みを要求して複写処理を制御する複写制御手段10と、残り複写サイズに応じて処理単位である副複写サイズを算出する副複写サイズ算出手段11と、副複写サイズを用いて複写元のメモリ領域を指示する複写元アドレスを算出する複写元アドレス算出手段13および複写先のメモリ領域を指示する複写先アドレスを算出する複写先アドレス算出手段14を有する複写アドレス算出手段12と、メモリアクセス装置2に対してデータ読み出し要求またはデータ書き込み要求を発行するリクエスト発行手段15を具備する。   The inter-memory copy control device 1 includes a copy control means 10 for requesting data read from a copy source address and data write to a copy destination address based on a copy instruction inputted from the outside, and a copy control means 10 for controlling copy processing A sub-copy size calculating means 11 for calculating a sub-copy size as a processing unit according to the copy size, a copy-source address calculating means 13 for calculating a copy-source address indicating a copy-source memory area using the sub-copy size, and A copy address calculating unit 12 having a copy destination address calculating unit 14 for calculating a copy destination address indicating a copy destination memory area, and a request issuing unit 15 for issuing a data read request or a data write request to the memory access device 2. It comprises.

このようなメモリ間複写制御装置1によれば、外部から複写指示が入力されると、複写制御手段10は、残り複写サイズ、複写元アドレスおよび複写先アドレスを複写指示によって指定された値に初期化する。   According to such an inter-memory copy control device 1, when a copy instruction is input from the outside, the copy control means 10 initializes the remaining copy size, copy source address, and copy destination address to the values specified by the copy instruction. Turn into.

その後、副複写サイズ算出手段11、複写アドレス算出手段12を構成する複写元アドレス算出手段13および複写先アドレス算出手段14を起動し、副複写サイズ、複写元アドレスおよび複写先アドレスを取得する。ここで、副複写サイズとは、1回の複写処理で実行するデータサイズの処理単位を言う。通常、一度にアクセス可能な最大のデータ幅はメモリごとに決まっており、1回の複写処理では、最大のデータ幅に相当するデータサイズから最小のデータ幅に相当するデータサイズの間の所定のデータサイズを処理単位として処理を行う。副複写サイズ算出手段11は、この処理単位となるデータサイズを残り複写サイズに応じて算出し、副複写サイズとする。また、複写元アドレス算出手段13および複写先アドレス算出手段14は、この副複写サイズに基づいてアドレス算出を行っている。複写制御手段10は、このようにして算出された副複写サイズと複写元アドレスを指定してリクエスト発行手段15に対しデータの読み出し要求を行い、該当データを取得する。続いて、副複写サイズと複写先アドレスを指定して、リクエスト発行手段15に対し、読み出されたデータの書き込み要求を行って、対象のメモリ領域にデータを複写し、複写処理を1回終了する。   Thereafter, the secondary copy size calculating means 11, the copy source address calculating means 13 and the copy destination address calculating means 14 constituting the copy address calculating means 12 are activated to acquire the secondary copy size, the copy source address and the copy destination address. Here, the sub-copy size refers to a processing unit of data size executed in one copy process. Usually, the maximum data width accessible at one time is determined for each memory, and in one copy process, a predetermined data size between a data size corresponding to the maximum data width and a data size corresponding to the minimum data width is determined. Processing is performed using the data size as a processing unit. The secondary copy size calculation unit 11 calculates the data size as a processing unit according to the remaining copy size, and sets it as the secondary copy size. Further, the copy source address calculation means 13 and the copy destination address calculation means 14 perform address calculation based on the sub-copy size. The copy control means 10 designates the sub-copy size and the copy source address calculated in this way, makes a data read request to the request issuing means 15, and acquires the corresponding data. Subsequently, the secondary copy size and the copy destination address are specified, and the request issuing means 15 is requested to write the read data, the data is copied to the target memory area, and the copy process is completed once. To do.

次に、残り複写サイズから副複写サイズを減算して更新し、更新された残り複写サイズに基づいて複写処理を続行するか終了するかを判定する。続行する場合は、副複写サイズ算出手段11、複写元アドレス算出手段13および複写先アドレス算出手段14の起動からの処理を行う。   Next, the sub-copy size is subtracted from the remaining copy size and updated, and it is determined whether to continue or end the copy process based on the updated remaining copy size. When continuing, the processing from the start of the secondary copy size calculation means 11, the copy source address calculation means 13 and the copy destination address calculation means 14 is performed.

このように、残り複写サイズによってのみ規定される副複写サイズを処理単位とする複写処理が繰り返され、複写元メモリ領域31のデータが複写先メモリ領域32に複写される。   In this way, the copying process with the sub-copy size defined only by the remaining copy size as a processing unit is repeated, and the data in the copy source memory area 31 is copied to the copy destination memory area 32.

また、上記課題を解決するために、図1に示したメモリ間複写制御装置1の処理機能をコンピュータに実行させるためのメモリ間複写処理プログラムが提供される。メモリ間複写処理プログラムは、コンピュータに、以下の処理手順を実行させることができる。   In order to solve the above-described problem, an inter-memory copy processing program for causing a computer to execute the processing function of the inter-memory copy control device 1 shown in FIG. 1 is provided. The inter-memory copy processing program can cause a computer to execute the following processing procedure.

コンピュータは、外部から複写指示が入力されると、複写指示に基づいて、残り複写サイズ、複写元アドレスおよび複写先アドレスを初期化する。次に、初期化された残り複写サイズに基づいて、最初の処理単位となる副複写サイズが算出される。そして、副複写サイズと複写元アドレスを指定して、データの読み出し要求を発行する。これに伴って、アクセスアドレスとアクセスサイズに関するアライメント制約のないメモリアクセス装置2が起動し、メモリ3からのデータ読み出しが実行される。続いて、副複写サイズと複写先アドレスを指定して、読み出されたデータの書き込み要求を発行する。これに伴って、メモリアクセス装置2によって、読み出された複写元アドレスのデータが複写先アドレスに複写される。次に、副複写サイズを用いて、残り複写サイズ、複写元アドレスおよび複写先アドレスを更新する。そして、更新された残り複写サイズをチェックし、複写処理を続行するか終了するかの判定を行う。続行する場合には、残り複写サイズに基づいた次の処理単位の副複写サイズ算出からの処理手順を繰り返す。   When a copy instruction is input from the outside, the computer initializes the remaining copy size, copy source address, and copy destination address based on the copy instruction. Next, based on the initialized remaining copy size, the sub-copy size that is the first processing unit is calculated. Then, the secondary copy size and the copy source address are designated and a data read request is issued. Along with this, the memory access device 2 having no alignment constraint on the access address and the access size is activated, and data reading from the memory 3 is executed. Subsequently, a sub-copy size and a copy destination address are designated and a read request for the read data is issued. Along with this, the memory access device 2 copies the read data of the copy source address to the copy destination address. Next, the remaining copy size, copy source address, and copy destination address are updated using the secondary copy size. Then, the updated remaining copy size is checked to determine whether to continue or end the copy process. When continuing, the processing procedure from the sub-copy size calculation of the next processing unit based on the remaining copy size is repeated.

本発明は、残りサイズによってのみ規定される副複写サイズに基づいて複写処理が行われるので、処理ルーチンの分岐に要する処理時間を削減することができるばかりでなく、副複写サイズを最適化することができるため複写自体の処理時間も短縮できる結果、メモリ領域の複写処理が高速化されるという利点がある。   In the present invention, since the copying process is performed based on the sub-copy size defined only by the remaining size, not only can the processing time required for branching the processing routine be reduced, but also the sub-copy size can be optimized. As a result, the processing time of copying itself can be shortened, and as a result, the copying process of the memory area is accelerated.

以下、本発明の実施の形態を図面を参照して詳細に説明する。まず、実施の形態に適用される発明の概念について説明し、その後、実施の形態の具体的な内容を説明する。
図1は本発明を適用したメモリ間複写制御装置の動作原理を示す説明図である。
Hereinafter, embodiments of the present invention will be described in detail with reference to the drawings. First, the concept of the invention applied to the embodiment will be described, and then the specific contents of the embodiment will be described.
FIG. 1 is an explanatory diagram showing the operation principle of an inter-memory copy control device to which the present invention is applied.

本発明が適用されるメモリ間複写制御装置1は、メモリ間複写制御装置1が発行するデータ読み出し要求あるいはデータ書き込み要求によって、メモリ領域へのアクセスを制御するメモリアクセス装置2を介して、メモリ3の所定領域のデータ読み出し/書き込みを行う。メモリ間複写処理では、1回にアクセス可能な所定の処理単位(データ幅)の複写を繰り返し行うことによって要求されたメモリ間の複写を実現する。   The inter-memory copy control device 1 to which the present invention is applied includes a memory 3 via a memory access device 2 that controls access to a memory area in response to a data read request or data write request issued by the inter-memory copy control device 1. Read / write data in a predetermined area. In the inter-memory copying process, the requested copying between memories is realized by repeatedly copying a predetermined processing unit (data width) accessible at one time.

メモリアクセス装置2は、アライメント制約が撤廃されており、アクセスアドレスとアクセスサイズとの関係に制約がない。すなわち、メモリ3の任意のアドレスから始まるメモリ領域からのデータ読み出しおよびデータ書き込みがアクセスサイズの制約なく可能である。   The memory access device 2 has no alignment restrictions, and there is no restriction on the relationship between the access address and the access size. That is, data reading and data writing from a memory area starting from an arbitrary address of the memory 3 can be performed without restriction on the access size.

メモリ3は、各種データを保存する所定の記憶装置で、メモリアクセス装置2によってデータの読み出しと書き込みが行われる。
メモリ間複写制御装置1は、データの複写処理を行う装置で、複写処理を制御する複写制御手段10、処理単位となる副複写サイズを算出する副複写サイズ算出手段11、複写アドレス算出手段12を構成する処理単位ごとに複写元アドレスを算出する複写元アドレス算出手段13と処理単位ごとに複写先アドレスを算出する複写先アドレス算出手段14、およびメモリアクセス装置2へのリクエストを発行するリクエスト発行手段15を具備する。
The memory 3 is a predetermined storage device that stores various data, and the memory access device 2 reads and writes data.
The inter-memory copy control device 1 is a device that performs data copy processing, and includes a copy control means 10 that controls the copy processing, a sub-copy size calculation means 11 that calculates a sub-copy size as a processing unit, and a copy address calculation means 12. Copy source address calculating means 13 for calculating a copy source address for each processing unit, copy destination address calculating means 14 for calculating a copy destination address for each processing unit, and request issuing means for issuing a request to the memory access device 2 15.

複写制御手段10は、外部からの複写指示に従って、一連の複写処理の実行を制御する。外部から複写指示が入力されると、元データが格納されている複写元メモリ領域31を示す複写元アドレス、複写したデータを格納する複写先メモリ領域32を示す複写先アドレス、複写するデータ量を示す複写サイズを含む複写情報が入力され、初期化処理が行われる。複写情報は初期値として設定されるので、以下の説明では、外部から複写指示された情報は、それぞれ、複写元アドレス(初期値)、複写先アドレス(初期値)、複写サイズ(初期値)と表記する。初期化処理では、処理単位ごとの複写元を示す複写元アドレスに複写元アドレス(初期値)が設定され、処理単位ごとの複写先を示す複写先アドレスに複写先アドレス(初期値)が設定される。また、複写未完了のデータ量を示す残り複写サイズには、複写サイズ(初期値)が設定される。   The copy control means 10 controls the execution of a series of copy processes in accordance with an external copy instruction. When a copy instruction is input from the outside, the copy source address indicating the copy source memory area 31 storing the original data, the copy destination address indicating the copy destination memory area 32 storing the copied data, and the amount of data to be copied Copy information including the indicated copy size is input, and initialization processing is performed. Since the copy information is set as an initial value, in the following description, the information instructed to copy from outside is the copy source address (initial value), the copy destination address (initial value), the copy size (initial value), respectively. write. In the initialization process, the copy source address (initial value) is set to the copy source address indicating the copy source for each processing unit, and the copy destination address (initial value) is set to the copy destination address indicating the copy destination for each processing unit. The In addition, a copy size (initial value) is set as the remaining copy size indicating the amount of data that has not been copied.

初期化処理が終了すると、処理単位ごとの複写処理を開始する。副複写サイズ算出手段11、複写元アドレス算出手段13および複写先アドレス算出手段14を起動し、処理単位ごとの副複写サイズ、複写元アドレス、複写先アドレスを取得する。そして、副複写サイズと複写元アドレスを指定してデータ読み出し要求をリクエスト発行手段15に対して行い、処理単位(副複写サイズ分)の読み出しデータを取得する。続いて、副複写サイズと複写先アドレスを指定してデータの書き込み要求をリクエスト発行手段15に対して行い、読み出された処理単位のデータの書き込みを行う。書き込みが終了した後、残り複写サイズから副複写サイズを減算し、残り複写サイズを更新する。更新された残り複写サイズをチェックし、残り複写サイズが0であれば、複写処理を終了する。0でなければ、処理単位ごとの複写処理手順の最初に戻って、次の処理単位の複写処理を開始する。   When the initialization process is completed, the copying process for each processing unit is started. The secondary copy size calculation means 11, the copy source address calculation means 13 and the copy destination address calculation means 14 are activated to acquire the secondary copy size, the copy source address, and the copy destination address for each processing unit. Then, a data read request is made to the request issuing means 15 by designating the secondary copy size and the copy source address, and the read data of the processing unit (sub copy size) is acquired. Subsequently, a sub-copy size and a copy destination address are designated, and a data write request is made to the request issuing means 15 to write the read processing unit data. After writing is completed, the sub-copy size is subtracted from the remaining copy size, and the remaining copy size is updated. The updated remaining copy size is checked, and if the remaining copy size is 0, the copy process is terminated. If it is not 0, the process returns to the beginning of the copy process procedure for each process unit, and the copy process for the next process unit is started.

副複写サイズ算出手段11は、残り複写サイズに応じた副複写サイズを判定し、処理単位のデータ量を設定する。メモリごとに一度にアクセス可能な最大のデータ幅は決められているので、副複写サイズには、最大のデータ幅から最小のデータ幅の間で残り複写サイズを超えない、アクセス可能な最も大きい値が設定される。例えば、最大のデータ幅を8バイトとして、8、4、2、1というように、アクセス可能な処理単位のデータサイズが予め決められている場合には、これらの処理単位のうち、残り複写サイズを超えない最大の処理単位を選択する。   The secondary copy size calculation unit 11 determines the secondary copy size according to the remaining copy size, and sets the data amount for each processing unit. Since the maximum data width that can be accessed at one time for each memory is determined, the secondary copy size is the largest accessible value that does not exceed the remaining copy size between the maximum data width and the minimum data width. Is set. For example, when the maximum data width is 8 bytes and the data size of accessible processing units is determined in advance, such as 8, 4, 2, 1, etc., the remaining copy size of these processing units is Select the largest processing unit that does not exceed.

複写元アドレス算出手段13は、この処理単位における複写元のメモリ領域を指示する複写元アドレスを算出する。
複写先アドレス算出手段14は、この処理単位における複写先のメモリ領域を指示する複写先アドレスを算出する。
The copy source address calculation means 13 calculates a copy source address indicating the copy source memory area in this processing unit.
The copy destination address calculation means 14 calculates a copy destination address indicating a copy destination memory area in this processing unit.

リクエスト発行手段15は、複写制御手段10から、アクセスするメモリ領域を示すアドレス(複写元アドレスまたは複写先アドレス)、アクセスするサイズ(副複写サイズ)および指示(読み出しあるいは書き込み)を入力すると、入力情報に基づいて、読み出しあるいは書き込みのリクエストをメモリアクセス装置2に対して発行する。そして、メモリアクセス装置2より得られた読み出しデータあるいは応答は、複写制御手段10へ伝える。   When the request issuing means 15 inputs from the copy control means 10 an address (copy source address or copy destination address) indicating the memory area to be accessed, an access size (sub-copy size) and an instruction (read or write), the input information Based on the above, a read or write request is issued to the memory access device 2. The read data or response obtained from the memory access device 2 is transmitted to the copy control means 10.

このような構成のメモリ間複写制御装置1の動作について説明する。
外部のアプリケーションなどから、メモリ間複写制御装置1に対して、複写元メモリ領域31を示す複写元アドレス(初期値)、複写先メモリ領域32を示す複写先アドレス(初期値)および複写サイズ(初期値)を含む複写指示が出され、処理が開始される。
The operation of the inter-memory copy control device 1 having such a configuration will be described.
A copy source address (initial value) indicating the copy source memory area 31, a copy destination address (initial value) indicating the copy destination memory area 32, and a copy size (initial A copy instruction including (value) is issued, and the process is started.

複写制御手段10は、複写指示に基づいて、処理単位ごとの複写処理におけるポインタとなる複写元アドレス、複写先アドレス、および複写未完了のデータ量を示す残り複写サイズを初期化する。初期化終了時、複写元アドレスおよび複写先アドレスは、複写指示されたメモリ領域の先頭アドレスを示し、残り複写サイズは、複写指示された複写サイズを示している。   Based on the copy instruction, the copy control unit 10 initializes a copy source address, a copy destination address, and a remaining copy size indicating an unfinished copy amount as a pointer in copy processing for each processing unit. At the end of initialization, the copy source address and copy destination address indicate the start address of the memory area instructed to copy, and the remaining copy size indicates the copy size instructed to copy.

初期化終了後、複写処理が開始され、複写制御手段10により副複写サイズ算出手段11、複写元アドレス算出手段13および複写先アドレス算出手段14が起動される。副複写サイズ算出手段11は、残り複写サイズを参照し、残り複写サイズを超えない最大のデータ幅を処理単位として選択する。複写元アドレス算出手段13および複写先アドレス算出手段14は、この処理単位における複写元メモリ領域31を示す複写元アドレスと、複写先メモリ領域32を示す複写先アドレスを算出する。   After the initialization, the copy process is started, and the copy control means 10 activates the secondary copy size calculation means 11, the copy source address calculation means 13, and the copy destination address calculation means 14. The secondary copy size calculation means 11 refers to the remaining copy size and selects the maximum data width not exceeding the remaining copy size as a processing unit. The copy source address calculating unit 13 and the copy destination address calculating unit 14 calculate a copy source address indicating the copy source memory area 31 and a copy destination address indicating the copy destination memory area 32 in this processing unit.

複写制御手段10は、リクエスト発行手段15に対し、副複写サイズと複写元アドレスを指定してデータ読み出し要求を行う。リクエスト発行手段15は、副複写サイズをアクセスサイズ、複写元アドレスをアクセスアドレスとして、データの読み出し要求のリクエストをメモリアクセス装置2に対して発行する。リクエストを受けたメモリアクセス装置2は、メモリ3の指定されたメモリ領域のデータを読み出す。読み出されたデータは、リクエスト発行手段15経由で複写制御手段10へ送られる。続いて、複写制御手段10は、リクエスト発行手段15に対し、副複写サイズと複写先アドレスを指定して読み出されたデータの書き込み要求を行う。リクエスト発行手段15は、副複写サイズをアクセスサイズ、複写先アドレスをアクセスアドレスとして、データの書き込み要求のリクエストをメモリアクセス装置2に対して発行する。リクエストを受けたメモリアクセス装置2は、メモリ3の指定されたメモリ領域にデータを書き込む。書き込みの終了信号が、リクエスト発行手段15経由で複写制御手段10へ送られ、処理単位の複写処理が終了する。   The copy control means 10 makes a data read request to the request issuing means 15 by specifying the sub-copy size and the copy source address. The request issuing means 15 issues a data read request request to the memory access device 2 with the secondary copy size as the access size and the copy source address as the access address. Upon receiving the request, the memory access device 2 reads data in the designated memory area of the memory 3. The read data is sent to the copy control means 10 via the request issuing means 15. Subsequently, the copy control means 10 requests the request issuing means 15 to write the read data by specifying the sub-copy size and the copy destination address. The request issuing unit 15 issues a data write request request to the memory access device 2 using the secondary copy size as the access size and the copy destination address as the access address. The memory access device 2 that has received the request writes data in a specified memory area of the memory 3. A write end signal is sent to the copy control means 10 via the request issuing means 15, and the copy processing for each processing unit is completed.

続いて、複写制御手段10は、副複写サイズを用いて残り複写サイズを更新するとともに、更新された残り複写サイズに基づいて複写処理の続行/終了の判定を行う。続行する場合には、副複写サイズ算出手段11、複写元アドレス算出手段13および複写先アドレス算出手段14の起動からの処理が繰り返される。   Subsequently, the copy control means 10 updates the remaining copy size using the sub-copy size, and determines whether to continue / end the copy process based on the updated remaining copy size. When continuing, the processes from the start of the secondary copy size calculating means 11, the copy source address calculating means 13 and the copy destination address calculating means 14 are repeated.

上記の説明の処理が繰り返され、残り複写サイズに応じた最大のデータ幅で複写処理が繰り返され、複写指示されたメモリ領域のメモリ間複写処理が終了する。
このように、処理単位である副複写サイズは、残り複写サイズの大きさによってのみ決まるため、複写元および複写先アドレスと副複写サイズに関する制約を判定する煩雑な処理を行う必要がなく、処理分岐に要する判定時間を短縮することができる。また、分岐する複写処理ルーチンもデータ幅の種類に応じた数だけ用意すればよいため、命令コードが肥大化することがない。さらに、アクセスアドレスに応じて処理を行うデータ幅が制約されることがないため、最大のデータ幅での複写処理が可能となり、複写処理自体の時間を短縮することができる。
The process described above is repeated, the copy process is repeated with the maximum data width corresponding to the remaining copy size, and the inter-memory copy process of the memory area instructed to be copied is completed.
As described above, since the secondary copy size as a processing unit is determined only by the size of the remaining copy size, there is no need to perform complicated processing for determining restrictions on the copy source and destination addresses and the secondary copy size, and processing branch Can be shortened. Further, since only the number of copy processing routines to be branched needs to be prepared according to the type of data width, the instruction code is not enlarged. Furthermore, since the data width to be processed in accordance with the access address is not restricted, the copying process with the maximum data width can be performed, and the copying process itself can be shortened.

以上のように、本発明によれば、メモリアドレスのアライメントの確認・アライメントを合わせるための処理を行う必要がなくなり、メモリ領域の複写処理を高速に行うことができる。この結果、メモリ領域の複写を伴ったシステム全体性能を向上できる。   As described above, according to the present invention, it is not necessary to perform processing for confirming and aligning the alignment of memory addresses, and the memory region can be copied at high speed. As a result, it is possible to improve the overall system performance accompanied by copying of the memory area.

なお、上記の説明では、複写元アドレス算出手段13と複写先アドレス算出手段14の起動を処理単位ごとの複写処理開始時としたが、残り複写サイズを更新する際に起動して次処理単位の複写元アドレスと複写先アドレスを更新しておいてもよい。   In the above description, the copy source address calculating unit 13 and the copy destination address calculating unit 14 are activated at the start of the copy process for each processing unit. However, when the remaining copy size is updated, the copy source address calculating unit 13 and the copy destination address calculating unit 14 are activated. The copy source address and the copy destination address may be updated.

ところで、メモリ間複写制御装置1は、メモリ領域間のデータ複写を行うためのデータ処理機能を有しており、CPU(Central Processing Unit)によって装置全体が制御されている。CPUには、バスを介してRAM(Random Access Memory)、ROM(Read Only Memory)が接続している。また、外部のプロセッサ・DSP、メモリアクセス装置にもバスを介して接続する。ROMには、CPUに実行させるプログラムが格納される。 また、RAMには、CPUによる処理に必要な各種データが格納される。このようなハードウェア構成によって、本実施の形態の処理機能を実現することができる。   By the way, the inter-memory copy control device 1 has a data processing function for copying data between memory areas, and the entire device is controlled by a CPU (Central Processing Unit). A RAM (Random Access Memory) and a ROM (Read Only Memory) are connected to the CPU via a bus. Also, an external processor / DSP and a memory access device are connected via a bus. The ROM stores a program to be executed by the CPU. The RAM stores various data necessary for processing by the CPU. With such a hardware configuration, the processing functions of the present embodiment can be realized.

なお、メモリ間複写制御装置1は、その処理機能をハードウェアによって実現することもできる。
次に、本発明を32ビットアドレス、64ビット(8バイト)データ幅のシステムに適用した場合を例にとり、実施の形態を説明する。この場合、処理単位のデータ幅は、8バイト、4バイト、2バイト、1バイトの4種類のうち、いずれかが選択できるとする。
Note that the inter-memory copy control device 1 can also realize its processing function by hardware.
Next, an embodiment will be described by taking the case where the present invention is applied to a system having a 32-bit address and 64-bit (8-byte) data width as an example. In this case, the data width of the processing unit can be selected from four types of 8 bytes, 4 bytes, 2 bytes, and 1 byte.

図2は、本発明の実施の形態のメモリ間複写制御装置の構成図である。図1と同じものには同じ符号を付し、説明は省略する。
本発明に係るメモリ間複写制御装置1は、複写制御手段10、副複写サイズを保持する副複写サイズ保持手段11a、複写元アドレスを保持する複写元アドレス保持手段13aと加算器13bを有する複写元アドレス算出手段、複写先アドレスを保持する複写先アドレス保持手段14aと加算器14bを有する複写先アドレス算出手段、リクエスト発行手段15および残り複写サイズを保持する残り複写サイズ保持手段16aと減算器16bを具備する。
FIG. 2 is a block diagram of the inter-memory copy control apparatus according to the embodiment of the present invention. The same components as those in FIG. 1 are denoted by the same reference numerals, and description thereof is omitted.
An inter-memory copy control apparatus 1 according to the present invention includes a copy control means 10, a sub copy size holding means 11a for holding a sub copy size, a copy source address holding means 13a for holding a copy source address, and an adder 13b. Address calculating means, copy destination address holding means 14a for holding the copy destination address and copy destination address calculating means having adder 14b, request issuing means 15, remaining copy size holding means 16a for holding the remaining copy size, and subtractor 16b It has.

複写制御手段10は、複写処理を制御する。副複写サイズ保持手段11a、複写元アドレス保持手段13a、複写先アドレス保持手段14aおよび残り複写サイズ保持手段16aは各データ保持手段に保持されたデータの読み出しおよび必要に応じて書き込みが可能で、これらの保持データを参照して複写処理を行う。なお、ここでは、副複写サイズの算出は複写制御手段10で行うとする。   The copy control means 10 controls the copy process. The secondary copy size holding unit 11a, the copy source address holding unit 13a, the copy destination address holding unit 14a, and the remaining copy size holding unit 16a can read and write data held in the respective data holding units. Copy processing is performed with reference to the stored data. Here, it is assumed that the sub-copy size is calculated by the copy control means 10.

副複写サイズ保持手段11aは、複写制御手段10が算出した副複写サイズの値を保持するレジスタである。ここでは、8バイト、4バイト、2バイト、あるいは1バイトのデータ幅値が保持される。必要に応じて、保持されている副複写サイズの値を加算器13b、14bおよび減算器16bへ出力する。   The secondary copy size holding unit 11 a is a register that holds the value of the secondary copy size calculated by the copy control unit 10. Here, a data width value of 8 bytes, 4 bytes, 2 bytes, or 1 byte is held. If necessary, the held sub-copy size value is output to the adders 13b and 14b and the subtractor 16b.

複写元アドレス保持手段13aは、処理単位における複写元のメモリ領域を指示する複写元アドレスを保持するレジスタである。初期化信号により外部から入力する複写元アドレス(初期値)をセットする。また、複写制御手段10に従って保持された複写元アドレスの値を加算器13bに出力する。加算器13bによって副複写サイズ分だけ加算された複写元アドレスは、次処理時の複写元アドレスとして複写元アドレス保持手段13aに格納される。   The copy source address holding unit 13a is a register that holds a copy source address indicating a copy source memory area in a processing unit. A copy source address (initial value) input from the outside is set by an initialization signal. Further, the value of the copy source address held according to the copy control means 10 is output to the adder 13b. The copy source address added by the adder 13b by the sub-copy size is stored in the copy source address holding unit 13a as a copy source address at the time of the next processing.

複写先アドレス保持手段14aは、処理単位における複写先のメモリ領域を指示する複写先アドレスを保持するレジスタである。初期化信号により外部から入力する複写先アドレス(初期値)をセットする。また、複写制御手段10に従って保持された複写先アドレスの値を加算器14bに出力する。加算器14bによって副複写サイズ分だけ加算された複写先アドレスは、次処理時の複写先アドレスとして複写先アドレス保持手段14aに格納される。   The copy destination address holding unit 14a is a register that holds a copy destination address indicating a copy destination memory area in a processing unit. A copy destination address (initial value) input from the outside is set by an initialization signal. Further, the value of the copy destination address held according to the copy control means 10 is output to the adder 14b. The copy destination address added by the adder 14b by the size of the sub-copy size is stored in the copy destination address holding unit 14a as a copy destination address in the next processing.

残り複写サイズ保持手段16aは、未完了の複写データ量を示す残り複写サイズを保持するレジスタである。初期化信号により外部から入力する複写サイズ(初期値)をセットする。また、複写制御手段10に従って保持された残り複写サイズの値を減算器16bに出力する。処理単位の複写処理が終了すると、減算器16bによって副複写サイズ分だけ減算された残り複写サイズが残り複写サイズ保持手段16aに格納される。   The remaining copy size holding means 16a is a register that holds the remaining copy size indicating the amount of unfinished copy data. The copy size (initial value) input from the outside is set by the initialization signal. Further, the value of the remaining copy size held according to the copy control means 10 is output to the subtracter 16b. When the copy processing for each processing unit is completed, the remaining copy size subtracted by the sub-copy size by the subtractor 16b is stored in the remaining copy size holding means 16a.

このような構成のメモリ間複写制御装置1の動作について説明する。
メモリ間複写制御装置1は、プロセッサ・DSPなどの外部装置から、複写サイズ(初期値)、複写元アドレス(初期値)、複写先アドレス(初期値)、複写開始信号を含む複写指示を入力する。複写制御手段10の初期化信号により、複写サイズ(初期値)が残り複写サイズ保持手段16a、複写元アドレス(初期値)が複写元アドレス保持手段13aおよび複写先アドレス(初期値)が複写先アドレス保持手段14aに格納され、初期化処理が終了する。
The operation of the inter-memory copy control device 1 having such a configuration will be described.
The inter-memory copy control device 1 inputs a copy instruction including a copy size (initial value), a copy source address (initial value), a copy destination address (initial value), and a copy start signal from an external device such as a processor / DSP. . In response to the initialization signal of the copy control means 10, the copy size (initial value) remains, the copy size holding means 16a, the copy source address (initial value) is the copy source address holding means 13a, and the copy destination address (initial value) is the copy destination address. It is stored in the holding means 14a, and the initialization process ends.

初期化終了後、複写処理が開始される。
複写制御手段10は、残り複写サイズ保持手段16aに保持された残り複写サイズを読み出し、複写処理の実行/終了の判定と、実行の場合の副複写サイズの選択を行う。残り複写サイズが0の場合、複写終了信号を外部に出力して複写処理を終了する。
After the initialization is completed, the copying process is started.
The copy control means 10 reads the remaining copy size held in the remaining copy size holding means 16a, determines the execution / end of the copy process, and selects the sub-copy size for execution. If the remaining copy size is 0, a copy end signal is output to the outside and the copy process is terminated.

一方、残り複写サイズが0以外の場合、複写処理を行う。残り複写サイズが1の場合、副複写サイズ保持手段11aに1をセットする。残り複写サイズが2または3の場合、副複写サイズ保持手段11aに2をセットする。残り複写サイズが4から7の場合、副複写サイズ保持手段11aに4をセットする。そして、残り複写サイズが8以上の場合、副複写サイズ保持手段11aに8をセットする。   On the other hand, if the remaining copy size is other than 0, copy processing is performed. If the remaining copy size is 1, 1 is set in the secondary copy size holding means 11a. When the remaining copy size is 2 or 3, 2 is set in the secondary copy size holding means 11a. When the remaining copy size is 4 to 7, 4 is set in the sub copy size holding means 11a. If the remaining copy size is 8 or more, 8 is set in the secondary copy size holding means 11a.

次に、複写制御手段10は、リクエスト発行手段15に対し、複写元アドレス保持手段13aに保持された複写元アドレスから、副複写サイズ保持手段11aにセットされたデータ幅でのデータ読み出しのリクエストを発行するように通知する。その結果、メモリから該当するデータαが読み出される。   Next, the copy control means 10 sends a request to the request issuing means 15 to read the data with the data width set in the secondary copy size holding means 11a from the copy source address held in the copy source address holding means 13a. Notify you to issue. As a result, the corresponding data α is read from the memory.

続いて、複写制御手段10は、リクエスト発行手段15に対し、複写先アドレス保持手段14aの保持された複写先アドレスから、副複写サイズ保持手段11aにセットされたデータ幅でデータαを書き込むリクエストを発行するように通知する。その結果、メモリの該当する領域にデータαが書き込まれる。   Subsequently, the copy control means 10 sends a request to the request issuing means 15 to write the data α with the data width set in the secondary copy size holding means 11a from the copy destination address held in the copy destination address holding means 14a. Notify you to issue. As a result, the data α is written in the corresponding area of the memory.

次に、複写制御手段10は、減算器16bによって、副複写サイズ保持手段11aに保持した副複写サイズ値を残り複写サイズ保持手段16aに保持した残り複写サイズの値から減算し、残り複写サイズ保持手段16aに反映する。これにより、処理単位の複写処理が終了したデータ量が減算され、残りのデータ量が残り複写サイズ保持手段16aに格納される。さらに、加算器13bにより複写元アドレス保持手段13aの値に副複写サイズの値を加算し、複写元アドレス保持手段13aに反映する。同様に、加算器14bにより複写先アドレス保持手段14aの値に副複写サイズの値を加算し、複写先アドレス保持手段14aに反映する。これにより、処理単位の複写処理が終了したメモリ領域の次の複写元アドレスおよび複写先アドレスが各保持手段に保持される。   Next, the copy control means 10 subtracts the sub-copy size value held in the sub-copy size holding means 11a from the remaining copy size value held in the remaining copy size holding means 16a by the subtractor 16b and holds the remaining copy size. This is reflected in the means 16a. As a result, the amount of data that has been copied in units of processing is subtracted, and the remaining amount of data is stored in the remaining copy size holding means 16a. Further, the adder 13b adds the value of the sub-copy size to the value of the copy source address holding means 13a and reflects it to the copy source address holding means 13a. Similarly, the adder 14b adds the value of the sub-copy size to the value of the copy destination address holding unit 14a, and reflects it to the copy destination address holding unit 14a. As a result, the next copy source address and copy destination address of the memory area for which the copy processing for each processing unit has been completed are held in the holding means.

このようにして次処理単位の複写処理のための準備が完了したので、複写処理の実行/終了の判定からの処理を行う。
以上の説明のように、本発明に係るメモリ間複写制御装置1では、残り複写サイズに応じて、最大のデータ幅の副複写サイズで複写処理を実行することができる。例えば、上記の説明の従来のメモリ間複写制御装置において、アクセスアドレス「00000001」から「00000022」に8バイトのデータを複写する場合、1バイト、2バイト、4バイト、1バイトの4回の読み出しと、2バイト、4バイト、2バイトの3回の書き込みが必要であった。これを本発明に係るメモリ間複写制御装置で実行すれば、8バイト1回の読み出しと、8バイト1回の書き込みで複写処理を終了する。
Since the preparation for the copy processing in the next processing unit is completed in this way, the processing from the determination of execution / end of the copy processing is performed.
As described above, the inter-memory copy control apparatus 1 according to the present invention can execute a copy process with a sub-copy size having the maximum data width according to the remaining copy size. For example, in the conventional memory-to-memory copy control device described above, when copying 8 bytes of data from the access address “00000001” to “00000002”, four readings of 1 byte, 2 bytes, 4 bytes, and 1 byte are performed. And writing of 3 times of 2 bytes, 4 bytes and 2 bytes was necessary. If this is executed by the memory-to-memory copy control apparatus according to the present invention, the copying process is completed by reading 8 bytes once and writing 8 bytes once.

このように、本発明によれば、最大のデータ幅を用いて複写処理を行うことができるため、複写処理の高速化が可能となる。
次に、本発明に係るメモリ間複写処理プログラムについて説明する。本発明に係るメモリ間複写処理プログラムを実行するコンピュータは、メモリ間複写制御装置として機能する。図3は、本発明の実施の形態のメモリ間複写処理プログラムによる処理手順を示したフローチャートである。
As described above, according to the present invention, since the copying process can be performed using the maximum data width, the copying process can be speeded up.
Next, an inter-memory copy processing program according to the present invention will be described. The computer that executes the inter-memory copy processing program according to the present invention functions as an inter-memory copy control device. FIG. 3 is a flowchart showing a processing procedure by the inter-memory copy processing program according to the embodiment of the present invention.

コンピュータは、外部から複写指示が入力されると、本発明に係るメモリ間複写処理プログラムによって、以下の処理を実行する。
[ステップS1] 複写指示に含まれる複写元サイズ(初期値)、複写元アドレス(初期値)、複写先アドレス(初期値)を用いて、残り複写サイズ、処理単位ごとの複写元アドレス、複写先アドレスを初期化する。
When a copy instruction is input from the outside, the computer executes the following processing by the memory-to-memory copy processing program according to the present invention.
[Step S1] Using the copy source size (initial value), copy source address (initial value), and copy destination address (initial value) included in the copy instruction, the remaining copy size, copy source address for each processing unit, and copy destination Initialize the address.

[ステップS2] 残りの複写サイズをチェックし、そのデータ量に応じて処理を分岐する。残り複写サイズが8バイト以上であれば、処理をステップS3へ進める。残り複写サイズが7バイトから4バイトであれば、処理をステップS4へ進める。残り複写サイズが3バイトまたは2バイトであれば、処理をステップS5へ進める。残り複写サイズが1バイトであれば、処理をステップS6へ進める。   [Step S2] The remaining copy size is checked, and the process branches according to the amount of data. If the remaining copy size is 8 bytes or more, the process proceeds to step S3. If the remaining copy size is 7 bytes to 4 bytes, the process proceeds to step S4. If the remaining copy size is 3 bytes or 2 bytes, the process proceeds to step S5. If the remaining copy size is 1 byte, the process proceeds to step S6.

[ステップS3] 残り複写サイズが8バイト以上の場合、データ幅(副複写サイズ)を8バイトとして8バイト複写処理を行う。すなわち、8バイトのデータ読み出しと、8バイトのデータ書き込みを行う。   [Step S3] If the remaining copy size is 8 bytes or more, 8-byte copy processing is performed with the data width (sub-copy size) set to 8 bytes. That is, 8-byte data reading and 8-byte data writing are performed.

[ステップS4] 残り複写サイズが7から4バイトの場合、データ幅(副複写サイズ)を4バイトとして4バイト複写処理を行う。すなわち、4バイトのデータ読み出しと、4バイトのデータ書き込みを行う。   [Step S4] If the remaining copy size is 7 to 4 bytes, 4-byte copy processing is performed with the data width (sub-copy size) set to 4 bytes. That is, 4-byte data reading and 4-byte data writing are performed.

[ステップS5] 残り複写サイズが3または2バイトの場合、データ幅(副複写サイズ)を2バイトとして2バイト複写処理を行う。すなわち、2バイトのデータ読み出しと、2バイトのデータ書き込みを行う。   [Step S5] If the remaining copy size is 3 or 2 bytes, 2-byte copy processing is performed with the data width (sub-copy size) set to 2 bytes. That is, 2-byte data reading and 2-byte data writing are performed.

[ステップS6] 残り複写サイズが1バイトの場合、データ幅(副複写サイズ)を1バイトとして1バイト複写処理を行う。すなわち、1バイトのデータ読み出しと、1バイトのデータ書き込みを行う。   [Step S6] When the remaining copy size is 1 byte, 1-byte copy processing is performed with the data width (sub-copy size) set to 1 byte. That is, 1-byte data is read and 1-byte data is written.

[ステップS7] 所定のデータ幅(副複写サイズ)での複写処理が終了し、残り複写サイズ、複写元アドレスおよび複写先アドレスを更新する。そして、残り複写サイズをチェックし、サイズが0かどうかによって処理を続行するか、終了するかを判定する。0である場合には、処理を終了する。0でない場合には、ステップS2に戻って、次の処理を行う。   [Step S7] Copy processing with a predetermined data width (sub-copy size) ends, and the remaining copy size, copy source address, and copy destination address are updated. Then, the remaining copy size is checked, and it is determined whether the processing is continued or finished depending on whether the size is 0 or not. If it is 0, the process is terminated. If it is not 0, the process returns to step S2 to perform the next process.

以上の説明のように、本発明によれば、複写処理の分岐ルーチンは、8バイト複写処理、4バイト複写処理、2バイト複写処理および1バイト複写処理の4種類であり、分岐のための判定も、残り複写サイズとデータ幅とを比較するだけである。このため、分岐判定のための処理時間を短縮することができるほか、処理ルーチンのためのメモリ量を少なくすることができる。また、最大のデータ幅が選択され複写処理を行うため、複写処理の高速化が可能となる。   As described above, according to the present invention, there are four types of copy processing branch routines: 8-byte copy processing, 4-byte copy processing, 2-byte copy processing, and 1-byte copy processing. However, only the remaining copy size is compared with the data width. For this reason, the processing time for branch determination can be shortened, and the memory amount for the processing routine can be reduced. In addition, since the maximum data width is selected and the copying process is performed, the copying process can be speeded up.

なお、上記の処理機能は、コンピュータによって実現することができる。その場合、メモリ間複写制御装置が有すべき機能の処理内容を記述したプログラムが提供される。そのプログラムをコンピュータで実行することにより、上記処理機能がコンピュータ上で実現される。処理内容を記述したプログラムは、コンピュータで読み取り可能な記録媒体に記録しておくことができる。コンピュータで読み取り可能な記録媒体としては、磁気記録装置、光ディスク、光磁気記録媒体、半導体メモリなどがある。磁気記録装置には、ハードディスク装置(HDD)、フレキシブルディスク(FD)、磁気テープなどがある。光ディスクには、DVD(Digital Versatile Disc)、DVD−RAM(Random Access Memory)、CD−ROM(Compact Disc Read Only Memory)、CD−R(Recordable)/RW(ReWritable)などがある。光磁気記録媒体には、MO(Magneto-Optical disk)などがある。   The above processing functions can be realized by a computer. In that case, a program describing the processing contents of the functions that the inter-memory copy control apparatus should have is provided. By executing the program on a computer, the above processing functions are realized on the computer. The program describing the processing contents can be recorded on a computer-readable recording medium. Examples of the computer-readable recording medium include a magnetic recording device, an optical disk, a magneto-optical recording medium, and a semiconductor memory. Examples of the magnetic recording device include a hard disk device (HDD), a flexible disk (FD), and a magnetic tape. Examples of the optical disc include a DVD (Digital Versatile Disc), a DVD-RAM (Random Access Memory), a CD-ROM (Compact Disc Read Only Memory), and a CD-R (Recordable) / RW (ReWritable). Magneto-optical recording media include MO (Magneto-Optical disk).

プログラムを流通させる場合には、たとえば、そのプログラムが記録されたDVD、CD−ROMなどの可搬型記録媒体が販売される。また、プログラムをサーバコンピュータの記憶装置に格納しておき、ネットワークを介して、サーバコンピュータから他のコンピュータにそのプログラムを転送することもできる。   When distributing the program, for example, portable recording media such as a DVD and a CD-ROM in which the program is recorded are sold. It is also possible to store the program in a storage device of a server computer and transfer the program from the server computer to another computer via a network.

プログラムを実行するコンピュータは、たとえば、可搬型記録媒体に記録されたプログラムもしくはサーバコンピュータから転送されたプログラムを、自己の記憶装置に格納する。そして、コンピュータは、自己の記憶装置からプログラムを読み取り、プログラムに従った処理を実行する。   The computer that executes the program stores, for example, the program recorded on the portable recording medium or the program transferred from the server computer in its own storage device. Then, the computer reads the program from its own storage device and executes processing according to the program.

本発明を適用したメモリ間複写制御装置の動作原理を示す説明図である。It is explanatory drawing which shows the operation principle of the copy control apparatus between memory to which this invention is applied. 本発明の実施の形態のメモリ間複写制御装置の構成図である。1 is a configuration diagram of an inter-memory copy control device according to an embodiment of the present invention. FIG. 本発明の実施の形態のメモリ間複写処理プログラムによる処理手順を示したフローチャートである。It is the flowchart which showed the process sequence by the copy processing program between memory of embodiment of this invention. アライメント制約について示した図である。It is the figure shown about the alignment restrictions. 従来のメモリ間複写処理手順を示したフローチャートである。It is the flowchart which showed the conventional copy processing procedure between memory.

符号の説明Explanation of symbols

1 メモリ間複写制御装置
2 メモリアクセス装置
3 メモリ
10 複写制御手段
11 副複写サイズ算出手段
11a 副複写サイズ保持手段
12 複写アドレス算出手段
13 複写元アドレス算出手段
13a 複写元アドレス保持手段
13b 加算器
14 複写先アドレス算出手段
14a 複写先アドレス保持手段
14b 加算器
15 リクエスト発行手段
16a 残り複写サイズ保持手段
16b 減算器



DESCRIPTION OF SYMBOLS 1 Copy control apparatus between memory 2 Memory access apparatus 3 Memory 10 Copy control means 11 Sub copy size calculation means 11a Sub copy size holding means 12 Copy address calculation means 13 Copy source address calculation means 13a Copy source address holding means 13b Adder 14 Copy Destination address calculating means 14a Copy destination address holding means 14b Adder 15 Request issuing means 16a Remaining copy size holding means 16b Subtractor



Claims (4)

複写指示によって、複写元メモリ領域のデータを読み出し、複写先メモリ領域に前記データを書き込むメモリ間複写制御装置において、
複写未完了のデータ量を示す残り複写サイズに応じて処理単位となる副複写サイズを算出する副複写サイズ算出手段と、
前記副複写サイズを用いて処理ごとの前記複写元メモリ領域を示す複写元アドレスと前記複写先メモリ領域を示す複写先アドレスを算出する複写アドレス算出手段と、
所定の記憶装置のメモリ領域をアクセスアドレスとアクセスサイズに関する制約なしに読み出しあるいは書き込みを行うメモリアクセス装置に対し、読み出しまたは書き込み要求を発行するリクエスト発行手段と、
外部から前記複写指示が入力されると前記残り複写サイズ、前記複写元アドレスおよび前記複写先アドレスを初期化するとともに、前記副複写サイズ算出手段および前記複写アドレス算出手段を動作させ、算出された前記副複写サイズと前記複写元アドレスを指定して前記リクエスト発行手段にデータ読み出しを要求し、前記副複写サイズと前記複写先アドレスを指定して前記リクエスト発行手段に読み出されたデータの書き込み要求をして複写処理を制御し、前記副複写サイズを用いて前記残り複写サイズを更新し、前記残り複写サイズに基づいて複写処理の続行/終了を判定する複写制御手段と、
を具備することを特徴とするメモリ間複写制御装置。
In a memory-to-memory copy control device that reads data in a copy source memory area according to a copy instruction and writes the data in a copy destination memory area.
Sub-copy size calculating means for calculating a sub-copy size as a processing unit according to the remaining copy size indicating the amount of unfinished data;
Copy address calculating means for calculating a copy source address indicating the copy source memory area and a copy destination address indicating the copy destination memory area for each process using the sub-copy size;
Request issuing means for issuing a read or write request to a memory access device that reads or writes a memory area of a predetermined storage device without restriction on an access address and an access size;
When the copy instruction is input from the outside, the remaining copy size, the copy source address, and the copy destination address are initialized, and the sub copy size calculating unit and the copy address calculating unit are operated to calculate the calculated A request to read data is requested to the request issuing means by designating a sub-copy size and the source address, and a request to write data read to the request issuing means is designated by designating the sub-copy size and the destination address. Copy control means for controlling copy processing, updating the remaining copy size using the sub-copy size, and determining continuation / termination of copy processing based on the remaining copy size;
An inter-memory copy control apparatus comprising:
前記副複写サイズ算出手段は、
前記残り複写サイズと、予め設定されている処理単位のデータサイズを比較し、前記残り複写サイズを超えない最も大きい前記処理単位のデータサイズを前記副複写サイズとして設定する、
ことを特徴とする請求項1記載のメモリ間複写制御装置。
The sub-copy size calculating means
The remaining copy size is compared with the data size of a preset processing unit, and the largest data size of the processing unit not exceeding the remaining copy size is set as the sub-copy size.
The inter-memory copy control apparatus according to claim 1.
前記複写アドレス算出手段は、
前記複写元アドレスの値を保持する複写元アドレス保持手段と、前記複写元アドレス保持手段の保持する値と前記副複写サイズの値とを加算する加算手段と、を有する複写元アドレス算出手段と、
前記複写先アドレスの値を保持する複写先アドレス保持手段と、前記複写先アドレス保持手段の保持する値と前記副複写サイズの値とを加算する加算手段と、を有する複写先アドレス算出手段と、
を具備することを特徴とする請求項1記載のメモリ間複写制御装置。
The copy address calculating means includes:
A copy source address calculating unit having a copy source address holding unit for holding the value of the copy source address, and an adding unit for adding the value held by the copy source address holding unit and the value of the sub-copy size;
A copy destination address calculating means having a copy destination address holding means for holding the value of the copy destination address; and an adding means for adding the value held by the copy destination address holding means and the value of the sub-copy size;
The inter-memory copy control apparatus according to claim 1, further comprising:
複写指示によって、複写元メモリ領域のデータを読み出し、複写先メモリ領域に前記データを書き込むメモリ領域間の複写処理を行うメモリ間複写処理プログラムにおいて、
コンピュータに、
外部から前記複写指示が入力されると、前記複写指示に基づいて複写未完了のデータ量を示す残り複写サイズ、データ読み出し領域を示す複写元アドレスおよびデータ書き込み領域を示す複写先アドレスを初期化し、
前記残り複写サイズに応じて処理単位となる副複写サイズを算出し、
所定の記憶装置のメモリ領域をアクセスアドレスとアクセスサイズに関する制約なしに読み出しあるいは書き込みを行うメモリアクセス装置に対し、前記副複写サイズと前記複写元アドレスを指定してデータの読み出しを要求して読み出しデータを取得し、
前記副複写サイズと前記複写先アドレスを指定して前記メモリアクセス装置に対し、前記読み出しデータの書き込みを要求して前記副複写サイズ分の複写処理を行い、
前記副複写サイズを用いて前記残り複写サイズ、前記複写元アドレスおよび前記複写先アドレスを更新し、
更新された前記残り複写サイズに基づいて複写処理の続行または終了を判定し、
続行する場合には、前記残り複写サイズに応じて前記副複写サイズの算出からの処理を行う、
手順を実行させることを特徴とするメモリ間複写処理プログラム。
In an inter-memory copy processing program that reads data in a copy source memory area according to a copy instruction and performs a copy process between memory areas that writes the data in a copy destination memory area.
On the computer,
When the copy instruction is input from the outside, the remaining copy size indicating the unfinished data amount based on the copy instruction, the copy source address indicating the data read area, and the copy destination address indicating the data write area are initialized.
Calculate a secondary copy size as a processing unit according to the remaining copy size,
A memory access device that reads or writes a memory area of a predetermined storage device without restrictions on an access address and an access size, specifies the secondary copy size and the copy source address, requests data read, and reads data Get
Specifying the secondary copy size and the copy destination address, requesting the memory access device to write the read data, and performing a copy process for the secondary copy size,
Updating the remaining copy size, the copy source address and the copy destination address using the sub-copy size;
Determine whether to continue or end the copying process based on the updated remaining copy size,
When continuing, processing from the calculation of the sub-copy size according to the remaining copy size,
An inter-memory copy processing program characterized by causing a procedure to be executed.
JP2003313357A 2003-09-05 2003-09-05 Memory copy controller Expired - Fee Related JP4040557B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2003313357A JP4040557B2 (en) 2003-09-05 2003-09-05 Memory copy controller

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2003313357A JP4040557B2 (en) 2003-09-05 2003-09-05 Memory copy controller

Publications (2)

Publication Number Publication Date
JP2005084763A true JP2005084763A (en) 2005-03-31
JP4040557B2 JP4040557B2 (en) 2008-01-30

Family

ID=34414299

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2003313357A Expired - Fee Related JP4040557B2 (en) 2003-09-05 2003-09-05 Memory copy controller

Country Status (1)

Country Link
JP (1) JP4040557B2 (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2009237790A (en) * 2008-03-26 2009-10-15 Yamaha Corp Dma controller
CN113238869A (en) * 2021-05-28 2021-08-10 北京达佳互联信息技术有限公司 Calculation acceleration method, equipment and system and storage medium

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2009237790A (en) * 2008-03-26 2009-10-15 Yamaha Corp Dma controller
CN113238869A (en) * 2021-05-28 2021-08-10 北京达佳互联信息技术有限公司 Calculation acceleration method, equipment and system and storage medium

Also Published As

Publication number Publication date
JP4040557B2 (en) 2008-01-30

Similar Documents

Publication Publication Date Title
US6665747B1 (en) Method and apparatus for interfacing with a secondary storage system
JPWO2004079583A1 (en) Data transfer control device and DMA data transfer control method
US5946708A (en) Automated cache manager for storage devices
JP7088897B2 (en) Data access methods, data access devices, equipment and storage media
JP2560988B2 (en) Information processing apparatus and processing method
US6684267B2 (en) Direct memory access controller, and direct memory access control method
JP4040557B2 (en) Memory copy controller
US6704833B2 (en) Atomic transfer of a block of data
JP4536189B2 (en) DMA transfer apparatus and DMA transfer system
JP2004206424A (en) Data processing device and data transfer method for data processing device
JP6648596B2 (en) File system control device, storage system, file system control method, and program
JP4431492B2 (en) Data transfer unit that supports multiple coherency granules
CN111045961A (en) Data processing method and storage controller using the same
JP3425724B2 (en) System uninterrupted program switching method
TW200809597A (en) Method and system for device to request and operate an external buffer provided from the host
JPS63251835A (en) Vector processor
JPH0468453A (en) Data transfer device
JPH02151930A (en) Storage buffer managing system
JPH05257807A (en) Cache memory controller
JP3154414B2 (en) Semiconductor integrated circuit for signal processing of write-once optical disc
JP4669027B2 (en) Storage system
JP2004227445A (en) Copying method for storage device subsystem and storage device subsystem therefor
JP2008276563A (en) Disk array device and management method
JPH0219495B2 (en)
JPH0526216B2 (en)

Legal Events

Date Code Title Description
A977 Report on retrieval

Free format text: JAPANESE INTERMEDIATE CODE: A971007

Effective date: 20070112

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20070116

A521 Written amendment

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20070319

A131 Notification of reasons for refusal

Free format text: JAPANESE INTERMEDIATE CODE: A131

Effective date: 20070522

A521 Written amendment

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20070723

A02 Decision of refusal

Free format text: JAPANESE INTERMEDIATE CODE: A02

Effective date: 20070814

A521 Written amendment

Free format text: JAPANESE INTERMEDIATE CODE: A523

Effective date: 20071010

A911 Transfer of reconsideration by examiner before appeal (zenchi)

Free format text: JAPANESE INTERMEDIATE CODE: A911

Effective date: 20071018

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: 20071106

A61 First payment of annual fees (during grant procedure)

Free format text: JAPANESE INTERMEDIATE CODE: A61

Effective date: 20071107

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20101116

Year of fee payment: 3

R150 Certificate of patent or registration of utility model

Free format text: JAPANESE INTERMEDIATE CODE: R150

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20101116

Year of fee payment: 3

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20111116

Year of fee payment: 4

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20111116

Year of fee payment: 4

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20121116

Year of fee payment: 5

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20121116

Year of fee payment: 5

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20131116

Year of fee payment: 6

LAPS Cancellation because of no payment of annual fees