CIRCT  19.0.0git
LLHD.h
Go to the documentation of this file.
1 //===- LLHD.h - C interface for the LLHD 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_LLHD_H
10 #define CIRCT_C_DIALECT_LLHD_H
11 
12 #include "mlir-c/IR.h"
13 
14 #ifdef __cplusplus
15 extern "C" {
16 #endif
17 
18 //===----------------------------------------------------------------------===//
19 // Dialect
20 //===----------------------------------------------------------------------===//
21 
23 
24 //===----------------------------------------------------------------------===//
25 // Types
26 //===----------------------------------------------------------------------===//
27 
28 /// Check if a type is a time type.
29 MLIR_CAPI_EXPORTED bool llhdTypeIsATimeType(MlirType);
30 /// Check if a type is a signal type.
31 MLIR_CAPI_EXPORTED bool llhdTypeIsASignalType(MlirType);
32 /// Check if a type is a pointer type.
33 MLIR_CAPI_EXPORTED bool llhdTypeIsAPointerType(MlirType);
34 
35 /// Create a time type.
36 MLIR_CAPI_EXPORTED MlirType llhdTimeTypeGet(MlirContext ctx);
37 /// Create a signal type.
38 MLIR_CAPI_EXPORTED MlirType llhdSignalTypeGet(MlirType element);
39 /// Create a pointer type.
40 MLIR_CAPI_EXPORTED MlirType llhdPointerTypeGet(MlirType element);
41 
42 /// Get the inner type of a signal.
43 MLIR_CAPI_EXPORTED MlirType llhdSignalTypeGetElementType(MlirType);
44 /// Get the inner type of a pointer.
45 MLIR_CAPI_EXPORTED MlirType llhdPointerTypeGetElementType(MlirType);
46 
47 //===----------------------------------------------------------------------===//
48 // Attributes
49 //===----------------------------------------------------------------------===//
50 
51 /// Check if an attribute is a time attribute.
52 MLIR_CAPI_EXPORTED bool llhdAttrIsATimeAttr(MlirAttribute);
53 
54 /// Create a time attribute.
55 MLIR_CAPI_EXPORTED MlirAttribute llhdTimeAttrGet(MlirContext ctx,
56  MlirStringRef timeUnit,
57  uint64_t seconds,
58  uint64_t delta,
59  uint64_t epsilon);
60 
61 /// Get the time unit of a time attribute.
62 MLIR_CAPI_EXPORTED MlirStringRef llhdTimeAttrGetTimeUnit(MlirAttribute);
63 /// Get the seconds component of a time attribute.
64 MLIR_CAPI_EXPORTED uint64_t llhdTimeAttrGetSeconds(MlirAttribute);
65 /// Get the delta component of a time attribute.
66 MLIR_CAPI_EXPORTED uint64_t llhdTimeAttrGetDelta(MlirAttribute);
67 /// Get the epsilon component of a time attribute.
68 MLIR_CAPI_EXPORTED uint64_t llhdTimeAttrGetEpsilon(MlirAttribute);
69 
70 #ifdef __cplusplus
71 }
72 #endif
73 
74 #endif // CIRCT_C_DIALECT_LLHD_H
MLIR_CAPI_EXPORTED uint64_t llhdTimeAttrGetSeconds(MlirAttribute)
Get the seconds component of a time attribute.
Definition: LLHD.cpp:88
MLIR_CAPI_EXPORTED MlirStringRef llhdTimeAttrGetTimeUnit(MlirAttribute)
Get the time unit of a time attribute.
Definition: LLHD.cpp:83
MLIR_CAPI_EXPORTED MlirType llhdTimeTypeGet(MlirContext ctx)
Create a time type.
Definition: LLHD.cpp:41
MLIR_CAPI_EXPORTED uint64_t llhdTimeAttrGetDelta(MlirAttribute)
Get the delta component of a time attribute.
Definition: LLHD.cpp:93
MLIR_CAPI_EXPORTED MlirType llhdSignalTypeGet(MlirType element)
Create a signal type.
Definition: LLHD.cpp:46
MLIR_CAPI_EXPORTED uint64_t llhdTimeAttrGetEpsilon(MlirAttribute)
Get the epsilon component of a time attribute.
Definition: LLHD.cpp:98
MLIR_CAPI_EXPORTED bool llhdTypeIsAPointerType(MlirType)
Check if a type is a pointer type.
Definition: LLHD.cpp:36
MLIR_CAPI_EXPORTED bool llhdTypeIsASignalType(MlirType)
Check if a type is a signal type.
Definition: LLHD.cpp:33
MLIR_CAPI_EXPORTED MlirType llhdPointerTypeGet(MlirType element)
Create a pointer type.
Definition: LLHD.cpp:51
MLIR_CAPI_EXPORTED MlirType llhdSignalTypeGetElementType(MlirType)
Get the inner type of a signal.
Definition: LLHD.cpp:56
MLIR_CAPI_EXPORTED bool llhdTypeIsATimeType(MlirType)
Check if a type is a time type.
Definition: LLHD.cpp:30
MLIR_CAPI_EXPORTED MlirType llhdPointerTypeGetElementType(MlirType)
Get the inner type of a pointer.
Definition: LLHD.cpp:61
MLIR_DECLARE_CAPI_DIALECT_REGISTRATION(LLHD, llhd)
MLIR_CAPI_EXPORTED bool llhdAttrIsATimeAttr(MlirAttribute)
Check if an attribute is a time attribute.
Definition: LLHD.cpp:70
MLIR_CAPI_EXPORTED MlirAttribute llhdTimeAttrGet(MlirContext ctx, MlirStringRef timeUnit, uint64_t seconds, uint64_t delta, uint64_t epsilon)
Create a time attribute.
Definition: LLHD.cpp:75