DIRECT (DCAM) - 2025.1 English - UG1308

Vitis Networking P4 User Guide (UG1308)

Document ID
UG1308
Release Date
2025-05-29
Version
2025.1 English

Direct address match, unlike the other tables, does not involve a comparison but instead uses the key as the direct address to access the stored value at that location (the table is effectively a RAM).

  • Key width: from 1 to 16 bits
  • Response width: from 1 to 7k bits
  • Table depth (max. number of entries): 2KeyWidth
  • Direct match: True/False
  • Hit/miss flag: Yes

    Here is an example of how to instantiate a direct table in a P4 file:

        table forwardIPv4 {
            key             = { hdr.ipv4.tos : exact; }
            actions         = { forwardPacket; NoAction; }
            size            = 64;
            default_action  = NoAction;
            direct_match    = true;
        }

For more details on how the compiler selects a direct table, see Compiler Table Selection. Note that in this type of table the total number of entries specified (size field) is ignored and is instead calculated from 2Keywidth.