CIRCT  19.0.0git
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::Problem >
 
struct  Default< scheduling::CyclicProblem >
 
struct  Default< scheduling::ChainingProblem >
 
struct  Default< scheduling::SharedOperatorsProblem >
 
struct  Default< scheduling::ModuloProblem >
 
struct  Default< scheduling::ChainingCyclicProblem >
 

Typedefs

using OperatorType = scheduling::Problem::OperatorType
 
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. More...
 
void printPropertyArray (ArrayAttr attr, AsmPrinter &p, ArrayRef< Attribute > alreadyPrinted={})
 Print an array attribute, suppressing the #ssp. More...
 
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 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>
OperatorType loadOperatorType (ProblemT &prob, OperatorTypeOp oprOp, SmallDenseMap< StringAttr, 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. More...
 
template<typename ProblemT , typename... OperationPropertyTs, typename... OperatorTypePropertyTs, typename... DependencePropertyTs, typename... InstancePropertyTs>
ProblemT loadProblem (InstanceOp instOp, std::tuple< OperationPropertyTs... > opProps, std::tuple< OperatorTypePropertyTs... > oprProps, 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. More...
 
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... 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... DependencePropertyTs, typename... InstancePropertyTs>
InstanceOp saveProblem (ProblemT &prob, std::tuple< OperationPropertyTs... > opProps, std::tuple< OperatorTypePropertyTs... > oprProps, 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. More...
 
template<typename ProblemT >
ProblemT loadProblem (InstanceOp instOp)
 Construct an instance of ProblemT from instOp, and attempt to set all of the problem class' properties. More...
 
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. More...
 

Typedef Documentation

◆ Dependence

Definition at line 34 of file Utilities.h.

◆ OperatorType

Definition at line 33 of file Utilities.h.

Function Documentation

◆ createPrintPass()

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

Definition at line 60 of file Print.cpp.

References lec::errs().

◆ createRoundtripPass()

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

Definition at line 79 of file Roundtrip.cpp.

◆ createSchedulePass()

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

Definition at line 273 of file Schedule.cpp.

◆ loadDependenceProperties() [1/2]

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

Definition at line 70 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 73 of file Utilities.h.

◆ loadInstanceProperties() [1/2]

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

Definition at line 84 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 87 of file Utilities.h.

◆ loadOperationProperties() [1/2]

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

Definition at line 41 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 44 of file Utilities.h.

◆ loadOperatorType()

template<typename ProblemT , typename... OperatorTypePropertyTs>
OperatorType circt::ssp::loadOperatorType ( ProblemT &  prob,
OperatorTypeOp  oprOp,
SmallDenseMap< StringAttr, 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 101 of file Utilities.h.

References assert(), circt::calyx::direction::get(), and loadOperatorTypeProperties().

Referenced by loadProblem().

◆ loadOperatorTypeProperties() [1/2]

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

Definition at line 55 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 58 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 437 of file Utilities.h.

◆ loadProblem() [2/2]

template<typename ProblemT , typename... OperationPropertyTs, typename... OperatorTypePropertyTs, typename... DependencePropertyTs, typename... InstancePropertyTs>
ProblemT circt::ssp::loadProblem ( InstanceOp  instOp,
std::tuple< OperationPropertyTs... >  opProps,
std::tuple< OperatorTypePropertyTs... >  oprProps,
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 140 of file Utilities.h.

References assert(), circt::calyx::direction::get(), loadDependenceProperties(), loadInstanceProperties(), loadOperationProperties(), and loadOperatorType().

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

References builder.

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 269 of file Utilities.h.

Referenced by saveProblem().

◆ saveInstanceProperties()

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

Definition at line 282 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 243 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 256 of file Utilities.h.

◆ 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 450 of file Utilities.h.

References builder.

◆ saveProblem() [2/2]

template<typename ProblemT , typename... OperationPropertyTs, typename... OperatorTypePropertyTs, typename... DependencePropertyTs, typename... InstancePropertyTs>
InstanceOp circt::ssp::saveProblem ( ProblemT &  prob,
std::tuple< OperationPropertyTs... >  opProps,
std::tuple< OperatorTypePropertyTs... >  oprProps,
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 builder

Definition at line 320 of file Utilities.h.

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

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