CIRCT  19.0.0git
Public Member Functions | Protected Member Functions | Private Attributes | List of all members
circt::scheduling::ChainingProblem Class Reference

This class models the accumulation of physical propagation delays on combinational paths along SSA dependences. More...

#include <Problems.h>

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

Public Member Functions

std::optional< float > getIncomingDelay (OperatorType opr)
 The incoming delay denotes the propagation time from the operand inputs to either the result outputs (combinational operators) or the first internal register stage. More...
 
void setIncomingDelay (OperatorType opr, float delay)
 
std::optional< float > getOutgoingDelay (OperatorType opr)
 The outgoing delay denotes the propagation time from either the operand inputs (combinational operators) or the last internal register stage to the result outputs. More...
 
void setOutgoingDelay (OperatorType opr, float delay)
 
std::optional< float > getStartTimeInCycle (Operation *op)
 Computed by the scheduler, this start time is relative to the beginning of the cycle that op starts in. More...
 
void setStartTimeInCycle (Operation *op, float time)
 
virtual PropertyStringVector getProperties (Operation *op) override
 
virtual PropertyStringVector getProperties (OperatorType opr) override
 
virtual LogicalResult check () override
 Return success if the constructed scheduling problem is valid. More...
 
virtual LogicalResult verify () override
 Return success if the computed solution is valid. More...
 
- Public Member Functions inherited from circt::scheduling::Problem
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 (Dependence dep)
 
virtual PropertyStringVector getProperties ()
 

Protected Member Functions

virtual LogicalResult checkDelays (OperatorType opr)
 Incoming/outgoing delays are set for opr and non-negative. More...
 
virtual LogicalResult verifyStartTimeInCycle (Operation *op)
 op has a non-negative start time in its cycle. More...
 
virtual LogicalResult verifyPrecedenceInCycle (Dependence dep)
 If dep is an SSA edge and its source operation finishes in the same time step as the destination operation, the source's result is available before the destination starts in that cycle. More...
 
- Protected Member Functions inherited from circt::scheduling::Problem
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...
 
virtual LogicalResult verifyPrecedence (Dependence dep)
 dep's source operation is available before dep's destination operation starts. More...
 

Private Attributes

OperatorTypeProperty< float > incomingDelay
 
OperatorTypeProperty< float > outgoingDelay
 
OperationProperty< float > startTimeInCycle
 

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 the accumulation of physical propagation delays on combinational paths along SSA dependences.

Each operator type is annotated with estimated values for incoming and outgoing delays. Combinational operators (zero-latency, no internal registers) have only a single delay; this important special case is modeled by setting the incoming and outgoing delays to the same value.

A solution to this problem comprises per-operation start times in a continuous unit, e.g. in nanoseconds, inside the discrete time steps/cycles determined by the underlying scheduling problem.

Definition at line 340 of file Problems.h.

Member Function Documentation

◆ check()

LogicalResult ChainingProblem::check ( )
overridevirtual

Return success if the constructed scheduling problem is valid.

Reimplemented from circt::scheduling::Problem.

Reimplemented in circt::scheduling::ChainingCyclicProblem.

Definition at line 290 of file Problems.cpp.

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

Referenced by circt::scheduling::ChainingCyclicProblem::check().

◆ checkDelays()

LogicalResult ChainingProblem::checkDelays ( OperatorType  opr)
protectedvirtual

Incoming/outgoing delays are set for opr and non-negative.

The delays are equal if opr is a zero-latency operator type.

Definition at line 224 of file Problems.cpp.

◆ getIncomingDelay()

std::optional<float> circt::scheduling::ChainingProblem::getIncomingDelay ( OperatorType  opr)
inline

The incoming delay denotes the propagation time from the operand inputs to either the result outputs (combinational operators) or the first internal register stage.

Definition at line 351 of file Problems.h.

References incomingDelay.

◆ getOutgoingDelay()

std::optional<float> circt::scheduling::ChainingProblem::getOutgoingDelay ( OperatorType  opr)
inline

The outgoing delay denotes the propagation time from either the operand inputs (combinational operators) or the last internal register stage to the result outputs.

Definition at line 361 of file Problems.h.

References outgoingDelay.

◆ getProperties() [1/2]

Problem::PropertyStringVector ChainingProblem::getProperties ( Operation *  op)
overridevirtual

Reimplemented from circt::scheduling::Problem.

Definition at line 208 of file Problems.cpp.

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

◆ getProperties() [2/2]

Problem::PropertyStringVector ChainingProblem::getProperties ( OperatorType  opr)
overridevirtual

Reimplemented from circt::scheduling::Problem.

Definition at line 215 of file Problems.cpp.

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

◆ getStartTimeInCycle()

std::optional<float> circt::scheduling::ChainingProblem::getStartTimeInCycle ( Operation *  op)
inline

Computed by the scheduler, this start time is relative to the beginning of the cycle that op starts in.

Definition at line 370 of file Problems.h.

References startTimeInCycle.

◆ setIncomingDelay()

void circt::scheduling::ChainingProblem::setIncomingDelay ( OperatorType  opr,
float  delay 
)
inline

Definition at line 354 of file Problems.h.

References incomingDelay.

◆ setOutgoingDelay()

void circt::scheduling::ChainingProblem::setOutgoingDelay ( OperatorType  opr,
float  delay 
)
inline

Definition at line 364 of file Problems.h.

References outgoingDelay.

◆ setStartTimeInCycle()

void circt::scheduling::ChainingProblem::setStartTimeInCycle ( Operation *  op,
float  time 
)
inline

Definition at line 373 of file Problems.h.

References startTimeInCycle.

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

◆ verify()

LogicalResult ChainingProblem::verify ( )
overridevirtual

Return success if the computed solution is valid.

Reimplemented from circt::scheduling::Problem.

Reimplemented in circt::scheduling::ChainingCyclicProblem.

Definition at line 301 of file Problems.cpp.

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

Referenced by circt::scheduling::ChainingCyclicProblem::verify().

◆ verifyPrecedenceInCycle()

LogicalResult ChainingProblem::verifyPrecedenceInCycle ( Dependence  dep)
protectedvirtual

If dep is an SSA edge and its source operation finishes in the same time step as the destination operation, the source's result is available before the destination starts in that cycle.

Definition at line 255 of file Problems.cpp.

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

◆ verifyStartTimeInCycle()

LogicalResult ChainingProblem::verifyStartTimeInCycle ( Operation *  op)
protectedvirtual

op has a non-negative start time in its cycle.

Definition at line 248 of file Problems.cpp.

Member Data Documentation

◆ incomingDelay

OperatorTypeProperty<float> circt::scheduling::ChainingProblem::incomingDelay
private

Definition at line 344 of file Problems.h.

Referenced by getIncomingDelay(), and setIncomingDelay().

◆ outgoingDelay

OperatorTypeProperty<float> circt::scheduling::ChainingProblem::outgoingDelay
private

Definition at line 344 of file Problems.h.

Referenced by getOutgoingDelay(), and setOutgoingDelay().

◆ startTimeInCycle

OperationProperty<float> circt::scheduling::ChainingProblem::startTimeInCycle
private

Definition at line 345 of file Problems.h.

Referenced by getStartTimeInCycle(), and setStartTimeInCycle().


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