Loading [MathJax]/jax/output/HTML-CSS/config.js
CIRCT 21.0.0git
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
RTG.h
Go to the documentation of this file.
1//===- RTG.h - C interface for the for RTG dialect ----------------*- C -*-===//
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_RTG_H
10#define CIRCT_C_DIALECT_RTG_H
11
12#include "mlir-c/IR.h"
13
14#ifdef __cplusplus
15extern "C" {
16#endif
17
18//===----------------------------------------------------------------------===//
19// Dialect API.
20//===----------------------------------------------------------------------===//
21
23MLIR_CAPI_EXPORTED void registerRTGPasses(void);
24
25//===----------------------------------------------------------------------===//
26// Type API.
27//===----------------------------------------------------------------------===//
28
29/// If the type is an RTG sequence.
30MLIR_CAPI_EXPORTED bool rtgTypeIsASequence(MlirType type);
31
32/// Creates an RTG sequence type in the context.
33MLIR_CAPI_EXPORTED MlirType rtgSequenceTypeGet(MlirContext ctxt,
34 intptr_t numElements,
35 MlirType const *elementTypes);
36
37/// The number of substitution elements of the RTG sequence.
38MLIR_CAPI_EXPORTED unsigned rtgSequenceTypeGetNumElements(MlirType type);
39
40/// The type of of the substitution element at the given index.
41MLIR_CAPI_EXPORTED MlirType rtgSequenceTypeGetElement(MlirType type,
42 unsigned i);
43
44/// If the type is an RTG randomized sequence.
45MLIR_CAPI_EXPORTED bool rtgTypeIsARandomizedSequence(MlirType type);
46
47/// Creates an RTG randomized sequence type in the context.
48MLIR_CAPI_EXPORTED MlirType rtgRandomizedSequenceTypeGet(MlirContext ctxt);
49
50/// If the type is an RTG label.
51MLIR_CAPI_EXPORTED bool rtgTypeIsALabel(MlirType type);
52
53/// Creates an RTG mode type in the context.
54MLIR_CAPI_EXPORTED MlirType rtgLabelTypeGet(MlirContext ctxt);
55
56/// If the type is an RTG set.
57MLIR_CAPI_EXPORTED bool rtgTypeIsASet(MlirType type);
58
59/// Creates an RTG set type in the context.
60MLIR_CAPI_EXPORTED MlirType rtgSetTypeGet(MlirType elementType);
61
62/// Return the element type of the RTG set.
63MLIR_CAPI_EXPORTED MlirType rtgSetTypeGetElementType(MlirType type);
64
65/// If the type is an RTG bag.
66MLIR_CAPI_EXPORTED bool rtgTypeIsABag(MlirType type);
67
68/// Creates an RTG bag type in the context.
69MLIR_CAPI_EXPORTED MlirType rtgBagTypeGet(MlirType elementType);
70
71/// Return the element type of the RTG bag.
72MLIR_CAPI_EXPORTED MlirType rtgBagTypeGetElementType(MlirType type);
73
74/// If the type is an RTG dict.
75MLIR_CAPI_EXPORTED bool rtgTypeIsADict(MlirType type);
76
77/// Creates an RTG dict type in the context.
78MLIR_CAPI_EXPORTED MlirType rtgDictTypeGet(MlirContext ctxt,
79 intptr_t numEntries,
80 MlirAttribute const *entryNames,
81 MlirType const *entryTypes);
82
83/// If the type is an RTG immediate.
84MLIR_CAPI_EXPORTED bool rtgTypeIsAImmediate(MlirType type);
85
86/// Creates an RTG immediate type in the context.
87MLIR_CAPI_EXPORTED MlirType rtgImmediateTypeGet(MlirContext ctx,
88 uint32_t width);
89
90/// Returns the width of the RTG immediate type.
91MLIR_CAPI_EXPORTED uint32_t rtgImmediateTypeGetWidth(MlirType type);
92
93/// Creates an RTG array type in the context.
94MLIR_CAPI_EXPORTED MlirType rtgArrayTypeGet(MlirType elementType);
95
96/// If the type is an RTG array.
97MLIR_CAPI_EXPORTED bool rtgTypeIsAArray(MlirType type);
98
99/// Returns the element type of the RTG array.
100MLIR_CAPI_EXPORTED MlirType rtgArrayTypeGetElementType(MlirType type);
101
102/// If the type is an RTG memory.
103MLIR_CAPI_EXPORTED bool rtgTypeIsAMemory(MlirType type);
104
105/// Creates an RTG memory type in the context.
106MLIR_CAPI_EXPORTED MlirType rtgMemoryTypeGet(MlirContext ctx,
107 uint32_t addressWidth);
108
109/// Returns the address with of an RTG memory type.
110MLIR_CAPI_EXPORTED uint32_t rtgMemoryTypeGetAddressWidth(MlirType type);
111
112/// If the type is an RTG memory block.
113MLIR_CAPI_EXPORTED bool rtgTypeIsAMemoryBlock(MlirType type);
114
115/// Creates an RTG memory block type in the context.
116MLIR_CAPI_EXPORTED MlirType rtgMemoryBlockTypeGet(MlirContext ctx,
117 uint32_t addressWidth);
118
119/// Returns the address with of an RTG memory block type.
120MLIR_CAPI_EXPORTED uint32_t rtgMemoryBlockTypeGetAddressWidth(MlirType type);
121
122//===----------------------------------------------------------------------===//
123// Attribute API.
124//===----------------------------------------------------------------------===//
125
132
133/// If the attribute is an RTG label visibility.
134MLIR_CAPI_EXPORTED bool rtgAttrIsALabelVisibilityAttr(MlirAttribute attr);
135
136/// Get the RTG label visibility from the attribute.
137MLIR_CAPI_EXPORTED RTGLabelVisibility
138rtgLabelVisibilityAttrGetValue(MlirAttribute attr);
139
140/// Creates an RTG label visibility attribute in the context.
141MLIR_CAPI_EXPORTED MlirAttribute
142rtgLabelVisibilityAttrGet(MlirContext ctxt, RTGLabelVisibility visibility);
143
144/// If the attribute is an RTG default context.
145MLIR_CAPI_EXPORTED bool rtgAttrIsADefaultContextAttr(MlirAttribute attr);
146
147/// Creates an RTG default context attribute in the context.
148MLIR_CAPI_EXPORTED MlirAttribute rtgDefaultContextAttrGet(MlirContext ctxt,
149 MlirType type);
150
151/// Checks if the attribute is an RTG immediate attribute.
152MLIR_CAPI_EXPORTED bool rtgAttrIsAImmediate(MlirAttribute attr);
153
154/// Creates an RTG immediate attribute in the context with the given width and
155/// value.
156MLIR_CAPI_EXPORTED MlirAttribute rtgImmediateAttrGet(MlirContext ctx,
157 uint32_t width,
158 uint64_t value);
159
160/// Returns the width of the RTG immediate attribute.
161MLIR_CAPI_EXPORTED uint32_t rtgImmediateAttrGetWidth(MlirAttribute attr);
162
163/// Returns the value of the RTG immediate attribute.
164MLIR_CAPI_EXPORTED uint64_t rtgImmediateAttrGetValue(MlirAttribute attr);
165
166/// If the attribute is an RTG any context attribute.
167MLIR_CAPI_EXPORTED bool rtgAttrIsAAnyContextAttr(MlirAttribute attr);
168
169/// Creates an RTG any context attribute in the context.
170MLIR_CAPI_EXPORTED MlirAttribute rtgAnyContextAttrGet(MlirContext ctxt,
171 MlirType type);
172
173#ifdef __cplusplus
174}
175#endif
176
177#endif // CIRCT_C_DIALECT_RTG_H
MlirType uint64_t numElements
Definition CHIRRTL.cpp:30
MlirType elementType
Definition CHIRRTL.cpp:29
MLIR_CAPI_EXPORTED MlirAttribute rtgAnyContextAttrGet(MlirContext ctxt, MlirType type)
Creates an RTG any context attribute in the context.
Definition RTG.cpp:256
MLIR_CAPI_EXPORTED bool rtgTypeIsAMemory(MlirType type)
If the type is an RTG memory.
Definition RTG.cpp:153
MLIR_CAPI_EXPORTED bool rtgAttrIsAAnyContextAttr(MlirAttribute attr)
If the attribute is an RTG any context attribute.
Definition RTG.cpp:252
MLIR_CAPI_EXPORTED MlirType rtgLabelTypeGet(MlirContext ctxt)
Creates an RTG mode type in the context.
Definition RTG.cpp:71
MLIR_CAPI_EXPORTED RTGLabelVisibility rtgLabelVisibilityAttrGetValue(MlirAttribute attr)
Get the RTG label visibility from the attribute.
Definition RTG.cpp:200
MLIR_CAPI_EXPORTED uint32_t rtgImmediateAttrGetWidth(MlirAttribute attr)
Returns the width of the RTG immediate attribute.
Definition RTG.cpp:241
RTGLabelVisibility
Definition RTG.h:126
@ RTG_LABEL_VISIBILITY_EXTERNAL
Definition RTG.h:129
@ RTG_LABEL_VISIBILITY_GLOBAL
Definition RTG.h:128
@ RTG_LABEL_VISIBILITY_LOCAL
Definition RTG.h:127
MLIR_CAPI_EXPORTED MlirType rtgSequenceTypeGetElement(MlirType type, unsigned i)
The type of of the substitution element at the given index.
Definition RTG.cpp:51
MLIR_CAPI_EXPORTED MlirAttribute rtgDefaultContextAttrGet(MlirContext ctxt, MlirType type)
Creates an RTG default context attribute in the context.
Definition RTG.cpp:189
MLIR_CAPI_EXPORTED MlirType rtgImmediateTypeGet(MlirContext ctx, uint32_t width)
Creates an RTG immediate type in the context.
Definition RTG.cpp:142
MLIR_CAPI_EXPORTED uint32_t rtgMemoryTypeGetAddressWidth(MlirType type)
Returns the address with of an RTG memory type.
Definition RTG.cpp:159
MLIR_CAPI_EXPORTED bool rtgTypeIsAArray(MlirType type)
If the type is an RTG array.
Definition RTG.cpp:129
MLIR_CAPI_EXPORTED bool rtgAttrIsALabelVisibilityAttr(MlirAttribute attr)
If the attribute is an RTG label visibility.
Definition RTG.cpp:196
MLIR_DECLARE_CAPI_DIALECT_REGISTRATION(RTG, rtg)
MLIR_CAPI_EXPORTED MlirAttribute rtgLabelVisibilityAttrGet(MlirContext ctxt, RTGLabelVisibility visibility)
Creates an RTG label visibility attribute in the context.
Definition RTG.cpp:214
MLIR_CAPI_EXPORTED void registerRTGPasses(void)
Definition RTG.cpp:26
MLIR_CAPI_EXPORTED MlirType rtgArrayTypeGetElementType(MlirType type)
Returns the element type of the RTG array.
Definition RTG.cpp:131
MLIR_CAPI_EXPORTED bool rtgTypeIsABag(MlirType type)
If the type is an RTG bag.
Definition RTG.cpp:92
MLIR_CAPI_EXPORTED MlirType rtgSequenceTypeGet(MlirContext ctxt, intptr_t numElements, MlirType const *elementTypes)
Creates an RTG sequence type in the context.
Definition RTG.cpp:39
MLIR_CAPI_EXPORTED MlirAttribute rtgImmediateAttrGet(MlirContext ctx, uint32_t width, uint64_t value)
Creates an RTG immediate attribute in the context with the given width and value.
Definition RTG.cpp:236
MLIR_CAPI_EXPORTED unsigned rtgSequenceTypeGetNumElements(MlirType type)
The number of substitution elements of the RTG sequence.
Definition RTG.cpp:47
MLIR_CAPI_EXPORTED MlirType rtgSetTypeGet(MlirType elementType)
Creates an RTG set type in the context.
Definition RTG.cpp:80
MLIR_CAPI_EXPORTED bool rtgTypeIsASet(MlirType type)
If the type is an RTG set.
Definition RTG.cpp:78
MLIR_CAPI_EXPORTED MlirType rtgMemoryTypeGet(MlirContext ctx, uint32_t addressWidth)
Creates an RTG memory type in the context.
Definition RTG.cpp:155
MLIR_CAPI_EXPORTED MlirType rtgRandomizedSequenceTypeGet(MlirContext ctxt)
Creates an RTG randomized sequence type in the context.
Definition RTG.cpp:62
MLIR_CAPI_EXPORTED uint64_t rtgImmediateAttrGetValue(MlirAttribute attr)
Returns the value of the RTG immediate attribute.
Definition RTG.cpp:245
MLIR_CAPI_EXPORTED bool rtgTypeIsAMemoryBlock(MlirType type)
If the type is an RTG memory block.
Definition RTG.cpp:166
MLIR_CAPI_EXPORTED bool rtgAttrIsAImmediate(MlirAttribute attr)
Checks if the attribute is an RTG immediate attribute.
Definition RTG.cpp:232
MLIR_CAPI_EXPORTED bool rtgTypeIsARandomizedSequence(MlirType type)
If the type is an RTG randomized sequence.
Definition RTG.cpp:58
MLIR_CAPI_EXPORTED bool rtgTypeIsADict(MlirType type)
If the type is an RTG dict.
Definition RTG.cpp:106
MLIR_CAPI_EXPORTED bool rtgTypeIsAImmediate(MlirType type)
If the type is an RTG immediate.
Definition RTG.cpp:138
MLIR_CAPI_EXPORTED MlirType rtgDictTypeGet(MlirContext ctxt, intptr_t numEntries, MlirAttribute const *entryNames, MlirType const *entryTypes)
Creates an RTG dict type in the context.
Definition RTG.cpp:108
MLIR_CAPI_EXPORTED MlirType rtgBagTypeGet(MlirType elementType)
Creates an RTG bag type in the context.
Definition RTG.cpp:94
MLIR_CAPI_EXPORTED uint32_t rtgMemoryBlockTypeGetAddressWidth(MlirType type)
Returns the address with of an RTG memory block type.
Definition RTG.cpp:174
MLIR_CAPI_EXPORTED MlirType rtgArrayTypeGet(MlirType elementType)
Creates an RTG array type in the context.
Definition RTG.cpp:124
MLIR_CAPI_EXPORTED MlirType rtgBagTypeGetElementType(MlirType type)
Return the element type of the RTG bag.
Definition RTG.cpp:99
MLIR_CAPI_EXPORTED bool rtgTypeIsASequence(MlirType type)
If the type is an RTG sequence.
Definition RTG.cpp:35
MLIR_CAPI_EXPORTED bool rtgTypeIsALabel(MlirType type)
If the type is an RTG label.
Definition RTG.cpp:69
MLIR_CAPI_EXPORTED uint32_t rtgImmediateTypeGetWidth(MlirType type)
Returns the width of the RTG immediate type.
Definition RTG.cpp:146
MLIR_CAPI_EXPORTED MlirType rtgMemoryBlockTypeGet(MlirContext ctx, uint32_t addressWidth)
Creates an RTG memory block type in the context.
Definition RTG.cpp:170
MLIR_CAPI_EXPORTED MlirType rtgSetTypeGetElementType(MlirType type)
Return the element type of the RTG set.
Definition RTG.cpp:85
MLIR_CAPI_EXPORTED bool rtgAttrIsADefaultContextAttr(MlirAttribute attr)
If the attribute is an RTG default context.
Definition RTG.cpp:185
Definition rtg.py:1