JPH07141300A - Period processing method using plural processors - Google Patents

Period processing method using plural processors

Info

Publication number
JPH07141300A
JPH07141300A JP5289105A JP28910593A JPH07141300A JP H07141300 A JPH07141300 A JP H07141300A JP 5289105 A JP5289105 A JP 5289105A JP 28910593 A JP28910593 A JP 28910593A JP H07141300 A JPH07141300 A JP H07141300A
Authority
JP
Japan
Prior art keywords
cycle
processing
period
execution
periodic
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
JP5289105A
Other languages
Japanese (ja)
Inventor
Eiji Ishikawa
英治 石川
Tomoshi Matsuda
知志 松田
Michihiro Aoki
道宏 青木
Shuji Miki
修次 三木
Takanari Hoshiai
隆成 星合
Nobuyuki Watabe
信幸 渡部
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.)
Nippon Telegraph and Telephone Corp
Original Assignee
Nippon Telegraph and Telephone Corp
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Nippon Telegraph and Telephone Corp filed Critical Nippon Telegraph and Telephone Corp
Priority to JP5289105A priority Critical patent/JPH07141300A/en
Publication of JPH07141300A publication Critical patent/JPH07141300A/en
Pending legal-status Critical Current

Links

Abstract

PURPOSE:To provide a decentralized period processing method using plural processors. CONSTITUTION:When an in-period-process flag IMF in a period process support circuit 2 is OFF and a flag for interruption generation is ON, processors P1 to Pn are interrupted and a period control program is started at the same time. A period control program places the processors in decentralized execution of the period process program by using a time-out signal holding flag 22 which holds the time-out signal of a timer 21, a period process execution inhibition display flag 27 which is fired by software at the end of the dispatching (actuation end) of all period process object programs to be processed in respective period and reset when a next period comes and the period processes in the last period are all completed, a period process end display flag 28 which indicates that the execution of all the period process object programs to be processed in the respective periods ends, and the period process program and a correspondence table 35 of its execution time in a main storage device 3.

Description

【発明の詳細な説明】Detailed Description of the Invention

【0001】[0001]

【産業上の利用分野】本発明は、複数のプロセッサで予
め決められた起動周期の複数の周期処理プログラムを分
散して行う周期処理方法に関し、特に、該周期処理プロ
グラムを複数のプロセッサで対等に分散して実行するよ
うにしたマルチプロセッサを用いた周期処理方法に関す
る。
BACKGROUND OF THE INVENTION 1. Field of the Invention The present invention relates to a cyclic processing method for distributing a plurality of cyclic processing programs having a predetermined start cycle by a plurality of processors, and more particularly, to the cyclic processing program evenly by a plurality of processors. The present invention relates to a periodic processing method using a multiprocessor which is distributed and executed.

【0002】[0002]

【従来の技術】一般に、周期処理は、予め定められた周
期毎に決められた処理プログラムを実行することによっ
て処理の実時間性を保証するするものであり、特に、交
換処理などにおいて有用な処理方法である。以下に、従
来の周期処理を、実行すべき周期処理プログラムの起動
タイミングを規定する周期処理表を用いた周期処理方法
を例にして説明する。以下の説明では、周期処理のスケ
ジュールによって起動処理されるものを「周期処理」と
呼び、これ以外の処理を「通常処理」と呼ぶことにす
る。図6に単一プロセッサを用いて予め決められた周期
で周期処理を行う従来例を示す。図6において、71は
基本周期信号発生部TSG、72は割り込み制御部IR
C、73はレジスタ読み出し/書き込み部、74は割り
込みマスクレジスタ、75は割り込み要因レジスタ、7
6は割り込み要求判定部、77はプロセッサ、78はプ
ロセッサバス、79は主記憶装置(MM)、主記憶装置
(MM)79には、実行時刻毎に実行する処理プログラ
ムを保持する周期処理表(TBL)80、時刻ポインタ
81、処理プログラムを指示するPROCポインタ82
が格納されている。周期処理表(TBL:80)は、図
に示されているように、列方向に処理プログラム番号
を、行方向に実行時刻を対応させている。処理プログラ
ム番号は、PROC1〜PROCnの列(n:登録可能
な最大プログラム数)で、実行時刻は0からT/Tsの
m行(m:T/Ts、Tsは基本周期)で与えられる
(Ts:基本周期、T:最大周期)。
2. Description of the Related Art Generally, periodic processing guarantees real-time processing by executing a processing program determined for each predetermined cycle, and is particularly useful in exchange processing. Is the way. The conventional cyclic processing will be described below by taking a cyclic processing method using a cyclic processing table that defines the start timing of the cyclic processing program to be executed as an example. In the following description, what is activated by the periodic process schedule will be referred to as “periodic process”, and other processes will be referred to as “normal process”. FIG. 6 shows a conventional example in which a single processor is used to perform cyclic processing at a predetermined cycle. In FIG. 6, reference numeral 71 is a basic period signal generator TSG, and 72 is an interrupt controller IR.
C and 73 are register read / write units, 74 is an interrupt mask register, 75 is an interrupt factor register, 7
6 is an interrupt request determination unit, 77 is a processor, 78 is a processor bus, 79 is a main storage device (MM), and a main processing unit (MM) 79 has a periodic processing table (a periodic processing table that holds a processing program to be executed at each execution time). TBL) 80, time pointer 81, PROC pointer 82 for instructing a processing program
Is stored. In the periodic processing table (TBL: 80), as shown in the figure, processing program numbers are associated in the column direction and execution times are associated in the row direction. The processing program number is a column of PROC1 to PROCn (n: the maximum number of programs that can be registered), and the execution time is given from 0 to m rows of T / Ts (m: T / Ts, Ts is a basic cycle) (Ts : Basic period, T: maximum period).

【0003】現在実行中の処理プログラム(PROC)
は、実行時刻を指定する時刻ポインタTPTR(81)
と、当該時刻中に実行すべき処理プログラム(PRO
C)を指定するPROCポインタPPTR(82)によ
って指定される。したがって、指定されたTBL(8
0)の内容が“1”ということは、当該時刻中に該処理
プログラム(PROC)を実行すべきことを意味してい
る。上述の時刻ポインタTPTR(81)は1から順に
+1し、mまでの値を有し、mの次は再び1に戻る。ま
た、PROCポインタPPTR(82)は、1からnま
での値を取る。周期処理のプロセッサに対する起動要求
通知は、即時性を確保するためプロセッサの割込み機能
を用いる。一般的なプロセッサの割込み機能には、割込
みを抑止する割込みマスク制御を備えている。周期処理
は緊急度の高い処理であるから、周期処理を実行する場
合は、通常、この割り込みマスクを用いることによって
他からの割込みを抑止しておく。なお、一般の割り込み
の場合は、必要に応じて割り込みの種類に依存した割り
込み優先順位を設けることも行われている。
Processing program currently being executed (PROC)
Is a time pointer TPTR (81) that specifies the execution time
And a processing program to be executed during the time (PRO
C) designated by the PROC pointer PPTR (82). Therefore, the designated TBL (8
When the content of 0) is "1", it means that the processing program (PROC) should be executed during the time. The above-mentioned time pointer TPTR (81) sequentially increments from 1 by 1 and has a value up to m, and after m, returns to 1 again. The PROC pointer PPTR (82) takes a value from 1 to n. The interrupt request of the processor is used to ensure the immediacy of the activation request notification to the processor of the periodic processing. The interrupt function of a general processor has an interrupt mask control for suppressing an interrupt. Since the periodic process is a process with a high degree of urgency, when executing the periodic process, interrupts from others are usually suppressed by using this interrupt mask. In the case of general interrupts, an interrupt priority order depending on the type of interrupt is also provided as needed.

【0004】以下、上述した従来の単一プロセッサを用
いた場合の図6の動作を、図7に示すタイミングチャー
トおよび図8に示す割り込み処理時の動作フローチャー
トに従って詳細に説明する。 (1)基本周期信号発生部TSG(71)から前述のT
s間隔毎に基本周期信号S1が発生される(t1)。 (2)割込み制御部IRC(72)は、上述の基本周期
信号S1のアクティブ(ハイレベル)を検出して、割込
み要因レジスタIRR(75)を“1”(要求有り)に
設定する(t2)。 (3)割込み制御部IRC(72)の割込み要求判定部
IRJ(76)は、割込みマスクレジスタIMR(7
4)の内容と上述の割込み要因レジスタIRR(75)
の内容を比較して、IRR=“1”、かつ、IMR
“0”(マスク解除)であれば、プロセッサPに対する
割込み要求信号INTを“1”を設定する(t3)。 (4)プロセッサPは、上述の割込み要求信号INTの
アクティブ(ハイレベル)を検出し、割込み処理に移行
する。
The operation of FIG. 6 when the above-mentioned conventional single processor is used will be described in detail below with reference to the timing chart of FIG. 7 and the operation flowchart of the interrupt processing shown in FIG. (1) From the basic periodic signal generator TSG (71) to the above-mentioned T
The basic periodic signal S1 is generated at intervals of s (t1). (2) The interrupt control unit IRC (72) detects the active (high level) of the basic cycle signal S1 and sets the interrupt factor register IRR (75) to "1" (requested) (t2). . (3) The interrupt request determination unit IRJ (76) of the interrupt control unit IRC (72) uses the interrupt mask register IMR (7
Contents of 4) and the above-mentioned interrupt factor register IRR (75)
Content of IRR = "1" and IMR
If it is "0" (mask release), the interrupt request signal INT to the processor P is set to "1" (t3). (4) The processor P detects the active state (high level) of the above-mentioned interrupt request signal INT and shifts to interrupt processing.

【0005】(5)プロセッサPでの割込み処理は、以
下のような動作を行う。割込み要求信号INTが検出さ
れたら、図8に示される割り込み処理が行われる。 .先ず、ステップ91において、次のa、b、cの各
処理が行われる(t4)。 a.プロセッサPは、プロセッサバスPBUS(78)
を介して割込み制御部IRC(72)内のレジスタ読み
だし/書き込み部RRW(73)を起動し、割込みマス
クレジスタIMR(74)に“1”を設定する。 b.プロセッサPは、プロセッサバスPBUS(78)
を介して割込み制御部IRC(72)内のレジスタ読み
だし/書き込み部RRW(73)を起動し、割込み要因
レジスタIRR(75)に“0”を設定する。 c.プロセッサPは、主記憶MM上のPROCポインタ
PPTR(82)に“0”を設定する。 .次に、ステップ92において、プロセッサPは、主
記憶MM(79)上の時刻ポインタTPTR(81)を
更新(+1)する(t5)。 .次のステップ93において、プロセッサPは、主記
憶MM(79)上の周期処理表TBL(80)を検索
し、PPTR(82)を更新(TPTRの指す行で、P
PTR+1の列から“1”を検索し、PPTRの内容を
該検索位置の列番号に更新) .ステップ94において、プロセッサPは、検索した
結果、該当PROCが存在すれば、ステップ95で該処
理を実行しステップ93に戻る。該当処理PROCが存
在する間、ステップ93〜ステップ95の処理を繰り返
す。 .ステップ96において、プロセッサPは、プロセッ
サバスPBUS(78)を介して割込み制御部IRC
(72)内のレジスタ読み出し/書き込み部RRW(7
3)を起動し、割込みマスクレジスタIMR(74)に
“0”を設定(t6)した後、割込み処理を終了し、通
常処理に復帰する。 上記(1)から(5)の処理を繰り返し実行することに
より、各基本周期毎に周期処理を実現する。なお、上記
(3)のにおいて、IMR=“1”であれば(図7のt
7に示した場合)、以降の処理はIMR=“0”となる
(t8)まで延長される。周期処理が当該周期内に終了
できず、次周期に入った場合には、前周期の処理が終了
した後、次周期の処理を実施する。
(5) The interrupt processing in the processor P operates as follows. When the interrupt request signal INT is detected, the interrupt processing shown in FIG. 8 is performed. . First, in step 91, the following processes a, b, and c are performed (t4). a. Processor P is a processor bus PBUS (78)
The register read / write unit RRW (73) in the interrupt control unit IRC (72) is activated via the, and "1" is set in the interrupt mask register IMR (74). b. Processor P is a processor bus PBUS (78)
The register read / write unit RRW (73) in the interrupt control unit IRC (72) is activated via the, and "0" is set in the interrupt factor register IRR (75). c. The processor P sets “0” in the PROC pointer PPTR (82) on the main memory MM. . Next, in step 92, the processor P updates (+1) the time pointer TPTR (81) on the main memory MM (79) (t5). . In the next step 93, the processor P searches the periodic processing table TBL (80) on the main memory MM (79) and updates the PPTR (82) (in the row indicated by TPTR, P
"1" is searched from the column of PTR + 1, and the contents of PPTR are updated to the column number of the search position). In step 94, the processor P executes the processing in step 95 and returns to step 93 if the corresponding PROC exists as a result of the search. While the corresponding processing PROC exists, the processing of step 93 to step 95 is repeated. . In step 96, the processor P sends the interrupt control unit IRC via the processor bus PBUS (78).
Register read / write unit RRW (7 in (72)
3) is started, "0" is set in the interrupt mask register IMR (74) (t6), the interrupt process is terminated, and the normal process is resumed. By repeatedly executing the above processes (1) to (5), the periodic process is realized for each basic period. In the above (3), if IMR = "1" (t in FIG. 7).
7)), the subsequent process is extended until IMR = “0” (t8). When the cycle process cannot be completed within the cycle and enters the next cycle, the process of the next cycle is performed after the process of the previous cycle is completed.

【0006】[0006]

【発明が解決しようとする課題】上記従来技術は、単一
プロセッサでの処理を前提にしたものであり、単一プロ
セッサでしか周期処理の実行ができない。したがって、
マルチプロセッサを用いた場合においても、従来技術の
方法では、周期処理は専用の1台のプロセッサでしか実
行できないので、性能向上が図れない。そのため、複数
のプロセッサで周期処理を分散して実行する負荷分散周
期処理が考えられるが、その場合、次のような問題
(a)、(b)がある。 (a):特定のプロセッサ(例えばプロセッサ1)が周
期処理を実行中に、次周期の時刻がきた場合、プロセッ
サ1が実行している(前周期の)周期処理を実行完了す
るまで、その時点で(前周期の)周期処理を終了してい
る他のプロセッサの周期処理開始を抑止しなければなら
ない。 (b):特定のプロセッサ(例えばプロセッサ1)が周
期処理とは別の処理を行っている間に、他のプロセッサ
でその周期の周期処理を全て実行終了した場合、別処理
を終了したプロセッサ1の周期処理実行を抑止しなけれ
ばならない。本発明は上記事情に鑑みてなされたもの
で、その目的とするところは、従来の技術における上述
の如き問題を解消し、マルチプロセッサを用いた場合に
おいても、複数のプロセッサで周期処理を対等に分散し
て実行できる周期処理方法を提供することにある。
The above-mentioned prior art is premised on the processing by a single processor, and the periodic processing can be executed only by the single processor. Therefore,
Even when a multiprocessor is used, the conventional method cannot improve the performance because the periodic processing can be executed by only one dedicated processor. Therefore, load distribution cyclic processing in which cyclic processing is distributed and executed by a plurality of processors is conceivable, but in that case, there are the following problems (a) and (b). (A): When the time of the next cycle comes while a specific processor (for example, the processor 1) is executing the cyclic processing, the time until the execution of the cyclic processing (previous cycle) being executed by the processor 1 is completed Therefore, it is necessary to suppress the start of the periodic processing of another processor which has finished the periodic processing (of the previous cycle). (B): When a specific processor (for example, the processor 1) is executing a process different from the periodic process, when another processor completes the execution of the periodic process of the period, the processor 1 that has completed the different process It is necessary to suppress the periodic processing execution of. The present invention has been made in view of the above circumstances, and an object of the present invention is to solve the above-described problems in the conventional technique, and even when a multiprocessor is used, a plurality of processors can perform the periodic processing equally. It is to provide a periodic processing method that can be executed in a distributed manner.

【0007】[0007]

【課題を解決するための手段】本発明の上記目的は、上
記目的を達成するために、複数のプロセッサによって予
め決められた起動周期の複数の周期処理プログラムを分
散して行うマルチプロセッサを用いた周期処理方法にお
いて、上記各プロセッサ毎に設けられた周期制御プログ
ラムと、上記各プロセッサ毎に周期処理中であることを
表示するプロセッサ毎に設けられた周期処理中表示手段
と、各周期毎に実行すべき全ての周期処理プログラムの
起動が終了した時点から次周期の周期処理の開始時点ま
で周期処理実行禁止であることを表示する周期処理実行
禁止表示手段と、各周期毎に実行すべき全ての周期処理
プログラムの起動が終了した時点から次周期の開始時点
まで実行すべき周期処理プログラムを全て実行完了して
いることを表示する周期処理終了表示手段とを備え、上
記周期制御プログラムによって、各周期毎に処理すべき
全ての周期処理プログラムの起動が終了した時点で周期
処理終了表示手段に全周期処理プログラムの起動終了を
表示するとともに、周期処理実行禁止表示手段に周期処
理の開始の禁止を表示し、各周期毎に処理すべき全ての
周期処理プログラムの実行が終了してかつ次周期の開始
時に周期処理実行禁止表示手段をリセットするようにし
ている。
In order to achieve the above-mentioned object, the above-mentioned object of the present invention uses a multiprocessor which disperses a plurality of periodic processing programs having a predetermined start-up period by a plurality of processors. In the cycle processing method, a cycle control program provided for each processor, a cycle processing display means provided for each processor to display that the cycle processing is being performed, and executed for each cycle From the time when the start of all the periodic processing programs to the start of the periodic processing of the next cycle, the periodic processing execution prohibition display means for displaying that the periodic processing execution is prohibited, and all the periodic processing execution prohibited Displays that all cyclic processing programs to be executed have been completed from the time when the cyclic processing program starts to the time when the next cycle starts. Cycle processing end display means, and when the cycle control program finishes starting all cycle processing programs to be processed in each cycle, the cycle processing end display means displays the start and end of all cycle processing programs. At the same time, the prohibition of the start of the periodic processing is displayed on the periodic processing execution prohibition display means, and the periodic processing execution prohibition display means is displayed at the start of the next cycle after the execution of all the periodic processing programs to be processed in each cycle is completed. I am trying to reset.

【0008】[0008]

【作用】本発明に係る周期処理方法においては、上述の
如く、マルチプロセッサシステムを構成するすべてのプ
ロセッサが、対等に、任意のプロセッサで周期処理を実
現可能としたことにより、システム内の全てのプロセッ
サでの処理を同じにした周期処理方法を実現でき、性能
の向上が図れる。
In the periodic processing method according to the present invention, as described above, all the processors forming the multiprocessor system can realize the periodic processing by any processor on an equal basis. A periodic processing method in which the processing in the processor is the same can be realized, and the performance can be improved.

【0009】[0009]

【実施例】以下に、本発明の実施例を、図面を参照して
詳細に説明する。図1は、本発明の一実施例の適用対象
となるシステム構成を示す図である。図1において、1
1〜1nはプロセッサ(P1〜Pn)、2は周期処理サ
ポート回路、3は主記憶MMを示す。周期処理サポート
回路2において、21は周期間隔を計数しているタイマ
(TICY:一定周期毎タイムアウト信号を出力)、2
2はタイマ21のタイムアウト信号を保持するタイムア
ウト信号保持フラグ(TIF)、231〜23nはプロ
セッサ毎の周期処理中表示フラグ(IMF)、241〜
24nはプロセッサへの割込み発生用フラグ(IR
F)、251〜25nは周期処理中表示フラグ231〜
23nが発火中は各プロセッサへの割込みを抑止する割
込み抑止回路を、26は各周期処理中表示フラグ231
〜23nのORをとり、全てのプロセッサで周期処理を
終了したか否かを表示する回路、27は各周期で処理す
べき全ての周期処理対象プログラムのディスパッチ終了
(起動終了)時にソフトウエアにより発火され、次周期
が到着(タイムアウト信号保持フラグ22点火)してか
つ前周期の周期処理が全て終了している場合にリセット
される周期処理実行禁止表示フラグ(INCF)、28
は各周期毎に処理すべき周期処理対象プログラムを全て
実行終了したことを示す周期処理終了表示フラグ(EN
PF)、29は周期処理実行禁止表示フラグが点火され
た場合に周期処理終了表示フラグを点火し、次周期の到
着(タイムアウト信号保持フラグ22点火)を契機に周
期処理終了表示フラグをリセットする周期処理終了表示
フラグ制御回路である。
Embodiments of the present invention will be described below in detail with reference to the drawings. FIG. 1 is a diagram showing a system configuration to which an embodiment of the present invention is applied. In FIG. 1, 1
1 to 1n are processors (P1 to Pn), 2 is a periodic processing support circuit, and 3 is a main memory MM. In the cycle processing support circuit 2, 21 is a timer for counting cycle intervals (TICY: outputs a time-out signal for every fixed cycle), 2
Reference numeral 2 is a time-out signal holding flag (TIF) that holds a time-out signal of the timer 21, 231 to 23n are periodic processing in-progress flags (IMF) for each processor, and 241-
24n is a flag for generating an interrupt to the processor (IR
F), 251 to 25n are display flags 231 to 231 during periodic processing.
An interrupt suppression circuit for suppressing an interrupt to each processor while 23n is firing, and 26 is a display flag 231 for each periodic processing
A circuit that takes an OR of ~ 23n and displays whether or not the periodic processing has been completed in all the processors. 27 is fired by software when the dispatch of all the cyclically processed programs to be processed in each cycle is completed (startup is completed). Then, the next cycle arrives (timeout signal holding flag 22 ignition) and the cycle processing execution prohibition display flag (INCF), which is reset when the cycle processing of the previous cycle is completed, 28
Indicates that the periodic processing end display flag (EN
PF), 29 is a cycle for igniting the cycle processing end display flag when the cycle processing execution prohibition display flag is ignited, and for resetting the cycle processing end display flag upon arrival of the next cycle (timeout signal holding flag 22 ignition) It is a processing end display flag control circuit.

【0010】また、30は時刻カウンタ(TCTR)、
31は前周期の周期処理が1周期以内に終了している場
合には、次周期の到着(タイムアウト信号保持フラグ点
火)を契機に、前周期の周期処理が次周期に跨った場合
には、前周期の周期処理が終了したことを契機(回路2
6の出力が“0”)に、時刻カウンタ30のインクリメ
ント(+1)を行う時刻カウンタインクリメント制御回
路、32はソフトウエアにより予め登録されるエントリ
数(TTE)、33は時刻カウンタ30とエントリ数3
2の内容が一致した場合に時刻カウンタをリセットする
比較器、34は主記憶MM上の周期処理表(TBL)を
参照可能か否かを示すテーブル参照フラグ(TAF)、
35は周期処理のスケジュールを管理する周期処理表、
36は現在実行中の周期処理対象プログラムの番号を示
すプログラムポインタ(PPTR)である。周期処理表
35は、列方向に処理プログラム番号(1〜m)を、行
方向に実行時刻(t1〜tk)を対応させている。本実
施例では、時刻を指定するカウンタについてもハードウ
エアサポートしている。これにより、周期毎の時刻のカ
ウンタアップをソフトウエアで制御する必要がなくな
る。
Further, 30 is a time counter (TCTR),
31 indicates that when the cycle processing of the previous cycle is completed within one cycle, the arrival of the next cycle (timeout signal holding flag ignition) triggers the cycle processing of the previous cycle to extend to the next cycle. When the cycle processing of the previous cycle is completed (circuit 2
When the output of 6 is "0"), the time counter increment control circuit that increments (+1) the time counter 30, 32 is the number of entries (TTE) registered in advance by software, 33 is the time counter 30 and 3 are the number of entries.
A comparator that resets the time counter when the contents of 2 match, 34 is a table reference flag (TAF) indicating whether or not the periodic processing table (TBL) on the main memory MM can be referred to,
Reference numeral 35 is a periodic processing table for managing the schedule of periodic processing,
Reference numeral 36 is a program pointer (PPTR) indicating the number of the program to be periodically processed which is currently being executed. In the periodic processing table 35, processing program numbers (1 to m) are associated in the column direction and execution times (t1 to tk) are associated in the row direction. In this embodiment, the counter for designating the time is also supported by hardware. As a result, it is not necessary to control the counter up of the time for each cycle by software.

【0011】次に、図1のシステムの動作を、図2の周
期制御プログラムの処理フローチャート及び図3〜図5
に示すタイムチャートを用いて詳細に説明する。なお、
周期制御プログラムの起動パターンは図3、図4、およ
び図5に示したものに大別できる。図3のパターンは各
周期毎の全ての周期処理対象プログラムの実行が1周期
内で終了した場合で、図4は周期処理対象プログラムの
実行が2周期以上に跨った場合である。図5は周期処理
契機の割込みをマスクして別処理を行っていたプロセッ
サが別処理を終了して周期処理を開始する場合である。
Next, the operation of the system of FIG. 1 will be described with reference to the process flow chart of the cycle control program of FIG. 2 and FIGS.
It will be described in detail with reference to the time chart shown in FIG. In addition,
The activation pattern of the cycle control program can be broadly classified into those shown in FIGS. 3, 4, and 5. The pattern of FIG. 3 shows the case where the execution of all the cyclic processing target programs for each cycle ends within one cycle, and FIG. 4 shows the case where the execution of the cyclic processing target program spans two or more cycles. FIG. 5 shows a case where a processor that has been performing another process by masking an interrupt triggered by the periodic process ends the another process and starts the periodic process.

【0012】以下に、図2に基づいて、一定周期毎の割
込みを契機に起動された周期制御プログラムの動作フロ
ーを以下に詳細に説明する。先ず、周期制御プログラム
が起動されると(ステップ50)、周期制御プログラム
は、まず、周期処理実行禁止表示フラグ(INCF:2
7)をリードする(ステップ51)。リードした周期処
理実行禁止表示フラグ(INCF:27)が“0”か否
かを判定し(ステップ52)、“0”の場合には(イー
1)に、“0”でなければ(イー2)に進む。
Below, the operation flow of the cycle control program activated upon the interruption of every fixed cycle will be described in detail with reference to FIG. First, when the cycle control program is started (step 50), the cycle control program firstly displays the cycle process execution prohibition display flag (INCF: 2).
7) is read (step 51). It is determined whether or not the read periodic process execution prohibition display flag (INCF: 27) is "0" (step 52). If it is "0" (ee1), it is not "0" (ee2). ).

【0013】(イ−1):ステップ52での判定の結
果、周期処理実行禁止表示フラグ(INCF:27)が
周期処理実行許可状態の場合(すなわち、INCF=0
の場合) 〔例えば、図3のプロセッサP1、P2、・・Pnのよ
うな場合〕 .自プロセッサ対応の周期処理中表示フラグ(IMF
1〜IMFn:231〜23n)をセット、すなわち、
周期処理中状態(“1”)にし、割込み発生用フラグ
(IRF1〜IRFn:241〜24n)をリセットす
る(ステップ53)。割込み発生用フラグIRFをリセ
ットしておく理由は、次周期に割り込みが発生した場合
にそれを新たに記憶するためである。 .次に、時刻カウンタ(TCTR:30)を読込み、
第何番目の周期の周期処理対象プログラムを実行すれば
良いかを確認する(ステップ54)。
(A-1): As a result of the judgment in step 52, when the periodic process execution prohibition display flag (INCF: 27) is in the periodic process execution permission state (that is, INCF = 0).
(For example, in the case of the processors P1, P2, ... Pn in FIG. 3). Periodic processing in progress display flag (IMF)
1 to IMFn: 231 to 23n), that is,
The cycle processing state ("1") is set, and the interrupt generation flags (IRF1 to IRFn: 241 to 24n) are reset (step 53). The reason for resetting the interrupt generation flag IRF is to newly store the interrupt when the interrupt occurs in the next cycle. . Next, read the time counter (TCTR: 30),
It is confirmed what number cycle of the periodic processing target program should be executed (step 54).

【0014】.次に、周期処理実行権を取得するため
にTAFフラグ34にテストアンドセット(T&S)を
行う。すなわち、TAGフラグ34を読み出して“0”
かどうかを見て、“0”(アクセス可)ならば、それを
“1”にして他からのアクセスを禁止する(ステップ5
5:周期処理実行権獲得)。TAGフラグ34が“1”
(アクセス禁止)で、周期処理実行権の取得が成功しな
かった場合はステップ55に戻り、周期処理実行権獲得
が成功するまでステップ55とステップ56を繰り返
し、成功したら次のステップ57に進む。 .ステップ57では、実行すべき周期処理対象プログ
ラムが残っているか否かを検索するために、周期処理終
了表示フラグ(ENPF:28)を読み込み、周期処理
終了表示フラグ(ENPF:28)が0か否かを判定し
(ステップ58)、0でなかったら、TAFフラグ3
4、自プロセッサ対応の周期処理中表示フラグ(IMF
1〜IMFn:231〜23n)をリセットし(ステッ
プ62)、周期処理を終了する(ステップ63)。
.. Next, a test and set (T & S) is performed on the TAF flag 34 in order to acquire the periodic processing execution right. That is, the TAG flag 34 is read and "0" is read.
If it is "0" (accessible), it is set to "1" to prohibit access from others (step 5).
5: Acquisition of periodic processing execution right). The TAG flag 34 is "1"
If the acquisition of the periodic process execution right is not successful in (access prohibition), the process returns to step 55, and steps 55 and 56 are repeated until the acquisition of the periodic process execution right succeeds. If succeeded, the process proceeds to the next step 57. . In step 57, the periodic process end display flag (ENPF: 28) is read in order to search whether or not the periodic process target program to be executed remains, and whether the periodic process end display flag (ENPF: 28) is 0 or not. (Step 58), if not 0, TAF flag 3
4. Display flag (IMF during processing) for own processor
1 to IMFn: 231 to 23n) are reset (step 62), and the periodic process is ended (step 63).

【0015】.ステップ58における判定の結果、周
期処理終了表示フラグ(ENPF:28)が0であれ
ば、主記憶(MM:3)上の周期処理表(35)を検索
し、プログラムポインタ(PPTR:36)を更新する
(ステップ59)。検索した結果、実行すべき周期処理
対象プログラムが現周期で実行すべき最後の周期処理対
象プログラムならば(ステップ60)、周期処理実行禁
止表示フラグ(INCF:27)のセット、プログラム
ポインタ(PPTR:36)のリセットし(ステップ6
1)、テーブル参照フラグ(TAF:34)の解除、自
プロセッサ対応の周期処理中表示フラグ(IMF1〜I
MFn:231〜23n)のリセットを行い(ステップ
62)、周期処理を終了する(ステップ63)。 .周期処理表を検索した結果、実行すべき周期処理対
象プログラムが現周期で実行すべき最後の周期処理対象
プログラムでないならば(ステップ60)、テーブル参
照フラグ(TAF:34)の解除を行った後(ステップ
64)、ステップ55(の処理)に戻る。
.. If the result of determination in step 58 is that the periodic processing end display flag (ENPF: 28) is 0, the periodic processing table (35) in the main memory (MM: 3) is searched and the program pointer (PPTR: 36) is set. Update (step 59). As a result of the search, if the cyclic processing target program to be executed is the last cyclic processing target program to be executed in the current cycle (step 60), the cyclic processing execution prohibition display flag (INCF: 27) is set and the program pointer (PPTR: 36) is reset (step 6)
1), release of the table reference flag (TAF: 34), display flag (IMF1 to IF1) corresponding to the own processor
MFn: 231 to 23n) is reset (step 62), and the cycle process is ended (step 63). . As a result of searching the cyclic processing table, if the cyclic processing target program to be executed is not the last cyclic processing target program to be executed in the current cycle (step 60), after clearing the table reference flag (TAF: 34) (Step 64) and the procedure returns to (the processing of) step 55.

【0016】(イ−2):ステップ52での判定の結
果、周期処理実行禁止表示フラグ(INCF:27)が
周期処理実行禁止状態の場合(すなわち、INCF=1
の場合) 〔例えば、図4のプロセッサP1、P2、・・Pnの第
m+1周期参照〕 .周期処理終了表示フラグ(ENPF:28)を読み
込み(ステップ65)、該周期処理終了表示フラグ(E
NPF:28)が0か否かを判定し(ステップ66)、
0でないならば、TAFフラグ34の解除、自プロセッ
サ対応の周期処理中表示フラグ231〜23nのリセッ
トを行い(ステップ62)、周期処理を終了する(ステ
ップ63)。 .ステップ66での判定の結果、周期処理終了表示フ
ラグ(ENPF:28)が0であれば、周期処理実行禁
止表示フラグ(INCF:27)を読み込み(ステップ
67)、周期処理実行禁止表示フラグ(INCF:2
7)が0か否かを判定する(ステップ68)。 .ステップ68での判定の結果、周期処理実行禁止表
示フラグ(INCF:27)が0ならば(イ−1)の
処理に戻る。0でないならば、再度ステップ67に戻っ
て0になるまでステップ67とステップ68を繰り返し
て待つ。
(A-2): As a result of the determination in step 52, when the periodic process execution prohibition display flag (INCF: 27) is in the periodic process execution prohibition state (that is, INCF = 1).
(For example, refer to the (m + 1) th cycle of the processors P1, P2, ... Pn in FIG. 4). The periodic processing end display flag (ENPF: 28) is read (step 65), and the periodic processing end display flag (E
It is determined whether NPF: 28) is 0 (step 66),
If it is not 0, the TAF flag 34 is released, the in-period processing display flags 231 to 23n corresponding to the self processor are reset (step 62), and the periodic processing is ended (step 63). . If the result of determination in step 66 is that the cyclic process end display flag (ENPF: 28) is 0, the cyclic process execution prohibition display flag (INCF: 27) is read (step 67), and the cyclic process execution prohibition display flag (INCF). : 2
It is determined whether or not 7) is 0 (step 68). . If the result of determination in step 68 is that the periodic process execution prohibition display flag (INCF: 27) is 0, the process returns to (a-1). If it is not 0, the process returns to step 67 again and repeats steps 67 and 68 until it becomes 0, and waits.

【0017】以上のようにして、各周期毎の全ての周期
処理対象プログラムの実行が1周期内で終了した場合は
図3のように、周期処理対象プログラムの実行が2周期
以上に跨った場合は図4のように、周期処理契機の割込
みをマスクして別処理を行っていたプロセッサが別処理
を終了して周期処理を開始する場合は図5のようにな
り、マルチプロセッサシステムを構成するすべてのプロ
セッサが、対等に、任意のプロセッサで周期処理を実現
可能としたことにより、システム内の全てのプロセッサ
での処理を同じにした周期処理方法を実現できる。
As described above, when the execution of all the cyclic processing target programs for each cycle is completed within one cycle, as shown in FIG. 3, the execution of the cyclic processing target program spans two or more cycles. When the processor that has been performing another process by masking the interruption caused by the periodic process as shown in FIG. 4 finishes the another process and starts the periodic process, it becomes as shown in FIG. 5 and constitutes a multiprocessor system. Since all the processors can equally implement the periodic processing by any processor, it is possible to realize the periodic processing method in which the processing by all the processors in the system is the same.

【0018】[0018]

【発明の効果】以上、詳細に説明した如く、本発明によ
れば、マルチプロセッサを用いた場合においても、任意
のプロセッサで周期処理を実行可能とする周期処理方
法、特にシステム内の全てのプロセッサでの処理を同じ
にした周期処理方法を実現できる。
As described above in detail, according to the present invention, even when a multiprocessor is used, a periodic processing method that allows any processor to execute the periodic processing, particularly all the processors in the system. It is possible to realize a periodic processing method in which the processing in step 1 is the same.

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

【図1】本発明の一実施例の適用対象となるシステム構
成を示す図である。
FIG. 1 is a diagram showing a system configuration to which an embodiment of the present invention is applied.

【図2】本発明の周期制御プログラムのフローチャート
である。
FIG. 2 is a flowchart of a cycle control program of the present invention.

【図3】各周期処理パターンのタイムチャートである。FIG. 3 is a time chart of each cyclic processing pattern.

【図4】各周期処理パターンのタイムチャートである。FIG. 4 is a time chart of each cyclic processing pattern.

【図5】各周期処理パターンのタイムチャートである。FIG. 5 is a time chart of each cyclic processing pattern.

【図6】従来例の周期処理のシステム構成を示す図であ
る。
FIG. 6 is a diagram showing a system configuration of periodic processing of a conventional example.

【図7】従来例の周期処理パターンのタイムチャートを
示す図である。
FIG. 7 is a diagram showing a time chart of a periodic processing pattern of a conventional example.

【図8】従来例における割り込み処理のフローチャート
である。
FIG. 8 is a flowchart of interrupt processing in a conventional example.

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

11〜1n プロセッサ(P1〜Pn) 2 周期処理サポート回路 3 主記憶(MM) 21 一定周期毎にタイムアウト信号を出力するタイマ
(TICY) 22 タイマ21のタイムアウト信号を保持するタイム
アウト信号保持フラグ 231〜23n 周期処理中表示フラグ(IMF1〜I
MFn) 241〜24n 割込み発生用フラグ(IRF1〜IR
Fn) 251〜25n 割込み抑止回路 26 全てのプロセッサで周期処理を終了したか否かを
表示する回路 27 周期処理実行禁止表示フラグ(INCF) 28 周期処理終了表示フラグ(ENPF) 29 周期処理終了表示フラグ制御回路 30 時刻カウンタ(TCTR) 31 時刻カウンタインクリメント制御回路 32 エントリ数(TTE) 33 比較器 34 主記憶上の周期処理表を参照可能か否かを示すT
AFフラグ(TAF) 35 周期処理のスケジュールを管理する周期処理表 36 現在実行中の周期処理対象プログラムの番号を示
すポインタ(PPTR)
11 to 1n Processor (P1 to Pn) 2 Cycle processing support circuit 3 Main memory (MM) 21 Timer (TICY) that outputs a timeout signal at regular intervals 22 Timeout signal holding flag 231 to 23n that holds the timeout signal of the timer 21 Display flag during I / O processing (IMF1-I
MFn) 241 to 24n Interrupt generation flag (IRF1 to IR
Fn) 251 to 25n Interrupt suppression circuit 26 Circuit for displaying whether or not the periodic processing is completed in all the processors 27 Cycle processing execution prohibition display flag (INCF) 28 Cycle processing end display flag (ENPF) 29 Cycle processing end display flag Control circuit 30 Time counter (TCTR) 31 Time counter increment control circuit 32 Number of entries (TTE) 33 Comparator 34 T indicating whether or not the periodic processing table on the main memory can be referred to
AF flag (TAF) 35 Periodic processing table for managing the periodic processing schedule 36 Pointer (PPTR) indicating the number of the periodic processing target program currently being executed

───────────────────────────────────────────────────── フロントページの続き (72)発明者 三木 修次 東京都千代田区内幸町1丁目1番6号 日 本電信電話株式会社内 (72)発明者 星合 隆成 東京都千代田区内幸町1丁目1番6号 日 本電信電話株式会社内 (72)発明者 渡部 信幸 東京都千代田区内幸町1丁目1番6号 日 本電信電話株式会社内 ─────────────────────────────────────────────────── ─── Continued front page (72) Inventor Shuji Miki 1-1-6 Uchisaiwaicho, Chiyoda-ku, Tokyo Nihon Telegraph and Telephone Corporation (72) Takanari Hoshiai 1-1-6 Uchisaiwaicho, Chiyoda-ku, Tokyo No. Japan Nippon Telegraph and Telephone Corp. (72) Inventor Nobuyuki Watanabe 1-1-6 Uchisaiwaicho, Chiyoda-ku, Tokyo Nihon Telegraph and Telephone Corp.

Claims (1)

【特許請求の範囲】[Claims] 【請求項1】 複数のプロセッサによって予め決められ
た起動周期の複数の周期処理プログラムを分散して行う
マルチプロセッサを用いた周期処理方法において、上記
各プロセッサ毎に設けられた周期制御プログラムと、上
記各プロセッサ毎に周期処理中であることを表示するプ
ロセッサ毎に設けられた周期処理中表示手段と、各周期
毎に実行すべき全ての周期処理プログラムの起動が終了
した時点から次周期の周期処理の開始時点まで周期処理
実行禁止であることを表示する周期処理実行禁止表示手
段と、各周期毎に実行すべき全ての周期処理プログラム
の起動が終了した時点から次周期の開始時点まで実行す
べき周期処理プログラムを全て実行完了していることを
表示する周期処理終了表示手段とを備え、上記周期制御
プログラムによって、各周期毎に処理すべき全ての周期
処理プログラムの起動が終了した時点で周期処理終了表
示手段に全周期処理プログラムの起動終了を表示すると
ともに、周期処理実行禁止表示手段に周期処理の開始の
禁止を表示し、各周期毎に処理すべき全ての周期処理プ
ログラムの実行が終了してかつ次周期の開始時に周期処
理実行禁止表示手段をリセットすることを特徴とするマ
ルチプロセッサを用いた周期処理方法。
1. A cycle processing method using a multi-processor for distributing a plurality of cycle processing programs of a predetermined start cycle by a plurality of processors, wherein a cycle control program provided for each processor, Cycle processing in-progress display means provided for each processor to indicate that the cycle processing is being performed for each processor, and the cycle processing for the next cycle from the time when all the cycle processing programs to be executed for each cycle are finished The periodic process execution prohibition display means for displaying that the periodic process execution is prohibited until the start time of, and the process should be executed from the time when the start of all the cyclic process programs to be executed in each cycle to the start time of the next cycle. A cycle processing end display means for displaying that the execution of all the cycle processing programs has been completed, When the start of all cyclic processing programs to be processed for each cycle is completed, the cyclic processing end display means displays the start and end of all cyclic processing programs, and the cyclic processing execution prohibition display means displays the start of cyclic processing. Cycle processing using a multiprocessor characterized by displaying prohibition and resetting the cycle processing execution prohibition display means at the start of the next cycle after the execution of all the cycle processing programs to be processed in each cycle is completed Method.
JP5289105A 1993-11-18 1993-11-18 Period processing method using plural processors Pending JPH07141300A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP5289105A JPH07141300A (en) 1993-11-18 1993-11-18 Period processing method using plural processors

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP5289105A JPH07141300A (en) 1993-11-18 1993-11-18 Period processing method using plural processors

Publications (1)

Publication Number Publication Date
JPH07141300A true JPH07141300A (en) 1995-06-02

Family

ID=17738861

Family Applications (1)

Application Number Title Priority Date Filing Date
JP5289105A Pending JPH07141300A (en) 1993-11-18 1993-11-18 Period processing method using plural processors

Country Status (1)

Country Link
JP (1) JPH07141300A (en)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2016024614A (en) * 2014-07-18 2016-02-08 株式会社デンソー Data processor
JP2017078938A (en) * 2015-10-20 2017-04-27 株式会社デンソー Parallelization method, parallelization tool, and on-vehicle device
WO2024004414A1 (en) * 2022-06-27 2024-01-04 日立Astemo株式会社 Information processing device

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2016024614A (en) * 2014-07-18 2016-02-08 株式会社デンソー Data processor
JP2017078938A (en) * 2015-10-20 2017-04-27 株式会社デンソー Parallelization method, parallelization tool, and on-vehicle device
WO2024004414A1 (en) * 2022-06-27 2024-01-04 日立Astemo株式会社 Information processing device

Similar Documents

Publication Publication Date Title
JP2005190207A (en) Interruption control device and control method
JPH07141300A (en) Period processing method using plural processors
WO2009023076A1 (en) Synchronization of processors in a multiprocessor system
GB2517494A (en) Handling time intensive instructions
JP2001117786A (en) Process scheduling device and process scheduling method
JP4605191B2 (en) Interrupt processing synchronization device, interrupt processing synchronization method, and program
CN114035928A (en) Distributed task allocation processing method
JP3775868B2 (en) Engine control software timing management device
JP3063015B2 (en) Periodic processing method
WO1992003794A1 (en) Dual level scheduling of processes
JPS63300326A (en) Transaction execution schedule system
JPH02247738A (en) Multitask system
JPH05158899A (en) Cycle processing method
JPH0496167A (en) Interruption system for multi-processor system
JPS6154542A (en) Task control system
JPH09128248A (en) Microprocessor
JP2566002B2 (en) Task dispatching method
JPH05108374A (en) Multitask execution device
JP2010165209A (en) Multi-thread processor system
JP2550189B2 (en) Message identifier numbering system
JPS6027948A (en) Scheduling method
JPH064320A (en) Timer control system
JPH09167114A (en) Method for allocating stack of multi-thread task
CN114780220A (en) Task scheduling control method, device and equipment and readable storage medium
SU758155A1 (en) Program interrupting device