-
Notifications
You must be signed in to change notification settings - Fork 437
Expand file tree
/
Copy pathSeq.h
More file actions
85 lines (62 loc) · 2.88 KB
/
Seq.h
File metadata and controls
85 lines (62 loc) · 2.88 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
//===- Seq.h - C interface for the Seq dialect --------------------*- C -*-===//
//
// Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
// See https://llvm.org/LICENSE.txt for license information.
// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
//
//===----------------------------------------------------------------------===//
#ifndef CIRCT_C_DIALECT_SEQ_H
#define CIRCT_C_DIALECT_SEQ_H
#include "mlir-c/IR.h"
#ifdef __cplusplus
extern "C" {
#endif
MLIR_DECLARE_CAPI_DIALECT_REGISTRATION(Sequential, seq);
MLIR_CAPI_EXPORTED void registerSeqPasses(void);
/// If the type is an clock type
MLIR_CAPI_EXPORTED bool seqTypeIsAClock(MlirType type);
/// Get the TypeID is an clock type
MLIR_CAPI_EXPORTED MlirTypeID seqClockTypeGetTypeID(void);
/// Creates an seq clock type
MLIR_CAPI_EXPORTED MlirType seqClockTypeGet(MlirContext ctx);
/// If the type is an immutable type
MLIR_CAPI_EXPORTED bool seqTypeIsAImmutable(MlirType type);
/// Creates a seq immutable type
MLIR_CAPI_EXPORTED MlirType seqImmutableTypeGet(MlirType type);
/// Creates a seq immutable type
MLIR_CAPI_EXPORTED MlirType seqImmutableTypeGetInnerType(MlirType type);
/// If the type is a HLMemType
MLIR_CAPI_EXPORTED bool seqTypeIsAHLMem(MlirType type);
/// Creates a seq HLMem type
MLIR_CAPI_EXPORTED MlirType seqHLMemTypeGet(MlirContext ctx, intptr_t rank,
const int64_t *shape,
MlirType elementType);
/// Gets the element type of an HLMem type
MLIR_CAPI_EXPORTED MlirType seqHLMemTypeGetElementType(MlirType type);
/// Gets the rank of an HLMem type
MLIR_CAPI_EXPORTED intptr_t seqHLMemTypeGetRank(MlirType type);
/// Gets a pointer to the shape array of an HLMem type
/// The array length is equal to the rank.
/// The pointer remains valid as long as the MlirType exists.
MLIR_CAPI_EXPORTED const int64_t *seqHLMemTypeGetShape(MlirType type);
/// If the type is a FirMem type
MLIR_CAPI_EXPORTED bool seqTypeIsAFirMem(MlirType type);
/// Creates a seq FirMem type
/// \param maskWidth A pointer to the mask width. Pass NULL if no mask is
/// present.
MLIR_CAPI_EXPORTED MlirType seqFirMemTypeGet(MlirContext ctx, uint64_t depth,
uint32_t width,
const uint32_t *maskWidth);
/// Gets the depth of a FirMem type
MLIR_CAPI_EXPORTED uint64_t seqFirMemTypeGetDepth(MlirType type);
/// Gets the width of a FirMem type
MLIR_CAPI_EXPORTED uint32_t seqFirMemTypeGetWidth(MlirType type);
/// Returns true if the FirMem type has a mask width defined
MLIR_CAPI_EXPORTED bool seqFirMemTypeHasMask(MlirType type);
/// Gets the mask width of a FirMem type
/// Behavior is undefined if seqFirMemTypeHasMask returns false
MLIR_CAPI_EXPORTED uint32_t seqFirMemTypeGetMaskWidth(MlirType type);
#ifdef __cplusplus
}
#endif
#endif // CIRCT_C_DIALECT_SEQ_H