CIRCT  19.0.0git
Typedefs | Functions
SVExtractTestCode.cpp File Reference
#include "PassDetail.h"
#include "circt/Dialect/HW/HWAttributes.h"
#include "circt/Dialect/HW/HWInstanceGraph.h"
#include "circt/Dialect/HW/HWOps.h"
#include "circt/Dialect/HW/HWSymCache.h"
#include "circt/Dialect/HW/InnerSymbolNamespace.h"
#include "circt/Dialect/SV/SVPasses.h"
#include "circt/Dialect/Seq/SeqDialect.h"
#include "circt/Dialect/Seq/SeqOps.h"
#include "circt/Support/Namespace.h"
#include "mlir/IR/Builders.h"
#include "mlir/IR/IRMapping.h"
#include "llvm/ADT/SetVector.h"
#include <set>
Include dependency graph for SVExtractTestCode.cpp:

Go to the source code of this file.

Typedefs

using BindTable = DenseMap< StringAttr, SmallDenseMap< StringAttr, sv::BindOp > >
 

Functions

static void getBackwardSliceSimple (Operation *rootOp, SetVector< Operation * > &backwardSlice, llvm::function_ref< bool(Operation *)> filter)
 
static void blockSlice (SetVector< Operation * > &ops, SetVector< Operation * > &blocks)
 
static void computeSlice (SetVector< Operation * > &roots, SetVector< Operation * > &results, llvm::function_ref< bool(Operation *)> filter)
 
static SetVector< Operation * > getBackwardSlice (SetVector< Operation * > &roots, llvm::function_ref< bool(Operation *)> filter)
 
static SetVector< Operation * > getBackwardSlice (hw::HWModuleOp module, llvm::function_ref< bool(Operation *)> rootFn, llvm::function_ref< bool(Operation *)> filterFn)
 
static StringAttr getNameForPort (Value val, SmallVector< mlir::Attribute > modulePorts)
 
static hw::HWModuleOp createModuleForCut (hw::HWModuleOp op, SetVector< Value > &inputs, IRMapping &cutMap, StringRef suffix, Attribute path, Attribute fileName, BindTable &bindTable)
 
static void setInsertPointToEndOrTerminator (OpBuilder &builder, Block *block)
 
static void addBlockMapping (IRMapping &cutMap, Operation *oldOp, Operation *newOp)
 
static bool hasOoOArgs (hw::HWModuleOp newMod, Operation *op)
 
static void updateOoOArgs (SmallVectorImpl< Operation * > &lateBoundOps, IRMapping &cutMap)
 
static void migrateOps (hw::HWModuleOp oldMod, hw::HWModuleOp newMod, SetVector< Operation * > &depOps, IRMapping &cutMap, hw::InstanceGraph &instanceGraph)
 
static bool isBound (hw::HWModuleLike op, hw::InstanceGraph &instanceGraph)
 
static void addExistingBinds (Block *topLevelModule, BindTable &bindTable)
 
static void inlineInputOnly (hw::HWModuleOp oldMod, hw::InstanceGraph &instanceGraph, BindTable &bindTable, SmallPtrSetImpl< Operation * > &opsToErase, llvm::DenseSet< hw::InnerRefAttr > &innerRefUsedByNonBindOp)
 
static bool isAssertOp (hw::HWSymbolCache &symCache, Operation *op)
 
static bool isCoverOp (hw::HWSymbolCache &symCache, Operation *op)
 
static bool isAssumeOp (hw::HWSymbolCache &symCache, Operation *op)
 
bool isInDesign (hw::HWSymbolCache &symCache, Operation *op, bool disableInstanceExtraction=false, bool disableRegisterExtraction=false)
 Return true if the operation belongs to the design. More...
 

Typedef Documentation

◆ BindTable

using BindTable = DenseMap<StringAttr, SmallDenseMap<StringAttr, sv::BindOp> >

Definition at line 36 of file SVExtractTestCode.cpp.

Function Documentation

◆ addBlockMapping()

static void addBlockMapping ( IRMapping &  cutMap,
Operation *  oldOp,
Operation *  newOp 
)
static

Definition at line 265 of file SVExtractTestCode.cpp.

References assert().

Referenced by migrateOps().

◆ addExistingBinds()

static void addExistingBinds ( Block *  topLevelModule,
BindTable bindTable 
)
static

Definition at line 337 of file SVExtractTestCode.cpp.

◆ blockSlice()

static void blockSlice ( SetVector< Operation * > &  ops,
SetVector< Operation * > &  blocks 
)
static

Definition at line 89 of file SVExtractTestCode.cpp.

Referenced by getBackwardSlice().

◆ computeSlice()

static void computeSlice ( SetVector< Operation * > &  roots,
SetVector< Operation * > &  results,
llvm::function_ref< bool(Operation *)>  filter 
)
static

Definition at line 99 of file SVExtractTestCode.cpp.

References getBackwardSliceSimple().

Referenced by getBackwardSlice().

◆ createModuleForCut()

static hw::HWModuleOp createModuleForCut ( hw::HWModuleOp  op,
SetVector< Value > &  inputs,
IRMapping &  cutMap,
StringRef  suffix,
Attribute  path,
Attribute  fileName,
BindTable bindTable 
)
static

◆ getBackwardSlice() [1/2]

static SetVector<Operation *> getBackwardSlice ( hw::HWModuleOp  module,
llvm::function_ref< bool(Operation *)>  rootFn,
llvm::function_ref< bool(Operation *)>  filterFn 
)
static

Definition at line 130 of file SVExtractTestCode.cpp.

References getBackwardSlice().

◆ getBackwardSlice() [2/2]

static SetVector<Operation *> getBackwardSlice ( SetVector< Operation * > &  roots,
llvm::function_ref< bool(Operation *)>  filter 
)
static

Definition at line 109 of file SVExtractTestCode.cpp.

References blockSlice(), and computeSlice().

Referenced by getBackwardSlice().

◆ getBackwardSliceSimple()

static void getBackwardSliceSimple ( Operation *  rootOp,
SetVector< Operation * > &  backwardSlice,
llvm::function_ref< bool(Operation *)>  filter 
)
static

Definition at line 47 of file SVExtractTestCode.cpp.

References assert().

Referenced by computeSlice().

◆ getNameForPort()

static StringAttr getNameForPort ( Value  val,
SmallVector< mlir::Attribute >  modulePorts 
)
static

Definition at line 141 of file SVExtractTestCode.cpp.

References circt::calyx::direction::get(), and seq::reg().

Referenced by createModuleForCut().

◆ hasOoOArgs()

static bool hasOoOArgs ( hw::HWModuleOp  newMod,
Operation *  op 
)
static

Definition at line 278 of file SVExtractTestCode.cpp.

Referenced by inlineInputOnly(), and migrateOps().

◆ inlineInputOnly()

static void inlineInputOnly ( hw::HWModuleOp  oldMod,
hw::InstanceGraph &  instanceGraph,
BindTable bindTable,
SmallPtrSetImpl< Operation * > &  opsToErase,
llvm::DenseSet< hw::InnerRefAttr > &  innerRefUsedByNonBindOp 
)
static

◆ isAssertOp()

static bool isAssertOp ( hw::HWSymbolCache &  symCache,
Operation *  op 
)
static

Definition at line 531 of file SVExtractTestCode.cpp.

Referenced by isInDesign().

◆ isAssumeOp()

static bool isAssumeOp ( hw::HWSymbolCache &  symCache,
Operation *  op 
)
static

Definition at line 565 of file SVExtractTestCode.cpp.

Referenced by isInDesign().

◆ isBound()

static bool isBound ( hw::HWModuleLike  op,
hw::InstanceGraph &  instanceGraph 
)
static

Definition at line 326 of file SVExtractTestCode.cpp.

◆ isCoverOp()

static bool isCoverOp ( hw::HWSymbolCache &  symCache,
Operation *  op 
)
static

Definition at line 555 of file SVExtractTestCode.cpp.

Referenced by isInDesign().

◆ isInDesign()

bool isInDesign ( hw::HWSymbolCache &  symCache,
Operation *  op,
bool  disableInstanceExtraction = false,
bool  disableRegisterExtraction = false 
)

Return true if the operation belongs to the design.

Definition at line 577 of file SVExtractTestCode.cpp.

References isAssertOp(), isAssumeOp(), and isCoverOp().

◆ migrateOps()

static void migrateOps ( hw::HWModuleOp  oldMod,
hw::HWModuleOp  newMod,
SetVector< Operation * > &  depOps,
IRMapping &  cutMap,
hw::InstanceGraph &  instanceGraph 
)
static

◆ setInsertPointToEndOrTerminator()

static void setInsertPointToEndOrTerminator ( OpBuilder &  builder,
Block *  block 
)
static

Definition at line 256 of file SVExtractTestCode.cpp.

References builder.

Referenced by migrateOps().

◆ updateOoOArgs()

static void updateOoOArgs ( SmallVectorImpl< Operation * > &  lateBoundOps,
IRMapping &  cutMap 
)
static

Definition at line 290 of file SVExtractTestCode.cpp.

Referenced by inlineInputOnly(), and migrateOps().