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
108 SynthLongestPathCollection collection, bool perEndPoint);
109
110//===----------------------------------------------------------------------===//
111// DataflowPath API
112//===----------------------------------------------------------------------===//
113
114MLIR_CAPI_EXPORTED int64_t
115synthLongestPathDataflowPathGetDelay(SynthLongestPathDataflowPath dataflowPath);
116
117MLIR_CAPI_EXPORTED SynthLongestPathObject
119 SynthLongestPathDataflowPath dataflowPath);
120
121MLIR_CAPI_EXPORTED SynthLongestPathObject
123 SynthLongestPathDataflowPath dataflowPath);
124
125MLIR_CAPI_EXPORTED SynthLongestPathHistory
127 SynthLongestPathDataflowPath dataflowPath);
128
129MLIR_CAPI_EXPORTED MlirOperation
130synthLongestPathDataflowPathGetRoot(SynthLongestPathDataflowPath dataflowPath);
131
132//===----------------------------------------------------------------------===//
133// History API
134//===----------------------------------------------------------------------===//
135
136MLIR_CAPI_EXPORTED bool
137synthLongestPathHistoryIsEmpty(SynthLongestPathHistory history);
138
139MLIR_CAPI_EXPORTED void
140synthLongestPathHistoryGetHead(SynthLongestPathHistory history,
141 SynthLongestPathObject *object, int64_t *delay,
142 MlirStringRef *comment);
143
144MLIR_CAPI_EXPORTED SynthLongestPathHistory
145synthLongestPathHistoryGetTail(SynthLongestPathHistory history);
146
147//===----------------------------------------------------------------------===//
148// Object API
149//===----------------------------------------------------------------------===//
150
151MLIR_CAPI_EXPORTED IgraphInstancePath
152synthLongestPathObjectGetInstancePath(SynthLongestPathObject object);
153
154MLIR_CAPI_EXPORTED MlirStringRef
155synthLongestPathObjectName(SynthLongestPathObject object);
156
157MLIR_CAPI_EXPORTED size_t
158synthLongestPathObjectBitPos(SynthLongestPathObject object);
159
160#ifdef __cplusplus
161}
162#endif
163
164#endif // CIRCT_C_DIALECT_SYNTH_H
MLIR_CAPI_EXPORTED MlirOperation synthLongestPathDataflowPathGetRoot(SynthLongestPathDataflowPath dataflowPath)
Definition Synth.cpp:247
MLIR_CAPI_EXPORTED bool synthLongestPathHistoryIsEmpty(SynthLongestPathHistory history)
Definition Synth.cpp:256
MLIR_CAPI_EXPORTED SynthLongestPathHistory synthLongestPathHistoryGetTail(SynthLongestPathHistory history)
Definition Synth.cpp:274
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:261
MLIR_CAPI_EXPORTED size_t synthLongestPathCollectionGetSize(SynthLongestPathCollection collection)
Definition Synth.cpp:185
MLIR_CAPI_EXPORTED size_t synthLongestPathObjectBitPos(SynthLongestPathObject object)
Definition Synth.cpp:311
MLIR_CAPI_EXPORTED SynthLongestPathObject synthLongestPathDataflowPathGetStartPoint(SynthLongestPathDataflowPath dataflowPath)
Definition Synth.cpp:223
MLIR_CAPI_EXPORTED IgraphInstancePath synthLongestPathObjectGetInstancePath(SynthLongestPathObject object)
Definition Synth.cpp:286
#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 synthLongestPathCollectionDropNonCriticalPaths(SynthLongestPathCollection collection, bool perEndPoint)
Definition Synth.cpp:206
MLIR_CAPI_EXPORTED void registerSynthPasses(void)
Definition Synth.cpp:38
MLIR_CAPI_EXPORTED SynthLongestPathObject synthLongestPathDataflowPathGetEndPoint(SynthLongestPathDataflowPath dataflowPath)
Definition Synth.cpp:230
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:240
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:300
MLIR_CAPI_EXPORTED int64_t synthLongestPathDataflowPathGetDelay(SynthLongestPathDataflowPath dataflowPath)
Definition Synth.cpp:217
Definition synth.py:1