CIRCT 24.0.0git
Loading...
Searching...
No Matches
SVTypes.h
Go to the documentation of this file.
1//===- SVTypes.h - Declare SV dialect types ----------------------*- 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// This file declares the types for the SV dialect.
10//
11//===----------------------------------------------------------------------===//
12
13#ifndef CIRCT_DIALECT_SV_TYPES_H
14#define CIRCT_DIALECT_SV_TYPES_H
15
17#include "mlir/IR/Attributes.h"
18#include "mlir/IR/BuiltinAttributes.h"
19
20#define GET_TYPEDEF_CLASSES
21#include "circt/Dialect/SV/SVTypes.h.inc"
22
23namespace circt {
24namespace sv {
25using InOutType = circt::hw::InOutType;
26
27/// Return the element type of an InOutType or null if the operand isn't an
28/// InOut type.
29mlir::Type getInOutElementType(mlir::Type type);
30
31/// Return the element type of an SV handle type or null if the operand is not
32/// an SV lvalue (NetType or VarType).
33mlir::Type getHandleElementType(mlir::Type type);
34
35/// Return a handle of the same kind (NetType or VarType) as `handleType`,
36/// wrapping `elementType` instead. Returns null if `handleType` isn't a
37/// NetType or VarType.
38mlir::Type getHandleOfElementType(mlir::Type handleType,
39 mlir::Type elementType);
40
41/// Return the element type of a NetType or null if the operand isn't a Net
42/// type.
43mlir::Type getNetElementType(mlir::Type type);
44
45/// Return true if a type is a valid element type of a NetType.
46bool isValidNetElementType(mlir::Type type);
47
48/// Return the element type of a VarType or null if the operand isn't a Var
49/// type.
50mlir::Type getVarElementType(mlir::Type type);
51
52/// Return true if a type is a valid element type of a VarType.
53bool isValidVarElementType(mlir::Type type);
54
55/// Return the element type of an ArrayType or UnpackedArrayType, or null if the
56/// operand isn't an array.
57mlir::Type getAnyHWArrayElementType(mlir::Type type);
58} // end namespace sv
59} // end namespace circt
60
61#endif // CIRCT_DIALECT_SV_TYPES_H
MlirType elementType
Definition CHIRRTL.cpp:29
mlir::Type getVarElementType(mlir::Type type)
Return the element type of a VarType or null if the operand isn't a Var type.
Definition SVTypes.cpp:151
bool isValidNetElementType(mlir::Type type)
Return true if a type is a valid element type of a NetType.
mlir::Type getAnyHWArrayElementType(mlir::Type type)
Return the element type of an ArrayType or UnpackedArrayType, or null if the operand isn't an array.
circt::hw::InOutType InOutType
Definition SVTypes.h:25
mlir::Type getHandleOfElementType(mlir::Type handleType, mlir::Type elementType)
Return a handle of the same kind (NetType or VarType) as handleType, wrapping elementType instead.
Definition SVTypes.cpp:94
mlir::Type getNetElementType(mlir::Type type)
Return the element type of a NetType or null if the operand isn't a Net type.
Definition SVTypes.cpp:111
mlir::Type getInOutElementType(mlir::Type type)
Return the element type of an InOutType or null if the operand isn't an InOut type.
Definition SVTypes.cpp:67
mlir::Type getHandleElementType(mlir::Type type)
Return the element type of an SV handle type or null if the operand is not an SV lvalue (NetType or V...
Definition SVTypes.cpp:80
bool isValidVarElementType(mlir::Type type)
Return true if a type is a valid element type of a VarType.
The InstanceGraph op interface, see InstanceGraphInterface.td for more details.
Definition sv.py:1