P4C
The P4 Compiler
Loading...
Searching...
No Matches
table.h
1/*
2 * SPDX-FileCopyrightText: 2024 The P4 Language Consortium
3 *
4 * SPDX-License-Identifier: Apache-2.0
5 */
6
7#ifndef BACKENDS_P4TOOLS_MODULES_SMITH_COMMON_TABLE_H_
8#define BACKENDS_P4TOOLS_MODULES_SMITH_COMMON_TABLE_H_
9#include <cstddef>
10
11#include "backends/p4tools/modules/smith/common/generator.h"
12#include "ir/ir.h"
13#include "lib/cstring.h"
14
15namespace P4::P4Tools::P4Smith {
16
17class TableGenerator : public Generator {
18 public:
19 explicit TableGenerator(const SmithTarget &target) : Generator(target) {}
20
21 virtual ~TableGenerator() = default;
22
23 virtual IR::P4Table *genTableDeclaration();
24
25 virtual IR::TableProperties *genTablePropertyList();
26
27 virtual IR::KeyElement *genKeyElement(IR::ID match_kind);
28
29 virtual IR::Key *genKeyElementList(size_t len);
30
31 virtual IR::Property *genKeyProperty();
32
33 virtual IR::MethodCallExpression *genTableActionCall(cstring method_name,
34 const IR::ParameterList &params);
35
36 virtual IR::ActionList *genActionList(size_t len);
37
38 IR::Property *genActionListProperty();
39};
40
41} // namespace P4::P4Tools::P4Smith
42
43#endif /* BACKENDS_P4TOOLS_MODULES_SMITH_COMMON_TABLE_H_ */
Definition p4tools/modules/smith/core/target.h:23
Definition cstring.h:85
Definition id.h:28