slang::driver::Driver::Options struct

A container for various options that can be parsed and applied to the compilation process.

Public functions

auto lintMode() const -> bool
Returns true if the lintMode option is provided.

Public variables

std::optional<std::string> languageVersion
The version of the SystemVerilog language to use.

Preprocessing

std::optional<uint32_t> maxIncludeDepth
The maximum depth of included files before an error is issued.
std::vector<std::string> defines
A list of macros that should be defined in each compilation unit.
std::vector<std::string> undefines
A list of macros that should be undefined in each compilation unit.
std::optional<bool> librariesInheritMacros
If true, library files will inherit macro definitions from primary source files.
std::vector<std::string> ignoreDirectives
A set of preprocessor directives to be ignored.

Parsing

std::optional<uint32_t> maxParseDepth
The maximum call stack depth of parsing before an error is issued.
std::optional<uint32_t> maxLexerErrors
The maximum number of lexer errors that can be encountered before giving up.
std::optional<uint32_t> numThreads
The number of threads to use for parsing.

Compilation

std::optional<uint32_t> maxInstanceDepth
The maximum depth of nested module instances (and interfaces/programs), to detect infinite recursion.
std::optional<uint32_t> maxGenerateSteps
The maximum number of steps that will be taken when expanding a single generate construct, to detect infinite loops.
std::optional<uint32_t> maxConstexprDepth
The maximum depth of nested function calls in constant expressions, to detect infinite recursion.
std::optional<uint32_t> maxConstexprSteps
The maximum number of steps to allow when evaluating a constant expressions, to detect infinite loops.
std::optional<uint32_t> maxConstexprBacktrace
The maximum number of frames in a callstack to display in diagnostics before abbreviating them.
std::optional<uint32_t> maxInstanceArray
The maximum number of instances allowed in a single instance array.
std::optional<std::string> compat
A string indicating a member of CompatMode to use for tailoring other compilation options.
std::optional<std::string> minTypMax
A string indicating a member of MinTypMax to indicate which set of (min:typ:max) expressions is valid for this compilation.
std::optional<std::string> timeScale
A string that indicates the default time scale to use for any design elements that don't specify one explicitly.
std::map<ast::CompilationFlags, std::optional<bool>> compilationFlags
A collection of flags that control compilation.
std::vector<std::string> topModules
If non-empty, specifies the list of modules that should serve as the top modules in the design.
std::vector<std::string> 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.
std::vector<std::string> libraryOrder
A list of library names specifying the order in which module lookup should be resolved between libraries.
std::optional<std::string> defaultLibName
The name of the default library; if not set, defaults to "work".

Diagnostics control

std::optional<bool> colorDiags
If true, print diagnostics with color.
std::optional<bool> diagColumn
If true, include column numbers in printed diagnostics.
std::optional<bool> diagLocation
If true, include location information in printed diagnostics.
std::optional<bool> diagSourceLine
If true, include source line context in printed diagnostics.
std::optional<bool> diagOptionName
If true, include warning option names in printed diagnostics.
std::optional<bool> diagIncludeStack
If true, include file include stacks in printed diagnostics.
std::optional<bool> diagMacroExpansion
If true, include macro expansion information in printed diagnostics.
std::optional<std::string> diagHierarchy
One of the ShowHierarchyPathOption values that control whether to include hierarchy paths in printed diagnostics.
std::optional<uint32_t> errorLimit
The maximum number of errors to print before giving up.
std::vector<std::string> warningOptions
A list of warning options that will be passed to the DiagnosticEngine.

File lists

std::optional<bool> singleUnit
If set to true, all source files will be treated as part of a single compilation unit, meaning all of their text will be merged together.
flat_hash_set<std::string> excludeExts
A set of extensions that will be used to exclude files.

Variable documentation

std::vector<std::string> slang::driver::Driver::Options::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.