Loading [MathJax]/extensions/tex2jax.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
23
24//===----------------------------------------------------------------------===//
25// Type API.
26//===----------------------------------------------------------------------===//
27
28/// If the type is an RTG sequence.
29MLIR_CAPI_EXPORTED bool rtgTypeIsASequence(MlirType type);
30
31/// Creates an RTG sequence type in the context.
32MLIR_CAPI_EXPORTED MlirType rtgSequenceTypeGet(MlirContext ctxt,
33 intptr_t numElements,
34 MlirType const *elementTypes);
35
36/// The number of substitution elements of the RTG sequence.
37MLIR_CAPI_EXPORTED unsigned rtgSequenceTypeGetNumElements(MlirType type);
38
39/// The type of of the substitution element at the given index.
40MLIR_CAPI_EXPORTED MlirType rtgSequenceTypeGetElement(MlirType type,
41 unsigned i);
42
43/// If the type is an RTG randomized sequence.
44MLIR_CAPI_EXPORTED bool rtgTypeIsARandomizedSequence(MlirType type);
45
46/// Creates an RTG randomized sequence type in the context.
47MLIR_CAPI_EXPORTED MlirType rtgRandomizedSequenceTypeGet(MlirContext ctxt);
48
49/// If the type is an RTG label.
50MLIR_CAPI_EXPORTED bool rtgTypeIsALabel(MlirType type);
51
52/// Creates an RTG mode type in the context.
53MLIR_CAPI_EXPORTED MlirType rtgLabelTypeGet(MlirContext ctxt);
54
55/// If the type is an RTG set.
56MLIR_CAPI_EXPORTED bool rtgTypeIsASet(MlirType type);
57
58/// Creates an RTG set type in the context.
59MLIR_CAPI_EXPORTED MlirType rtgSetTypeGet(MlirType elementType);
60
61/// Return the element type of the RTG set.
62MLIR_CAPI_EXPORTED MlirType rtgSetTypeGetElementType(MlirType type);
63
64/// If the type is an RTG bag.
65MLIR_CAPI_EXPORTED bool rtgTypeIsABag(MlirType type);
66
67/// Creates an RTG bag type in the context.
68MLIR_CAPI_EXPORTED MlirType rtgBagTypeGet(MlirType elementType);
69
70/// Return the element type of the RTG bag.
71MLIR_CAPI_EXPORTED MlirType rtgBagTypeGetElementType(MlirType type);
72
73/// If the type is an RTG dict.
74MLIR_CAPI_EXPORTED bool rtgTypeIsADict(MlirType type);
75
76/// Creates an RTG dict type in the context.
77MLIR_CAPI_EXPORTED MlirType rtgDictTypeGet(MlirContext ctxt,
78 intptr_t numEntries,
79 MlirAttribute const *entryNames,
80 MlirType const *entryTypes);
81
82/// If the type is an RTG immediate.
83MLIR_CAPI_EXPORTED bool rtgTypeIsAImmediate(MlirType type);
84
85/// Creates an RTG immediate type in the context.
86MLIR_CAPI_EXPORTED MlirType rtgImmediateTypeGet(MlirContext ctx,
87 uint32_t width);
88
89/// Returns the width of the RTG immediate type.
90MLIR_CAPI_EXPORTED uint32_t rtgImmediateTypeGetWidth(MlirType type);
91
92/// Creates an RTG array type in the context.
93MLIR_CAPI_EXPORTED MlirType rtgArrayTypeGet(MlirType elementType);
94
95/// If the type is an RTG array.
96MLIR_CAPI_EXPORTED bool rtgTypeIsAArray(MlirType type);
97
98/// Returns the element type of the RTG array.
99MLIR_CAPI_EXPORTED MlirType rtgArrayTypeGetElementType(MlirType type);
100
101//===----------------------------------------------------------------------===//
102// Attribute API.
103//===----------------------------------------------------------------------===//
104
111
112/// If the attribute is an RTG label visibility.
113MLIR_CAPI_EXPORTED bool rtgAttrIsALabelVisibilityAttr(MlirAttribute attr);
114
115/// Get the RTG label visibility from the attribute.
116MLIR_CAPI_EXPORTED RTGLabelVisibility
117rtgLabelVisibilityAttrGetValue(MlirAttribute attr);
118
119/// Creates an RTG label visibility attribute in the context.
120MLIR_CAPI_EXPORTED MlirAttribute
121rtgLabelVisibilityAttrGet(MlirContext ctxt, RTGLabelVisibility visibility);
122
123/// If the attribute is an RTG default context.
124MLIR_CAPI_EXPORTED bool rtgAttrIsADefaultContextAttr(MlirAttribute attr);
125
126/// Creates an RTG default context attribute in the context.
127MLIR_CAPI_EXPORTED MlirAttribute rtgDefaultContextAttrGet(MlirContext ctxt,
128 MlirType type);
129
130/// Checks if the attribute is an RTG immediate attribute.
131MLIR_CAPI_EXPORTED bool rtgAttrIsAImmediate(MlirAttribute attr);
132
133/// Creates an RTG immediate attribute in the context with the given width and
134/// value.
135MLIR_CAPI_EXPORTED MlirAttribute rtgImmediateAttrGet(MlirContext ctx,
136 uint32_t width,
137 uint64_t value);
138
139/// Returns the width of the RTG immediate attribute.
140MLIR_CAPI_EXPORTED uint32_t rtgImmediateAttrGetWidth(MlirAttribute attr);
141
142/// Returns the value of the RTG immediate attribute.
143MLIR_CAPI_EXPORTED uint64_t rtgImmediateAttrGetValue(MlirAttribute attr);
144
145#ifdef __cplusplus
146}
147#endif
148
149#endif // CIRCT_C_DIALECT_RTG_H
MlirType uint64_t numElements
Definition CHIRRTL.cpp:30
MlirType elementType
Definition CHIRRTL.cpp:29
MLIR_CAPI_EXPORTED MlirType rtgLabelTypeGet(MlirContext ctxt)
Creates an RTG mode type in the context.
Definition RTG.cpp:68
MLIR_CAPI_EXPORTED RTGLabelVisibility rtgLabelVisibilityAttrGetValue(MlirAttribute attr)
Get the RTG label visibility from the attribute.
Definition RTG.cpp:169
MLIR_CAPI_EXPORTED uint32_t rtgImmediateAttrGetWidth(MlirAttribute attr)
Returns the width of the RTG immediate attribute.
Definition RTG.cpp:210
RTGLabelVisibility
Definition RTG.h:105
@ RTG_LABEL_VISIBILITY_EXTERNAL
Definition RTG.h:108
@ RTG_LABEL_VISIBILITY_GLOBAL
Definition RTG.h:107
@ RTG_LABEL_VISIBILITY_LOCAL
Definition RTG.h:106
MLIR_CAPI_EXPORTED MlirType rtgSequenceTypeGetElement(MlirType type, unsigned i)
The type of of the substitution element at the given index.
Definition RTG.cpp:48
MLIR_CAPI_EXPORTED MlirAttribute rtgDefaultContextAttrGet(MlirContext ctxt, MlirType type)
Creates an RTG default context attribute in the context.
Definition RTG.cpp:158
MLIR_CAPI_EXPORTED MlirType rtgImmediateTypeGet(MlirContext ctx, uint32_t width)
Creates an RTG immediate type in the context.
Definition RTG.cpp:139
MLIR_CAPI_EXPORTED bool rtgTypeIsAArray(MlirType type)
If the type is an RTG array.
Definition RTG.cpp:126
MLIR_CAPI_EXPORTED bool rtgAttrIsALabelVisibilityAttr(MlirAttribute attr)
If the attribute is an RTG label visibility.
Definition RTG.cpp:165
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:183
MLIR_CAPI_EXPORTED MlirType rtgArrayTypeGetElementType(MlirType type)
Returns the element type of the RTG array.
Definition RTG.cpp:128
MLIR_CAPI_EXPORTED bool rtgTypeIsABag(MlirType type)
If the type is an RTG bag.
Definition RTG.cpp:89
MLIR_CAPI_EXPORTED MlirType rtgSequenceTypeGet(MlirContext ctxt, intptr_t numElements, MlirType const *elementTypes)
Creates an RTG sequence type in the context.
Definition RTG.cpp:36
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:205
MLIR_CAPI_EXPORTED unsigned rtgSequenceTypeGetNumElements(MlirType type)
The number of substitution elements of the RTG sequence.
Definition RTG.cpp:44
MLIR_CAPI_EXPORTED MlirType rtgSetTypeGet(MlirType elementType)
Creates an RTG set type in the context.
Definition RTG.cpp:77
MLIR_CAPI_EXPORTED bool rtgTypeIsASet(MlirType type)
If the type is an RTG set.
Definition RTG.cpp:75
MLIR_CAPI_EXPORTED MlirType rtgRandomizedSequenceTypeGet(MlirContext ctxt)
Creates an RTG randomized sequence type in the context.
Definition RTG.cpp:59
MLIR_CAPI_EXPORTED uint64_t rtgImmediateAttrGetValue(MlirAttribute attr)
Returns the value of the RTG immediate attribute.
Definition RTG.cpp:214
MLIR_CAPI_EXPORTED bool rtgAttrIsAImmediate(MlirAttribute attr)
Checks if the attribute is an RTG immediate attribute.
Definition RTG.cpp:201
MLIR_CAPI_EXPORTED bool rtgTypeIsARandomizedSequence(MlirType type)
If the type is an RTG randomized sequence.
Definition RTG.cpp:55
MLIR_CAPI_EXPORTED bool rtgTypeIsADict(MlirType type)
If the type is an RTG dict.
Definition RTG.cpp:103
MLIR_CAPI_EXPORTED bool rtgTypeIsAImmediate(MlirType type)
If the type is an RTG immediate.
Definition RTG.cpp:135
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:105
MLIR_CAPI_EXPORTED MlirType rtgBagTypeGet(MlirType elementType)
Creates an RTG bag type in the context.
Definition RTG.cpp:91
MLIR_CAPI_EXPORTED MlirType rtgArrayTypeGet(MlirType elementType)
Creates an RTG array type in the context.
Definition RTG.cpp:121
MLIR_CAPI_EXPORTED MlirType rtgBagTypeGetElementType(MlirType type)
Return the element type of the RTG bag.
Definition RTG.cpp:96
MLIR_CAPI_EXPORTED bool rtgTypeIsASequence(MlirType type)
If the type is an RTG sequence.
Definition RTG.cpp:32
MLIR_CAPI_EXPORTED bool rtgTypeIsALabel(MlirType type)
If the type is an RTG label.
Definition RTG.cpp:66
MLIR_CAPI_EXPORTED uint32_t rtgImmediateTypeGetWidth(MlirType type)
Returns the width of the RTG immediate type.
Definition RTG.cpp:143
MLIR_CAPI_EXPORTED MlirType rtgSetTypeGetElementType(MlirType type)
Return the element type of the RTG set.
Definition RTG.cpp:82
MLIR_CAPI_EXPORTED bool rtgAttrIsADefaultContextAttr(MlirAttribute attr)
If the attribute is an RTG default context.
Definition RTG.cpp:154
Definition rtg.py:1