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