CIRCT
20.0.0git
|
#include "circt/Conversion/FIRRTLToHW.h"
#include "circt/Dialect/Comb/CombOps.h"
#include "circt/Dialect/Emit/EmitOps.h"
#include "circt/Dialect/FIRRTL/AnnotationDetails.h"
#include "circt/Dialect/FIRRTL/FIRRTLAnnotations.h"
#include "circt/Dialect/FIRRTL/FIRRTLInstanceGraph.h"
#include "circt/Dialect/FIRRTL/FIRRTLOps.h"
#include "circt/Dialect/FIRRTL/FIRRTLTypes.h"
#include "circt/Dialect/FIRRTL/FIRRTLUtils.h"
#include "circt/Dialect/FIRRTL/FIRRTLVisitors.h"
#include "circt/Dialect/FIRRTL/NLATable.h"
#include "circt/Dialect/HW/HWAttributes.h"
#include "circt/Dialect/HW/HWOps.h"
#include "circt/Dialect/HW/HWTypes.h"
#include "circt/Dialect/HW/InnerSymbolNamespace.h"
#include "circt/Dialect/LTL/LTLOps.h"
#include "circt/Dialect/SV/SVOps.h"
#include "circt/Dialect/Seq/SeqOps.h"
#include "circt/Dialect/Sim/SimOps.h"
#include "circt/Dialect/Verif/VerifOps.h"
#include "circt/Support/BackedgeBuilder.h"
#include "circt/Support/Namespace.h"
#include "mlir/IR/BuiltinOps.h"
#include "mlir/IR/BuiltinTypes.h"
#include "mlir/IR/ImplicitLocOpBuilder.h"
#include "mlir/IR/Threading.h"
#include "mlir/Pass/Pass.h"
#include "llvm/Support/Debug.h"
#include "llvm/Support/Mutex.h"
#include "circt/Conversion/Passes.h.inc"
Go to the source code of this file.
Namespaces | |
circt | |
The InstanceGraph op interface, see InstanceGraphInterface.td for more details. | |
Macros | |
#define | DEBUG_TYPE "lower-to-hw" |
#define | GEN_PASS_DEF_LOWERFIRRTLTOHW |
Functions | |
static bool | isZeroBitFIRRTLType (Type type) |
Return true if the specified type is a sized FIRRTL type (Int or Analog) with zero bits. More... | |
static Value | getSingleNonInstanceOperand (AttachOp op) |
static LogicalResult | verifyOpLegality (Operation *op) |
This verifies that the target operation has been lowered to a legal operation. More... | |
static IntType | getWidestIntType (Type t1, Type t2) |
Given two FIRRTL integer types, return the widest one. More... | |
static Value | castToFIRRTLType (Value val, Type type, ImplicitLocOpBuilder &builder) |
Cast a value to a desired target type. More... | |
static Value | castFromFIRRTLType (Value val, Type type, ImplicitLocOpBuilder &builder) |
Cast from a FIRRTL type (potentially with a flip) to a standard type. More... | |
static void | moveVerifAnno (ModuleOp top, AnnotationSet &annos, StringRef annoClass, StringRef attrBase) |
Move a ExtractTestCode related annotation from annotations to an attribute. More... | |
static unsigned | getBitWidthFromVectorSize (unsigned size) |
static void | tryCopyName (Operation *dst, Operation *src) |
static ArrayAttr | getHWParameters (FExtModuleOp module, bool ignoreValues) |
Map the parameter specifier on the specified extmodule into the HWModule representation for parameters. More... | |
static Value | tryEliminatingAttachesToAnalogValue (Value value, Operation *insertPoint) |
Given a value of analog type, check to see the only use of it is an attach. More... | |
static Value | tryEliminatingConnectsToValue (Value flipValue, Operation *insertPoint, CircuitLoweringState &loweringState) |
Given a value of flip type, check to see if all of the uses of it are connects. More... | |
static SmallVector< SubfieldOp > | getAllFieldAccesses (Value structValue, StringRef field) |
static LogicalResult | handleZeroBit (Value failedOperand, const std::function< LogicalResult()> &fn) |
Zero bit operands end up looking like failures from getLoweredValue. More... | |
template<typename... Args> | |
static Operation * | buildImmediateVerifOp (ImplicitLocOpBuilder &builder, StringRef opName, Args &&...args) |
Helper function to build an immediate assert operation based on the original FIRRTL operation name. More... | |
template<typename... Args> | |
static Operation * | buildConcurrentVerifOp (ImplicitLocOpBuilder &builder, StringRef opName, Args &&...args) |
Helper function to build a concurrent assert operation based on the original FIRRTL operation name. More... | |
Variables | |
static const char | moduleHierarchyFileAttrName [] = "firrtl.moduleHierarchyFile" |
Attribute that indicates that the module hierarchy starting at the annotated module should be dumped to a file. More... | |
#define DEBUG_TYPE "lower-to-hw" |
Definition at line 43 of file LowerToHW.cpp.
#define GEN_PASS_DEF_LOWERFIRRTLTOHW |
Definition at line 46 of file LowerToHW.cpp.
|
static |
Helper function to build a concurrent assert operation based on the original FIRRTL operation name.
This reduces code duplication in lowerVerificationStatement
.
Definition at line 4480 of file LowerToHW.cpp.
|
static |
Helper function to build an immediate assert operation based on the original FIRRTL operation name.
This reduces code duplication in lowerVerificationStatement
.
Definition at line 4465 of file LowerToHW.cpp.
|
static |
Cast from a FIRRTL type (potentially with a flip) to a standard type.
Definition at line 143 of file LowerToHW.cpp.
Referenced by tryEliminatingAttachesToAnalogValue(), and tryEliminatingConnectsToValue().
|
static |
Cast a value to a desired target type.
This will insert struct casts and unrealized conversion casts as necessary.
Definition at line 129 of file LowerToHW.cpp.
|
static |
Definition at line 1283 of file LowerToHW.cpp.
References assert().
|
static |
Definition at line 190 of file LowerToHW.cpp.
|
static |
Map the parameter specifier on the specified extmodule into the HWModule representation for parameters.
If ignoreValues
is true, all the values are dropped.
Definition at line 937 of file LowerToHW.cpp.
References circt::calyx::direction::get().
|
static |
Definition at line 67 of file LowerToHW.cpp.
References isZeroBitFIRRTLType().
|
static |
Given two FIRRTL integer types, return the widest one.
Definition at line 122 of file LowerToHW.cpp.
|
static |
Zero bit operands end up looking like failures from getLoweredValue.
This helper function invokes the closure specified if the operand was actually zero bit, or returns failure() if it was some other kind of failure.
Definition at line 2035 of file LowerToHW.cpp.
References assert(), and isZeroBitFIRRTLType().
|
static |
Return true if the specified type is a sized FIRRTL type (Int or Analog) with zero bits.
Definition at line 60 of file LowerToHW.cpp.
Referenced by getSingleNonInstanceOperand(), and handleZeroBit().
|
static |
Move a ExtractTestCode related annotation from annotations to an attribute.
Definition at line 164 of file LowerToHW.cpp.
References circt::calyx::direction::get(), and circt::firrtl::AnnotationSet::getAnnotation().
|
static |
Definition at line 196 of file LowerToHW.cpp.
|
static |
Given a value of analog type, check to see the only use of it is an attach.
If so, remove the attach and return the value being attached to it, converted to an HW inout type. If this isn't a situation we can handle, just return null.
Definition at line 1162 of file LowerToHW.cpp.
References castFromFIRRTLType(), circt::calyx::direction::get(), and circt::firrtl::lowerType().
Referenced by tryEliminatingConnectsToValue().
|
static |
Given a value of flip type, check to see if all of the uses of it are connects.
If so, remove the connects and return the value being connected to it, converted to an HW type. If this isn't a situation we can handle, just return null.
This can happen when there are no connects to the value. The 'mergePoint' location is where a 'hw.merge' operation should be inserted if needed.
Definition at line 1199 of file LowerToHW.cpp.
References assert(), castFromFIRRTLType(), loweringState, and tryEliminatingAttachesToAnalogValue().
|
static |
This verifies that the target operation has been lowered to a legal operation.
This checks that the operation recursively has no FIRRTL operations or types.
Definition at line 85 of file LowerToHW.cpp.
|
static |
Attribute that indicates that the module hierarchy starting at the annotated module should be dumped to a file.
Definition at line 56 of file LowerToHW.cpp.