Highlights
This release brings substantial elaboration performance improvements by way of instance caching, as well as more advanced linting capabilities with the new dataflow analysis framework.
Language Support
- Added support for clock flow, clock resolution, and clock inference rules in checkers and assertions
- Various cases of invalid clock usage will now issue appropriate errors
- Clock resolution is also performed for the sampled value system functions
- Implemented rules for which kinds of sequences and properties can be declared in clocking blocks
- Implemented rules for dynamic variable access from within checker procedures
Notable Breaking Changes
- AST serialization no longer includes uninstantiated scopes in the output
Driver::reportCompilationmethod had part of its functionality split out intoDriver::reportDiagnosticsto allow for calling the newDriver::runAnalysismethod in between. There is a newDriver::runFullCompilationmethod that wraps all of this for convenience if you don't care about controlling when each pass is done.- The
DEBUGmacro set for debug builds has been renamed toSLANG_DEBUG.NDEBUGis no longer used to conditionally control compilation, which should make it much less likely that using slang as a library will result in conflictingNDEBUGsettings and causing ODR violations. - Warning control command line options have been reworked to make them less confusing. Settings for warning groups no longer override more explicit settings for a specific warning, and a bunch of confusing ordering dependence between
-Werrorand the other settings have been removed. This may cause changes to which warnings are enabled if your command line has a particularly constructed set of options. See the documentation for more information. - Tracking of net and variable drivers has moved to the new analysis layer. If you were using that portion of the AST API you'll need to change to get that information post-analysis.
- The
--strict-driver-checkingflag has been removed. Its behavior can be regained by setting the new--max-loop-analysis-stepsto 0.
New Features
- slang can now optionally use cpptrace (using the
SLANG_USE_CPPTRACECMake option) for better backtraces in the event of internal assertions or exceptions thrown - There is a new post-elaboration analysis pass in slang that does additional checking for enforcing specific language rules and reporting extra warnings. This can be disabled with the
--disable-analysisflag, though it should not be needed unless there is a bug in slang. - Added a new option
--diag-abs-pathsto report diagnostics with absolute instead of relative file paths - Added -Wmissing-return and -Wincomplete-return which warn about non-void functions that do not return a value on all control paths
- Added -Wcase-unreachable for wildcard case items that are unreachable because they are completely subsumed by earlier items
- Added -Wcase-too-complex for case statements that are too complex to analyze, and
--max-case-analysis-stepsto control that limit - Added -Wcase-incomplete for wildcard case statements that don't completely cover the input space and have no default case
- Added -Wcase-redundant-default for case statements marked
uniqueorprioritythat provide a default case - Added -Wcase-wildcard-2state for wildcard case statements that have 2-state conditions and items
- The
`celldefinedirective is now exposed in the API and in AST serialization (thanks to @whitequark) - Added new flags
--all-deps,--include-deps,--module-deps, and--depfile-targetto allow outputting various dependency file lists from slang (thanks to @AndrewNolte) - Added -Winferred-latch which detects signals that are not assigned on all control paths through
always_combblocks - Added -Winferred-comb which detects combinational logic in
always_latchblocks - Added new flag
--disallow-refs-to-unknown-instanceswhich causes errors to be issued when there are hierarchical references to ignored unknown module instances that were allowed via the existing--ignore-unknown-modulesflag
Improvements
- slang now performs instance caching by default, which means duplicate instance bodies will not be visited during elaboration, which can greatly speed up elaboration times for large projects. This behavior can be disabled with the
--disable-instance-cachingflag, though it should not be needed unless there's a bug in slang -- please open an issue if you find that you need the flag. - -Wint-bool-conv now applies to expressions used in assertions, properties, and sequences
- The -G option can now set parameter values hierarchically, and the value can be an expression that uses package members such as enum values
- Hierarchical path strings for members of generic class types now include the specialization parameter values
- Instance array port slicing of packed types has been reworked. Each instance's port connection now has an expression tree selecting the appropriate bits of the potentially multi-dimensional packed type.
+libexthas been added as an alias for--libext- slang can now build for WASI targets (thanks to @whitequark)
Fixes
- Fixed argument binding for sequence and property instances when using named arguments
- Concurrent assertion and procedural checker statements are now correctly disallowed from appearing in subroutines and final blocks
- Fixed a place where empty argument names were not correctly allowed in function prototype declarations
- Fixed serialized AST locations that come from macro expansions (thanks to @micron-ian)
- Fixed various issues with how instance array indices are mapped to underlying elements
- Assignments are now correctly disallowed in timing controls
- Cycle delays are now correctly disallowed in event trigger statements
- The global future sampled value system functions are now correctly disallowed in assertions with sequence match items
- Fixed some confusing behavior with glob file patterns involving '.../'
- Fixed a bug that could cause the ordering of packages provided to the compilation to affect whether names can be looked up correctly
- Fixed an erroneous assert / error involving order of elaboration issues with virtual interface types
- Fixed
--cmd-renamewhen used with plus args
Tools & Bindings
pyslang
- Added some initial documentation and an API reference for the Python bindings (thanks to @parker-research)
- Added a bunch more tests for the Python bindings (thanks to @parker-research)
- Added Python bindings for the SyntaxRewriter class (thanks to @parker-research)
- Fixed several keep-alive lifetime issues with the Python bindings
slang-tidy
- Added new flag
--dump-configto dump possible configuration options to stdout and exit (thanks to @jameshanlon) - Printing check descriptions now includes the config key name (thanks to @jameshanlon)
- Added a new port prefix rule, similar to the existing port suffix rule (thanks to @corco)
- Added a new undriven range rule (thanks to @jameshanlon)
- Fixed OnlyAssignedOnReset false positive with struct arrays and for loops
- Fixed RegisterHasNoReset false positive for loop iterator variables
- Added support for user specified severities on individual checks (thanks to @jameshanlon)
slang-netlist
- The netlist tool has been removed from the repo -- it will be moved to its own standalone repo for further development
rewriter
- The rewriter tool has gained a number of options that control how the file is rewritten, including whether macros and includes should be expanded or not (thanks to @AndrewNolte)