CIRCT  20.0.0git
Namespaces | Macros | Typedefs | Functions
ModuleInliner.cpp File Reference
#include "circt/Dialect/Debug/DebugOps.h"
#include "circt/Dialect/FIRRTL/AnnotationDetails.h"
#include "circt/Dialect/FIRRTL/FIRRTLAnnotations.h"
#include "circt/Dialect/FIRRTL/FIRRTLOps.h"
#include "circt/Dialect/FIRRTL/FIRRTLTypes.h"
#include "circt/Dialect/FIRRTL/FIRRTLUtils.h"
#include "circt/Dialect/FIRRTL/Namespace.h"
#include "circt/Dialect/FIRRTL/Passes.h"
#include "circt/Dialect/HW/HWAttributes.h"
#include "circt/Dialect/HW/HWOps.h"
#include "circt/Dialect/HW/InnerSymbolNamespace.h"
#include "circt/Support/Debug.h"
#include "circt/Support/LLVM.h"
#include "mlir/IR/IRMapping.h"
#include "mlir/Pass/Pass.h"
#include "llvm/ADT/BitVector.h"
#include "llvm/ADT/SetOperations.h"
#include "llvm/Support/Debug.h"
#include "llvm/Support/FormatVariadic.h"
#include "circt/Dialect/FIRRTL/Passes.h.inc"
Include dependency graph for ModuleInliner.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 DEBUG_TYPE   "firrtl-inliner"
 
#define GEN_PASS_DEF_INLINER
 

Typedefs

using InnerRefToNewNameMap = DenseMap< hw::InnerRefAttr, StringAttr >
 

Functions

static void mapResultsToWires (IRMapping &mapper, SmallVectorImpl< Value > &wires, InstanceOp instance)
 This function is used after inlining a module, to handle the conversion between module ports and instance results. More...
 
static void replaceInnerRefUsers (ArrayRef< Operation * > newOps, const InnerRefToNewNameMap &map, StringAttr istName)
 Process each operation, updating InnerRefAttr's using the specified map and the given name as the containing IST of the mapped-to sym names. More...
 
static hw::InnerSymAttr uniqueInNamespace (hw::InnerSymAttr old, InnerRefToNewNameMap &map, hw::InnerSymbolNamespace &ns, StringAttr istName)
 Generate and creating map entries for new inner symbol based on old one and an appropriate namespace for creating unique names for each. More...
 

Macro Definition Documentation

◆ DEBUG_TYPE

#define DEBUG_TYPE   "firrtl-inliner"

Definition at line 33 of file ModuleInliner.cpp.

◆ GEN_PASS_DEF_INLINER

#define GEN_PASS_DEF_INLINER

Definition at line 37 of file ModuleInliner.cpp.

Typedef Documentation

◆ InnerRefToNewNameMap

using InnerRefToNewNameMap = DenseMap<hw::InnerRefAttr, StringAttr>

Definition at line 49 of file ModuleInliner.cpp.

Function Documentation

◆ mapResultsToWires()

static void mapResultsToWires ( IRMapping &  mapper,
SmallVectorImpl< Value > &  wires,
InstanceOp  instance 
)
static

This function is used after inlining a module, to handle the conversion between module ports and instance results.

This maps each wire to the result of the instance operation. When future operations are cloned from the current block, they will use the value of the wire instead of the instance results.

Definition at line 402 of file ModuleInliner.cpp.

◆ replaceInnerRefUsers()

static void replaceInnerRefUsers ( ArrayRef< Operation * >  newOps,
const InnerRefToNewNameMap map,
StringAttr  istName 
)
static

Process each operation, updating InnerRefAttr's using the specified map and the given name as the containing IST of the mapped-to sym names.

Definition at line 413 of file ModuleInliner.cpp.

References assert(), and circt::calyx::direction::get().

◆ uniqueInNamespace()

static hw::InnerSymAttr uniqueInNamespace ( hw::InnerSymAttr  old,
InnerRefToNewNameMap map,
hw::InnerSymbolNamespace &  ns,
StringAttr  istName 
)
static

Generate and creating map entries for new inner symbol based on old one and an appropriate namespace for creating unique names for each.

Definition at line 431 of file ModuleInliner.cpp.

References assert(), and circt::calyx::direction::get().