17#ifndef BACKENDS_DPDK_DPDKMETADATA_H_
18#define BACKENDS_DPDK_DPDKMETADATA_H_
21#include "frontends/common/resolveReferences/referenceMap.h"
27 bool &is_direction_used;
31 : is_direction_used(is_direction_used) {}
32 bool preorder(
const IR::Member *m)
override {
33 if (!is_direction_used && isDirection(m)) {
34 is_direction_used =
true;
55 dirToDirMapping.insert(std::make_pair(
cstring(
"pna_main_input_metadata_direction"),
56 cstring(
"pna_main_input_metadata_direction")));
57 dirToDirMapping.insert(std::make_pair(
cstring(
"pna_pre_input_metadata_direction"),
58 cstring(
"pna_main_input_metadata_direction")));
59 dirToDirMapping.insert(std::make_pair(
cstring(
"pna_main_parser_input_metadata_direction"),
60 cstring(
"pna_main_input_metadata_direction")));
61 inputToInputPortMapping.insert(
62 std::make_pair(
cstring(
"pna_main_input_metadata_input_port"),
63 cstring(
"pna_main_input_metadata_input_port")));
64 inputToInputPortMapping.insert(
65 std::make_pair(
cstring(
"pna_pre_input_metadata_direction"),
66 cstring(
"pna_main_input_metadata_input_port")));
67 inputToInputPortMapping.insert(
68 std::make_pair(
cstring(
"pna_main_parser_input_metadata_direction"),
69 cstring(
"pna_main_input_metadata_input_port")));
71 const IR::Node *preorder(IR::DpdkAsmProgram *p)
override;
72 const IR::Node *preorder(IR::Member *m)
override;
76 IR::DpdkListStatement *replaceDirection(IR::DpdkListStatement *l);
89 bool isPass(
const IR::Member *m);
90 const IR::Node *postorder(IR::DpdkAction *a)
override;
91 const IR::Node *postorder(IR::DpdkListStatement *l)
override;
Definition dpdkMetadata.h:43
DirectionToRegRead()
Definition dpdkMetadata.h:50
void uniqueNames(IR::DpdkAsmProgram *p)
Make sure new decls and fields name are unique.
Definition dpdkMetadata.cpp:26
IR::DpdkExternDeclaration * addRegDeclInstance(cstring instanceName)
Create and add register declaration instance to program.
Definition dpdkMetadata.cpp:56
Definition dpdkMetadata.h:84
bool isPass(const IR::Member *m)
Definition dpdkMetadata.cpp:100
Definition ordered_map.h:32
Definition ordered_set.h:32
Definition dpdk/backend.cpp:37