P4C
The P4 Compiler
Loading...
Searching...
No Matches
p4tools/modules/smith/core/target.h
1
#ifndef BACKENDS_P4TOOLS_MODULES_SMITH_CORE_TARGET_H_
2
#define BACKENDS_P4TOOLS_MODULES_SMITH_CORE_TARGET_H_
3
4
#include <ostream>
5
#include <string>
6
7
#include "backends/p4tools/common/compiler/compiler_target.h"
8
#include "backends/p4tools/modules/smith/common/declarations.h"
9
#include "backends/p4tools/modules/smith/common/expressions.h"
10
#include "backends/p4tools/modules/smith/common/parser.h"
11
#include "backends/p4tools/modules/smith/common/statements.h"
12
#include "backends/p4tools/modules/smith/common/table.h"
13
#include "ir/ir.h"
14
15
namespace
P4::P4Tools::P4Smith {
16
17
class
SmithTarget
:
public
CompilerTarget
{
18
public
:
20
static
const
SmithTarget
&
get
();
21
24
[[nodiscard]]
virtual
int
writeTargetPreamble
(std::ostream *ostream)
const
= 0;
25
26
[[nodiscard]]
virtual
const
IR::P4Program *generateP4Program()
const
= 0;
27
28
[[nodiscard]]
virtual
DeclarationGenerator
&declarationGenerator()
const
= 0;
29
[[nodiscard]]
virtual
ExpressionGenerator
&expressionGenerator()
const
= 0;
30
[[nodiscard]]
virtual
StatementGenerator
&statementGenerator()
const
= 0;
31
[[nodiscard]]
virtual
ParserGenerator
&parserGenerator()
const
= 0;
32
[[nodiscard]]
virtual
TableGenerator
&tableGenerator()
const
= 0;
33
34
[[nodiscard]]
ICompileContext
*
makeContext
()
const override
;
35
36
protected
:
37
explicit
SmithTarget
(
const
std::string &deviceName,
const
std::string &archName);
38
39
private
:
40
};
41
42
}
// namespace P4::P4Tools::P4Smith
43
44
#endif
/* BACKENDS_P4TOOLS_MODULES_SMITH_CORE_TARGET_H_ */
P4::ICompileContext
Definition
compile_context.h:32
P4::P4Tools::CompilerTarget
Encapsulates the details of invoking the P4 compiler for a target device and architecture.
Definition
compiler_target.h:19
P4::P4Tools::P4Smith::DeclarationGenerator
Definition
declarations.h:13
P4::P4Tools::P4Smith::ExpressionGenerator
Definition
common/expressions.h:48
P4::P4Tools::P4Smith::ParserGenerator
Definition
p4tools/modules/smith/common/parser.h:12
P4::P4Tools::P4Smith::SmithTarget
Definition
p4tools/modules/smith/core/target.h:17
P4::P4Tools::P4Smith::SmithTarget::writeTargetPreamble
virtual int writeTargetPreamble(std::ostream *ostream) const =0
P4::P4Tools::P4Smith::SmithTarget::makeContext
ICompileContext * makeContext() const override
Definition
p4tools/modules/smith/core/target.cpp:15
P4::P4Tools::P4Smith::SmithTarget::get
static const SmithTarget & get()
Definition
p4tools/modules/smith/core/target.cpp:19
P4::P4Tools::P4Smith::StatementGenerator
Definition
statements.h:10
P4::P4Tools::P4Smith::TableGenerator
Definition
table.h:11
backends
p4tools
modules
smith
core
target.h
Generated by
1.12.0