P4C
The P4 Compiler
Loading...
Searching...
No Matches
backend.h
1
/*
2
Copyright 2020 Intel Corp.
3
4
Licensed under the Apache License, Version 2.0 (the "License");
5
you may not use this file except in compliance with the License.
6
You may obtain a copy of the License at
7
8
http://www.apache.org/licenses/LICENSE-2.0
9
10
Unless required by applicable law or agreed to in writing, software
11
distributed under the License is distributed on an "AS IS" BASIS,
12
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13
See the License for the specific language governing permissions and
14
limitations 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
21
namespace
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
38
namespace
DPDK
{
39
class
DpdkBackend
{
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 DPDK
55
56
#endif
/* BACKENDS_DPDK_BACKEND_H_ */
DPDK::DpdkBackend
Definition
backend.h:39
DPDK::DpdkOptions
Definition
options.h:24
P4::ReferenceMap
Class used to encode maps from paths to declarations.
Definition
referenceMap.h:66
P4::TypeMap
Definition
typeMap.h:42
DPDK
Definition
backend.cpp:35
backends
dpdk
backend.h
Generated on Tue Mar 26 2024 for