JP2015035155A - Information processor - Google Patents

Information processor Download PDF

Info

Publication number
JP2015035155A
JP2015035155A JP2013166466A JP2013166466A JP2015035155A JP 2015035155 A JP2015035155 A JP 2015035155A JP 2013166466 A JP2013166466 A JP 2013166466A JP 2013166466 A JP2013166466 A JP 2013166466A JP 2015035155 A JP2015035155 A JP 2015035155A
Authority
JP
Japan
Prior art keywords
cpu
information processing
access
processing apparatus
peripheral devices
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
JP2013166466A
Other languages
Japanese (ja)
Inventor
高田 広章
Hiroaki Takada
広章 高田
晋也 本田
Shinya Honda
晋也 本田
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.)
Nagoya University NUC
Renesas Electronics Corp
Original Assignee
Nagoya University NUC
Renesas Electronics 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 Nagoya University NUC, Renesas Electronics Corp filed Critical Nagoya University NUC
Priority to JP2013166466A priority Critical patent/JP2015035155A/en
Publication of JP2015035155A publication Critical patent/JP2015035155A/en
Pending legal-status Critical Current

Links

Images

Abstract

PROBLEM TO BE SOLVED: To achieve access protection by a peripheral device unit.SOLUTION: An information processor 100 includes: a memory protection unit 11; and an access control part 20. The address space of a CPU 10 includes a plurality I/O alias address ranges, and a plurality of peripheral devices D1 to Dn disposed in the information processor 100 are mapped for each I/O alias address range. The memory protection unit 11 sets an access permission area for permitting access from the CPU 10 in the address space. The access control part 20 switches whether the access from the CPU is valid or invalid for each of the peripheral devices D1 to Dn according to which I/O alias address range among the plurality of I/O alias address ranges is accessed by the CPU 10.

Description

この発明は、メモリ保護ユニットを用いてメモリおよび周辺デバイスへのアクセスを制限する情報処理装置に関する。   The present invention relates to an information processing apparatus that restricts access to a memory and peripheral devices using a memory protection unit.

組込みソフトウェアの大規模化に伴い、各機能を安全に動作させるために組込みシステムにおいてもメモリ保護の必要性が高まっている。メモリ保護とは、組込みソフトウェアを構成するアプリケーションソフトウェアごとにアクセス可能なメモリおよび周辺デバイスを制限することである。   As the scale of embedded software increases, the need for memory protection is increasing in embedded systems in order to operate each function safely. Memory protection is to limit the accessible memory and peripheral devices for each application software constituting the embedded software.

組込みシステムでは、メモリ保護ユニット(MPU:Memory Protection Unit)と呼ばれるハードウェアによってメモリ保護を実現することが多い。MPUはアドレス空間に複数の領域を設定し、その領域毎にアクセス権を与える(MPUの概要は、たとえば、下記の非特許文献1,2を参照)。   In embedded systems, memory protection is often realized by hardware called a memory protection unit (MPU). The MPU sets a plurality of areas in the address space and gives an access right for each area (for example, refer to the following non-patent documents 1 and 2 for an overview of the MPU).

ルネサスエレクトロニクス、「V850E2Mマイクロプロセッサ・コア ユーザーズマニュアル アーキテクチャ編」、第3編 第6章 メモリ保護、Rev.1.00、2010年10月Renesas Electronics, “V850E2M Microprocessor Core User's Manual Architecture”, Volume 3 Chapter 6 Memory Protection, Rev.1.00, October 2010 ARM, "Cortex-M3 Revision r2p1 Technical Reference Manual", Chap.5 Memory Protection UnitARM, "Cortex-M3 Revision r2p1 Technical Reference Manual", Chap.5 Memory Protection Unit

MPUによって設定できる領域の数には上限があり、通常は10個以下である。このため、一般的なOSとアプリケーションプログラムとを動作させると、メモリの保護のために多数の領域を使用してしまい、周辺デバイスの保護に使用可能な領域の数が不足する。この結果、各周辺デバイス単位でのアクセス保護が実現できないという問題が生じる。   There is an upper limit to the number of areas that can be set by the MPU, and is usually 10 or less. For this reason, when a general OS and an application program are operated, a large number of areas are used for memory protection, and the number of areas usable for protection of peripheral devices is insufficient. As a result, there arises a problem that access protection for each peripheral device cannot be realized.

その他の課題と新規な特徴は、本明細書の記述および添付図面から明らかになるであろう。   Other problems and novel features will become apparent from the description of the specification and the accompanying drawings.

一実施の形態による情報処理装置は、メモリ保護ユニットとアクセス制御部とを備える。CPUのアドレス空間は複数のI/Oエイリアスアドレス範囲を含み、各I/Oエイリアスアドレス範囲ごとに情報処理装置に設けられた複数の周辺デバイスがマッピングされている。メモリ保護ユニットは、CPUからのアクセスを許可するアクセス許可領域をアドレス空間内に設定する。アクセス制御部は、上記の複数のI/Oエイリアスアドレス範囲のうちどのI/Oエイリアスアドレス範囲がCPUによってアクセスされているかに応じて、CPUからのアクセスが有効か無効かを周辺デバイスごとに切り替える。   An information processing apparatus according to an embodiment includes a memory protection unit and an access control unit. The CPU address space includes a plurality of I / O alias address ranges, and a plurality of peripheral devices provided in the information processing apparatus are mapped for each I / O alias address range. The memory protection unit sets an access permission area for permitting access from the CPU in the address space. The access control unit switches whether the access from the CPU is valid or invalid for each peripheral device according to which I / O alias address range of the plurality of I / O alias address ranges is accessed by the CPU. .

上記の一実施の形態の情報処理装置によれば、周辺デバイス単位でのアクセス保護が実現できる。   According to the information processing apparatus of the above-described embodiment, access protection in units of peripheral devices can be realized.

実施の形態1による情報処理装置の構成を概略的に示すブロック図である。1 is a block diagram schematically showing a configuration of an information processing device according to a first embodiment. CPUのアドレス空間の一例を示す図である。It is a figure which shows an example of the address space of CPU. 周辺デバイスのアドレスマッピングをより詳細に示す図である。It is a figure which shows the address mapping of a peripheral device in detail. 実施の形態1の情報処理装置において、どのアプリケーションソフトウェアの実行時にどの周辺デバイスがアクセス可能になるように設定されるかを表形式で示す図である。FIG. 3 is a diagram showing, in a table format, which peripheral devices are set to be accessible when executing which application software in the information processing apparatus according to the first embodiment. アプリケーションソフトウェア1の動作時において、MPUによる領域設定について説明するための図である。It is a figure for demonstrating the area | region setting by MPU at the time of operation | movement of the application software 1. FIG. アプリケーションソフトウェア1の動作時において、アクセス制御部の動作について説明するための図である。It is a figure for demonstrating operation | movement of an access control part at the time of operation | movement of the application software. アプリケーションソフトウェア2の動作時において、MPUによる領域設定について説明するための図である。It is a figure for demonstrating the area | region setting by MPU at the time of operation | movement of the application software 2. FIG. アプリケーションソフトウェア2の動作時において、アクセス制御部の動作について説明するための図である。It is a figure for demonstrating operation | movement of an access control part at the time of operation | movement of the application software. 比較例の情報処理装置において、どのアプリケーションソフトウェアの実行時にどの周辺デバイスがアクセス可能になるように設定されるかを表形式で示す図である。It is a figure which shows which peripheral device is set so that it becomes accessible at the time of execution of which application software in the information processing apparatus of a comparative example. 比較例の情報処理装置の場合のアプリケーションソフトウェア1の動作時において、MPUによる領域設定について説明するための図である。It is a figure for demonstrating the area | region setting by MPU at the time of operation | movement of the application software 1 in the information processing apparatus of a comparative example. 比較例の情報処理装置の場合のアプリケーションソフトウェア2の動作時において、MPUによる領域設定について説明するための図である。It is a figure for demonstrating the area | region setting by MPU at the time of operation | movement of the application software 2 in the information processing apparatus of a comparative example. 実施の形態2による情報処理装置の構成を示すブロック図である。6 is a block diagram illustrating a configuration of an information processing device according to Embodiment 2. FIG. 実施の形態2の情報処理装置において、どのアプリケーションソフトウェアの実行時にどの周辺デバイスがアクセス可能になるように設定されるかを表形式で示す図である。FIG. 10 is a diagram showing, in a tabular form, which peripheral devices are set to be accessible when executing which application software in the information processing apparatus according to the second embodiment. 図13の設定例における情報処理装置の動作を説明するための図である。It is a figure for demonstrating operation | movement of the information processing apparatus in the setting example of FIG. 実施の形態3による情報処理装置の構成を示すブロック図である。FIG. 10 is a block diagram illustrating a configuration of an information processing device according to a third embodiment.

以下、各実施の形態について図面を参照して詳しく説明する。なお、同一または相当する部分には同一の参照符号を付して、その説明を繰返さない。   Hereinafter, each embodiment will be described in detail with reference to the drawings. The same or corresponding parts are denoted by the same reference numerals, and description thereof will not be repeated.

<実施の形態1>
[情報処理装置の構成]
図1は、実施の形態1による情報処理装置の構成を概略的に示すブロック図である。
<Embodiment 1>
[Configuration of information processing device]
FIG. 1 is a block diagram schematically showing the configuration of the information processing apparatus according to the first embodiment.

図1を参照して、情報処理装置100は、組込みシステムなどのコンピュータシステムとして構成される。情報処理装置100は、中央処理装置(CPU:Central Processing Unit)10と、フラッシュメモリ12と、DRAM(Dynamic Random Access Memory)13と、n個の周辺デバイス1〜n(D1〜Dn)と、メモリ保護ユニット(MPU:Memory Protection Unit)11と、アクセス制御部20と、バス14とを含む。図1に示すように、情報処理装置100を構成する各要素は、共通のバス14を介して相互に接続されている。   Referring to FIG. 1, information processing apparatus 100 is configured as a computer system such as an embedded system. The information processing apparatus 100 includes a central processing unit (CPU) 10, a flash memory 12, a DRAM (Dynamic Random Access Memory) 13, n peripheral devices 1 to n (D1 to Dn), a memory A protection unit (MPU: Memory Protection Unit) 11, an access control unit 20, and a bus 14 are included. As shown in FIG. 1, the elements constituting the information processing apparatus 100 are connected to each other via a common bus 14.

CPU10は、情報処理装置全体の制御処理および演算処理を行う。この実施の形態では、CPU10が扱えるデータのビット数を32ビットとする。CPU10は、バス14を介して、フラッシュメモリ12、DRAM13、および周辺デバイス1〜n(D1〜Dn)と接続され、これらのメモリおよび各周辺デバイスにアクセスする。   The CPU 10 performs control processing and arithmetic processing for the entire information processing apparatus. In this embodiment, the number of bits of data that can be handled by the CPU 10 is 32 bits. The CPU 10 is connected to the flash memory 12, the DRAM 13, and the peripheral devices 1 to n (D1 to Dn) via the bus 14, and accesses these memories and the peripheral devices.

フラッシュメモリ12は、ROM(Read Only Memory)および外部記憶装置として用いられる。フラッシュメモリ12には、OS(Operating System)および複数のアプリケーションプログラムが予め格納されている。DRAM13は主記憶装置として用いられ、実行時に必要なプログラムがフラッシュメモリ12から呼び出される。なお、図1には図示されていないが、情報処理装置100は、プロセッサ内蔵メモリなど、その他のメモリを有していてもよい。   The flash memory 12 is used as a ROM (Read Only Memory) and an external storage device. The flash memory 12 stores an OS (Operating System) and a plurality of application programs in advance. The DRAM 13 is used as a main storage device, and a program necessary for execution is called from the flash memory 12. Although not illustrated in FIG. 1, the information processing apparatus 100 may include other memories such as a processor built-in memory.

周辺デバイス1〜n(D1〜Dn)は、たとえば、タイマ、シリアル通信インターフェイス、DMA(Direct Memory Access)コントローラ、割り込みコントローラ、汎用入出力ポート、および表示コントローラなどにそれぞれ対応する。この明細書では、周辺デバイスを単にデバイスと記載する場合ある。   The peripheral devices 1 to n (D1 to Dn) correspond to, for example, a timer, a serial communication interface, a DMA (Direct Memory Access) controller, an interrupt controller, a general-purpose input / output port, and a display controller. In this specification, the peripheral device may be simply referred to as a device.

MPU11は、メモリ保護に特化したハードウェアである。組込みシステムでは、メモリ管理ユニット(MMU:Memory Management Unit)を用いた仮想記憶によってメモリ保護を実現するのではなく、MPUによってメモリ保護が実現される場合が多い。   The MPU 11 is hardware specialized for memory protection. In embedded systems, memory protection is often realized by MPU rather than by virtual storage using a memory management unit (MMU).

具体的に、MPU11は、CPU10のアドレス空間内に複数の領域(アクセス許可領域とも称する)を指定し、その領域毎にアクセス権(リード/ライト)を与えることができる。リード/ライトの一方のみが許可される場合もあるし、両方とも許可される場合もある。領域の指定はアドレスの上限と下限を指定する方法が一般的であるが、開始アドレスとサイズを指定することもある。作成可能な領域の数には上限があり一般的には10枚以下である。これは、領域の数を増やすと、コンパレータが多くなるために、回路面積が大きくなるばかりか、遅延が発生するためである。   Specifically, the MPU 11 can designate a plurality of areas (also referred to as access permission areas) in the address space of the CPU 10 and can give an access right (read / write) for each area. Only one of read / write may be permitted, or both may be permitted. In general, the area is specified by specifying an upper limit and a lower limit of the address, but a start address and a size may be specified. There is an upper limit to the number of regions that can be created, and generally no more than ten. This is because when the number of regions is increased, the number of comparators increases, so that not only the circuit area increases but also a delay occurs.

[デバイスアクセス保護について]
次に実施の形態1による情報処理装置100において、周辺デバイスのアクセス保護の特徴について説明する。情報処理装置100は、以下の特徴を有している。
[About device access protection]
Next, features of access protection for peripheral devices in the information processing apparatus 100 according to the first embodiment will be described. The information processing apparatus 100 has the following features.

(1) 周辺デバイスへのデータ入出力のためにアドレス空間内に複数のアドレス範囲(以下、I/O(Input/Output)エイリアスアドレス範囲と称する)が設けられる。周辺デバイス1〜n(D1〜Dn)は、各I/Oエイリアスアドレス範囲ごとにマッピングされる。   (1) A plurality of address ranges (hereinafter referred to as I / O (Input / Output) alias address ranges) are provided in the address space for data input / output to / from peripheral devices. Peripheral devices 1 to n (D1 to Dn) are mapped for each I / O alias address range.

(2) メモリ保護ユニット(MPU)を有するプロセッサ(CPU)が用いられる。好ましくは、MPUによって複数のI/Oエイリアスアドレス範囲のうちいずれか1つのアクセスが許可される。   (2) A processor (CPU) having a memory protection unit (MPU) is used. Preferably, any one of a plurality of I / O alias address ranges is permitted by the MPU.

(3) 複数のI/Oエイリアスアドレス範囲のうちどのI/Oエイリアスアドレス範囲がアクセスされたかに応じて、各周辺デバイスに対するアクセスを有効または無効に切り替えるための機構(アクセス制御部)が設けられる。以下、各特徴について詳しく説明する。   (3) A mechanism (access control unit) is provided for switching access to each peripheral device to be valid or invalid according to which I / O alias address range is accessed among a plurality of I / O alias address ranges. . Hereinafter, each feature will be described in detail.

(1.周辺デバイスのマッピング方式)
図2は、CPU10のアドレス空間の一例を示す図である。
(1. Peripheral device mapping method)
FIG. 2 is a diagram illustrating an example of the address space of the CPU 10.

図2に示す例では、4GB(ギガバイト)のアドレス空間(0x00000000〜0xFFFFFFFF)のうち、フラッシュメモリ12が0x00000000〜0x0FFFFFFFにマッピングされ、DRAM13が0x10000000〜0x1FFFFFFFにマッピングされる。なお、アドレスが16進数であることを明示するためにアドレスの先頭に“0x”が付加されている。   In the example shown in FIG. 2, in the 4 GB (gigabyte) address space (0x0000000 to 0xFFFFFFFF), the flash memory 12 is mapped to 0x0000000 to 0x0FFFFFFF and the DRAM 13 is mapped to 0x1000000 to 0x1FFFFFFF. Note that “0x” is added to the head of the address to clearly indicate that the address is a hexadecimal number.

この実施の形態では、各周辺デバイスにデータを入出力する方式として、メモリマップトI/Oが用いられる。メモリマップトI/Oでは、アドレス空間内にメモリと周辺デバイスとが共存し、メモリのリード/ライト命令が各周辺デバイスにも用いられる。具体的に図2の例では、周辺デバイス1〜n(D1〜Dn)が0x20000000〜0x2FFFFFFFにマッピングされている。   In this embodiment, a memory mapped I / O is used as a method for inputting / outputting data to / from each peripheral device. In memory-mapped I / O, a memory and a peripheral device coexist in the address space, and a memory read / write command is also used for each peripheral device. Specifically, in the example of FIG. 2, the peripheral devices 1 to n (D1 to Dn) are mapped to 0x20000000 to 0x2FFFFFFF.

図3は、周辺デバイスのアドレスマッピングをより詳細に示す図である。
図3を参照して、CPU10のアドレス空間には、周辺デバイス1〜n(D1〜Dn)をアクセスするために複数のアドレス範囲(I/Oエイリアスアドレス範囲1,2,3,…)が設けられる。周辺デバイス1〜n(D1〜Dn)は、各I/Oエイリアスアドレス範囲ごとにマッピングされている。たとえば、図3に示すように、デバイス1は、I/Oエイリアスアドレス範囲1のうちアドレス範囲0x20010000〜0x20010FFFにマッピングされるとともに、I/Oエイリアスアドレス範囲2のうちアドレス範囲0x20020000〜0x20020FFFにマッピングされている。デバイス1は、さらに、I/Oエイリアスアドレス範囲3のうちアドレス範囲0x20030000〜0x20030FFFにマッピングされている。他のデバイス2,3,…についても同様である。
FIG. 3 is a diagram showing the address mapping of peripheral devices in more detail.
Referring to FIG. 3, the address space of CPU 10 is provided with a plurality of address ranges (I / O alias address ranges 1, 2, 3,...) For accessing peripheral devices 1 to n (D1 to Dn). It is done. Peripheral devices 1 to n (D1 to Dn) are mapped for each I / O alias address range. For example, as shown in FIG. 3, the device 1 is mapped to the address range 0x20010000 to 0x20010FFF in the I / O alias address range 1 and is mapped to the address range 0x20000000 to 0x20020FFF in the I / O alias address range 2. ing. The device 1 is further mapped to the address range 0x20030000 to 0x20030FFF in the I / O alias address range 3. The same applies to the other devices 2, 3,.

(2.MPUによる保護領域の設定)
上記の各I/Oエイリアスアドレス範囲は、各アプリケーションソフトウェアに個別に対応する。たとえば、I/Oエイリアスアドレス範囲1,2,3…は、アプリケーションソフトウェア1,2,3にそれぞれ対応する。MPUは、動作中のアプリケーションソフトウェアに対応するI/Oエイリアスアドレス範囲をアクセス許可領域に指定する。したがって、図3のI/Oエイリアスアドレス範囲はアプリケーションソフトウェアの個数分必要になる。なお、MPUによる保護領域の切替えは、動作させるアプリケーションソフトウェアの切替時にOSなどのシステムソフトウェアによって実行される。
(2. Protection area setting by MPU)
Each of the above I / O alias address ranges individually corresponds to each application software. For example, the I / O alias address ranges 1, 2, 3,... Correspond to the application software 1, 2, 3, respectively. The MPU designates an I / O alias address range corresponding to the operating application software as an access permission area. Therefore, the I / O alias address range of FIG. 3 is required for the number of application software. The protection area switching by the MPU is executed by system software such as an OS when switching application software to be operated.

(3.アクセス制御部)
アクセス制御部20は、上記のI/Oエイリアスアドレス範囲1,2,3,…のうちどのI/Oエイリアスアドレス範囲がCPUによってアクセスされているかに応じて、周辺デバイスごとにアクセスが有効か無効かを切り替える。アクセス制御部20のこの機能とMPUによる保護領域の設定とを組み合わせることによって、アプリケーションソフトウェアに応じてアクセス可能な周辺デバイスを周辺デバイス単位で切替えることができる。以下、具体例を用いて各デバイスに対するアクセス制御についてさらに説明する。
(3. Access control unit)
The access control unit 20 determines whether access is valid or invalid for each peripheral device depending on which I / O alias address range is accessed by the CPU among the above I / O alias address ranges 1, 2, 3,. Switch between. By combining this function of the access control unit 20 and setting of the protection area by the MPU, it is possible to switch the accessible peripheral device for each peripheral device according to the application software. Hereinafter, access control for each device will be further described using a specific example.

(4.デバイスアクセス制御の具体例)
図4は、実施の形態1の情報処理装置において、どのアプリケーションソフトウェアの実行時にどの周辺デバイスがアクセス可能になるように設定されるかを表形式で示す図である。図4に示す例では、周辺デバイス1および4は、アプリケーションソフトウェア1の動作時にアクセス可能であるが、その他のアプリケーションソフトウェアの動作時にはアクセスできないように設定される。周辺デバイス2および3は、アプリケーションソフトウェア2の動作時にアクセス可能であるが、その他のアプリケーションソフトウェアの動作時にはアクセスできないように設定される。このようなアプリケーションごとのデバイスアクセス制御をデバイス単位で実現するために、MPU11とアクセス制御部20とが設けられている。
(4. Specific examples of device access control)
FIG. 4 is a diagram showing in tabular form which peripheral device is set to be accessible when executing which application software in the information processing apparatus of the first embodiment. In the example shown in FIG. 4, the peripheral devices 1 and 4 are set so that they can be accessed when the application software 1 operates, but cannot be accessed when other application software operates. The peripheral devices 2 and 3 are set so that they can be accessed when the application software 2 operates, but cannot be accessed when other application software operates. In order to realize such device access control for each application on a device basis, an MPU 11 and an access control unit 20 are provided.

なお、図4の場合とは異なるが、たとえば、デバイス1について、アプリケーションソフトウェア1および2のいずれの動作時でもアクセス可能であるように設定することもできる。   Although different from the case of FIG. 4, for example, the device 1 can be set to be accessible during the operation of the application software 1 and 2.

図5は、アプリケーションソフトウェア1の動作時において、MPUによる領域設定について説明するための図である。図5を参照して、アプリケーションソフトウェア1の動作時には、図1のMPU11によって、I/Oエイリアスアドレス範囲1(0x20010000〜0x2001FFFF)がアクセス許可領域(MPU領域1)に設定される。その他のアドレス範囲はアクセス不許可となる。なお、図5に示す取り消し線は、図6で説明するようにアクセスされたときに無効とされることを示している。   FIG. 5 is a diagram for explaining region setting by the MPU during operation of the application software 1. Referring to FIG. 5, when the application software 1 operates, the MPU 11 in FIG. 1 sets the I / O alias address range 1 (0x20010000 to 0x2001FFFF) as the access permission area (MPU area 1). Access to other address ranges is not permitted. Note that the strikethrough shown in FIG. 5 is invalidated when accessed as described in FIG.

図6は、アプリケーションソフトウェア1の動作時において、アクセス制御部20の動作について説明するための図である。なお、図6に示す取り消し線は、以下に説明するようにアクセスされたときに無効となることを示している。   FIG. 6 is a diagram for explaining the operation of the access control unit 20 during the operation of the application software 1. Note that the strikethrough shown in FIG. 6 indicates that it becomes invalid when accessed as described below.

図6を参照して、アクセス制御部20の制御に従うと、デバイス1(D1)は、I/Oエイリアスアドレス範囲1のアドレス0x20010000〜0x20010FFFによってアクセスされた場合には有効だが、I/Oエイリアスアドレス範囲2のアドレス0x20020000〜0x20020FFFによってアクセスされた場合には無効になる。デバイス2(D2)は、I/Oエイリアスアドレス範囲1のアドレス0x20011000〜0x20011FFFによってアクセスされた場合には無効だが、I/Oエイリアスアドレス範囲2のアドレス0x20021000〜0x20021FFFによってアクセスされた場合には有効になる。デバイス3(D3)は、I/Oエイリアスアドレス範囲1のアドレス0x20012000〜0x20012FFFによってアクセスされた場合には無効だが、I/Oエイリアスアドレス範囲2のアドレス0x20022000〜0x20022FFFによってアクセスされた場合には有効になる。デバイス4(D4)は、I/Oエイリアスアドレス範囲1のアドレス0x20013000〜0x20013FFFによってアクセスされた場合には有効だが、I/Oエイリアスアドレス範囲2のアドレス0x20022000〜0x20022FFFによってアクセスされた場合には無効になる。   Referring to FIG. 6, according to the control of access control unit 20, device 1 (D1) is valid when accessed by address 0x20010000-0x20010FFF in I / O alias address range 1, but I / O alias address When accessed by address 0x20000000 to 0x20020FFF in range 2, it becomes invalid. Device 2 (D2) is invalid when accessed by address 0x20011000-0x200111FFF in I / O alias address range 1, but enabled when accessed by address 0x20021000-0x20021FFF in I / O alias address range 2 Become. Device 3 (D3) is invalid when accessed by address 0x20012000-0x200112FFF in I / O alias address range 1, but valid when accessed by address 0x20022000-0x20022FFF in I / O alias address range 2 Become. Device 4 (D4) is valid when accessed by address 0x20013000-0x200113FFF in I / O alias address range 1, but is invalid when accessed by address 0x20022000-0x20022FFF in I / O alias address range 2 Become.

上記のアクセス制御部20の制御動作と、図5で説明したMPUによる領域設定とが組み合わされることにより、アプリケーションソフトウェア1の動作時には、デバイス1および4はCPU10からアクセス可能になり、デバイス2および3はCPU10からアクセスできなくなる。すなわち、図4に示した設定でのデバイスのアクセス制御が実現できる。   By combining the control operation of the access control unit 20 and the area setting by the MPU described with reference to FIG. 5, the devices 1 and 4 can be accessed from the CPU 10 during the operation of the application software 1. Cannot be accessed from the CPU 10. That is, device access control with the settings shown in FIG. 4 can be realized.

図7は、アプリケーションソフトウェア2の動作時において、MPUによる領域設定について説明するための図である。図7を参照して、アプリケーションソフトウェア2の動作時には、図1のMPU11によって、I/Oエイリアスアドレス範囲2(0x20020000〜0x2002FFFF)がアクセス許可領域に設定される。その他のアドレス範囲はアクセス不許可となる。なお、図7に示す取り消し線は、アクセスされたときに無効とされることを示している。   FIG. 7 is a diagram for explaining area setting by the MPU during the operation of the application software 2. Referring to FIG. 7, during operation of application software 2, I / O alias address range 2 (0x20000000 to 0x2002FFFF) is set in the access permission area by MPU 11 in FIG. Access to other address ranges is not permitted. Note that the strikethrough shown in FIG. 7 is invalidated when accessed.

図8は、アプリケーションソフトウェア2の動作時において、アクセス制御部20の動作について説明するための図である。図8を参照して、アクセス制御部20の制御動作自体は、図6で説明したアプリケーションソフトウェア1の動作時と同じである。このアクセス制御部20の制御動作と図7で説明したMPUによる領域設定とが組み合わされることにより、アプリケーションソフトウェア2の動作時には、デバイス2および3はCPU10からアクセス可能になり、デバイス1および4はCPU10からアクセスできなくなる。すなわち、図4に示した設定でのデバイスのアクセス制御が実現できる。なお、図8に示す取り消し線は、アクセスされたときに無効とされることを示している。   FIG. 8 is a diagram for explaining the operation of the access control unit 20 during the operation of the application software 2. Referring to FIG. 8, the control operation itself of access control unit 20 is the same as the operation of application software 1 described in FIG. By combining the control operation of the access control unit 20 and the area setting by the MPU described with reference to FIG. 7, when the application software 2 operates, the devices 2 and 3 can be accessed from the CPU 10, and the devices 1 and 4 are connected to the CPU Can no longer be accessed. That is, device access control with the settings shown in FIG. 4 can be realized. Note that the strikethrough shown in FIG. 8 is invalidated when accessed.

ここで、図6と図8とを比較すると、MPUによってアクセス許可領域として設定されるのは、連続した1領域(MPU領域1とする)のみである。すなわち、図6の場合(アプリケーションソフトウェア1を実行する場合)には、I/Oエイリアスアドレス範囲1(0x20010000〜0x2001FFFF)がMPU領域1に設定される。一方、図8の場合(アプリケーションソフトウェア2を実行する場合)には、I/Oエイリアスアドレス範囲2(0x20020000〜0x2002FFFF)がMPU領域1に設定される。すなわち、デバイスアクセス制御のために設定されるMPU領域の数を削減して1つにすることができる。   Here, when FIG. 6 is compared with FIG. 8, only one continuous area (referred to as MPU area 1) is set as an access permission area by the MPU. That is, in the case of FIG. 6 (when the application software 1 is executed), the I / O alias address range 1 (0x20010000 to 0x2001FFFF) is set in the MPU area 1. On the other hand, in the case of FIG. 8 (when the application software 2 is executed), the I / O alias address range 2 (0x20000000 to 0x2002FFFF) is set in the MPU area 1. That is, the number of MPU areas set for device access control can be reduced to one.

[実施の形態1の効果]
以下、実施の形態1の効果について説明する。
[Effect of Embodiment 1]
Hereinafter, effects of the first embodiment will be described.

まず、実施の形態1による情報処理装置100では、周辺デバイス単位でのアクセス保護が実現できる。すなわち、MPU領域を設定しただけでは、設定されたMPU領域内に配置された周辺デバイスが全てアクセス可能になってしまう。そこで、MPU領域の設定と、周辺デバイス単位でアクセスの有効・無効を設定可能なアクセス制御部20の機能とを組み合わせることにより、周辺デバイス単位でのアクセス可否の設定をアプリケーションごとに実現できる。   First, the information processing apparatus 100 according to the first embodiment can realize access protection in units of peripheral devices. In other words, if only the MPU area is set, all peripheral devices arranged in the set MPU area can be accessed. Therefore, by combining the setting of the MPU area and the function of the access control unit 20 capable of setting the validity / invalidity of access in units of peripheral devices, it is possible to realize the setting of accessibility in units of peripheral devices for each application.

さらに、アプリケーション切替時には、MPUによって1領域の設定のみを変更すればよいので、実行オーバヘッドを低減できる。この結果、アプリケーション切替処理の高速化が実現される。さらに、CPUを変更する必要がないので、汎用CPUを使用することができる。   Furthermore, when switching applications, only the setting of one area needs to be changed by the MPU, so that the execution overhead can be reduced. As a result, high-speed application switching processing is realized. Furthermore, since there is no need to change the CPU, a general-purpose CPU can be used.

以下、比較例の情報処理装置と対比することにより、実施の形態1の効果について補足する。ここで、比較例の情報処理装置では、図1に示すアクセス制御部20が設けられておらず、さらに図3に示すような複数のI/Oエイリアスアドレス範囲は設定されておらず、各周辺デバイスは単一のアドレス範囲にマッピングされているとする。   Hereinafter, the effects of the first embodiment will be supplemented by comparing with the information processing apparatus of the comparative example. Here, in the information processing apparatus of the comparative example, the access control unit 20 shown in FIG. 1 is not provided, and a plurality of I / O alias address ranges as shown in FIG. 3 are not set. Assume that a device is mapped to a single address range.

図9は、比較例の情報処理装置において、どのアプリケーションソフトウェアの実行時にどの周辺デバイスがアクセス可能になるように設定されるかを表形式で示す図である。図9に示す例では、周辺デバイス1、2および5は、アプリケーションソフトウェア1の動作時にアクセス可能であるが、他のアプリケーションソフトウェアの動作時にはアクセスできないように設定される。周辺デバイス3、4、6および8は、アプリケーションソフトウェア2の動作時にアクセス可能であるが、他のアプリケーションソフトウェアの動作時にはアクセスできないように設定される。周辺デバイス7は、アプリケーションソフトウェア3の動作時にはアクセス可能であるが、他のアプリケーションソフトウェアの動作時にはアクセスできないように設定される。   FIG. 9 is a diagram showing in tabular form which peripheral device is set to be accessible when executing which application software in the information processing apparatus of the comparative example. In the example shown in FIG. 9, the peripheral devices 1, 2, and 5 are set so that they can be accessed when the application software 1 operates, but cannot be accessed when other application software operates. The peripheral devices 3, 4, 6 and 8 are set so that they can be accessed when the application software 2 operates, but cannot be accessed when other application software operates. The peripheral device 7 is set so that it can be accessed when the application software 3 operates, but cannot be accessed when other application software operates.

図10は、比較例の情報処理装置の場合のアプリケーションソフトウェア1の動作時において、MPUによる領域設定について説明するための図である。   FIG. 10 is a diagram for explaining region setting by the MPU during the operation of the application software 1 in the case of the information processing apparatus of the comparative example.

図10を参照して、まず、周辺デバイスのアドレスマッピングについて説明すると、デバイス1は、単一のアドレス範囲0x20010000〜0x20011000にマッピングされている。他のデバイス2,3,…についても同様であり、個別に設定された単一のアドレス範囲にマッピングされている。どのデバイスがどのアドレス範囲にマッピングされるかは、ハードウェア設計時に決定される。   Referring to FIG. 10, first, address mapping of peripheral devices will be described. Device 1 is mapped to a single address range 0x20010000 to 0x20011000. The same applies to the other devices 2, 3,..., And they are mapped to a single address range set individually. Which device is mapped to which address range is determined at the time of hardware design.

図9のアクセス設定を実現するためには、アプリケーションソフトウェア1の動作時には周辺デバイス1、2および5をアクセス可能に設定する必要がある。ここで、MPUによって1領域として指定可能なのは連続したアドレス範囲に限られる。しかし、各アプリケーションが使用するデバイスはシステム毎に異なるため、使用する全てデバイスが連続したアドレスに配置されていない場合が多い。   In order to realize the access setting of FIG. 9, it is necessary to set the peripheral devices 1, 2 and 5 to be accessible when the application software 1 operates. Here, the MPU can designate only one area as a continuous address range. However, since the devices used by each application differ from system to system, there are many cases where all the devices used are not arranged at consecutive addresses.

具体的に周辺デバイス1および2は連続したアドレス範囲にマッピングされているが、周辺デバイス5は、周辺デバイス1,2とは離間したアドレス範囲にマッピングされている。したがって、周辺デバイス1,2がマッピングされているアドレス範囲0x20010000〜0x20011FFFをMPU領域1に設定し、周辺デバイス5が設定されているアドレス範囲0x20014000〜0x20014FFFをMPU領域2に設定する必要がある。設定するMPU領域数は2つになる。   Specifically, the peripheral devices 1 and 2 are mapped to a continuous address range, but the peripheral device 5 is mapped to an address range separated from the peripheral devices 1 and 2. Therefore, it is necessary to set the address range 0x20010000-0x200111FFF to which the peripheral devices 1 and 2 are mapped to the MPU area 1 and set the address range 0x20014000 to 0x20014FFF to which the peripheral device 5 is set to the MPU area 2. The number of MPU areas to be set is two.

図11は、比較例の情報処理装置の場合のアプリケーションソフトウェア2の動作時において、MPUによる領域設定について説明するための図である。   FIG. 11 is a diagram for explaining region setting by the MPU during the operation of the application software 2 in the case of the information processing apparatus of the comparative example.

図11を参照して、アプリケーションソフトウェア2の動作時には、周辺デバイス3、4、6および8をアクセス可能に設定する必要がある。ここで、周辺デバイス3および4は連続したアドレス範囲にマッピングされているが、周辺デバイス6および8のアドレス範囲は互いに離間するともに、周辺デバイス3,4のアドレス範囲とも離間している。したがって、周辺デバイス3,4がマッピングされているアドレス範囲0x20012000〜0x20013FFFをMPU領域1に設定し、周辺デバイス6がマッピングされているアドレス範囲0x20015000〜0x20015FFFをMPU領域2に設定する。さらに、周辺デバイス8がマッピングされているアドレス範囲0x20017000〜0x20017FFFをMPU領域3に設定する必要がある。   Referring to FIG. 11, when application software 2 operates, peripheral devices 3, 4, 6 and 8 need to be set to be accessible. Here, although the peripheral devices 3 and 4 are mapped to a continuous address range, the address ranges of the peripheral devices 6 and 8 are separated from each other and are also separated from the address ranges of the peripheral devices 3 and 4. Therefore, the address range 0x20012000 to 0x2001FFF to which the peripheral devices 3 and 4 are mapped is set in the MPU area 1, and the address range 0x20015000 to 0x200115FFF to which the peripheral device 6 is mapped is set in the MPU area 2. Furthermore, it is necessary to set the address range 0x2001000 to 0x20017FFF to which the peripheral device 8 is mapped in the MPU area 3.

ここで、一般的なOSとアプリケーションプログラムとを動作させると、メモリの保護のために多数のMPU領域が使用される。このため、周辺デバイスの保護に使用可能なMPU領域の枚数はわずかとなる。この結果、アプリケーションソフトウェアが使用する複数の周辺デバイスのアドレスが連続したアドレス範囲に配置されていない場合、MPU領域の数が不足して一部デバイスが使えないという問題が生じることがある。図11の場合で、デバイス保護のために利用可能なMPU領域が2枚に限られる場合は、周辺デバイス8がMPU領域に設定できなくなる。実施の形態1の情報処理装置100では、設定すべきMPU領域数は1つで十分であるので上記の問題を回避することができる。   Here, when a general OS and an application program are operated, a large number of MPU areas are used for memory protection. Therefore, the number of MPU areas that can be used for protecting peripheral devices is small. As a result, when the addresses of a plurality of peripheral devices used by the application software are not arranged in a continuous address range, there is a problem that the number of MPU areas is insufficient and some devices cannot be used. In the case of FIG. 11, when the number of MPU areas available for device protection is limited to two, the peripheral device 8 cannot be set as the MPU area. In the information processing apparatus 100 according to the first embodiment, the number of MPU areas to be set is sufficient, so the above problem can be avoided.

[変形例]
上記の実施の形態ではメモリマップトI/O方式の場合について説明した。これに対して、ポートマップトI/O方式の場合にも、周辺デバイス用のアドレス空間に複数のI/Oエイリアスアドレス範囲を設定し、各I/Oエイリアスアドレス範囲ごとに情報処理装置内の複数の周辺デバイスがマッピングされるようにすれば、上記と同様のデバイスアクセス保護を実現することができる。
[Modification]
In the above embodiment, the case of the memory mapped I / O method has been described. On the other hand, also in the case of the port mapped I / O method, a plurality of I / O alias address ranges are set in the address space for peripheral devices, and each I / O alias address range is set in the information processing apparatus. If a plurality of peripheral devices are mapped, device access protection similar to the above can be realized.

<実施の形態2>
[情報処理装置の構成]
図12は、実施の形態2による情報処理装置101の構成を示すブロック図である。図12の情報処理装置101では、図1のアクセス制御部20がアドレスデコーダ21によって具体的に実現される。その他の情報処理装置101の構成は、図1の場合と同様であるので同一または相当する部分には同一の参照符号を付して説明を繰り返さない。特に、図3で示した各周辺デバイスに対するアドレスマッピングは実施の形態2においても同じである。
<Embodiment 2>
[Configuration of information processing device]
FIG. 12 is a block diagram illustrating a configuration of the information processing apparatus 101 according to the second embodiment. In the information processing apparatus 101 in FIG. 12, the access control unit 20 in FIG. 1 is specifically realized by the address decoder 21. Since the configuration of other information processing apparatus 101 is the same as that in FIG. 1, the same or corresponding parts are denoted by the same reference numerals and description thereof will not be repeated. In particular, the address mapping for each peripheral device shown in FIG. 3 is the same in the second embodiment.

なお、図12では、図1のフラッシュメモリ12およびDRAM13の図示が省略されている。周辺デバイス1〜n(D1〜Dn)は、4個の周辺デバイスD1〜D4のみが代表的に示されている。   In FIG. 12, the flash memory 12 and the DRAM 13 of FIG. 1 are not shown. As for the peripheral devices 1 to n (D1 to Dn), only four peripheral devices D1 to D4 are representatively shown.

図12を参照して、アドレスデコーダ21は比較器群22を含む。比較器群22に含まれる比較器(イコールコンパレータ)A1,A2,…は、周辺デバイス1,2,…(D1,D2,…)にそれぞれ対応する。各比較器は、CPU10から出力されるアドレスのうち上位20ビットが、各自のレジスタに保持されている基準値と一致するか否かを判定する。なお、以下の説明では、最上位ビット(MSB)をビット31とし、最下位ビット(LSB)をビット0とする。上位20ビットはビット31〜12に対応する。   Referring to FIG. 12, address decoder 21 includes a comparator group 22. The comparators (equal comparators) A1, A2,... Included in the comparator group 22 correspond to the peripheral devices 1, 2,. Each comparator determines whether the upper 20 bits of the address output from the CPU 10 match the reference value held in its own register. In the following description, the most significant bit (MSB) is bit 31 and the least significant bit (LSB) is bit 0. The upper 20 bits correspond to bits 31-12.

具体的に比較器A1は、CPUが出力するアドレスの上位20ビットが基準値“0x200X0”と一致するか否かを判定する(ビット19〜16の値Xについては後述する)。比較器A1は、一致する場合に、自身(比較器A1)に対応するデバイス1(D1)のイネーブルポートENに活性化されたチップセレクト信号15を出力する。チップセレクト信号15が活性化されているとき、デバイス1(D1)へのアクセスが有効になる。   Specifically, the comparator A1 determines whether or not the upper 20 bits of the address output by the CPU match the reference value “0x200X0” (the value X of the bits 19 to 16 will be described later). If they match, the comparator A1 outputs the activated chip select signal 15 to the enable port EN of the device 1 (D1) corresponding to itself (comparator A1). When the chip select signal 15 is activated, access to the device 1 (D1) is valid.

同様に、比較器A2は、CPUが出力するアドレスの上位20ビットが基準値“0x200X1”に一致するか否かを判定し、一致する場合に対応のデバイス2(D2)のイネーブルポートENに出力するチップセレクト信号15を活性化する。比較器A3は、CPUが出力するアドレスの上位20ビットが基準値“0x200X2”に一致するか否かを判定し、一致する場合に対応のデバイス3(D3)のイネーブルポートENに出力するチップセレクト信号15を活性化する。比較器A4は、CPUが出力するアドレスの上位20ビットが基準値“0x200X3”に一致するか否かを判定し、一致する場合に対応のデバイス4(D4)のイネーブルポートENに出力するチップセレクト信号15を活性化する。   Similarly, the comparator A2 determines whether or not the upper 20 bits of the address output by the CPU matches the reference value “0x200X1”, and outputs the same to the enable port EN of the corresponding device 2 (D2) if they match. The chip select signal 15 to be activated is activated. The comparator A3 determines whether or not the upper 20 bits of the address output by the CPU match the reference value “0x200X2”, and if it matches, the chip select that is output to the enable port EN of the corresponding device 3 (D3) The signal 15 is activated. The comparator A4 determines whether or not the upper 20 bits of the address output by the CPU match the reference value “0x200X3”, and if it matches, the chip select that is output to the enable port EN of the corresponding device 4 (D4) The signal 15 is activated.

ここで、ビット19〜16の値“X”はアプリケーションソフトに対応する値に設定される。アプリケーションソフトウェア1の場合はX=0x1であり、アプリケーションソフトウェア2場合はX=0x2である。アプリケーションソフトウェア1および2のいずれにも対応する場合には、比較器は、アドレスのビット19〜16の値がX=0x1およびX=0x2のいずれかに一致するか否かを判定する。この場合、たとえば、デバイス1用に2つのイコールコンパレータとこれらのコンパレータの出力のOR演算を行う論理回路とが設けられる。   Here, the value “X” of bits 19 to 16 is set to a value corresponding to the application software. In the case of application software 1, X = 0x1, and in the case of application software 2, X = 0x2. When both the application software 1 and 2 are supported, the comparator determines whether the value of the bits 19 to 16 of the address matches either X = 0x1 or X = 0x2. In this case, for example, two equal comparators and a logic circuit that performs an OR operation on the outputs of these comparators are provided for the device 1.

他の方法として、アドレスの割り付けを工夫してビット単位でのアクセスの禁止・許可を設定可能にすれば、1つのデバイスに複数のアプリケーションソフトウェアを割付けることが可能になる。たとえば、図5、図12を参照して、ビット16の値が“1”(ビット19〜17の値は任意とする)の場合にデバイス1へのアクセスが可能であるとすると、アプリケーションソフトウェア1,3,5,…の各々の実行時にデバイス1へのアクセスが可能になる。一般的には各デバイスごとに、(1)許可するアドレスのビットのパターンを設定するレジスタ(アドレスパターンレジスタ)および(2)そのうちアクセス許可に用いるビットを設定するレジスタ(アドレスマスクレジスタ)を用意すれば、デバイスごとに複数のアプリケーションソフトに対してアクセスを許可することが可能になる。   As another method, if it is possible to set access prohibition / permission in bit units by devising address allocation, a plurality of application software can be allocated to one device. For example, referring to FIG. 5 and FIG. 12, when the value of bit 16 is “1” (the values of bits 19 to 17 are arbitrary), it is assumed that access to device 1 is possible. , 3, 5,... Can be accessed when the device 1 is executed. In general, for each device, prepare (1) a register (address pattern register) that sets the bit pattern of the address to be permitted, and (2) a register (address mask register) that sets the bit used for access permission. For example, it is possible to permit access to a plurality of application software for each device.

ビット15〜12は、周辺デバイス1,2,…(D1,D2,…)を特定するために用いられる。ビット15〜12の値が0x0のとき周辺デバイス1を示す。同様にビット15〜12の値が0x1のとき周辺デバイス2を示し、ビット15〜12の値が0x2のとき周辺デバイス3を示し、ビット15〜12の値が0x3のとき周辺デバイス4を示す。   Bits 15 to 12 are used to specify peripheral devices 1, 2,... (D1, D2,...). Peripheral device 1 is indicated when the values of bits 15-12 are 0x0. Similarly, peripheral device 2 is indicated when the values of bits 15 to 12 are 0x1, peripheral device 3 is indicated when the values of bits 15 to 12 are 0x2, and peripheral device 4 is indicated when the values of bits 15 to 12 are 0x3.

[具体的な動作例]
以下、実施の形態2による情報処理装置101の具体的な動作例について説明する。
[Specific operation example]
Hereinafter, a specific operation example of the information processing apparatus 101 according to the second embodiment will be described.

図13は、実施の形態2の情報処理装置において、どのアプリケーションソフトウェアの実行時にどの周辺デバイスがアクセス可能になるように設定されるかを表形式で示す図である。図13に示す例では、周辺デバイス1および4は、アプリケーションソフトウェア1の動作時にアクセス可能であるが、その他のアプリケーションソフトウェアの動作時にはアクセスできないように設定される。周辺デバイス2および3は、アプリケーションソフトウェア2の動作時にアクセス可能であるが、その他のアプリケーションソフトウェアの動作時にはアクセスできないように設定される。   FIG. 13 is a diagram showing in tabular form which peripheral device is set to be accessible when executing which application software in the information processing apparatus of the second embodiment. In the example shown in FIG. 13, the peripheral devices 1 and 4 are set so that they can be accessed when the application software 1 operates, but cannot be accessed when the other application software operates. The peripheral devices 2 and 3 are set so that they can be accessed when the application software 2 operates, but cannot be accessed when other application software operates.

上記の設定例の場合には、図12の比較器A1〜A4においてアドレスと比較される基準値は、それぞれ0x20010,0x20021,0x20022,0x20013となる。これらの基準値は、情報処理装置101の立上げ時にOSなどのシステムソフトウェアによって設定される。アプリケーションソフトウェアの切替時には再設定する必要はない。   In the case of the above setting example, the reference values compared with the addresses in the comparators A1 to A4 in FIG. 12 are 0x20010, 0x20021, 0x20022, and 0x20013, respectively. These reference values are set by system software such as an OS when the information processing apparatus 101 is started up. It is not necessary to reset when switching application software.

図14は、図13の設定例における情報処理装置101の動作を説明するための図である。図14を参照して、アドレスデコーダ21による比較動作に基づいて、CPU10からアドレス0x20010000〜0x20010FFFによってデバイス1(D1)がアクセスされたときにそのアクセスは有効になる。同様に、CPU10からアドレス0x20021000〜0x20021FFFによってデバイス2(D2)がアクセスされたときにそのアクセスは有効になる。CPU10からアドレス0x20022000〜0x20022FFFによってデバイス3(D3)がアクセスされたときにそのアクセスは有効になる。CPU10からアドレス0x20013000〜0x20013FFFによってデバイス4(D4)がアクセスされたときにそのアクセスは有効になる。上記以外のアドレスによって各デバイスがアクセスされた場合には、そのアクセスは無効になる。なお、図14に示す取り消し線は、アクセスされたときに無効とされることを示している。   FIG. 14 is a diagram for explaining the operation of the information processing apparatus 101 in the setting example of FIG. Referring to FIG. 14, based on the comparison operation by address decoder 21, when device 1 (D 1) is accessed from CPU 10 by address 0x20010000 to 0x20010FFF, the access becomes valid. Similarly, when the device 2 (D2) is accessed from the CPU 10 by the address 0x20021000 to 0x20021FFF, the access becomes valid. When the device 3 (D3) is accessed from the CPU 10 by the address 0x20022000 to 0x20022FFF, the access becomes valid. When the device 4 (D4) is accessed from the CPU 10 by the address 0x20013000 to 0x20013FFF, the access becomes valid. When each device is accessed by an address other than the above, the access becomes invalid. Note that the strikethrough shown in FIG. 14 is invalidated when accessed.

アプリケーションソフトウェア1の動作時には、実施の形態1の場合と同様に、MPU11によって図3のI/Oエイリアスアドレス範囲1(0x20010000〜0x2001FFFF)がアクセス許可領域(MPU領域1)に設定される。その他のアドレス範囲はアクセス不許可となる。したがって、アドレスデコーダ21の機能と組み合わされることによって、アプリケーションソフトウェア1の動作時には、デバイス1および4はCPU10からアクセス可能になり、デバイス2および3はCPU10からアクセスできなくなる。   When the application software 1 is operating, the MPU 11 sets the I / O alias address range 1 (0x20010000 to 0x2001FFFF) in FIG. 3 as the access permission area (MPU area 1), as in the first embodiment. Access to other address ranges is not permitted. Therefore, in combination with the function of the address decoder 21, when the application software 1 is operating, the devices 1 and 4 can be accessed from the CPU 10, and the devices 2 and 3 cannot be accessed from the CPU 10.

アプリケーションソフトウェア2の動作時には、MPU11によって図3のI/Oエイリアスアドレス範囲2(0x20020000〜0x2002FFFF)がアクセス許可領域に設定される。その他のアドレス範囲はアクセス不許可となる。したがって、アドレスデコーダ21の機能と組み合わされることによって、アプリケーションソフトウェア2の動作時には、デバイス2および3はCPU10からアクセス可能になり、デバイス1および4はCPU10からアクセスできなくなる。   When the application software 2 operates, the MPU 11 sets the I / O alias address range 2 (0x20000000 to 0x2002FFFF) in FIG. Access to other address ranges is not permitted. Therefore, in combination with the function of the address decoder 21, the devices 2 and 3 can be accessed from the CPU 10 and the devices 1 and 4 cannot be accessed from the CPU 10 when the application software 2 operates.

[実施の形態2の効果]
以上のとおり、実施の形態2の情報処理装置101によれば、図1のアクセス制御部20がアドレスデコーダ21として具体的に実現されている。この結果、実施の形態1の場合と同様の効果を奏することができる。
[Effect of Embodiment 2]
As described above, according to the information processing apparatus 101 of the second embodiment, the access control unit 20 in FIG. 1 is specifically realized as the address decoder 21. As a result, the same effect as in the first embodiment can be obtained.

<実施の形態3>
図15は、実施の形態3による情報処理装置102の構成を示すブロック図である。なお、図15では、図1のフラッシュメモリ12およびDRAM13の図示が省略されている。周辺デバイス1〜n(D1〜Dn)は、4個の周辺デバイスD1〜D4のみが代表的に示されている。
<Embodiment 3>
FIG. 15 is a block diagram illustrating a configuration of the information processing apparatus 102 according to the third embodiment. In FIG. 15, the flash memory 12 and the DRAM 13 of FIG. 1 are not shown. As for the peripheral devices 1 to n (D1 to Dn), only four peripheral devices D1 to D4 are representatively shown.

図15を参照して、実施の形態3による情報処理装置102は、周辺デバイス1,2,3,…(D1,D2,D3,…)の内部にそれぞれ設けられた比較器C1,C2,C3,…を含む点で図12の情報処理装置101と異なる。CPUから各周辺デバイスのデバイス本体(B1,B2,B3,…)へのアクセスは、アドレスデコーダ21に設けられた対応する比較器A1,A2,A3,…の比較結果とともに、対応する比較器C1,C2,C3,…の比較結果に基づいて、有効または無効に切り替えられる。   Referring to FIG. 15, information processing apparatus 102 according to Embodiment 3 includes comparators C1, C2, C3 provided in peripheral devices 1, 2, 3,... (D1, D2, D3,...), Respectively. Are different from the information processing apparatus 101 in FIG. The access from the CPU to the device body (B1, B2, B3,...) Of each peripheral device is performed together with the comparison results of the corresponding comparators A1, A2, A3,. , C2, C3,..., C2, C3,.

各比較器A1,A2,A3,A4は、CPU10によって対応する周辺デバイスがアクセスされているか否かを判定する。具体的には、比較器A1,A2,A3,A4の各々は、CPU10から出力されたアドレスのうちビット31〜20およびビット15〜12が各比較器ごとに定められた基準値と一致するか否かを判定する。比較器A1,A2,A3,A4においてアドレスと比較される基準値は、それぞれ0x200X0,0x200X1,0x200X2,0x200X3である(ただし、Xは任意の値)。   Each of the comparators A1, A2, A3, A4 determines whether or not the corresponding peripheral device is accessed by the CPU 10. Specifically, each of the comparators A1, A2, A3, and A4 indicates whether bits 31 to 20 and bits 15 to 12 of the address output from the CPU 10 match the reference value determined for each comparator. Determine whether or not. The reference values compared with the addresses in the comparators A1, A2, A3, and A4 are 0x200X0, 0x200X1, 0x200X2, and 0x200X3 (where X is an arbitrary value).

周辺デバイス1〜4にそれぞれ設けられた比較器C1,C2,C3,C4の各々は、対応する周辺デバイスで動作させるべきアプリケーションソフトウェアを判別するために設けられている。具体的には、比較器C1,C2,C3,C4の各々は、CPU10から出力されたアドレスのうちビット19〜16が各比較器ごとに定められた基準値と一致するか否かを判定する。図15に示す例では、この基準値は、比較器C1,C2,C3,C4の場合にそれぞれ0x1,0x2,0x2,0x1である。   Each of the comparators C1, C2, C3, and C4 provided in each of the peripheral devices 1 to 4 is provided to determine application software to be operated in the corresponding peripheral device. Specifically, each of the comparators C1, C2, C3, and C4 determines whether or not bits 19 to 16 in the address output from the CPU 10 match a reference value determined for each comparator. . In the example shown in FIG. 15, the reference values are 0x1, 0x2, 0x2, and 0x1 in the case of the comparators C1, C2, C3, and C4, respectively.

したがって、図15に示す例では、周辺デバイス1および4は、アプリケーションソフトウェア1の動作時にアクセス可能になり、周辺デバイス2および3は、アプリケーションソフトウェア2の動作時にアクセス可能になる。   Accordingly, in the example shown in FIG. 15, the peripheral devices 1 and 4 are accessible when the application software 1 is operating, and the peripheral devices 2 and 3 are accessible when the application software 2 is operating.

図15のその他の点は図12、図14の場合と同じであるので、同一または相当する部分には同一の参照符号を付して説明を繰り返さない。なお、図15に示す取り消し線は、アクセスされたときに無効とされることを示している。   Other points in FIG. 15 are the same as those in FIGS. 12 and 14, and thus the same or corresponding parts are denoted by the same reference numerals and description thereof will not be repeated. Note that the strikethrough shown in FIG. 15 is invalidated when accessed.

上記のように実施の形態3の場合には、アドレスデコーダ21に設けられた比較器A1,A2,A3,…と個々のデバイスに設けられた比較器C1,C2,C3,…とによって、図13に示すアドレスデコーダ21と同等の機能(すなわち、図1のアクセス制御部20の機能)が実現できる。この結果、実施の形態3の情報処理装置102は、実施の形態1,2の場合と同様の効果を奏する。   As described above, in the case of the third embodiment, the comparators A1, A2, A3,... Provided in the address decoder 21 and the comparators C1, C2, C3,. 13 (that is, the function of the access control unit 20 in FIG. 1) equivalent to the address decoder 21 shown in FIG. As a result, the information processing apparatus 102 according to the third embodiment has the same effect as in the first and second embodiments.

以上、本発明者によってなされた発明を実施の形態に基づき具体的に説明したが、本発明は上記実施の形態に限定されるものではなく、その要旨を逸脱しない範囲で種々変更可能であることは言うまでもない。   As mentioned above, the invention made by the present inventor has been specifically described based on the embodiment. However, the present invention is not limited to the above embodiment, and various modifications can be made without departing from the scope of the invention. Needless to say.

10 CPU、11 メモリ保護ユニット(MPU)、12 フラッシュメモリ、13 DRAM、14 バス、15 チップセレクト信号、20 アクセス制御部、21 アドレスデコーダ、22 比較器群、100,101,102 情報処理装置、A1〜A4,C1〜C4 比較器、D1〜D4 周辺デバイス。   10 CPU, 11 Memory protection unit (MPU), 12 Flash memory, 13 DRAM, 14 bus, 15 Chip select signal, 20 Access control unit, 21 Address decoder, 22 Comparator group, 100, 101, 102 Information processing device, A1 -A4, C1-C4 comparator, D1-D4 peripheral device.

Claims (7)

CPU(Central Processing Unit)と、
複数の周辺デバイスとを備え、
前記CPUのアドレス空間は複数のI/Oエイリアスアドレス範囲を含み、前記I/Oエイリアスアドレス範囲ごとに前記複数の周辺デバイスがマッピングされ、
さらに、前記アドレス空間内に、前記CPUからのアクセスを許可するアクセス許可領域を設定するメモリ保護ユニットと、
前記複数のI/Oエイリアスアドレス範囲のうちどのI/Oエイリアスアドレス範囲が前記CPUによってアクセスされているかに応じて、前記CPUからのアクセスが有効か無効かを前記周辺デバイスごとに切り替えるアクセス制御部とを備える、情報処理装置。
CPU (Central Processing Unit)
With multiple peripheral devices,
The CPU address space includes a plurality of I / O alias address ranges, and the plurality of peripheral devices are mapped for each I / O alias address range.
Furthermore, a memory protection unit that sets an access permission area for permitting access from the CPU in the address space;
An access control unit that switches whether access from the CPU is valid or invalid for each peripheral device, depending on which I / O alias address range of the plurality of I / O alias address ranges is accessed by the CPU. An information processing apparatus comprising:
前記メモリ保護ユニットは、前記複数のI/Oエイリアスアドレス範囲のうちのいずれか1つを前記アクセス許可領域に設定する、請求項1に記載の情報処理装置。   The information processing apparatus according to claim 1, wherein the memory protection unit sets any one of the plurality of I / O alias address ranges as the access permission area. 前記複数のI/Oエイリアスアドレス範囲は、前記情報処理装置で実行する複数のアプリケーションソフトウェアにそれぞれ対応し、
前記メモリ保護ユニットは、実行しているアプリケーションソフトウェアに対応するI/Oエイリアスアドレス範囲を前記アクセス許可領域に設定する、請求項2に記載の情報処理装置。
The plurality of I / O alias address ranges respectively correspond to a plurality of application software executed by the information processing apparatus,
The information processing apparatus according to claim 2, wherein the memory protection unit sets an I / O alias address range corresponding to the application software being executed in the access permission area.
前記アクセス制御部は、前記複数の周辺デバイスにそれぞれ対応する複数の比較器を含み、
各前記比較器は、前記CPUから出力されたアドレスのうちの複数の特定ビットの値が、各前記比較器ごとに定められた基準値に一致するか否かを判定し、
前記CPUから各前記周辺デバイスへのアクセスは、前記複数の特定ビットの値が対応の比較器について定められた前記基準値に一致するときに有効になる、請求項1に記載の情報処理装置。
The access control unit includes a plurality of comparators corresponding to the plurality of peripheral devices,
Each of the comparators determines whether or not the values of a plurality of specific bits in the address output from the CPU match a reference value determined for each of the comparators,
The information processing apparatus according to claim 1, wherein access from the CPU to each peripheral device is enabled when the values of the plurality of specific bits match the reference value defined for a corresponding comparator.
前記アクセス制御部は、
前記複数の周辺デバイスにそれぞれ対応する複数の第1の比較器と、
前記複数の周辺デバイスにそれぞれ対応する複数の第2の比較器とを含み、
各前記第1の比較器は、前記CPUから出力されたアドレスのうち複数の第1の特定ビットの値が、前記第1の比較器ごとに定められた第1の基準値に一致するか否かを判定し、
各前記第2の比較器は、前記CPUから出力されたアドレスのうち複数の第2の特定ビットの値が、前記第2の比較器ごとに定められた第2の基準値に一致するか否かを判定し、
前記CPUから各前記周辺デバイスへのアクセスは、前記複数の第1の特定ビットの値が対応の第1の比較器について定められた前記第1の基準値に一致し、かつ、前記複数の第2の特定ビットの値が対応の第2の比較器について定められた前記第2の基準値に一致するときに有効になる、請求項1に記載の情報処理装置。
The access control unit
A plurality of first comparators respectively corresponding to the plurality of peripheral devices;
A plurality of second comparators respectively corresponding to the plurality of peripheral devices;
Each of the first comparators determines whether or not the values of a plurality of first specific bits in the address output from the CPU match a first reference value determined for each of the first comparators. Determine whether
Each of the second comparators determines whether or not the values of a plurality of second specific bits in the address output from the CPU match a second reference value determined for each of the second comparators. Determine whether
The access from the CPU to each of the peripheral devices is such that the values of the plurality of first specific bits coincide with the first reference value determined for the corresponding first comparator, and The information processing apparatus according to claim 1, wherein the information processing apparatus is effective when a value of a specific bit of 2 matches the second reference value determined for a corresponding second comparator.
各前記第2の比較器は、対応の周辺デバイスの内部に設けられる、請求項5に記載の情報処理装置。   The information processing apparatus according to claim 5, wherein each of the second comparators is provided inside a corresponding peripheral device. 前記複数の周辺デバイスは、メモリマップトI/O方式で前記アドレス空間にマッピングされている、請求項1に記載の情報処理装置。   The information processing apparatus according to claim 1, wherein the plurality of peripheral devices are mapped to the address space by a memory mapped I / O method.
JP2013166466A 2013-08-09 2013-08-09 Information processor Pending JP2015035155A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2013166466A JP2015035155A (en) 2013-08-09 2013-08-09 Information processor

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2013166466A JP2015035155A (en) 2013-08-09 2013-08-09 Information processor

Publications (1)

Publication Number Publication Date
JP2015035155A true JP2015035155A (en) 2015-02-19

Family

ID=52543621

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2013166466A Pending JP2015035155A (en) 2013-08-09 2013-08-09 Information processor

Country Status (1)

Country Link
JP (1) JP2015035155A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2019525319A (en) * 2016-07-19 2019-09-05 サイプレス セミコンダクター コーポレーション Context-based protection system

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2019525319A (en) * 2016-07-19 2019-09-05 サイプレス セミコンダクター コーポレーション Context-based protection system
JP7001670B2 (en) 2016-07-19 2022-01-19 サイプレス セミコンダクター コーポレーション Context-based protection system
US11416421B2 (en) 2016-07-19 2022-08-16 Cypress Semiconductor Corporation Context-based protection system

Similar Documents

Publication Publication Date Title
JP6761891B2 (en) Memory controller with flexible address decoding function
JP5654056B2 (en) Hierarchical translation table control
JP6158952B2 (en) Operation of data processor memory access operations
IL183909A (en) Data processing apparatus having memory protection unit
JP6504984B2 (en) Data processor
WO2014098979A1 (en) Controlling access to groups of memory pages in a virtualized environment
JP4514066B2 (en) Data processing apparatus and access control method in data processing apparatus
ES2606128T3 (en) Data Space Arbitrator
JP2003006046A (en) Method and circuit for memory protection
TW202240413A (en) Pcie device and operating method thereof
JP2014081819A (en) Information processing apparatus
JP7001670B2 (en) Context-based protection system
JP2013092852A (en) Bus connection circuit, semiconductor device, and operation method for bus connection circuit
JP2015035155A (en) Information processor
KR20140135796A (en) Microcontroller with context switch
US10706178B2 (en) Data processing apparatus and access control method
TWI814167B (en) System operative to support virtual machines and method for controlling access to a physical address space in thereof
JP6235088B2 (en) Information processing device
JP6603100B2 (en) Memory control device and memory control method
JP5469085B2 (en) Server apparatus provided with MRA switch
JP5324676B2 (en) Processor, bus interface device, and computer system
JP5380392B2 (en) Semiconductor device, bus interface device, and computer system
JP2020009498A (en) Memory controller and memory control method
JP5915624B2 (en) Electronic control unit
JP2019117664A5 (en)