[go: up one dir, main page]

JP2007272562A - Fifo memory - Google Patents

Fifo memory Download PDF

Info

Publication number
JP2007272562A
JP2007272562A JP2006097356A JP2006097356A JP2007272562A JP 2007272562 A JP2007272562 A JP 2007272562A JP 2006097356 A JP2006097356 A JP 2006097356A JP 2006097356 A JP2006097356 A JP 2006097356A JP 2007272562 A JP2007272562 A JP 2007272562A
Authority
JP
Japan
Prior art keywords
write
pointer
write pointer
read
clock signal
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
JP2006097356A
Other languages
Japanese (ja)
Inventor
Naotoshi Nishioka
直俊 西岡
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.)
Yamaha Corp
Original Assignee
Yamaha 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 Yamaha Corp filed Critical Yamaha Corp
Priority to JP2006097356A priority Critical patent/JP2007272562A/en
Publication of JP2007272562A publication Critical patent/JP2007272562A/en
Pending legal-status Critical Current

Links

Images

Landscapes

  • Information Transfer Systems (AREA)

Abstract

<P>PROBLEM TO BE SOLVED: To provide a FIFO memory improved in data transmission efficiency. <P>SOLUTION: The memory comprises a dual port RAM (110) as storing means having a first access port to be operated in synchronization with a first clock signal and a second access port to be operated in synchronization with a second clock signal, a write pointer producing circuit (120) as write pointer producing means for producing a write pointer based on a write signal to be inputted to the first access port, a read pointer producing circuit (150) as read pointer producing means for producing a read pointer based on a read signal to be inputted to the second access port, and a full/empty determining circuit (140) as determining means for determining a storage area of the storing means to be full when difference between the write pointer and the read pointer becomes not larger than a predetermined margin. <P>COPYRIGHT: (C)2008,JPO&INPIT

Description

本発明は、互いに非同期なクロックでリード/ライト動作が可能なデュアルポートRAMを利用したFIFOメモリに関する。   The present invention relates to a FIFO memory using a dual port RAM capable of performing read / write operations with mutually asynchronous clocks.

一般に、FIFOメモリは、データを記憶するためのRAMと、ライトポインタ及びリードポインタを管理するためのアドレス演算回路とから構成されており、互いに非同期のクロックで動作する二つのデバイス間でデータ転送を行う際のインターフェイス等として利用される。このため、FIFOメモリは、ライト用のクロックとリード用のクロックとがそれぞれ入力可能なデュアルポートRAMを用いて実現されることが多い。   In general, a FIFO memory is composed of a RAM for storing data and an address arithmetic circuit for managing a write pointer and a read pointer, and transfers data between two devices operating with asynchronous clocks. It is used as an interface when performing. For this reason, the FIFO memory is often realized by using a dual port RAM into which a write clock and a read clock can be input.

図4に、デュアルポートRAM210を用いたFIFOメモリ200の構成を示す。
同図において、デュアルポートRAM210は、クロック信号CLK0に同期して動作する第1アクセスポートと、クロック信号CLK1に同期して動作する第2アクセスポートとを備えている。符号220はウェイト信号生成回路、符号230,250,280は同期化回路、符号240はライトポインタ生成回路、符号260はフル/エンプティ判定回路、符号270はリードポインタ生成回路である。
FIG. 4 shows a configuration of the FIFO memory 200 using the dual port RAM 210.
In the figure, the dual port RAM 210 includes a first access port that operates in synchronization with the clock signal CLK0 and a second access port that operates in synchronization with the clock signal CLK1. Reference numeral 220 is a wait signal generation circuit, reference numerals 230, 250, and 280 are synchronization circuits, reference numeral 240 is a write pointer generation circuit, reference numeral 260 is a full / empty determination circuit, and reference numeral 270 is a read pointer generation circuit.

デュアルポートRAM210の第1アクセスポートには、CPU等のバスマスタデバイスからライト信号WRとライトデータWD15〜WD0とが入力され、ライトポインタ生成回路240から同期化回路250を介してライトアドレス信号WA7〜WA0が入力される。一方、デュアルポートRAM210の第2アクセスポートには、外部の周辺デバイスからリード信号RDが入力され、リードポインタ生成回路270からリードアドレス信号RA7〜RA0が入力される。また、第2アクセスポートから周辺デバイスにリードデータRD15〜RD0が出力される。   A write signal WR and write data WD15 to WD0 are input from a bus master device such as a CPU to the first access port of the dual port RAM 210, and write address signals WA7 to WA0 are transmitted from the write pointer generation circuit 240 via the synchronization circuit 250. Is entered. On the other hand, the read signal RD is input from the external peripheral device to the second access port of the dual port RAM 210, and the read address signals RA 7 to RA 0 are input from the read pointer generation circuit 270. Also, read data RD15 to RD0 are output from the second access port to the peripheral device.

次に、図5に示すタイミングチャートを参照して、バスマスタデバイスからの要求に基づくライト動作について説明する。
先ず、時刻t1におけるクロック信号CLK0の立ち上がりで、バスマスタデバイスがライト信号WRをローレベルにアサート(assert)すると、これを受けて、ウェイト信号生成回路220は、その次の時刻t2におけるクロック信号CLK0の立ち上がりエッジでウェイト信号WATをハイレベルにアサートする。これ以後、ウェイト信号WATがネゲート(negate)されるまで、バスマスタデバイスによるライトが禁止される。
Next, a write operation based on a request from the bus master device will be described with reference to a timing chart shown in FIG.
First, when the bus master device asserts the write signal WR to the low level at the rising edge of the clock signal CLK0 at time t1, the wait signal generation circuit 220 receives this, and the wait signal generation circuit 220 receives the clock signal CLK0 at the next time t2. The wait signal WAT is asserted to a high level at the rising edge. Thereafter, writing by the bus master device is prohibited until the wait signal WAT is negated.

また、ウェイト信号生成回路220は、アサートされたライト信号WRを同期化回路230に出力する。同期化回路230は、時刻t3におけるクロック信号CLK1の立ち上がりエッジで、アサートされたライト信号WRを取り込み、次の時刻t4におけるクロック信号CLK1の立ち上がりエッジで、クロック信号CLK1に同期化されたローレベルのライト信号WRSを出力する。ライトポインタ生成回路240は、時刻t5におけるクロック信号CLK1の立ち上がりエッジで、ライト信号WRSによりポインタPwを更新して出力する。   The wait signal generation circuit 220 outputs the asserted write signal WR to the synchronization circuit 230. The synchronization circuit 230 takes in the asserted write signal WR at the rising edge of the clock signal CLK1 at the time t3, and is synchronized with the clock signal CLK1 at the rising edge of the clock signal CLK1 at the next time t4. Write signal WRS is output. The write pointer generation circuit 240 updates and outputs the pointer Pw with the write signal WRS at the rising edge of the clock signal CLK1 at time t5.

一方、リードポインタ生成回路270は、周辺デバイスから供給されるリード信号RDからリードポインタPrを生成する。この例ではリード信号RDはアサートされておらず、リードポインタPrは先頭アドレス「0」を維持している。フル/エンプティ判定回路260は、上述の更新されたライトポインタPwとリードポインタPrとからデュアルポートRAM210の記憶領域の残りを演算し、この演算結果から記憶領域がフル状態であるか否かを判定する。この例では、時刻t5におけるクロック信号CLK1の立ち上がりエッジでフル状態ではないと判定している。   On the other hand, the read pointer generation circuit 270 generates the read pointer Pr from the read signal RD supplied from the peripheral device. In this example, the read signal RD is not asserted, and the read pointer Pr maintains the head address “0”. The full / empty determination circuit 260 calculates the remaining storage area of the dual port RAM 210 from the updated write pointer Pw and read pointer Pr described above, and determines whether the storage area is full from the calculation result. To do. In this example, it is determined that the clock signal CLK1 is not full at the rising edge of the clock signal CLK1 at time t5.

記憶領域がフル状態ではないと判定されると、フル/エンプティ判定回路260は、時刻t6におけるクロック信号CLK1の立ち上がりエッジで、判定結果を表すアクノリッジ信号Ack1をハイレベルにアサートして同期化回路280に出力する。同期化回路280は、時刻7におけるクロック信号CLK0の立ち上がりエッジで、クロック信号CLK0でアクノリッジ信号Ack1を同期化してアクノリッジ信号Ack0を出力する。   If it is determined that the storage area is not full, the full / empty determination circuit 260 asserts the acknowledge signal Ack1 representing the determination result to a high level at the rising edge of the clock signal CLK1 at time t6 to synchronize the circuit 280. Output to. The synchronization circuit 280 synchronizes the acknowledge signal Ack1 with the clock signal CLK0 at the rising edge of the clock signal CLK0 at time 7, and outputs the acknowledge signal Ack0.

アクノリッジ信号Ack0を入力するウェイト信号生成回路220は、次の時刻t8におけるクロック信号CLK0の立ち上がりエッジでウェイト信号をローレベルにネゲートする。このウェイト信号を受けて、バスマスタデバイスは、次の時刻t9におけるクロック信号CLK0の立ち上がりエッジでライト信号WRをハイレベルにネゲートし、これにより一連のライト動作が完了する。
特開平8−17180号公報
The wait signal generation circuit 220 to which the acknowledge signal Ack0 is input negates the wait signal to the low level at the rising edge of the clock signal CLK0 at the next time t8. Upon receiving this wait signal, the bus master device negates the write signal WR to the high level at the rising edge of the clock signal CLK0 at the next time t9, thereby completing a series of write operations.
JP-A-8-17180

ところで、上述の従来技術によれば、ライトポインタPw及びリードポインタPrの両者の更新をリード用のクロック信号CLK1に同期させる必要がある。なぜなら、フル/エンプティ判定回路140においてデュアルポートRAM210の記憶領域が満杯であるか否かを正しく判定するためには、ライトポインタとリードポインタとを同一のタイミングで更新して両ポインタの位置関係を把握する必要があるからである。   By the way, according to the above-described prior art, it is necessary to synchronize the update of both the write pointer Pw and the read pointer Pr with the read clock signal CLK1. This is because, in order to correctly determine whether or not the storage area of the dual port RAM 210 is full in the full / empty determination circuit 140, the write pointer and the read pointer are updated at the same timing, and the positional relationship between the two pointers is updated. This is because it is necessary to grasp.

しかしながら、ライトポインタPw及びリードポインタPrの両者の更新をリード用のクロック信号CLK1に同期させることは、ライトポインタPwを得るためのライト信号WRを遅延させることを意味し、このため、フル/エンプティ判定回路260が判定結果を出力するまでに所定のレイテンシを必要とするという問題がある。   However, synchronizing the update of both the write pointer Pw and the read pointer Pr with the read clock signal CLK1 means delaying the write signal WR for obtaining the write pointer Pw, and therefore full / empty. There is a problem that a predetermined latency is required before the determination circuit 260 outputs the determination result.

具体的には、リード用のクロック信号CLK1で両ポインタを更新する場合、ライトポインタPwの更新にタイムラグが生じる。なぜなら、ライトポインタPwを更新する際に、同期化回路230によりライト信号WRをリード用のクロック信号CLK1に同期化させる必要があるためである。この同期化の際に発生するタイムラグが、フル/エンプティ状態を判定する際のレイテンシをもたらし、データ転送効率を低下させる原因になる。上述の図5に示す例では、ウェイト信号WATがアサートされてからネゲートされるまで、即ち第1アクセスポートから第2アクセスポートにデータが転送されるまでに8サイクルを要している。   Specifically, when updating both pointers with the read clock signal CLK1, there is a time lag in updating the write pointer Pw. This is because it is necessary to synchronize the write signal WR with the read clock signal CLK1 by the synchronization circuit 230 when the write pointer Pw is updated. The time lag generated at the time of synchronization brings about a latency in determining the full / empty state, and causes a decrease in data transfer efficiency. In the example shown in FIG. 5 described above, eight cycles are required from when the wait signal WAT is asserted to when it is negated, that is, until data is transferred from the first access port to the second access port.

本発明は、上記事情に鑑みてなされたものであり、データ転送効率を改善することができるFIFOメモリを提供することを目的とする。   The present invention has been made in view of the above circumstances, and an object thereof is to provide a FIFO memory capable of improving data transfer efficiency.

本発明に係るFIFOメモリは、第1クロック信号に同期して動作する第1アクセスポートと第2クロック信号に同期して動作する第2アクセスポートとを有する記憶手段と、前記第1アクセスポートに入力されるライト信号に基づきライトポインタを生成するライトポインタ生成手段と、前記第2アクセスポートに入力されるリード信号に基づきリードポインタを生成するリードポインタ生成手段と、前記ライトポインタとリードポインタとの差分が予め設定されたマージン以下となった場合に前記記憶手段の記憶領域が満杯であると判定する判定手段とを備える。   A FIFO memory according to the present invention comprises a storage means having a first access port that operates in synchronization with a first clock signal and a second access port that operates in synchronization with a second clock signal; Write pointer generating means for generating a write pointer based on an input write signal, read pointer generating means for generating a read pointer based on a read signal input to the second access port, and the write pointer and the read pointer Determination means for determining that the storage area of the storage means is full when the difference is equal to or less than a preset margin.

上記FIFOメモリにおいて、例えば、前記ライトポインタ生成手段は、前記ライトポインタを前記第2クロック信号で同期化して前記判定手段に出力することを特徴とする。
上記FIFOメモリにおいて、例えば、前記リードポインタ生成手段は、前記リードポインタを前記第1クロック信号で同期化して前記判定手段に出力することを特徴とする。
In the FIFO memory, for example, the write pointer generation unit synchronizes the write pointer with the second clock signal and outputs the result to the determination unit.
In the FIFO memory, for example, the read pointer generation unit synchronizes the read pointer with the first clock signal and outputs the result to the determination unit.

上記FIFOメモリにおいて、例えば、前記マージンは、前記ライトポインタ生成手段がライトポインタを生成してから該ライトポインタに基づく前記判定手段の判定結果が出力されるまでの期間における前記ライトポインタの変化分に応じて設定されたことを特徴とする。
上記FIFOメモリにおいて、例えば、前記記憶手段は、デュアルポートRAMであることを特徴とする。
In the FIFO memory, for example, the margin is a change amount of the write pointer in a period from when the write pointer generation unit generates a write pointer to when the determination result of the determination unit based on the write pointer is output. It is characterized by being set accordingly.
In the FIFO memory, for example, the storage means is a dual port RAM.

本発明によれば、ライトポインタとリードポインタとの間に一定のマージンを設けて、これらライトポインタ及びリードポインタに基づき記憶領域が満杯であるか否かを判定するようにしたので、記憶領域が満杯であるか否かを判定する際のレイテンシの発生を有効に抑制し、データ転送効率を改善することができる。   According to the present invention, a fixed margin is provided between the write pointer and the read pointer, and it is determined whether or not the storage area is full based on the write pointer and the read pointer. It is possible to effectively suppress the occurrence of latency when determining whether or not it is full, and to improve data transfer efficiency.

以下、図面を参照しながら、本発明の実施形態を説明する。
図1に、本発明の実施形態に係るFIFOメモリ100の構成を示す。
同図において、符号110はデュアルポートRAMである。デュアルポートRAM110は、CPU等のバスマスタデバイスのクロック信号CLK0に同期して動作する第1アクセスポート1100と、周辺デバイスのクロック信号CLK1に同期して動作する第2アクセスポート1101とを備える。
Hereinafter, embodiments of the present invention will be described with reference to the drawings.
FIG. 1 shows a configuration of a FIFO memory 100 according to an embodiment of the present invention.
In the figure, reference numeral 110 denotes a dual port RAM. The dual port RAM 110 includes a first access port 1100 that operates in synchronization with a clock signal CLK0 of a bus master device such as a CPU, and a second access port 1101 that operates in synchronization with a clock signal CLK1 of a peripheral device.

ここで、第1アクセスポート1100には、クロック信号CLK0に加え、図示しないバスマスタデバイスからライト信号WRとライトデータWD15〜WD0とが入力されると共に、後述のライトポインタ生成回路120からライトアドレス信号WA7〜WA0が入力される。一方、第2アクセスポート1101には、クロック信号CLK1に加え、図示しない周辺デバイスからリード信号RDが入力されると共に、後述のリードポインタ生成回路150からリードアドレス信号RA7〜RA0が入力される。また、第2アクセスポート1101からは周辺デバイスにリードデータRD15〜RD0が出力される。   Here, in addition to the clock signal CLK0, the first access port 1100 receives a write signal WR and write data WD15 to WD0 from a bus master device (not shown), and a write address signal WA7 from a write pointer generation circuit 120 described later. ~ WA0 is input. On the other hand, in addition to the clock signal CLK1, a read signal RD is input from a peripheral device (not shown) to the second access port 1101, and read address signals RA7 to RA0 are input from a read pointer generation circuit 150 described later. Further, read data RD15 to RD0 are output from the second access port 1101 to the peripheral devices.

符号120は、デュアルポートRAM110のライト位置を示すライトポインタPwを生成するためのライトポインタ生成回路である。このライトポインタ生成回路120にはライト信号WRが入力される。ライトポインタ生成回路120は、ライトポインタPwをライトアドレスWA7〜WA0としてデュアルポートRAM110の第1アクセスポート1100に供給する。   Reference numeral 120 denotes a write pointer generation circuit for generating a write pointer Pw indicating the write position of the dual port RAM 110. A write signal WR is input to the write pointer generation circuit 120. The write pointer generation circuit 120 supplies the write pointer Pw to the first access port 1100 of the dual port RAM 110 as the write addresses WA7 to WA0.

符号130は同期化回路であり、従属接続された2段のDフリップフロップから構成される。このうち、1段目のDフリップフロップにはライトポインタPwが入力され、2段目のDフリップフロップからはクロック信号CLK1に同期化されたライトポインタPwsが出力され、これら2段のDフリップフロップの各クロック端子にはクロック信号CLK1が入力される。
符号150は、デュアルポートRAM110のリード位置を示すリードポインタPrを生成するためのリードポインタ生成回路である。このリードポインタ生成回路150にはリード信号RDが入力される。
Reference numeral 130 denotes a synchronization circuit, which is composed of two cascaded D flip-flops. Among them, the write pointer Pw is input to the first stage D flip-flop, and the write pointer Pws synchronized with the clock signal CLK1 is output from the second stage D flip-flop. The clock signal CLK1 is input to each of the clock terminals.
Reference numeral 150 denotes a read pointer generation circuit for generating a read pointer Pr indicating the read position of the dual port RAM 110. A read signal RD is input to the read pointer generation circuit 150.

符号140は、上述の同期化されたライトポインタPwsとリードポインタPrとからデュアルポートRAMの記憶領域が満杯であるか否かを判定するフル/エンプティ判定回路である。このフル/エンプティ判定回路140は、本発明の主要な特徴部の一つを成し、ライトポインタPwsとリードポインタPrとの間に一定のマージンを設けて、これらポインタに基づいてデュアルポートRAMの記憶領域が満杯であるか否かを判定するものである。この判定結果は、判定信号JUDとして周辺デバイスに出力されると共に、ウェイト信号WAT1として後述の同期化回路160に出力される。なお、この判定においてライトポインタPwsとリードポインタPrとの間に設けられる上述の一定のマージンについては後述する。   Reference numeral 140 denotes a full / empty determination circuit that determines whether or not the storage area of the dual port RAM is full from the synchronized write pointer Pws and read pointer Pr. The full / empty determination circuit 140 forms one of the main features of the present invention, and provides a certain margin between the write pointer Pws and the read pointer Pr, and based on these pointers, the dual port RAM It is determined whether or not the storage area is full. This determination result is output as a determination signal JUD to the peripheral device, and also output as a wait signal WAT1 to a synchronization circuit 160 described later. Note that the above-described certain margin provided between the write pointer Pws and the read pointer Pr in this determination will be described later.

符号160は同期化回路であり、上述の同期化回路130と同様に従属接続された2段のDフリップフロップから構成される。だたし、これら2段のDフリップフロップの各クロック端子にはクロック信号CLK0が入力され、このうち、1段目のDフリップフロップにはウェイト信号WAT1が入力され、2段目のDフリップフロップからは、クロック信号CLK0に同期化されたウェイト信号WATが外部のバスマスタデバイスに出力される。   Reference numeral 160 denotes a synchronization circuit, which is configured by two stages of D flip-flops connected in cascade as in the above-described synchronization circuit 130. However, the clock signal CLK0 is input to each clock terminal of these two-stage D flip-flops, and among these, the wait signal WAT1 is input to the first-stage D flip-flop, and the second-stage D flip-flops The wait signal WAT synchronized with the clock signal CLK0 is output to the external bus master device.

次に、図2を参照して、フル/エンプティ判定回路140における判定手法と、その判定の際にライトポインタPwsとリードポインタPrとの間に設けられる上述の一定のマージンMについて、従来技術と対比して説明する。
図2は、フル判定が下される場合のデュアルポートRAM110の記憶領域と各ポインタとの関係の一例を表している。同図に示す例では、デュアルポートRAM110の記憶領域は、0段目からN−1段目までの合計N段のFIFOメモリの記憶領域を構成する。
Next, referring to FIG. 2, the determination method in the full / empty determination circuit 140 and the above-described fixed margin M provided between the write pointer Pws and the read pointer Pr at the time of the determination are as follows. The comparison will be described.
FIG. 2 shows an example of the relationship between the storage area of the dual port RAM 110 and each pointer when full determination is made. In the example shown in the figure, the storage area of the dual port RAM 110 constitutes a storage area of a total of N stages of FIFO memories from the 0th stage to the (N-1) th stage.

ここで、図2(a)は、本実施形態に係る上述の一定のマージンを説明するための図であり、ライトポインタPwsがN−M−1段目を示しているときにリードポインタPrが0段目(初段)を示している状態を表している。また、同図(b)は、従来技術におけるライトポインタPwとリードポインタPrとの関係を説明するための図であり、ライトポインタPwがN−1段目を示しているときにリードポインタPrが0段目を示している状態を表している。   Here, FIG. 2A is a diagram for explaining the above-described constant margin according to the present embodiment. When the write pointer Pws indicates the NM-1 stage, the read pointer Pr is This represents a state indicating the 0th stage (first stage). FIG. 4B is a diagram for explaining the relationship between the write pointer Pw and the read pointer Pr in the prior art. When the write pointer Pw indicates the (N−1) th stage, the read pointer Pr is The state showing the 0th stage is shown.

先ず、従来技術によれば、図2(b)に示すようにPw>Prの場合には、Pw−Pr=N−1なる関係が満足されると、FIFOメモリの記憶領域が満杯となり、フル判定が下される。また、図示しないが、Pw<Prの場合には、Pr−Pw=1なる関係が満足されると、FIFOメモリの記憶領域が満杯となり、フル判定が下される。即ち、従来技術では、リードポインタPrの後ろにライトポインタPwが完全に追いついた状態(空きの記憶領域が全くない状態)となった場合にフル判定が下される。   First, according to the prior art, in the case of Pw> Pr as shown in FIG. 2B, when the relationship Pw−Pr = N−1 is satisfied, the storage area of the FIFO memory becomes full and full. A decision is made. Although not shown, when Pw <Pr, if the relationship of Pr−Pw = 1 is satisfied, the storage area of the FIFO memory is full and a full determination is made. That is, in the conventional technique, the full determination is made when the write pointer Pw has completely caught up after the read pointer Pr (there is no empty storage area).

これに対し、本実施形態では、図2(a)に示すように、Pws>Prの場合にPw−Pr≧N−Mなる関係が満足されると、実際にはFIFOメモリの記憶領域が満杯にはなっていなくてもフル判定が下される。また、図示しないが、Pws<Prの場合にPr−Pw≦Mなる関係が満足されると、同様にFIFOメモリの記憶領域が満杯にはなっていなくてもフル判定が下される。   On the other hand, in this embodiment, as shown in FIG. 2A, when the relationship Pw−Pr ≧ NM is satisfied when Pws> Pr, the storage area of the FIFO memory is actually full. Even if it is not, full judgment is made. Although not shown, if the relationship of Pr−Pw ≦ M is satisfied when Pws <Pr, the full determination is similarly made even if the storage area of the FIFO memory is not full.

即ち、本実施形態では、リードポインタPrと、これを追いかけるライトポインタPwsとの間の差分が所定のマージンM以下になった場合にフル判定が下される。このマージンMをどのように設定すべきかについては後述する。
以上で、本実施形態におけるフル判定の手法とマージンMについて説明した。
That is, in the present embodiment, the full determination is made when the difference between the read pointer Pr and the write pointer Pws chasing the read pointer Pr becomes equal to or less than a predetermined margin M. How to set the margin M will be described later.
The full determination method and the margin M in the present embodiment have been described above.

次に、図3に示すタイミングチャートを参照して、バスマスタデバイスからの要求に基づくライト動作を例として本実施形態の動作を説明する。
以下に説明するように、本実施形態によれば、バスマスタデバイスはライト動作毎にフル判定を待つ必要がなく、従ってバーストモードでのライト動作が可能になる。そこで、ここでは、バスマスタデバイスがバーストモードでデュアルポートRAM110にデータをライトする場合を説明する。
Next, with reference to the timing chart shown in FIG. 3, the operation of this embodiment will be described by taking a write operation based on a request from the bus master device as an example.
As will be described below, according to the present embodiment, the bus master device does not have to wait for a full determination for each write operation, and thus can perform a write operation in the burst mode. Therefore, here, a case where the bus master device writes data to the dual port RAM 110 in the burst mode will be described.

先ず、図3において、時刻t1におけるクロック信号CLK0の立ち上がりエッジで、バスマスタデバイスがライト信号WRをローレベルにアサートしてバーストモードでのライト動作を開始すると、それ以後、ライトポインタ生成回路120は、クロック信号CLK0の1サイクル毎にライトポインタPwをカウントアップして更新し、ライトポインタPwの値として、「1」,「2」,…,「17」を順次出力する。また、ライトポインタ生成回路120は、ライトポインタPwとしてライトアドレス信号WA7〜WA0をデュアルポートRAM110の第1アクセスポートに供給する。   First, in FIG. 3, when the bus master device asserts the write signal WR to the low level and starts the write operation in the burst mode at the rising edge of the clock signal CLK0 at the time t1, the write pointer generation circuit 120 thereafter The write pointer Pw is counted up and updated every cycle of the clock signal CLK0, and “1”, “2”,..., “17” are sequentially output as the value of the write pointer Pw. The write pointer generation circuit 120 supplies write address signals WA7 to WA0 to the first access port of the dual port RAM 110 as the write pointer Pw.

デュアルポートRAM110は、クロック信号CLK0の各サイクルにおいてバスマスタデバイスからライトデータWD15〜WD0を入力し、ライトポインタ生成回路120からライトポインタPwとして供給されるライトアドレス信号WA7〜WA0で指定される記憶領域に順次格納する。   The dual port RAM 110 receives write data WD15 to WD0 from the bus master device in each cycle of the clock signal CLK0, and stores it in the storage area specified by the write address signals WA7 to WA0 supplied from the write pointer generation circuit 120 as the write pointer Pw. Store sequentially.

同期化回路130は、ライトポインタPwをクロック信号CLK1で同期化し、クロック信号CLK1に同期したタイミングでライトポインタPwsをフル/エンプティ判定回路140に出力する。具体的には、同期化回路130は、時刻t2におけるクロック信号CLK1の立ち上がりエッジで、ライトポインタPwの値「2」を取り込み、次の時刻t3におけるクロック信号CLK1の立ち上がりエッジで、ライトポインタPwsとして値「2」を出力する。   The synchronization circuit 130 synchronizes the write pointer Pw with the clock signal CLK1, and outputs the write pointer Pws to the full / empty determination circuit 140 at a timing synchronized with the clock signal CLK1. Specifically, the synchronization circuit 130 captures the value “2” of the write pointer Pw at the rising edge of the clock signal CLK1 at time t2, and uses it as the write pointer Pws at the rising edge of the clock signal CLK1 at the next time t3. The value “2” is output.

以後同様にして、同期化回路130は、クロック信号CLK1の立ち上がりエッジでライトポインタPwの各値を取り込み、クロック信号CLK1で同期化されたライトポインタPwsとして、「3」,「5」,「7」,「8」,「10」,「11」,「12」,「14」,「15」,「17」の各値をフル/エンプティ判定回路140に順次出力する。   Thereafter, similarly, the synchronization circuit 130 captures each value of the write pointer Pw at the rising edge of the clock signal CLK1, and “3”, “5”, “7” are written as the write pointer Pws synchronized with the clock signal CLK1. , “8”, “10”, “11”, “12”, “14”, “15”, “17” are sequentially output to the full / empty determination circuit 140.

一方、リードポインタ生成回路150は、周辺デバイスから供給されるリード信号RDに基づきリードポインタPrを生成してフル/エンプティ判定回路140に出力する。また、リードポインタ生成回路150は、リードポインタPrとしてリードアドレス信号RA7〜RA0をデュアルポートRAM110の第2アクセスポート1101に供給する。デュアルポートRAM110は、ライトポインタ生成回路120から供給されるライトアドレス信号WA7〜WA0で指定される記憶領域に格納されたデータをリードデータRD15〜RD0として周辺デバイスに出力する。   On the other hand, the read pointer generation circuit 150 generates a read pointer Pr based on the read signal RD supplied from the peripheral device and outputs the read pointer Pr to the full / empty determination circuit 140. Further, the read pointer generation circuit 150 supplies read address signals RA7 to RA0 to the second access port 1101 of the dual port RAM 110 as the read pointer Pr. The dual port RAM 110 outputs the data stored in the storage area specified by the write address signals WA7 to WA0 supplied from the write pointer generation circuit 120 to the peripheral device as read data RD15 to RD0.

上述の第1アクセスポート側でのバスマスタデバイスによるライト動作の進行に従ってライトポインタPwの値が増加していくと共に、第2アクセスポート側での周辺デバイスによるリード動作の進行に従って、リードポインタPrの値がライトポインタPwを追跡するように増加していく。   As the write operation by the bus master device on the first access port side proceeds, the value of the write pointer Pw increases, and as the read operation by the peripheral device on the second access port side proceeds, the value of the read pointer Pr Increases to track the write pointer Pw.

ここで、本実施形態では、ライトポインタPwの値が「10」に到達したときに、ライトポインタPwとリードポインタPrとの関係が上述の図2(a)に示す関係になったとする。即ち、ライトポインタPwが「10」になった時点で、リードポインタPrとの間にはマージンMに相当する段数の空き領域しかなく、Pw−Pr≧N−Mなる条件が満足されているものとする。ただし、本実施形態では、この時点ではフル判定は下されない。   Here, in this embodiment, when the value of the write pointer Pw reaches “10”, it is assumed that the relationship between the write pointer Pw and the read pointer Pr becomes the relationship shown in FIG. That is, when the write pointer Pw becomes “10”, there is only a vacant area corresponding to the margin M between the read pointer Pr and the condition Pw−Pr ≧ NM is satisfied. And However, in this embodiment, full determination is not made at this point.

この状態から、時刻t5におけるクロックCLK1の立ち上がりエッジで、同期化回路130は、ライトポインタPwの値「11」を取り込み、これを時刻t6でライトポインタPwsとして出力する。フル/エンプティ判定回路140は、ライトポインタPwsの値「11」とリードポインタPrの値とから記憶領域が満杯か否かを判定する。この場合、ライトポインタPwとリードポインタPrとの間のFIFOの段数はマージンMにそうとうする段数以下であるから、フル/エンプティ判定回路140はフル判定を下し、時刻t7におけるクロック信号CLK1の立ち上がりエッジで、この判定結果を表す判定信号JUDを出力する。   From this state, at the rising edge of the clock CLK1 at time t5, the synchronization circuit 130 captures the value “11” of the write pointer Pw and outputs it as the write pointer Pws at time t6. The full / empty determination circuit 140 determines whether the storage area is full from the value “11” of the write pointer Pws and the value of the read pointer Pr. In this case, since the number of FIFO stages between the write pointer Pw and the read pointer Pr is equal to or less than the number of stages to be applied to the margin M, the full / empty determination circuit 140 makes a full determination and the rising edge of the clock signal CLK1 at time t7. At the edge, a determination signal JUD representing this determination result is output.

同期化回路160は、時刻t8におけるクロック信号CLK0の立ち上がりエッジでウェイト信号WAT1を取り込み、次の時刻t9におけるクロック信号CLK0の立ち上がりエッジでウェイト信号WATをハイレベルにアサートする。これを受けて、外部のバスマスタデバイスは、時刻t10におけるクロック信号CLK0の立ち上がりエッジでライト信号WRをハイレベルにネゲートし、これにより、一連のバーストモードでのライト動作が完了する。   The synchronization circuit 160 takes in the wait signal WAT1 at the rising edge of the clock signal CLK0 at time t8, and asserts the wait signal WAT to the high level at the rising edge of the clock signal CLK0 at the next time t9. In response, the external bus master device negates the write signal WR to the high level at the rising edge of the clock signal CLK0 at time t10, thereby completing the write operation in a series of burst modes.

上述のバーストモードでの一連のライド動作において、時刻t7においてフル/エンプティ判定回路140がフル判定を出力する以前の時刻t4で、フル判定を下すときの条件(Pw−Pr≧N−M)が満足されている。しかも、フル判定が下された後の時刻t10でライト信号WRがネゲートされている。従って、この例では、ライトポインタPwの値は「10」で留めなければならないにもかかわらず、ライトポインタPwの値は「17」まで進んでいる。   In the above-described series of ride operations in the burst mode, the condition (Pw−Pr ≧ NM) for making a full determination at time t4 before the full / empty determination circuit 140 outputs a full determination at time t7 is as follows. Satisfied. Moreover, the write signal WR is negated at time t10 after the full determination is made. Therefore, in this example, the value of the write pointer Pw has advanced to “17” even though the value of the write pointer Pw must be kept at “10”.

しかし、本実施形態によれば、上述のマージンMを設けているので、フル判定を下す時点で実際のライトポインタPwの値が進んでいても、デュアルポートRAM110の記憶領域にはマージンMに相当する空き領域が存在するため、オーバーフローには至らない。このことから、マージンMは、ライトポインタPwをクロック信号CLK1で同期化するためのタイムラグと、同期化されたライトポインタPwsとリードポインタPrとからフル判定を下すまでのタイムラグと、フル判定を表す信号をクロック信号CLK0で同期化してウェイト信号WATをアサートするためのタイムラグと、このウェイト信号WATを受けた外部のバスマスタデバイスがライト信号WRをネゲートするまでのタイムラグを考慮して決定される。即ち、マージンMに相当するFIFOの段数は、上述のようなタイムラグの合算期間におけるライトポインタPwの変化分を考慮し、この変化分に対応する全ライトデータを記憶可能なように設定される。換言すれば、マージンMは、ライトポインタが生成されてから判定結果が出力されるまでの期間におけるライトポインタの変化分に応じて設定される。   However, according to the present embodiment, since the margin M described above is provided, the storage area of the dual port RAM 110 corresponds to the margin M even if the actual value of the write pointer Pw is advanced at the time of full determination. Since there is a free area to be overflowed, overflow does not occur. Therefore, the margin M represents a time lag for synchronizing the write pointer Pw with the clock signal CLK1, a time lag until the full decision is made from the synchronized write pointer Pws and the read pointer Pr, and a full decision. It is determined in consideration of a time lag for synchronizing the signal with the clock signal CLK0 and asserting the wait signal WAT, and a time lag until the external bus master device receiving the wait signal WAT negates the write signal WR. That is, the number of FIFO stages corresponding to the margin M is set so that all write data corresponding to this change can be stored in consideration of the change in the write pointer Pw during the time lag summing period as described above. In other words, the margin M is set according to the change amount of the write pointer in the period from when the write pointer is generated until the determination result is output.

このように、本実施形態では、ライトポインタPwをリード用のクロック信号CLK1で同期化せずにデュアルポートRAM110に供給することにより、ライト用のクロック信号CLK0のサイクル毎のライト動作を可能とし、バーストモードでの高速なライト動作等を実現している。従って、データ転送効率が改善される。一方、ライトポインタPwをリード用のクロック信号CLK1で同期化したライトポインタPwsを用いてフル判定を行っているため、フル/エンプティ判定回路140が入力するライトポインタPwsの値が実際の値と異なり、フル判定に誤差が発生するが、上述のマージンMを設けてフル判定を行うことにより、オーバーフローを回避している。結局、オーバーフローを招くことなく高速なライト動作を実現している。   As described above, in this embodiment, the write pointer Pw is supplied to the dual port RAM 110 without being synchronized with the read clock signal CLK1, thereby enabling the write operation for each cycle of the write clock signal CLK0. Realizes high-speed write operation in burst mode. Therefore, the data transfer efficiency is improved. On the other hand, since the full determination is performed using the write pointer Pws obtained by synchronizing the write pointer Pw with the read clock signal CLK1, the value of the write pointer Pws input by the full / empty determination circuit 140 is different from the actual value. Although an error occurs in full determination, overflow is avoided by providing full margin with the margin M described above. As a result, a high-speed write operation is realized without causing an overflow.

また、この例では、クロック信号CLK1の周期がクロック信号CLK0よりも大きいため、ライトポインタPwをクロック信号CLK1で同期化して得られるライトポインタPwsの値は連続した値にならない。このこともフル/エンプティ判定回路140におけるフル判定の誤差の原因となるが、この誤差が存在したとしても、上述のマージンMによりオーバーフローには至らない。   In this example, since the cycle of the clock signal CLK1 is larger than that of the clock signal CLK0, the value of the write pointer Pws obtained by synchronizing the write pointer Pw with the clock signal CLK1 does not become a continuous value. This also causes a full determination error in the full / empty determination circuit 140. Even if this error exists, the margin M does not cause an overflow.

このように、本実施形態では、ライトポインタPwをライト用のクロック信号CLK0に同期させて生成し、リードポインタPrをリード用のクロック信号CLK1に同期させて生成することによりライト動作およびリード動作を高速化すると共に、そのことに伴うフル判定の誤差をマージンMによって吸収している。   As described above, in this embodiment, the write pointer Pw is generated in synchronization with the write clock signal CLK0, and the read pointer Pr is generated in synchronization with the read clock signal CLK1, thereby performing the write operation and the read operation. In addition to speeding up, the full determination error associated therewith is absorbed by the margin M.

以上、本発明の実施形態を詳述したが、具体的な構成は本実施形態に限られるものではなく、本発明の要旨を逸脱しない範囲の設計変更等も含まれる。例えば、上述の実施形態では、ライトポインタの生成をクロック信号CLK0に同期させ、リードポインタPrの生成とフル判定をリード用のクロック信号CLK1に同期させるものとしたが、ライトポインタの生成とフル判定をクロック信号CLK0に同期させ、リードポインタPrの生成をリード用のクロック信号CLK1に同期させるものとしてもよい。   As mentioned above, although embodiment of this invention was explained in full detail, the concrete structure is not restricted to this embodiment, The design change etc. of the range which does not deviate from the summary of this invention are included. For example, in the above-described embodiment, the generation of the write pointer is synchronized with the clock signal CLK0, and the generation of the read pointer Pr and the full determination are synchronized with the clock signal CLK1 for read. May be synchronized with the clock signal CLK0, and the generation of the read pointer Pr may be synchronized with the read clock signal CLK1.

本発明の実施形態に係るFIFOメモリの構成を示すブロック図である。It is a block diagram which shows the structure of the FIFO memory which concerns on embodiment of this invention. 本発明の実施形態に係るフル判定の際のマージンを説明するための説明図である。It is explanatory drawing for demonstrating the margin in the case of full determination which concerns on embodiment of this invention. 本発明の実施形態に係るFIFOメモリの動作を説明するためのタイミングチャートである。3 is a timing chart for explaining the operation of the FIFO memory according to the embodiment of the present invention. 従来技術に係るFIFOメモリの構成例を示す図である。It is a figure which shows the structural example of the FIFO memory which concerns on a prior art. 従来技術に係るFIFOメモリの動作を説明するためのタイミングチャートである。6 is a timing chart for explaining the operation of the FIFO memory according to the prior art.

符号の説明Explanation of symbols

100;FIFOメモリ、110;デュアルポートRAM、120;ライトポインタ生成回路、130,160;同期化回路、140;フル/エンプティ判定回路、150;リードポインタ生成回路。

100; FIFO memory, 110; dual port RAM, 120; write pointer generation circuit, 130, 160; synchronization circuit, 140; full / empty determination circuit, 150; read pointer generation circuit.

Claims (5)

第1クロック信号に同期して動作する第1アクセスポートと第2クロック信号に同期して動作する第2アクセスポートとを有する記憶手段と、
前記第1アクセスポートに入力されるライト信号に基づきライトポインタを生成するライトポインタ生成手段と、
前記第2アクセスポートに入力されるリード信号に基づきリードポインタを生成するリードポインタ生成手段と、
前記ライトポインタとリードポインタとの差分が予め設定されたマージン以下となった場合に前記記憶手段の記憶領域が満杯であると判定する判定手段と
を備えたFIFOメモリ。
Storage means having a first access port that operates in synchronization with the first clock signal and a second access port that operates in synchronization with the second clock signal;
Write pointer generating means for generating a write pointer based on a write signal input to the first access port;
Read pointer generating means for generating a read pointer based on a read signal input to the second access port;
A FIFO memory comprising: a determination unit that determines that the storage area of the storage unit is full when a difference between the write pointer and the read pointer is equal to or less than a preset margin.
前記ライトポインタ生成手段は、前記ライトポインタを前記第2クロック信号で同期化して前記判定手段に出力することを特徴とする請求項1記載のFIFOメモリ。   2. The FIFO memory according to claim 1, wherein the write pointer generation means synchronizes the write pointer with the second clock signal and outputs it to the determination means. 前記リードポインタ生成手段は、前記リードポインタを前記第1クロック信号で同期化して前記判定手段に出力することを特徴とする請求項1記載のFIFOメモリ。   2. The FIFO memory according to claim 1, wherein the read pointer generation means synchronizes the read pointer with the first clock signal and outputs the result to the determination means. 前記マージンは、前記ライトポインタ生成手段がライトポインタを生成してから該ライトポインタに基づく前記判定手段の判定結果が出力されるまでの期間における前記ライトポインタの変化分に応じて設定されたことを特徴とする請求項1ないし3の何れか1項記載のFIFOメモリ。   The margin is set according to a change amount of the write pointer in a period from when the write pointer generation unit generates a write pointer to when a determination result of the determination unit based on the write pointer is output. 4. The FIFO memory according to claim 1, wherein the FIFO memory is characterized in that: 前記記憶手段は、デュアルポートRAMであることを特徴とする請求項1ないし4の何れか1項記載のFIFOメモリ。

5. The FIFO memory according to claim 1, wherein the storage means is a dual port RAM.

JP2006097356A 2006-03-31 2006-03-31 Fifo memory Pending JP2007272562A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
JP2006097356A JP2007272562A (en) 2006-03-31 2006-03-31 Fifo memory

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
JP2006097356A JP2007272562A (en) 2006-03-31 2006-03-31 Fifo memory

Publications (1)

Publication Number Publication Date
JP2007272562A true JP2007272562A (en) 2007-10-18

Family

ID=38675306

Family Applications (1)

Application Number Title Priority Date Filing Date
JP2006097356A Pending JP2007272562A (en) 2006-03-31 2006-03-31 Fifo memory

Country Status (1)

Country Link
JP (1) JP2007272562A (en)

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102193884A (en) * 2010-03-10 2011-09-21 瑞萨电子株式会社 Data transfer circuit and method
US9542152B2 (en) 2012-11-27 2017-01-10 Samsung Electronics Co., Ltd. System-on-chip and application processor including FIFO buffer and mobile device comprising the same

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102193884A (en) * 2010-03-10 2011-09-21 瑞萨电子株式会社 Data transfer circuit and method
CN102193884B (en) * 2010-03-10 2015-06-24 瑞萨电子株式会社 Data transfer circuit and method
US9542152B2 (en) 2012-11-27 2017-01-10 Samsung Electronics Co., Ltd. System-on-chip and application processor including FIFO buffer and mobile device comprising the same

Similar Documents

Publication Publication Date Title
TWI298888B (en) Pseudo-synchronization of the transportation of data across asynchronous clock domains
JP4998519B2 (en) Asynchronous interface circuit and asynchronous data transfer method
US8675425B2 (en) Single-strobe operation of memory devices
WO2017016178A1 (en) Interface signal remapping method based on fpga
CN101344870B (en) FIFO control module with strong reusability and method for managing internal memory
CN101847131A (en) Storage control device
JP5414350B2 (en) Memory control circuit and control method thereof
JP7299890B2 (en) Asynchronous buffer with pointer offset
CN109815619B (en) Method for converting synchronous circuit into asynchronous circuit
JP2004062630A (en) FIFO memory and semiconductor device
US20080209095A1 (en) Structure for reducing latency associated with read operations in a memory system
CN110618950A (en) Asynchronous FIFO read-write control circuit and method, readable storage medium and terminal
JP2007272562A (en) Fifo memory
CN100405253C (en) Data transmission synchronization circuit, method and computer
US7734860B2 (en) Signal processor
JP4389459B2 (en) Data buffer device
US7822905B2 (en) Bridges capable of controlling data flushing and methods for flushing data
CN121070132B (en) Chip timer realizing device and SoC chip
CN113760795A (en) Asynchronous FIFO memory read-write control method, device and equipment
JP3711730B2 (en) Interface circuit
JP5433156B2 (en) Memory control circuit
JP5218225B2 (en) MEMORY ACCESS DEVICE, MEMORY ACCESS SYSTEM, AND MEMORY ACCESS DEVICE PROCESSING METHOD
JPH10112178A (en) FIFO memory and method of manufacturing the same
CN121541926A (en) Command acceleration device and its operation method
CN118113112A (en) Electronic device