P4C
The P4 Compiler
Loading...
Searching...
No Matches
shared_table_stepper.h
1#ifndef BACKENDS_P4TOOLS_MODULES_TESTGEN_TARGETS_PNA_SHARED_TABLE_STEPPER_H_
2#define BACKENDS_P4TOOLS_MODULES_TESTGEN_TARGETS_PNA_SHARED_TABLE_STEPPER_H_
3
4#include <vector>
5
6#include "ir/ir.h"
7
8#include "backends/p4tools/modules/testgen/core/small_step/table_stepper.h"
9#include "backends/p4tools/modules/testgen/lib/execution_state.h"
10#include "backends/p4tools/modules/testgen/lib/test_spec.h"
11#include "backends/p4tools/modules/testgen/targets/pna/shared_expr_stepper.h"
12#include "backends/p4tools/modules/testgen/targets/pna/test_spec.h"
13
15
17 protected:
20
23
26 void evalTableActionProfile(const std::vector<const IR::ActionListElement *> &tableActionList);
27
30 void evalTableActionSelector(const std::vector<const IR::ActionListElement *> &tableActionList);
31
38 enum class TableImplementation { standard, selector, profile, constant, skip };
39
44
47
49 std::vector<const IR::Expression *> actionSelectorKeys;
50
52 bool addProfileToState = false;
53
55 TableImplementation implementaton = TableImplementation::standard;
57
58 const IR::Expression *computeTargetMatchType(const TableUtils::KeyProperties &keyProperties,
59 TableMatchMap *matches,
60 const IR::Expression *hitCondition) override;
61
63 const std::vector<const IR::ActionListElement *> &tableActionList) override;
64
65 void evalTargetTable(
66 const std::vector<const IR::ActionListElement *> &tableActionList) override;
67
68 public:
69 explicit SharedPnaTableStepper(SharedPnaExprStepper *stepper, const IR::P4Table *table);
70};
71
72} // namespace P4::P4Tools::P4Testgen::Pna
73
74#endif /* BACKENDS_P4TOOLS_MODULES_TESTGEN_TARGETS_PNA_SHARED_TABLE_STEPPER_H_ */
Definition targets/pna/test_spec.h:94
Definition targets/pna/test_spec.h:128
Definition shared_expr_stepper.h:13
Definition shared_table_stepper.h:16
void evalTableActionProfile(const std::vector< const IR::ActionListElement * > &tableActionList)
Definition shared_table_stepper.cpp:87
bool checkForActionSelector()
Check whether the table has an action selector implementation.
Definition shared_table_stepper.cpp:295
const IR::Expression * computeTargetMatchType(const TableUtils::KeyProperties &keyProperties, TableMatchMap *matches, const IR::Expression *hitCondition) override
Definition shared_table_stepper.cpp:37
void checkTargetProperties(const std::vector< const IR::ActionListElement * > &tableActionList) override
Definition shared_table_stepper.cpp:338
const PnaDpdkActionProfile * actionProfile
The table has an action profile associated with it.
Definition shared_table_stepper.h:43
std::vector< const IR::Expression * > actionSelectorKeys
The selector keys that are part of the selector hash that is calculated.
Definition shared_table_stepper.h:49
void evalTableActionSelector(const std::vector< const IR::ActionListElement * > &tableActionList)
Definition shared_table_stepper.cpp:164
TableImplementation implementaton
The type of the table implementation.
Definition shared_table_stepper.h:55
bool checkForActionProfile()
Check whether the table has an action profile implementation.
Definition shared_table_stepper.cpp:253
TableImplementation
Definition shared_table_stepper.h:38
void evalTargetTable(const std::vector< const IR::ActionListElement * > &tableActionList) override
Definition shared_table_stepper.cpp:368
const PnaDpdkActionSelector * actionSelector
The table has an action selector associated with it.
Definition shared_table_stepper.h:46
bool addProfileToState
The current execution state does not have this profile added to it yet.
Definition shared_table_stepper.h:52
Shared PNA table properties.
Definition shared_table_stepper.h:41
Implements small-step operational semantics for tables.
Definition core/small_step/table_stepper.h:20
const IR::P4Table * table
The table for this particular stepper.
Definition core/small_step/table_stepper.h:26
ExprStepper * stepper
Reference to the calling expression stepper.
Definition core/small_step/table_stepper.h:23
Inja.
Definition pna/backend/metadata/metadata.cpp:24
KeyProperties define properties of table keys that are useful for execution.
Definition table_utils.h:10