20#ifndef TESTGEN_TARGETS_TOFINO_SHARED_PROGRAM_INFO_H_
21#define TESTGEN_TARGETS_TOFINO_SHARED_PROGRAM_INFO_H_
25#include "backends/p4tools/modules/testgen/core/program_info.h"
26#include "backends/p4tools/modules/testgen/targets/tofino/compiler_result.h"
28namespace P4::P4Tools::P4Testgen::Tofino {
30class TofinoSharedProgramInfo :
public ProgramInfo {
32 using PipeInfo =
struct {
39 const std::vector<PipeInfo>
pipes;
52 std::vector<PipeInfo> inputPipes,
57 gress_t
getGress(
const IR::Type_Declaration *decl)
const;
60 size_t getPipeIdx(
const IR::Type_Declaration *decl)
const;
63 [[nodiscard]]
bool isMultiPipe()
const;
69 [[nodiscard]]
const std::vector<PipeInfo> *
getPipes()
const;
72 [[nodiscard]]
virtual std::vector<std::vector<Continuation::Command>>
ingressCmds()
const = 0;
75 [[nodiscard]]
virtual std::vector<std::vector<Continuation::Command>>
egressCmds()
const = 0;
81 [[nodiscard]]
virtual const IR::Expression *getValidPortConstraint(
82 const IR::StateVariable &portVar)
const = 0;
84 [[nodiscard]]
virtual std::optional<const IR::Expression *> getPipePortRangeConstraint(
85 const IR::StateVariable &portVar,
size_t pipeIdx)
const = 0;
87 IR::StateVariable getParserParamVar(
const IR::P4Parser *parser,
const IR::Type *type,
88 size_t paramIndex,
cstring paramLabel)
const;
90 [[nodiscard]]
const IR::Type_Bits *getParserErrorType()
const override;
94 DECLARE_TYPEINFO(TofinoSharedProgramInfo, ProgramInfo);
The Declaration interface, representing objects with names.
Definition declaration.h:26
Definition ordered_map.h:32