1#ifndef BACKENDS_P4TOOLS_MODULES_TESTGEN_TARGETS_BMV2_TEST_SPEC_H_
2#define BACKENDS_P4TOOLS_MODULES_TESTGEN_TARGETS_BMV2_TEST_SPEC_H_
11#include "backends/p4tools/common/lib/model.h"
12#include "ir/declaration.h"
14#include "lib/cstring.h"
17#include "backends/p4tools/modules/testgen/lib/execution_state.h"
18#include "backends/p4tools/modules/testgen/lib/test_object.h"
19#include "backends/p4tools/modules/testgen/lib/test_spec.h"
20#include "backends/p4tools/modules/testgen/targets/bmv2/constants.h"
33 const IR::Expression *index;
36 const IR::Expression *value;
39 explicit IndexExpression(
const IR::Expression *index,
const IR::Expression *value);
50 [[nodiscard]]
const IR::Expression *
getIndex()
const;
53 [[nodiscard]]
const IR::Expression *
getValue()
const;
56 bool doComplete)
const override;
79 void writeToIndex(
const IR::Expression *index,
const IR::Expression *value);
86 [[nodiscard]]
const IR::Expression *
getValueAtIndex(
const IR::Expression *index)
const;
93 [[nodiscard]] std::map<big_int, std::pair<int, const IR::Constant *>>
unravelMap()
const;
116 bool doComplete)
const override;
136 bool doComplete)
const override;
150 std::vector<std::pair<cstring, std::vector<ActionArg>>> actions;
161 [[nodiscard]]
const std::vector<std::pair<cstring, std::vector<ActionArg>>> *
getActions()
const;
173 bool doComplete)
const override;
202 bool doComplete)
const override;
213 const IR::Expression *sessionId;
219 std::reference_wrapper<const ExecutionState> clonedState;
222 std::optional<int> preserveIndex;
228 std::optional<int> preserveIndex);
233 bool doComplete)
const override;
236 [[nodiscard]]
const IR::Expression *
getSessionId()
const;
256 const IR::Expression *sessionId;
259 const IR::Expression *clonePort;
272 bool doComplete)
const override;
275 [[nodiscard]]
const IR::Expression *
getSessionId()
const;
278 [[nodiscard]]
const IR::Expression *
getClonePort()
const;
301 std::map<cstring, const IR::Literal *> metadataFields;
309 bool doComplete)
const override;
312 [[nodiscard]]
const std::map<cstring, const IR::Literal *> &
getMetadataFields()
const;
330 const IR::Expression *value;
336 explicit Optional(
const IR::KeyElement *key,
const IR::Expression *value,
bool addMatch);
355 const IR::Expression *low;
358 const IR::Expression *high;
361 explicit Range(
const IR::KeyElement *key,
const IR::Expression *low,
362 const IR::Expression *high);
364 [[nodiscard]]
const Range *
evaluate(
const Model &model,
bool doComplete)
const override;
The Declaration interface, representing objects with names.
Definition declaration.h:26