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, MlirStringRef topModuleName);
55
56// Destroy a LongestPathAnalysis
57MLIR_CAPI_EXPORTED void
58synthLongestPathAnalysisDestroy(SynthLongestPathAnalysis analysis);
59
60// Get paths to a specific value and bit position
61MLIR_CAPI_EXPORTED SynthLongestPathCollection synthLongestPathAnalysisGetPaths(
62 SynthLongestPathAnalysis analysis, MlirValue value, int64_t bitPos,
63 bool elaboratePaths);
64
65// Get internal paths within the module (register-to-register paths).
66// Internal paths start and end at sequential elements, not ports.
67MLIR_CAPI_EXPORTED SynthLongestPathCollection
68synthLongestPathAnalysisGetInternalPaths(SynthLongestPathAnalysis analysis,
69 MlirStringRef moduleName,
70 bool elaboratePaths);
71
72// Get external paths from module input ports to internal sequential elements.
73MLIR_CAPI_EXPORTED SynthLongestPathCollection
75 SynthLongestPathAnalysis analysis, MlirStringRef moduleName);
76
77// Get external paths from internal sequential elements to module output ports.
78MLIR_CAPI_EXPORTED SynthLongestPathCollection
80 SynthLongestPathAnalysis analysis, MlirStringRef moduleName);
81
82//===----------------------------------------------------------------------===//
83// LongestPathCollection
84//===----------------------------------------------------------------------===//
85
86// Check if the collection is valid
87MLIR_CAPI_EXPORTED bool
88synthLongestPathCollectionIsNull(SynthLongestPathCollection collection);
89
90// Destroy a LongestPathCollection
91MLIR_CAPI_EXPORTED void
92synthLongestPathCollectionDestroy(SynthLongestPathCollection collection);
93
94// Get the number of paths in the collection
95MLIR_CAPI_EXPORTED size_t
96synthLongestPathCollectionGetSize(SynthLongestPathCollection collection);
97
98// Get a specific path from the collection as DataflowPath object
99MLIR_CAPI_EXPORTED SynthLongestPathDataflowPath
100synthLongestPathCollectionGetDataflowPath(SynthLongestPathCollection collection,
101 size_t pathIndex);
102
103MLIR_CAPI_EXPORTED void
104synthLongestPathCollectionMerge(SynthLongestPathCollection dest,
105 SynthLongestPathCollection src);
106
107//===----------------------------------------------------------------------===//
108// DataflowPath API
109//===----------------------------------------------------------------------===//
110
111MLIR_CAPI_EXPORTED int64_t
112synthLongestPathDataflowPathGetDelay(SynthLongestPathDataflowPath dataflowPath);
113
114MLIR_CAPI_EXPORTED SynthLongestPathObject
116 SynthLongestPathDataflowPath dataflowPath);
117
118MLIR_CAPI_EXPORTED SynthLongestPathObject
120 SynthLongestPathDataflowPath dataflowPath);
121
122MLIR_CAPI_EXPORTED SynthLongestPathHistory
124 SynthLongestPathDataflowPath dataflowPath);
125
126MLIR_CAPI_EXPORTED MlirOperation
127synthLongestPathDataflowPathGetRoot(SynthLongestPathDataflowPath dataflowPath);
128
129//===----------------------------------------------------------------------===//
130// History API
131//===----------------------------------------------------------------------===//
132
133MLIR_CAPI_EXPORTED bool
134synthLongestPathHistoryIsEmpty(SynthLongestPathHistory history);
135
136MLIR_CAPI_EXPORTED void
137synthLongestPathHistoryGetHead(SynthLongestPathHistory history,
138 SynthLongestPathObject *object, int64_t *delay,
139 MlirStringRef *comment);
140
141MLIR_CAPI_EXPORTED SynthLongestPathHistory
142synthLongestPathHistoryGetTail(SynthLongestPathHistory history);
143
144//===----------------------------------------------------------------------===//
145// Object API
146//===----------------------------------------------------------------------===//
147
148MLIR_CAPI_EXPORTED IgraphInstancePath
149synthLongestPathObjectGetInstancePath(SynthLongestPathObject object);
150
151MLIR_CAPI_EXPORTED MlirStringRef
152synthLongestPathObjectName(SynthLongestPathObject object);
153
154MLIR_CAPI_EXPORTED size_t
155synthLongestPathObjectBitPos(SynthLongestPathObject object);
156
157#ifdef __cplusplus
158}
159#endif
160
161#endif // CIRCT_C_DIALECT_SYNTH_H
MLIR_CAPI_EXPORTED MlirOperation synthLongestPathDataflowPathGetRoot(SynthLongestPathDataflowPath dataflowPath)
Definition Synth.cpp:241
MLIR_CAPI_EXPORTED bool synthLongestPathHistoryIsEmpty(SynthLongestPathHistory history)
Definition Synth.cpp:250
MLIR_CAPI_EXPORTED SynthLongestPathHistory synthLongestPathHistoryGetTail(SynthLongestPathHistory history)
Definition Synth.cpp:268
MLIR_CAPI_EXPORTED void synthLongestPathCollectionDestroy(SynthLongestPathCollection collection)
Definition Synth.cpp:180
MLIR_CAPI_EXPORTED void synthLongestPathHistoryGetHead(SynthLongestPathHistory history, SynthLongestPathObject *object, int64_t *delay, MlirStringRef *comment)
Definition Synth.cpp:255
MLIR_CAPI_EXPORTED size_t synthLongestPathCollectionGetSize(SynthLongestPathCollection collection)
Definition Synth.cpp:185
MLIR_CAPI_EXPORTED size_t synthLongestPathObjectBitPos(SynthLongestPathObject object)
Definition Synth.cpp:305
MLIR_CAPI_EXPORTED SynthLongestPathObject synthLongestPathDataflowPathGetStartPoint(SynthLongestPathDataflowPath dataflowPath)
Definition Synth.cpp:217
MLIR_CAPI_EXPORTED IgraphInstancePath synthLongestPathObjectGetInstancePath(SynthLongestPathObject object)
Definition Synth.cpp:280
#define DEFINE_C_API_STRUCT(name, storage)
Definition Synth.h:24
MLIR_CAPI_EXPORTED void registerSynthesisPipeline(void)
Definition Synth.cpp:34
MLIR_CAPI_EXPORTED void registerSynthPasses(void)
Definition Synth.cpp:38
MLIR_CAPI_EXPORTED SynthLongestPathObject synthLongestPathDataflowPathGetEndPoint(SynthLongestPathDataflowPath dataflowPath)
Definition Synth.cpp:224
MLIR_CAPI_EXPORTED SynthLongestPathCollection synthLongestPathAnalysisGetInternalPaths(SynthLongestPathAnalysis analysis, MlirStringRef moduleName, bool elaboratePaths)
Definition Synth.cpp:119
MLIR_CAPI_EXPORTED SynthLongestPathCollection synthLongestPathAnalysisGetPaths(SynthLongestPathAnalysis analysis, MlirValue value, int64_t bitPos, bool elaboratePaths)
Definition Synth.cpp:104
MLIR_CAPI_EXPORTED SynthLongestPathCollection synthLongestPathAnalysisGetPathsFromInternalToOutputPorts(SynthLongestPathAnalysis analysis, MlirStringRef moduleName)
Definition Synth.cpp:156
MLIR_CAPI_EXPORTED SynthLongestPathHistory synthLongestPathDataflowPathGetHistory(SynthLongestPathDataflowPath dataflowPath)
Definition Synth.cpp:234
MLIR_CAPI_EXPORTED bool synthLongestPathCollectionIsNull(SynthLongestPathCollection collection)
Definition Synth.cpp:176
MLIR_CAPI_EXPORTED SynthLongestPathDataflowPath synthLongestPathCollectionGetDataflowPath(SynthLongestPathCollection collection, size_t pathIndex)
Definition Synth.cpp:192
MLIR_DECLARE_CAPI_DIALECT_REGISTRATION(Synth, synth)
MLIR_CAPI_EXPORTED SynthLongestPathAnalysis synthLongestPathAnalysisCreate(MlirOperation module, bool collectDebugInfo, bool keepOnlyMaxDelayPaths, bool lazyComputation, MlirStringRef topModuleName)
Definition Synth.cpp:82
MLIR_CAPI_EXPORTED SynthLongestPathCollection synthLongestPathAnalysisGetPathsFromInputPortsToInternal(SynthLongestPathAnalysis analysis, MlirStringRef moduleName)
Definition Synth.cpp:138
MLIR_CAPI_EXPORTED void synthLongestPathCollectionMerge(SynthLongestPathCollection dest, SynthLongestPathCollection src)
Definition Synth.cpp:199
MLIR_CAPI_EXPORTED void synthLongestPathAnalysisDestroy(SynthLongestPathAnalysis analysis)
Definition Synth.cpp:99
MLIR_CAPI_EXPORTED MlirStringRef synthLongestPathObjectName(SynthLongestPathObject object)
Definition Synth.cpp:294
MLIR_CAPI_EXPORTED int64_t synthLongestPathDataflowPathGetDelay(SynthLongestPathDataflowPath dataflowPath)
Definition Synth.cpp:211
Definition synth.py:1