JPS63278146A - Reading system for status register - Google Patents
Reading system for status registerInfo
- Publication number
- JPS63278146A JPS63278146A JP11391087A JP11391087A JPS63278146A JP S63278146 A JPS63278146 A JP S63278146A JP 11391087 A JP11391087 A JP 11391087A JP 11391087 A JP11391087 A JP 11391087A JP S63278146 A JPS63278146 A JP S63278146A
- Authority
- JP
- Japan
- Prior art keywords
- reading
- status
- read
- read data
- data
- 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
Links
- 238000000034 method Methods 0.000 claims description 8
- 230000007547 defect Effects 0.000 abstract 1
- 238000010586 diagram Methods 0.000 description 18
- 230000000694 effects Effects 0.000 description 2
- 241001609213 Carassius carassius Species 0.000 description 1
- 230000002159 abnormal effect Effects 0.000 description 1
- 238000007796 conventional method Methods 0.000 description 1
- 230000007704 transition Effects 0.000 description 1
Classifications
-
- G—PHYSICS
- G06—COMPUTING; CALCULATING OR COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F13/00—Interconnection of, or transfer of information or other signals between, memories, input/output devices or central processing units
- G06F13/14—Handling requests for interconnection or transfer
- G06F13/20—Handling requests for interconnection or transfer for access to input/output bus
- G06F13/24—Handling requests for interconnection or transfer for access to input/output bus using interrupt
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
Abstract
Description
【発明の詳細な説明】
〔概要〕
複数ビットで構成され、複数の要求信号が優先順位に基
づきエンコードされてセットされるステータスレジスタ
の読取り方式であって、ステータスレジスタを連続して
読取り、読取るごとに前回読取ったデータと比較し、一
致したときそのデータを真値とするステータスレジスタ
の読取り方式。[Detailed Description of the Invention] [Summary] This is a reading method for a status register, which is composed of multiple bits and in which multiple request signals are encoded and set based on priority, and the status register is read continuously and each time the status register is read. A status register reading method in which the data is compared with the previously read data, and if they match, that data is taken as the true value.
本発明はステータスレジスタの読取り方式の改良に関す
る。The present invention relates to an improved method for reading status registers.
各部の状態(ステータス)を通知するステータスレジス
タ(状態通知用レジスタ)がシステムクロックとは非同
期に更新される制御装置では、プロセッサの読取りタイ
ミング時にステータスが更新される場合がある。In a control device in which a status register (status notification register) that notifies the status of each part is updated asynchronously with the system clock, the status may be updated at the read timing of the processor.
特に複数ビットで構成されるステータスレジスタが2ビ
ット以上更新されると、更新前後のステ−タスとは異な
るステータスに認識されて制御不良を起こすという問題
点がある。In particular, when a status register consisting of a plurality of bits is updated by two or more bits, a problem arises in that the status is recognized as different from the status before and after the update, resulting in control failure.
このため、真のステータスデータを読取る読取り方式か
求められている。Therefore, there is a need for a reading method that reads true status data.
以下割込み解析用ステータスレジスタの読取りを例とし
て従来例を説明する。A conventional example will be described below using reading of an interrupt analysis status register as an example.
第5図は割込み回路ブロック図、第6図は動作フローチ
ャート図である。FIG. 5 is an interrupt circuit block diagram, and FIG. 6 is an operation flowchart.
第5同において、
プライオリティエンコーダ1は各入出力部(101〜I
on )からそれぞれ出力される割込み信号IR旧〜I
RQn (16組以下とする)に接続され、優先順位の
高い割込み信号(優先順位をIRQI→lR11nとす
る)を選択して、そのIOを識別する4ビツトのデータ
にエンコードしてステータスレジスタ2の下位4ビツト
にセットする。In the fifth example, the priority encoder 1 has each input/output unit (101 to I
interrupt signals IR old to I output from
RQn (16 groups or less), selects a high-priority interrupt signal (priority is IRQI → lR11n), encodes it into 4-bit data that identifies that IO, and stores it in status register 2. Set to the lower 4 bits.
同時に、割込み信号IRQI〜IRQnは、オア回路3
を介してステータスレジスタ2の最上位ビットにセット
され、プロセッサ4に割込め信号IRQとして出力され
る。At the same time, the interrupt signals IRQI to IRQn are output to the OR circuit 3.
The signal is set to the most significant bit of the status register 2 via the signal IRQ, and is output to the processor 4 as an interrupt signal IRQ.
いま、入出力部IOを16組、ステータスレジスタ2を
8ピントとすると、割込みが発生しない状態では、ステ
ータスレジスタ2は、例えばステータスSO(0111
1111) (7F 、 16進表示〕にセットされ
ており、いずれかの入出力部■0に割込め原因が発生ず
ると、システムクロックとは非同期にステータス(Fx
xxx)(但し××××はプライオリティエンコーダ1
の出力)に変化する。Now, assuming that the input/output unit IO is 16 sets and the status register 2 is 8 pins, when no interrupt occurs, the status register 2 will be set to, for example, the status SO (0111
1111) (7F, hexadecimal display), and if an interrupt cause occurs in any input/output unit ■0, the status (Fx
XXX) (However, XXX is priority encoder 1.
output).
割込み信号IRQを受信したプロセッサ4は割込み解析
部8を起動し、第6図に示すように、ステータスレジス
タ2を読取って割込みを要求した入出力部■0を認識し
、割込み処理部5を起動して所定の割込み処理を実行す
る。Upon receiving the interrupt signal IRQ, the processor 4 activates the interrupt analysis unit 8, reads the status register 2, recognizes the input/output unit 0 that requested the interrupt, and activates the interrupt processing unit 5, as shown in FIG. and executes predetermined interrupt processing.
なお、優先順位が低く割込み要求が受付けられない入出
力部10は、割込み要求を出力したまま処理待ちの状態
となる。Note that the input/output unit 10, which has a low priority and cannot accept an interrupt request, remains in a state of waiting for processing while outputting the interrupt request.
上記ステータスレジスタ2が非同期で書込まれるように
構成されていると、プロセッサ4がステータスレジスタ
2を読取るタイミングで、より優先順位の高い割込み要
求により更新される場合が考えられ、読取ったデータが
不定、即ち、そのビットが0の状態か、1の状態かどち
らか不定となる。If the status register 2 is configured to be written asynchronously, it may be updated by an interrupt request with a higher priority at the timing when the processor 4 reads the status register 2, and the read data may become undefined. In other words, it is unclear whether the bit is in the 0 state or the 1 state.
このため、ステータスレジスタ2の2ビツト以上が更新
されると、更新前後のステータスとは異なるステータス
と認識して、割込みを発生していない入出力部■0に対
して割込み処理を実施するという問題点が発生ずる。Therefore, when 2 or more bits of status register 2 are updated, the status is recognized as different from the status before and after the update, and interrupt processing is executed for input/output section 0 that does not generate an interrupt. Dots appear.
以下第7図プロセッサの読取りタイミングを表す図、第
8図問題点の説明図を参照しつつ、上記問題点を説明す
る。The above-mentioned problems will be explained below with reference to FIG. 7, which shows the reading timing of the processor, and FIG. 8, which explains the problems.
第7図はプロセッサの読取りタイミングを表す図であり
、システムクロックに同期して読取り信号が出力され、
その読取り信号内の所定の期間(ts+th )はデー
タが確定しているという条件でステータスレジスタ2の
値が読取られる。FIG. 7 is a diagram showing the read timing of the processor, in which a read signal is output in synchronization with the system clock,
During a predetermined period (ts+th) within the read signal, the value of the status register 2 is read on the condition that the data is fixed.
一方ステータスレジスタ2へのセットは、割込みの発生
した時点で、システムクロックとは非同期にセットされ
るため、データを保証する期間(ts十th )にセッ
トされると、Oか1かのいずれかとして読取られる。On the other hand, the status register 2 is set asynchronously to the system clock when an interrupt occurs, so if it is set during the data guarantee period (ts + th), either O or 1 is set. is read as .
ステータスレジスタ2の2ビツト以上が更新されると、
第8図に示すような問題点が生じる。When 2 or more bits of status register 2 are updated,
A problem as shown in FIG. 8 arises.
例えば割込みが発生し、下位4ビツトがSl (例えば
下位4ビツト1110)にセットされた後、プロセッサ
4の読取りタイミングでより優先順位の高い割込みが発
生しS2 (1000)がセットされる場合、SX (
1100または1010)と読取られる恐れがある。For example, if an interrupt occurs and the lower 4 bits are set to Sl (for example, lower 4 bits 1110), and then an interrupt with a higher priority occurs at the read timing of the processor 4 and S2 (1000) is set, SX (
1100 or 1010).
これは割込み要求のない入出力部■0に対応するもので
異常状態が発生する。This corresponds to the input/output section (2)0, which does not receive an interrupt request, and an abnormal state occurs.
従来のステータスレジスタの読取りは1回の読取りで真
のステータスデータとして採用していたため、上記問題
点の発生が避けられなかった。In the conventional method of reading the status register, one reading is used as true status data, so the above-mentioned problem is unavoidable.
本発明は、上記問題点を解決し、ステータスレジスタの
真の値を読取るステータスレジスタの読取り方式を提供
することを目的とする。SUMMARY OF THE INVENTION An object of the present invention is to solve the above problems and provide a status register reading method for reading the true value of the status register.
C問題点を解決するだめの手段〕
上記目的のため、本発明のステータスレジスタの読取り
方式は、第1図本発明の原理説明図に示すように、
ステータスレジスタ(2)を連続して読取るとともに、
読取りごとに直前に読取ったデータと比較し、一致した
とき該データを真値と判別して読取りを終了する読取部
(7)
を設けたものである。Means for Solving Problem C] For the above purpose, the status register reading method of the present invention, as shown in FIG. ,
A reading section (7) is provided which compares each reading with the data read immediately before, and when they match, determines the data as a true value and finishes reading.
5作用〕
ステータスレジスタを2回i!l!続して読取り、比較
して不一致のときは3回目を読取って2回目の読取りデ
ータと比較するというように、不一致の場合は読取りを
繰り返し、読取るごとに直前に読取ったデータと比較し
て一致したとき読取ったデータを真の値と判別する。5 action] Press the status register twice! l! If the data does not match, the data is read a third time and compared with the data read the second time.If the data does not match, the data is read again, and each time the data is compared with the data read just before, the data is matched. The data read at that time is determined to be the true value.
読取りタイミングで更新されることが2凹板上発生ずる
確率は極めて稀であり、少なくとも4回の読取りでステ
ータスは確定する。It is extremely rare for a two-concave board to be updated at the reading timing, and the status is determined by at least four readings.
通常要求信号(例えば割込み要求)50ば受信されるま
で待機するから、優先順位の低い順に割込みが発生し、
且つすべて読取りタイミングで発生した場合を考えても
、最大要求信号数141回の読取りで確定する。Normally, it waits until a request signal (for example, an interrupt request) is received, so interrupts occur in order of priority,
Moreover, even if we consider the case where all the signals occur at the reading timing, the maximum number of required signals is determined after 141 readings.
このため、n+1回の読取り手段を準備しておくと誤読
取りは解消されるが、一致したとき読取りを終了させる
ように構成しておくと実際には4回程度で読取りが完了
する。For this reason, if reading means are prepared n+1 times, erroneous reading can be eliminated, but if the reading is configured to end when there is a match, reading will actually be completed in about 4 times.
以上のごとく優先順位に基づきセットされるステータス
レジスタの読取りは、前回の読取りデータと一致するま
で連続して読取ることによりステータスが確定し、制御
不良を回避することができる。By reading the status register set based on the priority order as described above, the status can be determined by reading continuously until the data matches the previous read data, and control failures can be avoided.
本発明の実施例を図を参照しつつ説明する。 Embodiments of the present invention will be described with reference to the drawings.
第2図は実施例の割込み回路ブロック図、第3図は実施
例の読取部動作フローチャート図、第4図はステータス
例を示す図で、(1)はタイムチャート図、 (■)は
読取り時のステータスを表す図である。Fig. 2 is a block diagram of the interrupt circuit of the embodiment, Fig. 3 is a flowchart of the operation of the reading section of the embodiment, and Fig. 4 is a diagram showing an example of status. FIG.
第2図において、
6は本発明の動作を行う割込み解析部であり、割込み信
号IRQにより起動され、読取部7によりステータスレ
ジスタ2を読取り、割込み要求元を解析して割込み処理
部5を起動するもの、7はステータスレジスタ2を読取
り、ステータスを判別する読取部、
であり、その他、全図を通じて同一符号は同一対象物を
表す。In FIG. 2, reference numeral 6 denotes an interrupt analysis section that operates according to the present invention, which is activated by the interrupt signal IRQ, reads the status register 2 by the reading section 7, analyzes the interrupt request source, and activates the interrupt processing section 5. 7 is a reading unit that reads the status register 2 and determines the status; the same reference numerals represent the same objects throughout the figures.
第3図は実施例の読取部動作フローチャート図であり、
4回の読取りで読取りステータスを確定(判別)する例
を示したものである。即ち、(1) ステータスレジ
スタ2を2回連続して読取り、1回目の読取りデータ(
#1)と2回目の読取りデータ(#2)とが一致したと
き、#2を真値とし、
(2)不一致ならば、3回目を読取り、3回目のデータ
(#3)が#2と一致したときは、#3を真値とし、
(3)不一致ならば、4回目の読取りを実施して、その
データ(#4)を真値とする。FIG. 3 is a flowchart of the operation of the reading section of the embodiment;
This shows an example in which the reading status is determined (determined) after four readings. That is, (1) Read status register 2 twice consecutively, and read the first read data (
When #1) and the second read data (#2) match, #2 is set as the true value. (2) If they do not match, read the third time and set the third data (#3) as #2. If they match, #3 is taken as the true value; (3) If they do not match, the fourth reading is performed and the data (#4) is taken as the true value.
なお、真値と判別したときは読取りを終了する。Note that when it is determined that it is a true value, the reading ends.
以上のフローは読取りタイミングにおいて2回連続して
更新されることは極めて稀で、4回目の読取りで確定す
るとしたものである。It is extremely rare for the above flow to be updated twice in a row at the reading timing, and it is determined at the fourth reading.
第合図はステータス例を表したもので、上記フローによ
る判別例を示したものである。The first figure represents an example of status, and shows an example of determination based on the above flow.
本図は、第1の割込みが発生し、ステータスS1がステ
ータスレジスタ2にセットされた後優先順位の高い第2
の割込みが発生してステータスS2がセットされるタイ
ミングと、その場合におけるステータスの推移を示した
もので、Sχは誤認され得る他のステータスを表す。This diagram shows that after the first interrupt occurs and the status S1 is set in the status register 2, the second interrupt with a higher priority is
This figure shows the timing when the interrupt occurs and the status S2 is set, and the transition of the status in that case. Sχ represents another status that can be misidentified.
この図より、明らかのように、
(1) ステータス■
一回目の読取りが不定のケースで、読取りステ−タスは
(SL、Sx、S2)の3通りがあり、1回目Sl。As is clear from this figure, (1) Status■ In the case where the first reading is undefined, there are three reading statuses (SL, Sx, S2), and the first reading is SL.
Sxならば2,3回目の読取りで82に確定し、1回目
S2ならば2回目の読取りで82と確定する。If it is Sx, it is determined to be 82 by the second and third reading, and if it is S2, which is the first reading, it is determined to be 82 by the second reading.
以上によりステータス■は少なくとも3回の読取りで確
定する。As described above, the status ■ is confirmed after at least three readings.
(2) ステータス■
一回目はSl、2回目が不定(Sl、SX、S2)であ
り、2回目が51の場合はSlで確定し、その他の場合
は3回目を読取り、前回が82の場合はS2で確定し、
前回がSXの場合は4回目を読取って32で確定する。(2) Status ■ The first reading is SL, the second reading is undefined (Sl, SX, S2), if the second reading is 51, it is confirmed with Sl; in other cases, the third reading is, and if the previous reading is 82. is determined in S2,
If the previous time was SX, read the fourth time and confirm with 32.
(3) ステータス■
一回目および2回目ともに81であるから、2回の読取
りで81と確定する。(3) Status■ Since the reading is 81 for both the first and second readings, it is determined to be 81 after two readings.
以上の例では少なくとも4回の読取りで読取りステータ
スが確定するが、読取りごとにステータスが変化する可
能性に対しては、前述したように最大n+1回(nは状
態数)の読取りで確定する。In the above example, the read status is determined by at least four readings, but to account for the possibility that the status changes with each reading, it is determined by reading a maximum of n+1 times (n is the number of states) as described above.
槌って、第1図に示すように、一致するまで連続して読
取り判別するフローにしてもよく、連続して不定状態が
発生する確率は極めて少ないため、少なくとも4回目で
確定し、読取りが終了する。As shown in Figure 1, it is also possible to create a flow in which reading and discrimination are performed continuously until a match is made.The probability that an indefinite state will occur continuously is extremely low, so it will be determined at least on the fourth try, and the reading will be determined. finish.
以上のごとく、前回読取ったデータと一致したときステ
ータスを確定するため、制御不良を防止することができ
る。As described above, since the status is determined when the data matches the previously read data, control failures can be prevented.
本発明は、ステータスレジスタを連続して読取り、直前
に読取ったデータと一致したときステータスを確定する
方式を提供するもので、ステータスが不定のため制御不
良を起こす状態を防止できる効果は極めて多大である。The present invention provides a method of reading the status register continuously and determining the status when the data matches the data read immediately before.The present invention has an extremely large effect in preventing control failures due to the status being undefined. be.
第1図は本発明の原理説明図、
第2図は実施例の割込み回路ブロック図、第3図は実施
例の読取部動作フローチャート図、第4図はステータス
例を表す図で、
(I)はタイムチャート図、
(n)は読取り時のステータスを表す図、第5図は割込
み回路ブロック図、
第6図は動作フローチャート図、
第7図はプロセッサの読取りタイミングを表す図、第8
図は問題点の説明図、
である。図中、
1はプライオリティエンコーダ、
2はステータスレジスタ、
3はオア回路、
4はプロセッサ、
5は割込み処理部、
6.8は割込み解析部、
7は読取部、
50は要求信号、
50−1は優先順位の高い要求信号、
IRQは割込み信号、
である。
執〉
へ5
拶
第1図
漬彷鮒りの読取缶漫屓乍フローチャート図第3図
実施例の割込み回路ブロック図
第2図
ステータス■
−・(1)タイムチャート図
(I[)読取り時のステータスを表す図ステータス例を
表す図
第4図
割込み回路ブロック図
第5図
動作フローチャート図
第6図
問題点の説明図Fig. 1 is a diagram explaining the principle of the present invention, Fig. 2 is a block diagram of an interrupt circuit of an embodiment, Fig. 3 is a flowchart of the operation of the reading section of the embodiment, and Fig. 4 is a diagram showing an example of status. is a time chart, (n) is a diagram showing the status at the time of reading, Fig. 5 is an interrupt circuit block diagram, Fig. 6 is an operation flow chart, Fig. 7 is a diagram showing the read timing of the processor, and Fig. 8 is a diagram showing the read timing.
The figure is an explanatory diagram of the problem. In the figure, 1 is a priority encoder, 2 is a status register, 3 is an OR circuit, 4 is a processor, 5 is an interrupt processing section, 6.8 is an interrupt analysis section, 7 is a reading section, 50 is a request signal, and 50-1 is a The request signal with a high priority, IRQ, is an interrupt signal. 5 Greetings Figure 1 Flow chart for reading pickled crucian carp Figure 3 Interrupt circuit block diagram of the embodiment Figure 2 Status ■
-・(1) Time chart diagram (I[) Diagram representing status when reading Diagram representing status example Figure 4 Interrupt circuit block diagram Figure 5 Operation flow chart Figure 6 Explanation of problems
Claims (1)
数の要求信号(50)のうち優先順位の高い要求信号(
50−1)が出力されたとき該要求信号(50−1)が
識別可能に前記複数ビットにエンコードされてセットさ
れるステータスレジスタの読取り方式であって、 該ステータスレジスタ(2)を連続して読取るとともに
、読取りごとに直前に読取ったデータと比較し、一致し
たとき該データを真値と判別して読取りを終了する読取
部(7) を設け、該ステータスレジスタ(2)を連続して読取り
、直前の読取りデータと一致したとき真値と判別するこ
とを特徴とするステータスレジスタの読取り方式。[Scope of Claims] A request signal (50) with a high priority among a plurality of request signals (50) composed of a plurality of bits and output from each section.
50-1) is output, the request signal (50-1) is identifiably encoded into the plurality of bits and set, and the status register (2) is read continuously. A reading unit (7) is provided which reads the data and compares it with the data read immediately before each reading, and when they match, determines the data as the true value and finishes the reading, and continuously reads the status register (2). , a status register reading method characterized in that a value is determined to be a true value when it matches the immediately previous read data.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP11391087A JPS63278146A (en) | 1987-05-11 | 1987-05-11 | Reading system for status register |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP11391087A JPS63278146A (en) | 1987-05-11 | 1987-05-11 | Reading system for status register |
Publications (1)
Publication Number | Publication Date |
---|---|
JPS63278146A true JPS63278146A (en) | 1988-11-15 |
Family
ID=14624247
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
JP11391087A Pending JPS63278146A (en) | 1987-05-11 | 1987-05-11 | Reading system for status register |
Country Status (1)
Country | Link |
---|---|
JP (1) | JPS63278146A (en) |
Citations (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JPS5312236A (en) * | 1976-07-21 | 1978-02-03 | Hitachi Ltd | Memory retry circuit |
-
1987
- 1987-05-11 JP JP11391087A patent/JPS63278146A/en active Pending
Patent Citations (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
JPS5312236A (en) * | 1976-07-21 | 1978-02-03 | Hitachi Ltd | Memory retry circuit |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
EP0212636B1 (en) | Bus state control circuit | |
JPS63238630A (en) | Interruption controller for microprocessor | |
US6901507B2 (en) | Context scheduling | |
US4803708A (en) | Time-of-day coincidence system | |
EP0331193B1 (en) | Vector operation instruction issue control method | |
JPS63278146A (en) | Reading system for status register | |
JP2990800B2 (en) | Interrupt processing device | |
JP2947195B2 (en) | Interrupt mask control method | |
JPS61241833A (en) | Instruction code access controller | |
SU1425607A1 (en) | Program control apparatus | |
SU1341636A1 (en) | Program interruption device | |
KR840000165B1 (en) | Bus control system | |
SU1513455A1 (en) | Device for monitoring properness of execution of commands by microprocessor system | |
JP3308670B2 (en) | Event-driven processing equipment failure detection device | |
JP2982811B2 (en) | Access control device | |
JPH0646411B2 (en) | End token output circuit | |
JP2504617B2 (en) | Data read control method | |
JPS62117054A (en) | Confirmation system for state of input and output device | |
JPS63173142A (en) | Completion token output circuit | |
JPH01255932A (en) | Instruction processor | |
JPS6228837A (en) | Interruption signal control system | |
JPS6394362A (en) | Bus coupling device | |
JPH0341502A (en) | Bit operation processor for programmable controller | |
JPH04267450A (en) | Data input control system | |
JPS6347825A (en) | Buffer access check system |