P4C
The P4 Compiler
Loading...
Searching...
No Matches
finalize_mau_pred_deps_power.h
1
19#ifndef BF_P4C_MAU_FINALIZE_MAU_PRED_DEPS_POWER_H_
20#define BF_P4C_MAU_FINALIZE_MAU_PRED_DEPS_POWER_H_
21
22#include <map>
23#include <ostream>
24
25#include "backends/tofino/bf-p4c/bf-p4c-options.h"
26#include "backends/tofino/bf-p4c/ir/gress.h"
27#include "backends/tofino/bf-p4c/mau/build_power_graph.h"
28#include "backends/tofino/bf-p4c/mau/determine_power_usage.h"
29#include "backends/tofino/bf-p4c/mau/jbay_next_table.h"
30#include "backends/tofino/bf-p4c/mau/mau_power.h"
31#include "backends/tofino/bf-p4c/mau/table_dependency_graph.h"
32#include "backends/tofino/bf-p4c/phv/phv_fields.h"
33#include "ir/pass_manager.h"
34
35namespace MauPower {
36
37class MauFeatures;
38
48 public:
50 const NextTable *next_table_properties, const BFN_Options &options);
51 std::ostream &emit_stage_asm(std::ostream &out, gress_t g, int stage) const;
52 bool requires_stage_asm(gress_t g, int stage) const;
53
54 private:
55 // inputs
56 const PhvInfo &phv_;
57 DependencyGraph &dep_graph_;
58 const NextTable *next_table_properties_;
59 const BFN_Options &options_;
60
61 // derived
62 MauFeatures *mau_features_;
63 // flag indicating if table placement used more stages than available in the device.
64 bool exceeds_stages_ = false;
65 // map from match table UniqueId to tuple of memory accesses
66 // A match table will also include any attached table's memory accesses used.
67 std::map<UniqueId, PowerMemoryAccess> table_memory_access_ = {};
68
69 // Per-gress graphs collected that will be walked to estimate power usage and compute MPR.
70 BuildPowerGraph *graphs_ = nullptr;
71 // Map from gress to MAU MPR settings.
72 std::map<gress_t, MprSettings *> mpr_settings_ = {};
73};
74
75} // end namespace MauPower
76
77#endif /* BF_P4C_MAU_FINALIZE_MAU_PRED_DEPS_POWER_H_ */
Definition bf-p4c-options.h:28
Definition build_power_graph.h:38
Definition finalize_mau_pred_deps_power.h:47
Definition mau_power.h:64
Definition next_table.h:26
Definition ir/pass_manager.h:40
Definition phv_fields.h:1095
Definition mau/asm_output.h:39
Definition table_dependency_graph.h:52