明 細 書
連想メモリ
技術分野
[0001] 本発明は、連想メモリ(内容検査メモリ: Content Addressable Memory:以下「CAM 」という。 )に関し、特に、高速検索が可能で、消費電力を抑え、且つ小さい実装面積 で実装可能な連想メモリに関する。
背景技術
[0002] 通常のメモリは、与えられたインデックス(アドレス)に対して、そのアドレスに格納さ れている登録データを生成する。一方、 CAMは、与えられた検索 (入力)データに対 して、それを格納する CAMのインデックス (アドレス)を生成する(非特許文献 1, 2参 照)。
[0003] CAMは、パターン 'マッチング、インターネットのルータ、プロセッサのキャッシュ、 T LB (Translation Lookaside Buffer)、データ圧縮、データベースのァクセラレータ、二 ユーラルネット、メモリパッチなど幅広 、分野にぉ 、て利用されて 、る。
[0004] 通常、 CAMは、その機能から、 2値 CAM (Binary CAM:以下「: BCAM」 t 、う。)及 び 3値 CAM (Ternary CAM :以下「TCAM」という。)の二種類に分類される。 BCA Mでは、各セルに 0及び 1を格納する。 TCAMでは各セルに 0, 1,及び *を格納す る。ここで、「*」はドント'ケア(don't care)を表し、 0と 1の両方にマッチする。
[0005] 〔定義 1〕 (BCAM)
n入力で登録データ数 pの BCAMテーブルは、 p個の異なる 2値ベクトルを格納す る。また、 p個のベクトルは、アドレス 1からアドレス pに順に格納されていると仮定する 。また、各ベクトルのアドレスは mビットで表現可能である。 mは次式(1)により表され る。
また、 p個のベクトルは、アドレス 1からアドレス pに順に格納されていると仮定する。 対応する BCAM関数 f:{0,l}n→{0,l}mは、以下の条件を満たす:
x)は入力 xと同じベクトルが BCAMテーブル中にあるとき、ベクトル Xを格納する C AMのアドレス(1力も pの値の何れ力)を出力する。入力 Xと同じパターンが BCAMテ 一ブル中に無 、場合には、 x)の値は 0である。
(定義終り)
[0007] (例 1)
(表 1)は、 7個の 2値ベクトルを格納する BCAMを示す。対応する BCAM関数を( 表 2)に示す。何れも、入力データに完全に一致したベクトルを格納するアドレスを 3 ビットの数 (例えば、 '011 ' )として出力する。入力ベクトルと一致するものが BCAM 中に格納されていない場合には、 0を出力する。
(例終わり)
[0008] [表 1]
.お 1: BCAM関数の例
[0009] [表 2]
[0010] 〔定義 2〕 (TCAM)
η入力で要素数 ρの TCAMテーブルは、 ρ個の 3値ベクトルを格納する。また、 ρ個 のベクトルは、アドレス 1からアドレス ρに順に格納されていると仮定する。また、各べク トルのアドレスは mビットで表現可能である。ここで、 mは上記式(1)により表される。 各 3値ベクトルは、 0, 1,又は * (ドント'ケア)から構成される。対応する TC AM関数 : f:{0,l}n→{0,l}mは、以下の条件を満たす:
入力 Xに対して、 Xと一致するベクトルが TCAMテーブル中にある場合、出力 x)は 、一致したベクトル中の最小のアドレスを示す。また、 Xと一致するベクトルが TC AM テーブル中に無い場合には、 0を出力する。
(定義終り)
[0011] (例 2)
(表 3)に示す TCAMは、 7個の 3値ベクトルを格納する。対応する TCAM関数を( 表 4)に示す。入力 χ=(1,0,1,1)は、アドレス 5及び 6に蓄えられているパターンと一致す る。 5の方が小さいので、出力は (0,1,0,1)となる。
(例終わり)
[0012] [表 3]
表 3: TCAM関数の例
[0013] [表 4]
表 4: TC AMテーブルの例
•^2 h f、 h
0 0 0 0 0 0 0
0 (} 0 1 1 1 1
0 0 1 0 0 0 1
0 0 1 1 0 丄 0
ϋ 1 0 0 0 ϋ 0
0 1 0 1 0 0 0
0 1 1 0 0 0 0
0 1 1 1 0 0 0
1 0 0 0 0 1 0
1 0 0 1 1 1 1
1 0 1 0 0 0 1
1 0 1 1 1 0 1
1 1 0 0 1 0 0
1 丄 0 1 0 丄 1
1 1 1 0 0 0 0
1 丄 1 1 丄 丄 0
[0014] CAMの機能をソフトウェアで実現することも可能である力 ソフトウェアで実現したも のは大幅に低速である。そのため、専用のハードウェア(半導体メモリ)を用いて CA Mを実現することが多い。以下、ハードウェアで構成された従来の CAMについて説 明する。
[0015] 図 8は、従来の CAMの基本構成の一例を表すブロック図である(特許文献 1参照) 。 CAM100は、比較レジスタ 101、検索ビット線ドライバ 102、 n個のワード W〜W、 n個の一致センス回路 MSC〜MSC、 n個の一致フラグレジスタ MFR〜MFR、 及びプライオリティ ·ェンコーダ (優先度付符号化回路) PEを備えて 、る。
[0016] 比較レジスタ 101は、 mビットの検索データを格納するレジスタである。検索ビット線 ドライバ 102は、比較レジスタ 101の各ビットを検索ビット線上にドライブする。各ヮー ド W〜Wは、それぞれ mビットの CAMセルを備えている。
[0017] 図 9は、図 8の CAMセルの構成回路図である。図 9に例示した CAMセル 103は、 不一致検出型のものである。 CAMセル 103は、メモリ'セル 104及び一致比較回路 105から構成される。メモリ'セル 104は、 1ビットのデータを記憶する SRAM構成のメ モリ'セルである。図 9において Dがデータ、 DNが反転データを表す。一致比較回路 105は、メモリ'セル 104に記憶された 1ビットのデータと検索ビット線対 SL, SLN上 にドライブされる検索データとを比較し、その一致比較結果を一致線 ML上に出力す る。
[0018] 一致比較回路 105は、 3つの nMOSトランジスタ(以下「nMOS」 t 、う。) 106, 10 7, 108を備えている。 nMOS 106, 107は、検索ビット線 SLNと検索ビット線 SLとの 間に直列に接続されている。 nMOS106, 107のゲートは、それぞれ、メモリ'セル 10 4のデータ D,反転データ DNに接続されている。 nMOS108は、一致線 MLとグラン ドとの間に接続されている。 nMOS108のゲートは、 nMOS106, 107の間のノード 1 09に接続されている。
[0019] まず、検索を行う前に、 CAM100のそれぞれのワード W〜Wに、検索対象である データが記憶される。各ワード内の各 CAMセル 103において、メモリ'セル 104への データの書き込み及びメモリ.セル 104からのデータの読み出しは、通常の SRAMと 同様にして行われる。
[0020] 検索時には、まず、比較レジスタ 101に検索データが格納される。検索データの各 のビットは、検索ビット線ドライバ 102により、各々対応する検索ビット線上にドライブさ れる。
[0021] 各々のワード W〜Wでは、各 CAMセルに予め記憶されているデータと検索ビット
線上にドライブされた検索データとの一致検索が同時 (並列)に実行され、その結果 がー致線 ML〜ML上に出力される。これらの検索結果は、それぞれ一致センス回 路 MSC〜MSCに入力される。各一致センス回路 MSC〜MSCは、各検索結果 を増幅し、一致センス出力として一致センス出力線 MT〜MTに出力する。各一致 センス出力は、一致フラグレジスタ MFR〜MFRに格納され、一致フラグ出力として 一致フラグ出力出力線 MF〜MFに出力される。一致フラグは、 ' 1 'が「一致あり」、 '0,が「一致なし」を表すものとする。
[0022] 各一致フラグ出力は、プライオリティ 'エンコーダ PEに入力される。プライオリティ' エンコーダ PEでは、所定の優先順位付けに従って、一致が検出されたワードの中か ら最優先順位のワードのアドレス (最優先一致アドレス: HMA)を選択し出力する。各 ワードの優先順位は、ワード Wが最も高ぐ Wに向力うに従って順次優先順位が低 くなるちのとする。
[0023] 尚、各ワード W〜W内の各 CAMセル 103における一致検索は、次のようにして 実行される。
[0024] まず、初期化動作を実行する。初期化動作では、検索ビット線対 SL, SLNがともに
'L' (= '〇')とされる。一方、メモリ'セル 104に記憶されているデータに応じて、一致 比較回路 105の nMOS106, 107のうち一方がオン状態、他方がオフ状態となる。 従って、 nMOS106, 107のうちオン状態の方を介して、両者の間のノード 109のレ ベルが' L,となり、 nMOS108はオフ状態となる。この状態で、一致線 ML力 'H, (= ' 1 ' )状態にプリチャージされる。尚、一致線 MLは 'H'が「一致」を表す。
[0025] 次に、検索ビット線を介して比較レジスタ 101に記憶された検索データの各ビットが 各 CAMセル 103に入力される。これにより、検索データ Sに応じて、検索ビット線対 S L, SLNの何れか一方が 'H'、他方が 'L'となる。
[0026] メモリ'セル 104に記憶されているデータ Dと検索データ Sとが一致する場合、ノード 109のレベルは' L,であり、 nMOS108はオフ状態に保持される。
[0027] 一方、データ Dと検索データ Sとが一致しない場合、ノード 109のレベルは 'Η'とな り、 nMOS108はオン状態になる。これにより、一致線 MLはデイスチャージされて' L '状態となる。
[0028] mビットの CAMセル 103からなる CAMワードの一致線 MLは、各 CAMセル 103 の nMOS 108がパラレルに接続されたワイヤード OR回路を構成している。従って、 1 ワードを構成する mビットの CAMセル 103のすべてにおいて一致が検出された場合 に限り、一致線 MLは 'Η' (「一致」)の状態に保持される。一方、 1ビットでも CAMセ ル 103で不一致が検出されると、一致線 MLは' L' (「不一致」)の状態となる。
[0029] 例えば、検索の結果、一致フラグレジスタ MFR〜MFRに、一致フラグとして' 0, , Ί ' , ' 1 ' , '0,, · ··, ' 1 ' , '0,が格納されたとする。この場合、ワード W , W , · ··,
2 3
W で一致が検出されている。従って、プライオリティ 'エンコーダ PEは、最も優先 順位が高いワード Wのアドレスを HMAとして出力する。また、一致フラグレジスタ M
2
FRに格納された一致フラグを' 0'にクリアすることで、その次に優先順位が高いヮー
2
Wのアドレスを HMAとして出力することができる。以下同様にして、一致が検出さ
3
れたワードのアドレスを順次出力することができる。
[0030] 尚、 TC AMとして使用する場合、ドント'ケアのビットについては、検索ビット線対 S L, SLNをともに 'L,(= '〇')としておけばよい。
[0031] 図 10は、図 8の CAMセルの別の例の構成回路図である。図 10に示す CAMセル 103,は一致検出型のものであり、図 9と同様、 SRAM構成のメモリ'セル 104及び一 致比較回路 105を備えている。 CAMセル 103,は、図 9の CAMセル 103において、 一致比較回路 105の nMOS108の接続が異なる。図 Dの nMOS108は、一致線 M Lと一致線 MLとの間に接続されている。 nMOS108のゲートは、 nMOS106, 10 a b
7の間のノード 109に接続されている。
[0032] CAMセル 103'では、検索時には、初期化動作として、ビット線対 SL, SLNが共 に 'H'とされる。一方、メモリ'セル 104に記憶されているデータに応じて、一致比較 回路 105の nMOS106, 107のうち一方がオン状態、他方がオフ状態となる。従って 、 nMOS106, 107のうちオン状態の方を介して、両者の間のノード 109のレベルが 'Η'となり、 nMOS108はオン状態となる。この状態で、一致線 MLの一端力 'H, (= ' 1 ' )状態にプリチャージされる。尚、一致線 MLは 'H'が「不一致」を表す。
[0033] mビットの CAMセル 103,からなる CAMワードの一致線 MLは、各 CAMセル 103 ,の nMOS 108がシリアルに接続された AND回路を構成する。従って、各々の CA
Mセルの一致線 ML , MLは、各々の CAMセル 103,の nMOS108を介して 'Η'
a b
にプリチャージされる。
[0034] その後、検索ビット線を介して比較レジスタ 101に記憶された検索データの各ビット が各 CAMセル 103 'に入力される。これにより、検索データ Sに応じて、検索ビット線 対 SL, SLNの何れか一方が 'H'、他方が 'L'となる。
[0035] メモリ'セル 104に記憶されているデータ Dと検索データ Sとが一致する場合、ノード
109のレベルは 'H,であり、 nMOS108はオン状態に保持される。
[0036] 一方、データ Dと検索データ Sとが一致しない場合、ノード 109のレベルは 'L,とな り、 nMOS108はオフ状態になる。
[0037] CAMワードの mビットの CAMセル 103,のすベての状態が確定した後、一致線 M
Lの一方の端部からデイスチャージを開始し、他方の端部で一致比較結果を判定す る。このとき、 1ビットでも不一致の CAMセル 103 'がある場合には、一致比較結果は
'H,、すなわち、不一致の状態に保持される。一方、すべての CAMセル 103,で一 致が検出された場合のみ、一致比較結果は' L'、すなわち一致状態となる。
[0038] 尚、 TC AMとして使用する場合、ドント'ケアのビットについては、検索ビット線対 S
L, SLNをともに 'H' ( = ' 1 ' )としておけばよい。
特許文献 1:特開 2004— 295967号公報
特許文献 2:特願 2003 - 389264号明細書
特許文献 3:特開 2004— 258799号公報
特許文献 4:特開 2004-258799号公報
非特許文献 1 :菅野卓雄監修,香山晋編, 「超高速デバイス,シリーズ 2 超高速 MO Sデバイス」,初版,倍風館, 1986年 2月, pp. 324- 325.
非特許文献 2 :電子情報通信学会編, 「LSIハンドブック」,第 1版,オーム社, 1994 年 11月, pp. 523 - 525.
非特干文献 3: Kostas Pagiamtzis ana Ali Sheikholeslami, A Low-Power Content- A ddressable Memory (CAM) Using Pipelined Hierarchical Search Scheme", IEEE Jour nal of Solid-State Circuits, Vol.39, No.9, Sept.2004, pp.1512- 1519.
特許文献 4 : T.Sasao, M.Matsuura, and Y.Iguchi, "A cascade realization of multi-o
utput lunction for reconfigurable hardware", International Workshop on Logic and S ynthesis (IWLS01), Lake Tahoe, CA, June 12—15, 2001, pp.225— 230.
特許文献 5 : T.Sasao and M.Matsuura, "BDD representation for incompletely sped fied multiple-output logic functions and its applications to lunctional decomposition,
Design Autonmation Conference, June 2005, (pp.373- 378).
非特許文献 6 :井口、笹尾、 "LUTカスケード 'アーキテクチャについて、 "平成 15年 電気学会電子 '情報'システム部門大会、 MC2-4, 2003年 8月 29日〜 30日、秋田大 学。
発明の開示
発明が解決しょうとする課題
[0039] 上記従来の CAMは、 RAMに比べると、並列に検索可能であるため高速であるが
、デバイスの構成は複雑となる。そのため、 CAMの 1ビットあたりの価格(ビットコスト) は、 RAMに比べると 10〜30倍程度、高価なものになる。
[0040] また、 1ビットあたりの消費電力が RAMに比べて遙かに大きい(非特許文献 3参照)
。これは、上で説明したように、すべての CAMセルを同時にアクセスするためである
。そのため、 1ビットあたりの消費電力は、通常の RAMの約 50倍程度にもなる。
[0041] そこで、本発明の目的は、検索の高速性を維持しつつも、消費電力を抑え且つデ バイスの構造を簡単ィ匕して小さい実装面積で実装可能な連想メモリを提供することに ある。
課題を解決するための手段
[0042] 以下、本明細書において使用する用語の定義及び本発明の前提となる理論を説 明し、その後本発明の構成及び作用について説明する。
[0043] 〔 1〕 CAM関数の性質
〔定義 3〕(分解表、基本分解表、列複雑度)
関数 X): Bn→Bq、及び Χ=(χ ,χ ,· · ·,χ )が与えられているものとする。ここで、 Β={0,1}
1 2 η
である。(X , X )を Xの分割とする。 fの「分解表」とは、二次元のマトリックスであって、
L H
列のラベルは、 Xに Bの構成要素をすベての可能な組み合わせに対して割り当てた し
ものであり、また行のラベルは、 Xに Bの構成要素をすベての可能な組み合わせに
対して割り当てたものである。また、対応するマトリックスの値は χ ,χ )の値に等しい
L Η 関数 fの分解表のうちで、 X =(χ , X , ···, X
L 1 2 nL )且つ X =(χ , X , ···, X
H nL+1 nL+2 n )となる分解 表を「基本分解表」という。
分解表の異なる列パターンの個数を分解表の「列複雑度」 、う。
尚、分解表の特別な場合として、 X =X
し の場合も考える。
(定義終り)
[0044] 〔定義 4〕(C尺度)
変数の順序を (X ,χ ,···,χ
1 2 n )としたとき、論理関数 fの基本分解表の列複雑度の最大値 を、 fの「C尺度」という。
(定義終り)
[0045] (例 3)
f=xx Vxx Vxxの C尺度は 3である力 f=xx Vxx Vxxの C尺度は 8である。
1 1 2 3 4 5 6 2 1 5 2 6 3 4
(例終わり)
[0046] 分解表の列複雑度は、 MTBDD (多端子二分決定グラフ)の幅に等 、。従って、 論理関数の C尺度は、与えられた入力変数の順における MTBDDの幅の最大値に 等しい。与えられた論理関数 χ ,χ ,···,χ)に対して、 C尺度は容易に計算でき、一意
1 2 n
的に定まる。後述するように、 C尺度が小さい関数は、 LUTカスケード (LUT (Lookup -table) cascade)で効率的に実現可能である。従って、 C尺度は、論理関数を LUT力 スケードで実現する際の複雑さの尺度となる。
[0047] 〔補題 1〕
与えられた関数 fに対して、非零出力を生ずる入力の組み合わせの個数を pとする。 このとき、 fの C尺度は高々 p+1である。
(補題終り)
[0048] 〔定理 1〕(BCAM関数の C尺度)
要素数 Pの BCAMテーブルが与えられたとき、その BCAM関数の C尺度は高々 p+ 1である。
(定理終り)
[0049] 〔定理 2〕(TCAM関数の C尺度)
TC AMテーブル力 ¾個のベクトルを格納し、各ベクトルが高々 k個のドント'ケアを有 するとき、対応する TCAM関数の C尺度は高々 2kp+lである。
(定理終り)
[0050] 〔2〕LUTカスケード
CAM関数は通常の RAMでも実現可能である。例えば、上記(表 1)に示した要素 7の BCAM関数は、(表 2)に示したように、 16ワードの RAMにより実現することがで きる。ここで、各ワードは 3ビットである。 n入力の CAM関数を単一の RAMで実現す る場合、 RAMの大きさは、 BCAMがわずか数個のベクトルしか含まない場合であつ ても、 2nに比例して大きくなる。そこで、 LUTカスケードを用いることにより、必要なメ モリ量を大幅に削減することが可能となる(特許文献 3参照)。
[0051] 〔定理 3〕
与えられた関数 fに対して、 X
Lを分解表の列に対応する変数、 X
Hを行に対応する変 数とし、 を分解表の列複雑度とする。このとき、関数 fは図 1に示すような回路で実 現することが可能である。この場合、二つのブロック Hと Gの間を結ぶ信号線数 (以下 「レイル数」という。)は
である。
(定理終り)
[0053] 二つのブロック間を結ぶ信号線数が X中の変数の個数よりも少ないとき、関数を実 し
現するためのメモリ量を削減できる可能性がある。この手法を「関数分解」という。与え られた関数を繰り返し関数分解することにより、図 2に示すような LUTカスケードが得 られる(非特許文献 4参照)。 LUTカスケードは「セル」から構成され、隣接するセル 間を接続する信号線を「レイル」という。 C尺度が小さな関数は小型の LUTカスケード で実現可能である。 C尺度を求めるには、必ずしも分解表を使用する必要はなぐ多 出力関数の特性関数を表現する二分決定グラフ(Binary Decision Diagram for Chara cteristic Function:以下「BDD_for_CF」という。)から効率的に計算することができる(
特許文献 2,非特許文献 5参照)。
[0054] 〔定理 4〕
C尺度が; zの論理関数は、入力数が高々
[0055] [数 3]
「 g2 ] + l (3) 出力数が
[0056] 画
「log2 μ \ (4) のセル力も構成された LUTカスケードで実現可能である。
(定理終り)
[0057] 〔定理 5〕
関数 実現する LUTカスケードを考える。いま、 nを外部入力変数、 sをセル数、 rを 最大レイル数 (即ち、セル間の信号線数)、 kをセルの最大入力数、 μを関数 fの C尺 度とする。
[0058] [数 5] k > r, τ =「 g2 μ,Ι C-r)) が成立するとき、以下の関係を満たす 実現する LUTカスケードが存在する
(定理終り)
[0060] 〔3〕ドント'ケアを用いた設計法
〔3— 1〕BCAM関数の設計法
BCAM関数では、真理値表において、非零出力の値力 全体の組み合わせの数 2 nに比べて大幅に少ない。つまり、次の(仮定 1)が成立するものとする。
[0061] (仮定 1) BCAMテーブルの入力ビット数を n、ベクトル数を pとするとき、 p《2n。
[0062] 例えば、 n=32で p=1000の BCAMを考えるとき、非零出力の割合は全最小項の個
数の 1000/232=2.3 X 10— 7となる。
[0063] BCAM関数を BDDで表現すると、 BDDの最大幅力 C尺度を超えな!/、こと、及び 〔定理 1〕から、レイル幅は p+1を超えないことがわかる。し力し、全体の幅は p+1近くな る。従って、 BCAM関数を LUTカスケードで実現する場合、入力数が
[0064] [数 7]
0¾(p + l)] + l (7) のセルが多数必要となる。そこで、ここではドント'ケアの概念を用いて、 BCAM関数 を実現するハードウェア量を削減する方法について、図 3を参照しながら説明する。
[0065] 〔ァノレゴリズム 1〕
(l)f^BCAM関数とする。また、 fにおいて CAMに登録されていないデータに対 する出力値をドント ·ケアとした関数を gとする。
[0066] (2) gの特性関数を表現する二分決定グラフ(BDD_for_CF)を生成し、簡単ィ匕を行う
[0067] (3)簡単化した BDDから、 LUTカスケード 1を生成する。一般に、 LUTカスケード 1 は、 ¾実現する LUTカスケード (これを「厳密な LUTカスケード」と呼ぶ。)よりも簡単 になる。
[0068] (4)検索データが登録データと一致するときは、 LUTカスケード 1は正し 、値を出 力する。検索データが登録データと一致しないときは、 LUTカスケード 1は、誤った 値を出力する可能性がある。
[0069] (5)誤りを補正するために、 m入力 n出力の補助メモリ 2を用いる。ここで、 mは次式 で表される。
[0070] [数 8]
m = log2(p + l)l (8) この補助メモリ 2には、各アドレスに BCAMテーブルの対応するデータが格納されて いる。
[0071] (6) LUTカスケード 1の出力のインデックスを補助メモリ 2に供給し、補助メモリ 2内 の登録データを読み出す。そして、一致回路 3により、入力データと補助メモリ 2の出
力データとを比較する。両者が一致すれば、 LUTカスケード 1の出力値は正しいこと が保証される。従ってエンコーダ 4は LUTカスケード 1の出力のインデックスをそのま ま出力する。一方、補助メモリ 2の出力データと入力データとがー致しないときは、 C AM内にそのデータは登録されていない。従って、そのときには、エンコーダ 4は無効 のインデックス (0)を出力する。
(アルゴリズム終り)
[0072] 補助メモリ 2の全ビット数は、 n2mであり、ハードウェアのコストは、 LUTカスケード 1の コストに比べ無視できる程度である。
[0073] 〔3— 2〕TCAM関数の設計法
TCAM関数の場合、 TC AMテーブルは 3値となるので、補助メモリ 2は、 m入力 2n 出力となる。また、一致回路 3で、ドント'ケアに対応するビットは無視する。他の部分 は BCAMと同じである。
[0074] 〔4〕本発明の構成
本発明に係る連想メモリの構成は、入力データに対しそのデータに対応する固有 のインデックスを出力する連想記憶メモリであって、
入力データに対しそのデータに対応する固有のインデックスを出力する関数 (以下 「CAM (Content Addressable Memory)関数」という。)fの無効出力値をドント'ケアで 置き換えた関数(以下「簡略化 CAM関数(reduced Content Addressable Memory lu nction)」という。)gを表す LUT結合論理回路又は PLA (Programmable Logic Array) により構成された簡略ィ匕関数演算部と、
前記 CAM関数 fの逆関数 f_1が記憶された補助メモリと、
前記 LUT演算手段の出力値が CAM関数 fの出力に一致するカゝ否かを判定する一 致判定手段と、
を備え、
前記 LUT演算手段は、前記入力データに対して前記簡略化 CAM関数 gの演算値 (以下「仮インデックス値」という。 )を前記補助メモリの読み出しアドレスとして出力し、 前記補助メモリは、前記仮インデックス値が読み出しアドレスとして入力されると、そ の仮インデックス値に対しする逆関数 f_ 1の値を出力し、
前記判定手段は、前記入力データと前記補助メモリが出力する逆関数 f_1の値とを 比較して、両者が一致する場合は前記 LUT演算手段の出力値を出力し、それ以外 の場合は無効信号を出力することを特徴とする。
[0075] この構成によれば、 LUT結合論理回路は、通常の RAMを複数個用いて構成する ことができる。また、補助メモリも通常の RAMで構成できる。また、 CAM関数 fそのも のを表す LUT結合論理回路ではなぐ CAM関数 fの無効出力値をドント'ケアで置き 換えた簡略ィ匕関数 gを表す LUT結合論理回路又は PLAを用いることによって、当該 LUT結合論理回路又は PLAを構成するために必要なメモリ量を大幅に削減するこ とができる。従って、全体として、従来の CAMに比べ、デバイスの構造を簡単ィ匕して 小さい実装面積により実装が可能となる。
[0076] また、通常の RAMで構成することによって、専用の CAM回路を必要としない。故 に、 ASICで構成する以外に、汎用の RAMを内蔵した FPG A (Field Programmable Gate Array)や CLD (Complex Programmable Logic Device)のようなプログラマブノレ' デバイスを用いて簡単に低コストで構成することもできる。
[0077] また、判定手段以外はすべて通常の RAMで構成できる。そして、 1回の検索動作 に対して、数回(LUT結合論理回路での RAMのアクセス回数 + 1)の RAMのァクセ スで仮インデックス値が得られる。各 RAMのアクセスでは、 RAM内の 1つのアドレス のみがアクセスされる。全体として、数回の RAMのメモリ'アクセスのみで仮インデッ タス値が得られる。従って、従来の CAMに比べると、消費電力を大幅に低減すること が可能となる。
[0078] 一方、高速性の面では、従来の CAMに比べると遅くなるものの、通常の RAMを C PUを用いて検索する方法に比べると遙かに高速に検索を行うことができる。
[0079] ここで、「LUT結合論理回路」とは、複数の LUT (Look- Up Table)をカスケード状 又はネットワーク状に結合した回路をいうが、必ずしもハードウエア的に複数の LUT を配置'結合する必要はない。例えば、 1つのメモリ内に複数の LUTを記憶させ、 LU Tの選択を順次切り替えながら、メモリの出力値をメモリの読み出しアドレスにフィード ノックすることによって LUT結合を実現するような回路であってもよ 、。 LUT結合論 理回路としては、 LUTカスケード論理回路の他に、 LUTをネットワーク状に結合した
LUTネットワークなどを使用することも可能である。
[0080] 尚、本発明は BCAM及び TCAMの双方に適用することが可能である。
発明の効果
[0081] 以上のように、本発明によれば、検索の高速性を維持しつつ、消費電力を抑え且 つデバイスの構造を簡単ィ匕して小さい実装面積で実装可能な連想メモリを提供する ことができる。
図面の簡単な説明
[0082] [図 1]論理関数の関数分解を表す図である。
[図 2]中間出力を有する LUTカスケードを表す図である。
[図 3]ドント'ケアを用いた CAM関数の実現法を説明する図である。
[図 4]本発明の実施例 1に係る連想メモリの全体構成を表す図である。
[図 5]図 4の簡略ィ匕関数演算部 5の構成を表す図である。
[図 6]図 4の一致判定手段 7の構成を表す図である。
[図 7]実施例 2に係る連想メモリの一致判定手段 7の構成を表す図である。
[図 8]従来の CAMの基本構成の一例を表すブロック図である。
[図 9]図 8の CAMセルの構成回路図である。
[図 10]図 8の CAMセルの別の例の構成回路図である。
符号の説明
[0083] 1 LUTカスケード
2 補助メモリ
3 一致回路
4 エンコーダ
5 簡略化関数演算部
6 補助メモリ
7 一致判定手段
10 連想メモリ
11 入力変数レジスタ
12— 1〜12— s 論理関数メモリ
13 出力変数レジスタ
21 EXNORゲート
22 ANDゲート
23 ANDゲート
31 pq素子
発明を実施するための最良の形態
[0084] 以下、本発明を実施するための最良の形態について、図面を参照しながら説明す る。
実施例 1
[0085] 図 4は、本発明の実施例 1に係る連想メモリの全体構成を表す図である。本実施例 の連想メモリ 10は、簡略化関数演算部 5、補助メモリ 6、及び一致判定手段 7を備え ている。
[0086] 連想メモリ 10は、外部回路力も入力される nビットの入力データ Χ=(χ , · · · ,χ )に対し
1 η その入力データ Xに対応する mビットの固有のインデックス A=(a , - - - ,a )を出力する。
1 m
入力データ Xは、簡略化関数演算部 5及び一致判定手段 7に入力される。
[0087] 以下では、入力データ Xに対しその入力データ Xに対応する固有のインデックス Aを 出力する CAM関数を、 Fと記す。また、 CAM関数 Fの出力のうち、無効なインデック ス値をドント ·ケアで置き換えた簡略ィ匕 CAM関数を、 Gと記す。
[0088] 簡略化関数演算部 5は、簡略化 CAM関数 Gを演算する LUT結合論理回路により 構成されている。簡略化関数演算部 5は、入力データ Xに対し仮インデックス A'=G(X) を演算する。この仮インデックス A'は、補助メモリ 6及び一致判定手段 7に出力される
[0089] 補助メモリ 6は、 CAM関数 Fの逆関数 F— すなわち、固有のインデックス Aに対しそ のインデックス Aに対応するデータ Xを出力するデータ出力関数が、 LUTとして記憶 されている。補助メモリ 6には、簡略ィ匕関数演算部 5が出力する仮インデックス A'が入 力され、それに対する逆算データ X'=F— ')が出力される。仮インデックス A'は、一致 判定手段 7に出力される。
[0090] 一致判定手段 7は、入力データ Xと逆算データ X'とを比較し、両者が一致するか否
かを判定する。そして、両者が一致する場合には仮インデックス A'を出力インデックス
Aとして出力し、一致しない場合には無効値を出力する。
[0091] 図 5は、図 4の簡略ィ匕関数演算部 5の構成を表す図である。本実施例 1においては
、簡略ィ匕関数演算部 5として、 LUTカスケード論理回路を用いる。
[0092] 簡略化関数演算部 5は、入力変数レジスタ 11、論理関数メモリ 12— 1〜12— s、及 び出力変数レジスタ 13を備えている。
[0093] 入力変数レジスタ 11は、外部から入力される入力データ Xを一時的に保持するレジ スタである。論理関数メモリ 12— 1〜12— sは、簡略ィ匕 CAM関数 Gを関数分解して 得られる CAM関数 Gの部分関数 G ,---,G力LUTとして格納されている。ここで、 Xの
1 s
分割を Χ=(Χ ,Χ ,···,Χ)とした場合、各部分関数 G ,-,Gは次のようになる。
1 2 s I s
[0094] [数 9]
(A ,RL) = G^
( '2!¾) G2( 2 ¾)
, ; (9)
(As-l! ¾-l ) = «^ΐ-Ι ( — 1' 2)
Α' {Α'Ϊ:Α'2,... ,A'S)
[0095] ここでは、ベクトル A ',Α ',···,Α 'は、 LUTカスケードの中間出力であり、ベクトル A
1 2 s-1 s
'は LUTカスケードの最終出力である。仮インデックス A'は、これらのベクトルの合成 として表される。また、ベクトル R ,R,---,R は、 LUTカスケードの中間変数を表す。
1 2 s-1
[0096] 出力変数レジスタ 13は、各論理関数メモリ 12— l〜12— sが出力する中間出力 A '
1
,Α ',···,Α '及び最終出力 Α 'を保持し、仮インデックス A'として出力するレジスタであ
2 s-1 s
る。
[0097] 尚、 LUTカスケード論理回路の詳 、動作にっ 、ては、特許文献 4及び非特許文 献 6に記載されているため、ここでは説明を省略する。
[0098] 図 6は、図 4の一致判定手段 7の構成を表す図である。図 6では、一例として、入力 データ Xが 8ビット、出力インデックス Aが 8ビットの場合を示している力 入力データ X 及び出力インデックス Aのビット数はこれに限られるものではない。
[0099] 一致判定手段 7は、入力データ Xの各ビットに対応して設けられた EXNORゲート 2
1、 1個の ANDゲート 22、及び出力インデックス Aの各ビットに対応して設けられた A
NDゲート 23により構成される。
[0100] 入力データ X及び逆算データ X'の各ビット X , χ ' (ί=1,2,· ··,8)は、それぞれ対応する
EXNORゲート 21に入力され、 EXNOR演算が行われる。各 EXNORゲート 21の演 算結果は、 ANDゲート 22に入力され、 AND演算が行われる。この ANDゲート 22の 出力 Qを、一致判定信号と呼ぶ。
[0101] 一方、仮インデックス A'の各ビット a ',a ',· ··,& 'は、それぞれ各 ANDゲート 23の一
1 2 8
方の入力ノードに入力される。また、各 ANDゲート 23の他方の入力ゲートには、一 致判定信号 Qが入力される。
[0102] 以上のように構成された本実施例に係る連想メモリ 10について、以下その動作を 説明する。
[0103] まず、外部回路力 入力データ Xが入力されると、簡略化関数演算部 5は、 CAM 関数 G(X)の演算を行い、その結果を仮インデックス A'として出力する。ここで、入力 データ Xに対する真のインデックスが存在する場合、仮インデックス A'の値は真のイン デッタスの値に一致する。一方、真のインデックスが存在しない場合には、仮インデッ タス A'の値はドント'ケアとなる。従って、仮インデックス A'は真のインデックスを含むも のの、その値が真のインデックスを表すのかドント'ケアを表すのかの判別はできない
[0104] 次に、仮インデックス A'は補助メモリ 6に入力される。補助メモリ 6は、仮インデックス A'に対してデータ出力関数 F— ')の LUT演算を行い、その結果を逆算データ X'= F 1 (Α')として出力する。このとき、仮インデックス A'は真のインデックスを表す場合には 、逆算データ X'は入力データ Xと同じ値となる。しかし、仮インデックス A'がドント'ケア の場合には、仮インデックス A'はデタラメな値なので、逆算データ X'には無効値が出 力される。
[0105] 次に、一致判定手段 7の i番目の EXNORゲート 21 (ί=1,2,· ··,8)には、それぞれ入 力データ Xの i番目の成分 Xと逆算データ X'の i番目の成分 X 'とが入力される。 EXNO Rゲート 21は、論理演算
[0106] [数 10]
φ = Φ (10) を行い、演算値 q;を出力する。演算値 q;の値は、成分 X;と成分 Xとが一致する場合は 1 、一致しない場合は 0となる。
[0107] 各演算値 q.は、 ANDゲート 22に入力され、 AND演算が行われる。これにより、入 力データ Xと逆算データ X'の各成分が完全に一致する場合には一致判定信号 Qは 1 となり、それ以外の場合には一致判定信号 Qは 0となる。従って、この一致判定信号 Qを用いることによって、仮インデックス A'が真のインデックス値を表しているか否かの 判別ができる。
[0108] i番目の ANDゲート 23 (ί=1,2,· ··,8)には、それぞれ仮インデックス A'の i番目の成分 Xと一致判定信号 Qが入力される。そして、各 ANDゲート 23はこれらの AND演算を 行い、その結果を出力インデックス Aの i番目の成分 aとして出力する。これにより、仮 インデックス A'が真のインデックス値を表して 、る場合には、出力インデックス Aとして 真のインデックス値が出力され、それ以外の場合は出力インデックス Aとして 0が出力 される。
[0109] 以上のようにして、入力データ Xに対する CAM関数の演算が行われる。上述のよう に、本実施の形態では、簡略ィ匕関数演算部 5及び補助メモリ 6はすべてメモリで構成 されているため、通常の RAMを用いて構成することが可能である。従って、プロセスの 微細化が容易であり回路規模を小さくすることができる。また、メモリであるため、使用 しない期間を省電力状態として消費電力の節減を図ることも可能である。
実施例 2
[0110] 本実施例 2に係る連想メモリの全体構成及び一致判定手段 7の構成は、図 4,図 6 と同様であり、説明は省略する。実施例 2に係る連想メモリは、簡略化関数演算部 5 の構成が実施例 1とは異なる。
[0111] 図 7は、実施例 2に係る連想メモリの簡略ィ匕関数演算部 5の構成を表す図である。
本実施例の簡略ィ匕関数演算部 5は、複数の pq素子 31を榭形状に結合した構成から なる。 pq素子 31は、 p入力 q出力のメモリである。各 pq素子 31の p, qの値はそれぞれ の pq素子 31ごとに任意に設定される。各 pq素子 31には、簡略ィ匕 CAM関数 Gを関
数分解して得られる部分関数 G ,G,…が LUTとして格納されている。このように複数
1 2
の pq素子 31を榭形状に結合した回路をここでは「pq回路網」と呼ぶ。
[0112] 尚、図 7の構成は一例であり、 pq素子 31の結合の仕方は、 CAM関数 Gにより適宜 選択される。
[0113] このように、簡略ィ匕関数演算部 5として pq回路網を使用しても、実施例 1と同様の連 想メモリを構成することができる。