P4C
The P4 Compiler
Loading...
Searching...
No Matches
targets/pna/test_backend.h
1/*
2 * SPDX-FileCopyrightText: 2023 Intel Corporation
3 *
4 * SPDX-License-Identifier: Apache-2.0
5 */
6
7#ifndef BACKENDS_P4TOOLS_MODULES_TESTGEN_TARGETS_PNA_TEST_BACKEND_H_
8#define BACKENDS_P4TOOLS_MODULES_TESTGEN_TARGETS_PNA_TEST_BACKEND_H_
9
10#include <cstdint>
11#include <filesystem>
12#include <functional>
13#include <optional>
14#include <set>
15#include <string>
16#include <vector>
17
18#include "backends/p4tools/common/lib/model.h"
19#include "backends/p4tools/common/lib/trace_event.h"
20#include "ir/ir.h"
21
22#include "backends/p4tools/modules/testgen/core/program_info.h"
23#include "backends/p4tools/modules/testgen/core/symbolic_executor/symbolic_executor.h"
24#include "backends/p4tools/modules/testgen/core/target.h"
25#include "backends/p4tools/modules/testgen/lib/execution_state.h"
26#include "backends/p4tools/modules/testgen/lib/test_backend.h"
27#include "backends/p4tools/modules/testgen/lib/test_spec.h"
28
30
31class PnaTestBackend : public TestBackEnd {
32 private:
34 static const std::set<std::string> SUPPORTED_BACKENDS;
35
36 public:
37 explicit PnaTestBackend(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::Pna
51
52#endif /* BACKENDS_P4TOOLS_MODULES_TESTGEN_TARGETS_PNA_TEST_BACKEND_H_ */
Definition backends/p4tools/common/lib/model.h:24
Represents state of execution after having reached a program point.
Definition execution_state.h:40
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/pna/test_backend.cpp:65
const TestSpec * createTestSpec(const ExecutionState *executionState, const Model *finalModel, const TestInfo &testInfo) override
Definition targets/pna/test_backend.cpp:74
Stores target-specific information about a P4 program.
Definition core/program_info.h:27
Definition symbolic_executor.h:27
SymbolicExecutor & symbex
Definition lib/test_backend.h:49
Definition lib/test_backend.h:77
Definition lib/test_spec.h:303
Inja.
Definition pna/backend/metadata/metadata.cpp:28
Definition test_backend_configuration.h:22