JP7822227B2 - Data transfer device and data transfer system including the same - Google Patents
Data transfer device and data transfer system including the sameInfo
- Publication number
- JP7822227B2 JP7822227B2 JP2022056108A JP2022056108A JP7822227B2 JP 7822227 B2 JP7822227 B2 JP 7822227B2 JP 2022056108 A JP2022056108 A JP 2022056108A JP 2022056108 A JP2022056108 A JP 2022056108A JP 7822227 B2 JP7822227 B2 JP 7822227B2
- Authority
- JP
- Japan
- Prior art keywords
- transfer
- time
- data
- request
- transfer request
- 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.)
- Active
Links
Landscapes
- Bus Control (AREA)
Description
本開示は、データ転送装置およびそれを備えたデータ転送システムに関する。 This disclosure relates to a data transfer device and a data transfer system equipped with the same.
計算機システムでは、CPU(Central Processing Unit)と複数の周辺回路とがシステムバスにより接続されており、それぞれの構成要素間でデータ転送が行なわれる。このとき、CPUがシステムバスを直接操作してデータ転送を主体的に実施すると、その間は演算できないので、CPUを介さないDMA(Direct memory Access)によるデータ転送が活用されている。 In a computer system, a CPU (Central Processing Unit) and multiple peripheral circuits are connected by a system bus, and data is transferred between each component. If the CPU were to directly operate the system bus to perform the data transfer, calculations would not be possible during that time, so data transfers using DMA (Direct Memory Access), which does not involve the CPU, are used.
たとえば特開2007-183692号公報(特許文献1)には、DMA転送が行なわれるシステムバスの他に、DMA転送要求を行なうための専用線を設けることにより、システムバスの占有率を下げ、効率的にデータ転送を行なう技術が開示されている。 For example, Japanese Patent Application Laid-Open Publication No. 2007-183692 (Patent Document 1) discloses a technology that reduces the system bus occupancy rate and enables efficient data transfer by providing a dedicated line for making DMA transfer requests in addition to the system bus on which DMA transfers are performed.
従来のDMAによるデータ転送では、複数の構成要素から同時にデータ転送要求がある場合には、予め規定された優先順位に基づいてデータ転送を行なうことが多い。たとえば、第1の周辺回路とのデータ転送は高優先で行なわれ、第2の周辺回路とのデータ転送は低優先で行なわれる。 In conventional DMA data transfers, when multiple components simultaneously request data transfers, the data transfers are often performed based on predefined priorities. For example, data transfers with a first peripheral circuit are performed with high priority, and data transfers with a second peripheral circuit are performed with low priority.
しかしながら、このデータ転送方法では、データ転送の優先度が固定されているので、高優先のデータと低優先のデータとが混在して転送される場合には、適切な優先順位でデータ転送を行なうことができない。 However, with this data transfer method, the priority of data transfer is fixed, so if high-priority data and low-priority data are transferred together, the data cannot be transferred with the appropriate priority.
たとえば、第1の周辺回路が低優先のデータを転送したい場合にも高優先のデータとして転送されてしまい、第2の周辺回路のデータ転送を妨げる恐れがある。また、第1の周辺回路が高優先のデータを転送したいときに、さらに優先度が高く設定されているデータの転送が他の構成要素によって行なわれる場合には、第1の周辺回路のデータ転送が想定より大きく遅延される恐れがある。 For example, even if a first peripheral circuit wishes to transfer low-priority data, it may end up being transferred as high-priority data, which could interfere with the data transfer of a second peripheral circuit. Furthermore, if a first peripheral circuit wishes to transfer high-priority data, and another component is transferring data with an even higher priority, the data transfer of the first peripheral circuit may be delayed longer than expected.
それゆえに、本開示の主たる目的は、優先度の高いデータと優先度の低いデータとが混在している場合でも適切にデータ転送を行なうことが可能なデータ転送装置およびそれを備えたデータ転送システムを提供することである。 Therefore, the primary objective of this disclosure is to provide a data transfer device and a data transfer system equipped with the same that are capable of properly transferring data even when high-priority data and low-priority data are mixed.
本開示のデータ転送装置は、複数の転送要求に従ってデータを転送するデータ転送装置である。各転送要求は、当該転送要求を実行するために必要な転送所要時間に関連する第1の情報と、当該転送要求に対するデータ転送を完了するまでに許容される最大時間である転送許容時間を示す第2の情報とを含む。このデータ転送装置は、各転送要求の前記第1および第2の情報に基づいて、複数の転送要求を実行する順序を設定する計算部と、計算部によって設定された順序で複数の転送要求を実行する転送コントロール回路とを備えたものである。 The data transfer device disclosed herein is a data transfer device that transfers data in accordance with multiple transfer requests. Each transfer request includes first information related to the required transfer time to execute the transfer request, and second information indicating the allowed transfer time, which is the maximum time allowed for completing the data transfer for that transfer request. This data transfer device includes a calculation unit that sets the order in which the multiple transfer requests will be executed based on the first and second information for each transfer request, and a transfer control circuit that executes the multiple transfer requests in the order set by the calculation unit.
本開示のデータ転送装置では、各転送要求毎に転送要求を実行する順序を設定するようにしたので、優先度の高いデータと優先度の低いデータとが混在しても適切にデータ転送を行なうことができる。 The data transfer device disclosed herein sets the order in which transfer requests are executed for each transfer request, allowing for appropriate data transfer even when high-priority data and low-priority data are mixed.
実施の形態1.
図1は、本実施の形態1に従うデータ転送システムの構成を示すブロック図である。このデータ転送システムでは、各構成要素が優先度の高いデータと優先度の低いデータとを混在して転送したい場合には、優先度の高いデータから転送される。図1において、このデータ転送システムは、DMA部1、システムバス2、RAM(Random Access Memory)3、周辺回路4,5、およびMPU(Micro Processor Unit)6を備える。
Embodiment 1.
1 is a block diagram showing the configuration of a data transfer system according to the first embodiment. In this data transfer system, when each component wishes to transfer a mixture of high-priority data and low-priority data, the data with the highest priority is transferred first. In FIG. 1, this data transfer system includes a DMA unit 1, a system bus 2, a RAM (Random Access Memory) 3, peripheral circuits 4 and 5, and an MPU (Micro Processor Unit) 6.
DMA部1(データ転送装置)は、ある構成要素から他の構成要素へデータ転送を行なう際に用いられる回路である。周辺回路4,5の各々は、DMA部1にデータ転送要求を出力するブロックである。周辺回路4,5としては、たとえば、GPU(Graphics Processing Unit)、FPGA(Field Programmable Gate Array)、外部と通信を行なうIF(interface)等が挙げられる。MPU6は、CPUを含み、種々の演算および制御を行なう。このデータ転送システムでは、MPU6のCPUを介さないDMAによるデータ転送が行なわれる。 DMA unit 1 (data transfer device) is a circuit used when transferring data from one component to another. Peripheral circuits 4 and 5 are blocks that output data transfer requests to DMA unit 1. Examples of peripheral circuits 4 and 5 include a GPU (Graphics Processing Unit), FPGA (Field Programmable Gate Array), and IF (Interface) for communicating with the outside world. MPU 6 includes a CPU and performs various calculations and controls. In this data transfer system, data is transferred by DMA without going through the CPU of MPU 6.
一般的なデータ転送システムでは、データ転送要求は、転送元アドレス、転送先アドレス、転送データ容量を含む。転送データ容量は、転送所要時間TRに関連する第1の情報の一実施例を構成する。本実施の形態1では、データ転送要求は、さらに転送許容時間TAを示す第2の情報を含む。転送所要時間TRおよび転送許容時間TAについては後述する。 In a typical data transfer system, a data transfer request includes a source address, a destination address, and a transfer data capacity. The transfer data capacity constitutes one example of first information related to the required transfer time TR. In this first embodiment, the data transfer request further includes second information indicating the allowable transfer time TA. The required transfer time TR and the allowable transfer time TA will be described later.
RAM3は、DMA部1、周辺回路4、周辺回路5、MPU6によって共用されるメモリである。RAM3は、DMA部1からのデータ転送要求に応じて、データの書き込みおよび読み出しを行なう。本実施の形態1では、周辺回路4と周辺回路と5がシステムバス2を経由してDMA部1にデータ転送要求を送信し、DMA部1がRAM3にデータ転送を行なう。 RAM 3 is memory shared by DMA unit 1, peripheral circuit 4, peripheral circuit 5, and MPU 6. RAM 3 writes and reads data in response to a data transfer request from DMA unit 1. In this embodiment 1, peripheral circuits 4 and 5 send data transfer requests to DMA unit 1 via system bus 2, and DMA unit 1 transfers the data to RAM 3.
DMA部1は、転送許容時間保持部11、データバッファ12、BUS/IF(Interface)13、転送所要時間計算部14、転送コントロール回路15、転送時間カウンタ16、ディスティネーションアドレスポインタ17、およびソースアドレスポインタ18を含む。以下では、転送許容時間保持部11および転送所要時間計算部14をそれぞれ単に「保持部11」および「計算部14」と称する場合がある。 The DMA unit 1 includes an allowable transfer time holding unit 11, a data buffer 12, a BUS/IF (Interface) 13, a required transfer time calculation unit 14, a transfer control circuit 15, a transfer time counter 16, a destination address pointer 17, and a source address pointer 18. Hereinafter, the allowable transfer time holding unit 11 and the required transfer time calculation unit 14 may be simply referred to as the "holding unit 11" and the "calculation unit 14," respectively.
データバッファ12は、転送コントロール回路15によってデータ転送元から読み出されたデータを一時的に格納する。また、データバッファ12は、転送コントロール回路15から書き込み要求が出力されると、当該データバッファ12に格納されたデータを転送先に対して書き込む。 The data buffer 12 temporarily stores data read from the data source by the transfer control circuit 15. Furthermore, when a write request is output from the transfer control circuit 15, the data buffer 12 writes the data stored in the data buffer 12 to the transfer destination.
BUS/IF13は、システムバス2とデータバッファ12とのバスプロトコルをそろえるブロックである。システムバス2の規格に合わせて、BUS/IF13は、転送方法、データ容量といった転送に必要なルールに則り、信号を授受する。 BUS/IF 13 is a block that aligns the bus protocol between the system bus 2 and the data buffer 12. In accordance with the system bus 2 standard, BUS/IF 13 exchanges signals in accordance with the rules required for transfer, such as transfer method and data capacity.
保持部11は、転送要求元から転送される転送許容時間TAを保持し、その転送許容時間TAを計算部14に出力する。計算部14は、転送所要時間TRを計算する。転送所要時間TRとは、転送要求元からの転送要求をDMA部1が受信してから、DMA部1が転送要求元に完了通知を送るまでに必要な時間のことである。 The holding unit 11 holds the allowable transfer time TA for transfer from the transfer request source and outputs this allowable transfer time TA to the calculation unit 14. The calculation unit 14 calculates the required transfer time TR. The required transfer time TR is the time required from when the DMA unit 1 receives a transfer request from the transfer request source until the DMA unit 1 sends a completion notification to the transfer request source.
計算部14は、転送コントロール回路15から送信された計算要求、転送データ容量、転送要求、および現在の転送順と、バスプロトコル(バスビット幅、バースト長、転送間隔等)の情報とに基づいて、転送所要時間TRを計算する。転送所要時間TRの計算方法については後述する。 The calculation unit 14 calculates the required transfer time TR based on the calculation request, transfer data capacity, transfer request, and current transfer order sent from the transfer control circuit 15, as well as information on the bus protocol (bus bit width, burst length, transfer interval, etc.). The method for calculating the required transfer time TR will be described later.
また、計算部14は、保持部11から各データ転送要求の転送許容時間TAを受け取り、転送許容時間TA内に転送が終了するか否かを判断する。転送所要時間TRが転送許容時間TAを超えている場合には、要求された許容時間TA内にデータ転送を完了することができないので、転送要求元(本例では周辺回路4,5)にエラーを通知する。 The calculation unit 14 also receives the allowable transfer time TA for each data transfer request from the holding unit 11 and determines whether the transfer will be completed within the allowable transfer time TA. If the required transfer time TR exceeds the allowable transfer time TA, the data transfer cannot be completed within the requested allowable transfer time TA, and an error is notified to the transfer request source (peripheral circuits 4 and 5 in this example).
また、計算部14は、転送所要時間TRと転送許容時間TAとの関係にかかわらず、転送所要時間TRの計算結果から求めた転送順を転送コントロール回路15に新たな転送順として応答する。すなわち、計算部14は、現在の転送順と転送所要時間TRの再計算結果とから適切な転送順を再検討し、新しい転送順として応答する。 In addition, regardless of the relationship between the required transfer time TR and the allowable transfer time TA, the calculation unit 14 responds to the transfer control circuit 15 with the transfer order determined from the calculation result of the required transfer time TR as the new transfer order. In other words, the calculation unit 14 reconsiders the appropriate transfer order based on the current transfer order and the recalculation result of the required transfer time TR, and responds with the new transfer order.
転送が行なわれている間に第2、第3の転送要求がDMA部1に入力された場合、計算部14は、転送所要時間TRの再計算を行なう。計算部14は、その結果から現在の転送順に対して、新しく入力された転送要求をどの順番に挿入するかを判断し、その結果求められた新しい転送順を転送コントロール回路15に通知する。計算部14の詳細な動作については後述する。 If a second or third transfer request is input to the DMA unit 1 while a transfer is in progress, the calculation unit 14 recalculates the required transfer time TR. Based on the result, the calculation unit 14 determines in what order the newly input transfer requests should be inserted into the current transfer order, and notifies the transfer control circuit 15 of the new transfer order determined as a result. The detailed operation of the calculation unit 14 will be described later.
転送コントロール回路15は、周辺回路4,5からDMA部1に対して転送要求があった場合に、システムバス2の占有権を取得し、データバッファ12から転送するデータをRAM3や周辺回路4,5へ出力する。 When a transfer request is made to the DMA unit 1 from the peripheral circuits 4 and 5, the transfer control circuit 15 acquires the right to use the system bus 2 and outputs the data to be transferred from the data buffer 12 to the RAM 3 and the peripheral circuits 4 and 5.
また、転送コントロール回路15は、周辺回路4,5等からの転送要求を受信した時に転送時間カウンタ16に対して起動命令を出力する。また、転送コントロール回路15は、計算部14に転送所要時間TRの計算命令と、現在保持している転送順とを出力する。また、転送コントロール回路15は、計算部14から受信した転送順を保持する。 In addition, the transfer control circuit 15 outputs a start command to the transfer time counter 16 when it receives a transfer request from the peripheral circuits 4, 5, etc. The transfer control circuit 15 also outputs a calculation command for the required transfer time TR to the calculation unit 14, as well as the currently held transfer order. The transfer control circuit 15 also holds the transfer order received from the calculation unit 14.
転送時間カウンタ16(計時部)は、DMA部1の周辺の構成要素からの転送要求が到着した際に、その到着から経過した時間を計測する。この経過時間は、後述する「処理済み時間」に該当し、第2のデータ転送要求が到着した場合に、第1の転送許容時間TAからカウンタによって計測した時間を減算した値である転送残り時間を参照するために用いられる。転送時間カウンタ16は、複数の転送要求が到着した場合に、それぞれの転送残り時間を計算するため、一度の転送中に発生する転送要求の最大の数のカウンタを持つ。 When a transfer request arrives from a peripheral component of the DMA unit 1, the transfer time counter 16 (timekeeping unit) measures the time that has elapsed since that request. This elapsed time corresponds to the "processed time" described below, and is used to reference the remaining transfer time, which is the value obtained by subtracting the time measured by the counter from the first transfer allowable time TA, when a second data transfer request arrives. When multiple transfer requests arrive, the transfer time counter 16 calculates the remaining transfer time for each, and therefore has a counter for the maximum number of transfer requests that can occur during a single transfer.
ディスティネーションアドレスポインタ17は、転送先のアドレスを示す。ソースアドレスポインタ18は、転送元のアドレスを示す。転送コントロール回路15は、ソースアドレスポインタ18によって示される転送元アドレスからディスティネーションアドレスポインタ17によって示される転送先アドレスにデータを転送する。 The destination address pointer 17 indicates the address of the transfer destination. The source address pointer 18 indicates the address of the transfer source. The transfer control circuit 15 transfers data from the source address indicated by the source address pointer 18 to the destination address indicated by the destination address pointer 17.
本実施の形態1におけるDMA部1は、転送要求元(本例では周辺回路4,5)から、一般的なDMAにはない転送許容時間TAという追加の制約を受け取ることにより、データ転送の優先順位を柔軟に決定してデータを転送することを特徴としている。 The DMA unit 1 in this first embodiment is characterized by receiving an additional constraint, the transfer allowable time TA, from the transfer request source (peripheral circuits 4 and 5 in this example), which is not present in general DMA, allowing it to flexibly determine the priority of data transfers and transfer data accordingly.
ここで、転送許容時間TAとは、転送要求元がデータ転送を要求したタイミングから、そのデータ転送が完了した旨の通知をその転送要求元が受け取るまでの、許容可能な最大の時間である。すなわち、転送許容時間TAとは、転送要求元が要求したデータ転送が完了していなければならない制限時間を意味する。各転送要求元は、優先度の高いデータ転送要求では転送許容時間TAを小さく設定し、優先度が低いデータ転送要求では転送許容時間TAを大きく設定する。 Here, the allowed transfer time TA is the maximum allowable time from when a transfer request source requests a data transfer until the transfer request source receives notification that the data transfer has completed. In other words, the allowed transfer time TA is the time limit within which the data transfer requested by the transfer request source must be completed. Each transfer request source sets a short allowed transfer time TA for high-priority data transfer requests and a long allowed transfer time TA for low-priority data transfer requests.
DMA部1は、転送許容時間TAと関連情報(後述する転送所要時間TRなど)とを基に、データ転送要求毎に転送許容時間TA内にデータ転送が完了するように、どのデータ転送要求から順番に実行するべきかを優先制御する。 The DMA unit 1 prioritizes the order in which data transfer requests should be executed, based on the allowable transfer time TA and related information (such as the required transfer time TR, described below), so that the data transfer for each data transfer request is completed within the allowable transfer time TA.
許容時間TA内に転送が間に合わない場合には、DMA部1は、転送が間に合わないことをエラーとして転送要求元に通知する。この転送許容時間TAを採用することにより、DMA部1内で複数のデータ転送要求から最も優先度の高い転送要求を判定することができ、優先度の混在したデータ転送においても優先度の高い転送を優先して実行することができる。 If the transfer cannot be completed within the allowed time TA, the DMA unit 1 notifies the transfer request source that the transfer cannot be completed in time as an error. By adopting this allowed transfer time TA, the DMA unit 1 can determine the highest priority transfer request from multiple data transfer requests, and can prioritize the highest priority transfer even when data transfers with mixed priorities are performed.
図2は、このデータ転送システムのデータ転送動作を示す図である。図2では、2つの転送要求元RS1(本例では周辺回路4)および転送要求元RS2(本例では周辺回路5)からデータ転送要求があり、転送要求元RS1および転送要求元RS2から転送データを読み出し、同じRAM3に書き込む場合を考える。実際に本データ転送システムを利用する場合には、データ転送要求元、転送元(ソースアドレス)、転送先(ディスティネーションアドレス)、構成要素の数と種類は問わない。 Figure 2 shows the data transfer operation of this data transfer system. In Figure 2, we consider a case where there are data transfer requests from two transfer request sources, RS1 (peripheral circuit 4 in this example) and RS2 (peripheral circuit 5 in this example), and the transfer data is read from transfer request source RS1 and transfer request source RS2 and written to the same RAM 3. When actually using this data transfer system, the data transfer request source, transfer source (source address), transfer destination (destination address), and the number and type of components are not important.
データ転送要求元RS1から転送コントロール回路15へデータ転送要求R1が送られた場合、まず、転送コントロール回路15は、転送時間カウンタ16内のカウンタC1に起動命令を出力し、カウンタC1は、データ転送要求R1の受付時点からの時間をカウントする。この転送時間カウンタ16および転送コントロール回路15は、第2のデータ転送要求R2が発生した場合に、転送要求R1,R2の優先順位を判定する計算を行なうために必要となる。 When a data transfer request R1 is sent from data transfer request source RS1 to transfer control circuit 15, transfer control circuit 15 first outputs a start command to counter C1 in transfer time counter 16, and counter C1 counts the time from the time data transfer request R1 was accepted. This transfer time counter 16 and transfer control circuit 15 are required to perform calculations to determine the priority of transfer requests R1 and R2 when a second data transfer request R2 occurs.
また同時に、転送コントロール回路15は、保持部11に転送許容時間TA1を書き込む。保持部11は、その転送許容時間TA1を計算部14に通知する。その後、転送コントロール回路15は、計算部14へ転送所要時間TR1を計算するよう要求する。この転送所要時間TR1は、転送要求元RS1からデータ転送要求R1を受け取り、転送先(RAM3)へのデータ転送が完了するまでにかかる時間である。 At the same time, the transfer control circuit 15 writes the allowable transfer time TA1 to the holding unit 11. The holding unit 11 notifies the calculation unit 14 of the allowable transfer time TA1. The transfer control circuit 15 then requests the calculation unit 14 to calculate the required transfer time TR1. This required transfer time TR1 is the time required from receiving the data transfer request R1 from the transfer request source RS1 until the data transfer to the transfer destination (RAM3) is completed.
転送所要時間TR1は、転送データ容量、システム周波数、バスプロトコル(バスビット幅、バースト長、転送間隔等)の値から計算される。転送データ容量は、転送要求元RS1が指定するデータD1の大きさである。システム周波数は、DMA部1自体を動作させているクロック周波数であり、システム設計で定められている。バースト長は、バスプロトコルに応じて規定されている1回のトランザクション(読み出しおよび書き込み)で転送できるデータサイズである。転送間隔は、複数のトランザクションを連続的に発行する際に、前回のトランザクションの終了から今回のトランザクションの開始までの間に、空けなければいけない時間である。 The transfer time TR1 is calculated from the transfer data capacity, system frequency, and bus protocol (bus bit width, burst length, transfer interval, etc.). The transfer data capacity is the size of data D1 specified by transfer request source RS1. The system frequency is the clock frequency that operates DMA unit 1 itself, and is determined by the system design. The burst length is the data size that can be transferred in one transaction (read and write), as determined by the bus protocol. The transfer interval is the time that must be left between the end of the previous transaction and the start of the current transaction when multiple transactions are issued consecutively.
システム周波数とバスプロトコルにより、データ転送の単位時間当たりの転送レート(bit/sec)が算出される。そして、転送データ容量(bit)を転送レートで除算することにより、転送所要時間TRが算出される。計算部14(図1)は、このようにデータ転送要求の情報から転送所要時間TRを計算し、その結果から求めた転送順を転送コントロール回路15に通知する。 The transfer rate (bits/sec) per unit time of data transfer is calculated from the system frequency and bus protocol. The required transfer time TR is then calculated by dividing the transfer data capacity (bits) by the transfer rate. The calculation unit 14 (Figure 1) calculates the required transfer time TR from the data transfer request information in this way, and notifies the transfer control circuit 15 of the transfer order determined from the result.
ここで、転送レートをRt[bit/sec]とし、バスのデータビット幅をWbとし、バースト長をLbとし、1バースト当たりに必要なクロック数をNc[clk]とし、システム周波数をFs[clk/sec]とし、転送間隔をDt[sec]とすると、Rt=(Wb×Lb)/[(Nc/Fs)+Dt]となる。また、転送所要時間をTR[sec]とし、転送データ容量をDc[bit]とすると、TR=Dc/Rtとなる。 Here, if the transfer rate is Rt [bit/sec], the bus data bit width is Wb, the burst length is Lb, the number of clocks required per burst is Nc [clk], the system frequency is Fs [clk/sec], and the transfer interval is Dt [sec], then Rt = (Wb x Lb) / [(Nc/Fs) + Dt]. Furthermore, if the time required for transfer is TR [sec] and the transfer data capacity is Dc [bit], then TR = Dc/Rt.
計算部14は、計算した転送所要時間TR1と、保持部11から通知された転送許容時間TA1とを比較し、TR1≦TA1である場合、転送コントロール回路15に転送順を応答する。この時点では1つの転送要求R1だけしか存在しないので、計算部14から転送コントロール回路15に送られる転送順は、転送要求R1がされたデータD1を1番目に転送する旨を示す。その後、転送コントロール回路15は、データ転送元(本例では転送要求元RS1)からデータD1を読み出し、そのデータD1をデータバッファ12に格納する。なお、TR1>TA1である場合の動作については後述する(図4)。 The calculation unit 14 compares the calculated required transfer time TR1 with the allowable transfer time TA1 notified by the holding unit 11, and if TR1≦TA1, it responds with the transfer order to the transfer control circuit 15. Since there is only one transfer request R1 at this point, the transfer order sent from the calculation unit 14 to the transfer control circuit 15 indicates that data D1 for which transfer request R1 was made will be transferred first. The transfer control circuit 15 then reads data D1 from the data transfer source (transfer request source RS1 in this example) and stores that data D1 in the data buffer 12. Note that the operation when TR1>TA1 will be described later (Figure 4).
次に、転送コントロール回路15は、データバッファ12から転送先(本例ではRAM3)への転送処理を開始する。具体的には、転送コントロール回路15は、データバッファ12から一度に転送可能なデータ容量だけ転送データを受け取り、RAM3に書き込みを開始する。一度に転送可能なデータ容量は、バスプロトコルに依存する。 Next, the transfer control circuit 15 starts the transfer process from the data buffer 12 to the transfer destination (RAM3 in this example). Specifically, the transfer control circuit 15 receives the transfer data from the data buffer 12 in the amount that can be transferred at one time, and starts writing it to RAM3. The amount of data that can be transferred at one time depends on the bus protocol.
データ転送要求元RS1から転送データD1を読み出してデータバッファ12に格納する動作とRAM3に書き込む動作とに関し、図2ではデータバッファ12にすべてのデータD1が書き込まれた後にRAM3にデータD1を書き込んでいるが、データの読み出しチャネルと書き込みチャネルとが独立しているバスプロトコル等であれば、2つの動作を並列に行なってもよい。 Regarding the operation of reading transfer data D1 from data transfer request source RS1 and storing it in data buffer 12, and the operation of writing it to RAM 3, in Figure 2, data D1 is written to RAM 3 after all data D1 has been written to data buffer 12, but if the bus protocol or the like has independent data read and write channels, the two operations may be performed in parallel.
次に、データ転送要求R1に基づくデータ転送の実行中に、データ転送要求元RS2から第2のデータ転送要求R2が発生したとする。その場合、転送コントロール回路15は、RAM3へのデータ書き込みを一時停止し、データ転送を一時中断する。また同時に、転送コントロール回路15は、転送時間カウンタ16内のカウンタC2を起動させ、保持部11に転送許容時間TA2を書き込む。 Next, suppose that a second data transfer request R2 is issued from data transfer request source RS2 while data transfer based on data transfer request R1 is in progress. In this case, transfer control circuit 15 temporarily stops writing data to RAM3 and suspends the data transfer. At the same time, transfer control circuit 15 activates counter C2 in transfer time counter 16 and writes the allowed transfer time TA2 to holding unit 11.
その後、転送コントロール回路15は、計算部14に転送所要時間TR1,TR2を計算するように命令する。この場合、転送所要時間TR1については再計算となる。このとき、転送要求R1に対して既にある程度のデータ転送を完了しているので、計算部14は、計算式中の転送データ容量を、残りの転送しなければならないデータ容量(データ残量)に置き換えて計算する。データD1の残量は、データバッファ12から計算部14に通知される。 The transfer control circuit 15 then commands the calculation unit 14 to calculate the required transfer times TR1 and TR2. In this case, the required transfer time TR1 is recalculated. At this point, a certain amount of data has already been transferred in response to transfer request R1, so the calculation unit 14 replaces the transfer data capacity in the calculation formula with the remaining amount of data that must be transferred (remaining data amount). The remaining amount of data D1 is notified to the calculation unit 14 by the data buffer 12.
また同時に、転送コントロール回路15は、複数の転送要求の中から優先度に応じた新たな転送順を計算部14によって算出するため、転送時間カウンタ16内のカウンタC1,C2に対して、それぞれが測定していた時間を処理済み時間TP1,TP2として計算部14へ出力するように、カウント値出力命令を出力する。また、保持部11は、計算部14に転送許容時間TA1,TA2を通知する。 At the same time, the transfer control circuit 15 outputs a count value output command to counters C1 and C2 in the transfer time counter 16 to output the times they have measured as processed times TP1 and TP2 to the calculation unit 14, so that the calculation unit 14 can calculate a new transfer order according to the priority from among the multiple transfer requests. The holding unit 11 also notifies the calculation unit 14 of the allowed transfer times TA1 and TA2.
ここで、計算部14が計算を行なった結果、以下の条件(1)が偽となり、かつ条件(2)が真となる場合を考える。
条件(1):TR1+TR2≦TA2-TP2
条件(2):TR1+TR2≦TA1-TP1
Here, consider a case where, as a result of calculation by the calculation unit 14, the following condition (1) is false and the following condition (2) is true.
Condition (1): TR1+TR2≦TA2-TP2
Condition (2): TR1+TR2≦TA1-TP1
このとき、条件(1)が偽であることは、残りの所要時間(TR1+TR2)が残りの許容時間(TA2-TP2)よりも大きいので、残りの許容時間(TA2-TP2)以内にデータD2の転送を終了するためには、データD2をデータD1よりも先に転送しなければならないことを意味する。 In this case, if condition (1) is false, it means that the remaining required time (TR1 + TR2) is greater than the remaining allowable time (TA2 - TP2), and therefore data D2 must be transferred before data D1 in order to complete the transfer of data D2 within the remaining allowable time (TA2 - TP2).
また、条件(2)が真であることは、残りの所要時間(TR1+TR2)が残りの許容時間(TA1-TP1)以下であることを表し、残りの許容時間(TA1-TP1)以内にデータD1の転送を終了するためには、データD2とデータD1の転送順序はどちらでもよいことを意味する。 Furthermore, if condition (2) is true, it means that the remaining required time (TR1 + TR2) is less than or equal to the remaining allowable time (TA1 - TP1), and that the order in which data D2 and data D1 are transferred can be either, as long as the transfer of data D1 is completed within the remaining allowable time (TA1 - TP1).
したがって、条件(1)が偽となり、かつ条件(2)が真となる場合には、計算部14は、データD2をデータD1よりも先に転送する必要があると判断し、その旨を示す情報を転送順として転送コントロール回路15に送信する。 Therefore, if condition (1) is false and condition (2) is true, the calculation unit 14 determines that data D2 needs to be transferred before data D1, and sends information indicating this to the transfer control circuit 15 as the transfer order.
換言すると、計算部14は、再計算した転送所要時間TR1と、転送要求R1の開始前に予定されている他の転送要求R2を実行するために必要な待ち時間TR2との和が転送要求R1の転送許容時間(TA1-TP1)内に収まるように、転送要求R1,R2を実行する順序を設定する。 In other words, the calculation unit 14 sets the order in which transfer requests R1 and R2 are executed so that the sum of the recalculated required transfer time TR1 and the waiting time TR2 required to execute another transfer request R2 scheduled before the start of transfer request R1 falls within the allowable transfer time (TA1-TP1) for transfer request R1.
転送所要時間TRからどの転送要求を優先して送信するかのさらなる詳細については後述する。条件(1)が偽であり、かつ条件(2)が真である場合、転送コントロール回路15は、計算部14から転送順(データD2をデータD1よりも優先して転送するという情報)を受けとり、その後、転送要求元RS2からデータD2を読み出し、そのデータD2をRAM3に書き込む。このとき、転送コントロール回路15は、データD1と同様に、転送要求元RS2から読み出したデータD2をデータバッファ12に書き込み、データバッファ12から読み出されたデータD2をRAM3に書き込む。 Further details on which transfer request is given priority based on the required transfer time TR will be discussed later. If condition (1) is false and condition (2) is true, the transfer control circuit 15 receives the transfer order (information that data D2 will be transferred with priority over data D1) from the calculation unit 14, then reads data D2 from the transfer request source RS2 and writes that data D2 to RAM3. At this time, the transfer control circuit 15 writes data D2 read from transfer request source RS2 to data buffer 12, just like data D1, and writes data D2 read from data buffer 12 to RAM3.
RAM3に対してデータD2の書き込みが終了した場合、転送コントロール回路15は、データ転送要求元RS2へデータ転送が完了したことを通知する。また同時に、転送コントロール回路15は、転送時間カウンタ16へカウンタC2の停止命令を出力する。 When writing of data D2 to RAM3 is complete, the transfer control circuit 15 notifies the data transfer request source RS2 that the data transfer is complete. At the same time, the transfer control circuit 15 outputs a command to the transfer time counter 16 to stop counter C2.
その後、転送コントロール回路15は、中断していたデータD1の書き込みを再開する。転送コントロール回路15は、データD1の書き込みが完了し、データ転送要求元RS1へデータ転送完了通知を出力した場合、同時に転送時間カウンタ16内のカウンタC1に対して初期化命令を出力する。 Then, the transfer control circuit 15 resumes the interrupted writing of data D1. When the transfer control circuit 15 completes writing of data D1 and outputs a data transfer completion notification to the data transfer request source RS1, it simultaneously outputs an initialization command to counter C1 in the transfer time counter 16.
図3は、このデータ転送システムのデータ転送動作を示す他の図である。図3では、データ転送要求R1の実行中にデータ転送要求R2が発生したとき、転送要求R1を優先し、次に転送要求R2を実施する場合の動作が示されている。この動作は、データ転送要求R2が発生するまでは図2で示した動作と同じであるが、その後に計算部14が転送要求R1を優先して実行すると判断する点で、図2で示した動作と異なる。 Figure 3 is another diagram showing the data transfer operation of this data transfer system. Figure 3 shows the operation when, when data transfer request R2 occurs while data transfer request R1 is being executed, transfer request R1 is given priority and transfer request R2 is executed next. This operation is the same as the operation shown in Figure 2 until data transfer request R2 occurs, but differs from the operation shown in Figure 2 in that the calculation unit 14 then determines that transfer request R1 should be executed with priority.
すなわち、データ転送要求元RS2から転送要求R2が転送コントロール回路15に送信されると、転送コントロール回路15は、計算部14に転送所要時間TR1,TR2の再計算命令を出力する。 That is, when a transfer request R2 is sent from data transfer request source RS2 to transfer control circuit 15, transfer control circuit 15 outputs a command to calculation unit 14 to recalculate required transfer times TR1 and TR2.
ここで、計算部14が転送所要時間TR1,TR2の再計算を行なった結果、以下の条件(1)が真であり、かつ条件(3)が真となる場合を考える。
条件(1):TR1+TR2≦TA2-TP2
条件(3):TA1-TP1-TR1≦TA2-TP2-TR2
Here, consider a case where, as a result of the calculation unit 14 recalculating the required transfer times TR1 and TR2, the following condition (1) is true and the following condition (3) is true.
Condition (1): TR1+TR2≦TA2-TP2
Condition (3): TA1-TP1-TR1≦TA2-TP2-TR2
条件(1)が真であることは、残りの所要時間(TR1+TR2)が残りの許容時間(TA2-TP2)以下であることを表し、残りの許容時間(TA2-TP2)以内にデータD2の転送を終了するためには、データD1とデータD2の転送順序はどちらでもよいことを意味する。 Condition (1) being true means that the remaining required time (TR1 + TR2) is less than or equal to the remaining allowable time (TA2 - TP2), and that the order in which data D1 and data D2 are transferred can be either, as long as the transfer of data D2 is completed within the remaining allowable time (TA2 - TP2).
また、条件(3)は、残りの許容時間(TA1-TP1)と所要時間TR1との差(すなわちデータD1の転送の余裕となる時間)が、残りの許容時間(TA2-TP2)と所要時間TR2との差(すなわちデータD2の転送の余裕となる時間)以下であることを表している。したがって、計算部14は、データD1をデータD2よりも先に転送する必要があると判断し、その転送順を転送コントロール回路15に送信する。 Furthermore, condition (3) indicates that the difference between the remaining allowable time (TA1-TP1) and the required time TR1 (i.e., the time available for transferring data D1) is less than or equal to the difference between the remaining allowable time (TA2-TP2) and the required time TR2 (i.e., the time available for transferring data D2). Therefore, the calculation unit 14 determines that data D1 needs to be transferred before data D2, and transmits this transfer order to the transfer control circuit 15.
この場合、転送所要時間TR2と、転送要求R2の開始前に予定されている他の転送要求R1を実行するために必要な待ち時間TR1との和(TR2+TR1)は、転送要求R2の残りの許容時間(TA2-TP2)内に収まる。 In this case, the sum of the required transfer time TR2 and the waiting time TR1 required to execute another transfer request R1 scheduled before the start of transfer request R2 (TR2 + TR1) falls within the remaining allowable time for transfer request R2 (TA2 - TP2).
転送コントロール回路15は、計算部14からの転送順に従って、RAM3に対するデータD1の書き込みを再開する。データD1の転送の完了後、転送コントロール回路15は、データ転送要求元RS1へデータ転送完了通知を転送し、データD2の転送を開始する。RAM3に対するデータD2の転送の完了後、転送コントロール回路15は、データ転送要求元RS2へデータD2の転送完了通知を送信する。 The transfer control circuit 15 resumes writing data D1 to RAM3 in the order of transfer from the calculation unit 14. After the transfer of data D1 is complete, the transfer control circuit 15 transfers a data transfer completion notification to the data transfer request source RS1 and starts transferring data D2. After the transfer of data D2 to RAM3 is complete, the transfer control circuit 15 sends a data D2 transfer completion notification to the data transfer request source RS2.
一方、条件(1)が真であり、かつ条件(3)が偽である場合、データD1の転送の余裕となる時間が、データD2の転送の余裕となる時間よりも大きい。したがって、計算部14は、データD2をデータD1よりも先に転送する必要があると判断し、その転送順を転送コントロール回路15に送信する。この場合、転送コントロール回路15の動作は図2と同様になる。また、転送所要時間TR2が、データD1の転送を再開するまでの待ち時間となる。 On the other hand, if condition (1) is true and condition (3) is false, the available time for transferring data D1 is greater than the available time for transferring data D2. Therefore, the calculation unit 14 determines that data D2 needs to be transferred before data D1, and transmits this transfer order to the transfer control circuit 15. In this case, the operation of the transfer control circuit 15 is the same as in Figure 2. Furthermore, the transfer time TR2 is the waiting time until the transfer of data D1 is resumed.
図4は、このデータ転送システムのデータ転送動作を示すさらに他の図である。図4では、転送要求元RS1からの最初の転送要求R1に応答して計算部14によって計算された転送所要時間TR1が転送許容時間TA1を超えている場合(TR1>TA1)の動作が示されている。 Figure 4 is yet another diagram showing the data transfer operation of this data transfer system. Figure 4 shows the operation when the required transfer time TR1 calculated by the calculation unit 14 in response to the first transfer request R1 from the transfer request source RS1 exceeds the allowable transfer time TA1 (TR1 > TA1).
転送要求元RS1が転送コントロール回路15へ転送先のアドレス、転送元のアドレス、転送データD1の容量、転送許容時間TA1を送信すると、転送コントロール回路15は、転送時間カウンタ16内のカウンタC1にカウンタ起動命令を出力し、保持部11に転送許容時間TA1を書き込む。 When the transfer request source RS1 sends the destination address, source address, size of transfer data D1, and allowable transfer time TA1 to the transfer control circuit 15, the transfer control circuit 15 outputs a counter start command to counter C1 in the transfer time counter 16 and writes the allowable transfer time TA1 to the holding unit 11.
次に、転送コントロール回路15は、計算部14へ転送データD1の容量を送信し、保持部11は、転送許容時間TA1を計算部14へ出力する。計算部14は、転送データD1の容量と、バスプロトコル等による転送間隔とから転送所要時間TR1を計算し、転送所要時間TR1と転送許容時間TA1を比較する。 Next, the transfer control circuit 15 transmits the capacity of the transfer data D1 to the calculation unit 14, and the holding unit 11 outputs the allowable transfer time TA1 to the calculation unit 14. The calculation unit 14 calculates the required transfer time TR1 from the capacity of the transfer data D1 and the transfer interval based on the bus protocol, etc., and compares the required transfer time TR1 with the allowable transfer time TA1.
ここでは、TR1≦TA1が偽である場合、すなわち、転送所要時間TR1が転送許容時間TA1よりも大きく、転送許容時間TA1内にデータ転送を完了できない場合について説明する。この場合、計算部14は、転送順と、エラーを検出したことを示すエラー検出信号とを転送コントロール回路15に送信する。この時点では、1つの転送要求R1のみが発生しているので、転送順は転送要求R1に応じたデータD1を1番に転送する旨を示す。エラー検出信号に応答して転送コントロール回路15は、転送要求元RS1にエラー通知E1を送信する。 Here, we will explain the case where TR1≦TA1 is false, that is, the required transfer time TR1 is greater than the allowable transfer time TA1, and the data transfer cannot be completed within the allowable transfer time TA1. In this case, the calculation unit 14 sends the transfer order and an error detection signal indicating that an error has been detected to the transfer control circuit 15. At this point, only one transfer request R1 has been generated, so the transfer order indicates that data D1 corresponding to transfer request R1 will be transferred first. In response to the error detection signal, the transfer control circuit 15 sends an error notification E1 to the transfer request source RS1.
エラー通知E1が発行された後、転送要求R1を実行するか、転送要求R1を破棄するかは、ユーザにより選択できるものとする。ユーザが転送要求R1を破棄した場合には、DMA部1は、データ転送要求R1を受け取る前の状態に戻り、待機状態となる。 After error notification E1 is issued, the user can choose whether to execute transfer request R1 or abandon transfer request R1. If the user abandons transfer request R1, DMA unit 1 returns to the state it was in before receiving data transfer request R1 and enters a standby state.
以下、転送要求R1を実行する場合の動作について説明する。転送コントロール回路15は、エラー通知E1を出力した後、転送要求元RS1から転送データD1を読み出し、転送要求元RS1は、データバッファ12にデータD1を書き込む。 The following describes the operation when executing transfer request R1. After outputting error notification E1, the transfer control circuit 15 reads transfer data D1 from transfer request source RS1, and transfer request source RS1 writes data D1 to the data buffer 12.
その後、転送コントロール回路15は、データバッファ12のデータをRAM3に書き込む。データD1の転送が完了すると、転送コントロール回路15は、転送要求元RS1にデータD1の転送完了通知を出力し、同時に転送時間カウンタ16内のカウンタC1へ初期化命令を出力する。 Then, the transfer control circuit 15 writes the data in the data buffer 12 to RAM 3. When the transfer of data D1 is complete, the transfer control circuit 15 outputs a transfer completion notification for data D1 to the transfer request source RS1, and at the same time outputs an initialization command to counter C1 in the transfer time counter 16.
図5は、このデータ転送システムのデータ転送動作を示すさらに他の図である。図5では、データD1の転送中にデータD2の転送が要求されたとき、データD1を先に転送するとデータD2を転送許容時間TA2内に転送できず、かつデータD2を先に転送するとデータD1を転送許容時間TA1内に転送できなくなる場合の動作が示されている。 Figure 5 is yet another diagram showing the data transfer operation of this data transfer system. Figure 5 shows the operation when a request to transfer data D2 is made while data D1 is being transferred, and if data D1 is transferred first, data D2 cannot be transferred within the allowed transfer time TA2, and if data D2 is transferred first, data D1 cannot be transferred within the allowed transfer time TA1.
すなわち、転送要求元RS1から転送コントロール回路15に転送要求R1が出力されると、転送コントロール回路15は、転送時間カウンタ16内のカウンタC1を起動させるとともに、保持部11に転送許容時間TA1を書き込む。 That is, when a transfer request R1 is output from the transfer request source RS1 to the transfer control circuit 15, the transfer control circuit 15 activates counter C1 in the transfer time counter 16 and writes the allowed transfer time TA1 to the holding unit 11.
次に、転送コントロール回路15は、計算部14に対して転送所要時間TR1の計算を要求し、保持部11は計算部14に転送許容時間TA1を出力する。計算部14は、転送所要時間TR1を計算し、転送コントロール回路15へ転送順を出力する。この転送順は、データD1を1番目に転送する旨を示す。転送コントロール回路15は、転送要求元RS2からの第2のデータ転送要求R2が入力されるまで、転送要求元RS1からデータD1を読み出してRAM3に書き込む。 Next, the transfer control circuit 15 requests the calculation unit 14 to calculate the required transfer time TR1, and the holding unit 11 outputs the allowable transfer time TA1 to the calculation unit 14. The calculation unit 14 calculates the required transfer time TR1 and outputs the transfer order to the transfer control circuit 15. This transfer order indicates that data D1 will be transferred first. The transfer control circuit 15 reads data D1 from transfer request source RS1 and writes it to RAM3 until a second data transfer request R2 is input from transfer request source RS2.
転送要求元RS2から転送要求R2が転送コントロール回路15に出力されると、転送コントロール回路15は、転送時間カウンタ16にカウンタC2の起動命令を出力する。同時に転送コントロール回路15は、データバッファ12からRAM3へのデータD1の書き込みを停止させ、計算部14に所要時間TR1,TR2の計算命令を出力し、転送時間カウンタ16内のカウンタC1,C2にカウント値出力命令を出力して、計算部14へ処理済み時間TP1,TP2を出力させる。同時に、転送コントロール回路15は、現在の転送順を計算部14に出力する。 When transfer request R2 is output from transfer request source RS2 to transfer control circuit 15, transfer control circuit 15 outputs a command to start counter C2 to transfer time counter 16. At the same time, transfer control circuit 15 stops writing data D1 from data buffer 12 to RAM3, outputs a command to calculate required times TR1 and TR2 to calculation unit 14, and outputs count value output commands to counters C1 and C2 within transfer time counter 16, causing calculation unit 14 to output processed times TP1 and TP2. At the same time, transfer control circuit 15 outputs the current transfer order to calculation unit 14.
計算部14は、転送時間カウンタ16から転送要求R1,R2について、それぞれカウンタC1,C2の起動から経過した処理済み時間TP1,TP2を受け取り、転送コントロール回路15から転送要求R2のデータD2の容量を受け取り、データバッファ12からデータD1の容量を受け取り、保持部11から転送許容時間TA1,TA2を受け取る。 The calculation unit 14 receives from the transfer time counter 16 the processed times TP1 and TP2 elapsed since the start of counters C1 and C2 for transfer requests R1 and R2, respectively, receives the amount of data D2 for transfer request R2 from the transfer control circuit 15, receives the amount of data D1 from the data buffer 12, and receives the allowable transfer times TA1 and TA2 from the holding unit 11.
ここで、計算部14が転送所要時間TR1,TR2を計算した結果、以下の条件(1)が偽であり、かつ条件(2)が偽となる場合を考える。
条件(1):TR1+TR2≦TA2-TP2
条件(2):TR1+TR2≦TA1-TP1
Here, consider a case where, as a result of the calculation of the required transfer times TR1 and TR2 by the calculation unit 14, the following condition (1) is false and the following condition (2) is false.
Condition (1): TR1+TR2≦TA2-TP2
Condition (2): TR1+TR2≦TA1-TP1
条件(1)が偽であることは、残りの所要時間(TR1+TR2)が残りの許容時間(TA2-TP2)よりも大きいので、残りの許容時間(TA2-TP2)以内にデータD2の転送を終了するためには、データD2をデータD1よりも先に転送しなければならないことを意味する。 Condition (1) being false means that the remaining required time (TR1 + TR2) is greater than the remaining allowable time (TA2 - TP2), and therefore data D2 must be transferred before data D1 in order to complete the transfer of data D2 within the remaining allowable time (TA2 - TP2).
また、条件(2)が偽であることは、残りの所要時間(TR1+TR2)が残りの許容時間(TA1-TP1)よりも大きいので、残りの許容時間(TA1-TP1)以内にデータD1の転送を終了するためには、データD1をデータD2よりも先に転送しなければならないことを意味する。 Furthermore, if condition (2) is false, it means that the remaining required time (TR1 + TR2) is greater than the remaining allowable time (TA1 - TP1), and therefore data D1 must be transferred before data D2 in order to complete the transfer of data D1 within the remaining allowable time (TA1 - TP1).
この場合、許容時間(TA1-TP1)および許容時間(TA2-TP2)のうちのいずれか一方しか満たせないので、既に実行中であった転送要求R1を優先する。計算部14は、転送コントロール回路15に対してエラー検出信号を送信し、転送順を通知する。この転送順は、データD1を1番目に転送し、データD2を2番目に転送する旨を示す。 In this case, since only one of the allowable times (TA1-TP1) and (TA2-TP2) can be met, priority is given to the transfer request R1 that was already in progress. The calculation unit 14 sends an error detection signal to the transfer control circuit 15 and notifies it of the transfer order. This transfer order indicates that data D1 will be transferred first, and data D2 will be transferred second.
転送コントロール回路15は、計算部14からエラー検出信号と転送順を受け取った後、転送要求元RS2にエラー通知E2を出力する。その後、転送コントロール回路15は、RAM3に対するデータD1の書き込みを再開し、データD1の書き込みが完了したら転送要求元RS1に対してデータD1の転送完了通知を出力し、転送時間カウンタ16内のカウンタC1に対して初期化命令を出力する。 After receiving the error detection signal and transfer order from the calculation unit 14, the transfer control circuit 15 outputs an error notification E2 to the transfer request source RS2. The transfer control circuit 15 then resumes writing data D1 to RAM3, and when writing of data D1 is complete, outputs a transfer completion notification for data D1 to the transfer request source RS1, and outputs an initialization command to counter C1 in the transfer time counter 16.
その後転送要求R2を実行するか否かはユーザにより選択できるものとする。転送要求R2を実行する場合、転送コントロール回路15は、RAM3に対するデータD2の書き込みを開始する。データD2の転送が完了すると、転送コントロール回路15は、転送要求元RS2に対してデータD2の転送完了通知を出力し、転送時間カウンタ16内のカウンタC2に対して初期化命令を出力する。 The user can then choose whether or not to execute transfer request R2. If transfer request R2 is executed, transfer control circuit 15 begins writing data D2 to RAM3. When the transfer of data D2 is complete, transfer control circuit 15 outputs a transfer completion notification for data D2 to transfer request source RS2, and outputs an initialization command to counter C2 within transfer time counter 16.
図6は、図2~図5で示した転送コントロール回路15の動作の一部を示すフローチャートであり、図7は、その動作の残りの部分を示すフローチャートである。転送コントロール回路15が起動されると、ステップS1において転送コントロール回路15は初期化される。ステップS2において転送コントロール回路15は、システムの構成要素からのデータ転送要求が入力されるまで待機する。 Figure 6 is a flowchart showing part of the operation of the transfer control circuit 15 shown in Figures 2 to 5, and Figure 7 is a flowchart showing the remaining part of that operation. When the transfer control circuit 15 is started, the transfer control circuit 15 is initialized in step S1. In step S2, the transfer control circuit 15 waits until a data transfer request is input from a system component.
転送要求元RS1(本例では周辺回路4)からのデータ転送要求R1が入力されると、ステップS3において転送コントロール回路15は、転送時間カウンタ16内のカウンタC1に開始命令(起動命令)を出力し、カウンタC1を起動させる。 When a data transfer request R1 is input from the transfer request source RS1 (peripheral circuit 4 in this example), in step S3 the transfer control circuit 15 outputs a start command (activation command) to counter C1 in the transfer time counter 16, activating counter C1.
ステップS4において転送コントロール回路15は、転送要求元RS1から送信されてきた転送許容時間TA1を保持部11に転送する。ステップS5において転送コントロール回路15は、計算部14に転送所要時間TR1の計算要求を出力する。ステップS6において転送コントロール回路15は、計算部14から転送順またはエラー検出信号が送信されるまで待機する。 In step S4, the transfer control circuit 15 transfers the allowable transfer time TA1 sent from the transfer request source RS1 to the holding unit 11. In step S5, the transfer control circuit 15 outputs a calculation request for the required transfer time TR1 to the calculation unit 14. In step S6, the transfer control circuit 15 waits until the calculation unit 14 sends a transfer order or error detection signal.
ステップS7において転送コントロール回路15は、エラー検出信号が送信されたか否かを判別し、送信されたと判別した場合にはステップS8においてエラー通知E1を転送要求元RS1に出力した後、ステップS8Aにおいてユーザが転送要求R1を破棄したか否かを判別する。 In step S7, the transfer control circuit 15 determines whether an error detection signal has been sent. If it determines that an error detection signal has been sent, in step S8 it outputs an error notification E1 to the transfer request source RS1, and then in step S8A it determines whether the user has abandoned the transfer request R1.
なお、ユーザが転送要求R1を破棄したか否かはどのようにして判別してもよいが、たとえば、ステップS7においてエラー検出信号が送信されたと判別された場合に、転送要求R1を破棄するか否かをDMA部1に予め設定しておく方法が挙げられる。或いは、ステップS7においてエラー検出信号が送信されたと判別された場合に、その旨を転送要求元RS1に通知し、転送要求元RS1から転送要求R1を破棄するか否かの指示を受けることにより、ユーザが転送要求R1を破棄したか否かを判別するようにしてもよい。 Whether the user has abandoned transfer request R1 may be determined in any manner. For example, one method is to preset in DMA unit 1 whether or not to abandon transfer request R1 when it is determined in step S7 that an error detection signal has been sent. Alternatively, when it is determined in step S7 that an error detection signal has been sent, this may be notified to transfer request source RS1, and an instruction as to whether or not to abandon transfer request R1 may be received from transfer request source RS1, thereby determining whether or not the user has abandoned transfer request R1.
ステップS8Aにおいて転送コントロール回路15は、ユーザが転送要求R1を破棄したと判別した場合にはステップS2に戻り、ユーザが転送要求R1を破棄していないと判別した場合にはステップS10に進む。 If the transfer control circuit 15 determines in step S8A that the user has discarded the transfer request R1, it returns to step S2; if it determines that the user has not discarded the transfer request R1, it proceeds to step S10.
ステップS7においてエラー検出信号が送信されていないと判別された場合には、ステップS9において転送コントロール回路15は、転送要求元RS2(本例では周辺回路5)から転送要求R2があるか否かを判別し、転送要求R2がある場合はステップS14(図7)に進み、転送要求R2がない場合はステップS10に進む。 If it is determined in step S7 that an error detection signal has not been sent, the transfer control circuit 15 determines in step S9 whether or not there is a transfer request R2 from the transfer request source RS2 (in this example, the peripheral circuit 5). If there is a transfer request R2, the process proceeds to step S14 (Figure 7); if there is no transfer request R2, the process proceeds to step S10.
ステップS10において転送コントロール回路15は、転送データ元DS1(本例では周辺回路4)からデータD1を取得し、転送先DD1(本例ではRAM3)にデータD1を転送し続ける。ステップS11において転送コントロール回路15は、データD1の転送が完了しているか否かを判別し、データD1の転送が完了していない場合にはステップS9に戻り、データD1の転送が完了した場合にはステップS12に進む。 In step S10, the transfer control circuit 15 acquires data D1 from the transfer data source DS1 (peripheral circuit 4 in this example) and continues to transfer data D1 to the transfer destination DD1 (RAM 3 in this example). In step S11, the transfer control circuit 15 determines whether the transfer of data D1 is complete. If the transfer of data D1 is not complete, the process returns to step S9; if the transfer of data D1 is complete, the process proceeds to step S12.
ステップS12において転送コントロール回路15は、転送要求元RS1に対してデータ転送完了通知を送信する。ステップS13において転送コントロール回路15は、転送時間カウンタ16内のカウンタC1に対して初期化命令を出力し、ステップS2に戻って次の転送要求が発生するまで待機する。 In step S12, the transfer control circuit 15 sends a data transfer completion notification to the transfer request source RS1. In step S13, the transfer control circuit 15 outputs an initialization command to counter C1 in the transfer time counter 16, and then returns to step S2 to wait until the next transfer request is generated.
ステップS9において第2のデータ転送要求R2が発生した場合、ステップS14(図7)において転送コントロール回路15は、データ転送要求R2の発生時から経過した時間を計測するため転送時間カウンタ16内のカウンタC2に対して起動命令を出力する。 If a second data transfer request R2 occurs in step S9, in step S14 (Figure 7), the transfer control circuit 15 outputs a start command to counter C2 in the transfer time counter 16 to measure the time that has elapsed since the data transfer request R2 was generated.
ステップS15において転送コントロール回路15は、転送要求元RS2から送信されてきた転送許容時間TA2を保持部11に書き込む。ステップS16において転送コントロール回路15は、計算部14に転送所要時間TR1,TR2の再計算命令を出力する。ステップS16Aにおいて転送コントロール回路15は、転送時間カウンタ16に対して処理済み時間TP1,TP2を出力させるため、カウント値出力命令を出力する。ステップS17において転送コントロール回路15は、計算部14から転送順またはエラー検出信号が送信されるまで待機する。 In step S15, the transfer control circuit 15 writes the allowable transfer time TA2 transmitted from the transfer request source RS2 into the holding unit 11. In step S16, the transfer control circuit 15 outputs a command to the calculation unit 14 to recalculate the required transfer times TR1 and TR2. In step S16A, the transfer control circuit 15 outputs a count value output command to the transfer time counter 16 to output the processed times TP1 and TP2. In step S17, the transfer control circuit 15 waits until the calculation unit 14 transmits a transfer order or error detection signal.
ステップS18において転送コントロール回路15は、エラー検出信号が送信されたか否かを判別し、送信されたと判別した場合にはステップS19においてエラー通知E2を転送要求元RS2に出力した後、ステップS19Aにおいてユーザが転送要求R2を破棄したか否かを判別する。 In step S18, the transfer control circuit 15 determines whether an error detection signal has been sent, and if it determines that an error detection signal has been sent, in step S19 it outputs an error notification E2 to the transfer request source RS2, and then in step S19A it determines whether the user has abandoned the transfer request R2.
なお、ユーザが転送要求R2を破棄したか否かはどのようにして判別してもよいが、たとえば、ステップS18においてエラー検出信号が送信されたと判別された場合に、転送要求R2を破棄するか否かをDMA部1に予め設定しておく方法が挙げられる。或いは、ステップS18においてエラー検出信号が送信されたと判別された場合に、その旨を転送要求元RS2に通知し、転送要求元RS2から転送要求R2を破棄するか否かの指示を受けることにより、ユーザが転送要求R2を破棄したか否かを判別するようにしてもよい。 Whether the user has discarded transfer request R2 may be determined in any manner. For example, one method is to preset in DMA unit 1 whether or not to discard transfer request R2 when it is determined in step S18 that an error detection signal has been sent. Alternatively, when it is determined in step S18 that an error detection signal has been sent, this may be notified to transfer request source RS2, and an instruction as to whether or not to discard transfer request R2 may be received from transfer request source RS2, thereby determining whether or not the user has discarded transfer request R2.
ステップS19Aにおいて転送コントロール回路15は、ユーザが転送要求R2を破棄したと判別した場合にはステップS29に進み、ユーザが転送要求R2を破棄していないと判別した場合にはステップS21に進む。ステップS18においてエラー検出信号が送信されていないと判別された場合にはステップS20に進む。 If the transfer control circuit 15 determines in step S19A that the user has discarded transfer request R2, it proceeds to step S29; if it determines that the user has not discarded transfer request R2, it proceeds to step S21. If it determines in step S18 that an error detection signal has not been sent, it proceeds to step S20.
ステップS20において転送コントロール回路15は、計算部14から送信された転送順に基づいて、転送要求R1を優先するか否かを判別し、転送要求R1を優先しないと判別した場合にはステップS27に進み、転送要求R1を優先すると判別した場合にはステップS21に進む。 In step S20, the transfer control circuit 15 determines whether or not to prioritize transfer request R1 based on the transfer order sent from the calculation unit 14. If it determines that transfer request R1 is not prioritized, it proceeds to step S27; if it determines that transfer request R1 is prioritized, it proceeds to step S21.
転送コントロール回路15は、ステップS21において転送データ元DS1からのデータD1をすべて転送先DD1に転送し、ステップS22においてデータ転送完了通知を転送要求元RS1に送信し、ステップS23において転送時間カウンタ16内のカウンタC1に初期化命令を出力する。 In step S21, the transfer control circuit 15 transfers all data D1 from the transfer data source DS1 to the transfer destination DD1, in step S22 it sends a data transfer completion notification to the transfer request source RS1, and in step S23 it outputs an initialization command to counter C1 in the transfer time counter 16.
次に、転送コントロール回路15は、ステップS24において転送データ元DS2(本例では周辺回路5)からのデータD2をすべて転送先DD2(本例ではRAM3)に転送し、ステップS25においてデータ転送完了通知を転送要求元RS2に送信し、ステップS26において転送時間カウンタ16内のカウンタC2に初期化命令を出力する。その後、転送コントロール回路15は、ステップS2(図6)に戻って次の転送要求R1が入力されるまで待機する。 Next, in step S24, the transfer control circuit 15 transfers all data D2 from the transfer data source DS2 (peripheral circuit 5 in this example) to the transfer destination DD2 (RAM3 in this example), sends a data transfer completion notification to the transfer request source RS2 in step S25, and outputs an initialization command to counter C2 in the transfer time counter 16 in step S26. The transfer control circuit 15 then returns to step S2 (Figure 6) and waits until the next transfer request R1 is input.
ステップS20において転送要求R1を優先しないと判別した場合には、転送コントロール回路15は、ステップS27において転送データ元DS2(本例では周辺回路5)からのデータD2をすべて転送先DD2(本例ではRAM3)に転送し、ステップS28においてデータ転送完了通知を転送要求元RS2に送信し、ステップS29において転送時間カウンタ16内のカウンタC2に初期化命令を出力する。 If it is determined in step S20 that transfer request R1 does not have priority, the transfer control circuit 15 transfers all data D2 from the transfer data source DS2 (peripheral circuit 5 in this example) to the transfer destination DD2 (RAM3 in this example) in step S27, sends a data transfer completion notification to the transfer request source RS2 in step S28, and outputs an initialization command to counter C2 in the transfer time counter 16 in step S29.
次に、転送コントロール回路15は、ステップS30において転送データ元DS1からのデータD1をすべて転送先DD1に転送し、ステップS31においてデータ転送完了通知を転送要求元RS1に送信し、ステップS32において転送時間カウンタ16内のカウンタC1に初期化命令を出力する。その後、転送コントロール回路15は、ステップS2(図6)に戻って次の転送要求R1が入力されるまで待機する。 Next, in step S30, the transfer control circuit 15 transfers all of the data D1 from the transfer data source DS1 to the transfer destination DD1, sends a data transfer completion notification to the transfer request source RS1 in step S31, and outputs an initialization command to counter C1 in the transfer time counter 16 in step S32. The transfer control circuit 15 then returns to step S2 (Figure 6) and waits until the next transfer request R1 is input.
図8は、転送時間カウンタ16に含まれる個別カウンタCの動作を示すフローチャートである。転送時間カウンタ16は、独立した複数の個別カウンタCを含む。各個別カウンタCは、データ転送毎に個別に動作し、データ転送毎の処理済み時間TPを計測する。 Figure 8 is a flowchart showing the operation of the individual counter C included in the transfer time counter 16. The transfer time counter 16 includes multiple independent individual counters C. Each individual counter C operates independently for each data transfer and measures the processing time TP for each data transfer.
DMA部1が起動されると、ステップS60において個別カウンタCは初期化される。このとき、個別カウンタCのカウント値は初期値に設定される。ステップS61において個別カウンタCは、転送コントロール回路15から起動命令が入力されるまで待機する。 When the DMA unit 1 is started, the individual counter C is initialized in step S60. At this time, the count value of the individual counter C is set to its initial value. In step S61, the individual counter C waits until a start command is input from the transfer control circuit 15.
ステップS62において、起動命令が入力された個別カウンタCのカウント値は、システムクロックの各パルスに応答してインクリメント(+1)される。ステップS63において個別カウンタCは、転送コントロール回路15からのカウント値の出力命令があるか否かを判別し、カウント値の出力命令があると判別した場合にはステップS65に進み、カウント値の出力命令がないと判別した場合にはステップS64に進む。 In step S62, the count value of the individual counter C to which the start command has been input is incremented (+1) in response to each pulse of the system clock. In step S63, the individual counter C determines whether or not there is a count value output command from the transfer control circuit 15. If it determines that there is a count value output command, it proceeds to step S65; if it determines that there is no count value output command, it proceeds to step S64.
ステップS64において個別カウンタCは、転送コントロール回路15からの初期化命令があるか否かを判別し、初期化命令があると判別した場合にはステップS60に戻り、初期化命令がないと判別した場合にはステップS62に戻る。 In step S64, individual counter C determines whether or not there is an initialization command from the transfer control circuit 15. If it determines that there is an initialization command, it returns to step S60; if it determines that there is no initialization command, it returns to step S62.
ステップS63においてカウント値の出力命令があると判別された場合には、ステップS65において個別カウンタCは、現在のカウント値を計算部14に送信した後、ステップS62に戻る。 If it is determined in step S63 that there is a count value output command, in step S65 the individual counter C transmits the current count value to the calculation unit 14, and then the process returns to step S62.
次に、先に入力された転送要求R1と、後に入力された転送要求R2とのうちのどちらを優先して実行すべきであるかを判定する判定方法について説明する。前提として、転送要求R1の転送所要時間TR1は転送許容時間TA1以下であるものとし(TR1≦TA1)、同様に、転送要求R2の転送所要時間TR2は転送許容時間TA2以下であるものとする(TR2≦TA2)。この前提が満たされない場合は、上記ステップS6~S8(図6)およびステップS17~S19(図7)で示したように、データ転送要求を受け付けた時点で転送要求元にエラー通知を送信することになる。 Next, we will explain the method for determining which of the transfer request R1, which was input first, or the transfer request R2, which was input later, should be given priority. We assume that the required transfer time TR1 for transfer request R1 is less than or equal to the allowable transfer time TA1 (TR1≦TA1), and similarly, the required transfer time TR2 for transfer request R2 is less than or equal to the allowable transfer time TA2 (TR2≦TA2). If this assumption is not met, an error notification will be sent to the transfer request source when the data transfer request is accepted, as shown in steps S6-S8 (Figure 6) and steps S17-S19 (Figure 7) above.
まず、ケースCA1として、転送要求R1の実行後に転送要求R2を実行したとき、転送許容時間TA2内に収まり、かつ、余裕時間TM1が余裕時間TM2以下となる場合について説明する。ここで、余裕時間TMとは、ある1つのデータ転送要求において、転送完了通知を出すまでに要する時間が自身の転送許容時間TAに対してどの程度余裕があるかという時間情報である。 First, we will explain case CA1, where when transfer request R2 is executed after transfer request R1 is executed, it falls within the allowed transfer time TA2 and the slack time TM1 is less than or equal to the slack time TM2. Here, slack time TM is time information that indicates how much leeway there is in the time required to issue a transfer completion notification for a given data transfer request compared to its own allowed transfer time TA.
ある1つのデータ転送要求(たとえばR2)の実施を開始する前に、他のデータ転送要求(たとえばR1)が優先して実施される場合があり、そのときには他のデータ転送要求(この場合はR1)の所要時間(この場合はTR1)の分だけ自身の転送要求(この場合はR2)の開始を待たなければならない。このため、余裕時間TMは、以下のように算出される。 Before a certain data transfer request (e.g., R2) can begin to be executed, another data transfer request (e.g., R1) may be executed first. In such cases, the start of the transfer request (in this case, R2) must wait the time required (in this case, TR1) for the other data transfer request (in this case, R1). For this reason, the slack time TM is calculated as follows:
ここでは、データ転送要求の総数がn個ある場合、小文字のnによって各転送要求と他の転送要求を区別し、転送要求R1、転送要求R2、…、転送要求Rnと表し、大文字のNによって各転送要求が実行される順番を示し、1番目、2番目、…、N番目と表す。 Here, if there are a total of n data transfer requests, each transfer request is distinguished from the others by the lowercase n, and is represented as transfer request R1, transfer request R2, ..., transfer request Rn, and the uppercase N indicates the order in which each transfer request is executed, and is represented as 1st, 2nd, ..., Nth.
転送要求RnがN番目に転送される場合の余裕時間TMnは、TMn=TAn-SUM(N-1)-TRn-TPnとなる。ここで、SUM(N-1)=[TR1+TR2+…+TR(N-1)]であり、SUM(N-1)は、1番目から(N-1)番目までに実行される転送要求の転送所要時間TRの総和である。 The slack time TMn when transfer request Rn is transferred Nth is TMn = TAn - SUM(N-1) - TRn - TPn. Here, SUM(N-1) = [TR1 + TR2 + ... + TR(N-1)], and SUM(N-1) is the sum of the transfer times TR required for the transfer requests executed from the first to the (N-1)th.
上記の例では、2つの転送要求R1,R2のどちらを1番目に転送するかを判定しているので、転送要求R1,R2よりも前に行なわれる転送要求がない。このため、上式中の「転送要求Rnより前に実行される転送所要時間TRの総和SUM(N-1)」は0となる。すなわち、SUM(1-1)=SUM(0)=0である。このため、TM1=TA1-TP1-TR1、TM2=TA2-TP2-TR2となる。 In the above example, a determination is being made as to which of two transfer requests R1 and R2 will be transferred first, so there are no transfer requests made before transfer requests R1 and R2. Therefore, the "sum of transfer times TR required for transfers executed before transfer request Rn (SUM(N-1))" in the above formula is 0. In other words, SUM(1-1) = SUM(0) = 0. Therefore, TM1 = TA1 - TP1 - TR1, and TM2 = TA2 - TP2 - TR2.
転送要求R1によるデータ転送を再開し、その後に転送要求R2によるデータ転送を行なった場合でも転送許容時間TA2内に収まり、かつ余裕時間TM1が余裕時間TM2以下(TM1≦TM2、すなわちTA1-TP1-TR1≦TA2-TP2-TR2)である場合は、転送要求R1の後に転送要求R2を実行する。 If data transfer based on transfer request R1 is resumed and then data transfer based on transfer request R2 is performed, and the data transfer falls within the allowable transfer time TA2, and the slack time TM1 is less than or equal to the slack time TM2 (TM1 ≤ TM2, i.e., TA1 - TP1 - TR1 ≤ TA2 - TP2 - TR2), transfer request R2 will be executed after transfer request R1.
ケースCA1であるためには、条件(1)すなわちTR1+TR2≦TA2-TP2が真であり、かつ条件(3)すなわちTA1-TP1-TR1≦TA2-TP2-TR2が真となる必要がある。 For case CA1 to be true, condition (1) must be true, i.e., TR1 + TR2 ≦ TA2 - TP2, and condition (3) must be true, i.e., TA1 - TP1 - TR1 ≦ TA2 - TP2 - TR2.
次に、ケースCA2として、転送要求R1の実行後に転送要求R2を実行したとき、転送許容時間TA2内に収まり、かつ、余裕時間TM1が余裕時間TM2よりも大きい(TM1>TM2、すなわちTA1-TP1-TR1>TA2-TP2-TR2)場合について説明する。 Next, we will explain case CA2, where when transfer request R2 is executed after transfer request R1 is executed, it falls within the transfer allowable time TA2 and the leeway time TM1 is greater than the leeway time TM2 (TM1 > TM2, i.e., TA1 - TP1 - TR1 > TA2 - TP2 - TR2).
この場合はデータD1の転送を再開し、その後にデータD2の転送を行なった場合でも転送許容時間TA2内に収まるが、余裕時間TM2が余裕時間TM1よりも小さい。したがって、データD1の後にデータD2を転送すると新たなデータ転送要求R3が発生した際、データ転送要求R3をデータ転送要求R2の前に実施すると、データ転送要求R2の許容時間TA2を満たせなくなる可能性が高くなる。このため、複数のデータ転送要求があるときに可能な限り許容時間TAを満たせるようにするため、転送要求R2を先に実施し、その後に転送要求R1を実施するようにする。 In this case, even if the transfer of data D1 is resumed and then data D2 is transferred, it will still fall within the allowable transfer time TA2, but the leeway time TM2 is shorter than the leeway time TM1. Therefore, if data D2 is transferred after data D1 and a new data transfer request R3 occurs, if data transfer request R3 is executed before data transfer request R2, there is a high possibility that the allowable time TA2 for data transfer request R2 will not be met. For this reason, in order to meet the allowable time TA as much as possible when there are multiple data transfer requests, transfer request R2 is executed first, followed by transfer request R1.
ケースCA2であるためには、条件(1)すなわちTR1+TR2≦TA2-TP2が真であり、かつ条件(3)すなわちTA1-TP1-TR1≦TA2-TP2-TR2が偽となる必要がある。 For case CA2 to occur, condition (1) - TR1 + TR2 ≦ TA2 - TP2 - must be true, and condition (3) - TA1 - TP1 - TR1 ≦ TA2 - TP2 - TR2 - must be false.
次いで、ケースCA3として、データD1の転送後ではデータD2の転送が間に合わないが、データD2を先に転送することにより、転送許容時間TA2を満たし、かつ、その後にデータD1を転送して転送許容時間TA1を満たす場合について説明する。この場合、データD2を先に転送し、その後にデータD1を転送すれば転送許容時間TAを超えることがないため、データD2を優先して転送する。 Next, we will explain case CA3, where data D2 cannot be transferred in time after data D1 has been transferred, but by transferring data D2 first, the allowable transfer time TA2 is met, and then data D1 is transferred, so the allowable transfer time TA1 is met. In this case, if data D2 is transferred first and then data D1 is transferred, the allowable transfer time TA will not be exceeded, so data D2 is transferred first.
ケースCA3であるためには、条件(1)すなわちTR1+TR2≦TA2-TP2が偽であり、かつ条件(2)すなわちTR1+TR2≦TA1-TP1が真である必要がある。 For case CA3 to be true, condition (1), i.e., TR1 + TR2 ≦ TA2 - TP2, must be false, and condition (2), i.e., TR1 + TR2 ≦ TA1 - TP1, must be true.
次に、ケースCA4として、データD2を先に転送するとデータD2の転送は間に合うが、データD1の転送が間に合わない場合について説明する。この場合は、既に転送中であったデータD1を先に転送し、転送要求元RS2にはエラー通知E2を行なう。 Next, we will explain case CA4, where if data D2 is transferred first, the transfer of data D2 will be completed in time, but the transfer of data D1 will not be completed in time. In this case, data D1, which was already being transferred, is transferred first, and an error notification E2 is sent to the transfer request source RS2.
ケースCA4であるためには、条件(1)すなわちTR1+TR2≦TA2-TP2が偽であり、かつ条件(2)すなわちTR1+TR2≦TA1-TP1が偽である必要がある。 For case CA4 to exist, condition (1) - TR1 + TR2 ≦ TA2 - TP2 - must be false, and condition (2) - TR1 + TR2 ≦ TA1 - TP1 - must be false.
補足として、ケースCA1およびケースCA2において余裕時間TMによって転送順を判定する部分については、それを実施しなくても転送許容時間TAを満たす転送を実現でき、転送要求R1,R2のどちらを先に実施してもそれぞれの許容時間TAに間に合うので、余裕時間TMによる判定の実施はユーザにより選択できるものとする。余裕時間TMによる判定実施しない場合には、条件(1)すなわちTR1+TR2≦TA2-TP2が真であるならば、転送要求R1を1番目に実施し、転送要求R2を2番目に実施する。 As a supplementary note, in cases CA1 and CA2, the transfer order is determined based on the slack time TM. Transfers that meet the allowable transfer time TA can be achieved without this, and regardless of which transfer request R1 or R2 is executed first, the respective allowable times TA will be met. Therefore, whether or not to perform the determination based on the slack time TM is optional. If the determination based on the slack time TM is not performed, then if condition (1) is true, i.e., TR1 + TR2 ≦ TA2 - TP2, then transfer request R1 is executed first, and transfer request R2 is executed second.
図9は、計算部14の動作の一部を示すフローチャートであり、図10は、その動作の残りの部分を示すフローチャートである。計算部14が起動されると、ステップS81において計算部14は初期化される。ステップS82において計算部14は、転送コントロール回路15から計算要求が入力されるまで待機する。 Figure 9 is a flowchart showing part of the operation of the calculation unit 14, and Figure 10 is a flowchart showing the remaining part of that operation. When the calculation unit 14 is started, the calculation unit 14 is initialized in step S81. In step S82, the calculation unit 14 waits until a calculation request is input from the transfer control circuit 15.
計算要求が入力された場合、ステップS83において計算部14は、その計算要求が第1のデータ転送要求R1に起因しているか否かを判別する。そして、計算部14は、データ転送要求R1に起因していないと判別した場合(第2以降のデータ転送要求に起因している場合)にはステップS90(図10)に進み、データ転送要求R1に起因していると判別した場合(他のデータ転送要求がない場合)にはステップS84に進む。 When a calculation request is input, in step S83 the calculation unit 14 determines whether the calculation request is due to the first data transfer request R1. If the calculation unit 14 determines that the calculation request is not due to data transfer request R1 (if it is due to a second or subsequent data transfer request), it proceeds to step S90 (Figure 10). If the calculation unit 14 determines that the calculation request is due to data transfer request R1 (if there are no other data transfer requests), it proceeds to step S84.
計算部14は、ステップS84において保持部11から転送許容時間TA1を取得し、ステップS85において転送コントロール回路15からデータD1の容量を取得する。ステップS86において計算部14は、データD1の容量と、クロックの周波数と、バスプロトコルによる転送間隔とに基づいて転送所要時間TR1を計算する。 In step S84, the calculation unit 14 obtains the allowable transfer time TA1 from the holding unit 11, and in step S85 obtains the size of data D1 from the transfer control circuit 15. In step S86, the calculation unit 14 calculates the required transfer time TR1 based on the size of data D1, the clock frequency, and the transfer interval according to the bus protocol.
ステップS87において計算部14は、計算して求めた転送所要時間TR1と、転送コントロール回路15から転送された転送許容時間TA1との長短を比較し、TR1≦TA1であるか否かを判別する。 In step S87, the calculation unit 14 compares the calculated required transfer time TR1 with the allowable transfer time TA1 transferred from the transfer control circuit 15, and determines whether TR1 is less than or equal to TA1.
TR1≦TA1でない場合、ステップS88において計算部14は、転送コントロール回路15に転送順およびエラー通知E1を出力して、ステップS82に戻る。TR1≦TA1である場合、ステップS89において計算部14は、転送順を転送コントロール回路15へ出力して、ステップS82に戻る。 If TR1≦TA1 is not true, then in step S88 the calculation unit 14 outputs the transfer order and error notification E1 to the transfer control circuit 15, and the process returns to step S82. If TR1≦TA1 is true, then in step S89 the calculation unit 14 outputs the transfer order to the transfer control circuit 15, and the process returns to step S82.
ステップS83(図9)においてデータ転送要求R1に起因していないと判別した場合(第2以降のデータ転送要求に起因している場合)には、ステップS90(図10)において計算部14は、保持部11から転送許容時間TA1,TA2を取得する。 If it is determined in step S83 (Figure 9) that the data transfer is not caused by data transfer request R1 (if the data transfer is caused by a second or subsequent data transfer request), then in step S90 (Figure 10), the calculation unit 14 obtains the allowable transfer times TA1 and TA2 from the storage unit 11.
ステップS91において計算部14は、データバッファ12からデータD1,D2の容量を取得し、転送コントロール回路15から転送順を取得する。ステップS92において計算部14は、カウンタ16内のカウンタC1,C2からカウント値を取得する。ステップS93において計算部14は、転送所要時間TR1,TR2を再計算する。 In step S91, the calculation unit 14 obtains the capacity of data D1 and D2 from the data buffer 12 and obtains the transfer order from the transfer control circuit 15. In step S92, the calculation unit 14 obtains the count values from counters C1 and C2 in the counter 16. In step S93, the calculation unit 14 recalculates the transfer times TR1 and TR2.
ステップS94において計算部14は、計算して求めた転送所要時間TR2と、転送コントロール回路15から転送された転送許容時間TA2との長短を比較し、TR2≦TA2であるか否かを判別する。 In step S94, the calculation unit 14 compares the calculated required transfer time TR2 with the allowable transfer time TA2 transferred from the transfer control circuit 15, and determines whether TR2 is less than or equal to TA2.
TR2≦TA2である場合(ステップS94でYESの場合)、ステップS95において計算部14は、条件(1)すなわちTR1+TR2≦TA2-TP2が真であるか否かを判別する。条件(1)が真である場合(ステップS95でYESの場合)、ステップS96において計算部14は、条件(3)すなわちTA1-TP1-TR1≦TA2-TP2-TR2が真であるか否かを判別する。 If TR2≦TA2 (YES in step S94), then in step S95 the calculation unit 14 determines whether condition (1), i.e., TR1 + TR2≦TA2-TP2, is true. If condition (1) is true (YES in step S95), then in step S96 the calculation unit 14 determines whether condition (3), i.e., TA1-TP1-TR1≦TA2-TP2-TR2, is true.
条件(3)が真である場合(ステップS96でYESの場合)には上記ケースCA1に該当するので、ステップS97において計算部14は、データD1を1番目に送信し、データD2を2番目に送信する旨を示す転送順を転送コントロール回路15に出力して、ステップS82(図9)に戻る。 If condition (3) is true (YES in step S96), the above case CA1 applies, so in step S97 the calculation unit 14 outputs a transfer order to the transfer control circuit 15 indicating that data D1 will be sent first and data D2 will be sent second, and the process returns to step S82 (Figure 9).
条件(3)が偽である場合(ステップS96でNOの場合)には上記ケースCA2に該当するので、ステップS98において計算部14は、データD2を1番目に送信し、データD1を2番目に送信する旨を示す転送順を転送コントロール回路15に出力して、ステップS82に戻る。 If condition (3) is false (NO in step S96), the above case CA2 applies, so in step S98 the calculation unit 14 outputs a transfer order to the transfer control circuit 15 indicating that data D2 will be sent first and data D1 will be sent second, and the process returns to step S82.
条件(1)が偽である場合(ステップS95でNOの場合)、ステップS99において計算部14は、条件(2)すなわちTR1+TR2≦TA1-TP1が真であるか否かを判別する。 If condition (1) is false (NO in step S95), in step S99, the calculation unit 14 determines whether condition (2), i.e., TR1 + TR2 ≦ TA1 - TP1, is true.
条件(2)が真である場合(ステップS99でYESの場合)には上記ケースCA3に該当するので、ステップS98において計算部14は、データD2を1番目に送信し、データD1を2番目に送信する旨を示す転送順を転送コントロール回路15に出力して、ステップS82に戻る。 If condition (2) is true (YES in step S99), the above case CA3 applies, so in step S98 the calculation unit 14 outputs a transfer order to the transfer control circuit 15 indicating that data D2 will be sent first and data D1 will be sent second, and then the process returns to step S82.
条件(2)が偽である場合(ステップS99でNOの場合)には上記ケースCA4に該当するので、ステップS100において計算部14は、エラー通知E2を転送要求元RS2に送信するとともに、データD1を1番目に送信し、データD2を2番目に送信する旨を示す転送順を転送コントロール回路15に出力して、ステップS82に戻る。ただし、上述の通り、データD2を転送するか転送要求R2を破棄するかはユーザが選択できるものとする。 If condition (2) is false (NO in step S99), the above case CA4 applies, so in step S100 the calculation unit 14 sends an error notification E2 to the transfer request source RS2 and outputs a transfer order to the transfer control circuit 15 indicating that data D1 will be sent first and data D2 will be sent second, and then returns to step S82. However, as mentioned above, the user can choose whether to transfer data D2 or discard transfer request R2.
TR2≦TA2でない場合(ステップS94でNOの場合)、ステップS100において計算部14は、エラー通知E2を転送要求元RS2に送信するとともに、データD1を1番目に送信し、データD2を2番目に送信する旨を示す転送順とを転送コントロール回路15に出力して、ステップS82に戻る。ただし、この場合も、データD2を転送するか転送要求R2を破棄するかはユーザが選択できるものとする。 If TR2≦TA2 is not satisfied (NO in step S94), in step S100, the calculation unit 14 sends an error notification E2 to the transfer request source RS2 and outputs a transfer order indicating that data D1 will be sent first and data D2 will be sent second to the transfer control circuit 15, and then returns to step S82. However, in this case, too, the user can select whether to transfer data D2 or discard transfer request R2.
以上のように、本実施の形態1では、各転送要求毎に転送所要時間TRが計算され、各転送要求の転送所要時間TRが当該転送要求の転送許容時間TA以内に収まるように、複数の転送要求を実行する順序が設定される。また、転送許容時間TAは、転送要求の優先度が高いほど短い時間に設定される。したがって、優先度の高いデータと優先度の低いデータとが混在している場合でも、優先度の高いデータを優先度の低いデータよりも先に転送することができる。 As described above, in this first embodiment, the required transfer time TR is calculated for each transfer request, and the order in which multiple transfer requests are executed is set so that the required transfer time TR for each transfer request falls within the allowable transfer time TA for that transfer request. Furthermore, the allowable transfer time TA is set to a shorter time the higher the priority of the transfer request. Therefore, even when high-priority data and low-priority data are mixed, the high-priority data can be transferred before the low-priority data.
また、図11は、上記実施の形態1の変更例に含まれる計算部14の動作の一部を示すフローチャートであり、図12は、その動作の残りの部分を示すフローチャートである。上記実施の形態1では、2つの転送要求R1,R2が発生する場合について説明したが、3つ以上の転送要求が発生する場合についても同様の方法で転送順を判定することが可能である。この変更例では、任意の数の転送要求が発生する場合でも、優先度の高いデータを優先度の低いデータよりも先に転送することが可能なデータ転送システムについて説明する。 Furthermore, Figure 11 is a flowchart showing part of the operation of the calculation unit 14 included in the modified example of the first embodiment, and Figure 12 is a flowchart showing the remaining part of the operation. In the first embodiment, a case where two transfer requests R1 and R2 are generated is described, but the transfer order can also be determined in a similar manner when three or more transfer requests are generated. In this modified example, a data transfer system is described that is capable of transferring high priority data before low priority data, even when any number of transfer requests are generated.
図11において、ステップS120~S128は、ステップS81~S89(図9)と同様である。すなわち、計算部14が起動されると、計算部14は、初期化され、転送コントロール回路15から計算要求が入力されるまで待機する(ステップS120,S121)。 In Figure 11, steps S120 to S128 are the same as steps S81 to S89 (Figure 9). That is, when the calculation unit 14 is started, it is initialized and waits until a calculation request is input from the transfer control circuit 15 (steps S120 and S121).
計算要求が入力された場合、計算部14は、その計算要求が第1のデータ転送要求R1に起因しているか否かを判別し(ステップS122)、データ転送要求R1に起因していないと判別した場合(第2以降のデータ転送要求に起因している場合)にはステップS129(図12)に進み、データ転送要求R1に起因していると判別した場合(他のデータ転送要求がない場合)にはステップS123に進む。 When a calculation request is input, the calculation unit 14 determines whether the calculation request is due to the first data transfer request R1 (step S122). If it determines that the calculation request is not due to data transfer request R1 (if it is due to a second or subsequent data transfer request), the calculation unit 14 proceeds to step S129 (Figure 12). If it determines that the calculation request is due to data transfer request R1 (if there are no other data transfer requests), the calculation unit 14 proceeds to step S123.
計算部14は、保持部11から転送許容時間TA1を取得し(ステップS123)、転送コントロール回路15からデータD1の容量を取得し(ステップS124)、転送許容時間TA1と、データD1の容量と、クロックの周波数と、バスプロトコルによる転送間隔とに基づいて転送所要時間TR1を計算する(ステップS125)。 The calculation unit 14 obtains the allowable transfer time TA1 from the holding unit 11 (step S123), obtains the size of the data D1 from the transfer control circuit 15 (step S124), and calculates the required transfer time TR1 based on the allowable transfer time TA1, the size of the data D1, the clock frequency, and the transfer interval according to the bus protocol (step S125).
次に、計算部14は、計算して求めた転送所要時間TR1と、転送コントロール回路15から転送された転送許容時間TA1との長短を比較し、TR1≦TA1であるか否かを判別する(ステップS126)。 Next, the calculation unit 14 compares the calculated required transfer time TR1 with the allowable transfer time TA1 transferred from the transfer control circuit 15, and determines whether TR1 is less than or equal to TA1 (step S126).
TR1≦TA1でない場合、計算部14は、転送コントロール回路15に転送順およびエラー通知E1を出力して、ステップS121に戻る(ステップS127)。TR1≦TA1である場合、計算部14は、転送順を転送コントロール回路15へ出力して、ステップS121に戻る(ステップS128)。 If TR1≦TA1 is not true, the calculation unit 14 outputs the transfer order and error notification E1 to the transfer control circuit 15 and returns to step S121 (step S127). If TR1≦TA1 is true, the calculation unit 14 outputs the transfer order to the transfer control circuit 15 and returns to step S121 (step S128).
ステップS122(図11)において第1のデータ転送要求R1に起因していないと判別した場合(第2以降のデータ転送要求に起因している場合)には、ステップS129(図12)において計算部14は、保持部11に保持されている転送許容時間TAを取得する。 If it is determined in step S122 (Figure 11) that the data transfer is not caused by the first data transfer request R1 (if the data transfer is caused by a second or subsequent data transfer request), then in step S129 (Figure 12), the calculation unit 14 obtains the allowable transfer time TA stored in the storage unit 11.
ステップS130において計算部14は、データバッファ12および転送コントロール回路15からデータDの容量を取得し、転送コントロール回路15から転送順を取得する。ステップS131において計算部14は、カウンタ16内のカウンタCからカウント値を取得する。ステップS132において計算部14は、すべての転送所要時間TRを再計算する。転送所要時間TRは過去に計算している場合もあるが、データ転送により転送処理が進んで転送データ容量が減っている可能性があるため再計算を行なう。 In step S130, the calculation unit 14 obtains the capacity of data D from the data buffer 12 and transfer control circuit 15, and obtains the transfer order from the transfer control circuit 15. In step S131, the calculation unit 14 obtains the count value from counter C in counter 16. In step S132, the calculation unit 14 recalculates all required transfer times TR. Although the required transfer times TR may have been calculated in the past, they are recalculated because the transfer process may have progressed due to data transfer and the amount of data transferred may have decreased.
ステップS133において計算部14は、転送要求Rの総数がn個である場合、X=N-1とする。ここで、新たに発生したデータ転送要求Rnについて説明する。ただし、nは2以上の整数である。データ転送要求Rnに対して、先に転送することが予定されていたデータ転送要求Rは(n-1)個だけあり、データD1~D(n-1)の転送順は1番目から(N-1)番目までのいずれかである。 In step S133, if the total number of transfer requests R is n, the calculation unit 14 sets X = N-1. Now, let's consider a newly generated data transfer request Rn, where n is an integer greater than or equal to 2. There are only (n-1) data transfer requests R scheduled to be transferred prior to data transfer request Rn, and the transfer order of data D1 to D(n-1) is anywhere from 1st to (N-1).
計算部14は、転送要求Rnの前に予定されていた転送要求R1~R(n-1)の前に転送要求Rnを実施できるかどうかを、最後尾に予定されている転送要求(すなわち転送順が(N-1)番目の転送要求)から順番に繰り返し判定していく。このため、ステップS133では、繰り返し処理の変数Xの初期値を(N-1)と表現する。 The calculation unit 14 repeatedly determines whether transfer request Rn can be executed before transfer requests R1 to R(n-1) that were scheduled before transfer request Rn, starting from the last scheduled transfer request (i.e., the transfer request whose transfer order is (N-1)). For this reason, in step S133, the initial value of the variable X for the repetitive process is expressed as (N-1).
ここで、転送要求R1~R(n-1)の前に転送要求Rnを実施するかどうかを判定する方法について説明する。前提として、すべて転送要求Rにおいて、転送所要時間TRは転送許容時間TA以下であるものとする(TR≦TA)。なお、この前提が満たされない場合は、ステップS127(図11)およびステップS141(図12)において、データ転送要求Rを受け付けた時点で転送要求元RSにエラーを通知することになる。 Here, we will explain the method for determining whether to execute transfer request Rn before transfer requests R1 to R(n-1). The premise is that for all transfer requests R, the required transfer time TR is less than or equal to the allowable transfer time TA (TR≦TA). If this premise is not met, an error will be notified to the transfer request source RS at the time the data transfer request R is accepted in step S127 (FIG. 11) and step S141 (FIG. 12).
まず、ケースCA11として、1番目からX番目までのデータ転送を実行した後にn番目のデータ転送を行なったとき、転送許容時間TAn内に収まり、かつ、X番目となるデータ転送の余裕時間TMXが余裕時間TMn以下となる場合について説明する。この場合は、X番目のデータ転送の優先度がより高いため、n番目のデータ転送は(X+1)番目に行なわれることになる。 First, we will explain case CA11, where, after the first through Xth data transfers have been performed, the nth data transfer is performed within the allowable transfer time TAn and the margin time TMX for the Xth data transfer is less than or equal to the margin time TMn. In this case, because the Xth data transfer has a higher priority, the nth data transfer will be performed (X+1).
ケースCA11であることを判定するには、以下の条件(11)が真であり、かつ条件(12)が真であることを満たす必要がある(ステップS135,S136,S140)。ただし、SUM(X)は、1番目からX番目までの転送所要時間TRの和である。条件(12)では、転送要求Rnと、元々X番目に予定されていた転送要求とを、仮にX番目に実行した場合における余裕時間TMn,TMXを比較している。
条件(11):TRn+SUM(X)≦TAn-TPn
条件(12):TMX≦TMn、すなわちTAX-(TPX+TRX+SUM(X-1))≦TAn-(TPn+TRn+SUM(X-1))
To determine whether the case is CA11, the following condition (11) and condition (12) must be true (steps S135, S136, S140). Here, SUM(X) is the sum of the required transfer times TR from the first to the Xth transfers. Condition (12) compares the slack times TMn and TMX that would occur if the transfer request Rn and the transfer request originally scheduled for the Xth transfer were executed in the Xth transfer.
Condition (11): TRn+SUM(X)≦TAn-TPn
Condition (12): TMX≦TMn, i.e., TAX−(TPX+TRX+SUM(X−1))≦TAn−(TPn+TRn+SUM(X−1))
次に、ケースCA12として、1番目からX番目までのデータ転送を実行した後にn番目のデータ転送を行なったとき、転送許容時間TAn内に収まり、かつ、X番目となるデータ転送の余裕時間TMXが余裕時間TMnよりも大きい場合について説明する。 Next, we will explain case CA12, where, after the first through Xth data transfers have been performed, the nth data transfer is performed within the allowable transfer time TAn and the margin time TMX for the Xth data transfer is greater than the margin time TMn.
この場合は、X番目のデータ転送を実施し、その後にn番目のデータ転送Rnを行なった場合でも、転送許容時間TAnに収まるが、ケースCA2と同様に新たな転送要求、すなわち(n+1)番目以降の転送要求が発生したとき、各データ転送要求が許容時間TA内に転送できる可能性を高めるため、X番目のデータ転送とデータ転送Rnとの転送順を入れ替える(ステップS137A)。これにより、転送要求RnがX番目に実行され、元々のX番目に実行する予定であったデータ転送が(X+1)番目に実行される。 In this case, even if the Xth data transfer is performed followed by the nth data transfer Rn, it will still fit within the allowable transfer time TAn. However, as in case CA2, when a new transfer request occurs, i.e., a transfer request for the (n+1)th or later transfer, the order of the Xth data transfer and data transfer Rn is swapped (step S137A) to increase the likelihood that each data transfer request can be transferred within the allowable time TA. As a result, transfer request Rn is executed Xth, and the data transfer originally scheduled to be executed Xth is executed (X+1).
なお、これは、上記ケースCA2において、転送要求R1と転送要求R2の実行順を入れ替えたことと同じである。ケースCA2では、元々転送要求R1は1番目に実施されるが、転送要求R2の余裕時間TM2の方が転送要求R1の余裕時間TM1よりも小さいため、転送要求R2を1番目に実施し、転送要求R1を2番目に実施した。 Note that this is the same as swapping the execution order of transfer request R1 and transfer request R2 in case CA2 above. In case CA2, transfer request R1 was originally executed first, but because the slack time TM2 of transfer request R2 is shorter than the slack time TM1 of transfer request R1, transfer request R2 is executed first and transfer request R1 is executed second.
また、転送要求RnはX番目に実行されることになったが、転送要求Rnの1つ前に実行される(X-1)番目のデータ転送の余裕時間TMXが転送要求Rnの余裕時間TMnよりも大きい可能性がある。そのため、繰り返し処理のためXの値を1だけ小さくし、再度ケースCA11からの判定を行なう(ステップS138,S139)。ケースCA12であると判定されるためには、上記の条件(11)が真であり、かつ条件(12)が偽であることを満たす必要がある(ステップS135,S136,S137A)。 Furthermore, although transfer request Rn is to be executed Xth, there is a possibility that the margin time TMX of the (X-1)th data transfer executed immediately before transfer request Rn is greater than the margin time TMn of transfer request Rn. Therefore, the value of X is decreased by 1 for the repeated processing, and the determination is made again from case CA11 (steps S138, S139). To be determined as case CA12, the above condition (11) must be true and condition (12) must be false (steps S135, S136, S137A).
次いで、ケースCA13として、1番目からX番目までのデータ転送を実施した後に転送要求Rnを実施するとデータ転送は間に合わないが、転送要求Rnを元々X番目のデータ転送より前に転送すると、元々X番目のデータ転送の転送許容時間TAが満たされる場合について説明する。 Next, we will explain case CA13, where if transfer request Rn is executed after the first through Xth data transfers have been executed, the data transfer will not be completed in time, but if transfer request Rn is transferred before the original Xth data transfer, the original allowable transfer time TA for the Xth data transfer will be satisfied.
この場合、元々のX番目であった転送要求を、転送要求Rnの後に実行しても許容時間TAを満たしているため、転送要求Rnが先に行なわれるよう転送要求RnをX番目に実行し、元々X番目であったデータ転送を(X+1)番目に実行する。 In this case, the allowable time TA is met even if the transfer request that was originally Xth is executed after transfer request Rn, so transfer request Rn is executed Xth so that it is executed first, and the data transfer that was originally Xth is executed (X+1)th.
ケースCA13であると判定されるためには、上記条件(11)が偽であり、かつ以下の条件(13)が真となる必要がある(ステップS135,S137,S137A)。
条件(11):TRn+SUM(X)≦TAn-TPn
条件(13):TRX+TRn+SUM(X-1)≦TAX-TPX
In order to determine that the case is CA13, the above condition (11) must be false and the following condition (13) must be true (steps S135, S137, S137A).
Condition (11): TRn+SUM(X)≦TAn-TPn
Condition (13): TRX+TRn+SUM(X-1)≦TAX-TPX
なお、ケースCA13の判定においては、条件(11)および条件(13)の順番Xは、転送要求Rnと順番を入れ替える前の元々のX番目の転送要求の順番であることに注意する必要がある。 Note that when determining case CA13, the order X of conditions (11) and (13) is the original order of the Xth transfer request before it was swapped with transfer request Rn.
また、条件(11)が偽であることは、転送要求Rnと元々のX番目の転送要求とを入れ替えなければ、転送要求Rnの許容時間TAnが満たせないことを意味する。 Furthermore, if condition (11) is false, it means that the allowable time TAn for transfer request Rn cannot be met unless transfer request Rn is swapped with the original Xth transfer request.
また、条件(13)が真であることは、元々のX番目であったデータ転送要求RXの前に、転送要求Rnを実行しても(すなわち、転送要求RnをX番目に実行し、転送要求RXを(X+1)番目に実行しても)、転送要求RXの転送許容時間TAを満たすことを意味する。 Furthermore, the fact that condition (13) is true means that even if transfer request Rn is executed before data transfer request RX, which was originally the Xth (i.e., even if transfer request Rn is executed Xth and transfer request RX is executed (X+1)th), the allowable transfer time TA of transfer request RX will be met.
また、ケースCA13の後、転送許容時間TAnが満たせるようになったのか、また転送要求Rnの余裕時間TMnと、転送要求Rnの1つ前の転送[(X-1)番目の転送]の余裕時間TMとの大小関係に応じて、さらに転送要求Rnの順番を早める必要があるのかを判定するために、ケースCA12と同様にXの値を1小さくし、再度ケースCA11からの判定を行なう。 Furthermore, after case CA13, to determine whether the allowable transfer time TAn can be met and whether it is necessary to further advance the order of transfer request Rn depending on the relative magnitude of the slack time TMn of transfer request Rn and the slack time TM of the transfer immediately preceding transfer request Rn [the (X-1)th transfer], the value of X is decreased by 1, as in case CA12, and the determination from case CA11 is repeated again.
ただし、ケースCA12およびケースCA13の場合においてXから1を引いた結果Xが0となった場合、これ以上転送要求Rnの前に実行される転送要求は存在しないので、転送要求Rnを1番目に設定してループを抜ける(ステップS139,S140)。 However, in cases CA12 and CA13, if subtracting 1 from X results in X being 0, there are no more transfer requests to be executed before transfer request Rn, so transfer request Rn is set to first and the loop is exited (steps S139 and S140).
また、ケースCA1およびケースCA2の余裕時間の計算を実施しない場合でも、TRn≦TAnであり、動作として問題は発生しないので、ステップS136を実施するかどうかはユーザが選択できるものとする。ステップS136を実施しない場合は、ステップS135により転送許容時間TAnを満たすために、転送要求Rnが必要最低限な転送順が判明した時点でループを抜ける。 Furthermore, even if the calculation of the slack time in cases CA1 and CA2 is not performed, TRn≦TAn and no operational problems will occur, so the user can choose whether to perform step S136. If step S136 is not performed, the loop will exit when the minimum necessary transfer order for transfer request Rn to satisfy the transfer allowable time TAn is determined in step S135.
その他、補足説明としてステップS134においてTRn≦TAnとなることを判定しているので、転送要求Rnの順番が最も早くなった場合(転送要求Rnが1番目となる場合)にも、転送許容時間TAnを満たさないという事象は発生しない。 As an additional note, because step S134 determines whether TRn≦TAn, even if transfer request Rn becomes the earliest in order (transfer request Rn is first), the event of not meeting the transfer allowable time TAn will not occur.
次に、ケースCA14として、1番目からX番目までデータ転送を実行した後では、転送許容時間TAnを満たせず、かつ、転送要求Rnを元々のX番目の転送要求RXより前に実行すると、元々のX番目の転送要求RXの転送許容時間TAXを満たせない場合について説明する。 Next, we will explain case CA14, where the allowable transfer time TAn cannot be met after the first through Xth data transfers have been executed, and the allowable transfer time TAX of the original Xth transfer request RX cannot be met if transfer request Rn is executed before the original Xth transfer request RX.
この場合、X番目のデータ転送を先に実行する。転送要求Rnを送信した転送要求元にはエラー通知を行なう。上記条件(11)が偽であり、かつ条件(13)が偽となる場合に、ケースCA14であると判定される(ステップS135,S137,S141)。 In this case, the Xth data transfer is executed first. An error notification is sent to the transfer request source that sent the transfer request Rn. If the above condition (11) is false and the above condition (13) is false, it is determined that the case is CA14 (steps S135, S137, S141).
この場合は、転送要求Rnに対するエラー通知を転送コントロール回路15に行なう。エラーの発生した転送要求Rnを実施するかどうかはユーザにより選択できるものとする。転送要求Rnを実施する場合は、転送要求Rnは(X+1)番目に実施される(ステップS141)。 In this case, an error notification for transfer request Rn is sent to the transfer control circuit 15. The user can choose whether to implement transfer request Rn in which an error occurred. If transfer request Rn is to be implemented, transfer request Rn is implemented as the (X+1)th request (step S141).
なお、エラーとなった転送要求Rnを実施する場合は、転送要求Rnの実行が完了するまで、新たに発生した転送要求R(n+1)以降の転送要求がエラーとなる可能性が高くなるので、システムの目的に応じてはエラーとなった転送要求を実施しないようにすることが有効である。 Note that if a transfer request Rn that resulted in an error is implemented, there is a high possibility that newly generated transfer requests R(n+1) and onwards will result in an error until the execution of transfer request Rn is completed. Therefore, depending on the purpose of the system, it may be effective to not implement the transfer request that resulted in an error.
再び図12を参照して、ステップS134において計算部14は、今回新たに発生した転送要求Rnについて、転送所要時間TRnと転送許容時間TAnの長短を比較し、TRn≦TAnであるか否かを判別する。 Referring again to FIG. 12, in step S134, the calculation unit 14 compares the required transfer time TRn and the allowed transfer time TAn for the newly generated transfer request Rn, and determines whether TRn≦TAn.
TRn≦TAnである場合(ステップS134でYESの場合)、ステップS135において計算部14は、条件(11)が真であるか否かを判別する。条件(11)が真である場合(ステップS135でYESの場合)、ステップS136において計算部14は、条件(12)が真であるか否かを判別する。 If TRn≦TAn (YES in step S134), in step S135 the calculation unit 14 determines whether condition (11) is true. If condition (11) is true (YES in step S135), in step S136 the calculation unit 14 determines whether condition (12) is true.
条件(12)が真である場合(ステップS136でYESの場合)には上記ケースCA11に該当するので、ステップS140において計算部14は、最新のデータ転送要求Rnを(X+1)番目に実行する旨を示す転送順を転送コントロール回路15に送信する。 If condition (12) is true (YES in step S136), the above case CA11 applies, so in step S140, the calculation unit 14 sends to the transfer control circuit 15 a transfer order indicating that the latest data transfer request Rn will be executed as the (X+1)th.
条件(12)が偽である場合(ステップS136でNOの場合)には上記ケースCA12に該当するので、計算部14は、ステップS137AにおいてX番目のデータ転送とデータ転送Rnとの転送順を入れ替え、ステップS138においてXの値を1だけ小さくし、ステップS139においてX=0であるか否かを判別する。X=0である場合(ステップS139でYESの場合)には、計算部14はステップS140を実行する。X=0でない場合(ステップS139でNOの場合)には、計算部14はステップS135に戻る。 If condition (12) is false (NO in step S136), the above case CA12 applies, so the calculation unit 14 swaps the transfer order of the Xth data transfer and data transfer Rn in step S137A, decreases the value of X by 1 in step S138, and determines whether X = 0 in step S139. If X = 0 (YES in step S139), the calculation unit 14 executes step S140. If X = 0 is not (NO in step S139), the calculation unit 14 returns to step S135.
条件(11)が偽である場合(ステップS135でNOの場合)、ステップS137において計算部14は、条件(13)が真であるか否かを判別する。条件(13)が真である場合(ステップS137でYESの場合)には上記ケースCA13に該当するので、計算部14はステップS137Aに進む。 If condition (11) is false (NO in step S135), in step S137 the calculation unit 14 determines whether condition (13) is true. If condition (13) is true (YES in step S137), the above case CA13 applies, and the calculation unit 14 proceeds to step S137A.
条件(13)が偽である場合(ステップS137でNOの場合)には上記ケースCA14に該当するので、ステップS141において計算部14は、n番目の転送要求Rnに対してエラー通知Enを行ない、転送要求Rnを(X+1)番目に実行する旨を示す転送順を転送コントロール回路15に応答し、ステップS121(図11)に戻る。 If condition (13) is false (NO in step S137), the above case CA14 applies, so in step S141 the calculation unit 14 issues an error notification En for the nth transfer request Rn, responds to the transfer control circuit 15 with a transfer order indicating that transfer request Rn will be executed in the (X+1)th order, and returns to step S121 (Figure 11).
以上のように、この変更例では、任意の数nの転送要求が発生する場合でも、優先度の高いデータを優先度の低いデータよりも先に転送することができる。 As described above, in this modified example, even when an arbitrary number n of transfer requests occur, high priority data can be transferred before low priority data.
実施の形態2.
実施の形態1では、1番目からX番目までデータ転送を実行した後に転送要求Rnを実行すると転送許容時間TAnを満たせず、かつ、転送要求Rnを元々のX番目の転送要求RXより前に実行すると元々のX番目の転送要求RXの転送許容時間TAXを満たせない場合(上記のケースCA14)には、常に転送要求RXの後に転送要求Rnを実行する(図10のステップS100、図12のステップS141)。
Embodiment 2.
In the first embodiment, if the transfer allowable time TAn is not met when the transfer request Rn is executed after the first to Xth data transfers have been executed, and if the transfer request Rn is executed before the original Xth transfer request RX, the transfer allowable time TAX of the original Xth transfer request RX is not met (case CA14 above), then the transfer request Rn is always executed after the transfer request RX (step S100 in FIG. 10, step S141 in FIG. 12).
しかしながら、製品やシステムによっては、新しく発生したデータ転送要求Rnが重要である場合には、それ以前の転送要求RXを待たせることになっても、重要な転送要求Rnを優先して実行することが求められる場合がある。本実施の形態2では、この問題の解決が図られる。 However, depending on the product or system, if a newly generated data transfer request Rn is important, it may be necessary to prioritize execution of the important transfer request Rn, even if this means making the previous transfer request RX wait. This second embodiment aims to solve this problem.
図13は、本実施の形態2に従うデータ転送システムの構成を示すブロック図であって、図1と対比される図である。図13が図1と異なる点は、周辺回路4,5がそれぞれ周辺回路21,22で置換され、DMA部1がDMA部25で置換されている点である。 Figure 13 is a block diagram showing the configuration of a data transfer system according to the second embodiment, and is a diagram to be compared with Figure 1. Figure 13 differs from Figure 1 in that peripheral circuits 4 and 5 are replaced with peripheral circuits 21 and 22, respectively, and DMA unit 1 is replaced with DMA unit 25.
周辺回路21,22の各々は、転送要求元RSとして、DMA部25にデータ転送要求Rを送信する。このデータ転送要求Rは、転送元アドレス、転送先アドレス、転送所要時間TRに関連する第1の情報(すなわち転送データ容量)、および転送許容時間TAを示す第2の情報に加え、当該転送要求Rの重要度IMを示す第3の情報をさらに含む。重要度IMはどのように定義されていてもよいが、たとえば、重要度IMは、1,2,3のうちのいずれかの数字で表され、重要な転送要求Rほど大きな数字で表される。 Each of the peripheral circuits 21 and 22 transmits a data transfer request R to the DMA unit 25 as a transfer request source RS. This data transfer request R includes not only first information relating to the source address, destination address, required transfer time TR (i.e., transfer data capacity), and second information indicating the allowable transfer time TA, but also third information indicating the importance IM of the transfer request R. The importance IM may be defined in any way, but for example, the importance IM is represented by a number from 1, 2, or 3, with the more important the transfer request R, the larger the number.
DMA部25がDMA部1と異なる点は、重要度保持部26が追加され、転送所要時間計算部14および転送コントロール回路15がそれぞれ転送所要時間計算部27および転送コントロール回路28で置換されている点である。なお、転送所要時間計算部27についても、以下では単に「計算部27」と称する場合がある。 DMA unit 25 differs from DMA unit 1 in that it includes an importance holding unit 26, and the required transfer time calculation unit 14 and transfer control circuit 15 have been replaced with a required transfer time calculation unit 27 and a transfer control circuit 28, respectively. Note that the required transfer time calculation unit 27 may also be referred to simply as the "calculation unit 27" below.
重要度保持部26は、転送要求元TSから転送される重要度IMを保持し、その重要度IMを計算部27に出力する。計算部27は、計算部14と同じ動作を行なう他、転送許容時間TAを保持部11から取得するときに(図11のステップS123、図12のステップS129)、重要度IMを重要度保持部26から取得する。 The importance holding unit 26 holds the importance IM transferred from the transfer request source TS and outputs the importance IM to the calculation unit 27. The calculation unit 27 performs the same operations as the calculation unit 14, and also acquires the importance IM from the importance holding unit 26 when acquiring the transfer allowable time TA from the holding unit 11 (step S123 in Figure 11, step S129 in Figure 12).
さらに計算部27は、上記の条件(11)が偽であり、かつ条件(13)が偽であるために上記ケースCA14であると判定される場合(図12のステップS137でNOの場合)には、転送順がX番目の転送要求RXの重要度IMXと、新たに発生した転送要求Rnの重要度IMnとを比較する。 Furthermore, if the calculation unit 27 determines that the above case CA14 applies because the above condition (11) is false and the above condition (13) is false (NO in step S137 of FIG. 12), it compares the importance IMX of the Xth transfer request RX in the transfer order with the importance IMn of the newly generated transfer request Rn.
そして計算部27は、転送要求Rnの重要度IMnが転送要求RXの重要度IMXよりも高い場合には、転送要求Rnと転送要求RXの転送順を入れ替えるとともに、転送要求RXの転送要求元RSXにエラーEXを通知する。 If the importance IMn of transfer request Rn is higher than the importance IMX of transfer request RX, the calculation unit 27 swaps the transfer order of transfer request Rn and transfer request RX and notifies the transfer request source RSX of transfer request RX of an error EX.
他方、計算部27は、転送要求Rnの重要度IMnが転送要求RXの重要度IMX以下である場合には、転送要求Rnと転送要求RXの転送順を入れ替えず、転送要求Rnの転送要求元RSnにエラーEnを通知する。 On the other hand, if the importance IMn of transfer request Rn is equal to or less than the importance IMX of transfer request RX, the calculation unit 27 does not change the transfer order of transfer request Rn and transfer request RX, and notifies the transfer request source RSn of transfer request Rn of an error En.
転送コントロール回路28は、転送コントロール回路15と同じ動作を行なう他、転送許容時間TAを保持部11に転送するときに(図6のステップS4、図7のステップS15)、重要度IMを重要度保持部26に転送する。 The transfer control circuit 28 performs the same operations as the transfer control circuit 15, and also transfers the importance IM to the importance holding unit 26 when transferring the transfer allowable time TA to the holding unit 11 (step S4 in Figure 6, step S15 in Figure 7).
図14は、計算部27の動作の要部を示すフローチャートであって、図12と対比される図である。図14が図12と異なる点は、ステップS151,S152が追加されている点である。 Figure 14 is a flowchart showing the main operations of the calculation unit 27, and is a diagram to be compared with Figure 12. Figure 14 differs from Figure 12 in that steps S151 and S152 have been added.
ステップS137においてNOである場合には、計算部27は、ステップS151において次の条件(14)が真であるか否かを判別する。
条件(14):IMX<IMn
If the result of step S137 is NO, the calculation unit 27 determines in step S151 whether the following condition (14) is true:
Condition (14): IMX<IMn
条件(14)が真である場合(ステップS151でYESの場合)には、転送要求Rnの重要度IMnが転送要求RXの重要度IMXよりも高いので、計算部27は、ステップS152において転送要求RXの要求元RSXに対してエラー通知EXを送った後、ステップS137Aにおいて転送要求RXと転送要求Rnの転送順を入れ替える。これにより、重要な転送要求Rnが転送要求RXよりも先に実行される。 If condition (14) is true (YES in step S151), the importance IMn of transfer request Rn is higher than the importance IMX of transfer request RX, so the calculation unit 27 sends an error notification EX to the requestor RSX of transfer request RX in step S152, and then swaps the transfer order of transfer request RX and transfer request Rn in step S137A. As a result, the more important transfer request Rn is executed before transfer request RX.
なお、ステップS152において転送要求RXの要求元RSXに対してエラー通知EXを送るのは、条件(13)は偽(ステップS137でNO)であるので、転送要求RXと転送要求Rnの転送順を入れ替えると、元々X番目であった転送要求RXの転送許容時間TAXを満たせなくなるからである。 In step S152, an error notification EX is sent to the requestor RSX of the transfer request RX because condition (13) is false (NO in step S137), and if the transfer order of the transfer request RX and the transfer request Rn is swapped, the allowable transfer time TAX of the transfer request RX, which was originally the Xth, would no longer be met.
条件(14)が偽である場合(ステップS151でNOの場合)には、転送要求Rnの重要度IMnが転送要求RXの重要度IMX以下であるので、計算部27は、ステップS141において転送要求Rnの要求元RSnに対してエラー通知Enを送るとともに、転送要求RXの後に転送要求Rnが実行されるように転送順を応答する。他の構成および動作は、実施の形態1と同じであるので、その説明は繰り返さない。 If condition (14) is false (NO in step S151), the importance IMn of transfer request Rn is less than or equal to the importance IMX of transfer request RX, so in step S141, the calculation unit 27 sends an error notification En to the requestor RSn of transfer request Rn and responds with a transfer order so that transfer request Rn is executed after transfer request RX. The other configurations and operations are the same as in embodiment 1, so their description will not be repeated.
以上のように、本実施の形態2では、ケースCA14である場合(図14のステップS137でNOの場合)には、転送要求RXの重要度IMXと転送要求Rnの重要度IMnとを比較し、IMX<IMnである場合には、転送要求RXよりも転送要求Rnを先に実行する。したがって、転送要求RXを待たせることになるが、転送要求RXよりも重要な転送要求Rnを先に実行することができる。 As described above, in this second embodiment, in case CA14 (NO in step S137 in FIG. 14), the importance IMX of transfer request RX is compared with the importance IMn of transfer request Rn, and if IMX < IMn, transfer request Rn is executed before transfer request RX. Therefore, although transfer request RX will have to wait, transfer request Rn, which is more important than transfer request RX, can be executed before transfer request RX.
なお、本実施の形態2では、転送コントロール回路28が転送要求Rに含まれている重要度IMを重要度保持部26に転送したが、これに限るものではなく、転送要求元(周辺回路21,22)が転送要求Rの重要度IMを重要度保持部26に登録しても構わない。 In the second embodiment, the transfer control circuit 28 transfers the importance IM included in the transfer request R to the importance holding unit 26, but this is not limited to this, and the transfer request source (peripheral circuits 21, 22) may also register the importance IM of the transfer request R in the importance holding unit 26.
実施の形態3.
実施の形態2では、ケースCA14である場合には、DMA部25の計算部27(図13)が転送要求RX,Rnの重要度IMX,IMnに基づいて条件(14)の真偽を判定し、条件(14)が真である場合には、転送要求RX,Rnを実行する順番(転送順)を入れ替える(図14のステップS151,S152,S137A)。
Embodiment 3.
In the second embodiment, in the case of case CA14, the calculation unit 27 (FIG. 13) of the DMA unit 25 determines whether the condition (14) is true or false based on the importance IMX, IMn of the transfer requests RX, Rn, and if the condition (14) is true, the order in which the transfer requests RX, Rn are executed (transfer order) is changed (steps S151, S152, S137A in FIG. 14).
しかしながら、製品やシステムによっては、全ての転送要求Rについて重要度IMを一律に定義することが難しい場合がある。また、転送要求Rを発行した後に状況が変化し、その転送要求Rの重要度IMが変化してしまう場合がある。このような場合に転送順が入れ替えられると、製品やシステムが意図しない事態が発生する恐れがある。本実施の形態3では、この問題の解決が図られる。 However, depending on the product or system, it may be difficult to uniformly define the importance IM for all transfer requests R. Furthermore, the situation may change after a transfer request R is issued, causing the importance IM of that transfer request R to change. If the transfer order is changed in such a case, an unintended situation may occur in the product or system. This third embodiment aims to solve this problem.
図15は、本実施の形態3に従うデータ転送システムの構成を示すブロック図であって、図1と対比される図である。図15が図1と異なる点は、周辺回路4,5がそれぞれ周辺回路31,32で置換され、DMA部1がDMA部33で置換されている点である。 Figure 15 is a block diagram showing the configuration of a data transfer system according to the third embodiment, and is a diagram to be compared with Figure 1. Figure 15 differs from Figure 1 in that peripheral circuits 4 and 5 are replaced by peripheral circuits 31 and 32, respectively, and DMA unit 1 is replaced by DMA unit 33.
周辺回路31,32の各々は、周辺回路4,5の各々と同じ動作を行なう他、DMA部33から転送順の入れ替えが可能か否かの問い合わせがあった場合には、その問い合わせに対する回答をDMA部33に送信する。 Peripheral circuits 31 and 32 each perform the same operations as peripheral circuits 4 and 5, and when DMA unit 33 inquires whether the transfer order can be changed, they also send a response to that inquiry to DMA unit 33.
DMA部33がDMA部1と異なる点は、転送所要時間計算部14が転送所要時間計算部34で置換されている点である。なお、転送所要時間計算部34についても、以下では単に「計算部34」と称する場合がある。計算部34は、計算部14と同じ動作を行なう他、ケースCA14である場合には、転送要求RXの要求元RSX(たとえば周辺回路31)に転送要求RX,Rnを実行する順番の入れ替えの可否を問い合わせる。 DMA unit 33 differs from DMA unit 1 in that required transfer time calculation unit 14 has been replaced with required transfer time calculation unit 34. Note that required transfer time calculation unit 34 may also be referred to simply as "calculation unit 34" below. Calculation unit 34 performs the same operations as calculation unit 14, and in case CA14, queries the requester RSX of transfer request RX (for example, peripheral circuit 31) as to whether the order in which transfer requests RX and Rn are executed can be reversed.
そして計算部34は、要求元RSXから転送要求RX,Rnの入れ替えが可能である旨の回答があった場合には、転送要求Rnと転送要求RXの順番を入れ替えるとともに、転送要求RXの転送要求元RSXにエラーEXを通知する。 If the request source RSX replies that it is possible to switch the transfer requests RX and Rn, the calculation unit 34 switches the order of the transfer requests Rn and RX and notifies the transfer request source RSX of the transfer request RX of an error EX.
他方、計算部34は、要求元RSXから転送要求RX,Rnの入れ替えが不可能である旨の回答があった場合には、転送要求Rnと転送要求RXの順番を入れ替えずに、転送要求Rnの転送要求元RSn(たとえば周辺回路32)にエラーEnを通知する。 On the other hand, if the calculation unit 34 receives a response from the request source RSX indicating that it is not possible to switch the transfer requests RX and Rn, it does not switch the order of the transfer requests Rn and RX, and notifies the transfer request source RSn (for example, the peripheral circuit 32) of the transfer request Rn of an error En.
図16は、計算部34の動作の要部を示すフローチャートであって、図12と対比される図である。図16が図12と異なる点は、ステップS161~S164が追加されている点である。 Figure 16 is a flowchart showing the main operations of the calculation unit 34, and is a diagram to be compared with Figure 12. Figure 16 differs from Figure 12 in that steps S161 to S164 have been added.
ステップS137においてNOである場合に、計算部34は、ステップS161において転送要求RXの要求元RSX(たとえば周辺回路31)に転送要求RX,Rnの入れ替えが可能か否かを問い合わせる。転送要求元RSXは、計算部34からの問い合わせを検討し、転送要求RX,Rnの入れ替えが可能か否かの回答を計算部34に送信する。 If the answer is NO in step S137, the calculation unit 34 inquires in step S161 of the requestor RSX (e.g., peripheral circuit 31) of the transfer request RX as to whether the transfer requests RX and Rn can be swapped. The transfer requestor RSX reviews the inquiry from the calculation unit 34 and sends a response to the calculation unit 34 as to whether the transfer requests RX and Rn can be swapped.
計算部34は、ステップS162において転送要求元RSXからの回答を受信し、ステップS163において、受信した回答に基づいて転送要求RX,Rnの入れ替えが可能か否かを判別する。 In step S162, the calculation unit 34 receives a response from the transfer request source RSX, and in step S163, based on the received response, determines whether or not the transfer requests RX and Rn can be swapped.
転送要求RX,Rnの入れ替えが可能である場合(ステップS163でYESの場合)には、計算部34は、ステップS164において転送要求RXの要求元RSXに対してエラー通知EXを送った後、ステップS137Aにおいて転送要求RXと転送要求Rnの転送順を入れ替える。これにより、重要な転送要求Rnが転送要求RXよりも先に実行される。 If it is possible to switch the transfer requests RX and Rn (YES in step S163), the calculation unit 34 sends an error notification EX to the requestor RSX of the transfer request RX in step S164, and then switches the transfer order of the transfer request RX and the transfer request Rn in step S137A. This allows the important transfer request Rn to be executed before the transfer request RX.
なお、ステップS164において転送要求RXの要求元RSXに対してエラー通知EXを送るのは、条件(13)は偽(ステップS137でNO)であるので、転送要求RXと転送要求Rnの転送順を入れ替えると、元々X番目であった転送要求RXの転送許容時間TAXを満たせなくなるからである。 In step S164, an error notification EX is sent to the requestor RSX of the transfer request RX because condition (13) is false (NO in step S137), and if the transfer order of the transfer request RX and the transfer request Rn is swapped, the allowable transfer time TAX of the transfer request RX, which was originally the Xth, would no longer be met.
転送要求RX,Rnの入れ替えが不可能である場合(ステップS163でNOの場合)には、計算部34は、ステップS141において転送要求Rnの要求元RSnに対してエラー通知Enを送るとともに、転送要求RXの次に転送要求Rnが実行されるように転送順を応答する。他の構成および動作は、実施の形態1と同じであるので、その説明は繰り返さない。 If it is not possible to switch the transfer requests RX and Rn (NO in step S163), the calculation unit 34 sends an error notification En to the requestor RSn of the transfer request Rn in step S141, and also responds with a transfer order so that the transfer request Rn is executed after the transfer request RX. The other configurations and operations are the same as in embodiment 1, so their description will not be repeated.
以上のように、本実施の形態3では、ケースCA14である場合(図16のステップS137でNOの場合)には、転送要求RXの要求元RSXに転送要求RX,Rnの入れ替えが可能か否かを問い合わせ、入れ替え可能の回答があった場合には、転送要求RXよりも転送要求Rnを先に実行する。したがって、実施の形態1と同じ効果が得られる他、全ての転送要求Rについて重要度IMを一律に定義することが難しい場合や、転送要求Rを発行した後に転送要求Rの重要度IMが変化してしまう場合でも、システムの意図に反する事態を招くことなく、重要な転送要求Rnを先に実行することができる。 As described above, in this third embodiment, in case CA14 (NO in step S137 of FIG. 16), the requestor RSX of the transfer request RX is queried as to whether or not the transfer requests RX and Rn can be swapped, and if the response is that they can be swapped, the transfer request Rn is executed before the transfer request RX. Therefore, in addition to obtaining the same effect as in the first embodiment, even if it is difficult to uniformly define the importance IM for all transfer requests R, or even if the importance IM of a transfer request R changes after it is issued, the important transfer request Rn can be executed first without causing a situation that goes against the intention of the system.
なお、転送要求RXの要求元RSXに転送要求RX,Rnの入れ替えが可能か否かを問い合わせる場合に、転送要求RX,Rnの入れ替えの可否を判定するための情報として、転送要求RX,Rnを入れ替えた場合に、どの程度転送許容時間TAXを超過することになるか等の情報を転送要求元RSXに伝えてもよい。 When inquiring of the requester RSX of the transfer request RX as to whether or not the transfer requests RX and Rn can be swapped, the requester RSX may be informed of information such as the extent to which the transfer allowable time TAX will be exceeded if the transfer requests RX and Rn are swapped, as information for determining whether or not the transfer requests RX and Rn can be swapped.
また、本実施の形態3では、転送要求RXの要求元RSXのみに転送要求の入れ替えの可否を問い合わせたが、これに限るものではなく、転送要求元RSn以外の全ての転送要求元RS0~RSXに転送要求の入れ替えの可否を問い合わせ、入れ替え可能となった転送要求と転送要求Rnとを入れ替えても構わない。 Furthermore, in this third embodiment, only the request source RSX of the transfer request RX is inquired about whether or not the transfer request can be swapped, but this is not limited to this. It is also possible to inquire about whether or not the transfer request can be swapped of all transfer request sources RS0 to RSX other than the transfer request source RSn, and swap the transfer request that becomes swappable with the transfer request Rn.
また、転送要求RX,Rnの入れ替えが可能な場合には、新たな転送許容時間TAX1も回答に含ませることとし、保持部11に保持されている転送許容時間TAXを新たな転送許容時間TAX1に書き換えても構わない。この場合は、転送順を入れ替えた後に、エラーとなることはない。 Furthermore, if it is possible to switch the transfer requests RX and Rn, the new transfer allowance time TAX1 can also be included in the response, and the transfer allowance time TAX stored in the storage unit 11 can be rewritten with the new transfer allowance time TAX1. In this case, no errors will occur after the transfer order is switched.
また、実施の形態2と実施の形態3を適宜組み合わせて使用することが可能である。たとえば、転送要求RX,Rnの入れ替えが可能か否かを重要度IMX,IMnに基づいて判定し、IMX<IMnである場合には転送順を入れ替え(実施の形態2)、IMX=IMnである場合には、転送要求RX,Rnの入れ替えの可否を要求元RSXに問い合わせる方法(実施の形態3)が考えらえる。 It is also possible to combine the second and third embodiments as appropriate. For example, it is possible to determine whether or not the transfer requests RX and Rn can be swapped based on the importance IMX and IMn, and if IMX < IMn, swap the transfer order (second embodiment), and if IMX = IMn, inquire of the requestor RSX whether or not the transfer requests RX and Rn can be swapped (third embodiment).
今回開示された実施の形態はすべての点で例示であって制限的なものではないと考えられるべきである。本開示により示される技術的範囲は、上記した実施の形態ではなくて請求の範囲によって示され、請求の範囲と均等の意味および範囲内でのすべての変更が含まれることが意図される。 The embodiments disclosed herein should be considered in all respects to be illustrative and not restrictive. The technical scope of the present disclosure is defined by the claims, not the above-described embodiments, and is intended to include all modifications within the meaning and scope of the claims.
1,25,33 DMA部、2 システムバス、3 RAM、4,5,21,22,31,32 周辺回路、6 MPU、11 転送許容時間保持部、12 データバッファ、13 BUS/IF、14,27,34 転送所要時間計算部、15 転送コントロール回路、16 転送時間カウンタ、17 ディスティネーションアドレスポインタ、18 ソースアドレスポインタ、26 重要度保持部。 1, 25, 33 DMA unit, 2 System bus, 3 RAM, 4, 5, 21, 22, 31, 32 Peripheral circuits, 6 MPU, 11 Transfer allowable time holding unit, 12 Data buffer, 13 BUS/IF, 14, 27, 34 Transfer required time calculation unit, 15 Transfer control circuit, 16 Transfer time counter, 17 Destination address pointer, 18 Source address pointer, 26 Importance holding unit.
Claims (6)
各転送要求は、当該転送要求を実行するために必要な転送所要時間に関連する第1の情報と、当該転送要求に対するデータ転送を完了するまでに許容される最大時間である転送許容時間を示す第2の情報とを含み、
前記データ転送装置は、
前記各転送要求の前記第1および第2の情報に基づいて、前記複数の転送要求を実行する順序を設定する計算部と、
前記計算部によって設定された順序で前記複数の転送要求を実行する転送コントロール回路とを備え、
前記計算部は、
前記各転送要求毎に前記第1の情報に基づいて前記転送所要時間を計算し、
前記各転送要求の前記転送所要時間が当該転送要求の前記転送許容時間以内に収まるように、前記複数の転送要求を実行する順序を設定し、
前記各転送要求の前記転送所要時間が当該転送要求の前記転送許容時間以内に収まるように前記順序を設定することができない場合に、前記計算部は、
当該転送要求の開始前に予定されている他の転送要求の要求元に、当該転送要求および前記他の転送要求の順番の入れ替えが可能か否かを問い合わせ、
前記順番の入れ替えが可能であると回答された場合には、前記各転送要求が前記他の転送要求よりも先に実行されるように前記順序を設定し、
前記順番の入れ替えが可能でないと回答された場合には、前記各転送要求が前記他の転送要求よりも後に実行されるように前記順序を設定する、データ転送装置。 A data transfer device that transfers data in accordance with a plurality of transfer requests,
Each transfer request includes first information relating to a required transfer time required to execute the transfer request, and second information indicating an allowed transfer time, which is a maximum time allowed for completing a data transfer for the transfer request;
The data transfer device
a calculation unit that sets an order of execution of the plurality of transfer requests based on the first and second information of each of the transfer requests;
a transfer control circuit that executes the plurality of transfer requests in an order set by the calculation unit;
The calculation unit
calculating the required transfer time for each of the transfer requests based on the first information;
setting an order in which the plurality of transfer requests are to be executed so that the required transfer time of each of the transfer requests falls within the transfer allowable time of the transfer request;
When the order cannot be set so that the required transfer time of each of the transfer requests falls within the transfer allowable time of the transfer request, the calculation unit:
inquiring of a requester of another transfer request scheduled before the start of the transfer request whether or not it is possible to change the order of the transfer request and the other transfer request;
If it is answered that the order can be changed, the order is set so that each of the transfer requests is executed before the other transfer requests;
If the response is that the order cannot be changed, the data transfer device sets the order so that each of the transfer requests is executed after the other transfer requests.
各転送要求は、当該転送要求を実行するために必要な転送所要時間に関連する第1の情報と、当該転送要求に対するデータ転送を完了するまでに許容される最大時間である転送許容時間を示す第2の情報とを含み、
前記データ転送装置は、
前記各転送要求の前記第1および第2の情報に基づいて、前記複数の転送要求を実行する順序を設定する計算部と、
前記計算部によって設定された順序で前記複数の転送要求を実行する転送コントロール回路とを備え、
前記計算部は、
前記各転送要求毎に前記第1の情報に基づいて前記転送所要時間を計算し、
前記各転送要求の前記転送所要時間が当該転送要求の前記転送許容時間以内に収まるように、前記複数の転送要求を実行する順序を設定し、
前記各転送要求が通知された時点からの経過時間を測定する計時部をさらに備え、
前記各転送要求が通知される毎に、前記計算部は、
前記計時部の計時結果に基づいて、前記各転送要求の前記転送許容時間の残り時間を計算し、
前記各転送要求のデータ残量に基づいて当該転送要求を実行するために必要な前記転送所要時間を再計算し、
再計算された前記転送所要時間が前記転送許容時間の残り時間内に収まるように、前記複数の転送要求を実行する順序を再設定する、データ転送装置。 A data transfer device that transfers data in accordance with a plurality of transfer requests,
Each transfer request includes first information relating to a required transfer time required to execute the transfer request, and second information indicating an allowed transfer time, which is a maximum time allowed for completing a data transfer for the transfer request;
The data transfer device
a calculation unit that sets an order of execution of the plurality of transfer requests based on the first and second information of each of the transfer requests;
a transfer control circuit that executes the plurality of transfer requests in an order set by the calculation unit;
The calculation unit
calculating the required transfer time for each of the transfer requests based on the first information;
setting an order in which the plurality of transfer requests are to be executed so that the required transfer time of each of the transfer requests falls within the transfer allowable time of the transfer request;
a timer unit for measuring the elapsed time from the time when each of the transfer requests is notified;
Each time the transfer request is notified, the calculation unit:
Calculating the remaining time of the permissible transfer time for each of the transfer requests based on the timekeeping result of the timekeeping unit;
recalculating the required transfer time for executing each of the transfer requests based on the remaining amount of data in each of the transfer requests;
a data transfer device that resets the order in which the plurality of transfer requests are executed so that the recalculated required transfer time falls within the remaining time of the allowed transfer time.
各転送要求は、当該転送要求を実行するために必要な転送所要時間に関連する第1の情報と、当該転送要求に対するデータ転送を完了するまでに許容される最大時間である転送許容時間を示す第2の情報とを含み、
前記データ転送装置は、
前記各転送要求の前記第1および第2の情報に基づいて、前記複数の転送要求を実行する順序を設定する計算部と、
前記計算部によって設定された順序で前記複数の転送要求を実行する転送コントロール回路とを備え、
前記計算部は、
前記各転送要求毎に前記第1の情報に基づいて前記転送所要時間を計算し、
前記各転送要求の前記転送所要時間が当該転送要求の前記転送許容時間以内に収まるように、前記複数の転送要求を実行する順序を設定し、
前記各転送要求が通知される毎に、前記計算部は、
当該転送要求の前記転送許容時間と前記転送所要時間との差である第1の余裕時間を計算し、
当該転送要求の前に実行される予定の他の転送要求について、前記他の転送要求の前記転送許容時間と前記転送所要時間との差である第2の余裕時間を計算し、
前記第1の余裕時間が前記第2の余裕時間よりも大きい場合には、当該転送要求を実行する順序を前記他の転送要求の後に設定し、
前記第1の余裕時間が前記第2の余裕時間よりも小さい場合には、当該転送要求を実行する順序を前記他の転送要求の先に設定する、データ転送装置。 A data transfer device that transfers data in accordance with a plurality of transfer requests,
Each transfer request includes first information relating to a required transfer time required to execute the transfer request, and second information indicating an allowed transfer time, which is a maximum time allowed for completing a data transfer for the transfer request;
The data transfer device
a calculation unit that sets an order of execution of the plurality of transfer requests based on the first and second information of each of the transfer requests;
a transfer control circuit that executes the plurality of transfer requests in an order set by the calculation unit;
The calculation unit
calculating the required transfer time for each of the transfer requests based on the first information;
setting an order in which the plurality of transfer requests are to be executed so that the required transfer time of each of the transfer requests falls within the transfer allowable time of the transfer request;
Each time the transfer request is notified, the calculation unit:
calculate a first margin time, which is the difference between the permissible transfer time and the required transfer time of the transfer request;
For another transfer request scheduled to be executed before the transfer request, a second margin time is calculated, which is the difference between the transfer allowable time and the transfer required time of the other transfer request;
If the first margin time is greater than the second margin time, the transfer request is executed after the other transfer requests;
When the first margin time is smaller than the second margin time, the data transfer device sets the order of execution of the transfer request to precede the other transfer requests.
前記複数の転送要求を送信する転送要求元とを備える、データ転送システム。 The data transfer device according to any one of claims 1 to 5 ;
a transfer request source that transmits the plurality of transfer requests.
Applications Claiming Priority (2)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| JP2021075965 | 2021-04-28 | ||
| JP2021075965 | 2021-04-28 |
Publications (2)
| Publication Number | Publication Date |
|---|---|
| JP2022170691A JP2022170691A (en) | 2022-11-10 |
| JP7822227B2 true JP7822227B2 (en) | 2026-03-02 |
Family
ID=83944871
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| JP2022056108A Active JP7822227B2 (en) | 2021-04-28 | 2022-03-30 | Data transfer device and data transfer system including the same |
Country Status (1)
| Country | Link |
|---|---|
| JP (1) | JP7822227B2 (en) |
Citations (1)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| JP2002207691A (en) | 2001-01-11 | 2002-07-26 | Matsushita Electric Ind Co Ltd | Data transfer control device |
-
2022
- 2022-03-30 JP JP2022056108A patent/JP7822227B2/en active Active
Patent Citations (1)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| JP2002207691A (en) | 2001-01-11 | 2002-07-26 | Matsushita Electric Ind Co Ltd | Data transfer control device |
Also Published As
| Publication number | Publication date |
|---|---|
| JP2022170691A (en) | 2022-11-10 |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| US6298397B1 (en) | Data transfer control system determining a start of a direct memory access (DMA) using rates of a common bus allocated currently and newly requested | |
| US7472213B2 (en) | Resource management device | |
| JP4034969B2 (en) | Memory management system for common memory | |
| JP2504512B2 (en) | DMA controller | |
| JP2004531830A (en) | System and method for controlling bus arbitration during a cache memory burst cycle | |
| JP2009277096A (en) | Dma control system, printer, and transfer instruction program | |
| EP1063594B1 (en) | An interrupt controller and a microcomputer incorporating this controller | |
| US4896266A (en) | Bus activity sequence controller | |
| KR100708096B1 (en) | How to adjust the bus system and its execution order | |
| US7467245B2 (en) | PCI arbiter | |
| US5974479A (en) | System for executing, canceling, or suspending a DMA transfer based upon internal priority comparison between a DMA transfer and an interrupt request | |
| JP7822227B2 (en) | Data transfer device and data transfer system including the same | |
| US20040044809A1 (en) | DMA controller and DMA transfer method | |
| US8756356B2 (en) | Pipe arbitration using an arbitration circuit to select a control circuit among a plurality of control circuits and by updating state information with a data transfer of a predetermined size | |
| US20060155893A1 (en) | Methods and apparatus for sharing memory bandwidth | |
| US9910812B2 (en) | Initiating multiple data transactions on a system bus | |
| JP2007058716A (en) | Data transfer bus system | |
| JP2002288120A (en) | Arbiter and bus system | |
| US20040093439A1 (en) | Data processing control apparatus and DMA controller | |
| KR100451722B1 (en) | apparatus for controlling direct memory access | |
| JP7259537B2 (en) | Information processing equipment | |
| JP7226084B2 (en) | Information processing equipment | |
| JP2006215621A (en) | DMA controller | |
| JPH06131294A (en) | Data transfer device | |
| JP2004118298A (en) | Data processing control device |
Legal Events
| Date | Code | Title | Description |
|---|---|---|---|
| A621 | Written request for application examination |
Free format text: JAPANESE INTERMEDIATE CODE: A621 Effective date: 20241119 |
|
| A977 | Report on retrieval |
Free format text: JAPANESE INTERMEDIATE CODE: A971007 Effective date: 20251111 |
|
| A131 | Notification of reasons for refusal |
Free format text: JAPANESE INTERMEDIATE CODE: A131 Effective date: 20251118 |
|
| A521 | Request for written amendment filed |
Free format text: JAPANESE INTERMEDIATE CODE: A523 Effective date: 20251210 |
|
| 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: 20260120 |
|
| A61 | First payment of annual fees (during grant procedure) |
Free format text: JAPANESE INTERMEDIATE CODE: A61 Effective date: 20260217 |
|
| R150 | Certificate of patent or registration of utility model |
Ref document number: 7822227 Country of ref document: JP Free format text: JAPANESE INTERMEDIATE CODE: R150 |