CIRCT  20.0.0git
Public Member Functions | Static Public Attributes | 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)
 
void clearStartTimeInCycle ()
 
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...
 
 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 (Dependence dep)
 
virtual PropertyStringVector getProperties ()
 

Static Public Attributes

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

Protected Member Functions

 ChainingProblem ()=default
 
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
 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...
 
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 339 of file Problems.h.

Constructor & Destructor Documentation

◆ ChainingProblem()

circt::scheduling::ChainingProblem::ChainingProblem ( )
protecteddefault

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.

◆ clearStartTimeInCycle()

void circt::scheduling::ChainingProblem::clearStartTimeInCycle ( )
inline

Definition at line 380 of file Problems.h.

References startTimeInCycle.

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

◆ 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 355 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 365 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 374 of file Problems.h.

References startTimeInCycle.

◆ 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.

◆ setIncomingDelay()

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

Definition at line 358 of file Problems.h.

References incomingDelay.

◆ setOutgoingDelay()

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

Definition at line 368 of file Problems.h.

References outgoingDelay.

◆ setStartTimeInCycle()

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

Definition at line 377 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 348 of file Problems.h.

Referenced by getIncomingDelay(), and setIncomingDelay().

◆ name

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

Definition at line 341 of file Problems.h.

◆ outgoingDelay

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

Definition at line 348 of file Problems.h.

Referenced by getOutgoingDelay(), and setOutgoingDelay().

◆ startTimeInCycle

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

Definition at line 349 of file Problems.h.

Referenced by clearStartTimeInCycle(), getStartTimeInCycle(), and setStartTimeInCycle().


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