Index Generation Functions: Logic Synthesis for Pattern Matching - - PowerPoint PPT Presentation

index generation functions logic synthesis for pattern
SMART_READER_LITE
LIVE PREVIEW

Index Generation Functions: Logic Synthesis for Pattern Matching - - PowerPoint PPT Presentation

Index Generation Functions: Logic Synthesis for Pattern Matching Tsutomu Sasao Meiji University, Kanagawa, Japan 2015/12/10 2015/12/10 Sasao EPFL2015 1 1 1


slide-1
SLIDE 1

2015/12/10 Sasao EPFL2015 1 2015/12/10 1

Index Generation Functions: Logic Synthesis for Pattern Matching

Tsutomu Sasao Meiji University, Kanagawa, Japan

1

slide-2
SLIDE 2

2015/12/10 Sasao EPFL2015 2 2015/12/10 2

  • .

0110000100010000101001100001000100001010 0101111101101010001101011111011010100011 1111010101110111000011110101011101110001 0001111000010001011100011110000100010111 0011110000000100010100111100000001000101 0111001001000100100101110010010001001001 0010001110001111001000100011100011110010 1111111111010001111000100011100011110010 1110111000110001011011101110001100010110 1010000110100100001110100001101001000011

slide-3
SLIDE 3

2015/12/10 Sasao EPFL2015 3 2015/12/10 3

Circuit

x1

x2

x40

y1 y2 y3 y4

slide-4
SLIDE 4

2015/12/10 Sasao EPFL2015 4 2015/12/10 4

Methods

  • 1. Use a look up table.
  • 2. Convert the table into Verilog code

and use logic synthesis tool to generate an FPGA.

  • 3. Use Xilinx CAM IP core.
  • 4. Use a new method.
slide-5
SLIDE 5

2015/12/10 Sasao EPFL2015 5 2015/12/10 5

  • 1. To distinguish 10 vectors, 5 bits are

sufficient, in most cases.

  • 2. Find 5 bits to distinguish 10 vectors.
  • 3. Given an input vector, check if there

exist a vector that matches the 5 bits.

  • 4. If such a vector exists, check if other

bits of the vector are equal to the input.

New Method

slide-6
SLIDE 6

2015/12/10 Sasao EPFL2015 6 2015/12/10 6

We have 10 vectors of 40 bits. Design a circuit for pattern matching.

0110000100010000101001100001000100001010 0101111101101010001101011111011010100011 1111010101110111000011110101011101110001 0001111000010001011100011110000100010111 0011110000000100010100111100000001000101 0111001001000100100101110010010001001001 0010001110001111001000100011100011110010 1111111111010001111000100011100011110010 1110111000110001011011101110001100010110 1010000110100100001110100001101001000011

slide-7
SLIDE 7

2015/12/10 Sasao EPFL2015 7 2015/12/10 7

Index Generation Unit (IGU) Index Generation Unit (IGU)

X1 X2

Linear Circuit

5

Main Memory

AUX Memory

Comparator

X2 AND

  • 35

35 35

  • 7
slide-8
SLIDE 8

2015/12/10 Sasao EPFL2015 8 2015/12/10 8

Incompletely Specified Index Incompletely Specified Index Generation Function Generation Function

. } 1 , { , where }, ,..., 2 , 1 { : = ⊆ → B B D k D f

n

8

slide-9
SLIDE 9

2015/12/10 Sasao EPFL2015 9 2015/12/10 9

Number of Variables to Represent Number of Variables to Represent Incompletely Specified Index Incompletely Specified Index Generation Functions Generation Functions

9

slide-10
SLIDE 10

2015/12/10 Sasao EPFL2015 10 2015/12/10 10

Index Generation Function

x1 x2 x3 x4 x5 x6 x7 index

  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10
slide-11
SLIDE 11

2015/12/10 Sasao EPFL2015 11 2015/12/10 11

7 7-

  • Segment to BCD Converter

Segment to BCD Converter

7segments BCD

a b c d e f g

  • 1
  • 2
  • 3
  • 4
  • 5
  • 6
  • 7
  • 8
  • 9
  • 10

d e f a b c g

  • 11
slide-12
SLIDE 12

2015/12/10 Sasao EPFL2015 12 2015/12/10 12

Q: Which Segments are Necessary?

a d e f b c g

12

slide-13
SLIDE 13

2015/12/10 Sasao EPFL2015 13 2015/12/10 13

Five Segments are Necessary { {a, a,b b,e, ,e,f f,g ,g} }

13

slide-14
SLIDE 14

2015/12/10 Sasao EPFL2015 14 2015/12/10 14

How many variables, on the average, How many variables, on the average, are necessary to represent are necessary to represent incompletely specified index incompletely specified index generation functions with 7 variables generation functions with 7 variables and weight 10? and weight 10?

14

slide-15
SLIDE 15

2015/12/10 Sasao EPFL2015 15 2015/12/10 15

  • 22 functions

22 functions 978 functions

15

Number of Functions

slide-16
SLIDE 16

2015/12/10 Sasao EPFL2015 16 2015/12/10 16

Property Property

To represent an incompletely specified index generation function with weight k, variables are sufficient, for most cases, when Example: When k=127.

  • 3

) 1 ( log 2

2

− + k

. 7 ≥ k

  • 11

3 7 2 3 ) 1 ( log 2

2

= − × = − + k

16

slide-17
SLIDE 17

2015/12/10 Sasao EPFL2015 17 2015/12/10 17

If each column has at most one non If each column has at most one non-

  • zero

zero element in a decomposition chart, then element in a decomposition chart, then f f can be represented with only the column can be represented with only the column variables variables.

.

1

x

4

x

2

x

3

x

2 3 4 1

17

slide-18
SLIDE 18

2015/12/10 Sasao EPFL2015 18 2015/12/10 18

1

x

2 1 2 1 2 1 2 1

2 3 4 1 x x x x x x x x f ⋅ ∨ ⋅ ∨ ⋅ ∨ ⋅ =

2

x

4

x

3

x

2 3 4 1 1 1 1 4 4 4 3 3 3 2 2 2

18

slide-19
SLIDE 19

2015/12/10 Sasao EPFL2015 19 2015/12/10 19

  • 1

x

4

x

2

x

3

x

4 2 3 1

slide-20
SLIDE 20

2015/12/10 Sasao EPFL2015 20 2015/12/10 20

If the element 4 is moved right two squares,

then f is represented by only x1 and x2 1

x

4

x

2

x

3

x

4

  • 2

4 3

slide-21
SLIDE 21

2015/12/10 Sasao EPFL2015 21 2015/12/10 21

A linear transformation permutes elements.

4 4 3 3 4 2 2 4 1 1

x y x y x x y x x y = = ⊕ = ⊕ =

1

y

4

x

2

y

3

x

2 3 4 1 4

slide-22
SLIDE 22

2015/12/10 Sasao EPFL2015 22 2015/12/10 22

In this case, each column has at most one non-zero element.

4 4 3 3 4 2 2 4 1 1

x y x y x x y x x y = = ⊕ = ⊕ =

1

y

4

x

2

y

3

x

2 3 4 1

slide-23
SLIDE 23

2015/12/10 Sasao EPFL2015 23 2015/12/10 23

General Function Linear Function p

n X q

Linear Decomposition Linear Decomposition

Cost: np Cost: q2p

23

  • )

1 (

2

+ = k log q

slide-24
SLIDE 24

2015/12/10 Sasao EPFL2015 24 2015/12/10 24

•‣ General form: •‣ Compound degree: The number of coefficients with ai=1 . •‣ A variable with the compound degree 1 is primitive.

Compound Variables Compound Variables

n nx

a x a x a y ⊕ ⊕ ⊕ =

  • 2

2 1 1

} 1 , { ∈

i

a

24

slide-25
SLIDE 25

2015/12/10 Sasao EPFL2015 25 2015/12/10 25

Linear Circuits Linear Circuits

1 1 1 j i

x x y ⊕ =

n n

MUX MUX

n n

MUX MUX

+ +

jp ip p

x x y ⊕ =

1 1 i

x y =

n

MUX ip p

x y =

n

MUX

Compound degree 2 Compound degree 1

25

slide-26
SLIDE 26

2015/12/10 Sasao EPFL2015 26 2015/12/10 26

1 1-

  • out
  • ut-
  • of
  • f-
  • 7 code to Index Converter

7 code to Index Converter

1-out-of-7 code

x7 x6x5 x4x3x2x1

Index

0 0 0 0 0 0 1

1

0 0 0 0 0 1 0

2

0 0 0 0 1 0 0

3

0 0 0 1 0 0 0

4

0 0 1 0 0 0 0

5

0 1 0 0 0 0 0

6

1 0 0 0 0 0 0

7

  • 26
slide-27
SLIDE 27

2015/12/10 Sasao EPFL2015 27 2015/12/10 27

Distribution is Skewed Distribution is Skewed

•‣ For each xi, there is single 1, and 6 0’‚s.

1-out-of-7 code x7 x6x5 x4x3x2x1

Index

0 0 0 0 0 0 1

1

0 0 0 0 0 1 0

2

0 0 0 0 1 0 0

3

0 0 0 1 0 0 0

4

0 0 1 0 0 0 0

5

0 1 0 0 0 0 0

6

1 0 0 0 0 0 0

7

27

slide-28
SLIDE 28

2015/12/10 Sasao EPFL2015 28 2015/12/10 28

Only Three Variables are Only Three Variables are Necessary. Necessary.

7 6 5 4 3 7 6 3 2 2 7 5 3 1 1

x x x x y x x x x y x x x x y ⊕ ⊕ ⊕ = ⊕ ⊕ ⊕ = ⊕ ⊕ ⊕ =

28

slide-29
SLIDE 29

2015/12/10 Sasao EPFL2015 29 2015/12/10 29

Original Original vs.

  • vs. Transformed

Transformed Variables Variables

Transformed variables For each of y1,y2,y3, there are 3 0’‚s, and 4 1’‚s.

x7 x6x5 x4x3x2x1 y3 y2 y1

0 0 0 0 0 0 1

0 0 1

0 0 0 0 0 1 0

0 1 0

0 0 0 0 1 0 0

0 1 1

0 0 0 1 0 0 0

1 0 0

0 0 1 0 0 0 0

1 0 1

0 1 0 0 0 0 0

1 1 0

1 0 0 0 0 0 0

1 1 1

7 6 5 4 3 7 6 3 2 2 7 5 3 1 1

x x x x y x x x x y x x x x y ⊕ ⊕ ⊕ = ⊕ ⊕ ⊕ = ⊕ ⊕ ⊕ =

29

slide-30
SLIDE 30

2015/12/10 Sasao EPFL2015 30 2015/12/10 30

Linear Decomposition Linear Decomposition

Linear

Function

General Function

7 3 3

30

slide-31
SLIDE 31

2015/12/10 Sasao EPFL2015 31 2015/12/10 31

# of Variables to Represent IP Address # of Variables to Represent IP Address Tables ( Tables (n n=32) =32)

k

t=1 t=2 t=3

1670

18 17 16

3288

20 19 18

4591

21 20 19

7903

23 21 20

31

t : Compound degree

slide-32
SLIDE 32

2015/12/10 Sasao EPFL2015 32 2015/12/10 32

Scanning Engine for Computer Scanning Engine for Computer Virus Virus

•‣ Stores k=1.3 million virus sub-patterns

  • f n=40 bits.

•‣ The single LUT realization requires 21 Tera bits. •‣ Our method requires only 160 Mega bits.

32

slide-33
SLIDE 33

2015/12/10 Sasao EPFL2015 33 2015/12/10 33

Memory

Reg.

Input (text) Output 8 8

  • k

2

log

Reg.

8

Reg.

8

Reg.

8 8 8 8

Reg.

8 8

Circuit to Detect Suspicious Patterns

5 characters 40 bits, 1.3 million patterns

slide-34
SLIDE 34

2015/12/10 Sasao EPFL2015 34 2015/12/10 34

  • H. Nakahara, T. Sasao, M. Matsuura, "A low-cost and high-performance

virus scanning engine using a binary CAM emulator and an MPU," 8th International Symposium on Applied Reconfigurable Computing, (ARC 2012), March 19-23, 2012, Hong-Kong.

34

slide-35
SLIDE 35

2015/12/10 Sasao EPFL2015 35 2015/12/10 35

Current Projects

•‣ Minimizers for input variables

–— high-speed applications –— exact minimum

•‣ Functional decomposition

–— using multiple IGUs

•‣ New applications

–— Replacement for CAMs –— Large-scale search engine

slide-36
SLIDE 36

2015/12/10 Sasao EPFL2015 36 2015/12/10 36

Reference Reference

•‣ T. Sasao, Memory-Based Logic Synthesis, Springer 2011.

36

slide-37
SLIDE 37

2015/12/10 Sasao EPFL2015 37

slide-38
SLIDE 38

2015/12/10 Sasao EPFL2015 38 2015/12/10 38

1

x

4

x

2

x

3

x

4 2 3 1

x4 x3 x2 x1 Index

0 0 0 1

1

0 0 1 0

2

0 1 0 0

3

1 0 0 0

4