slang::ast::CompilationOptions struct

Contains various options that can control compilation behavior.

Public variables

uint32_t maxInstanceDepth
uint32_t maxGenerateSteps
uint32_t maxConstexprDepth
uint32_t maxConstexprSteps
uint32_t maxConstexprBacktrace
uint32_t maxDefParamSteps
uint32_t maxInstanceArray
The maximum number of instances allowed in a single instance array.
uint32_t errorLimit
uint32_t typoCorrectionLimit
MinTypMax minTypMax
bool allowHierarchicalConst
If true, allow hierarchical names in constant expressions.
bool relaxEnumConversions
If true, allow all integral types to convert implicitly to enum types.
bool allowUseBeforeDeclare
bool allowDupInitialDrivers
bool strictDriverChecking
bool lintMode
bool suppressUnused
If true, suppress warnings about unused code elements.
bool ignoreUnknownModules
bool scriptMode
std::optional<TimeScale> defaultTimeScale
flat_hash_set<std::string_view> topModules
std::vector<std::string> paramOverrides

Variable documentation

uint32_t slang::ast::CompilationOptions::maxInstanceDepth

The maximum depth of nested module instances (and interfaces/programs), to detect infinite recursion.

uint32_t slang::ast::CompilationOptions::maxGenerateSteps

The maximum number of steps that will be taken when expanding a single generate construct, to detect infinite loops.

uint32_t slang::ast::CompilationOptions::maxConstexprDepth

The maximum depth of nested function calls in constant expressions, to detect infinite recursion.

uint32_t slang::ast::CompilationOptions::maxConstexprSteps

The maximum number of steps to allow when evaluating a constant expressions, to detect infinite loops.

uint32_t slang::ast::CompilationOptions::maxConstexprBacktrace

The maximum number of frames in a callstack to display in diagnostics before abbreviating them.

uint32_t slang::ast::CompilationOptions::maxDefParamSteps

The maximum number of iterations to try to resolve defparams before giving up due to potentially cyclic dependencies in parameter values.

uint32_t slang::ast::CompilationOptions::errorLimit

The maximum number of errors that can be found before we short circuit the tree walking process.

uint32_t slang::ast::CompilationOptions::typoCorrectionLimit

The maximum number of times we'll attempt to do typo correction before giving up. This is to prevent very slow compilation times if the source text is hopelessly broken.

MinTypMax slang::ast::CompilationOptions::minTypMax

Specifies which set of min:typ:max expressions should be used during compilation.

bool slang::ast::CompilationOptions::allowUseBeforeDeclare

If true, allow symbols to be referenced before they're declared, even if that would otherwise be an error in SystemVerilog.

bool slang::ast::CompilationOptions::allowDupInitialDrivers

Signals driven by an always_comb are normally not allowed to be driven by any other process. Setting this option allows initial blocks to also drive such signals.

bool slang::ast::CompilationOptions::strictDriverChecking

If true, perform strict checking of variable drivers, which currently means not taking into account procedural for loop unrolling.

bool slang::ast::CompilationOptions::lintMode

If true, compile in "linting" mode where we suppress errors that could be caused by not having an elaborated design.

bool slang::ast::CompilationOptions::ignoreUnknownModules

If true, don't issue an error when encountering an instantiation for an unknown definition.

bool slang::ast::CompilationOptions::scriptMode

When in script mode, suppress some errors that are otherwise pretty annoying when not in a batch context. For example, top-level modules that have interface ports will cause an error if this is not set.

std::optional<TimeScale> slang::ast::CompilationOptions::defaultTimeScale

The default time scale to use for design elements that don't specify one explicitly.

flat_hash_set<std::string_view> slang::ast::CompilationOptions::topModules

If non-empty, specifies the list of modules that should serve as the top modules in the design. If empty, this will be automatically determined based on which modules are unreferenced elsewhere.

std::vector<std::string> slang::ast::CompilationOptions::paramOverrides

A list of parameters to override, of the form <name>=<value> – note that for now at least this only applies to parameters in top-level modules.