CIRCT 22.0.0git
Loading...
Searching...
No Matches
Synth.h
Go to the documentation of this file.
1//===----------------------------------------------------------------------===//
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_DIALECT_SYNTH_H
10#define CIRCT_C_DIALECT_SYNTH_H
11
13#include "mlir-c/IR.h"
14
15#ifdef __cplusplus
16extern "C" {
17#endif
18
19MLIR_CAPI_EXPORTED void registerSynthesisPipeline(void);
20
22MLIR_CAPI_EXPORTED void registerSynthPasses(void);
23
24#define DEFINE_C_API_STRUCT(name, storage) \
25 struct name { \
26 storage *ptr; \
27 }; \
28 typedef struct name name
29
30//===----------------------------------------------------------------------===//
31// LongestPathAnalysis
32//===----------------------------------------------------------------------===//
33
34// Opaque handle to LongestPathObject
35DEFINE_C_API_STRUCT(SynthLongestPathObject, void);
36
37// Opaque handle to LongestPathHistory
38DEFINE_C_API_STRUCT(SynthLongestPathHistory, void);
39
40// Opaque handle to LongestPathDataflowPath
41DEFINE_C_API_STRUCT(SynthLongestPathDataflowPath, void);
42
43// Opaque handle to LongestPathAnalysis
44DEFINE_C_API_STRUCT(SynthLongestPathAnalysis, void);
45
46// Opaque handle to LongestPathCollection
47DEFINE_C_API_STRUCT(SynthLongestPathCollection, void);
48
49#undef DEFINE_C_API_STRUCT
50
51// Create a LongestPathAnalysis for the given module
52MLIR_CAPI_EXPORTED SynthLongestPathAnalysis synthLongestPathAnalysisCreate(
53 MlirOperation module, bool collectDebugInfo, bool keepOnlyMaxDelayPaths,
54 bool lazyComputation);
55
56// Destroy a LongestPathAnalysis
57MLIR_CAPI_EXPORTED void
58synthLongestPathAnalysisDestroy(SynthLongestPathAnalysis analysis);
59
60MLIR_CAPI_EXPORTED SynthLongestPathCollection synthLongestPathAnalysisGetPaths(
61 SynthLongestPathAnalysis analysis, MlirValue value, int64_t bitPos,
62 bool elaboratePaths);
63
64MLIR_CAPI_EXPORTED SynthLongestPathCollection
65synthLongestPathAnalysisGetAllPaths(SynthLongestPathAnalysis analysis,
66 MlirStringRef moduleName,
67 bool elaboratePaths);
68
69//===----------------------------------------------------------------------===//
70// LongestPathCollection
71//===----------------------------------------------------------------------===//
72
73// Check if the collection is valid
74MLIR_CAPI_EXPORTED bool
75synthLongestPathCollectionIsNull(SynthLongestPathCollection collection);
76
77// Destroy a LongestPathCollection
78MLIR_CAPI_EXPORTED void
79synthLongestPathCollectionDestroy(SynthLongestPathCollection collection);
80
81// Get the number of paths in the collection
82MLIR_CAPI_EXPORTED size_t
83synthLongestPathCollectionGetSize(SynthLongestPathCollection collection);
84
85// Get a specific path from the collection as DataflowPath object
86MLIR_CAPI_EXPORTED SynthLongestPathDataflowPath
87synthLongestPathCollectionGetDataflowPath(SynthLongestPathCollection collection,
88 size_t pathIndex);
89
90MLIR_CAPI_EXPORTED void
91synthLongestPathCollectionMerge(SynthLongestPathCollection dest,
92 SynthLongestPathCollection src);
93
94//===----------------------------------------------------------------------===//
95// DataflowPath API
96//===----------------------------------------------------------------------===//
97
98MLIR_CAPI_EXPORTED int64_t
99synthLongestPathDataflowPathGetDelay(SynthLongestPathDataflowPath dataflowPath);
100
101MLIR_CAPI_EXPORTED SynthLongestPathObject
103 SynthLongestPathDataflowPath dataflowPath);
104
105MLIR_CAPI_EXPORTED SynthLongestPathObject
107 SynthLongestPathDataflowPath dataflowPath);
108
109MLIR_CAPI_EXPORTED SynthLongestPathHistory
111 SynthLongestPathDataflowPath dataflowPath);
112
113MLIR_CAPI_EXPORTED MlirOperation
114synthLongestPathDataflowPathGetRoot(SynthLongestPathDataflowPath dataflowPath);
115
116//===----------------------------------------------------------------------===//
117// History API
118//===----------------------------------------------------------------------===//
119
120MLIR_CAPI_EXPORTED bool
121synthLongestPathHistoryIsEmpty(SynthLongestPathHistory history);
122
123MLIR_CAPI_EXPORTED void
124synthLongestPathHistoryGetHead(SynthLongestPathHistory history,
125 SynthLongestPathObject *object, int64_t *delay,
126 MlirStringRef *comment);
127
128MLIR_CAPI_EXPORTED SynthLongestPathHistory
129synthLongestPathHistoryGetTail(SynthLongestPathHistory history);
130
131//===----------------------------------------------------------------------===//
132// Object API
133//===----------------------------------------------------------------------===//
134
135MLIR_CAPI_EXPORTED IgraphInstancePath
136synthLongestPathObjectGetInstancePath(SynthLongestPathObject object);
137
138MLIR_CAPI_EXPORTED MlirStringRef
139synthLongestPathObjectName(SynthLongestPathObject object);
140
141MLIR_CAPI_EXPORTED size_t
142synthLongestPathObjectBitPos(SynthLongestPathObject object);
143
144#ifdef __cplusplus
145}
146#endif
147
148#endif // CIRCT_C_DIALECT_SYNTH_H
MLIR_CAPI_EXPORTED MlirOperation synthLongestPathDataflowPathGetRoot(SynthLongestPathDataflowPath dataflowPath)
Definition Synth.cpp:203
MLIR_CAPI_EXPORTED bool synthLongestPathHistoryIsEmpty(SynthLongestPathHistory history)
Definition Synth.cpp:212
MLIR_CAPI_EXPORTED SynthLongestPathHistory synthLongestPathHistoryGetTail(SynthLongestPathHistory history)
Definition Synth.cpp:230
MLIR_CAPI_EXPORTED void synthLongestPathCollectionDestroy(SynthLongestPathCollection collection)
Definition Synth.cpp:142
MLIR_CAPI_EXPORTED void synthLongestPathHistoryGetHead(SynthLongestPathHistory history, SynthLongestPathObject *object, int64_t *delay, MlirStringRef *comment)
Definition Synth.cpp:217
MLIR_CAPI_EXPORTED size_t synthLongestPathCollectionGetSize(SynthLongestPathCollection collection)
Definition Synth.cpp:147
MLIR_CAPI_EXPORTED size_t synthLongestPathObjectBitPos(SynthLongestPathObject object)
Definition Synth.cpp:267
MLIR_CAPI_EXPORTED SynthLongestPathObject synthLongestPathDataflowPathGetStartPoint(SynthLongestPathDataflowPath dataflowPath)
Definition Synth.cpp:179
MLIR_CAPI_EXPORTED IgraphInstancePath synthLongestPathObjectGetInstancePath(SynthLongestPathObject object)
Definition Synth.cpp:242
#define DEFINE_C_API_STRUCT(name, storage)
Definition Synth.h:24
MLIR_CAPI_EXPORTED void registerSynthesisPipeline(void)
Definition Synth.cpp:34
MLIR_CAPI_EXPORTED SynthLongestPathAnalysis synthLongestPathAnalysisCreate(MlirOperation module, bool collectDebugInfo, bool keepOnlyMaxDelayPaths, bool lazyComputation)
Definition Synth.cpp:82
MLIR_CAPI_EXPORTED void registerSynthPasses(void)
Definition Synth.cpp:38
MLIR_CAPI_EXPORTED SynthLongestPathObject synthLongestPathDataflowPathGetEndPoint(SynthLongestPathDataflowPath dataflowPath)
Definition Synth.cpp:186
MLIR_CAPI_EXPORTED SynthLongestPathCollection synthLongestPathAnalysisGetPaths(SynthLongestPathAnalysis analysis, MlirValue value, int64_t bitPos, bool elaboratePaths)
Definition Synth.cpp:102
MLIR_CAPI_EXPORTED SynthLongestPathHistory synthLongestPathDataflowPathGetHistory(SynthLongestPathDataflowPath dataflowPath)
Definition Synth.cpp:196
MLIR_CAPI_EXPORTED bool synthLongestPathCollectionIsNull(SynthLongestPathCollection collection)
Definition Synth.cpp:138
MLIR_CAPI_EXPORTED SynthLongestPathDataflowPath synthLongestPathCollectionGetDataflowPath(SynthLongestPathCollection collection, size_t pathIndex)
Definition Synth.cpp:154
MLIR_DECLARE_CAPI_DIALECT_REGISTRATION(Synth, synth)
MLIR_CAPI_EXPORTED SynthLongestPathCollection synthLongestPathAnalysisGetAllPaths(SynthLongestPathAnalysis analysis, MlirStringRef moduleName, bool elaboratePaths)
Definition Synth.cpp:117
MLIR_CAPI_EXPORTED void synthLongestPathCollectionMerge(SynthLongestPathCollection dest, SynthLongestPathCollection src)
Definition Synth.cpp:161
MLIR_CAPI_EXPORTED void synthLongestPathAnalysisDestroy(SynthLongestPathAnalysis analysis)
Definition Synth.cpp:97
MLIR_CAPI_EXPORTED MlirStringRef synthLongestPathObjectName(SynthLongestPathObject object)
Definition Synth.cpp:256
MLIR_CAPI_EXPORTED int64_t synthLongestPathDataflowPathGetDelay(SynthLongestPathDataflowPath dataflowPath)
Definition Synth.cpp:173
Definition synth.py:1