CIRCT 20.0.0git
Loading...
Searching...
No Matches
RtgToolOptions.h
Go to the documentation of this file.
1//===- RtgToolOptions.h - Configuration Options for rtgtool -----*- C++ -*-===//
2//
3// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4// See https://llvm.org/LICENSE.txt for license information.
5// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6//
7//===----------------------------------------------------------------------===//
8//
9// This header file defines configuration options for the rtgtool.
10//
11//===----------------------------------------------------------------------===//
12
13#ifndef CIRCT_TOOLS_RTGTOOL_RTGTOOLOPTIONS_H
14#define CIRCT_TOOLS_RTGTOOL_RTGTOOLOPTIONS_H
15
16#include "circt/Support/LLVM.h"
17#include "mlir/Pass/PassManager.h"
18#include "llvm/ADT/ArrayRef.h"
19#include "llvm/ADT/SmallVector.h"
20
21namespace circt {
22namespace rtg {
23
24/// The set of options used to control the behavior of the RTG tool.
26public:
28
29 RtgToolOptions(unsigned seed) : seed(seed) {}
30
31 void setOutputFormat(OutputFormat format) { outputFormat = format; }
33
35 this->seed = seed;
36 return *this;
37 }
38 unsigned getSeed() const { return seed; }
39
41 verifyPasses = enable;
42 return *this;
43 }
44 bool getVerifyPasses() const { return verifyPasses; }
45
47 verbosePassExecution = enable;
48 return *this;
49 }
51
52 RtgToolOptions &setUnsupportedInstructions(SmallVector<std::string> &&instr) {
54 return *this;
55 }
56 RtgToolOptions &setUnsupportedInstructions(ArrayRef<std::string> instr) {
57 unsupportedInstructions = SmallVector<std::string>(instr);
58 return *this;
59 }
60 RtgToolOptions &addUnsupportedInstruction(const std::string &instr) {
61 unsupportedInstructions.push_back(instr);
62 return *this;
63 }
64 ArrayRef<std::string> getUnsupportedInstructions() const {
66 }
67
70 return *this;
71 }
72 std::string getUnsupportedInstructionsFile() const {
74 }
75
76private:
78 unsigned seed;
79 bool verifyPasses = true;
81 SmallVector<std::string> unsupportedInstructions;
83};
84
85/// Populates the passes necessary to lower IR with RTG randomization operations
86/// to fully elaborated IR (i.e., IR without random constructs).
87void populateRandomizerPipeline(mlir::PassManager &pm,
88 const RtgToolOptions &options);
89
90} // namespace rtg
91} // namespace circt
92
93#endif // CIRCT_TOOLS_RTGTOOL_RTGTOOLOPTIONS_H
The set of options used to control the behavior of the RTG tool.
OutputFormat getOutputFormat() const
void setOutputFormat(OutputFormat format)
RtgToolOptions & setSeed(unsigned seed)
RtgToolOptions & addUnsupportedInstruction(const std::string &instr)
RtgToolOptions & setUnsupportedInstructionsFile(StringRef filename)
std::string unsupportedInstructionsFile
RtgToolOptions & setVerifyPasses(bool enable)
RtgToolOptions & setVerbosePassExecution(bool enable)
RtgToolOptions & setUnsupportedInstructions(ArrayRef< std::string > instr)
SmallVector< std::string > unsupportedInstructions
ArrayRef< std::string > getUnsupportedInstructions() const
std::string getUnsupportedInstructionsFile() const
bool getVerbosePassExecution() const
RtgToolOptions & setUnsupportedInstructions(SmallVector< std::string > &&instr)
void populateRandomizerPipeline(mlir::PassManager &pm, const RtgToolOptions &options)
Populates the passes necessary to lower IR with RTG randomization operations to fully elaborated IR (...
The InstanceGraph op interface, see InstanceGraphInterface.td for more details.
Definition rtg.py:1