19#ifndef BACKENDS_TOFINO_BF_P4C_PHV_PRAGMA_PHV_PRAGMAS_H_
20#define BACKENDS_TOFINO_BF_P4C_PHV_PRAGMA_PHV_PRAGMAS_H_
22#include "backends/tofino/bf-p4c/bf-p4c-options.h"
23#include "backends/tofino/bf-p4c/phv/pragma/pa_alias.h"
24#include "backends/tofino/bf-p4c/phv/pragma/pa_atomic.h"
25#include "backends/tofino/bf-p4c/phv/pragma/pa_byte_pack.h"
26#include "backends/tofino/bf-p4c/phv/pragma/pa_container_size.h"
27#include "backends/tofino/bf-p4c/phv/pragma/pa_container_type.h"
28#include "backends/tofino/bf-p4c/phv/pragma/pa_deparser_zero.h"
29#include "backends/tofino/bf-p4c/phv/pragma/pa_mutually_exclusive.h"
30#include "backends/tofino/bf-p4c/phv/pragma/pa_no_init.h"
31#include "backends/tofino/bf-p4c/phv/pragma/pa_no_overlay.h"
32#include "backends/tofino/bf-p4c/phv/pragma/pa_no_pack.h"
33#include "backends/tofino/bf-p4c/phv/pragma/pa_solitary.h"
40constexpr const char *NOT_PARSED =
"not_parsed";
41constexpr const char *NOT_DEPARSED =
"not_deparsed";
42constexpr const char *DISABLE_DEPARSE_ZERO =
"pa_disable_deparse_0_optimization";
50 unsigned &expr_index,
unsigned &required_args,
51 const IR::StringLiteral *&pipe_arg,
52 const IR::StringLiteral *&gress_arg);
54 static bool checkNumberArgs(
const IR::Annotation *annotation,
unsigned required_args,
55 const unsigned min_required_args,
bool exact_number_of_args,
58 const IR::StringLiteral *pipe_arg);
81 const PragmaSolitary &pa_solitary()
const {
return pa_solitary_i; }
84 const PragmaAtomic &pa_atomic()
const {
return pa_atomic_i; }
87 const PragmaNoOverlay &pa_no_overlay()
const {
return pa_no_overlay_i; }
93 const PragmaNoInit &pa_no_init()
const {
return pa_no_init_i; }
99 const PragmaNoPack &pa_no_pack()
const {
return pa_no_pack_i; }
102 const PragmaBytePack &pa_byte_pack()
const {
return pa_byte_pack_i; }
107 pa_mutually_exclusive_i(phv),
110 pa_no_overlay_i(phv),
111 pa_container_type_i(phv),
113 pa_deparser_zero_i(phv),
115 pa_byte_pack_i(phv) {
117 &pa_container_sizes_i,
118 &pa_mutually_exclusive_i,
122 &pa_container_type_i,
131 : pa_container_sizes_i(phv, container_size_constr),
132 pa_mutually_exclusive_i(phv),
135 pa_no_overlay_i(phv),
136 pa_container_type_i(phv),
138 pa_deparser_zero_i(phv),
139 pa_no_pack_i(phv, no_pack_constr),
140 pa_byte_pack_i(phv) {
142 &pa_container_sizes_i,
143 &pa_mutually_exclusive_i,
147 &pa_container_type_i,
Definition ir/pass_manager.h:40
Definition ordered_map.h:32
Definition ordered_set.h:32
Definition phv_pragmas.h:46
static bool checkStringLiteralArgs(const IR::Vector< IR::Expression > &exprs)
Definition phv_pragmas.cpp:76
static bool checkPipeApplication(const IR::Annotation *annotation, const IR::BFN::Pipe *pipe, const IR::StringLiteral *pipe_arg)
Definition phv_pragmas.cpp:130
static bool checkNumberArgs(const IR::Annotation *annotation, unsigned required_args, const unsigned min_required_args, bool exact_number_of_args, cstring pragma_name, cstring pragma_args_wo_pipe)
Definition phv_pragmas.cpp:97
static void reportNoMatchingPHV(const IR::BFN::Pipe *pipe, const IR::Expression *expr, cstring field_name=""_cs)
Definition phv_pragmas.cpp:146
static bool gressValid(cstring gress)
Definition phv_pragmas.cpp:22
static bool determinePipeGressArgs(const IR::Vector< IR::Expression > &exprs, unsigned &expr_index, unsigned &required_args, const IR::StringLiteral *&pipe_arg, const IR::StringLiteral *&gress_arg)
Definition phv_pragmas.cpp:34
Definition phv_fields.h:1095
Definition pa_atomic.h:30
Definition pa_byte_pack.h:39
Definition pa_container_size.h:39
Definition pa_container_type.h:35
Definition pa_deparser_zero.h:30
Definition pa_mutually_exclusive.h:37
Definition pa_no_overlay.h:33
Definition pa_no_pack.h:28
Definition pa_solitary.h:27
Adds the no_init pragma to the specified fields with the specified gress.
Definition pa_no_init.h:35
TODO: this is not really specific to BMV2, it should reside somewhere else.
Definition applyOptionsPragmas.cpp:24
The namespace encapsulating PHV-related stuff.
Definition gateway.h:32