Loading [MathJax]/extensions/tex2jax.js
CIRCT 21.0.0git
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Classes | Typedefs | Functions
circt::ssp Namespace Reference

Classes

struct  Default
 Dummy struct to query a problem's default properties (i.e. More...
 
struct  Default< scheduling::ChainingCyclicProblem >
 
struct  Default< scheduling::ChainingProblem >
 
struct  Default< scheduling::CyclicProblem >
 
struct  Default< scheduling::ModuloProblem >
 
struct  Default< scheduling::Problem >
 
struct  Default< scheduling::SharedOperatorsProblem >
 

Typedefs

using OperatorType = scheduling::Problem::OperatorType
 
using ResourceType = scheduling::Problem::ResourceType
 
using Dependence = scheduling::Problem::Dependence
 

Functions

mlir::OptionalParseResult parseOptionalPropertyArray (ArrayAttr &attr, AsmParser &parser, ArrayRef< Attribute > alreadyParsed={})
 Parse an array of attributes while recognizing the properties of the SSP dialect even without a #ssp.
 
void printPropertyArray (ArrayAttr attr, AsmPrinter &p, ArrayRef< Attribute > alreadyPrinted={})
 Print an array attribute, suppressing the #ssp.
 
std::unique_ptr< mlir::Pass > createPrintPass ()
 
std::unique_ptr< mlir::Pass > createRoundtripPass ()
 
std::unique_ptr< mlir::Pass > createSchedulePass ()
 
template<typename ProblemT >
void loadOperationProperties (ProblemT &, Operation *, ArrayAttr)
 
template<typename ProblemT , typename OperationPropertyT , typename... OperationPropertyTs>
void loadOperationProperties (ProblemT &prob, Operation *op, ArrayAttr props)
 
template<typename ProblemT >
void loadOperatorTypeProperties (ProblemT &, OperatorType, ArrayAttr)
 
template<typename ProblemT , typename OperatorTypePropertyT , typename... OperatorTypePropertyTs>
void loadOperatorTypeProperties (ProblemT &prob, OperatorType opr, ArrayAttr props)
 
template<typename ProblemT >
void loadResourceTypeProperties (ProblemT &, ResourceType, ArrayAttr)
 
template<typename ProblemT , typename ResourceTypePropertyT , typename... ResourceTypePropertyTs>
void loadResourceTypeProperties (ProblemT &prob, ResourceType rsrc, ArrayAttr props)
 
template<typename ProblemT >
void loadDependenceProperties (ProblemT &, Dependence, ArrayAttr)
 
template<typename ProblemT , typename DependencePropertyT , typename... DependencePropertyTs>
void loadDependenceProperties (ProblemT &prob, Dependence dep, ArrayAttr props)
 
template<typename ProblemT >
void loadInstanceProperties (ProblemT &, ArrayAttr)
 
template<typename ProblemT , typename InstancePropertyT , typename... InstancePropertyTs>
void loadInstanceProperties (ProblemT &prob, ArrayAttr props)
 
template<typename ProblemT , typename... OperatorTypePropertyTs>
ProblemT::OperatorType loadOperatorType (ProblemT &prob, OperatorTypeOp oprOp, SmallDenseMap< typename ProblemT::OperatorType, unsigned > &oprIds)
 Load the operator type represented by oprOp into prob under a unique name informed by oprIds, and attempt to set its properties from the given attribute classes.
 
template<typename ProblemT , typename... ResourceTypePropertyTs>
ProblemT::ResourceType loadResourceType (ProblemT &prob, ResourceTypeOp rsrcOp, SmallDenseMap< typename ProblemT::ResourceType, unsigned > &rsrcIds)
 Load the resource type represented by rsrcOp into prob under a unique name informed by rsrcIds, and attempt to set its properties from the given attribute classes.
 
template<typename ProblemT , typename... OperationPropertyTs, typename... OperatorTypePropertyTs, typename... ResourceTypePropertyTs, typename... DependencePropertyTs, typename... InstancePropertyTs>
ProblemT loadProblem (InstanceOp instOp, std::tuple< OperationPropertyTs... > opProps, std::tuple< OperatorTypePropertyTs... > oprProps, std::tuple< ResourceTypePropertyTs... > rsrcProps, std::tuple< DependencePropertyTs... > depProps, std::tuple< InstancePropertyTs... > instProps)
 Construct an instance of ProblemT from instOp, and attempt to set properties from the given attribute classes.
 
template<typename ProblemT , typename... OperationPropertyTs>
ArrayAttr saveOperationProperties (ProblemT &prob, Operation *op, ImplicitLocOpBuilder &b)
 
template<typename ProblemT , typename... OperatorTypePropertyTs>
ArrayAttr saveOperatorTypeProperties (ProblemT &prob, OperatorType opr, ImplicitLocOpBuilder &b)
 
template<typename ProblemT , typename... ResourceTypePropertyTs>
ArrayAttr saveResourceTypeProperties (ProblemT &prob, ResourceType rsrc, ImplicitLocOpBuilder &b)
 
template<typename ProblemT , typename... DependencePropertyTs>
ArrayAttr saveDependenceProperties (ProblemT &prob, Dependence dep, ImplicitLocOpBuilder &b)
 
template<typename ProblemT , typename... InstancePropertyTs>
ArrayAttr saveInstanceProperties (ProblemT &prob, ImplicitLocOpBuilder &b)
 
template<typename ProblemT , typename... OperationPropertyTs, typename... OperatorTypePropertyTs, typename... ResourceTypePropertyTs, typename... DependencePropertyTs, typename... InstancePropertyTs>
InstanceOp saveProblem (ProblemT &prob, std::tuple< OperationPropertyTs... > opProps, std::tuple< OperatorTypePropertyTs... > oprProps, std::tuple< ResourceTypePropertyTs... > rsrcProps, std::tuple< DependencePropertyTs... > depProps, std::tuple< InstancePropertyTs... > instProps, OpBuilder &builder)
 Construct an InstanceOp from a given ProblemT instance, and create/attach attributes of the given classes for the corresponding properties on the scheduling problem.
 
template<typename ProblemT >
ProblemT loadProblem (InstanceOp instOp)
 Construct an instance of ProblemT from instOp, and attempt to set all of the problem class' properties.
 
template<typename ProblemT >
InstanceOp saveProblem (ProblemT &prob, OpBuilder &builder)
 Construct an InstanceOp from a given ProblemT instance, and create/attach attributes for all of the problem class' properties.
 

Typedef Documentation

◆ Dependence

Definition at line 35 of file Utilities.h.

◆ OperatorType

Definition at line 33 of file Utilities.h.

◆ ResourceType

Definition at line 34 of file Utilities.h.

Function Documentation

◆ createPrintPass()

std::unique_ptr< mlir::Pass > circt::ssp::createPrintPass ( )

Definition at line 73 of file Print.cpp.

◆ createRoundtripPass()

std::unique_ptr< mlir::Pass > circt::ssp::createRoundtripPass ( )

Definition at line 92 of file Roundtrip.cpp.

◆ createSchedulePass()

std::unique_ptr< mlir::Pass > circt::ssp::createSchedulePass ( )

Definition at line 286 of file Schedule.cpp.

◆ loadDependenceProperties() [1/2]

template<typename ProblemT >
void circt::ssp::loadDependenceProperties ( ProblemT &  ,
Dependence  ,
ArrayAttr   
)

Definition at line 86 of file Utilities.h.

Referenced by loadProblem().

◆ loadDependenceProperties() [2/2]

template<typename ProblemT , typename DependencePropertyT , typename... DependencePropertyTs>
void circt::ssp::loadDependenceProperties ( ProblemT &  prob,
Dependence  dep,
ArrayAttr  props 
)

Definition at line 89 of file Utilities.h.

◆ loadInstanceProperties() [1/2]

template<typename ProblemT >
void circt::ssp::loadInstanceProperties ( ProblemT &  ,
ArrayAttr   
)

Definition at line 100 of file Utilities.h.

Referenced by loadProblem().

◆ loadInstanceProperties() [2/2]

template<typename ProblemT , typename InstancePropertyT , typename... InstancePropertyTs>
void circt::ssp::loadInstanceProperties ( ProblemT &  prob,
ArrayAttr  props 
)

Definition at line 103 of file Utilities.h.

◆ loadOperationProperties() [1/2]

template<typename ProblemT >
void circt::ssp::loadOperationProperties ( ProblemT &  ,
Operation *  ,
ArrayAttr   
)

Definition at line 42 of file Utilities.h.

Referenced by loadProblem().

◆ loadOperationProperties() [2/2]

template<typename ProblemT , typename OperationPropertyT , typename... OperationPropertyTs>
void circt::ssp::loadOperationProperties ( ProblemT &  prob,
Operation *  op,
ArrayAttr  props 
)

Definition at line 45 of file Utilities.h.

◆ loadOperatorType()

template<typename ProblemT , typename... OperatorTypePropertyTs>
ProblemT::OperatorType circt::ssp::loadOperatorType ( ProblemT &  prob,
OperatorTypeOp  oprOp,
SmallDenseMap< typename ProblemT::OperatorType, unsigned > &  oprIds 
)

Load the operator type represented by oprOp into prob under a unique name informed by oprIds, and attempt to set its properties from the given attribute classes.

The registered name is returned. The template instantiation fails if properties are incompatible with ProblemT.

Definition at line 117 of file Utilities.h.

References assert(), circt::scheduling::Problem::OperatorType::getValue(), and loadOperatorTypeProperties().

Referenced by loadProblem().

◆ loadOperatorTypeProperties() [1/2]

template<typename ProblemT >
void circt::ssp::loadOperatorTypeProperties ( ProblemT &  ,
OperatorType  ,
ArrayAttr   
)

Definition at line 56 of file Utilities.h.

Referenced by loadOperatorType().

◆ loadOperatorTypeProperties() [2/2]

template<typename ProblemT , typename OperatorTypePropertyT , typename... OperatorTypePropertyTs>
void circt::ssp::loadOperatorTypeProperties ( ProblemT &  prob,
OperatorType  opr,
ArrayAttr  props 
)

Definition at line 59 of file Utilities.h.

◆ loadProblem() [1/2]

template<typename ProblemT >
ProblemT circt::ssp::loadProblem ( InstanceOp  instOp)

Construct an instance of ProblemT from instOp, and attempt to set all of the problem class' properties.

Relies on the specialization of template circt::ssp::Default for ProblemT.

Definition at line 564 of file Utilities.h.

◆ loadProblem() [2/2]

template<typename ProblemT , typename... OperationPropertyTs, typename... OperatorTypePropertyTs, typename... ResourceTypePropertyTs, typename... DependencePropertyTs, typename... InstancePropertyTs>
ProblemT circt::ssp::loadProblem ( InstanceOp  instOp,
std::tuple< OperationPropertyTs... >  opProps,
std::tuple< OperatorTypePropertyTs... >  oprProps,
std::tuple< ResourceTypePropertyTs... >  rsrcProps,
std::tuple< DependencePropertyTs... >  depProps,
std::tuple< InstancePropertyTs... >  instProps 
)

Construct an instance of ProblemT from instOp, and attempt to set properties from the given attribute classes.

The attribute tuples are used solely for grouping/inferring the template parameter packs. The tuple elements may therefore be unitialized objects. The template instantiation fails if properties are incompatible with ProblemT.

Operations may link to operator types in other libraries, but the origin of an operator type will not be preserved in the problem instance. As this could lead to conflicts, operator types will be automatically renamed in the returned instance.

Example: To load an instance of the circt::scheduling::CyclicProblem with all its input and solution properties, call this as follows:

loadProblem<CyclicProblem>(instOp,
std::make_tuple(LinkedOperatorTypeAttr(), StartTimeAttr()),
std::make_tuple(LatencyAttr()),
std::make_tuple(DistanceAttr()),
std::make_tuple(InitiationIntervalAttr()));

Definition at line 179 of file Utilities.h.

References assert(), loadDependenceProperties(), loadInstanceProperties(), loadOperationProperties(), loadOperatorType(), and loadResourceType().

◆ loadResourceType()

template<typename ProblemT , typename... ResourceTypePropertyTs>
ProblemT::ResourceType circt::ssp::loadResourceType ( ProblemT &  prob,
ResourceTypeOp  rsrcOp,
SmallDenseMap< typename ProblemT::ResourceType, unsigned > &  rsrcIds 
)

Load the resource type represented by rsrcOp into prob under a unique name informed by rsrcIds, and attempt to set its properties from the given attribute classes.

The registered name is returned. The template instantiation fails if properties are incompatible with ProblemT.

Definition at line 138 of file Utilities.h.

References assert(), circt::scheduling::Problem::ResourceType::getValue(), and loadResourceTypeProperties().

Referenced by loadProblem().

◆ loadResourceTypeProperties() [1/2]

template<typename ProblemT >
void circt::ssp::loadResourceTypeProperties ( ProblemT &  ,
ResourceType  ,
ArrayAttr   
)

Definition at line 71 of file Utilities.h.

Referenced by loadResourceType().

◆ loadResourceTypeProperties() [2/2]

template<typename ProblemT , typename ResourceTypePropertyT , typename... ResourceTypePropertyTs>
void circt::ssp::loadResourceTypeProperties ( ProblemT &  prob,
ResourceType  rsrc,
ArrayAttr  props 
)

Definition at line 74 of file Utilities.h.

◆ parseOptionalPropertyArray()

mlir::OptionalParseResult circt::ssp::parseOptionalPropertyArray ( ArrayAttr &  attr,
AsmParser &  parser,
ArrayRef< Attribute >  alreadyParsed = {} 
)

Parse an array of attributes while recognizing the properties of the SSP dialect even without a #ssp.

prefix. Any attributes supplied in alreadyParsed are prepended to the parsed ones.

Definition at line 36 of file SSPAttributes.cpp.

Referenced by parseSSPProperties().

◆ printPropertyArray()

void circt::ssp::printPropertyArray ( ArrayAttr  attr,
AsmPrinter &  p,
ArrayRef< Attribute >  alreadyPrinted = {} 
)

Print an array attribute, suppressing the #ssp.

prefix for properties defined in the SSP dialect. Attributes mentioned in alreadyPrinted are skipped.

Definition at line 89 of file SSPAttributes.cpp.

Referenced by printSSPProperties().

◆ saveDependenceProperties()

template<typename ProblemT , typename... DependencePropertyTs>
ArrayAttr circt::ssp::saveDependenceProperties ( ProblemT &  prob,
Dependence  dep,
ImplicitLocOpBuilder &  b 
)

Definition at line 380 of file Utilities.h.

Referenced by saveProblem().

◆ saveInstanceProperties()

template<typename ProblemT , typename... InstancePropertyTs>
ArrayAttr circt::ssp::saveInstanceProperties ( ProblemT &  prob,
ImplicitLocOpBuilder &  b 
)

Definition at line 393 of file Utilities.h.

Referenced by saveProblem().

◆ saveOperationProperties()

template<typename ProblemT , typename... OperationPropertyTs>
ArrayAttr circt::ssp::saveOperationProperties ( ProblemT &  prob,
Operation *  op,
ImplicitLocOpBuilder &  b 
)

Definition at line 341 of file Utilities.h.

Referenced by saveProblem().

◆ saveOperatorTypeProperties()

template<typename ProblemT , typename... OperatorTypePropertyTs>
ArrayAttr circt::ssp::saveOperatorTypeProperties ( ProblemT &  prob,
OperatorType  opr,
ImplicitLocOpBuilder &  b 
)

Definition at line 354 of file Utilities.h.

Referenced by saveProblem().

◆ saveProblem() [1/2]

template<typename ProblemT >
InstanceOp circt::ssp::saveProblem ( ProblemT &  prob,
OpBuilder &  builder 
)

Construct an InstanceOp from a given ProblemT instance, and create/attach attributes for all of the problem class' properties.

Relies on the specialization of template circt::ssp::Default for ProblemT.

Definition at line 578 of file Utilities.h.

◆ saveProblem() [2/2]

template<typename ProblemT , typename... OperationPropertyTs, typename... OperatorTypePropertyTs, typename... ResourceTypePropertyTs, typename... DependencePropertyTs, typename... InstancePropertyTs>
InstanceOp circt::ssp::saveProblem ( ProblemT &  prob,
std::tuple< OperationPropertyTs... >  opProps,
std::tuple< OperatorTypePropertyTs... >  oprProps,
std::tuple< ResourceTypePropertyTs... >  rsrcProps,
std::tuple< DependencePropertyTs... >  depProps,
std::tuple< InstancePropertyTs... >  instProps,
OpBuilder &  builder 
)

Construct an InstanceOp from a given ProblemT instance, and create/attach attributes of the given classes for the corresponding properties on the scheduling problem.

The returned InstanceOp uses the given instanceName and problemName. OperationOps are created unnamed, unless they represent the source operation in an auxiliary dependence, or the operationNameFn callback returns a non-null StringAttr with the desired name. The attribute tuples are used solely for grouping/inferring the template parameter packs. The tuple elements may therefore be unitialized objects. The template instantiation fails if properties are incompatible with ProblemT.

Example: To save an instance of the circt::scheduling::CyclicProblem with all its input and solution properties, and reyling on default operation names, call this as follows:

saveProblem<CyclicProblem>(prob,
std::make_tuple(LinkedOperatorTypeAttr(), StartTimeAttr()),
std::make_tuple(LatencyAttr()),
std::make_tuple(DistanceAttr()),
std::make_tuple(InitiationIntervalAttr()),
builder);

Definition at line 432 of file Utilities.h.

References assert(), circt::ValueMapper::get(), saveDependenceProperties(), saveInstanceProperties(), saveOperationProperties(), saveOperatorTypeProperties(), saveResourceTypeProperties(), and circt::ValueMapper::set().

Referenced by scheduleChainingCyclicProblemWithSimplex(), scheduleChainingProblemWithSimplex(), scheduleProblemTWithSimplex(), and scheduleWithASAP().

◆ saveResourceTypeProperties()

template<typename ProblemT , typename... ResourceTypePropertyTs>
ArrayAttr circt::ssp::saveResourceTypeProperties ( ProblemT &  prob,
ResourceType  rsrc,
ImplicitLocOpBuilder &  b 
)

Definition at line 367 of file Utilities.h.

Referenced by saveProblem().