30 using GressAssignment = PHV::Allocation::GressAssignment;
31 using ExtractSource = PHV::Allocation::ExtractSource;
32 using ContainerAllocStatus = PHV::Allocation::ContainerAllocStatus;
33 enum class Parity : int8_t { Zero = 0, One = 1, Unspecified = -1 };
35 struct ContainerClass {
39 GressAssignment gress;
40 GressAssignment parser_group_gress;
41 GressAssignment deparser_group_gress;
42 ExtractSource parser_extract_group_source;
46 BUG_CHECK(cstat,
"no allocation status for container %1%", c);
47 is_empty = cstat->alloc_status == ContainerAllocStatus::EMPTY;
48 parity = track_parity ? Parity(c.index() % 2) : Parity::Unspecified;
49 kind = c.type().kind();
51 parser_group_gress = cstat->parserGroupGress;
52 deparser_group_gress = cstat->deparserGroupGress;
53 parser_extract_group_source = cstat->parserExtractGroupSource;
56 bool operator==(
const ContainerClass &o)
const {
return as_tuple() == o.as_tuple(); }
58 bool operator<(
const ContainerClass &o)
const {
return as_tuple() < o.as_tuple(); }
60 std::tuple<bool, Parity,
PHV::Kind, GressAssignment, GressAssignment, GressAssignment,
63 return std::make_tuple(is_empty, parity, kind, gress, parser_group_gress,
64 deparser_group_gress, parser_extract_group_source);
101 return ContainerClass(alloc, c, wideArith || (restrictW0 && c.is(PHV::Size::b8)));
104 std::map<ContainerClass, PHV::Container> equivalenceClasses;
105 std::set<PHV::Container> excluded;
107 bool wideArith =
false;
108 bool wideArithLow =
false;