JP2001084151A - Central processing unit - Google Patents

Central processing unit

Info

Publication number
JP2001084151A
JP2001084151A JP25801399A JP25801399A JP2001084151A JP 2001084151 A JP2001084151 A JP 2001084151A JP 25801399 A JP25801399 A JP 25801399A JP 25801399 A JP25801399 A JP 25801399A JP 2001084151 A JP2001084151 A JP 2001084151A
Authority
JP
Japan
Prior art keywords
register
unit
temporary storage
central processing
processing unit
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
JP25801399A
Other languages
Japanese (ja)
Inventor
Isao Katayama
功 片山
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.)
Toshiba Corp
Original Assignee
Toshiba 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 Toshiba Corp filed Critical Toshiba Corp
Priority to JP25801399A priority Critical patent/JP2001084151A/en
Publication of JP2001084151A publication Critical patent/JP2001084151A/en
Pending legal-status Critical Current

Links

Abstract

PROBLEM TO BE SOLVED: To provide a central processing unit capable of accelerating the preserving operation and restoring operation of a register in a central processing unit at the time of task switching. SOLUTION: This central processing unit 10 is provided with an arithmetic part 12 for operating each kind of arithmetic processing, an instruction fetch/ decode part 14 for controlling the arithmetic part 12, plural registers 16 for temporarily storing data necessary for the arithmetic processing of the arithmetic part 12 or the arithmetic result of the arithmetic part 12, and a register transferring device 18 connected with the register 16 and an outside bus 24 for controlling data transfer between the register 16 and the outside bus 24, and for successively executing the preservation or restoration of the value of the register 16 when any dead space is generated in the outside bus 24 and inside buses 20 and 22.

Description

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

【0001】[0001]

【発明の属する技術分野】本発明は、リアル・タイム・
オペレーティングシステムで管理されたコンピュータシ
ステムで用いられる中央処理装置に関する。特に、本発
明は、この中央処理装置内部のレジスタの保存動作およ
び復帰動作の高速化技術に関する。
TECHNICAL FIELD The present invention relates to a real-time
The present invention relates to a central processing unit used in a computer system managed by an operating system. In particular, the present invention relates to a technique for accelerating the operation of saving and restoring registers in the central processing unit.

【0002】[0002]

【従来の技術】自動車のエンジン制御装置等の制御機器
や産業用機器では、外部からの入力信号やプログラムか
らの要求に対して、即座に(リアルタイムに)、あるい
は一定時間内にその処理を確実に終了する必要がある。
このようなリアルタイム処理に適したオペレーティング
・システムがリアル・タイム・オペレーティングシステ
ム(OS)である。
2. Description of the Related Art In a control device such as an engine control device of an automobile or an industrial device, it is ensured that an input signal from the outside or a request from a program is processed immediately (in real time) or within a predetermined time. Need to end.
An operating system suitable for such real-time processing is a real-time operating system (OS).

【0003】制御機器や産業用機器の制御プログラムの
多くは複数の「タスク」と呼ばれるプログラムを単位と
して構成されている。リアル・タイムOSは中央処理装
置上で実行されているタスクを管理し、制御機器等の状
態の変化に応じて、現在実行しているタスクを中断し、
別のタスクの実行を開始する。このように、リアル・タ
イムOSは実行されるタスクの切り替えを頻繁に行って
いる。この切り替えの際、中断したタスクの実行を後で
再開できるように、タスクの切り替え直前の中央処理装
置の状態、つまり中央処理装置内部のレジスタの値を外
部記憶装置に一時的に保存する必要がある。このため、
リアル・タイムOSはタスク切り替えを実行する際は、
切り替え直前のレジスタの値を外部記憶装置に転送し、
保存しなければならない(レジスタの保存動作)。さら
に、次のタスク実行のため、そのタスク中断時のレジス
タの値を外部記憶装置からレジスタに読み込まなければ
ならない(レジスタの復帰動作)。
Many control programs for control equipment and industrial equipment are configured in units of a plurality of programs called "tasks". The real-time OS manages tasks that are being executed on the central processing unit, suspends currently executing tasks according to changes in the state of control devices, etc.,
Start running another task. Thus, the real-time OS frequently switches the task to be executed. At the time of this switching, it is necessary to temporarily store the state of the central processing unit immediately before the switching of the task, that is, the value of the register in the central processing unit in the external storage device so that the execution of the interrupted task can be resumed later. is there. For this reason,
When the real-time OS executes task switching,
Transfer the value of the register immediately before switching to the external storage device,
Must be saved (register save operation). Furthermore, in order to execute the next task, the value of the register at the time of the interruption of the task must be read from the external storage device into the register (register return operation).

【0004】このように、タスク切り替え時には、中央
処理装置内のレジスタの保存動作および復帰動作がレジ
スタの数だけ繰り返される。そして、これらの動作はタ
スク切り替えの際必ず挿入される。したがって、新しい
タスクの動作開始が遅延するという問題がある。また、
タスク切り替えの実行中は、機器の状態変化に対応する
機能がすべて停止してしまう場合が多く、タスク切り替
え時間の短縮は非常に重要な課題である。
As described above, at the time of task switching, the operation of saving and restoring registers in the central processing unit is repeated by the number of registers. These operations are always inserted at the time of task switching. Therefore, there is a problem that the operation start of a new task is delayed. Also,
During the task switching, all the functions corresponding to the change in the state of the device are often stopped, and shortening the task switching time is a very important issue.

【0005】このため、リアル・タイムOSの改良やタ
スク切り替え機能のハードウェア化、といった支援によ
ってタスク切り替え時間を短縮する手法が提案されてい
る。たとえば、中央処理装置内にレジスタ保存専用記憶
装置を設ける例がある。この例の場合、タスク切り替え
要求が発生した時点で、中央処理装置内のレジスタの値
のすべては一括してレジスタ保存専用記憶装置に自動的
に保存される。しかし、記憶装置の容量制限によって扱
えるタスクの数には限りがある。また、直ちには保存が
不要なレジスタの値まで一括して保存されてしまうの
で、専用記憶装置の低使用率、無用なレジスタの保存や
復帰に要する時間の消費といった問題もある。
For this reason, there has been proposed a technique for shortening the task switching time with the support of improving the real-time OS and implementing the task switching function as hardware. For example, there is an example in which a dedicated storage device for register storage is provided in the central processing unit. In the case of this example, when the task switching request is generated, all the register values in the central processing unit are automatically and collectively stored in the register storage dedicated storage device. However, the number of tasks that can be handled is limited due to storage device capacity limitations. In addition, since values of registers that do not need to be stored are immediately stored in a lump, there are also problems such as a low use rate of the dedicated storage device and consumption of time required for storing and restoring unnecessary registers.

【0006】[0006]

【発明が解決しようとする課題】本発明は、このような
課題を解決し、タスク切り替え時の中央処理装置内のレ
ジスタの保存動作および復帰動作を高速化できる中央処
理装置を提供することを目的とする。
SUMMARY OF THE INVENTION An object of the present invention is to provide a central processing unit capable of solving the above-mentioned problems and speeding up the operation of saving and restoring registers in the central processing unit at the time of task switching. And

【0007】[0007]

【課題を解決するための手段】上記課題を解決するた
め、本発明の特徴は、各種の演算処理を行う演算部と、
命令をフェッチ/デコードし、演算部を制御する命令フ
ェッチ/デコード部と、演算部の演算処理に必要なデー
タや演算部の演算結果を一時的に記憶する複数の記憶回
路(レジスタ)で構成された一時記憶部(レジスタユニ
ット)と、レジスタユニットおよび外部バスに接続さ
れ、レジスタユニットと外部バス間のデータ転送を制御
するレジスタ転送装置であって、外部バスおよび演算部
とレジスタユニット間の内部バスに空きが生じた場合に
データ転送を逐次実行するレジスタ転送部とを有する中
央処理装置であることである。
Means for Solving the Problems In order to solve the above problems, a feature of the present invention is to provide an arithmetic unit for performing various arithmetic processes,
An instruction fetch / decode unit that fetches / decodes an instruction and controls an operation unit, and a plurality of storage circuits (registers) that temporarily store data necessary for operation processing of the operation unit and operation results of the operation unit. A register transfer device connected to the temporary storage unit (register unit), the register unit and the external bus, and controlling data transfer between the register unit and the external bus, the internal bus between the external bus and the arithmetic unit and the register unit. Is a central processing unit having a register transfer unit for sequentially executing data transfer when a vacancy occurs.

【0008】本発明の特徴によれば、中断されるタスク
の状態を示すレジスタユニットの値の保存と開始される
別のタスクの状態を示すレジスタユニットの値の復帰が
中央処理装置が実行する処理と見掛け上並列的に実行さ
れる。このため、タスク切り替え処理に要する時間が短
縮され、中央処理装置の高速化が図られる。
According to a feature of the present invention, the processing executed by the central processing unit is to store the value of the register unit indicating the state of the task to be interrupted and to restore the value of the register unit indicating the state of another task to be started. And apparently executed in parallel. Therefore, the time required for the task switching process is reduced, and the speed of the central processing unit is increased.

【0009】[0009]

【発明の実施の形態】以下、図面を用いて本発明の実施
の形態について説明する。図1は、本発明の実施の形態
に係る中央処理装置のブロック図である。図1におい
て、この実施の形態に係る中央処理装置は、リアル・タ
イムOSで管理される中央処理装置10であって、AL
U(Arithmetic and Logic Unit)等で構成され、各種
の算術演算、論理演算を行う演算部12と、命令をフェ
ッチし、フェッチされた命令をデコードする命令フェッ
チ/デコード部14と、読み込まれたデータや、演算部
12の演算結果を一時的に記憶する複数のレジスタ(レ
ジスタユニット)16と、レジスタ16と外部記憶装置
40の間のデータ転送を制御するレジスタ転送装置18
とで構成されている。演算部12とレジスタユニット1
6は、演算部12からレジスタユニット16にデータを
転送する内部バス(「第1の内部バス」と呼ぶ)20、
およびレジスタユニット16から演算部12にデータを
転送する内部バス(「第2の内部バス」と呼ぶ)22で
接続されている。通常、第2の内部バス22はデータ読
み込みの効率化のため2チャネル用意されている。一
方、レジスタユニット16と外部バス24は、レジスタ
ユニット16から外部バス24にデータを転送する内部
バス(「保存用チャネル」と呼ぶ)26、および外部バ
ス24からレジスタユニット16にデータを転送する内
部バス(「復帰用チャネル」と呼ぶ)で接続されてい
る。そして、レジスタユニット16は、切り替え回路
(「第1の切り替え回路」と呼ぶ)30によって第1の
内部バス20または復帰用チャネル28のいずれか一方
と接続され、切り替え回路(「第2の切り替え回路」と
呼ぶ)32によって第2の内部バス22または保存用チ
ャネル26のいずれか一方と接続される。
Embodiments of the present invention will be described below with reference to the drawings. FIG. 1 is a block diagram of a central processing unit according to an embodiment of the present invention. In FIG. 1, a central processing unit according to this embodiment is a central processing unit 10 managed by a real-time OS,
U (Arithmetic and Logic Unit) and the like, which performs various arithmetic and logical operations, an instruction fetch / decode unit 14 for fetching instructions and decoding the fetched instructions, and read data And a plurality of registers (register units) 16 for temporarily storing the operation results of the operation unit 12, and a register transfer device 18 for controlling data transfer between the registers 16 and the external storage device 40.
It is composed of Operation unit 12 and register unit 1
6, an internal bus (referred to as a “first internal bus”) 20 for transferring data from the arithmetic unit 12 to the register unit 16;
And an internal bus (referred to as a “second internal bus”) 22 for transferring data from the register unit 16 to the operation unit 12. Normally, the second internal bus 22 is provided with two channels for efficient data reading. On the other hand, the register unit 16 and the external bus 24 include an internal bus (referred to as a “storage channel”) 26 for transferring data from the register unit 16 to the external bus 24 and an internal bus 26 for transferring data from the external bus 24 to the register unit 16. They are connected by a bus (called a “return channel”). The register unit 16 is connected to one of the first internal bus 20 and the return channel 28 by a switching circuit (referred to as a “first switching circuit”) 30, and the switching circuit (“the second switching circuit”). 32) is connected to either the second internal bus 22 or the storage channel 26.

【0010】ここで、レジスタ転送装置18には、レジ
スタユニット16のデータ転送を制御する転送制御部3
8が内蔵されている。転送制御部38は、命令フェッチ
/デコード部14からバス使用情報cを受取り、その情
報cに基いて第1の切り替え回路30に制御信号dを、
第2の切り替え回路32に制御信号eを出力し、それら
の切り替え動作を制御する。そして、レジスタユニット
16を復帰用チャネル28または保存用チャネル26に
接続し、レジスタ16と外部記憶装置40との間のデー
タ転送を実行する。転送制御部38は、データ転送が実
行されるレジスタ16を指定する転送フラグレジスタ3
4と、レジスタ16の保存先または復帰元の位置を指定
する転送アドレスレジスタ36とを持っている。転送フ
ラグレジスタ34は、保存用チャネル26に対応するレ
ジスタ「ch1」と、復帰用チャネル28に対応するレ
ジスタ「ch2」とで構成されている。レジスタ34を
構成するレジスタ「ch1」および「ch2」のビット
幅はレジスタ16の数に一致し、さらに、そのビット番
号がレジスタ番号に対応している。したがって、保存ま
たは復帰されるレジスタ16を必要に応じて種々選択す
ることができる。データ転送の実行の有無は各ビットの
状態で示される。たとえばデータ転送が実行されるレジ
スタ16に対応するビットに“1”をセットし、その他
のビットを“0”とすれば良い。転送アドレスレジスタ
36にはデータ転送が実行されるレジスタ16のデータ
の保存先の位置または復帰元の位置が指定される。この
実施の形態では、レジスタ16の値は外部バス24に接
続された外部記憶装置40に保存される。したがって、
転送アドレスレジスタ36には外部記憶装置40内のデ
ータ記憶領域のレジスタ16の保存先または復帰元のア
ドレスが指定されることになる。通常、これら転送フラ
グレジスタ34と転送アドレスレジスタ36の値は、リ
アル・タイムOSによって設定される。
Here, the register transfer unit 18 includes a transfer control unit 3 for controlling data transfer of the register unit 16.
8 is built-in. The transfer control unit 38 receives the bus use information c from the instruction fetch / decode unit 14, and sends a control signal d to the first switching circuit 30 based on the information c.
A control signal e is output to the second switching circuit 32 to control the switching operation thereof. Then, the register unit 16 is connected to the return channel 28 or the save channel 26 to execute data transfer between the register 16 and the external storage device 40. The transfer control unit 38 controls the transfer flag register 3 that specifies the register 16 in which the data transfer is performed.
4 and a transfer address register 36 for designating the storage destination or the return source position of the register 16. The transfer flag register 34 includes a register “ch1” corresponding to the save channel 26 and a register “ch2” corresponding to the return channel 28. The bit widths of the registers “ch1” and “ch2” constituting the register 34 match the number of the registers 16, and their bit numbers correspond to the register numbers. Therefore, the register 16 to be saved or restored can be variously selected as needed. Whether or not data transfer is performed is indicated by the state of each bit. For example, a bit corresponding to the register 16 in which data transfer is performed may be set to “1”, and the other bits may be set to “0”. In the transfer address register 36, the position of the data storage destination or the position of the return source of the register 16 in which the data transfer is performed is designated. In this embodiment, the value of the register 16 is stored in the external storage device 40 connected to the external bus 24. Therefore,
In the transfer address register 36, the address of the storage destination or the return source of the register 16 in the data storage area in the external storage device 40 is specified. Normally, the values of the transfer flag register 34 and the transfer address register 36 are set by the real time OS.

【0011】次に、本発明の実施の形態に係る中央処理
装置10のレジスタ転送装置18の動作について説明す
る。まず、この中央処理装置10の基本的な動作につい
て簡単に説明する。通常、システムに電源が投入される
と、あるいはシステムがリセットされると、中央処理装
置10の外部から所望の命令aが命令フェッチ/デコー
ド部14によってフェッチされる。そして、その命令a
を命令フェッチ/デコード部14はデコードし、その命
令に対応した制御信号を発生し、演算部12に出力す
る。演算部12はその制御信号bに基いて各種の演算を
実行する。その演算の際、必要なデータをレジスタ16
から読み込み、またその演算結果をレジスタ16に保存
する。同様にして、中央処理装置10は所定の命令を逐
次実行していく。
Next, the operation of the register transfer device 18 of the central processing unit 10 according to the embodiment of the present invention will be described. First, a basic operation of the central processing unit 10 will be briefly described. Usually, when the system is powered on or when the system is reset, a desired instruction a is fetched by the instruction fetch / decode unit 14 from outside the central processing unit 10. And the instruction a
Is decoded by the instruction fetch / decode unit 14, generates a control signal corresponding to the instruction, and outputs the control signal to the arithmetic unit 12. The calculation unit 12 performs various calculations based on the control signal b. At the time of the operation, necessary data is stored in the register 16
And the result of the operation is stored in the register 16. Similarly, the central processing unit 10 sequentially executes predetermined instructions.

【0012】次に、レジスタ転送装置18のレジスタ保
存動作について説明する。図2は、レジスタ転送装置1
8のレジスタ保存動作を説明するための図である。図3
は、レジスタ転送装置18のレジスタ保存動作の処理手
順を示すフローチャートである。なお、中央処理装置1
0内のレジスタ16の数は16個であり、転送フラグレ
ジスタ34および転送アドレスレジスタ36はOSが指
定するものとする。図3に示すように、レジスタ転送装
置18は、システムに電源が投入されると、あるいはシ
ステムがリセットされると、保存用チャネル26に対応
する転送フラグレジスタ(ch2)34に対して予め決
められた方向にビットサーチを開始する(ステップS1
01)。システムが動作中は定常的にビットサーチを行
ない、セットされたビットを発見すると、レジスタ転送
装置18はそのセットされたビットに対応するレジスタ
16のデータ転送待機状態となる。図2では、たとえば
ビットサーチが転送フラグレジスタ(ch2)34の最
下位ビット(least significant bit)である右端のビ
ット(ビット「0」)から最上位ビット(most signifi
cant bit)である左端のビット(ビット「15」)に向
かって行われた場合、まず最初にビット2が発見される
(ステップS102YES)。レジスタ転送装置18は
命令フェッチ/デコード回路14からバス使用情報cを
取得し、常時、第1および第2の内部バス20,22、
外部バス24の使用状況を監視している。そして、第2
の内部バス22に空きが生じ(ステップS103YE
S)、さらに外部バス24に空きが生じた場合(ステッ
プS104YES)、レジスタ転送装置18は第2の切
り替え回路32に制御信号eを出力し、レジスタユニッ
ト16に保存用チャネル26を接続する(ステップS1
05)。そして、レジスタ転送装置18は転送フラグレ
ジスタ34のセットされたビット「2」に対応するレジ
スタ(R2)16を選択する(ステップS106)。レ
ジスタ転送装置18は、選択されたレジスタ(R2)1
6の値を保存用チャネル26を介して外部記憶装置40
に転送する。選択されたレジスタ(R2)の値は転送ア
ドレスレジスタ36に示された外部記憶装置40のアド
レスに保存されることになる(ステップS107)。レ
ジスタ(R2)16のデータ転送が終了すると、レジス
タ転送装置18は第2の切り替え回路32に制御信号e
を出力し、レジスタユニット16を第2の内部バス22
に再び接続する(ステップS108)。最後に、転送フ
ラグレジスタ34のビット「2」を“0”にリセットす
る。また、転送アドレスレジスタ36が次にデータ転送
が実行されるレジスタ16の保存先を指すように、転送
アドレスレジスタ36の値が自動的に更新される。たと
えばデータ転送が終わる度に、転送アドレスレジスタ3
6を自動的に繰り上げる、あるいは繰り下げるようにす
れば良い。繰り上げと繰り下げの選択は図2に示すよう
に、転送アドレスレジスタ36に複数の入力の中から1
つを選択するマルチプレクサ42を設け、チャネル番号
によってその選択を行うようにすれば良い。
Next, the register storing operation of the register transfer device 18 will be described. FIG. 2 shows a register transfer device 1
8 is a diagram for explaining a register saving operation of FIG. FIG.
9 is a flowchart showing a processing procedure of a register saving operation of the register transfer device 18. The central processing unit 1
The number of the registers 16 in 0 is 16, and the transfer flag register 34 and the transfer address register 36 are specified by the OS. As shown in FIG. 3, when the system is powered on or the system is reset, the register transfer device 18 determines a transfer flag register (ch2) 34 corresponding to the storage channel 26 in advance. Bit search is started in the set direction (step S1).
01). When the system is in operation, a bit search is constantly performed, and when a set bit is found, the register transfer device 18 enters a data transfer standby state of the register 16 corresponding to the set bit. In FIG. 2, for example, the bit search is performed from the rightmost bit (bit “0”), which is the least significant bit of the transfer flag register (ch2) 34, to the most significant bit (most signifi).
When the operation is performed toward the leftmost bit (bit “15”), which is a cant bit, bit 2 is found first (step S102: YES). The register transfer device 18 obtains the bus use information c from the instruction fetch / decode circuit 14, and always acquires the first and second internal buses 20, 22,
The usage status of the external bus 24 is monitored. And the second
Is available in the internal bus 22 (step S103YE).
S), if the external bus 24 becomes free (step S104 YES), the register transfer device 18 outputs the control signal e to the second switching circuit 32 and connects the storage channel 26 to the register unit 16 (step S104). S1
05). Then, the register transfer device 18 selects the register (R2) 16 corresponding to the set bit “2” of the transfer flag register 34 (Step S106). The register transfer device 18 selects the selected register (R2) 1
6 through the storage channel 26 to the external storage device 40.
Transfer to The value of the selected register (R2) is stored in the address of the external storage device 40 indicated in the transfer address register 36 (step S107). When the data transfer of the register (R2) 16 is completed, the register transfer device 18 sends the control signal e to the second switching circuit 32.
And outputs the register unit 16 to the second internal bus 22.
Is connected again (step S108). Finally, the bit “2” of the transfer flag register 34 is reset to “0”. Further, the value of the transfer address register 36 is automatically updated so that the transfer address register 36 indicates the storage destination of the register 16 where the data transfer is performed next. For example, every time data transfer is completed, the transfer address register 3
6 may be automatically moved up or down. As shown in FIG. 2, selection between carry-up and carry-down is performed by setting the transfer address register 36 to one of a plurality of inputs.
A multiplexer 42 for selecting one may be provided, and the selection may be made according to the channel number.

【0013】そして、転送フラグレジスタ34のビット
がすべて“0”にリセットされると、レジスタ保存動作
が終了し、今度はレジスタ転送装置18によるレジスタ
復帰動作が実行される。
When all the bits of the transfer flag register 34 are reset to "0", the register saving operation is completed, and the register transfer device 18 executes a register return operation.

【0014】次に、レジスタ転送装置18のレジスタ復
帰動作について説明する。図4は、レジスタ転送装置1
8のレジスタ復帰動作を説明するための図である。図5
は、レジスタ転送装置18のレジスタ復帰動作の処理手
順を示すフローチャートである。図5に示すように、レ
ジスタ転送装置18は、システムに電源が投入される
と、あるいはシステムがリセットされると、復帰用チャ
ネル28に対応する転送フラグレジスタ(ch1)34
に対して予め決められた方向にビットサーチを開始する
(ステップS201)。システムが動作中は定常的にビ
ットサーチを行ない、セットされたビットを発見する
と、レジスタ転送装置18はそのセットされたビットに
対応するレジスタ16のデータ転送待機状態となる。図
4では、たとえばビットサーチが転送フラグレジスタ
(ch2)34の最上位ビット(ビット「15」)から
最下位ビット(ビット「0」)に向かって行われた場
合、まず最初にビット15が発見される(ステップS2
02YES)。レジスタ転送装置18は命令フェッチ/
デコード回路14からバス使用情報cを取得し、常時、
第1および第2の内部バス20,22、外部バス24の
使用状況を監視している。そして、第1の内部バス20
に空きが生じ(ステップS203YES)、さらに外部
バス24に空きが生じた場合(ステップS204YE
S)、レジスタ転送装置18は第1の切り替え回路30
に制御信号dを出力し、レジスタユニット16に復帰用
チャネル28を接続する(ステップS205)。そし
て、レジスタ転送装置18は転送フラグレジスタ34の
セットされたビット「15」に対応するレジスタ(R1
5)16を選択する(ステップS206)。レジスタ転
送装置18は、選択されたレジスタ(R15)16の値
を復帰用チャネル28を介して外部記憶装置40から転
送する。選択されたレジスタ(R15)の値は転送アド
レスレジスタ36に示された外部記憶装置40のアドレ
スに保存されている(ステップS207)。レジスタ
(R15)16のデータ転送が終了すると、レジスタ転
送装置18は第1の切り替え回路30に制御信号dを出
力し、レジスタユニット16を第1の内部バス20に再
び接続する(ステップS208)。最後に、転送フラグ
レジスタ34のビット「15」を“0”にリセットす
る。また、転送アドレスレジスタ36が次にデータ転送
が実行されるレジスタ16の保存先を指すように、転送
アドレスレジスタ36の値が自動的に更新される。
Next, the register return operation of the register transfer device 18 will be described. FIG. 4 shows the register transfer device 1
8 is a diagram for explaining a register return operation of FIG. FIG.
9 is a flowchart showing a processing procedure of a register return operation of the register transfer device 18. As shown in FIG. 5, when the system is powered on or the system is reset, the register transfer device 18 transfers the transfer flag register (ch1) 34 corresponding to the return channel 28.
, A bit search is started in a predetermined direction (step S201). When the system is in operation, a bit search is constantly performed, and when a set bit is found, the register transfer device 18 enters a data transfer standby state of the register 16 corresponding to the set bit. In FIG. 4, for example, when a bit search is performed from the most significant bit (bit “15”) to the least significant bit (bit “0”) of transfer flag register (ch2) 34, bit 15 is found first. (Step S2
02YES). The register transfer unit 18 receives the instruction fetch /
The bus usage information c is obtained from the decoding circuit 14, and
The usage status of the first and second internal buses 20, 22 and the external bus 24 is monitored. Then, the first internal bus 20
Is available (step S203 YES), and if an external bus 24 is available (step S204YE).
S), the register transfer device 18 uses the first switching circuit 30
The control signal d is output to the register unit 16 and the return channel 28 is connected to the register unit 16 (step S205). Then, the register transfer device 18 stores the register (R1) corresponding to the set bit “15” of the transfer flag register 34.
5) 16 is selected (step S206). The register transfer device 18 transfers the value of the selected register (R15) 16 from the external storage device 40 via the return channel 28. The value of the selected register (R15) is stored in the address of the external storage device 40 indicated in the transfer address register 36 (Step S207). When the data transfer of the register (R15) 16 is completed, the register transfer device 18 outputs a control signal d to the first switching circuit 30, and connects the register unit 16 to the first internal bus 20 again (step S208). Finally, the bit “15” of the transfer flag register 34 is reset to “0”. Further, the value of the transfer address register 36 is automatically updated so that the transfer address register 36 indicates the storage destination of the register 16 where the data transfer is performed next.

【0015】そして、転送フラグレジスタ34のビット
がすべて“0”にリセットされると、レジスタ復帰動作
が終了し、タスク切り替えが実行されたことになる。
When all the bits of the transfer flag register 34 are reset to "0", the register return operation ends, and the task switching has been executed.

【0016】次に、本発明の実施の形態に係る中央処理
装置10のレジスタ転送装置18の効果を説明する例を
図6に示す。図6は、従来技術によるタスク切り替え時
間と本発明によるタスク切り替え時間の違いを示した図
である。図6に示す例は、タスクAが中断され、タスク
Bが再開される状況を示している。また、横軸はタスク
切り替え処理開始からの経過時間を意味するものとす
る。
Next, FIG. 6 shows an example for explaining the effect of the register transfer device 18 of the central processing unit 10 according to the embodiment of the present invention. FIG. 6 is a diagram showing a difference between the task switching time according to the related art and the task switching time according to the present invention. The example illustrated in FIG. 6 illustrates a situation in which task A is suspended and task B is resumed. The horizontal axis indicates the elapsed time from the start of the task switching process.

【0017】まず、前段の従来技術によるタスク切り替
えでは、タスク切り替え処理が開始すると、中断される
タスクAの情報や各種のリソースの使用状況のチェック
等が行われる(「システム管理」)。そして、中断され
るタスクAのレジスタの値の保存動作が実行される
(「タスクAのレジスタ保存」)。次に、タスクの実行
優先度から次に実行されるべきタスクBが選択される
(「スケジューリング」)。タスクBの選択後、再び
「システム管理」が行われ、その後、今度はタスクBの
レジスタの値の復帰動作が実行される(「タスクBのレ
ジスタ復帰」)。最後に、「システム管理」が行われた
後、タスク切り替え処理が終了する。
First, in the task switching according to the prior art of the prior art, when the task switching process starts, information on the task A to be interrupted and the usage status of various resources are checked ("system management"). Then, the operation of saving the value of the register of the task A to be interrupted is executed (“save the register of the task A”). Next, the task B to be executed next is selected from the task execution priority ("scheduling"). After the task B is selected, “system management” is performed again, and then, the operation of restoring the value of the register of the task B is performed (“restoration of the register of the task B”). Finally, after “system management” is performed, the task switching process ends.

【0018】一方、後段の本発明によるタスク切り替え
では、タスクAのレジスタの保存動作およびタスクBの
レジスタの復帰動作はレジスタ転送装置18によって実
行される。すなわち、本発明によるタスク切り替えで
は、レジスタの保存動作および復帰動作が、中央処理装
置10が実行するその他の処理と、見かけ上並列的に実
行されるため、タスク切り替え時間は全体としては短縮
される(「タスク切り替え時間の短縮」)。図6に示す
ように、タスク切り替え処理が開始すると、OSはタス
クAのレジスタ保存のための転送フラグレジスタ34お
よび転送アドレスレジスタ36の値をそれぞれ設定す
る。そして、中央処理装置10は従来技術と同様「シス
テム管理」、「スケジューリング」を順次実行する。そ
れと並行して、レジスタ転送装置18は、上記のように
バスの使用状況を監視し、バスに空きが生じている期間
を利用してタスクAのレジスタ保存動作を独自に実行す
る。中央処理装置10は、「スケジューリング」によっ
て次に実行されるタスクBが選択されると、直ちに転送
フラグレジスタ34および転送アドレスレジスタ36に
タスクBの復帰動作のための値をそれぞれ設定する。レ
ジスタ転送装置18は転送フラグレジスタ34および転
送アドレスレジスタ36の値によってタスクBの復帰動
作を独自に実行する。そして、中央処理装置10による
「システム管理」およびレジスタ転送装置18による
「タスクBのレジスタ復帰動作」が終了した時点でタス
クBの実行が再開される。
On the other hand, in the subsequent task switching according to the present invention, the register transfer operation of the register A of the task A and the operation of restoring the register of the task B are executed. That is, in the task switching according to the present invention, the register saving operation and the register restoring operation are apparently executed in parallel with other processes executed by the central processing unit 10, so that the task switching time is shortened as a whole. ("Reduce task switching time"). As shown in FIG. 6, when the task switching process starts, the OS sets the values of the transfer flag register 34 and the transfer address register 36 for saving the register of the task A. Then, the central processing unit 10 sequentially executes “system management” and “scheduling” as in the related art. At the same time, the register transfer device 18 monitors the bus use status as described above, and executes the register saving operation of the task A independently using the period in which the bus is free. When the next task B to be executed is selected by “scheduling”, the central processing unit 10 immediately sets a value for the return operation of the task B in the transfer flag register 34 and the transfer address register 36, respectively. The register transfer device 18 executes the return operation of the task B independently based on the values of the transfer flag register 34 and the transfer address register 36. Then, when the “system management” by the central processing unit 10 and the “task B register return operation” by the register transfer unit 18 are completed, the execution of the task B is resumed.

【0019】[0019]

【発明の効果】本発明によれば、タスク切り替えに要す
る時間を短縮することができる中央処理装置を実現でき
る。
According to the present invention, a central processing unit capable of reducing the time required for task switching can be realized.

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

【図1】本発明の実施の形態に係る中央処理装置のブロ
ック図である。
FIG. 1 is a block diagram of a central processing unit according to an embodiment of the present invention.

【図2】本発明の実施の形態に係るレジスタ転送装置の
レジスタ保存動作を説明するための図である。
FIG. 2 is a diagram for explaining a register storing operation of the register transfer device according to the embodiment of the present invention.

【図3】本発明の実施の形態に係るレジスタ転送装置の
レジスタ保存動作の処理手順を示すフローチャートであ
る。
FIG. 3 is a flowchart showing a processing procedure of a register saving operation of the register transfer device according to the embodiment of the present invention.

【図4】本発明の実施の形態に係るレジスタ転送装置の
レジスタ復帰動作を説明するための図である。
FIG. 4 is a diagram for explaining a register return operation of the register transfer device according to the embodiment of the present invention;

【図5】本発明の実施の形態に係るレジスタ転送装置の
レジスタ保存動作の処理手順を示すフローチャートであ
る。
FIG. 5 is a flowchart showing a processing procedure of a register saving operation of the register transfer device according to the embodiment of the present invention.

【図6】従来技術によるタスク切り替え時間と本発明に
よるタスク切り替え時間の違いを示した図である。
FIG. 6 is a diagram showing a difference between a task switching time according to the related art and a task switching time according to the present invention.

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

10 中央処理装置 12 演算部 14 命令フェッチ/デコード部 16 レジスタユニット 18 レジスタ転送装置 20 第1の内部バス 22 第2の内部バス 24 外部バス 26 保存用チャネル 28 復帰用チャネル 30 第1の切り替え回路 32 第2の切り替え回路 34 転送フラグレジスタ 36 転送アドレスレジスタ 38 転送制御部 40 外部記憶装置 42 マルチプレクサ Reference Signs List 10 central processing unit 12 arithmetic unit 14 instruction fetch / decode unit 16 register unit 18 register transfer device 20 first internal bus 22 second internal bus 24 external bus 26 storage channel 28 return channel 30 first switching circuit 32 Second switching circuit 34 Transfer flag register 36 Transfer address register 38 Transfer control unit 40 External storage device 42 Multiplexer

Claims (6)

【特許請求の範囲】[Claims] 【請求項1】 各種の演算処理を行う演算部と、 命令をフェッチ/デコードし、前記演算部を制御する命
令フェッチ/デコード部と、 前記演算部の演算処理に必要なデータや前記演算部の演
算結果を一時的に記憶する複数の記憶回路で構成された
一時記憶部と、 前記一時記憶部および外部バスに接続され、前記一時記
憶部と前記外部バス間のデータ転送を制御するレジスタ
転送装置であって、前記外部バスおよび前記演算部と前
記一時記憶部間の内部バスに空きが生じた場合に前記デ
ータ転送を逐次実行するレジスタ転送部とを有すること
を特徴とする中央処理装置。
An arithmetic unit for performing various arithmetic processing; an instruction fetch / decode unit for fetching / decoding an instruction and controlling the arithmetic unit; A temporary storage unit composed of a plurality of storage circuits for temporarily storing operation results; a register transfer device connected to the temporary storage unit and an external bus, for controlling data transfer between the temporary storage unit and the external bus A central processing unit, comprising: a register transfer unit that sequentially executes the data transfer when an empty space occurs in the external bus and the internal bus between the arithmetic unit and the temporary storage unit.
【請求項2】 前記レジスタ転送部は、前記中央処理装
置が現在実行している処理を中断し、別の処理を開始す
る場合に、中断される処理の状態を示す前記一時記憶部
の値を外部に保存した後、開始される処理の状態を示す
前記一時記憶部の値を外部から復帰することを特徴とす
る請求項1に記載の中央処理装置。
2. The method according to claim 1, wherein the register transfer unit interrupts a process currently being executed by the central processing unit and, when starting another process, stores the value of the temporary storage unit indicating a state of the interrupted process. 2. The central processing unit according to claim 1, wherein a value stored in the temporary storage unit, which indicates a state of a process to be started, is externally restored after being stored outside.
【請求項3】 前記レジスタ転送部は、前記一時記憶部
から前記外部バスにデータを転送し、前記一時記憶部の
値を保存する第1のチャネルと、前記外部バスから前記
一時記憶部にデータを転送し、前記一時記憶部の値を復
帰する第2のチャネルとを備え、前記一時記憶部の保存
と復帰は同時に実行されないことを特徴とする請求項2
に記載の中央処理装置。
3. The first transfer unit for transferring data from the temporary storage unit to the external bus and storing a value in the temporary storage unit, and transferring the data from the external bus to the temporary storage unit. And a second channel for transferring the value of the temporary storage unit and restoring the value of the temporary storage unit, wherein saving and restoring of the temporary storage unit are not performed simultaneously.
A central processing unit according to item 1.
【請求項4】 前記レジスタ転送部は、保存または復帰
される前記複数の記憶回路の少なくとも一つを指定する
第1の指定部と、前記指定された記憶回路の保存先また
は復帰元を指定する第2の指定部とを備えることを特徴
とする請求項3に記載の中央処理装置。
4. The register transfer unit specifies a first specification unit that specifies at least one of the plurality of storage circuits to be stored or restored, and a storage destination or a restoration source of the specified storage circuit. The central processing unit according to claim 3, further comprising a second designation unit.
【請求項5】 前記外部バスに外部記憶装置が接続さ
れ、前記保存先または復帰元は前記外部記憶装置内のデ
ータ格納領域であることを特徴とする請求項4に記載の
中央処理装置。
5. The central processing unit according to claim 4, wherein an external storage device is connected to the external bus, and the storage destination or the restoration source is a data storage area in the external storage device.
【請求項6】 前記レジスタ転送部は、前記一時記憶部
の保存時には前記一時記憶部を前記演算部から切り離
し、前記第1のチャネルに接続すると共に、前記一時記
憶部の復帰時には前記一時記憶部を前記演算部から切り
離し、前記第2のチャネルに接続することを特徴とする
請求項3に記載の中央処理装置。
6. The register transfer section disconnects the temporary storage section from the arithmetic section when storing the temporary storage section, connects the temporary storage section to the first channel, and stores the temporary storage section when returning the temporary storage section. 4. The central processing unit according to claim 3, wherein the central processing unit is separated from the arithmetic unit and connected to the second channel.
JP25801399A 1999-09-10 1999-09-10 Central processing unit Pending JP2001084151A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP25801399A JP2001084151A (en) 1999-09-10 1999-09-10 Central processing unit

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP25801399A JP2001084151A (en) 1999-09-10 1999-09-10 Central processing unit

Publications (1)

Publication Number Publication Date
JP2001084151A true JP2001084151A (en) 2001-03-30

Family

ID=17314325

Family Applications (1)

Application Number Title Priority Date Filing Date
JP25801399A Pending JP2001084151A (en) 1999-09-10 1999-09-10 Central processing unit

Country Status (1)

Country Link
JP (1) JP2001084151A (en)

Similar Documents

Publication Publication Date Title
US7836291B2 (en) Method, medium, and apparatus with interrupt handling in a reconfigurable array
JP4610593B2 (en) Dual thread processor
US5613114A (en) System and method for custom context switching
US9158574B2 (en) Handling interrupts in data processing
US20030014472A1 (en) Thread ending method and device and parallel processor system
US9043806B2 (en) Information processing device and task switching method
JPH09212371A (en) Register saving and restoring system
TWI426451B (en) Work processing device
US4851992A (en) Register/saving/restoring system for saving and restoring data in a register of a slave processor
JP2008152409A (en) Semiconductor integrated circuit
JP2003058381A (en) Processor realizing exception processing setting by program
JP2001084151A (en) Central processing unit
JP3767529B2 (en) Microprocessor
JP2876791B2 (en) Exception handling device and exception handling method
JP2002312302A (en) Peripheral device
JP2008225710A (en) Computer system and process-switching method used in the system
JPWO2004023291A1 (en) Information processing equipment
CN114579264A (en) Processing apparatus, processing system, and processing method
JPS60250438A (en) Information processor
JPH02173828A (en) Interruption process system
JPH03182945A (en) Transfer system for data in main storage
JPS58142451A (en) Interruption control system
JPH036758A (en) Microprocessor
JPH08221271A (en) Pipeline processor
JPH03184127A (en) Register saving control method