CIRCT  19.0.0git
Public Member Functions | Private Attributes | List of all members
circt::calyx::LoopLoweringStateInterface< Loop > Class Template Reference

#include <CalyxLoweringUtils.h>

Inheritance diagram for circt::calyx::LoopLoweringStateInterface< Loop >:
Inheritance graph
[legend]
Collaboration diagram for circt::calyx::LoopLoweringStateInterface< Loop >:
Collaboration graph
[legend]

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'. More...
 
calyx::RegisterOp getLoopIterReg (Loop op, unsigned idx)
 Return a mapping of block argument indices to block argument. More...
 
const DenseMap< unsigned, calyx::RegisterOp > & getLoopIterRegs (Loop op)
 Return a mapping of block argument indices to block argument. More...
 
void setLoopLatchGroup (Loop op, calyx::GroupOp group)
 Registers grp to be the loop latch group of op. More...
 
calyx::GroupOp getLoopLatchGroup (Loop op)
 Retrieve the loop latch group registered for op. More...
 
void setLoopInitGroups (Loop op, SmallVector< calyx::GroupOp > groups)
 Registers groups to be the loop init groups of op. More...
 
SmallVector< calyx::GroupOp > getLoopInitGroups (Loop op)
 Retrieve the loop init groups registered for op. More...
 
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. More...
 

Private Attributes

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

Detailed Description

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

Definition at line 235 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 242 of file CalyxLoweringUtils.h.

References assert(), circt::calyx::LoopLoweringStateInterface< Loop >::loopIterRegs, and seq::reg().

◆ 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 298 of file CalyxLoweringUtils.h.

References circt::calyx::buildAssignmentsForRegisterWrite(), builder, circt::calyx::LoopLoweringStateInterface< Loop >::getLoopIterReg(), and seq::reg().

◆ 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 289 of file CalyxLoweringUtils.h.

References assert(), and circt::calyx::LoopLoweringStateInterface< Loop >::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 251 of file CalyxLoweringUtils.h.

References assert(), and circt::calyx::LoopLoweringStateInterface< Loop >::getLoopIterRegs().

Referenced by circt::calyx::LoopLoweringStateInterface< Loop >::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 260 of file CalyxLoweringUtils.h.

References circt::calyx::LoopLoweringStateInterface< Loop >::loopIterRegs.

Referenced by circt::calyx::LoopLoweringStateInterface< Loop >::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 273 of file CalyxLoweringUtils.h.

References assert(), and circt::calyx::LoopLoweringStateInterface< Loop >::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 281 of file CalyxLoweringUtils.h.

References assert(), and circt::calyx::LoopLoweringStateInterface< Loop >::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 265 of file CalyxLoweringUtils.h.

References assert(), and circt::calyx::LoopLoweringStateInterface< Loop >::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 329 of file CalyxLoweringUtils.h.

Referenced by circt::calyx::LoopLoweringStateInterface< Loop >::getLoopInitGroups(), and circt::calyx::LoopLoweringStateInterface< Loop >::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 320 of file CalyxLoweringUtils.h.

Referenced by circt::calyx::LoopLoweringStateInterface< Loop >::addLoopIterReg(), and circt::calyx::LoopLoweringStateInterface< Loop >::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 325 of file CalyxLoweringUtils.h.

Referenced by circt::calyx::LoopLoweringStateInterface< Loop >::getLoopLatchGroup(), and circt::calyx::LoopLoweringStateInterface< Loop >::setLoopLatchGroup().


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