JPH05334099A - Write circuit for state setting register - Google Patents

Write circuit for state setting register

Info

Publication number
JPH05334099A
JPH05334099A JP14083092A JP14083092A JPH05334099A JP H05334099 A JPH05334099 A JP H05334099A JP 14083092 A JP14083092 A JP 14083092A JP 14083092 A JP14083092 A JP 14083092A JP H05334099 A JPH05334099 A JP H05334099A
Authority
JP
Japan
Prior art keywords
setting register
state setting
write
storage area
memory area
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.)
Withdrawn
Application number
JP14083092A
Other languages
Japanese (ja)
Inventor
Hirotomo Terada
浩朋 寺田
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.)
Fujitsu Ltd
Original Assignee
Fujitsu 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 Fujitsu Ltd filed Critical Fujitsu Ltd
Priority to JP14083092A priority Critical patent/JPH05334099A/en
Publication of JPH05334099A publication Critical patent/JPH05334099A/en
Withdrawn legal-status Critical Current

Links

Abstract

PURPOSE:To eliminate complicated work and to reduce possibility to generate an error by employing such configuration that interrupt is prevented from occurring when write on a state setting register and a spare memory area are performed. CONSTITUTION:This circuit is a write circuit provided with the state setting register 13 which sets the internal state of a device and the spare memory area 14 on which the same content is written to read the content of the state setting register 13, and for the state setting register of the device which performs the write on the spare memory area 14 following when the write is performed on the state setting register 13, and it is constituted so that the write on the state setting register 13 and the spare memory area 14 can be performed simultaneously. In other words, the write on the state setting register 13 and the spare memory area 14 can be performed simultaneously by the write circuit 30. Thereby, since the write on the state setting register 13 and that on the spare memory area 14 are not sequentially performed, it is possible to prevent discrepancy in the contents of the state setting register 13 and the spare memory area 14 due to the intrusion of the interrupt between the write on the state setting register 13 and that on the spare memory area 14 from occurring.

Description

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

【0001】[0001]

【産業上の利用分野】本発明は装置の内部状態を設定す
る状態設定レジスタの書込回路に関する。
BACKGROUND OF THE INVENTION 1. Field of the Invention The present invention relates to a state setting register write circuit for setting an internal state of a device.

【0002】[0002]

【従来の技術】従来からマイクロプロセッサ(以下MP
Uと略する)で制御される装置は、処理の複雑化に伴
い、いくつかの割り込みレベルを使ったファームウェア
制御が採用されている。また、このような装置は、ハー
ドウエアの状態を設定するための状態設定レジスタや、
ハードウエアの状態を読み取るための状態読取レジスタ
を持っており、それぞれファームウェアで書込み及び読
み取りができる。
2. Description of the Related Art Conventionally, a microprocessor (hereinafter referred to as MP
A device controlled by abbreviated as U) employs firmware control using several interrupt levels as the processing becomes complicated. Moreover, such a device has a state setting register for setting the state of the hardware,
It has a status read register for reading the status of the hardware, and each can be written and read by the firmware.

【0003】図3は従来の装置の構成図である。図にお
いて、11はMPUであって、装置を制御するものであ
る。12はアドレスデコーダであって、MPU11から出
力されるアドレスバスのアドレス信号をデコードして出
力するものである。13は状態設定レジスタであって、
ハードウエアの状態を設定するものである。14は予備
記憶領域であって、該状態設定レジスタ13の内容を読み
取るため同一内容を書き込むものである。15は状態読
取レジスタであって、ハードウエアの状態信号が保持さ
れておりMPUが読み取るためのものである。
FIG. 3 is a block diagram of a conventional device. In the figure, 11 is an MPU for controlling the apparatus. An address decoder 12 decodes and outputs the address signal of the address bus output from the MPU 11. 13 is a status setting register,
It sets the hardware status. Reference numeral 14 denotes a preliminary storage area in which the same contents are written to read the contents of the state setting register 13. Reference numeral 15 is a status reading register, which holds the status signal of the hardware and is read by the MPU.

【0004】図の装置で、状態設定レジスタ13の設定値
を設定する時は、予備記憶領域14の値を読み出し、MP
U11で値を変えたいビットを変更した後状態設定レジス
タ13と予備記憶領域14へ書き込む。状態設定レジスタ13
や状態読取レジスタ15は記憶領域と一連のアドレスを持
ち、また予備記憶領域14は記憶領域の一部を予備記憶領
域として割り当てたものであり、それぞれ別のアドレス
をもっている。そこで予備記憶領域14への書込みは状態
設定レジスタ13への書込みとシリアルにおこなわなけれ
ばならない。
In the apparatus shown in the figure, when setting the setting value of the state setting register 13, the value of the spare storage area 14 is read and MP
After changing the bit whose value is to be changed in U11, the value is written in the state setting register 13 and the preliminary storage area 14. Status setting register 13
The status read register 15 has a storage area and a series of addresses, and the spare storage area 14 is a part of the storage area assigned as a spare storage area, and has different addresses. Therefore, writing to the auxiliary storage area 14 must be performed serially with writing to the state setting register 13.

【0005】これらの処理は従来ファームウェアで行わ
れていた。図4は従来の装置で割込発生時の処理フロー
チャートである。本来の処理はステップ81→ステップ82
→ステップ83→ステップ84と進むように設定されてい
る。
Conventionally, these processes have been performed by firmware. FIG. 4 is a processing flowchart when an interrupt occurs in the conventional device. The original process is step 81 → step 82
→ It is set to proceed to step 83 → step 84.

【0006】すなわちステップ81で予備記憶領域14から
状態設定レジスタ13の内容の複写"00000000 "を読み出
す。そして、ステップ82でビット0の値を変更すると"
00000001 "となる。ステップ83で状態設定レジスタ13に
その内容" 00000001 "を書込む。続いてステップ84で予
備記憶領域14に同一内容を書き込む。
That is, in step 81, a copy "00000000" of the contents of the state setting register 13 is read from the preliminary storage area 14. Then, when the value of bit 0 is changed in step 82, "
In step 83, the content "00000001" is written in the state setting register 13. Then, in step 84, the same content is written in the spare storage area 14.

【0007】これで状態設定レジスタ13の設定が完了し
たことになる。しかし、ステップ83からステップ84の間
に、より優先度の高い割り込みが発生しその処理の中で
同じ状態設定レジスタ13の別のビットを変更しようとす
る場合がある。図のステップ83の後で割込が発生してス
テップ91に進む場合である。このときステップ83の処理
の状態はすべて退避されるが状態設定レジスタ13の内容
は退避されないものとする。割込処理の中でステップ91
で予備記憶領域14から状態設定レジスタ13の内容の複
写" 00000000 "を読み出す。そして、ステップ92でビッ
ト1の値を変更すると" 00000010 "となる。ステップ93
で状態設定レジスタ13にその内容" 00000010 "を書込
む。続いてステップ94で予備記憶領域14に同一内容を書
き込む。そして割込処理を終了してすべての退避情報を
復旧して元のステップ84へ戻る。
This completes the setting of the state setting register 13. However, there is a case where an interrupt with a higher priority occurs during steps 83 to 84, and another bit of the same state setting register 13 is changed in the process. This is a case where an interrupt occurs after step 83 in the figure and the process proceeds to step 91. At this time, the state of the process of step 83 is all saved, but the contents of the state setting register 13 are not saved. Step 91 in the interrupt process
The "00000000" which is a copy of the contents of the status setting register 13 is read from the preliminary storage area 14. Then, when the value of bit 1 is changed in step 92, it becomes "00000010". Step 93
Write the contents "00000010" to the status setting register 13 with. Then, in step 94, the same contents are written in the preliminary storage area 14. Then, the interrupt process is terminated, all the saved information is restored, and the process returns to the original step 84.

【0008】ステップ84では元の内容" 00000001 "が予
備記憶領域14に書き込まれる。このように途中に割込が
入ると、割込処理の中で変更したビットの値が、割り込
み解除後に予備記憶領域14へ書き込む時に、割り込み処
理の中で状態設定レジスタ13に設定したビットがあるこ
とが分からないため、割り込み処理が発生する前の状態
に戻してしまうことになる。そこで状態設定レジスタ13
の内容と予備記憶領域14の内容に相違が生じて、これが
障害の原因となる。
In step 84, the original content "00000001" is written in the spare storage area 14. When an interrupt occurs in this way, when the value of the bit changed during the interrupt process is written to the auxiliary storage area 14 after the interrupt is released, there is a bit set in the status setting register 13 during the interrupt process. Because I do not know that, I will return to the state before the interrupt processing occurred. Therefore, the status setting register 13
And the contents of the spare storage area 14 differ from each other, which causes a failure.

【0009】そこで、従来はさらに割り込みを禁止する
処理を行うようにしていた。図5は従来の装置で割込禁
止時の処理フローチャートである。即ち状態設定レジス
タ13を設定する場合はステップ80で割り込みマスクを設
定して割り込みを禁止する。その後従来の処理を行い状
態設定レジスタ13と予備記憶領域14への書き込みを行う
( ステップ81→ステップ82→ステップ83→ステップ84)
。書込みが終了するとステップ85で割り込みマスクを
解除する。
Therefore, conventionally, processing for further prohibiting interrupts has been performed. FIG. 5 is a processing flowchart when an interrupt is prohibited in the conventional device. That is, when setting the status setting register 13, the interrupt mask is set in step 80 to disable the interrupt. After that, the conventional processing is performed to write to the status setting register 13 and the spare storage area 14.
(Step 81 → Step 82 → Step 83 → Step 84)
.. When the writing is completed, the interrupt mask is released in step 85.

【0010】[0010]

【発明が解決しようとする課題】従って、従来はこのよ
うな事態の発生を防止するため、割込を防止するための
割込マスクを設定した後、状態設定レジスタ13と予備記
憶領域14へ書き込みを行い、その後割込マスクを解除す
ることを行っていた。
Therefore, conventionally, in order to prevent such a situation from occurring, an interrupt mask for preventing an interrupt is set and then written to the state setting register 13 and the spare storage area 14. And then released the interrupt mask.

【0011】しかし、このような処理を毎回プログラム
の作成時に考慮することは煩雑であり、この処理を忘れ
るという誤りを犯すこともある。本発明はこのような点
にかんがみて、状態設定レジスタと予備記憶領域へ書き
込みを行う際、割込を生じさせない手段を提供すること
を目的とする。
However, it is complicated to consider such a process each time a program is created, and an error of forgetting this process may be made. In view of such a point, the present invention has an object to provide a means for preventing an interrupt when writing to the state setting register and the spare storage area.

【0012】[0012]

【課題を解決するための手段】上記の課題は下記の如く
に構成された状態設定レジスタの書込回路によって解決
される。
The above problem can be solved by a write circuit of a state setting register configured as follows.

【0013】図1は、本発明の原理図である。装置の内
部状態を設定する状態設定レジスタ13と、該状態設定レ
ジスタ13の内容を読み取るため同一内容を書き込む予備
記憶領域14と、を有し、該状態設定レジスタ13へ書込ん
だ場合は引き続いて該予備記憶領域14への書込みを行う
装置の状態設定レジスタの書込回路であって、該状態設
定レジスタ13と該予備記憶領域14への書込みを同時に行
うように構成する。
FIG. 1 shows the principle of the present invention. It has a state setting register 13 for setting the internal state of the device, and a spare storage area 14 for writing the same contents to read the contents of the state setting register 13, and when writing to the state setting register 13, it continues. A writing circuit of a state setting register of a device for writing to the spare storage area 14, which is configured to simultaneously write to the state setting register 13 and the spare storage area 14.

【0014】[0014]

【作用】書込み回路30により状態設定レジスタ13と予備
記憶領域14への書込みを同時に行う。
Operation: The writing circuit 30 simultaneously writes to the state setting register 13 and the preliminary storage area 14.

【0015】このことにより、状態設定レジスタ13と予
備記憶領域14への書込みを逐次的に処理しなくなったた
め状態設定レジスタ13と予備記憶領域14への書込みの間
に割り込みが入って、状態設定レジスタ13と予備記憶領
域14の内容の不一致が生ずるということがなくなる。
As a result, the writing to the state setting register 13 and the spare storage area 14 is no longer sequentially processed, so an interrupt occurs between the writing to the state setting register 13 and the spare storage area 14, and the state setting register It is possible to prevent a discrepancy between the contents of 13 and the preliminary storage area 14.

【0016】[0016]

【実施例】図2は、本発明の実施例の構成図であり、状
態設定レジスタの書込み回路の詳細を示すものである。
図において、16はデコーダであって、状態設定レジス
タ13や予備記憶領域14を指定する信号をアドレス信号か
ら生成するものである。このとき状態設定レジスタ13を
指定する信号はR/W信号も同時に論理積をとる。
2 is a block diagram of an embodiment of the present invention, showing the details of a write circuit of a state setting register.
In the figure, 16 is a decoder for generating a signal designating the state setting register 13 and the spare storage area 14 from an address signal. At this time, the signal designating the state setting register 13 is logically ANDed with the R / W signal at the same time.

【0017】17はタイミングパルス発生回路であっ
て、MPUからのタイミング信号に基いて読み出し及び
書込みを行うタイミングパルスを発生するものである。
その他、図3と同一符号の物は同一物である。
Reference numeral 17 denotes a timing pulse generation circuit, which generates a timing pulse for reading and writing based on a timing signal from the MPU.
In addition, the same reference numerals as those in FIG. 3 are the same.

【0018】本発明の実施例では状態設定レジスタ13と
予備記憶領域14のアドレスを同一にする。状態設定レジ
スタ13の設定値を変更するために予備記憶領域14の値を
読み込む時、MPU11は予備記憶領域14のアドレスを出
力し、R/W信号R を読出状態にする。デコーダ16で
は、アドレスバスのアドレス信号A とR/W信号R から
状態設定レジスタ13と予備記憶領域14を選択する信号を
生成する。この場合は読出状態なので状態設定レジスタ
13を選択する信号は出力されない。
In the embodiment of the present invention, the addresses of the state setting register 13 and the spare storage area 14 are made the same. When reading the value of the preliminary storage area 14 in order to change the setting value of the state setting register 13, the MPU 11 outputs the address of the preliminary storage area 14 and puts the R / W signal R into the read state. The decoder 16 generates a signal for selecting the state setting register 13 and the spare storage area 14 from the address signal A and the R / W signal R of the address bus. In this case, the status setting register
The signal for selecting 13 is not output.

【0019】タイミング信号T と予備記憶領域14の選択
信号SSをうけたタイミングパルス発生回路17は予備記憶
領域14にタイミングパルスを送出し、予備記憶領域14は
アドレスバスのアドレス信号A とR/W信号R とタイミ
ングパルス発生回路17からのタイミングパルスを受けて
動作し読出しを行い読出出力はデータバスに出力されM
PU11に送られる。
The timing pulse generation circuit 17 which receives the timing signal T and the selection signal SS of the spare memory area 14 sends a timing pulse to the spare memory area 14, and the spare memory area 14 receives the address signals A and R / W of the address bus. Upon receiving the signal R and the timing pulse from the timing pulse generation circuit 17, it operates and reads, and the read output is output to the data bus M
Sent to PU11.

【0020】MPU11は読み出した予備記憶領域14の内
容を変更後、状態設定レジスタ13と予備記憶領域14へ書
き込む時、MPU11は予備記憶領域14のアドレスを出力
し、R/W信号を書込み状態にして、データバスから設
定する情報を送出し、タイミング信号T を送出する。
When the MPU 11 changes the read contents of the preliminary storage area 14 and then writes them in the state setting register 13 and the preliminary storage area 14, the MPU 11 outputs the address of the preliminary storage area 14 and puts the R / W signal into the write state. Then, the information to be set is transmitted from the data bus, and the timing signal T is transmitted.

【0021】デコーダ16では、アドレス信号A とR/W
信号R から状態設定レジスタ13と予備記憶領域14への選
択信号を生成し、タイミングパルス発生回路17は、状態
設定レジスタ13と予備記憶領域14にそれぞれのタイミン
グパルスを送出する。そこで、状態設定レジスタ13はデ
ータバスのデータ信号D とタイミングパルス発生回路17
からのタイミングパルスを受けて動作し書込みを行う。
In the decoder 16, the address signal A and R / W
A selection signal for the state setting register 13 and the preliminary storage area 14 is generated from the signal R, and the timing pulse generation circuit 17 sends respective timing pulses to the state setting register 13 and the preliminary storage area 14. Therefore, the status setting register 13 uses the data signal D of the data bus and the timing pulse generation circuit 17
It operates by receiving the timing pulse from and writes.

【0022】また、予備記憶領域14も同時にアドレスバ
スのアドレス信号A とR/W信号Rとデータバスのデー
タ信号D とタイミングパルス発生回路17からのタイミン
グパルスを受けて指定アドレスに書込みを行う。
The spare memory area 14 also receives the address signal A of the address bus, the R / W signal R, the data signal D of the data bus, and the timing pulse from the timing pulse generating circuit 17 and writes to the designated address.

【0023】この結果、状態設定レジスタ13とその予備
記憶領域14の両方に同時に書き込むことになる。上記の
如く状態設定レジスタ13とその予備記憶領域14の両方に
同時に書き込むようにすれば、途中で割り込みが入って
両者の内容が食い違うことはなくなる。
As a result, the data is written into both the state setting register 13 and its spare storage area 14 at the same time. If the status setting register 13 and the spare storage area 14 are simultaneously written as described above, there is no possibility that an interrupt will occur in the middle and the contents of the two will not conflict with each other.

【0024】この時の同時とは全く物理的に同時である
必要はなく割り込みの入らない範囲での同時であること
は勿論である。ここで状態設定レジスタが複数ある場合
や状態読取レジスタが複数ある場合も同様の構成を実現
できる。
It is needless to say that the coincidence at this time does not have to be physical coincidence at all and is coincidence within a range where an interrupt does not enter. Here, the same configuration can be realized when there are a plurality of status setting registers and a plurality of status reading registers.

【0025】また本実施例では状態設定レジスタと予備
記憶領域とのアドレスを同一にしたが、必ずしも同一で
ある必要はなく、同時に書き込むことができる構成であ
ればよいことは勿論である。
Further, in the present embodiment, the addresses of the state setting register and the spare storage area are the same, but it is not always necessary that they be the same, and it is needless to say that it is possible to write simultaneously.

【0026】[0026]

【発明の効果】以上の説明から明らかなように本発明に
よれば状態設定レジスタと予備記憶領域へ書き込みを行
う際、割込を生じさせない手段を提供することにより、
プログラムの作成時に考慮する煩雑な作業を解消し、誤
りを侵す可能性を削除するという著しい工業的効果があ
る。
As is apparent from the above description, according to the present invention, by providing the state setting register and the means for preventing the interruption when writing to the spare storage area,
It has a remarkable industrial effect of eliminating the complicated work to be taken into consideration when creating a program and eliminating the possibility of causing errors.

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

【図1】 本発明の原理図FIG. 1 is a principle diagram of the present invention.

【図2】 本発明の実施例の書込み回路の構成図FIG. 2 is a configuration diagram of a write circuit according to an embodiment of the present invention.

【図3】 従来の装置の構成図FIG. 3 is a block diagram of a conventional device

【図4】 従来の装置で割込発生時の処理フローチャー
FIG. 4 is a processing flowchart when an interrupt occurs in a conventional device.

【図5】 従来の装置で割込禁止時の処理フローチャー
FIG. 5 is a processing flowchart when interrupts are prohibited in a conventional device.

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

11 MPU 12 アドレスデ
コーダ 13 状態設定レジスタ 14 予備記憶領
域 15 状態読取レジスタ 16 デコーダ 17 タイミングパルス発生回路 80〜85,91〜94 動作ステップ
11 MPU 12 Address Decoder 13 State Setting Register 14 Preliminary Storage Area 15 State Reading Register 16 Decoder 17 Timing Pulse Generation Circuit 80-85, 91-94 Operation Step

Claims (1)

【特許請求の範囲】[Claims] 【請求項1】 装置の内部状態を設定する状態設定レジ
スタ(13)と、該状態設定レジスタ(13)の内容を読み取る
ため同一内容を書き込む予備記憶領域(14)と、を有し、
該状態設定レジスタ(13)へ書込んだ場合は引き続いて該
予備記憶領域(14)への書込みを行う装置の状態設定レジ
スタの書込回路であって、該状態設定レジスタ(13)と該
予備記憶領域(14)への書込みを同時に行うことを特徴と
する状態設定レジスタの書込回路。
1. A state setting register (13) for setting an internal state of a device, and a spare storage area (14) for writing the same content to read the content of the state setting register (13),
A write circuit of the state setting register of the device which, when writing to the state setting register (13), continuously writes to the spare storage area (14), is a write circuit of the state setting register (13) and the spare A writing circuit for a status setting register, which is characterized in that writing to the storage area (14) is performed at the same time.
JP14083092A 1992-06-02 1992-06-02 Write circuit for state setting register Withdrawn JPH05334099A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP14083092A JPH05334099A (en) 1992-06-02 1992-06-02 Write circuit for state setting register

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP14083092A JPH05334099A (en) 1992-06-02 1992-06-02 Write circuit for state setting register

Publications (1)

Publication Number Publication Date
JPH05334099A true JPH05334099A (en) 1993-12-17

Family

ID=15277715

Family Applications (1)

Application Number Title Priority Date Filing Date
JP14083092A Withdrawn JPH05334099A (en) 1992-06-02 1992-06-02 Write circuit for state setting register

Country Status (1)

Country Link
JP (1) JPH05334099A (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH08329480A (en) * 1995-06-02 1996-12-13 Nec Corp Seeking speed controller for optical head
JP2009163285A (en) * 2007-12-28 2009-07-23 Nec Electronics Corp Output port, microcomputer and data output method

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH08329480A (en) * 1995-06-02 1996-12-13 Nec Corp Seeking speed controller for optical head
JP2009163285A (en) * 2007-12-28 2009-07-23 Nec Electronics Corp Output port, microcomputer and data output method

Similar Documents

Publication Publication Date Title
JPH0764957A (en) Timer device
JPH05334099A (en) Write circuit for state setting register
JP3055999B2 (en) Microprogram control device group
JPH05250254A (en) Storage circuit
JPH0877143A (en) Vector data processor
JPS58105363A (en) Storage device
JPH0743668B2 (en) Access control device
JPS60142450A (en) Storage system
JPH056280A (en) Interruption control system
JP3405513B2 (en) Redundant controller for programmable controller
JP2884620B2 (en) Digital image processing device
JPH05120155A (en) Microprogram controller
JPH02302855A (en) Memory control system
JPS61123957A (en) Storage device
JPS62105252A (en) Abnormality detecting circuit
JPS59132025A (en) Interruption control system
JPH0378845A (en) Man storage key control system
JPS63144496A (en) Write control system for storage device
JPH0469737A (en) Microaddress circuit
JPH01161537A (en) Interruption controller
JPH04209046A (en) Memory access circuit
JPH03147046A (en) Data processor
JPH0219932A (en) Back-up device for development of microprocessor
JPH0580698B2 (en)
JPH02292655A (en) Data processor

Legal Events

Date Code Title Description
A300 Withdrawal of application because of no request for examination

Free format text: JAPANESE INTERMEDIATE CODE: A300

Effective date: 19990803