JPH06149593A - Multitask executive device - Google Patents

Multitask executive device

Info

Publication number
JPH06149593A
JPH06149593A JP4299533A JP29953392A JPH06149593A JP H06149593 A JPH06149593 A JP H06149593A JP 4299533 A JP4299533 A JP 4299533A JP 29953392 A JP29953392 A JP 29953392A JP H06149593 A JPH06149593 A JP H06149593A
Authority
JP
Japan
Prior art keywords
register file
register
executed
task
priority
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
JP4299533A
Other languages
Japanese (ja)
Inventor
Mikio Ogisu
幹雄 荻須
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.)
Panasonic Holdings Corp
Original Assignee
Matsushita Electric Industrial Co 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 Matsushita Electric Industrial Co Ltd filed Critical Matsushita Electric Industrial Co Ltd
Priority to JP4299533A priority Critical patent/JPH06149593A/en
Publication of JPH06149593A publication Critical patent/JPH06149593A/en
Pending legal-status Critical Current

Links

Abstract

(57)【要約】 【目的】 ユーザープログラムの負担なく、外部状況に
応じたタスク切替が実行でき、オーバーヘッドを最小限
に押さえる。 【構成】 レジスタファイル切り替え制御部1は外部端
子3の入力データによりレジスタファイル群8中から一
つのレジスタファイルを選択し切り替え、待避処理実行
部2にそれを示す端子起動信号5と実行中レジスタファ
イル情報信号6を出力する。割込み、例外、復帰の事象
の発生を示す信号4が発生した場合、待避処理実行部2
は切り替え制御部1に特定レジスタファイル指定信号7
を出力する。切り替え制御部1はこの信号7を受理する
と強制的に特定レジスタファイルへの切り替えをする。
レジスタファイル群8の各レジスタファイルは起動優先
度レジスタ、インストラクション・ポインタ、スタック
領域ポインタを持ち、それらはアドレスバス9、データ
バス10に接続されて、待避処理実行部2の制御下にあ
る。
(57) [Summary] [Purpose] The task switching can be executed according to the external situation without burdening the user program, and the overhead is minimized. [Structure] The register file switching control unit 1 selects and switches one register file from the register file group 8 according to the input data of the external terminal 3, and notifies the save process execution unit 2 of the terminal start signal 5 and the register file under execution. The information signal 6 is output. When the signal 4 indicating the occurrence of an interrupt, an exception, or a recovery event occurs, the save process execution unit 2
Is a specific register file designation signal 7 to the switching control unit 1.
Is output. When the switching control unit 1 receives the signal 7, the switching control unit 1 forcibly switches to the specific register file.
Each register file of the register file group 8 has a start priority register, an instruction pointer, and a stack area pointer, which are connected to the address bus 9 and the data bus 10 and are under the control of the save processing execution unit 2.

Description

【発明の詳細な説明】Detailed Description of the Invention

【0001】[0001]

【産業上の利用分野】本発明は、一つの中央演算処理装
置(以下CPUという)を用いて、二つ以上のタスク
(仕事)を時分割並行処理をするマルチタスク実行装置
に関するものである。
BACKGROUND OF THE INVENTION 1. Field of the Invention The present invention relates to a multi-task execution device for performing time-division parallel processing of two or more tasks (work) by using one central processing unit (hereinafter referred to as CPU).

【0002】[0002]

【従来の技術】マイクロプロセッサーを利用してタスク
を実行する場合、一つのCPUに対して、レジスタ群、
スタックポインタ、およびステータスレジスタ等からな
る1組のレジスタファイルを準備し、CPUからの命令
に応じてレジスタファイルに必要なデータを転送しなが
らタスクを実行する方法のものが多い。
2. Description of the Related Art When a microprocessor is used to execute a task, a register group for one CPU,
In many cases, a set of register files including a stack pointer and a status register is prepared, and tasks are executed while transferring necessary data to the register files according to an instruction from the CPU.

【0003】ところが、この方式では常時一つのタスク
しか実行できないため、実行効率が悪くなるという問題
点があった。そのため、従来から一つのCPUに対して
設けられた1組のレジスタファイルを時分割で使用し、
複数のタスクを実行する方法が考えられている。しかし
ながらこの方法は、タスクを切り替える度に、それまで
レジスタファイルに格納されていたデータを、いったん
メモリ(スタック)領域に待避させ、次のタスクに必要
なデータを別のメモリ領域からレジスタファイルに呼び
出しする操作が必要となる。このデータの切り替え時間
中はタスクを実行することができず、したがって時間的
なロスが大きくなる。
However, in this method, only one task can be executed at any one time, so that there is a problem that the execution efficiency is deteriorated. Therefore, one set of register files conventionally provided for one CPU is used in a time-sharing manner,
Methods for performing multiple tasks are being considered. However, with this method, each time the task is switched, the data previously stored in the register file is temporarily saved in the memory (stack) area, and the data required for the next task is called from another memory area to the register file. Operation is required. During this data switching time, the task cannot be executed, and therefore the time loss becomes large.

【0004】このような問題点を解決するために、一つ
のCPUに対して複数のレジスタファイルを準備し、順
次切り替えながら複数のタスクを実行する方法も考えら
れている。この方法では、一つのタスクに対して一つの
レジスタファイルが準備されているので、切り替え時に
データを待避させたり、呼び出したりする必要はなく、
したがって時間的なロスは少なくなる。しかしこの場合
でも、複数のタスク切り替え設定がプログラムによって
実行されるため、ユーザーがユーザーの仕様に合わせて
プログラムを作成するには大きな負担がかかっていた。
In order to solve such a problem, there has been considered a method of preparing a plurality of register files for one CPU and executing a plurality of tasks while sequentially switching them. With this method, one register file is prepared for one task, so there is no need to save or recall data when switching,
Therefore, time loss is reduced. However, even in this case, since a plurality of task switching settings are executed by the program, it has been a great burden for the user to create the program according to the user's specifications.

【0005】一方、タスクを切り替えるタイミングとし
て、1命令実行毎に切り替える方法や、各タスクに時間
的重みをつけて切り替える方法が考えられている。この
場合、ある長い時間の間に複数のタスクが実行されるア
プリケーションの場合には、非常に有効な切り替え手段
となり得るが、アプリケーションのおかれた外部状況に
よって実行するタスクが異なり、優先的に外部状況に対
応したタスクを実行する場合には、外部状況の判断を行
ない、判断結果にもとづき実行するタスクの選択をプロ
グラムによって行なう必要があり、事象発生から実際の
実行に至るまでのオーバーヘッドが大であった。
On the other hand, as a timing of switching the task, a method of switching each time one instruction is executed, or a method of switching each task by weighting it with time is considered. In this case, in the case of an application in which multiple tasks are executed in a certain long time, it can be a very effective switching means, but the task to be executed differs depending on the external situation of the application, and the external task is given priority. When executing a task that corresponds to a situation, it is necessary to judge the external situation and select the task to be executed based on the judgment result by a program, which causes a large overhead from the event occurrence to the actual execution. there were.

【0006】また、割込み・例外によるレジスタファイ
ルの起動は、その割込み・例外要因が同時あるいは多重
に発生した場合、優先度に従って割込み・例外を受理
し、それらの処理を実行する方法が一般的に知られてお
り、優先度の判断をハードウェアによって行なってい
た。しかしながら、この方法では割込み・例外の実行優
先度の比較判断は可能であるが、通常タスクとの実行優
先度の比較はソフトウェアにより行なっていたため、ソ
フトウェアの負担が大であり、優先度の判断処理に時間
がかかっていた。
In addition, the activation of a register file by an interrupt / exception is generally carried out by a method of accepting the interrupt / exception according to the priority and executing the processing when the interrupt / exception factors are generated simultaneously or in a multiple manner. It was known, and the priority was determined by hardware. However, with this method, it is possible to compare and judge the execution priorities of interrupts and exceptions, but since the software compares the execution priorities with normal tasks, the load on the software is heavy, and the priority judgment processing is performed. Was taking time.

【0007】[0007]

【発明が解決しようとする課題】このように複数のタス
クを一つのCPUで実行させる場合、 (1)各タスクの切り替え設定をプログラムで設定しな
ければならないため、ユーザーに大きな負担がかかる。 (2)外部状況によって実行タスクを変更する場合もプ
ログラムの介在があったため、オーバーヘッドが大であ
った。 (3)割込み・例外によるレジスタファイル起動と端子
によるレジスタファイル起動があった場合、両者の優先
度をソフトウェアにより比較する場合その負担が大であ
った。本発明は、このような従来の課題を解決するマル
チタスク実行装置を提供するものである。
When a plurality of tasks are executed by one CPU in this way, (1) the switching setting of each task must be set by a program, which imposes a heavy burden on the user. (2) Even if the execution task is changed depending on the external situation, the intervention of the program causes a large overhead. (3) When a register file is activated by an interrupt / exception and a register file is activated by a terminal, the burden of comparing both priorities by software is heavy. The present invention provides a multitask execution device that solves such conventional problems.

【0008】[0008]

【課題を解決するための手段】本発明は上記課題を解決
するために、次の機能を有する構成よりなる。 (1)外部状況に対応する少なくとも1本の外部入力端
子を設け、外部入力端子から入力されるデータにより直
接レジスタファイルが選択される。 (2)割込み・例外が発生した場合、割込み・例外処理
を実行するレジスタファイルに対応するスタックポイン
タにより、割込み・例外処理前の受理可能なレジスタフ
ァイル起動優先度または割込み・例外優先度が待避され
る。 (3)外部状況によるレジスタファイルの直接起動があ
った場合、選択されたレジスタファイルに対応するスタ
ックポインタによりレジスタファイル起動前の受理可能
なレジスタファイル起動優先度または割込み・例外優先
度が待避される。 (4)外部状況によるレジスタファイルの直接起動があ
った場合、そのレジスタファイルの起動を許可するかど
うかのフラグにより起動判断をハードウェアが実行す
る。 (5)外部状況によるレジスタファイルの直接起動があ
った場合、他のレジスタファイル起動または割込み・例
外・システムコールとの優先度比較をハードウェアが実
行する。
In order to solve the above problems, the present invention comprises a structure having the following functions. (1) At least one external input terminal corresponding to the external situation is provided, and the register file is directly selected by the data input from the external input terminal. (2) When an interrupt / exception occurs, the stack pointer corresponding to the register file that executes interrupt / exception processing saves the acceptable register file activation priority or interrupt / exception priority before interrupt / exception processing. It (3) When a register file is directly activated due to an external situation, the stack pointer corresponding to the selected register file saves the acceptable register file activation priority or interrupt / exception priority before register file activation. . (4) When the register file is directly activated due to an external situation, the hardware executes the activation judgment by the flag as to whether or not the activation of the register file is permitted. (5) When the register file is directly activated due to an external situation, the hardware executes activation of another register file or comparison of priorities with interrupts, exceptions, and system calls.

【0009】[0009]

【作用】この構成により、マルチタスク処理において、
ユーザープログラムの負担なく、外部状況に応じたタス
ク切り替えが実行でき、オーバーヘッドを最小限に押さ
えたシステムを実現することができる。
With this configuration, in multitask processing,
Task switching can be executed according to external conditions without burdening the user program, and a system with minimal overhead can be realized.

【0010】[0010]

【実施例】以下本発明の一実施例について図面を参照し
ながら説明する。
DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS An embodiment of the present invention will be described below with reference to the drawings.

【0011】図1は、本発明の端子によりレジスタファ
イルをハードウェアで選択・切り替えでき、端子起動時
のプログラム情報待避用スタックポインタと例外・割込
み発生時のプログラム情報待避用SPを使い分けるマル
チタスク実行装置の構成を示した図である。
FIG. 1 shows a multi-task execution in which a register file can be selected / switched by hardware by means of the terminals of the present invention, and a stack pointer for saving program information at terminal activation and a SP for saving program information at exception / interrupt occurrence are used separately. It is the figure which showed the structure of the apparatus.

【0012】レジスタファイル切り替え制御部(以下単
に切り替え制御部という)1は、外部端子3の入力デー
タによりレジスタファイル群8の中から一つのレジスタ
ファイルを選択し、切り替えるとともに、待避処理実行
部2に対して、外部端子3によりレジスタファイルの切
り替え動作があったことを示す端子起動信号5と、現在
実行中のレジスタファイル番号(レジスタファイル群8
の中で現在どのレジスタファイルが使用されているかを
示す)情報である実行中レジスタファイル情報信号6と
を出力する。また、割込み(プログラムでの処理と非同
期、無関係に発生する)、例外(プログラムの実行に依
存して発生)、復帰(割込み・例外からの復帰)の事象
が発生したことを示す信号割込み・例外・復帰信号4が
発生した場合、待避処理実行部2は切り替え制御部1に
対して、特定レジスタファイル指定信号7を出力する。
切り替え制御部1は、いったん特定レジスタファイル指
定信号7を受理すると、強制的に特定レジスタファイル
への切り替えを実行する。レジスタファイル群8の各レ
ジスタファイルは、レジスタファイル起動の優先度を示
す、起動優先度レジスタ、インストラクション・ポイン
タ(以下IPという)、スタック領域ポインタ(以下S
Pという)を持っており、レジスタファイル0の場合、
起動優先度レジスタ11、IP12、SP13を各1本
ずつ備えている。各起動優先度レジスタ、IP、SPは
アドレスバス9およびデータバス10に接続されてお
り、待避処理実行部2の制御下にある。
The register file switching control unit (hereinafter simply referred to as a switching control unit) 1 selects one register file from the register file group 8 according to the input data of the external terminal 3 and switches it, and at the same time, the save processing execution unit 2 On the other hand, the terminal start signal 5 indicating that the register file switching operation has been performed by the external terminal 3 and the register file number currently being executed (register file group 8
(Indicating which register file is currently used) in the execution register file information signal 6 is output. In addition, a signal indicating that an interrupt event (which occurs asynchronously with the processing in the program or not), an exception (occurs depending on the execution of the program), and a return event (return from interrupt / exception) When the return signal 4 is generated, the save processing execution unit 2 outputs the specific register file designation signal 7 to the switching control unit 1.
Once the switching control unit 1 receives the specific register file designating signal 7, it forcibly switches to the specific register file. Each register file of the register file group 8 has a startup priority register, an instruction pointer (hereinafter referred to as IP), a stack area pointer (hereinafter S
If you have a register file 0,
The boot priority register 11, the IP 12 and the SP 13 are provided one each. Each boot priority register, IP, SP is connected to the address bus 9 and the data bus 10, and is under the control of the save process execution unit 2.

【0013】本実施例では、一例として、起動優先度レ
ジスタを各レジスタファイルに設けたが、必ずしもレジ
スタファイルに対応して設ける必要はない。また、割込
み・例外処理を実行するレジスタファイルを特定化(特
定レジスタファイル)し、特定レジスタファイルで割込
み・例外処理を実行するとしているが、これも不特定の
レジスタファイルで処理可能である。
In this embodiment, as an example, the activation priority register is provided in each register file, but it is not always necessary to provide it in correspondence with the register file. Further, the register file that executes interrupt / exception processing is specified (specific register file), and the interrupt / exception processing is executed by the specific register file, but this can also be processed by an unspecified register file.

【0014】図1の実施例では、特定レジスタファイル
をレジスタファイル0として以下説明する。外部端子3
よりレジスタファイル2の起動要求があった場合、切り
替え制御部1は、レジスタファイル選択信号14を介し
て、レジスタファイル群8の中からレジスタファイル2
を選択する。このとき、レジスタファイル2に対応する
起動優先度レジスタ15、IP16、SP17も選択さ
れる。また、切り替え制御部1は待避処理実行部2に対
して、端子起動信号5を有効状態にするとともに、実行
中レジスタファイル情報信号6を介して、レジスタファ
イル2が起動されたことを伝達する。待避処理実行部2
は、これらの情報を受けて、レジスタファイル2のSP
17を使用して、起動優先度レジスタ15、IP16を
待避する処理を実行する。その処理内容は次のとおりで
ある。 (1)アドレスバス9を介して、SP17を選択し、S
P17内のスタック領域アドレス情報をデータバス10
を介して読む。 (2)スタック領域アドレス情報を使って、IP16、
起動優先度レジスタ15の順に待避処理を行なう。 (3)新しいスタック領域アドレス情報をアドレスバス
9、データバス10を用いてSP17に書き戻す。
In the embodiment of FIG. 1, the specific register file will be described as the register file 0 below. External terminal 3
When there is a request to activate the register file 2, the switching control unit 1 selects the register file 2 from the register file group 8 via the register file selection signal 14.
Select. At this time, the activation priority register 15, IP16 and SP17 corresponding to the register file 2 are also selected. Further, the switching control unit 1 makes the terminal activation signal 5 valid and informs the evacuation process execution unit 2 that the register file 2 has been activated through the in-execution register file information signal 6. Retraction processing execution unit 2
Receives these information, SP of register file 2
17 is used to execute processing for saving the activation priority register 15 and the IP 16. The processing contents are as follows. (1) Select SP17 via address bus 9 and
The stack area address information in P17 is transferred to the data bus 10
Read through. (2) Using the stack area address information, IP16,
The save processing is performed in the order of the activation priority register 15. (3) The new stack area address information is written back to the SP 17 using the address bus 9 and the data bus 10.

【0015】次に、割込み・例外・復帰信号4が有効状
態になった場合を説明する。割込み・例外・復帰信号4
が割込み・例外状態を示している場合、待避処理実行部
2は、特定レジスタファイル指定信号7を介して、切り
替え制御部1に対してレジスタファイル0の起動を実行
させる。切り替え制御部1は、レジスタファイル選択信
号14によりレジスタファイル0を選択するとともに、
実行中レジスタファイル情報信号6を介して、レジスタ
ファイル0が起動されたことを伝達する。待避処理実行
部2は、これらの情報を受けて、レジスタファイル0の
SP13を使用して、起動優先度レジスタ11、IP1
2を待避する処理を実行する。その処理内容は次のとお
りである。 (1)アドレスバス9を介して、SP13を選択し、S
P13内のスタック領域アドレス情報をデータバス10
を介して読む。 (2)スタック領域アドレス情報を使って、IP12、
起動優先度レジスタ11の順に待避処理を行なう。 (3)新しいスタック領域アドレス情報をアドレスバス
9、データバス10を用いてSP13に書き戻す。
Next, the case where the interrupt / exception / return signal 4 becomes valid will be described. Interrupt / Exception / Return signal 4
Indicates the interrupt / exception state, the save process execution unit 2 causes the switching control unit 1 to activate the register file 0 via the specific register file designation signal 7. The switching control unit 1 selects the register file 0 by the register file selection signal 14 and
The execution of the register file 0 is transmitted via the register file information signal 6 being executed. Receiving the above information, the save processing executing unit 2 uses the SP 13 of the register file 0 to start the boot priority register 11 and IP1.
The process of saving 2 is executed. The processing contents are as follows. (1) Select SP13 via address bus 9
The stack area address information in P13 is transferred to the data bus 10
Read through. (2) IP12, using the stack area address information
Evacuation processing is performed in the order of the activation priority register 11. (3) The new stack area address information is written back to the SP 13 using the address bus 9 and the data bus 10.

【0016】割込み・例外・復帰信号4が割込み・例外
処理からの復帰状態の場合、待避処理実行部2は実行中
レジスタファイル情報信号6で示される実行中のレジス
タファイルに従って、起動優先度レジスタ、IP、SP
を選択し、復帰動作を実行する。処理内容は次のとおり
である。 (1)アドレスバス9を介して、SPを選択し、SP内
のスタック領域アドレス情報をデータバス10を介して
読む。 (2)スタック領域アドレス情報を使って、起動優先度
レジスタ、IPの順に復帰動作を行なう。 (3)新しいスタック領域アドレス情報をアドレスバス
9、データバス10を用いてSPに書き戻す。
When the interrupt / exception / return signal 4 is in the return state from the interrupt / exception process, the save process execution unit 2 follows the running priority register file indicated by the running register file information signal 6 to start the priority register, IP, SP
Select to execute the return operation. The processing contents are as follows. (1) The SP is selected via the address bus 9 and the stack area address information in the SP is read via the data bus 10. (2) Using the stack area address information, the recovery operation is performed in the order of the boot priority register and IP. (3) The new stack area address information is written back to the SP using the address bus 9 and the data bus 10.

【0017】スタックへの待避動作が起動がかかったレ
ジスタファイルで管理されるSPで行なわれるため、多
重で待避処理が起こった場合、管理が容易であり、ま
た、SPの選択を含めた待避処理をハードウェアで実行
することにより、ソフトウェアの負担の少ないシステム
を実現することができる。
Since the saving operation to the stack is performed by the SP managed by the activated register file, the management is easy when the saving processing occurs in multiple times, and the saving processing including the selection of the SP is performed. By executing the above with hardware, it is possible to realize a system with less burden on software.

【0018】図2は、本発明の端子によりレジスタファ
イルをハードウェアで選択・切り替えでき、ハードウェ
アで切り替えることを許可するかどうかを選択するフラ
グとレジスタファイル起動優先レベルを示すレジスタを
設け、切り替え判断をするマルチタスク実行装置の構成
を示した図である。
FIG. 2 shows that a register file can be selected / switched by hardware through the terminals of the present invention, and a flag for selecting whether to permit switching by hardware and a register indicating a register file activation priority level are provided and switched. It is a figure showing the composition of the multitask execution device which judges.

【0019】レジスタファイル切り替え制御部1(以下
切り替え制御部)は、外部端子3の入力データによりレ
ジスタファイル群8の中から一つのレジスタファイルを
選択し、切り替える機能を持つ。レジスタファイル群8
の各レジスタファイルは、そのレジスタファイルに起動
をかけてよいかどうかを示す起動許可フラグや、そのレ
ジスタファイルの起動優先度を示す起動優先度レジスタ
を持っており、レジスタファイル0の場合、起動許可フ
ラグ18と起動優先度レジスタ19を備えており、任意
に設定可能である。本実施例では、一例として、起動許
可フラグと起動優先度レジスタを各レジスタファイルに
設けたが、必ずしもレジスタファイルに対応して設ける
必要はない。起動許可フラグ、起動優先度レジスタと
も、待避処理実行部2に入力されている。起動優先度レ
ジスタは現在実行中優先度レジスタ22と比較され、起
動許可フラグが“1”で、かつ、(起動優先度レジス
タ)>(実行中優先度レジスタ22)であれば、切り替
え許可信号23が、待避処理実行部2から切り替え制御
部1に出力され、切り替え動作が実行される。また、待
避処理実行部2は起動優先度レジスタの値を実行中優先
レジスタ22に書き込む。起動優先度レジスタの値は各
レジスタファイル間、割込み・例外によるレジスタファ
イル起動間との優先度を示しており、値が大きいほど、
優先度が高い。一例として、起動優先度レジスタの値が
4ビットで示される場合、起動優先度レジスタ19が
“1111”、起動優先度レジスタ21が“100
1”、および割込み優先度(図示せず)が“1010”
であったとすると、優先度は、(レジスタファイル0)
>(割込み)>(レジスタファイル2)となる。しかし
ながら、起動許可フラグにおいて、起動許可フラグ18
が“1”、起動許可フラグ20が“1”、および割込み
許可フラグ(図示せず)が“0”であったとすると、起
動順序は、レジスタファイル0、レジスタファイル2と
なり、割込みは受理されない。
The register file switching control unit 1 (hereinafter, switching control unit) has a function of selecting and switching one register file from the register file group 8 according to the input data of the external terminal 3. Register file group 8
Each register file has a start permission flag indicating whether the register file can be activated, and a start priority register indicating the start priority of the register file. A flag 18 and a boot priority register 19 are provided and can be set arbitrarily. In the present embodiment, as an example, the activation permission flag and the activation priority register are provided in each register file, but they need not necessarily be provided corresponding to the register file. Both the activation permission flag and the activation priority register are input to the save processing execution unit 2. The activation priority register is compared with the currently executing priority register 22, and if the activation permission flag is “1” and (activation priority register)> (execution priority register 22), the switching permission signal 23 Is output from the save processing execution unit 2 to the switching control unit 1, and the switching operation is executed. Further, the save processing execution unit 2 writes the value of the activation priority register into the executing priority register 22. The value of the startup priority register indicates the priority between register files and between register file startup due to interrupts and exceptions.
high priority. As an example, when the value of the activation priority register is indicated by 4 bits, the activation priority register 19 is “1111” and the activation priority register 21 is “100”.
1 ", and the interrupt priority (not shown) is" 1010 "
Then, the priority is (register file 0)
>(Interrupt)> (register file 2). However, in the activation permission flag, the activation permission flag 18
Is "1", the activation permission flag 20 is "1", and the interruption permission flag (not shown) is "0", the activation sequence is register file 0, register file 2, and the interrupt is not accepted.

【0020】また、レジスタファイル0を割込み・例外
が発生した場合の”特定レジスタファイル”であるとす
ると、各割込み・例外・システムコールに起動許可フラ
グや起動優先度レジスタを備えているので、起動許可フ
ラグ18と起動優先度レジスタ19は不要であり、図2
から起動許可フラグ18と起動優先度レジスタ19を取
り去ったシステムも可能である。ここで、割込み・例外
処理を実行するレジスタファイルを特定化(特定レジス
タファイル)し、特定レジスタファイルで割込み・例外
処理を実行するとしているが、これも不特定のレジスタ
ファイルで処理可能である。このように、各レジスタフ
ァイル、割込み・例外・システムコールに優先度をつけ
ることにより、優先度の高いものから処理することが可
能となり、また、優先度の比較・判断をハードウェアで
実行することにより、ソフトウェアの負担が軽いシステ
ムを実現することができる。
If register file 0 is a "specific register file" when an interrupt / exception occurs, each interrupt / exception / system call has a start enable flag and a start priority register. The permission flag 18 and the activation priority register 19 are unnecessary, and
A system in which the activation permission flag 18 and the activation priority register 19 are removed from is also possible. Here, the register file that executes interrupt / exception processing is specified (specific register file), and the interrupt / exception processing is executed in the specific register file, but this can also be processed by an unspecified register file. In this way, by prioritizing each register file, interrupts, exceptions, and system calls, it is possible to process from the highest priority, and the priority comparison and judgment can be executed by hardware. Thus, it is possible to realize a system in which the load of software is light.

【0021】図3は図1、図2の本発明のマルチタスク
実行装置のタイミングを示した図である。横軸は時間を
示し、図の右側方向へ時間が進んでいく。ここでは、一
例として“特定レジスタファイル”としてレジスタファ
イル0が起動される。ここで、割込み・例外処理を実行
するレジスタファイルを特定化(特定レジスタファイ
ル)し、特定レジスタファイルで割込み・例外処理を実
行するとしているが、これも不特定のレジスタファイル
で処理可能である。レジスタファイル2とレジスタファ
イル4とが、CPU(図示せず)を時分割に占有してマ
ルチタスク処理を実行しているときに、端子起動により
レジスタファイル5の起動がかかったとすると、ここ
で、実行中優先度レジスタ22とレジスタファイル5の
起動優先度レジスタの比較、および起動許可フラグのチ
ェックが行なわれる。レジスタファイル5の起動が許可
されると、レジスタファイル5のSPを使って、レジス
タファイル5のIPと実行中優先度レジスタ22(過去
にレジスタファイル5で他のタスクが割り当てられてい
なければ、実行中優先度レジスタ22のみでも可)がレ
ジスタファイル5のスタックエリアに待避される。待避
される実行中優先度レジスタ22の値は、レジスタファ
イル5を起動する前の実行中優先度レジスタ22の値で
ある。待避処理終了後、実行中優先度レジスタ22に
は、レジスタファイル5の起動優先度レジスタの値がそ
のまま実行中優先度レジスタ22にセットされる。レジ
スタファイル5のIPはそのまま保持される。
FIG. 3 is a diagram showing the timing of the multitask execution system of the present invention shown in FIGS. The horizontal axis indicates time, and the time advances to the right in the figure. Here, as an example, the register file 0 is started as the “specific register file”. Here, the register file that executes interrupt / exception processing is specified (specific register file), and the interrupt / exception processing is executed in the specific register file, but this can also be processed by an unspecified register file. If the register file 2 and the register file 4 occupy a CPU (not shown) in a time-sharing manner and execute multitask processing, if the register file 5 is activated by terminal activation, here, The execution priority register 22 and the activation priority register of the register file 5 are compared and the activation permission flag is checked. When the activation of the register file 5 is permitted, the SP of the register file 5 is used to execute the IP of the register file 5 and the executing priority register 22 (execution if another task is not assigned in the register file 5 in the past. Only the medium priority register 22 is also saved) in the stack area of the register file 5. The value of the running priority register 22 that is saved is the value of the running priority register 22 before the register file 5 is activated. After the save processing is completed, the value of the activation priority register of the register file 5 is set in the executing priority register 22 as it is in the executing priority register 22. The IP of the register file 5 is retained as it is.

【0022】割込み発生により、特定レジスタファイル
であるレジスタファイル0の起動が許可されると、レジ
スタファイル0のSPを使って、レジスタファイル0の
IPと実行中優先度レジスタ22がレジスタファイル0
のスタックエリアに待避される。ここで待避される実行
中優先度レジスタ22の値は、レジスタファイル0を起
動する前の値(=レジスタファイル5の起動優先度)で
ある。待避処理のあと、レジスタファイル0の起動優先
度レジスタの値が、実行中優先度レジスタ22にセット
される。レジスタファイル0で割込みからの“復帰命
令”が実行されると、レジスタファイル0のSPを使っ
て、レジスタファイル0のスタックエリアからレジスタ
ファイル0のIPと実行中優先度レジスタ22が戻され
る。実行中優先度レジスタ22内にはレジスタファイル
0起動前、すなわち、レジスタファイル5の起動優先度
が格納されている。また、レジスタファイル5のIPは
保持されているので、レジスタファイル5はシステムコ
ール発行前の状態に戻される。レジスタファイル5でレ
ジスタファイル5起動に対する“復帰命令”が実行され
ると、レジスタファイル5のSPを使って、レジスタフ
ァイル5のスタックエリアからレジスタファイル5のI
Pと実行中優先度レジスタ22(または実行中優先度レ
ジスタ22のみ)が戻される。実行中優先度レジスタ2
2内にはレジスタファイル5起動前の起動優先度が格納
されているので、実行中優先度レジスタ22の値はレジ
スタファイル5起動前の状態に戻される。割込み・例外
・端子によるレジスタファイルの起動があった場合、起
動前の優先度がスタック内に保存されるため、割込み・
例外・端子によるレジスタファイルの起動からの復帰時
に割込み・例外・端子によるレジスタファイルの起動前
の状態に戻すことができ、システム管理が容易となる。
When the activation of the register file 0, which is a specific register file, is permitted by the occurrence of an interrupt, the IP of the register file 0 and the executing priority register 22 are set to the register file 0 by using the SP of the register file 0.
Are saved in the stack area. The value of the running priority register 22 saved here is the value before the register file 0 is started (= start priority of the register file 5). After the save processing, the value of the activation priority register of the register file 0 is set in the executing priority register 22. When the "return instruction" from the interrupt is executed in the register file 0, the IP of the register file 0 and the executing priority register 22 are returned from the stack area of the register file 0 by using the SP of the register file 0. The in-execution priority register 22 stores the activation priority of the register file 0, that is, the activation priority of the register file 5. Since the IP of the register file 5 is held, the register file 5 is returned to the state before the system call was issued. When the "restore instruction" for the activation of the register file 5 is executed in the register file 5, the SP of the register file 5 is used to change the I of the register file 5 from the stack area of the register file 5.
P and the running priority register 22 (or only the running priority register 22) are returned. Executing priority register 2
Since the activation priority before activation of the register file 5 is stored in 2, the value of the in-execution priority register 22 is returned to the state before activation of the register file 5. When a register file is activated by an interrupt, exception, or pin, the priority before activation is saved in the stack.
At the time of returning from the activation of the register file by the exception / terminal, the state before the activation of the register file by the interrupt / exception / terminal can be restored, and the system management becomes easy.

【0023】[0023]

【発明の効果】この構成により、マルチタスク処理にお
いて、タスク切り替え時にユーザープログラムの負担が
なく、外部状況に応じたタスク切り替えが実行でき、オ
ーバーヘッドを最小限に押さえることができる。また、
スタックへの待避動作が起動がかかったレジスタファイ
ルで管理されるSPで行なわれるため、多重で待避処理
が起こった場合、管理が容易で、かつ、各レジスタファ
イル、割込み・例外に優先度をつけることにより、優先
度の高いものから処理することが可能であり、また以上
の一連の処理をハードウェアで実行するため、ソフトウ
ェアの負担の少なく、応答性のよいシステムを提供する
ことができる。
With this configuration, in multitask processing, there is no burden on the user program when switching tasks, task switching can be executed according to external conditions, and overhead can be minimized. Also,
Since the save operation to the stack is performed by the SP managed by the activated register file, if multiple save operations occur, it is easy to manage and prioritize each register file and interrupt / exception. As a result, it is possible to perform processing in descending order of priority, and since the series of processing described above is executed by hardware, it is possible to provide a system with low software load and good responsiveness.

【図面の簡単な説明】[Brief description of drawings]

【図1】本発明の端子によりレジスタファイルをハード
ウェアで選択・切り替えでき、端子起動時のプログラム
情報待避用スタックポインタ(SP)と例外・割込み発
生時のプログラム情報待避用SPを使い分けるマルチタ
スク実行装置の構成を示した図
FIG. 1 is a multi-task execution in which a register file can be selected / switched by hardware by a terminal of the present invention, and a program information saving stack pointer (SP) at terminal activation and a program information saving SP at exception / interrupt occurrence are used separately. Diagram showing the configuration of the device

【図2】本発明の端子によりレジスタファイルをハード
ウェアで選択・切り替えでき、ハードウェアで切り替え
ることを許可するかどうかを選択するフラグとレジスタ
ファイル起動優先レベルを示すレジスタを設け、切り替
え判断をするマルチタスク実行装置の構成を示した図
FIG. 2 is a diagram showing a register file which can be selected / switched by hardware by the terminal of the present invention, a flag for selecting whether to permit switching by hardware and a register indicating a register file activation priority level are provided, and switching judgment is performed. Diagram showing the configuration of the multitask execution unit

【図3】図1、図2に示した本発明のマルチタスク実行
装置のタイミング図
FIG. 3 is a timing diagram of the multitask execution device of the present invention shown in FIGS. 1 and 2.

【符号の説明】[Explanation of symbols]

1 レジスタファイル切り替え制御部 2 待避処理実行部 3 外部端子 4 信号割込み・例外・復帰信号 5 端子起動信号 6 実行中レジスタファイル情報信号 7 特定レジスタファイル指定信号 8 レジスタファイル群 9 アドレスバス 10 データバス 11 起動優先度レジスタ 12 インストラクション・ポインタ(IP) 13 スタック領域ポインタ(SP) 14 レジスタファイル選択信号 15 起動優先度レジスタ 16 インストラクション・ポインタ(IP) 17 スタック領域ポインタ(SP) 18 起動許可フラグ 19 起動優先度レジスタ 20 起動許可フラグ 21 起動優先度レジスタ 22 現在実行中優先度レジスタ 23 切り替え許可信号 1 register file switching control unit 2 save processing execution unit 3 external terminal 4 signal interrupt / exception / return signal 5 terminal start signal 6 executing register file information signal 7 specific register file designation signal 8 register file group 9 address bus 10 data bus 11 Start priority register 12 Instruction pointer (IP) 13 Stack area pointer (SP) 14 Register file selection signal 15 Start priority register 16 Instruction pointer (IP) 17 Stack area pointer (SP) 18 Start permission flag 19 Start priority Register 20 Activation permission flag 21 Activation priority register 22 Currently executing priority register 23 Switching permission signal

Claims (3)

【特許請求の範囲】[Claims] 【請求項1】レジスタファイル切り替え制御部の管理下
で複数のレジスタファイルに一つの中央演算処理装置を
時分割で占有させ、前記複数のレジスタファイルにより
複数のタスクを時分割並行処理するマルチタスク実行装
置において、レジスタファイルの切り替え手段として、
少なくとも一つの入力端子を備え、前記入力端子から入
力するデータは前記中央演算処理装置に時分割に占有さ
せていく前記複数のレジスタファイルの一部または全て
を指定可能で、前記入力端子から前記データを入力する
ことにより前記複数のレジスタファイルの中から実行す
べきレジスタファイルをハードウェアで選択・切り替え
る第1の手段と、前記レジスタファイルでのタスク実行
の優先レベルを示す第2の手段とを備えたマルチタスク
実行装置。
1. Multitask execution in which one central processing unit is occupied by a plurality of register files in a time-sharing manner under the control of a register file switching control unit, and a plurality of tasks are processed in a time-sharing parallel manner by the plurality of register files. In the device, as a register file switching means,
At least one input terminal is provided, and the data input from the input terminal can specify a part or all of the plurality of register files that the central processing unit occupies in a time division manner. A first means for selecting / switching a register file to be executed from the plurality of register files by hardware by inputting, and a second means for indicating a priority level of task execution in the register file. Multitasking device.
【請求項2】レジスタファイル切り替え制御部の管理下
で複数のレジスタファイルに一つの中央演算処理装置を
時分割で占有させ、前記複数のレジスタファイルにより
複数のタスクを時分割並行処理するマルチタスク実行装
置において、レジスタファイルの切り替え手段として、
少なくとも一つの入力端子を備え、前記入力端子から入
力するデータは前記中央演算処理装置に時分割に占有さ
せていく前記複数のレジスタファイルの一部または全て
を指定可能で、前記入力端子から前記データを入力する
ことにより前記複数のレジスタファイルの中から実行す
べきレジスタファイルをハードウェアで選択・切り替え
る第1の手段と、前記入力端子による前記レジスタファ
イルの起動許可を示す第2の手段とを備えたマルチタス
ク実行装置。
2. A multitask execution in which one central processing unit is occupied by a plurality of register files in a time-sharing manner under the control of a register file switching control unit, and a plurality of tasks are processed in a time-sharing parallel manner by the plurality of register files. In the device, as a register file switching means,
At least one input terminal is provided, and the data input from the input terminal can specify a part or all of the plurality of register files that the central processing unit occupies in a time division manner. By inputting, to select and switch the register file to be executed from the plurality of register files by hardware, and second means for indicating the activation permission of the register file by the input terminal. Multitasking device.
【請求項3】レジスタファイル切り替え制御部の管理下
で複数のレジスタファイルに一つの中央演算処理装置を
時分割で占有させ、前記複数のレジスタファイルにより
複数のタスクを時分割並行処理するマルチタスク実行装
置において、レジスタファイルの切り替え手段として、
少なくとも一つの入力端子を備え、前記入力端子から入
力するデータは前記中央演算処理装置に時分割に占有さ
せていく前記複数のレジスタファイルの一部または全て
を指定可能で、前記入力端子から前記データを入力する
ことにより前記複数のレジスタファイルの中から実行す
べきレジスタファイルをハードウェアで選択・切り替え
る第1の手段と、例外・割込み要因や前記入力端子での
レジスタファイルの起動要因あるいは前記レジスタファ
イルでのタスク実行の優先レベルを示す第2の手段と、
前記中央演算処理装置の現在実行中の優先レベルを示す
第3の手段と、前記第2の手段による優先レベルと前記
第3の手段による現在実行中の優先レベルを比較し、例
外・割込み発生によるタスクや前記入力端子で発生する
タスクが実行される前記レジスタファイルを、前記中央
演算処理装置に占有させるか否かの判断をする第4の手
段と、前記第4の手段により例外・割込み発生によるタ
スクや前記入力端子で発生するタスクが実行される前記
レジスタファイルを、前記中央演算処理装置に占有させ
る場合、前記実行されるレジスタファイルが使用可能な
スタック領域に、前記第3の手段による現在実行中の優
先レベルを待避することにより、前記受理したタスク終
了時に、タスク起動前の現在実行中の優先レベルに戻す
ことが可能な第5の手段とを備えたマルチタスク実行装
置。
3. A multitask execution in which a plurality of register files occupy one central processing unit in a time-sharing manner under the control of a register file switching control unit, and a plurality of tasks are processed in a time-sharing parallel manner by the plurality of register files. In the device, as a register file switching means,
At least one input terminal is provided, and the data input from the input terminal can specify a part or all of the plurality of register files that the central processing unit occupies in a time division manner. Means for selecting / switching the register file to be executed from the plurality of register files by hardware by inputting, and an exception / interruption factor, a factor of activating the register file at the input terminal, or the register file Means for indicating the priority level of task execution in
The third means indicating the priority level currently being executed by the central processing unit, the priority level by the second means and the priority level currently being executed by the third means are compared to determine whether an exception or an interrupt has occurred. A fourth means for determining whether or not the central processing unit is to occupy the register file in which a task or a task generated at the input terminal is executed; and an exception / interruption generated by the fourth means. When the central processing unit is to occupy the register file in which the task or the task generated in the input terminal is executed, it is currently executed by the third means in a stack area where the register file to be executed can be used. By saving the medium priority level, it is possible to return to the currently executing priority level before task activation at the end of the accepted task. Multitask execution and means.
JP4299533A 1992-11-10 1992-11-10 Multitask executive device Pending JPH06149593A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP4299533A JPH06149593A (en) 1992-11-10 1992-11-10 Multitask executive device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP4299533A JPH06149593A (en) 1992-11-10 1992-11-10 Multitask executive device

Publications (1)

Publication Number Publication Date
JPH06149593A true JPH06149593A (en) 1994-05-27

Family

ID=17873840

Family Applications (1)

Application Number Title Priority Date Filing Date
JP4299533A Pending JPH06149593A (en) 1992-11-10 1992-11-10 Multitask executive device

Country Status (1)

Country Link
JP (1) JPH06149593A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2015531521A (en) * 2012-10-09 2015-11-02 コンチネンタル オートモーティヴ ゲゼルシャフト ミット ベシュレンクテル ハフツングContinental Automotive GmbH Method and controller for controlling the separate execution of a plurality of linked program blocks

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPS5999553A (en) * 1982-11-29 1984-06-08 Nec Corp Interruption control system
JPH02253440A (en) * 1989-03-28 1990-10-12 Matsushita Electric Ind Co Ltd Time division multitask execution device
JPH0328933A (en) * 1989-06-26 1991-02-07 Matsushita Electric Ind Co Ltd Task control method
JPH03257631A (en) * 1990-03-08 1991-11-18 Matsushita Electric Ind Co Ltd Time division multitask executing device
JPH04180131A (en) * 1990-11-14 1992-06-26 Matsushita Electric Ind Co Ltd Interruption processor

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPS5999553A (en) * 1982-11-29 1984-06-08 Nec Corp Interruption control system
JPH02253440A (en) * 1989-03-28 1990-10-12 Matsushita Electric Ind Co Ltd Time division multitask execution device
JPH0328933A (en) * 1989-06-26 1991-02-07 Matsushita Electric Ind Co Ltd Task control method
JPH03257631A (en) * 1990-03-08 1991-11-18 Matsushita Electric Ind Co Ltd Time division multitask executing device
JPH04180131A (en) * 1990-11-14 1992-06-26 Matsushita Electric Ind Co Ltd Interruption processor

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2015531521A (en) * 2012-10-09 2015-11-02 コンチネンタル オートモーティヴ ゲゼルシャフト ミット ベシュレンクテル ハフツングContinental Automotive GmbH Method and controller for controlling the separate execution of a plurality of linked program blocks

Similar Documents

Publication Publication Date Title
US5168566A (en) Multi-task control device for central processor task execution control provided as a peripheral device and capable of prioritizing and timesharing the tasks
US5386563A (en) Register substitution during exception processing
US5701493A (en) Exception handling method and apparatus in data processing systems
JPH02272652A (en) Method for expanding memory
JPS6364144A (en) Data transfer method between storage devices
EP0239078B1 (en) Register saving/restoring system
JP3970609B2 (en) Processor system
US5790872A (en) Interrupt control handler for a RISC-type microprocessor
JPH0668725B2 (en) Device for responding to interrupt condition in data processing system and method for responding to asynchronous interrupt condition
JP2693916B2 (en) Task scheduling method
JP2579008B2 (en) Time-division multitasking execution device
JP2585905B2 (en) Multitask execution device
JPH04241032A (en) System call execution device
JP2574349B2 (en) Time-division multitasking execution device
JP2553698B2 (en) Time-division multitasking execution device
JP2666667B2 (en) Multitask execution device
JPS62151942A (en) Task changing-over system
JP2000132409A (en) Stack sharing system for task having no wait state
JPH0821027B2 (en) Microcomputer with built-in A / D converter
JPH05224953A (en) Interrupt control device and method
JPH06187169A (en) Multi-task executing device
JPH06149594A (en) Multitask execution device
JPH02163834A (en) Multi-task processing system
JPS5971555A (en) Performance monitoring system
JPH0424828A (en) Multi-task control system