Skip to content

v6.0

Latest
Compare
Choose a tag to compare
@MikePopoloski MikePopoloski released this 21 Apr 18:38
· 174 commits to master since this release
7bcff26

Highlights

This release adds support for SystemVerilog configurations, which was the last major language feature missing from slang. There are now only a handful of minor issues remaining before slang's SystemVerilog implementation can be declared 100% complete -- see the lang-compliance issue label for known issues.

Also this release begins adding support for the changes made in the newly released IEEE 1800-2023 version of the SystemVerilog LRM. The remaining work on this will likely be completed in the next slang release. The changes in this (the 6.0) release are documented below in two categories; "clarifications" are changes that apply automatically to all code, whereas "new features" require use of the new --std command line flag to enable.

Language Support

  • Added --allow-bare-value-param-assigment (included in 'vcs' compat mode) to allow a non-standard module instantiation syntax where a single parameter value can be supplied without including parentheses
  • Added --allow-self-determined-stream-concat (included in 'vcs' compat mode) to allow the use of streaming concatenation expressions in self-determined contexts (instead of just in assignments)
  • Added --allow-multi-driven-locals (included in 'vcs' compat mode) to allow subroutine local variables to be driven by multiple always_ff / always_comb blocks
  • Added full support for SystemVerilog libraries and configurations
  • Added support for equality comparisons between virtual interfaces and actual interface instances (thanks to @likeamahoney)
  • Ref args are now correctly disallowed in fork-join_any and join_none blocks
  • Wildcard port connections now correctly avoid importing new symbols into a scope via wildcard imports
  • Added support for referencing interface instances in unpacked array concatenations involving virtual interface arrays

Clarifications in IEEE 1800-2023

  • Unsized integer literals can be any bit width, not just capped at 32 bits.
  • Unpacked unions are allowed as net types
  • Time literals should be scaled but not rounded to the current time precision
  • Multiline block comments are allowed in macro definitions
  • Set membership operations (case statements, inside operator) always allow unbounded literals
  • Unbounded literals can only be assigned to parameters with simple bit vector types
  • $cast arguments don't need to be singular at compile time
  • Checking for multi-driven variables in subroutines invoked from always_comb/_latch/_ff doesn't apply to tasks, only functions
  • Non-blocking assignments to elements of dynamic arrays are not allowed
  • Static casts are assignment-like contexts
  • Tagged union expressions must be primaries only (binary expressions are not allowed)
  • Severity system tasks should work in constant functions (and behave as elaboration-time tasks)

New Features in IEEE 1800-2023

  • Triple quoted (multiline) string literals
  • Macro stringification with triple quoted strings
  • Type parameters and the type() operator can now refer to incomplete forward typedefs
  • Type parameters can now specify a type restriction just like forward typedefs
  • The `timescale directive is disallowed inside design elements
  • Boolean expressions in conditional directives (ifdef, ifndef)
  • Function call expressions can be chained (slang already supported this but several issues related to it were fixed)
  • type(this) is now allowed in static contexts within class declarations
  • Soft packed unions
  • The index method of array iterators can be renamed via an argument to the method call
  • Unpacked arrays have a built-in map method
  • Classes can be declared final
  • Class constructor argument lists and extends argument lists can be declared default
  • Class methods can be declared initial, extends, and final
  • Added the weak_reference built-in class
  • Interface classes can be declared within other classes
  • The built-in process class is declared final
  • Value ranges gain new absolute / relative tolerance operators
  • ref static subroutine arguments

General Features

  • Added -Wmultibit-edge (on by default) to warn about clock edge triggers on multibit expressions
  • Added -Wint-bool-conv and -Wfloat-bool-conv to warn about multibit integer and floating point expressions used in a boolean context
  • Added -Wuseless-cast to warn about explicit casts to the same type as the underlying expression
  • Added -Wunknown-sys-name to allow downgrading the error that occurs when referencing an unknown system task or function
  • Added compilation unit listings to allow fine grained control over how sources are parsed into separate compilation units (including separating macro defines and include directories on a per-unit basis)
  • Added --defaultLibName to control the name of the default source library
  • Added --std to choose which version of the LRM slang should conform to. By default this is "1800-2017" but can be set to "1800-2023" to enable new features added in the recently published update to the SystemVerilog LRM.
  • Added a new experimental tool, slang-hier, that prints elaborated instances in a design (thanks to @udif)

Improvements

  • --cmd-ignore and --cmd-rename now also work with options that include a value via an equals expression
  • Information about module/interface/program definitions are now included in AST JSON output
  • slang-reflect has been improved to support reflecting more complex types for local parameters (thanks to @Sustrak)
  • Rewrote analysis of user-defined primitive tables to be much more efficient; previously primitives with large numbers of inputs could take a very long time to analyze
  • Command line defines now take precedence over defines in Verilog source files, which matches the behavior of other tools (thanks to @udif)
  • -Wvector-overflow has been improved to not warn when forming minimum negative integer literals
  • Backslashes at the end of lines in command files are now ignored instead of causing errors (thanks to @udif)

Fixes

  • Fixed several crashes in slang-tidy (thanks to @likeamahoney)
  • Fixed a bug where a missing `endif directive didn't always cause an error to be issued
  • Fixed the use of the this handle in non-static class property initializer expressions
  • Fixed a bug where use of the unqualified randomize would sometimes find std::randomize when it should have found a class-local randomize method
  • Fixed several spurious lexer errors when otherwise invalid tokens are used inside stringified macro expansion
  • Fixed a crash in the Python SyntaxVisitor bindings
  • Correctly allow instance paths to be used in assert control system function arguments
  • Fixed a bug where multi-driver checks for called subroutines didn't apply when one of the source procedures was a plain always block
  • Fixed bug in parsing empty action blocks for sequences and properties
  • Fixed the Python bindings for Type::isBitstreamType
  • Fixed a crash when calling getResolutionFunction on built-in net types
  • Fixed a bug in the checking of forward typedef type restrictions
  • Fixed the end spacing of stringified macro expansions
  • Fixed a macro expansion corner case where an escaped identifier that ends in a backslash was not considered as a line continuation for the macro body
  • Fixed several cases where invalid syntax could lead to follow on errors with malformed messages
  • Fixed several crashes related to corrupted source files containing embedded null characters or invalid UTF8 sequences
  • Fixed a crash that could occur when a source file ended in an invalid hex escape inside an unterminated string literal
  • Fixed an infinite loop when parsing a malformed list of terminals in a primitive declaration
  • Fixed an infinite loop caused by malformed recursive checker instantiations
  • Fixed an infinite loop when parsing case statements with malformed pattern items
  • Added checking for several missing invalid corner cases in user-defined primitive declarations
  • Fixed the propagation of unbounded literals through parameters used in expressions
  • Fixed handling of nested modules to be properly independent of each other when there are multiple instances of their parent module
  • Fixed handling of bind directives that target nested modules
  • Fixed handling of bind directives that appear in uninstantiated generate blocks
  • Fixed handling of include files that don't contain a newline character (thanks to @ihathbeer)
  • Fixed handling of classes that declare a member named "\new" with an escaped identifier
  • chandles are properly allowed in non-edge event expressions
  • Correctly disallow wait fork and expect in functions and final blocks
  • Fixed bug in computing bounds for assignments to slices of unpacked arrays
  • Fixed macro argument parsing when there are (* and *) tokens in them
  • Fixed a bug in SVInt::operator< when comparing the smallest possible negative integer (thanks to @Krym4s)
  • Correctly allow non-blocking assignments with a timing delay to be used in always_ff blocks (thanks to @udif)
  • Fixed checking of overlapping primitive table rows when the '-' output character is used (thanks to @udif)
  • Fixed checking for which kinds of functions are allowed in deferred assertion actions and sequence match items
  • Fixed a couple of places where range selects were not properly checked for overflow
  • Fixed sorting of diagnostics when buffers are loaded in non-deterministic order
  • Added error handling for packages that try to import themselves
  • Type references and assignments of type void are now correctly disallowed
  • Fixed several bugs in slang-netlist (thanks to @jameshanlon)
  • Fixed --allow-toplevel-iface-ports when used with interface arrays