CIRCT  20.0.0git
Namespaces | Macros | Functions
LowerCHIRRTL.cpp File Reference
#include "circt/Dialect/FIRRTL/CHIRRTLVisitors.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/Passes.h"
#include "circt/Support/LLVM.h"
#include "mlir/IR/ImplicitLocOpBuilder.h"
#include "mlir/IR/OperationSupport.h"
#include "mlir/Pass/Pass.h"
#include "llvm/ADT/DenseMap.h"
#include "llvm/ADT/Hashing.h"
#include "llvm/ADT/TypeSwitch.h"
#include "circt/Dialect/FIRRTL/Passes.h.inc"
Include dependency graph for LowerCHIRRTL.cpp:

Go to the source code of this file.

Namespaces

 circt
 The InstanceGraph op interface, see InstanceGraphInterface.td for more details.
 
 circt::firrtl
 

Macros

#define GEN_PASS_DEF_LOWERCHIRRTLPASS
 

Functions

static void forEachLeaf (ImplicitLocOpBuilder &builder, Value value, llvm::function_ref< void(Value)> func)
 Performs the callback for each leaf element of a value. More...
 
static void connectLeafsTo (ImplicitLocOpBuilder &builder, Value bundle, Value value)
 Drive a value to all leafs of the input aggregate value. More...
 
static MemOp::PortKind memDirAttrToPortKind (MemDirAttr direction)
 Converts a CHIRRTL memory port direction to a MemoryOp port type. More...
 

Macro Definition Documentation

◆ GEN_PASS_DEF_LOWERCHIRRTLPASS

#define GEN_PASS_DEF_LOWERCHIRRTLPASS

Definition at line 29 of file LowerCHIRRTL.cpp.

Function Documentation

◆ connectLeafsTo()

static void connectLeafsTo ( ImplicitLocOpBuilder &  builder,
Value  bundle,
Value  value 
)
static

Drive a value to all leafs of the input aggregate value.

This only makes sense when all leaf values have the same type, since the same value will be connected to each leaf. This does not work for aggregates with flip types.

Definition at line 150 of file LowerCHIRRTL.cpp.

References circt::firrtl::emitConnect(), and forEachLeaf().

◆ forEachLeaf()

static void forEachLeaf ( ImplicitLocOpBuilder &  builder,
Value  value,
llvm::function_ref< void(Value)>  func 
)
static

Performs the callback for each leaf element of a value.

This will create any subindex and subfield operations needed to access the leaf values of the aggregate value.

Definition at line 133 of file LowerCHIRRTL.cpp.

Referenced by connectLeafsTo().

◆ memDirAttrToPortKind()

static MemOp::PortKind memDirAttrToPortKind ( MemDirAttr  direction)
static

Converts a CHIRRTL memory port direction to a MemoryOp port type.

The biggest difference is that there is no match for the Infer port type.

Definition at line 170 of file LowerCHIRRTL.cpp.