JPH02158839A - Data transferring method - Google Patents

Data transferring method

Info

Publication number
JPH02158839A
JPH02158839A JP31320288A JP31320288A JPH02158839A JP H02158839 A JPH02158839 A JP H02158839A JP 31320288 A JP31320288 A JP 31320288A JP 31320288 A JP31320288 A JP 31320288A JP H02158839 A JPH02158839 A JP H02158839A
Authority
JP
Japan
Prior art keywords
data
memory area
processing
transfer
interrupt
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
JP31320288A
Other languages
Japanese (ja)
Inventor
Shoko Tsuji
辻 勝公
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Fujitsu Ltd
Original Assignee
Fujitsu Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Fujitsu Ltd filed Critical Fujitsu Ltd
Priority to JP31320288A priority Critical patent/JPH02158839A/en
Publication of JPH02158839A publication Critical patent/JPH02158839A/en
Pending legal-status Critical Current

Links

Abstract

PURPOSE:To speed up data transferring processing by forming FIFO (First in First out) structure on a memory area when the data transferring processing is performed by interruption. CONSTITUTION:The capacity information 31 of a first data memory area 12, a transferring address 32, a read-out position information 33 and a write-in position information 34 are provided on a second data memory area 13 to control the first data memory area 12. Then, in the case of the rise of an interruption request during data processing, processing operation is executed prior to interruption processing according to the decision of an interruption control part. Namely, the data transferring processing of the FIFO structure can be executed on the memory area 11 by starting by the interruption. Accordingly, internal data is never saved in a stack by the interruption request, and data transferring processing time can be shortened. Thus, data transferring processing efficiency is improved.

Description

【発明の詳細な説明】 〔概 要〕 データ転送方法、特にプログラムの正常な流れを中断し
て、割り込みによりデータ転送処理をする方法に関し、 該データ転送処理を割り込みにより実行する際に生ずる
内部データの退避動作に係る無駄を省き、メモリ領域上
にF I F O(First in First o
ut)を形成し、データ転送処理の高速化を図ることを
目的とし、 データ処理中に割り込み要求があったとき、割り込み処
理に優先して、データ転送処理をするデータ転送方法に
おいて、メモリ領域に転送データの書き込みをする第1
のデータメモリ領域と、前記第1のデータメモリ領域の
書き込み読み出しの管理をする第2のデータメモリ領域
とを設け、少なくとも、前記データ転送処理が割り込み
によるマイクロ命令により起動し、前記第1のデータメ
モリ領域に転送データの書き込み処理をし、前記第1の
データメモリ領域に最先に書き込み処理をした転送デー
タから順に読み出し処理をすることを含み構成する。
[Detailed Description of the Invention] [Summary] Regarding a data transfer method, particularly a method of interrupting the normal flow of a program and performing a data transfer process using an interrupt, internal data generated when the data transfer process is executed using an interrupt is provided. The first in first o
The purpose of this data transfer method is to speed up data transfer processing by forming a 1st to write the transfer data
a data memory area and a second data memory area for managing writing and reading of the first data memory area, and at least the data transfer process is activated by a microinstruction by an interrupt and the first data The method includes writing transfer data into a memory area, and sequentially reading data from the first data memory area starting from the transfer data written first.

〔産業上の利用分野〕[Industrial application field]

本発明は、データ転送方法に関するものであり、更に詳
しく言えばプログラムの正常な流れを中断して、割り込
みによりデータ転送処理をする方法に関するものである
The present invention relates to a data transfer method, and more specifically to a method of interrupting the normal flow of a program and performing data transfer processing using an interrupt.

近年の1チツプマイクロコントローラには、マイクロプ
ロセッサや主記憶の内部原因による内部割り込みや周辺
の入出力装置による外部割り込みにより、プログラムの
正常な流れを中断して強制的に例外処理プログラムを実
行する機能がある。
Recent single-chip microcontrollers have a function that interrupts the normal flow of the program and forcibly executes an exception handling program due to internal interrupts caused by internal causes in the microprocessor or main memory, or external interrupts from peripheral input/output devices. There is.

ここでデータ転送処理とは、割り込み処理にて外部から
の外部データを外部メモリに格納したり、外部メモリに
格納された外部データを外部に出力することをいう。従
って、CPU内の内部データを一時的にスタックに退避
させる内部的なデータ転送処理とは異なる。
Here, data transfer processing refers to storing external data from the outside into an external memory or outputting external data stored in the external memory to the outside in interrupt processing. Therefore, this differs from internal data transfer processing in which internal data within the CPU is temporarily saved on the stack.

ところで、割り込みにおけるデータ転送処理では、内部
データの退避処理に多くの時間を要する。
By the way, in data transfer processing using an interrupt, it takes a lot of time to save internal data.

これによりデータ処理の高速化をすることができないと
いう問題がある。
This poses a problem in that it is not possible to speed up data processing.

そこで、内部データをスタックにハードウェア的に退避
させずに、データ転送させる方法が望まれている。
Therefore, a method is desired in which data is transferred without saving internal data to the stack using hardware.

〔従来の技術〕[Conventional technology]

第5.6図は従来例に係る説明図である。 FIG. 5.6 is an explanatory diagram of a conventional example.

第5図(a)、(b)は従来例のデータ転送方法に係る
説明図である。
FIGS. 5(a) and 5(b) are explanatory diagrams of a conventional data transfer method.

同図(a)は、従来例に係る通信データ処理システムを
模式する図である。
FIG. 2A is a diagram schematically illustrating a communication data processing system according to a conventional example.

図において、8はCPU (中央演算処理装置)であり
、命令実行部1、命令制御部2、割り込み制御部3、デ
ータ制御部4から成る。データ制御部4は、プログラム
カウンタ4a、スタックポインタ4b、他のレジスタ4
C及びアキュムレータ4d等から成る。また5は内部バ
スを示している。
In the figure, 8 is a CPU (Central Processing Unit), which includes an instruction execution section 1, an instruction control section 2, an interrupt control section 3, and a data control section 4. The data control unit 4 includes a program counter 4a, a stack pointer 4b, and other registers 4.
C, an accumulator 4d, etc. Further, 5 indicates an internal bus.

6は通信チップであり、通信チップAは受信データDI
Nを入力して外部データD21を出力するものである。
6 is a communication chip, and communication chip A is a received data DI.
It inputs N and outputs external data D21.

通信チップBは、外部データD22を入力して、送信デ
ータDOTを出力するものである。
The communication chip B inputs external data D22 and outputs transmission data DOT.

7は、外部メモリであり、外部データ021を格納した
り、格納されている外部データD22を出力するもので
ある。これ等により内部データDIや外部データD21
.D22のデータ処理をする通信用のマイクロプロセッ
サ等が構成されている。
7 is an external memory that stores external data 021 and outputs stored external data D22. Due to these, internal data DI and external data D21
.. A communication microprocessor and the like that process data of D22 are configured.

同図(b)は、従来例の通信用マイクロプロセッサ等の
データ転送方法に係るフローチャートである。
FIG. 2B is a flowchart relating to a conventional data transfer method for a communication microprocessor, etc.

図において、ユーザプログラムの正常な流れは、割り込
みにより中断され、強制的に例外処理プログラムに変更
される。この場合、まずステップP。
In the figure, the normal flow of a user program is interrupted by an interrupt and is forcibly changed to an exception handling program. In this case, first step P.

通信チップ八又はBからの割り込み要求が発生する。こ
のとき、命令実行部1や命令制御部2は、ユーザプログ
ラムの状態保存するためステップP。
An interrupt request is generated from communication chip 8 or B. At this time, the instruction execution unit 1 and the instruction control unit 2 execute step P to save the state of the user program.

で割り込みシーケンス起動される。The interrupt sequence is activated.

次いで、ステップP、で割り込みシーケンスに従って、
プログラムカウンタ4aやアキュムレータ4d等の内部
データD1をスタックポインタ4bの指すアドレスに退
避させる。
Then, according to the interrupt sequence in step P,
The internal data D1 of the program counter 4a, accumulator 4d, etc. is saved to the address pointed to by the stack pointer 4b.

次に、ステップP4で割り込みプログラムの処理に移行
し、ステップP、で、通信チップAの受信データDIN
を外部データDI2にして、外部メモリ7に転送処理を
したり、又、外部メモリ7の外部データD22を通信チ
ップBの送信データDOTとして、データ転送処理をす
る。
Next, in step P4, the process moves to the interrupt program, and in step P, the received data DIN of the communication chip A is
is set as external data DI2 and transferred to the external memory 7, and external data D22 in the external memory 7 is set as transmission data DOT of the communication chip B and processed for data transfer.

次いで、ステップP、で割り込みシーケンスを起動し、
ステップP7でスタックポインタ4bに退避した内部デ
ータDIをプログラムカウンタ4aやアキエムレータ4
dに戻す、これによりユーザプログラムに状態復元をす
る。
Then, in step P, start an interrupt sequence,
The internal data DI saved in the stack pointer 4b in step P7 is transferred to the program counter 4a and the achievable emulator 4.
d, thereby restoring the state to the user program.

第6図(a)、(b)は、従来例のデータ転送方法に係
る問題点を説明する図である。
FIGS. 6(a) and 6(b) are diagrams illustrating problems associated with the conventional data transfer method.

同図(a)は、通信チップAの要求により、割り込み処
理に優先して、外部データD21を外部メモリ7のメモ
リ領域7aにデータ転送処理するカウンタモードを示し
ている。
3A shows a counter mode in which external data D21 is transferred to the memory area 7a of the external memory 7 in response to a request from the communication chip A, giving priority to interrupt processing.

これは、割り込み処理を優先すると、第5図のステップ
P、の処理内容のように、内部データD1をスタックポ
インタに退避する時間を要する。
This is because, if priority is given to interrupt processing, it will take time to save the internal data D1 to the stack pointer, as in the processing content of step P in FIG.

このため、割り込み処理を実行せずに外部データD21
を優先して実行し、データ転送処理の高速化を図るもの
である。
Therefore, the external data D21 is processed without executing interrupt processing.
is executed with priority to speed up data transfer processing.

図において、7bはポインタであり、外部メモ+J 7
のメモリ領域7aに割り付けられたデータ転送領域7C
の位置を示すものである。
In the figure, 7b is a pointer, external memo +J 7
Data transfer area 7C allocated to memory area 7a of
It shows the position of

カウンタモードでは、まず通信チップAの受信データD
INを外部データD21にして、CPU8を介して、次
々に外部メモリ7のデータ転送領域7cに転送をする。
In counter mode, first receive data D of communication chip A.
IN is set as external data D21 and is transferred to the data transfer area 7c of the external memory 7 one after another via the CPU 8.

ここで、ポインタ7bが「始め」→「終了」に移行して
、メモリ領域7aに確保しであるデータ転送領域7Cが
満席になると割り込みシーケンスが起動され、第5図の
ステップP、以降の処理内容に移行する。
Here, when the pointer 7b moves from "start" to "end" and the data transfer area 7C reserved in the memory area 7a becomes full, an interrupt sequence is activated, and the processing from step P in FIG. Moving on to the content.

同図(b)は、同様に通信チップBの要求により割り込
み処理に優先して、外部メモリ7に格納した外部データ
D22を外部へ転送処理するカウンタモードを示してい
る。
FIG. 4B shows a counter mode in which external data D22 stored in the external memory 7 is transferred to the outside in response to a request from the communication chip B, giving priority to interrupt processing.

図において、ポインタ7bが「始め」→「終了」に移動
して、データ転送領域7Cが空席になると、割り込みシ
ーケンスが起動され第5図のステップP、以降の処理内
容に移行する。
In the figure, when the pointer 7b moves from "start" to "end" and the data transfer area 7C becomes empty, an interrupt sequence is activated and the process moves to step P in FIG. 5 and subsequent processing contents.

このようにして、データ転送領域7Cが外部データD2
1で満席になる毎に割り込みシーケンスが起動して、カ
ウンタやアドレス等の転送モードを設定する必要がある
。このときに、CPUB内のプログラムカウンタやアキ
ュムレータの内部データDIがスタックに一時退避する
In this way, the data transfer area 7C is transferred to the external data D2.
1 and every time the seats become full, an interrupt sequence is activated and it is necessary to set the transfer mode of counters, addresses, etc. At this time, the program counter in CPUB and the internal data DI of the accumulator are temporarily saved to the stack.

〔発明が解決しようとする課題〕[Problem to be solved by the invention]

従って、通信チップAから通信チップBに直接外部デー
タD21の転送処理をする必要が生じた場合、従°来例
によれば、通信チップAから外部メモリ7へ外部データ
D21をデータ転送する第1のカウンタモードと、外部
メモリ7から通信チップBへ外部データD22をデータ
転送をする第2のカウンタモードとが実行される。
Therefore, when it becomes necessary to transfer the external data D21 directly from the communication chip A to the communication chip B, according to the conventional example, the first step is to transfer the external data D21 from the communication chip A to the external memory 7. A second counter mode in which the external data D22 is transferred from the external memory 7 to the communication chip B are executed.

また、この第1,2のカウンタモードの間に割り込みシ
ーケンスの処理実行がされる。
Furthermore, an interrupt sequence process is executed between the first and second counter modes.

このため、第6図(a)のように、割り込み処置 理に優先して、外部データD21を通信チップAから外
部メモリ7にデータ転送する部分と、外部メモリ7から
通信チップBにデータ転送する部分については、データ
転送の高速化を図ることかできるが、その間の割り込み
シーケンスの処理に係るCPU8のアキュムレータやプ
ログラムカウンタの内部データDIが一時スタックに退
避する時間を要し、全体的にデータ転送の高速化を図る
ことができないという問題がある。
Therefore, as shown in FIG. 6(a), there is a part that transfers the external data D21 from the communication chip A to the external memory 7, and a part that transfers the data from the external memory 7 to the communication chip B, giving priority to the interrupt handling process. Although it is possible to speed up the data transfer, it takes time for the internal data DI of the accumulator and program counter of the CPU 8 related to interrupt sequence processing to be temporarily saved to the stack, and the data transfer as a whole is slowed down. There is a problem in that it is not possible to increase the speed of the process.

本発明は、かかる従来例の問題点に鑑み創作さたもので
あり、データ転送処理をカウンタモードにより実行する
際に生ずる内部データの退避動作を無くし、メモリ領域
上にF I F O(First 1nFirst o
ut)を形成し、データ転送処理の高速化を図ることを
可能とするデータ転送方法の提供を目的とする。
The present invention was created in view of the problems of the conventional example, and eliminates the internal data saving operation that occurs when data transfer processing is executed in counter mode, and performs FIFO (First 1nFirst) operation on the memory area. o
The purpose of the present invention is to provide a data transfer method that makes it possible to speed up data transfer processing.

〔課題を解決するための手段〕[Means to solve the problem]

第1図は、本発明のデータ転送方法に係る原理図を示し
ている。
FIG. 1 shows a principle diagram of the data transfer method of the present invention.

その方法は、データ処理中に割り込み要求があったとき
、割り込み処理に優先して、データ転送処理をするデー
タ転送方法において、メモリ領域11に転送データの書
き込みをする第1のデータメモリ領域12と、前記第1
のデータメモリ領域12の書き込み読み出しの管理をす
る第2のデータメモリ領域13とを設け、少なくとも、
前記データ転送処理が割り込みによるマイクロ命令によ
り起動し、前記第1のデータメモリ領域12に転送デー
タの書き込み処理をし、前記第1のデータメモリ領域1
2に最先に書き込み処理をした転送データから順に読み
出し処理をすることを特徴とし、 第2のデータメモリ領域には、少な(とも、前記第1の
メモリ領域12の容量、情報31、転送アドレス32読
み出し位置情報33及び書き込み位置情報34を有する
ことを特徴とし、上記目的を達成する。
This method includes a first data memory area 12 that writes transfer data to a memory area 11 in a data transfer method that performs data transfer processing with priority over interrupt processing when an interrupt request is received during data processing. , said first
a second data memory area 13 for managing writing and reading of the data memory area 12;
The data transfer process is activated by a microinstruction caused by an interrupt, writes transfer data to the first data memory area 12, and writes the transfer data to the first data memory area 1.
The second data memory area is characterized in that the read processing is performed in order from the transfer data that was written first, and the second data memory area has a small amount of data (including the capacity of the first memory area 12, information 31, and transfer address). 32 read position information 33 and write position information 34, the above object is achieved.

〔作用〕[Effect]

本発明によれば、第1のデータメモリ領域12を管理す
る第2のデータメモリ領域13に、該第1のデータメモ
リ領域12の容量情報31.転送アドレス32.読み出
し位置情報33及び書き込み位置情報34を設けている
According to the present invention, capacity information 31. of the first data memory area 12 is stored in the second data memory area 13 that manages the first data memory area 12. Forwarding address 32. Read position information 33 and write position information 34 are provided.

このため、データ処理中にCPU等に割り込み要求があ
った場合、割り込み制御部14等の判断により割り込み
処理に優先して、次の処理動作をすることが可能となる
Therefore, if an interrupt request is made to the CPU or the like during data processing, the next processing operation can be performed in priority to the interrupt processing based on the judgment of the interrupt control unit 14 or the like.

すなわち、まず第1のデータメモリ領域12の転送アド
レス32の読み出し処理がされ、次いで転送データの書
き込み処理又は読み出し処理の判断がされる。
That is, first, the transfer address 32 of the first data memory area 12 is read out, and then it is determined whether to write or read the transfer data.

この判断により、例えば書き込み動作の場合には書き込
み位置情報34に基づいて、第1のデータメモリ領域1
2の書き込み位置に転送データが格納される。このとき
順次転送データが第1のデータメモリ領域12に格納さ
れると共に書き込み位置情報34の内容が更改される。
With this determination, for example, in the case of a write operation, the first data memory area 1 is
The transfer data is stored in the write position No. 2. At this time, the transferred data is sequentially stored in the first data memory area 12, and the contents of the write position information 34 are updated.

一方読み出し動作の場合には、読み出し位置情報33に
基づいて、第1のデータメモリ領域12に最先に書き込
み処理をした転送データから読み出し処理がされる。こ
のとき順次転送データが他のデータメモリ領域に読み出
されると共に読み出し位置情報33の内容が更改される
On the other hand, in the case of a read operation, based on the read position information 33, the read process is performed starting from the transfer data that was written into the first data memory area 12 first. At this time, the transferred data is sequentially read out to other data memory areas and the contents of the read position information 33 are updated.

次いで書き込み位置情報34と読み出し位置情報33に
基づいてデータ転送処理の終了が判断され、他の処理が
継続される。
Next, it is determined based on the write position information 34 and the read position information 33 that the data transfer process is complete, and other processes are continued.

これにより、メモリ領域11上においてPIFo (F
irst !n First out)構造のデータ転
送処理をすることが可能となる。
As a result, PIFo (F
irst! It becomes possible to perform data transfer processing with a structure (n First out).

〔実施例〕〔Example〕

次に図を参照しながら本発明の実施例について説明をす
る。
Next, embodiments of the present invention will be described with reference to the drawings.

第2−.4図は、本発明の実施例に係るデータ転送方法
を説明する図であり、第2図は、本発明の実施例に係る
メモリ領域を説明する図を示している。
2nd-. FIG. 4 is a diagram illustrating a data transfer method according to an embodiment of the present invention, and FIG. 2 is a diagram illustrating a memory area according to an embodiment of the present invention.

図において、10は1チツプマイクロコントローラ等の
マイクロプロセッサであり、割り込み制御レジスタ14
.命令実行部16.命令制御部17、データ制御部18
及び内部バス19等から構成されている。
In the figure, 10 is a microprocessor such as a 1-chip microcontroller, and an interrupt control register 14
.. Instruction execution unit 16. Command control unit 17, data control unit 18
and an internal bus 19.

11は主記憶や制御レジスタ等のメモリ領域である。1
2は第1のデータメモリ領域であり、FIFO8II域
を形成するメモリデータ領域である。
11 is a memory area such as main memory and control registers. 1
2 is a first data memory area, which is a memory data area forming a FIFO8II area.

FIFOfiJI域には転送データが格納される。13
は第2のデータメモリ領域であり、FIFO6Jt域1
2の管理をするメモリデータ領域である。
Transfer data is stored in the FIFOfiJI area. 13
is the second data memory area, and FIFO6Jt area 1
This is a memory data area for managing 2.

第2のデータメモリ領域13には、パンノアサイズ31
.バツフアアドレスポインタ32.ロードポインタ33
.ストアポインタ34.各種モード35.バッファデイ
スフリプタ36及びメモリアドレス37が登録されてい
る。ここで、転送データは、メモリアドレス37の示し
であるデータが転送されるものであり、第1のデータメ
モリ領域12からロードされたデータがメモリアドレス
37の示す領域に転送されるものである。15は、他の
データメモリ領域である。
The second data memory area 13 has a Panor size 31
.. Buffer address pointer 32. Load pointer 33
.. Store pointer 34. Various modes 35. A buffer disk flipper 36 and a memory address 37 are registered. Here, the transfer data is the data indicated by the memory address 37 that is transferred, and the data loaded from the first data memory area 12 is transferred to the area indicated by the memory address 37. 15 is another data memory area.

バッツァサイズ31は、FIFO領域12の大きさ(容
N)であり、ロードポインタ33は、FIF、0fil
域12に格納された転送データを読み出す位置を指定す
るものであり、ストアポインタ34は、FIFO領域1
2に転送データを格納する書き込み位置を指定するもの
である。 各種モード35には割り込み処理又はデータ
処理のどちらを優先するか等の転送モードが設定できる
。モードの選択は、割り込み制御レジスタ14によって
、割り込みの起動により動作する。
Batza size 31 is the size (capacity N) of FIFO area 12, and load pointer 33 is FIF, 0fil.
The store pointer 34 specifies the position from which to read the transfer data stored in the FIFO area 12.
2 specifies the write position where the transfer data is to be stored. In the various modes 35, transfer modes can be set, such as whether priority is given to interrupt processing or data processing. Mode selection is performed by activating an interrupt using the interrupt control register 14.

バッファディスクリブタアドレス36は、例えば第2の
データメモリ領域12のバッファディスクリブタのアド
レスが登録されるものである。なお、第2のデータメモ
リ領域12を2つに分けた理由は、カウンタモードやF
IFOモード等の転送モードにより2又は4バイトに変
化し、無駄なデータ領域をなくすためである。
The buffer disk libter address 36 is, for example, the address of the buffer disk libter of the second data memory area 12 registered. The reason why the second data memory area 12 is divided into two is because the counter mode and F
This is to eliminate unnecessary data areas, which change to 2 or 4 bytes depending on the transfer mode such as IFO mode.

メモリアドレス37は、他のデータメモリ領域15の書
き込み又は読み出し番地である。
The memory address 37 is a write or read address for another data memory area 15.

第3図は、本発明の実施例のデータ転送方法に係るフロ
ーチャートである。
FIG. 3 is a flowchart relating to a data transfer method according to an embodiment of the present invention.

図において、まずステップP1では通常のCPU動作が
されている。これは、ユーザプログラム等の正常な流れ
、すなわち割り込み要求前の状態に係るデータ処理動作
である。
In the figure, first, in step P1, normal CPU operation is performed. This is a data processing operation related to the normal flow of a user program, ie, the state before an interrupt request.

次に、ステップP2で割り込み要求の発生の存無を判断
する。ここで、割り込み要求無しの場合(NO)は、ス
テップP1に戻りステップP1の処理内容を繰り返す。
Next, in step P2, it is determined whether or not an interrupt request has occurred. Here, if there is no interrupt request (NO), the process returns to step P1 and repeats the processing contents of step P1.

割り込み要求有りの場合(YES)には、ステップP、
に移行する。
If there is an interrupt request (YES), step P;
to move to.

ステップP、で転送をするかしないかを判断する。転送
しない場合はステップP1□へ移行し通常の割り込みシ
ーケンスを実行する。転送する場合はP、に移行する。
In step P, it is determined whether or not to transfer. If not transferred, the process moves to step P1□ and a normal interrupt sequence is executed. To transfer, move to P.

ステップP4では、転送処理の起動をする。このとき、
データ制御部18に格納されたマイクロプログラム等の
マイクロ命令により命令実行部16、命令制御部17を
介して転送処理の起動がされる。
In step P4, transfer processing is started. At this time,
A transfer process is activated by a microinstruction such as a microprogram stored in the data control unit 18 via the instruction execution unit 16 and the instruction control unit 17.

次いで、ステップP、では、FIFOモードか。Next, in step P, is it FIFO mode?

カウンタモードかの判断をする。ここで、F[FO(リ
ングモード)の場合(YES又はA)には、FEFOモ
ードに係るデータ転送処理をする。なお、FIFOモー
ドに係るデータ転送処理については第4図において、詳
述する。カウンタモードの場合(NO)にはステップP
、に移行する。
Determine whether it is in counter mode. Here, in the case of F[FO (ring mode) (YES or A), data transfer processing related to FEFO mode is performed. Note that the data transfer process related to the FIFO mode will be explained in detail in FIG. 4. In case of counter mode (NO), step P
, move to.

ステップP&では、従来例のようなカウンタモードによ
るデータ転送処理を行う。
In step P&, data transfer processing is performed in a counter mode as in the conventional example.

さらにステップP、では、各種ポインタ等の制御がなさ
れ、ステップP8に移行し、カウンタモードのデータ転
送処理について、正常か否かの判断をする。このとき、
正常終了の場合(YES)には、ステップP、に移行し
、割り込みクリアをし、ステップ15でCPU動作に復
帰をする。正常終了でない場合(No)には、ステップ
pHに移行し、異常終了時の処理をする。
Furthermore, in step P, various pointers and the like are controlled, and the process moves to step P8, where it is determined whether or not the data transfer process in the counter mode is normal. At this time,
In the case of normal termination (YES), the process moves to step P, where the interrupt is cleared, and in step 15, the CPU operation is returned to. If the termination is not normal (No), the process moves to step pH and processes for abnormal termination are performed.

次に、ステップP1□に移行し、割り込みシーケンスを
実行し、続いてステップpu3では、ユーザの割り込み
プログラムの処理をし、ステップP14で、割り込み復
帰処理をする。
Next, the process moves to step P1□ to execute an interrupt sequence, followed by step pu3 to process the user's interrupt program, and step P14 to perform interrupt recovery processing.

次いで、ステップPISに移行し、CPU動作に復帰し
、割り込み要求前の正常なプログラム処理に戻る。
Next, the process moves to step PIS, and the CPU operation returns to normal program processing before the interrupt request.

第4図は、本発明の実施例のFIFOモードに係るデー
タ転送処理に係るフローチャートである。
FIG. 4 is a flowchart relating to data transfer processing in the FIFO mode according to the embodiment of the present invention.

これは、第3図のフローチャートにおけるステップP5
においてFIFOモードをする場合(YES、又は、A
)のステップP1゜の処理内容である− 図において、まずステップP、。1でバッファディスク
リブタの読み出し処理をする。ここで、第2のデータメ
モリ領域12のバッファディスクリブタアドレス36が
参照され、バッファアドレスポインタ32がf!認され
る。
This is step P5 in the flowchart of FIG.
When using FIFO mode (YES or A
) is the processing content of step P1°. In the figure, first, step P. 1 performs read processing of the buffer disk libter. Here, the buffer disk libter address 36 of the second data memory area 12 is referenced, and the buffer address pointer 32 is set to f! recognized.

次に、ステップptoiで転送ビットの判断をする。こ
こで例えば、転送ビットDIR−1のときをロード処理
七尾めた場合(YES)、ステップP4..に移行する
。ロード処理はPIFO6+l域12の読み出し位置(
ロードポイント)から転送データの読み出しをする処理
である。転送ビットDIR−0の場合(NO)には、ス
トア処理をするためにステップP、。、に移行する。ス
トア処理はFIFOpi域12の書き込み位置(ストア
ポイント)に転送データの書き込みをする処理である。
Next, in step ptoi, the transfer bit is determined. Here, for example, if the load processing is performed when the transfer bit DIR-1 is set (YES), step P4. .. to move to. The load process is performed at the read position of PIFO6+l area 12 (
This is the process of reading transfer data from a load point). If the transfer bit is DIR-0 (NO), step P, to perform a store process. , move to. The store process is a process of writing transfer data to a write position (store point) in the FIFOpi area 12.

ここで、先にステップpies以下を参照しながらスト
ア処理について説明をする。
Here, the store process will be explained first with reference to steps below.

従って、ステップP1゜、では、メモリレジスタの内容
をアドレスポインタ(BAP)32+ストアポインタ3
4の示すメモリ領域へ転送をする。
Therefore, in step P1゜, the contents of the memory register are converted to address pointer (BAP) 32 + store pointer 3.
Transfer to the memory area indicated by 4.

ここで、他のデータメモリ領域15からの転送データは
FIFOjl域12に書き込み処理される。
Here, the transfer data from the other data memory area 15 is written into the FIFOjl area 12.

次に、ステップP 1114でストアポインタ34を1
つ加算(インクリメント)する。
Next, in step P1114, the store pointer 34 is set to 1.
Add (increment) by one.

次いでステップP、。、でストアポインタ34とバッフ
ァサイズ31とが同値であるか否かを判断する。ストア
ポインタ34とバッファサイズ31とが等しくなった場
合(YES)には、ステップP1゜、に移行し、ストア
ポインタ34に“00″の書き込みをし、ステップP、
。フに移行する。それらが等しくない場合(NO)には
ステップPlOフに移行し、ストアポインタ34とロー
ドポインタ33とが同値であるか否かの判断をする9等
しい場合(YES)には、ステップptesで割り込み
を要求したリソースのステータスレジスタS■。
Next, step P. , it is determined whether the store pointer 34 and the buffer size 31 are the same value. If the store pointer 34 and the buffer size 31 become equal (YES), the process moves to step P1°, where "00" is written to the store pointer 34, and step P,
. transition to f. If they are not equal (NO), the process moves to step PLO, and it is determined whether the store pointer 34 and load pointer 33 have the same value.9 If they are equal (YES), an interrupt is executed in step ptes. Status register S■ of the requested resource.

SOに“10″をセットし、書き込み容量が“Full
” (満席)であることを知らせる。このときは、異常
終了である。この場合は、第3図のフローチャートにお
けるステップP++CB点)に移行し、異常終了時の処
理をし、次いでステップp+xの割り込みシーケンスの
実行、ステップP+zのユーザの割り込みプログラム処
理及びステップP 14の割り込みシーケンスの復帰処
理をする。その後ステップP+sで、CPU動作に復帰
する。
Set SO to “10” and write capacity is “Full”.
” (full). In this case, it is an abnormal termination. In this case, the process moves to step P++ (point CB) in the flowchart of FIG. Execution of the sequence, processing of the user's interrupt program in step P+z, and return processing of the interrupt sequence in step P14 are performed.Then, in step P+s, the CPU operation is returned to.

ストアポインタ34とロードポインタ33とが等しくな
い場合(No)には、正常終了であり第3図のフローチ
ャートにおけるステップP、へ移行する0以上がFIF
Oモードに係るストア処理時のデータ転送処理である。
If the store pointer 34 and the load pointer 33 are not equal (No), it is a normal termination and the process moves to step P in the flowchart of FIG.
This is data transfer processing during store processing related to O mode.

次にFIFOモードに係るロード処理時のデータ転送処
理について説明をする。
Next, the data transfer process during the load process related to the FIFO mode will be explained.

すなわち、ステップplozで転送ビットDIR=1の
場合(YES)ステップP1゜、に移行し、ロードポイ
ンタ33とストアポインタ34とが同値であるか否かの
判断をする。ここでロードポインタ33とストアポイン
タ34とが等しい場合(YES)には、ステップPI1
4に移行し、割り込みを要求したリソースのステータス
レジスタに′01″をセットし、FIFO6J域12の
書き込み容量がElf) ty” (空席)であること
を知らせるこの場合は、第3図のフローチャートにおけ
るステップpH(B点)k移行し、異常終了時の処理を
し、次いでステップP1□の割り込みシーケンスの実行
、ステップptsのユーザの割り込みプログラム処理及
びステップPI4の割り込みシーケンスの復帰処理をす
る。その後ステップpusでCPU動作に復帰する。
That is, if the transfer bit DIR=1 in step ploz (YES), the process moves to step P1°, and it is determined whether the load pointer 33 and store pointer 34 have the same value. If the load pointer 33 and store pointer 34 are equal (YES), step PI1
4, sets '01'' in the status register of the resource that requested the interrupt, and informs that the write capacity of FIFO 6J area 12 is "Elf) ty" (vacant). The process moves to step pH (point B) k, performs processing at the time of abnormal termination, then executes the interrupt sequence in step P1□, processes the user's interrupt program in step pts, and performs return processing for the interrupt sequence in step PI4. After that, step PU returns to CPU operation.

ステップP109でロードポインタ33とストアポイン
タ34とが等しくない場合(No)には、ステップpH
。に移行し、アドレスポインタ(BAP)32+ロード
ポインタ33の内容をメモリレジスタ等に転送をする。
If the load pointer 33 and store pointer 34 are not equal in step P109 (No), the step pH
. The contents of the address pointer (BAP) 32+load pointer 33 are transferred to a memory register or the like.

このとき、FIFO8JI域12に格納されていた転送
データが他のデータメモリ領域15に読み出し処理され
る。
At this time, the transfer data stored in the FIFO8JI area 12 is read out to another data memory area 15 and processed.

次に、ステップP Il+でロードポインタ33を1つ
加算(インクリメント)する。
Next, in step P Il+, the load pointer 33 is added (incremented) by one.

次いで、ステップP1□でロードポインタ33とバッフ
ァサイズ31とが同値であるか否かの判断をする。ここ
でロードポインタ33とバッファサイズ31とが等しい
場合(YES)には、ステップP1.2でロードポイン
タ33に“00″を書き込む、それらが等しくない場合
にも第3図のフローチャートのステップPIに移行し割
り込みのクリアをし、ステップpusに移行してCPU
動作に復帰する。
Next, in step P1□, it is determined whether the load pointer 33 and the buffer size 31 are the same value. If the load pointer 33 and the buffer size 31 are equal (YES), "00" is written to the load pointer 33 in step P1.2. If they are not equal, step PI of the flowchart in FIG. Shift to clear interrupts, shift to step pus, and clear CPU
Return to operation.

これにより、メモリ領域11上でFIFO(First
 in First out)が形成される。
As a result, FIFO (First
in First out) is formed.

このようにして、FIFOfiI域12を管理する第2
のデータメモリ領域13に該PIFOf+Jj域12の
バッファサイズ31.バッファアドレスポインタ32.
ロードポインタ33及びストアポインタ34を設けてい
る。
In this way, the second
The buffer size of the PIFOf+Jj area 12 is stored in the data memory area 13 of 31. Buffer address pointer 32.
A load pointer 33 and a store pointer 34 are provided.

このため、データ処理中にCPU等に割り込み要求があ
った場合、割り込みレジスタ14等の判断により割り込
み処理に優先して、次掲のデータ処理動作をすることが
可能となる。
Therefore, if an interrupt request is made to the CPU or the like during data processing, the following data processing operation can be performed with priority over the interrupt processing based on the judgment of the interrupt register 14 or the like.

すなわち、まずFIFO領域12のバッファアドレスポ
インタ32の読み出し処理がされ、次いで転送データの
書き込み処理又は読み出し処理の判断がされる。
That is, first, the buffer address pointer 32 of the FIFO area 12 is read out, and then it is determined whether to write or read the transfer data.

この判断により、例えば書き込み動作の場合には、スト
アポインタ34に基づいてF(FOel域12のストア
ポイントに転送データが格納される。
Based on this determination, for example, in the case of a write operation, the transfer data is stored in the store point of the F(FOel area 12) based on the store pointer 34.

このとき、順次転送データがFIFOの領域12に格納
されると共にストアポインタ34の内容が更改される。
At this time, the transferred data is sequentially stored in the FIFO area 12 and the contents of the store pointer 34 are updated.

一方読み出し動作の場合にはロードポインタ33に基づ
いて、FIFO領域12に最先に書き込み処理をした転
送データから読み出し処理がされる。このとき順次転送
データが他のデータメモリ領域15に読み出されると共
にロードポインタ33内容が更改される。
On the other hand, in the case of a read operation, based on the load pointer 33, the read process is performed starting from the transfer data written to the FIFO area 12 first. At this time, the transferred data is sequentially read out to another data memory area 15 and the contents of the load pointer 33 are updated.

次いでストアポインタ34とロードポインタ33に基づ
いてデータ転送処理の終了判断がされ他の処理が継続さ
れる。
Next, it is determined based on the store pointer 34 and load pointer 33 that the data transfer process is complete, and other processes are continued.

これにより、メモリ領域ll上においてFIFO(Fi
rst in First out)構造のデータ転送
処理をすることが可能となる。
As a result, FIFO (Fi
rst in first out) structure can be performed.

なお、本発明の実施例ではFIFO領域12を管理する
第2のデータメモリ領域13をバッファディスクリブタ
とサービスディスクリブタとに2分したが、1つであっ
ても良い。またロードポインタ33・ストアポインタ3
4等に専用カウンタを設けても良い。これにより、マイ
クロ命令の負担が少なくなりさらにデータ転送処理の高
速化を図ることが可能となる。
In the embodiment of the present invention, the second data memory area 13 for managing the FIFO area 12 is divided into two parts, a buffer disk libter and a service disk libter, but it may be divided into one. Also, load pointer 33 and store pointer 3
A dedicated counter may be provided for the 4th grade. This reduces the burden of microinstructions and further speeds up data transfer processing.

〔発明の効果〕〔Effect of the invention〕

以上説明したように本発明によれば割り込みによる起動
により、メモリ6N域上でFIFO構造のデータ転送処
理をすることができる。
As explained above, according to the present invention, data transfer processing in a FIFO structure can be performed on the memory 6N area by activation by an interrupt.

このため、従来のように、割り込み要求により、外部か
らの外部データを直接外部データとして外部へデータ転
送処理する場合、アキュームレータやプログラムカウン
タ等の内部データをスタンクに退避させることが無くな
る。従って、データ転送処理時間を大幅に短縮すことが
可能となる。
Therefore, when external data from the outside is directly transferred to the outside as external data by an interrupt request as in the past, internal data such as an accumulator or a program counter is not saved in the storage tank. Therefore, it becomes possible to significantly shorten the data transfer processing time.

これにより、データ転送処理効率が向上し、1チツプマ
イクロコントローラ等のデータ処理動作について、高速
化を図ることが可能となる。
This improves the data transfer processing efficiency and makes it possible to speed up the data processing operation of a one-chip microcontroller or the like.

【図面の簡単な説明】[Brief explanation of the drawing]

第1図は、本発明のデータ転送方法に係る原理図、 第2図は、本発明の実施例のメモリ領域を説明する図、 第3図は、本発明の実施例のデータ転送方法に係るフロ
ーチャート、 第4図は、本発明の実施例のF[FOモードに係る転送
処理にかかるフローチャート、第5図(a)、(b)は
、従来例のデータ転送方法に係る説明図、 第6図(a)、(b)は、従来例のデータ転送方法に係
る問題点を説明する図である。 (符号の説明) lO・・・マイクロプロセッサ、 7a、11・・・メモリ領域、 12・・・第1のデータメモリ領域(FIFO9Jl域
)、13・・・第2のデータメモリ領域、 31・・・容量情報、 32・・・転送アドレス、 33・・・読み出し位置情報、 34・・・書き込み位置情報、 3.14・・・割り込みレジスタ(割り込み制御部)、
15・・・他のデータメモリ領域、 1.16・・・命令実行部、 2.17・・・命令制御部、 4、工8・・・データ制御部、 5.19・・・内部バス、 4a・・・プログラムカウンタ、 4b・・・スタックポインタ、 4c・・・他のレジスタ、 4d・・・アキュームレータ、 6・・・通信チップA又はB、 7・・・外部メモリ、 7b・・・ポインタ、 7c・・・データ転送領域、 8・・・CPU (中央演算処理装置)、DIN・・・
受信データ、 DOT・・・送信データ、 D2゜ D21゜ D22・・・外部データ、 DI・・・内部データ。
FIG. 1 is a principle diagram related to the data transfer method of the present invention, FIG. 2 is a diagram explaining the memory area of the embodiment of the present invention, and FIG. 3 is a diagram related to the data transfer method of the embodiment of the present invention. Flowchart, FIG. 4 is a flowchart related to the transfer process related to the F[FO mode of the embodiment of the present invention, FIGS. 5(a) and (b) are explanatory diagrams related to the conventional data transfer method, Figures (a) and (b) are diagrams illustrating problems associated with the conventional data transfer method. (Explanation of symbols) IO...Microprocessor, 7a, 11...Memory area, 12...First data memory area (FIFO9Jl area), 13...Second data memory area, 31...・Capacity information, 32... Transfer address, 33... Read position information, 34... Write position information, 3.14... Interrupt register (interrupt control unit),
15...Other data memory areas, 1.16...Instruction execution unit, 2.17...Instruction control unit, 4, Engineering 8...Data control unit, 5.19...Internal bus, 4a...Program counter, 4b...Stack pointer, 4c...Other registers, 4d...Accumulator, 6...Communication chip A or B, 7...External memory, 7b...Pointer , 7c...Data transfer area, 8...CPU (central processing unit), DIN...
Reception data, DOT...Transmission data, D2゜D21゜D22...External data, DI...Internal data.

Claims (2)

【特許請求の範囲】[Claims] (1)データ処理中に割り込み要求があったとき、割り
込み処理に優先して、データ転送処理をするデータ転送
方法において、 メモリ領域(11)に転送データの書き込みをする第1
のデータメモリ領域(12)と、 前記第1のデータメモリ領域(12)の書き込み読み出
しの管理をする第2のデータメモリ領域(13)とを設
け、 少なくとも、前記データ転送処理が割り込みによるマイ
クロ命令により起動し、 前記第1のデータメモリ領域(12)に転送データの書
き込み処理をし、 前記第1のデータメモリ領域(12)に最先に書き込み
処理をした転送データから順に読み出し処理をすること
を特徴とするデータ転送方法。
(1) When an interrupt request is received during data processing, the data transfer process takes precedence over the interrupt process.
a data memory area (12), and a second data memory area (13) that manages writing and reading of the first data memory area (12), and at least the data transfer process is performed using an interrupt-based microinstruction. , the first data memory area (12) is activated by writing transfer data, and the first data memory area (12) is sequentially read from transfer data written first. A data transfer method characterized by:
(2)請求項1記載の第2のデータメモリ領域(13)
は、少なくとも、前記第1のメモリ領域(12)の容量
情報(31)、転送アドレス(32)読み出し位置情報
(33)及び書き込み位置情報(34)を有することを
特徴とするデータ転送方法。
(2) Second data memory area (13) according to claim 1
A data transfer method comprising at least capacity information (31), transfer address (32), read position information (33), and write position information (34) of the first memory area (12).
JP31320288A 1988-12-12 1988-12-12 Data transferring method Pending JPH02158839A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP31320288A JPH02158839A (en) 1988-12-12 1988-12-12 Data transferring method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP31320288A JPH02158839A (en) 1988-12-12 1988-12-12 Data transferring method

Publications (1)

Publication Number Publication Date
JPH02158839A true JPH02158839A (en) 1990-06-19

Family

ID=18038334

Family Applications (1)

Application Number Title Priority Date Filing Date
JP31320288A Pending JPH02158839A (en) 1988-12-12 1988-12-12 Data transferring method

Country Status (1)

Country Link
JP (1) JPH02158839A (en)

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPS595359A (en) * 1982-07-01 1984-01-12 Fujitsu Ltd Queuing method of input/output instruction
JPS5947637A (en) * 1982-09-10 1984-03-17 Fujitsu Ltd Data transfer control system
JPS61251252A (en) * 1985-04-30 1986-11-08 Hitachi Ltd Processing method for data transfer

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPS595359A (en) * 1982-07-01 1984-01-12 Fujitsu Ltd Queuing method of input/output instruction
JPS5947637A (en) * 1982-09-10 1984-03-17 Fujitsu Ltd Data transfer control system
JPS61251252A (en) * 1985-04-30 1986-11-08 Hitachi Ltd Processing method for data transfer

Similar Documents

Publication Publication Date Title
EP0087978A2 (en) Information processing unit
US20070074214A1 (en) Event processing method in a computer system
CN108958903B (en) Embedded multi-core central processor task scheduling method and device
US5499363A (en) Microprocessor coupled to coprocessor by coprocessor bus separate from system bus to external memory for increased efficiency
JPH1173365A (en) Method for optimizing data moving operation
JPH02158839A (en) Data transferring method
JP4451010B2 (en) Programmable controller
JP2669911B2 (en) DMA controller and information processing system
CN108958904B (en) Driver framework of lightweight operating system of embedded multi-core central processing unit
CN108958905B (en) Lightweight operating system of embedded multi-core central processing unit
JPH0895810A (en) Batch job execution system
JPH0754467B2 (en) Data processing device
JP2668987B2 (en) Data processing device
JP3388534B2 (en) Graphic drawing data control method
JPS6352240A (en) Data processor
JPH03201032A (en) Arithmetic processing unit
JPH0449146B2 (en)
JP2562474B2 (en) Multi-CPU system adapter and control method thereof
JPS59144955A (en) Information processor
JPH0683639A (en) Register device
JPS6249550A (en) Data transfer device
JP3900660B2 (en) Sequence controller
JPH0424733B2 (en)
JPS63826B2 (en)
JPH05250161A (en) Microcomputer device