P4C
The P4 Compiler
Loading...
Searching...
No Matches
modules/testgen/targets/bmv2/compiler_result.h
1/*
2 * SPDX-FileCopyrightText: 2024 The P4 Language Consortium
3 *
4 * SPDX-License-Identifier: Apache-2.0
5 */
6
7#ifndef BACKENDS_P4TOOLS_MODULES_TESTGEN_TARGETS_BMV2_COMPILER_RESULT_H_
8#define BACKENDS_P4TOOLS_MODULES_TESTGEN_TARGETS_BMV2_COMPILER_RESULT_H_
9
10#include "backends/p4tools/common/compiler/midend.h"
11#include "backends/p4tools/common/lib/variables.h"
12#include "control-plane/p4RuntimeSerializer.h"
13#include "frontends/common/options.h"
14
15#include "backends/p4tools/modules/testgen/core/compiler_result.h"
16#include "backends/p4tools/modules/testgen/targets/bmv2/map_direct_externs.h"
17#include "backends/p4tools/modules/testgen/targets/bmv2/p4_asserts_parser.h"
18
20
22class BMv2V1ModelCompilerResult : public TestgenCompilerResult {
23 private:
25 P4::P4RuntimeAPI p4runtimeApi;
26
28 DirectExternMap directExternMap;
29
30 // Vector containing vectors of P4Constraints restrictions and nodes to which these restrictions
31 // apply.
32 ConstraintsVector p4ConstraintsRestrictions;
33
34 public:
35 explicit BMv2V1ModelCompilerResult(TestgenCompilerResult compilerResult,
36 P4::P4RuntimeAPI p4runtimeApi,
37 DirectExternMap directExternMap,
38 ConstraintsVector p4ConstraintsRestrictions);
39
41 [[nodiscard]] const P4::P4RuntimeAPI &getP4RuntimeApi() const;
42
44 // apply.
46
48 [[nodiscard]] const DirectExternMap &getDirectExternMap() const;
49
50 DECLARE_TYPEINFO(BMv2V1ModelCompilerResult, TestgenCompilerResult);
51};
52
53} // namespace P4::P4Tools::P4Testgen::Bmv2
54
55#endif /* BACKENDS_P4TOOLS_MODULES_TESTGEN_TARGETS_BMV2_COMPILER_RESULT_H_ */
const DirectExternMap & getDirectExternMap() const
Definition modules/testgen/targets/bmv2/compiler_result.cpp:45
ConstraintsVector getP4ConstraintsRestrictions() const
Definition modules/testgen/targets/bmv2/compiler_result.cpp:41
const P4::P4RuntimeAPI & getP4RuntimeApi() const
Definition modules/testgen/targets/bmv2/compiler_result.cpp:39
Inja.
Definition targets/bmv2/cmd_stepper.cpp:37
std::map< cstring, const IR::P4Table * > DirectExternMap
Definition bmv2/map_direct_externs.h:25
std::vector< const IR::Expression * > ConstraintsVector
Definition variables.h:23
Definition p4RuntimeSerializer.h:48