JP2001154859A - Digital processor - Google Patents

Digital processor

Info

Publication number
JP2001154859A
JP2001154859A JP33453199A JP33453199A JP2001154859A JP 2001154859 A JP2001154859 A JP 2001154859A JP 33453199 A JP33453199 A JP 33453199A JP 33453199 A JP33453199 A JP 33453199A JP 2001154859 A JP2001154859 A JP 2001154859A
Authority
JP
Japan
Prior art keywords
cache memory
task
interrupt
microcomputer
storage device
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
JP33453199A
Other languages
Japanese (ja)
Inventor
Shinjiro Yamada
真二郎 山田
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.)
Hitachi Ltd
Original Assignee
Hitachi Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Hitachi Ltd filed Critical Hitachi Ltd
Priority to JP33453199A priority Critical patent/JP2001154859A/en
Publication of JP2001154859A publication Critical patent/JP2001154859A/en
Pending legal-status Critical Current

Links

Landscapes

  • Memory System Of A Hierarchy Structure (AREA)

Abstract

PROBLEM TO BE SOLVED: To quicken the responding speed at the generation of interruption and at the request for memory access of a microcomputer in a hierarchical storage system equipped with a real time OS. SOLUTION: This microcomputer in a hierarchical storage system equipped with a real time OS is provided with a function for executing a task which is highly likely to be executed afterwards in an idle time without any task to be executed, that is, the processing of steps ST3-ST4 for transferring an interruption handler from a main storage device to a cache memory or preparation processing related with a prescribed task, that is, the processing of steps ST5-ST6 for transferring dirty data in the cache memory to the main storage device in advance.

Description

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

【0001】[0001]

【発明の属する技術分野】この発明はデジタル処理装置
に関し、例えば、階層記憶方式をとるマイクロコンピュ
ータの割り込み等に対する応答速度の高速化に利用して
特に有効な技術に関するものである。
BACKGROUND OF THE INVENTION 1. Field of the Invention The present invention relates to a digital processing apparatus, and more particularly to a technique which is particularly effective for use in increasing the response speed to an interrupt or the like of a microcomputer employing a hierarchical storage system.

【0002】[0002]

【従来の技術】ストアドプログラム方式をとるマイクロ
コンピュータ等のデジタル処理装置があり、このような
デジタル処理装置の基本ソフトとなってアプリケーショ
ンプログラム等の実行を制御するオペレーティングシス
テムがある。また、マイクロコンピュータ等の処理能力
を高める一つの手段として、例えば主記憶装置に比べて
動作速度の速いキャッシュメモリを中央処理ユニット
(CPU)と同一チップ内に設けるいわゆる階層記憶方
式が知られている。
2. Description of the Related Art There is a digital processing device such as a microcomputer employing a stored program system, and an operating system which controls the execution of application programs and the like as basic software of such a digital processing device. As one means for improving the processing capability of a microcomputer or the like, a so-called hierarchical storage system in which a cache memory having a higher operation speed than a main storage device is provided in the same chip as a central processing unit (CPU) is known. .

【0003】[0003]

【発明が解決しようとする課題】本願発明者等は、この
発明に先立って、マイクロコンピュータ用のオペレーテ
ィングシステムの開発に携わり、次の問題点に気付い
た。すなわち、このマイクロコンピュータは、上記階層
記憶方式をとり、比較的動作速度の速いキャッシュメモ
リと、比較的動作速度の遅い主記憶装置とを備える。
Prior to the present invention, the present inventors were involved in the development of an operating system for a microcomputer and noticed the following problems. That is, this microcomputer adopts the above-mentioned hierarchical storage method, and includes a cache memory having a relatively high operation speed and a main storage device having a relatively low operation speed.

【0004】マイクロコンピュータの基本ソフトとなる
オペレーティングシステム、つまりその実質的な実行手
段となる中央処理ユニット(CPU)は、例えば図6に
示されるように、ステップST21により実行すべきタ
スクがないことを判定した時点でアイドル状態となり、
ステップST23により例えば割り込み発生が判定され
た時点でアイドル状態から離脱する。そして、ステップ
ST24により、割り込み解析処理のための割込みハン
ドラがキャッシュメモリ内にあるかどうかを判定した
後、これがキャッシュメモリ内になくミスヒットした場
合は、ステップST25により主記憶装置から割込みハ
ンドラを読み出し、キャッシュメモリに転写する。その
後、ステップST26による割り込み解析処理が行わ
れ、割り込み要因に対応した例えばタスクDに関する処
理が開始される。
An operating system as basic software of the microcomputer, that is, a central processing unit (CPU) as its substantial execution means, for example, as shown in FIG. 6, confirms that there is no task to be executed in step ST21. It becomes idle at the time of judgment,
At step ST23, for example, when it is determined that an interrupt has occurred, the CPU leaves the idle state. After determining in step ST24 whether an interrupt handler for interrupt analysis processing is in the cache memory, if this is not in the cache memory and a mishit occurs, the interrupt handler is read from the main storage device in step ST25. Is transferred to the cache memory. Thereafter, an interrupt analysis process in step ST26 is performed, and a process related to, for example, the task D corresponding to the interrupt factor is started.

【0005】一方、ステップST27によるタスクDの
処理が開始され、例えば中央処理ユニットからメモリア
クセス要求があると、ステップST28により、キャッ
シュメモリ内にダーティデータ、つまり中央処理ユニッ
ト等によって書き換えられ、かつ未だ主記憶装置の対応
するアドレスが書き換えられていないデータがあるかど
うかの判定が行われる。その結果、キャッシュメモリ内
にダーティデータがない場合、ステップST30による
メモリアクセスが行われるが、ダーティデータがある場
合、ステップST29によって主記憶装置内の対応する
アドレスを書き換えた後、ステップST30によるメモ
リアクセスが行われる。
On the other hand, when the processing of task D in step ST27 is started and, for example, there is a memory access request from the central processing unit, in step ST28 the dirty data in the cache memory, that is, the central processing unit, etc. It is determined whether there is data whose corresponding address in the main storage device has not been rewritten. As a result, if there is no dirty data in the cache memory, the memory access is performed in step ST30. If there is dirty data, the corresponding address in the main storage device is rewritten in step ST29, and then the memory access is performed in step ST30. Is performed.

【0006】つまり、このオペレーティングシステム、
つまりその実質的な実行手段となる中央処理ユニット
は、図7に再掲されるように、実行すべきタスクがない
アイドル状態ではその制御動作を完全に停止し、割り込
み解析処理IPに必要なキャッシュメモリへの割込みハ
ンドラ転写処理IHや、主記憶装置に対するダーティデ
ータ転写処理DTは、割り込み要求やメモリアクセス要
求が生じた時点でその都度行われる。このため、割り込
み解析処理IPが開始され、あるいはメモリアクセスが
開始されるまでに比較的長い時間が必要となり、マイク
ロコンピュータ及びそのオペレーティングシステムとし
ての応答速度が遅くなる。
That is, this operating system,
That is, as shown in FIG. 7, the central processing unit, which is the substantial execution means, completely stops the control operation in the idle state where there is no task to be executed, and sets the cache memory necessary for the interrupt analysis processing IP. Transfer processing IH to the interrupt handler and dirty data transfer processing DT to the main storage device are performed each time an interrupt request or a memory access request occurs. Therefore, a relatively long time is required until the interrupt analysis processing IP is started or the memory access is started, and the response speed of the microcomputer and its operating system is reduced.

【0007】この発明の目的は、例えばリアルタイムO
Sを備えかつ階層記憶方式をとるマイクロコンピュータ
等の割り込み発生時及びメモリアクセス要求発生等にお
ける応答速度を高速化することにある。
An object of the present invention is to provide, for example, a real-time O
An object of the present invention is to increase the response speed when an interruption occurs in a microcomputer or the like that employs a hierarchical storage system and has a memory access request.

【0008】この発明の前記ならびにその他の目的と新
規な特徴は、この明細書の記述及び添付図面から明らか
になるであろう。
[0008] The above and other objects and novel features of the present invention will become apparent from the description of this specification and the accompanying drawings.

【0009】[0009]

【課題を解決するための手段】本願において開示される
発明のうち代表的なものの概要を簡単に説明すれば、次
の通りである。すなわち、リアルタイムOSを備えかつ
階層記憶方式をとるマイクロコンピュータ等において、
実行すべきタスクがないアイドル時、以後実行される確
率の高いタスク、つまり例えば割り込み解析のための割
込みハンドラを主記憶装置からキャッシュメモリに転写
する処理や、所定のタスクに関する準備処理、つまり例
えばキャッシュメモリ内にあるダーティデータを主記憶
装置に転写する処理などを先行して実行する機能を持た
せる。
The following is a brief description of an outline of a typical invention among the inventions disclosed in the present application. That is, in a microcomputer having a real-time OS and employing a hierarchical storage method,
When there is no task to be executed at the time of idle, a task having a high probability of being executed thereafter, for example, a process of transferring an interrupt handler for interrupt analysis from the main storage device to the cache memory, or a preparation process for a predetermined task, that is, for example, a cache It has a function of executing in advance the process of transferring dirty data in the memory to the main storage device.

【0010】上記手段によれば、例えば割り込み発生
時、割込みハンドラをキャッシュメモリに読み込むこと
なく、直ちに割り込み解析処理を開始することができる
とともに、メモリアクセス要求発生時には、ダーティデ
ータを主記憶装置に転写することなく、直ちにメモリア
クセスを開始することができる。この結果、リアルタイ
ムOSひいてはこれを備えるマイクロコンピュータ等の
割り込み発生時及びメモリアクセス要求発生時における
応答時間を短縮することができる。
According to the above means, for example, when an interrupt occurs, the interrupt analysis process can be started immediately without reading the interrupt handler into the cache memory, and when a memory access request occurs, the dirty data is transferred to the main storage device. Without starting, the memory access can be started immediately. As a result, it is possible to reduce the response time when an interrupt occurs in the real-time OS, and in addition, when a microcomputer or the like including the real-time OS and a memory access request occurs.

【0011】[0011]

【発明の実施の形態】図1には、この発明が適用された
マイクロコンピュータ(デジタル処理装置)のリアルタ
イムOS(オペレーティングシステム)を含む制御系統
を説明するための一実施例の説明図が示され、図2に
は、その記憶階層を説明するための一実施例の説明図が
示されている。これらの図をもとに、まずこの実施例の
マイクロコンピュータの制御系統及び記憶階層の概要に
ついて説明する。
DESCRIPTION OF THE PREFERRED EMBODIMENTS FIG. 1 is an explanatory diagram of one embodiment for explaining a control system including a real-time OS (operating system) of a microcomputer (digital processing device) to which the present invention is applied. FIG. 2 is an explanatory diagram of an embodiment for explaining the storage hierarchy. First, an outline of a control system and a storage hierarchy of the microcomputer of this embodiment will be described with reference to these drawings.

【0012】図1において、この実施例のマイクロコン
ピュータは、ストアドプログラム方式をとり、制御系統
の中心となる中央処理ユニットCPUや図示されない記
憶装置を含むハードウェア1をその基本構造体とする。
また、そのソフトウェアは、基本ソフトとなるオペレー
ティングシステム2と、各種の制御プログラム又はアプ
リケーションプログラム等からなるn個のタスクつまり
タスク31〜タスク3nと、割り込み解析のための割込
みハンドラ4とを含んでなる。このうち、オペレーティ
ングシステム2は、その核となるカーネルを含み、タス
ク31〜タスク3nは、カーネルによってその実行が制
御・統轄される。
In FIG. 1, the microcomputer of this embodiment adopts a stored program system, and has a basic structure of a hardware 1 including a central processing unit CPU as a center of a control system and a storage device (not shown).
The software includes an operating system 2 serving as basic software, n tasks including various control programs or application programs, that is, tasks 31 to 3n, and an interrupt handler 4 for interrupt analysis. . Of these, the operating system 2 includes a kernel as its core, and the execution of the tasks 31 to 3n is controlled and controlled by the kernel.

【0013】なお、特に制限されないが、割込みハンド
ラ4は、通常動作時、割り込み要求を受け付けたハード
ウェア1の中央処理ユニットCPUによって直接キャッ
シュメモリ内に読み出され、実行されるが、後述するア
イドル時には、オペレーティングシステム2のカーネル
による指示を受けてキャッシュメモリ内に読み出され
る。言うまでもなく、キャッシュメモリ内に割込みハン
ドラ4が存在するかどうかの判定や、その主記憶装置か
らキャッシュメモリに対する読み込みは、ハードウェア
1の図示されないキャッシュメモリ制御部によって行わ
れる。
Although not particularly limited, during normal operation, the interrupt handler 4 is read directly into the cache memory by the central processing unit CPU of the hardware 1 that has received the interrupt request and executed, but is not described later. Sometimes, the instruction is read into the cache memory in response to an instruction from the kernel of the operating system 2. Needless to say, whether or not the interrupt handler 4 exists in the cache memory and reading from the main storage device to the cache memory are performed by a cache memory control unit (not shown) of the hardware 1.

【0014】ところで、この実施例のマイクロコンピュ
ータは、いわゆる階層記憶方式をとり、その記憶装置1
2は、図2に示されるように、例えばスタティック型R
AM(ランダムアクセスメモリ)等の比較的動作速度の
速いメモリからなるキャッシュメモリ121と、例えば
ダイナミック型RAM,EEPROM(電気的に消去・
書き換え可能なROM)あるいはマスクROM(リード
オンリメモリ)等の比較的動作速度の遅いメモリからな
る主記憶装置122と、例えば磁気ディスクや光ディス
ク等からなる大容量の補助記憶装置123とを含む。
The microcomputer of this embodiment employs a so-called hierarchical storage system, and its storage device 1
2 is, for example, as shown in FIG.
A cache memory 121 composed of a memory having a relatively high operation speed such as an AM (random access memory) and a dynamic RAM, an EEPROM (electrically erased /
It includes a main storage device 122 composed of a memory having a relatively low operation speed such as a rewritable ROM) or a mask ROM (read only memory), and a large-capacity auxiliary storage device 123 composed of, for example, a magnetic disk or an optical disk.

【0015】前述のように、マイクロコンピュータのハ
ードウェア1は、キャッシュメモリ制御部を備え、この
キャッシュメモリ制御部は、メモリアクセス要求を受け
て、まずアクセス要求のあったメモリアドレスに対応す
るプログラム又はデータ等がキャッシュメモリ内に残さ
れているかどうかを判定する。その結果、キャッシュメ
モリ内にあっていわゆるヒットした場合、そのまま指定
されたプログラム又はデータを中央処理ユニットCPU
等に読み出し、又はこれを書き換えるが、対応するプロ
グラム又はデータがキャッシュメモリ内になくいわゆる
ミスヒットした場合、これを所定の単位で主記憶装置1
22から読み出し、キャッシュメモリ121に転写した
後、対応する処理を開始させる。
As described above, the hardware 1 of the microcomputer includes the cache memory control unit. The cache memory control unit receives the memory access request, and first receives a program or a program corresponding to the memory address requested to be accessed. It is determined whether data or the like is left in the cache memory. As a result, when a so-called hit is found in the cache memory, the designated program or data is directly transferred to the central processing unit CPU.
If the corresponding program or data does not exist in the cache memory and a so-called mishit occurs, it is read in a predetermined unit in the main storage device 1.
After reading from the cache memory 121 and transferring it to the cache memory 121, a corresponding process is started.

【0016】一方、中央処理ユニットCPUによる新し
いメモリアクセス要求は、上記のように、キャッシュメ
モリ121の書き換えをともなう場合があり、もしキャ
ッシュメモリ内にダーティデータ、つまりキャッシュメ
モリ内で書き換えを受け、しかも主記憶装置122の対
応するアドレスの書き換えが未だ終了していないデータ
があった場合、これらのデータが誤消去され、最新情報
が保持されない危険性がある。このため、上記キャッシ
ュメモリ制御部は、メモリアクセス要求を受けた時点
で、予めキャッシュメモリ内の所定のフラグをもとにダ
ーティデータの有無を判定し、ダーティデータが存在す
る場合にはこれを主記憶装置122の対応するアドレス
に転写する機能を併せ持つ。
On the other hand, a new memory access request by the central processing unit CPU may involve rewriting of the cache memory 121 as described above. If the cache memory 121 receives dirty data, ie, rewrite in the cache memory, If there is data for which the rewriting of the corresponding address in the main storage device 122 has not been completed yet, there is a risk that these data are erroneously erased and the latest information is not retained. For this reason, the cache memory control unit determines in advance whether or not dirty data exists based on a predetermined flag in the cache memory at the time of receiving the memory access request. It also has a function of transferring data to a corresponding address in the storage device 122.

【0017】図3には、図1のマイクロコンピュータの
アイドル時の処理手順を説明するための一実施例の処理
フロー図が示され、図4には、そのアイドル時の動作を
説明するための一実施例のタイミングチャートが示され
ている。また、図5には、図1のマイクロコンピュータ
のオペレーティングシステムのC言語による記述形式を
説明するための一実施例の部分的な説明図が示されてい
る。これらの図をもとに、この実施例のマイクロコンピ
ュータ及びそのリアルタイムOSによるアイドル時の処
理手順と動作の概要ならびにその特徴について説明す
る。
FIG. 3 is a flow chart showing an operation of the microcomputer shown in FIG. 1 at the time of idling according to an embodiment. FIG. 4 is a flowchart showing the operation of the microcomputer at the time of idling. A timing chart of one embodiment is shown. FIG. 5 is a partial explanatory diagram of one embodiment for describing a description format in C language of the operating system of the microcomputer in FIG. With reference to these figures, an outline of the processing procedure and operation of the microcomputer of this embodiment and its real-time OS at the time of idling and the features thereof will be described.

【0018】なお、アイドル状態とは、マイクロコンピ
ュータの中央処理ユニットCPU、つまりはオペレーテ
ィングシステム、すなわちそのカーネルが実行すべき又
は実行を制御すべきタスクがない状態を指すが、本明細
書の記述では、割込みハンドラのキャッシュメモリに対
する読み込みや、ダーティデータの主記憶装置に対する
書き込みが行われる期間もアイドル状態に含まれるもの
とした。以下、オペレーティングシステムのカーネルか
らみた形で、具体的説明を進める。
Note that the idle state refers to a state in which the central processing unit CPU of the microcomputer, that is, the operating system, that is, the kernel has no tasks to execute or to control the execution, but in the description of this specification, The period during which the interrupt handler reads the cache memory and writes the dirty data to the main storage device is also included in the idle state. Hereinafter, a specific description will be given from the viewpoint of the kernel of the operating system.

【0019】図3において、オペレーティングシステム
のカーネルは、ステップST1により、実行すべきタス
クがあるかどうかを判定し、実行すべきタスクがある場
合、ステップST2によってこれを実行すべく制御す
る。しかし、ステップST1で実行すべきタスクがない
と判定した場合、アイドル状態となる。
In FIG. 3, the kernel of the operating system determines in step ST1 whether there is a task to be executed, and if there is a task to be executed, controls to execute this task in step ST2. However, when it is determined in step ST1 that there is no task to be executed, an idle state is set.

【0020】この実施例において、アイドル状態となっ
たオペレーティングシステムのカーネルは、直ちに制御
動作を停止せず、まずステップST3により、キャッシ
ュメモリ制御部を起動して、これまでにキャッシュメモ
リ内に割込みハンドラが読み込まれ、保存されていない
かどうかを判定する。その結果、キャッシュメモリ内に
割込みハンドラが残存し、ヒットした場合、ステップS
T5に処理を移行するが、キャッシュメモリ内に割込み
ハンドラがなくミスヒットした場合は、ステップST4
により主記憶装置内にある割込みハンドラを読み出し、
キャッシュメモリに転写した後、ステップST5の処理
に移行する。
In this embodiment, the kernel of the operating system in the idle state does not immediately stop the control operation. First, in step ST3, the cache memory control unit is activated, and the interrupt handler is previously stored in the cache memory. Is read and it is determined whether or not it has been saved. As a result, if an interrupt handler remains in the cache memory and a hit occurs, step S
The process proceeds to T5. If there is no interrupt handler in the cache memory and a miss occurs, the process proceeds to step ST4.
Reads the interrupt handler in the main memory,
After the transfer to the cache memory, the process proceeds to step ST5.

【0021】なお、この実施例のマイクロコンピュータ
のオペレーティングシステムは、例えばC言語を用いて
記述され、カーネルアイドル時における割込みハンドラ
等のキャッシュメモリに対する転写処理は、例えば図5
(a)に示されるような形式で記述される。また、この
とき使用されるテーブルの構造は、例えば図5(b)に
示されるような形式で記述される。図5(a)の実施例
において、テーブル(FETCH TBL)は、10個
の領域からなるものとされる。
The operating system of the microcomputer of this embodiment is described using, for example, the C language, and the process of transferring the interrupt handler and the like to the cache memory when the kernel is idle is performed, for example, as shown in FIG.
It is described in a format as shown in FIG. The structure of the table used at this time is described, for example, in a format as shown in FIG. In the embodiment shown in FIG. TBL) consists of ten regions.

【0022】ステップST5に処理を移したカーネル
は、キャッシュメモリ制御部を再度起動し、キャッシュ
メモリの所定のフラグをもとにキャッシュメモリ内にダ
ーティデータが残されているかどうか判定する。その結
果、キャッシュメモリ内にダーティデータが残されてい
ない場合、ステップST6の処理を飛び越して何ら制御
動作を行わない本来のアイドル状態となるが、キャッシ
ュメモリ内にダーティデータが残されている場合は、ス
テップST6によりダーティデータを主記憶装置の対応
するアドレスに書き込んだ後、本来のアイドル状態とな
る。
The kernel, which has shifted the processing to step ST5, activates the cache memory control unit again and determines whether dirty data is left in the cache memory based on a predetermined flag of the cache memory. As a result, if no dirty data is left in the cache memory, the process proceeds to step ST6, and the control enters an original idle state in which no control operation is performed. However, if dirty data is left in the cache memory, After the dirty data is written to the corresponding address in the main storage device in step ST6, the device enters the original idle state.

【0023】なお、キャッシュメモリ内にあるダーティ
データを主記憶装置に転写するための処理が、C言語に
より、前記図5(a)又は(b)と同様な形式で記述さ
れるものであることは言うまでもない。
The process for transferring the dirty data in the cache memory to the main storage device is described in C language in a format similar to that of FIG. 5A or 5B. Needless to say.

【0024】本来のアイドル状態となったカーネル、つ
まり中央処理ユニットCPUは、ステップST7によ
り、図示されない割り込み要求フラグによる割り込み要
求発生の有無を判定し、何らかの割り込み要求があるま
でアイドル状態を持続する。そして、割り込み要求の発
生を受けてアイドル状態から離脱するが、キャッシュメ
モリには、すでに前記ステップST3によって割込みハ
ンドラが読み込まれているため、キャッシュメモリ制御
部では、キャッシュメモリのヒットが判定され、直ちに
ステップST8による割り込み解析処理を開始される。
In step ST7, the kernel that has originally entered the idle state, that is, the central processing unit CPU, determines whether or not an interrupt request has been generated by an interrupt request flag (not shown), and maintains the idle state until some interrupt request occurs. Then, when the interrupt request is generated, the CPU leaves the idle state. However, since the interrupt handler has already been read into the cache memory in step ST3, the cache memory control unit determines the cache memory hit and immediately The interrupt analysis processing in step ST8 is started.

【0025】一方、ステップST8による割り込み解析
結果を受けて、カーネルは、割り込み要因に対応した例
えばタスクDに関する処理を開始させる。また、その間
に中央処理ユニットCPU等からメモリアクセス要求が
あった場合、カーネルはキャッシュメモリ制御部に対し
てダーティデータ転写処理を指示する。しかし、キャッ
シュメモリ内のダーティデータは、すでに前記ステップ
ST6によって主記憶装置の対応するアドレスに転写さ
れているため、キャッシュメモリ制御部は、ダーティデ
ータはないものと判定し、直ちにステップST10によ
るメモリアクセスを実行する。さらに、カーネルは、ス
テップST11によるタスクD処理の終了を受けて、次
の処理の実行又はアイドル状態に移行する。
On the other hand, upon receiving the result of the interrupt analysis in step ST8, the kernel starts processing relating to, for example, task D corresponding to the interrupt factor. If a memory access request is received from the central processing unit CPU or the like during that time, the kernel instructs the cache memory control unit to perform dirty data transfer processing. However, since the dirty data in the cache memory has already been transferred to the corresponding address in the main storage device in step ST6, the cache memory control unit determines that there is no dirty data, and immediately proceeds to the memory access in step ST10. Execute Further, upon completion of the task D process in step ST11, the kernel executes the next process or shifts to an idle state.

【0026】マイクロコンピュータのオペレーティング
システムのカーネルのアイドル時における制御手順を、
さらに図4をもとに時系列的に説明する。
The control procedure when the microcomputer operating system kernel is idle is as follows:
Further, a description will be given in chronological order based on FIG.

【0027】図4において、中央処理ユニットCPUつ
まりオペレーティングシステムのカーネルは、まずカー
ネル処理K11により、例えばタスクAを実行するため
の準備処理を行った後、タスクA処理TA1を起動す
る。また、その終了を受けて、カーネル処理K12によ
り、タスクA処理TA1に関する終結処理と、タスクB
を実行するための準備処理を行った後、タスクB処理T
Bを起動する。さらに、タスクB処理TBの終了を受け
て、カーネル処理K13により、タスクCの準備処理を
行った後、タスクC処理TCを起動する。
In FIG. 4, the central processing unit CPU, that is, the kernel of the operating system first performs, for example, a preparation process for executing the task A by the kernel process K11 and then starts the task A process TA1. In response to the termination, the kernel process K12 terminates the task A process TA1 and terminates the task B process.
After performing the preparation process for executing the task B, the task B process T
Start B. Further, in response to the end of the task B process TB, the kernel process K13 prepares the task C, and then starts the task C process TC.

【0028】カーネルは、タスクC処理TCの終了を受
けた時点で、他に実行すべきタスクがないことを判定
し、アイドルとなるが、本来のアイドル状態となる前
に、まずカーネル処理K14により、キャッシュメモリ
に割込みハンドラを読み込むための準備処理を行った
後、キャッシュメモリ制御部による割込みハンドラ転写
処理IHを起動する。このとき、キャッシュメモリ制御
部は、前記したように、キャッシュメモリ内に以前読み
込まれた割込みハンドラが残されていないかどうかを判
定し、残されていない場合はこれを主記憶装置から読み
出し、キャッシュメモリに転写する。そして、キャッシ
ュメモリに対する割込みハンドラの読み込みが終了した
時点で、カーネルにその旨を報告する。
When the kernel receives the end of the task C processing TC, the kernel determines that there is no other task to be executed, and enters an idle state. After performing a preparation process for reading the interrupt handler into the cache memory, the cache memory control unit activates the interrupt handler transfer process IH. At this time, as described above, the cache memory control unit determines whether or not the previously read interrupt handler is left in the cache memory, and if not, reads it from the main storage device, and Transfer to memory. When the reading of the interrupt handler into the cache memory is completed, the fact is reported to the kernel.

【0029】割込みハンドラ転写処理IHの終了を受け
たカーネルは、カーネル処理K15によりその終結処理
を行うとともに、ダーティデータを主記憶装置に転写す
るための準備処理を行った後、再度キャッシュメモリ制
御部を起動し、ダーティデータ転写処理DTを開始させ
る。そして、主記憶装置へのダーティデータ転写処理D
Tが終了した時点で、カーネル処理K16によりその終
結処理を行った後、すべての制御動作を停止し、本来の
アイドル状態に移行する。
Upon completion of the interrupt handler transfer processing IH, the kernel performs the termination processing by the kernel processing K15, performs the preparation processing for transferring the dirty data to the main storage device, and then again executes the cache memory control unit. To start the dirty data transfer process DT. Then, dirty data transfer processing D to the main storage device
At the end of T, after the termination process is performed by the kernel process K16, all control operations are stopped, and a transition is made to the original idle state.

【0030】次に、アイドル状態にある中央処理ユニッ
トCPUは、割り込み要求を受けてアイドル状態から離
脱し、割込みハンドラによる割り込み解析処理を開始し
ようとする。キャッシュメモリ制御部は、中央処理ユニ
ットCPUの指示を受けて、キャッシュメモリ内に割込
みハンドラが残されているかどうかを判定するが、キャ
ッシュメモリ内にはすでに前記アイドル時の割込みハン
ドラ転写処理IHによって割込みハンドラが読み込まれ
ているため、直ちに中央処理ユニットCPUにヒットし
たことを報告し、中央処理ユニットCPUは割り込み解
析処理IPを開始する。この割込みハンドラ転写処理I
H及び割り込み解析処理IPは、オペレーティングシス
テムのカーネルを介在することなく開始されるが、その
終了は、カーネルに報告され、これを受けてカーネル処
理K17による終結処理と、割り込み要因に対応するタ
スクD処理TDの準備処理が行われる。
Next, the central processing unit CPU in the idle state receives the interrupt request, leaves the idle state, and attempts to start the interrupt analysis processing by the interrupt handler. The cache memory control unit receives an instruction from the central processing unit CPU and determines whether or not an interrupt handler is left in the cache memory. Since the handler has been read, the central processing unit CPU is immediately notified of the hit, and the central processing unit CPU starts the interrupt analysis processing IP. This interrupt handler transfer processing I
H and the interrupt analysis processing IP are started without intervention of the kernel of the operating system, but the end is reported to the kernel, and in response to this, the termination processing by the kernel processing K17 and the task D corresponding to the interrupt cause are performed. Preparation processing for processing TD is performed.

【0031】ところで、タスクD処理TDが実行されて
いる間に、中央処理ユニットCPU等によるメモリアク
セス要求があると、キャッシュメモリ制御部は、所定の
フラグをもとにキャッシュメモリ内にダーティデータが
残されているかどうかを判定する。しかし、キャッシュ
メモリ内のダーティデータは、すでに前記アイドル時の
ダーティデータ転写処理DTによって主記憶装置に転写
済みであるため、直ちに所定のメモリアクセスが開始さ
れる。タスクD処理TDの終了を受けたカーネルは、カ
ーネル処理K18により、その終結処理を行うととも
に、次のタスクA処理TA2のための準備処理を行い、
同様な制御動作を繰り返す。
When a memory access request is issued by the central processing unit CPU or the like while the task D process TD is being executed, the cache memory control unit stores dirty data in the cache memory based on a predetermined flag. Determine if any are left. However, since the dirty data in the cache memory has already been transferred to the main storage device by the dirty data transfer process DT at the time of idling, a predetermined memory access is immediately started. The kernel that has received the end of the task D process TD performs the termination process and the preparation process for the next task A process TA2 by the kernel process K18,
A similar control operation is repeated.

【0032】このように、この実施例のマイクロコンピ
ュータ及びそのオペレーティングシステムは、実行すべ
きタスクがないアイドル時、以後実行される確率の高い
タスクに関するプログラム、つまり例えば割込みハンド
ラ等をキャッシュメモリに先行して読み込み、またキャ
ッシュメモリ内にある所定のデータ、つまり例えばダー
ティデータ等を主記憶装置に先行して転写する機能を持
つ。このため、何らかの割り込み要求によってアイドル
状態から離脱し、あるいは直後にメモリアクセス要求が
あった場合でも、割り込み解析に必要な割込みハンドラ
はすでにキャッシュメモリ内にあり、キャッシュメモリ
内には、メモリアクセスに先立って主記憶装置に転写す
べきダーティデータもない。この結果、直ちに割り込み
解析処理を開始し、あるいは直ちにメモリアクセスを実
行することができるため、マイクロコンピュータ及びそ
のオペレーティングシステムとしての割り込み要求又は
メモリアクセス要求に対する応答速度が高速化されるも
のである。
As described above, the microcomputer and its operating system according to the present embodiment precede the cache memory with a program relating to a task having a high probability of being executed, that is, an interrupt handler, for example, when there is no task to be executed. It has a function of transferring predetermined data in the cache memory, that is, dirty data, for example, prior to the main storage device. For this reason, even if the CPU leaves the idle state due to some interrupt request or receives a memory access request immediately after that, the interrupt handler necessary for interrupt analysis is already in the cache memory, and is stored in the cache memory prior to the memory access. There is no dirty data to be transferred to the main memory. As a result, since the interrupt analysis process can be started immediately or the memory access can be executed immediately, the response speed to the interrupt request or the memory access request as the microcomputer and its operating system is increased.

【0033】以上の実施例から得られる作用効果は、下
記の通りである。すなわち、 (1)リアルタイムOS等のオペレーティングシステム
を備えかつ階層記憶方式をとるマイクロコンピュータ等
において、実行すべきタスクがないアイドル時、以後実
行される確率の高いタスク、つまり例えば割り込み解析
のための割込みハンドラを主記憶装置からキャッシュメ
モリに転写する処理や、所定のタスクに関する準備処
理、つまり例えばキャッシュメモリ内にあるダーティデ
ータを主記憶装置に転写する処理などを先行して実行す
る機能を持たせることで、例えば割り込み発生時、割込
みハンドラをキャッシュメモリに読み込むことなく、直
ちに割り込み解析処理を開始することができるととも
に、メモリアクセス要求発生時には、ダーティデータを
主記憶装置に転写することなく、直ちにメモリアクセス
を開始することができるという効果が得られる。
The functions and effects obtained from the above embodiment are as follows. (1) In a microcomputer equipped with an operating system such as a real-time OS or the like and adopting a hierarchical storage system, when there is no task to be executed, a task with a high probability of being executed thereafter, for example, an interrupt for interrupt analysis A function to precede the process of transferring the handler from the main storage device to the cache memory or the preparation process for a predetermined task, that is, the process of transferring dirty data in the cache memory to the main storage device in advance, for example. Thus, for example, when an interrupt occurs, the interrupt analysis process can be started immediately without loading the interrupt handler into the cache memory, and when a memory access request occurs, the memory access is immediately performed without transferring the dirty data to the main storage device. Start The effect that it can be obtained is obtained.

【0034】(2)上記(1)項により、マイクロコン
ピュータ等及びそのオペレーティングシステムの割り込
み発生時及びメモリアクセス要求発生時における応答時
間を短縮することができるという効果が得られる。
(2) According to the above item (1), an effect is obtained that the response time when an interruption of a microcomputer or the like and its operating system occurs and a memory access request occurs can be shortened.

【0035】以上、本発明者によってなされた発明を実
施例に基づき具体的に説明したが、この発明は、上記実
施例に限定されるものではなく、その要旨を逸脱しない
範囲で種々変更可能であることは言うまでもない。例え
ば、図1において、マイクロコンピュータのソフトウェ
アを含む制御系統は、本実施例による制約を受けること
なく種々の実施形態をとりうる。図2において、マイク
ロコンピュータの記憶階層は、例えば複数段のキャッシ
ュメモリを設けるなど種々考えられるし、各記憶装置を
構成するメモリの種別等も任意に選択することができ
る。また、キャッシュメモリは、必ずしも中央処理ユニ
ットCPUと同一チップ上に形成されることを必須条件
とはしない。
As described above, the invention made by the inventor has been specifically described based on the embodiment. However, the invention is not limited to the above embodiment, and various modifications can be made without departing from the gist of the invention. Needless to say, there is. For example, in FIG. 1, the control system including the software of the microcomputer can take various embodiments without being restricted by the present embodiment. In FIG. 2, the storage hierarchy of the microcomputer can be variously conceived, for example, by providing a cache memory of a plurality of stages, and the type of the memory constituting each storage device can be arbitrarily selected. The cache memory is not necessarily required to be formed on the same chip as the central processing unit CPU.

【0036】図3において、例えば、ステップST3及
びST4による割込みハンドラの転写処理と、ステップ
ST5及びST6によるダーティデータの転写処理は、
順序を入れ換えて実行してもよい。また、アイドル時に
キャッシュメモリに転写されるプログラムは、割込みハ
ンドラに限定されないし、キャッシュメモリから主記憶
装置に転写されるデータについても同様である。図示さ
れるマイクロコンピュータ及びそのオペレーティングシ
ステムの処理フローはほんの一例であって、種々の実施
形態をとりうる。図4において、各処理間の具体的時間
関係は、本発明の主旨に何ら制約を与えないし、各タス
クの処理順序及び処理時間ならびにその組み合わせ等
も、この実施例によって制約されない。図5において、
オペレーティングシステムは、必ずしもC言語で記述さ
れることを必須条件とはしないし、その記述方法及び具
体的内容等は、本実施例により制約されない。
In FIG. 3, for example, the transfer processing of the interrupt handler in steps ST3 and ST4 and the transfer processing of the dirty data in steps ST5 and ST6 are as follows.
The order may be changed. Further, the program transferred to the cache memory at idle is not limited to the interrupt handler, and the same applies to data transferred from the cache memory to the main storage device. The illustrated processing flows of the microcomputer and its operating system are merely examples, and various embodiments can be taken. In FIG. 4, the specific time relationship between the processes does not restrict the gist of the present invention at all, and the processing order and the processing time of each task and the combination thereof are not restricted by this embodiment. In FIG.
The operating system is not necessarily required to be described in the C language, and its description method and specific contents are not limited by this embodiment.

【0037】以上の説明では、主として本発明者によっ
てなされた発明をその背景となった利用分野であるマイ
クロコンピュータ及びそのリアルタイムOSに適用した
場合について説明したが、それに限定されるものではな
く、例えば、同様なリアルタイムOSを備えるワークス
テーションやマイクロコントローラ等にも適用できる
し、各種のオペレーティングシステムを格納した記憶媒
体等にも適用できる。この発明は、少なくともストアド
プログラム方式をとるデジタル処理装置ならびにそのオ
ペレーティングシステムに広く適用できる。
In the above description, the invention made mainly by the present inventor has been described as applied to a microcomputer and its real-time OS, which are the fields of use as the background, but the invention is not limited to this. The present invention can also be applied to a workstation or a microcontroller having a similar real-time OS, or to a storage medium or the like in which various operating systems are stored. INDUSTRIAL APPLICABILITY The present invention is widely applicable to at least a digital processing device using a stored program method and its operating system.

【0038】[0038]

【発明の効果】本願において開示される発明のうち代表
的なものによって得られる効果を簡単に説明すれば、下
記の通りである。すなわち、リアルタイムOSを備えか
つ階層記憶方式をとるマイクロコンピュータ等におい
て、実行すべきタスクがないアイドル時、以後実行され
る確率の高いタスク、つまり例えば割り込み解析のため
の割込みハンドラを主記憶装置からキャッシュメモリに
転写する処理や、所定のタスクに関する準備処理、つま
り例えばキャッシュメモリ内にあるダーティデータを主
記憶装置に転写する処理などを先行して実行する機能を
持たせる。
The effects obtained by typical ones of the inventions disclosed in the present application will be briefly described as follows. That is, in a microcomputer having a real-time OS and adopting a hierarchical storage system, when there is no task to be executed, the task having a high probability of being executed thereafter, for example, an interrupt handler for interrupt analysis is cached from the main storage device. A function is provided for executing processing for transferring data to a memory and preparation processing for a predetermined task, that is, processing for transferring dirty data in a cache memory to a main storage device in advance.

【0039】これにより、例えば割り込み発生時、割込
みハンドラをキャッシュメモリに読み込むことなく、直
ちに割り込み解析処理を開始することができるととも
に、例えばメモリアクセス要求発生時には、ダーティデ
ータを主記憶装置に転写することなく、直ちにメモリア
クセスを開始することができる。この結果、リアルタイ
ムOSひいてはこれを備えるマイクロコンピュータ等の
割り込み発生時及びメモリアクセス要求発生時における
応答時間を短縮することができる。
Thus, for example, when an interrupt occurs, the interrupt analysis process can be started immediately without reading the interrupt handler into the cache memory. For example, when a memory access request occurs, dirty data can be transferred to the main storage device. And the memory access can be started immediately. As a result, it is possible to reduce the response time when an interrupt occurs in the real-time OS, and in addition, when a microcomputer or the like including the real-time OS and a memory access request occurs.

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

【図1】この発明が適用されたマイクロコンピュータ及
びそのオペレーティングシステムの制御系統を説明する
ための一実施例を示す説明図である。
FIG. 1 is an explanatory diagram showing an embodiment for explaining a microcomputer to which the present invention is applied and a control system of an operating system thereof.

【図2】図1のマイクロコンピュータの記憶階層を説明
するための一実施例を示す説明図である。
FIG. 2 is an explanatory diagram showing one embodiment for explaining a storage hierarchy of the microcomputer of FIG. 1;

【図3】図1のマイクロコンピュータのアイドル時の処
理手順を説明するための一実施例を示す処理フロー図で
ある。
FIG. 3 is a processing flowchart showing an embodiment for explaining a processing procedure at the time of idling of the microcomputer in FIG. 1;

【図4】図1のマイクロコンピュータのアイドル時の動
作を説明するための一実施例を示すタイミングチャート
である。
FIG. 4 is a timing chart showing an embodiment for explaining the operation of the microcomputer of FIG. 1 at the time of idling;

【図5】図1のマイクロコンピュータのオペレーティン
グシステムのC言語による記述形式を説明するための一
実施例を示す部分的な説明図である。
FIG. 5 is a partial explanatory diagram showing one embodiment for describing a description format in C language of the operating system of the microcomputer in FIG. 1;

【図6】この発明に先立って本願発明者等が開発したマ
イクロコンピュータ及びそのオペレーティングシステム
のアイドル時の処理手順を説明するための一例を示す処
理フロー図である。
FIG. 6 is a processing flowchart showing an example for explaining a processing procedure at the time of idling of a microcomputer and its operating system developed by the present inventors prior to the present invention;

【図7】図6のマイクロコンピュータのアイドル時の動
作を説明するための一例を示すタイミングチャートであ
る。
7 is a timing chart showing an example for explaining an operation of the microcomputer in FIG. 6 at the time of idling;

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

1……ハードウェア、2……オペレーティングシステ
ム、31〜3n……タスク、4……割込みハンドラ。1
1……CPU(中央処理ユニット)、12……記憶装
置、121……キャッシュメモリ、122……主記憶装
置、123……補助記憶装置。ST1〜ST11,ST
21〜ST31……処理ステップ。K11〜K18,K
21〜K26……カーネル処理、IH……割込みハンド
ラ転写処理、IP……割り込み処理、DT……ダーティ
データ転写処理、TA1〜TA2……タスクA処理、T
B1〜TB2……タスクB処理、TC……タスクC処
理、TD……タスクD処理。
1. Hardware 2. Operating system 31 to 3n Task 4. Interrupt handler 1
1 CPU (central processing unit), 12 storage device, 121 cache memory, 122 main storage device, 123 auxiliary storage device. ST1 to ST11, ST
21 to ST31 Processing steps. K11 to K18, K
21 to K26: Kernel processing, IH: Interrupt handler transfer processing, IP: Interrupt processing, DT: Dirty data transfer processing, TA1 to TA2: Task A processing, T
B1 to TB2: Task B processing, TC: Task C processing, TD: Task D processing

Claims (1)

【特許請求の範囲】[Claims] 【請求項1】 実行すべきタスクがないアイドル時にお
いて、以後実行される確率の高いタスク又はこれに関連
する準備処理を先行して実行しうるオペレーティングシ
ステムを備えてなることを特徴とするデジタル処理装
置。
1. A digital process comprising an operating system capable of executing a task with a high probability of being executed or a preparation process related thereto in an idle state when there is no task to be executed. apparatus.
JP33453199A 1999-11-25 1999-11-25 Digital processor Pending JP2001154859A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP33453199A JP2001154859A (en) 1999-11-25 1999-11-25 Digital processor

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP33453199A JP2001154859A (en) 1999-11-25 1999-11-25 Digital processor

Publications (1)

Publication Number Publication Date
JP2001154859A true JP2001154859A (en) 2001-06-08

Family

ID=18278455

Family Applications (1)

Application Number Title Priority Date Filing Date
JP33453199A Pending JP2001154859A (en) 1999-11-25 1999-11-25 Digital processor

Country Status (1)

Country Link
JP (1) JP2001154859A (en)

Similar Documents

Publication Publication Date Title
US7475202B2 (en) Memory controller and method for optimized read/modify/write performance
US5410700A (en) Computer system which supports asynchronous commitment of data
US8055872B2 (en) Data processor with hardware accelerator, accelerator interface and shared memory management unit
EP1396792B1 (en) Memory copy command specifying source and destination of data executed in the memory controller
JP2982875B2 (en) Slave controller
JPH11143775A (en) Cache memory system
JPS62243044A (en) Control system for disk cache memory
JP2001154859A (en) Digital processor
US7788448B2 (en) Sequencer cache and method for operating the same
US6981103B2 (en) Cache memory control apparatus and processor
JPH08328959A (en) Disk cache controller
JPS601655B2 (en) Data prefetch method
JPH06324861A (en) System and method for controlling cpu
JP2713218B2 (en) Checkpoint / restart processing method
JP2002108704A (en) Disk cache control system
JPH04333929A (en) Cache memory control system
JPH05257807A (en) Cache memory controller
JPH0651982A (en) Arithmetic processing unit
US20040103267A1 (en) Data processor having cache memory
JP2860395B2 (en) Channel command prefetch controller
JPH01298453A (en) Cache error processing system
JPH0447350A (en) Main storage read/response control
JPS6240555A (en) Prefetch control system
JPH0594373A (en) Data flash interval control system
JP3029355B2 (en) Single-step instruction execution method