CIRCT
20.0.0git
|
An interface for conversion passes that lower Calyx programs. More...
#include <CalyxLoweringUtils.h>
Public Member Functions | |
CalyxLoweringState (mlir::ModuleOp module, StringRef topLevelFunction) | |
mlir::ModuleOp | getModule () |
Returns the current program. More... | |
StringRef | getTopLevelFunction () const |
Returns the name of the top-level function in the source program. More... | |
std::string | blockName (Block *b) |
Returns a meaningful name for a block within the program scope (removes the ^ prefix from block names). More... | |
template<typename T = calyx::ComponentLoweringStateInterface> | |
T * | getState (calyx::ComponentOp op) |
Returns the component lowering state associated with op . More... | |
template<typename ValueOrBlock > | |
std::string | irName (ValueOrBlock &v) |
Returns a meaningful name for a value within the program scope. More... | |
Private Attributes | |
StringRef | topLevelFunction |
The name of this top-level function. More... | |
mlir::ModuleOp | module |
The program associated with this state. More... | |
DenseMap< Operation *, std::unique_ptr< ComponentLoweringStateInterface > > | componentStates |
Mapping from ComponentOp to component lowering state. More... | |
An interface for conversion passes that lower Calyx programs.
This handles state during the lowering of a Calyx program.
Definition at line 470 of file CalyxLoweringUtils.h.
|
explicit |
Definition at line 441 of file CalyxLoweringUtils.cpp.
std::string circt::calyx::CalyxLoweringState::blockName | ( | Block * | b | ) |
Returns a meaningful name for a block within the program scope (removes the ^ prefix from block names).
Definition at line 454 of file CalyxLoweringUtils.cpp.
References irName().
mlir::ModuleOp circt::calyx::CalyxLoweringState::getModule | ( | ) |
Returns the current program.
Definition at line 445 of file CalyxLoweringUtils.cpp.
|
inline |
Returns the component lowering state associated with op
.
If not found already found, a new mapping is added for this ComponentOp. Different conversions may have different derived classes of the interface, so we provided a template.
Definition at line 490 of file CalyxLoweringUtils.h.
References componentStates.
Referenced by circt::calyx::RewriteMemoryAccesses::partiallyLower(), circt::calyx::InlineCombGroups::partiallyLower(), and circt::calyx::FuncOpPartialLoweringPattern::partiallyLower().
StringRef circt::calyx::CalyxLoweringState::getTopLevelFunction | ( | ) | const |
Returns the name of the top-level function in the source program.
Definition at line 450 of file CalyxLoweringUtils.cpp.
References topLevelFunction.
|
inline |
Returns a meaningful name for a value within the program scope.
Definition at line 505 of file CalyxLoweringUtils.h.
References module.
Referenced by blockName().
|
private |
Mapping from ComponentOp to component lowering state.
Definition at line 520 of file CalyxLoweringUtils.h.
Referenced by getState().
|
private |
The program associated with this state.
Definition at line 517 of file CalyxLoweringUtils.h.
Referenced by hw.InstanceBuilder::create_default_value(), getModule(), om.Evaluator::instantiate(), irName(), hw.InstanceBuilder::operand_names(), and hw.InstanceBuilder::result_names().
|
private |
The name of this top-level function.
Definition at line 515 of file CalyxLoweringUtils.h.
Referenced by getTopLevelFunction().