GithubHelp home page GithubHelp logo

tcam's Introduction

tcam

TCAM (Ternary Content-Addressable Memory) in Verilog.

Specifications

  • Index table implemented on distributed memory (registers)
  • Data table implemented on Simple Dual Port Memory (distributed or block)
  • Set/Clear latency: 1
  • Request latency: 3

Parameters:

  • ADDR_WIDTH - Address width
  • KEY_WIDTH - Key and Mask width
  • DATA_WIDTH - Data width
  • MASK_DISABLE - Disable mask flag
  • RAM_STYLE_DATA - ram_style attribute for data memory

Ports

  • clk - Input clock
  • rst - Synchronous reset (active-HIGH)
  • set_addr - Input Address for Set/Clear operation
  • set_data - Input Data for Set operation
  • set_key - Input Key for Set operation
  • set_xmask - Input Mask for Set operation
  • set_clr - Input Clear flag for Set/Clear operation
  • set_valid - Input Valid flag for Set/Clear operation
  • req_key - Input Key for Request operation
  • req_valid - Input Valid flag for Request operation
  • req_ready - Output Ready flag for Request operation
  • res_addr - Output Address for Request operation
  • res_data - Output Data for Request operation
  • res_valid - Output Valid flag for Request operation
  • res_null - Output Null flag for Request operation ('not found')

Example Timings

TCAM

Example timing diagram contains 4 stages:

  • Set stage: fills TCAM with data and masks
  • Success request stage: requests data by key
  • Clear stage: clears data with address <0x1>
  • Failed request stage: no correct data in TCAM (res_null signal is ACTIVE)

Structure

Top

Top Structure

Description:

  • line_array - array of lines, each line contains registered memory (keys and masks) and matching logic
  • line_encoder - converts input line match signals to corresponding addresses sequentially
  • ram - random access memory containing data

Line

Line Structure

Description:

Each key and mask are contained in the registered memory. This circumstance allows implement parallel matching logic. The output match signal is comparison of zero with results of function: "buffered key" XOR "input request key" AND "inverted buffered mask".

tcam's People

Contributors

mcjtag avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.