CIRCT 24.0.0git
Loading...
Searching...
No Matches
SimToSV.cpp File Reference
#include "circt/Conversion/SimToSV.h"
#include "circt/Conversion/SVLoweringUtils.h"
#include "circt/Dialect/Comb/CombOps.h"
#include "circt/Dialect/Emit/EmitOps.h"
#include "circt/Dialect/HW/HWOps.h"
#include "circt/Dialect/SV/SVOps.h"
#include "circt/Dialect/Seq/SeqOps.h"
#include "circt/Dialect/Sim/SimDialect.h"
#include "circt/Dialect/Sim/SimOps.h"
#include "circt/Dialect/Sim/SimTypes.h"
#include "circt/Support/Namespace.h"
#include "circt/Support/ProceduralRegionTrait.h"
#include "circt/Support/SparseOpSCC.h"
#include "mlir/IR/Builders.h"
#include "mlir/IR/BuiltinOps.h"
#include "mlir/IR/DialectImplementation.h"
#include "mlir/IR/ImplicitLocOpBuilder.h"
#include "mlir/IR/Threading.h"
#include "mlir/IR/Visitors.h"
#include "mlir/Pass/Pass.h"
#include "mlir/Transforms/DialectConversion.h"
#include "llvm/ADT/Twine.h"
#include "llvm/Support/LogicalResult.h"
#include "circt/Conversion/Passes.h.inc"
Include dependency graph for SimToSV.cpp:

Go to the source code of this file.

Classes

class  PlusArgsTestLowering
class  PlusArgsValueLowering
class  StreamLowering< OpTy, StreamValue >
class  UnrealizedConversionCastLowering
class  TriggeredLowering
class  FlushLowering
class  DPICallLowering
class  StringConstantLowering
class  StringConcatLowering
struct  LowerDPIFunc

Namespaces

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

Macros

#define DEBUG_TYPE   "lower-sim-to-sv"
#define GEN_PASS_DEF_LOWERSIMTOSV

Typedefs

using StdoutStreamLowering = StreamLowering<StdoutStreamOp, 0x80000001>
using StderrStreamLowering = StreamLowering<StderrStreamOp, 0x80000002>

Functions

static bool needsIfdefGuard (Operation *op)
 Check whether an op should be placed inside an ifdef guard that prevents it from affecting synthesis runs.
static std::pair< Value, Value > needsClockAndConditionWrapper (Operation *op)
 Check whether an op should be placed inside an always process triggered on a clock, and an if statement checking for a condition.
static LogicalResult convert (ClockedTerminateOp op, PatternRewriter &rewriter)
static LogicalResult convert (ClockedPauseOp op, PatternRewriter &rewriter)
static LogicalResult convert (TerminateOp op, PatternRewriter &rewriter)
static LogicalResult convert (PauseOp op, PatternRewriter &rewriter)
static ArrayAttr buildSVPerArgumentAttrs (MLIRContext *context, sim::DPIFuncOp func)
static void addFragments (hw::HWModuleOp module, const llvm::DenseMap< StringAttr, StringAttr > &symbolToFragment, const SimConversionState &state)
static bool moveOpsIntoIfdefGuardsAndProcesses (Operation *rootOp)

Macro Definition Documentation

◆ DEBUG_TYPE

#define DEBUG_TYPE   "lower-sim-to-sv"

Definition at line 37 of file SimToSV.cpp.

◆ GEN_PASS_DEF_LOWERSIMTOSV

#define GEN_PASS_DEF_LOWERSIMTOSV

Definition at line 40 of file SimToSV.cpp.

Typedef Documentation

◆ StderrStreamLowering

using StderrStreamLowering = StreamLowering<StderrStreamOp, 0x80000002>

Definition at line 229 of file SimToSV.cpp.

◆ StdoutStreamLowering

using StdoutStreamLowering = StreamLowering<StdoutStreamOp, 0x80000001>

Definition at line 228 of file SimToSV.cpp.

Function Documentation

◆ addFragments()

void addFragments ( hw::HWModuleOp module,
const llvm::DenseMap< StringAttr, StringAttr > & symbolToFragment,
const SimConversionState & state )
static

◆ buildSVPerArgumentAttrs()

ArrayAttr buildSVPerArgumentAttrs ( MLIRContext * context,
sim::DPIFuncOp func )
static

Definition at line 437 of file SimToSV.cpp.

References context.

Referenced by LowerDPIFunc::lower().

◆ convert() [1/4]

LogicalResult convert ( ClockedPauseOp op,
PatternRewriter & rewriter )
static

Definition at line 261 of file SimToSV.cpp.

References success().

◆ convert() [2/4]

LogicalResult convert ( ClockedTerminateOp op,
PatternRewriter & rewriter )
static

Definition at line 253 of file SimToSV.cpp.

References success().

◆ convert() [3/4]

LogicalResult convert ( PauseOp op,
PatternRewriter & rewriter )
static

Definition at line 274 of file SimToSV.cpp.

References success().

◆ convert() [4/4]

LogicalResult convert ( TerminateOp op,
PatternRewriter & rewriter )
static

Definition at line 266 of file SimToSV.cpp.

References success().

◆ moveOpsIntoIfdefGuardsAndProcesses()

bool moveOpsIntoIfdefGuardsAndProcesses ( Operation * rootOp)
static

◆ needsClockAndConditionWrapper()

std::pair< Value, Value > needsClockAndConditionWrapper ( Operation * op)
static

Check whether an op should be placed inside an always process triggered on a clock, and an if statement checking for a condition.

Definition at line 56 of file SimToSV.cpp.

Referenced by moveOpsIntoIfdefGuardsAndProcesses().

◆ needsIfdefGuard()

bool needsIfdefGuard ( Operation * op)
static

Check whether an op should be placed inside an ifdef guard that prevents it from affecting synthesis runs.

Definition at line 50 of file SimToSV.cpp.

Referenced by moveOpsIntoIfdefGuardsAndProcesses().