CIRCT  19.0.0git
Private Member Functions | List of all members
circt::pipelinetocalyx::BuildControl Class Reference

Builds a control schedule by traversing the CFG of the function and associating this with the previously created groups. More...

Inheritance diagram for circt::pipelinetocalyx::BuildControl:
Inheritance graph
[legend]
Collaboration diagram for circt::pipelinetocalyx::BuildControl:
Collaboration graph
[legend]

Private Member Functions

LogicalResult partiallyLowerFuncToComp (FuncOp funcOp, PatternRewriter &rewriter) const override
 
LogicalResult scheduleBasicBlock (PatternRewriter &rewriter, const DenseSet< Block * > &path, mlir::Block *parentCtrlBlock, mlir::Block *block) const
 Sequentially schedules the groups that registered themselves with 'block'. More...
 
LogicalResult schedulePath (PatternRewriter &rewriter, const DenseSet< Block * > &path, Location loc, Block *from, Block *to, Block *parentCtrlBlock) const
 Schedules a block by inserting a branch argument assignment block (if any) before recursing into the scheduling of the block innards. More...
 
LogicalResult buildCFGControl (DenseSet< Block * > path, PatternRewriter &rewriter, mlir::Block *parentCtrlBlock, mlir::Block *preBlock, mlir::Block *block) const
 
calyx::WhileOp buildWhileCtrlOp (PipelineWhileOp whileOp, SmallVector< calyx::GroupOp > initGroups, PatternRewriter &rewriter) const
 

Additional Inherited Members

- Public Member Functions inherited from circt::calyx::FuncOpPartialLoweringPattern
 FuncOpPartialLoweringPattern (MLIRContext *context, LogicalResult &resRef, PatternApplicationState &patternState, DenseMap< mlir::func::FuncOp, calyx::ComponentOp > &map, calyx::CalyxLoweringState &state)
 
LogicalResult partiallyLower (mlir::func::FuncOp funcOp, PatternRewriter &rewriter) const override final
 Entry point to initialize the state of this class and conduct the partial lowering. More...
 
calyx::ComponentOp getComponent () const
 Returns the component operation associated with the currently executing partial lowering. More...
 
template<typename T = ComponentLoweringStateInterface>
T & getState () const
 
CalyxLoweringStateloweringState () const
 Return the calyx lowering state for this pattern. More...
 
virtual LogicalResult partiallyLowerFuncToComp (mlir::func::FuncOp funcOp, PatternRewriter &rewriter) const =0
 
- Public Member Functions inherited from circt::calyx::PartialLoweringPattern< mlir::func::FuncOp >
 PartialLoweringPattern (MLIRContext *ctx, LogicalResult &resRef, PatternApplicationState &patternState)
 
LogicalResult matchAndRewrite (mlir::func::FuncOp op, PatternRewriter &rewriter) const override
 
- Protected Attributes inherited from circt::calyx::FuncOpPartialLoweringPattern
DenseMap< mlir::func::FuncOp, calyx::ComponentOp > & functionMapping
 

Detailed Description

Builds a control schedule by traversing the CFG of the function and associating this with the previously created groups.

For simplicity, the generated control flow is expanded for all possible paths in the input DAG. This elaborated control flow is later reduced in the runControlFlowSimplification passes.

Definition at line 1152 of file LoopScheduleToCalyx.cpp.

Member Function Documentation

◆ buildCFGControl()

LogicalResult circt::pipelinetocalyx::BuildControl::buildCFGControl ( DenseSet< Block * >  path,
PatternRewriter &  rewriter,
mlir::Block *  parentCtrlBlock,
mlir::Block *  preBlock,
mlir::Block *  block 
) const
inlineprivate

TODO(mortbopet): we could choose to support ie. std.switch, but it would probably be easier to just require it to be lowered beforehand.

Wrap each branch inside an if/else.

Schedule sequentially within the current parent control block.

Definition at line 1246 of file LoopScheduleToCalyx.cpp.

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

◆ buildWhileCtrlOp()

calyx::WhileOp circt::pipelinetocalyx::BuildControl::buildWhileCtrlOp ( PipelineWhileOp  whileOp,
SmallVector< calyx::GroupOp >  initGroups,
PatternRewriter &  rewriter 
) const
inlineprivate

Insert while iter arg initialization group(s). Emit a parallel group to assign one or more registers all at once.

Insert the while op itself.

If a bound was specified, add it.

Definition at line 1310 of file LoopScheduleToCalyx.cpp.

References circt::calyx::direction::get(), circt::pipelinetocalyx::PipelineWhileOp::getBound(), circt::pipelinetocalyx::PipelineWhileOp::getConditionValue(), circt::calyx::WhileOpInterface< T >::getLoc(), and circt::calyx::WhileOpInterface< T >::getOperation().

◆ partiallyLowerFuncToComp()

LogicalResult circt::pipelinetocalyx::BuildControl::partiallyLowerFuncToComp ( FuncOp  funcOp,
PatternRewriter &  rewriter 
) const
inlineoverrideprivate

Definition at line 1156 of file LoopScheduleToCalyx.cpp.

◆ scheduleBasicBlock()

LogicalResult circt::pipelinetocalyx::BuildControl::scheduleBasicBlock ( PatternRewriter &  rewriter,
const DenseSet< Block * > &  path,
mlir::Block *  parentCtrlBlock,
mlir::Block *  block 
) const
inlineprivate

Sequentially schedules the groups that registered themselves with 'block'.

Schedule pipeline stages in the parallel group directly.

Definition at line 1170 of file LoopScheduleToCalyx.cpp.

◆ schedulePath()

LogicalResult circt::pipelinetocalyx::BuildControl::schedulePath ( PatternRewriter &  rewriter,
const DenseSet< Block * > &  path,
Location  loc,
Block *  from,
Block *  to,
Block *  parentCtrlBlock 
) const
inlineprivate

Schedules a block by inserting a branch argument assignment block (if any) before recursing into the scheduling of the block innards.

Blocks 'from' and 'to' refer to blocks in the source program. parentCtrlBlock refers to the control block wherein control operations are to be inserted.

Schedule any registered block arguments to be executed before the body of the branch.

Definition at line 1230 of file LoopScheduleToCalyx.cpp.


The documentation for this class was generated from the following file: