CIRCT  20.0.0git
RtgTool.h
Go to the documentation of this file.
1 //===-- circt-c/RtgTool.h - C API for the 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 #ifndef CIRCT_C_RTGTOOL_H
10 #define CIRCT_C_RTGTOOL_H
11 
12 #include "mlir-c/Pass.h"
13 
14 #ifdef __cplusplus
15 extern "C" {
16 #endif
17 
18 //===----------------------------------------------------------------------===//
19 // Tool Options API.
20 //===----------------------------------------------------------------------===//
21 
22 #define DEFINE_C_API_STRUCT(name, storage) \
23  struct name { \
24  storage *ptr; \
25  }; \
26  typedef struct name name
27 
28 DEFINE_C_API_STRUCT(CirctRtgToolOptions, void);
29 
30 #undef DEFINE_C_API_STRUCT
31 
32 // NOLINTNEXTLINE(modernize-use-using)
38 
39 MLIR_CAPI_EXPORTED CirctRtgToolOptions
41 MLIR_CAPI_EXPORTED void circtRtgToolOptionsDestroy(CirctRtgToolOptions options);
42 
43 MLIR_CAPI_EXPORTED void
44 circtRtgToolOptionsSetOutputFormat(CirctRtgToolOptions options,
46 
47 MLIR_CAPI_EXPORTED void circtRtgToolOptionsSetSeed(CirctRtgToolOptions options,
48  unsigned seed);
49 
50 MLIR_CAPI_EXPORTED void
51 circtRtgToolOptionsSetVerifyPasses(CirctRtgToolOptions options, bool enable);
52 
53 MLIR_CAPI_EXPORTED void
54 circtRtgToolOptionsSetVerbosePassExecution(CirctRtgToolOptions options,
55  bool enable);
56 
57 MLIR_CAPI_EXPORTED void circtRtgToolOptionsSetUnsupportedInstructions(
58  CirctRtgToolOptions options, unsigned numInstr,
59  const char **unsupportedInstructions);
60 
61 MLIR_CAPI_EXPORTED void circtRtgToolOptionsAddUnsupportedInstruction(
62  CirctRtgToolOptions options, const char *unsupportedInstruction);
63 
64 MLIR_CAPI_EXPORTED void
65 circtRtgToolOptionsSetUnsupportedInstructionsFile(CirctRtgToolOptions options,
66  const char *filename);
67 
68 //===----------------------------------------------------------------------===//
69 // Pipeline Population API.
70 //===----------------------------------------------------------------------===//
71 
72 MLIR_CAPI_EXPORTED void
73 circtRtgToolRandomizerPipeline(MlirPassManager pm, CirctRtgToolOptions options);
74 
75 #ifdef __cplusplus
76 }
77 #endif
78 
79 #endif // CIRCT_C_RTGTOOL_H
MLIR_CAPI_EXPORTED void circtRtgToolOptionsSetUnsupportedInstructions(CirctRtgToolOptions options, unsigned numInstr, const char **unsupportedInstructions)
Definition: RtgTool.cpp:65
MLIR_CAPI_EXPORTED void circtRtgToolOptionsAddUnsupportedInstruction(CirctRtgToolOptions options, const char *unsupportedInstruction)
Definition: RtgTool.cpp:74
#define DEFINE_C_API_STRUCT(name, storage)
Definition: RtgTool.h:22
CiretRtgToolOutputFormat
Definition: RtgTool.h:33
@ CIRCT_RTGTOOL_OUTPUT_FORMAT_ASM
Definition: RtgTool.h:36
@ CIRCT_RTGTOOL_OUTPUT_FORMAT_ELABORATED_MLIR
Definition: RtgTool.h:35
@ CIRCT_RTGTOOL_OUTPUT_FORMAT_MLIR
Definition: RtgTool.h:34
MLIR_CAPI_EXPORTED void circtRtgToolOptionsSetVerifyPasses(CirctRtgToolOptions options, bool enable)
Definition: RtgTool.cpp:55
MLIR_CAPI_EXPORTED void circtRtgToolOptionsSetOutputFormat(CirctRtgToolOptions options, CirctRtgToolOutputFormat format)
Definition: RtgTool.cpp:33
MLIR_CAPI_EXPORTED void circtRtgToolOptionsSetUnsupportedInstructionsFile(CirctRtgToolOptions options, const char *filename)
Definition: RtgTool.cpp:80
MLIR_CAPI_EXPORTED void circtRtgToolOptionsDestroy(CirctRtgToolOptions options)
Definition: RtgTool.cpp:29
MLIR_CAPI_EXPORTED void circtRtgToolOptionsSetSeed(CirctRtgToolOptions options, unsigned seed)
Definition: RtgTool.cpp:51
MLIR_CAPI_EXPORTED void circtRtgToolOptionsSetVerbosePassExecution(CirctRtgToolOptions options, bool enable)
Definition: RtgTool.cpp:60
MLIR_CAPI_EXPORTED void circtRtgToolRandomizerPipeline(MlirPassManager pm, CirctRtgToolOptions options)
Definition: RtgTool.cpp:89
MLIR_CAPI_EXPORTED CirctRtgToolOptions circtRtgToolOptionsCreateDefault(unsigned seed)
Definition: RtgTool.cpp:24
enum CiretRtgToolOutputFormat CirctRtgToolOutputFormat