
Public Member Functions | |
| HeaderConverter (ConversionContext *ctxt, cstring scalarsName) | |
| void | addHeaderStacks (const IR::Type_Struct *type) |
| void | addTypesAndInstances (const IR::Type_StructLike *type, bool meta) |
| void | end_apply (const IR::Node *node) override |
| Visitor::profile_t | init_apply (const IR::Node *node) override |
| bool | isHeaders (const IR::Type_StructLike *st) |
| bool | preorder (const IR::Parameter *param) override |
Protected Member Functions | |
| void | addHeaderField (const cstring &header, const cstring &name, int size, bool is_signed) |
| void | addHeaderType (const IR::Type_StructLike *st) |
| Util::JsonArray * | addHeaderUnionFields (cstring hdrName, const IR::Type_HeaderUnion *type) |
| Util::JsonArray * | pushNewArray (Util::JsonArray *parent) |
Create header type and header instance from a IR::StructLike type
| meta | this boolean indicates if the struct is a metadata or header. |
|
override |
We synthesize a "header_type" for each local which has a struct type and we pack all the scalar-typed locals into a 'scalar' type
Generate ctxt->json for header from IR::Block's constructor parameters
The only allowed fields in a struct are: Type_Bits, Type_Bool and Type_Header
header H { bit<32> x; }
struct { bit<32> x; bool y; H h; }
Type_Struct within a Type_Struct, i.e. nested struct, should be flattened apriori.