P4C
The P4 Compiler
Loading...
Searching...
No Matches
attached_entries.h
1
19#ifndef BF_P4C_MAU_ATTACHED_ENTRIES_H_
20#define BF_P4C_MAU_ATTACHED_ENTRIES_H_
21
22#include <ostream>
23
24#include "lib/ordered_map.h"
25
26namespace P4 {
27namespace IR {
28namespace MAU {
29class AttachedMemory; // forward declaration
30}
31} // namespace IR
32} // namespace P4
33
34using namespace P4;
35
36// Table Placement needs to communicate infomation about attached tables (how many entries
37// are being placed in the current stage and whether more will be in a later stage) to Memory
38// allocation, IXBar allocation, and table layout. It does so via an attached_entries_t
39// map, which needs to be declared before anything related to any of the above can be
40// declared, so there's no good place to do it. So we declare it here as a stand-alone
41// header that can be included before anything else
42
44 int entries;
45 bool need_more = false; // need more entries in a later stage
46 bool first_stage = true; // no entries are in any earlier stage
48 explicit attached_entries_element_t(int e) : entries(e) {}
49};
50
52
53// not a consistent ordering -- true if first has more of anything than second
54bool operator>(const attached_entries_t &, const attached_entries_t &);
55
56std::ostream &operator<<(std::ostream &, const attached_entries_t &);
57std::ostream &operator<<(std::ostream &, const attached_entries_element_t &);
58
59#endif /* BF_P4C_MAU_ATTACHED_ENTRIES_H_ */
Definition ordered_map.h:32
The namespace encapsulating IR node classes.
TODO: this is not really specific to BMV2, it should reside somewhere else.
Definition applyOptionsPragmas.cpp:24
Definition attached_entries.h:43