37class AssignActionHandle :
public PassManager {
38 class ActionProfileImposedConstraints :
public MauInspector {
40 bool preorder(
const IR::MAU::ActionData *)
override;
41 bool preorder(
const IR::MAU::Table *)
override {
47 ActionProfileImposedConstraints() { visitDagOnce =
false; }
51 HandleAssignments handle_assignments;
55 static constexpr unsigned INIT_ACTION_HANDLE = (0x20 << 24) + 1;
56 unsigned handle_position = 0;
58 AssignActionHandle &self;
61 bool preorder(
const IR::MAU::Action *)
override;
63 unsigned next_handle() {
64 unsigned rv = INIT_ACTION_HANDLE + handle_position;
70 explicit DetermineHandle(AssignActionHandle &aah) : self(aah) {}
74 const AssignActionHandle &self;
75 bool preorder(IR::MAU::Action *)
override;
78 explicit AssignHandle(
const AssignActionHandle &aah) : self(aah) {}
83 std::map<unsigned, const IR::MAU::Action *> unique_handle;
85 bool preorder(
const IR::MAU::Action *)
override;
88 GuaranteeUniqueHandle() {}
91 class ValidateSelectors :
public PassManager {
100 ValidateSelectors &self;
102 bool preorder(
const IR::MAU::Selector *sel)
override;
103 bool preorder(
const IR::MAU::Table *)
override {
109 explicit ValidateKey(ValidateSelectors &s) : self(s) { visitDagOnce =
false; }
112 class SetSymmetricSelectorKeys :
public MauModifier {
113 ValidateSelectors &self;
114 bool preorder(IR::MAU::Table *tbl)
override;
117 explicit SetSymmetricSelectorKeys(ValidateSelectors &s) : self(s) {}
121 explicit ValidateSelectors(
const PhvInfo &phv) : phv(phv) {
122 addPasses({
new ValidateKey(*
this),
new SetSymmetricSelectorKeys(*
this)});
127 explicit AssignActionHandle(
const PhvInfo &phv) {
128 addPasses({
new ValidateSelectors(phv),
new ActionProfileImposedConstraints,
129 new DetermineHandle(*
this),
new AssignHandle(*
this),
new GuaranteeUniqueHandle});
TODO: this is not really specific to BMV2, it should reside somewhere else.
Definition applyOptionsPragmas.cpp:24