CIRCT 24.0.0git
Loading...
Searching...
No Matches
FirRegLowering.cpp File Reference
#include "FirRegLowering.h"
#include "circt/Dialect/Comb/CombOps.h"
#include "circt/Dialect/SV/SVTypes.h"
#include "circt/Support/Utils.h"
#include "mlir/IR/Threading.h"
#include "mlir/Transforms/DialectConversion.h"
#include "llvm/ADT/DenseSet.h"
#include "llvm/Support/Debug.h"
#include <deque>
Include dependency graph for FirRegLowering.cpp:

Go to the source code of this file.

Macros

#define DEBUG_TYPE   "lower-seq-firreg"

Functions

static Value buildXMRTo (OpBuilder &builder, HierPathOp path, Location loc, Type type)
static Block::iterator getBlockEnd (Block *block)
 Immediately before the terminator, if present. Otherwise, the block's end.
static StringAttr getInnerSymFor (InnerSymbolNamespace &innerSymNS, seq::FirRegOp reg)
 Attach an inner-sym to field-id 0 of the given register, or use an existing inner-sym, if present.
static InnerRefAttr getInnerRefTo (StringAttr mod, InnerSymbolNamespace &isns, seq::FirRegOp reg)
static std::vector< BuriedFirReg > getBuriedRegs (HWModuleOp module)
 Locate the registers under the given HW module, which are not at the top-level of the module body.
static std::vector< BuriedFirReg > getAllBuriedRegs (ModuleOp top)
 Locate all registers which are not at the top-level of their parent HW module.
static hw::HierPathOp getHierPathTo (OpBuilder &builder, Namespace &ns, BuriedFirReg entry)
 Construct a hierarchical path op that targets the given register.
static bool areEquivalentValues (Value term, Value next)
static llvm::SetVector< Value > extractConditions (Value value)
static std::optional< APInt > getConstantValue (Value value)

Macro Definition Documentation

◆ DEBUG_TYPE

#define DEBUG_TYPE   "lower-seq-firreg"

Definition at line 24 of file FirRegLowering.cpp.

Function Documentation

◆ areEquivalentValues()

bool areEquivalentValues ( Value term,
Value next )
static

◆ buildXMRTo()

Value buildXMRTo ( OpBuilder & builder,
HierPathOp path,
Location loc,
Type type )
static

◆ extractConditions()

llvm::SetVector< Value > extractConditions ( Value value)
static

Definition at line 473 of file FirRegLowering.cpp.

Referenced by circt::FirRegLowering::tryRestoringSubaccess().

◆ getAllBuriedRegs()

std::vector< BuriedFirReg > getAllBuriedRegs ( ModuleOp top)
static

Locate all registers which are not at the top-level of their parent HW module.

These registers will be initialized through an NLA. Put an inner symbol on each, and return a list of the buried registers and their inner-symbols.

Definition at line 197 of file FirRegLowering.cpp.

References context, getBuriedRegs(), and circt::transformReduce().

Referenced by circt::FirRegLowering::createPaths().

◆ getBlockEnd()

Block::iterator getBlockEnd ( Block * block)
static

Immediately before the terminator, if present. Otherwise, the block's end.

Definition at line 34 of file FirRegLowering.cpp.

Referenced by circt::FirRegLowering::addToAlwaysBlock().

◆ getBuriedRegs()

std::vector< BuriedFirReg > getBuriedRegs ( HWModuleOp module)
static

Locate the registers under the given HW module, which are not at the top-level of the module body.

These registers will be initialized through an NLA. Put an inner symbol on each, and return a list of the buried registers and their inner-symbols.

Definition at line 178 of file FirRegLowering.cpp.

References getInnerRefTo(), and seq::reg().

Referenced by getAllBuriedRegs().

◆ getConstantValue()

std::optional< APInt > getConstantValue ( Value value)
static

Definition at line 486 of file FirRegLowering.cpp.

Referenced by circt::FirRegLowering::tryRestoringSubaccess().

◆ getHierPathTo()

hw::HierPathOp getHierPathTo ( OpBuilder & builder,
Namespace & ns,
BuriedFirReg entry )
static

Construct a hierarchical path op that targets the given register.

Definition at line 212 of file FirRegLowering.cpp.

References circt::Namespace::newName().

Referenced by circt::FirRegLowering::createPaths().

◆ getInnerRefTo()

InnerRefAttr getInnerRefTo ( StringAttr mod,
InnerSymbolNamespace & isns,
seq::FirRegOp reg )
static

Definition at line 160 of file FirRegLowering.cpp.

References getInnerSymFor(), and seq::reg().

Referenced by getBuriedRegs().

◆ getInnerSymFor()

StringAttr getInnerSymFor ( InnerSymbolNamespace & innerSymNS,
seq::FirRegOp reg )
static

Attach an inner-sym to field-id 0 of the given register, or use an existing inner-sym, if present.

Definition at line 127 of file FirRegLowering.cpp.

References context, circt::Namespace::newName(), and seq::reg().

Referenced by getInnerRefTo().