CIRCT  19.0.0git
HWAttributes.h
Go to the documentation of this file.
1 //===- HWAttributes.h - Declare HW dialect attributes ------------*- 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_DIALECT_HW_ATTRIBUTES_H
10 #define CIRCT_DIALECT_HW_ATTRIBUTES_H
11 
12 #include "mlir/IR/Attributes.h"
13 #include "mlir/IR/BuiltinAttributeInterfaces.h"
14 #include "mlir/IR/BuiltinAttributes.h"
15 
16 namespace circt {
17 namespace hw {
18 class PEOAttr;
19 class EnumType;
20 enum class PEO : uint32_t;
21 
22 /// Returns a resolved version of 'type' wherein any parameter reference
23 /// has been evaluated based on the set of provided 'parameters'.
24 mlir::FailureOr<mlir::Type> evaluateParametricType(mlir::Location loc,
25  mlir::ArrayAttr parameters,
26  mlir::Type type,
27  bool emitErrors = true);
28 
29 /// Evaluates a parametric attribute (param.decl.ref/param.expr) based on a set
30 /// of provided parameter values.
31 mlir::FailureOr<mlir::TypedAttr>
32 evaluateParametricAttr(mlir::Location loc, mlir::ArrayAttr parameters,
33  mlir::Attribute paramAttr, bool emitErrors = true);
34 
35 /// Returns true if any part of t is parametric.
36 bool isParametricType(mlir::Type t);
37 
38 } // namespace hw
39 } // namespace circt
40 
41 #define GET_ATTRDEF_CLASSES
42 #include "circt/Dialect/HW/HWAttributes.h.inc"
43 
44 #endif // CIRCT_DIALECT_HW_ATTRIBUTES_H
mlir::FailureOr< mlir::TypedAttr > evaluateParametricAttr(mlir::Location loc, mlir::ArrayAttr parameters, mlir::Attribute paramAttr, bool emitErrors=true)
Evaluates a parametric attribute (param.decl.ref/param.expr) based on a set of provided parameter val...
enum PEO uint32_t mlir::FailureOr< mlir::Type > evaluateParametricType(mlir::Location loc, mlir::ArrayAttr parameters, mlir::Type type, bool emitErrors=true)
Returns a resolved version of 'type' wherein any parameter reference has been evaluated based on the ...
bool isParametricType(mlir::Type t)
Returns true if any part of t is parametric.
The InstanceGraph op interface, see InstanceGraphInterface.td for more details.
Definition: DebugAnalysis.h:21
Definition: hw.py:1