19#ifndef BACKENDS_TOFINO_BF_P4C_PHV_ANALYSIS_MUTEX_OVERLAY_H_
20#define BACKENDS_TOFINO_BF_P4C_PHV_ANALYSIS_MUTEX_OVERLAY_H_
24#include "bf-p4c/ir/tofino_write_context.h"
25#include "bf-p4c/mau/mau_visitor.h"
26#include "bf-p4c/parde/parde_visitor.h"
27#include "bf-p4c/parde/parser_info.h"
28#include "bf-p4c/phv/analysis/build_mutex.h"
29#include "bf-p4c/phv/analysis/header_mutex.h"
30#include "bf-p4c/phv/phv_fields.h"
31#include "bf-p4c/phv/pragma/pa_no_pack.h"
33#include "ir/visitor.h"
51 bool preorder(
const IR::MAU::TableSeq *)
override {
return false; }
52 bool preorder(
const IR::BFN::Deparser *)
override {
return false; }
56 :
BuildMutex(phv, neverOverlay, pragma, ignore_field) {}
74 : phv(phv), fieldToStates(fs), parserInfo(pi) {}
88 bool preorder(
const IR::BFN::Deparser *)
override {
return false; }
92 :
BuildMutex(phv, neverOverlay, pragma, ignore_field) {}
103 bool preorder(
const IR::BFN::AliasMember *alias)
override {
104 excludeAliasedField(alias);
108 bool preorder(
const IR::BFN::AliasSlice *alias)
override {
109 excludeAliasedField(alias);
113 void excludeAliasedField(
const IR::Expression *alias);
117 : phv(phv), neverOverlay(neverOverlay) {}
129 profile_t rv = Inspector::init_apply(root);
130 neverOverlay.clear();
134 void end_apply()
override;
138 : phv(phv), neverOverlay(neverOverlay) {}
148 void end_apply()
override;
152 : neverOverlay(neverOverlay), pragma(p) {}
176 return Inspector::init_apply(root);
178 bool preorder(
const IR::MAU::Primitive *prim)
override;
179 void markFields(
const IR::HeaderRef *hr);
183 bool isAddedInMAU(
const PHV::Field *field)
const {
return rv[field->
id]; }
198 actionToWrites.clear();
199 actionToReads.clear();
200 return Inspector::init_apply(root);
203 bool preorder(
const IR::MAU::Table *tbl)
override;
204 bool preorder(
const IR::MAU::Instruction *inst)
override;
205 void end_apply()
override;
213 : phv(p), addedFields(a) {}
224 povToFieldsMap.clear();
225 return Inspector::init_apply(root);
228 bool preorder(
const IR::BFN::EmitField *emit)
override;
229 void end_apply()
override;
254 bool preorder(
const IR::BFN::EmitChecksum *emitChecksum)
override;
258 : phv(p), addedFields(a), use(u) {}
273 bool preorder(
const IR::BFN::EmitChecksum *emitChecksum)
override;
277 : phv(p), addedFields(a), use(u) {}
289 : phv(p), pragma(pr) {}
303 : addedFields(phv), fieldToParserStates(phv) {
304 Visitor *exclude_csum_overlays =
nullptr;
305 if (Device::currentDevice() == Device::TOFINO) {
307 }
else if (Device::currentDevice() == Device::JBAY) {
316 &parserInfo, &fieldToParserStates,
Definition build_mutex.h:63
Definition mutex_overlay.h:46
Definition mutex_overlay.h:249
Definition mutex_overlay.h:268
Definition mutex_overlay.h:218
Definition mutex_overlay.h:186
Definition mutex_overlay.h:60
Definition mutex_overlay.h:144
Definition mutex_overlay.h:280
Definition mau_visitor.h:29
Definition mutex_overlay.h:293
Definition ir/pass_manager.h:40
Definition ordered_set.h:32
Definition phv_fields.h:154
int id
Unique field ID.
Definition phv_fields.h:164
bool pov
True if this Field is a validity bit.
Definition phv_fields.h:253
bool metadata
True if this Field is metadata.
Definition phv_fields.h:209
Definition phv_pragmas.h:46
Definition phv_fields.h:1095
Definition phv_parde_mau_use.h:154
Definition pa_mutually_exclusive.h:37
Definition pa_no_overlay.h:33
The namespace encapsulating PHV-related stuff.
Definition gateway.h:32
Map field to the parser states in which they are extracted or assigned from checksums.
Definition phv_fields.h:1755