P4C
The P4 Compiler
Loading...
Searching...
No Matches
targets/ebpf/test_backend.h
1#ifndef BACKENDS_P4TOOLS_MODULES_TESTGEN_TARGETS_EBPF_TEST_BACKEND_H_
2#define BACKENDS_P4TOOLS_MODULES_TESTGEN_TARGETS_EBPF_TEST_BACKEND_H_
3
4#include <cstdint>
5#include <filesystem>
6#include <functional>
7#include <optional>
8#include <string>
9#include <vector>
10
11#include "backends/p4tools/common/lib/model.h"
12#include "backends/p4tools/common/lib/trace_event.h"
13#include "ir/ir.h"
14#include "lib/big_int_util.h"
15
16#include "backends/p4tools/modules/testgen/core/program_info.h"
17#include "backends/p4tools/modules/testgen/core/symbolic_executor/symbolic_executor.h"
18#include "backends/p4tools/modules/testgen/lib/execution_state.h"
19#include "backends/p4tools/modules/testgen/lib/test_backend.h"
20#include "backends/p4tools/modules/testgen/lib/test_spec.h"
21
22namespace P4::P4Tools::P4Testgen::EBPF {
23
25 private:
30 static const int ZERO_PKT_WIDTH = 32;
31 static const big_int ZERO_PKT_VAL;
32 static const big_int ZERO_PKT_MAX;
34 static const std::vector<std::string> SUPPORTED_BACKENDS;
35
36 public:
37 explicit EBPFTestBackend(const ProgramInfo &programInfo,
38 const TestBackendConfiguration &testBackendConfiguration,
40
42 const ExecutionState *executionState, const Model *finalModel,
43 const IR::Expression *outputPacketExpr, const IR::Expression *outputPortExpr,
44 const std::vector<std::reference_wrapper<const TraceEvent>> *programTraces) override;
45
46 const TestSpec *createTestSpec(const ExecutionState *executionState, const Model *finalModel,
47 const TestInfo &testInfo) override;
48};
49
50} // namespace P4::P4Tools::P4Testgen::EBPF
51
52#endif /* BACKENDS_P4TOOLS_MODULES_TESTGEN_TARGETS_EBPF_TEST_BACKEND_H_ */
Definition backends/p4tools/common/lib/model.h:19
Definition targets/ebpf/test_backend.h:24
TestBackEnd::TestInfo produceTestInfo(const ExecutionState *executionState, const Model *finalModel, const IR::Expression *outputPacketExpr, const IR::Expression *outputPortExpr, const std::vector< std::reference_wrapper< const TraceEvent > > *programTraces) override
Definition targets/ebpf/test_backend.cpp:56
const TestSpec * createTestSpec(const ExecutionState *executionState, const Model *finalModel, const TestInfo &testInfo) override
Definition targets/ebpf/test_backend.cpp:80
Represents state of execution after having reached a program point.
Definition execution_state.h:34
Stores target-specific information about a P4 program.
Definition core/program_info.h:21
Definition symbolic_executor.h:21
Definition lib/test_backend.h:23
SymbolicExecutor & symbex
Definition lib/test_backend.h:43
Definition lib/test_backend.h:71
Definition lib/test_spec.h:296
Definition test_backend_configuration.h:16