Modular SRAMbased Binary ContentAddressable Memories Ameer M S
Modular SRAM-based Binary Content-Addressable Memories Ameer M. S. Abdelhadi and Guy G. F. Lemieux Department of Electrical and Computer Engineering University of British Columbia a place of mind THE UNIVERSITY OF BRITISH COLUMBIA Vancouver, Canada
Binary Content-Addressable Memory (BCAM) Hardware-based Single-Cycle Parallel Search Engines Write Match Stores new data at specific address Store ‘C’ in ‘ 1’ 0 B 1 C 2 D 3 A BCAM Search all addresses for a given data (pattern) Searc h for ‘D’ 0 B 1 C 2 D 3 A BCAM Found in ‘ 2’ 1/17
BCAM Applications Memory management Databases Pattern matching Data compression Data encryption e. g. DNA sequence lookup find and shorten redundant patterns find and encrypt specific patterns IP lookup in routing/ forwarding tables Associative caches Translation lookaside buffers (TLBs) Networking Eliminates memory bottleneck Intrusion detection • detect predefined suspicious packages Packet Classification 2/17
Motivation - FPGAs 1000’s Memory Blocks 100, 000’s Logic Elements No dedicated BCAM resources in FPGAs 3/17
Objectives BCAMs FPGAs Massively parallel memory search Block RAMs are main storage Require high memory bandwidth Limited memory bandwidth Use BRAMs to construct • • Modular and flexible Storage efficient Single-cycle Performance oriented BCAMs 4/17
Algorithmic Heuristics Associative Arrays Search Trees: Tries, BSTs, … Hashes Data dependent performance Variable search depth Misses due to conflicts Multi-unpredictable-cycle 5/17
Register-Based BCAM Concurrent register read and compare Single-cycle Limited resources Complex routing Fits small BCAMs 6/17
Brute-Force Transposed-Indicators-RAM (1) A Traditional BRAM-based BCAM Key idea: Transposed RAM - data becomes addresses Write Match Write ‘ 0’ to location ‘B’ ‘ 0’ to ‘B’ A B C D 3 0 1 2 Read location ‘D’ for match ‘D’ A B C D 3 0 1 2 ‘ 2’ * Xilinx App Notes 7/17
Brute-Force Transposed-Indicators-RAM (2) Storing Data to Multiple Addresses • How can we store data to multiple addresses? • Specify addresses using one-hot coding • Each bit indicates a match or “store at location” ØPROBLEM: Depth of CAM is limited by data width of RAM • e. g. to build 1 M deep CAM, we need 1 M bits wide • In FPGAs: 1000 BRAMs x 32 bit wide = 32 K deep CAM A B C D 0 1 2 3 1 BRAM-based Single-cycle Depth of CAM is limited by RAM width 8/17
BCAM Cascading • Solution: Cascading 1. Divide pattern into smaller slices 2. Search for each slice separately 3. If all slices are found pattern match! ØRAM depth is linear to pattern width RAM Depth = 2 Slice. Width x (Pattern Width / Slice Width) … … CAM … Pattern Match CAM Slice Match RAM Depth = 2 Pattern Width CAM Slice Match • Patterns are encoded as RAM addresses ØRAM depth is exponential to pattern width Slice Match • PROBLEM: Matched Pattern Slice 9/17
Hierarchical Search 2 D BCAM (1) Narrow and Deep BCAM Key idea: Hierarchical search 1 D BCAM 2 D BCAM Find a set (row) with Search this set (row) in match using a 1 D BCAM parallel for a specific match 2 k 4 M too deep 2 k 10/17
Hierarchical Search 2 D BCAM (2) Example • Hierarchical Search: 1. Find a row (segment) with match using a 1 D BCAM 2. Search this row (segment) in parallel for a specific match addresses 0 1 2 3 00 0 10 0 1 1 21 0 0 0 30 1 0 0 Transposed-RAM patterns • RAM: each segment in a line • Transposed-RAM: indicates “pattern in segment? ” patterns 0 2 1 3 1 RAM addresses • Divide address space into segments 11/17
Hierarchical Search 2 D BCAM (2) Example • Hierarchical Search: 1. Find a row (segment) with match using a 1 D BCAM 2. Search this row (segment) in parallel for a specific match addresses 0 1 2 3 00 0 10 0 1 1 21 0 0 0 30 1 0 0 Transposed-RAM patterns • RAM: each segment in a line • Transposed-RAM: indicates “pattern in segment? ” patterns 0 2 1 3 1 RAM addresses • Divide address space into sets 11/176
Hierarchical Search 2 D BCAM (2) Example • Hierarchical Search: 1. Find a row (segment) with match using a 1 D BCAM 2. Search this row (segment) in parallel for a specific match RAM addresses 0 1 2 3 00 0 10 0 1 1 21 0 0 0 30 1 0 0 Transposed-RAM patterns • RAM: each set in a line • Transposed-RAM: indicates “pattern in segment? ” patterns 0 2 3 1 1 1 sets • Divide address space into sets 11/17
Hierarchical Search 2 D BCAM (2) Example • Hierarchical Search: 1. Find a row (segment) with match using a 1 D BCAM 2. Search this row (segment) in parallel for a specific match RAM sets 0 1 00 0 10 1 21 0 31 0 Transposed-RAM patterns • RAM: each set in a line • Transposed-RAM: indicates “pattern in set? ” patterns 0 2 3 1 1 1 sets • Divide address space into sets 11/17
Hierarchical Search 2 D BCAM (2) Example • Hierarchical Search: 1. Find a set (row) with match using a 1 D BCAM 2. Search this row (segment) in parallel for a specific match Match pattern ‘ 3’ RAM sets 0 1 00 0 10 1 21 0 31 0 Transposed-RAM patterns • RAM: each set in a line • Transposed-RAM: indicates “pattern in set? ” patterns 0 2 3 1 1 1 sets • Divide address space into sets 11/17
Hierarchical Search 2 D BCAM (2) Example • Hierarchical Search: 1. Find a set (row) with match using a 1 D BCAM 2. Search this set (row) in parallel for a specific match RAM sets 0 1 00 0 10 1 21 0 31 0 Transposed-RAM patterns • RAM: each set in a line • Transposed-RAM: indicates “pattern in set? ” patterns 0 2 3 1 1 1 sets • Divide address space into sets 11/17
Hierarchical Search 2 D BCAM (3) Pros and Cons BRAM-Based Single match only Cannot be cascaded Single-cycle RAM depth is exponential to pattern width Efficient for deep CAMs Inefficient for wide patterns 12/17
Indirectly-Indexed 2 D (II 2 D) BCAM (1) Cascadable Wide and Deep BCAM patterns PROBLEM: is it possible to regenerate matches for all addresses? addresses 1 h 1 M a t 1 c s r o t 1 i c a 1 d I 1 n 1 1 13/17
Indirectly-Indexed 2 D (II 2 D) BCAM (1) Cascadable Wide and Deep BCAM Key observation Transposed RAM n columns (set of addresses) is a sparse matrix accommodates n matches (1’s) at most! patterns PROBLEM: is it possible to regenerate matches for all addresses? addresses 1 h 1 M a t 1 c s r o t 1 i c a 1 d I 1 n 1 1 13/17
Indirectly-Indexed 2 D (II 2 D) BCAM (1) Cascadable Wide and Deep BCAM Key observation Transposed RAM n columns (set of addresses) is a sparse matrix accommodates n matches (1’s) at most! Key idea: use indirect indices to point to intra-set matches Cascadable Scalable (linear growth) Supports wider patterns PROBLEM: is it possible to regenerate matches for all addresses? Sets s r o t a c i d n I s e c i Ind 1 1 1 Intra-set. Match Indicators 1 13/17
Indirectly-Indexed 2 D (II 2 D) BCAM (1) Cascadable Wide and Deep BCAM Key observation Transposed RAM n columns (set of addresses) is a sparse matrix accommodates n matches (1’s) at most! Key idea: use indirect indices to point to intra-set matches Cascadable Scalable (linear growth) Supports wider patterns PROBLEM: is it possible to regenerate matches for all addresses? Sets s r o t a c i d n I s e c i Ind 1 1 1 Intra-set. Match Indicators 1 1 1 LUTRAM BRAM 13/17
Indirectly-Indexed 2 D (II 2 D) BCAM (2) Example patterns 0 2 1 3 2 3 3 1 addresses 0123 00000 10001 21000 301 10 patterns • Find indices of all matching sets in Transposed-RAM • Read Indicators-RAM using indices from Transposed-RAM RAM(reference) Transposed-RAM addresses • Divide address space into sets • Store sets with a match in Indicators-RAM • Transposed-RAM stores indices to all matches in set • Hierarchical Search: 14/17
Indirectly-Indexed 2 D (II 2 D) BCAM (2) Example patterns 0 2 1 3 2 3 3 1 addresses 0123 00000 10001 21000 301 10 patterns • Find indices of all matching sets in Transposed-RAM • Read Indicators-RAM using indices from Transposed-RAM RAM(reference) Transposed-RAM addresses • Divide address space into sets • Store sets with a match in Indicators-RAM • Transposed-RAM stores indices to all matches in set • Hierarchical Search: 14/17
Indirectly-Indexed 2 D (II 2 D) BCAM (2) Example patterns 0 2 1 3 2 3 3 1 addresses 0123 00000 100 2 00 3 10 01 01 10 patterns • Find indices of all matching sets in Transposed-RAM • Read Indicators-RAM using indices from Transposed-RAM RAM(reference) Transposed-RAM addresses • Divide address space into sets • Store sets with a match in Indicators-RAM • Transposed-RAM stores indices to all matches in set • Hierarchical Search: Indicators-RAMs 14/17
Indirectly-Indexed 2 D (II 2 D) BCAM (2) Example patterns 0 2 1 3 2 3 3 1 sets 0 1 0 - 1 2 3 10 01 01 10 patterns • Find indices of all matching sets in Transposed-RAM • Read Indicators-RAM using indices from Transposed-RAM RAM(reference) Transposed-RAM addresses • Divide address space into sets • Store sets with a match in Indicators-RAM • Transposed-RAM stores indices to all matches in set • Hierarchical Search: Indicators-RAMs 14/17
Indirectly-Indexed 2 D (II 2 D) BCAM (2) Example RAM(reference) Transposed-RAM • Find indices of all matching sets in Match pattern ‘ 3’ Transposed-RAM • Read Indicators-RAM using indices from Transposed-RAM sets 0 1 0 - 1 2 3 10 01 01 10 patterns 0 2 1 3 2 3 3 1 addresses • Divide address space into sets • Store sets with a match in Indicators-RAM • Transposed-RAM stores indices to all matches in set • Hierarchical Search: Indicators-RAMs 14/16
Indirectly-Indexed 2 D (II 2 D) BCAM (2) Example RAM(reference) Transposed-RAM • Find indices of all matching sets in Match pattern ‘ 3’ Transposed-RAM • Read Indicators-RAM using indices from Transposed-RAM sets 0 1 0 - 1 2 3 10 01 01 10 patterns 0 2 1 3 2 3 3 1 addresses • Divide address space into sets • Store sets with a match in Indicators-RAM • Transposed-RAM stores indices to all matches in set • Hierarchical Search: Indicators-RAMs 14/17
Indirectly-Indexed 2 D (II 2 D) BCAM (2) Example RAM(reference) Transposed-RAM • Find indices of all matching sets in Match pattern ‘ 3’ Transposed-RAM 0123 • Read Indicators-RAM using indices 0110 from Transposed-RAM Found in ‘ 1’ and ‘ 2’ sets 0 1 0 - 1 2 3 10 01 01 10 patterns 0 2 1 3 2 3 3 1 addresses • Divide address space into sets • Store sets with a match in Indicators-RAM • Transposed-RAM stores indices to all matches in set • Hierarchical Search: Indicators-RAMs 14/17
Indirectly-Indexed 2 D (II 2 D) BCAM (3) Area and Performance Except for very a narrow HS, II 2 D exhibits higher Fmax register-based BCAM register consumption II 2 D linear ALM consumption; similar to other methods HS exponential BRAM consumption II 2 D linear BRAM consumption II 2 D supports wider patterns 15/17
Indirectly-Indexed 2 D (II 2 D) BCAM (3) Area and Performance Except for very a narrow HS, II 2 D exhibits higher Fmax register-based BCAM register consumption II 2 D linear ALM consumption; similar to other methods HS exponential BRAM consumption II 2 D linear BRAM consumption II 2 D supports wider patterns 15/17
Indirectly-Indexed 2 D (II 2 D) BCAM (3) Area and Performance Except for very a narrow HS, II 2 D exhibits higher Fmax register-based BCAM register consumption II 2 D linear ALM consumption; similar to other methods HS exponential BRAM consumption II 2 D linear BRAM consumption II 2 D supports wider patterns 15/17
Indirectly-Indexed 2 D (II 2 D) BCAM (3) Area and Performance Except for very a narrow HS, II 2 D exhibits higher Fmax register-based BCAM register consumption II 2 D linear ALM consumption; similar to other methods HS exponential BRAM consumption II 2 D linear BRAM consumption II 2 D supports wider patterns 15/17
Indirectly-Indexed 2 D (II 2 D) BCAM (3) Area and Performance Except for very a narrow HS, II 2 D exhibits higher Fmax register-based BCAM register consumption II 2 D linear ALM consumption; similar to other methods HS exponential BRAM consumption II 2 D linear BRAM consumption II 2 D supports wider patterns 15/17
Indirectly-Indexed 2 D (II 2 D) BCAM (3) Area and Performance Except for very a narrow HS, II 2 D exhibits higher Fmax register-based BCAM register consumption II 2 D linear ALM consumption; similar to other methods HS exponential BRAM consumption II 2 D linear BRAM consumption II 2 D supports wider patterns 15/17
Open Source http: //ece. ubc. ca/~lemieux/downloads/ Modular and parametric Verilog files Run-in-batch simulation and synthesis manager 16/17
Conclusions Single-cycle Cascadable Scalable Deep Wide Brute-Force Transposed-RAM addresses patterns BRAM-based I h c t Ma s r o t a c i nd 17/17
Conclusions Single-cycle Cascadable Scalable Deep Wide Hierarchical Search 2 D BCAM sets h c t s a r M o t t e a S c i d n I patterns BRAM-based 17/17
Conclusions Single-cycle Cascadable Scalable Deep Wide Indirectly-Indexed 2 D (II 2 D) BCAM sets s r Multi-unpredictable-cyclet o a c i s d e In dic In patterns BRAM-based Intra-set Match Indicators 17/17
Thank You!
Backup Slides
Conclusions BRAM-based Single-cycle Deep Wide sets h rs c t a M icato Ind II 2 D patterns addresses h c t a M tors a c i d n I Hierarchical patterns Brute-Force s e t s s r os t a ic ice d In Ind Match Indicators 16
- Slides: 42