19#ifndef BACKENDS_TOFINO_BF_P4C_LOGGING_CONSTRAINED_FIELDS_H_
20#define BACKENDS_TOFINO_BF_P4C_LOGGING_CONSTRAINED_FIELDS_H_
24#include "backends/tofino/bf-p4c/phv/phv_fields.h"
25#include "backends/tofino/bf-p4c/phv/utils/utils.h"
26#include "phv_schema.h"
33 using Constraint = Logging::Phv_Schema_Logger::Constraint;
36 Constraint *logger =
nullptr;
39 Constraint *getLogger() {
return logger; }
41 bool hasLoggedConstraints()
const {
return logger->get_base_constraint().size() > 0; }
62 const le_bitrange &getRange()
const {
return range; }
84 std::vector<ConstrainedSlice> slices;
91 bool deparsedBottomBits =
false;
93 bool noOverlay =
false;
94 bool exactContainer =
false;
96 bool sameContainerGroup =
false;
102 const cstring &getName()
const {
return name; }
105 std::vector<ConstrainedSlice> &getSlices() {
return slices; }
106 const std::vector<ConstrainedSlice> &getSlices()
const {
return slices; }
121 void setBottomBits(
bool b);
122 bool hasBottomBits()
const {
return deparsedBottomBits; }
124 void setNoSplit(
bool b);
125 bool hasNoSplit()
const {
return noSplit; }
127 void setNoOverlay(
bool b);
128 bool hasNoOverlay()
const {
return noOverlay; }
130 void setExactContainer(
bool b);
131 bool hasExactContainer()
const {
return exactContainer; }
133 void setNoHoles(
bool b);
134 bool hasNoHoles()
const {
return noHoles; }
136 void setSameContainerGroup(
bool b);
137 bool hasSameContainerGroup() {
return sameContainerGroup; }
140typedef std::map<cstring, ConstrainedField> ConstrainedFieldMap;
148 static ConstrainedFieldMap buildMap(
const PhvInfo &phv,
149 const std::list<PHV::SuperCluster *> &groups);
Class representing PHV::Field with constraints and handle for constraint logging. Contains non-group ...
Definition constrained_fields.h:81
void setSolitary(const Constraints::SolitaryConstraint &solitary)
Constraints.
Definition constrained_fields.cpp:58
Initialize map of constrained fields by information present in PhvInfo and their slices based on slic...
Definition constrained_fields.h:146
Class representing FieldSlice with constraints, which has handle for constraint logging....
Definition constrained_fields.h:50
ConstrainedSlice(const ConstrainedField &parent, le_bitrange range)
Definition constrained_fields.cpp:23
void setAlignment(const Constraints::AlignmentConstraint &alignment)
Constraints.
Definition constrained_fields.cpp:32
bool operator<(const ConstrainedSlice &other) const override
Comparators implementation for LiftCompare.
Definition constrained_fields.cpp:40
Definition constraints.h:149
Definition constraints.h:203
Definition constraints.h:90
Definition constraints.h:56
Class with handle for logging constraints.
Definition constrained_fields.h:31
Definition phv_fields.h:1095