P4C
The P4 Compiler
Loading...
Searching...
No Matches
validate_allocation.h
1
19#ifndef BF_P4C_PHV_VALIDATE_ALLOCATION_H_
20#define BF_P4C_PHV_VALIDATE_ALLOCATION_H_
21
22#include "bf-p4c/phv/alloc_setting.h"
23#include "bf-p4c/phv/fieldslice_live_range.h"
24#include "ir/ir.h"
25#include "ir/visitor.h"
26#include "lib/symbitmatrix.h"
27#include "phv_fields.h"
28
29class PhvInfo;
30class ClotInfo;
31
32namespace PHV {
33
47class ValidateAllocation final : public Inspector {
48 public:
49 ValidateAllocation(PhvInfo &phv, const ClotInfo &clot,
50 const PHV::FieldSliceLiveRangeDB &physical_liverange,
51 const PHV::AllocSetting &setting)
52 : phv(phv), clot(clot), physical_liverange(physical_liverange), setting(setting) {}
53
54 void set_physical_liverange_overlay(bool enable) { physical_liverange_overlay = enable; }
55
56 private:
57 PhvInfo &phv;
58 const ClotInfo &clot;
59 const PHV::FieldSliceLiveRangeDB &physical_liverange;
60 bool physical_liverange_overlay = false;
61 const PHV::AllocSetting &setting;
62
63 SymBitMatrix mutually_exclusive_field_ids;
64 profile_t init_apply(const IR::Node *root) override;
65 bool preorder(const IR::BFN::Digest *digest) override;
66 bool preorder(const IR::BFN::Pipe *pipe) override;
67 bool preorder(const IR::BFN::DeparserParameter *dp) override;
68
70 size_t getPOVContainerBytes(gress_t gress) const;
71};
72
73} // namespace PHV
74
75#endif /* BF_P4C_PHV_VALIDATE_ALLOCATION_H_ */
Definition clot_info.h:41
Definition node.h:95
Definition visitor.h:400
Definition symbitmatrix.h:27
Definition visitor.h:78
Definition fieldslice_live_range.h:152
Definition validate_allocation.h:47
Definition phv_fields.h:1095
The namespace encapsulating PHV-related stuff.
Definition gateway.h:32
Definition alloc_setting.h:25