CIRCT 24.0.0git
Loading...
Searching...
No Matches
Analysis.cpp File Reference
#include "circt/Dialect/Handshake/HandshakeOps.h"
#include "circt/Dialect/Handshake/HandshakePasses.h"
#include "circt/Dialect/Handshake/HandshakeUtils.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

namespace  circt
 The InstanceGraph op interface, see InstanceGraphInterface.td for more details.
namespace  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.
static bool isControlOperand (Operation *op, Value v)
 Returns true if v is used as a control operand in op.
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.

Macro Definition Documentation

◆ GEN_PASS_DEF_HANDSHAKEADDIDS

#define GEN_PASS_DEF_HANDSHAKEADDIDS

Definition at line 31 of file Analysis.cpp.

◆ GEN_PASS_DEF_HANDSHAKEDOTPRINT

#define GEN_PASS_DEF_HANDSHAKEDOTPRINT

Definition at line 29 of file Analysis.cpp.

◆ GEN_PASS_DEF_HANDSHAKEOPCOUNT

#define GEN_PASS_DEF_HANDSHAKEOPCOUNT

Definition at line 30 of file Analysis.cpp.

Function Documentation

◆ dotPrintNode()

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 168 of file Analysis.cpp.

References isControlOp().

◆ getArgName()

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

Definition at line 303 of file Analysis.cpp.

Referenced by getUniqueArgName().

◆ getLocalName()

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

Definition at line 299 of file Analysis.cpp.

Referenced by getUniqueArgName(), and getUniqueResName().

◆ getResName()

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

Definition at line 312 of file Analysis.cpp.

Referenced by getUniqueResName().

◆ getUniqueArgName()

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

Definition at line 307 of file Analysis.cpp.

References getArgName(), and getLocalName().

◆ getUniqueResName()

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

Definition at line 316 of file Analysis.cpp.

References getLocalName(), and getResName().

◆ isControlOp()

bool isControlOp ( Operation * op)
static

Definition at line 40 of file Analysis.cpp.

Referenced by dotPrintNode(), and isControlOperand().

◆ isControlOperand()

bool isControlOperand ( Operation * op,
Value v )
static

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

Definition at line 288 of file Analysis.cpp.

References isControlOp().

◆ tryAddExtraEdgeInfo()

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 366 of file Analysis.cpp.