CIRCT 22.0.0git
Loading...
Searching...
No Matches
Macros | Functions
FirRegLowering.cpp File Reference
#include "FirRegLowering.h"
#include "circt/Dialect/Comb/CombOps.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 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)
 
static Value buildXMRTo (OpBuilder &builder, HierPathOp path, Location loc, Type type)
 

Macro Definition Documentation

◆ DEBUG_TYPE

#define DEBUG_TYPE   "lower-seq-firreg"

Definition at line 24 of file FirRegLowering.cpp.

Function Documentation

◆ areEquivalentValues()

static bool areEquivalentValues ( Value  term,
Value  next 
)
static

◆ buildXMRTo()

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

Definition at line 799 of file FirRegLowering.cpp.

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

◆ extractConditions()

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

Definition at line 444 of file FirRegLowering.cpp.

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

◆ getAllBuriedRegs()

static 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 190 of file FirRegLowering.cpp.

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

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

◆ getBlockEnd()

static Block::iterator getBlockEnd ( Block *  block)
static

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

Definition at line 27 of file FirRegLowering.cpp.

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

◆ getBuriedRegs()

static 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 171 of file FirRegLowering.cpp.

References seq::reg().

Referenced by getAllBuriedRegs().

◆ getConstantValue()

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

Definition at line 457 of file FirRegLowering.cpp.

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

◆ getHierPathTo()

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

Construct a hierarchical path op that targets the given register.

Definition at line 205 of file FirRegLowering.cpp.

References circt::Namespace::newName().

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

◆ getInnerRefTo()

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

Definition at line 153 of file FirRegLowering.cpp.

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

◆ getInnerSymFor()

static 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 120 of file FirRegLowering.cpp.

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

Referenced by getInnerRefTo().