Loading [MathJax]/jax/output/HTML-CSS/config.js
CIRCT 21.0.0git
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
RTGTest.cpp
Go to the documentation of this file.
1//===- RTGTest.cpp - C interface for the RTGTest dialect ------------------===//
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
13
14#include "mlir/CAPI/Registration.h"
15
16using namespace circt;
17using namespace circt::rtgtest;
18
19//===----------------------------------------------------------------------===//
20// Dialect API.
21//===----------------------------------------------------------------------===//
22
23MLIR_DEFINE_CAPI_DIALECT_REGISTRATION(RTGTest, rtgtest, RTGTestDialect)
24
25//===----------------------------------------------------------------------===//
26// Type API.
27//===----------------------------------------------------------------------===//
28
29bool rtgtestTypeIsACPU(MlirType type) { return isa<CPUType>(unwrap(type)); }
30
31MlirType rtgtestCPUTypeGet(MlirContext ctxt) {
32 return wrap(CPUType::get(unwrap(ctxt)));
33}
34
35bool rtgtestTypeIsAIntegerRegister(MlirType type) {
36 return isa<IntegerRegisterType>(unwrap(type));
37}
38
39MlirType rtgtestIntegerRegisterTypeGet(MlirContext ctxt) {
40 return wrap(IntegerRegisterType::get(unwrap(ctxt)));
41}
42
43//===----------------------------------------------------------------------===//
44// Attribute API.
45//===----------------------------------------------------------------------===//
46
47bool rtgtestAttrIsACPU(MlirAttribute attr) {
48 return isa<CPUAttr>(unwrap(attr));
49}
50
51MlirAttribute rtgtestCPUAttrGet(MlirContext ctxt, unsigned id) {
52 return wrap(CPUAttr::get(unwrap(ctxt), id));
53}
54
55unsigned rtgtestCPUAttrGetId(MlirAttribute attr) {
56 return cast<CPUAttr>(unwrap(attr)).getId();
57}
58
59// Registers
60//===----------------------------------------------------------------------===//
61
62bool rtgtestAttrIsARegZero(MlirAttribute attr) {
63 return isa<RegZeroAttr>(unwrap(attr));
64}
65
66MlirAttribute rtgtestRegZeroAttrGet(MlirContext ctxt) {
67 return wrap(RegZeroAttr::get(unwrap(ctxt)));
68}
69
70bool rtgtestAttrIsARegRa(MlirAttribute attr) {
71 return isa<RegRaAttr>(unwrap(attr));
72}
73
74MlirAttribute rtgtestRegRaAttrGet(MlirContext ctxt) {
75 return wrap(RegRaAttr::get(unwrap(ctxt)));
76}
77
78bool rtgtestAttrIsARegSp(MlirAttribute attr) {
79 return isa<RegSpAttr>(unwrap(attr));
80}
81
82MlirAttribute rtgtestRegSpAttrGet(MlirContext ctxt) {
83 return wrap(RegSpAttr::get(unwrap(ctxt)));
84}
85
86bool rtgtestAttrIsARegGp(MlirAttribute attr) {
87 return isa<RegGpAttr>(unwrap(attr));
88}
89
90MlirAttribute rtgtestRegGpAttrGet(MlirContext ctxt) {
91 return wrap(RegGpAttr::get(unwrap(ctxt)));
92}
93
94bool rtgtestAttrIsARegTp(MlirAttribute attr) {
95 return isa<RegTpAttr>(unwrap(attr));
96}
97
98MlirAttribute rtgtestRegTpAttrGet(MlirContext ctxt) {
99 return wrap(RegTpAttr::get(unwrap(ctxt)));
100}
101
102bool rtgtestAttrIsARegT0(MlirAttribute attr) {
103 return isa<RegT0Attr>(unwrap(attr));
104}
105
106MlirAttribute rtgtestRegT0AttrGet(MlirContext ctxt) {
107 return wrap(RegT0Attr::get(unwrap(ctxt)));
108}
109
110bool rtgtestAttrIsARegT1(MlirAttribute attr) {
111 return isa<RegT1Attr>(unwrap(attr));
112}
113
114MlirAttribute rtgtestRegT1AttrGet(MlirContext ctxt) {
115 return wrap(RegT1Attr::get(unwrap(ctxt)));
116}
117
118bool rtgtestAttrIsARegT2(MlirAttribute attr) {
119 return isa<RegT2Attr>(unwrap(attr));
120}
121
122MlirAttribute rtgtestRegT2AttrGet(MlirContext ctxt) {
123 return wrap(RegT2Attr::get(unwrap(ctxt)));
124}
125
126bool rtgtestAttrIsARegS0(MlirAttribute attr) {
127 return isa<RegS0Attr>(unwrap(attr));
128}
129
130MlirAttribute rtgtestRegS0AttrGet(MlirContext ctxt) {
131 return wrap(RegS0Attr::get(unwrap(ctxt)));
132}
133
134bool rtgtestAttrIsARegS1(MlirAttribute attr) {
135 return isa<RegS1Attr>(unwrap(attr));
136}
137
138MlirAttribute rtgtestRegS1AttrGet(MlirContext ctxt) {
139 return wrap(RegS1Attr::get(unwrap(ctxt)));
140}
141
142bool rtgtestAttrIsARegA0(MlirAttribute attr) {
143 return isa<RegA0Attr>(unwrap(attr));
144}
145
146MlirAttribute rtgtestRegA0AttrGet(MlirContext ctxt) {
147 return wrap(RegA0Attr::get(unwrap(ctxt)));
148}
149
150bool rtgtestAttrIsARegA1(MlirAttribute attr) {
151 return isa<RegA1Attr>(unwrap(attr));
152}
153
154MlirAttribute rtgtestRegA1AttrGet(MlirContext ctxt) {
155 return wrap(RegA1Attr::get(unwrap(ctxt)));
156}
157
158bool rtgtestAttrIsARegA2(MlirAttribute attr) {
159 return isa<RegA2Attr>(unwrap(attr));
160}
161
162MlirAttribute rtgtestRegA2AttrGet(MlirContext ctxt) {
163 return wrap(RegA2Attr::get(unwrap(ctxt)));
164}
165
166bool rtgtestAttrIsARegA3(MlirAttribute attr) {
167 return isa<RegA3Attr>(unwrap(attr));
168}
169
170MlirAttribute rtgtestRegA3AttrGet(MlirContext ctxt) {
171 return wrap(RegA3Attr::get(unwrap(ctxt)));
172}
173
174bool rtgtestAttrIsARegA4(MlirAttribute attr) {
175 return isa<RegA4Attr>(unwrap(attr));
176}
177
178MlirAttribute rtgtestRegA4AttrGet(MlirContext ctxt) {
179 return wrap(RegA4Attr::get(unwrap(ctxt)));
180}
181
182bool rtgtestAttrIsARegA5(MlirAttribute attr) {
183 return isa<RegA5Attr>(unwrap(attr));
184}
185
186MlirAttribute rtgtestRegA5AttrGet(MlirContext ctxt) {
187 return wrap(RegA5Attr::get(unwrap(ctxt)));
188}
189
190bool rtgtestAttrIsARegA6(MlirAttribute attr) {
191 return isa<RegA6Attr>(unwrap(attr));
192}
193
194MlirAttribute rtgtestRegA6AttrGet(MlirContext ctxt) {
195 return wrap(RegA6Attr::get(unwrap(ctxt)));
196}
197
198bool rtgtestAttrIsARegA7(MlirAttribute attr) {
199 return isa<RegA7Attr>(unwrap(attr));
200}
201
202MlirAttribute rtgtestRegA7AttrGet(MlirContext ctxt) {
203 return wrap(RegA7Attr::get(unwrap(ctxt)));
204}
205
206bool rtgtestAttrIsARegS2(MlirAttribute attr) {
207 return isa<RegS2Attr>(unwrap(attr));
208}
209
210MlirAttribute rtgtestRegS2AttrGet(MlirContext ctxt) {
211 return wrap(RegS2Attr::get(unwrap(ctxt)));
212}
213
214bool rtgtestAttrIsARegS3(MlirAttribute attr) {
215 return isa<RegS3Attr>(unwrap(attr));
216}
217
218MlirAttribute rtgtestRegS3AttrGet(MlirContext ctxt) {
219 return wrap(RegS3Attr::get(unwrap(ctxt)));
220}
221
222bool rtgtestAttrIsARegS4(MlirAttribute attr) {
223 return isa<RegS4Attr>(unwrap(attr));
224}
225
226MlirAttribute rtgtestRegS4AttrGet(MlirContext ctxt) {
227 return wrap(RegS4Attr::get(unwrap(ctxt)));
228}
229
230bool rtgtestAttrIsARegS5(MlirAttribute attr) {
231 return isa<RegS5Attr>(unwrap(attr));
232}
233
234MlirAttribute rtgtestRegS5AttrGet(MlirContext ctxt) {
235 return wrap(RegS5Attr::get(unwrap(ctxt)));
236}
237
238bool rtgtestAttrIsARegS6(MlirAttribute attr) {
239 return isa<RegS6Attr>(unwrap(attr));
240}
241
242MlirAttribute rtgtestRegS6AttrGet(MlirContext ctxt) {
243 return wrap(RegS6Attr::get(unwrap(ctxt)));
244}
245
246bool rtgtestAttrIsARegS7(MlirAttribute attr) {
247 return isa<RegS7Attr>(unwrap(attr));
248}
249
250MlirAttribute rtgtestRegS7AttrGet(MlirContext ctxt) {
251 return wrap(RegS7Attr::get(unwrap(ctxt)));
252}
253
254bool rtgtestAttrIsARegS8(MlirAttribute attr) {
255 return isa<RegS8Attr>(unwrap(attr));
256}
257
258MlirAttribute rtgtestRegS8AttrGet(MlirContext ctxt) {
259 return wrap(RegS8Attr::get(unwrap(ctxt)));
260}
261
262bool rtgtestAttrIsARegS9(MlirAttribute attr) {
263 return isa<RegS9Attr>(unwrap(attr));
264}
265
266MlirAttribute rtgtestRegS9AttrGet(MlirContext ctxt) {
267 return wrap(RegS9Attr::get(unwrap(ctxt)));
268}
269
270bool rtgtestAttrIsARegS10(MlirAttribute attr) {
271 return isa<RegS10Attr>(unwrap(attr));
272}
273
274MlirAttribute rtgtestRegS10AttrGet(MlirContext ctxt) {
275 return wrap(RegS10Attr::get(unwrap(ctxt)));
276}
277
278bool rtgtestAttrIsARegS11(MlirAttribute attr) {
279 return isa<RegS11Attr>(unwrap(attr));
280}
281
282MlirAttribute rtgtestRegS11AttrGet(MlirContext ctxt) {
283 return wrap(RegS11Attr::get(unwrap(ctxt)));
284}
285
286bool rtgtestAttrIsARegT3(MlirAttribute attr) {
287 return isa<RegT3Attr>(unwrap(attr));
288}
289
290MlirAttribute rtgtestRegT3AttrGet(MlirContext ctxt) {
291 return wrap(RegT3Attr::get(unwrap(ctxt)));
292}
293
294bool rtgtestAttrIsARegT4(MlirAttribute attr) {
295 return isa<RegT4Attr>(unwrap(attr));
296}
297
298MlirAttribute rtgtestRegT4AttrGet(MlirContext ctxt) {
299 return wrap(RegT4Attr::get(unwrap(ctxt)));
300}
301
302bool rtgtestAttrIsARegT5(MlirAttribute attr) {
303 return isa<RegT5Attr>(unwrap(attr));
304}
305
306MlirAttribute rtgtestRegT5AttrGet(MlirContext ctxt) {
307 return wrap(RegT5Attr::get(unwrap(ctxt)));
308}
309
310bool rtgtestAttrIsARegT6(MlirAttribute attr) {
311 return isa<RegT6Attr>(unwrap(attr));
312}
313
314MlirAttribute rtgtestRegT6AttrGet(MlirContext ctxt) {
315 return wrap(RegT6Attr::get(unwrap(ctxt)));
316}
return wrap(CMemoryType::get(unwrap(ctx), baseType, numElements))
MLIR_DEFINE_CAPI_DIALECT_REGISTRATION(CHIRRTL, chirrtl, circt::chirrtl::CHIRRTLDialect) MlirType chirrtlTypeGetCMemory(MlirContext ctx
static EvaluatorValuePtr unwrap(OMEvaluatorValue c)
Definition OM.cpp:116
bool rtgtestAttrIsARegS3(MlirAttribute attr)
If the attribute is an RTGTest RegS3Attr.
Definition RTGTest.cpp:214
MlirAttribute rtgtestRegS9AttrGet(MlirContext ctxt)
Creates an RTGTest RegS9 attribute in the context.
Definition RTGTest.cpp:266
bool rtgtestAttrIsARegT2(MlirAttribute attr)
If the attribute is an RTGTest RegT2Attr.
Definition RTGTest.cpp:118
MlirAttribute rtgtestRegT0AttrGet(MlirContext ctxt)
Creates an RTGTest RegT0 attribute in the context.
Definition RTGTest.cpp:106
MlirAttribute rtgtestRegSpAttrGet(MlirContext ctxt)
Creates an RTGTest RegSp attribute in the context.
Definition RTGTest.cpp:82
bool rtgtestAttrIsARegA6(MlirAttribute attr)
If the attribute is an RTGTest RegA6Attr.
Definition RTGTest.cpp:190
MlirAttribute rtgtestRegA1AttrGet(MlirContext ctxt)
Creates an RTGTest RegA1 attribute in the context.
Definition RTGTest.cpp:154
MlirAttribute rtgtestRegT5AttrGet(MlirContext ctxt)
Creates an RTGTest RegT5 attribute in the context.
Definition RTGTest.cpp:306
MlirAttribute rtgtestRegZeroAttrGet(MlirContext ctxt)
Creates an RTGTest RegZero attribute in the context.
Definition RTGTest.cpp:66
MlirAttribute rtgtestRegS1AttrGet(MlirContext ctxt)
Creates an RTGTest RegS1 attribute in the context.
Definition RTGTest.cpp:138
bool rtgtestAttrIsARegS6(MlirAttribute attr)
If the attribute is an RTGTest RegS6Attr.
Definition RTGTest.cpp:238
MlirAttribute rtgtestRegS7AttrGet(MlirContext ctxt)
Creates an RTGTest RegS7 attribute in the context.
Definition RTGTest.cpp:250
bool rtgtestAttrIsARegS2(MlirAttribute attr)
If the attribute is an RTGTest RegS2Attr.
Definition RTGTest.cpp:206
MlirAttribute rtgtestRegT4AttrGet(MlirContext ctxt)
Creates an RTGTest RegT4 attribute in the context.
Definition RTGTest.cpp:298
MlirAttribute rtgtestRegS8AttrGet(MlirContext ctxt)
Creates an RTGTest RegS8 attribute in the context.
Definition RTGTest.cpp:258
bool rtgtestAttrIsARegA1(MlirAttribute attr)
If the attribute is an RTGTest RegA1Attr.
Definition RTGTest.cpp:150
bool rtgtestAttrIsARegA3(MlirAttribute attr)
If the attribute is an RTGTest RegA3Attr.
Definition RTGTest.cpp:166
bool rtgtestAttrIsARegZero(MlirAttribute attr)
If the type is an RTGTest RegZeroAttr.
Definition RTGTest.cpp:62
MlirAttribute rtgtestRegA0AttrGet(MlirContext ctxt)
Creates an RTGTest RegA0 attribute in the context.
Definition RTGTest.cpp:146
bool rtgtestAttrIsARegA0(MlirAttribute attr)
If the attribute is an RTGTest RegA0Attr.
Definition RTGTest.cpp:142
bool rtgtestAttrIsARegS4(MlirAttribute attr)
If the attribute is an RTGTest RegS4Attr.
Definition RTGTest.cpp:222
MlirAttribute rtgtestRegT1AttrGet(MlirContext ctxt)
Creates an RTGTest RegT1 attribute in the context.
Definition RTGTest.cpp:114
bool rtgtestAttrIsARegT0(MlirAttribute attr)
If the attribute is an RTGTest RegT0Attr.
Definition RTGTest.cpp:102
bool rtgtestTypeIsAIntegerRegister(MlirType type)
If the type is an RTGTest IntegerRegisterType.
Definition RTGTest.cpp:35
MlirAttribute rtgtestRegS3AttrGet(MlirContext ctxt)
Creates an RTGTest RegS3 attribute in the context.
Definition RTGTest.cpp:218
bool rtgtestAttrIsARegS9(MlirAttribute attr)
If the attribute is an RTGTest RegS9Attr.
Definition RTGTest.cpp:262
bool rtgtestAttrIsARegT4(MlirAttribute attr)
If the attribute is an RTGTest RegT4Attr.
Definition RTGTest.cpp:294
MlirAttribute rtgtestRegS2AttrGet(MlirContext ctxt)
Creates an RTGTest RegS2 attribute in the context.
Definition RTGTest.cpp:210
MlirAttribute rtgtestRegT2AttrGet(MlirContext ctxt)
Creates an RTGTest RegT2 attribute in the context.
Definition RTGTest.cpp:122
bool rtgtestTypeIsACPU(MlirType type)
If the type is an RTGTest CPUType.
Definition RTGTest.cpp:29
bool rtgtestAttrIsARegS10(MlirAttribute attr)
If the attribute is an RTGTest RegS10Attr.
Definition RTGTest.cpp:270
MlirAttribute rtgtestRegA6AttrGet(MlirContext ctxt)
Creates an RTGTest RegA6 attribute in the context.
Definition RTGTest.cpp:194
MlirAttribute rtgtestRegS10AttrGet(MlirContext ctxt)
Creates an RTGTest RegS10 attribute in the context.
Definition RTGTest.cpp:274
MlirAttribute rtgtestCPUAttrGet(MlirContext ctxt, unsigned id)
Creates an RTGTest CPU attribute in the context.
Definition RTGTest.cpp:51
MlirAttribute rtgtestRegS5AttrGet(MlirContext ctxt)
Creates an RTGTest RegS5 attribute in the context.
Definition RTGTest.cpp:234
bool rtgtestAttrIsARegT6(MlirAttribute attr)
If the attribute is an RTGTest RegT6Attr.
Definition RTGTest.cpp:310
bool rtgtestAttrIsARegS0(MlirAttribute attr)
If the attribute is an RTGTest RegS0Attr.
Definition RTGTest.cpp:126
MlirType rtgtestIntegerRegisterTypeGet(MlirContext ctxt)
Creates an RTGTest IntegerRegisterType in the context.
Definition RTGTest.cpp:39
MlirAttribute rtgtestRegT3AttrGet(MlirContext ctxt)
Creates an RTGTest RegT3 attribute in the context.
Definition RTGTest.cpp:290
MlirAttribute rtgtestRegRaAttrGet(MlirContext ctxt)
Creates an RTGTest RegRa attribute in the context.
Definition RTGTest.cpp:74
bool rtgtestAttrIsACPU(MlirAttribute attr)
If the type is an RTGTest CPUAttr.
Definition RTGTest.cpp:47
MlirType rtgtestCPUTypeGet(MlirContext ctxt)
Creates an RTGTest CPU type in the context.
Definition RTGTest.cpp:31
bool rtgtestAttrIsARegSp(MlirAttribute attr)
If the attribute is an RTGTest RegSpAttr.
Definition RTGTest.cpp:78
bool rtgtestAttrIsARegTp(MlirAttribute attr)
If the attribute is an RTGTest RegTpAttr.
Definition RTGTest.cpp:94
bool rtgtestAttrIsARegGp(MlirAttribute attr)
If the attribute is an RTGTest RegGpAttr.
Definition RTGTest.cpp:86
MlirAttribute rtgtestRegA2AttrGet(MlirContext ctxt)
Creates an RTGTest RegA2 attribute in the context.
Definition RTGTest.cpp:162
bool rtgtestAttrIsARegA7(MlirAttribute attr)
If the attribute is an RTGTest RegA7Attr.
Definition RTGTest.cpp:198
MlirAttribute rtgtestRegTpAttrGet(MlirContext ctxt)
Creates an RTGTest RegTp attribute in the context.
Definition RTGTest.cpp:98
bool rtgtestAttrIsARegS5(MlirAttribute attr)
If the attribute is an RTGTest RegS5Attr.
Definition RTGTest.cpp:230
MlirAttribute rtgtestRegT6AttrGet(MlirContext ctxt)
Creates an RTGTest RegT6 attribute in the context.
Definition RTGTest.cpp:314
bool rtgtestAttrIsARegA5(MlirAttribute attr)
If the attribute is an RTGTest RegA5Attr.
Definition RTGTest.cpp:182
MlirAttribute rtgtestRegS11AttrGet(MlirContext ctxt)
Creates an RTGTest RegS11 attribute in the context.
Definition RTGTest.cpp:282
MlirAttribute rtgtestRegA5AttrGet(MlirContext ctxt)
Creates an RTGTest RegA5 attribute in the context.
Definition RTGTest.cpp:186
MlirAttribute rtgtestRegGpAttrGet(MlirContext ctxt)
Creates an RTGTest RegGp attribute in the context.
Definition RTGTest.cpp:90
bool rtgtestAttrIsARegS7(MlirAttribute attr)
If the attribute is an RTGTest RegS7Attr.
Definition RTGTest.cpp:246
MlirAttribute rtgtestRegA7AttrGet(MlirContext ctxt)
Creates an RTGTest RegA7 attribute in the context.
Definition RTGTest.cpp:202
MlirAttribute rtgtestRegS0AttrGet(MlirContext ctxt)
Creates an RTGTest RegS0 attribute in the context.
Definition RTGTest.cpp:130
bool rtgtestAttrIsARegRa(MlirAttribute attr)
If the attribute is an RTGTest RegRaAttr.
Definition RTGTest.cpp:70
MlirAttribute rtgtestRegA4AttrGet(MlirContext ctxt)
Creates an RTGTest RegA4 attribute in the context.
Definition RTGTest.cpp:178
MlirAttribute rtgtestRegA3AttrGet(MlirContext ctxt)
Creates an RTGTest RegA3 attribute in the context.
Definition RTGTest.cpp:170
bool rtgtestAttrIsARegT1(MlirAttribute attr)
If the attribute is an RTGTest RegT1Attr.
Definition RTGTest.cpp:110
bool rtgtestAttrIsARegA2(MlirAttribute attr)
If the attribute is an RTGTest RegA2Attr.
Definition RTGTest.cpp:158
MlirAttribute rtgtestRegS4AttrGet(MlirContext ctxt)
Creates an RTGTest RegS4 attribute in the context.
Definition RTGTest.cpp:226
bool rtgtestAttrIsARegS11(MlirAttribute attr)
If the attribute is an RTGTest RegS11Attr.
Definition RTGTest.cpp:278
bool rtgtestAttrIsARegS1(MlirAttribute attr)
If the attribute is an RTGTest RegS1Attr.
Definition RTGTest.cpp:134
bool rtgtestAttrIsARegA4(MlirAttribute attr)
If the attribute is an RTGTest RegA4Attr.
Definition RTGTest.cpp:174
bool rtgtestAttrIsARegT3(MlirAttribute attr)
If the attribute is an RTGTest RegT3Attr.
Definition RTGTest.cpp:286
bool rtgtestAttrIsARegS8(MlirAttribute attr)
If the attribute is an RTGTest RegS8Attr.
Definition RTGTest.cpp:254
MlirAttribute rtgtestRegS6AttrGet(MlirContext ctxt)
Creates an RTGTest RegS6 attribute in the context.
Definition RTGTest.cpp:242
bool rtgtestAttrIsARegT5(MlirAttribute attr)
If the attribute is an RTGTest RegT5Attr.
Definition RTGTest.cpp:302
unsigned rtgtestCPUAttrGetId(MlirAttribute attr)
Returns the core ID represented by the CPU attribute.
Definition RTGTest.cpp:55
The InstanceGraph op interface, see InstanceGraphInterface.td for more details.