CIRCT 20.0.0git
Loading...
Searching...
No Matches
Firtool.cpp
Go to the documentation of this file.
1//===- Firtool.cpp - C Interface to Firtool-lib ---------------------------===//
2//
3// Implements a C Interface for Firtool-lib.
4//
5//===----------------------------------------------------------------------===//
6
9#include "mlir/CAPI/IR.h"
10#include "mlir/CAPI/Pass.h"
11#include "mlir/CAPI/Support.h"
12#include "mlir/CAPI/Utils.h"
13#include "llvm/Support/CommandLine.h"
14#include "llvm/Support/raw_ostream.h"
15
16using namespace circt;
17
18DEFINE_C_API_PTR_METHODS(CirctFirtoolFirtoolOptions,
20
21//===----------------------------------------------------------------------===//
22// Option API.
23//===----------------------------------------------------------------------===//
24
25CirctFirtoolFirtoolOptions circtFirtoolOptionsCreateDefault() {
26 auto *options = new firtool::FirtoolOptions();
27 return wrap(options);
28}
29
30void circtFirtoolOptionsDestroy(CirctFirtoolFirtoolOptions options) {
31 delete unwrap(options);
32}
33
34void circtFirtoolOptionsSetOutputFilename(CirctFirtoolFirtoolOptions options,
35 MlirStringRef filename) {
36 unwrap(options)->setOutputFilename(unwrap(filename));
37}
38
40 CirctFirtoolFirtoolOptions options, bool disable) {
41 unwrap(options)->setDisableUnknownAnnotations(disable);
42}
43
45 CirctFirtoolFirtoolOptions options, bool value) {
46 unwrap(options)->setDisableAnnotationsClassless(value);
47}
48
50 CirctFirtoolFirtoolOptions options, bool value) {
51 unwrap(options)->setLowerAnnotationsNoRefTypePorts(value);
52}
53
55 CirctFirtoolFirtoolOptions options, bool value) {
56 unwrap(options)->setAllowAddingPortsOnPublic(value);
57}
58
60 CirctFirtoolFirtoolOptions options,
63
64 switch (value) {
66 converted = firrtl::PreserveAggregate::PreserveMode::None;
67 break;
69 converted = firrtl::PreserveAggregate::PreserveMode::OneDimVec;
70 break;
72 converted = firrtl::PreserveAggregate::PreserveMode::Vec;
73 break;
75 converted = firrtl::PreserveAggregate::PreserveMode::All;
76 break;
77 }
78
79 unwrap(options)->setPreserveAggregate(converted);
80}
81
83 CirctFirtoolFirtoolOptions options, CirctFirtoolPreserveValuesMode value) {
85
86 switch (value) {
88 converted = firrtl::PreserveValues::PreserveMode::Strip;
89 break;
91 converted = firrtl::PreserveValues::PreserveMode::None;
92 break;
94 converted = firrtl::PreserveValues::PreserveMode::Named;
95 break;
97 converted = firrtl::PreserveValues::PreserveMode::All;
98 break;
99 }
100
101 unwrap(options)->setPreserveValues(converted);
102}
103
104void circtFirtoolOptionsSetEnableDebugInfo(CirctFirtoolFirtoolOptions options,
105 bool value) {
106 unwrap(options)->setEnableDebugInfo(value);
107}
108
109void circtFirtoolOptionsSetBuildMode(CirctFirtoolFirtoolOptions options,
110 CirctFirtoolBuildMode value) {
112
113 switch (value) {
115 converted = firtool::FirtoolOptions::BuildMode::BuildModeDefault;
116 break;
118 converted = firtool::FirtoolOptions::BuildMode::BuildModeDebug;
119 break;
121 converted = firtool::FirtoolOptions::BuildMode::BuildModeRelease;
122 break;
123 }
124
125 unwrap(options)->setBuildMode(converted);
126}
127
128void circtFirtoolOptionsSetDisableLayerSink(CirctFirtoolFirtoolOptions options,
129 bool value) {
130 unwrap(options)->setDisableLayerSink(value);
131}
132
134 CirctFirtoolFirtoolOptions options, bool value) {
135 unwrap(options)->setDisableOptimization(value);
136}
137
139 CirctFirtoolFirtoolOptions options, bool value) {
140 unwrap(options)->setExportChiselInterface(value);
141}
142
144 CirctFirtoolFirtoolOptions options, MlirStringRef value) {
145 unwrap(options)->setChiselInterfaceOutDirectory(unwrap(value));
146}
147
148void circtFirtoolOptionsSetVbToBv(CirctFirtoolFirtoolOptions options,
149 bool value) {
150 unwrap(options)->setVbToBV(value);
151}
152
153void circtFirtoolOptionsSetNoDedup(CirctFirtoolFirtoolOptions options,
154 bool value) {
155 unwrap(options)->setNoDedup(value);
156}
157
158void circtFirtoolOptionsSetCompanionMode(CirctFirtoolFirtoolOptions options,
160 firrtl::CompanionMode converted;
161
162 switch (value) {
164 converted = firrtl::CompanionMode::Bind;
165 break;
167 converted = firrtl::CompanionMode::Instantiate;
168 break;
170 converted = firrtl::CompanionMode::Drop;
171 break;
172 }
173
174 unwrap(options)->setCompanionMode(converted);
175}
176
178 CirctFirtoolFirtoolOptions options, bool value) {
179 unwrap(options)->setDisableAggressiveMergeConnections(value);
180}
181
182void circtFirtoolOptionsSetLowerMemories(CirctFirtoolFirtoolOptions options,
183 bool value) {
184 unwrap(options)->setLowerMemories(value);
185}
186
187void circtFirtoolOptionsSetBlackBoxRootPath(CirctFirtoolFirtoolOptions options,
188 MlirStringRef value) {
189 unwrap(options)->setBlackBoxRootPath(unwrap(value));
190}
191
192void circtFirtoolOptionsSetReplSeqMem(CirctFirtoolFirtoolOptions options,
193 bool value) {
194 unwrap(options)->setReplSeqMem(value);
195}
196
197void circtFirtoolOptionsSetReplSeqMemFile(CirctFirtoolFirtoolOptions options,
198 MlirStringRef value) {
199 unwrap(options)->setReplSeqMemFile(unwrap(value));
200}
201
202void circtFirtoolOptionsSetExtractTestCode(CirctFirtoolFirtoolOptions options,
203 bool value) {
204 unwrap(options)->setExtractTestCode(value);
205}
206
208 CirctFirtoolFirtoolOptions options, bool value) {
209 unwrap(options)->setIgnoreReadEnableMem(value);
210}
211
212void circtFirtoolOptionsSetDisableRandom(CirctFirtoolFirtoolOptions options,
215
216 switch (value) {
218 converted = firtool::FirtoolOptions::RandomKind::None;
219 break;
221 converted = firtool::FirtoolOptions::RandomKind::Mem;
222 break;
224 converted = firtool::FirtoolOptions::RandomKind::Reg;
225 break;
227 converted = firtool::FirtoolOptions::RandomKind::All;
228 break;
229 }
230
231 unwrap(options)->setDisableRandom(converted);
232}
233
235 CirctFirtoolFirtoolOptions options, MlirStringRef value) {
236 unwrap(options)->setOutputAnnotationFilename(unwrap(value));
237}
238
240 CirctFirtoolFirtoolOptions options, bool value) {
241 unwrap(options)->setEnableAnnotationWarning(value);
242}
243
244void circtFirtoolOptionsSetAddMuxPragmas(CirctFirtoolFirtoolOptions options,
245 bool value) {
246 unwrap(options)->setAddMuxPragmas(value);
247}
248
250 CirctFirtoolFirtoolOptions options, firrtl::VerificationFlavor value) {
251 unwrap(options)->setVerificationFlavor(value);
252}
253
255 CirctFirtoolFirtoolOptions options, bool value) {
256 unwrap(options)->setEmitSeparateAlwaysBlocks(value);
257}
258
260 CirctFirtoolFirtoolOptions options, bool value) {
261 unwrap(options)->setEtcDisableInstanceExtraction(value);
262}
263
265 CirctFirtoolFirtoolOptions options, bool value) {
266 unwrap(options)->setEtcDisableRegisterExtraction(value);
267}
268
270 CirctFirtoolFirtoolOptions options, bool value) {
271 unwrap(options)->setEtcDisableModuleInlining(value);
272}
273
275 CirctFirtoolFirtoolOptions options, bool value) {
276 unwrap(options)->setAddVivadoRAMAddressConflictSynthesisBugWorkaround(value);
277}
278
279void circtFirtoolOptionsSetCkgModuleName(CirctFirtoolFirtoolOptions options,
280 MlirStringRef value) {
281 unwrap(options)->setCkgModuleName(unwrap(value));
282}
283
284void circtFirtoolOptionsSetCkgInputName(CirctFirtoolFirtoolOptions options,
285 MlirStringRef value) {
286 unwrap(options)->setCkgInputName(unwrap(value));
287}
288
289void circtFirtoolOptionsSetCkgOutputName(CirctFirtoolFirtoolOptions options,
290 MlirStringRef value) {
291 unwrap(options)->setCkgOutputName(unwrap(value));
292}
293
294void circtFirtoolOptionsSetCkgEnableName(CirctFirtoolFirtoolOptions options,
295 MlirStringRef value) {
296 unwrap(options)->setCkgEnableName(unwrap(value));
297}
298
299void circtFirtoolOptionsSetCkgTestEnableName(CirctFirtoolFirtoolOptions options,
300 MlirStringRef value) {
301 unwrap(options)->setCkgTestEnableName(unwrap(value));
302}
303
305 CirctFirtoolFirtoolOptions options, bool value) {
306 unwrap(options)->setExportModuleHierarchy(value);
307}
308
309void circtFirtoolOptionsSetStripFirDebugInfo(CirctFirtoolFirtoolOptions options,
310 bool value) {
311 unwrap(options)->setStripFirDebugInfo(value);
312}
313
314void circtFirtoolOptionsSetStripDebugInfo(CirctFirtoolFirtoolOptions options,
315 bool value) {
316 unwrap(options)->setStripDebugInfo(value);
317}
318
320 CirctFirtoolFirtoolOptions options, bool value) {
321
322 unwrap(options)->setDisableCSEinClasses(value);
323}
324
326 CirctFirtoolFirtoolOptions options, bool value) {
327 unwrap(options)->setSelectDefaultInstanceChoice(value);
328}
329
330//===----------------------------------------------------------------------===//
331// Populate API.
332//===----------------------------------------------------------------------===//
333
334MlirLogicalResult
336 CirctFirtoolFirtoolOptions options) {
337 return wrap(
339}
340
341MlirLogicalResult
343 CirctFirtoolFirtoolOptions options,
344 MlirStringRef inputFilename) {
346 unwrap(inputFilename)));
347}
348
349MlirLogicalResult
351 CirctFirtoolFirtoolOptions options) {
352 return wrap(firtool::populateLowFIRRTLToHW(*unwrap(pm), *unwrap(options)));
353}
354
355MlirLogicalResult
356circtFirtoolPopulateHWToSV(MlirPassManager pm,
357 CirctFirtoolFirtoolOptions options) {
358 return wrap(firtool::populateHWToSV(*unwrap(pm), *unwrap(options)));
359}
360
361MlirLogicalResult
363 CirctFirtoolFirtoolOptions options,
364 MlirStringCallback callback, void *userData) {
365 auto stream =
366 std::make_unique<mlir::detail::CallbackOstream>(callback, userData);
367 return wrap(firtool::populateExportVerilog(*unwrap(pm), *unwrap(options),
368 std::move(stream)));
369}
370
371MlirLogicalResult
373 CirctFirtoolFirtoolOptions options,
374 MlirStringRef directory) {
376 unwrap(directory)));
377}
378
379MlirLogicalResult
381 CirctFirtoolFirtoolOptions options) {
382 return wrap(firtool::populateFinalizeIR(*unwrap(pm), *unwrap(options)));
383}
384
385MlirLogicalResult
387 CirctFirtoolFirtoolOptions options,
388 MlirStringCallback callback, void *userData) {
389 auto stream =
390 std::make_unique<mlir::detail::CallbackOstream>(callback, userData);
391 return wrap(firtool::populateHWToBTOR2(*unwrap(pm), *unwrap(options),
392 *std::move(stream)));
393}
void circtFirtoolOptionsSetDisableAggressiveMergeConnections(CirctFirtoolFirtoolOptions options, bool value)
Definition Firtool.cpp:177
void circtFirtoolOptionsSetStripDebugInfo(CirctFirtoolFirtoolOptions options, bool value)
Definition Firtool.cpp:314
void circtFirtoolOptionsSetEmitSeparateAlwaysBlocks(CirctFirtoolFirtoolOptions options, bool value)
Definition Firtool.cpp:254
void circtFirtoolOptionsSetDisableUnknownAnnotations(CirctFirtoolFirtoolOptions options, bool disable)
Definition Firtool.cpp:39
void circtFirtoolOptionsSetDisableLayerSink(CirctFirtoolFirtoolOptions options, bool value)
Definition Firtool.cpp:128
void circtFirtoolOptionsSetExportModuleHierarchy(CirctFirtoolFirtoolOptions options, bool value)
Definition Firtool.cpp:304
void circtFirtoolOptionsSetCkgOutputName(CirctFirtoolFirtoolOptions options, MlirStringRef value)
Definition Firtool.cpp:289
void circtFirtoolOptionsSetCkgTestEnableName(CirctFirtoolFirtoolOptions options, MlirStringRef value)
Definition Firtool.cpp:299
MlirLogicalResult circtFirtoolpopulateHWToBTOR2(MlirPassManager pm, CirctFirtoolFirtoolOptions options, MlirStringCallback callback, void *userData)
Definition Firtool.cpp:386
void circtFirtoolOptionsSetVerificationFlavor(CirctFirtoolFirtoolOptions options, firrtl::VerificationFlavor value)
Definition Firtool.cpp:249
void circtFirtoolOptionsSetCkgEnableName(CirctFirtoolFirtoolOptions options, MlirStringRef value)
Definition Firtool.cpp:294
void circtFirtoolOptionsSetPreserveAggregate(CirctFirtoolFirtoolOptions options, CirctFirtoolPreserveAggregateMode value)
Definition Firtool.cpp:59
void circtFirtoolOptionsSetDisableOptimization(CirctFirtoolFirtoolOptions options, bool value)
Definition Firtool.cpp:133
void circtFirtoolOptionsSetLowerAnnotationsNoRefTypePorts(CirctFirtoolFirtoolOptions options, bool value)
Definition Firtool.cpp:49
void circtFirtoolOptionsSetIgnoreReadEnableMem(CirctFirtoolFirtoolOptions options, bool value)
Definition Firtool.cpp:207
void circtFirtoolOptionsSetOutputFilename(CirctFirtoolFirtoolOptions options, MlirStringRef filename)
Definition Firtool.cpp:34
void circtFirtoolOptionsSetSelectDefaultInstanceChoice(CirctFirtoolFirtoolOptions options, bool value)
Definition Firtool.cpp:325
void circtFirtoolOptionsSetReplSeqMemFile(CirctFirtoolFirtoolOptions options, MlirStringRef value)
Definition Firtool.cpp:197
MlirLogicalResult circtFirtoolPopulateCHIRRTLToLowFIRRTL(MlirPassManager pm, CirctFirtoolFirtoolOptions options, MlirStringRef inputFilename)
Definition Firtool.cpp:342
void circtFirtoolOptionsSetDisableAnnotationsClassless(CirctFirtoolFirtoolOptions options, bool value)
Definition Firtool.cpp:44
void circtFirtoolOptionsDestroy(CirctFirtoolFirtoolOptions options)
Definition Firtool.cpp:30
void circtFirtoolOptionsSetVbToBv(CirctFirtoolFirtoolOptions options, bool value)
Definition Firtool.cpp:148
void circtFirtoolOptionsSetOutputAnnotationFilename(CirctFirtoolFirtoolOptions options, MlirStringRef value)
Definition Firtool.cpp:234
void circtFirtoolOptionsSetNoDedup(CirctFirtoolFirtoolOptions options, bool value)
Definition Firtool.cpp:153
void circtFirtoolOptionsSetBlackBoxRootPath(CirctFirtoolFirtoolOptions options, MlirStringRef value)
Definition Firtool.cpp:187
void circtFirtoolOptionsSetCkgModuleName(CirctFirtoolFirtoolOptions options, MlirStringRef value)
Definition Firtool.cpp:279
void circtFirtoolOptionsSetDisableRandom(CirctFirtoolFirtoolOptions options, CirctFirtoolRandomKind value)
Definition Firtool.cpp:212
MlirLogicalResult circtFirtoolPopulateFinalizeIR(MlirPassManager pm, CirctFirtoolFirtoolOptions options)
Definition Firtool.cpp:380
void circtFirtoolOptionsSetAllowAddingPortsOnPublic(CirctFirtoolFirtoolOptions options, bool value)
Definition Firtool.cpp:54
void circtFirtoolOptionsSetEtcDisableInstanceExtraction(CirctFirtoolFirtoolOptions options, bool value)
Definition Firtool.cpp:259
void circtFirtoolOptionsSetEnableAnnotationWarning(CirctFirtoolFirtoolOptions options, bool value)
Definition Firtool.cpp:239
void circtFirtoolOptionsSetReplSeqMem(CirctFirtoolFirtoolOptions options, bool value)
Definition Firtool.cpp:192
void circtFirtoolOptionsSetEnableDebugInfo(CirctFirtoolFirtoolOptions options, bool value)
Definition Firtool.cpp:104
void circtFirtoolOptionsSetExportChiselInterface(CirctFirtoolFirtoolOptions options, bool value)
Definition Firtool.cpp:138
void circtFirtoolOptionsSetCkgInputName(CirctFirtoolFirtoolOptions options, MlirStringRef value)
Definition Firtool.cpp:284
void circtFirtoolOptionsSetBuildMode(CirctFirtoolFirtoolOptions options, CirctFirtoolBuildMode value)
Definition Firtool.cpp:109
MlirLogicalResult circtFirtoolPopulateHWToSV(MlirPassManager pm, CirctFirtoolFirtoolOptions options)
Definition Firtool.cpp:356
void circtFirtoolOptionsSetLowerMemories(CirctFirtoolFirtoolOptions options, bool value)
Definition Firtool.cpp:182
void circtFirtoolOptionsSetEtcDisableModuleInlining(CirctFirtoolFirtoolOptions options, bool value)
Definition Firtool.cpp:269
void circtFirtoolOptionsSetAddVivadoRAMAddressConflictSynthesisBugWorkaround(CirctFirtoolFirtoolOptions options, bool value)
Definition Firtool.cpp:274
MlirLogicalResult circtFirtoolPopulateExportVerilog(MlirPassManager pm, CirctFirtoolFirtoolOptions options, MlirStringCallback callback, void *userData)
Definition Firtool.cpp:362
MlirLogicalResult circtFirtoolPopulateLowFIRRTLToHW(MlirPassManager pm, CirctFirtoolFirtoolOptions options)
Definition Firtool.cpp:350
void circtFirtoolOptionsSetExtractTestCode(CirctFirtoolFirtoolOptions options, bool value)
Definition Firtool.cpp:202
void circtFirtoolOptionsSetChiselInterfaceOutDirectory(CirctFirtoolFirtoolOptions options, MlirStringRef value)
Definition Firtool.cpp:143
void circtFirtoolOptionsSetStripFirDebugInfo(CirctFirtoolFirtoolOptions options, bool value)
Definition Firtool.cpp:309
void circtFirtoolOptionsSetDisableCSEinClasses(CirctFirtoolFirtoolOptions options, bool value)
Definition Firtool.cpp:319
DEFINE_C_API_PTR_METHODS(CirctFirtoolFirtoolOptions, circt::firtool::FirtoolOptions) CirctFirtoolFirtoolOptions circtFirtoolOptionsCreateDefault()
Definition Firtool.cpp:18
void circtFirtoolOptionsSetAddMuxPragmas(CirctFirtoolFirtoolOptions options, bool value)
Definition Firtool.cpp:244
void circtFirtoolOptionsSetCompanionMode(CirctFirtoolFirtoolOptions options, CirctFirtoolCompanionMode value)
Definition Firtool.cpp:158
void circtFirtoolOptionsSetEtcDisableRegisterExtraction(CirctFirtoolFirtoolOptions options, bool value)
Definition Firtool.cpp:264
MlirLogicalResult circtFirtoolPopulatePreprocessTransforms(MlirPassManager pm, CirctFirtoolFirtoolOptions options)
Definition Firtool.cpp:335
MlirLogicalResult circtFirtoolPopulateExportSplitVerilog(MlirPassManager pm, CirctFirtoolFirtoolOptions options, MlirStringRef directory)
Definition Firtool.cpp:372
void circtFirtoolOptionsSetPreserveValues(CirctFirtoolFirtoolOptions options, CirctFirtoolPreserveValuesMode value)
Definition Firtool.cpp:82
return wrap(CMemoryType::get(unwrap(ctx), baseType, numElements))
static EvaluatorValuePtr unwrap(OMEvaluatorValue c)
Definition OM.cpp:113
CirctFirtoolCompanionMode
Definition Firtool.h:42
@ CIRCT_FIRTOOL_COMPANION_MODE_BIND
Definition Firtool.h:43
@ CIRCT_FIRTOOL_COMPANION_MODE_DROP
Definition Firtool.h:45
@ CIRCT_FIRTOOL_COMPANION_MODE_INSTANTIATE
Definition Firtool.h:44
CirctFirtoolRandomKind
Definition Firtool.h:56
@ CIRCT_FIRTOOL_RANDOM_KIND_MEM
Definition Firtool.h:58
@ CIRCT_FIRTOOL_RANDOM_KIND_NONE
Definition Firtool.h:57
@ CIRCT_FIRTOOL_RANDOM_KIND_REG
Definition Firtool.h:59
@ CIRCT_FIRTOOL_RANDOM_KIND_ALL
Definition Firtool.h:60
MLIR_CAPI_EXPORTED CirctFirtoolFirtoolOptions circtFirtoolOptionsCreateDefault(void)
CirctFirtoolPreserveAggregateMode
Definition Firtool.h:26
@ CIRCT_FIRTOOL_PRESERVE_AGGREGATE_MODE_NONE
Definition Firtool.h:27
@ CIRCT_FIRTOOL_PRESERVE_AGGREGATE_MODE_ALL
Definition Firtool.h:30
@ CIRCT_FIRTOOL_PRESERVE_AGGREGATE_MODE_VEC
Definition Firtool.h:29
@ CIRCT_FIRTOOL_PRESERVE_AGGREGATE_MODE_ONE_DIM_VEC
Definition Firtool.h:28
CirctFirtoolBuildMode
Definition Firtool.h:49
@ CIRCT_FIRTOOL_BUILD_MODE_RELEASE
Definition Firtool.h:52
@ CIRCT_FIRTOOL_BUILD_MODE_DEBUG
Definition Firtool.h:51
@ CIRCT_FIRTOOL_BUILD_MODE_DEFAULT
Definition Firtool.h:50
CirctFirtoolPreserveValuesMode
Definition Firtool.h:34
@ CIRCT_FIRTOOL_PRESERVE_VALUES_MODE_STRIP
Definition Firtool.h:35
@ CIRCT_FIRTOOL_PRESERVE_VALUES_MODE_ALL
Definition Firtool.h:38
@ CIRCT_FIRTOOL_PRESERVE_VALUES_MODE_NAMED
Definition Firtool.h:37
@ CIRCT_FIRTOOL_PRESERVE_VALUES_MODE_NONE
Definition Firtool.h:36
Set of options used to control the behavior of the firtool pipeline.
Definition Firtool.h:30
LogicalResult populateHWToBTOR2(mlir::PassManager &pm, const FirtoolOptions &opt, llvm::raw_ostream &os)
Definition Firtool.cpp:433
LogicalResult populateExportSplitVerilog(mlir::PassManager &pm, const FirtoolOptions &opt, llvm::StringRef directory)
Definition Firtool.cpp:415
LogicalResult populateHWToSV(mlir::PassManager &pm, const FirtoolOptions &opt)
Definition Firtool.cpp:303
LogicalResult populateLowFIRRTLToHW(mlir::PassManager &pm, const FirtoolOptions &opt)
Definition Firtool.cpp:262
LogicalResult populateExportVerilog(mlir::PassManager &pm, const FirtoolOptions &opt, std::unique_ptr< llvm::raw_ostream > os)
Definition Firtool.cpp:396
LogicalResult populatePreprocessTransforms(mlir::PassManager &pm, const FirtoolOptions &opt)
Definition Firtool.cpp:27
LogicalResult populateFinalizeIR(mlir::PassManager &pm, const FirtoolOptions &opt)
Definition Firtool.cpp:425
LogicalResult populateCHIRRTLToLowFIRRTL(mlir::PassManager &pm, const FirtoolOptions &opt, StringRef inputFilename)
Definition Firtool.cpp:55
The InstanceGraph op interface, see InstanceGraphInterface.td for more details.