20#ifndef BACKENDS_P4TOOLS_MODULES_TESTGEN_TARGETS_TOFINO_SHARED_TABLE_STEPPER_H_
21#define BACKENDS_P4TOOLS_MODULES_TESTGEN_TARGETS_TOFINO_SHARED_TABLE_STEPPER_H_
27#include "lib/cstring.h"
29#include "backends/p4tools/modules/testgen/core/small_step/table_stepper.h"
30#include "backends/p4tools/modules/testgen/lib/execution_state.h"
31#include "backends/p4tools/modules/testgen/lib/test_spec.h"
32#include "backends/p4tools/modules/testgen/targets/tofino/shared_expr_stepper.h"
33#include "backends/p4tools/modules/testgen/targets/tofino/test_spec.h"
35namespace P4::P4Tools::P4Testgen::Tofino {
37class TofinoTableStepper :
public TableStepper {
45 enum class TableImplementation { standard, selector, profile, constant, skip };
48 struct TofinoProperties {
56 std::vector<const IR::Expression *> actionSelectorKeys;
59 bool addProfileToState =
false;
62 TableImplementation implementaton;
66 bool checkForActionProfile();
69 bool checkForActionSelector();
73 void evalTableActionProfile(
const std::vector<const IR::ActionListElement *> &tableActionList);
77 void evalTableActionSelector(
const std::vector<const IR::ActionListElement *> &tableActionList);
81 TableMatchMap *matches,
82 const IR::Expression *hitCondition)
override;
85 const std::vector<const IR::ActionListElement *> &tableActionList)
override;
88 const std::vector<const IR::ActionListElement *> &tableActionList)
override;