P4C
The P4 Compiler
Loading...
Searching...
No Matches
targets/tofino/tofino2/cmd_stepper.h
1/*******************************************************************************
2 * Copyright (C) 2024 Intel Corporation
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing,
11 * software distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions
14 * and limitations under the License.
15 *
16 *
17 * SPDX-License-Identifier: Apache-2.0
18 ******************************************************************************/
19
20#ifndef BACKENDS_P4TOOLS_MODULES_TESTGEN_TARGETS_TOFINO_TOFINO2_CMD_STEPPER_H_
21#define BACKENDS_P4TOOLS_MODULES_TESTGEN_TARGETS_TOFINO_TOFINO2_CMD_STEPPER_H_
22
23#include <map>
24#include <optional>
25#include <string>
26
27#include "ir/ir.h"
28#include "ir/solver.h"
29
30#include "backends/p4tools/modules/testgen/core/program_info.h"
31#include "backends/p4tools/modules/testgen/core/small_step/cmd_stepper.h"
32#include "backends/p4tools/modules/testgen/lib/continuation.h"
33#include "backends/p4tools/modules/testgen/lib/execution_state.h"
34#include "backends/p4tools/modules/testgen/targets/tofino/tofino2/program_info.h"
35
36namespace P4::P4Tools::P4Testgen::Tofino {
37
38class JBayCmdStepper : public CmdStepper {
39 protected:
40 std::string getClassName() override { return "JBayCmdStepper"; }
41
42 const JBayProgramInfo &getProgramInfo() const override;
43
44 std::optional<const Constraint *> startParserImpl(const IR::P4Parser *parser,
45 ExecutionState &nextState) const override;
46
47 void initializeTargetEnvironment(ExecutionState &nextState) const override;
48
49 std::map<Continuation::Exception, Continuation> getExceptionHandlers(
50 const IR::P4Parser *parser, Continuation::Body normalContinuation,
51 const ExecutionState &nextState) const override;
52
53 public:
55};
56
57} // namespace P4::P4Tools::P4Testgen::Tofino
58
59#endif /* BACKENDS_P4TOOLS_MODULES_TESTGEN_TARGETS_TOFINO_TOFINO2_CMD_STEPPER_H_ */
Provides a higher-level interface for an SMT solver.
Definition solver.h:24
ExecutionState & state
The state being evaluated.
Definition abstract_stepper.h:49
const ProgramInfo & programInfo
Target-specific information about the P4 program being evaluated.
Definition abstract_stepper.h:46
A continuation body is a list of commands.
Definition continuation.h:129
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 targets/tofino/tofino2/cmd_stepper.h:38
void initializeTargetEnvironment(ExecutionState &nextState) const override
Definition targets/tofino/tofino2/cmd_stepper.cpp:49
std::optional< const Constraint * > startParserImpl(const IR::P4Parser *parser, ExecutionState &nextState) const override
Definition targets/tofino/tofino2/cmd_stepper.cpp:157
std::string getClassName() override
Definition targets/tofino/tofino2/cmd_stepper.h:40
std::map< Continuation::Exception, Continuation > getExceptionHandlers(const IR::P4Parser *parser, Continuation::Body normalContinuation, const ExecutionState &nextState) const override
Definition targets/tofino/tofino2/cmd_stepper.cpp:238
Definition targets/tofino/tofino2/program_info.h:35
Definition phv/solver/action_constraint_solver.cpp:33