CIRCT 23.0.0git
Loading...
Searching...
No Matches
Functions | Variables
Structure.cpp File Reference
#include "ImportVerilogInternals.h"
#include "slang/ast/Compilation.h"
#include "slang/ast/symbols/ClassSymbols.h"
#include "slang/syntax/AllSyntax.h"
#include "slang/syntax/SyntaxVisitor.h"
#include "llvm/ADT/STLFunctionalExtras.h"
#include "llvm/ADT/ScopeExit.h"
Include dependency graph for Structure.cpp:

Go to the source code of this file.

Functions

static void recordDPIExportDirectives (Context &context, const slang::ast::Scope &scope, const slang::syntax::SyntaxNode *syntax)
 Record export "DPI-C" directives in the given scope so that callable declarations can be tagged with the exported C name.
 
static void guessNamespacePrefix (const slang::ast::Symbol &symbol, SmallString< 64 > &prefix)
 
static moore::ProcedureKind convertProcedureKind (slang::ast::ProceduralBlockKind kind)
 
static moore::NetKind convertNetKind (slang::ast::NetType::NetKind kind)
 
static FunctionType getFunctionSignature (Context &context, const slang::ast::SubroutineSymbol &subroutine, ArrayRef< Type > prefixParams, ArrayRef< Type > suffixParams={})
 Helper function to generate the function signature from a SubroutineSymbol and optional extra arguments (used for this argument)
 
static FailureOr< SmallVector< moore::DPIArgInfo > > getDPISignature (Context &context, const slang::ast::SubroutineSymbol &subroutine)
 

Variables

static constexpr StringLiteral dpiExportAttrName = "circt.dpi.export"
 

Function Documentation

◆ convertNetKind()

static moore::NetKind convertNetKind ( slang::ast::NetType::NetKind  kind)
static

Definition at line 264 of file Structure.cpp.

◆ convertProcedureKind()

static moore::ProcedureKind convertProcedureKind ( slang::ast::ProceduralBlockKind  kind)
static

Definition at line 246 of file Structure.cpp.

◆ getDPISignature()

static FailureOr< SmallVector< moore::DPIArgInfo > > getDPISignature ( Context context,
const slang::ast::SubroutineSymbol &  subroutine 
)
static

Definition at line 1813 of file Structure.cpp.

References context.

Referenced by circt::ImportVerilog::Context::declareCallableImpl().

◆ getFunctionSignature()

static FunctionType getFunctionSignature ( Context context,
const slang::ast::SubroutineSymbol &  subroutine,
ArrayRef< Type >  prefixParams,
ArrayRef< Type >  suffixParams = {} 
)
static

Helper function to generate the function signature from a SubroutineSymbol and optional extra arguments (used for this argument)

Definition at line 1778 of file Structure.cpp.

Referenced by circt::ImportVerilog::Context::declareCallableImpl().

◆ guessNamespacePrefix()

static void guessNamespacePrefix ( const slang::ast::Symbol &  symbol,
SmallString< 64 > &  prefix 
)
static

◆ recordDPIExportDirectives()

static void recordDPIExportDirectives ( Context context,
const slang::ast::Scope &  scope,
const slang::syntax::SyntaxNode *  syntax 
)
static

Record export "DPI-C" directives in the given scope so that callable declarations can be tagged with the exported C name.

Slang resolves the directives during elaboration but does not expose them on the subroutine symbols themselves, so walk the scope's syntax to recover them.

Definition at line 30 of file Structure.cpp.

References context.

Referenced by circt::ImportVerilog::Context::convertCompilation(), circt::ImportVerilog::Context::convertModuleBody(), and circt::ImportVerilog::Context::convertPackage().

Variable Documentation

◆ dpiExportAttrName

constexpr StringLiteral dpiExportAttrName = "circt.dpi.export"
staticconstexpr

Definition at line 20 of file Structure.cpp.

Referenced by circt::ImportVerilog::Context::declareCallableImpl().