JPH0542019B2 - - Google Patents
Info
- Publication number
- JPH0542019B2 JPH0542019B2 JP18636088A JP18636088A JPH0542019B2 JP H0542019 B2 JPH0542019 B2 JP H0542019B2 JP 18636088 A JP18636088 A JP 18636088A JP 18636088 A JP18636088 A JP 18636088A JP H0542019 B2 JPH0542019 B2 JP H0542019B2
- Authority
- JP
- Japan
- Prior art keywords
- memory
- microprocessor
- data
- interrupt
- management unit
- 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
Description
【発明の詳細な説明】
〔産業上の利用分野〕
本発明は、マイクロプロセツサを使用してデー
タ処理を行なう際のメモリ管理方法に関する。DETAILED DESCRIPTION OF THE INVENTION [Field of Industrial Application] The present invention relates to a memory management method when data processing is performed using a microprocessor.
本発明は、データ処理を行ない、この処理され
たデータをモメモリにたくわえる処理を行なうマ
イクロプロセツサを用い、データ用メモリの管理
を高速に行なうために、データを用メモリを一定
の管理単位に区切ると共に、マイクロプロセツサ
が、前記データを前記データ用メモリに書き込み
あるいは読み出す場合に、割り込み式メモリ管理
回路により前記マイクロプロセツサのアドレスを
監視し、データ用メモリの前記管理単位の最終番
地を検出し、以後のデータ用メモリの書き込み動
作を禁止しマイクロプロセツサに対して割り込み
をかける。この割り込みをマイクロプロセツサが
受け、前記管理単位が終了したことを検出し、マ
イクロプロセツサは、前記割り込みを受けつけた
インストラクシヨンが、書き込みか読み出しか
と、最終番地から何回アクセスたかを、割り込み
式メモリ管理回路に保持されているフラグにより
判定し、1回のアクセスに対しては新たな管理単
位を用意してデータ処理を続け、複数回のアクセ
スに対しては、新たな管理単位を用意すると共に
新たな管理単位に対して前回の管理単位をこえて
読みこみを行なつた場合には、こえた回数分新た
な管理単位からデータを読みこみ、書きこみの場
合には、書き込み禁止を解除し、こえた回数分新
たな管理単位に対してデータを書きこみ処理をつ
づけるようにした。
The present invention uses a microprocessor that processes data and stores the processed data in memory, and divides the data memory into fixed management units in order to manage the data memory at high speed. Additionally, when the microprocessor writes or reads the data to or from the data memory, an interrupt type memory management circuit monitors the address of the microprocessor and detects the final address of the management unit in the data memory. , prohibits future data memory write operations and issues an interrupt to the microprocessor. The microprocessor receives this interrupt, detects that the management unit has ended, and uses the interrupt to determine whether the instruction that received the interrupt was a write or read, and how many times it accessed from the last address. Determined by the flag held in the memory management circuit, a new management unit is prepared for one access and data processing continues, and a new management unit is prepared for multiple accesses. At the same time, if data is read into a new management unit more than the previous management unit, data will be read from the new management unit for the number of times that exceeded, and if data is written, write protection will be applied. The process is now continued by writing data to new management units for the number of times exceeded.
従来、メモリの管理は、ソフトウエアにより、
管理単位の判定を行なわれるか、あるいは、専用
のメモリ管理素子又は、マイクロプロセツサに内
蔵されたメモリ管理素子により、マイクロプロセ
ツサのアドレス変換により行なわれていた。
Traditionally, memory management was done using software.
The determination of the management unit was performed, or the address conversion of the microprocessor was performed using a dedicated memory management element or a memory management element built into the microprocessor.
従来方法の課題は、専用のメモリ管理素子を使
用する方法においては、マイクロプロセツサを高
性能なコンピユータとして使用することを目的と
しているため、コンピユータとして必要な機能を
すべてふくめている関係から、データの管理だけ
を行ないたいという用途にはコスト的に非常に高
くついていた。又、ソフトウエアでデータ用メモ
リの管理を行なう方法は、安価であはあるが、デ
ータの処理速度が遅くなつていた。
The problem with conventional methods is that the purpose of using a dedicated memory management element is to use a microprocessor as a high-performance computer, and since it includes all the functions necessary for a computer, data The cost was extremely high for applications where only the management of data was desired. Furthermore, although the method of managing data memory using software is inexpensive, the data processing speed is slow.
従来の課題を解決するために、本発明では、高
価なメモリ管理素子を使用せず、また高速にデー
タ処理を行なえるように、マイクロプロセツサに
標準で装備されている割り込みを使用し、データ
用メモリの管理を行なう構成とした。
To solve the conventional problems, the present invention uses interrupts that are standard in microprocessors to process data at high speed without using expensive memory management elements. The configuration was designed to manage the memory for use.
マイクロプロセツサが、メモリに対して書き込
みあるいは読み出しを行なうと、メモリ管理回路
がアドレスの監視を行ない、管理単位の最終番地
を検出すると、前記メモリ管理回路がマイクロプ
ロセツサに対して割り込みを発生する。割り込み
を受けたマイクロプロセツサは、前記管理単位の
終了を検出し、新たな管理単位を用意し、メモリ
管理回路が保持しているフラグにより、前記割り
込みを受けつけたインストラクシヨンの内容を判
定し、前記内容に応じた処理を行ない、データ処
理をつづける。
When the microprocessor writes or reads from memory, the memory management circuit monitors the address, and when the final address of the management unit is detected, the memory management circuit generates an interrupt to the microprocessor. . The microprocessor that received the interrupt detects the end of the management unit, prepares a new management unit, and determines the contents of the instruction that received the interrupt based on the flag held by the memory management circuit. , performs processing according to the content and continues data processing.
以下、本発明の一実施例を図面に基づき説明す
る。
Hereinafter, one embodiment of the present invention will be described based on the drawings.
第1図を用いて本発明の概略を説明する。 An outline of the present invention will be explained using FIG.
マイクロプロセツサ1がメモリ3に対してアク
セスを行なうと、アドレスバス11、バス制御信
号13および読み出し時にはデータバス12が動
作し割り込み式メモリ管理回路2がこれを認識
し、あらかじめ決められたメモリ3の管理単位の
最終番地でなれば、割り込み式メモリ管理回路2
は、メモリ3に対してチツプセレクト17、リー
ド15またはライト16に信号を発生させ通常の
アクセスが行われる。マイクロプロセツサ1がメ
モリ3に対して管理単位の最終番地をアクセスす
ると、割り込み式メモリ管理回路2は、メモリ3
に対して通常のアクセスすると同時にマイクロプ
ロセツサ1に対して割り込み14を発生させる。
マイクロプロセツサ1は割り込みを前記アクセス
を行なつているインストラクシヨン中に認識し、
前記管理単位の終了を検出し、新たな管理単位を
用意し、割り込み式メモリ管理回路2が有する読
み出し書き込み区別フラグとアクセス回数区別フ
ラグにより前記インストラクシヨンの内容を判定
し、内容に応じた処理を行なつた後、再びデータ
処理が続けられる。 When the microprocessor 1 accesses the memory 3, the address bus 11, the bus control signal 13, and the data bus 12 operate when reading, and the interrupt type memory management circuit 2 recognizes this and accesses the predetermined memory 3. If it is the final address of the management unit, interrupt type memory management circuit 2
generates a chip select 17, read 15 or write 16 signal to the memory 3 and performs normal access. When the microprocessor 1 accesses the final address of the management unit in the memory 3, the interrupt type memory management circuit 2
An interrupt 14 is generated for the microprocessor 1 at the same time as normal access is made to the microprocessor 1.
The microprocessor 1 recognizes the interrupt during the accessing instruction;
Detects the end of the management unit, prepares a new management unit, determines the content of the instruction based on the read/write distinction flag and the access count distinction flag of the interrupt type memory management circuit 2, and processes according to the content. After that, data processing continues again.
次に本発明の実施例を第2図、第3図に基づい
て具体的に説明する。第2図は全体のブロツク図
を表わし、第3図は、割り込み式メモリ管理回路
2を詳細に表わした回路図である。 Next, an embodiment of the present invention will be specifically described based on FIGS. 2 and 3. FIG. 2 shows an overall block diagram, and FIG. 3 is a circuit diagram showing the interrupt type memory management circuit 2 in detail.
本実施例では、マイクロプロセツサ1は、デー
タバス12の幅が16ビツトとし、データ用メモリ
3へのアクセスは1ワード(16ビツト)単位で行
ない、データ用メモリ3をアクセスするインスト
ラクシヨンは、アクセス1回で行なわれる1ワー
ドアクセスまたはアクセス2回で行なわれる2ワ
ードアクセスとし、メモリの管理単位として2キ
ロバイトを使用する場合について説明する。マイ
クロプロセツサ1がデータ用メモリ3に対して書
き込み、あるいは読み出しを行なうと、マイクロ
プロセツサ1のバス制御信号13およびアドレス
バス11がアドレスデコーダ4に入力しアドレス
デコーダ4により、データ用メモリ選択信号
(RAMSELECT)23が発生する。割り込み式
メモリ管理回路2は、選択信号23を受けとり、
マイクロプロセツサ1のバス制御信号13の一部
である。バス読み出し書き込み制御信号(R/
W)18とともに、データ用メモリ3に対して、
メモリ制御信号である17,15,1
6を第3図のメモリR/Wコントロールブロツク
2Dより供給する。また割り込み式メモリ管理回
路2は、これと同時に、前記アクセスが、メモリ
管理単位の最終番地かどうかを第3図に示す
NANDゲート2Aにより、アドレスバス11の
うち下位のA1〜A10のアドレス線がすべて1
かどうかをもつて判定し、最終番地の場合には、
バスサイクルの開始にF/F2Bに0がラツチさ
れ、前記F/Fの出力がマイクロプロセツサ1へ
の割り込み()14となる。同時にF/F
2Cには、マイクロプロセツサ1にるアクセスが
読み出しか書き込みかの情報が保持される。バス
サイクルの終了時点には、F/F2Eが0とな
り、メモリ制御信号()16が禁止され以後
割り込みクリア信号()20がマイク
ロプロセツサ1からあたえられるまで、データ用
メモリ3を書きかえる動作は禁止される。F/F
2F,2Gはあらかじめ割り込みクリア信号
()20があたえられ、両方とも1が保
持されている。前記最終番地へアクセスが1ワー
ドで終了すると、F/F2Fには0、F/F2G
には1が保持され、前記最終番地へのアクセス
が、最終番地からの2ワードで行なわれると、
F/F2Fには0、F/F2Gには0が保持され
る。マイクロプロセツサ1は、割り込みを受けつ
けると、F/F2Bの出力R/Wフラグ19、
F/F2Fの出力フラグA24、F/F2Gの出
力フラグB25をI/Oポート5をアドレスデコ
ーダ4を介し、ステータスリード信号
()21により読みこみ、割り込み
を受けつけたインストラクシヨンサイクルの内容
を判定する。F/F2B,2F,2Gの内容が、
101の場合には、読み込み処理で、メモリ管理単
位の最終番地で終了したことを示し、読み込み用
の新しい管理単位を用意し、割り込みクリア信号
()20を発行し、再度データ処理を続
行する。F/F2B,2F,2Gの内容が100の
場合には、読み込み処理で、メモリ管理単位の最
終番地をこえて1ワード読みこんだことを示し、
読み込み用の新しい管理単位を用意し、割り込み
クリア信号()20を発行し新しい管
理単位の1ワード目を、読み込み用にあらかじめ
設定されているマイクロプロセツサ1の内部レジ
スタに読み込み、再度データ処理を続行する。
001の場合には、101で示した処理が書き込みとし
てあつわかれて処理され、000の場合には001で示
した処理が書き込みとして処理される。 In this embodiment, the microprocessor 1 assumes that the width of the data bus 12 is 16 bits, accesses the data memory 3 in units of 1 word (16 bits), and the instruction to access the data memory 3 is , a case will be described in which 1 word access is performed in one access or 2 word access is performed in two accesses, and 2 kilobytes are used as the memory management unit. When the microprocessor 1 writes to or reads from the data memory 3, the bus control signal 13 and address bus 11 of the microprocessor 1 are input to the address decoder 4, and the address decoder 4 outputs the data memory selection signal. (RAMSELECT) 23 occurs. The interrupt type memory management circuit 2 receives the selection signal 23,
This is part of the bus control signal 13 of the microprocessor 1. Bus read/write control signal (R/
W) Along with 18, for data memory 3,
17, 15, 1 which are memory control signals
6 is supplied from the memory R/W control block 2D in FIG. At the same time, the interrupt type memory management circuit 2 determines whether the access is to the final address of the memory management unit, as shown in FIG.
By the NAND gate 2A, all the lower address lines of A1 to A10 of the address bus 11 are set to 1.
If it is the final address, then
At the start of a bus cycle, 0 is latched in F/F 2B, and the output of said F/F becomes an interrupt () 14 to the microprocessor 1. F/F at the same time
2C holds information as to whether the access by the microprocessor 1 is for reading or writing. At the end of the bus cycle, F/F2E becomes 0, the memory control signal ( ) 16 is disabled, and the operation of rewriting the data memory 3 is performed until the interrupt clear signal ( ) 20 is given from the microprocessor 1. It is forbidden. F/F
2F and 2G are given an interrupt clear signal ( ) 20 in advance, and both are held at 1. When the access to the final address ends with one word, F/F2F has 0, F/F2G
is held as 1, and when the final address is accessed using two words from the final address,
0 is held in F/F2F and 0 is held in F/F2G. When the microprocessor 1 receives an interrupt, it sets the output R/W flag 19 of the F/F2B,
Read the output flag A24 of F/F2F and the output flag B25 of F/F2G through the I/O port 5 via the address decoder 4 using the status read signal ( ) 21 to determine the contents of the instruction cycle that received the interrupt. do. The contents of F/F2B, 2F, 2G are
In the case of 101, it indicates that the reading process has ended at the final address of the memory management unit, a new management unit for reading is prepared, an interrupt clear signal ( ) 20 is issued, and data processing is continued again. If the contents of F/F2B, 2F, and 2G are 100, it indicates that one word was read beyond the final address of the memory management unit during the read process.
Prepare a new management unit for reading, issue an interrupt clear signal ( ) 20, read the first word of the new management unit into the internal register of microprocessor 1 that has been set in advance for reading, and start data processing again. continue.
In the case of 001, the process indicated by 101 is processed as a write, and in the case of 000, the process indicated by 001 is processed as a write.
本実施例ではデータバスの幅が16ビツトの場合
を例にとり説明を行なつたが、他のマイクロプロ
セツサの場合についてもほぼ同一の回路で実現で
き、また2回以上のアクセスについてもF/F2
F,F/F2Gの数を増やすことにより容易に実
現が可能である。 Although this embodiment has been explained using the case where the data bus width is 16 bits, it can be realized using almost the same circuit for other microprocessors, and F/ F2
This can be easily realized by increasing the number of F, F/F2G.
以上、本発明はデータ用メモリの管理を、非常
に少ない部品で構成できるため、専用のメモリ管
理素子等を使う場合に比べ安価に作成でき、また
本発明を使用しないでソフトウエアによりメモリ
管理を行なうと、管理単位の境界を判定するた
め、1データごとにメモリアドレスの比較のイン
ストラクシヨンが入る為、非常に遅くなる。本発
明を使用することにより比較のイントラクシヨン
がなくなり、高速処理が実現できるという効果を
有する。
As described above, the present invention allows data memory management to be configured with a very small number of parts, so it can be created at a lower cost than when using a dedicated memory management element, and memory management can be performed by software without using the present invention. If this is done, an instruction to compare memory addresses is entered for each piece of data in order to determine the boundaries of the management unit, resulting in a very slow process. By using the present invention, there is no comparison instruction and high-speed processing can be realized.
第1図は、本発明の概略を表わすブロツク図、
第2図は、本発明の実施例を表わすブロツク図、
第3図は、本発明の実施例を表わす回路図であ
る。
1……マイクロプロセツサ、2……割り込み式
メモリ管理回路、3……データ用メモリ、4……
アドレスデコーダ、5……I/Oポート。
FIG. 1 is a block diagram showing the outline of the present invention;
FIG. 2 is a block diagram representing an embodiment of the present invention;
FIG. 3 is a circuit diagram representing an embodiment of the present invention. 1...Microprocessor, 2...Interrupt type memory management circuit, 3...Data memory, 4...
Address decoder, 5...I/O port.
Claims (1)
モリ管理を行なう方法において、マイクロプロセ
ツサが、前記データを前記メモリに書き込みある
いは読み出す場合に、前記マイクロプロセツサの
アドレスを監視し、前記メモリの前記管理単位の
最終番地を検出し、前記マイクロプロセツサに対
して割り込みを発生させると同時に、最終番地ア
クセス後は、前記メモリへの書き込みを禁止さ
せ、最終番地へのアクセスが読み込みかを区別す
るフラグを保持し、前記割り込みを発生させたイ
ンストラクシヨンが、最終番地から何回アクセス
を行なつたかを示すフラグを保持することによ
り、データ用のメモリの管理を行なうメモリ管理
方法。1 In a method for managing memory by dividing data memory into fixed units, when a microprocessor writes or reads data to or from the memory, the address of the microprocessor is monitored, and the A flag that detects the final address of a management unit, generates an interrupt to the microprocessor, and at the same time prohibits writing to the memory after accessing the final address, and distinguishes whether access to the final address is a read. A memory management method for managing memory for data by holding a flag indicating how many times the instruction that caused the interrupt has accessed from the final address.
Priority Applications (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| JP18636088A JPH0236442A (en) | 1988-07-26 | 1988-07-26 | Method for controlling memory |
Applications Claiming Priority (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| JP18636088A JPH0236442A (en) | 1988-07-26 | 1988-07-26 | Method for controlling memory |
Publications (2)
| Publication Number | Publication Date |
|---|---|
| JPH0236442A JPH0236442A (en) | 1990-02-06 |
| JPH0542019B2 true JPH0542019B2 (en) | 1993-06-25 |
Family
ID=16187010
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| JP18636088A Granted JPH0236442A (en) | 1988-07-26 | 1988-07-26 | Method for controlling memory |
Country Status (1)
| Country | Link |
|---|---|
| JP (1) | JPH0236442A (en) |
-
1988
- 1988-07-26 JP JP18636088A patent/JPH0236442A/en active Granted
Also Published As
| Publication number | Publication date |
|---|---|
| JPH0236442A (en) | 1990-02-06 |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| US5163146A (en) | System responsive to interrupt levels for changing and restoring clock speed by changing and restoring a register value | |
| JP3136257B2 (en) | Computer memory interface device | |
| JPH0236442A (en) | Method for controlling memory | |
| JPH03656B2 (en) | ||
| JPS603049A (en) | Bus interface apparatus | |
| JPS59197946A (en) | Memory device | |
| JPH09311812A (en) | Microcomputer | |
| JPS6019816B2 (en) | microprogram control adapter | |
| JPS63318651A (en) | Memory managing circuit | |
| JPH0447350A (en) | Main storage read/response control | |
| JPH04181454A (en) | Data access controller | |
| JPH0214741B2 (en) | ||
| JPS635432A (en) | Microprocessor | |
| JPH0258648B2 (en) | ||
| JPS6212555B2 (en) | ||
| JPH04337851A (en) | Memory access system | |
| JPS63188233A (en) | Central processing unit | |
| JPH0154729B2 (en) | ||
| JPH02206888A (en) | Microcomputer | |
| JPS5829046A (en) | Memory sorting system | |
| JPS61123951A (en) | Memory system | |
| JPS6174045A (en) | Channel control system in multi-processor system | |
| JPH1027153A (en) | Bus transfer device | |
| JPS6349942A (en) | Arithmetic processing unit | |
| JPH0232434A (en) | Memory access device |
Legal Events
| Date | Code | Title | Description |
|---|---|---|---|
| S533 | Written request for registration of change of name |
Free format text: JAPANESE INTERMEDIATE CODE: R313533 |
|
| R350 | Written notification of registration of transfer |
Free format text: JAPANESE INTERMEDIATE CODE: R350 |
|
| LAPS | Cancellation because of no payment of annual fees |