-
Notifications
You must be signed in to change notification settings - Fork 1
/
flay.h
31 lines (22 loc) · 1.1 KB
/
flay.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
#ifndef BACKENDS_P4TOOLS_MODULES_FLAY_FLAY_H_
#define BACKENDS_P4TOOLS_MODULES_FLAY_FLAY_H_
#include "backends/p4tools/common/p4ctool.h"
#include "backends/p4tools/modules/flay/core/specialization/flay_service.h"
#include "backends/p4tools/modules/flay/options.h"
namespace P4::P4Tools::Flay {
/// This is main implementation of the P4Flay tool.
class Flay : public AbstractP4cTool<FlayOptions> {
protected:
void registerTarget() override;
int mainImpl(const CompilerResult &compilerResult) override;
public:
virtual ~Flay() = default;
/// Analyse the given program and return an optimized version.
static std::optional<FlayServiceStatisticsMap> optimizeProgram(const std::string &program,
const FlayOptions &flayOptions);
/// Open the program file specified in the compiler options, preprocess it, and return an
/// optimized version.
static std::optional<FlayServiceStatisticsMap> optimizeProgram(const FlayOptions &flayOptions);
};
} // namespace P4::P4Tools::Flay
#endif /* BACKENDS_P4TOOLS_MODULES_FLAY_FLAY_H_ */