CIRCT
20.0.0git
|
Lower FirRegOp to sv.reg
and sv.always
.
More...
#include <FirRegLowering.h>
Classes | |
struct | RegLowerInfo |
Public Member Functions | |
FirRegLowering (TypeConverter &typeConverter, hw::HWModuleOp module, bool disableRegRandomization=false, bool emitSeparateAlwaysBlocks=false) | |
void | lower () |
bool | needsRegRandomization () const |
Public Attributes | |
unsigned | numSubaccessRestored = 0 |
Private Types | |
using | AlwaysKeyType = std::tuple< Block *, sv::EventControl, Value, sv::ResetType, sv::EventControl, Value > |
using | IfKeyType = std::pair< Block *, Value > |
Private Member Functions | |
RegLowerInfo | lower (seq::FirRegOp reg) |
void | initialize (OpBuilder &builder, RegLowerInfo reg, ArrayRef< Value > rands) |
void | initializeRegisterElements (Location loc, OpBuilder &builder, Value reg, Value rand, unsigned &pos) |
void | createTree (OpBuilder &builder, Value reg, Value term, Value next) |
std::optional< std::tuple< Value, Value, Value > > | tryRestoringSubaccess (OpBuilder &builder, Value reg, Value term, hw::ArrayCreateOp nextRegValue) |
void | addToAlwaysBlock (Block *block, sv::EventControl clockEdge, Value clock, const std::function< void(OpBuilder &)> &body, sv::ResetType resetStyle={}, sv::EventControl resetEdge={}, Value reset={}, const std::function< void(OpBuilder &)> &resetBody={}) |
void | addToIfBlock (OpBuilder &builder, Value cond, const std::function< void()> &trueSide, const std::function< void()> &falseSide) |
hw::ConstantOp | getOrCreateConstant (Location loc, const APInt &value) |
Private Attributes | |
llvm::SmallDenseMap< AlwaysKeyType, std::pair< sv::AlwaysOp, sv::IfOp > > | alwaysBlocks |
llvm::SmallDenseMap< IfKeyType, sv::IfOp > | ifCache |
llvm::SmallDenseMap< APInt, hw::ConstantOp > | constantCache |
llvm::SmallDenseMap< std::pair< Value, unsigned >, Value > | arrayIndexCache |
std::unique_ptr< ReachableMuxes > | reachableMuxes |
TypeConverter & | typeConverter |
hw::HWModuleOp | module |
bool | disableRegRandomization |
bool | emitSeparateAlwaysBlocks |
bool | needsRandom = false |
Lower FirRegOp to sv.reg
and sv.always
.
Definition at line 76 of file FirRegLowering.h.
|
private |
Definition at line 130 of file FirRegLowering.h.
|
private |
Definition at line 135 of file FirRegLowering.h.
FirRegLowering::FirRegLowering | ( | TypeConverter & | typeConverter, |
hw::HWModuleOp | module, | ||
bool | disableRegRandomization = false , |
||
bool | emitSeparateAlwaysBlocks = false |
||
) |
Definition at line 108 of file FirRegLowering.cpp.
References module, and reachableMuxes.
|
private |
Definition at line 617 of file FirRegLowering.cpp.
References alwaysBlocks, assert(), and emitSeparateAlwaysBlocks.
|
private |
Definition at line 89 of file FirRegLowering.cpp.
Referenced by createTree().
|
private |
Definition at line 397 of file FirRegLowering.cpp.
References addToIfBlock(), areEquivalentValues(), arrayIndexCache, assert(), getOrCreateConstant(), numSubaccessRestored, reachableMuxes, seq::reg(), and tryRestoringSubaccess().
|
inlineprivate |
Definition at line 118 of file FirRegLowering.h.
Referenced by createTree(), initializeRegisterElements(), lower(), and tryRestoringSubaccess().
|
private |
Definition at line 591 of file FirRegLowering.cpp.
References concat(), initializeRegisterElements(), and seq::reg().
Referenced by lower().
|
private |
Definition at line 561 of file FirRegLowering.cpp.
References assert(), comb.ExtractOp::create(), getOrCreateConstant(), and seq::reg().
Referenced by initialize().
void FirRegLowering::lower | ( | ) |
Definition at line 119 of file FirRegLowering.cpp.
References hw.BitcastOp::create(), comb.ExtractOp::create(), disableRegRandomization, circt::calyx::direction::get(), getOrCreateConstant(), initialize(), module, needsRandom, and seq::reg().
Referenced by circt::SeqToSVPass::runOnOperation().
|
private |
|
inline |
Definition at line 83 of file FirRegLowering.h.
Referenced by circt::SeqToSVPass::runOnOperation().
|
private |
Definition at line 324 of file FirRegLowering.cpp.
References areEquivalentValues(), extractConditions(), getConstantValue(), getOrCreateConstant(), and seq::reg().
Referenced by createTree().
|
private |
Definition at line 133 of file FirRegLowering.h.
Referenced by addToAlwaysBlock().
|
private |
Definition at line 139 of file FirRegLowering.h.
Referenced by createTree().
|
private |
Definition at line 138 of file FirRegLowering.h.
|
private |
Definition at line 145 of file FirRegLowering.h.
Referenced by lower().
|
private |
Definition at line 146 of file FirRegLowering.h.
Referenced by addToAlwaysBlock().
|
private |
Definition at line 136 of file FirRegLowering.h.
|
private |
Definition at line 143 of file FirRegLowering.h.
Referenced by hw.InstanceBuilder::create_default_value(), FirRegLowering(), om.Evaluator::instantiate(), lower(), hw.InstanceBuilder::operand_names(), and hw.InstanceBuilder::result_names().
|
private |
Definition at line 148 of file FirRegLowering.h.
Referenced by lower().
unsigned circt::FirRegLowering::numSubaccessRestored = 0 |
Definition at line 85 of file FirRegLowering.h.
Referenced by createTree(), and circt::SeqToSVPass::runOnOperation().
|
private |
Definition at line 140 of file FirRegLowering.h.
Referenced by createTree(), and FirRegLowering().
|
private |
Definition at line 142 of file FirRegLowering.h.