CIRCT  19.0.0git
Namespaces | Macros | Functions
Analysis.cpp File Reference
#include "circt/Dialect/Handshake/HandshakeOps.h"
#include "circt/Dialect/Handshake/HandshakePasses.h"
#include "circt/Support/LLVM.h"
#include "mlir/Dialect/Arith/IR/Arith.h"
#include "mlir/IR/BuiltinTypes.h"
#include "mlir/IR/OperationSupport.h"
#include "mlir/IR/PatternMatch.h"
#include "mlir/Pass/Pass.h"
#include "mlir/Support/IndentedOstream.h"
#include "llvm/ADT/TypeSwitch.h"
#include <optional>
#include "circt/Dialect/Handshake/HandshakePasses.h.inc"
Include dependency graph for Analysis.cpp:

Go to the source code of this file.

Namespaces

 circt
 The InstanceGraph op interface, see InstanceGraphInterface.td for more details.
 
 circt::handshake
 

Macros

#define GEN_PASS_DEF_HANDSHAKEDOTPRINT
 
#define GEN_PASS_DEF_HANDSHAKEOPCOUNT
 
#define GEN_PASS_DEF_HANDSHAKEADDIDS
 

Functions

static bool isControlOp (Operation *op)
 
static std::string dotPrintNode (mlir::raw_indented_ostream &outfile, StringRef instanceName, Operation *op, DenseMap< Operation *, unsigned > &opIDs)
 Prints an operation to the dot file and returns the unique name for the operation within the graph. More...
 
static bool isControlOperand (Operation *op, Value v)
 Returns true if v is used as a control operand in op. More...
 
static std::string getLocalName (StringRef instanceName, StringRef suffix)
 
static std::string getArgName (handshake::FuncOp op, unsigned index)
 
static std::string getUniqueArgName (StringRef instanceName, handshake::FuncOp op, unsigned index)
 
static std::string getResName (handshake::FuncOp op, unsigned index)
 
static std::string getUniqueResName (StringRef instanceName, handshake::FuncOp op, unsigned index)
 
static void tryAddExtraEdgeInfo (mlir::raw_indented_ostream &os, Operation *from, Value result, Operation *to)
 Emits additional, non-graphviz information about the connection between from- and to. More...
 

Macro Definition Documentation

◆ GEN_PASS_DEF_HANDSHAKEADDIDS

#define GEN_PASS_DEF_HANDSHAKEADDIDS

Definition at line 30 of file Analysis.cpp.

◆ GEN_PASS_DEF_HANDSHAKEDOTPRINT

#define GEN_PASS_DEF_HANDSHAKEDOTPRINT

Definition at line 28 of file Analysis.cpp.

◆ GEN_PASS_DEF_HANDSHAKEOPCOUNT

#define GEN_PASS_DEF_HANDSHAKEOPCOUNT

Definition at line 29 of file Analysis.cpp.

Function Documentation

◆ dotPrintNode()

static std::string dotPrintNode ( mlir::raw_indented_ostream &  outfile,
StringRef  instanceName,
Operation *  op,
DenseMap< Operation *, unsigned > &  opIDs 
)
static

Prints an operation to the dot file and returns the unique name for the operation within the graph.

Fill color

Shape

Label

If we have an ID attribute, we'll add the ID of the operation as well. This helps crossprobing the diagram with the Handshake IR and waveform diagrams.

Style; add dashed border for control nodes

Definition at line 167 of file Analysis.cpp.

References isControlOp().

◆ getArgName()

static std::string getArgName ( handshake::FuncOp  op,
unsigned  index 
)
static

Definition at line 302 of file Analysis.cpp.

Referenced by getUniqueArgName().

◆ getLocalName()

static std::string getLocalName ( StringRef  instanceName,
StringRef  suffix 
)
static

Definition at line 298 of file Analysis.cpp.

Referenced by getUniqueArgName(), and getUniqueResName().

◆ getResName()

static std::string getResName ( handshake::FuncOp  op,
unsigned  index 
)
static

Definition at line 311 of file Analysis.cpp.

Referenced by getUniqueResName().

◆ getUniqueArgName()

static std::string getUniqueArgName ( StringRef  instanceName,
handshake::FuncOp  op,
unsigned  index 
)
static

Definition at line 306 of file Analysis.cpp.

References getArgName(), and getLocalName().

◆ getUniqueResName()

static std::string getUniqueResName ( StringRef  instanceName,
handshake::FuncOp  op,
unsigned  index 
)
static

Definition at line 315 of file Analysis.cpp.

References getLocalName(), and getResName().

◆ isControlOp()

static bool isControlOp ( Operation *  op)
static

Definition at line 39 of file Analysis.cpp.

Referenced by dotPrintNode(), and isControlOperand().

◆ isControlOperand()

static bool isControlOperand ( Operation *  op,
Value  v 
)
static

Returns true if v is used as a control operand in op.

Definition at line 287 of file Analysis.cpp.

References isControlOp().

◆ tryAddExtraEdgeInfo()

static void tryAddExtraEdgeInfo ( mlir::raw_indented_ostream &  os,
Operation *  from,
Value  result,
Operation *  to 
)
static

Emits additional, non-graphviz information about the connection between from- and to.

This does not have any effect on the graph itself, but may be used by other tools to reason about the connectivity between nodes.

Definition at line 365 of file Analysis.cpp.