JPH03188530A - Program prefetching device - Google Patents
Program prefetching deviceInfo
- Publication number
- JPH03188530A JPH03188530A JP32789089A JP32789089A JPH03188530A JP H03188530 A JPH03188530 A JP H03188530A JP 32789089 A JP32789089 A JP 32789089A JP 32789089 A JP32789089 A JP 32789089A JP H03188530 A JPH03188530 A JP H03188530A
- Authority
- JP
- Japan
- Prior art keywords
- instruction
- program
- data
- task
- executed
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Granted
Links
- 238000010586 diagram Methods 0.000 description 2
- 230000008676 import Effects 0.000 description 1
Landscapes
- Advance Control (AREA)
- Executing Machine-Instructions (AREA)
Abstract
Description
【発明の詳細な説明】
産業上の利用分野
本発明は、マイクロプロセッサ−等を用いて制御するシ
ステムにおいて、2つ以上のタスク(仕事)を1つのマ
イクロプロセッサ−等で時分割実行を行う場合、実行効
率、速度を高めるための命令プログラム先取り装置に関
するものである。DETAILED DESCRIPTION OF THE INVENTION Field of Industrial Application The present invention relates to a system controlled using a microprocessor, etc., in which two or more tasks (works) are executed in a time-sharing manner by one microprocessor, etc. This invention relates to an instruction program prefetching device for increasing execution efficiency and speed.
従来の技術
マイクロプロセッサ−等を利用してタスクを実行する場
合、1つのマイクロプロセッサ−等に対して、プログラ
ムカウンタ、スタックポインタ。BACKGROUND ART When a task is executed using a microprocessor, a program counter, a stack pointer, etc. are required for one microprocessor.
汎用レジスタ等からなる1組のレジスタファイルを準備
し、そのプログラムカウンタの示すアドレスノ命令プロ
グラムを、プログラム格納領域から読み出し、命令を実
行していた。この場合、現在実行している命令が全て終
了した時点で、次の命令のプログラムデータを読み出す
ため、時間的にロスが多かりた。そこで命令実行中に次
の命令プログラムデータを読み出す制御、つまり命令プ
ログラムの先取りを行うことによりマイクロプロセッサ
−等の実行効率をあげているものが多い。A set of register files consisting of general-purpose registers and the like is prepared, and the instruction program at the address indicated by the program counter is read from the program storage area and the instruction is executed. In this case, the program data for the next instruction is read after all currently executed instructions have been completed, resulting in a large amount of time loss. Therefore, many microprocessors improve their execution efficiency by controlling the reading of the next instruction program data during instruction execution, that is, by prefetching the instruction program.
この場合、プログラム実行状態を局所的にみれば、1つ
のタスクしか実行していないため、通常命令プログラム
は順番に並んでいるため、容易に次の命令プログラムデ
ータを先取りすることができる。しかし、最近の制御シ
ステムでは、プログラム実行状態を局所的にみても複数
タスクを同時実行させることにより制御しなければなら
ないものもでてきている。そこで、2つのタスクまでは
完全に時分割並行実行可能なマイクロプロセッサ−も出
現している。このマイクロプロセッサ−は、2つのレジ
スタファイルを持ち、プログラムからの命令に従ってマ
ルチプレクサを切り換えることにより、レジスタファイ
ルを切り換え、2つのタスクの時分割並行実行を実現し
ている。このようにすれば1つのタスクに対して1つの
レジスタファイルが準備されているから、タスク切り換
えは高速に行える。この場合プログラムの実行状態とし
ては、1命令毎にタスクを切り換えて2つのタスクをみ
かけ上向時並行処理に近い形で実行している場合が多い
。プログラムの実行効率をあげるために命令先取りを行
う場合、各タスクに対して命令先取り装置を持たす必要
があり、この場合だと2系統の命令先取り装置を用いる
ことにより、他のタスク状態を認識せずに命令先取りが
でき、高速実行が可能となる。しかし並行して実行する
タスクが多くなると、命令先取り装置もそのタスク数分
実装する必要があり、回路規模が増大するという問題が
生じる。またこの場合命令先取り装置を1系統しか持た
ない場合には、現タスクの現命令実行時には、現タスク
の次命令が命令先取り装置に入っているが、実際に次に
実行する命令は次タスクの命令であるため、命令先取り
装置に入っているデータをすてて、新たに命令を読みに
行く必要があり、時間的にロスが出る。In this case, when looking at the program execution state locally, only one task is being executed, and the instruction programs are normally lined up in order, so the next instruction program data can be easily read in advance. However, in recent control systems, some programs have to be controlled by simultaneously executing multiple tasks, even if the program execution state is viewed locally. Therefore, microprocessors that can execute up to two tasks completely in parallel in time division have also appeared. This microprocessor has two register files, and by switching a multiplexer in accordance with instructions from a program, switches the register files and realizes time-sharing parallel execution of two tasks. In this way, one register file is prepared for one task, so task switching can be performed at high speed. In this case, the execution state of the program is often such that the task is switched for each instruction and two tasks are executed in a manner similar to upward parallel processing. When performing instruction prefetching to improve program execution efficiency, it is necessary to have an instruction prefetching device for each task. In this case, by using two systems of instruction prefetching devices, it is possible to recognize the status of other tasks. This enables high-speed execution by pre-fetching instructions. However, when the number of tasks to be executed in parallel increases, it is necessary to implement instruction prefetching devices corresponding to the number of tasks, resulting in a problem that the circuit size increases. In this case, if there is only one system of instruction prefetching device, the next instruction of the current task will be in the instruction prefetching device when the current task executes the current instruction, but the next instruction to be actually executed will be of the next task. Since it is a command, it is necessary to throw away the data stored in the command prefetching device and read a new command, which results in a time loss.
このような問題点を解決するために、1つのマイクロプ
ロセッサ−等に対して複数のレジスタファイルを準備し
、マイクロプロセッサ−(プログラム)からの命令に従
ってマルチプレクサを切り換え、複数のレジスタファイ
ルを順次切り換えながら複数のタスクを時分割で並行実
行させるシステムでは、命令実行効率を上げるために、
命令先取り装置を2系統以上設け、次に実行するタスク
を認識する機能を設け、順次命令先取り装置とタスクの
関係を切り換えて効率良く命令を先取りする機能を持た
せる必要がある。In order to solve such problems, multiple register files are prepared for one microprocessor, etc., and the multiplexer is switched according to instructions from the microprocessor (program), and the multiple register files are sequentially switched. In systems that execute multiple tasks in parallel in a time-sharing manner, to increase instruction execution efficiency,
It is necessary to provide two or more systems of instruction prefetching devices, provide a function to recognize the task to be executed next, and provide a function to efficiently prefetch instructions by sequentially switching the relationship between the instruction prefetching device and the task.
発明が解決しようとする課題
このように、従来複数のタスクを1つのマイクロプロセ
ッサ−で実行させる場合には、仮に命令先取り装置が1
系統あったとしても、タスクが切り換わるたびに命令先
取りデータが無効となり、再度命令先取りをする必要が
あった。また、命令実行効率を上げるために、全タスク
に対し各々1系統の命令先取り装置を設けると論理回路
規模が美大になり実現が苦しい。Problems to be Solved by the Invention As described above, conventionally, when multiple tasks are executed by one microprocessor, if the instruction prefetching device is
Even if there was a system, the instruction prefetch data would become invalid every time the task was switched, and it would be necessary to prefetch the instructions again. Further, in order to improve instruction execution efficiency, if one system of instruction prefetching device is provided for each task, the logic circuit scale becomes large and difficult to realize.
本発明は、命令先取り装置を2系統設け、複数のタスク
が切り換わる毎に、命令先取り装置を切り換えることに
より、次タスクが実行する命令を先に取り込むことを可
能とし、従来の問題を解決するものである。The present invention solves the conventional problems by providing two systems of instruction prefetching devices and switching the instruction prefetching devices each time a plurality of tasks are switched, thereby making it possible to first capture the instruction to be executed by the next task. It is something.
課題を解決するための手段
本発明は上述の問題点を解決するために、複数タスクの
時分割並行実行を制御する機能に、次命令の実行タスク
を事前に認識する機能を付加し、その情報を元にし、2
系統の命令プログラム先取り装置を順次切り換え、効率
のよい命令先取り動作を行うようにしたものである。Means for Solving the Problems In order to solve the above-mentioned problems, the present invention adds a function to the function of controlling time-division parallel execution of multiple tasks to recognize the execution task of the next instruction in advance, and uses the information Based on 2
The instruction program prefetching devices in the system are sequentially switched to perform efficient instruction prefetching operations.
作用
このようにすれば、複数タスクを複数レジスタファイル
を用いて、時分割並行実行制御を行う場合、命令プログ
ラムデータの読み出し待ちを極力抑えることができ、高
速、高効率実行が可能となり、また、並行実行するタス
クが複数になっても、タスクの実行状態を認識すること
により、命令プログラム先取り装置は2系統のみ実装す
ることで実現でき、回路規模の増大なしに効率良い制御
が可能となる。By doing this, when performing time-division parallel execution control of multiple tasks using multiple register files, it is possible to minimize the waiting time for reading instruction program data, and high-speed and highly efficient execution is possible. Even if there are multiple tasks to be executed in parallel, by recognizing the execution status of the tasks, the instruction program prefetching device can be implemented by implementing only two systems, allowing efficient control without increasing the circuit scale.
実施例
本発明の一実施例を第1図に示すブロック図を用いて詳
しく述べる。例ではN個のレジスタファイル1a〜1n
を持ち、N個の時分割並行実行を行うシステムを示す。Embodiment An embodiment of the present invention will be described in detail using the block diagram shown in FIG. In the example, N register files 1a to 1n
, and performs N time-division parallel executions.
レジスタファイルA−N(la〜in)はマルチプレク
サA4aにより1a〜1nのうち1つが選択され、パス
9に接続される。マルチプレクサA4aは時分割並行実
行の制御の一部を行うタスク切り換え41112により
実行タスクが使用すべきレジスタファイルを信号線10
を通して制御する。バス9にはマイクロプロセッサ−の
処理に必要な機能回路例えば制御、演算処理機能等8が
接続され、従来のマイクロプロセッサ−制御が行われる
。命令プログラム先取り装置は、命令プログラム先取り
制御3.マルチプレクサB4b、プリフェッチキ、a−
A、B11,5b%データ分配回路15により構成され
る。命令プログラム先取り制御3は、タスク切り換え制
御2から出力されるタスクの実行状態を逐次認識し、現
在実行タスクと、次に実行すべきタスクを判断し、制御
信号11.12.13を作成する。制御の概略を述べる
。命令プログラム先取り制御3で作成された信号13に
より、プログラム格納領域6から命令プログラムデータ
が読み出され、データ分配回路15により、読み出され
た命令プログラムデータを、ブリフェッチキューA5a
か、ブリフェッチキューB5bのどちらに格納するか決
定する。マルチプレクサB4bは信号12により、ブリ
フェッチキューA5aとB5bのどちらのデータを命令
デコーダ等7に送り出すかを決定する。One of register files A-N (la to in) is selected from among register files 1a to 1n by multiplexer A4a and connected to path 9. The multiplexer A4a selects the register file to be used by the execution task via the signal line 10 by the task switching 41112 that performs part of the control of time-division parallel execution.
control through. Connected to the bus 9 are functional circuits 8 necessary for microprocessor processing, such as control and arithmetic processing functions, and conventional microprocessor control is performed. The instruction program prefetching device performs instruction program prefetching control3. Multiplexer B4b, prefetch key, a-
It is constituted by A, B11, 5b% data distribution circuit 15. The instruction program prefetch control 3 sequentially recognizes the execution status of the tasks output from the task switching control 2, determines the currently executed task and the task to be executed next, and creates control signals 11, 12, and 13. An outline of the control will be described. The instruction program data is read from the program storage area 6 by the signal 13 created by the instruction program prefetch control 3, and the data distribution circuit 15 transfers the read instruction program data to the prefetch queue A5a.
or the brief fetch queue B5b. The multiplexer B4b uses the signal 12 to determine which data from the brief fetch queues A5a and B5b is to be sent to the instruction decoder 7, etc.
次にマルチタスク時分割並行実行時の動作を述べる。簡
単化のため、3タスクの実行を考える。Next, we will describe the operation during time-sharing parallel execution of multi-tasks. For simplicity, consider executing three tasks.
使用するレジスタファイルはla、lb、lcとし、マ
ルチタスク実行は、1機械語命令毎にタスクを切り換え
るモードとする。つまり、レジスタファイル1aに関す
る1命令を実行すると、次は、レジスタファイル1bに
関する1命令を実行し、次にレジスタファイルICに関
する1命令を実行し、次にレジスタファイル1aに関す
る命令をするという具合に順次レジスタファイルが自動
的に変わるモードで考える。現在、レジスタファイル1
aに関する命令を行っていた場合を考える。このタスク
に対してブリフェッチキx−A5aが使用されていたと
する。通常のマイクロプロセッサ−では、ブリフェッチ
キューに空きがあれば、プログラム格納領域よりデータ
が読み出され、満たされるまでこの動作は続く。ブリフ
ェッチキューが満たされると、空になるまで、プログラ
ム格納領域からのデータ読み出し動作は止まっている。The register files used are la, lb, and lc, and multitask execution is performed in a mode in which tasks are switched for each machine language instruction. In other words, when one instruction related to register file 1a is executed, next one instruction related to register file 1b is executed, then one instruction related to register file IC is executed, then an instruction related to register file 1a is executed, and so on. Consider a mode in which the register file changes automatically. Currently, register file 1
Consider the case where an instruction related to a is given. Assume that the brief fetch key x-A5a is used for this task. In a typical microprocessor, if there is free space in the briefetch queue, data is read from the program storage area, and this operation continues until the briefetch queue is filled. When the brief fetch queue is filled, data reading operations from the program storage area are stopped until it becomes empty.
本発明では、このタイミング、データ読み出し動作が止
まっているときに、次タスクの実行を前もって解析し、
この場合であると、レジスタファイル1bに関する命令
のデータを、プログラム格納領域6より読み出し、デー
タ分配回路15を切り換え、ブリフェッチキ、−B 5
bにそのデータを取り込んでおく。このとき、レジス
タファイル1aに関する命令実行時に、ブリフェッチキ
ューが満たされなかった場合にはこの動作は発生しない
。レジスタファイル1aに関する命令が終了すると、レ
ジスタファイルが1aから1bに切り換わり、ブリフェ
ッチキューもA5aからB5bに切り換わる。このとき
ブリフェッチキューB5bには、命令プログラムデータ
が入っている可能性があるため、命令データ読み出し待
ちなしに命令実行が可能となる。また、この命令実行中
に、ブリフェッチキa−B 5 bが満たされれば、以
前と同様に、レジスタファイルICに関する命令のデー
タを前もって読み出し、現在使用していない方のブリフ
ェッチキューA5aに格納しておき、タスク切り換え時
のロスをなくす。レジスタファイルICに関する命令を
ブリフェッチキューA5aを使用して実行しているとき
に、ブリフェッチキューが満たされれば、次に実行する
レジスタファイル1aに関する命令データを前もって読
み出し、ブリフェッチキ、−B 5 bに格納する。こ
のように、ブリフェッチキューを2系統設け、これをダ
イナミックに変更することにより、少ない回路規模で効
率の良い命令プログラムの実行を行うことができる。In the present invention, at this timing, when the data read operation is stopped, the execution of the next task is analyzed in advance,
In this case, the instruction data regarding the register file 1b is read from the program storage area 6, the data distribution circuit 15 is switched, and the brief fetch key -B5
Import the data into b. At this time, this operation does not occur if the brief fetch queue is not filled when the instruction regarding the register file 1a is executed. When the instruction related to the register file 1a is completed, the register file is switched from 1a to 1b, and the brief fetch queue is also switched from A5a to B5b. At this time, since there is a possibility that the instruction program data is stored in the brief fetch queue B5b, the instruction can be executed without waiting for instruction data to be read. Also, if the briefetch keys a-B5b are filled during the execution of this instruction, the data of the instruction related to the register file IC is read in advance and stored in the briefetch queue A5a which is not currently in use, as before. This eliminates loss when switching tasks. When the instruction related to the register file IC is executed using the brief fetch queue A5a, if the brief fetch queue is filled, the instruction data related to the register file 1a to be executed next is read in advance and sent to the brief fetch key -B 5 b. Store. In this way, by providing two systems of brief fetch queues and dynamically changing them, it is possible to efficiently execute an instruction program with a small circuit scale.
発明の詳細
な説明したように、本発明によれば、簡単で少ない制御
回路規模で、複数タスクの時分割並行実行を高効率で行
うことができ、いままで、マイコン等で制御できなかっ
た高速マルチタスク実行による制御の実現が可能となる
。As described in detail, according to the present invention, it is possible to perform time-division parallel execution of multiple tasks with high efficiency with a simple and small control circuit scale, and to achieve high-speed execution that could not be controlled with a microcomputer or the like until now. It becomes possible to realize control by executing multi-tasks.
図は本発明のプログラム先取り装置の一実施例を示すブ
ロック図である。
1a〜ln・・・・・・レジスタファイルA−N、2・
・・・・・タスク切り換え制御、3・・・・・・命令プ
ログラム先取り制御s 4a、4b・・・・・・マルチ
プレクサA。
B、5a、5b・・・・・・ブリフエツチキ、−A、B
、6・・・・・・プログラム格納領域、7・・・・・・
命令デコーダ等、8・・・・・・制御、演算処理機能等
、9・・・・・・ノ(ス(システムパス)、10.11
.12.13.14・・・・・・制御信号線、15・・
・・・・データ分配回路。The figure is a block diagram showing an embodiment of the program prefetching device of the present invention. 1a-ln...Register file A-N, 2.
...Task switching control, 3...Instruction program preemption control s 4a, 4b...Multiplexer A. B, 5a, 5b...Brifuetsuchiki, -A, B
, 6...Program storage area, 7...
Instruction decoder, etc., 8... Control, arithmetic processing functions, etc., 9... System path, 10.11
.. 12.13.14... Control signal line, 15...
...Data distribution circuit.
Claims (1)
イル(プログラムカウンタ、スタックポインタ、汎用レ
ジスタ等)を有し、ハードウェアにより時分割マルチタ
スクの並行実行を行う装置において、命令プログラムデ
ータの先取りを、複数タスクの実行状態を認識して行う
ことを特徴とするプログラム先取り装置。In a device such as a single microprocessor that has multiple register files (program counter, stack pointer, general-purpose registers, etc.) and performs parallel execution of time-sharing multitasking using hardware, prefetching instruction program data can be performed by multiple tasks. A program prefetching device that recognizes the execution state of a program.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP1327890A JP2591200B2 (en) | 1989-12-18 | 1989-12-18 | Program prefetching device |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP1327890A JP2591200B2 (en) | 1989-12-18 | 1989-12-18 | Program prefetching device |
Publications (2)
Publication Number | Publication Date |
---|---|
JPH03188530A true JPH03188530A (en) | 1991-08-16 |
JP2591200B2 JP2591200B2 (en) | 1997-03-19 |
Family
ID=18204127
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
JP1327890A Expired - Lifetime JP2591200B2 (en) | 1989-12-18 | 1989-12-18 | Program prefetching device |
Country Status (1)
Country | Link |
---|---|
JP (1) | JP2591200B2 (en) |
Cited By (4)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JPH05224923A (en) * | 1991-11-22 | 1993-09-03 | Internatl Business Mach Corp <Ibm> | Hybrid-pipeline connecting processor and processing method thereof |
JPH06124205A (en) * | 1992-10-12 | 1994-05-06 | Matsushita Electric Ind Co Ltd | Instruction prefetch device |
US8195922B2 (en) | 2005-03-18 | 2012-06-05 | Marvell World Trade, Ltd. | System for dynamically allocating processing time to multiple threads |
KR101696751B1 (en) * | 2015-12-17 | 2017-01-16 | 동아대학교 산학협력단 | Safety cap with multi-function and safety supervision system in work |
Citations (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JPS60250438A (en) * | 1984-05-25 | 1985-12-11 | Nec Corp | Information processor |
-
1989
- 1989-12-18 JP JP1327890A patent/JP2591200B2/en not_active Expired - Lifetime
Patent Citations (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JPS60250438A (en) * | 1984-05-25 | 1985-12-11 | Nec Corp | Information processor |
Cited By (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JPH05224923A (en) * | 1991-11-22 | 1993-09-03 | Internatl Business Mach Corp <Ibm> | Hybrid-pipeline connecting processor and processing method thereof |
JPH06124205A (en) * | 1992-10-12 | 1994-05-06 | Matsushita Electric Ind Co Ltd | Instruction prefetch device |
US8195922B2 (en) | 2005-03-18 | 2012-06-05 | Marvell World Trade, Ltd. | System for dynamically allocating processing time to multiple threads |
US8468324B2 (en) | 2005-03-18 | 2013-06-18 | Marvell World Trade Ltd. | Dual thread processor |
KR101696751B1 (en) * | 2015-12-17 | 2017-01-16 | 동아대학교 산학협력단 | Safety cap with multi-function and safety supervision system in work |
Also Published As
Publication number | Publication date |
---|---|
JP2591200B2 (en) | 1997-03-19 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US6128728A (en) | Virtual shadow registers and virtual register windows | |
US8424021B2 (en) | Event-based bandwidth allocation mode switching method and apparatus | |
CN100440139C (en) | Dual thread processor | |
RU2263949C2 (en) | Translated commands with possible rerun | |
US4074353A (en) | Trap mechanism for a data processing system | |
US5218712A (en) | Providing a data processor with a user-mode accessible mode of operations in which the processor performs processing operations without interruption | |
JP2002149424A (en) | A plurality of logical interfaces to shared coprocessor resource | |
WO1983001133A1 (en) | Microprocessor with memory having interleaved address inputs and interleaved instruction and data outputs | |
US4701847A (en) | Adaptive instruction sequence synthesizer and process | |
US4837688A (en) | Multi-channel shared resource processor | |
JPH03188530A (en) | Program prefetching device | |
EP0301707B1 (en) | Apparatus and method for providing an extended processing environment on nonmicrocoded data processing system | |
JPH0484335A (en) | Virtual machine control method | |
JP2585905B2 (en) | Multitask execution device | |
JPH0668725B2 (en) | Device for responding to interrupt condition in data processing system and method for responding to asynchronous interrupt condition | |
KR100639146B1 (en) | Data Processing System with Cartesian Controller | |
US7818549B2 (en) | Event driven digital signal processor with time constraints | |
KR880001399B1 (en) | Data processor | |
JP2000020310A (en) | Processor | |
SU896625A1 (en) | Data processing device | |
JPH04148236A (en) | Central processing unit | |
JPS58114250A (en) | Common microprocessor | |
JPH0683986A (en) | Single chip microcomputer | |
JPH0217541A (en) | Stack system micro-computer | |
JPH0719247B2 (en) | Command transmission control method in information processing apparatus |