JPH1011301A - Multitask processor and multitask processing control method - Google Patents

Multitask processor and multitask processing control method

Info

Publication number
JPH1011301A
JPH1011301A JP16486796A JP16486796A JPH1011301A JP H1011301 A JPH1011301 A JP H1011301A JP 16486796 A JP16486796 A JP 16486796A JP 16486796 A JP16486796 A JP 16486796A JP H1011301 A JPH1011301 A JP H1011301A
Authority
JP
Japan
Prior art keywords
context
task
save
restore
bus
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
JP16486796A
Other languages
Japanese (ja)
Inventor
Masaharu Imai
正治 今井
Akichika Shiomi
彰睦 塩見
Takumi Nakano
巧 仲野
Mitsuyoshi Itabashi
光義 板橋
Masashi Kiroku
真史 記録
Takafumi Yamase
孝文 山瀬
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.)
Yazaki Corp
Original Assignee
Yazaki Corp
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 Yazaki Corp filed Critical Yazaki Corp
Priority to JP16486796A priority Critical patent/JPH1011301A/en
Publication of JPH1011301A publication Critical patent/JPH1011301A/en
Pending legal-status Critical Current

Links

Abstract

PROBLEM TO BE SOLVED: To prevent the total performance of a microprocessor from decreasing even when the number of tasks to be processed is less than the number of register groups of the microprocessor. SOLUTION: When it is necessary to save and reload a context, a saving/ reloading control means 12 saves a context stored in one of register groups 24-1 to 24-M in a context storage means 18 through saving/reloading buses 11, 15, and 16 provided independently of a bus 17 and reloads a context to be processed which is stored in the context storage means 18 to the register group, so ordinary task processing can be performed simultaneously with the saving and loading of the contexts to reduce the overhead of the saving/ reloading processing, thereby improving the total performance of the multitask processor.

Description

【発明の詳細な説明】DETAILED DESCRIPTION OF THE INVENTION

【0001】[0001]

【発明の属する技術分野】本発明は、マルチタスク処理
装置及びマルチタスク処理制御方法に係り、特にマルチ
タスキングにおいて、コンテキストスイッチング(Cont
ext switching )を行なうマルチタスク処理装置及びマ
ルチタスク処理制御方法に関する。
BACKGROUND OF THE INVENTION 1. Field of the Invention The present invention relates to a multitasking processing apparatus and a multitasking processing control method, and more particularly to a context switching (Cont.
The present invention relates to a multitask processing device for performing ext switching) and a multitask processing control method.

【0002】[0002]

【従来の技術】近年のマイクロプロセッサにおいては、
複数のタスクを並列して処理するマルチタスキングが行
なわれている。このマルチタスキングを実現する方法と
して、複数種類の方法があるが、このような方法の中
で、最も簡単な方法としてコンテキストスイッチングが
知られている。
2. Description of the Related Art In recent microprocessors,
Multitasking for processing a plurality of tasks in parallel has been performed. There are a plurality of types of methods for realizing this multitasking, and context switching is known as the simplest of these methods.

【0003】従来のマイクロプロセッサは、レジスタフ
ァイル(レジスタ群)を1組しか持っていなかったた
め、タスク切換の際には、レジスタファイルの内容であ
るコンテキストを外部メモリであるコンテキスト用メモ
リ(例えば、メインメモリ上に設ける。)に退避し、次
にレジスタファイルの内容を退避したタスクの処理を行
なう場合には、コンテキスト用メモリから対応するコン
テキストをレジスタに復帰させていた。
Since a conventional microprocessor has only one set of register files (register groups), when switching tasks, the context which is the contents of the register file is stored in a context memory (for example, main memory) which is an external memory. In the case where the task is performed after saving the contents of the register file, the corresponding context is restored from the context memory to the register.

【0004】しかし、上記従来のマイクロプロセッサに
おいては、タスク切換が起こる度にコンテキスト用メモ
リに対するアクセスが必要となる。コンテキスト用メモ
リ空間の切換え、例えば、メインメモリ空間の切換えは
かなりの時間を要するため、マイクロプロセッサ全体と
してのパフォーマンスが低下してしまうという問題点が
あった。
However, in the above-mentioned conventional microprocessor, access to the context memory is required every time task switching occurs. Switching of the context memory space, for example, switching of the main memory space, requires a considerable amount of time, and thus has the problem of degrading the performance of the entire microprocessor.

【0005】[0005]

【発明が解決しようとする課題】上記問題点を解決すべ
く、複数のレジスタファイルを設け、コンテキスト用メ
モリ空間の切換頻度を低減することによりパフォーマン
スの向上を図る方法が提案されている。
In order to solve the above problem, there has been proposed a method of improving performance by providing a plurality of register files and reducing the frequency of switching of the context memory space.

【0006】図11に複数のレジスタファイルを有する
マイクロプロセッサの概要構成ブロック図を示す。マイ
クロプロセッサ100は、それぞれ一のタスクのコンテ
キストを格納する複数のレジスタファイル101-1〜1
01-nと、複数のレジスタファイル101-1〜101-n
にいずれのタスクに対応するコンテキストが格納されて
いるかを判別し、タスクの処理に用いるレジスタファイ
ルを選択するための制御信号を出力するレジスタファイ
ル選択回路105と、レジスタファイル101-1〜10
1-nと演算回路110及び制御回路111とを接続する
内部バス(内部アドレスバス及び内部データバス)10
6と、内部バス106及び外部データバス109を制御
するためのバス制御回路107と、を備えて構成されて
いる。
FIG. 11 shows a schematic block diagram of a microprocessor having a plurality of register files. The microprocessor 100 includes a plurality of register files 101-1 to 101-1 each storing a context of one task.
01-n and a plurality of register files 101-1 to 101-n
And a register file selection circuit 105 that outputs a control signal for selecting a register file to be used for task processing, and a register file selection circuit 105 that determines which task stores a context corresponding to the task.
Internal bus (internal address bus and internal data bus) 10 for connecting 1-n to arithmetic circuit 110 and control circuit 111
6 and a bus control circuit 107 for controlling the internal bus 106 and the external data bus 109.

【0007】さらに、マイクロプロセッサ100には、
レジスタファイル101-1〜101-nに格納しきれない
コンテキストを退避するとともに、各種データを記憶す
るデータ/コンテキスト用メモリ108が外部データバ
ス109を介して接続されている。
Further, the microprocessor 100 includes:
A context that cannot be stored in the register files 101-1 to 101-n is saved, and a data / context memory 108 for storing various data is connected via an external data bus 109.

【0008】次に動作を説明する。1) 処理すべきタスク数Nがレジスタファイル数n以
下の場合(N≦n) この場合には、各タスクのコンテキストはいずれかのレ
ジスタファイルに格納されていることとなる。
Next, the operation will be described. 1) The number N of tasks to be processed is less than the number n of register files
In the following case (N ≦ n) In this case, the context of each task is stored in one of the register files.

【0009】従って、タスク切換えが発生した場合に
は、レジスタファイル選択回路105は、切換え先のタ
スクに対応するレジスタファイルを複数のレジスタファ
イル101-1〜101-nのうちから判別し、対応するレ
ジスタファイル101-X(X=1〜n)のみをアクティ
ブにするための制御信号を出力する。
Therefore, when task switching occurs, the register file selection circuit 105 determines the register file corresponding to the task to be switched from among the plurality of register files 101-1 to 101-n, and responds. A control signal for activating only the register file 101-X (X = 1 to n) is output.

【0010】これによりそれ以降は、当該アクティブに
されたレジスタファイル101-Xのみがアクセス可能と
なり、このレジスタファイル101-Xに格納されている
コンテキストに基づいて演算回路110及び制御回路1
11は動作を行なうこととなる。
Thus, thereafter, only the activated register file 101-X can be accessed, and the arithmetic circuit 110 and the control circuit 1 are controlled based on the context stored in the register file 101-X.
11 performs the operation.

【0011】従って、処理すべきタスク数Nがレジスタ
ファイル数n以下の場合には、レジスタファイル101
-1〜101-nに格納しきれないコンテキストが発生する
ことがなく、各種データを記憶するデータ/コンテキス
ト用メモリ108に対して外部データバス109を介し
てアクセスする必要がないので、高速にタスク切換えを
行なうことができ、マイクロプロセッサ101全体のパ
フォーマンスを向上させることができるのである。2) 処理すべきタスク数Nがレジスタファイル数nよ
り多い場合(N>n) この場合には、N個のタスクのコンテキストのうち、n
個のタスクに対応するコンテキストはいずれかのレジス
タファイルに格納されているとともに、(N−n)個の
コンテキストはデータ/コンテキスト用メモリ108に
格納されていることとなる。
Therefore, if the number N of tasks to be processed is less than the number n of register files, the register file 101
-1 to 101-n, and there is no need to access the data / context memory 108 for storing various data via the external data bus 109. Switching can be performed, and the performance of the entire microprocessor 101 can be improved. 2) The number N of tasks to be processed is equal to the number n of register files.
(N> n) In this case, among the contexts of the N tasks, n
The contexts corresponding to the tasks are stored in any of the register files, and the (N−n) contexts are stored in the data / context memory 108.

【0012】従って、タスク切換えが発生した場合に
は、レジスタファイル選択回路105は、切換え先のタ
スクに対応するコンテキストがレジスタファイル101
-1〜101-nのいずれかに存在するか否かを判別し、い
ずれかのレジスタファイル101-1〜101-nに当該切
換え先のタスクに対応するコンテキストが存在する場合
には、対応するレジスタファイル101-X(X=1〜
n)のみをアクティブにするための制御信号を出力す
る。
Therefore, when task switching occurs, the register file selection circuit 105 determines that the context corresponding to the task to be switched to is the register file 101.
-1 to 101-n, and if any of the register files 101-1 to 101-n has a context corresponding to the task to be switched to, the corresponding context is determined. Register file 101-X (X = 1 to
A control signal for activating only n) is output.

【0013】これによりそれ以降は、当該アクティブに
されたレジスタファイル101-Xのみがアクセス可能と
なり、このレジスタファイル101-Xに格納されている
コンテキストに基づいて演算回路110及び制御回路1
11は動作を行なうこととなる。
As a result, thereafter, only the activated register file 101-X can be accessed, and the arithmetic circuit 110 and the control circuit 1 are controlled based on the context stored in the register file 101-X.
11 performs the operation.

【0014】一方、いずれのレジスタファイル101-1
〜101-nにも当該切換え先のタスクに対応するコンテ
キストが存在しない場合には、レジスタファイル選択回
路105は、タスクの優先度等に基づいてデータ/コン
テキスト用メモリ108に退避すべきコンテキストが格
納されているレジスタファイル101-Y(Y=1〜n)
を判別するとともに、バス制御回路107を制御するこ
とにより、当該レジスタファイル101-Yに格納されて
いるコンテキストを内部バス106及びデータバス10
9を介してデータ/コンテキスト用メモリ108に退避
する。
On the other hand, any register file 101-1
If there is no context corresponding to the task at the switching destination in any of the to-101-n, the register file selection circuit 105 stores the context to be saved in the data / context memory 108 based on the task priority and the like. Register file 101-Y (Y = 1 to n)
And by controlling the bus control circuit 107, the context stored in the register file 101-Y is transferred to the internal bus 106 and the data bus 10-Y.
9 to the data / context memory 108.

【0015】退避が終了すると、レジスタファイル選択
回路105は、再びバス制御回路107を制御すること
により復帰させるべきコンテキストをデータバス109
及び内部バス106を介してレジスタファイル101-Y
に格納する。そして、レジスタファイル選択回路105
は、コンテキストの復帰が完了すると、レジスタファイ
ル101-Yのみをアクティブにするための制御信号を出
力する。
When the saving is completed, the register file selection circuit 105 controls the bus control circuit 107 again to change the context to be restored to the data bus 109.
And the register file 101-Y via the internal bus 106
To be stored. Then, the register file selection circuit 105
Outputs a control signal for activating only the register file 101-Y when the return of the context is completed.

【0016】これによりそれ以降は、当該アクティブに
されたレジスタファイル101-Yのみがアクセス可能と
なり、このレジスタファイル101-Yに格納されている
コンテキストに基づいて演算回路110及び制御回路1
11は動作を行なうこととなる。
Thereafter, only the activated register file 101-Y can be accessed, and the arithmetic circuit 110 and the control circuit 1 are controlled based on the context stored in the register file 101-Y.
11 performs the operation.

【0017】以上の説明のように、処理すべきタスク数
Nがレジスタファイル数nより多い場合には、全てのコ
ンテキストをレジスタファイルに格納することができ
ず、コンテキストの退避/復帰のための時間が必要とな
って、マイクロプロセッサ全体のパフォーマンスが低下
してしまうという問題点があった。
As described above, when the number N of tasks to be processed is larger than the number n of register files, not all contexts can be stored in the register file, and the time for saving / restoring contexts is not sufficient. However, there is a problem that the performance of the entire microprocessor is deteriorated.

【0018】そこで、本発明の目的は、処理すべきタス
ク数がマイクロプロセッサのレジスタファイル(レジス
タ群)数よりも多い場合にもマイクロプロセッサ全体の
パフォーマンスを低下させることがないマルチタスク処
理装置及びマルチタスク処理制御方法を提供することに
ある。
An object of the present invention is to provide a multitask processing apparatus and a multitask processing apparatus which do not lower the performance of the entire microprocessor even when the number of tasks to be processed is larger than the number of register files (register groups) of the microprocessor. A task processing control method is provided.

【0019】[0019]

【課題を解決するための手段】請求項1記載の発明は、
各々がコンテキストを格納するM個(M;2以上の整
数)のレジスタ群及びタスク処理を行なうべく前記M個
のレジスタ群に接続されたバスを有し、選択したいずれ
か一のレジスタ群に格納されている前記コンテキストに
基づいて、複数の前記タスク処理を順次行なうマルチタ
スク処理装置において、前記コンテキストを格納するコ
ンテキスト用記憶手段と、前記バスとは別個に設けら
れ、かつ、前記M個のレジスタ群と前記コンテキスト用
記憶手段との間に設けられて前記コンテキストの退避/
復帰を行なうための退避/復帰用バスと、前記退避/復
帰用バスを介して、前記コンテキストを前記コンテキス
ト用記憶手段に退避し、あるいは、前記コンテキスト用
記憶手段から前記コンテキストを前記レジスタ群に復帰
させるための制御を行なう退避/復帰制御手段と、を備
えて構成する。
According to the first aspect of the present invention,
Each of which has M (M; an integer of 2 or more) registers for storing a context and a bus connected to the M registers for performing task processing, and is stored in any one of the selected registers. In a multitask processing device for sequentially performing a plurality of the task processes based on the context, the context storage means for storing the context, and the bus are provided separately, and the M registers are provided. Provided between a group and the context storage means to save / restore the context
The context is saved to the context storage means via the save / restore bus for performing the restoration and the save / restore bus, or the context is restored from the context storage means to the register group. Evacuation / recovery control means for performing control for causing the evacuation / recovery control to be performed.

【0020】請求項1記載の発明によれば、マルチタス
ク処理装置は、コンテキストの退避/復帰処理を行なう
必要がない場合には、M個のレジスタ群のうち、処理す
べきタスクに対応するレジスタ群に格納されているデー
タをバスを介してやり取りしてタスクの処理を行なう。
According to the first aspect of the present invention, when it is not necessary to perform the context save / restore processing, the multitask processing device registers the register corresponding to the task to be processed among the M register groups. Tasks are processed by exchanging data stored in the group via a bus.

【0021】そして処理に用いるレジスタ群を切換える
ことにより、複数のタスク処理を順次行なうマルチタス
ク処理を行なう。一方、コンテキストの退避/復帰処理
を行なう必要がある場合、すなわち、M個のレジスタ群
に処理すべきタスクに対応するコンテキストが格納され
ていない場合には、退避/復帰制御手段は、バスとは別
個に設けられた退避/復帰用バスを介して、いずれかの
レジスタ群に格納されているコンテキストをコンテキス
ト用記憶手段に退避するとともに、コンテキスト用記憶
手段に格納されている処理すべきコンテキストを当該レ
ジスタ群に復帰させる。
By switching the register group used for processing, multitask processing for sequentially performing a plurality of task processing is performed. On the other hand, when it is necessary to perform the context save / restore process, that is, when the context corresponding to the task to be processed is not stored in the M register groups, the save / restore control means performs the processing with the bus. The context stored in any of the register groups is saved to the context storage unit via the separately provided save / restore bus, and the context to be processed stored in the context storage unit is stored in the context storage unit. Return to the register group.

【0022】従って、通常のタスク処理を、バスを介し
てコンテキストの退避/復帰と並行して行なうことがで
きる。請求項2記載の発明は、請求項1記載の発明にお
いて、前記退避/復帰制御手段は、現在実行中のタスク
処理と並行して前記現在実行中のタスク処理を除く各タ
スク処理の優先順位及び処理状態に基づいて次に退避可
能なタスク処理及び復帰すべきタスク処理の判別処理を
行なうように構成する。
Therefore, normal task processing can be performed in parallel with the context save / restore via the bus. According to a second aspect of the present invention, in the first aspect of the present invention, the save / restore control means includes a priority order of each task process excluding the currently executing task process in parallel with the currently executing task process. Based on the processing state, a determination is made as to a task process that can be saved next and a task process that should be restored.

【0023】請求項2記載の発明によれば、請求項1記
載の発明の作用に加えて、退避/復帰制御手段は、現在
実行中のタスク処理と並行して現在実行中のタスク処理
を除く各タスク処理の優先順位及び処理状態に基づいて
次に退避可能なタスク処理及び復帰すべきタスク処理の
判別処理を行なう。
According to the second aspect of the present invention, in addition to the operation of the first aspect, the save / restore control means excludes the currently executing task processing in parallel with the currently executing task processing. Based on the priority and the processing state of each task process, a process of determining the next evacuable task process and the task process to be restored is performed.

【0024】請求項3記載の発明は、請求項1又は請求
項2記載の発明において、並行して処理すべき全タスク
数をL(L;2以上の整数)とし、 L≦M の場合には、全タスク処理に対応するコンテキストを前
記M個のレジスタ群のうちのL個のレジスタ群に格納す
る。
According to a third aspect of the present invention, when the total number of tasks to be processed in parallel is L (L; an integer of 2 or more) in the first or second aspect, and L ≦ M, Stores a context corresponding to all task processing in L register groups of the M register groups.

【0025】請求項3記載の発明によれば、請求項1又
は請求項2記載の発明の作用に加えて、並行して処理す
べき全タスク数をL(L;2以上の整数)とし、 L≦M の場合には、全タスク処理に対応するコンテキストをM
個のレジスタ群のうちのL個のレジスタ群に格納するの
で、タスク切換に伴うコンテキストの退避/復帰処理が
生じることがなく高速に処理を行なうことができる。
According to the invention of claim 3, in addition to the effect of the invention of claim 1 or 2, the total number of tasks to be processed in parallel is L (L; an integer of 2 or more), If L ≦ M, the context corresponding to all task processes is set to M
Since the data is stored in the L register groups among the register groups, the processing can be performed at a high speed without the context saving / restoring processing accompanying the task switching.

【0026】請求項4記載の発明は、各々がコンテキス
トを格納するM個(M;2以上の整数)のレジスタ群及
びタスク処理を行なうべく前記M個のレジスタ群に接続
されたバスを有し、選択したいずれか一のレジスタ群に
格納されている前記コンテキストに基づいて、複数の前
記タスク処理を順次行なうマルチタスク処理装置のマル
チタスク処理制御方法において、現在実行中のタスク処
理と並行して前記現在実行中のタスク処理を除く各タス
ク処理の優先順位及び処理状態に基づいて次に退避可能
なタスク処理及び復帰すべきタスク処理を判別する判別
工程と、前記判別に基づいて、前記バスとは別個に設け
られ、かつ、前記M個のレジスタ群と前記コンテキスト
用記憶手段との間に設けられて前記コンテキストの退避
/復帰を行なうための退避/復帰用バスを介して、前記
退避可能なタスク処理に対応するコンテキストを前記コ
ンテキスト用記憶手段に退避し、あるいは、前記コンテ
キスト用記憶手段から前記コンテキストを前記レジスタ
群に復帰させるための制御を行なう退避/復帰制御工程
と、を備えて構成する。
The invention according to claim 4 has M (M; an integer of 2 or more) register groups each storing a context and a bus connected to the M register groups for performing task processing. A multitask processing control method for a multitask processing device that sequentially performs a plurality of the task processes based on the context stored in any one of the selected register groups; A discriminating step of discriminating a next evacuable task process and a task process to be restored based on the priority and the processing state of each task process except the task process that is currently being executed; and Are provided separately and provided between the M register group and the context storage means to save / restore the context. Control for saving a context corresponding to the task task that can be saved to the context storage means via the save / restore bus, or for returning the context from the context storage means to the register group. Evacuation / return control step of performing

【0027】請求項4記載の発明によれば、判別工程
は、現在実行中のタスク処理と並行して現在実行中のタ
スク処理を除く各タスク処理の優先順位及び処理状態に
基づいて次に退避可能なタスク処理及び復帰すべきタス
ク処理を判別する。これにより退避/復帰工程は、判別
工程における判別に基づいて、バスとは別個に設けら
れ、かつ、M個のレジスタ群と前記コンテキスト用記憶
手段との間に設けられてコンテキストの退避/復帰を行
なうための退避/復帰用バスを介して、前記退避可能な
タスク処理に対応するコンテキストをコンテキスト用記
憶手段に退避し、あるいは、コンテキスト用記憶手段か
らコンテキストをレジスタ群に復帰させるための制御を
行なう。
According to the fourth aspect of the present invention, the determining step is performed next based on the priority and the processing state of each task process excluding the currently executing task process in parallel with the currently executing task process. A possible task process and a task process to be returned are determined. Thus, the save / restore step is provided separately from the bus based on the determination in the determination step, and is provided between the M register group and the context storage means to save / restore the context. A context corresponding to the savable task processing is saved to a context storage unit via a save / restore bus for performing, or control is performed to restore the context from the context storage unit to a register group. .

【0028】請求項5記載の発明は、請求項4記載のマ
ルチタスク処理制御方法において、並行して処理すべき
全タスク数をL(L;2以上の整数)とし、 L≦M の場合には、前記M個のレジスタ群のうちのL個のレジ
スタ群に全タスク処理に対応するコンテキストを格納す
る格納工程を備えて構成する。
According to a fifth aspect of the present invention, in the multitask processing control method according to the fourth aspect, the total number of tasks to be processed in parallel is set to L (L; an integer of 2 or more), and when L ≦ M. Comprises a storing step of storing contexts corresponding to all task processes in L register groups of the M register groups.

【0029】請求項5記載の発明によれば、請求項4記
載の発明の作用に加えて、格納工程は、 L≦M の場合には、M個のレジスタ群のうちのL個のレジスタ
群に全タスク処理に対応するコンテキストを格納する。
According to the fifth aspect of the present invention, in addition to the effect of the fourth aspect of the present invention, the storing step is such that when L ≦ M, L register groups out of M register groups Stores the context corresponding to all task processing.

【0030】[0030]

【発明の実施の形態】次に図面を参照して本発明の好適
な実施形態を説明する。図1にマルチタスク処理装置の
実施形態としてのマイクロプロセッサの概要構成ブロッ
ク図を示す。
Preferred embodiments of the present invention will now be described with reference to the drawings. FIG. 1 shows a schematic block diagram of a microprocessor as an embodiment of a multitask processing device.

【0031】マイクロプロセッサ30は、大別すると、
後述のM個のレジスタファイル(レジスタ群)24-1〜
24-Mを有し、退避/復帰処理を行なうレジスタ回路1
0と、レジスタファイル24-1〜24-Mの内容に基づい
て各種演算を行なう演算回路26と、後述のレジスタフ
ァイル24-1〜24-Mと演算回路26を接続する内部バ
ス(内部アドレスバス及び内部データバス)17と、内
部バス17及び後述の外部データバス13を制御するた
めのバス制御回路22と、を備えて構成されている。
The microprocessor 30 is roughly divided into
M register files (register group) 24-1 to
Register circuit 1 having 24-M and performing save / restore processing
0, an arithmetic circuit 26 for performing various operations based on the contents of the register files 24-1 to 24-M, and an internal bus (internal address bus) for connecting the register files 24-1 to 24-M and the arithmetic circuit 26 to be described later. And an internal data bus 17, and a bus control circuit 22 for controlling the internal bus 17 and an external data bus 13 described later.

【0032】レジスタ回路10は、内部バス17とは別
個に設けられ、後述のレジスタファイル24-1〜24-M
と接続されている退避/復帰用内部バス11と、演算回
路26の処理状態に応じてコンテキストの退避/復帰を
制御すべくタスクの処理に用いるレジスタファイルを選
択するための制御信号SC を出力する退避/復帰制御回
路12と、後述の退避/復帰用内部バス11並びに退避
/復帰用データバス15及び退避/復帰用アドレスバス
16を制御するための退避/復帰用バス制御回路14
と、それぞれ一のタスクのコンテキストを格納するM個
(M;2以上の整数)のレジスタファイル(レジスタ
群)24-1〜24-Mと、を備えて構成されている。
The register circuit 10 is provided separately from the internal bus 17, and has register files 24-1 to 24-M to be described later.
And a control signal SC for selecting a register file to be used for task processing in order to control context save / restore in accordance with the processing state of the arithmetic circuit 26. Save / restore control circuit 12 and save / restore bus control circuit 14 for controlling save / restore internal bus 11, save / restore data bus 15, and save / restore address bus 16, which will be described later.
And M (M; an integer of 2 or more) register files (register groups) 24-1 to 24-M each storing a context of one task.

【0033】バス制御回路22には、各種データを記憶
する外部メモリとしてのデータ用メモリ20が接続され
た外部データバス13が接続されている。退避/復帰制
御回路12は、複数のレジスタファイル24-1〜24-M
にいずれのタスクに対応するコンテキストが格納されて
いるかを判別するレジスタファイル選択回路12Aを備
えて構成されている。
The bus control circuit 22 is connected to an external data bus 13 to which a data memory 20 as an external memory for storing various data is connected. The save / restore control circuit 12 includes a plurality of register files 24-1 to 24-M
Is provided with a register file selection circuit 12A that determines which task corresponds to which context.

【0034】退避/復帰用バス制御回路14には、退避
/復帰用データバス15及び退避/復帰用アドレスバス
16を介して、退避したコンテキストを格納するための
外部メモリとしてのコンテキスト用メモリ18を備えて
構成されている。次に概要動作を説明する。1) 処理すべきタスク数Nがレジスタファイル数M以
下の場合(N≦M) この場合には、各タスクのコンテキストはいずれかのレ
ジスタファイル24-1〜24-Mに格納されることとな
る。
The save / restore bus control circuit 14 has a context memory 18 as an external memory for storing the saved context via a save / restore data bus 15 and a save / restore address bus 16. It is provided with. Next, the outline operation will be described. 1) The number N of tasks to be processed is less than the number M of register files
In the following case (N ≦ M) In this case, the context of each task is stored in any of the register files 24-1 to 24-M.

【0035】従って、タスク切換えが発生した場合に
は、レジスタファイル選択回路12Aは、切換え先のタ
スクに対応するレジスタファイルを複数のレジスタファ
イル24-1〜24-Mのうちから判別し、対応するレジス
タファイル24-X(X=1〜M)のみをアクティブにす
るための制御信号SC を出力する。
Therefore, when task switching occurs, the register file selection circuit 12A determines the register file corresponding to the task to be switched from among the plurality of register files 24-1 to 24-M, and responds. A control signal SC for activating only the register file 24-X (X = 1 to M) is output.

【0036】これによりそれ以降は、当該アクティブに
されたレジスタファイル24-Xのみがアクセス可能とな
り、このレジスタファイル24-Xに格納されているコン
テキストに基づいて演算回路26は動作を行なうことと
なる。従って、処理すべきタスク数Nがレジスタファイ
ル数M以下の場合には、レジスタファイル24-1〜24
-Mに格納しきれないコンテキストが発生することはな
く、退避/復帰用データバス15及び退避/復帰用アド
レスバス16を介してコンテキスト用メモリ18をアク
セスする必要がないので、高速にタスク切換えを行なう
ことができ、マイクロプロセッサ3全体のパフォーマン
スを向上させることができるのである。2) 処理すべきタスク数Nがレジスタファイル数Mよ
り多い場合(N>M) この場合には、N個のタスクのコンテキストのうち、M
個のタスクに対応するコンテキストはいずれかのレジス
タファイル24-1〜24-Mに格納されているとともに、
(N−M)個のコンテキストはコンテキスト用メモリ1
8に格納されていることとなる。 i) 退避/復帰処理を行なわない場合の制御 そこで、タスク切換えが発生した場合には、レジスタフ
ァイル選択回路12Aは、内部バス17、バス制御回路
7、外部データバス13及びデータ用メモリ20を用い
て現在行なわれている演算回路26のタスクの処理と並
行して、切換え先のタスクに対応するコンテキストがレ
ジスタファイル24-1〜24-Mのいずれかに存在するか
否かを判別する。
Thus, thereafter, only the activated register file 24-X can be accessed, and the arithmetic circuit 26 operates based on the context stored in the register file 24-X. . Therefore, if the number N of tasks to be processed is less than the number M of register files, the register files 24-1 to 24
There is no occurrence of a context that cannot be stored in -M, and there is no need to access the context memory 18 via the save / restore data bus 15 and the save / restore address bus 16, so that task switching can be performed at high speed. This can improve the performance of the entire microprocessor 3. 2) The number N of tasks to be processed is equal to the number M of register files.
(N> M) In this case, among the contexts of the N tasks, M
The contexts corresponding to the tasks are stored in any of the register files 24-1 to 24-M.
(NM) contexts are context memory 1
8 is stored. i) Control when save / restore processing is not performed Therefore, when task switching occurs, the register file selection circuit 12A sets the internal bus 17, the bus control circuit
7. In parallel with the current processing of the task of the arithmetic circuit 26 using the external data bus 13 and the data memory 20, the context corresponding to the task to be switched is stored in the register files 24-1 to 24-M. It is determined whether there is any of them.

【0037】このレジスタファイル選択回路12Aの判
別に基づいて退避/復帰制御回路12は、いずれかのレ
ジスタファイル24-1〜24-Mに当該切換え先のタスク
に対応するコンテキストが存在する場合には、対応する
レジスタファイル24-X(X=1〜M)のみをアクティ
ブにするための制御信号SC を出力する。
Based on the judgment of the register file selection circuit 12A, the save / restore control circuit 12 determines whether a context corresponding to the task to be switched exists in any of the register files 24-1 to 24-M. , And outputs a control signal SC for activating only the corresponding register file 24-X (X = 1 to M).

【0038】これによりそれ以降は、当該アクティブに
されたレジスタファイル24-Xのみがアクセス可能とな
り、このレジスタファイル24-Xに格納されているコン
テキストに基づいて演算回路26はタスクの処理を行な
うこととなる。 ii) 退避/復帰処理を行なう場合の制御 一方、いずれのレジスタファイル24-1〜24-Mにも当
該切換え先のタスクに対応するコンテキストが存在しな
い場合には、レジスタファイル選択回路12Aは、タス
クの優先度等に基づいてコンテキスト用メモリ18に退
避すべきコンテキストが格納されているレジスタファイ
ル24-Y(Y=1〜M)を判別する。
Thereafter, only the activated register file 24-X can be accessed, and the arithmetic circuit 26 performs task processing based on the context stored in the register file 24-X. Becomes ii) Control when performing save / restore processing On the other hand, if there is no context corresponding to the task to be switched to in any of the register files 24-1 to 24-M, the register file selection circuit 12A sets the task Then, the register file 24-Y (Y = 1 to M) storing the context to be saved in the context memory 18 is determined based on the priority or the like.

【0039】これにより退避/復帰制御回路12は、制
御信号SC により退避/復帰用バス制御回路14を制御
することにより、当該レジスタファイル24-Yに格納さ
れているコンテキストを退避/復帰用内部バス11並び
に退避/復帰用データバス15及び退避/復帰用アドレ
スバス16を介してコンテキスト用メモリ18に退避す
る。
Thus, the save / restore control circuit 12 controls the save / restore bus control circuit 14 with the control signal SC, thereby saving the context stored in the register file 24-Y to the internal bus for save / restore. 11 and a save / restore data bus 15 and a save / restore address bus 16 to save to the context memory 18.

【0040】レジスタファイル24-Yに格納されている
コンテキストのコンテキスト用メモリ18への退避が終
了すると、退避/復帰制御回路12は、再び制御信号S
C により退避/復帰用バス制御回路14を制御すること
により、レジスタファイル24-Yに復帰させるべきコン
テキストを退避/復帰用データバス15及び退避/復帰
用アドレスバス16並びに退避/復帰用内部バス11を
介してレジスタファイル24-Yに格納する。
When the saving of the context stored in the register file 24-Y to the context memory 18 is completed, the saving / restoring control circuit 12 returns to the control signal S
By controlling the save / restore bus control circuit 14 by C, the context to be restored to the register file 24-Y is changed to the save / restore data bus 15, the save / restore address bus 16, and the save / restore internal bus 11 Is stored in the register file 24-Y.

【0041】そして、退避/復帰制御回路12は、コン
テキストのレジスタファイル24-Yへの復帰が完了する
と、レジスタファイル24-Yをアクティブにするための
制御信号SC を出力する。これによりそれ以降は、当該
アクティブにされたレジスタファイル24-Yをアクセス
することが可能となり、このレジスタファイル24-Yに
格納されているコンテキストに基づいて演算回路26は
対応するタスクの処理を行なうこととなる。
When the context is completely restored to the register file 24-Y, the save / restore control circuit 12 outputs a control signal SC for activating the register file 24-Y. This makes it possible to access the activated register file 24-Y thereafter, and the arithmetic circuit 26 performs the processing of the corresponding task based on the context stored in the register file 24-Y. It will be.

【0042】以上の退避/復帰処理は、内部バス17、
バス制御回路7、外部データバス13及びデータ用メモ
リ20を用いて現在行なわれている演算回路26のタス
クの処理と並行して行なうことができるので、現在実行
中のタスクの処理を中断する必要がなく、レジスタファ
イルの切換時間のオーバーヘッドを削減することが可能
となる。従って、マイクロプロセッサ全体のパフォーマ
ンスを向上させることができる。
The above save / restore processing is performed on the internal bus 17,
Using the bus control circuit 7, the external data bus 13, and the data memory 20, the task can be performed in parallel with the task of the arithmetic circuit 26 that is currently being performed. Therefore, it is possible to reduce the overhead of register file switching time. Therefore, the performance of the entire microprocessor can be improved.

【0043】以上の説明のように、処理すべきタスク数
Nがレジスタファイル数Mより多い場合にも、見掛け
上、全てのコンテキストをレジスタファイルに格納した
場合と同等の処理を行なうことができ、復帰/退避処理
のために現在実行中のタスクの処理が影響を受けないよ
うに余裕を見込んだ数のレジスタファイルを用意してお
けばよいので、レジスタ切換に伴うオーバーヘッドを削
減するために最低限必要なレジスタファイル数は少なく
てすむので、簡易な構成を達成できるにもかかわらずマ
イクロプロセッサ全体のパフォーマンスを向上できる。
As described above, even when the number N of tasks to be processed is larger than the number M of register files, it is possible to perform processing equivalent to the case where all contexts are stored in the register file. It is sufficient to prepare a sufficient number of register files so that the processing of the currently executing task is not affected by the return / save processing, so that the overhead required for register switching is minimized. Since the number of required register files is small, the performance of the entire microprocessor can be improved despite a simple configuration being achieved.

【0044】次に図2乃至図10を参照してより具体的
な動作を説明する。以下においては、説明の簡略化のた
め、レジスタファイル数M=2の場合について説明す
る。この場合において、処理すべきタスクは、図2に示
すように、第1タスクT1、第2タスクT2 、第3タス
クT3 、第4タスクT4 の4個あり、タスクの優先度
は、数字が小さいほど優先度が高く、第1タスクT1 の
優先度=1(最も優先度が高い)、第2タスクT2 の優
先度=2、第3タスクT3 の優先度=3、第4タスクの
優先度=4(最も優先度が低い)であるとする。さら
に、タスクの状態としては、図2に示すように、タスク
を実行中である実行状態(図中、「RUN」と示
す。)、直ちにタスクの実行に移行できる実行可能状態
(図中、「READY」と示す。)、キー入力待ち等の
待機状態(図中、「WAIT」と示す。)の3状態があ
るものとする。また、これらのタスクの状態に関する情
報(例えば、図2参照)は、退避/復帰制御回路12が
保有している。
Next, a more specific operation will be described with reference to FIGS. Hereinafter, a case where the number of register files is M = 2 will be described for simplification of the description. In this case, as shown in FIG. 2, there are four tasks to be processed: a first task T1, a second task T2, a third task T3, and a fourth task T4. Priority of the first task T1 = 1 (highest priority), priority of the second task T2 = 2, priority of the third task T3 = 3, priority of the fourth task = 4 (lowest priority). Further, as shown in FIG. 2, the task state includes an execution state in which the task is being executed (indicated as “RUN” in the figure), and an executable state in which the task can be immediately shifted to the execution of the task (in the figure, “ READY ”), and a standby state such as key input waiting (indicated as“ WAIT ”in the figure). The information on the states of these tasks (for example, see FIG. 2) is held by the save / restore control circuit 12.

【0045】また、図2乃至図10においては、図示の
簡略化のため、第1タスクT1 をタスクT1 、第2タス
クT2 をタスクT2 、第3タスクT3 をタスクT3 、第
4タスクT4 をタスクT4 と表している。また、図4乃
至図10においては、図示の簡略化のため、バス制御回
路22及び退避/復帰用バス制御回路14は図示を省略
している。
In FIGS. 2 to 10, for the sake of simplicity, the first task T1 is a task T1, the second task T2 is a task T2, the third task T3 is a task T3, and the fourth task T4 is a task T4. It is represented as T4. In FIGS. 4 to 10, the bus control circuit 22 and the save / restore bus control circuit 14 are omitted for simplification of the illustration.

【0046】初期状態においては、図2及び図4(a)
に示すように、第1タスクT1 は実行状態(=「RU
N」)、第2タスクT2 、第3タスクT3 及び第4タス
クT4は実行可能状態(=「READY」)にあるもの
とする。この段階では、演算回路26は、第1レジスタ
ファイル24-1に格納されている第1タスクT1 のコン
テキストに基づいて第1タスクT1 の処理を行なってい
る。この第1タスクT1 の処理の結果については、内部
バス17、バス制御回路22及び外部データバス13を
介してデータ用メモリ20に格納される。
In the initial state, FIG. 2 and FIG.
As shown in the figure, the first task T1 is in the execution state (= “RU
N "), the second task T2, the third task T3, and the fourth task T4 are in an executable state (=" READY "). At this stage, the arithmetic circuit 26 performs the processing of the first task T1 based on the context of the first task T1 stored in the first register file 24-1. The result of the processing of the first task T1 is stored in the data memory 20 via the internal bus 17, the bus control circuit 22, and the external data bus 13.

【0047】そして、第2レジスタファイル24-2に
は、優先度=2の第2タスクT2 のコンテキストが格納
されている。さらにコンテキスト用メモリ18には、優
先度=3のタスク、すなわち、第3タスクT3 のコンテ
キスト及び現時点において優先度の最も低い第4タスク
T4のコンテキストが格納されている。
The context of the second task T2 having the priority = 2 is stored in the second register file 24-2. Furthermore, the context memory 18 stores the task of priority = 3, that is, the context of the third task T3 and the context of the fourth task T4 having the lowest priority at the present time.

【0048】そして、第1タスクT1 の処理の途中でキ
ーボードを介したデータ入力待ち状態等が発生すると、
図5(a)に示すように、第1タスクT1 は待機状態
(=「WAIT」)となり、演算回路26は、第2レジ
スタファイル24-2に格納されている第2タスクT2 の
コンテキストを用いて、第2タスクT2 を実行状態(=
「RUN」)とする。
When a state of waiting for data input via the keyboard or the like occurs during the processing of the first task T1,
As shown in FIG. 5A, the first task T1 enters a waiting state (= "WAIT"), and the arithmetic circuit 26 uses the context of the second task T2 stored in the second register file 24-2. To execute the second task T2 (=
"RUN").

【0049】この第2タスクT2 の実行と並行して、退
避/復帰制御回路12のレジスタファイル選択回路12
Aは、図5(a)に示した各タスクの優先度及び状態に
基づいて判別を行ない、待機状態(=「WAIT」)に
ある第1レジスタファイル24-1に格納されている第1
タスクT1 のコンテキストをコンテキスト用メモリ18
に退避すべき旨の判別を行なう。
In parallel with the execution of the second task T2, the register file selection circuit 12 of the save / restore control circuit 12
A makes a determination based on the priority and state of each task shown in FIG. 5A, and the first stored in the first register file 24-1 in the standby state (= "WAIT").
The context of task T1 is stored in context memory 18.
Is determined to be evacuated.

【0050】このレジスタファイル選択回路12Aの判
別に基づいて、図3のフローチャートに示すように、退
避/復帰制御回路12は、退避/復帰用バス制御回路1
4を制御信号SC により制御して、第1レジスタファイ
ル24-1から退避/復帰用内部バス11並びに退避/復
帰用データバス15及び退避/復帰用アドレスバス16
を介して、コンテキスト用メモリ18に第1タスクT1
のコンテキストを退避する(ステップS1)。
Based on the discrimination of the register file selection circuit 12A, the save / restore control circuit 12 sets the save / restore bus control circuit 1 as shown in the flowchart of FIG.
4 is controlled by the control signal SC, and the internal bus 11 for saving / restoring, the data bus 15 for saving / restoring, and the address bus 16 for saving / returning from the first register file 24-1.
Via the first task T1 in the context memory 18
Is saved (step S1).

【0051】図6に第1タスクT1 のコンテキストをコ
ンテキスト用メモリ18に退避後の状態を示す。そし
て、この第1タスクT1 のコンテキストの退避処理と並
行して演算回路26は、第2レジスタファイル24-2に
格納されている第2タスクT2 のコンテキストに基づい
て第2タスクT2 の処理を行なうこととなる(ステップ
S3)。
FIG. 6 shows a state after the context of the first task T 1 has been saved in the context memory 18. Then, in parallel with the context saving processing of the first task T1, the arithmetic circuit 26 performs the processing of the second task T2 based on the context of the second task T2 stored in the second register file 24-2. (Step S3).

【0052】さらに退避/復帰制御回路12は、コンテ
キスト用メモリ18にコンテキストが格納されているタ
スクのうち、実行可能状態(=「READY」)にあ
り、かつ、最も優先度の高いタスクのコンテキスト(図
5(a)参照)、すなわち、この場合においては第3タ
スクT3 のコンテキストを退避/復帰用バス制御回路1
4を制御信号SC により制御し、退避/復帰用内部バス
11並びに退避/復帰用データバス15及び退避/復帰
用アドレスバス16を介して第1レジスタファイル24
-1に復帰する(ステップS2)。
Further, the save / restore control circuit 12 is in the executable state (= “READY”) of the tasks whose context is stored in the context memory 18 and has the context (“READY”) of the task with the highest priority. 5 (a), that is, in this case, the context of the third task T3 is saved / restored by the bus control circuit 1
4 is controlled by the control signal SC, and the first register file 24 is saved via the internal bus 11 for save / restore, the data bus 15 for save / restore, and the address bus 16 for save / restore.
It returns to -1 (step S2).

【0053】図7に第3タスクT3 のコンテキストを第
1レジスタファイル24-1に復帰後の状態を示す。そし
て、第2タスクT2 の処理の途中でキーボードを介した
データ入力待ち状態等が発生すると、図8(a)に示す
ように、第2タスクT2 は待機状態(=「WAIT」)
となり、演算回路26は、第1レジスタファイル24-1
に格納されている第3タスクT3 のコンテキストを用
いて、第3タスクT3 を実行状態(=「RUN」)とす
る。
FIG. 7 shows a state after the context of the third task T3 has been returned to the first register file 24-1. If a state of waiting for data input via the keyboard occurs during the processing of the second task T2, the second task T2 enters a waiting state (= "WAIT") as shown in FIG. 8A.
And the arithmetic circuit 26 calculates the first register file 24-1
The third task T3 is set to the execution state (= "RUN") using the context of the third task T3 stored in.

【0054】この第3タスクT3 の実行と並行して、退
避/復帰制御回路12のレジスタファイル選択回路12
Aは、図8(a)に示した各タスクの優先度及び状態に
基づいて判別を行ない、待機状態(=「WAIT」)に
ある第2レジスタファイル24-2 に格納されている第
2タスクT2 のコンテキストをコンテキスト用メモリ1
8に退避すべき旨の判別を行なう。
In parallel with the execution of the third task T3, the register file selection circuit 12 of the save / restore control circuit 12
A determines based on the priority and state of each task shown in FIG. 8A, and the second task stored in the second register file 24-2 in the standby state (= “WAIT”) T2 context is used as context memory 1
8 is determined to be evacuated.

【0055】このレジスタファイル選択回路12Aの判
別に基づいて、図3のフローチャートに示した処理と同
様に、退避/復帰制御回路12は、退避/復帰用バス制
御回路14を制御信号SC により制御して、第2レジス
タファイル24-2 から退避/復帰用内部バス11並び
に退避/復帰用データバス15及び退避/復帰用アドレ
スバス16を介して、コンテキスト用メモリ18に第2
タスクT2 のコンテキストを退避する(図3のステップ
S1に相当)。
Based on the determination by the register file selection circuit 12A, the save / restore control circuit 12 controls the save / restore bus control circuit 14 by the control signal SC, similarly to the processing shown in the flowchart of FIG. From the second register file 24-2 to the context memory 18 via the save / restore internal bus 11, the save / restore data bus 15 and the save / restore address bus 16,
The context of task T2 is saved (corresponding to step S1 in FIG. 3).

【0056】図9に第2タスクT2 のコンテキストをコ
ンテキスト用メモリ18に退避後の状態を示す。そし
て、この第2タスクT2 のコンテキストの退避処理と並
行して演算回路26は、第1レジスタファイル24-1に
格納されている第3タスクT3 のコンテキストに基づい
て第3タスクT3 の処理を行なうこととなる(図3のス
テップS3相当)。
FIG. 9 shows a state after the context of the second task T 2 has been saved in the context memory 18. Then, in parallel with the process of saving the context of the second task T2, the arithmetic circuit 26 performs the process of the third task T3 based on the context of the third task T3 stored in the first register file 24-1. (Corresponding to step S3 in FIG. 3).

【0057】さらに退避/復帰制御回路12は、図10
に示すように、コンテキスト用メモリ18にコンテキス
トが格納されているタスクのうち、実行可能状態(=
「READY」)にあり、かつ、最も優先度の高いタス
クのコンテキスト(図8(a)参照)、すなわち、この
場合においては第4タスクT4 のコンテキストを退避/
復帰用内部バス11並びに退避/復帰用データバス15
及び退避/復帰用アドレスバス16を介して第1レジス
タファイル24-1に復帰する(図3のステップS2相
当)。
Further, the save / restore control circuit 12 is provided in
As shown in FIG. 5, among the tasks whose context is stored in the context memory 18, the executable state (=
"READY") and the context of the task with the highest priority (see FIG. 8A), that is, in this case, the context of the fourth task T4 is saved /
Internal bus 11 for restoration and data bus 15 for saving / restoring
Then, the process returns to the first register file 24-1 via the save / restore address bus 16 (corresponding to step S2 in FIG. 3).

【0058】そして、以下、同様にしてコンテキストの
退避/復帰及びレジスタ切換えを行なってマルチタスク
処理を実行する。以上の説明のように、本実施形態によ
れば、演算回路26におけるタスクの実行を中断するこ
となく、すなわち、演算回路26におけるタスクの実行
と並行してコンテキストの退避/復帰処理を行なうこと
ができ、レジスタファイル切換に伴う退避/復帰処理の
ためのオーバーヘッドを削減し、マイクロプロセッサ全
体のパフォーマンスを向上させることができるのであ
る。
Subsequently, the context is saved / restored and the registers are switched in the same manner to execute the multitask processing. As described above, according to the present embodiment, the context save / restore process can be performed without interrupting the execution of the task in the arithmetic circuit 26, that is, in parallel with the execution of the task in the arithmetic circuit 26. As a result, the overhead for the save / restore processing associated with the register file switching can be reduced, and the performance of the entire microprocessor can be improved.

【0059】[0059]

【発明の効果】請求項1記載の発明によれば、マルチタ
スク処理装置は、コンテキストの退避/復帰処理を行な
う必要がある場合、すなわち、M個のレジスタ群に処理
すべきタスクに対応するコンテキストが格納されていな
い場合には、退避/復帰制御手段は、バスとは別個に設
けられた退避/復帰用バスを介して、いずれかのレジス
タ群に格納されているコンテキストをコンテキスト用記
憶手段に退避するとともに、コンテキスト用記憶手段に
格納されている処理すべきコンテキストを当該レジスタ
群に復帰させるので、通常のタスク処理をコンテキスト
の退避/復帰と並行して行なうことができ、退避/復帰
処理のオーバーヘッドを削減して、マルチタスク処理装
置全体のパフォーマンスを向上できる。
According to the first aspect of the present invention, the multi-task processing device needs to perform context save / restore processing, that is, the context corresponding to the task to be processed in the M register groups. Is not stored, the save / restore control means stores the context stored in any of the register groups in the context storage means via the save / restore bus provided separately from the bus. Since the context to be processed, which is stored in the context storage means, is restored in the register group, the normal task processing can be performed in parallel with the context save / restore. The overhead can be reduced and the performance of the entire multitask processing device can be improved.

【0060】請求項2記載の発明によれば、請求項1記
載の発明の効果に加えて、退避/復帰制御手段は、現在
実行中のタスク処理と並行して現在実行中のタスク処理
を除く各タスク処理の優先順位及び処理状態に基づいて
次に退避可能なタスク処理及び復帰すべきタスク処理の
判別処理を行なうので、次に実行すべきタスク処理に対
応するコンテキストは、いずれかのレジスタ群に格納さ
れていることとなり、直ちにレジスタ群の切換を行な
え、切換のオーバーヘッドをより低減することが可能と
なる。
According to the second aspect of the present invention, in addition to the effect of the first aspect, the save / restore control means excludes the currently executing task processing in parallel with the currently executing task processing. Based on the priority and the processing state of each task process, a task process that can be saved next and a task process that should be restored are performed. The register group can be switched immediately, and the overhead of switching can be further reduced.

【0061】請求項3記載の発明によれば、請求項1又
は請求項2記載の発明の効果に加えて、並行して処理す
べき全タスク数をL(L;2以上の整数)とし、 L≦M の場合には、全タスク処理に対応するコンテキストをM
個のレジスタ群のうちのL個のレジスタ群に格納するの
で、タスク切換に伴うコンテキストの退避/復帰処理が
生じることがなく高速に処理を行なうことができ、マル
チタスク処理装置のパフォーマンスを低下させることが
ない。
According to the invention of claim 3, in addition to the effect of the invention of claim 1 or 2, the total number of tasks to be processed in parallel is L (L; an integer of 2 or more), If L ≦ M, the context corresponding to all task processes is set to M
Since the data is stored in the L registers among the plurality of registers, the processing can be performed at high speed without performing the context save / restore processing associated with the task switching, thereby deteriorating the performance of the multitask processing device. Nothing.

【0062】請求項4記載の発明によれば、判別工程
は、現在実行中のタスク処理と並行して現在実行中のタ
スク処理を除く各タスク処理の優先順位及び処理状態に
基づいて次に退避可能なタスク処理及び復帰すべきタス
ク処理を判別し、退避/復帰工程は、判別工程における
判別に基づいて、バスとは別個に設けられてコンテキス
トの退避/復帰を行なうための退避/復帰用バスを介し
て、退避可能なタスク処理に対応するコンテキストをコ
ンテキスト用記憶手段に退避し、あるいは、コンテキス
ト用記憶手段からコンテキストをレジスタ群に復帰させ
るための制御を行なうので、通常のタスク処理はバスを
介して行ない、退避/復帰処理は並行して退避/復帰用
バスを介して行なうことにより退避/復帰処理のオーバ
ーヘッドを削減して、マルチタスク処理全体のパフォー
マンスを向上できる。
According to the fourth aspect of the present invention, the determination step is performed next based on the priority and the processing state of each task process excluding the currently executing task process in parallel with the currently executing task process. A possible task process and a task process to be restored are determined, and a save / restore process is provided separately from the bus based on the determination in the determination process, and is a save / restore bus for performing context save / restore. , The context corresponding to the task task that can be saved is saved to the context storage means, or the control for restoring the context from the context storage means to the register group is performed. The save / restore process is performed in parallel via the save / restore bus to reduce the overhead of the save / restore process. Multitasking overall performance can be improved.

【0063】請求項5記載の発明によれば、請求項4記
載の発明の作用に加えて、格納工程は、 L≦M の場合には、M個のレジスタ群のうちのL個のレジスタ
群に全タスク処理に対応するコンテキストを格納するの
で、タスク切換に伴うコンテキストの退避/復帰処理が
生じることがなく高速に処理を行なうことができ、マル
チタスク処理におけるパフォーマンスを低下させること
がない。
According to the fifth aspect of the present invention, in addition to the operation of the fourth aspect of the present invention, the storing step is: if L ≦ M, L of the M register groups Since the contexts corresponding to all the task processes are stored, the process can be performed at a high speed without the context saving / restoring process accompanying the task switching, and the performance in the multitasking process is not reduced.

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

【図1】実施形態のマルチタスク処理装置の概要構成ブ
ロック図である。
FIG. 1 is a schematic configuration block diagram of a multitask processing device according to an embodiment.

【図2】タスク処理の優先度及び状態の例を説明する図
である。
FIG. 2 is a diagram illustrating an example of task processing priorities and states;

【図3】実施形態の動作処理フローチャートである。FIG. 3 is an operation processing flowchart of the embodiment.

【図4】実施形態の動作説明図(その1)である。FIG. 4 is an operation explanatory diagram (part 1) of the embodiment;

【図5】実施形態の動作説明図(その2)である。FIG. 5 is an operation explanatory diagram (part 2) of the embodiment.

【図6】実施形態の動作説明図(その3)である。FIG. 6 is an operation explanatory view (3) of the embodiment.

【図7】実施形態の動作説明図(その4)である。FIG. 7 is an operation explanatory view (part 4) of the embodiment.

【図8】実施形態の動作説明図(その5)である。FIG. 8 is an operation explanatory view (No. 5) of the embodiment;

【図9】実施形態の動作説明図(その6)である。FIG. 9 is an operation explanatory view (No. 6) of the embodiment;

【図10】実施形態の動作説明図(その7)である。FIG. 10 is an operation explanatory view (No. 7) of the embodiment.

【図11】従来のマルチタスク処理装置の概要構成ブロ
ック図である。
FIG. 11 is a schematic block diagram of a conventional multitask processing device.

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

10 レジスタ回路 11 退避/復帰用内部バス 12 退避/復帰制御回路 12A レジスタファイル選択回路 13 外部データバス 14 退避/復帰用バス制御回路 15 退避/復帰用データバス 16 退避/復帰用アドレスバス 17 内部バス 18 コンテキスト用メモリ 20 データ用メモリ 22 バス制御回路 24-1〜24-M レジスタファイル(レジスタ群) 26 演算回路 30 マイクロプロセッサ Reference Signs List 10 register circuit 11 internal bus for save / restore 12 save / restore control circuit 12A register file selection circuit 13 external data bus 14 bus control circuit for save / restore 15 data bus for save / restore 16 address bus for save / restore 17 internal bus 18 Context Memory 20 Data Memory 22 Bus Control Circuit 24-1 to 24-M Register File (Register Group) 26 Arithmetic Circuit 30 Microprocessor

───────────────────────────────────────────────────── フロントページの続き (72)発明者 塩見 彰睦 静岡県浜松市半田町3776 医大宿舎K− 544 (72)発明者 仲野 巧 愛知県宝飯郡音羽町長沢八王子49 (72)発明者 板橋 光義 静岡県裾野市御宿1500 矢崎総業株式会社 内 (72)発明者 記録 真史 静岡県裾野市御宿1500 矢崎総業株式会社 内 (72)発明者 山瀬 孝文 静岡県裾野市御宿1500 矢崎総業株式会社 内 ──────────────────────────────────────────────────続 き Continuing on the front page (72) Inventor Akinori Shiomi 3776 Handa-cho, Hamamatsu City, Shizuoka Pref. Inside Yasushi Sogyo Co., Ltd., 1500, Yazaki Sogyo Co., Ltd., in Shizuoka Prefecture, Japan Inside the inventor's record, Masafumi 1500, Yazaki Sogyo Co., Ltd.

Claims (5)

【特許請求の範囲】[Claims] 【請求項1】 各々がコンテキストを格納するM個
(M;2以上の整数)のレジスタ群及びタスク処理を行
なうべく前記M個のレジスタ群に接続されたバスを有
し、選択したいずれか一のレジスタ群に格納されている
前記コンテキストに基づいて、複数の前記タスク処理を
順次行なうマルチタスク処理装置において、 前記コンテキストを格納するコンテキスト用記憶手段
と、 前記バスとは別個に設けられ、かつ、前記M個のレジス
タ群と前記コンテキスト用記憶手段との間に設けられて
前記コンテキストの退避/復帰を行なうための退避/復
帰用バスと、 前記退避/復帰用バスを介して、前記コンテキストを前
記コンテキスト用記憶手段に退避し、あるいは、前記コ
ンテキスト用記憶手段から前記コンテキストを前記レジ
スタ群に復帰させるための制御を行なう退避/復帰制御
手段と、 を備えたことを特徴とするマルチタスク処理装置。
1. Each of a plurality of M (M; an integer of 2 or more) registers for storing a context and a bus connected to the M registers for performing task processing. In a multitask processing device that sequentially performs a plurality of the task processes based on the context stored in the register group, a context storage unit that stores the context, and the bus is separately provided, and A save / restore bus provided between the M register group and the context storage means for saving / restoring the context; and storing the context via the save / restore bus. Save the context to the context storage means, or restore the context from the context storage means to the register group And a save / return control means for performing control for the multitask processing device.
【請求項2】 請求項1記載のマルチタスク処理装置に
おいて、 前記退避/復帰制御手段は、現在実行中のタスク処理と
並行して前記現在実行中のタスク処理を除く各タスク処
理の優先順位及び処理状態に基づいて次に退避可能なタ
スク処理及び復帰すべきタスク処理の判別処理を行なう
ことを特徴とするマルチタスク処理装置。
2. The multi-task processing device according to claim 1, wherein said save / restore control means includes a priority order of each task process excluding said currently executing task process in parallel with a currently executing task process. A multi-task processing device that performs a determination process of a task process that can be saved next and a task process that should be restored based on a processing state.
【請求項3】 請求項1又は請求項2記載のマルチタス
ク処理装置において、 並行して処理すべき全タスク数をL(L;2以上の整
数)とし、 L≦M の場合には、全タスク処理に対応するコンテキストを前
記M個のレジスタ群のうちのL個のレジスタ群に格納す
ることを特徴とするマルチタスク処理装置。
3. The multitask processing device according to claim 1, wherein the total number of tasks to be processed in parallel is L (L; an integer of 2 or more). A multitask processing device, wherein a context corresponding to task processing is stored in L registers among the M registers.
【請求項4】 各々がコンテキストを格納するM個
(M;2以上の整数)のレジスタ群及びタスク処理を行
なうべく前記M個のレジスタ群に接続されたバスを有
し、選択したいずれか一のレジスタ群に格納されている
前記コンテキストに基づいて、複数の前記タスク処理を
順次行なうマルチタスク処理装置のマルチタスク処理制
御方法において、 現在実行中のタスク処理と並行して前記現在実行中のタ
スク処理を除く各タスク処理の優先順位及び処理状態に
基づいて次に退避可能なタスク処理及び復帰すべきタス
ク処理を判別する判別工程と、 前記判別に基づいて、前記バスとは別個に設けられ、か
つ、前記M個のレジスタ群と前記コンテキスト用記憶手
段との間に設けられて前記コンテキストの退避/復帰を
行なうための退避/復帰用バスを介して、前記退避可能
なタスク処理に対応するコンテキストを前記コンテキス
ト用記憶手段に退避し、あるいは、前記コンテキスト用
記憶手段から前記コンテキストを前記レジスタ群に復帰
させるための制御を行なう退避/復帰制御工程と、 を備えたことを特徴とするマルチタスク処理制御方法。
4. A memory device comprising: M (M; an integer of 2 or more) registers each storing a context; and a bus connected to the M registers for performing task processing. A multitask processing control method for a multitask processing device that sequentially executes a plurality of the task processes based on the context stored in a group of registers, wherein the currently executing task is executed in parallel with the currently executing task process. A discriminating step of discriminating the next evacuable task process and the task process to be restored based on the priority and the processing state of each task process except the process; provided based on the discrimination, separately from the bus; A save / restore bus provided between the M register group and the context storage means for saving / restoring the context; A save / restore control step of saving the context corresponding to the task process that can be saved to the context storage means, or performing control for restoring the context from the context storage means to the register group. A multitask processing control method, comprising:
【請求項5】 請求項4記載のマルチタスク処理制御方
法において、 並行して処理すべき全タスク数をL(L;2以上の整
数)とし、 L≦M の場合には、前記M個のレジスタ群のうちのL個のレジ
スタ群に全タスク処理に対応するコンテキストを格納す
る格納工程を備えたことを特徴とするマルチタスク処理
制御方法。
5. The multitask processing control method according to claim 4, wherein the total number of tasks to be processed in parallel is L (L; an integer of 2 or more), and when L ≦ M, the M tasks A multitask processing control method, comprising a storage step of storing a context corresponding to all task processes in L register groups of the register group.
JP16486796A 1996-06-25 1996-06-25 Multitask processor and multitask processing control method Pending JPH1011301A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP16486796A JPH1011301A (en) 1996-06-25 1996-06-25 Multitask processor and multitask processing control method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP16486796A JPH1011301A (en) 1996-06-25 1996-06-25 Multitask processor and multitask processing control method

Publications (1)

Publication Number Publication Date
JPH1011301A true JPH1011301A (en) 1998-01-16

Family

ID=15801437

Family Applications (1)

Application Number Title Priority Date Filing Date
JP16486796A Pending JPH1011301A (en) 1996-06-25 1996-06-25 Multitask processor and multitask processing control method

Country Status (1)

Country Link
JP (1) JPH1011301A (en)

Cited By (13)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2004063925A1 (en) * 2003-01-09 2004-07-29 Japan Science And Technology Agency Context switching method, device, program, recording medium, and central processing unit
US7020879B1 (en) 1998-12-16 2006-03-28 Mips Technologies, Inc. Interrupt and exception handling for multi-streaming digital processors
US7035997B1 (en) 1998-12-16 2006-04-25 Mips Technologies, Inc. Methods and apparatus for improving fetching and dispatch of instructions in multithreaded processors
US7191313B2 (en) 2001-08-28 2007-03-13 Sony Corporation Microprocessor
US7237093B1 (en) 1998-12-16 2007-06-26 Mips Technologies, Inc. Instruction fetching system in a multithreaded processor utilizing cache miss predictions to fetch instructions from multiple hardware streams
US7257814B1 (en) 1998-12-16 2007-08-14 Mips Technologies, Inc. Method and apparatus for implementing atomicity of memory operations in dynamic multi-streaming processors
JP2009080820A (en) * 2008-10-31 2009-04-16 Panasonic Corp Task switching device, method and program
US7529907B2 (en) 1998-12-16 2009-05-05 Mips Technologies, Inc. Method and apparatus for improved computer load and store operations
US7707391B2 (en) 1998-12-16 2010-04-27 Mips Technologies, Inc. Methods and apparatus for improving fetching and dispatch of instructions in multithreaded processors
US7765546B2 (en) 1998-12-16 2010-07-27 Mips Technologies, Inc. Interstream control and communications for multi-streaming digital processors
US8042116B2 (en) 2004-09-17 2011-10-18 Panasonic Corporation Task switching based on the execution control information held in register groups
US8276156B2 (en) 2003-03-13 2012-09-25 Panasonic Corporation Task switching based on assigned time slot
JP2017037370A (en) * 2015-08-06 2017-02-16 富士通株式会社 Computing device, process control method and process control program

Cited By (18)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7529907B2 (en) 1998-12-16 2009-05-05 Mips Technologies, Inc. Method and apparatus for improved computer load and store operations
US7035997B1 (en) 1998-12-16 2006-04-25 Mips Technologies, Inc. Methods and apparatus for improving fetching and dispatch of instructions in multithreaded processors
US7650605B2 (en) 1998-12-16 2010-01-19 Mips Technologies, Inc. Method and apparatus for implementing atomicity of memory operations in dynamic multi-streaming processors
US7707391B2 (en) 1998-12-16 2010-04-27 Mips Technologies, Inc. Methods and apparatus for improving fetching and dispatch of instructions in multithreaded processors
US7237093B1 (en) 1998-12-16 2007-06-26 Mips Technologies, Inc. Instruction fetching system in a multithreaded processor utilizing cache miss predictions to fetch instructions from multiple hardware streams
US7257814B1 (en) 1998-12-16 2007-08-14 Mips Technologies, Inc. Method and apparatus for implementing atomicity of memory operations in dynamic multi-streaming processors
US7467385B2 (en) 1998-12-16 2008-12-16 Mips Technologies, Inc. Interrupt and exception handling for multi-streaming digital processors
US7926062B2 (en) 1998-12-16 2011-04-12 Mips Technologies, Inc. Interrupt and exception handling for multi-streaming digital processors
US7900207B2 (en) 1998-12-16 2011-03-01 Mips Technologies, Inc. Interrupt and exception handling for multi-streaming digital processors
US7020879B1 (en) 1998-12-16 2006-03-28 Mips Technologies, Inc. Interrupt and exception handling for multi-streaming digital processors
US7765546B2 (en) 1998-12-16 2010-07-27 Mips Technologies, Inc. Interstream control and communications for multi-streaming digital processors
US7191313B2 (en) 2001-08-28 2007-03-13 Sony Corporation Microprocessor
US8020169B2 (en) 2003-01-09 2011-09-13 Japan Science And Technology Agency Context switching system having context cache and a register file for the save and restore context operation
WO2004063925A1 (en) * 2003-01-09 2004-07-29 Japan Science And Technology Agency Context switching method, device, program, recording medium, and central processing unit
US8276156B2 (en) 2003-03-13 2012-09-25 Panasonic Corporation Task switching based on assigned time slot
US8042116B2 (en) 2004-09-17 2011-10-18 Panasonic Corporation Task switching based on the execution control information held in register groups
JP2009080820A (en) * 2008-10-31 2009-04-16 Panasonic Corp Task switching device, method and program
JP2017037370A (en) * 2015-08-06 2017-02-16 富士通株式会社 Computing device, process control method and process control program

Similar Documents

Publication Publication Date Title
US6687810B2 (en) Method and apparatus for staggering execution of a single packed data instruction using the same circuit
JP2788605B2 (en) Computer system and instruction execution method
JPH09212371A (en) Register saving and restoring system
JPH1011301A (en) Multitask processor and multitask processing control method
JPH0736848A (en) Information processor and processing method
EP0644481A1 (en) Back-up logic for dual execution unit processor
JP2724078B2 (en) Maintenance method for redundant memory
JPH1139171A (en) Multitask processor, multitask processing control method and control program storing medium
JPH06236272A (en) Method and system for enhancement of efficiency of synchronization of superscalar processor system
JPS62151940A (en) Register saving/return system
JP2000215068A (en) Multitask scheduling device
JPH11167494A (en) Arithmetic processor and register managing method for it
JP2723847B2 (en) Microprocessor
JP2639988B2 (en) Data driven data processor
JPH09106344A (en) Pipeline processor
JP2594140B2 (en) Data driven data processor
JP3471388B2 (en) Auxiliary processing unit
JPH06149593A (en) Multitask executive device
JPH08115215A (en) Processing system and operating method
JP2001134449A (en) Data processor and its control method
JPH09146769A (en) Pipeline processor
JPH05250161A (en) Microcomputer device
JPH0262633A (en) Inter-program communication system
JPH0357025A (en) Register circuit
JPH0855034A (en) Arithmetic processor and interrupt processing system using the processor

Legal Events

Date Code Title Description
A02 Decision of refusal

Free format text: JAPANESE INTERMEDIATE CODE: A02

Effective date: 20020716