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; }
61 const le_bitrange &getRange()
const {
return range; }
83 std::vector<ConstrainedSlice> slices;
90 bool deparsedBottomBits =
false;
92 bool noOverlay =
false;
93 bool exactContainer =
false;
95 bool sameContainerGroup =
false;
101 const cstring &getName()
const {
return name; }
104 std::vector<ConstrainedSlice> &getSlices() {
return slices; }
105 const std::vector<ConstrainedSlice> &getSlices()
const {
return slices; }
120 void setBottomBits(
bool b);
121 bool hasBottomBits()
const {
return deparsedBottomBits; }
123 void setNoSplit(
bool b);
124 bool hasNoSplit()
const {
return noSplit; }
126 void setNoOverlay(
bool b);
127 bool hasNoOverlay()
const {
return noOverlay; }
129 void setExactContainer(
bool b);
130 bool hasExactContainer()
const {
return exactContainer; }
132 void setNoHoles(
bool b);
133 bool hasNoHoles()
const {
return noHoles; }
135 void setSameContainerGroup(
bool b);
136 bool hasSameContainerGroup() {
return sameContainerGroup; }
139typedef std::map<cstring, ConstrainedField> ConstrainedFieldMap;
147 static ConstrainedFieldMap buildMap(
const PhvInfo &phv,
148 const std::list<PHV::SuperCluster *> &groups);
Class representing PHV::Field with constraints and handle for constraint logging. Contains non-group ...
Definition constrained_fields.h:80
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:145
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