CIRCT 20.0.0git
Loading...
Searching...
No Matches
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
15extern "C" {
16#endif
17
18//===----------------------------------------------------------------------===//
19// Dialect
20//===----------------------------------------------------------------------===//
21
23
24//===----------------------------------------------------------------------===//
25// Types
26//===----------------------------------------------------------------------===//
27
28/// Check if a type is a time type.
29MLIR_CAPI_EXPORTED bool llhdTypeIsATimeType(MlirType);
30/// Check if a type is a signal type.
31MLIR_CAPI_EXPORTED bool llhdTypeIsASignalType(MlirType);
32/// Check if a type is a pointer type.
33MLIR_CAPI_EXPORTED bool llhdTypeIsAPointerType(MlirType);
34
35/// Create a time type.
36MLIR_CAPI_EXPORTED MlirType llhdTimeTypeGet(MlirContext ctx);
37/// Create a signal type.
38MLIR_CAPI_EXPORTED MlirType llhdSignalTypeGet(MlirType element);
39/// Create a pointer type.
40MLIR_CAPI_EXPORTED MlirType llhdPointerTypeGet(MlirType element);
41
42/// Get the inner type of a signal.
43MLIR_CAPI_EXPORTED MlirType llhdSignalTypeGetElementType(MlirType);
44/// Get the inner type of a pointer.
45MLIR_CAPI_EXPORTED MlirType llhdPointerTypeGetElementType(MlirType);
46
47//===----------------------------------------------------------------------===//
48// Attributes
49//===----------------------------------------------------------------------===//
50
51/// Check if an attribute is a time attribute.
52MLIR_CAPI_EXPORTED bool llhdAttrIsATimeAttr(MlirAttribute);
53
54/// Create a time attribute.
55MLIR_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.
62MLIR_CAPI_EXPORTED MlirStringRef llhdTimeAttrGetTimeUnit(MlirAttribute);
63/// Get the seconds component of a time attribute.
64MLIR_CAPI_EXPORTED uint64_t llhdTimeAttrGetSeconds(MlirAttribute);
65/// Get the delta component of a time attribute.
66MLIR_CAPI_EXPORTED uint64_t llhdTimeAttrGetDelta(MlirAttribute);
67/// Get the epsilon component of a time attribute.
68MLIR_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:75
MLIR_CAPI_EXPORTED MlirStringRef llhdTimeAttrGetTimeUnit(MlirAttribute)
Get the time unit of a time attribute.
Definition LLHD.cpp:70
MLIR_CAPI_EXPORTED MlirType llhdTimeTypeGet(MlirContext ctx)
Create a time type.
Definition LLHD.cpp:38
MLIR_CAPI_EXPORTED uint64_t llhdTimeAttrGetDelta(MlirAttribute)
Get the delta component of a time attribute.
Definition LLHD.cpp:80
MLIR_CAPI_EXPORTED MlirType llhdSignalTypeGet(MlirType element)
Create a signal type.
MLIR_CAPI_EXPORTED uint64_t llhdTimeAttrGetEpsilon(MlirAttribute)
Get the epsilon component of a time attribute.
Definition LLHD.cpp:85
MLIR_CAPI_EXPORTED bool llhdTypeIsAPointerType(MlirType)
Check if a type is a pointer type.
Definition LLHD.cpp:33
MLIR_CAPI_EXPORTED bool llhdTypeIsASignalType(MlirType)
Check if a type is a signal type.
MLIR_CAPI_EXPORTED MlirType llhdPointerTypeGet(MlirType element)
Create a pointer type.
Definition LLHD.cpp:43
MLIR_CAPI_EXPORTED MlirType llhdSignalTypeGetElementType(MlirType)
Get the inner type of a signal.
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:48
MLIR_DECLARE_CAPI_DIALECT_REGISTRATION(LLHD, llhd)
MLIR_CAPI_EXPORTED bool llhdAttrIsATimeAttr(MlirAttribute)
Check if an attribute is a time attribute.
Definition LLHD.cpp:57
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:62