P4C
The P4 Compiler
Loading...
Searching...
No Matches
portable.h
1
/*
2
Copyright 2024 Marvell Technology, Inc.
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_BMV2_PORTABLE_COMMON_PORTABLE_H_
18
#define BACKENDS_BMV2_PORTABLE_COMMON_PORTABLE_H_
19
20
#include "backends/bmv2/common/action.h"
21
#include "backends/bmv2/common/control.h"
22
#include "backends/bmv2/common/deparser.h"
23
#include "backends/bmv2/common/extern.h"
24
#include "backends/bmv2/common/header.h"
25
#include "backends/bmv2/common/helpers.h"
26
#include "backends/bmv2/common/lower.h"
27
#include "backends/bmv2/common/parser.h"
28
#include "backends/common/portableProgramStructure.h"
29
#include "backends/common/programStructure.h"
30
#include "frontends/common/constantFolding.h"
31
#include "frontends/common/resolveReferences/referenceMap.h"
32
#include "frontends/p4/coreLibrary.h"
33
#include "frontends/p4/enumInstance.h"
34
#include "frontends/p4/evaluator/evaluator.h"
35
#include "frontends/p4/methodInstance.h"
36
#include "frontends/p4/simplify.h"
37
#include "frontends/p4/strengthReduction.h"
38
#include "frontends/p4/typeMap.h"
39
#include "frontends/p4/unusedDeclarations.h"
40
#include "ir/ir.h"
41
#include "lib/big_int_util.h"
42
#include "lib/json.h"
43
44
namespace
P4::BMV2
{
45
46
class
PortableCodeGenerator
{
47
public
:
48
unsigned
error_width = 32;
49
50
void
createStructLike(
ConversionContext
*ctxt,
const
IR::Type_StructLike *st,
51
P4::PortableProgramStructure
*structure);
52
void
createTypes(
ConversionContext
*ctxt,
P4::PortableProgramStructure
*structure);
53
void
createHeaders(
ConversionContext
*ctxt,
P4::PortableProgramStructure
*structure);
54
void
createScalars(
ConversionContext
*ctxt,
P4::PortableProgramStructure
*structure);
55
void
createExterns();
56
void
createActions(
ConversionContext
*ctxt,
P4::PortableProgramStructure
*structure);
57
void
createGlobals();
58
cstring
convertHashAlgorithm(
cstring
algo);
59
};
60
61
EXTERN_CONVERTER_W_OBJECT_AND_INSTANCE(Checksum)
62
EXTERN_CONVERTER_W_OBJECT_AND_INSTANCE(Counter)
63
EXTERN_CONVERTER_W_OBJECT_AND_INSTANCE(DirectCounter)
64
EXTERN_CONVERTER_W_OBJECT_AND_INSTANCE(Meter)
65
EXTERN_CONVERTER_W_OBJECT_AND_INSTANCE(DirectMeter)
66
EXTERN_CONVERTER_W_OBJECT_AND_INSTANCE(Random)
67
EXTERN_CONVERTER_W_INSTANCE(ActionProfile)
68
EXTERN_CONVERTER_W_INSTANCE(ActionSelector)
69
EXTERN_CONVERTER_W_OBJECT_AND_INSTANCE(Digest)
70
71
}
// namespace P4::BMV2
72
73
#endif
/* BACKENDS_BMV2_PORTABLE_COMMON_PORTABLE_H_ */
P4::BMV2::PortableCodeGenerator
Definition
portable.h:46
P4::PortableProgramStructure
Definition
portableProgramStructure.h:29
P4::cstring
Definition
cstring.h:85
P4::BMV2
TODO: this is not really specific to BMV2, it should reside somewhere else.
Definition
action.cpp:21
P4::BMV2::ConversionContext
Definition
bmv2/common/helpers.h:297
backends
bmv2
portable_common
portable.h
Generated by
1.12.0