P4C
The P4 Compiler
 
Loading...
Searching...
No Matches
DPDK::ConvertStatementToDpdk Class Reference
Inheritance diagram for DPDK::ConvertStatementToDpdk:

Public Member Functions

 ConvertStatementToDpdk (P4::ReferenceMap *refmap, P4::TypeMap *typemap, DpdkProgramStructure *structure)
 
 ConvertStatementToDpdk (P4::ReferenceMap *refmap, P4::TypeMap *typemap, DpdkProgramStructure *structure, IR::Type_Struct *metadataStruct)
 
void add_instr (const IR::DpdkAsmStatement *s)
 
cstring append_parser_name (const IR::P4Parser *p, cstring)
 
void branchingInstructionGeneration (cstring true_label, cstring false_label, const IR::Expression *expr)
 
IR::IndexedVector< IR::DpdkAsmStatement > & get_instr ()
 
IR::IndexedVector< IR::DpdkAsmStatement > getInstructions ()
 
bool handleConstSwitch (const IR::SwitchStatement *a)
 
bool preorder (const IR::AssignmentStatement *a) override
 
bool preorder (const IR::IfStatement *a) override
 
bool preorder (const IR::MethodCallStatement *a) override
 
bool preorder (const IR::SwitchStatement *a) override
 
void process_logical_operation (const IR::Expression *, const IR::Operation_Binary *)
 
void process_relation_operation (const IR::Expression *, const IR::Operation_Relation *)
 
void set_parent (const IR::Node *p)
 
void set_parser (const IR::P4Parser *p)
 

Member Function Documentation

◆ preorder()

bool DPDK::ConvertStatementToDpdk::preorder ( const IR::MethodCallStatement * a)
override

Extract instruction of DPDK target expects the second argument (size of the varbit field of the header) to be the number of bytes to be extracted while in P4 it is the number of bits to be extracted. We need to compute the size in bytes.

Warning
If the value is not aligned to 8 bits, the remainder after division is dropped during runtime (this is a target limitation).