CIRCT  19.0.0git
Macros | Typedefs | Functions
ModuleInliner.cpp File Reference
#include "PassDetails.h"
#include "circt/Dialect/Debug/DebugOps.h"
#include "circt/Dialect/FIRRTL/AnnotationDetails.h"
#include "circt/Dialect/FIRRTL/CHIRRTLDialect.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/FIRRTLVisitors.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 "llvm/ADT/BitVector.h"
#include "llvm/ADT/SetOperations.h"
#include "llvm/ADT/SetVector.h"
#include "llvm/ADT/SmallPtrSet.h"
#include "llvm/ADT/TypeSwitch.h"
#include "llvm/Support/Debug.h"
#include "llvm/Support/FormatVariadic.h"
Include dependency graph for ModuleInliner.cpp:

Go to the source code of this file.

Macros

#define DEBUG_TYPE   "firrtl-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 38 of file ModuleInliner.cpp.

Typedef Documentation

◆ InnerRefToNewNameMap

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

Definition at line 47 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 400 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 411 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 429 of file ModuleInliner.cpp.

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