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
35namespace P4::BMV2 {
36
38 public:
39 unsigned error_width = 32;
40
41 void createStructLike(ConversionContext *ctxt, const IR::Type_StructLike *st,
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
52EXTERN_CONVERTER_W_OBJECT_AND_INSTANCE(Checksum)
53EXTERN_CONVERTER_W_OBJECT_AND_INSTANCE(Counter)
54EXTERN_CONVERTER_W_OBJECT_AND_INSTANCE(DirectCounter)
55EXTERN_CONVERTER_W_OBJECT_AND_INSTANCE(Meter)
56EXTERN_CONVERTER_W_OBJECT_AND_INSTANCE(DirectMeter)
57EXTERN_CONVERTER_W_OBJECT_AND_INSTANCE(Random)
58EXTERN_CONVERTER_W_INSTANCE(ActionProfile)
59EXTERN_CONVERTER_W_INSTANCE(ActionSelector)
60EXTERN_CONVERTER_W_OBJECT_AND_INSTANCE(Digest)
61
62} // namespace P4::BMV2
63
64#endif /* BACKENDS_BMV2_PORTABLE_COMMON_PORTABLE_H_ */
Definition portable.h:37
Definition portableProgramStructure.h:20
Definition cstring.h:85
TODO: this is not really specific to BMV2, it should reside somewhere else.
Definition action.cpp:9
Definition bmv2/common/helpers.h:288