JPH03216746A - Memory protector - Google Patents

Memory protector

Info

Publication number
JPH03216746A
JPH03216746A JP2010510A JP1051090A JPH03216746A JP H03216746 A JPH03216746 A JP H03216746A JP 2010510 A JP2010510 A JP 2010510A JP 1051090 A JP1051090 A JP 1051090A JP H03216746 A JPH03216746 A JP H03216746A
Authority
JP
Japan
Prior art keywords
data
memory
attribute
access
signal
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
JP2010510A
Other languages
Japanese (ja)
Inventor
Hideo Furuno
古野 英夫
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.)
Toshiba Corp
Original Assignee
Toshiba Corp
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Toshiba Corp filed Critical Toshiba Corp
Priority to JP2010510A priority Critical patent/JPH03216746A/en
Publication of JPH03216746A publication Critical patent/JPH03216746A/en
Pending legal-status Critical Current

Links

Abstract

PURPOSE:To surely protect the memory data on a RAM against the runaway of a processor and the intentional and illicit accesses by setting the attribute data to an attribute memory to inhibit the writing operation in accordance with the data word of a data memory storing the writing operation inhibiting data. CONSTITUTION:The attribute data is set to an attribute memory 21 to inhibit the data rewriting operation is accordance with the data word inhibiting the writing operation out of those data stored in a data memory 5. Thus the accesses are defined as errors every time a CPU 1 tries to rewrite the corresponding data stored in the memory 5. Thus the data rewriting operation is inhibited. That is, the attribute data inhibiting the data writing operation is set to the memory 21 so that the data stored in the corresponding area of the memory 5 can be protected. Thus it is possible to surely protect the memory data on a RAM against the runaway of a processor and the intentional and illicit accesses.

Description

【発明の詳細な説明】 [発明の目的] (産業上の利用分野) 本発明は、マイクロプロセッサを用いた装置に使用され
るメモリのデータ保護を行うメモリ保護装置に関する。
DETAILED DESCRIPTION OF THE INVENTION [Object of the Invention] (Field of Industrial Application) The present invention relates to a memory protection device that protects data in a memory used in a device using a microprocessor.

(従来の技術) 従来、マイクロプロセッサを用いた装置に使用されるメ
モリとしては、ROM(リード・オンリ●メモリ),R
AM(ランダム●アクセス●メモリ)等が知られている
。そのうちROMはデータの書込みを禁止しているため
、装置に異常が生じてもメモリデータを確実に保護でき
る利点がある。〔かじ、一旦装置にセットされたROM
のメそりデータを更新する場合にはROMを別のものに
交換するか、専用のデータ書換装置を用いてROMに記
憶されたデータの書換えを行う必要があり、そのために
装置をオフラインとしてROMを取り出さなければなら
ず手間を要するものであった。
(Prior Art) Conventionally, memories used in devices using microprocessors include ROM (read-only memory), R
AM (random access memory) and the like are known. Since writing of data to ROM is prohibited, it has the advantage that memory data can be reliably protected even if an abnormality occurs in the device. [Kazi, ROM once set in the device
To update the ROM data, it is necessary to replace the ROM with another one or use a dedicated data rewriting device to rewrite the data stored in the ROM. It had to be taken out, which required time and effort.

一方、RAMはデータの書込みおよび読出しが自由に行
えるので、更新が頻繁なデータの記憶手段として好適で
ある。ところが、このRAMはメモリデータの書換えが
可能であるため、装置の異常等によって必要なデータが
破壊してしまうおそれがあり、それを防止してメモリデ
ータを保護するための保護手段が必要となる。そこで従
来は、異常が生じた場合にメモリデータの書換えを禁止
するようなソフトウエアプログラムをプロセッサに組み
込むことによってメモリデータの保護を図っていた。
On the other hand, since data can be freely written to and read from RAM, it is suitable as a storage means for data that is frequently updated. However, since the memory data in this RAM can be rewritten, there is a risk that necessary data may be destroyed due to equipment abnormality, etc., and protection measures are required to prevent this and protect the memory data. . Conventionally, therefore, memory data has been protected by incorporating into the processor a software program that prohibits rewriting of memory data in the event of an abnormality.

しかるに、このソフトウェアプログラムによるメモリデ
ータの保護手段にあっては、プロセッサの暴走等によっ
てプログラムが働かなくなりメモリデータが破壊される
ことがあり、また故意の不正アクセスによっても書き換
えられるおそれがあった。このため、各種のプロセス制
御分野などデータの破壊が重大な危険に結び付くような
装置には適用できない不都合があった。
However, with this software program-based memory data protection means, there is a risk that the program may stop working and the memory data may be destroyed due to a runaway of the processor, or may be rewritten due to deliberate unauthorized access. For this reason, there is a problem in that it cannot be applied to devices such as those in various process control fields where data destruction would lead to serious danger.

(発明が解決しようとする課題) このようにRAMに対するメモリデータの保護をソフト
ウエアプログラムにより行う従来技術においては、プロ
セッサの暴走等によってデータが破壊されるのを防ぐこ
とが困難であり、しかも故意の不正アクセス等からも確
実に保護できるものではなかった。このため、各種のプ
ロセス制御分野などデータの異常が重大な危険に結び付
くような装置には適用できない不都合があった。
(Problem to be Solved by the Invention) As described above, in the conventional technology in which memory data in RAM is protected by a software program, it is difficult to prevent data from being destroyed due to a runaway processor, etc. It was not possible to reliably protect against unauthorized access, etc. For this reason, there is an inconvenience that this method cannot be applied to devices such as those in various process control fields where data abnormalities can lead to serious danger.

そこで本発明は、RAMに対するメモリデータの保護を
プロセッサの暴走や故意の不正アクセスからも確実に行
うことができるメモリ保護装置を提供しようとするもの
である。
SUMMARY OF THE INVENTION Therefore, an object of the present invention is to provide a memory protection device that can reliably protect memory data in RAM from a runaway processor or intentional unauthorized access.

[発明の構成] (課題を解決するための手段) データをワード単位で複数ワード分記憶するデータメモ
リの保護装置において、データメモリの各ワード毎の属
性を1もしくは複数のワード単位で記憶する属性メモリ
と、データメモリに対するデータアクセスに応じて属性
メモリからアクセス先のデータワードに対応する属性を
発生させるメモリ属性発生手段と、データメモリに対す
るデータアクセスの種別を示す属性を発生させるアクセ
ス属性発生手段と、これらの発生手段により発生された
メモリ属性とアクセス属性との組合わせによりデータメ
モリに対するデータアクセスの実行を許可するか否かを
判定する判定手段とを備えたものである。
[Structure of the Invention] (Means for Solving the Problems) In a protection device for a data memory that stores a plurality of words of data in units of words, an attribute that stores attributes for each word of the data memory in units of one or more words. a memory; a memory attribute generating means for generating an attribute corresponding to a data word to be accessed from the attribute memory in response to a data access to the data memory; and an access attribute generating means for generating an attribute indicating the type of data access to the data memory. , and determining means for determining whether execution of data access to the data memory is permitted based on a combination of the memory attribute and the access attribute generated by these generating means.

なお属性メモリとして、データメモリに対して設けられ
たパリティピット記憶用メモリの不使用ビットを代用す
ることが可能である。
Note that an unused bit of the parity pit storage memory provided for the data memory can be used as the attribute memory.

また、データメモリに対するデータアクセスの実行不可
が判定されたとき、強制的に特定の命令コードを発生さ
せる手段を設けると好都合である。
Furthermore, it is advantageous to provide means for forcibly generating a specific instruction code when it is determined that data access to the data memory cannot be executed.

(作 用) このような構成のメモリ保護装置においては、属性メモ
リにデータメモリの各ワード毎の属性として例えばデー
タの書込みを許可するか禁止するか、データの読出しを
許可するか禁止するか等の情報を1もしくは複数のワー
ド単位で記憶させる。
(Function) In a memory protection device having such a configuration, the attribute memory is used to specify attributes for each word of the data memory, such as whether to permit or prohibit writing of data, permit or prohibit reading of data, etc. information is stored in units of one or more words.

こうすることにより、プロセッサからデータメモリに対
するデータアクセスが行われると、メモリ属性発生手段
により上記属性メモリからアクセス先のデータワードに
対応する属性が発生されると同時にアクセス属性発生手
段により当該データアクセスの種別を示す属性が発生さ
れ、これらの属性の組合わせに基づいてデータメモリに
対するデータアクセスの実行を許可するか否かが判定さ
れる。従って、書換えを禁止するデータが記憶されたデ
ータメモリのデータワードに対応して書込みを禁止する
属性を属性メモリに記憶させることにより、当該データ
の保護がはかられる。
By doing this, when data access is performed from the processor to the data memory, the memory attribute generation means generates an attribute corresponding to the data word to be accessed from the attribute memory, and at the same time, the access attribute generation means generates an attribute for the data access. Attributes indicating the type are generated, and based on a combination of these attributes, it is determined whether or not to permit execution of data access to the data memory. Therefore, by storing in the attribute memory an attribute that prohibits writing corresponding to a data word of the data memory in which data that prohibits rewriting is stored, the data can be protected.

なお属性メモリとして、データメモリに対して設けられ
たパリティピット記憶用メモリの不使用ビットを代用す
ることによって、メモリの使用効率を改善できる。
Note that memory usage efficiency can be improved by substituting unused bits of the parity pit storage memory provided for the data memory as the attribute memory.

また、データアクセスの実行不可時にノーオペレーショ
ンコードを発生させることによって、異常時に適切な対
応をとれるようになる。
Furthermore, by generating a no-operation code when data access cannot be executed, it becomes possible to take appropriate measures in the event of an abnormality.

(実施例) 以下、本発明を第1図に示すマイクロコンピュータシス
テムに適用したー実施例について図面を参照しながら説
明する。
(Example) Hereinafter, an example in which the present invention is applied to the microcomputer system shown in FIG. 1 will be described with reference to the drawings.

第1図において1はマイクロプロセッサとしてのCPU
 (中央処理装置)であって、このCPU1にはアドレ
スバス2,データバス3および制御信号バス4の各バス
ラインを介して、データメモリ5,メモリ属性発生器6
およびアクセス属性発生器7がそれぞれ接続されている
。また、プリンタ,ディスプレイ,キーボード等の周辺
機器を制御する周辺回路8およびエラー検出器9が前記
制御信号バス4を介してCPUIに接続されている。
In Figure 1, 1 is a CPU as a microprocessor.
(Central processing unit), and this CPU 1 is connected to a data memory 5, a memory attribute generator 6 via each bus line of an address bus 2, a data bus 3, and a control signal bus
and an access attribute generator 7 are connected respectively. Further, a peripheral circuit 8 for controlling peripheral devices such as a printer, a display, and a keyboard, and an error detector 9 are connected to the CPUI via the control signal bus 4.

上記エラー検出器9にはメモリ属性バス10およびアク
セス属性バス11を介して前記メモリ属性発生器6およ
びアクセス属性発生器7がそれぞれ接続されている。ま
た、上記エラー検出器9は前記データメモリ5に対して
メモリ書込み保護信号S1およびメモリ読出し保護信号
S2を適時出力できるようになっている。
The error detector 9 is connected to the memory attribute generator 6 and the access attribute generator 7 via a memory attribute bus 10 and an access attribute bus 11, respectively. Further, the error detector 9 is capable of outputting a memory write protection signal S1 and a memory read protection signal S2 to the data memory 5 at appropriate times.

上記データメモリ5はRAMで構成されており、CPU
Iが各部を制御するためのプログラムデータや周辺回路
8により起動される各種タスクのプログラムデータ等が
記憶される。
The data memory 5 is composed of RAM, and the CPU
Program data for I to control various parts, program data for various tasks activated by the peripheral circuit 8, etc. are stored.

上記メモリ属性発生器6は、第2図に示すように属性メ
モリ21を有する。この属性メモリ21は、前記データ
メモリ5に記憶されるデータワードに1対1もしくは1
対n (n≧2)で対応して属性データを記憶するメモ
リである。そしてこの属性メモリ21のアドレスとデー
タメモリ5のアドレスとが1対1で対応している。なお
、属性としてはデータの書込みを禁止するか許可するか
を示すデータライト属性、データの読出しを禁止するか
許可するかを示すデータリード属性、オペレーションコ
ードフエツチ時のデータの読出しを禁止するか許可する
かを示すプログラム実行属性、および各種タスクに割り
付けられた階層的な特権レベルいわゆるタスクレベルを
選択するタスクレベル属性がある。
The memory attribute generator 6 has an attribute memory 21 as shown in FIG. This attribute memory 21 is arranged one-to-one or one-to-one for the data words stored in the data memory 5.
This is a memory that stores attribute data in correspondence with n pairs (n≧2). The addresses of the attribute memory 21 and the addresses of the data memory 5 have a one-to-one correspondence. Note that the attributes include a data write attribute that indicates whether writing of data is prohibited or permitted, a data read attribute that indicates whether reading of data is prohibited or permitted, and whether reading of data is prohibited when fetching an operation code. There are program execution attributes that indicate whether permission is granted, and task level attributes that select hierarchical privilege levels, so-called task levels, assigned to various tasks.

一方、上記属性メモリ21のアドレス入力端子ADRに
は前記アドレスバス2を介してメモリアドレス信号A1
が入力される。またデータ入力端子DINには出力ボー
ト22およびラッチ回路23を介してデータバス3上の
データが入力されるようになっている。ここで、上記出
力ボート22はアドレスバス2を介して入力されるボー
トアドレス信号A2によって選択され、このときデータ
パス3上のデータを読み込んでラッチ回路23へ出力す
る。上記ラッチ回路23は、制御信号バス4を介して入
力される書込み制御信号S3に基づいてデータを属性メ
モリ21に出力する。
On the other hand, a memory address signal A1 is sent to the address input terminal ADR of the attribute memory 21 via the address bus 2.
is input. Further, data on the data bus 3 is inputted to the data input terminal DIN via the output port 22 and the latch circuit 23. Here, the output boat 22 is selected by a boat address signal A2 input via the address bus 2, and at this time reads data on the data path 3 and outputs it to the latch circuit 23. The latch circuit 23 outputs data to the attribute memory 21 based on the write control signal S3 input via the control signal bus 4.

上記属性メモリ21の書込み端子WEには論理積回路2
4の出力であるライト信号WSが入力される。また読出
し端子REには論理否定回路25の出力であるリード信
号RSが入力されるようになっている。ここで、上記論
理積回路24は制御信号バス4を介して入力されるデー
タメモリ読出し信号S4と属性メモリ書込み許可信号S
5との論理積を演算する。論理否定回路25は上記属性
メモリ書込み許可信号S5の論理否定を演算する。
The write terminal WE of the attribute memory 21 has an AND circuit 2.
A write signal WS, which is the output of No. 4, is input. Further, a read signal RS, which is an output of the logic NOT circuit 25, is input to the read terminal RE. Here, the AND circuit 24 outputs a data memory read signal S4 input via the control signal bus 4 and an attribute memory write permission signal S.
Compute the AND with 5. The logic negation circuit 25 calculates the logic negation of the attribute memory write permission signal S5.

上記属性メモリ21のデータ出力端子DOUTは前記属
性データバス10に接続されている。しかして、前記リ
ード信号RSが入力されている状態で前記メモリアドレ
ス信号A1によってアドレス指定されると、その指定ア
ドレスの属性データがメモリ属性データ信号pとして前
記属性データパス10に出力されるようになっている。
A data output terminal DOUT of the attribute memory 21 is connected to the attribute data bus 10. Thus, when an address is specified by the memory address signal A1 while the read signal RS is being input, the attribute data of the specified address is output to the attribute data path 10 as the memory attribute data signal p. It has become.

また前記ライト信号WSが入力されている状態(このと
きリード信号RSは入力されない)で前記メモリアドレ
ス信号A1によってアドレス指定されると、その指定ア
ドレスに前記データ入力端子DINに入力された属性デ
ータが設定されるようになっている。
Further, when an address is specified by the memory address signal A1 while the write signal WS is input (at this time, the read signal RS is not input), the attribute data input to the data input terminal DIN is stored at the specified address. It is now set.

前記アクセス属性発生器7は、データメモリ5に対t゛
るアクセスが1回行われる毎にそのアクセス種別(読出
し.書込み等)に対応したステータスをアクセス属性と
して発生するもので、第3図に示すようにアクセスステ
ータスエンコーダ31,出力ポート32およびラッチ回
路33を有する。
The access attribute generator 7 generates a status corresponding to the access type (reading, writing, etc.) as an access attribute each time the data memory 5 is accessed once. As shown, it has an access status encoder 31, an output port 32, and a latch circuit 33.

上記アクセスステータスエンコーダ31は、制御信号バ
ス4を介してデータメモリ読出し信号s4が入力された
ならばアクセス属性としてデータリード属性を、データ
メモリ書込み信号S6が入力されたならばアクセス属性
としてデータライト属性を、オペレーションコードフェ
ッチ信号s7が入力されたならばアクセス属性としてプ
ログラム実行属性をそれぞれ発生するもので、発生され
たアクセス属性信号q1はアクセス属性バス11へ出力
される。上記出力ポート32は、アドレスバス2を介し
て入力されるボートアドレス信号A3によって選択され
、このとき周辺回路8から発生されるタスクレベルデー
タD2をデータバス3がら読み込みタスクレベル属性信
号q2としてラッチ回路33へ出力する。上記ラッチ回
路33は、制御信号バス4を介して入力される書込み制
御信号S8に基づいて上記タスクレベル属性信号q2を
アクセス属性バス11へ出力する。
The access status encoder 31 sets a data read attribute as an access attribute when a data memory read signal s4 is input via the control signal bus 4, and a data write attribute as an access attribute when a data memory write signal S6 is input. When the operation code fetch signal s7 is input, a program execution attribute is generated as an access attribute, and the generated access attribute signal q1 is output to the access attribute bus 11. The output port 32 is selected by the boat address signal A3 input via the address bus 2, and reads the task level data D2 generated from the peripheral circuit 8 from the data bus 3 and outputs it as a task level attribute signal q2 to the latch circuit. Output to 33. The latch circuit 33 outputs the task level attribute signal q2 to the access attribute bus 11 based on the write control signal S8 input via the control signal bus 4.

前記エラー検出器9は、第4図に示すように、エラー判
定部41とゲート回路42とを有する。
The error detector 9 includes an error determination section 41 and a gate circuit 42, as shown in FIG.

上記エラー判定部41は、前記メモリ属性発生器6から
発生されたメモリ属性データ信号pと、アクセス属性発
生器7から発生されたアクセス属性信号q1またはタス
クレベル属性信号q2とをメモリ属性バス10およびア
クセス属性バス11からそれぞれ入力し、その一致関係
や包含関係あるいは適当な演算によって両者の関係を調
べ、その結果によりエラーを発生するか否かを判定する
もので、判定結果は判定信号aとして上記ゲート回路4
2に出力される。また、エラー判定時には割込み信号b
とトランスファアクノリッジ信号Cとを前記制御信号バ
ス4に送出するようになっている。上記ゲート回路42
は、前記エラー判定部41からの判定信号aがデータメ
モリ5のアクセス許可を示すとき、すなわちエラー判定
でないときに、制御信号バス4からのデータメモリ読出
し信号S4あるいはデータメモリ書込み信号S6をそれ
ぞれメモリ書込み保護信号S1あるいはメモリ読出し保
護信号S2としてデータメモリ5の書込み端子WEある
いは読出し端子REに出力する。
The error determination unit 41 transmits the memory attribute data signal p generated from the memory attribute generator 6 and the access attribute signal q1 or task level attribute signal q2 generated from the access attribute generator 7 to the memory attribute bus 10 and The system inputs each input from the access attribute bus 11, examines the relationship between the two by using the matching relationship, inclusion relationship, or appropriate calculation, and determines whether or not an error occurs based on the result.The determination result is used as the determination signal a described above. Gate circuit 4
2 is output. Also, when determining an error, interrupt signal b
and a transfer acknowledge signal C to the control signal bus 4. The gate circuit 42
When the judgment signal a from the error judgment unit 41 indicates permission to access the data memory 5, that is, when it is not an error judgment, the data memory read signal S4 or the data memory write signal S6 from the control signal bus 4 is sent to the memory respectively. It is output to the write terminal WE or the read terminal RE of the data memory 5 as a write protection signal S1 or a memory read protection signal S2.

しかして、上記データメモリ5は制御信号バス4からの
チップセレクト信号CSにより選択された状態で書込み
端子WEにメモリ書込み保護信号S1が入力されたなら
ば、アドレス端子ADHに入力されたアドレス信号A1
によって指定されたアドレスにデータ入出力端子I/O
に入力されたデータを書込むようになっている。これに
対し、同じくチップセレクト信号CSにより選択された
状態で読出し端子REにメモリ読出し保護信号S2が入
力されたならば、アドレス端子ADRに入力されたアド
レス信号A1によって指定されたアドレスのデータをデ
ータ入出力端子I/Oからデータバス3へ出力するよう
になっている。
Therefore, if the data memory 5 is selected by the chip select signal CS from the control signal bus 4 and the memory write protection signal S1 is input to the write terminal WE, the address signal A1 input to the address terminal ADH is
Data input/output terminal I/O to the address specified by
It is designed to write the data entered in. On the other hand, if the memory read protection signal S2 is input to the read terminal RE while being selected by the chip select signal CS, the data at the address specified by the address signal A1 input to the address terminal ADR is transferred to the data. It is configured to output to the data bus 3 from the input/output terminal I/O.

このように構成された本実施例においては、データメモ
リ5のアドレスと属性メモリ発生器6に設けられた属性
メモリ21のアドレスとが1対1で対応しており、デー
タメモリ5に記憶されるデータワードの属性を上記属性
メモリ21の対応するアドレスに設定できる。すなわち
、属性設定モードを選択することによって論理積回路2
4の出力である書込み信号WSがアクティブとなり、こ
のときメモリアドレス信号A1で指定されたアドレスに
ラッチ回路23から出力される属性データが書込まれる
ので、例えば周辺回路8に接続されたキーボードを用い
てアドレスおよび属性データを指定することによって任
意に設定可能である。
In this embodiment configured in this way, the addresses of the data memory 5 and the addresses of the attribute memory 21 provided in the attribute memory generator 6 correspond one-to-one, and are stored in the data memory 5. The attributes of the data word can be set to the corresponding addresses in the attribute memory 21. That is, by selecting the attribute setting mode, the AND circuit 2
4 becomes active, and at this time, the attribute data output from the latch circuit 23 is written to the address specified by the memory address signal A1. It can be set arbitrarily by specifying the address and attribute data.

データメモリ5に記憶されるデータワードの属性が上記
属性メモリ21の対応するアドレスに設定された状態で
、CPU1がデータメモリ5のアクセスを行うと、属性
メモリ発生器6からは上記属性メモリ21の該当アドレ
スに設定された属性データがメモリ属性データ信号pと
してメモリ属性バス10に出力される。また同時にアク
セス属性発生器7からはそのアクセス種別に対応したア
クセス属性信号q1がアクセス属性バス1lに出力され
る。しかして、エラー検出器9において上記メモリ属性
データ信号pとアクセス属性信号q1とが比較される。
When the CPU 1 accesses the data memory 5 with the attribute of the data word stored in the data memory 5 set at the corresponding address in the attribute memory 21, the attribute memory generator 6 outputs information from the attribute memory 21. The attribute data set at the corresponding address is output to the memory attribute bus 10 as a memory attribute data signal p. At the same time, the access attribute generator 7 outputs an access attribute signal q1 corresponding to the access type to the access attribute bus 1l. The error detector 9 then compares the memory attribute data signal p and the access attribute signal q1.

そして、例えば両者が一致しているときエラー無しが判
定されてデータメモリ5に対するアクセス信号、すなわ
ちデータメモリ読出し信号S4あるいはデータメモリ書
込み信号S6がそれぞれメモリ書込み保護信号S1ある
いはメモリ読出し保護信号S2としてデータメモリ5に
供給される。これにより、データメモリ5はアクセスさ
れる。
For example, when the two match, it is determined that there is no error, and the access signal to the data memory 5, that is, the data memory read signal S4 or the data memory write signal S6, is used as the memory write protection signal S1 or the memory read protection signal S2, respectively. The data is supplied to the memory 5. As a result, the data memory 5 is accessed.

これに対し、エラー検出器9においてエラー有りが判定
された場合、データメモリ5に対するアクセス信号の出
力が禁止される。したがって、データメモリ5はアクセ
ス不能となる。またこのとき、エラー検出器9よりCP
UIに対して割込みがかけられ、トランスファアクノリ
ッジ信号Cが送出される。これにより、CPU1のアク
セスサイクルは中途で終結することになる。
On the other hand, if the error detector 9 determines that there is an error, output of the access signal to the data memory 5 is prohibited. Therefore, data memory 5 becomes inaccessible. Also, at this time, the error detector 9 detects that CP
An interrupt is applied to the UI, and a transfer acknowledge signal C is sent. As a result, the access cycle of the CPU 1 ends midway.

したがって、データメモリ5に記憶されたデータのうち
書換えを禁止するデータのデータワード(1乃至複数)
に対応して属性メモリ21にデー夕書込みを禁止する属
性データを設定することにより、CPUIがデータメモ
リ5上の該当データの書換えを行おうとした場合には常
にそのアクセスをエラーにでき、データの書換え動作を
禁止できる。換言すれば、属性メモリ21にデータ書込
みを禁止する属性データを設定することにより、データ
メモリ5上の該当エリアに記憶されたデータを確実に保
護できるようになる。
Therefore, among the data stored in the data memory 5, data word (one or more) of data that is prohibited from being rewritten.
By setting attribute data that prohibits data writing in the attribute memory 21 in response to this, whenever the CPU attempts to rewrite the corresponding data on the data memory 5, the access can always be treated as an error, and the data Rewriting operations can be prohibited. In other words, by setting attribute data that prohibits data writing in the attribute memory 21, data stored in the corresponding area on the data memory 5 can be reliably protected.

また、データメモリ5上のデータ未設定エリアに対して
は属性メモリ21の該当エリアにデータ読出しを禁止す
る属性データを設定する。こうすることにより、CPU
Iの暴走等によってデータメモリ5上の該当エリアに対
してデータの読出しがかけられてもそのアクセスをエラ
ーにできる。
Furthermore, for areas on the data memory 5 where no data has been set, attribute data that prohibits data reading is set in the corresponding area of the attribute memory 21. By doing this, the CPU
Even if data is read from the corresponding area on the data memory 5 due to a runaway of I, the access can be made an error.

そして、このときCPUIに対して割込みがかけられて
トランスファアクノリッジ信号が送出され,CPUIの
アクセスサイクルが終結されるので、CPU1の暴走に
リセットをかけられる。従って故意の不正アクセスがあ
ってもそれを確実に防止できるようになる。
At this time, an interrupt is applied to the CPU, a transfer acknowledge signal is sent, and the access cycle of the CPU is terminated, so that the runaway of the CPU 1 can be reset. Therefore, even if there is intentional unauthorized access, it can be reliably prevented.

なお、本発明は前記実施例に限定されるものではなく、
本発明を要旨を逸脱しない範囲で種々変形実施可能であ
るのは勿論である。
Note that the present invention is not limited to the above embodiments,
It goes without saying that the present invention can be modified in various ways without departing from the scope of the invention.

例えば第5図はメモリ属性発生器6に組み込まれていた
属性メモリ21の機能をデータメモリ5に対して既に設
けられているパリティメモリ51を代用させた構成例で
ある。パリティメモリ51はデータメモリ5に設定され
たデータのパリティビットを記憶するためのもので、こ
のバリティメモリ51上の不使用ビットを属性データに
割り当てている。この場合、前記実施例と同様の作用効
果を奏するばかりか、メモリの使用効率を改善できる。
For example, FIG. 5 shows a configuration example in which a parity memory 51 already provided for the data memory 5 is substituted for the function of the attribute memory 21 incorporated in the memory attribute generator 6. Parity memory 51 is for storing parity bits of data set in data memory 5, and unused bits on parity memory 51 are assigned to attribute data. In this case, not only the same effects as in the embodiment described above can be achieved, but also the memory usage efficiency can be improved.

なお、本来のバリティメモリ51としての動作に影響を
及ぼさないように、メモリアクセスサイクルの内部で適
当なスケジューリングを行う必要があるのは言うまでも
ないことである。
It goes without saying that it is necessary to perform appropriate scheduling within the memory access cycle so as not to affect the original operation of the parity memory 51.

また、第6図はエラー検出器9のエラー判定部41にお
いてエラー発生有りが判定されたとき、特定の命令コー
ドを発生させるようにした構成例である。この場合にお
いて、エラー判定部41からのエラー信号dに応じてコ
ード発生器61から発生される命令コードとしては、ノ
ーオペレーションコード,エラー処理タスクへのジャン
プ命令コードなどが考えられる。このような命令コード
をCPUIに対して発生させることにより、アクセスエ
ラー発生時においてCPUIが予期せぬ動作をしないよ
う適切な処置をとれるようになる。
Further, FIG. 6 shows an example of a configuration in which a specific instruction code is generated when the error determining section 41 of the error detector 9 determines that an error has occurred. In this case, the instruction code generated from the code generator 61 in response to the error signal d from the error determination section 41 may be a no-operation code, a jump instruction code to an error processing task, or the like. By generating such an instruction code for the CPUI, appropriate measures can be taken to prevent the CPUI from operating unexpectedly when an access error occurs.

[発明の効果] 以上詳述したように、本発明によれば、RAMに対する
メモリデータの保護をプロセッサの暴走や故意の不正ア
クセスからも確実に行うことができるメモリ保護装置を
提供できる。
[Effects of the Invention] As described in detail above, according to the present invention, it is possible to provide a memory protection device that can reliably protect memory data in a RAM from a runaway processor or intentional unauthorized access.

また請求項2によれば、メモリの使用効率の改善をもは
かり得るメモリ保護装置を提供できる。
Moreover, according to claim 2, it is possible to provide a memory protection device that can improve memory usage efficiency.

さらに請求項3によれば、アクセスエラー発生に対して
速やかに適切な処置をとることができるメモリ保護装置
を提供できる。
Furthermore, according to claim 3, it is possible to provide a memory protection device that can promptly take appropriate measures against the occurrence of an access error.

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

第1図乃至第4図は本発明の一実施例を示す図であって
、第1図は全体構成を示すブロック図第2図はメモリ属
性発生器の構成を示すブロック図、第3図はアクセス属
性発生器の構成を示すブロック図、第4図はエラー検出
器の構成を示すブロック図、第5図は属性メモリとして
パリティメモリを代用した変形例の構成を示すブロック
図、第6図はエラー検出器の改良例を示すブロック図で
ある。 1・・・CPU,5・・・データメモリ、6・・・メモ
リ属性発生器、7・・・アクセス属性発生器、9・・・
エラー検出器、21・・・属性メモリ、5l・・・バリ
ティメモリ、61・・・コード発生器。
1 to 4 are diagrams showing one embodiment of the present invention, in which FIG. 1 is a block diagram showing the overall configuration, FIG. 2 is a block diagram showing the configuration of the memory attribute generator, and FIG. 3 is a block diagram showing the configuration of the memory attribute generator. FIG. 4 is a block diagram showing the configuration of the access attribute generator, FIG. 4 is a block diagram showing the configuration of the error detector, FIG. 5 is a block diagram showing the configuration of a modified example in which parity memory is used as the attribute memory, and FIG. FIG. 3 is a block diagram showing an improved example of an error detector. 1... CPU, 5... Data memory, 6... Memory attribute generator, 7... Access attribute generator, 9...
Error detector, 21... Attribute memory, 5l... Validity memory, 61... Code generator.

Claims (3)

【特許請求の範囲】[Claims] (1)データをワード単位で複数ワード分記憶するデー
タメモリの保護装置において、前記データメモリの各ワ
ード毎の属性を1もしくは複数のワード単位で記憶する
属性メモリと、前記データメモリに対するデータアクセ
スに応じて前記属性メモリからアクセス先のデータワー
ドに対応する属性を発生させるメモリ属性発生手段と、
前記データメモリに対するデータアクセスの種別を示す
属性を発生させるアクセス属性発生手段と、これらの発
生手段により発生されたメモリ属性とアクセス属性との
組合わせにより前記データメモリに対するデータアクセ
スの実行を許可するか否かを判定する判定手段とを具備
したことを特徴とするメモリ保護装置。
(1) In a protection device for a data memory that stores multiple words of data in units of words, an attribute memory that stores attributes for each word of the data memory in units of one or more words, and a data access to the data memory are provided. memory attribute generating means for generating an attribute corresponding to the accessed data word from the attribute memory in response;
Access attribute generating means for generating an attribute indicating the type of data access to the data memory, and whether execution of data access to the data memory is permitted by a combination of the memory attribute and the access attribute generated by these generating means. What is claimed is: 1. A memory protection device characterized by comprising: determination means for determining whether the
(2)前記属性メモリは、前記データメモリに対して設
けられたパリテイビット記憶用メモリの不使用ビットを
代用することを特徴とする請求項1記載のメモリ保護装
置。
(2) The memory protection device according to claim 1, wherein the attribute memory substitutes an unused bit of a parity bit storage memory provided for the data memory.
(3)前記判定手段がデータメモリに対するデータアク
セスの実行不可を判定したとき、強制的に特定の命令コ
ードを発生させる手段を設けたことを特徴とする請求項
1記載のメモリ保護装置。
(3) The memory protection device according to claim 1, further comprising means for forcibly generating a specific instruction code when the determining means determines that data access to the data memory cannot be executed.
JP2010510A 1990-01-22 1990-01-22 Memory protector Pending JPH03216746A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2010510A JPH03216746A (en) 1990-01-22 1990-01-22 Memory protector

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2010510A JPH03216746A (en) 1990-01-22 1990-01-22 Memory protector

Publications (1)

Publication Number Publication Date
JPH03216746A true JPH03216746A (en) 1991-09-24

Family

ID=11752217

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2010510A Pending JPH03216746A (en) 1990-01-22 1990-01-22 Memory protector

Country Status (1)

Country Link
JP (1) JPH03216746A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH08235026A (en) * 1995-03-01 1996-09-13 Nec Corp Cpu operation abnormality detection system

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JPH08235026A (en) * 1995-03-01 1996-09-13 Nec Corp Cpu operation abnormality detection system

Similar Documents

Publication Publication Date Title
US7444668B2 (en) Method and apparatus for determining access permission
US5396609A (en) Method of protecting programs and data in a computer against unauthorized access and modification by monitoring address regions
US5737760A (en) Microcontroller with security logic circuit which prevents reading of internal memory by external program
US5305460A (en) Data processor
US4523271A (en) Software protection method and apparatus
US4388695A (en) Hardware memory write lock circuit
US6631472B2 (en) Kernel mode protection
US4685056A (en) Computer security device
KR100232670B1 (en) Device and method for multiprogram execution control
US20060090053A1 (en) Program-controlled unit
US20060112246A1 (en) Program-controlled unit
EP0109504A2 (en) Protection system for storage and input/output facilities and the like
US20040187019A1 (en) Information processing apparatus
JP2018067047A (en) Controller
JPH03216746A (en) Memory protector
EP1262857B1 (en) Information processing apparatus and method of controlling an access level
US20060080519A1 (en) Program-controlled unit
JPS59231800A (en) Preventing device for foul writing to main memory
JPS62160554A (en) Device for preventing wrong access to memory
JPH01123342A (en) Writing protecting circuit for memory
JPH01180656A (en) Memory protecting device
JPH0242551A (en) Data processing system and nonvolatile semiconductor memory
JPH05334195A (en) Information processor
JPH01261760A (en) Computer system
JPH03228146A (en) Microcomputer incorporating eeprom