JP3075646B2 - Task activation method - Google Patents

Task activation method

Info

Publication number
JP3075646B2
JP3075646B2 JP04333398A JP33339892A JP3075646B2 JP 3075646 B2 JP3075646 B2 JP 3075646B2 JP 04333398 A JP04333398 A JP 04333398A JP 33339892 A JP33339892 A JP 33339892A JP 3075646 B2 JP3075646 B2 JP 3075646B2
Authority
JP
Japan
Prior art keywords
task
level
priority
register
information
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.)
Expired - Fee Related
Application number
JP04333398A
Other languages
Japanese (ja)
Other versions
JPH06187173A (en
Inventor
公二 川口
哲仁 渡辺
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.)
Fuji Electric Co Ltd
Original Assignee
Fuji Electric Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Fuji Electric Co Ltd filed Critical Fuji Electric Co Ltd
Priority to JP04333398A priority Critical patent/JP3075646B2/en
Publication of JPH06187173A publication Critical patent/JPH06187173A/en
Application granted granted Critical
Publication of JP3075646B2 publication Critical patent/JP3075646B2/en
Anticipated expiration legal-status Critical
Expired - Fee Related legal-status Critical Current

Links

Description

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

【0001】[0001]

【産業上の利用分野】本発明は、たとえばシーケンサ、
自動販売機、自動車の燃料の噴射装置など、CPUを用
いた制御装置において、実行されるプログラムがタスク
という分割されたモジュールとして管理されていて、そ
のタスク起動をソフトウェアまたはハードウェアによっ
て制御するタスク起動方式に関する。
BACKGROUND OF THE INVENTION The present invention relates to, for example, a sequencer,
In a control device using a CPU, such as a vending machine or an automobile fuel injection device, a program to be executed is managed as a divided module called a task, and the task activation is controlled by software or hardware. About the method.

【0002】[0002]

【従来の技術】従来のタスク起動装置は、プログラム
(Operating System) によりタスク起動管理を行ってい
た。これは外部割込みやソフト割込みによるタスク起動
イベントまたは定周期割込みによるタスク起動イベント
が発生すると、タスク番号をそのタスクの優先度を示す
レベル毎にキューイングする処理や、各々のレベル毎の
キュートップのタスク要求の優先度判定を行う処理、さ
らに優先度判定されたタスクをキューから引き抜く処理
などをプログラムにより行うものである。
2. Description of the Related Art A conventional task starting device manages task starting by a program (Operating System). This is because when a task start event occurs due to an external interrupt or software interrupt or a task start event occurs due to a fixed cycle interrupt, the task number is queued for each level indicating the priority of the task, and the queue top for each level is The processing for determining the priority of the task request and the processing for extracting the task whose priority has been determined from the queue are performed by a program.

【0003】[0003]

【発明が解決しようとする課題】しかしながら、上記し
た従来のタスク起動装置は、タスク起動イベントが起き
てからタスク要求が発生するまでの処理がプログラムで
行われるため、オーバヘッドとなり、さらにこのオーバ
ヘッドは管理されるタスクの数と共に増大するという問
題があった。
However, in the above-described conventional task activation device, since the processing from the occurrence of a task activation event to the generation of a task request is performed by a program, it causes an overhead, and this overhead is further managed. There is a problem that it increases with the number of tasks performed.

【0004】本発明は、外部割込みやソフト割込みによ
るタスク起動イベントが発生した場合、あるいは定周期
プログラムによるタスク起動イベントが発生した場合の
CPUの管理を大幅に軽減し、オーバヘッドの少ない高
速なタスク起動を可能とするタスク起動方式を実現する
ことを目的とする。
The present invention greatly reduces the management of the CPU when a task start event occurs due to an external interrupt or a soft interrupt, or when a task start event occurs due to a fixed-cycle program, thereby enabling high-speed task start-up with little overhead. It is an object of the present invention to realize a task activation method that enables the following.

【0005】[0005]

【課題を解決するための手段】図1は本発明の原理を説
明するブロック図である。この図1の構成は外部割り込
みやソフト割り込みによるタスク起動イベントに対して
の処理を行うものである。
FIG. 1 is a block diagram for explaining the principle of the present invention. The configuration of FIG. 1 performs processing for a task activation event caused by an external interrupt or a soft interrupt.

【0006】同図において、10は本発明のタスク起動
装置であり、制御装置内のCPU20との間で各種信号
の授受が行われる。タスク起動装置10は概略的には、
タスクキューファイル1、タスク優先レベル判定回路
2、タスク番号設定レジスタ3、マルチプレクサなどの
タスク番号選択手段4で構成されている。
In FIG. 1, reference numeral 10 denotes a task activation device according to the present invention, which exchanges various signals with a CPU 20 in a control device. The task activation device 10 is generally
It comprises a task queue file 1, a task priority level determination circuit 2, a task number setting register 3, and a task number selecting means 4 such as a multiplexer.

【0007】上記タスク優先レベル判定回路2は、タス
ク要求フラグ21(以下フラグ21という)、タスク優
先レベルレジスタ22(以下優先レベルレジスタ22と
いう)、タスク優先レベルマスクレジスタ23(以下マ
スクレジスタ23という)、マスクレジスタ割り込み退
避レジスタ24(以下退避レジスタ24という)、プラ
イオリティエンコーダ25で構成されている。
The task priority level determination circuit 2 includes a task request flag 21 (hereinafter referred to as a flag 21), a task priority level register 22 (hereinafter referred to as a priority level register 22), and a task priority level mask register 23 (hereinafter referred to as a mask register 23). , A mask register interrupt save register 24 (hereinafter referred to as a save register 24), and a priority encoder 25.

【0008】外部割り込みやソフト割り込みによるタス
ク起動イベントが起きると、CPU20はそのタスク番
号をレベル毎に管理されたタスクキューファイル1にセ
ットする。このときたとえば、タスクキューファイル1
の0レベルのファイルには、タスク番号#0,#1,#
2・・・がキューイングされ、1レベルのタスクキュー
のファイルにはタスク番号#10,#20,#30・・
・がキューイングされるというようにそれぞれの優先レ
ベル毎にタスク番号がキューイングされる。なお、キュ
ーはファーストインファーストアウトとなっているの
で、上記0レベルのタスクキューファイルを例にとる
と、キュートップのタスク番号は#0となる。
When a task activation event occurs due to an external interrupt or a soft interrupt, the CPU 20 sets the task number in the task queue file 1 managed for each level. At this time, for example, task queue file 1
0 level files have task numbers # 0, # 1, #
.. Are queued, and task numbers # 10, # 20, # 30,.
The task number is queued for each priority level, such that the task number is queued. Since the queue is first-in first-out, the task number at the top of the queue is # 0 in the case of the 0-level task queue file as an example.

【0009】このように各優先レベルに応じたタスクキ
ューファイル1にタスク番号がセットされると、各レベ
ルのキュートップのタスク番号がタスク番号設定レジス
タ3に各レベル毎にセットされるとともに、フラグ21
が各レベル毎にセットされる。
When the task number is set in the task queue file 1 corresponding to each priority level, the task number of the queue top of each level is set in the task number setting register 3 for each level and the flag is set. 21
Is set for each level.

【0010】また、上記マスクレジスタ23は、マスク
情報がセットされるレジスタであり、各レベルの優先順
次がたとえば、0レベル>1レベル>2レベルであった
とすると、マスクレジスタ23に「0」がセットされた
場合、0レベル以下がすべてマスクされる。この場合、
0レベル、1レベル、2レベルのタスク要求がすべてマ
スクされるので、タスク番号設定レジスタ3にタスク番
号がそれぞれセットされ、なおかつ、それぞれのフラグ
21がセットされていたとしても、タスク要求は発生し
ないことになる。
The mask register 23 is a register in which mask information is set. If the priority order of each level is, for example, 0 level> 1 level> 2 level, "0" is set in the mask register 23. When set, all levels below 0 are masked. in this case,
Since the task requests of the 0 level, 1 level and 2 levels are all masked, no task request is generated even if the task numbers are set in the task number setting register 3 and the respective flags 21 are set. Will be.

【0011】同様にマスクレジスタ23に「1」がセッ
トされると1レベル、2レベルのタスク要求がマスクさ
れ、「2」がセットされると2レベルのみのタスク要求
がマスクされる。また、「3」がセットされた場合に
は、全レベルのタスク要求がマスクされなくなる。
Similarly, when "1" is set in the mask register 23, one-level and two-level task requests are masked, and when "2" is set, only two-level task requests are masked. When "3" is set, task requests at all levels are not masked.

【0012】プライオリティエンコーダ25は、上記マ
スクレジスタ23のマスク情報とフラグ21のフラグの
セット情報をもとに優先度判定を行うもので、マスクさ
れてなく、しかも優先度の高いレベルを優先レベルレジ
スタ22にセットするとともにCPU20に対してタス
ク要求を出力する。
The priority encoder 25 determines the priority based on the mask information of the mask register 23 and the set information of the flag of the flag 21. The priority encoder 25 determines the level which is not masked and has a higher priority. 22 and output a task request to the CPU 20.

【0013】このタスク要求をCPU20が受け付ける
と、優先レベルレジスタ22の内容を読みだし、その内
容からどのレベルのタスク要求があるかを知る。そし
て、CPU20がタスク番号設定レジスタ3からタスク
番号を読み出す際は、タスク番号選択手段4によって自
動的にそのときのタスク番号が選択される。
When the CPU 20 receives this task request, it reads out the contents of the priority level register 22 and knows the level of the task request from the contents. Then, when the CPU 20 reads the task number from the task number setting register 3, the task number at that time is automatically selected by the task number selecting means 4.

【0014】また、上記退避レジスタ24は、タスク番
号がCPU20に読み出されることにより、その時点ま
でマスクレジスタ23にセットされていたマスク情報を
一時的に取り込むものである。
The evacuation register 24 temporarily fetches the mask information set in the mask register 23 until the task number is read out by the CPU 20.

【0015】[0015]

【作用】外部割り込みやソフト割り込みなどのタスクイ
ベントが発生すると、CPUはタスクの優先レベルに応
じたタスクキューファイル1にタスク番号をセットす
る。すると、各レベルのキュートップのタスク番号が各
レベル毎のタスク番号設定レジスタ3にセットされると
ともに対応するタスク要求フラグがセットされる。
When a task event such as an external interrupt or a soft interrupt occurs, the CPU sets a task number in the task queue file 1 corresponding to the task priority level. Then, the task number of the queue top of each level is set in the task number setting register 3 for each level, and the corresponding task request flag is set.

【0016】そして、プライオリティエンコーダ25
は、マスク情報とフラグの設定情報とにより、レベルの
優先度を判定し、マスクされていない最も優先度の高い
レベル(これをここでは1レベルとする)を優先レベル
レジスタ22にセットするとともにCPU20に対して
タスク要求を発生する。
Then, the priority encoder 25
Determines the priority of the level on the basis of the mask information and the setting information of the flag, sets the highest level of unmasked priority (this is set to 1 level here) in the priority level register 22 and sets the CPU 20 Issues a task request to

【0017】CPU20はこのタスク要求を受けると、
上記優先レベルレジスタ22の内容(1レベル)を読み
出して1レベルのタスク要求があることを知る。そし
て、タスク番号選択手段4が上記優先レベルレジスタ2
2からの信号を受けてタスク番号設定レジスタ3から1
レベルのキュートップのタスク番号(これをタスク番号
#10とする)を選択して、CPU20に対してタスク
番号#10を与える。
When the CPU 20 receives this task request,
The content (1 level) of the priority level register 22 is read out to find that there is a 1 level task request. Then, the task number selecting means 4 sets the priority level register 2
2 from the task number setting register 3
The task number at the top of the queue of the level (this is referred to as task number # 10) is selected, and task number # 10 is given to CPU 20.

【0018】このようにしてタスク番号が読み出される
ことにより、タスク起動装置10は、この時点までのマ
スクレジスタ23のセット内容を退避レジスタ24に退
避させる。
By reading the task number in this manner, the task activation device 10 saves the set contents of the mask register 23 up to this point in the save register 24.

【0019】そして、CPU20が先のタスク番号#1
0のタスク処理を終了すると、マスクレジスタ23のセ
ット内容を退避レジスタ24から復帰させて、次のタス
ク要求を発生する。
Then, the CPU 20 sets the task number # 1
When the task processing of 0 is completed, the set content of the mask register 23 is restored from the save register 24, and the next task request is generated.

【0020】したがって、外部割り込みやソフト割り込
みなどのタスク起動イベントが起きてから、タスク要求
を発生させるための処理としてはタスク番号をレベルに
対応したキューファイルにセットするだけで良く、CP
Uの処理を簡略化することができ、オーバヘッドの少な
い高速なタスク起動が可能となる。
Therefore, after a task start event such as an external interrupt or a soft interrupt has occurred, the process for generating a task request only requires setting the task number in the queue file corresponding to the level.
The processing of U can be simplified, and high-speed task activation with little overhead can be performed.

【0021】図2はあらかじめプログラマブルに設定さ
れた周期で、定周期タスクのタスク起動イベントが発生
した場合、そのタスク番号を優先レベルに応じて図1で
示したタスクキューファイル1に自動的にセットする定
周期タスク起動手段を示すブロック図である。
FIG. 2 shows a cycle that is set in advance in a programmable manner. When a task activation event of a fixed-cycle task occurs, the task number is automatically set in the task queue file 1 shown in FIG. 1 according to the priority level. FIG. 4 is a block diagram showing a fixed-period task activating unit.

【0022】この定周期タスク起動手段は、定周期割り
込みのベース時間Tを設定可能な定周期タイマ31と、
各レベル毎でなおかつ、そのレベルのタスク番号毎に設
けられた定周期タスク起動回路41及び図1で示したタ
スク起動装置10で構成されている。なお、図2では定
周期タスク起動回路41は、ある1つのタスク番号に対
応した定周期タスク起動回路のみが図示されているが、
他のタスク番号に対応した定周期タスク起動回路も同様
の構成となっている。
The fixed-period task starting means includes a fixed-period timer 31 capable of setting a base time T of a fixed-period interrupt;
It comprises a periodic task activation circuit 41 provided for each level and for each task number of that level and the task activation device 10 shown in FIG. In FIG. 2, the fixed-period task activation circuit 41 shows only a fixed-period task activation circuit corresponding to a certain task number.
The fixed-cycle task activation circuits corresponding to other task numbers have the same configuration.

【0023】この定周期タスク起動回路41は、タスク
番号が設定されるタスク番号レジスタ51とそのタスク
周期Nを設定する周期設定レジスタ52、さらにカウン
ト手段としてダウンカウンタ53で構成されている。
The fixed-period task starting circuit 41 includes a task number register 51 in which a task number is set, a cycle setting register 52 for setting the task cycle N, and a down counter 53 as counting means.

【0024】そして、この定周期タスク起動回路41へ
の定周期タスク初期設定はCPU20により行われる。
すなわち、初期設定としてのCPU20の処理は、定周
期タイマ31に割り込み周期のベース時間Tを設定する
とともにタスク番号レジスタ51にタスク番号を設定
し、さらに周期設定レジスタ52に周期Nを設定する。
この周期Nを設定するとその内容がダウンカウンタ53
にもセットされる。このとき、定周期割り込みタスクが
起動される周期はN×Tで決定される。
The initialization of the fixed-cycle task in the fixed-cycle task activation circuit 41 is performed by the CPU 20.
That is, in the processing of the CPU 20 as the initial setting, the base time T of the interrupt cycle is set in the fixed cycle timer 31, the task number is set in the task number register 51, and the cycle N is set in the cycle setting register 52.
When this cycle N is set, the contents are set to the down counter 53.
Also set. At this time, the cycle at which the periodic interrupt task is activated is determined by N × T.

【0025】また、この定周期タスク起動回路41から
発生するタスク番号は、図1で示したタスクキューファ
イル1の対応するキューファイルに格納される。初期設
定としてイニシャル時に行うCPUの処理は、前記した
ように、ベース時間Tの設定、タスク番号の設定、周期
Nの設定を行ったのち、定周期タイマコントロール指令
を出して定周期タイマ31を有効にする。これにより、
定周期タイマ31から出力されるカウントクロック(ク
ロック周期T)に同期して、ダウンカウンタ53の内容
(N)がデクリメントされる。すなわち、クロックの周
期T時間毎にNが−1されて行く。そして、ダウンカウ
ンタ53が0になると、タスク番号レジスタ51に設定
されているタスク番号が図1で示したタスクキューファ
イル1の対応するレベルのキューファイルにセットされ
る。そして、再びダウンカウンタ53には周期Nがセッ
トされ、上記動作が繰り返される。したがって、このタ
スク起動周期はN×Tとなる。
The task number generated by the fixed-cycle task activation circuit 41 is stored in a queue file corresponding to the task queue file 1 shown in FIG. As described above, the processing of the CPU performed at the time of the initial setting is to set the base time T, set the task number, and set the cycle N, and then issue a fixed cycle timer control command to enable the fixed cycle timer 31. To This allows
The content (N) of the down counter 53 is decremented in synchronization with the count clock (clock cycle T) output from the fixed cycle timer 31. That is, N is decremented by one every time period T of the clock. When the down counter 53 becomes 0, the task number set in the task number register 51 is set in the queue file of the corresponding level of the task queue file 1 shown in FIG. Then, the cycle N is set in the down counter 53 again, and the above operation is repeated. Therefore, the task activation cycle is N × T.

【0026】なお、タスクキューファイル1にタスク番
号がセットされた後は、図1で説明した動作によりCP
U20に対してタスク要求が出力される。したがって、
あらかじめプログラマブルに設定された周期で定周期タ
スクのタスク起動イベントが発生する場合において、タ
スク起動イベントが発生するか否かの管理をしなくて
も、タスク番号を自動的に対応するキューファイルにセ
ットすることができる。
After the task number is set in the task queue file 1, the CP shown in FIG.
A task request is output to U20. Therefore,
When a task start event of a fixed-cycle task occurs at a preset programmable cycle, the task number is automatically set to the corresponding queue file without having to manage whether the task start event occurs. can do.

【0027】[0027]

【実施例】次に本発明の実施例を説明する。図3は外部
割り込みやソフト割り込みによるタスク起動イベントに
対するタスク起動手段の実施例(以下、第1の実施例と
いう)の構成図であり前記本発明の原理で説明した図1
に対応するものである。同図において、10はタスク起
動装置であり、制御装置内のCPU20との間で各種信
号の授受が行われる。
Next, embodiments of the present invention will be described. FIG. 3 is a block diagram of an embodiment (hereinafter referred to as a first embodiment) of a task starting means for a task starting event due to an external interrupt or a soft interrupt.
It corresponds to. In the figure, reference numeral 10 denotes a task activation device, which exchanges various signals with the CPU 20 in the control device.

【0028】タスク起動装置10は、概略的には図1で
示したようにタスクキューファイル1、タスク優先レベ
ル判定回路2、タスク番号レジスタ3、タスク番号選択
手段としてのマルチプレクサ(MPX)4から構成され
ている。
As shown in FIG. 1, the task starting device 10 comprises a task queue file 1, a task priority level judging circuit 2, a task number register 3, and a multiplexer (MPX) 4 as a task number selecting means. Have been.

【0029】上記タスクキューファイル1は、たとえば
1レベルのタスクイベントの発生順序がタスク番号#1
0,#11,#12,・・・の順序である場合、タスク
キューファイル1の1レベルのキューファイル11 は図
4のような格納状態となる。さらに説明を加えると、外
部割り込みやソフト割り込みなどのタスク起動イベント
が発生すると、CPU20はタスク優先レベルに応じた
タスクキューファイル1にタスク番号をセットする。た
とえばタスクキューファイル1の0レベルファイル10
にはタスク番号発生順に#0,#1,#2,・・・がキ
ューイングされ、1レベル領域11 には前記したように
#10,#11,#12,・・・がキューイングされ、
2レベルファイル12 には#20,#21,#22,・
・・がキューイングされるというようにそれぞれのレベ
ル毎にタスク番号がキューイングされる。
In the task queue file 1, for example, the order of occurrence of one-level task events is the task number # 1.
If the order is 0, # 11, # 12,..., The one-level queue file 11 of the task queue file 1 is stored as shown in FIG. More specifically, when a task activation event such as an external interrupt or a soft interrupt occurs, the CPU 20 sets a task number in the task queue file 1 corresponding to the task priority level. For example, 0 level file 1 0 of task queue file 1
The task number generation order # 0, # 1, # 2, ... are queued, one level area 1 # 10 as described above in 1, # 11, # 12, ... are queued ,
The 2-level file 1 2 # 20, # 21, # 22, &
Task numbers are queued for each level, such that... Are queued.

【0030】なお、キューはファーストインファースト
アウトとなっているので、0レベルファイル10 を例に
とると、この0レベルファイル10 におけるキュートッ
プのタスク番号は#0となる。
[0030] In addition, the queue since has become a first-in-first-out, take a 0 level file 1 0 as an example, the task number of the queue top in the 0 level file 1 0 will be # 0.

【0031】また、前記タスク優先レベル判定回路2
は、フラグ21、優先レベルレジスタ22、マスクレジ
スタ23、退避レジスタ24、プライオリティエンコー
ダ25で構成されている。
The task priority level determination circuit 2
Is composed of a flag 21, a priority level register 22, a mask register 23, a save register 24, and a priority encoder 25.

【0032】そして、上記したように各レベルに応じた
タスクキューファイル1にタスク番号がセットされる
と、各レベルのキュートップのタスク番号がタスク番号
設定レジスタ3の各レベル領域にセットされる。たとえ
ば、タスク番号設定レジスタ3の0レベル領域30 には
タスク番号#0、1レベル領域31 にはタスク番号#1
0、2レベル領域32 にはタスク番号#20、というよ
うにそれぞれのレベルのその時点におけるキュートップ
のタスク番号が対応するレベル領域にセットされる。
When the task number is set in the task queue file 1 corresponding to each level as described above, the task number of the queue top of each level is set in each level area of the task number setting register 3. For example, the 0 level region 3 0 task number setting register 3 task number # 0 is the level region 3 1 task number # 1
0,2 The level region 3 2 task number # 20, the task number of the queue top at that time at each level so that is set to the corresponding level region.

【0033】このタスク番号設定レジスタ3にタスク番
号がセットされると同時に、上記フラグ21はそれぞれ
のレベルのフラグがセット状態となる。すなわち、タス
クキューファイル1の0レベルファイル10 、1レベル
ファイル11 、2レベルファイル12 にタスク番号がキ
ューイングされると、対応するレベルのフラグがセット
される。たとえば、0レベルファイル10 にタスク番号
がキューイングされると、0レベルフラグ210 がセッ
トし、1レベルファイル11 にタスク番号がキューイン
グされると、1レベルフラグ211 がセットし、2レベ
ルファイル12にタスク番号がキューイングされると、
2レベルフラグ212 がセットする。
At the same time when the task number is set in the task number setting register 3, the flags 21 are set to the respective levels. That is, when 0-level file 1 0 Task Queue file 1, 1-level file 1 1, 2-level file 1 2 to the task number is queued, the corresponding level of the flag is set. For example, when 0-level file 1 0 to the task number is queued, 0 level flag 21 0 is set, the first level file 1 1 to the task number is queued, one level flag 21 1 is set, 2 level file 1 2 When the task number is queued,
2 level flag 21 2 is set.

【0034】また、マスクレジスタ23は前記したよう
にマスク情報がセットされるもので、ここで0レベル、
1レベル、2レベルの各レベルの優先順位を、0レベル
>1レベル>2レベルとすると、マスクレジスタ23に
「0」がセットされた場合、0レベル以下のすべてのレ
ベルがマスクされるので、0レベル、1レベル、2レベ
ルのタスク要求がマスクされる。タスク要求がマスクさ
れると、タスク番号設定レジスタ3にタスク番号がセッ
トされ、なおかつタスク要求フラグ21がセットされて
いても、そのマスクされたタスク要求は発生しない。
In the mask register 23, mask information is set as described above.
Assuming that the priority levels of the first level and the second level are 0 level> 1 level> 2 level, when “0” is set in the mask register 23, all levels below the 0 level are masked. 0 level, 1 level, and 2 level task requests are masked. When the task request is masked, the masked task request is not generated even if the task number is set in the task number setting register 3 and the task request flag 21 is set.

【0035】退避レジスタ24はCPU20にタスク番
号が読み出されると、その時点までのマスクレジスタ2
3のマスク情報を一時的に取り込むレジスタである。た
とえばCPU20にタスク番号が読み出されるまでマス
クレジスタ23に「3」がセットされていたとすると、
CPU20のタスク番号読み込み後、マスクレジスタ2
3の内容が退避レジスタ24の0レベル領域240 、1
レベル領域241 、2レベル領域242 の何れかのレベ
ル領域(CPU20に読み込まれたタスク番号に対応す
るレベル領域)に退避させられる。
When the task number is read by the CPU 20, the save register 24 stores the mask register 2 up to that point.
3 is a register for temporarily taking in the mask information. For example, if "3" is set in the mask register 23 until the task number is read by the CPU 20,
After reading the task number of the CPU 20, the mask register 2
3 is the 0-level area 24 0 , 1 of the save register 24
It is saved to one of the level areas 24 1 and 24 2 (the level area corresponding to the task number read by the CPU 20).

【0036】プライオリティエンコーダ25は、前記タ
スク要求フラグ21のフラグ情報とマスクレジスタ23
のマスク情報により優先度の最も高いレベルを優先レベ
ルレジスタ22に出力するとともに、タスク要求をCP
U20に出力するものである。
The priority encoder 25 is provided with the flag information of the task request flag 21 and the mask register 23.
The highest level of priority is output to the priority level register 22 according to the mask information of
Output to U20.

【0037】このような構成において、次に動作を説明
する。外部割り込みやソフト割り込みなどのタスクイベ
ントが発生すると、CPU20はタスクの優先レベルに
応じたタスクキューファイル1にタスク番号をセットす
る。これにより、各レベルのキュートップのタスク番号
が各レベル毎のタスク番号レジスタ3にセットされると
ともに、該当するレベル毎のタスク要求フラグ21がセ
ットされる。これを具体的な例を用いて説明する。
The operation of the above configuration will now be described. When a task event such as an external interrupt or a soft interrupt occurs, the CPU 20 sets a task number in the task queue file 1 corresponding to the task priority level. Thus, the task number of the queue top of each level is set in the task number register 3 for each level, and the task request flag 21 for each corresponding level is set. This will be described using a specific example.

【0038】ここでは、タスクキューファイル1の0レ
ベルファイル10 にはタスクがキューイングされてな
く、1レベルファイル11 にはタスク番号#10,#1
1,#12がキューイングされ、2レベルファイル12
にはタスク番号#20,#21,#22がキューイング
されたとする。また、マスクレジスタ23には「3」が
セットされているとする。
[0038] Here, the 0-level file 1 0 of the task queue file 1, not to the task are queued, one level file 1 task number # 10 to 1, # 1
1 and # 12 are queued, 2 level file 1 2
, Task numbers # 20, # 21, and # 22 are queued. It is also assumed that “3” is set in the mask register 23.

【0039】上記したようにタスクキューファイル1の
0レベルファイル10 にはタスクがキューイングされて
いないので、タスク番号設定レジスタ3の0レベル領域
0及び0レベルフラグ210 はセットされない。一
方、タスク番号設定レジスタ3の1レベル領域31 には
タスクキューファイル1の1レベルファイル11 のキュ
ートップであるタスク番号#10がセットされ、同様
に、2レベル領域32 には2レベルファイル12 のキュ
ートップであるタスク番号#20がセットされる。これ
と同時に1レベルフラグ211 と2レベルフラグ212
がセットされる。
[0039] Since the 0-level file 1 0 Task Queue file 1 as described above task is not queued, 0 level region 3 0 and 0 level flag 21 0 task number setting register 3 is not set. On the other hand, the 1 level region 3 1 task number setting register 3 is set the task ID # 10 is a queue top-level file 1 1 Task Queue file 1, similarly, two-level region 3 2 2 level task number # 20 is a queue top of file 1 2 is set. At the same time, the one-level flag 21 1 and the two-level flag 21 2
Is set.

【0040】このような状態において、プライオリティ
エンコーダ25はマスクレジスタ23のマスク情報とタ
スク要求フラグ21のフラグ情報、つまり、この場合
は、全レベルのタスク要求がマスクされてなく、また1
レベルと2レベルのフラグ21 1 ,212 がセットされ
ているという情報を得て、1レベル>2レベルの優先順
位であることを判定する。これにより、優先レベルレジ
スタ22に1レベルがセットされるとともにCPU20
にタスク要求を出力する。
In such a state, the priority
The encoder 25 transmits the mask information of the mask register 23 and the timer.
Flag information of the disk request flag 21, that is, in this case,
Indicates that all levels of task requests are unmasked and 1
Level and 2 level flag 21 1, 21TwoIs set
Information, and the priority order of 1 level> 2 levels
Is determined to be the first place. This allows the priority level cash register
1 level is set in the star 22 and the CPU 20
Output task request to

【0041】このタスク要求をCPU20が受け付ける
と、上記優先レベルレジスタ22を読み出して、1レベ
ルのタスク要求があることを知る。一般にCPU20は
タスクレベルをタスク制御に用いる。
When the CPU 20 receives this task request, the CPU 20 reads the priority level register 22 to know that there is a one-level task request. Generally, the CPU 20 uses the task level for task control.

【0042】そして、CPU20がタスク番号設定レジ
スタ3からタスク番号を読み出すときは、マルチプレク
サ4が優先レベルレジスタ22の内容を受けて、この場
合は1レベルのタスク要求番号レジスタを選択すること
により自動的にタスク番号#10を得ることができる。
When the CPU 20 reads the task number from the task number setting register 3, the multiplexer 4 receives the contents of the priority level register 22, and in this case, automatically selects the one-level task request number register. And the task number # 10 can be obtained.

【0043】このようにタスク起動装置10からタスク
番号が読み出されたことにより、このタスク起動装置1
0は、マスクレジスタ23のこれまでの内容を退避レジ
スタ24の1レベル領域241 へ退避させ、マスクレジ
スタ23に「1」をセットし、さらに、タスク番号設定
レジスタ3の1レベル領域31 の内容とタスク要求フラ
グ21の1レベルフラグ211 の内容をクリアする。
By reading the task number from the task activation device 10 in this manner, the task activation device 1
0 saves the previous contents of the mask register 23 to the one-level area 24 1 of the save register 24, sets “1” to the mask register 23, and furthermore, saves the contents of the one-level area 3 1 of the task number setting register 3. It clears the content and 1 level flag 21 1 of the contents of the task request flag 21.

【0044】その後、タスクキューファイル1の1レベ
ルファイル11 のその時点におけるキュートップのタス
ク番号#11がタスク番号設定レジスタ3の1レベル領
域3 1 にセットされ、さらにタスク要求フラグ21の1
レベルフラグ211 がセットされる。しかし、このとき
はタスク優先レベルマスクレジスタは「1」にセットさ
れているので、1レベルと2レベルがマスクされ、1レ
ベルと2レベルのタスク要求は出力されないことにな
る。ただし、このとき0レベルはマスクされていないの
で、もし、0レベルキューファイル10 にタスク番号が
セットされていれば、0レベルのタスク要求が発生す
る。
Thereafter, one level of the task queue file 1
File 11Cue top task at that time
Task number # 11 is the one-level area of the task number setting register 3.
Area 3 1Is set, and the task request flag 21 is set to 1
Level flag 211Is set. But at this time
Indicates that the task priority level mask register is set to “1”.
1 level and 2 levels are masked and 1 level
Bell and level 2 task requests will not be output.
You. However, at this time, the 0 level is not masked.
So, if the 0 level queue file 10Has a task number
If set, a task request of level 0 occurs
You.

【0045】そして、CPU20は前記タスク番号#1
0の処理を終了すると、タスク起動装置10に対して、
マスクレジスタ23の復帰命令を退避レジスタ24に発
行する。これにより、退避レジスタ24の1レベル領域
241 に格納されているマスク情報「3」がマスクレジ
スタ23に戻される。このようにして、マスクレジスタ
23にはタスク番号#10がCPU20に読み込まれる
前のマスク情報「3」が戻され、次のタスク要求が発生
する。この場合は、1レベルのその時点におけるキュー
トップであるタスク番号#11がタスク要求として発生
させられる。このタスク番号#11のタスク要求の発生
は、前記タスク番号#10の場合と同様の動作過程にて
行われる。
Then, the CPU 20 executes the task number # 1.
0, the task activation device 10
An instruction to restore the mask register 23 is issued to the save register 24. Thus, the mask information stored in the first level region 24 1 of the save register 24 "3" is returned to the mask register 23. Thus, the mask information “3” before the task number # 10 is read by the CPU 20 is returned to the mask register 23, and the next task request is generated. In this case, the task number # 11 which is the queue top at the current level of one level is generated as a task request. The generation of the task request of the task number # 11 is performed in the same operation process as that of the task number # 10.

【0046】このように本実施例では、外部割り込みや
ソフト割り込みなどのタスク起動イベントが発生してか
ら、タスク要求を発生させるための処理としては、タス
ク番号をレベルに対応したキューにセットするだけの処
理で済み、オーバヘッドの少ない高速なタスク起動が可
能となる。
As described above, in the present embodiment, after a task start event such as an external interrupt or a soft interrupt occurs, the process for generating a task request is only to set a task number in a queue corresponding to a level. , The task can be started at high speed with little overhead.

【0047】図5は、あらかじめプログラマブルに設定
された周期で、定周期タスクのタスク起動イベントが発
生した場合、そのタスク番号を優先度レベルに応じて第
1の実施例で説明したタスクキューファイル1に自動的
にセットする手段の実施例(以下、第2の実施例とい
う)を説明するものであり、前記発明の原理で説明した
図2に対応するものである。
FIG. 5 shows that when a task start event of a fixed-period task occurs at a cycle that is set in advance in a programmable manner, the task number is assigned to the task queue file 1 described in the first embodiment according to the priority level. This embodiment describes an embodiment (hereinafter referred to as a second embodiment) of a means for automatically setting the position, and corresponds to FIG. 2 described based on the principle of the present invention.

【0048】図5において、図2及び図3と同一部分に
は同一符号を付してある。すなわち、10は前記第1の
実施例で説明したタスク起動装置であり、その構成は図
3と同一であるので、同図の煩雑化を防ぐため、図5で
はそれぞれの構成要素は図示されていない。
In FIG. 5, the same parts as those in FIGS. 2 and 3 are denoted by the same reference numerals. That is, reference numeral 10 denotes the task activation device described in the first embodiment, and the configuration thereof is the same as that of FIG. 3; therefore, each component is shown in FIG. Absent.

【0049】図5において、30は定周期割り込み制御
回路であり、概略的には、定周期割り込みのベース時間
Tを設定可能な定周期タイマ31と、0レベル、1レベ
ル、2レベルの各レベル毎に設けられたそれぞれの定周
期タスク起動回路群40により構成されている。
In FIG. 5, reference numeral 30 denotes a fixed-period interrupt control circuit, which is generally a fixed-period timer 31 capable of setting a base time T for a fixed-period interrupt, and 0 level, 1 level, and 2 levels. It is composed of a group of fixed-cycle task activation circuits 40 provided for each.

【0050】上記各定周期タスク起動回路群40は、各
レベルのタスク番号に対応して定周期タスク起動回路4
0 ,411 ,・・・が設けられた構成となっている。
たとえば、0レベルの定周期タスク起動回路群40を例
にとって説明すると、この0レベルのタスク番号#0,
#1,・・・ごとに定周期タスク起動回路400 ,40
1 ,・・・が設けられている。そして、これら各定周期
タスク起動回路400,401 ,・・・は図2で説明し
たように、タスク番号を設定するタスク番号レジスタ5
1とそのタスクの周期Nを設定する周期設定レジスタ5
2、さらにダウンカウンタ53とで構成されている。
The fixed-period task activation circuit group 40 corresponds to the task number of each level.
1 0, 41 1, has a configuration in which ... is provided.
For example, taking the 0-level fixed-period task activation circuit group 40 as an example, this 0-level task number # 0,
# 1,... Fixed period task activation circuits 40 0 , 40
1 , ... are provided. Each of these fixed-period task activation circuits 40 0 , 40 1 ,..., As described with reference to FIG.
1 and a cycle setting register 5 for setting the cycle N of the task
2, and a down counter 53.

【0051】上記周期設定レジスタ52に周期Nを設定
すると、その内容(周期N)はダウンカウンタ53にも
セットされる。このような構成において、次にその動作
を図6のタイムチャートを参照しながら説明する。ま
ず、CPU20は定周期タイマ31に割り込み周期のベ
ース時間Tを設定し、また、各レベル毎の定周期タスク
起動回路群40に対して定周期タスク初期設定を行う。
たとえば、0レベルの定周期タスク起動回路群40のタ
スク番号#0の初期設定を例にとって説明すると、ま
ず、タスク番号レジスタ51にそのタスク番号を設定す
るとともに周期設定レジスタ52にそのタスク周期N
(ここではN=4とする)を設定する。このタスク周期
Nを設定すると、その内容はダウンカウンタ53にもセ
ットされる。
When the cycle N is set in the cycle setting register 52, the content (cycle N) is also set in the down counter 53. In such a configuration, the operation will be described next with reference to the time chart of FIG. First, the CPU 20 sets the base time T of the interrupt cycle in the fixed cycle timer 31 and performs the fixed cycle task initialization for the fixed cycle task activation circuit group 40 for each level.
For example, a description will be given by taking as an example the initial setting of the task number # 0 of the fixed-cycle task activation circuit group 40 of level 0. First, the task number is set in the task number register 51 and the task cycle N is set in the cycle setting register 52.
(Here, N = 4) is set. When this task cycle N is set, its contents are also set in the down counter 53.

【0052】このような初期設定は他の定周期タスク起
動回路に対しても同様に行い、すべての定周期タスクの
初期設定を終了すると、CPU20からの定周期タイマ
コントロール指定により定周期タイマ31を有効にす
る。ここまでが初期設定としてのCPU20の処理であ
る。
Such initialization is similarly performed for the other fixed-cycle task activation circuits. When the initialization of all the fixed-cycle tasks is completed, the fixed-cycle timer 31 is designated by the CPU 20 to control the fixed-cycle timer. To enable. This is the processing of the CPU 20 as the initial setting.

【0053】定周期タイマ31が有効になると、T時間
後にカウントクロック信号CLが出され、これにより、
ダウンカウンタ53が−1される。すなわち、ダウンカ
ウンタ53には「4」がセットされているので、最初の
カウントクロック信号CLにより、−1されてダウンカ
ウンタ53の内容は「3」となる。このようにして、定
周期タイマ31からのカウントクロックにより、次々デ
クリメントされ、ダウンカウンタ53の内容が「0」に
なると、タスク番号レジスタ51に格納されているタス
ク番号#0が、そのタスクレベルに対応したキューファ
イル1にセットされ、前記したような第1の実施例によ
る処理手順にてタスク要求が発生される。
When the fixed-period timer 31 becomes valid, a count clock signal CL is output after a time T, whereby
The down counter 53 is decremented by one. That is, since “4” is set in the down counter 53, the count value is decremented by 1 by the first count clock signal CL, and the content of the down counter 53 becomes “3”. In this manner, the count value is decremented one after another by the count clock from the fixed-cycle timer 31, and when the content of the down counter 53 becomes "0", the task number # 0 stored in the task number register 51 is changed to the task level. The task is set in the corresponding queue file 1 and a task request is generated in the processing procedure according to the first embodiment as described above.

【0054】これと同時に、周期設定レジスタ52の値
Nが再びダウンカウンタ53にセットされて上記同様、
定周期タイマ31からのカウントクロックによりダウン
カウントされるという動作が繰り返し行われる。したが
って、上記タスク番号#0の定周期割り込みが起動され
る周期は、T=100msecとすれば、N×Tにより(こ
の場合N=4)、400msecとなる。
At the same time, the value N of the cycle setting register 52 is set again in the down counter 53, and
The operation of counting down by the count clock from the fixed period timer 31 is repeatedly performed. Therefore, if T = 100 msec, the cycle at which the fixed cycle interrupt of the task number # 0 is activated is 400 msec by N × T (N = 4 in this case).

【0055】このように設定された時間が(N×T)が
経過すると、自動的にタスク起動イベントが発生し、C
PUからの操作がなくてもタスク番号をレベル毎に管理
されたキューファイルにセットすることができ、キュー
ファイルにセットされたのちは、前記第1の実施例によ
る処理でタスク要求を発生することができる。
When the set time (N × T) elapses, a task start event is automatically generated, and C
The task number can be set in the queue file managed for each level without any operation from the PU. After the task number is set in the queue file, a task request is generated in the processing according to the first embodiment. Can be.

【0056】なお、上記第2の実施例において、ダウン
カウンタ53は常に有効状態にあって、定周期タイマ3
1が有効となることにより出力されるカウントクロック
によりダウンカウンタ53がデクリメントされる例を示
したが、この方式に限らず、定周期タイマ31のカウン
トクロックは常に出力されていて、ダウンカウンタ53
を有効とする制御を行い、このダウンカウンタ53を有
効とすることにより、上記カウントクロックによってデ
クリメントする方式でも良い。
In the second embodiment, the down counter 53 is always in the valid state,
Although the example in which the down counter 53 is decremented by the count clock output when 1 becomes valid is not limited to this method, the count clock of the fixed-period timer 31 is always output, and the down counter 53 is decremented.
Is performed, and the down-counter 53 is made valid so that the count is decremented by the count clock.

【0057】[0057]

【発明の効果】本発明によれば、外部割り込みやソフト
割り込みによるタスク起動イベントが起きてから、タス
ク要求を発生させるための処理としては、タスク番号を
そのタスクのレベルに対応したキューファイルにセット
するだけであり、タスクのキュー管理や割り込みタスク
を考慮した優先度判定、割り込みマスクレジスタ制御に
かかるCPU処理が不要となり、高速なタスク起動が可
能となる。
According to the present invention, as a process for generating a task request after a task start event due to an external interrupt or a soft interrupt occurs, a task number is set in a queue file corresponding to the task level. This eliminates the need for CPU processing related to task queue management, priority determination in consideration of interrupt tasks, and interrupt mask register control, and high-speed task activation becomes possible.

【0058】また、定周期プログラムによるタスク起動
イベントに対しては、このようなタスク起動イベントが
発生するか否かの管理が不要となり。さらにタスク起動
イベントが発生してから、そのタスク番号をそのタスク
のレベルに応じたキューファイルに自動的にセットでき
るので、よりオーバヘッドの少ない高速なタスク起動が
可能となる。
Further, it is not necessary to manage whether such a task activation event occurs for a task activation event by a fixed-cycle program. Furthermore, since the task number can be automatically set in the queue file according to the level of the task after the occurrence of the task activation event, the task activation with less overhead can be performed.

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

【図1】本発明の原理を説明する構成図である。FIG. 1 is a configuration diagram illustrating the principle of the present invention.

【図2】定周期プログラムによるタスク起動イベントの
場合の本発明の原理を説明する構成図である。
FIG. 2 is a configuration diagram illustrating the principle of the present invention in the case of a task activation event by a fixed-cycle program.

【図3】本発明の第1の実施例を説明する構成図であ
る。
FIG. 3 is a configuration diagram illustrating a first embodiment of the present invention.

【図4】同実施例におけるタスクキューファイルを説明
する図である。
FIG. 4 is a diagram illustrating a task queue file according to the embodiment.

【図5】本発明の第2の実施例を説明する構成図であ
る。
FIG. 5 is a configuration diagram illustrating a second embodiment of the present invention.

【図6】第2の実施例の動作を説明するタイムチャート
である。
FIG. 6 is a time chart for explaining the operation of the second embodiment.

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

1 タスクキューファイル 2 タスク優先レベル判定回路 3 タスク番号設定レジスタ 4 タスク番号選択手段 31 定周期タイマ 51 タスク番号レジスタ 52 周期設定レジスタ 53 カウント手段(ダウンカウンタ) Reference Signs List 1 task queue file 2 task priority level judgment circuit 3 task number setting register 4 task number selection means 31 fixed cycle timer 51 task number register 52 cycle setting register 53 counting means (down counter)

フロントページの続き (56)参考文献 特開 平4−86923(JP,A) 特開 昭63−163640(JP,A) 特開 昭49−123546(JP,A) 特開 平3−157733(JP,A) 特開 昭58−54437(JP,A) 特開 平3−177932(JP,A) (58)調査した分野(Int.Cl.7,DB名) G06F 9/46 Continuation of the front page (56) References JP-A-4-86923 (JP, A) JP-A-63-163640 (JP, A) JP-A-49-123546 (JP, A) JP-A-3-157733 (JP) JP-A-58-54437 (JP, A) JP-A-3-17732 (JP, A) (58) Fields investigated (Int. Cl. 7 , DB name) G06F 9/46

Claims (4)

(57)【特許請求の範囲】(57) [Claims] 【請求項1】 タスクの優先度に応じてそのタスク番号
を優先度レベル毎にキューイングするタスクキューファ
イル(1)と、 このタスクキューファイル(1)にタスク番号がレベル
に応じてキューイングされると各レベルのキュートップ
のタスク番号がレベル毎にセットされるタスク番号レジ
スタ(3)と、 上記各レベルの優先順位を判定して、その時点における
最も優先順位の高い優先レベル情報を出力するとともに
タスク要求を出力するタスク優先レベル判定回路(2)
と、 このタスク優先レベル判定回路(2)からの上記優先レ
ベル情報を受けて、上記タスク番号設定レジスタ(3)
にセットされている各レベル毎のキュートップのタスク
番号のうち、上記優先レベルのキュートップのタスク番
号を選択してタスク番号情報として出力するタスク番号
選択手段(4)と、 を備えたことを特徴とするタスク起動方式。
1. A task queue file (1) for queuing a task number for each priority level according to the priority of a task, and task numbers are queued in the task queue file (1) according to the level. Then, the task number register (3) in which the task number of the queue top of each level is set for each level, the priority of each level is determined, and the highest priority information at that time is output. Task priority level determination circuit for outputting a task request together with the task priority level (2)
Receiving the priority level information from the task priority level determination circuit (2), and receiving the task number setting register (3)
Task number selecting means (4) for selecting the task number of the cue top of the priority level among the task numbers of the cue top for each level set in, and outputting the same as task number information. Characterized task activation method.
【請求項2】 タスクの優先度に応じてそのタスク番号
を優先度レベル毎にキューイングするタスクキューファ
イル(1)と、 このタスクキューファイル(1)にタスク番号がレベル
に応じてキューイングされると各レベルのキュートップ
のタスク番号がレベル毎にセットされるタスク番号設定
レジスタ(3)と、 上記各レベルの優先順位を判定して、その時点における
最も優先順位の高い優先レベル情報を出力するとともに
タスク要求を出力するタスク優先レベル判定回路(2)
と、 このタスク優先レベル判定回路(2)からの上記優先レ
ベル情報を受けて、上記タスク番号設定レジスタ(3)
にセットされている各レジスタ毎のキュートップのタス
ク番号のうち、上記優先レベルのキュートップのタスク
番号を選択してタスク番号情報として出力するタスク番
号選択手段(4)と、 定周期割り込みのベース時間Tを設定可能な定周期タイ
マ(31)と、 各レベルの各々のタスク毎に設けられ、各々のタスク番
号をセットするタスク番号レジスタ(51)と、 各レベルの各々のタスク毎に設けられ、各々のタスク周
期Nをセットするタスク周期設定レベル(52)と、 各レベルの各々のタスク毎に設けられ、上記定周期タイ
マ(31)が出力するカウントクロックに同期して上記
タスク周期Nをカウントするカウント手段(53)と、 を有し、上記カウント手段(53)のカウント値が上記
Nをカウントすると、対応するタスク番号を上記タスク
キューファイル(1)の対応するレベル領域にセットす
ることを特徴とするタスク起動方式。
2. A task queue file (1) for queuing a task number for each priority level according to the priority of the task, and the task numbers are queued in the task queue file (1) according to the level. Then, the task number setting register (3) in which the task number of the queue top of each level is set for each level, and the priority of each level is determined, and the highest priority information at that time is output. Task priority level judgment circuit that outputs a task request at the same time (2)
Receiving the priority level information from the task priority level determination circuit (2), and receiving the task number setting register (3)
A task number selecting means (4) for selecting the task number of the queue top of the priority level from among the task numbers of the queue top for each register set in the register and outputting as task number information; A fixed-period timer (31) capable of setting a time T, a task number register (51) provided for each task of each level and setting a task number, and a task number register (51) provided for each task of each level A task cycle setting level (52) for setting each task cycle N; and a task cycle N provided for each task of each level and synchronized with a count clock output from the fixed cycle timer (31). Counting means (53) for counting, and when the count value of the counting means (53) counts the N, a corresponding task number The task starting method, characterized in that set to the corresponding level area of the task queue file (1).
【請求項3】 前記タスク優先レベル判定回路(2)
は、タスクキューファイル(1)にレベルに応じてタス
ク番号がキューイングされると、対応するレベルのフラ
グをセットするタスク要求フラグ(21)と、 レベル毎にマスク可能で、あるレベルをマスクするとそ
のレベル以下の優先順位のレベルをすべてマスクするマ
スク情報が設定されるタスク優先レベルマスクレジスタ
(23)と、 このタスク優先レベルマスクレジスタ(23)のマスク
情報と上記タスク要求フラグ(21)のフラグ情報をも
とにタスクレベルの優先度判定を行い、その時点におけ
る最も優先度の高い優先レベル情報を出力すると共にタ
スク要求を出力するプライオリティエンコーダ(25)
と、 このプライオリティエンコーダ(25)により優先権を
得たレベル情報がセットされるタスク優先レベルレジス
タ(22)と、 CPUなどの外部装置が上記タスク要求を受けて、タス
ク番号を読み出すと、その時点までの上記タスク優先レ
ベルマスクレジスタ(23)のマスク情報が退避される
マスク情報退避レジスタ(24)と、 を備えたことを特徴とする請求項1または2記載のタス
ク起動方式。
3. The task priority level determination circuit (2).
When a task number is queued in a task queue file (1) according to a level, a task request flag (21) for setting a flag of a corresponding level and a maskable for each level. A task priority level mask register (23) in which mask information for masking all levels of priority lower than that level is set; mask information of the task priority level mask register (23); and a flag of the task request flag (21) Priority encoder (25) that performs task level priority determination based on the information, outputs the highest priority level information at that time, and outputs a task request
And a task priority level register (22) in which the level information obtained priority by the priority encoder (25) is set. When an external device such as a CPU receives the task request and reads out the task number, 3. A task activation method according to claim 1, further comprising: a mask information saving register (24) for saving the mask information of the task priority level mask register (23) up to the above.
【請求項4】 上記マスク情報退避レジスタ(24)に
退避されたマスク情報は、CPUなど外部装置にてタス
ク処理終了後、タスク優先レベルマスクレジスタ(2
3)に復帰させることを特徴とする請求項1または2記
載のタスク起動方式。
4. The mask information saved in the mask information save register (24) is stored in a task priority level mask register (2) after task processing is completed by an external device such as a CPU.
3. The task starting method according to claim 1, wherein the task is returned to step (3).
JP04333398A 1992-12-15 1992-12-15 Task activation method Expired - Fee Related JP3075646B2 (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP04333398A JP3075646B2 (en) 1992-12-15 1992-12-15 Task activation method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP04333398A JP3075646B2 (en) 1992-12-15 1992-12-15 Task activation method

Publications (2)

Publication Number Publication Date
JPH06187173A JPH06187173A (en) 1994-07-08
JP3075646B2 true JP3075646B2 (en) 2000-08-14

Family

ID=18265674

Family Applications (1)

Application Number Title Priority Date Filing Date
JP04333398A Expired - Fee Related JP3075646B2 (en) 1992-12-15 1992-12-15 Task activation method

Country Status (1)

Country Link
JP (1) JP3075646B2 (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP5243711B2 (en) * 2006-11-10 2013-07-24 セイコーエプソン株式会社 Processor

Also Published As

Publication number Publication date
JPH06187173A (en) 1994-07-08

Similar Documents

Publication Publication Date Title
US5708814A (en) Method and apparatus for reducing the rate of interrupts by generating a single interrupt for a group of events
JP3525518B2 (en) Data transfer device
JP3075646B2 (en) Task activation method
JP2000259429A (en) Device and method for managing timer
JP2821345B2 (en) Asynchronous I / O control method
JPH07104830B2 (en) Computer system and method of operating a computer system
JP2594600B2 (en) Single chip microcomputer
JPH05108380A (en) Data processing system
JP2947195B2 (en) Interrupt mask control method
JP2585905B2 (en) Multitask execution device
JP2731768B2 (en) Memory controller
WO2003075167A1 (en) Method and arrangement for virtual direct memory access
JP3613513B2 (en) Operating system timer management method
JP2776785B2 (en) Serial data transfer device
JP3134811B2 (en) Data processing device
JP3367949B2 (en) Image data processing device
JPH06274436A (en) Data transfer system
JP2885631B2 (en) Operating system management device and operating system management method
JP2870812B2 (en) Parallel processor
JP4003113B2 (en) Multithread control method in telephone exchange
JP2747154B2 (en) I / O processor
JP3221904B2 (en) Control register writing device
JPH1124944A (en) Process synchronization method
Reisinger Inside the MARS Operating System
JPH0322142A (en) Interruption control device for microprocessor

Legal Events

Date Code Title Description
A01 Written decision to grant a patent or to grant a registration (utility model)

Free format text: JAPANESE INTERMEDIATE CODE: A01

Effective date: 20000530

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250

R250 Receipt of annual fees

Free format text: JAPANESE INTERMEDIATE CODE: R250

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20080609

Year of fee payment: 8

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20090609

Year of fee payment: 9

S111 Request for change of ownership or part of ownership

Free format text: JAPANESE INTERMEDIATE CODE: R313117

S531 Written request for registration of change of domicile

Free format text: JAPANESE INTERMEDIATE CODE: R313531

S533 Written request for registration of change of name

Free format text: JAPANESE INTERMEDIATE CODE: R313533

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20090609

Year of fee payment: 9

R350 Written notification of registration of transfer

Free format text: JAPANESE INTERMEDIATE CODE: R350

FPAY Renewal fee payment (event date is renewal date of database)

Free format text: PAYMENT UNTIL: 20100609

Year of fee payment: 10

LAPS Cancellation because of no payment of annual fees