Compiler Table Selection - 2022.2 English

Vitis Networking P4 User Guide (UG1308)

Document ID
UG1308
Version
2022.2 English
Revision
The compiler uses the following general rules to select the type of table implemented:
  • If all fields are defined as exact, a BCAM is selected by default, except in the following circumstances:
    • If the size is <= 32 entries, a TinyBCAM is selected.
    • If the direct_match attribute is specified (and key is <= 16 bits), a Direct Table is selected.
  • For any other combination of fields, a TCAM is selected by default, except in the following circumstances:
    • If the size is <= 32 entries and there are no range match filelds, a TinyTCAM is selected. There is no reason or advantage to restrict the num_masks in this implementation.
    • If the num_masks attribute has been specified and there are no range match fields, an STCAM is selected.
    • If the key attribute has a single lpm field with a field width of < 64 bits, an STCAM is used. Along with the single lpm field, the key attribute can optionally have any number of exact match fields. In this scenario, num_masks is calculated automatically to equal the field width.