P4C
The P4 Compiler
Loading...
Searching...
No Matches
map_direct_externs.h
1#ifndef BACKENDS_P4TOOLS_MODULES_TESTGEN_TARGETS_BMV2_MAP_DIRECT_EXTERNS_H_
2#define BACKENDS_P4TOOLS_MODULES_TESTGEN_TARGETS_BMV2_MAP_DIRECT_EXTERNS_H_
3
4#include <array>
5#include <map>
6#include <optional>
7
8#include "ir/ir.h"
9#include "ir/visitor.h"
10#include "lib/cstring.h"
11
13
19using DirectExternMap = std::map<cstring, const IR::P4Table *>;
20
25 private:
27 static constexpr std::array kTableExternProperties = {"meters", "counters"};
28
30 std::map<cstring, const IR::Declaration_Instance *> declaredExterns;
31
33 DirectExternMap directExternMap;
34
37 std::optional<const IR::Declaration_Instance *> getExternFromTableImplementation(
38 const IR::Property *tableImplementation);
39
40 bool preorder(const IR::Declaration_Instance *declInstance) override;
41 bool preorder(const IR::P4Table *table) override;
42
43 public:
46};
47
48} // namespace P4::P4Tools::P4Testgen::Bmv2
49
50#endif /*BACKENDS_P4TOOLS_MODULES_TESTGEN_TARGETS_BMV2_MAP_DIRECT_EXTERNS_H_*/
Definition visitor.h:400
Definition map_direct_externs.h:24
const DirectExternMap & getDirectExternMap()
Definition map_direct_externs.cpp:65
Inja.
Definition targets/bmv2/cmd_stepper.cpp:33
std::map< cstring, const IR::P4Table * > DirectExternMap
Definition map_direct_externs.h:19