CIRCT 23.0.0git
Loading...
Searching...
No Matches
Seq.h
Go to the documentation of this file.
1//===- Seq.h - C interface for the Seq 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_SEQ_H
10#define CIRCT_C_DIALECT_SEQ_H
11
12#include "mlir-c/IR.h"
13
14#ifdef __cplusplus
15extern "C" {
16#endif
17
19MLIR_CAPI_EXPORTED void registerSeqPasses(void);
20
21/// If the type is an clock type
22MLIR_CAPI_EXPORTED bool seqTypeIsAClock(MlirType type);
23
24/// Creates an seq clock type
25MLIR_CAPI_EXPORTED MlirType seqClockTypeGet(MlirContext ctx);
26
27/// If the type is an immutable type
28MLIR_CAPI_EXPORTED bool seqTypeIsAImmutable(MlirType type);
29
30/// Creates a seq immutable type
31MLIR_CAPI_EXPORTED MlirType seqImmutableTypeGet(MlirType type);
32
33/// Creates a seq immutable type
34MLIR_CAPI_EXPORTED MlirType seqImmutableTypeGetInnerType(MlirType type);
35
36/// If the type is a HLMemType
37MLIR_CAPI_EXPORTED bool seqTypeIsAHLMem(MlirType type);
38
39/// Creates a seq HLMem type
40MLIR_CAPI_EXPORTED MlirType seqHLMemTypeGet(MlirContext ctx, intptr_t rank,
41 const int64_t *shape,
42 MlirType elementType);
43
44/// Gets the element type of an HLMem type
45MLIR_CAPI_EXPORTED MlirType seqHLMemTypeGetElementType(MlirType type);
46
47/// Gets the rank of an HLMem type
48MLIR_CAPI_EXPORTED intptr_t seqHLMemTypeGetRank(MlirType type);
49
50/// Gets a pointer to the shape array of an HLMem type
51/// The array length is equal to the rank.
52/// The pointer remains valid as long as the MlirType exists.
53MLIR_CAPI_EXPORTED const int64_t *seqHLMemTypeGetShape(MlirType type);
54
55/// If the type is a FirMem type
56MLIR_CAPI_EXPORTED bool seqTypeIsAFirMem(MlirType type);
57
58/// Creates a seq FirMem type
59/// \param maskWidth A pointer to the mask width. Pass NULL if no mask is
60/// present.
61MLIR_CAPI_EXPORTED MlirType seqFirMemTypeGet(MlirContext ctx, uint64_t depth,
62 uint32_t width,
63 const uint32_t *maskWidth);
64
65/// Gets the depth of a FirMem type
66MLIR_CAPI_EXPORTED uint64_t seqFirMemTypeGetDepth(MlirType type);
67
68/// Gets the width of a FirMem type
69MLIR_CAPI_EXPORTED uint32_t seqFirMemTypeGetWidth(MlirType type);
70
71/// Returns true if the FirMem type has a mask width defined
72MLIR_CAPI_EXPORTED bool seqFirMemTypeHasMask(MlirType type);
73
74/// Gets the mask width of a FirMem type
75/// Behavior is undefined if seqFirMemTypeHasMask returns false
76MLIR_CAPI_EXPORTED uint32_t seqFirMemTypeGetMaskWidth(MlirType type);
77
78#ifdef __cplusplus
79}
80#endif
81
82#endif // CIRCT_C_DIALECT_SEQ_H
MlirType elementType
Definition CHIRRTL.cpp:29
MLIR_CAPI_EXPORTED bool seqTypeIsAClock(MlirType type)
If the type is an clock type.
Definition Seq.cpp:24
MLIR_CAPI_EXPORTED MlirType seqImmutableTypeGetInnerType(MlirType type)
Creates a seq immutable type.
Definition Seq.cpp:40
MLIR_CAPI_EXPORTED bool seqTypeIsAFirMem(MlirType type)
If the type is a FirMem type.
Definition Seq.cpp:66
MLIR_CAPI_EXPORTED void registerSeqPasses(void)
Definition Seq.cpp:22
MLIR_CAPI_EXPORTED uint64_t seqFirMemTypeGetDepth(MlirType type)
Gets the depth of a FirMem type.
Definition Seq.cpp:78
MLIR_CAPI_EXPORTED MlirType seqImmutableTypeGet(MlirType type)
Creates a seq immutable type.
Definition Seq.cpp:36
MLIR_CAPI_EXPORTED uint32_t seqFirMemTypeGetWidth(MlirType type)
Gets the width of a FirMem type.
Definition Seq.cpp:82
MLIR_CAPI_EXPORTED MlirType seqFirMemTypeGet(MlirContext ctx, uint64_t depth, uint32_t width, const uint32_t *maskWidth)
Creates a seq FirMem type.
Definition Seq.cpp:70
MLIR_CAPI_EXPORTED MlirType seqHLMemTypeGetElementType(MlirType type)
Gets the element type of an HLMem type.
Definition Seq.cpp:54
MLIR_DECLARE_CAPI_DIALECT_REGISTRATION(Sequential, seq)
MLIR_CAPI_EXPORTED bool seqTypeIsAImmutable(MlirType type)
If the type is an immutable type.
Definition Seq.cpp:32
MLIR_CAPI_EXPORTED intptr_t seqHLMemTypeGetRank(MlirType type)
Gets the rank of an HLMem type.
Definition Seq.cpp:58
MLIR_CAPI_EXPORTED bool seqTypeIsAHLMem(MlirType type)
If the type is a HLMemType.
Definition Seq.cpp:44
MLIR_CAPI_EXPORTED bool seqFirMemTypeHasMask(MlirType type)
Returns true if the FirMem type has a mask width defined.
Definition Seq.cpp:86
MLIR_CAPI_EXPORTED MlirType seqHLMemTypeGet(MlirContext ctx, intptr_t rank, const int64_t *shape, MlirType elementType)
Creates a seq HLMem type.
Definition Seq.cpp:48
MLIR_CAPI_EXPORTED MlirType seqClockTypeGet(MlirContext ctx)
Creates an seq clock type.
Definition Seq.cpp:28
MLIR_CAPI_EXPORTED const int64_t * seqHLMemTypeGetShape(MlirType type)
Gets a pointer to the shape array of an HLMem type The array length is equal to the rank.
Definition Seq.cpp:62
MLIR_CAPI_EXPORTED uint32_t seqFirMemTypeGetMaskWidth(MlirType type)
Gets the mask width of a FirMem type Behavior is undefined if seqFirMemTypeHasMask returns false.
Definition Seq.cpp:90
Definition seq.py:1