JPH05173984A - Method for synchronous control between plural processing units - Google Patents

Method for synchronous control between plural processing units

Info

Publication number
JPH05173984A
JPH05173984A JP3338818A JP33881891A JPH05173984A JP H05173984 A JPH05173984 A JP H05173984A JP 3338818 A JP3338818 A JP 3338818A JP 33881891 A JP33881891 A JP 33881891A JP H05173984 A JPH05173984 A JP H05173984A
Authority
JP
Japan
Prior art keywords
processing
value
time
processing units
interrupt
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
JP3338818A
Other languages
Japanese (ja)
Inventor
Katsutoshi Kizaki
勝敏 木崎
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.)
NEC Home Electronics Ltd
NEC Corp
Original Assignee
NEC Home Electronics Ltd
Nippon 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 NEC Home Electronics Ltd, Nippon Electric Co Ltd filed Critical NEC Home Electronics Ltd
Priority to JP3338818A priority Critical patent/JPH05173984A/en
Publication of JPH05173984A publication Critical patent/JPH05173984A/en
Pending legal-status Critical Current

Links

Landscapes

  • Multi Processors (AREA)

Abstract

PURPOSE:To perform fine control over a parallel processing system which has plural processing units. CONSTITUTION:In a step S7, the processing units are synchronized each time a loop ends. In a step S10, the value of an interval timer is read in as a timer value. In a step 8, the interval timer is preset. In a step 11, the timer value is transferred to the other processing unit. In a step 12, the minimum timer value is selected. In a step 13, the value obtained by subtracting the selected timer value from a comparison value is used as the 1st comparison value of a next loop. In an interruption processing routine, the comparison value is put back to the preset value (2 milliseconds) previously set in a step 9.

Description

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

【0001】[0001]

【産業上の利用分野】本発明は、クロックに同期して同
一の所定の処理を行う複数の処理ユニットを有し、これ
ら複数の処理ユニットの処理結果がすべて一致したとき
にのみこの一致した処理結果を外部へ制御信号として発
生する並列処理システムに係り、特に、これら複数の処
理ユニットがそれぞれ別のクロック発振器から供給され
るクロックに同期して動作する並列処理システムにおけ
る複数処理ユニット間の同期制御方法に関する。
BACKGROUND OF THE INVENTION 1. Field of the Invention The present invention has a plurality of processing units that perform the same predetermined processing in synchronization with a clock, and only when the processing results of the plurality of processing units are the same, the matched processing is performed. The present invention relates to a parallel processing system for generating a result as a control signal to the outside, and in particular, a synchronous control between a plurality of processing units in a parallel processing system in which the plurality of processing units operate in synchronization with clocks supplied from different clock oscillators. Regarding the method.

【0002】[0002]

【従来の技術】マルチプロセッサシステムは複数の処理
ユニットを有するシステムである。このマルチプロセッ
サシステムの1つに並列処理システムがある。並列処理
システムとは、複数の処理ユニットに同一の所定の処理
を行なわせ、これら複数の処理ユニットの処理結果がす
べて一致したときにのみこの一致した処理結果を外部へ
制御信号として発生するシステムのことである。並列処
理システムは並列冗長システムとも呼ばれる。このよう
な並列処理システムは、一般に、信頼性が要求され、人
命に係わるような制御システムにおいて使用される。並
列処理システムは、例えば、カーエレクトロニクスの分
野では、アンチロックブレーキシステム(以下、AB
S)制御回路において使用されている。すなわち、ブレ
ーキ制御は非常に危険が伴う制御系なので、確実な制御
が要求されるからである。ABS制御回路は、周知のよ
うに、急ブレーキを掛けたときに、車輪がロックするの
を防止して、最適な制動作用を得るようにした制御回路
である。以下では、ABS制御回路を例にとって説明す
る。
2. Description of the Related Art A multiprocessor system is a system having a plurality of processing units. A parallel processing system is one of the multiprocessor systems. A parallel processing system is a system in which a plurality of processing units are caused to perform the same predetermined processing and only when the processing results of the plurality of processing units match, the matched processing results are generated as a control signal to the outside. That is. A parallel processing system is also called a parallel redundant system. Such a parallel processing system is generally required for reliability and is used in a control system involving human life. For example, in the field of car electronics, a parallel processing system is an anti-lock braking system (hereinafter referred to as AB
S) Used in control circuits. That is, the brake control is a very dangerous control system, and therefore reliable control is required. As is well known, the ABS control circuit is a control circuit that prevents the wheels from locking when a sudden brake is applied to obtain an optimum braking action. The ABS control circuit will be described below as an example.

【0003】まず、ABS制御回路の概要について説明
する。車は車体と車輪とを有する。車が走行していると
き、車体および車輪は、それぞれ、零でない車体速およ
び車輪速で動いている。普通に走行している状態では、
もちろん、車体速と車輪速とは同一の速度である。換言
すれば、スリップ率は実質的に零である。ここで、スリ
ップ率とは車体速に対して車輪速がどれだけ落ちたかを
示す値であって、(車体速−車輪速)/車体速で表され
る。
First, an outline of the ABS control circuit will be described. The car has a body and wheels. When the vehicle is running, the vehicle body and wheels are moving at non-zero vehicle body speed and wheel speed, respectively. When running normally,
Of course, the vehicle speed and the wheel speed are the same. In other words, the slip ratio is substantially zero. Here, the slip ratio is a value indicating how much the wheel speed has decreased with respect to the vehicle speed, and is represented by (vehicle speed-wheel speed) / vehicle speed.

【0004】ところが、ブレーキペダルを急に踏むと、
車輪はロックに向かい、車輪速は零に向かうが、慣性に
より車体速は急には零にはならない。このままの状態で
は、スリップにより車は慣性により急には止まることが
できず、制動距離が非常に長くなってしまう。したがっ
て、スリップ率が所定の率以上になったときに、ブレー
キを緩めるような制御を行えば、車のスリップをなくす
ことができ、短い制動距離で短時間に車を止めることが
出来る。
However, when the brake pedal is suddenly depressed,
The wheel goes to the lock and the wheel speed goes to zero, but the body speed does not suddenly become zero due to inertia. In this state, the vehicle cannot suddenly stop due to inertia due to slippage, resulting in a very long braking distance. Therefore, when the slip ratio becomes equal to or higher than a predetermined ratio, by performing control so as to loosen the brake, the slip of the vehicle can be eliminated and the vehicle can be stopped in a short time with a short braking distance.

【0005】この制御を行うのがABS制御回路であ
る。したがって、ABS制御回路では、車体速と車輪速
とを常時監視する必要がある。このために、ABS制御
回路は、車のタイヤに取り付けられたホイールセンサか
らの検知信号を取り入れる。ABS制御回路は、2つの
処理ユニットを有し、各処理ユニットでは、この取り入
れた検知信号から車体速と車輪速とを計算し、この計算
して得られた車体速と車輪速とから上記スリップ率を求
めている。これらの計算は、所定時間の周期で繰り返し
行われる。すなわち、2つの処理ユニットでは、それら
のROMに全く同一のプログラムが格納されていて、そ
れらのCPUがこのプログラムに従って所定時間の周期
で繰り返し処理を行っている。つまり、プログラムを実
行するのに所定時間かかり、処理がプログラムの終了点
に達すると再びそのプログラムの先頭に戻って、プログ
ラムに従った処理を再開する。この所定時間はループタ
イムと呼ばれる。このループタイムは、例えば、6ミリ
秒である。各ループタイム中で求められたスリップ率が
所定の率以上のときに、油圧ブレーキシステムのソレノ
イドバルブに制御信号を送ることにより、ソレノイドバ
ルブを駆動してブレーキの油圧を緩める。上述したよう
に、この制御信号は、2つの処理ユニットの処理結果が
一致したときにのみ発生される。
The ABS control circuit performs this control. Therefore, the ABS control circuit needs to constantly monitor the vehicle speed and the wheel speed. To this end, the ABS control circuit incorporates a detection signal from a wheel sensor mounted on the vehicle tire. The ABS control circuit has two processing units. In each processing unit, the vehicle speed and the wheel speed are calculated from the incorporated detection signal, and the slip is calculated from the calculated vehicle speed and the wheel speed. Seeking a rate. These calculations are repeated in a cycle of a predetermined time. That is, in the two processing units, exactly the same programs are stored in their ROMs, and their CPUs repeatedly perform processing in accordance with this program at predetermined time intervals. That is, it takes a predetermined time to execute the program, and when the process reaches the end point of the program, the process returns to the beginning of the program again, and the process according to the program is restarted. This predetermined time is called a loop time. This loop time is, for example, 6 milliseconds. When the slip ratio obtained during each loop time is equal to or higher than a predetermined ratio, a control signal is sent to the solenoid valve of the hydraulic brake system to drive the solenoid valve to loosen the hydraulic pressure of the brake. As mentioned above, this control signal is generated only when the processing results of the two processing units match.

【0006】この制御信号はループタイムを単位として
発生されても良い。しかしながら、ループタイムを単位
とすると、ループタイムは6ミリ秒と長いので、ブレー
キの油圧の制御が荒くなってしまう。この制御をきめ細
かく(緻密に)行うために、ループタイムを所定数で割
った時間を単位として制御信号を発生することが行われ
ている。具体例として、所定数には3が選ばれ、したが
って、単位時間は2ミリ秒である。すなわち、2ミリ秒
毎にチョッピングを行う。
This control signal may be generated in units of loop time. However, when the loop time is used as a unit, the loop time is as long as 6 milliseconds, so the control of the hydraulic pressure of the brake becomes rough. In order to perform this control finely (finely), a control signal is generated in units of time obtained by dividing the loop time by a predetermined number. As a specific example, 3 is selected as the predetermined number, and therefore the unit time is 2 milliseconds. That is, chopping is performed every 2 milliseconds.

【0007】このような緻密な制御を行うために、従
来、各処理ユニットは、予め設定した(2ミリ秒に対応
する)比較値とインターバルタイマの値とを常に比較し
ている。これらの値が一致したときに割込みを発生させ
ると共に、インターバルタイマをプリセットする。これ
により、割込みは2ミリ秒経過毎に発生することにな
る。この割込み回数を割込み処理ルーチン内でカウント
する。割込み処理ルーチンからメイン処理ルーチンに復
帰後、この割込み回数をチェックし、それが3となった
ときでメイン処理ルーチンの最初に戻ることにより、ル
ープタイムを作っている。
In order to perform such precise control, conventionally, each processing unit always compares a preset comparison value (corresponding to 2 milliseconds) with the value of the interval timer. When these values match, an interrupt is generated and the interval timer is preset. This causes an interrupt to occur every 2 milliseconds. This interrupt count is counted in the interrupt processing routine. After returning from the interrupt processing routine to the main processing routine, the number of times of this interrupt is checked, and when it reaches 3, the loop time is created by returning to the beginning of the main processing routine.

【0008】従来のABS制御回路では、2つの処理ユ
ニットには1つのクロック発生器からのクロックが供給
されていた。すなわち、2つの処理ユニットは同一のク
ロックに同期して動作している。これは、2つの処理ユ
ニットを全く同じ動作で動作させる必要があるからであ
る。換言すれば、2つの処理ユニットは、全く同じ時計
をもっている。この場合、2つの処理ユニットは常に同
期が取れているので、同期をとるための特別の処理が不
要である。
In the conventional ABS control circuit, two processing units are supplied with a clock from one clock generator. That is, the two processing units operate in synchronization with the same clock. This is because it is necessary to operate the two processing units with exactly the same operation. In other words, the two processing units have exactly the same clock. In this case, since the two processing units are always synchronized, no special processing for synchronizing is necessary.

【0009】しかしながら、1つのクロック発生器から
供給されるクロックに同期して2つの処理ユニットが駆
動されるので、このクロック発生器が故障してしまう
と、2つの処理ユニットは同時にその動作を停止、すな
わち、ダウンしてしまう。これでは、並列冗長構成にし
た意味がなくなり、高い信頼性を保つことができない。
また、同時に2つの処理ユニットがダウンしてしまう
と、後述するような、フェイルセイフを行うことができ
ない。
However, since the two processing units are driven in synchronization with the clock supplied from one clock generator, if the clock generator fails, the two processing units stop their operations at the same time. , That is, it goes down. In this case, it is meaningless to have a parallel redundant configuration, and high reliability cannot be maintained.
Further, if two processing units go down at the same time, fail-safe cannot be performed as described later.

【0010】この問題を解決するため、本願発明者は2
つの処理ユニットをそれぞれ別々のクロック発振器から
のクロックで動作させれば良いのではないかと思料し
た。しかしながら、全く同じクロック周波数をもつクロ
ックを発振できるクロック発振器を手に入れることは実
質上不可能である。また、ほとんど同じクロック周波数
をもつクロックを発振できる高精度のクロック発振器は
高価である。従って、この場合、2つの処理ユニット
は、互いにほぼ等しいけれども、若干誤差のあるクロッ
ク周波数をもつクロックで動作することになる。換言す
れば、2つの処理ユニットは、それぞれ、互いに異なる
時計をもつことになる。このような互いに異なるクロッ
ク周波数をもつクロックで動作する2つの処理ユニット
は、時間の経過につれて、それぞれの時計が示す時刻が
しだいにずれていき、誤差が累積していく。この誤差の
累積値が大きくなると、2つの処理ユニットの処理結果
の一致をとることが不可能になってしまう。
In order to solve this problem, the present inventor has
I thought it would be better to operate the two processing units with clocks from different clock oscillators. However, it is virtually impossible to obtain a clock oscillator capable of oscillating a clock having exactly the same clock frequency. Further, a highly accurate clock oscillator that can oscillate a clock having almost the same clock frequency is expensive. Therefore, in this case, the two processing units will operate with clocks having clock frequencies that are approximately equal to each other, but with a slight error. In other words, the two processing units will each have different clocks. In such two processing units operating with clocks having different clock frequencies, the time indicated by each clock gradually shifts as time passes, and the error accumulates. If the cumulative value of this error becomes large, it becomes impossible to match the processing results of the two processing units.

【0011】そこで、本願発明者は、2つの処理ユニッ
ト間の同期を取る方法、すなわち、互いの時計が示す時
刻を合わせる方法を提案し、既に、特願平3−1789
49号として出願した。
Therefore, the inventor of the present application has proposed a method for synchronizing two processing units, that is, a method for adjusting the times indicated by the clocks of the two processing units.
Filed as No. 49.

【0012】以下、図5および図6を参照して、上記提
案した従来の同期制御方法について説明する。ここで
は、ループタイムLTが6ミリ秒、予め設定された比較
値CMが2ミリ秒に相当するとする。また、2つの処理
ユニットを、それぞれ、第1の処理ユニットCPU1お
よび第2の処理ユニットCPU2と呼ぶことにする。第
1の処理ユニットCPU1に供給される第1のクロック
の第1のクロック周波数よりも第1の処理ユニットCP
U2に供給される第2のクロックの第2のクロック周波
数の方が若干高いとする。したがって、第1の処理ユニ
ットCPU1の第1の時計(第1のインターバルタイマ
IT1)よりも第2の処理ユニットCPU2の第2の時
計(第2のインターバルタイマIT2)の方が若干速く
進むことになる。また、第1および第2の処理ユニット
CPU1およびCPU2は、それぞれ、第1および第2
の読出し専用メモリを備え、これらには全く同一のプロ
グラムが格納されている。このプログラムはメイン処理
ルーチン(図5(a))と割込み処理ルーチン(図5
(b))とを有する。第1および第2の処理ユニットC
PU1およびCPU2の各々は、各ループタイムLTの
間に、メイン処理ルーチンと割込み処理ルーチンとをそ
れぞれ3回繰り返すことになる。この同期制御方法で
は、説明を進めていくと明らかになるように、第1およ
び第2の処理ユニットCPU1およびCPU2間の同期
を取るために、進みの遅い第1の処理ユニットCPU1
の第1の時計の時刻の方に進みの速い第2の処理ユニッ
トCPU2の第2の時計の時刻を合わせる。
The proposed conventional synchronization control method will be described below with reference to FIGS. 5 and 6. Here, it is assumed that the loop time LT corresponds to 6 milliseconds and the preset comparison value CM corresponds to 2 milliseconds. The two processing units will be referred to as a first processing unit CPU1 and a second processing unit CPU2, respectively. The first processing unit CP is higher than the first clock frequency of the first clock supplied to the first processing unit CPU1.
It is assumed that the second clock frequency of the second clock supplied to U2 is slightly higher. Therefore, the second clock (second interval timer IT2) of the second processing unit CPU2 advances slightly faster than the first clock (first interval timer IT1) of the first processing unit CPU1. Become. In addition, the first and second processing units CPU1 and CPU2 respectively include the first and second processing units.
Read-only memory, which stores exactly the same program. This program consists of a main processing routine (Fig. 5 (a)) and an interrupt processing routine (Fig. 5).
(B)). First and second processing unit C
Each of the PU1 and the CPU2 repeats the main processing routine and the interrupt processing routine three times during each loop time LT. In this synchronous control method, as will become clear as the description proceeds, the first processing unit CPU1 which is slow in advance is synchronized in order to synchronize the first and second processing units CPU1 and CPU2.
The time of the second clock of the second processing unit CPU2, which advances faster than the time of the first clock, is adjusted.

【0013】図6に於いて、1行目に第1の処理ユニッ
トCPU1の第1のインターバルタイマIT1の値を示
し、2行目に第1の処理ユニットCPU1の割込みタイ
ミングを示す。そして、3行目に第2の処理ユニットC
PU2の第2のインターバルタイマIT2の値を示し、
4行目に第2の処理ユニットCPU2の割込みタイミン
グを示す。
In FIG. 6, the first line shows the value of the first interval timer IT1 of the first processing unit CPU1 and the second line shows the interrupt timing of the first processing unit CPU1. Then, in the third line, the second processing unit C
Shows the value of the second interval timer IT2 of PU2,
The fourth line shows the interrupt timing of the second processing unit CPU2.

【0014】まず、第1および第2の処理ユニットCP
U1およびCPU2の第1および第2のインターバルタ
イマIT1およびIT2がプリセットされることによ
り、ループタイムLTが開始する。この時点から、1回
目のメイン処理ルーチンが第1および第2の処理ユニッ
トCPU1および2の各々で開始する。この1回目のメ
イン処理ルーチンの処理(ステップS1)中、第1およ
び第2の処理ユニットCPU1およびCPU2では、そ
れぞれ、第1および第2のインターバルタイマIT1お
よびIT2の値と比較値とを比較する。上述したよう
に、第1のインターバルタイマIT1よりも第2のイン
ターバルタイマIT2の方が速く進むので、先に第2の
インターバルタイマIT2の値と比較値とが一致する。
この一致時点で、第2の処理ユニットCPU2のメイン
処理ルーチンで第1の割込み1が発生する。ループタイ
ムLTの開始時点から第1の割込み1の発生時点まで間
は、第2の処理ユニットCPU2の第2の時計の2ミリ
秒に相当する。第1の割込みの発生後、第2の処理ユニ
ットCPU2において、1回目の割込み処理ルーチンの
処理(図5(b))が行われる。この割込み処理ルーチ
ンでは、まず割込みの回数をカウント(ステップS2)
し、そして、第2のインターバルタイマIT2をプリセ
ットする(ステップS3)。
First, the first and second processing units CP
The loop time LT is started by presetting the first and second interval timers IT1 and IT2 of U1 and CPU2. From this point, the first main processing routine starts in each of the first and second processing units CPU1 and CPU2. During the processing of the first main processing routine (step S1), the first and second processing units CPU1 and CPU2 respectively compare the values of the first and second interval timers IT1 and IT2 with the comparison value. .. As described above, since the second interval timer IT2 advances faster than the first interval timer IT1, the value of the second interval timer IT2 and the comparison value match first.
At the time of this coincidence, the first interrupt 1 is generated in the main processing routine of the second processing unit CPU2. The period from the start time of the loop time LT to the occurrence time of the first interrupt 1 corresponds to 2 milliseconds of the second clock of the second processing unit CPU2. After the occurrence of the first interrupt, the second processing unit CPU2 performs the processing of the first interrupt processing routine (FIG. 5B). In this interrupt processing routine, first, the number of interrupts is counted (step S2).
Then, the second interval timer IT2 is preset (step S3).

【0015】引き続いて、第1のインターバルタイマI
T1の値と比較値とが一致し、この一致時点で、第1の
処理ユニットCPU1のメイン処理ルーチンで第1の割
込み1が発生する。ループタイムLTの開始時点から第
1の割込み1の発生時点まで間は、第1の処理ユニット
CPU1の第1の時計の2ミリ秒に相当する。第2の処
理ユニットCPU2の場合と同様に、第1の割込みの発
生後、第1の処理ユニットCPU1において、1回目の
割込み処理ルーチン(図5(b))の処理が行われる。
この割込み処理ルーチンでは、まず割込みの回数をカウ
ント(ステップS2)し、そして、第1のインターバル
タイマIT1をプリセットする(ステップS3)。
Subsequently, the first interval timer I
The value of T1 and the comparison value match, and at the time of this match, the first interrupt 1 occurs in the main processing routine of the first processing unit CPU1. The period from the start time of the loop time LT to the generation time of the first interrupt 1 corresponds to 2 milliseconds of the first clock of the first processing unit CPU1. Similar to the case of the second processing unit CPU2, after the occurrence of the first interrupt, the processing of the first interrupt processing routine (FIG. 5B) is performed in the first processing unit CPU1.
In this interrupt processing routine, the number of interrupts is first counted (step S2), and then the first interval timer IT1 is preset (step S3).

【0016】このようにして、第1および第2の処理ユ
ニットCPU1およびCPU2において、1回目の割込
み処理ルーチンの処理(ステップS4)が行われ、最初
に第2の処理ユニットCPU2の割込み処理ルーチンの
処理が終了し、引き続いて、第1の処理ユニットCPU
1の割込み処理ルーチンの処理が終了する。ここで、第
1の処理ユニットCPU1の割込み処理ルーチンの処理
時間がxミリ秒であるとする。第1および第2の処理ユ
ニットCPU1およびCPU2の各々において、割込み
処理ルーチンの処理が終了したら、メイン処理ルーチン
(図5(a))に復帰し、2回目のメイン処理ルーチン
が実行される。
In this way, the first and second processing units CPU1 and CPU2 perform the first interrupt processing routine process (step S4), and first the second processing unit CPU2 interrupt processing routine is executed. After the processing is completed, the first processing unit CPU continues.
The processing of the interrupt processing routine 1 ends. Here, it is assumed that the processing time of the interrupt processing routine of the first processing unit CPU1 is x milliseconds. In each of the first and second processing units CPU1 and CPU2, when the processing of the interrupt processing routine is completed, the process returns to the main processing routine (FIG. 5A) and the second main processing routine is executed.

【0017】以下同様にして、第1および第2の処理ユ
ニットCPU1およびCPU2の各々において、2ミリ
秒経過毎に、第2および第3の割込みが発生し、2回目
および3回目の割込み処理ルーチンの処理が行われる。
この3回目の割込み処理ルーチンにおいて、割込みの回
数として“3”がカウントされる。3回目の割込み処理
ルーチンの処理終了後、第1および第2の処理ユニット
CPU1およびCPU2の各々において、再びメイン処
理ルーチンに復帰する。ここで、最初に第2の処理ユニ
ットCPU2がメイン処理ルーチンに復帰し、割込み回
数が“3”なので(ステップS5のYES)、割込み回
数を“0”にリセット(ステップS6)した後、第1の
処理ユニットCPU1と間で同期を取るために、第2の
処理ユニットCPU2は第1の処理ユニットCPU1へ
同期信号を転送する(ステップS7)。そして、第2の
処理ユニットCPU2は待ち状態に入る。引き続いて、
第1の処理ユニットCPU1がメイン処理ルーチンに復
帰し、割込み回数が“3”なので(ステップS5のYE
S)、割込み回数を“0”にリセット(ステップS6)
した後、第2の処理ユニットCPU2と間で同期を取る
ために、第1の処理ユニットCPU1は第2の処理ユニ
ットCPU2へ同期信号を転送する(ステップS7)。
In the same manner, the second and third interrupts are generated in each of the first and second processing units CPU1 and CPU2 every 2 milliseconds, and the second and third interrupt processing routines are executed. Is processed.
In this third interrupt processing routine, "3" is counted as the number of interrupts. After the processing of the third interrupt processing routine is completed, each of the first and second processing units CPU1 and CPU2 returns to the main processing routine again. Here, first, the second processing unit CPU2 returns to the main processing routine, and the number of interrupts is "3" (YES in step S5), so the number of interrupts is reset to "0" (step S6), and then the first The second processing unit CPU2 transfers the synchronization signal to the first processing unit CPU1 in order to synchronize with the first processing unit CPU1 (step S7). Then, the second processing unit CPU2 enters the waiting state. Then,
The first processing unit CPU1 returns to the main processing routine and the number of interrupts is "3" (YE in step S5).
S), reset the number of interrupts to "0" (step S6)
Then, in order to synchronize with the second processing unit CPU2, the first processing unit CPU1 transfers a synchronization signal to the second processing unit CPU2 (step S7).

【0018】第1および第2の処理ユニットCPU1お
よびCPU2の両方において、自己が発生した同期信号
と他方からの同期信号とを確認する(ステップS7のY
ES)と、第1および第2の処理ユニットCPU1およ
びCPU2は、それぞれ、第1および第2のインターバ
ルタイマIT1およびIT2をプリセットする(ステッ
プS8)。これにより、第1および第2の処理ユニット
CPU1およびCPU2間で同期が取られ、次のループ
タイムLTが開始する。
In both the first and second processing units CPU1 and CPU2, the synchronization signal generated by itself and the synchronization signal from the other are confirmed (Y in step S7).
ES) and the first and second processing units CPU1 and CPU2 preset the first and second interval timers IT1 and IT2, respectively (step S8). As a result, the first and second processing units CPU1 and CPU2 are synchronized and the next loop time LT starts.

【0019】ここで、図6に示したように、第1の処理
ユニットCPU1における実際のループタイムLTは、
第1の時計で6ミリ秒ではなく、(6+x)ミリ秒であ
ることに注意されたい。もちろん、第2の処理ユニット
CPU2における実際のループタイムLTは、第2の時
計では、(6+x)ミリ秒より長くなる。とにかく、上
述の説明から明らかように、進みの遅い第1の処理ユニ
ットCPU1の第1の時計の時刻に進みの速い第2の処
理ユニットCPU2の第2の時計の時刻を合わせること
ができる。
Here, as shown in FIG. 6, the actual loop time LT in the first processing unit CPU1 is
Note that the first clock has (6 + x) milliseconds instead of 6 milliseconds. Of course, the actual loop time LT in the second processing unit CPU2 is longer than (6 + x) milliseconds in the second clock. At any rate, as is apparent from the above description, it is possible to set the time of the second clock of the fast second processing unit CPU2 to the time of the first clock of the slow first processing unit CPU1.

【0020】このように、2つの処理ユニットはそれぞ
れ別々のクロック発振器からのクロックに同期して動作
しているので、一方の側の処理ユニットの側のクロック
発振器が故障しても、他方のクロック発振器が正常に動
作している限りは、このクロック発振器からクロックが
供給される処理ユニットは正常に動作することになる。
この場合、動作不能な処理ユニットからはいくら待って
も同期信号が送出されてこないので、正常に動作してい
る処理ユニットでは、この同期信号が所定時間待っても
送られてこないことを確認した時点で、他方の処理ユニ
ットに障害が発生したと判断する。これにより、正常に
動作している処理ユニットは、当該ABS制御回路によ
るブレーキ制御を解除して、通常のブレーキ制御へ戻す
ような処理を行うことができる。すなわち、フェイルセ
イフを行うことができる。
As described above, since the two processing units operate in synchronization with the clocks from the different clock oscillators respectively, even if the clock oscillator on the side of the processing unit on one side fails, the clock on the other side fails. As long as the oscillator is operating normally, the processing unit clocked by this clock oscillator will operate normally.
In this case, the synchronization signal is not sent out from the inoperable processing unit no matter how much time is waited, so it was confirmed that this synchronization signal was not sent even after waiting a predetermined time in the processing unit operating normally. At this point, it is determined that the other processing unit has failed. As a result, the processing unit that is operating normally can perform processing that releases the brake control by the ABS control circuit and returns to normal brake control. That is, fail safe can be performed.

【0021】[0021]

【発明が解決しようとする課題】上述した従来の同期制
御方法では、ループタイムを6ミリ秒に設定したにも拘
らず、実際のループタイムは、割込み処理時間(xミリ
秒)分だけ加算された(6+x)ミリ秒になってしま
う。この割込み処理時間に基づくループタイムの誤差
は、ブレーキによる制動を行っている時間に比例して累
積していく。一方、読出し専用メモリROMに格納され
たプログラムは、ループタイムが6ミリ秒のときに、最
適な制動作用を得ることができるように予めプログラム
されている。したがって、従来の同期制御方法を採用し
ているABS制御回路では、ループタイムの誤差の累積
により、緻密なABS制御を行うことができない。
In the above-mentioned conventional synchronous control method, the actual loop time is added by the interrupt processing time (x milliseconds) even though the loop time is set to 6 milliseconds. It becomes (6 + x) milliseconds. The loop time error based on the interrupt processing time accumulates in proportion to the braking time. On the other hand, the program stored in the read-only memory ROM is preprogrammed so as to obtain the optimum braking action when the loop time is 6 milliseconds. Therefore, the ABS control circuit adopting the conventional synchronous control method cannot perform precise ABS control due to accumulation of loop time errors.

【0022】このような従来の同期制御方法による欠点
は、何もABS制御回路においてのみ現れるものではな
く、他の並列処理システム(並列冗長システム)に対し
ても同様に現れる欠点である。
The drawbacks of such a conventional synchronous control method are not only appearing only in the ABS control circuit, but also appearing in other parallel processing systems (parallel redundant systems).

【0023】したがって本発明の目的は、複数の処理ユ
ニットを有する並列処理システムに対して緻密な制御を
行なわせることができる複数処理ユニット間の同期制御
方法を提供することにある。
Therefore, an object of the present invention is to provide a synchronous control method for a plurality of processing units, which enables a parallel processing system having a plurality of processing units to perform precise control.

【0024】[0024]

【課題を解決するための手段】本発明による複数処理ユ
ニット間の同期制御方法は、それぞれが専用のクロック
発振器を有し、このクロック発振器から供給されるクロ
ック信号に同期して、所定のループタイム内に所定の回
数割込み処理を行う処理を繰り返し、前記ループタイム
および前記各割込み処理の開始時点毎にプリセットされ
前記クロック信号を計時する計時動作を開始し、その計
時値が所定の比較値と一致したときに、新たに前記割込
み処理を行う処理ユニットが、複数存在するときに、前
記各処理ユニットの前記ループタイムにおける最後の割
込み処理が終了した時点で、前記各処理ユニット間の同
期を取り、全ての前記処理ユニットの前記ループタイム
の開始時点を一致させる同期制御方法において、前記処
理ユニットは、それぞれ前記割込み処理の開始直後は前
記比較値として、前記ループタイムを前記割込み処理の
回数で除した値とし、前記ループタイムの開始直後は前
記比較値として、全ての前記処理ユニットで平行して実
行された前回のループタイムの最後の前記割込み処理終
了時点での前記計時値の内で最小のものを前記所定の比
較値から差し引いた値とすることを特徴とする。
According to the method for controlling synchronization between a plurality of processing units according to the present invention, each has a dedicated clock oscillator, and a predetermined loop time is synchronized with a clock signal supplied from the clock oscillator. The process of performing the interrupt process a predetermined number of times is repeated, and the clocking operation for clocking the clock signal preset at each start time of the loop time and each interrupt process is started, and the clocked value matches the predetermined comparison value. When there are a plurality of processing units that newly perform the interrupt processing, when the last interrupt processing in the loop time of each processing unit is completed, the processing units are synchronized with each other, In the synchronous control method for matching the start time points of the loop times of all the processing units, the processing units are Immediately after the start of the interrupt processing, as the comparison value, a value obtained by dividing the loop time by the number of times of the interrupt processing, and immediately after the start of the loop time as the comparison value, in parallel in all the processing units. It is characterized in that the smallest one of the time count values at the time of ending the interrupt processing at the end of the last loop time executed is set to a value obtained by subtracting from the predetermined comparison value.

【0025】[0025]

【実施例】次に、本発明の実施例について図面を参照し
て説明する。
Embodiments of the present invention will now be described with reference to the drawings.

【0026】図2は本発明による同期制御方法が適用で
きる並列処理システムを示すブロック図である。本実施
例において、図示の並列処理システムは、ABS制御回
路である。
FIG. 2 is a block diagram showing a parallel processing system to which the synchronous control method according to the present invention can be applied. In the present embodiment, the illustrated parallel processing system is an ABS control circuit.

【0027】ABS制御回路は、第1および第2の処理
ユニットCPU1およびCPU2を有する。第1および
第2の処理ユニットCPU1およびCPU2には、それ
ぞれ、第1および第2のクロック発振器CO1およびC
O2から第1および第2のクロック周波数をもつ第1お
よび第2のクロックが供給される。
The ABS control circuit has first and second processing units CPU1 and CPU2. The first and second processing units CPU1 and CPU2 respectively include first and second clock oscillators CO1 and C2.
First and second clocks having first and second clock frequencies are supplied from O2.

【0028】第1および第2の処理ユニットCPU1お
よびCPU2は、それぞれ、後述するように、第1およ
び第2の同期信号線11および12を介して第1および
第2の同期信号を第2および第1の処理ユニットCPU
2およびCPU1へ転送する。第1および第2の処理ユ
ニットCPU1およびCPU2はデータバス13を介し
て互いに接続されている。このデータバス13を介し
て、後述するように、第1および第2のタイマ値が、そ
れぞれ、第1および第2の処理ユニットCPU1および
CPU2から第2および第1の処理ユニットCPU2お
よびCPU1へ転送される。
The first and second processing units CPU1 and CPU2 respectively output the first and second synchronization signals via the first and second synchronization signal lines 11 and 12, respectively, as described later. First processing unit CPU
2 and CPU1. The first and second processing units CPU1 and CPU2 are connected to each other via a data bus 13. As will be described later, first and second timer values are transferred from the first and second processing units CPU1 and CPU2 to the second and first processing units CPU2 and CPU1 via the data bus 13, respectively. To be done.

【0029】第1および第2の処理ユニットCPU1お
よびCPU2はそれぞれ第1および第2の制御信号を出
力する。第1および第2の制御信号はアンド回路14で
論理積が取られた後、アクチュエータ(ソレノイドバル
ブ)へ送出される。すなわち、アンド回路14では第1
の制御信号と第2の制御信号とが一致したときのみ、そ
の一致した制御信号をアクチュエータへ送出する。
The first and second processing units CPU1 and CPU2 output first and second control signals, respectively. The first and second control signals are ANDed by the AND circuit 14 and then sent to the actuator (solenoid valve). That is, in the AND circuit 14, the first
Only when the control signal of 1 and the second control signal match, the matched control signal is sent to the actuator.

【0030】第1および第2の処理ユニットCPU1お
よびCPU2は、それぞれ、第1および第2の読出し専
用メモリ(図示せず)を備え、これらには全く同一のプ
ログラムが格納されている。したがって、第1および第
2の処理ユニットCPU1およびCPU2は、それぞ
れ、第1および第2のクロック発振器CO1およびCO
2から供給される第1および第2のクロックに同期して
同一の所定の処理を行う。従来の技術を説明するために
なされた仮定がここでもなされる。すなわち、ループタ
イムLTが6ミリ秒、予めレジスタ(後述する)に設定
される比較値CMが2ミリ秒に相当するとする。第1の
処理ユニットCPU1に供給される第1のクロックの第
1のクロック周波数よりも第1の処理ユニットCPU2
に供給される第2のクロックの第2のクロック周波数の
方が若干高いとする。したがって、第1の処理ユニット
CPU1の第1の時計(第1のインターバルタイマIT
1)よりも第2の処理ユニットCPU2の第2の時計
(第2のインターバルタイマIT2)の方が若干速く進
むことになる。
The first and second processing units CPU1 and CPU2 respectively include first and second read-only memories (not shown) in which exactly the same programs are stored. Therefore, the first and second processing units CPU1 and CPU2 respectively include the first and second clock oscillators CO1 and CO2.
The same predetermined processing is performed in synchronism with the first and second clocks supplied from 2. Assumptions made to explain the prior art are also made here. That is, it is assumed that the loop time LT corresponds to 6 milliseconds and the comparison value CM preset in the register (described later) corresponds to 2 milliseconds. The first processing unit CPU2 is higher than the first clock frequency of the first clock supplied to the first processing unit CPU1.
It is assumed that the second clock frequency of the second clock supplied to the is slightly higher. Therefore, the first clock (first interval timer IT of the first processing unit CPU1
The second clock (second interval timer IT2) of the second processing unit CPU2 advances slightly faster than 1).

【0031】図1に第1および第2の読出し専用メモリ
に格納されるプログラムを示す。図5に示されたものと
同様に、図1に示したプログラムはメイン処理ルーチン
(図1(a))と割込み処理ルーチン(図1(b))と
を有する。第1および第2の処理ユニットCPU1およ
びCPU2の各々は、各ループタイムLTの間に、メイ
ン処理ルーチンと割込み処理ルーチンとをそれぞれ3回
繰り返すことになる。
FIG. 1 shows programs stored in the first and second read-only memories. Like the program shown in FIG. 5, the program shown in FIG. 1 has a main processing routine (FIG. 1A) and an interrupt processing routine (FIG. 1B). Each of the first and second processing units CPU1 and CPU2 repeats the main processing routine and the interrupt processing routine three times during each loop time LT.

【0032】図1において、従来の同期制御方法を実現
するプログラムを示す図5と同様のステップには同一参
照符号を付し、説明を簡単にするためにそれらの説明に
ついては省略する。図1において、図5と相違する点
は、割込み処理ルーチンに、比較値として予め設定した
値をレジスタに格納するステップS9を追加し、メイン
処理ルーチンに、タイマ値を読込むためのステップS1
0、タイマ値を他方のCPUへ転送するためのステップ
S11、自CPUと他方のCPUのタイマ値の小さい方
をタイマ値TMとして選択するステップS12、および
比較値として予め設定した値からタイマ値TMを差し引
いて得られる値をレジスタに格納するステップS13を
付加したことである。
In FIG. 1, steps similar to those in FIG. 5 showing a program for realizing the conventional synchronization control method are designated by the same reference numerals, and the description thereof will be omitted for simplification of the description. 1 is different from FIG. 5 in that step S9 for storing a preset value as a comparison value in a register is added to the interrupt processing routine, and step S1 for reading the timer value in the main processing routine.
0, step S11 for transferring the timer value to the other CPU, step S12 for selecting the smaller timer value of the own CPU and the other CPU as the timer value TM, and the timer value TM from the preset value as the comparison value. That is, step S13 of storing the value obtained by subtracting the value in the register is added.

【0033】以下、本発明による同期制御方法につい
て、図1、図2および図3を参照して説明する。
The synchronization control method according to the present invention will be described below with reference to FIGS. 1, 2 and 3.

【0034】メイン処理ルーチンにおいて、ステップS
7で第1および第2の処理ユニットCPU1およびCP
U2との両方で同期信号が確認されたなら、第1および
第2の処理ユニットCPU1およびCPU2は、それぞ
れ、第1および第2のインターバルタイマIT1および
IT2の値を第1および第2のタイマ値TM1およびT
M2として読み込ん(ステップS10)だ後、第1およ
び第2のタイマ値TM1およびTM2をプリセットする
(ステップS8)。それから、第1および第2の処理ユ
ニットCPU1およびCPU2は、それぞれ、その読込
んだ第1および第2のタイマ値TM1およびTM2をデ
ータバス13(図2)を介して、第2および第1の処理
ユニットCPU2およびCPU1へ転送する(ステップ
S11)。第1および第2の処理ユニットCPU1およ
びCPU2では、各々、第1および第2のタイマ値TM
1およびTM2の中で小さい値の方をタイマ値TMとし
て選択する(ステップS12)。この例では、第1のタ
イマ値TM1の方が第2のタイマ値TM2より小さいの
で、タイマ値TMとして第1のタイマ値TM1が選択さ
れる。
In the main processing routine, step S
7, first and second processing units CPU1 and CP
If the synchronization signal is confirmed with both U2, the first and second processing units CPU1 and CPU2 change the values of the first and second interval timers IT1 and IT2, respectively, to the first and second timer values. TM1 and T
After being read as M2 (step S10), the first and second timer values TM1 and TM2 are preset (step S8). Then, the first and second processing units CPU1 and CPU2 respectively read the read first and second timer values TM1 and TM2 via the data bus 13 (FIG. 2). The data is transferred to the processing units CPU2 and CPU1 (step S11). In the first and second processing units CPU1 and CPU2, respectively, the first and second timer values TM
The smaller value of 1 and TM2 is selected as the timer value TM (step S12). In this example, since the first timer value TM1 is smaller than the second timer value TM2, the first timer value TM1 is selected as the timer value TM.

【0035】第1および第2の処理ユニットCPU1お
よびCPU2では、各々、予め設定した比較値CMから
タイマ値TMを差し引き、その差し引いて得られる値
を、レジスタ(図示せず)に新しい比較値CMとして格
納する(ステップS13)。すなわち、次のループタイ
ムLTの初回の比較値CMとして、予め設定した比較値
CMからタイマ値TMを差し引いた値が設定される。
In each of the first and second processing units CPU1 and CPU2, the timer value TM is subtracted from the preset comparison value CM, and the value obtained by the subtraction is stored in a register (not shown) as a new comparison value CM. (Step S13). That is, a value obtained by subtracting the timer value TM from the preset comparison value CM is set as the first comparison value CM for the next loop time LT.

【0036】一方、2回目および3回目の比較値CM
は、それぞれ、1回目および2回目の割込み処理中に、
割込み処理ルーチンのステップS9で、予め設定した値
(2ミリ秒に相当する)にセットされる。
On the other hand, the comparison value CM of the second and third times
Respectively, during the first and second interrupt handling,
In step S9 of the interrupt processing routine, a preset value (corresponding to 2 milliseconds) is set.

【0037】この結果、図3に示されるように、ループ
タイムLTの開始時点から第1の割込み発生時点までの
時間は2ミリ秒からタイマ値TMを引いた時間に等し
い。また、第1の割込み発生時点から第2の割込み発生
時点までの時間および第2の割込み発生時点から第3の
割込み発生時点までの時間は2ミリ秒に等しい。そし
て、第3の割込み発生時点から次のループタイムLTの
開始時点までの時間、すなわち、割込み処理時間はタイ
マ値TMに等しい。その結果、各ループタイムLTは丁
度、遅い方のCPUの時計で、6ミリ秒に等しくなる。
As a result, as shown in FIG. 3, the time from the start time of the loop time LT to the first interrupt generation time is equal to 2 milliseconds minus the timer value TM. Also, the time from the first interrupt occurrence time to the second interrupt occurrence time and the time from the second interrupt occurrence time to the third interrupt occurrence time are equal to 2 milliseconds. The time from the occurrence of the third interrupt to the start of the next loop time LT, that is, the interrupt processing time, is equal to the timer value TM. As a result, each loop time LT is exactly equal to 6 ms on the clock of the slower CPU.

【0038】上記実施例では、ソフトウェアによって本
発明による同期制御方法を実現する例について説明した
が、以下に述べるように、ハードウェアによって本発明
による同期制御方法を実現しても良い。
In the above embodiment, an example in which the synchronization control method according to the present invention is realized by software has been described. However, as described below, the synchronization control method according to the present invention may be realized by hardware.

【0039】図3に本発明による同期制御方法を実現す
る第1および第2の処理ユニットCPU1およびCPU
2の構成例を示す。
FIG. 3 shows first and second processing units CPU1 and CPU for realizing the synchronous control method according to the present invention.
2 shows an example of the configuration.

【0040】第1および第2の処理ユニットCPU1お
よびCPU2の各々は、計時動作を行うインターバルタ
イマ21と、比較値CMを格納するレジスタ22とを有
する。従来においては、レジスタ22に格納される比較
値CMは固定値であるが、本発明では固定値ではなく後
述するように選択的に設定される。インターバルタイマ
21は後述するようにプリセットされる。インターバル
タイマ21の値と比較値CMとは比較器23で比較さ
れ、これらの値が一致したとき、比較器23は値一致信
号を出力する。この値一致信号は割込み信号として割込
み処理部24に供給される。また、値一致信号はオアゲ
ート25を介してインターバルタイマ21をプリセット
する。この値一致信号に応答して、カウンタ26は割込
み回数をカウントする。割込み回数と所定数(この例で
は“3”)とは比較器27で比較され、これらの数が一
致すると、比較器27は数一致信号を出力する。この数
一致信号はラッチ回路28でラッチされる。また、数一
致信号によってカウンタ26はリセットされる。
Each of the first and second processing units CPU1 and CPU2 has an interval timer 21 for performing a time counting operation and a register 22 for storing a comparison value CM. Conventionally, the comparison value CM stored in the register 22 is a fixed value, but in the present invention, it is not a fixed value but is selectively set as described later. The interval timer 21 is preset as described later. The value of the interval timer 21 and the comparison value CM are compared by the comparator 23, and when these values match, the comparator 23 outputs a value match signal. This value matching signal is supplied to the interrupt processing unit 24 as an interrupt signal. Further, the value coincidence signal presets the interval timer 21 via the OR gate 25. In response to this value match signal, the counter 26 counts the number of interrupts. The comparator 27 compares the number of interruptions with a predetermined number (“3” in this example), and if these numbers match, the comparator 27 outputs a number match signal. This number coincidence signal is latched by the latch circuit 28. Further, the counter 26 is reset by the number coincidence signal.

【0041】数一致信号をラッチすると、ラッチ回路2
8はそのラッチした信号をアンドゲート29へ供給す
る。アンドゲート29には割込み処理部24から割込み
処理終了信号が供給される。したがって、アンドゲート
29は、割込み回数が“3”になった後に供給される割
込み処理終了信号を通過させる。このアンドゲート29
を通過した信号は同期信号として他のCPUへ送出され
ると共にアンドゲート3へも供給される。この通過した
割込み処理終了信号に応答して、レジスタ31はインタ
ーバルタイマ21の値を保持する。この保持した値は、
割込み処理時間に対応するタイマ値に等しい。このレジ
スタ31に保持されたタイマ値は、データバス13を介
して他のCPUへ転送される。一方、レジスタ32は他
のCPUから転送されてきたタイマ値を保持する。
When the number match signal is latched, the latch circuit 2
8 supplies the latched signal to the AND gate 29. An interrupt processing end signal is supplied from the interrupt processing unit 24 to the AND gate 29. Therefore, the AND gate 29 passes the interrupt processing end signal supplied after the number of interrupts reaches "3". This AND gate 29
The signal passed through is sent to another CPU as a synchronizing signal and is also supplied to the AND gate 3. In response to the passed interrupt processing end signal, the register 31 holds the value of the interval timer 21. This held value is
It is equal to the timer value corresponding to the interrupt processing time. The timer value held in the register 31 is transferred to another CPU via the data bus 13. On the other hand, the register 32 holds the timer value transferred from another CPU.

【0042】アンドゲート30には他のCPUから転送
されてきた同期信号が供給される。したがって、アンド
ゲート30は自CPUと他のCPUの両方から同期信号
を受け取ると、同期タイミング信号をオアゲート25を
介してインターバルタイマ21へ供給してインターバル
タイマ21をプリセットする。また、この同期タイミン
グ信号によって、ラッチ回路28はリセットされる。
The AND gate 30 is supplied with the synchronization signal transferred from another CPU. Therefore, when the AND gate 30 receives a synchronization signal from both the own CPU and another CPU, the AND gate 30 supplies the synchronization timing signal to the interval timer 21 via the OR gate 25 to preset the interval timer 21. Further, the latch circuit 28 is reset by this synchronization timing signal.

【0043】最小値選択回路33は2つのレジスタ31
および32に保持されたタイマ値の内、小さい値の方を
選択して、選択したタイマ値TMを出力する。減算器3
4は、予め設定した値(この値は2ミリ秒に相当し、本
例では“10”)からタイマ値TMを減算して、減算結
果を出力する。減算結果と予め設定された値との一方が
セレクタ35で選択され、この選択した値が比較値CM
としてレジスタ22に格納される。セレクタ35には、
ラッチ回路28から出力されるラッチした信号を遅延回
路36で所定遅延時間だけ遅延した信号が選択指示信号
として供給される。ここで、ラッチ回路28から出力さ
れるラッチした信号を、直接、選択指示信号としてセレ
クタ35に供給せず、遅延回路36からの遅延した信号
をセレクタ35の選択指示信号として使用した理由につ
いては、遅延回路36の所定遅延時間の範囲と共に、後
で詳述する。とにかく、セレクタ35は、選択指示信号
が論理ハイレベルHを示しているときには、選択した値
として減算結果を選択し、選択指示信号が論理ロウレベ
ルLを示しているときには、選択した値として予め設定
した値を選択する。
The minimum value selection circuit 33 includes two registers 31.
A smaller value is selected from the timer values held in and 32, and the selected timer value TM is output. Subtractor 3
Reference numeral 4 subtracts the timer value TM from a preset value (this value corresponds to 2 milliseconds, "10" in this example) and outputs the subtraction result. One of the subtraction result and the preset value is selected by the selector 35, and the selected value is the comparison value CM.
Is stored in the register 22 as The selector 35 has
A signal obtained by delaying the latched signal output from the latch circuit 28 by a predetermined delay time by the delay circuit 36 is supplied as a selection instruction signal. Here, the reason why the latched signal output from the latch circuit 28 is not directly supplied to the selector 35 as the selection instruction signal but the delayed signal from the delay circuit 36 is used as the selection instruction signal of the selector 35 is as follows. The range of the predetermined delay time of the delay circuit 36 will be described later in detail. In any case, the selector 35 selects the subtraction result as the selected value when the selection instruction signal indicates the logical high level H, and preset as the selected value when the selection instruction signal indicates the logical low level L. Select a value.

【0044】以下、本発明のハードウェアによる同期制
御方法について、図2、図3および図4を参照して説明
する。
The hardware synchronization control method of the present invention will be described below with reference to FIGS. 2, 3 and 4.

【0045】第1および第2の処理ユニットCPU1お
よびCPU2との両方で同期信号がアンドゲート30に
より確認されたなら、第1および第2の処理ユニットC
PU1およびCPU2は、それぞれ、第1および第2の
インターバルタイマIT1およびIT2の値を第1およ
び第2のタイマ値TM1およびTM2としてレジスタ3
1および32に読み込んだ後、第1および第2のタイマ
値TM1およびTM2をプリセットする。それから、第
1および第2の処理ユニットCPU1およびCPU2
は、それぞれ、その読込んだ第1および第2のタイマ値
TM1およびTM2をデータバス13(図2)を介し
て、第2および第1の処理ユニットCPU2およびCP
U1へ転送する。第1および第2の処理ユニットCPU
1およびCPU2では、各々、最小値選択器33によ
り、第1および第2のタイマ値TM1およびTM2の中
で小さい値の方をタイマ値TMとして選択する。この例
では、第1のタイマ値TM1の方が第2のタイマ値TM
2より小さいので、タイマ値TMとして第1のタイマ値
TM1が選択される。
If the synchronization signal is confirmed by the AND gate 30 in both the first and second processing units CPU1 and CPU2, the first and second processing units C
PU1 and CPU2 respectively register the values of the first and second interval timers IT1 and IT2 as the first and second timer values TM1 and TM2, respectively.
After reading 1 and 32, the first and second timer values TM1 and TM2 are preset. Then, the first and second processing units CPU1 and CPU2
Respectively read the read first and second timer values TM1 and TM2 through the data bus 13 (FIG. 2) into the second and first processing units CPU2 and CP, respectively.
Transfer to U1. First and second processing unit CPU
In the CPU 1 and the CPU 2, the minimum value selector 33 selects the smaller one of the first and second timer values TM1 and TM2 as the timer value TM. In this example, the first timer value TM1 is the second timer value TM
Since it is smaller than 2, the first timer value TM1 is selected as the timer value TM.

【0046】第1および第2の処理ユニットCPU1お
よびCPU2では、各々、減算器34によって予め設定
した比較値CMからタイマ値TMを差し引き、その差し
引いて得られる値を、セククタ35を介してレジスタ2
2に新しい比較値CMとして格納する。すなわち、次の
ループタイムLTの初回の比較値CMとして、予め設定
した比較値CMからタイマ値TMを差し引いた値が設定
される。
In each of the first and second processing units CPU1 and CPU2, the timer value TM is subtracted from the comparison value CM preset by the subtractor 34, and the value obtained by the subtraction is transferred to the register 2 via the sector 35.
2 is stored as a new comparison value CM. That is, a value obtained by subtracting the timer value TM from the preset comparison value CM is set as the first comparison value CM for the next loop time LT.

【0047】ここで、減算器34からの減算値を、セク
クタ35を介してレジスタ22に新しい比較値CMとし
て格納する格納タイミングについて、上記遅延回路36
の所定遅延時間と関連づけて説明する。この格納タイミ
ングは、次の条件を満足する必要がある。格納タイミ
ングが図3の『CM=CM−TM』時点より前であるこ
と。図3の『CM=CM−TM』時点で、セレクタ3
5は減算器34側を選択していること。この2つの条件
を満足させるために、遅延回路36に設定される所定遅
延時間Tdは、次の数式1で表される範囲を満足する必
要がある。
Here, regarding the storage timing of storing the subtracted value from the subtractor 34 as a new comparison value CM in the register 22 via the ector 35, the delay circuit 36 will be described.
Will be described in association with the predetermined delay time. This storage timing needs to satisfy the following conditions. The storage timing is before the time of "CM = CM-TM" in FIG. At the time of “CM = CM-TM” in FIG. 3, the selector 3
5 means that the subtractor 34 side is selected. In order to satisfy these two conditions, the predetermined delay time Td set in the delay circuit 36 needs to satisfy the range represented by the following mathematical formula 1.

【0048】[0048]

【数1】 [Equation 1]

【0049】一方、2回目および3回目の比較値CM
は、それぞれ、割込み処理部24での1回目および2回
目の割込み処理中に、セレクタ35によって予め設定し
た値(2ミリ秒に相当する“10”)にセットされる。
On the other hand, the comparison value CM for the second and third times
Are respectively set to values (“10” corresponding to 2 milliseconds) preset by the selector 35 during the first and second interruption processing in the interruption processing unit 24.

【0050】この結果、図3に示されるように、ループ
タイムLTの開始時点から第1の割込み発生時点までの
時間は2ミリ秒からタイマ値TMを引いた時間に等し
い。また、第1の割込み発生時点から第2の割込み発生
時点までの時間および第2の割込み発生時点から第3の
割込み発生時点までの時間は2ミリ秒に等しい。そし
て、第3の割込み発生時点から次のループタイムLTの
開始時点までの時間、すなわち、割込み処理時間はタイ
マ値TMに等しい。その結果、各ループタイムLTは丁
度、遅い方のCPUの時計で、6ミリ秒に等しくなる。
As a result, as shown in FIG. 3, the time from the start of the loop time LT to the occurrence of the first interrupt is equal to 2 milliseconds minus the timer value TM. Also, the time from the first interrupt occurrence time to the second interrupt occurrence time and the time from the second interrupt occurrence time to the third interrupt occurrence time are equal to 2 milliseconds. The time from the occurrence of the third interrupt to the start of the next loop time LT, that is, the interrupt processing time, is equal to the timer value TM. As a result, each loop time LT is exactly equal to 6 ms on the clock of the slower CPU.

【0051】上述した実施例では、同期制御方法をAB
S制御回路に適用した場合について説明したが、カーエ
レクトロニクスの分野で高信頼性が要求され、暴走を回
避しなければならないシステム、例えば、4輪操舵制御
回路やトラクション制御回路にも適用できる。さらに、
カーエレクトロニクスの分野以外にも信頼性が要求され
るシステム、例えば、航空機の制御システム等へも本発
明の同期制御方法が適用可能である。
In the above-described embodiment, the synchronization control method is AB
Although the case of application to the S control circuit has been described, the present invention can be applied to a system that requires high reliability in the field of car electronics and must avoid runaway, such as a four-wheel steering control circuit and a traction control circuit. further,
The synchronous control method of the present invention can be applied to a system that requires reliability other than the field of car electronics, such as an aircraft control system.

【0052】また、上記実施例では、処理ユニットを2
個含む並列処理システムの場合について説明したが、3
個以上の処理ユニットを有する並列処理システムにも同
様に適用できる。
Further, in the above embodiment, the number of processing units is two.
I explained the case of parallel processing system that includes 3
It is similarly applicable to a parallel processing system having more than one processing unit.

【0053】[0053]

【発明の効果】以上説明したように、本発明によれば、
ループが終了する毎に複数の処理ユニット間で同期を取
り、各々の処理ユニットのタイマ値をデータ転送し、タ
イマ値の最小のものを比較値から引いた値を、次のルー
プの初回の比較値とすることにより、割込み間隔を常に
同じにすることができ、また、ループタイムも割込み処
理により作ることができるので、割込み処理内で制御出
力を行え、並列処理システムに対してより緻密な制御を
行なわせることができる。
As described above, according to the present invention,
Each time the loop ends, synchronization is made between multiple processing units, the timer value of each processing unit is transferred, and the value with the minimum timer value subtracted from the comparison value is compared for the first time in the next loop. By setting a value, the interrupt interval can always be made the same, and the loop time can also be created by interrupt processing, so control output can be performed within interrupt processing, and more precise control for parallel processing systems. Can be done.

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

【図1】本発明の一実施例による同期制御方法を実現す
るために各処理ユニットの読出し専用メモリに格納され
るプログラムを表すフローチャートである。
FIG. 1 is a flowchart showing a program stored in a read-only memory of each processing unit to implement a synchronous control method according to an embodiment of the present invention.

【図2】本発明が適用される並列処理システムを示すブ
ロック図である。
FIG. 2 is a block diagram showing a parallel processing system to which the present invention is applied.

【図3】本発明の一実施例による同期制御方法を説明す
るためのタイムチャートである。
FIG. 3 is a time chart for explaining a synchronization control method according to an embodiment of the present invention.

【図4】並列処理システムを構成する各処理ユニットの
機能ブロック図である。
FIG. 4 is a functional block diagram of each processing unit constituting the parallel processing system.

【図5】従来の同期制御方法を実現するために各処理ユ
ニットの読出し専用メモリに格納されるプログラムを表
すフローチャートである。
FIG. 5 is a flowchart showing a program stored in a read-only memory of each processing unit to realize a conventional synchronization control method.

【図6】従来の同期制御方法を説明するためのタイムチ
ャートである。
FIG. 6 is a time chart for explaining a conventional synchronization control method.

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

S1 メイン処理ルーチン中のメイン処理ステップ S2 割込み回数計数ステップ S3 タイマプリセットステップ S5 割込み回数判定ステップ S6 割込み回数リセットステップ S7 同期確認ステップ S8 タイマプリセットステップ S9 比較値設定ステップ S10 タイマ値読込みステップ S11 タイマ値転送ステップ S12 タイマ値選択ステップ S13 比較値設定ステップ S1 Main processing step in the main processing routine S2 Interrupt count step S3 Timer preset step S5 Interrupt count determination step S6 Interrupt count reset step S7 Synchronization confirmation step S8 Timer preset step S9 Comparison value setting step S10 Timer value reading step S11 Timer value transfer Step S12 Timer value selection step S13 Comparison value setting step

Claims (1)

【特許請求の範囲】[Claims] 【請求項1】 それぞれが専用のクロック発振器を有
し、このクロック発振器から供給されるクロック信号に
同期して、所定のループタイム内に所定の回数割込み処
理を行う処理を繰り返し、前記ループタイムおよび前記
各割込み処理の開始時点毎にプリセットされ前記クロッ
ク信号を計時する計時動作を開始し、その計時値が所定
の比較値と一致したときに、新たに前記割込み処理を行
う処理ユニットが、複数存在するときに、前記各処理ユ
ニットの前記ループタイムにおける最後の割込み処理が
終了した時点で、前記各処理ユニット間の同期を取り、
全ての前記処理ユニットの前記ループタイムの開始時点
を一致させる同期制御方法において、 前記処理ユニットは、それぞれ前記割込み処理の開始直
後は前記比較値として、前記ループタイムを前記割込み
処理の回数で除した値とし、前記ループタイムの開始直
後は前記比較値として、全ての前記処理ユニットで平行
して実行された前回のループタイムの最後の前記割込み
処理終了時点での前記計時値の内で最小のものを前記所
定の比較値から差し引いた値とすることを特徴とする複
数処理ユニット間の同期制御方法。
1. Each has a dedicated clock oscillator, and in synchronism with a clock signal supplied from this clock oscillator, a process of performing an interrupt process a predetermined number of times within a predetermined loop time is repeated, and the loop time and There is a plurality of processing units that newly perform the interrupt processing when the clocking operation preset for each start time of each interrupt processing starts a clocking operation for clocking the clock signal and the measured time value matches a predetermined comparison value. When the last interrupt processing in the loop time of each processing unit is completed, the processing units are synchronized with each other,
In the synchronous control method of matching the start time points of the loop times of all the processing units, the processing unit divides the loop time by the number of times of the interrupt processing as the comparison value immediately after the start of the interrupt processing. Value, and as the comparison value immediately after the start of the loop time, the smallest one of the measured values at the end of the interrupt processing at the end of the last loop time executed in parallel in all the processing units. Is a value obtained by subtracting from the predetermined comparison value.
JP3338818A 1991-12-20 1991-12-20 Method for synchronous control between plural processing units Pending JPH05173984A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP3338818A JPH05173984A (en) 1991-12-20 1991-12-20 Method for synchronous control between plural processing units

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP3338818A JPH05173984A (en) 1991-12-20 1991-12-20 Method for synchronous control between plural processing units

Publications (1)

Publication Number Publication Date
JPH05173984A true JPH05173984A (en) 1993-07-13

Family

ID=18321741

Family Applications (1)

Application Number Title Priority Date Filing Date
JP3338818A Pending JPH05173984A (en) 1991-12-20 1991-12-20 Method for synchronous control between plural processing units

Country Status (1)

Country Link
JP (1) JPH05173984A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2007316815A (en) * 2006-05-24 2007-12-06 Nec Corp Clock abnormality detection method and clock abnormality detecting program

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2007316815A (en) * 2006-05-24 2007-12-06 Nec Corp Clock abnormality detection method and clock abnormality detecting program

Similar Documents

Publication Publication Date Title
JPS63136247A (en) Calculator for compound calculating machine equipment and synchronization of calculator thereof
CN108139945B (en) Vehicle safety electronic control system
JPS59209940A (en) Wheel information calculating device
JPH10513286A (en) Processing and circuit configuration for monitoring function of program control circuit
JP3752884B2 (en) Automotive electronic control unit with self-monitoring function
US5485379A (en) Method and system for detecting the proper functioning of an ABS control unit utilizing substantially identical programmed microprocessors
JPH05173984A (en) Method for synchronous control between plural processing units
US5490072A (en) Method and system for detecting the proper functioning of an ABS control unit utilizing dual programmed microprocessors
JP3916495B2 (en) Controller with fail-safe function
US6115832A (en) Process and circuitry for monitoring a data processing circuit
JPH08305611A (en) Cpu monitoring method and device
JPH06321076A (en) Computation synchronizing method for vehicle control computer system incorporating plural cpus
JPS61120247A (en) Detector for runaway of controller
JPS6055466A (en) Synchronization system between plural processors
JPH08305664A (en) Method and device for cpu monitoring
JP3314791B2 (en) Synchronization method for multiprocessor systems
JP3415636B2 (en) Processor unit
JP2588290B2 (en) Data input / output system
JPS5855535B2 (en) Multi-computer device for vehicles
JPS59176863A (en) Timer synchronizing system
JPS6224820B2 (en)
JPS61259357A (en) Common bus control system
JP2526835B2 (en) Duplex synchronous control system of programmable controller
JPS59127164A (en) Multi-system synchronizing device
JPH09198280A (en) Method for generating pulse for system monitoring and real time operating system provided with pulse generation function for monitoring

Legal Events

Date Code Title Description
A02 Decision of refusal

Free format text: JAPANESE INTERMEDIATE CODE: A02

Effective date: 20000308