JP4360439B2 - Memory management device and memory management method - Google Patents
Memory management device and memory management method Download PDFInfo
- Publication number
- JP4360439B2 JP4360439B2 JP2007323307A JP2007323307A JP4360439B2 JP 4360439 B2 JP4360439 B2 JP 4360439B2 JP 2007323307 A JP2007323307 A JP 2007323307A JP 2007323307 A JP2007323307 A JP 2007323307A JP 4360439 B2 JP4360439 B2 JP 4360439B2
- Authority
- JP
- Japan
- Prior art keywords
- queue
- counter
- idle
- register
- address
- 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
Images
Landscapes
- Memory System (AREA)
Description
本発明は、書込みが要求されたデータをデータメモリに書き込むと共に、読み出しが要求されたデータをデータメモリより読み出して出力する場合に、データメモリの使用領域と空き領域とをリンクリストメモリを使用して管理する装置及び方法に関する。 The present invention uses the link list memory to write the data requested to be written to the data memory, and to read the data requested to be read from the data memory and output the data memory. It is related with the apparatus and method which manage.
例えば、通信などのアプリケーションにおいて、1つのデータメモリに対して複数のパケットによるデータの入力要求や出力要求が発行され、データメモリを各パケットに対応した複数の領域に分けて使用する場合に、リンクリストメモリを用いて領域管理を行い、データメモリの空き領域を、極力効率的に使用する管理方式がある(例えば、特許文献1参照)。
しかしながら、上記のようなリンクリストを用いた管理方式では、複数の入力元より入力されるデータをデータメモリに時系列的に書き込んで行くと、特定の入力元がメモリ領域の殆どを使用する結果、その他の入力元がデータメモリを使用する余地がなくなってしまうという問題がある。
本発明は上記事情に鑑みて成されたものであり、その目的は、複数のアクセスユニットが1つのデータメモリを使用する場合に、各ユニットの使用領域を確実に用意することができるメモリ管理装置及びメモリ管理方法を提供することにある。
However, in the management method using the link list as described above, when data input from a plurality of input sources is written in the data memory in time series, the result that the specific input source uses most of the memory area. There is a problem that there is no room for other input sources to use the data memory.
The present invention has been made in view of the above circumstances, and an object of the present invention is to provide a memory management device that can reliably prepare a use area of each unit when a plurality of access units use one data memory. And a memory management method.
請求項1記載のメモリ管理装置によれば、データメモリの使用領域と空き領域とをリンクリストメモリを使用して管理する場合に、複数のアクセスユニットが夫々データメモリを使用する領域に制限を設け、各アクセスユニットの使用領域が常に確保されるように構成するので、従来とは異なり、特定のユニットがデータメモリを独占的に使用する状態となることは回避される。 According to the memory management device of the first aspect, when the used area and the free area of the data memory are managed by using the link list memory, a restriction is provided on an area where each of the plurality of access units uses the data memory. Since the use area of each access unit is always ensured, unlike a conventional case, it is avoided that a specific unit exclusively uses the data memory.
また、各アクセスユニットのキューカウンタに下限値を設定し、空き領域数を示すIdleカウンタより、キューカウンタのカウンタ値が前記下限値未満である場合の両者の差分を全て合計したものを減じた仮想Idleカウンタを使用して空き領域を管理することで、各ユニットの使用領域は、少なくとも下限値分は確保されるようになる。
そして、書込み制御手段は、複数のアクセスユニットの何れかによる書込み要求が発生した場合(書込みユニット)、当該ユニットのキューカウンタが上限値以上、または、前記キューカウンタが上限値未満で且つ下限値以上であり且つ仮想Idleカウンタの値が「0」の場合は、データメモリに対する書込みを禁止する。即ち、キューカウンタが上限値未満であっても、仮想Idleカウンタ値が「0」であれば、その時点の空き領域は、他のユニットの使用領域の下限を確保すると実質的に空きが無い状態にある。従って、この場合もデータメモリに対する書込みを禁止する。
In addition , a lower limit value is set in the queue counter of each access unit, and a virtual value obtained by subtracting the sum of all differences between the counter values when the queue counter value is less than the lower limit value from the Idle counter indicating the number of free areas. By managing the free space using the Idle counter, at least the lower limit value is secured in the used space of each unit.
When a write request is issued by any of a plurality of access units (write unit), the write control means has a queue counter of the unit equal to or greater than the upper limit value, or the queue counter is less than the upper limit value and equal to or greater than the lower limit value. When the value of the virtual idle counter is “0”, writing to the data memory is prohibited. That is, even if the queue counter is less than the upper limit value, if the virtual idle counter value is “0”, the free area at that time is substantially free if the lower limit of the used area of other units is secured. It is in. Therefore, also in this case, writing to the data memory is prohibited.
また、書込みユニットのキューカウンタが下限値未満の場合、または、前記カウンタが上限値未満で且つ下限値以上であり且つ仮想Idleカウンタが「0」でない場合は当該カウンタをデクリメントしてから、Idle先頭レジスタが示すアドレスにデータを書き込む。即ち、キューカウンタが下限値未満であれば、書込みユニットの使用領域には確実に空きがあることを示すので無条件に書込みが可能である。また、キューカウンタが下限値以上であっても、仮想Idleカウンタが「0」でなければ、その他のユニットが使用する下限を確保した上で空き領域が存在することを示す。従って、(領域を1つ使用するので)仮想Idleカウンタをデクリメントして、Idle先頭レジスタが示すアドレスにデータを書き込むことができる。 Also, when the queue counter of the writing unit is less than the lower limit value, or when the counter is less than the upper limit value and greater than or equal to the lower limit value and the virtual Idle counter is not “0”, the counter is decremented and then the Idle head Write data to the address indicated by the register. That is, if the queue counter is less than the lower limit value, it indicates that there is a vacant space in the used area of the writing unit, so that unconditional writing is possible. Even if the queue counter is equal to or greater than the lower limit value, if the virtual idle counter is not “0”, it indicates that a free area exists after ensuring the lower limit used by other units. Therefore, the virtual Idle counter can be decremented (because one area is used) and data can be written to the address indicated by the Idle head register.
そして、上記の書込み処理を行った後、書込みユニットのキューカウンタが「0」でなければ、Idle先頭レジスタのアドレス値を当該ユニットのキュー末尾レジスタが示すリンクリストメモリのアドレスに書き込む。即ち、上記の書込み処理を行った結果、空き領域の先頭は、書込みユニットの使用領域の末尾となるからである。また、書込みユニットのキューカウンタが「0」の場合は、当該ユニットの使用領域が全く無いことを示すので、空き領域の先頭アドレスを当該ユニットのキュー先頭レジスタに書き込んで、当該使用領域の先頭を設定する。 After the above write processing, if the queue counter of the writing unit is not “0”, the address value of the Idle head register is written to the address of the link list memory indicated by the queue tail register of the unit. That is, as a result of performing the above-described writing process, the head of the empty area becomes the end of the used area of the writing unit. In addition, when the write unit queue counter is “0”, it indicates that there is no used area of the unit, so the start address of the free area is written to the queue start register of the unit, and the start of the used area is set. Set.
更に、書込みユニットのキュー末尾レジスタに、Idle先頭レジスタの内容(空き領域の先頭アドレス)を書込み、(領域を1つ使用したので)当該ユニットのキューカウンタをインクリメントし、Idle先頭レジスタが示すリンクリストメモリのアドレスからデータ(即ち、現時点の空き領域の先頭アドレス)を読み出すと、そのデータをIdle先頭レジスタに書き込んで、(空き領域が1つ減ったので)Idleカウンタをデクリメントする。
以上のようにして、各ユニットの使用領域を確保しつつ、データメモリに対する書込み制御を行うことができる。そして、各ユニットの使用領域に上限値と下限値とを設定してデータメモリを管理するので、下限値により各ユニットの最小使用数を確保した上で、上限値を柔軟に(即ち、上限値のトータルがデータメモリの容量を超えても良い)設定することが可能となる。
加えて、複数のアクセスユニットを、各ユニットがそれぞれ複数のグループに属するように複数のアクセスグループに分けて各グループ毎にキューカウンタを設け、それらのキューカウンタについては、キューの上限値のみを設定し、書込み制御手段は、当該上限値についてはアクセスユニット毎のキューカウンタの上限値と同様の判断処理を行うと共に、各グループ毎にキューカウンタについて、アクセスユニット毎のキューカウンタと同様のカウント操作を行う。斯様に構成すれば、各グループ毎に使用領域の上限を設定することで、アプリケーションに応じて上限をより多様に設定することができる。
Furthermore, the contents of the Idle head register (the head address of the empty area) are written to the queue end register of the writing unit, the queue counter of the unit is incremented (because one area is used), and the link list indicated by the Idle head register When data is read from the memory address (that is, the start address of the current empty area), the data is written to the Idle start register and the Idle counter is decremented (because the empty area has been decreased by one).
As described above, write control to the data memory can be performed while securing the use area of each unit. Since the data memory is managed by setting the upper limit value and the lower limit value in the usage area of each unit, the upper limit value can be flexibly set (i.e., the upper limit value after securing the minimum number of units used by the lower limit value). Can be set to exceed the capacity of the data memory).
In addition, a plurality of access units are divided into a plurality of access groups so that each unit belongs to a plurality of groups, and a queue counter is provided for each group, and only the upper limit value of the queue is set for these queue counters. Then, the write control means performs determination processing similar to the upper limit value of the queue counter for each access unit for the upper limit value, and performs the same counting operation as the queue counter for each access unit for the queue counter for each group. Do. With such a configuration, by setting the upper limit of the use area for each group, the upper limit can be set more variously according to the application.
請求項2記載のメモリ管理装置によれば、書込み制御手段は、書込みユニットによる書込み要求が発生した場合、当該ユニットのキューカウンタが上限値以上、または、前記キューカウンタが上限値未満で且つ下限値以上であり且つ仮想Idleカウンタの値が「0」の場合は、当該ユニットの使用領域の先頭アドレスにデータを書き込む。即ち、請求項1においては、同様のケースでデータメモリに対する書込みを禁止したが、請求項2では、使用領域の先頭アドレス,即ち、最も古いデータの上に新たなデータを上書きし、キュー先頭レジスタのアドレス値をキュー末尾レジスタが示すリンクリストメモリのアドレスとキュー末尾レジスタに書き込み、キュー先頭レジスタのアドレス値が示すリンクリストメモリのアドレスからデータを読み出して、そのデータをキュー先頭アドレスに書き込み、最新のデータとして管理する。従って、最新のデータを喪失することなく、データメモリに記憶させることができる。
そして、複数のアクセスユニットを、各ユニットがそれぞれ複数のグループに属するように複数のアクセスグループに分けて各グループ毎にキューカウンタを設け、それらのキューカウンタについては、キューの上限値のみを設定し、書込み制御手段は、当該上限値についてはアクセスユニット毎のキューカウンタの上限値と同様の判断処理を行うと共に、各グループ毎にキューカウンタについて、アクセスユニット毎のキューカウンタと同様のカウント操作を行う。斯様に構成すれば、各グループ毎に使用領域の上限を設定することで、アプリケーションに応じて上限をより多様に設定することができる。
According to the memory management device of
A plurality of access units are divided into a plurality of access groups so that each unit belongs to a plurality of groups, and a queue counter is provided for each group, and only the upper limit value of the queue is set for these queue counters. The write control means performs determination processing similar to the upper limit value of the queue counter for each access unit for the upper limit value, and performs the same counting operation as the queue counter for each access unit for the queue counter for each group. . With such a configuration, by setting the upper limit of the use area for each group, the upper limit can be set more variously according to the application.
請求項4記載のメモリ管理装置によれば、読出し制御手段は、複数のアクセスユニットの何れかによる読出し要求が発生した場合に(読出しユニット)、当該ユニットのキューカウンタが「0」の場合はデータメモリからのデータ読み出しを禁止する。即ち、この場合、読出し対象となるデータが存在しないからである。一方、前記キューカウンタが「0」でない場合は、読出しユニットのキュー先頭レジスタが示すデータメモリのアドレス(即ち、使用領域の先頭アドレス)からデータを読み出す。尚、一度読み出されたデータは、その時点でデータメモリに記憶保持する必要がなくなり、上書きが許可されることが前提となっている。 According to the memory management device of the fourth aspect, when the read request is issued by any one of the plurality of access units (read unit), the read control means performs data when the queue counter of the unit is “0”. Prohibits reading data from memory. That is, in this case, there is no data to be read. On the other hand, when the queue counter is not "0", data is read from the address of the data memory indicated by the queue head register of the reading unit (that is, the head address of the used area). It is assumed that once read data does not need to be stored in the data memory at that time, and overwriting is permitted.
そして、上記の処理の後、Idleカウンタの値が「0」でない場合は、Idle末尾レジスタが示すリンクリストメモリのアドレスとIdle末尾レジスタに、読出しユニットのキュー先頭レジスタの内容を書込む。また、使用領域が1つ開放されたのでIdleカウンタをインクリメントする。
一方、Idleカウンタの値が「0」の場合は、使用領域の空きがないので、Idle先頭レジスタ及びIdle末尾レジスタに、読出しユニットのキュー先頭レジスタの内容を書込んでから(空き領域の先頭を再度初期設定する)Idleカウンタをインクリメントする。
After the above processing, if the value of the Idle counter is not “0”, the contents of the queue head register of the reading unit are written into the address of the link list memory indicated by the Idle tail register and the Idle tail register. Further, since one used area is released, the Idle counter is incremented.
On the other hand, when the value of the Idle counter is “0”, there is no available area, so the contents of the queue start register of the reading unit are written in the Idle start register and the Idle end register (the start of the free area is (Initializing again) Increment the Idle counter.
更に、読出しユニットのキュー先頭レジスタが示すリンクリストメモリのアドレスからデータを読出して、そのデータをキュー先頭レジスタに書込み、使用領域が1つ開放されたので当該ユニットのキューカウンタをデクリメントする。加えて、読出しユニットのキューカウンタが下限値以上であれば、実質的な空き領域が1つ増えるので、仮想Idleカウンタをインクリメントする。
以上のように制御することで、各ユニットの使用領域からデータの読み出しを適切に行なうことができる。
Further, data is read from the address of the link list memory indicated by the queue head register of the reading unit, and the data is written to the queue head register. Since one used area is released, the queue counter of the unit is decremented. In addition, if the queue counter of the reading unit is equal to or greater than the lower limit value, the virtual empty area is incremented by one, so the virtual idle counter is incremented.
By controlling as described above, data can be appropriately read from the use area of each unit.
(第1実施例)
以下、本発明の第1実施例について図1ないし図6を参照して説明する。図1は、本発明のメモリ管理装置を含むデータ入出力システムの構成を示すものである。斯様なシステムは、例えば、通信データを送受信する装置などに使用される。データ入出力システム1はデータメモリ2を備えており、そのデータメモリ2を、3つのポートP0〜P2(アクセスユニット)が共有してデータの書込み及び読み出しを行うようになっている。そして、データメモリ2については、使用領域及び空き領域の管理をリンクリスト方式により行うため、リンクリストメモリ3が用意されている。
(First embodiment)
Hereinafter, a first embodiment of the present invention will be described with reference to FIGS. FIG. 1 shows a configuration of a data input / output system including a memory management device according to the present invention. Such a system is used, for example, for an apparatus that transmits and receives communication data. The data input /
ポートP0〜P2は、リクエスト調停部4並びに制御部(読出し制御手段,書込み制御手段)5を介してデータメモリ2にアクセスを行う。ポートP0〜P2がリクエスト調停部4に対してWriteリクエスト(書込み要求)、Readリクエスト(読出し要求)を出力すると、リクエスト調停部4はその要求を調停して要求を許可する。そして、要求が許可されたポートP0〜P2の何れかは、Writeポート,Readポートを出力して、Writeアクセス,Readアクセスを実行する。
リクエスト調停部4は、制御部5に対して、起動信号,R/W制御信号,アクセスを実行するポートを示すポート信号を出力する。制御部5は、シーケンサ(ステートマシン)や演算器を備えており、アドレス,セレクト制御やデータ制御を行う。
The ports P0 to P2 access the
The
使用領域管理部(読出し制御手段,書込み制御手段)6は、ポートP0〜P2がデータメモリ2を使用するに当たり、各使用領域を管理するためのレジスタ群やカウンタなどで構成される。以下、使用領域管理部6における管理パラメータについて説明する。
・キュー先頭アドレス :使用領域の先頭アドレス
・キュー末尾アドレス :使用領域の末尾アドレス
・キューカウンタ:使用領域を実際に使用している(データを書込んでいる)サイズ
・キュー上限数 :使用領域の上限数(ユーザ設定による固定値)
・キュー下限数 :使用領域の下限数(ユーザ設定による固定値)
即ち、各使用領域について下限数(下限値)を設定することで、各ポートP0〜P2には、夫々の使用領域の最小限数が確保される。また、下限数とは別に上限数(上限値)を設定し、使用領域の最大数を制限する。ここで、「キュー」とは「使用領域」と同義である。
The use area management unit (read control means, write control means) 6 includes a register group and a counter for managing each use area when the ports P0 to P2 use the
-Queue start address: Start address of the used area-Queue end address: End address of the used area-Queue counter: Size in which the used area is actually used (data is written)-Maximum number of queues: Number of used areas Maximum number (fixed value by user setting)
-Queue lower limit number: Lower limit number of used area (fixed value set by user)
That is, by setting the lower limit number (lower limit value) for each used area, the minimum number of used areas is secured for each port P0 to P2. In addition to the lower limit number, an upper limit number (upper limit value) is set to limit the maximum number of used areas. Here, “queue” is synonymous with “use area”.
そして、以下の各フラグは、キューカウンタの状態に応じて使用領域管理部6により自動的にセットされる。
・キューFULLフラグ :キューカウンタが上限数以上になるとセット
・キューOV_MINフラグ :キューカウンタが下限数以上になるとセット
・キューEMPTYフラグ :キューカウンタが「0」になるとセット
The following flags are automatically set by the use
• Queue FULL flag: Set when the queue counter exceeds the upper limit • Queue OV_MIN flag: Set when the queue counter exceeds the lower limit • Queue EMPTY flag: Set when the queue counter reaches “0”
一方、未使用領域管理部(読出し制御手段,書込み制御手段)7は、データメモリ2の未使用領域(空き領域)を管理するためのレジスタ群である。以下、未使用領域管理部7における管理パラメータについて説明する。
・Idle先頭アドレス :未使用領域の先頭アドレス
・Idle末尾アドレス :未使用領域の末尾アドレス
・Idleカウンタ :未使用領域のサイズ
また、Idleカウンタとは別に、仮想Idleカウンタが用意されている。仮想Idleカウンタは、Idleカウンタのカウンタ値から、各ポートP0〜P2について、キューカウンタのカウンタ値がキュー下限数未満である場合の両者の差分を全てのポートにつき合計し、その合計値を減じた値が未使用領域管理部7によりセットされるカウンタである。ここで「Idle」とは「未使用領域」と同義である。
On the other hand, the unused area management unit (read control means, write control means) 7 is a register group for managing unused areas (free areas) of the
-Idle start address: Start address of unused area-Idle end address: End address of unused area-Idle counter: Size of unused area In addition to the Idle counter, a virtual Idle counter is provided. The virtual Idle counter summed the difference between all the ports when the counter value of the queue counter is less than the queue lower limit number for each port P0 to P2, and subtracted the total value from the counter value of the Idle counter. This is a counter whose value is set by the unused
即ち、上述のように、各使用領域について下限数を設定することで、各ポートP0〜P2の使用領域を確保するので、何れかのポートがデータメモリ2に書込みを行う場合に、自身の使用領域について見かけ上の空き領域があるとしても、仮想Idleカウンタが「0」の場合には(仮想Idle_EMPTYフラグがセットされる)、他のポートの使用領域について下限数を確保するため書込みを禁止する。
That is, as described above, by setting the lower limit number for each used area, the used area of each port P0-P2 is secured, so when any port writes to the
そして、制御部5は、使用領域管理部6,未使用領域管理部7の各レジスタ,カウンタ,フラグの状態を参照しつつ、リンクリストメモリ3に、使用領域,未使用領域夫々のリンクリストアドレスを書き込むことで、データメモリ2をリンクリスト方式によって管理する。また、制御部5は、データメモリ2に対する書込み処理,読出し処理が終了すると、Writeアクノリッジ,Readアクノリッジ信号を外部に出力する。
以上の構成において、データ入出力システム1よりリクエスト調停部4を除いたものがメモリ管理装置8を構成している。尚、リンクリストを用いた管理方式の基本的な部分については、特許文献1に開示されているような周知技術と同様である。
Then, the
In the above configuration, the
次に、本実施例の作用について図2ないし図6も参照して説明する。
<全体処理>
図3は、制御部5を中心に実行される処理内容の全体を示すフローチャートである。制御部5は、リンクリストメモリ3,使用領域管理部6及び未使用領域管理部7に対して図4に示す初期設定を行なう(ステップM1)。それから、ポートP0〜P2の何れかによってWriteリクエスト,Readリクエストの何れかが発行されるまで(ステップM3,M6)待機する(ステップM2,Idle状態)。
そして、Writeリクエストがあると(ステップM3,「YES」)、データメモリ2の使用領域(バッファ)に空きがあるか否かを判定し(ステップM4)空きがあればWrite処理を実行する(ステップM5)。一方、Readリクエストがあると(ステップM6,「YES」)、データメモリ2の使用領域に読み出し対象データがあるか否かを判定し(ステップM7)対象データがあればRead処理を実行する(ステップM8)。
Next, the operation of this embodiment will be described with reference to FIGS.
<Overall processing>
FIG. 3 is a flowchart showing the entire processing executed mainly by the
When there is a write request (step M3, "YES"), it is determined whether or not there is an empty space in the use area (buffer) of the data memory 2 (step M4). M5). On the other hand, if there is a read request (step M6, “YES”), it is determined whether or not there is data to be read in the use area of the data memory 2 (step M7). M8).
<初期設定処理>
次に、ステップM1の「初期設定」処理について、図4を参照して説明する。制御部5は、先ず、リンクリストメモリ3の全アドレスに、「アドレス+1」のデータを書き込む(ステップS1)。それから、各ポートP0〜P2の制御レジスタを設定する(ステップS2)。キューカウンタはゼロクリアし、キュー上限数,下限数は、ユーザの仕様に応じて設定する。尚、キュー先頭アドレス,末尾アドレスは処理の実行過程で決まるため、初期設定は不要である。
<Initial setting process>
Next, the “initial setting” process in step M1 will be described with reference to FIG. First, the
続いて、使用領域管理部6は、各ポートP0〜P2のキューカウンタの状態に応じて、FULLフラグ, OV_MINフラグ, EMPTYフラグを初期設定する(ステップS3)。この場合、キューEMPTYフラグだけがセットされる。尚、続くステップS4,S5は、第1実施例を拡張した第2実施例において実行される処理であり、第1実施例では使用しないため、その説明は第2実施例で行う。
Subsequently, the use
次に、制御部5は、未使用領域管理部7のIdle先頭アドレス,末尾アドレスを、リンクリストメモリ(バッファ)3の先頭アドレス,末尾アドレスに設定すると共に、Idleカウンタを、リンクリストメモリ3のサイズに設定する(この時点では、全領域が未使用であるため,ステップS6)。それから、仮想Idleカウンタの値を、上述のように初期設定し(ステップS7)、当該カウンタの状態を仮想Idle _EMPTYフラグに反映させる(ステップS8)。
Next, the
<Write制御>
次に、ステップM4,M5に相当するWrite制御について図5を参照して説明する。先ず、書込みを行うのがP0〜P2の何れのポートであるかを判別すると(ステップW1)、そのポート(書込みポートと称す)のキューFULLフラグが「0」か否かを判断する(ステップW2)。キューFULLフラグが「1」であれば(NO)、書込みポートの使用領域には全てデータが書き込まれており、且つ、それらは未だ読み出されていない状態にある。従って、データメモリ2に書込みは行わず、処理を終了する。
<Write control>
Next, the write control corresponding to steps M4 and M5 will be described with reference to FIG. First, when it is determined which port of P0 to P2 is to be written (step W1), it is determined whether or not the queue FULL flag of that port (referred to as a write port) is “0” (step W2). ). If the queue FULL flag is “1” (NO), all data is written in the used area of the write port, and they are not yet read. Therefore, the
一方、キューFULLフラグが「0」であれば(YES)、書込みポートの使用領域は上限に達していないので、続いてキューOV_MINフラグが「0」か否かを判断する(ステップW3)。キューOV_MINフラグが「0」であれば(YES)、書込みポートの使用領域は未だ下限に達していないことを示すので、無条件で書込みが可能となる。従って、この時点でIdle先頭アドレスレジスタが示しているリンクリストメモリ3のアドレス(最初の書込みは、メモリ3の先頭アドレス)にデータを書き込む(ステップW4)。
On the other hand, if the queue FULL flag is “0” (YES), since the use area of the write port has not reached the upper limit, it is subsequently determined whether or not the queue OV_MIN flag is “0” (step W3). If the queue OV_MIN flag is “0” (YES), it indicates that the used area of the write port has not yet reached the lower limit, so that writing is possible unconditionally. Therefore, data is written to the address of the
また、ステップW3において、キューOV_MINフラグが「1」であれば(NO)、書込みポートの使用領域は下限を超えている。そこで、ステップW9に移行し、仮想Idle _EMPTYフラグが「0」か否かを判断する。当該フラグが「1」であれば(NO)、他のポートの下限を確保した状態で、データメモリ2に空き領域はないことを示すので、書込みは行わず処理を終了する。一方、上記フラグが「0」であれば(YES)データメモリ2に空き領域があるので、ステップW4に移行して書込みを行う。尚、ステップW2,W3,W9,W10の処理が、図3におけるステップM4に対応する。
In Step W3, if the queue OV_MIN flag is “1” (NO), the use area of the write port exceeds the lower limit. Therefore, the process proceeds to step W9, and it is determined whether or not the virtual Idle_EMPTY flag is “0”. If the flag is “1” (NO), it indicates that there is no free space in the
ステップW4においてデータを書き込むと、続いて、書込みポートのキューカウンタが「0」か否かを判断する(ステップW5)。当該カウンタが「0」でなければ(NO)、使用領域に書き込まれているデータが、その時点で全て読み出されていないことを示す。
但し、最初に書込みが行われた時点では、初期設定によりキューカウンタは「0」となっているため「YES」と判断し、キュー先頭アドレスレジスタに、Idle先頭アドレスレジスタの値を書き込む(ステップW11)。それから、当該レジスタの値を、キュー末尾アドレスレジスタにも書込み(データを1個だけ書き込んだ時点では、使用領域の先頭と末尾は同じ)、この時点で領域を1つ使用したのでキューカウンタをインクリメントする(ステップW7)。
When data is written in step W4, it is subsequently determined whether or not the queue counter of the write port is “0” (step W5). If the counter is not “0” (NO), it indicates that all data written in the use area has not been read at that time.
However, since the queue counter is “0” by the initial setting at the time of the first writing, it is determined as “YES”, and the value of the Idle head address register is written in the queue head address register (step W11). ). Then, the value of the register is also written to the queue end address register (when only one piece of data is written, the beginning and end of the used area are the same), and the queue counter is incremented because one area is used at this point. (Step W7).
尚、次回に同じ書込みポートが次のデータを書き込む場合には、ステップW5で(NO)と判断するので、ステップW6に移行し、キュー末尾アドレスレジスタが示すリンクリストメモリ3のアドレスに、Idle先頭アドレスレジスタの値を書き込む。そして、ステップW7に移行する。
続くステップW8では、キューカウンタの状態を各キュー(FULL,OV_MIN,EMPTY)フラグに反映させる。それから、Idle先頭アドレスレジスタが示すリンクリストメモリ3のアドレスからデータを読出し、そのデータをIdle先頭アドレスレジスタに書き込むと共に、Idleカウンタをデクリメントする(ステップW12)。最後に、仮想Idleカウンタの状態を、EMPTYフラグに反映させると(ステップW13)処理を終了する。
When the next data is written next time by the same write port, it is judged as NO in step W5. Therefore, the process proceeds to step W6, and the Idle head is added to the address of the
In subsequent step W8, the state of the queue counter is reflected in each queue (FULL, OV_MIN, EMPTY) flag. Then, data is read from the address of the
上述した書込み制御については、ステップW2,W3,W9における各フラグの判定結果に基づく書込み処理の禁止と、その判定処理を行うためのステップW10,W13における仮想Idleカウンタに関する処理部分が新規な構成となっている。 Regarding the above-described write control, the write processing is prohibited based on the determination result of each flag in steps W2, W3, and W9, and the processing portion related to the virtual idle counter in steps W10 and W13 for performing the determination processing has a new configuration. It has become.
<Read制御>
次に、図3のステップM7,M8に相当するRead制御について図6を参照して説明する。先ず、読み出しを行うのがP0〜P2の何れのポートであるかを判別すると(ステップR1)、そのポート(読出しポートと称す)のキューEMPTYフラグが「0」か否かを判断する(ステップR2)。即ち、キューEMPTYフラグが「1」にセットされていれば(NO)、読出しポートの使用領域にデータの書込みが全く行われておらず、読出し対象データが存在しないことを示す。従って、データの読み出しは行わず、処理を終了する。
<Read control>
Next, Read control corresponding to steps M7 and M8 in FIG. 3 will be described with reference to FIG. First, when it is determined which port of P0 to P2 is to be read (step R1), it is determined whether or not the queue EMPTY flag of that port (referred to as a read port) is “0” (step R2). ). That is, if the queue EMPTY flag is set to “1” (NO), it indicates that no data is written in the use area of the read port and no read target data exists. Therefore, the process is terminated without reading data.
一方、キューEMPTYフラグが「0」であれば(ステップR2,YES)読出し対象データが存在するので、キュー先頭アドレスレジスタが示すデータメモリ2のアドレスからデータを読み出す(ステップR3)。続いて、Idleカウンタが「0」か否かを判断するが(ステップR4)、「0」でなければ(NO)データメモリ2に空き領域が存在する。従って、Idle末尾アドレスレジスタが示すリンクリストメモリ3のアドレスに、読出しポートのキュー先頭アドレスレジスタの内容を書き込む(ステップR5)。即ち、空き領域の末尾を、ステップR3で読出しを行ったアドレスに更新する。
また、ステップR4においてIdleカウンタが「0」の場合は(YES)、データメモリ2に空き領域がないので、Idle先頭アドレスレジスタにキュー先頭アドレスレジスタの内容を書き込む(ステップR12)。即ち、空き領域の先頭アドレスを、使用領域の先頭アドレスに更新する。
On the other hand, if the queue EMPTY flag is “0” (step R2, YES), there is data to be read, so data is read from the address of the
If the Idle counter is “0” in step R4 (YES), the
続いて、Idle末尾アドレスレジスタに、キュー先頭アドレスレジスタの内容を書き込む。即ち、この時点での使用領域の先頭アドレスが空き領域の末尾アドレスとなる。それから、データを読み出したことで使用領域を1つ開放したのでIdleカウンタをインクリメントする(ステップR6)。次に、キュー先頭アドレスレジスタが示すリンクリストメモリ3のアドレスからデータを読み出すと、そのデータをキュー先頭アドレスレジスタに書き込み、キューカウンタをデクリメントする(ステップR7)。
Subsequently, the contents of the queue head address register are written into the Idle tail address register. That is, the start address of the used area at this time is the end address of the empty area. Then, since one used area is released by reading the data, the Idle counter is incremented (step R6). Next, when data is read from the address of the
次に、ステップW8と同様に、キューカウンタの状態を各キュー(FULL,OV_MIN,EMPTY)フラグに反映させると(ステップR8)、キューOV_MINフラグが「0」か否かを判定する(ステップR9)。当該フラグが「1」であれば(NO)、使用領域を1つ開放した時点で、読出しポートの割当て領域は下限以上に使用されている。従って、仮想Idleカウンタをインクリメントして(ステップR10)、当該カウンタの状態をEMPTYフラグに反映させると(ステップR11)処理を終了する(尚、ステップR11はパスしても良い)。一方、ステップR9においてキューOV_MINフラグが「0」であれば(YES)、読出しポートの割当て領域は下限に達するまで使用されていないので、そのままステップR11に移行する。 Next, similarly to step W8, when the state of the queue counter is reflected in each queue (FULL, OV_MIN, EMPTY) flag (step R8), it is determined whether or not the queue OV_MIN flag is “0” (step R9). . If the flag is “1” (NO), the read port allocation area is used more than the lower limit when one used area is released. Therefore, when the virtual idle counter is incremented (step R10) and the state of the counter is reflected in the EMPTY flag (step R11), the process is terminated (step R11 may be passed). On the other hand, if the queue OV_MIN flag is “0” in step R9 (YES), the read port allocation area is not used until the lower limit is reached, and the process proceeds to step R11.
ここで、図2は、上記のWrite制御,Read制御が行われた場合のデータメモリ2,リンクリストメモリ3のイメージと、各レジスタやフラグの変化状態の一例を示す。初期状態が(a)であり、データメモリ2(サイズは8フレームと仮定)の空き領域はアドレス4,7となっている。ポートP0のデータ配置は、
データP0−0→アドレス0
データP0−1→アドレス1
データP0−2→アドレス5
であり、使用領域の先頭アドレスは「0」、末尾アドレスは「5」、キューカウンタの値は「3」となっている。また、リンクリストメモリ3におけるアドレスリンクは、
アドレス:0→1→5→(6)
となっている。但し、最後のアドレス(6)はポートP0の使用領域を意味しない。
Here, FIG. 2 shows an example of the image of the
Data P0-0
Data P0-1
Data P0-2
The start address of the use area is “0”, the end address is “5”, and the value of the queue counter is “3”. The address link in the
Address: 0 → 1 → 5 → (6)
It has become. However, the last address (6) does not mean the use area of the port P0.
また、各ポートP0,P1,P2の使用領域の上限は各「4」であり、それらのトータルはデータメモリ2のサイズを超えているが、下限は「1」,「1」,「2」に設定されており、各ポートには少なくともそれらの領域が確保されている。そして、データを書き込んだ数が上限値に達しなくとも、仮想Idleカウンタの状態に基づく制御により書込みが制限される場合がある。
In addition, the upper limit of the use area of each port P0, P1, P2 is “4”, and their total exceeds the size of the
上記の状態(a)から、(b)において、ポートP0が次にデータP0−3を書き込む場合、データメモリ2の空き領域の先頭アドレス「4」(Idle0)に書き込む。その結果、リンクリストメモリ3のアドレス5にはアドレス4が書き込まれ、リンクリストメモリ3におけるアドレスリンクは、
アドレス:0→1→5→4→(7)
に変化する。
また、使用領域の末尾アドレスは「4」、キューカウンタの値は「4」となり、上限に達したため、キューFULLフラグがセットされる。そして、Idle先頭アドレスは「7」に、Idleカウンタの値は「1」に、仮想Idleカウンタの値は「0」に減少したので、仮想Idle_EMPTYフラグがセットされる。
In the state (a) to (b), when the port P0 next writes the data P0-3, the data P2 is written to the free space start address “4” (Idle0). As a result, the
Address: 0 → 1 → 5 → 4 → (7)
To change.
Further, the end address of the used area is “4”, the value of the queue counter is “4”, and since the upper limit has been reached, the queue FULL flag is set. Since the Idle start address is decreased to “7”, the value of the Idle counter is decreased to “1”, and the value of the virtual Idle counter is decreased to “0”, the virtual Idle_EMPTY flag is set.
次に状態(b)から、(c)において、ポートP2がデータP2−0を読み出す場合、データメモリ2のキュー先頭アドレス2からデータP2−0が読み出される。すると、アドレス2が空き領域となり、ポートP2の使用領域はなくなる。即ち、キューカウンタの値は「0」となってキューEMPTYフラグがセットされる。そして、Idle末尾アドレスは「2」となり、Idleカウンタはインクリメントされて「2」となる。この場合、Read制御に従ってポートP2のキュー先頭アドレスは(4)に更新されるが、使用領域は存在しないため実質的な意味はない。
Next, in the state (b) to (c), when the port P2 reads the data P2-0, the data P2-0 is read from the
以上のように本実施例によれば、データ入出力システム1において、データメモリ2の使用領域と空き領域とをリンクリストメモリ3を使用して管理する場合に、ポートP0〜P2が夫々データメモリ2を使用する領域に制限を設け、各ポートP0〜P2の使用領域が常に確保されるようにメモリ管理装置8を構成したので、従来とは異なり、特定のポートがデータメモリ2を独占的に使用する状態となることは回避される。
具体的には、各ポートP0〜P2のキューカウンタに下限数を設定し、空き領域数を示すIdleカウンタの値より、各キューカウンタにおけるカウンタ値が下限数よりも大きい場合の両者の差分を合計して減じた仮想Idleカウンタを使用して空き領域を管理することで、各ユニットの使用領域は、少なくとも下限数分は確保される。
As described above, according to the present embodiment, in the data input /
Specifically, the lower limit number is set in the queue counter of each port P0 to P2, and the difference between the two when the counter value in each queue counter is larger than the lower limit number is summed from the value of the idle counter indicating the number of free areas. By managing the free space using the reduced virtual idle counter, the used space of each unit is secured at least the lower limit number.
そして、制御部5は、ポートP0〜P2の何れかによる書込み要求が発生した場合、書込みポートのキューカウンタが上限数以上、または上限数未満で且つ下限数以上であり且つ仮想Idleカウンタの値が「0」の場合は、データメモリ2に対する書込みを禁止する。即ち、キューカウンタが上限数未満であっても、他のポートの使用領域の下限を確保する必要がある場合は書込みを禁止する。
また、書込みポートのキューカウンタが下限数未満の場合、または上限数未満で且つ下限数以上であり且つ仮想Idleカウンタが「0」でない場合は当該カウンタをデクリメントし、Idle先頭レジスタが示すアドレスにデータを書き込む。即ち、書込みポートの使用領域に確実に空きがある場合、また、その他のポートが使用する下限を確保した上で空き領域が存在する場合は、空き領域の先頭アドレスにデータを書き込むことができる。
When a write request is generated by any of the ports P0 to P2, the
If the queue counter of the write port is less than the lower limit number, or less than the upper limit number and greater than or equal to the lower limit number, and the virtual Idle counter is not “0”, the counter is decremented and data is stored at the address indicated by the Idle head register. Write. That is, if there is a vacant area in the use area of the write port, or if a vacant area exists after ensuring the lower limit used by other ports, data can be written to the start address of the vacant area.
そして、上記のように書込み処理を行なうと空き領域の先頭は書込みポートの使用領域の末尾となるので、キューカウンタが「0」でなければ、Idle先頭レジスタのアドレス値を当該ポートのキュー末尾レジスタが示すリンクリストメモリ3のアドレスに書き込む。また、キューカウンタが「0」の場合は使用領域に先頭がないので、空き領域の先頭アドレスを書込みポートのキュー先頭レジスタに書き込んで、使用領域の先頭を空き領域の先頭として、以降は、使用領域の先頭からデータを上書きすることができる。
When the write process is performed as described above, the head of the free area becomes the end of the used area of the write port. Therefore, if the queue counter is not “0”, the address value of the Idle start register is set to the queue end register of the port. Is written in the address of the
更に、書込みポートのキュー末尾レジスタにIdle先頭レジスタの内容を書き込んでキューカウンタをインクリメントし、Idle先頭レジスタが示すリンクリストメモリ3のアドレスからデータを読み出し、Idle先頭レジスタに書き込むとIdleカウンタをデクリメントする。従って、各ポートの使用領域を確保しつつ書込み制御を行うことができる。そして、各ポートの使用領域について、下限数により最小使用数を確保した上で上限数を柔軟に設定することができる。
また、制御部5は、ポートP0〜P2の何れかによる読出し要求が発生した場合に、読み出しポートのキューカウンタが「0」の場合はデータ読み出しを禁止し、キューカウンタが「0」でない場合は、キュー先頭レジスタが示すデータメモリ2のアドレスからデータを読み出す。
Furthermore, the contents of the Idle head register are written to the queue end register of the write port, the queue counter is incremented, data is read from the address of the
Further, when a read request is generated by any of the ports P0 to P2, the
そして、上記の処理の後、Idleカウンタの値が「0」でない場合は、Idle末尾レジスタが示すリンクリストメモリ3のアドレスとIdle末尾レジスタに、キュー先頭レジスタの内容を書込んでIdleカウンタをインクリメントする。また、Idleカウンタの値が「0」の場合は、Idle先頭レジスタ及びIdle末尾レジスタに、キュー先頭レジスタの内容を書込んでからIdleカウンタをインクリメントする。更に、キュー先頭レジスタが示すリンクリストメモリ3のアドレスからデータを読出してキュー先頭レジスタに書き込んでキューカウンタをデクリメントし、キューカウンタが下限数以上であれば仮想Idleカウンタをインクリメントする。従って、各ポートの使用領域からデータの読み出しを適切に行なうことができる。
After the above processing, if the value of the Idle counter is not “0”, the contents of the queue head register are written to the address of the
(第2実施例)
図7ないし図12は本発明の第2実施例を示すものであり、第1実施例と同一部分には同一符号を付して説明を省略し、以下異なる部分について説明する。第2実施例のデータ入出力システム11は、データメモリ2に対して書込み及び読み出しを行なうユニット数を増やして構成されており、リクエスト調停部4は12に、制御部5は13に、使用領域管理部6は14に、メモリ管理装置8は15に夫々置き換えられている。
(Second embodiment)
7 to 12 show a second embodiment of the present invention. The same parts as those in the first embodiment are denoted by the same reference numerals and the description thereof will be omitted. Hereinafter, different parts will be described. The data input /
ポートはP0〜P7の8つがあり、各ポートについてHigh,Mid,Lowの3つの優先度(クラス)が設定されており、アクセスユニット数は「24」となっている。そして、ポートP0における優先度High,Mid,Lowの各ユニットは、P0グループと称す。尚、これらの優先度は、本発明のメモリ管理方式とは直接の関係がなく、各ポートP0〜P7の内部でデータを読み書きするための優先順位を示しており、その優先順位に基づく調整は別の構成部分によって行なわれる。 There are eight ports P0 to P7, and three priorities (classes) of High, Mid, and Low are set for each port, and the number of access units is “24”. Each unit of priority High, Mid, and Low at the port P0 is referred to as a P0 group. These priorities are not directly related to the memory management system of the present invention, and indicate priorities for reading / writing data in the ports P0 to P7, and adjustment based on the priorities is performed. This is done by another component.
使用領域管理部14においては、各ユニット毎に、先頭/末尾アドレスレジスタ,キューカウンタ,キュー上限/下限数,キュー(FULL,OV_MIN,EMPTY)フラグが用意されていると共に、各ポートP0〜P7毎にも、キューカウンタ,キュー上限数,キューFULLフラグが用意されている(ポート総和管理部)。また、各ポートP0〜P7におけるHigh,Mid,Lowの優先度についても縦の関係でグループ化されており、各グループ毎にキューカウンタ,キュー上限数,キューFULLフラグが用意されている(優先度総和管理部)。尚、グループ毎のカウンタや上限数は、グループに属するユニットのカウンタ値,上限数の総和となる。
In the use
次に、第2実施例の作用について図8乃至図12も参照して説明する。尚、第2実施例の場合、図4に示す初期設定処理において、各ポート総和管理部及び各優先度総和管理部についても、キューカウンタの初期設定(=0),キュー上限数の設定(ユーザの仕様による)を行なうと共に(ステップS4)、キューカウンタの状態をキューFULLフラグに反映させる処理を行なう(ステップS5)。 Next, the operation of the second embodiment will be described with reference to FIGS. In the case of the second embodiment, in the initial setting process shown in FIG. 4, the initial setting of the queue counter (= 0) and the setting of the upper limit number of queues (users) are also set for each port total management unit and each priority total management unit. (Step S4) and the process of reflecting the state of the queue counter in the queue FULL flag (step S5).
また、図8,図9は、第1実施例の図5,図6相当図である。基本的な処理は第1実施例と同様であるが、ステップ番号に“’”を付した処理については、アクセスを行ったユニットを、当該ユニットが属するグループと共に特定する処理が付加されたものを示している。例えば、図8のステップW1’では、書込み要求を行なったユニットが属しているのが、P0〜P7の何れのグループであり(何れのポート総和管理部に属し)、High,Mid,Lowの何れの優先度総和管理部に属するかを判別しており、ステップW2’では、書込みユニットが属するグループ,優先度管理部,ポート総和管理部の全てのキューFULLフラグが「0」か否かを判断する。
また、ステップW8’においては、対象グループのカウンタ状態を各キューフラグに反映させると共に、対象のポート総和管理部,優先度総和管理部のカウンタ状態も、キューFULLフラグに反映させている。そして、図9に示すRead制御においても、同様の変更が加えられている。
8 and 9 are diagrams corresponding to FIGS. 5 and 6 of the first embodiment. The basic processing is the same as in the first embodiment, but for the processing with the step number “'” added, the processing for specifying the accessed unit together with the group to which the unit belongs is added. Show. For example, in step W1 ′ in FIG. 8, the unit that made the write request belongs to any group of P0 to P7 (which belongs to any port total management unit), and any of High, Mid, and Low In step W2 ′, it is determined whether or not all queue FULL flags of the group to which the writing unit belongs, the priority management unit, and the port total management unit are “0”. To do.
In step W8 ′, the counter state of the target group is reflected in each queue flag, and the counter states of the target port total management unit and priority total management unit are also reflected in the queue FULL flag. The same change is made in the Read control shown in FIG.
図10,図11は、以上のように処理を行う結果、各アクセスユニットがデータメモリ2の領域を分割して使用する例を概念的に説明するものである。尚、説明を簡単にするため、ポート数をP0〜P3の4つとして計12のユニットがある場合を示す。また、データメモリ2のサイズは、512フレームであるとする。
10 and 11 conceptually illustrate an example in which each access unit divides and uses the area of the
図11(a)においては、各グループのキュー単位,出力ポート単位,クラス単位の何れについても上限数を「512」に設定した場合であり、上限数の設定条件が最も緩くなっている。即ち、各ユニットについては、キューの下限数が確保されている以外は、その他のユニットの何れか1つが仮想Idleカウンタで示される空き領域の最大値(<512)まで使用することが可能である。また、各ポートP0〜P3についても、各クラスHigh,Mid,Lowについても、同様の設定である。 In FIG. 11A, the upper limit number is set to “512” for any of the queue unit, output port unit, and class unit of each group, and the setting condition for the upper limit number is the most lenient. That is, for each unit, any one of the other units can be used up to the maximum free space value (<512) indicated by the virtual idle counter, except that the lower limit number of queues is secured. . The same setting is applied to each of the ports P0 to P3 and the classes High, Mid, and Low.
図11(b)においては、(a)に対して、各グループのキュー単位の上限を、クラスHighは42フレーム、クラスMid,Lowは43フレームとして、各ポート毎に512フレームを等分した場合である。尚、ポート単位,クラス単位の上限が512フレームに設定されているが、実質的には(42+43+43=)128フレームが上限となっている。 In FIG. 11B, when the upper limit of the queue unit of each group is 42 frames for class High and 43 frames for classes Mid and Low with respect to (a), 512 frames are equally divided for each port. It is. Although the upper limit of the port unit and the class unit is set to 512 frames, the upper limit is substantially (42 + 43 + 43 =) 128 frames.
図11(c)においては、ポート間で上限数に傾斜を付与して設定した場合である。即ち、ポートP0については各クラスの上限が64フレーム,ポートP1,P2は同上限が夫々48,32フレームとなっている。そして、ポートP3については、クラス単位の上限設定がなく、ポート単位で上限が80フレームに設定されている。 FIG. 11C shows the case where the upper limit number is given an inclination between ports. That is, the upper limit of each class is 64 frames for port P0, and the upper limits of ports P1 and P2 are 48 and 32 frames, respectively. For the port P3, there is no upper limit setting for each class, and the upper limit is set to 80 frames for each port.
図11(d)においては、各ポートP0〜P3毎に上限を128フレームで設定して等分する。そして、キュー単位の上限設定は50フレームとしておき、総和が128フレームとなる範囲内で制限する。 In FIG. 11 (d), the upper limit is set to 128 frames for each port P0 to P3 and is equally divided. The upper limit setting for each queue is set to 50 frames, and the upper limit is limited within a range where the total is 128 frames.
また、図12は、図7に示すデータ入出力システム11を備え、その周辺にポートP0〜P7の入出力制御を行う構成部分を加えたものを示しており、例えば、通信データ入出力装置のICチップとして構成される。通信データ入出力装置21は、8つのポートP0〜P7について、入力ポート22,出力ポート23が独立に存在する。即ち、入力ポート22(0)を介して入力されたデータがデータメモリ2に書き込まれると、そのデータは出力ポート23(0)により読み出されて外部に出力される。
Further, FIG. 12 shows the data input /
入力ポート22が、リクエスト信号を入力制御部24に出力すると、入力制御部24は、それらのリクエスト信号を調停し、マルチプレクサ25及びWriteグループ設定部26にポートセレクト信号を出力すると共に、データ入出力システム11のリクエスト調停部12に対して、Writeリクエスト信号を出力する。
入力制御部24で選択された入力ポート22のデータは、マルチプレクサ25を介して優先度判定部27に出力され、更にデータ入出力システム11のデータメモリ2に出力される。各ポートについては、優先度High,Mid,Lowのグループが存在しており、ポート内においてそれらの内2つ以上がリクエストを出力した場合、ポート内で優先度が高いものが選択されている。そして、優先度判定部27は、選択されたポートが出力したデータに付与されている優先度を判定すると、その判定結果をWriteグループ設定部26に出力する。
When the
The data of the
Writeグループ設定部26は、与えられたポート並びに優先度に基づいてWriteグループ(アクセスユニットの1つ)を設定し、リクエスト調停部12に対して出力する。また、データ入出力システム11の制御部13が出力するWriteアクノリッジ信号は、入力制御部24に与えられている。
The write
一方、出力ポート23が、リクエスト信号を自身に対応する出力優先度判定部28並びに出力制御部29に出力すると、出力優先度判定部28は、上記リクエスト信号に付与されているポートグループの優先度を判定し、その判定結果を出力制御部29に出力する。すると、出力制御部29は、入力されたリクエスト信号並びに優先度に応じてReadグループ(アクセスユニットの1つ)を設定し、Readリクエスト信号と共にリクエスト調停部12に対して出力する。
そして、データメモリ2より出力されたデータは、各出力ポート23に出力されるようになっている。また、制御部13が出力するReadアクノリッジ信号は、出力制御部29に与えられ、出力制御部29は、選択した出力ポートの1つにそのアクノリッジ信号を出力する。
On the other hand, when the
The data output from the
以上のように第2実施例によれば、複数のポートP0〜P7について、優先度のクラスを3段階に設定したグループを持たせて、また、その3段階のクラスについてもアクセスグループに分けて各グループ毎にキューカウンタを設け、それらのキューカウンタについては上限数のみを設定し、制御部13は、当該上限数についてはポートP0〜P7毎のキューカウンタの上限数と同様の判断処理を行うと共に、各グループ毎のキューカウンタについて、ポートP0〜P7のキューカウンタと同様のカウント操作を行う。従って、アプリケーションに応じて上限をより多様に設定することができる。
As described above, according to the second embodiment, a plurality of ports P0 to P7 are provided with a group in which priority classes are set in three levels, and the three-level classes are also divided into access groups. A queue counter is provided for each group, and only the upper limit number is set for these queue counters, and the
(第3実施例)
図13は本発明の第3実施例を示すものであり、第1実施例と異なる部分について説明する。図13は図5相当図である。第1実施例のWrite制御では、ステップW2,W9で「NO」と判断した場合に、データメモリ2に対する書込みを禁止したが、第3実施例では、上記のケースでステップW14を実行し、書込みポートのキュー先頭アドレスレジスタが示すデータメモリ2のアドレスに入力データを書き込む。
(Third embodiment)
FIG. 13 shows a third embodiment of the present invention, and different portions from the first embodiment will be described. FIG. 13 corresponds to FIG. In the write control of the first embodiment, when “NO” is determined in steps W2 and W9, writing to the
即ち、ステップW2,W9で「NO」と判断するケースは、データメモリ2に空き領域が存在しないため、第1実施例では書込みを禁止したが、第3実施例では、書込みポートの使用領域の先頭アドレスが示す、未だ読み出されていないデータの内最も古いものに、最新の入力データを上書きする。それから、キュー先頭レジスタのアドレス値をキュー末尾レジスタが示すリンクリストメモリのアドレスとキュー末尾レジスタに書き込み(ステップW15,W16)、キュー先頭レジスタのアドレス値が示すリンクリストメモリのアドレスからデータを読み出して、そのデータをキュー先頭アドレスに書き込み(ステップW17)、最新のデータとして管理する。従って、最新のデータを喪失することなく、データメモリに記憶させることができる。
That is, in the case where “NO” is determined in steps W2 and W9, since there is no free area in the
本発明は上記し且つ図面に記載した実施例に限定されるものではなく、以下のような変形または拡張が可能である。
アクセスユニットの数は、個別の設計に応じて適宜変更すれば良い。
The present invention is not limited to the embodiments described above and shown in the drawings, and the following modifications or expansions are possible.
The number of access units may be appropriately changed according to the individual design.
図面中、2はデータメモリ、3はリンクリストメモリ、5は制御部(読出し制御手段,書込み制御手段)、6は使用領域管理部(読出し制御手段,書込み制御手段)、7は未使用領域管理部(読出し制御手段,書込み制御手段)、8はメモリ管理装置、13は制御部(読出し制御手段,書込み制御手段)、14は使用領域管理部(読出し制御手段,書込み制御手段)、15はメモリ管理装置を示す。 In the drawing, 2 is a data memory, 3 is a link list memory, 5 is a control unit (reading control means, writing control means), 6 is a used area management part (reading control means, write control means), and 7 is unused area management. (Read control means, write control means), 8 is a memory management device, 13 is a control section (read control means, write control means), 14 is a use area management section (read control means, write control means), and 15 is a memory. Indicates a management device.
Claims (8)
前記データメモリに対してデータの書込み及び読み出しを行う複数のアクセスユニットが夫々前記データメモリを使用する領域に制限を設けることで、前記複数のアクセスユニットの使用領域が常に確保されるように構成し、
前記複数のアクセスユニットが、夫々前記データメモリを使用している領域の先頭アドレス,末尾アドレスが格納されるキュー先頭レジスタ及びキュー末尾レジスタと、
これら複数のアクセスユニットが、夫々前記データメモリの領域を使用しているサイズをカウントするためのキューカウンタと、
前記空き領域の先頭アドレス及び末尾アドレスが格納されるIdle先頭レジスタ及びIdle末尾レジスタと、
前記空き領域のサイズをカウントするためのIdleカウンタと、
前記複数のキューカウンタについて夫々キューの上限値,及びキューの最小限確保数に対応する下限値が設定されており、前記Idleカウンタの値より、各キューカウンタにおけるカウンタ値が前記下限値未満である場合の両者の差分を全て合計して減算した値が格納される仮想Idleカウンタとを備え、
前記複数のアクセスユニットの何れかによる書込み要求が発生した場合に、
前記アクセスユニットに対応するキューカウンタが上限値以上、または、前記キューカウンタが上限値未満で且つ下限値以上であり且つ前記仮想Idleカウンタの値が「0」の場合は、前記データメモリに対する書込みを禁止し、
前記アクセスユニットに対応するキューカウンタが下限値未満の場合、または、前記キューカウンタが上限値未満で且つ下限値以上であり且つ前記仮想Idleカウンタが「0」でない場合は当該カウンタをデクリメントしてから、前記Idle先頭レジスタが示すアドレスにデータを書込み、
前記キューカウンタが「0」でない場合は、前記Idle先頭レジスタのアドレス値を、前記アクセスユニットのキュー末尾レジスタが示す前記リンクリストメモリのアドレスに書込み、前記キューカウンタが「0」の場合は、前記アドレス値を、前記アクセスユニットのキュー先頭レジスタに書込み、
前記アクセスユニットのキュー末尾レジスタに、前記Idle先頭レジスタの内容を書き込んで、前記アクセスユニットのキューカウンタをインクリメントし、
前記Idle先頭レジスタが示す前記リンクリストメモリのアドレスからデータを読み出して、前記データを前記Idle先頭レジスタに書き込んで、前記Idleカウンタをデクリメントする書込み制御手段を備え、
前記複数のアクセスユニットを、各ユニットがそれぞれ複数のグループに属するように複数のアクセスグループに分けて、各グループ毎にキューカウンタを設け、
前記書込み制御手段は、前記グループ毎のキューカウンタについては、キューの上限値のみを設定し、当該上限値については、前記アクセスユニット毎のキューカウンタの上限値と同様の判断処理を行い、前記アクセスユニット毎のキューカウンタと同様のカウント操作を行うことを特徴とするメモリ管理装置。 When the data requested to be written is written to the data memory and the data requested to be read is read from the data memory and output, the used area and free area of the data memory are managed using the link list memory In the memory management device
A plurality of access units that write and read data to and from the data memory are configured so that a use area of the plurality of access units is always secured by providing a restriction on an area in which the data memory is used. ,
A plurality of access units, a queue start register and a queue end register for storing a start address and an end address of an area in which the data memory is used;
A queue counter for counting the size in which each of the plurality of access units is using the area of the data memory, and
Idle start register and Idle end register in which the start address and end address of the empty area are stored, and
An Idle counter for counting the size of the free area;
An upper limit value of the queue and a lower limit value corresponding to the minimum number of queues are set for each of the plurality of queue counters, and the counter value in each queue counter is less than the lower limit value from the value of the Idle counter. And a virtual idle counter in which the value obtained by adding and subtracting all the differences between the two is stored,
When a write request by any of the plurality of access units occurs,
When the queue counter corresponding to the access unit is greater than or equal to the upper limit value, or when the queue counter is less than the upper limit value and greater than or equal to the lower limit value and the value of the virtual idle counter is “0”, writing to the data memory is performed. Ban,
When the queue counter corresponding to the access unit is less than the lower limit value, or when the queue counter is less than the upper limit value and greater than or equal to the lower limit value and the virtual idle counter is not “0”, the counter is decremented. , Write data to the address indicated by the Idle head register,
When the queue counter is not “0”, the address value of the Idle head register is written to the address of the link list memory indicated by the queue end register of the access unit, and when the queue counter is “0”, the Write the address value to the queue head register of the access unit,
Write the contents of the Idle head register to the queue end register of the access unit, increment the queue counter of the access unit,
Read data from the address of the link list memory indicated by the Idle first register, write the data to the Idle first register, and includes a write control means for decrementing the Idle counter,
The plurality of access units are divided into a plurality of access groups so that each unit belongs to a plurality of groups, and a queue counter is provided for each group,
The write control means sets only the upper limit value of the queue for the queue counter for each group, and performs the same determination processing as the upper limit value of the queue counter for each access unit for the upper limit value. A memory management device that performs a counting operation similar to a queue counter for each unit.
前記データメモリに対してデータの書込み及び読み出しを行う複数のアクセスユニットが夫々前記データメモリを使用する領域に制限を設けることで、前記複数のアクセスユニットの使用領域が常に確保されるように構成し、
前記複数のアクセスユニットが、夫々前記データメモリを使用している領域の先頭アドレス,末尾アドレスが格納されるキュー先頭レジスタ及びキュー末尾レジスタと、
これら複数のアクセスユニットが、夫々前記データメモリの領域を使用しているサイズをカウントするためのキューカウンタと、
前記空き領域の先頭アドレス及び末尾アドレスが格納されるIdle先頭レジスタ及びIdle末尾レジスタと、
前記空き領域のサイズをカウントするためのIdleカウンタと、
前記複数のキューカウンタについて夫々キューの上限値,及びキューの最小限確保数に対応する下限値が設定されており、前記Idleカウンタの値より、各キューカウンタにおけるカウンタ値が前記下限値未満である場合の両者の差分を全て合計して減算した値が格納される仮想Idleカウンタとを備え、
前記複数のアクセスユニットの何れかによる書込み要求が発生した場合に、
前記アクセスユニットに対応するキューカウンタが上限値以上、または、前記キューカウンタが上限値未満で且つ下限値以上であり且つ前記仮想Idleカウンタの値が「0」の場合は、当該ユニットの使用領域のキュー先頭レジスタが示すアドレスにデータを書込み、前記キュー先頭レジスタのアドレス値をキュー末尾レジスタが示す前記リンクリストメモリのアドレスとキュー末尾レジスタに書き込み、前記アドレス値が示す前記リンクリストメモリのアドレスからデータを読み出して、前記データを前記キュー先頭アドレスへ書き込み、
前記アクセスユニットに対応するキューカウンタが下限値未満の場合、または、前記キューカウンタが上限値未満で且つ下限値以上であり且つ前記仮想Idleカウンタが「0」でない場合は当該カウンタをデクリメントしてから、前記Idle先頭レジスタが示すアドレスにデータを書込み、
前記キューカウンタが「0」でない場合は、前記Idle先頭レジスタのアドレス値を、前記アクセスユニットのキュー末尾レジスタが示す前記リンクリストメモリのアドレスに書込み、前記キューカウンタが「0」の場合は、前記アドレス値を、前記アクセスユニットのキュー先頭レジスタに書込み、
前記アクセスユニットのキュー末尾レジスタに、前記Idle先頭レジスタの内容を書き込んで、前記アクセスユニットのキューカウンタをインクリメントし、
前記Idle先頭レジスタが示す前記リンクリストメモリのアドレスからデータを読み出して、前記データを前記Idle先頭レジスタに書き込んで、前記Idleカウンタをデクリメントする書込み制御手段を備え、
前記複数のアクセスユニットを、各ユニットがそれぞれ複数のグループに属するように複数のアクセスグループに分けて、各グループ毎にキューカウンタを設け、
前記書込み制御手段は、前記グループ毎のキューカウンタについては、
キューの上限値のみを設定し、当該上限値については、前記アクセスユニット毎のキューカウンタの上限値と同様の判断処理を行い、
前記アクセスユニット毎のキューカウンタと同様のカウント操作を行うことを特徴とするメモリ管理装置。 When the data requested to be written is written to the data memory and the data requested to be read is read from the data memory and output, the used area and free area of the data memory are managed using the link list memory In the memory management device
A plurality of access units that write and read data to and from the data memory are configured so that a use area of the plurality of access units is always secured by providing a restriction on an area in which the data memory is used. ,
A plurality of access units, a queue start register and a queue end register for storing a start address and an end address of an area in which the data memory is used;
A queue counter for counting the size in which each of the plurality of access units is using the area of the data memory, and
Idle start register and Idle end register in which the start address and end address of the empty area are stored, and
An Idle counter for counting the size of the free area;
The upper limit of the respective queue for the plurality of queues counters, and the lower limit corresponding to minimum number reserved for the queue and is set, than the value of the Idle counter, the counter value of each queue counter is smaller than the lower limit value And a virtual idle counter in which the value obtained by adding and subtracting all the differences between the two is stored,
When a write request by any of the plurality of access units occurs,
When the queue counter corresponding to the access unit is greater than or equal to the upper limit value, or when the queue counter is less than the upper limit value and greater than or equal to the lower limit value and the value of the virtual idle counter is “0” , Data is written to the address indicated by the queue head register, the address value of the queue head register is written to the address of the link list memory indicated by the queue tail register and the queue tail register, and data is obtained from the address of the link list memory indicated by the address value. And write the data to the queue head address,
When the queue counter corresponding to the access unit is less than the lower limit value, or when the queue counter is less than the upper limit value and greater than or equal to the lower limit value and the virtual idle counter is not “0”, the counter is decremented. , Write data to the address indicated by the Idle head register,
When the queue counter is not “0”, the address value of the Idle head register is written to the address of the link list memory indicated by the queue end register of the access unit, and when the queue counter is “0”, the Write the address value to the queue head register of the access unit,
Write the contents of the Idle head register to the queue end register of the access unit, increment the queue counter of the access unit,
Read data from the address of the link list memory indicated by the Idle first register, write the data to the Idle first register, and includes a write control means for decrementing the Idle counter ,
The plurality of access units are divided into a plurality of access groups so that each unit belongs to a plurality of groups, and a queue counter is provided for each group,
The write control means, for the queue counter for each group,
Only the upper limit value of the queue is set, and for the upper limit value, a determination process similar to the upper limit value of the queue counter for each access unit is performed,
A memory management device that performs a counting operation similar to a queue counter for each access unit .
前記アクセスユニットに対応するキューカウンタが「0」の場合は、前記データメモリからのデータ読み出しを禁止し、
前記アクセスユニットに対応するキューカウンタが「0」でない場合は、前記アクセスユニットのキュー先頭レジスタが示す前記データメモリのアドレスからデータを読み出し、
前記Idleカウンタの値が「0」でない場合は、前記Idle末尾レジスタが示す前記リンクリストメモリのアドレスと前記Idle末尾レジスタに、前記アクセスユニットのキュー先頭レジスタの内容を書込んで、前記Idleカウンタをインクリメントし、
前記カウンタの値が「0」の場合は、前記Idle先頭レジスタ及び前記Idle末尾レジスタに、前記アクセスユニットのキュー先頭レジスタの内容を書込んで、前記Idleカウンタをインクリメントし、
前記アクセスユニットのキュー先頭レジスタが示す前記リンクリストメモリのアドレスからデータを読出して、そのデータを前記キュー先頭レジスタに書き込んで前記アクセスユニットのキューカウンタをデクリメントし、
前記アクセスユニットのキューカウンタが下限値以上となった場合は、仮想Idleカウンタをインクリメントする読出し制御手段を備えたことを特徴とする請求項1乃至3の何れかに記載のメモリ管理装置。 When a read request is generated by any of the plurality of access units,
When the queue counter corresponding to the access unit is “0”, data reading from the data memory is prohibited,
When the queue counter corresponding to the access unit is not “0”, data is read from the address of the data memory indicated by the queue head register of the access unit;
When the value of the Idle counter is not “0”, the contents of the queue head register of the access unit are written in the address of the link list memory indicated by the Idle tail register and the Idle tail register, and the Idle counter is set. Increment and
When the value of the counter is “0”, the contents of the queue head register of the access unit are written into the Idle head register and the Idle tail register, and the Idle counter is incremented.
Read data from the address of the link list memory indicated by the queue head register of the access unit, write the data to the queue head register, decrement the queue counter of the access unit,
Wherein if the queue counter of the access unit is not less than the lower limit value, a memory management device according to any one of claims 1 to 3, further comprising a read control means for incrementing the virtual Idle counter.
前記データメモリに対してデータの書込み及び読み出しを行う複数のアクセスユニットが夫々前記データメモリを使用する領域に制限を設けることで、前記複数のアクセスユニットの使用領域を常に確保し、
前記複数のアクセスユニットが、夫々前記データメモリを使用している領域の先頭アドレス,末尾アドレスが格納されるキュー先頭レジスタ及びキュー末尾レジスタと、
これら複数のアクセスユニットが、夫々前記データメモリの領域を使用しているサイズをカウントするためのキューカウンタと、
前記空き領域の先頭アドレス及び末尾アドレスが格納されるIdle先頭レジスタ及びIdle末尾レジスタと、
前記空き領域のサイズをカウントするためのIdleカウンタと、
前記複数のキューカウンタについて夫々キューの上限値,及びキューの最小限確保数に対応する下限値を設定することで、前記Idleカウンタの値より、各キューカウンタにおけるカウンタ値が前記下限値未満である場合の両者の差分を全て合計して減算した値が格納される仮想Idleカウンタとを使用し、
前記複数のアクセスユニットの何れかによる書込み要求が発生した場合に、
前記アクセスユニットに対応するキューカウンタが上限値以上、または、前記キューカウンタが上限値未満で且つ下限値以上であり且つ前記仮想Idleカウンタの値が「0」の場合は、前記データメモリに対する書込みを禁止し、
前記アクセスユニットに対応するキューカウンタが下限値未満の場合、または、前記キューカウンタが上限値未満で且つ下限値以上であり且つ前記仮想Idleカウンタが「0」でない場合は当該カウンタをデクリメントしてから、前記Idle先頭レジスタが示すアドレスにデータを書込み、
前記キューカウンタが「0」でない場合は、前記Idle先頭レジスタのアドレス値を、前記アクセスユニットのキュー末尾レジスタが示す前記リンクリストメモリのアドレスに書込み、前記キューカウンタが「0」の場合は、前記アドレス値を、前記アクセスユニットのキュー先頭レジスタに書込み、
前記アクセスユニットのキュー末尾レジスタに、前記Idle先頭レジスタの内容を書き込んで、前記アクセスユニットのキューカウンタをインクリメントすると共に、前記Idle先頭レジスタが示す前記リンクリストメモリのアドレスからデータを読み出して、前記データを前記Idle先頭レジスタに書き込んで、前記Idleカウンタをデクリメントし、
前記複数のアクセスユニットを、各ユニットがそれぞれ複数のグループに属するように複数のアクセスグループに分けて、各グループ毎にキューカウンタを使用し、
前記グループ毎のキューカウンタについては、キューの上限値のみを設定し、当該上限値については、前記アクセスユニット毎のキューカウンタの上限値と同様の判断処理を行い、前記アクセスユニット毎のキューカウンタと同様のカウント操作を行うことを特徴とするメモリ管理方法。 When the data requested to be written is written to the data memory and the data requested to be read is read from the data memory and output, the used area and free area of the data memory are managed using the link list memory In the memory management method to
A plurality of access units that perform writing and reading of data to and from the data memory are provided with restrictions on the areas where the data memory is used, respectively, so that the use area of the plurality of access units is always secured,
A plurality of access units, a queue start register and a queue end register for storing a start address and an end address of an area in which the data memory is used;
A queue counter for counting the size in which each of the plurality of access units is using the area of the data memory, and
Idle start register and Idle end register in which the start address and end address of the empty area are stored, and
An Idle counter for counting the size of the free area;
By setting the upper limit value of the queue and the lower limit value corresponding to the minimum number of reserved queues for each of the plurality of queue counters, the counter value in each queue counter is less than the lower limit value than the value of the Idle counter. Use the virtual idle counter that stores the total of the differences between the two cases and stores the subtracted value.
When a write request by any of the plurality of access units occurs,
When the queue counter corresponding to the access unit is greater than or equal to the upper limit value, or when the queue counter is less than the upper limit value and greater than or equal to the lower limit value and the value of the virtual idle counter is “0”, writing to the data memory is performed. Ban,
When the queue counter corresponding to the access unit is less than the lower limit value, or when the queue counter is less than the upper limit value and greater than or equal to the lower limit value and the virtual idle counter is not “0”, the counter is decremented. , Write data to the address indicated by the Idle head register,
When the queue counter is not “0”, the address value of the Idle head register is written to the address of the link list memory indicated by the queue end register of the access unit, and when the queue counter is “0”, the Write the address value to the queue head register of the access unit,
Write the contents of the Idle head register to the queue end register of the access unit, increment the queue counter of the access unit, read data from the address of the link list memory indicated by the Idle head register, and To the Idle head register, decrement the Idle counter,
Dividing the plurality of access units into a plurality of access groups so that each unit belongs to a plurality of groups, and using a queue counter for each group,
For the queue counter for each group, only the upper limit value of the queue is set, and for the upper limit value, a determination process similar to the upper limit value of the queue counter for each access unit is performed. A memory management method comprising performing a similar counting operation .
前記データメモリに対してデータの書込み及び読み出しを行う複数のアクセスユニットが夫々前記データメモリを使用する領域に制限を設けることで、前記複数のアクセスユニットの使用領域を常に確保し、
前記複数のアクセスユニットが、夫々前記データメモリを使用している領域の先頭アドレス,末尾アドレスが格納されるキュー先頭レジスタ及びキュー末尾レジスタと、
これら複数のアクセスユニットが、夫々前記データメモリの領域を使用しているサイズをカウントするためのキューカウンタと、
前記空き領域の先頭アドレス及び末尾アドレスが格納されるIdle先頭レジスタ及びIdle末尾レジスタと、
前記空き領域のサイズをカウントするためのIdleカウンタと、
前記複数のキューカウンタについて夫々キューの上限値,及びキューの最小限確保数に対応する下限値を設定することで、前記Idleカウンタの値より、各キューカウンタにおけるカウンタ値が前記下限値未満である場合の両者の差分を全て合計して減算した値が格納される仮想Idleカウンタとを使用し、
前記複数のアクセスユニットの何れかによる書込み要求が発生した場合に、
前記アクセスユニットに対応するキューカウンタが上限値以上、または、前記キューカウンタが上限値未満で且つ下限値以上であり且つ前記仮想Idleカウンタの値が「0」の場合は、当該ユニットの使用領域のキュー先頭レジスタが示すアドレスにデータを書込み、前記キュー先頭レジスタのアドレス値をキュー末尾レジスタが示す前記リンクリストメモリのアドレスとキュー末尾レジスタに書き込み、前記アドレス値が示す前記リンクリストメモリのアドレスからデータを読み出して、前記データを前記キュー先頭アドレスへ書き込み、
前記アクセスユニットに対応するキューカウンタが下限値未満の場合、または、前記キューカウンタが上限値未満で且つ下限値以上であり且つ前記仮想Idleカウンタが「0」でない場合は当該カウンタをデクリメントしてから、前記Idle先頭レジスタが示すアドレスにデータを書込み、
前記キューカウンタが「0」でない場合は、前記Idle先頭レジスタのアドレス値を、前記アクセスユニットのキュー末尾レジスタが示す前記リンクリストメモリのアドレスに書込み、前記キューカウンタが「0」の場合は、前記アドレス値を、前記アクセスユニットのキュー先頭レジスタに書込み、
前記アクセスユニットのキュー末尾レジスタに、前記Idle先頭レジスタの内容を書き込んで、前記アクセスユニットのキューカウンタをインクリメントすると共に、前記Idle先頭レジスタが示す前記リンクリストメモリのアドレスからデータを読み出して、前記データを前記Idle先頭レジスタに書き込んで、前記Idleカウンタをデクリメントし、
前記複数のアクセスユニットを、各ユニットがそれぞれ複数のグループに属するように複数のアクセスグループに分けて、各グループ毎にキューカウンタを使用し、
前記グループ毎のキューカウンタについては、キューの上限値のみを設定し、当該上限値については、前記アクセスユニット毎のキューカウンタの上限値と同様の判断処理を行い、前記アクセスユニット毎のキューカウンタと同様のカウント操作を行うことを特徴とするメモリ管理方法。 When the data requested to be written is written to the data memory and the data requested to be read is read from the data memory and output, the used area and free area of the data memory are managed using the link list memory In the memory management method to
A plurality of access units that perform writing and reading of data to and from the data memory are provided with restrictions on the areas where the data memory is used, respectively, so that the use area of the plurality of access units is always secured ,
A plurality of access units, a queue start register and a queue end register for storing a start address and an end address of an area in which the data memory is used;
A queue counter for counting the size in which each of the plurality of access units is using the area of the data memory, and
Idle start register and Idle end register in which the start address and end address of the empty area are stored, and
An Idle counter for counting the size of the free area;
By setting the upper limit value of the queue and the lower limit value corresponding to the minimum number of reserved queues for each of the plurality of queue counters, the counter value in each queue counter is less than the lower limit value than the value of the Idle counter. Use the virtual idle counter that stores the total of the differences between the two cases and stores the subtracted value.
When a write request by any of the plurality of access units occurs,
When the queue counter corresponding to the access unit is greater than or equal to the upper limit value, or when the queue counter is less than the upper limit value and greater than or equal to the lower limit value and the value of the virtual idle counter is “0”, Data is written to the address indicated by the queue head register, the address value of the queue head register is written to the address of the link list memory indicated by the queue tail register and the queue tail register, and data is obtained from the address of the link list memory indicated by the address value. And write the data to the queue head address,
When the queue counter corresponding to the access unit is less than the lower limit value, or when the queue counter is less than the upper limit value and greater than or equal to the lower limit value and the virtual idle counter is not “0”, the counter is decremented. , Write data to the address indicated by the Idle head register,
When the queue counter is not “0”, the address value of the Idle head register is written to the address of the link list memory indicated by the queue end register of the access unit, and when the queue counter is “0”, the Write the address value to the queue head register of the access unit,
Write the contents of the Idle head register to the queue end register of the access unit, increment the queue counter of the access unit, read data from the address of the link list memory indicated by the Idle head register, and To the Idle head register, decrement the Idle counter,
Dividing the plurality of access units into a plurality of access groups so that each unit belongs to a plurality of groups, and using a queue counter for each group,
For the queue counter for each group, only the upper limit value of the queue is set, and for the upper limit value, a determination process similar to the upper limit value of the queue counter for each access unit is performed. A memory management method comprising performing a similar counting operation .
前記アクセスユニットに対応するキューカウンタが「0」の場合は、前記データメモリからのデータ読み出しを禁止し、
前記アクセスユニットに対応するキューカウンタが「0」でない場合は、前記アクセスユニットのキュー先頭レジスタが示す前記データメモリのアドレスからデータを読み出し、
前記Idleカウンタの値が「0」でない場合は、前記Idle末尾レジスタが示す前記リンクリストメモリのアドレスと前記Idle末尾レジスタに、前記アクセスユニットのキュー先頭レジスタの内容を書込んで、前記Idleカウンタをインクリメントし、
前記カウンタの値が「0」の場合は、前記Idle先頭レジスタ及び前記Idle末尾レジスタに、前記アクセスユニットのキュー先頭レジスタの内容を書込んで、前記Idleカウンタをインクリメントし、
前記アクセスユニットのキュー先頭レジスタが示す前記リンクリストメモリのアドレスからデータを読出して、そのデータを前記キュー先頭レジスタに書き込んで前記アクセスユニットのキューカウンタをデクリメントし、
前記アクセスユニットのキューカウンタが下限値以上となった場合は、仮想Idleカウンタをインクリメントすることを特徴とする請求項5乃至7の何れかに記載のメモリ管理方法。 When a read request is generated by any of the plurality of access units ,
When the queue counter corresponding to the access unit is “0”, data reading from the data memory is prohibited,
When the queue counter corresponding to the access unit is not “0”, data is read from the address of the data memory indicated by the queue head register of the access unit;
When the value of the Idle counter is not “0”, the contents of the queue head register of the access unit are written in the address of the link list memory indicated by the Idle tail register and the Idle tail register, and the Idle counter is set. Increment and
When the value of the counter is “0”, the contents of the queue head register of the access unit are written into the Idle head register and the Idle tail register, and the Idle counter is incremented.
Read data from the address of the link list memory indicated by the queue head register of the access unit, write the data to the queue head register, decrement the queue counter of the access unit,
Wherein if the queue counter of the access unit is not less than the lower limit value, a memory management method according to any one of claims 5 to 7, characterized in that incrementing the virtual Idle counter.
Priority Applications (3)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| JP2007323307A JP4360439B2 (en) | 2007-03-27 | 2007-12-14 | Memory management device and memory management method |
| DE102008000649.1A DE102008000649B4 (en) | 2007-03-27 | 2008-03-13 | Memory management device and method for this |
| US12/076,021 US8176263B2 (en) | 2007-03-27 | 2008-03-13 | Memory management apparatus and method for same |
Applications Claiming Priority (2)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| JP2007081493 | 2007-03-27 | ||
| JP2007323307A JP4360439B2 (en) | 2007-03-27 | 2007-12-14 | Memory management device and memory management method |
Publications (2)
| Publication Number | Publication Date |
|---|---|
| JP2008269561A JP2008269561A (en) | 2008-11-06 |
| JP4360439B2 true JP4360439B2 (en) | 2009-11-11 |
Family
ID=40048923
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| JP2007323307A Expired - Fee Related JP4360439B2 (en) | 2007-03-27 | 2007-12-14 | Memory management device and memory management method |
Country Status (1)
| Country | Link |
|---|---|
| JP (1) | JP4360439B2 (en) |
Families Citing this family (2)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| JP5191059B2 (en) * | 2009-06-23 | 2013-04-24 | 日本電信電話株式会社 | Buffer circuit and buffer circuit control method |
| JP7180462B2 (en) * | 2019-03-11 | 2022-11-30 | 株式会社デンソー | Relay device and frame storage control method |
-
2007
- 2007-12-14 JP JP2007323307A patent/JP4360439B2/en not_active Expired - Fee Related
Also Published As
| Publication number | Publication date |
|---|---|
| JP2008269561A (en) | 2008-11-06 |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| EP1645967B1 (en) | Multi-channel DMA with shared FIFO buffer | |
| US7363389B2 (en) | Apparatus and method for enhanced channel adapter performance through implementation of a completion queue engine and address translation engine | |
| JP4977159B2 (en) | Technology for executing atomic compare and swap instructions using a specific processor | |
| US10846251B1 (en) | Scratchpad-based operating system for multi-core embedded systems | |
| US8151275B2 (en) | Accessing copy information of MMIO register by guest OS in both active and inactive state of a designated logical processor corresponding to the guest OS | |
| JP4457168B2 (en) | Resource request arbitration device, resource request arbitration method, and computer program | |
| US8677045B2 (en) | Transaction reordering system and method with protocol indifference | |
| JP2020113137A (en) | Storage device | |
| US20090144527A1 (en) | Stream processing apparatus, method for stream processing and data processing system | |
| CN110032335B (en) | Atomic data access request mediation | |
| EP2097828A2 (en) | Dmac to handle transfers of unknown lengths | |
| KR20220035242A (en) | A programmable network interface device comprising a host computing device and a network interface device. | |
| US20250103389A1 (en) | System and Method for Queuing Work within a Virtualized Scheduler Based on In-Unit Accounting of In-Unit Entries | |
| JP4360439B2 (en) | Memory management device and memory management method | |
| WO2006035727A1 (en) | Information processing device, memory area management method, and computer program | |
| CN112559405A (en) | Control method and device of multichannel DMA (direct memory access) with token bucket structure | |
| JP4789269B2 (en) | Vector processing apparatus and vector processing method | |
| US8176263B2 (en) | Memory management apparatus and method for same | |
| US10481951B2 (en) | Multi-queue device assignment for application groups | |
| CN109426562B (en) | priority weighted round robin scheduler | |
| CN101361050B (en) | Data transmission device and data transmission method | |
| JP2013041361A (en) | Resource arbitration system and resource arbitration method | |
| US20010007114A1 (en) | Control apparatus and control method | |
| US20040078499A1 (en) | Framework for high-performance hardware abstraction | |
| US12417791B2 (en) | Direct memory access (DMA) circuit and operation method thereof |
Legal Events
| Date | Code | Title | Description |
|---|---|---|---|
| A977 | Report on retrieval |
Free format text: JAPANESE INTERMEDIATE CODE: A971007 Effective date: 20090421 |
|
| A131 | Notification of reasons for refusal |
Free format text: JAPANESE INTERMEDIATE CODE: A131 Effective date: 20090512 |
|
| A521 | Request for written amendment filed |
Free format text: JAPANESE INTERMEDIATE CODE: A523 Effective date: 20090701 |
|
| TRDD | Decision of grant or rejection written | ||
| A01 | Written decision to grant a patent or to grant a registration (utility model) |
Free format text: JAPANESE INTERMEDIATE CODE: A01 Effective date: 20090721 |
|
| A01 | Written decision to grant a patent or to grant a registration (utility model) |
Free format text: JAPANESE INTERMEDIATE CODE: A01 |
|
| A61 | First payment of annual fees (during grant procedure) |
Free format text: JAPANESE INTERMEDIATE CODE: A61 Effective date: 20090803 |
|
| FPAY | Renewal fee payment (event date is renewal date of database) |
Free format text: PAYMENT UNTIL: 20120821 Year of fee payment: 3 |
|
| FPAY | Renewal fee payment (event date is renewal date of database) |
Free format text: PAYMENT UNTIL: 20130821 Year of fee payment: 4 |
|
| R250 | Receipt of annual fees |
Free format text: JAPANESE INTERMEDIATE CODE: R250 |
|
| R250 | Receipt of annual fees |
Free format text: JAPANESE INTERMEDIATE CODE: R250 |
|
| R250 | Receipt of annual fees |
Free format text: JAPANESE INTERMEDIATE CODE: R250 |
|
| R250 | Receipt of annual fees |
Free format text: JAPANESE INTERMEDIATE CODE: R250 |
|
| LAPS | Cancellation because of no payment of annual fees |