CIRCT 24.0.0git
Loading...
Searching...
No Matches
PipelineOps.cpp File Reference
#include "circt/Dialect/Pipeline/PipelineOps.h"
#include "circt/Support/ParsingUtils.h"
#include "mlir/Dialect/Arith/IR/Arith.h"
#include "mlir/Dialect/Func/IR/FuncOps.h"
#include "mlir/IR/Builders.h"
#include "mlir/Interfaces/FunctionImplementation.h"
#include "llvm/Support/Debug.h"
#include "llvm/Support/FormatVariadic.h"
#include "circt/Dialect/Pipeline/PipelineDialect.cpp.inc"
#include "circt/Dialect/Pipeline/Pipeline.cpp.inc"
Include dependency graph for PipelineOps.cpp:

Go to the source code of this file.

Macros

#define DEBUG_TYPE   "pipeline-ops"
#define GET_OP_CLASSES
#define GET_OP_LIST

Functions

static ParseResult parseOutputList (OpAsmParser &parser, llvm::SmallVector< Type > &inputTypes, mlir::ArrayAttr &outputNames)
static void printOutputList (OpAsmPrinter &p, TypeRange types, ArrayAttr names)
static ParseResult parseKeywordAndOperand (OpAsmParser &p, StringRef keyword, OpAsmParser::UnresolvedOperand &op)
static ParseResult parsePipelineOp (mlir::OpAsmParser &parser, mlir::OperationState &result)
static void printKeywordOperand (OpAsmPrinter &p, StringRef keyword, Value value)
template<typename TPipelineOp>
static void printPipelineOp (OpAsmPrinter &p, TPipelineOp op)
static void buildPipelineLikeOp (OpBuilder &odsBuilder, OperationState &odsState, TypeRange dataOutputs, ValueRange inputs, ArrayAttr inputNames, ArrayAttr outputNames, Value clock, Value go, Value reset, Value stall, StringAttr name, ArrayAttr stallability)
template<typename TPipelineOp>
static void getPipelineAsmResultNames (TPipelineOp op, OpAsmSetValueNameFn setNameFn)
template<typename TPipelineOp>
static void getPipelineAsmBlockArgumentNames (TPipelineOp op, mlir::Region &region, mlir::OpAsmSetValueNameFn setNameFn)
static FailureOr< llvm::SmallVector< Block * > > getOrderedStagesFailable (ScheduledPipelineOp op)
static bool isNestedBlock (Block *stopAt, Block *parent, Block *current)
static bool useDefinedInStage (Block *stopAt, Block *stage, OpOperand &use)
static ParseResult parseOptNamedTypedAssignment (OpAsmParser &parser, OpAsmParser::UnresolvedOperand &v, Type &t, StringAttr &name)
static ParseResult parseSingleStageRegister (OpAsmParser &parser, OpAsmParser::UnresolvedOperand &v, Type &t, llvm::SmallVector< OpAsmParser::UnresolvedOperand > &clockGates, StringAttr &name)
ParseResult parseStageRegisters (OpAsmParser &parser, llvm::SmallVector< OpAsmParser::UnresolvedOperand, 4 > &registers, llvm::SmallVector< mlir::Type, 1 > &registerTypes, llvm::SmallVector< OpAsmParser::UnresolvedOperand, 4 > &clockGates, ArrayAttr &clockGatesPerRegister, ArrayAttr &registerNames)
void printStageRegisters (OpAsmPrinter &p, Operation *op, ValueRange registers, TypeRange registerTypes, ValueRange clockGates, ArrayAttr clockGatesPerRegister, ArrayAttr names)
void printPassthroughs (OpAsmPrinter &p, Operation *op, ValueRange passthroughs, TypeRange passthroughTypes, ArrayAttr names)
ParseResult parsePassthroughs (OpAsmParser &parser, llvm::SmallVector< OpAsmParser::UnresolvedOperand, 4 > &passthroughs, llvm::SmallVector< mlir::Type, 1 > &passthroughTypes, ArrayAttr &passthroughNames)

Macro Definition Documentation

◆ DEBUG_TYPE

#define DEBUG_TYPE   "pipeline-ops"

Definition at line 29 of file PipelineOps.cpp.

◆ GET_OP_CLASSES

#define GET_OP_CLASSES

Definition at line 1144 of file PipelineOps.cpp.

◆ GET_OP_LIST

#define GET_OP_LIST

Function Documentation

◆ buildPipelineLikeOp()

void buildPipelineLikeOp ( OpBuilder & odsBuilder,
OperationState & odsState,
TypeRange dataOutputs,
ValueRange inputs,
ArrayAttr inputNames,
ArrayAttr outputNames,
Value clock,
Value go,
Value reset,
Value stall,
StringAttr name,
ArrayAttr stallability )
static

Definition at line 306 of file PipelineOps.cpp.

◆ getOrderedStagesFailable()

FailureOr< llvm::SmallVector< Block * > > getOrderedStagesFailable ( ScheduledPipelineOp op)
static

Definition at line 499 of file PipelineOps.cpp.

◆ getPipelineAsmBlockArgumentNames()

template<typename TPipelineOp>
void getPipelineAsmBlockArgumentNames ( TPipelineOp op,
mlir::Region & region,
mlir::OpAsmSetValueNameFn setNameFn )
static

Definition at line 372 of file PipelineOps.cpp.

◆ getPipelineAsmResultNames()

template<typename TPipelineOp>
void getPipelineAsmResultNames ( TPipelineOp op,
OpAsmSetValueNameFn setNameFn )
static

Definition at line 361 of file PipelineOps.cpp.

◆ isNestedBlock()

bool isNestedBlock ( Block * stopAt,
Block * parent,
Block * current )
static

Definition at line 549 of file PipelineOps.cpp.

Referenced by useDefinedInStage().

◆ parseKeywordAndOperand()

ParseResult parseKeywordAndOperand ( OpAsmParser & p,
StringRef keyword,
OpAsmParser::UnresolvedOperand & op )
static

Definition at line 117 of file PipelineOps.cpp.

References failure(), and success().

Referenced by parsePipelineOp().

◆ parseOptNamedTypedAssignment()

ParseResult parseOptNamedTypedAssignment ( OpAsmParser & parser,
OpAsmParser::UnresolvedOperand & v,
Type & t,
StringAttr & name )
static

Definition at line 761 of file PipelineOps.cpp.

References failure(), and success().

Referenced by parseSingleStageRegister().

◆ parseOutputList()

ParseResult parseOutputList ( OpAsmParser & parser,
llvm::SmallVector< Type > & inputTypes,
mlir::ArrayAttr & outputNames )
static

Definition at line 85 of file PipelineOps.cpp.

References failure(), and success().

Referenced by parsePipelineOp().

◆ parsePassthroughs()

ParseResult parsePassthroughs ( OpAsmParser & parser,
llvm::SmallVector< OpAsmParser::UnresolvedOperand, 4 > & passthroughs,
llvm::SmallVector< mlir::Type, 1 > & passthroughTypes,
ArrayAttr & passthroughNames )

Definition at line 907 of file PipelineOps.cpp.

References failure(), and success().

◆ parsePipelineOp()

ParseResult parsePipelineOp ( mlir::OpAsmParser & parser,
mlir::OperationState & result )
static

◆ parseSingleStageRegister()

ParseResult parseSingleStageRegister ( OpAsmParser & parser,
OpAsmParser::UnresolvedOperand & v,
Type & t,
llvm::SmallVector< OpAsmParser::UnresolvedOperand > & clockGates,
StringAttr & name )
static

Definition at line 788 of file PipelineOps.cpp.

References failure(), parseOptNamedTypedAssignment(), and success().

◆ parseStageRegisters()

ParseResult parseStageRegisters ( OpAsmParser & parser,
llvm::SmallVector< OpAsmParser::UnresolvedOperand, 4 > & registers,
llvm::SmallVector< mlir::Type, 1 > & registerTypes,
llvm::SmallVector< OpAsmParser::UnresolvedOperand, 4 > & clockGates,
ArrayAttr & clockGatesPerRegister,
ArrayAttr & registerNames )

Definition at line 810 of file PipelineOps.cpp.

References failure(), and success().

◆ printKeywordOperand()

void printKeywordOperand ( OpAsmPrinter & p,
StringRef keyword,
Value value )
static

Definition at line 245 of file PipelineOps.cpp.

Referenced by printPipelineOp().

◆ printOutputList()

void printOutputList ( OpAsmPrinter & p,
TypeRange types,
ArrayAttr names )
static

Definition at line 107 of file PipelineOps.cpp.

Referenced by printPipelineOp().

◆ printPassthroughs()

void printPassthroughs ( OpAsmPrinter & p,
Operation * op,
ValueRange passthroughs,
TypeRange passthroughTypes,
ArrayAttr names )

Definition at line 883 of file PipelineOps.cpp.

References empty.

◆ printPipelineOp()

template<typename TPipelineOp>
void printPipelineOp ( OpAsmPrinter & p,
TPipelineOp op )
static

◆ printStageRegisters()

void printStageRegisters ( OpAsmPrinter & p,
Operation * op,
ValueRange registers,
TypeRange registerTypes,
ValueRange clockGates,
ArrayAttr clockGatesPerRegister,
ArrayAttr names )

Definition at line 850 of file PipelineOps.cpp.

References empty.

◆ useDefinedInStage()

bool useDefinedInStage ( Block * stopAt,
Block * stage,
OpOperand & use )
static

Definition at line 565 of file PipelineOps.cpp.

References assert(), and isNestedBlock().