P4C
The P4 Compiler
Loading...
Searching...
No Matches
check_clot_groups.h
1
19#ifndef BACKENDS_TOFINO_BF_P4C_PARDE_CLOT_CHECK_CLOT_GROUPS_H_
20#define BACKENDS_TOFINO_BF_P4C_PARDE_CLOT_CHECK_CLOT_GROUPS_H_
21
22#include <iostream>
23
24#include "clot_info.h"
25#include "parde/parde_visitor.h"
26
28 const PhvInfo &phv;
29 const ClotInfo &clot;
30 bool preorder(const IR::BFN::AbstractDeparser *);
31 bool preorder(const IR::BFN::EmitField *);
32 void postorder(const IR::BFN::AbstractDeparser *);
33
34 unsigned DEPARSER_CHUNK_SIZE;
35 unsigned DEPARSER_CHUNKS_PER_GROUP;
36 unsigned DEPARSER_CHUNK_GROUPS;
37 unsigned DEPARSER_CLOTS_PER_GROUP;
38
39 struct fde_span {
40 const Clot *clot = nullptr; // nullptr for no clot/data from PHV
41 unsigned size = 0; // in bits
42 unsigned chunk = 0;
43 fde_span() {}
44 explicit fde_span(const Clot *cl) : clot(cl) {}
45 };
46 std::vector<fde_span> field_dictionary;
47
48 public:
49 CheckClotGroups(const PhvInfo &phv, const ClotInfo &clot) : phv(phv), clot(clot) {
50 auto &spec = Device::pardeSpec();
51 DEPARSER_CHUNK_SIZE = spec.deparserChunkSize();
52 DEPARSER_CHUNKS_PER_GROUP = spec.deparserChunkGroupSize();
53 DEPARSER_CHUNK_GROUPS = spec.numDeparserChunkGroups();
54 DEPARSER_CLOTS_PER_GROUP = spec.numClotsPerDeparserGroup();
55 }
56};
57
58#endif /* BACKENDS_TOFINO_BF_P4C_PARDE_CLOT_CHECK_CLOT_GROUPS_H_ */
Definition check_clot_groups.h:27
Definition clot.h:57
Definition clot_info.h:41
Definition phv_fields.h:1095
Definition parde_visitor.h:117