CIRCT  20.0.0git
Public Member Functions | Static Public Attributes | Protected Member Functions | Private Attributes | List of all members
circt::scheduling::CyclicProblem Class Reference

This class models a cyclic scheduling problem. More...

#include <Problems.h>

Inheritance diagram for circt::scheduling::CyclicProblem:
Inheritance graph
[legend]
Collaboration diagram for circt::scheduling::CyclicProblem:
Collaboration graph
[legend]

Public Member Functions

std::optional< unsigned > getDistance (Dependence dep)
 The distance determines whether a dependence has to be satisfied in the same iteration (distance=0 or not set), or distance-many iterations later. More...
 
void setDistance (Dependence dep, unsigned val)
 
std::optional< unsigned > getInitiationInterval ()
 The initiation interval (II) is the number of time steps between subsequent iterations, i.e. More...
 
void setInitiationInterval (unsigned val)
 
virtual PropertyStringVector getProperties (Dependence dep) override
 
virtual PropertyStringVector getProperties () override
 
virtual LogicalResult verify () override
 Return success if the computed solution is valid. More...
 
 Problem (Operation *containingOp)
 Construct an empty scheduling problem. More...
 
 Problem ()=default
 
- Public Member Functions inherited from circt::scheduling::Problem
 Problem (Operation *containingOp)
 Construct an empty scheduling problem. More...
 
virtual ~Problem ()=default
 
void insertOperation (Operation *op)
 Include op in this scheduling problem. More...
 
LogicalResult insertDependence (Dependence dep)
 Include dep in the scheduling problem. More...
 
void insertOperatorType (OperatorType opr)
 Include opr in this scheduling problem. More...
 
OperatorType getOrInsertOperatorType (StringRef name)
 Retrieves the operator type identified by the client-specific name. More...
 
Operation * getContainingOp ()
 Return the operation containing this problem, e.g. to emit diagnostics. More...
 
void setContainingOp (Operation *op)
 Set the operation containing this problem, e.g. to emit diagnostics. More...
 
bool hasOperation (Operation *op)
 Return true if op is part of this problem. More...
 
const OperationSetgetOperations ()
 Return the set of operations. More...
 
DependenceRange getDependences (Operation *op)
 Return a range object to transparently iterate over op's incoming 1) implicit def-use dependences (backed by the SSA graph), and then 2) explictly added auxiliary dependences. More...
 
bool hasOperatorType (OperatorType opr)
 Return true if opr is part of this problem. More...
 
const OperatorTypeSetgetOperatorTypes ()
 Return the set of operator types. More...
 
std::optional< OperatorTypegetLinkedOperatorType (Operation *op)
 The linked operator type provides the runtime characteristics for op. More...
 
void setLinkedOperatorType (Operation *op, OperatorType opr)
 
std::optional< unsigned > getLatency (OperatorType opr)
 The latency is the number of cycles opr needs to compute its result. More...
 
void setLatency (OperatorType opr, unsigned val)
 
std::optional< unsigned > getStartTime (Operation *op)
 Return the start time for op, as computed by the scheduler. More...
 
void setStartTime (Operation *op, unsigned val)
 
std::optional< unsigned > getEndTime (Operation *op)
 Returns the end time for op, as computed by the scheduler. More...
 
StringAttr getInstanceName ()
 
void setInstanceName (StringAttr name)
 
StringAttr getLibraryName ()
 
void setLibraryName (StringAttr name)
 
StringAttr getOperationName (Operation *op)
 
void setOperationName (Operation *op, StringAttr name)
 
virtual PropertyStringVector getProperties (Operation *op)
 
virtual PropertyStringVector getProperties (OperatorType opr)
 
virtual LogicalResult check ()
 Return success if the constructed scheduling problem is valid. More...
 

Static Public Attributes

static constexpr auto name = "CyclicProblem"
 
- Static Public Attributes inherited from circt::scheduling::Problem
static constexpr auto name = "Problem"
 

Protected Member Functions

 CyclicProblem ()=default
 
virtual LogicalResult verifyPrecedence (Dependence dep) override
 dep's source operation is available before dep's destination operation starts (dep's distance iterations later). More...
 
virtual LogicalResult verifyInitiationInterval ()
 This problem has a non-zero II. More...
 
- Protected Member Functions inherited from circt::scheduling::Problem
 Problem ()=default
 
virtual LogicalResult checkLinkedOperatorType (Operation *op)
 op is linked to a registered operator type. More...
 
virtual LogicalResult checkLatency (OperatorType opr)
 opr has a latency. More...
 
virtual LogicalResult verifyStartTime (Operation *op)
 op has a start time. More...
 

Private Attributes

DependenceProperty< unsigned > distance
 
InstanceProperty< unsigned > initiationInterval
 

Additional Inherited Members

- Public Types inherited from circt::scheduling::Problem
using Dependence = detail::Dependence
 A thin wrapper to allow a uniform handling of def-use and auxiliary dependences. More...
 
using OperatorType = mlir::StringAttr
 Operator types are distinguished by name (chosen by the client). More...
 
using OperationSet = llvm::SetVector< Operation * >
 
using DependenceRange = llvm::iterator_range< detail::DependenceIterator >
 
using OperatorTypeSet = llvm::SetVector< OperatorType >
 
using PropertyStringVector = llvm::SmallVector< std::pair< std::string, std::string >, 2 >
 
- Protected Types inherited from circt::scheduling::Problem
using AuxDependenceMap = llvm::DenseMap< Operation *, llvm::SmallSetVector< Operation *, 4 > >
 
template<typename T >
using OperationProperty = llvm::DenseMap< Operation *, std::optional< T > >
 
template<typename T >
using DependenceProperty = llvm::DenseMap< Dependence, std::optional< T > >
 
template<typename T >
using OperatorTypeProperty = llvm::DenseMap< OperatorType, std::optional< T > >
 
template<typename T >
using InstanceProperty = std::optional< T >
 

Detailed Description

This class models a cyclic scheduling problem.

Its solution can be used to construct a pipelined datapath with a fixed, integer initiation interval, in which the execution of multiple iterations/samples/etc. may overlap.

Definition at line 286 of file Problems.h.

Constructor & Destructor Documentation

◆ CyclicProblem()

circt::scheduling::CyclicProblem::CyclicProblem ( )
protecteddefault

Member Function Documentation

◆ getDistance()

std::optional<unsigned> circt::scheduling::CyclicProblem::getDistance ( Dependence  dep)
inline

The distance determines whether a dependence has to be satisfied in the same iteration (distance=0 or not set), or distance-many iterations later.

Definition at line 301 of file Problems.h.

References distance.

Referenced by circt::scheduling::scheduleLP().

◆ getInitiationInterval()

std::optional<unsigned> circt::scheduling::CyclicProblem::getInitiationInterval ( )
inline

The initiation interval (II) is the number of time steps between subsequent iterations, i.e.

a new iteration is started every II time steps. The best possible value is 1, meaning that a corresponding pipeline accepts new data every cycle. This property is part of the cyclic problem's solution.

Definition at line 311 of file Problems.h.

References initiationInterval.

◆ getProperties() [1/2]

Problem::PropertyStringVector CyclicProblem::getProperties ( )
overridevirtual

Reimplemented from circt::scheduling::Problem.

Definition at line 164 of file Problems.cpp.

References circt::scheduling::Problem::getProperties().

◆ getProperties() [2/2]

Problem::PropertyStringVector CyclicProblem::getProperties ( Dependence  dep)
overridevirtual

Reimplemented from circt::scheduling::Problem.

Definition at line 157 of file Problems.cpp.

References circt::scheduling::Problem::getProperties().

◆ Problem() [1/2]

circt::scheduling::Problem::Problem
default

◆ Problem() [2/2]

circt::scheduling::Problem::Problem
inlineexplicit

Construct an empty scheduling problem.

containingOp is used for its MLIRContext and to emit diagnostics.

Definition at line 81 of file Problems.h.

◆ setDistance()

void circt::scheduling::CyclicProblem::setDistance ( Dependence  dep,
unsigned  val 
)
inline

Definition at line 304 of file Problems.h.

References distance.

Referenced by circt::analysis::CyclicSchedulingAnalysis::analyzeForOp().

◆ setInitiationInterval()

void circt::scheduling::CyclicProblem::setInitiationInterval ( unsigned  val)
inline

Definition at line 312 of file Problems.h.

References initiationInterval.

Referenced by circt::scheduling::scheduleLP().

◆ verify()

LogicalResult CyclicProblem::verify ( )
overridevirtual

Return success if the computed solution is valid.

Reimplemented from circt::scheduling::Problem.

Reimplemented in circt::scheduling::ChainingCyclicProblem, and circt::scheduling::ModuloProblem.

Definition at line 198 of file Problems.cpp.

References circt::scheduling::Problem::verify().

Referenced by circt::scheduling::ModuloProblem::verify(), and circt::scheduling::ChainingCyclicProblem::verify().

◆ verifyInitiationInterval()

LogicalResult CyclicProblem::verifyInitiationInterval ( )
protectedvirtual

This problem has a non-zero II.

Definition at line 192 of file Problems.cpp.

◆ verifyPrecedence()

LogicalResult CyclicProblem::verifyPrecedence ( Dependence  dep)
overrideprotectedvirtual

dep's source operation is available before dep's destination operation starts (dep's distance iterations later).

Reimplemented from circt::scheduling::Problem.

Definition at line 171 of file Problems.cpp.

References circt::scheduling::detail::Dependence::getDestination(), and circt::scheduling::detail::Dependence::getSource().

Member Data Documentation

◆ distance

DependenceProperty<unsigned> circt::scheduling::CyclicProblem::distance
private

Definition at line 295 of file Problems.h.

Referenced by getDistance(), and setDistance().

◆ initiationInterval

InstanceProperty<unsigned> circt::scheduling::CyclicProblem::initiationInterval
private

Definition at line 296 of file Problems.h.

Referenced by getInitiationInterval(), and setInitiationInterval().

◆ name

constexpr auto circt::scheduling::CyclicProblem::name = "CyclicProblem"
staticconstexpr

Definition at line 288 of file Problems.h.


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