CIRCT 24.0.0git
Loading...
Searching...
No Matches
circt::calyx::LoopLoweringStateInterface< Loop > Class Template Reference

#include <CalyxLoweringUtils.h>

Inheritance diagram for circt::calyx::LoopLoweringStateInterface< Loop >:
Collaboration diagram for circt::calyx::LoopLoweringStateInterface< Loop >:

Public Member Functions

 ~LoopLoweringStateInterface ()=default
void addLoopIterReg (Loop op, calyx::RegisterOp reg, unsigned idx)
 Register reg as being the idx'th iter_args register for 'op'.
calyx::RegisterOp getLoopIterReg (Loop op, unsigned idx)
 Return a mapping of block argument indices to block argument.
const DenseMap< unsigned, calyx::RegisterOp > & getLoopIterRegs (Loop op)
 Return a mapping of block argument indices to block argument.
void setLoopLatchGroup (Loop op, calyx::GroupOp group)
 Registers grp to be the loop latch group of op.
calyx::GroupOp getLoopLatchGroup (Loop op)
 Retrieve the loop latch group registered for op.
void setLoopInitGroups (Loop op, SmallVector< calyx::GroupOp > groups)
 Registers groups to be the loop init groups of op.
SmallVector< calyx::GroupOp > getLoopInitGroups (Loop op)
 Retrieve the loop init groups registered for op.
calyx::GroupOp buildLoopIterArgAssignments (OpBuilder &builder, Loop op, calyx::ComponentOp componentOp, Twine uniqueSuffix, MutableArrayRef< OpOperand > ops)
 Creates a new group that assigns the 'ops' values to the iter arg registers of the loop operation.

Private Attributes

DenseMap< Operation *, DenseMap< unsigned, calyx::RegisterOp > > loopIterRegs
 A mapping from loop ops to iteration argument registers.
DenseMap< Operation *, calyx::GroupOp > loopLatchGroups
 A loop latch group is a group that should be sequentially executed when finishing a loop body.
DenseMap< Operation *, SmallVector< calyx::GroupOp > > loopInitGroups
 Loop init groups are to be scheduled before the while operation.

Detailed Description

template<typename Loop>
class circt::calyx::LoopLoweringStateInterface< Loop >

Definition at line 240 of file CalyxLoweringUtils.h.

Constructor & Destructor Documentation

◆ ~LoopLoweringStateInterface()

template<typename Loop>
circt::calyx::LoopLoweringStateInterface< Loop >::~LoopLoweringStateInterface ( )
default

Member Function Documentation

◆ addLoopIterReg()

template<typename Loop>
void circt::calyx::LoopLoweringStateInterface< Loop >::addLoopIterReg ( Loop op,
calyx::RegisterOp reg,
unsigned idx )
inline

Register reg as being the idx'th iter_args register for 'op'.

Definition at line 247 of file CalyxLoweringUtils.h.

References assert(), and loopIterRegs.

◆ buildLoopIterArgAssignments()

template<typename Loop>
calyx::GroupOp circt::calyx::LoopLoweringStateInterface< Loop >::buildLoopIterArgAssignments ( OpBuilder & builder,
Loop op,
calyx::ComponentOp componentOp,
Twine uniqueSuffix,
MutableArrayRef< OpOperand > ops )
inline

Creates a new group that assigns the 'ops' values to the iter arg registers of the loop operation.

Pass iteration arguments through registers. This follows closely to what is done for branch ops.

Create register assignment for each iter_arg. a calyx::GroupDone signal is created for each register. These will be &'ed together in MultipleGroupDonePattern.

Definition at line 303 of file CalyxLoweringUtils.h.

References circt::calyx::buildAssignmentsForRegisterWrite(), circt::calyx::createGroup(), and getLoopIterReg().

◆ getLoopInitGroups()

template<typename Loop>
SmallVector< calyx::GroupOp > circt::calyx::LoopLoweringStateInterface< Loop >::getLoopInitGroups ( Loop op)
inline

Retrieve the loop init groups registered for op.

Definition at line 294 of file CalyxLoweringUtils.h.

References assert(), and loopInitGroups.

◆ getLoopIterReg()

template<typename Loop>
calyx::RegisterOp circt::calyx::LoopLoweringStateInterface< Loop >::getLoopIterReg ( Loop op,
unsigned idx )
inline

Return a mapping of block argument indices to block argument.

Definition at line 256 of file CalyxLoweringUtils.h.

References assert(), and getLoopIterRegs().

Referenced by buildLoopIterArgAssignments().

◆ getLoopIterRegs()

template<typename Loop>
const DenseMap< unsigned, calyx::RegisterOp > & circt::calyx::LoopLoweringStateInterface< Loop >::getLoopIterRegs ( Loop op)
inline

Return a mapping of block argument indices to block argument.

Definition at line 265 of file CalyxLoweringUtils.h.

References loopIterRegs.

Referenced by getLoopIterReg().

◆ getLoopLatchGroup()

template<typename Loop>
calyx::GroupOp circt::calyx::LoopLoweringStateInterface< Loop >::getLoopLatchGroup ( Loop op)
inline

Retrieve the loop latch group registered for op.

Definition at line 278 of file CalyxLoweringUtils.h.

References assert(), and loopLatchGroups.

◆ setLoopInitGroups()

template<typename Loop>
void circt::calyx::LoopLoweringStateInterface< Loop >::setLoopInitGroups ( Loop op,
SmallVector< calyx::GroupOp > groups )
inline

Registers groups to be the loop init groups of op.

Definition at line 286 of file CalyxLoweringUtils.h.

References assert(), and loopInitGroups.

◆ setLoopLatchGroup()

template<typename Loop>
void circt::calyx::LoopLoweringStateInterface< Loop >::setLoopLatchGroup ( Loop op,
calyx::GroupOp group )
inline

Registers grp to be the loop latch group of op.

Definition at line 270 of file CalyxLoweringUtils.h.

References assert(), and loopLatchGroups.

Member Data Documentation

◆ loopInitGroups

template<typename Loop>
DenseMap<Operation *, SmallVector<calyx::GroupOp> > circt::calyx::LoopLoweringStateInterface< Loop >::loopInitGroups
private

Loop init groups are to be scheduled before the while operation.

These groups should set the initial value(s) of the loop init_args register(s).

Definition at line 334 of file CalyxLoweringUtils.h.

Referenced by getLoopInitGroups(), and setLoopInitGroups().

◆ loopIterRegs

template<typename Loop>
DenseMap<Operation *, DenseMap<unsigned, calyx::RegisterOp> > circt::calyx::LoopLoweringStateInterface< Loop >::loopIterRegs
private

A mapping from loop ops to iteration argument registers.

Definition at line 325 of file CalyxLoweringUtils.h.

Referenced by addLoopIterReg(), and getLoopIterRegs().

◆ loopLatchGroups

template<typename Loop>
DenseMap<Operation *, calyx::GroupOp> circt::calyx::LoopLoweringStateInterface< Loop >::loopLatchGroups
private

A loop latch group is a group that should be sequentially executed when finishing a loop body.

The execution of this group will write the yield'ed loop body values to the iteration argument registers.

Definition at line 330 of file CalyxLoweringUtils.h.

Referenced by getLoopLatchGroup(), and setLoopLatchGroup().


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