JP3047839B2 - Single-chip microcomputer - Google Patents
Single-chip microcomputerInfo
- Publication number
- JP3047839B2 JP3047839B2 JP8342549A JP34254996A JP3047839B2 JP 3047839 B2 JP3047839 B2 JP 3047839B2 JP 8342549 A JP8342549 A JP 8342549A JP 34254996 A JP34254996 A JP 34254996A JP 3047839 B2 JP3047839 B2 JP 3047839B2
- Authority
- JP
- Japan
- Prior art keywords
- access
- information
- cpu
- word length
- memory
- 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.)
- Expired - Fee Related
Links
Landscapes
- Storage Device Security (AREA)
- Executing Machine-Instructions (AREA)
- Microcomputers (AREA)
Description
【0001】[0001]
【発明の属する技術分野】本発明は、シングルチップ・
マイクロコンピュータに関し、特に内蔵メモリあるいは
内蔵I/Oレジスタに対する不正アクセス検出機能を有
するシングルチップ・マイクロコンピュータに関する。BACKGROUND OF THE INVENTION 1. Field of the Invention
More particularly, the present invention relates to a single-chip microcomputer having a function of detecting unauthorized access to a built-in memory or a built-in I / O register.
【0002】[0002]
【従来の技術】RAMに対するメモリデータの保護をプ
ロセッサの暴走や故意の不正アクセスからの保護を確実
に行うことができるようにしたメモリ保護装置が、特開
平3−216746号公報に提案されている。すなわち
同公報には、データをワード単位で複数ワード分記憶す
るデータメモリの保護装置において、前記データメモリ
の各ワード毎の属性を1もしくは複数のワード単位で記
憶する属性メモリと、前記データメモリに対するデータ
アクセスに応じて前記属性メモリからアクセス先のデー
タワードに対応する属性を発生させるメモリ属性発生手
段と、前記データメモリに対するデータアクセスの種別
を示す属性を発生させるアクセス属性発生手段と、これ
らの発生手段により発生されたメモリ属性とアクセス属
性との組合わせにより前記データメモリに対するデータ
アクセスの実行を許可するか否かを判定する判定手段
と、を具備したメモリ保護装置が提案されている。2. Description of the Related Art Japanese Patent Application Laid-Open No. 3-216746 proposes a memory protection device capable of reliably protecting memory data in a RAM from runaway of a processor or intentional unauthorized access. . That is, the publication discloses a data memory protection device that stores data for a plurality of words in word units, an attribute memory that stores an attribute for each word of the data memory in one or a plurality of word units, Memory attribute generating means for generating an attribute corresponding to a data word to be accessed from the attribute memory in response to data access; access attribute generating means for generating an attribute indicating a type of data access to the data memory; There has been proposed a memory protection device comprising: a determination unit that determines whether to permit execution of data access to the data memory based on a combination of a memory attribute and an access attribute generated by the unit.
【0003】このメモリ保護装置においては、属性メモ
リにデータメモリの各ワード毎の属性として例えばデー
タの書込みを許可するか禁止するか、データの読出しを
許可するか禁止するか等の情報を1もしくは複数のワー
ド単位で記憶させる。[0003] In this memory protection device, information such as whether to permit or prohibit writing of data and whether to permit or prohibit reading of data is stored in the attribute memory as one or more attributes as attributes of each word of the data memory. Store in multiple word units.
【0004】こうすることにより、プロセッサからデー
タメモリに対するデータアクセスが行われると、メモリ
属性発生手段により上記属性メモリからアクセス先のデ
ータワードに対応する属性が発生されると同時に、アク
セス属性発生手段により当該データアクセスの種別を示
す属性が発生され、これらの属性の組合わせに基づいて
データアクセスの実行を許可するか否かが判定される。
従って、書換えを禁止するデータが記憶されたデ
ータメモリのデータワードに対応して書込みを禁止す
る属性を属性メモリに記憶させることにより、当残デー
タの保護を図るようにしたものである。Thus, when a data access is made from the processor to the data memory, an attribute corresponding to the data word of the access destination is generated from the attribute memory by the memory attribute generating means, and at the same time, the access attribute generating means generates the attribute. An attribute indicating the type of the data access is generated, and it is determined whether execution of the data access is permitted based on a combination of these attributes.
Therefore, data in which data that prohibits rewriting is stored.
The attribute which inhibits writing corresponding to the data word of the data memory is stored in the attribute memory to protect the remaining data.
【0005】[0005]
【発明が解決しようとする課題】しかしながら、上記従
来技術においては、ワード長の一定でないシングルチッ
プ・マイクロコンピュータの複数の内蔵I/Oレジスタ
のうちの1つに対して、不正ワード長でのアクセスに対
する保護ができないことである。However, in the above-mentioned prior art, an illegal word length is used to access one of a plurality of built-in I / O registers of a single-chip microcomputer having a variable word length. Cannot be protected against
【0006】その理由は、従来の技術においては、各ワ
ードが画一的な機能しか持たないメモリの保護のみを想
定しているため、固定長のワード単位でのメモリ属性の
判定手段しか持たず、アクセス時の有効ワード長に関す
る保護を考慮していない、ことによる。The reason is that, in the conventional technique, only protection of a memory in which each word has only a uniform function is assumed, and therefore, only a means for determining a memory attribute in units of fixed-length words is provided. This is because protection regarding the effective word length at the time of access is not considered.
【0007】したがって、本発明は、上記事情に鑑みて
なされたものであって、その目的は、ワード長が一定で
ないシングルチップ・マイクロコンピュータの複数のI
/Oレジスタのに対する不正ワード長でのアクセスに対
する保護を実現するシングルチップ・マイクロコンピュ
ータを提供することにある。SUMMARY OF THE INVENTION Accordingly, the present invention has been made in view of the above circumstances, and has as its object to provide a plurality of ICs of a single-chip microcomputer having a variable word length.
An object of the present invention is to provide a single-chip microcomputer which realizes protection against an access to an / O register with an illegal word length.
【0008】[0008]
【課題を解決するための手段】前記目的を達成するた
め、本発明のシングルチップ・マイクロンピュータは、
内蔵メモリおよび内蔵I/Oレジスタの各アクセス単位
毎のワード長情報を記憶するワード長管理用メモリと、
内蔵メモリあるいは内蔵I/Oレジスタに対するCPU
からのアクセスに応じてワード長管理用メモリと属性管
理用メモリからアクセス単位に対応するワード長情報と
リード/ライト属性を出力させるアクセス単位情報出力
手段と、CPUから内蔵メモリおよび内蔵I/Oレジス
タに対するアクセス・サイクルの有効ワード幅とリード
/ライト属性を発生させるCPUアクセス情報発生手段
と、アクセス単位情報出力手段により出力されたワード
長情報およびリード/ライト属性と前記CPUアクセス
情報発生手段により発生された有効ワード幅およびリー
ド/ライト情報との組み合わせを判定する不正アクセス
検出器と、不正アクセス検出器により出力される判定結
果に応じてCPUに割り込みを発生させるための割り込
み発生手段とを有する。In order to achieve the above-mentioned object, a single-chip microcomputer according to the present invention comprises:
A word length management memory for storing word length information for each access unit of the built-in memory and the built-in I / O register;
CPU for built-in memory or built-in I / O register
Access unit information output means for outputting word length information and read / write attributes corresponding to an access unit from a word length management memory and an attribute management memory in response to an access from the CPU, a built-in memory and a built-in I / O register from the CPU CPU access information generating means for generating an effective word width and a read / write attribute of an access cycle to the word, word length information and read / write attribute output by the access unit information output means, and CPU access information generating means. An unauthorized access detector for determining a combination of the effective word width and the read / write information, and an interrupt generating means for generating an interrupt for the CPU according to the determination result output from the unauthorized access detector.
【0009】本発明のシングルチップ・マイクロンピュ
ータの概要を以下に説明する。本発明においては、CP
Uが任意のワード長の内蔵I/Oレジスタにアクセスす
る場合において、アクセスしようとする内蔵I/Oレジ
スタのワード長とCPUの起動するアクセス・サイクル
の有効ワード幅が異なった際に、アクセス単位情報出力
手段が出力するワード長管理用メモリの出力データと、
CPUアクセス情報発生手段が出力する情報の組み合わ
せに基づき、検出手段が、不正アクセスを検出し、CP
Uに割り込みを発生させる。The outline of the single-chip microcomputer according to the present invention will be described below. In the present invention, the CP
When U accesses an internal I / O register having an arbitrary word length, if the word length of the internal I / O register to be accessed differs from the effective word width of an access cycle activated by the CPU, an access unit is determined. Output data of the word length management memory output by the information output means,
Based on a combination of information output by the CPU access information generating means, the detecting means detects an unauthorized access and
An interrupt is issued to U.
【0010】このため、本発明によれば、CPUは、不
正アクセスを検出時における割り込み処理によって、不
正アクセスによるシステムの暴走を防いだり、CPUの
プログラムの不具合を検出したりすることが可能にな
る。Therefore, according to the present invention, the CPU can prevent runaway of the system due to the unauthorized access and detect a defect in the program of the CPU by interrupt processing upon detection of the unauthorized access. .
【0011】[0011]
【発明の実施の形態】次に、本発明の実施の形態につい
て図面を参照して詳細に説明する。Next, embodiments of the present invention will be described in detail with reference to the drawings.
【0012】図1は、本発明の実施の形態の構成を示す
図である。図1を参照すると、本発明の実施の形態は、
CPU1に対してアドレス・バス2とデータ・バス3と
制御バス4とを介して、ワード長が一定でないI/Oレ
ジスタで構成されるI/Oレジスタ群5と、データ・メ
モリ8と、が接続される。さらに、アドレス・バス2と
データ・バス3には、ワード長管理用メモリ6と、属性
管理用メモリ7と、が接続され、ワード長管理用メモリ
6からのリード/ライト属性信号10と、属性管理用メ
モリ7からのアクセス単位信号11とが、不正アクセス
検出器9に入力される。FIG. 1 is a diagram showing a configuration of an embodiment of the present invention. Referring to FIG. 1, an embodiment of the present invention comprises:
An I / O register group 5 composed of I / O registers having an irregular word length and a data memory 8 are provided to the CPU 1 via an address bus 2, a data bus 3, and a control bus 4. Connected. Further, a word length management memory 6 and an attribute management memory 7 are connected to the address bus 2 and the data bus 3, and a read / write attribute signal 10 from the word length management memory 6 and an attribute The access unit signal 11 from the management memory 7 is input to the unauthorized access detector 9.
【0013】ワード長管理用メモリ6には、アドレス・
バス2の上でデータ・メモリ8とI/Oレジスタ群5に
割り振られた各アドレス毎のアクセス単位情報が、該ア
ドレスに1対1に対応する形で予め格納されている。The word length management memory 6 has an address
Access unit information for each address allocated to the data memory 8 and the I / O register group 5 on the bus 2 is stored in advance in such a manner as to correspond to the addresses on a one-to-one basis.
【0014】一方、属性管理用メモリ7には、アドレス
・バス2の上でデータ・メモリ8とI/Oレジスタ群5
に割り振られた各アドレス毎のリード/ライト属性に対
応する情報が、該アドレスに1対1に対応する形で予め
格納されている。On the other hand, the attribute management memory 7 has a data memory 8 and an I / O register group 5 on the address bus 2.
The information corresponding to the read / write attribute for each address assigned to each address is stored in advance in such a manner as to correspond one-to-one to the address.
【0015】不正アクセス検出器9には、CPU1から
のバス・アクセス状態信号13が入力され、不正アクセ
ス検出器9の出力である割り込み要求信号12は、CP
U1に入力される。A bus access status signal 13 from the CPU 1 is input to the unauthorized access detector 9, and an interrupt request signal 12 output from the unauthorized access detector 9 is
It is input to U1.
【0016】次に、本発明の実施の形態の動作につい
て、図1を参照して説明する。Next, the operation of the embodiment of the present invention will be described with reference to FIG.
【0017】CPU1が、I/Oレジスタ群5を構成す
るI/Oレジスタに対してアクセスをした場合、属性管
理用メモリ7は、アドレス・バス2上のI/Oレジスタ
のアドレスで指定される格納データを、出力(リード/
ライト属性信号)10に出力する。これらの格納データ
は、I/Oレジスタ群5を構成するI/Oレジスタのリ
ード/ライト属性である。When the CPU 1 accesses an I / O register constituting the I / O register group 5, the attribute management memory 7 is specified by the address of the I / O register on the address bus 2. Output stored data (read /
Write attribute signal) 10. These stored data are the read / write attributes of the I / O registers constituting the I / O register group 5.
【0018】一方、ワード長管理用メモリ6は、アドレ
ス・バス2上のI/Oレジスタのアドレスで指定される
格納データを、出力(アクセス単位信号)11に出力す
る。これらの格納データは、I/Oレジスタのアクセス
単位情報である。On the other hand, the word length management memory 6 outputs the storage data specified by the address of the I / O register on the address bus 2 to an output (access unit signal) 11. These stored data are access unit information of the I / O register.
【0019】そして、リード/ライト属性信号10とア
クセス単位信号11の組み合わせがバス・アクセス状態
信号13の状態と整合せず、不正アクセスの状態であっ
たとき、不正アクセス検出器9は、割り込み要求信号1
2をCPU1に対して出力する。CPU1は、この割り
込み要求信号12を受けて一連のプログラム実行を中断
し、割り込み処理が起動される。When the combination of the read / write attribute signal 10 and the access unit signal 11 does not match the state of the bus access state signal 13 and is in an unauthorized access state, the unauthorized access detector 9 Signal 1
2 is output to the CPU 1. Upon receiving the interrupt request signal 12, the CPU 1 suspends the execution of a series of programs, and the interrupt processing is started.
【0020】[0020]
【実施例】上記した本発明の実施の形態について更に詳
細に説明すべく、本発明の実施例を図面を参照して以下
に説明する。BRIEF DESCRIPTION OF THE DRAWINGS FIG. 1 is a block diagram showing an embodiment of the present invention;
【0021】図2は、本発明の一実施例の構成を示す図
である。図2を参照すると、本発明の一実施例において
は、16ビットCPU14に対して、アドレス・バス2
と、16ビット・データ・バス15と、制御バス4を介
して、8ビット長あるいは16ビット長の複数のI/O
レジスタで構成されるI/Oレジスタ群5と、16ビッ
ト入出力幅のデータ・メモリ8が接続されている。FIG. 2 is a diagram showing the configuration of one embodiment of the present invention. Referring to FIG. 2, in one embodiment of the present invention, the address bus 2
And a plurality of 8-bit or 16-bit I / Os via a 16-bit data bus 15 and a control bus 4.
An I / O register group 5 composed of registers and a data memory 8 having a 16-bit input / output width are connected.
【0022】さらに、アドレス・バス2と16ビット・
データ・バス15には、2ビット出力幅のワード長管理
用ROM(読み出し専用メモリ)16と、2ビット出力
幅の属性管理用ROM17と、が接続され、それぞれの
出力18、19が不正アクセス検出器9に入力される。Further, the address bus 2 and the 16-bit
The data bus 15 is connected to a word length management ROM (read only memory) 16 having a 2-bit output width and an attribute management ROM 17 having a 2-bit output width. Input to the container 9.
【0023】ワード長管理用ROM16には、アドレス
・バス2の上でデータ・メモリ8とI/Oレジスタ群5
とに割り振られた各アドレス毎の8ビット・アクセスの
可否情報、および16ビット・アクセスの可否情報がそ
れぞれ1ビットずつ、そのアドレスに1対1に対応する
形で予め格納されている。The word length management ROM 16 has a data memory 8 and an I / O register group 5 on an address bus 2.
The 8-bit access availability information and the 16-bit access availability information for each address allocated to each address are stored in advance in such a manner that each bit has a one-to-one correspondence with the address.
【0024】一方、属性管理用ROM17には、アドレ
ス・バス2の上でデータ・メモリ8とI/Oレジスタ群
5とに割り振られた各アドレス毎のリード可否の属性お
よびライト可否の属性に対応する情報がそれぞれ1ビッ
トずつ、そのアドレスに1対1に対応する形で予め格納
される。On the other hand, the attribute management ROM 17 has a read / write permission attribute and a write permission attribute for each address allocated to the data memory 8 and the I / O register group 5 on the address bus 2. The information to be stored is stored in advance in the form of one bit at a time corresponding to the address.
【0025】不正アクセス検出器9には制御バス4が接
続され、不正アクセス検出器9の出力である割り込み要
求信号12は16ビットCPU14に入力される。The control bus 4 is connected to the unauthorized access detector 9, and an interrupt request signal 12 output from the unauthorized access detector 9 is input to the 16-bit CPU 14.
【0026】図3は、本発明の一実施例における属性管
理用ROM17の接続構成を示したものである。図3を
参照すると、属性管理用ROM17には、アドレス・バ
ス2のほか、制御バス4を構成し、アドレス・バス2と
16ビット・データ・バス15の活性化状態を示すデー
タ・ストローブ信号20がOE(アウトプットイネーブ
ル)端子に接続され、リード可否属性信号21と、ライ
ト可否属性信号22と、が出力信号19(図2参照)に
出力される。FIG. 3 shows a connection configuration of the attribute management ROM 17 in one embodiment of the present invention. Referring to FIG. 3, the attribute management ROM 17 includes a control bus 4 in addition to the address bus 2, and a data strobe signal 20 indicating the activation state of the address bus 2 and the 16-bit data bus 15. Are connected to an OE (output enable) terminal, and a read enable / disable attribute signal 21 and a write enable / disable attribute signal 22 are output as an output signal 19 (see FIG. 2).
【0027】図4は、本発明の一実施例におけるワード
長管理用ROM16の接続構成を示したものである。図
4を参照すると、ワード長管理用ROM16にはアドレ
ス・バス2のほか、データ・ストローブ信号20がOE
端子に接続され、8ビット・アクセス可否情報信号23
と、16ビット・アクセス可否情報信号24とが出力信
号18(図2参照)に出力される。FIG. 4 shows a connection configuration of the word length management ROM 16 in one embodiment of the present invention. Referring to FIG. 4, in addition to the address bus 2, the data strobe signal 20 is stored in the ROM 16 for word length management.
8 bit access permission / inhibition information signal 23
And the 16-bit access permission / inhibition information signal 24 are output as the output signal 18 (see FIG. 2).
【0028】図5は、本発明の一実施例における不正ア
クセス検出器9の回路構成の一例を示す図である。図5
を参照すると、不正アクセス検出器9は、制御バス4か
ら、16ビットCPU14のアクセス・ワード幅である
8ビットあるいは16ビットのいずれかを1ビット情報
として示すアクセス幅信号25のほか、16ビット・デ
ータ・バス15のリード状態を示すリード・ストローブ
信号26と、ライト状態を示すライト・ストローブ信号
27と、データ・ストローブ信号20と、が入力されて
いる。FIG. 5 is a diagram showing an example of a circuit configuration of the unauthorized access detector 9 in one embodiment of the present invention. FIG.
, The unauthorized access detector 9 outputs, from the control bus 4, an access width signal 25 indicating, as 1-bit information, either 8 bits or 16 bits, which is the access word width of the 16-bit CPU 14, A read strobe signal 26 indicating a read state of the data bus 15, a write strobe signal 27 indicating a write state, and a data strobe signal 20 are input.
【0029】また、属性管理用ROM17から出力され
るリード可否属性信号21とライト可否属性信号22
と、ワード長管理用ROM16から出力される8ビット
・アクセス可否情報信号23と16ビット・アクセス可
否情報信号24とが入力され、16ビットCPU14に
対する割り込み要求信号12を出力する。The read enable / disable attribute signal 21 and the write enable / disable attribute signal 22 output from the attribute management ROM 17
And an 8-bit access permission / inhibition information signal 23 and a 16-bit access permission / inhibition information signal 24 output from the word length management ROM 16, and output an interrupt request signal 12 to the 16-bit CPU 14.
【0030】より詳細には、図5を参照して、不正アク
セス検出器9は、16ビットCPU14のアクセス・ワ
ード幅である8ビットあるいは16ビットのいずれかを
1ビット情報として示すアクセス幅信号25と8ビット
・アクセス可否情報信号23を入力とするANDゲート
AND1、アクセス幅信号25の反転信号と16ビット
・アクセス可否情報信号24とを入力とするANDゲー
トAND2、リード・ストローブ信号26とリード可否
属性信号21とを入力とするANDゲートAND3、ラ
イト・ストローブ信号27とライト可否属性信号22と
を入力とするANDゲートAND4、AND1、AND
2の出力を入力とするNORゲートNOR1、AND
3、AND4の出力を入力とするNORゲートNOR
2、NOR1、NOR2の出力を入力とするORゲート
ORを備え、ORゲートの出力はD型フリップフロップ
28のデータ入力端Dに入力され、D型フリップフロッ
プはデータストローブ信号20をクロック入力とし、出
力端QをCPU14に対する割り込み要求信号12に接
続している。More specifically, referring to FIG. 5, an unauthorized access detector 9 includes an access width signal 25 indicating, as 1-bit information, either 8 bits or 16 bits, which is the access word width of the 16-bit CPU 14. AND gate AND1 that receives an input of an access width signal 25 and an AND gate AND2 that receives an inverted signal of an access width signal 25 and a 16-bit access availability information signal 24, a read strobe signal 26 and a read availability. AND gate AND3 receiving the attribute signal 21 and AND gates AND4, AND1, AND receiving the write strobe signal 27 and the write enable / disable attribute signal 22 as inputs.
NOR gates NOR1 and AND having the output of 2 as input
3. NOR gate NOR having the output of AND4 as input
2, an OR gate OR having inputs of NOR1 and NOR2 as inputs, an output of the OR gate is input to a data input terminal D of a D-type flip-flop 28, and the D-type flip-flop receives a data strobe signal 20 as a clock input; The output terminal Q is connected to the interrupt request signal 12 for the CPU 14.
【0031】次に、本発明の実施例の動作について、図
2、図3、図4、及び図5を参照して詳細に説明する。Next, the operation of the embodiment of the present invention will be described in detail with reference to FIG. 2, FIG. 3, FIG. 4, and FIG.
【0032】16ビットCPU14が、I/Oレジスタ
群5を構成するリードおよびライト可能な8ビット長の
I/Oレジスタに対して、16ビット単位のライト・ア
クセスを行った場合、属性管理用ROM17は、アドレ
ス・バス2上の当該I/Oレジスタのアドレスで指定さ
れる2ビットの格納データを、データ・ストローブ信号
20に同期して、リード可否属性信号21とライト可否
属性信号22として出力する。これらの格納データとし
ては、当該I/Oレジスタのリード可否属性とライト可
否属性が予め格納されており、この場合、リード可否属
性信号21とライト可否属性信号22は、リード可能お
よびライト可能のステータス(状態)を示す。When the 16-bit CPU 14 performs a 16-bit write access to the readable and writable 8-bit I / O registers constituting the I / O register group 5, the attribute management ROM 17 Outputs 2-bit storage data specified by the address of the I / O register on the address bus 2 as a read enable / disable attribute signal 21 and a write enable / disable attribute signal 22 in synchronization with the data strobe signal 20. . As these stored data, the read enable / disable attribute and the write enable / disable attribute of the I / O register are stored in advance. In this case, the read enable / disable attribute signal 21 and the write enable / disable attribute signal 22 indicate the read enable / write enable status. (State).
【0033】一方、ワード長管理用ROM16は、アド
レス・バス2上の当該I/Oレジスタのアドレスで指定
される2ビットの格納データを、データ・ストローブ信
号20に同期して、8ビット・アクセス可否情報信号2
3と、16ビット・アクセス可否情報信号24として出
力する。これらの格納データとしては、当該I/Oレジ
スタの8ビット・アクセス可否情報と16ビット・アク
セス可否情報が予め格納されており、この場合、8ビッ
ト・アクセス可否情報信号23と、16ビット・アクセ
ス可否情報信号24は、8ビット・アクセスのみ可能の
ステータスを示す。On the other hand, the word length management ROM 16 accesses the 2-bit storage data specified by the address of the I / O register on the address bus 2 in synchronism with the data strobe signal 20 to perform 8-bit access. Availability information signal 2
3 and a 16-bit access availability information signal 24. As these stored data, 8-bit access permission / inhibition information and 16-bit access permission / inhibition information of the I / O register are stored in advance. In this case, an 8-bit access permission / inhibition information signal 23 and a 16-bit access permission signal are stored. The availability information signal 24 indicates a status in which only 8-bit access is possible.
【0034】このため、アクセス幅信号25(16ビッ
ト単位のアクセスを示している)と、8ビット・アクセ
ス可否信号23の状態と、が整合せず、不正アクセス検
出器9は、データ・ストローブ信号20に同期して割り
込み要求信号12を出力するため、16ビットCPU1
4は一連のプログラム実行を中断し、割り込み処理が起
動される。すなわち、アクセス信号25と8ビット・ア
クセス可能信号23とのAND出力は“0”となり、ア
クセス信号25の反転出力と16ビット・アクセス可能
信号24のAND出力も“0”となり、NORゲートN
OR1の出力が“1”となり、ORゲートを介してD型
フリップフロップ28に入力され、データ・ストローブ
信号20に同期して割り込み要求信号12が出力され
る。Therefore, the access width signal 25 (indicating an access in units of 16 bits) does not match the state of the 8-bit access permission signal 23, and the unauthorized access detector 9 outputs the data strobe signal In order to output the interrupt request signal 12 in synchronization with the
4 interrupts the execution of a series of programs, and interrupt processing is started. That is, the AND output of the access signal 25 and the 8-bit accessible signal 23 becomes "0", the inverted output of the access signal 25 and the AND output of the 16-bit accessible signal 24 become "0", and the NOR gate N
The output of OR1 becomes "1", is input to the D-type flip-flop 28 via the OR gate, and the interrupt request signal 12 is output in synchronization with the data strobe signal 20.
【0035】[0035]
【発明の効果】以上説明したように、本発明によれば、
シングルチップ・マイクロコンピュータに内蔵されるワ
ード長の一定でないI/Oレジスタに対する不正ワード
長でのアクセスの検出を可能とする、という効果を奏す
る。このため、本発明によれば、上記した従来方式より
も、より高い確度で、不正アクセスによるシステムの暴
走を防ぐと共に、CPUのプログラムの不具合を検出す
ることができるという利点を有する。As described above, according to the present invention,
This has the effect of making it possible to detect access to an I / O register with a variable word length built in a single-chip microcomputer with an incorrect word length. For this reason, according to the present invention, there is an advantage that the runaway of the system due to unauthorized access can be prevented with higher accuracy than that of the above-described conventional method, and a defect in the CPU program can be detected.
【0036】その理由は、本発明においては、各アクセ
ス単位毎のワード長情報を記憶するワード長管理用メモ
リと各アドレス毎のアクセス単位情報を格納するワード
長管理用メモリを備え、CPUがI/Oレジスタにアク
セスするとき、ワード長管理用メモリを示すI/Oレジ
スタのワード長と、CPUの起動するアクセス・サイク
ルの有効ワード幅が異なった場合に不正アクセスを検出
し、CPUに割り込みを発生させるようにしたことによ
る。The reason is that, in the present invention, a word length management memory for storing word length information for each access unit and a word length management memory for storing access unit information for each address are provided. When accessing the / O register, if the word length of the I / O register indicating the word length management memory is different from the effective word width of the access cycle activated by the CPU, an illegal access is detected and an interrupt is issued to the CPU. It depends on what was made to occur.
【図1】本発明の一実施の形態の構成を示すブロック図
である。FIG. 1 is a block diagram showing a configuration of an embodiment of the present invention.
【図2】本発明の一実施例の構成を示すブロック図であ
る。FIG. 2 is a block diagram showing a configuration of one embodiment of the present invention.
【図3】本発明の一実施例における属性管理用メモリ
(ROM)の接続構成を示すブロック図である。FIG. 3 is a block diagram showing a connection configuration of an attribute management memory (ROM) in one embodiment of the present invention.
【図4】本発明の一実施例におけるワード長管理用メモ
リ(ROM)の接続構成を示すブロック図である。FIG. 4 is a block diagram showing a connection configuration of a word length management memory (ROM) in one embodiment of the present invention.
【図5】本発明の一実施例における不正アクセス検出器
の構成を示すブロック図である。FIG. 5 is a block diagram showing a configuration of an unauthorized access detector in one embodiment of the present invention.
1 CPU 2 アドレス・バス 3 データ・バス 4 制御バス 5 I/Oレジスタ群 6 ワード長管理用メモリ 7 属性管理メモリ 8 データ・メモリ 9 不正アクセス検出器 10 出力 11 出力 12 割り込み要求信号 13 アクセス状態信号 14 16ビットCPU 15 16ビット・データ・バス 16 ワード長管理用ROM 17 属性管理用ROM 18 出力 19 出力 20 データ・ストローブ信号 21 リード可否属性信号 22 ライト可否属性信号 23 8ビット・アクセス可否信号 24 16ビット・アクセス可否信号 25 アクセス幅信号 26 リード・ストローブ信号 27 ライト・ストローブ信号 DESCRIPTION OF SYMBOLS 1 CPU 2 Address bus 3 Data bus 4 Control bus 5 I / O register group 6 Word length management memory 7 Attribute management memory 8 Data memory 9 Unauthorized access detector 10 Output 11 Output 12 Interrupt request signal 13 Access status signal 14 16-bit CPU 15 16-bit data bus 16 Word length management ROM 17 Attribute management ROM 18 Output 19 Output 20 Data strobe signal 21 Read enable / disable attribute signal 22 Write enable / disable attribute signal 23 8-bit access enable / disable signal 24 16 Bit access enable / disable signal 25 Access width signal 26 Read strobe signal 27 Write strobe signal
Claims (5)
ータ・メモリと、I/Oレジスタと、を少なくとも有す
るシングルチップ・マイクロコンピュータにおいて、 前記データ・メモリ及び前記I/Oレジスタの各アクセ
ス単位毎のワード長情報を記憶するワード長管理用メモ
リと、 各アクセス単位のリード/ライト属性を記憶する属性管
理用メモリと、 前記データ・メモリ又は前記I/Oレジスタに対する前
記CPUからのアクセスに応じて、前記ワード長管理用
メモリと、前記属性管理用メモリと、から、前記アクセ
ス単位に対応するワード長情報と、リード/ライト属性
と、をそれぞれ出力させるアクセス単位情報出力手段
と、 前記CPUから前記データ・メモリおよび前記I/Oレ
ジスタに対するアクセス・サイクルの有効ワード幅と、
リード/ライト属性と、を発生させるCPUアクセス情
報発生手段と、 前記アクセス単位情報出力手段により出力されたワード
長情報およびリード/ライト属性と、前記CPUアクセ
ス情報発生手段により発生された有効ワード幅およびリ
ード/ライト情報との組み合わせを判定する不正アクセ
ス検出手段と、 前記不正アクセス検出手段により出力される判定結果に
応じて、前記CPUに割り込みを発生させるための割り
込み発生手段と、 を具備したことを特徴とするシングルチップ・マイクロ
コンピュータ。1. A single-chip microcomputer having at least a CPU, a data memory, and an I / O register on a single semiconductor pellet, wherein each of the data memory and the I / O register is accessed. A word length management memory that stores word length information for each unit; an attribute management memory that stores read / write attributes of each access unit; and an access from the CPU to the data memory or the I / O register. Responsively, access unit information output means for outputting word length information corresponding to the access unit and read / write attribute from the word length management memory and the attribute management memory; From the valid word of the access cycle to the data memory and the I / O register Width and
CPU access information generating means for generating a read / write attribute; word length information and read / write attribute output by the access unit information output means; an effective word width generated by the CPU access information generating means; Unauthorized access detection means for determining a combination with read / write information; and interrupt generation means for causing the CPU to generate an interrupt in accordance with a determination result output by the unauthorized access detection means. Features a single-chip microcomputer.
ジスタからなるI/Oレジスタ群の各アドレス毎のアク
セス単位情報を格納するワード長管理用メモリを備え、
さらに、 CPUが前記I/Oレジスタ群の一のI/Oレジスタに
アクセスする際、前記ワード長管理用メモリがアクセス
され、前記ワード長管理用メモリから出力される前記I
/Oレジスタに対応するワード長情報と、前記CPUが
起動するアクセス・サイクルのアクセス情報である有効
ワード幅とが異なった場合に、不正アクセスとして検出
し、前記CPUに割り込みを発生させる手段を備えたこ
とを特徴とするシングルチップ・マイクロコンピュー
タ。2. A word length management memory for storing access unit information for each address of an I / O register group including a plurality of I / O registers to which addresses are assigned,
Further, when the CPU accesses one of the I / O registers of the I / O register group, the word length management memory is accessed and the I / O register output from the word length management memory is accessed.
When the word length information corresponding to the / O register is different from the effective word width which is the access information of the access cycle activated by the CPU, means for detecting an illegal access and generating an interrupt to the CPU is provided. A single-chip microcomputer.
ード/ライト可否情報を格納する属性管理用メモリを備
え、 前記CPUが前記I/Oレジスタをアクセスする際に、
前記属性管理用メモリがアクセスされ、前記属性管理用
メモリから出力される前記I/Oレジスタに対応するリ
ード/ライト可否情報と、前記ワード長管理用メモリか
ら出力される前記I/Oレジスタに対応するワード長情
報と、さらに前記CPUからのアクセス情報との組合せ
から不正アクセスを検出する、ことを特徴とする請求項
2記載のシングルチップ・マイクロコンピュータ。3. An attribute management memory for storing read / write availability information for each address of the I / O register group, wherein the CPU accesses the I / O register when the CPU accesses the I / O register.
The attribute management memory is accessed, and read / write availability information corresponding to the I / O register output from the attribute management memory and corresponding to the I / O register output from the word length management memory. 3. The single-chip microcomputer according to claim 2, wherein an unauthorized access is detected from a combination of word length information to be accessed and access information from the CPU.
情報を格納するワード長管理用メモリを備え、さらに、 CPUが前記データメモリをアクセスする際、前記ワー
ド長管理用メモリがアクセスされ、前記ワード長管理用
メモリから出力される前記データメモリのワード長情報
と、前記CPUが起動するアクセス・サイクルのアクセ
ス情報である有効ワード幅とが異なった場合に、不正ア
クセスとして検出し、前記CPUに割り込みを発生させ
る手段を備えたことを特徴とするシングルチップ・マイ
クロコンピュータ。4. A word length management memory for storing access unit information for each address of a data memory, further comprising: when the CPU accesses the data memory, the word length management memory is accessed; If the word length information of the data memory output from the management memory is different from the effective word width which is the access information of the access cycle activated by the CPU, it is detected as an illegal access, and an interrupt is issued to the CPU. A single-chip microcomputer comprising means for generating.
/ライト可否情報を格納する属性管理用メモリを備え、 前記CPUが前記データメモリをアクセスする際に前記
属性管理用メモリがアクセスされ、前記属性管理用メモ
リから出力されるリード/ライト可否情報と、前記ワー
ド長管理用メモリから出力される前記データメモリに対
応するワード長情報と、さらに前記CPUからのアクセ
ス情報との組合せから不正アクセスを検出する、ことを
特徴とする請求項4記載のシングルチップ・マイクロコ
ンピュータ。5. An attribute management memory for storing read / write enable / disable information for each address of said data memory, wherein said attribute management memory is accessed when said CPU accesses said data memory, Unauthorized access is detected from a combination of read / write permission information output from the management memory, word length information corresponding to the data memory output from the word length management memory, and access information from the CPU. The single-chip microcomputer according to claim 4, wherein
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP8342549A JP3047839B2 (en) | 1996-12-06 | 1996-12-06 | Single-chip microcomputer |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
JP8342549A JP3047839B2 (en) | 1996-12-06 | 1996-12-06 | Single-chip microcomputer |
Publications (2)
Publication Number | Publication Date |
---|---|
JPH10171715A JPH10171715A (en) | 1998-06-26 |
JP3047839B2 true JP3047839B2 (en) | 2000-06-05 |
Family
ID=18354616
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
JP8342549A Expired - Fee Related JP3047839B2 (en) | 1996-12-06 | 1996-12-06 | Single-chip microcomputer |
Country Status (1)
Country | Link |
---|---|
JP (1) | JP3047839B2 (en) |
-
1996
- 1996-12-06 JP JP8342549A patent/JP3047839B2/en not_active Expired - Fee Related
Also Published As
Publication number | Publication date |
---|---|
JPH10171715A (en) | 1998-06-26 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US7366849B2 (en) | Protected configuration space in a protected environment | |
US6226732B1 (en) | Memory system architecture | |
US5305460A (en) | Data processor | |
US6397301B1 (en) | Preventing access to secure area of a cache | |
US5606662A (en) | Auto DRAM parity enable/disable mechanism | |
US20050086517A1 (en) | Page granular curtained memory via mapping control | |
KR0138697B1 (en) | Microcomputer | |
US5497458A (en) | Cache testability circuit for embedded diagnostics | |
JPS6237419B2 (en) | ||
US20020166034A1 (en) | Protection circuit for preventing unauthorized access to the memory device of a processor | |
EP0142819B1 (en) | Access control system for storage having hardware area and software area | |
JP3047839B2 (en) | Single-chip microcomputer | |
EP1842135B1 (en) | Generic low cost hardware mechanism for memory protection | |
JP3082701B2 (en) | Memory protection device and memory protection method | |
JPS6074059A (en) | Storage device access control method | |
JPS62160554A (en) | Device for preventing wrong access to memory | |
JPS6250863B2 (en) | ||
EP0350917A2 (en) | Personal computer system capable of preventing contention in memory address space | |
JPH10240623A (en) | Micro computer with read protection function | |
JPH01201751A (en) | Memory protecting device | |
JP2944080B2 (en) | Memory content protection circuit | |
JPH11238016A (en) | Method and device for memory protection | |
JPS60142452A (en) | Memory protection method | |
JPS60246450A (en) | Memory protecting device | |
JPH0744463A (en) | One-chip microcomputer incorporating eeprom |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
A01 | Written decision to grant a patent or to grant a registration (utility model) |
Free format text: JAPANESE INTERMEDIATE CODE: A01 Effective date: 20000222 |
|
FPAY | Renewal fee payment (event date is renewal date of database) |
Free format text: PAYMENT UNTIL: 20080324 Year of fee payment: 8 |
|
FPAY | Renewal fee payment (event date is renewal date of database) |
Free format text: PAYMENT UNTIL: 20090324 Year of fee payment: 9 |
|
FPAY | Renewal fee payment (event date is renewal date of database) |
Free format text: PAYMENT UNTIL: 20100324 Year of fee payment: 10 |
|
FPAY | Renewal fee payment (event date is renewal date of database) |
Free format text: PAYMENT UNTIL: 20100324 Year of fee payment: 10 |
|
FPAY | Renewal fee payment (event date is renewal date of database) |
Free format text: PAYMENT UNTIL: 20110324 Year of fee payment: 11 |
|
FPAY | Renewal fee payment (event date is renewal date of database) |
Free format text: PAYMENT UNTIL: 20110324 Year of fee payment: 11 |
|
S533 | Written request for registration of change of name |
Free format text: JAPANESE INTERMEDIATE CODE: R313533 |
|
FPAY | Renewal fee payment (event date is renewal date of database) |
Free format text: PAYMENT UNTIL: 20110324 Year of fee payment: 11 |
|
R350 | Written notification of registration of transfer |
Free format text: JAPANESE INTERMEDIATE CODE: R350 |
|
FPAY | Renewal fee payment (event date is renewal date of database) |
Free format text: PAYMENT UNTIL: 20110324 Year of fee payment: 11 |
|
FPAY | Renewal fee payment (event date is renewal date of database) |
Free format text: PAYMENT UNTIL: 20120324 Year of fee payment: 12 |
|
FPAY | Renewal fee payment (event date is renewal date of database) |
Free format text: PAYMENT UNTIL: 20130324 Year of fee payment: 13 |
|
FPAY | Renewal fee payment (event date is renewal date of database) |
Free format text: PAYMENT UNTIL: 20130324 Year of fee payment: 13 |
|
FPAY | Renewal fee payment (event date is renewal date of database) |
Free format text: PAYMENT UNTIL: 20140324 Year of fee payment: 14 |
|
LAPS | Cancellation because of no payment of annual fees |