Skip to content

v0.6: More language features

Compare
Choose a tag to compare
@MikePopoloski MikePopoloski released this 10 Jan 17:16
· 2118 commits to master since this release

Highlights

Many large open source SystemVerilog codebases can now be fully elaborated by slang, such as the black-parrot project.

Language Support

  • Partial support for bind directives
  • Support for modports, including enforcing all connection and port access rules
  • Full support for DPI import and export directives (except for open array arguments)
  • Support for the $assertcontrol family of system tasks
  • Support for iff conditional event controls
  • Support for wait statements
  • Support for procedural assign / deassign / force / release statements
  • Support for intra-assignment repeat event controls
  • Implemented remaining support and rules for nets, net types, net delays, and user-defined net types
  • Support for ref arguments
  • Support for all built-in methods on associative arrays
  • Support for the built-in std package
  • Support for the std::process class
  • Support for the std::semaphore class
  • Enforce all rules around optional parenthesis when invoking subroutines
  • Support for with array iterator expressions, including in constant expressions
  • Added the sum, product, sort, rsort, reverse, shuffle, min, max, unique, unique_index built-in array methods
  • Added the find, find_index, find_first, find_first_index, find_last, find_last_index built-in array methods
  • Support for rand and randc class properties
  • Added the randomize, pre_randomize, post_randomize, srandom, get_randstate, set_randstate built-in class methods
  • Added the $urandom_range system function
  • Added the rand_mode and constraint_mode built-in methods on classes and properties
  • Full support for class constraint declarations and constraint blocks, including all class qualifiers and name lookup rules
  • Full support for inline constraint blocks via with expressions on randomize calls, including local:: name lookup
  • Support for left justifying integers when formatting with $sformatf

General Features

  • Added a -G command line option which can override top-level module parameter values
  • Added a --ast-json-scope option which controls which scopes are dumped to JSON
  • Added -Wwidth-expand and -Wwidth-trunc (both off by default) which warn about implicit integral conversions that change size
  • Added -Wimplicit-conv (on by default) which warns about implicit conversions between different structs / unions / enums
  • Did a cleanup pass on warning text and grouping into categories. The default set of warnings should now consist only of warnings that have a very high likelihood of being a real problem. The -Wextra group is recommended but not enabled by default. -Wconversion is a new group that includes all implicit conversion-related warnings.
  • Added a --ignore-unknown-modules flag which suppresses errors for instantiations of unknown modules
  • The driver tool now prints errors to stderr instead of stdout
  • Added --libdir and --libext flags to allow automatically searching for files to include in the build when encountering unknown modules
  • Added a -v flag to include source files that are treated as "libraries", meaning modules in them are not automatically instantiated

Fixes

  • Fixed many issues related to spurious semantic errors reported inside uninstantiated modules
  • Fixed traversal of statement bodies via the ASTVisitor helper class
  • Fixed incorrect errors reported for non-ANSI ports with separate I/O and type declarations
  • Fixed many issues related to method prototype declarations
  • Unpacked arrays now correctly support up to 2^31 elements
  • Implicitly typed parameters that are assigned string literals are themselves treated as string literals in other expressions
  • Fixed accidental truncation of bits that was occurring when connecting array ports across interface instance array instantiations
  • Fixed type checking for compound assignment operators
  • Fixed lookup of class names in packages
  • Fixed many issues with class inheritance
  • Fixed crash when visiting generic class specializations leads to more specializations being created
  • Fixed merging of port types across separate I/O and type declarations, including in subroutine bodies
  • Fixed foreach loops to work with strings and predefined integer types
  • Fixed foreach loops over class properties
  • Don't report an error when void casting a system subroutine that can be both a task and a function
  • Fixed a check for variable initializers that reference themselves in their own declaration
  • Fixed lookup of subroutines when invoking them without parenthesis
  • Port connections were missing in AST JSON output
  • Fixed lookup of event objects in various statements
  • Fixed visibility checks for members of generic classes
  • Trailing '%' symbols in format strings are now a warning instead of an error