The Format String is a string used to configure the key width and the position and width of range fields. The format string is only available for variable rate STCAMs and only needed when ranges are used. The hardware generation uses this string to generate range matching logic. The software driver uses this string to validate input arguments and generate the right masks when ranges are used.
For standalone usage, the format string needs to be created explicitly.
The format string describes the format of all keys and masks. A key
consists of several fields, and the format string specifies the location and size of the
fields. In the string, fields are separated by a colon (:). The string is read from left to right. The first field corresponds to
the least significant bit of the key. The key is specified as little-endian. Each field
is specified with a field length and field type. There are no alignment restrictions for
the fields. The location, type, number, and size of fields are fully flexible.
The following field types and lengths are supported:
- t
- Ternary field - the filed mask can have any value.
Field length 1 to 1024 bit
- r
- Range field - Matching is done with logic comparators with
start/end values.
Field length 1 to 32 bit
For example, the format "2t:32r:3r:128t" contains two range fields, one 32 bit wide and the other 3 bit wide. The 32 bit range field starts at bit 2 in the key. The two ternary fields could use any mask. The key width is 2 + 32 + 3+ 128 = 165 bit.