JP3042266B2 - Memory access method - Google Patents
Memory access methodInfo
- Publication number
- JP3042266B2 JP3042266B2 JP5198433A JP19843393A JP3042266B2 JP 3042266 B2 JP3042266 B2 JP 3042266B2 JP 5198433 A JP5198433 A JP 5198433A JP 19843393 A JP19843393 A JP 19843393A JP 3042266 B2 JP3042266 B2 JP 3042266B2
- Authority
- JP
- Japan
- Prior art keywords
- bank
- record
- offset
- value
- data
- 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 - Lifetime
Links
Classifications
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F12/00—Accessing, addressing or allocating within memory systems or architectures
- G06F12/02—Addressing or allocation; Relocation
- G06F12/06—Addressing a physical block of locations, e.g. base addressing, module addressing, memory dedication
- G06F12/0646—Configuration or reconfiguration
- G06F12/0669—Configuration or reconfiguration with decentralised address assignment
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F12/00—Accessing, addressing or allocating within memory systems or architectures
- G06F12/02—Addressing or allocation; Relocation
- G06F12/06—Addressing a physical block of locations, e.g. base addressing, module addressing, memory dedication
- G06F12/0638—Combination of memories, e.g. ROM and RAM such as to permit replacement or supplementing of words in one module by words in another module
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Memory System (AREA)
Description
【0001】[0001]
【産業上の利用分野】本発明は、メモリアクセス方法に
関する。BACKGROUND OF THE INVENTION 1. Field of the Invention The present invention relates to a memory access method.
【0002】[0002]
【従来の技術】従来、工場の設備の制御を行うプログラ
マブルロジックコントローラ(以下、PLCと記述す
る。)は、マイクロプロセッサユニット(以下、MPU
と記述する。)とランダムアクセスメモリ(以下、RA
Mと記述する。)などを内蔵している。この内蔵された
MPUは、同じくPLC内のRAMにデータをアクセス
する場合、図4のフローチャートのような処理を行う。2. Description of the Related Art Conventionally, a programmable logic controller (hereinafter, referred to as PLC) for controlling equipment in a factory has a microprocessor unit (hereinafter, referred to as MPU).
It is described. ) And random access memory (hereinafter RA)
Described as M. ) And so on. When accessing data in the RAM in the PLC, the built-in MPU performs a process as shown in the flowchart of FIG.
【0003】まず、所望のメモリの番地のデータを格納
するレコードポインタAと、一バンク当たりの最大レコ
ード数であるバンク内レコード数BをMPU内に一時的
に記憶されているレジスタから読み込む(S20)。こ
のレコードポインタAをバンク内レコード数Bで除算
し、この除算による商をバンク値C、余りをオフセット
値Dとする(S21)。このバンク値Cはバンクオフセ
ットEを加算し、バンクFを得る(S22)。また、オ
フセット値Dは一レコードに設定した最大バイト数であ
るレコードサイズGと乗算し、さらにレコードオフセッ
トEを加算することでアドレスJを得る(S23)。First, a record pointer A for storing data at a desired memory address and a number B of records in a bank, which is the maximum number of records per bank, are read from a register temporarily stored in the MPU (S20). ). The record pointer A is divided by the number of records B in the bank, and the quotient obtained by the division is set as the bank value C and the remainder is set as the offset value D (S21). The bank value C is added to the bank offset E to obtain the bank F (S22). The address J is obtained by multiplying the offset value D by the record size G, which is the maximum number of bytes set for one record, and further adding the record offset E (S23).
【0004】このように算出されたバンクFとアドレス
Jから所望のメモリの番地を割り出し、この割り出した
番地にしたがってメモリをアクセスしていた。The address of a desired memory is determined from the bank F and the address J calculated as described above, and the memory is accessed according to the determined address.
【0005】[0005]
【発明が解決しようとする課題】一般的にMPUは、演
算機能のうち除算機能も有しているが、除算は加算,乗
算と比較すると処理ステップが多くなることから処理速
度が遅くなる。この処理速度の遅れは必要なデータのア
ドレスを算出する時の遅れ時間となる。Generally, the MPU also has a division function among the operation functions. However, the division requires more processing steps than the addition and multiplication, so that the processing speed is reduced. This delay in processing speed is a delay time when calculating addresses of necessary data.
【0006】したがって、前記レジスタを除算して目的
のアドレスを算出する場合、PLC内のMPUが高速処
理可能なMPUであるときは問題ないが、コストとの兼
ね合いもあり多くのPLCには従来、一般的に用いられ
ているMPUでは、結果としてメモリアクセス時間が大
きくなり、多量のメモリアクセスまたは高速のメモリア
クセスに問題が生じていた。Therefore, when calculating the target address by dividing the register, there is no problem if the MPU in the PLC is an MPU capable of high-speed processing. In the generally used MPU, as a result, the memory access time becomes long, and a problem has arisen in a large amount of memory access or high-speed memory access.
【0007】そこで、本発明の目的は、MPUのメモリ
アクセスに係る負荷を軽減し、一般的に用いられるMP
Uであっても多量のメモリアクセスまたは高速のメモリ
アクセスを可能とするメモリアクセス方法を提供するこ
とにある。It is an object of the present invention to reduce the load on the memory access of the MPU, and to reduce the
An object of the present invention is to provide a memory access method that enables a large amount of memory access or high-speed memory access even if U is used.
【0008】[0008]
【課題を解決するための手段】上記の目的を達成するた
めの本発明は、記憶領域を複数に分割するバンクと、さ
らに当該バンクを複数に分割するレコードからなり、前
記バンクに入出力されるデータを前記バンクに順番に記
憶し、前記バンクの終りまで記憶されると再び最初から
順番に記憶する論理リングバッファメモリをアクセスす
るメモリアクセス方法において、前記論理リングバッフ
ァメモリの番地であるバンクとレコードのデータによっ
て構成されるレコードポインタを設け、前記レコードポ
インタのデータを所定ビットシフトさせてバンク値と
し、このバンク値にバンクオフセットを加算してバンク
を求め、次に、前記レコードポインタのデータを所望の
オフセットマスクでマスクしてオフセット値とし、この
オフセット値にレコードサイズを乗算し、得られた値に
レコードオフセットを加算してアドレスを求め、求めら
れたバンクとアドレスにより前記論理リングバッファメ
モリをアクセスすることを特徴とする。SUMMARY OF THE INVENTION The present invention for achieving the above object comprises a bank for dividing a storage area into a plurality of parts, and a record for further dividing the bank into a plurality of parts. A memory access method for accessing a logical ring buffer memory in which data is sequentially stored in the bank, and stored again from the beginning when the data is stored until the end of the bank. depending on the data
The record pointer configured Te provided, the Rekodopo
The data of the interface is shifted by a predetermined bit and the bank value is
And add the bank offset to this bank value
Then, the data of the record pointer is
Use an offset mask to set the offset value,
Multiply the offset value by the record size and multiply the resulting value by
Add the record offset to find the address,
The logical ring buffer memory according to the
It is characterized by accessing a memory .
【0009】[0009]
【作用】本発明のメモリアクセス方法は、レコードポイ
ンタに論理リングバッファメモリの番地であるバンクと
レコードのデータを格納し、このレコードポインタから
所望の論理リングバッファメモリの番地を割り出しメモ
リアクセスを行う。According to the memory access method of the present invention, data of a bank and a record, which are addresses of a logical ring buffer memory, are stored in a record pointer, and a desired logical ring buffer memory address is determined from the record pointer to perform memory access.
【0010】[0010]
【実施例】以下添付した図面を参照して、本発明のメモ
リアクセス方法を説明する。DETAILED DESCRIPTION OF THE PREFERRED EMBODIMENTS A memory access method according to the present invention will be described below with reference to the accompanying drawings.
【0011】本発明のメモリアクセス方法には、複数の
バンクのさらに一つのバンクを複数に分割したレコード
からなる論理リングバッファメモリと、このバンクとレ
コードのデータが書き込まれているレコードポインタを
処理することで番地の割り出しが行われる。According to the memory access method of the present invention, a logical ring buffer memory composed of a record obtained by further dividing one bank of a plurality of banks and a record pointer in which data of the bank and the record are written are processed. Thus, the address is determined.
【0012】例えば一実施例である図1のようにMPU
1内に記憶されているレコードポインタは、8ビットで
構成されており第0〜5ビットはアドレスのデータであ
るオフセットパラメータ、第6〜7ビットはバンクのデ
ータであるバンクパラメータがそれぞれ割り付けられて
いる。次に、データ処理を行うMPU1はこのレコード
ポインタを6ビットシフトすることでバンク値とし、こ
のバンク値を8ビット加算器5へ書き込みバンクオフセ
ットと加算し、その内の第0、1ビットをバンクを選択
するバンクセレクタ6に書き込み、このバンクセレクタ
はこの第0、1ビットをバンクとして論理リングバッフ
ァメモリであるRAM4のバンクを選択する。For example, as shown in FIG.
The record pointer stored in 1 is composed of 8 bits. The 0th to 5th bits are assigned offset parameters which are address data, and the 6th to 7th bits are assigned bank parameters which are bank data. I have. Next, the MPU 1 which performs data processing shifts the record pointer by 6 bits to obtain a bank value, writes the bank value to the 8-bit adder 5 and adds it to the bank offset. Is written to the bank selector 6 which selects the 0th and 1st bits as a bank and selects the bank of the RAM 4 which is a logical ring buffer memory.
【0013】一方、前述のレコードポインタはMPU1
によりマスクされオフセット値とされる。このオフセッ
ト値は一レコードに設定された最大バイト数であるレコ
ードサイズ分だけ8ビットシフトレジスタで乗算して、
さらに8ビット加算器3によりレコードオフセットと加
算されRAM4のアドレスとなる。On the other hand, the above-mentioned record pointer is MPU1
And is used as an offset value. This offset value is multiplied by the record size, which is the maximum number of bytes set in one record, by an 8-bit shift register,
Further, the data is added to the record offset by the 8-bit adder 3 to be an address of the RAM 4.
【0014】以上のようにレコードポインタを処理し、
バンクとレコードを求め所望の論理バッファメモリの番
地をアクセスすることができる。Processing the record pointer as described above,
A bank and a record are obtained, and a desired address of the logical buffer memory can be accessed.
【0015】なお、論理リングバッファメモリであるR
AM4の記憶領域の概念は、図2(a)のように0〜3
までの4つのバンクに分割されていて、さらにこの一バ
ンクはアドレス00H〜FFH間でのレコードに分割さ
れる。このような概念で分割されたRAM4は図2
(b)のようにバンク0〜バンク3まで回転方向に順番
にデータを読み込みまたは書き込みを行いバンク3まで
データが書き込まれると再びバンク0からデータを書き
込む。Note that the logical ring buffer memory R
The concept of the storage area of AM4 is 0 to 3 as shown in FIG.
Are divided into four banks, and this one bank is further divided into records between addresses 00H to FFH. The RAM 4 divided by such a concept is shown in FIG.
As shown in (b), data is read or written sequentially from bank 0 to bank 3 in the rotation direction. When data is written to bank 3, data is written again from bank 0.
【0016】このデータの読み込みは読み出しポインタ
R0 〜R8 の8個の読み出しポインタで、データの書き
込みは書き込みポインタWにてそれぞれ行われる。The reading of the data is performed by eight reading pointers R0 to R8, and the writing of the data is performed by the writing pointer W.
【0017】レコードポインタからバンクとアドレスを
求める制御のフローチャートは、図3のようになる。つ
まり、レコードポインタAを読み込み(S10)、レコ
ードポインタAを6ビット右にシフトし、このシフトし
た値をバンク値Cとする(S11)。また、レコードポ
インタをオフセットマスクMでマスクすることによりオ
フセット値Dとする(S12)。次に、このバンク値C
はバンクオフセットEを加算し、バンクFを得る(S1
3)。また、オフセット値Dは一レコードに設定した最
大バイト数であるレコードサイズGと乗算し、さらにレ
コードオフセットEを加算することでアドレスJを得る
(S14)。FIG. 3 is a flowchart of control for obtaining a bank and an address from a record pointer. That is, the record pointer A is read (S10), the record pointer A is shifted right by 6 bits, and the shifted value is set as the bank value C (S11). Also, the record pointer is masked with an offset mask M to obtain an offset value D (S12). Next, this bank value C
Adds the bank offset E to obtain the bank F (S1
3). The address J is obtained by multiplying the offset value D by the record size G, which is the maximum number of bytes set for one record, and further adding the record offset E (S14).
【0018】このように動作させることにより、本発明
のメモリアクセス方法はレコードポインタに格納されて
いるバンクとレコードのデータから所望の論理リングバ
ッファメモリの番地を割り出しメモリアクセスを行うの
で、MPUのメモリアクセスに係る負荷を軽減すること
ができる。By operating as described above, the memory access method of the present invention determines the address of the desired logical ring buffer memory from the bank and record data stored in the record pointer and performs memory access. The load related to access can be reduced.
【0019】[0019]
【発明の効果】以上に述べたように、本発明によれば、
MPUのメモリアクセスにかかる負荷を軽減し得るの
で、多量のメモリアクセスまたは高速のメモリアクセス
が可能となる。As described above, according to the present invention,
Since the load on the memory access of the MPU can be reduced, a large amount of memory access or high-speed memory access can be performed.
【図1】 本発明のメモリアクセス方法を動作させる回
路の一実施例である。FIG. 1 is an embodiment of a circuit for operating a memory access method of the present invention.
【図2】 論理リングバッファメモリを説明するための
図面である。FIG. 2 is a diagram for explaining a logical ring buffer memory.
【図3】 本発明のメモリアクセス方法の制御を説明す
るためのフローチャートである。FIG. 3 is a flowchart illustrating control of a memory access method according to the present invention.
【図4】 従来のメモリアクセス方法の制御を説明する
ためのフローチャートである。FIG. 4 is a flowchart illustrating control of a conventional memory access method.
1…MPU、 2…8ビッ
トシフトレジスタ、3、5…8ビット加算器、
4…RAM、6…バンクセレクタ。1 ... MPU, 2 ... 8-bit shift register, 3, 5 ... 8-bit adder,
4 ... RAM, 6 ... Bank selector.
Claims (1)
らに当該バンクを複数に分割するレコードからなり、前
記バンクに入出力されるデータを前記バンクに順番に記
憶し、前記バンクの終りまで記憶されると再び最初から
順番に記憶する論理リングバッファメモリをアクセスす
るメモリアクセス方法において、 前記論理リングバッファメモリの番地であるバンクとレ
コードのデータによって構成されるレコードポインタを
設け、前記レコードポインタのデータを所定ビットシフトさせ
てバンク値とし、このバンク値にバンクオフセットを加
算してバンクを求め、 次に、前記レコードポインタのデータを所望のオフセッ
トマスクでマスクしてオフセット値とし、このオフセッ
ト値にレコードサイズを乗算し、得られた値にレコード
オフセットを加算してアドレスを求め、 求められたバンクとアドレスにより前記論理リングバッ
ファメモリを アクセスすることを特徴とするメモリアク
セス方法。1. A bank for dividing a storage area into a plurality of parts, and a record for further dividing the bank into a plurality of parts. Data input / output to / from the banks are sequentially stored in the banks, and stored until the end of the banks. A memory access method for accessing the logical ring buffer memory that stores the data sequentially from the beginning when it is executed, further comprising: providing a record pointer constituted by bank and record data which are addresses of the logical ring buffer memory; Is shifted by a predetermined bit
The bank value, and add the bank offset to this bank value.
Then, the bank is obtained, and then the data of the record pointer is shifted to a desired offset.
The offset value by masking with the offset mask.
Value is multiplied by the record size, and the resulting value is
An address is obtained by adding an offset, and the logical ring buffer is obtained based on the obtained bank and address.
Memory access method characterized by accessing Famemori.
Priority Applications (2)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| JP5198433A JP3042266B2 (en) | 1993-08-10 | 1993-08-10 | Memory access method |
| KR94019730A KR970001918B1 (en) | 1993-08-10 | 1994-08-10 | Memory access apparatus and its method |
Applications Claiming Priority (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| JP5198433A JP3042266B2 (en) | 1993-08-10 | 1993-08-10 | Memory access method |
Publications (2)
| Publication Number | Publication Date |
|---|---|
| JPH0756805A JPH0756805A (en) | 1995-03-03 |
| JP3042266B2 true JP3042266B2 (en) | 2000-05-15 |
Family
ID=16391009
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| JP5198433A Expired - Lifetime JP3042266B2 (en) | 1993-08-10 | 1993-08-10 | Memory access method |
Country Status (2)
| Country | Link |
|---|---|
| JP (1) | JP3042266B2 (en) |
| KR (1) | KR970001918B1 (en) |
Families Citing this family (2)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| KR970066894A (en) * | 1996-03-08 | 1997-10-13 | 김광호 | High-speed data access method |
| JP2006260411A (en) * | 2005-03-18 | 2006-09-28 | Japan Radio Co Ltd | Signal processing apparatus and communication equipment using the same |
-
1993
- 1993-08-10 JP JP5198433A patent/JP3042266B2/en not_active Expired - Lifetime
-
1994
- 1994-08-10 KR KR94019730A patent/KR970001918B1/en not_active Expired - Fee Related
Also Published As
| Publication number | Publication date |
|---|---|
| JPH0756805A (en) | 1995-03-03 |
| KR970001918B1 (en) | 1997-02-19 |
| KR950006602A (en) | 1995-03-21 |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| US6381668B1 (en) | Address mapping for system memory | |
| JPH0612487A (en) | Sample rate converter for picture data | |
| US5287309A (en) | High-speed stack memory | |
| US5636153A (en) | Digital signal processing circuit | |
| US6684267B2 (en) | Direct memory access controller, and direct memory access control method | |
| KR100474357B1 (en) | A method for memory allocation using multi-level partition | |
| JP3042266B2 (en) | Memory access method | |
| US5918253A (en) | Memory address generator | |
| US4301514A (en) | Data processor for processing at one time data including X bytes and Y bits | |
| JP2856064B2 (en) | Digital filter | |
| US5708842A (en) | Apparatus for changing coefficients utilized to perform a convolution operation having address generator which uses initial count number and up/down count inputs received from external | |
| US6202187B1 (en) | Pattern generator for use in a semiconductor test device | |
| JP2595992B2 (en) | Electronic musical instrument | |
| JPS63136710A (en) | Digital signal processing circuit | |
| JPH0553920A (en) | Structured address generator | |
| KR100215903B1 (en) | Read/write circuit for memory | |
| JP2716563B2 (en) | Data write control method | |
| KR0168973B1 (en) | Rom accessing method and its apparatus | |
| JPH0364111A (en) | Memory device and digital signal processor using the memory device | |
| JPS62171052A (en) | Memory structure | |
| CN117194281A (en) | Asymmetric access method for variable-length data in ASIC | |
| JP2845746B2 (en) | Micro program controller | |
| JP2850594B2 (en) | RAM address generation circuit | |
| JP3288074B2 (en) | Address generation circuit | |
| JPH0218638A (en) | Data control system |
Legal Events
| Date | Code | Title | Description |
|---|---|---|---|
| FPAY | Renewal fee payment (event date is renewal date of database) |
Free format text: PAYMENT UNTIL: 20090310 Year of fee payment: 9 |
|
| FPAY | Renewal fee payment (event date is renewal date of database) |
Free format text: PAYMENT UNTIL: 20100310 Year of fee payment: 10 |
|
| FPAY | Renewal fee payment (event date is renewal date of database) |
Free format text: PAYMENT UNTIL: 20110310 Year of fee payment: 11 |
|
| FPAY | Renewal fee payment (event date is renewal date of database) |
Free format text: PAYMENT UNTIL: 20110310 Year of fee payment: 11 |
|
| FPAY | Renewal fee payment (event date is renewal date of database) |
Free format text: PAYMENT UNTIL: 20120310 Year of fee payment: 12 |
|
| FPAY | Renewal fee payment (event date is renewal date of database) |
Free format text: PAYMENT UNTIL: 20130310 Year of fee payment: 13 |