JPH0756805A - Memory access method - Google Patents

Memory access method

Info

Publication number
JPH0756805A
JPH0756805A JP5198433A JP19843393A JPH0756805A JP H0756805 A JPH0756805 A JP H0756805A JP 5198433 A JP5198433 A JP 5198433A JP 19843393 A JP19843393 A JP 19843393A JP H0756805 A JPH0756805 A JP H0756805A
Authority
JP
Japan
Prior art keywords
bank
record
address
memory
ring buffer
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.)
Granted
Application number
JP5198433A
Other languages
Japanese (ja)
Other versions
JP3042266B2 (en
Inventor
Masamichi Sakaino
真道 境野
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.)
Nissan Motor Co Ltd
Original Assignee
Nissan Motor Co Ltd
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 Nissan Motor Co Ltd filed Critical Nissan Motor Co Ltd
Priority to JP5198433A priority Critical patent/JP3042266B2/en
Priority to KR94019730A priority patent/KR970001918B1/en
Publication of JPH0756805A publication Critical patent/JPH0756805A/en
Application granted granted Critical
Publication of JP3042266B2 publication Critical patent/JP3042266B2/en
Anticipated expiration legal-status Critical
Expired - Lifetime legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F12/00Accessing, addressing or allocating within memory systems or architectures
    • G06F12/02Addressing or allocation; Relocation
    • G06F12/06Addressing a physical block of locations, e.g. base addressing, module addressing, memory dedication
    • G06F12/0646Configuration or reconfiguration
    • G06F12/0669Configuration or reconfiguration with decentralised address assignment
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F12/00Accessing, addressing or allocating within memory systems or architectures
    • G06F12/02Addressing or allocation; Relocation
    • G06F12/06Addressing a physical block of locations, e.g. base addressing, module addressing, memory dedication
    • G06F12/0638Combination 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)

Abstract

PURPOSE:To reduce a load by storing a bank as the address of a logical ring buffer memory and the data of records in a record pointer and performing memory access by calculating the desired address of the ring buffer memory from this record pointer. CONSTITUTION:The record pointer of a microprocessor unit (MPU) is composed of 8 bits, this is defined as a bank value by shifting 6 bits, this value is written in an 8-bit adder and added with bank offset, the Oth and 1st bits of it are written in a bank selector for selecting the bank and with the Oth and 1st bits as the bank, the bank of a random access memory (RAM) as the logical ring buffer memory is selected. The record pointer is masked by the MPU, defined as an offset value, multiplied by the 8-bit shift register just for the size of a record as many as the maximum number of bytes set to one record, and turned to the address of the RAM, the bank and the record are calculated, and the address of the memory is accessed.

Description

【発明の詳細な説明】Detailed Description of the Invention

【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 factory facilities is a microprocessor unit (hereinafter, MPU).
Write. ) And random access memory (hereinafter RA)
Write as M. ) And so on. When the built-in MPU also accesses the RAM in the PLC, the built-in MPU performs the processing 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 bank record number B, which is the maximum record number per bank, are read from a register temporarily stored in the MPU (S20). ). This record pointer A is divided by the number of records in the bank B, the quotient obtained by this division is taken as the bank value C, and the remainder is taken as the offset value D (S21). The bank value C is added to the bank offset E to obtain the bank F (S22). Further, the offset value D is multiplied by the record size G which is the maximum number of bytes set for one record, and the record offset E is added to obtain the address J (S23).

【0004】このように算出されたバンクFとアドレス
Jから所望のメモリの番地を割り出し、この割り出した
番地にしたがってメモリをアクセスしていた。
From the bank F and the address J calculated in this way, an address of a desired memory is determined, and the memory is accessed according to the determined address.

【0005】[0005]

【発明が解決しようとする課題】一般的にMPUは、演
算機能のうち除算機能も有しているが、除算は加算,乗
算と比較すると処理ステップが多くなることから処理速
度が遅くなる。この処理速度の遅れは必要なデータのア
ドレスを算出する時の遅れ時間となる。
Generally, the MPU also has a division function among the arithmetic functions, but the division has more processing steps than the addition and multiplication, and therefore the processing speed becomes slow. This delay in processing speed becomes a delay time when the address of necessary data is calculated.

【0006】したがって、前記レジスタを除算して目的
のアドレスを算出する場合、PLC内のMPUが高速処
理可能なMPUであるときは問題ないが、コストとの兼
ね合いもあり多くのPLCには従来、一般的に用いられ
ているMPUでは、結果としてメモリアクセス時間が大
きくなり、多量のメモリアクセスまたは高速のメモリア
クセスに問題が生じていた。
Therefore, when the target address is calculated by dividing the register, there is no problem when the MPU in the PLC is a MPU capable of high-speed processing, but there is a tradeoff with cost because many PLCs have been In the MPU generally used, as a result, the memory access time becomes long, and a problem occurs in a large amount of memory access or high-speed memory access.

【0007】そこで、本発明の目的は、MPUのメモリ
アクセスに係る負荷を軽減し、一般的に用いられるMP
Uであっても多量のメモリアクセスまたは高速のメモリ
アクセスを可能とするメモリアクセス方法を提供するこ
とにある。
Therefore, an object of the present invention is to reduce the load related to memory access of the MPU and to use a commonly used MP.
Another 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 for U.

【0008】[0008]

【課題を解決するための手段】上記の目的を達成するた
めの本発明は、記憶領域を複数に分割するバンクと、さ
らに当該バンクを複数に分割するレコードからなり、前
記バンクに入出力されるデータを前記バンクに順番に記
憶し、前記バンクの終りまで記憶されると再び最初から
順番に記憶する論理リングバッファメモリをアクセスす
るメモリアクセス方法において、前記論理リングバッフ
ァメモリの番地であるバンクとレコードのデータを格納
するレコードポインタを設け、当該レコードポインタか
ら所望の前記論理リングバッファメモリの番地を割り出
しアクセスすることを特徴とする。
In order to achieve the above object, the present invention comprises a bank for dividing a storage area into a plurality and a record for dividing the storage area into a plurality of banks, and the records are input to and output from the bank. In a memory access method of sequentially storing data in the bank and accessing the logical ring buffer memory that is sequentially stored again from the beginning when the data is stored up to the end of the bank, a bank and a record which are addresses of the logical ring buffer memory. Is provided, and a desired address of the logical ring buffer memory is indexed and accessed from the record pointer.

【0009】[0009]

【作用】本発明のメモリアクセス方法は、レコードポイ
ンタに論理リングバッファメモリの番地であるバンクと
レコードのデータを格納し、このレコードポインタから
所望の論理リングバッファメモリの番地を割り出しメモ
リアクセスを行う。
According to the memory access method of the present invention, the record pointer stores the address of the logical ring buffer memory, that is, the data of the bank and the record, and the address of the desired logical ring buffer memory is determined from this record pointer to perform the memory access.

【0010】[0010]

【実施例】以下添付した図面を参照して、本発明のメモ
リアクセス方法を説明する。
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 consisting of a record obtained by dividing one of a plurality of banks into a plurality of records and a record pointer in which the data of the bank and the record are written are processed. The address is indexed by this.

【0012】例えば一実施例である図1のようにMPU
1内に記憶されているレコードポインタは、8ビットで
構成されており第0〜5ビットはアドレスのデータであ
るオフセットパラメータ、第6〜7ビットはバンクのデ
ータであるバンクパラメータがそれぞれ割り付けられて
いる。次に、データ処理を行うMPU1はこのレコード
ポインタを6ビットシフトすることでバンク値とし、こ
のバンク値を8ビット加算器5へ書き込みバンクオフセ
ットと加算し、その内の第0、1ビットをバンクを選択
するバンクセレクタ6に書き込み、このバンクセレクタ
はこの第0、1ビットをバンクとして論理リングバッフ
ァメモリであるRAM4のバンクを選択する。
For example, an MPU as shown in FIG.
The record pointer stored in 1 is composed of 8 bits, and 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. There is. Next, the MPU 1 which performs data processing shifts this record pointer by 6 bits to form a bank value, writes this bank value to the 8-bit adder 5 and adds it to the bank offset, and the 0th and 1st bits of that are added to the bank value. Is written in the bank selector 6 for selecting the bank selector, and the bank selector selects the bank of the RAM 4 which is the logical ring buffer memory with the 0th and 1st bits as banks.

【0013】一方、前述のレコードポインタはMPU1
によりマスクされオフセット値とされる。このオフセッ
ト値は一レコードに設定された最大バイト数であるレコ
ードサイズ分だけ8ビットシフトレジスタで乗算して、
さらに8ビット加算器3によりレコードオフセットと加
算されRAM4のアドレスとなる。
On the other hand, the above-mentioned record pointer is the MPU1.
Is masked by and set as an offset value. This offset value is multiplied by the record size, which is the maximum number of bytes set in one record, in the 8-bit shift register,
Further, it is added to the record offset by the 8-bit adder 3 and becomes the address of the RAM 4.

【0014】以上のようにレコードポインタを処理し、
バンクとレコードを求め所望の論理バッファメモリの番
地をアクセスすることができる。
The record pointer is processed as described above,
It is possible to obtain a bank and a record and access an address of a desired logical buffer memory.

【0015】なお、論理リングバッファメモリであるR
AM4の記憶領域の概念は、図2(a)のように0〜3
までの4つのバンクに分割されていて、さらにこの一バ
ンクはアドレス00H〜FFH間でのレコードに分割さ
れる。このような概念で分割されたRAM4は図2
(b)のようにバンク0〜バンク3まで回転方向に順番
にデータを読み込みまたは書き込みを行いバンク3まで
データが書き込まれると再びバンク0からデータを書き
込む。
The logical ring buffer memory R
The concept of the storage area of AM4 is 0 to 3 as shown in FIG.
Up to four banks, and this one bank is further divided into records between addresses 00H and FFH. The RAM 4 divided by such a concept is shown in FIG.
As shown in (b), data is sequentially read or written from bank 0 to bank 3 in the rotation direction, and when data is written to bank 3, data is again written from bank 0.

【0016】このデータの読み込みは読み出しポインタ
R0 〜R8 の8個の読み出しポインタで、データの書き
込みは書き込みポインタWにてそれぞれ行われる。
The reading of the data is performed by the 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)。
A flow chart of the control for obtaining the bank and address from the record pointer is as shown in FIG. 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). Further, the record pointer is masked with the offset mask M to obtain the offset value D (S12). Next, this bank value C
Adds bank offset E to obtain bank F (S1
3). Further, the offset value D is multiplied by the record size G which is the maximum number of bytes set in one record, and the record offset E is added to obtain the address J (S14).

【0018】このように動作させることにより、本発明
のメモリアクセス方法はレコードポインタに格納されて
いるバンクとレコードのデータから所望の論理リングバ
ッファメモリの番地を割り出しメモリアクセスを行うの
で、MPUのメモリアクセスに係る負荷を軽減すること
ができる。
By operating in this way, the memory access method of the present invention determines the address of the desired logical ring buffer memory from the data of the bank and record stored in the record pointer and performs the memory access. The access load can be reduced.

【0019】[0019]

【発明の効果】以上、述べたように本発明によれば、M
PUのメモリアクセスに係る負荷を軽減し得るので、多
量のメモリアクセスまたは高速のメモリアクセスが可能
となる。
As described above, according to the present invention, M
Since the load on the PU memory access can be reduced, a large amount of memory access or high-speed memory access can be performed.

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

【図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 illustrating a logical ring buffer memory.

【図3】 本発明のメモリアクセス方法の制御を説明す
るためのフローチャートである。
FIG. 3 is a flowchart for explaining control of the memory access method of the present invention.

【図4】 従来のメモリアクセス方法の制御を説明する
ためのフローチャートである。
FIG. 4 is a flowchart for explaining control of a conventional memory access method.

【符号の説明】[Explanation of symbols]

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)

【特許請求の範囲】[Claims] 【請求項1】 記憶領域を複数に分割するバンクと、さ
らに当該バンクを複数に分割するレコードからなり、前
記バンクに入出力されるデータを前記バンクに順番に記
憶し、前記バンクの終りまで記憶されると再び最初から
順番に記憶する論理リングバッファメモリをアクセスす
るメモリアクセス方法において、 前記論理リングバッファメモリの番地であるバンクとレ
コードのデータを格納するレコードポインタを設け、当
該レコードポインタから所望の前記論理リングバッファ
メモリの番地を割り出しアクセスすることを特徴とする
メモリアクセス方法。
1. A bank, which divides a storage area into a plurality of areas, and a record, which further divides the bank into a plurality of areas. Then, in the memory access method for accessing the logical ring buffer memory which is sequentially stored again from the beginning, a record pointer for storing data of a bank and a record, which is an address of the logical ring buffer memory, is provided, and a desired pointer is provided from the record pointer. A memory access method, characterized in that an address of the logical ring buffer memory is indexed and accessed.
JP5198433A 1993-08-10 1993-08-10 Memory access method Expired - Lifetime JP3042266B2 (en)

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 true JPH0756805A (en) 1995-03-03
JP3042266B2 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)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2006260411A (en) * 2005-03-18 2006-09-28 Japan Radio Co Ltd Signal processor, and communication equipment using the same

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
KR970066894A (en) * 1996-03-08 1997-10-13 김광호 High-speed data access method

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP2006260411A (en) * 2005-03-18 2006-09-28 Japan Radio Co Ltd Signal processor, and communication equipment using the same

Also Published As

Publication number Publication date
KR950006602A (en) 1995-03-21
KR970001918B1 (en) 1997-02-19
JP3042266B2 (en) 2000-05-15

Similar Documents

Publication Publication Date Title
US6381668B1 (en) Address mapping for system memory
US5636153A (en) Digital signal processing circuit
JPH0752576B2 (en) Stack memory
JP3042266B2 (en) Memory access method
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
JP3923010B2 (en) Memory control circuit
JPS58208981A (en) Address control circuit
JPS62171052A (en) Memory structure
JPS63136710A (en) Digital signal processing circuit
JP2595992B2 (en) Electronic musical instrument
JPS6382530A (en) Semiconductor storage device
KR0168973B1 (en) Rom accessing method and its apparatus
KR100551458B1 (en) Digital signal processing operation method and digital signal processor
JPH0719221B2 (en) Memory control method
JP3288074B2 (en) Address generation circuit
JP2845746B2 (en) Micro program controller
JPH0540601A (en) Address generating circuit
JPH05290080A (en) Parallel processor
JPH04225453A (en) Data processor
JPH04321993A (en) Storage control device
JPS61288613A (en) Digital filter
JPS6081660A (en) Data transfer system
JPS62172460A (en) Data pointer circuit
JPS6388657A (en) Memory device
JPH0376504B2 (en)

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