P4C
The P4 Compiler
Loading...
Searching...
No Matches
arch/fromv1.0/stateful_alu.h
1
19#ifndef BACKENDS_TOFINO_BF_P4C_ARCH_FROMV1_0_STATEFUL_ALU_H_
20#define BACKENDS_TOFINO_BF_P4C_ARCH_FROMV1_0_STATEFUL_ALU_H_
21
22#include "frontends/p4-14/fromv1.0/converters.h"
23
24namespace P4 {
25namespace P4V1 {
26
28 bool has_stateful_alu = false;
29 struct reg_info {
30 const IR::Register *reg = nullptr;
31 const IR::Type::Bits *utype = nullptr; // salu alu type
32 const IR::Type *rtype = nullptr; // layout type
33 };
34 std::map<const IR::Register *, reg_info> cache;
35 const IR::ActionProfile *getSelectorProfile(P4V1::ProgramStructure *,
36 const IR::Declaration_Instance *);
37 reg_info getRegInfo(P4V1::ProgramStructure *, const IR::Declaration_Instance *,
39 const IR::Type::Bits *findUType(const IR::Declaration_Instance *, const IR::Type ** = nullptr);
41 static StatefulAluConverter singleton;
42
43 public:
44 const IR::Type_Extern *convertExternType(P4V1::ProgramStructure *, const IR::Type_Extern *,
45 cstring) override;
46 const IR::Declaration_Instance *convertExternInstance(
47 P4V1::ProgramStructure *, const IR::Declaration_Instance *, cstring,
49 const IR::Statement *convertExternCall(P4V1::ProgramStructure *,
50 const IR::Declaration_Instance *,
51 const IR::Primitive *) override;
52};
53
54} // namespace P4V1
55} // namespace P4
56
57#endif /* BACKENDS_TOFINO_BF_P4C_ARCH_FROMV1_0_STATEFUL_ALU_H_ */
Definition node.h:52
Definition vector.h:59
Definition converters.h:97
Information about the structure of a P4-14 program, used to convert it to a P4-16 program.
Definition frontends/p4-14/fromv1.0/programStructure.h:45
Definition arch/fromv1.0/stateful_alu.h:27
Definition cstring.h:85
TODO: this is not really specific to BMV2, it should reside somewhere else.
Definition applyOptionsPragmas.cpp:24