P4C
The P4 Compiler
Loading...
Searching...
No Matches
targets/ebpf/program_info.h
1#ifndef TESTGEN_TARGETS_EBPF_PROGRAM_INFO_H_
2#define TESTGEN_TARGETS_EBPF_PROGRAM_INFO_H_
3
4#include <vector>
5
6#include "ir/ir.h"
7#include "lib/cstring.h"
8#include "lib/ordered_map.h"
9
10#include "backends/p4tools/modules/testgen/core/program_info.h"
11#include "backends/p4tools/modules/testgen/lib/continuation.h"
12
13namespace P4::P4Tools::P4Testgen::EBPF {
14
16 private:
20
22 static const IR::Type_Bits PARSER_ERR_BITS;
23
26 std::vector<Continuation::Command> processDeclaration(const IR::Type_Declaration *cstrType,
27 size_t blockIdx) const;
28
29 public:
30 EBPFProgramInfo(const TestgenCompilerResult &compilerResult,
32
34 [[nodiscard]] const ArchSpec &getArchSpec() const override;
35
38 const;
39
40 [[nodiscard]] const IR::StateVariable &getTargetInputPortVar() const override;
41
42 [[nodiscard]] const IR::StateVariable &getTargetOutputPortVar() const override;
43
44 [[nodiscard]] const IR::Expression *dropIsActive() const override;
45
46 [[nodiscard]] const IR::Type_Bits *getParserErrorType() const override;
47
49 static const ArchSpec ARCH_SPEC;
50
51 DECLARE_TYPEINFO(EBPFProgramInfo, ProgramInfo);
52};
53
54} // namespace P4::P4Tools::P4Testgen::EBPF
55
56#endif /* TESTGEN_TARGETS_EBPF_PROGRAM_INFO_H_ */
Specifies a canonical representation of the target pipeline as documented in P4 code.
Definition p4tools/common/lib/arch_spec.h:13
Definition targets/ebpf/program_info.h:15
EBPFProgramInfo(const TestgenCompilerResult &compilerResult, ordered_map< cstring, const IR::Type_Declaration * > inputBlocks)
Definition targets/ebpf/program_info.cpp:33
const IR::StateVariable & getTargetOutputPortVar() const override
Definition targets/ebpf/program_info.cpp:115
const IR::StateVariable & getTargetInputPortVar() const override
Definition targets/ebpf/program_info.cpp:110
static const ArchSpec ARCH_SPEC
Definition targets/ebpf/program_info.h:49
const ordered_map< cstring, const IR::Type_Declaration * > * getProgrammableBlocks() const
Definition targets/ebpf/program_info.cpp:66
const ArchSpec & getArchSpec() const override
Definition targets/ebpf/program_info.cpp:64
const IR::Expression * dropIsActive() const override
Definition targets/ebpf/program_info.cpp:120
Stores target-specific information about a P4 program.
Definition core/program_info.h:21
Extends the CompilerResult with the associated P4RuntimeApi.
Definition modules/testgen/core/compiler_result.h:11
Definition ordered_map.h:32