P4C
The P4 Compiler
Loading...
Searching...
No Matches
dpdk/backend.h
1/*
2Copyright 2020 Intel Corp.
3
4Licensed under the Apache License, Version 2.0 (the "License");
5you may not use this file except in compliance with the License.
6You may obtain a copy of the License at
7
8 http://www.apache.org/licenses/LICENSE-2.0
9
10Unless required by applicable law or agreed to in writing, software
11distributed under the License is distributed on an "AS IS" BASIS,
12WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13See the License for the specific language governing permissions and
14limitations under the License.
15*/
16
17#ifndef BACKENDS_DPDK_BACKEND_H_
18#define BACKENDS_DPDK_BACKEND_H_
19#include "p4/config/v1/p4info.pb.h"
20
21namespace p4configv1 = ::p4::config::v1;
22#undef setbit
23
24#include "frontends/common/constantFolding.h"
25#include "frontends/common/resolveReferences/referenceMap.h"
26#include "frontends/p4/coreLibrary.h"
27#include "frontends/p4/enumInstance.h"
28#include "frontends/p4/evaluator/evaluator.h"
29#include "frontends/p4/methodInstance.h"
30#include "frontends/p4/simplify.h"
31#include "frontends/p4/typeMap.h"
32#include "frontends/p4/unusedDeclarations.h"
33#include "ir/ir.h"
34#include "lib/big_int_util.h"
35#include "lib/json.h"
36#include "options.h"
37
38namespace P4::DPDK {
40 DpdkOptions &options;
41 P4::ReferenceMap *refMap;
42 P4::TypeMap *typeMap;
43 const p4configv1::P4Info &p4info;
44 const IR::DpdkAsmProgram *dpdk_program = nullptr;
45
46 public:
47 void convert(const IR::ToplevelBlock *tlb);
48 DpdkBackend(DpdkOptions &options, P4::ReferenceMap *refMap, P4::TypeMap *typeMap,
49 const p4configv1::P4Info &p4info)
50 : options(options), refMap(refMap), typeMap(typeMap), p4info(p4info) {}
51 void codegen(std::ostream &) const;
52};
53
54} // namespace P4::DPDK
55
56#endif /* BACKENDS_DPDK_BACKEND_H_ */
Definition dpdk/backend.h:39
void convert(const IR::ToplevelBlock *tlb)
Definition dpdk/backend.cpp:39
Definition backends/dpdk/options.h:24
Class used to encode maps from paths to declarations.
Definition referenceMap.h:66
Definition typeMap.h:41
Definition dpdk/backend.cpp:37