JP2985092B2 - Time-division multitasking controller - Google Patents
Time-division multitasking controllerInfo
- Publication number
- JP2985092B2 JP2985092B2 JP2117474A JP11747490A JP2985092B2 JP 2985092 B2 JP2985092 B2 JP 2985092B2 JP 2117474 A JP2117474 A JP 2117474A JP 11747490 A JP11747490 A JP 11747490A JP 2985092 B2 JP2985092 B2 JP 2985092B2
- Authority
- JP
- Japan
- Prior art keywords
- address
- task
- tcb
- time
- value
- 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
Links
Description
【発明の詳細な説明】 (産業上の利用分野) 本発明は、1つの中央演算処理装置(CPU)を用いて
複数の仕事を時分割並行処理する時分解マルチタスク処
理装置に関する。Description: TECHNICAL FIELD The present invention relates to a time-resolved multitask processing device that performs a plurality of tasks in a time-sharing and parallel manner using one central processing unit (CPU).
(従来の技術) 従来、この種時分割マルチタスク制御装置は、特開平
1−169540号公報に記載されているように、1組の制御
用レジスタ群及びキュー切り替え制御部の管理下で複数
のタスク実行キューにひとつの中央演算処理装置を時分
割で占有させ、複数のタスク実行キューにより複数のタ
スクを時分割並行処理するように構成している。なお、
制御用レジスタ群の中には、複数のタスク実行キューの
切り替えモードを設定するキュー切り替えモードレジス
タ、タスク実行キューを指定するキュー切り替えスケジ
ューリングレジスタ、各タスク実行キューのCPU占有時
間を設定するキュー実行予定時間指定レジスタ等が備え
られてマルチタスクを時分割並行処理できるように構成
されている。(Prior Art) Conventionally, as described in Japanese Patent Application Laid-Open No. 1-169540, this kind of time-division multitasking control apparatus has a plurality of control registers under the control of a set of control registers and a queue switching control unit. One central processing unit is occupied by the task execution queue in a time-sharing manner, and a plurality of tasks are processed by the plurality of task execution queues in a time-division parallel manner. In addition,
Among the control registers, a queue switching mode register that sets the switching mode of multiple task execution queues, a queue switching scheduling register that specifies the task execution queue, and a queue execution schedule that sets the CPU occupation time of each task execution queue A time designation register and the like are provided so that multitasking can be performed in a time-division parallel manner.
(発明が解決しようとする課題) しかしながら、上記従来の構成では、複数のタスクを
1つのCPUで実行する場合、タスクの時間管理及び割り
込み処理を用いてタスクの切り替えを行うために、プロ
グラムの作成時に予め優先順位をつけたタスク・コント
ロール・ブロック(以下、TCBという)テーブルを作
り、TCBのメモリの内容を実行するタスクの先頭アドレ
スに書き替えることにより、実行したいタスクの管理を
行ってきた。しかし、制御しなければならないタスクの
数が増えるとこのTCBに格納されるタスクの数が多くな
る。また、この方法ではつぎに実行するタスクを捜すた
め優先順位の高いタスクから検索するため、優先順位の
低いタスクを検索する時間が長くなる。このように複数
のタスクを1つのCPUで実行するには、各タスクの切り
替え設定や各タスクの実行時間の優先順位をプログラム
で設定し、検索するため実際のタスクの実行時間が短く
なり、その他の制御プログラムが実行されている時間が
長くなるという問題があった。(Problems to be Solved by the Invention) However, in the above-described conventional configuration, when a plurality of tasks are executed by one CPU, a program is created in order to perform task switching using task time management and interrupt processing. At times, a task control block (hereinafter referred to as TCB) table to which priorities are assigned in advance is created, and the contents of the memory of the TCB are rewritten to the start address of the task to be executed, thereby managing the task to be executed. However, as the number of tasks that need to be controlled increases, the number of tasks stored in this TCB increases. Further, in this method, since the task to be executed next is searched for from the task with the higher priority, the time for searching for the task with the lower priority becomes longer. In order to execute multiple tasks on a single CPU in this way, the switching settings of each task and the priority of the execution time of each task are set by the program, and the actual task execution time is shortened by searching. However, there is a problem that the time during which the control program is executed becomes long.
本発明はこのような従来の問題を解決する時分割マル
チタスク制御装置を提供することを目的とするものであ
る。An object of the present invention is to provide a time-division multitask control device that solves such a conventional problem.
(課題を解決するための手段) 本発明は上記目的を達成するために、時分割マルチタ
スク制御装置は、1つの中央演算処理装置で複数のタス
クを実行する制御装置であって、各アドレスが示すデー
タとして、アドレス自体を示す値、あるいはその値に代
えて実行タスクの先頭アドレスの値を格納したタスク・
コントロール・ブロック・テーブルにおけるアドレスの
それ自体を示す値とそのアドレスにデータとして格納さ
れた値とを比較する比較手段と、そのアドレスからフラ
グレジスタを選択する選択手段と、選択手段の出力によ
って比較手段の出力を保持したフラグレジスタが複数あ
る場合に最優先のものを選択して1つの指定信号を出力
するプライオリティエンコーダと、プライオリティエン
コーダの指定信号と初期化により書き込まれるベースア
ドレスとを合成して、タスク・コントロール・ブロック
・テーブルのアドレスを出力するポートとを備え、複数
のタスクのうち最優先のタスクを選択するようにしたも
のである。(Means for Solving the Problems) In order to achieve the above object, the present invention provides a time-division multitasking control device in which a single central processing unit executes a plurality of tasks. As the data to indicate, a task that stores the value of the address itself, or the value of the start address of the execution task in place of that value.
Comparing means for comparing a value indicating the address itself in the control block table with a value stored as data at the address; selecting means for selecting a flag register from the address; and comparing means based on the output of the selecting means When there are a plurality of flag registers holding the outputs of the priority encoder, the priority encoder that selects the highest priority and outputs one designated signal, and the designated signal of the priority encoder and the base address written by initialization are synthesized, A port for outputting the address of the task control block table, and the highest priority task is selected from a plurality of tasks.
(作 用) したがって本発明によれば、TCBに必要なタスクの先
頭アドレスをセットするだけで優先順に実行するタスク
を容易に検索し、タスクの実行仕様を設定できる。(Operation) Therefore, according to the present invention, it is possible to easily search for tasks to be executed in the priority order and set the execution specifications of the tasks simply by setting the start address of the necessary task in the TCB.
(実施例) 第1図は本発明の一実施例における最優先のタスク選
択制御回路の基本的な構成を示すものである。第1図に
おいて、1はアドレスデータ比較回路、2はデコーダ、
3はフラグレジスタ、4はプライオリティエンコーダ、
5はTCBベースアドレス、6はポートである。(Embodiment) FIG. 1 shows a basic configuration of a highest priority task selection control circuit in one embodiment of the present invention. In FIG. 1, 1 is an address data comparison circuit, 2 is a decoder,
3 is a flag register, 4 is a priority encoder,
5 is a TCB base address and 6 is a port.
従来、第2図に示すようにTCBにはタスクを使用しな
いときは自分のアドレス(TCBアドレス)が書かれてい
る。TCBアドレスTCB2がタスク1に対応するとき、タス
ク1を実行するときはTCB2アドレスをその実行しようと
するタスク1の先頭アドレスに書き替える。ソフトウエ
アでTCBに登録されているタスクを検索していって、タ
スク1の先頭アドレスが一番優先順位が高いときはそこ
に書かれているタスク1を実行し、終了するとTCBのTCB
2アドレスをタスク1の先頭アドレスからTCB2アドレス
に書き替える。この時点で、またつぎの実行タスクがあ
るかTCBを検索し、時分割マルチタスクを実行する。本
発明の実施例では上記検索の部分をハードウエア化し、
優先順位の高いタスクの順にTCBアドレスを専用のポー
トから読み取ることができるようにしたものである。第
3図は本発明の実施例におけるTCB制御フローを示した
ものである。Conventionally, as shown in FIG. 2, when a task is not used, its own address (TCB address) is written in the TCB. When the task 1 is executed when the TCB address TCB2 corresponds to the task 1, the TCB2 address is rewritten to the head address of the task 1 to be executed. The software searches for a task registered in the TCB. If the first address of the task 1 has the highest priority, the task 1 written in that task is executed.
Rewrite address 2 from the start address of task 1 to TCB2 address. At this point, the TCB is searched for the next task to be executed, and the time division multitask is executed. In the embodiment of the present invention, the above search part is implemented by hardware,
TCB addresses can be read from dedicated ports in the order of tasks with higher priorities. FIG. 3 shows a TCB control flow in the embodiment of the present invention.
次に、第1図の実施例の動作について第3図を参照し
て説明する。TCBベースアドレスを初期化で書き込む(S
1)、またTCBには初期化でTCBアドレスを書き込む
(S2)。この時、TCBアドレスとTCBアドレスに対応する
位置に書き込むアドレス(データ)は一致しているた
め、アドレスデータ比較回路1の出力は0となる。ま
た、デコーダ2はフラグレジスタ3の対応するF/Fへラ
ッチパルスを発生し、フラグレジスタ3の該当F/Fの出
力は0となる。したがって、プライオリティエンコーダ
4の出力はどれも選ばれていないため一番優先順位の低
い信号を出力している(何れも選択されない時プライオ
リティエンコーダは最低優先順位を出力する)。この時
点でポート6を読む(S3)とプライオリティエンコーダ
4とTCBベースアドレス5が合成されてTCBアドレスTCB3
1が読める。Next, the operation of the embodiment of FIG. 1 will be described with reference to FIG. Write TCB base address by initialization (S
1), also in TCB writes TCB address initialization (S 2). At this time, since the TCB address and the address (data) to be written in the position corresponding to the TCB address match, the output of the address data comparison circuit 1 becomes 0. Further, the decoder 2 generates a latch pulse to the corresponding F / F of the flag register 3, and the output of the corresponding F / F of the flag register 3 becomes 0. Therefore, since none of the outputs of the priority encoder 4 are selected, the signal with the lowest priority is output (when none is selected, the priority encoder outputs the lowest priority). At this time, when the port 6 is read (S 3 ), the priority encoder 4 and the TCB base address 5 are combined to form the TCB address TCB3
I can read 1.
割込みによりタスク1を実行するためにTCB2アドレス
のTCBの内容をタスク1の先頭アドレスに書き替えると
(S7)、割込みから終了後に、タスク選択制御回路のア
ドレスデータ比較回路1は、TCBテーブルのアドレスで
あるTCB2において、TCB2アドレスと書き替えられたタス
ク1先頭アドレス(データ)は一致していないため、ア
ドレスデータ比較回路1の出力は1となる。またデコー
ダ2はフラグレジスタ3の該当F/Fに対しラッチパルス
を発生し、該当F/Fの出力は1となる。したがって、プ
ライオリティエンコーダ4の出力はTCB2を選ぶため「00
02H」(図示せず)の信号を出力している。この時点でT
CBの検索をするためにポート6を読むと、TCBベースア
ドレス5とプライオリティエンコーダ4のアドレスが合
成されてTCB2アドレスが読める(S3)。ここで、TCB2に
書かれているTCBのデータを読むと(S4)タスク1の先
頭アドレスが書かれているため、タスク1を実行し
(S5)、終了するとTCB2の内容をタスク1の先頭アドレ
スからTCB2アドレスに書き替える(S6)。この結果、TC
Bアドレスと書き込むアドレス(データ)は一致してい
るため、アドレスデータ比較回路1の出力は0となる。
またデコーダ2はフラグレジスタ3のラッチパルスを発
生し、フラグレジスタ3の該当するF/Fの出力は0とな
る。従って、プライオリティエンコーダ4の出力はどれ
も選ばれないため一番優先順位の低い信号を出力してい
る。この時点でポート6を読むとプライオリティエンコ
ーダ4とTCBベースアドレス5のアドレスが合成されてT
CB31アドレスが読める。またつぎの実行タスクがあるか
TCBテーブルのつぎのアドレスにおいて、前記の処理を
行いポート6を読み、これによって時分割マルチタスク
を実行する。When rewritten contents of the TCB for TCB2 address to perform a task 1 to the start address of the task 1 by an interrupt (S 7), after completion of the interrupt, the address data comparison circuit 1 of the task selection control circuit, the TCB table Since the TCB2 address and the rewritten task 1 start address (data) do not match in the address TCB2, the output of the address data comparison circuit 1 is 1. The decoder 2 generates a latch pulse for the corresponding F / F of the flag register 3, and the output of the corresponding F / F becomes 1. Therefore, the output of the priority encoder 4 is "00" to select TCB2.
02H "(not shown). At this point T
Reading the port 6 to the search for CB, TCB2 address is read address of the TCB base address 5 and a priority encoder 4 are combined (S 3). Here, when the data of TCB written in TCB2 is read (S 4 ), since the start address of task 1 is written, task 1 is executed (S 5 ). rewritten from the start address to TCB2 address (S 6). As a result, TC
Since the B address and the write address (data) match, the output of the address data comparison circuit 1 becomes 0.
The decoder 2 generates a latch pulse for the flag register 3, and the output of the corresponding F / F of the flag register 3 becomes 0. Therefore, since none of the outputs of the priority encoder 4 are selected, a signal having the lowest priority is output. At this point, when port 6 is read, the addresses of priority encoder 4 and TCB base address 5 are combined and T
CB31 address can be read. Is there another task to execute
At the next address in the TCB table, the above processing is performed to read the port 6, thereby executing the time-division multitasking.
(発明の効果) 本発明は上記実施例から明らかなように、TCBテーブ
ルに必要なタスクの先頭アドレスをセットするだけで優
先順に実行するタスクを容易にかつ短時間に検索し、タ
スクの実行仕様を設定できるという効果を有する。(Effect of the Invention) As is clear from the above embodiment, the present invention easily and quickly searches for tasks to be executed in priority order only by setting the start address of a necessary task in the TCB table, and executes task execution specifications. Has the effect of being able to set
第1図は本発明の一実施例における時分割マルチタスク
制御装置の基本的な構成図、第2図は従来のTCBにより
タスク処理を説明する図、第3図は本発明の一実施例に
おけるTCB制御フローチャートである。 1……アドレスデータ比較回路、2……デコーダ、3…
…フラグレジスタ、4……プライオリティエンコーダ、
5……TCBベースアドレス、6……ポート。FIG. 1 is a diagram showing a basic configuration of a time-division multi-task control device according to an embodiment of the present invention, FIG. 2 is a diagram illustrating task processing by a conventional TCB, and FIG. It is a TCB control flowchart. 1 ... address data comparison circuit, 2 ... decoder, 3 ...
... Flag register, 4 ... Priority encoder,
5: TCB base address, 6: Port.
───────────────────────────────────────────────────── フロントページの続き (58)調査した分野(Int.Cl.6,DB名) G06F 9/46,15/00 G06F 15/16,1/00 ──────────────────────────────────────────────────続 き Continued on the front page (58) Field surveyed (Int.Cl. 6 , DB name) G06F 9 / 46,15 / 00 G06F 15 / 16,1 / 00
Claims (1)
実行する制御装置であって、 各アドレスが示すデータとして、アドレス自体を示す
値、あるいは該値に代えて実行タスクの先頭アドレスの
値を格納したタスク・コントロール・ブロック・テーブ
ルにおけるアドレスのそれ自体を示す値と当該アドレス
にデータとして格納された値とを比較する比較手段と、
当該アドレスからフラグレジスタを選択する選択手段
と、該選択手段の出力によって前記比較手段の出力を保
持したフラグレジスタが複数ある場合に最優先のものを
選択して1つの指定信号を出力するプライオリティエン
コーダと、該プライオリティエンコーダの指定信号と初
期化により書き込まれるベースアドレスとを合成して、
前記タスク・コントロール・ブロック・テーブルのアド
レスを出力するポートとを備え、複数のタスクのうち最
優先のタスクを選択することを特徴とする時分割マルチ
タスク制御装置。1. A control device for executing a plurality of tasks by one central processing unit, wherein data indicated by each address is a value indicating an address itself, or a value of a head address of an execution task in place of the value. Comparing means for comparing a value indicating the address itself in the task control block table storing the value with a value stored as data at the address;
Selecting means for selecting a flag register from the address, and priority encoder for selecting the highest priority one and outputting one designation signal when there are a plurality of flag registers holding the output of the comparing means by the output of the selecting means And a designation signal of the priority encoder and a base address written by initialization,
A port for outputting an address of the task control block table, wherein a highest priority task is selected from a plurality of tasks.
Priority Applications (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| JP2117474A JP2985092B2 (en) | 1990-05-09 | 1990-05-09 | Time-division multitasking controller |
Applications Claiming Priority (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| JP2117474A JP2985092B2 (en) | 1990-05-09 | 1990-05-09 | Time-division multitasking controller |
Publications (2)
| Publication Number | Publication Date |
|---|---|
| JPH0415831A JPH0415831A (en) | 1992-01-21 |
| JP2985092B2 true JP2985092B2 (en) | 1999-11-29 |
Family
ID=14712587
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| JP2117474A Expired - Fee Related JP2985092B2 (en) | 1990-05-09 | 1990-05-09 | Time-division multitasking controller |
Country Status (1)
| Country | Link |
|---|---|
| JP (1) | JP2985092B2 (en) |
-
1990
- 1990-05-09 JP JP2117474A patent/JP2985092B2/en not_active Expired - Fee Related
Also Published As
| Publication number | Publication date |
|---|---|
| JPH0415831A (en) | 1992-01-21 |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| KR950012293B1 (en) | Information processing apparatus and information processing method using it | |
| JP2002533807A (en) | Interrupt / software control thread processing | |
| KR970016979A (en) | Queuing system and method of tasks in a multiprocessing system | |
| JPH05274276A (en) | Digital signal processing subsystem for personal computer | |
| US5678048A (en) | Interrupt vector method and apparatus for loading a slot memory address counter | |
| US6883171B1 (en) | Dynamic address windowing on a PCI bus | |
| JP3987277B2 (en) | Pulse signal generator | |
| JP2985092B2 (en) | Time-division multitasking controller | |
| JP2553698B2 (en) | Time-division multitasking execution device | |
| JP2574349B2 (en) | Time-division multitasking execution device | |
| JPS583177A (en) | Data processing system | |
| JP2927102B2 (en) | Instruction string switching method and arithmetic processor using the same | |
| JPH11306040A (en) | Emulator trace device | |
| JPH0199132A (en) | Multi-task executing device | |
| JPH03188531A (en) | Time-division multitask executing device | |
| JPS62151942A (en) | Task changing-over system | |
| JPS6229813B2 (en) | ||
| JPH0376499B2 (en) | ||
| JPS6048770B2 (en) | Information processing method | |
| JPS62169236A (en) | Information processor with queue control function | |
| JPH05241890A (en) | Data trace system | |
| JPS6074074A (en) | Priority control system | |
| JPH0376497B2 (en) | ||
| JPH03263265A (en) | Vector processor | |
| JPH06202888A (en) | Microprocessor |
Legal Events
| Date | Code | Title | Description |
|---|---|---|---|
| FPAY | Renewal fee payment (event date is renewal date of database) |
Free format text: PAYMENT UNTIL: 20081001 Year of fee payment: 9 |
|
| FPAY | Renewal fee payment (event date is renewal date of database) |
Free format text: PAYMENT UNTIL: 20081001 Year of fee payment: 9 |
|
| FPAY | Renewal fee payment (event date is renewal date of database) |
Free format text: PAYMENT UNTIL: 20091001 Year of fee payment: 10 |
|
| LAPS | Cancellation because of no payment of annual fees |