Skip to content

Releases: MikePopoloski/slang

v12.1

Choose a tag to compare

@github-actions github-actions released this 25 Oct 13:18
Immutable release. Only release title and notes can be modified.
v12.1
42710c7

Fixes

  • Fixed missing type checking of case property expression items against the case expression; incompatible types are now correctly reported as errors
  • dist expressions now have a result type of logic instead of void, matching the inside operator
  • Fixed $sdf_annotate to allow empty optional arguments and to correctly type check all of its string arguments
  • Fixed ICE during constant evaluation of repeat loop with real count (thanks to @sifferman)
  • Fixed replication operator to allow a literal zero count when the operand is a string literal, resulting in the empty string (thanks to @hankhsu1996)
  • Fixed bit-selects and part-selects of signed packed arrays declared via a typedef incorrectly producing a signed result
  • Fixed constant evaluation of slice stores that run past the end of an array or queue writing one element past the end
  • Fixed constant conversion of integral values with X/Z bits to strings incorrectly removing bytes that have known 1 bits
  • Fixed $sformatf to accept unpacked arrays of byte for %s arguments and for the format string
  • Fixed $sformatf results incorrectly containing null characters (e.g. from %c of 0)
  • Fixed the string atoi family of methods to require the scan to start with a digit before accepting underscores
  • Fixed the string atoreal method to only accept a valid real constant, rather than everything strtod accepts
  • Fixed the string realtoa method to produce the shortest representation that reads back as the same value
  • Fixed a case where references through an interface port were considered hierarchical references, preventing them from being used in $bits, type(), and net alias expressions (thanks to @hankhsu1996)
  • Fixed instance caching incorrectly sharing bodies for instances that call subroutines or instantiate sequences / properties via upward name lookup (thanks to @hankhsu1996)
  • Fixed crashes on struct and union members that declare an inline enum type (thanks to @hankhsu1996)
  • Fixed instance caching incorrectly sharing a body between instances given 0.0 and -0.0 as parameter values (thanks to @hankhsu1996)
  • Fixed instance caching incorrectly sharing a body between instances whose implicitly typed parameters are given the same integer at different widths or signedness (thanks to @hankhsu1996)
  • Fixed generic class specializations incorrectly being merged when their value parameters compare equal but are not identical (thanks to @hankhsu1996)
  • Fixed a race condition when computing line offsets for a file from multiple threads (thanks to @hankhsu1996)
  • Fixed sizing of the operand of a cast to an enum type; it now takes the enum's width as its context (thanks to @hankhsu1996)
  • Fixed constant evaluation of a conditional operator with an unknown condition to return the operand value when both operands are equal (thanks to @hankhsu1996)
  • Fixed struct member default values not being checked to be constant expressions (thanks to @hankhsu1996)
  • Fixed struct member default values not being used in the struct's default value (thanks to @hankhsu1996)
  • Fixed incorrect sign extension of division and remainder results on some constant integers wider than 64 bits
  • Fixed equality comparison of single-word integers with mixed signedness incorrectly sign extending, which also caused missed sign conversion warnings
  • Fixed slices of signed integers incorrectly producing a signed result
  • Fixed division and remainder of the most negative value of wide signed integers
  • Fixed multiplication of very large integers where one operand is less than half the size of the other
  • Fixed incorrect rounding when converting some wide integers to floating point
  • Fixed decimal literals that overflow a multi-word integer not being correctly truncated
  • Fixed several cases where an inline enum declaration would attach its values to the wrong scope (e.g. in ANSI port lists, class extends clauses, generate conditions, and randsequence productions)
  • Fixed handling of defparams inside of instance arrays
  • Fixed spurious errors on integral uses of replications in uninstantiated module bodies (thanks to @vbtcl)
  • Fixed $rtoi on negative values
  • Fixed the sign of the result of the string getc method
  • Fixed incorrect precision loss warnings when converting integers wider than 64 bits to real
  • Fixed invalid constant folding of a conditional expression with a non-constant matches clause
  • Fixed a crash in SyntaxTree.fromText when the text is a lone member keyword like default (thanks to @eanorige)
  • Fixed the expansion of nested macros defined and referenced within the same outer macro invocation
  • Fixed a parse error when the first formal argument of a sequence, property, let, or checker is declared untyped
  • We now gracefully continue AST construction after encountering the suppressible bad-procedural-force error, instead of erroring out the whole statement (thanks to @hankhsu1996)
  • Fixed multiple driver detection for range selects of unpacked arrays, which were previously treated as driving only their first element (thanks to @spomata)
  • Fixed $inferred_clock in non-procedural checker instances to resolve using the default clocking in effect where the checker is instantiated, rather than where it was declared
  • Fixed sequence, property, and let instances passed as arguments to another instance of the same declaration (e.g. s(a, s(b, c).triggered)) being incorrectly reported as recursive
  • Fixed a crash when selecting an inactive member of an unpacked union that declares an inline enum type
  • Fixed default_nettype information being lost when transforming a syntax tree with a SyntaxRewriter, which caused implicit nets to be incorrectly reported as errors
  • Fixed the check that type parameter overrides in bind directives resolve to the same types in both the target and directive scopes; it previously missed scoped names (e.g. pkg::T) and type names nested within more complex type expressions
  • Fixed the wildcard equality operators (==? and !=?) returning x when the left operand has an unknown bit, even though a known bit in another non-wildcard position differs (thanks to @marcobrambilla99)
  • Fixed packed arrays whose element type is a signed typedef, struct, or enum incorrectly being treated as signed; only packed arrays explicitly declared signed are signed (thanks to @sifferman)

Tools & Bindings

pyslang

  • Fixed incorrect binding of properties that return spans, which could lead to crashes
  • Added implicit conversions to allow passing symbols to methods that expect Scopes (which was broken in the nanobind conversion)
  • Fixed binding of flags enums to allow using expected operators on them (like |) (thanks to @XNinety9)
  • Fixed Driver.runAnalysis binding, which previously failed to return the resulting AnalysisManager

slang-tidy

  • Fixed the "UndrivenRange" check incorrectly reporting bits driven by range selects of unpacked arrays as undriven, and missing undriven elements past the last driver in unpacked and multidimensional arrays (thanks to @spomata)

slang-reflect

  • Fields of generated structs, unions, and enums are now value-initialized, so default-constructed objects start out zeroed (thanks to @spomata)
  • Fixed a crash when reflecting structs or unions that declare inline enum members
  • Fixed incorrect namespace qualification of union member conversion operators for non-user-defined types

v12.0

Choose a tag to compare

@github-actions github-actions released this 29 Sep 10:33
Immutable release. Only release title and notes can be modified.
v12.0
545f88b

Language Compatibility

  • Added --allow-cross-auto-bin-max (included in 'vcs' compat mode) which enables the cross_auto_bin_max legacy coverage option, for compatibility with (pre-IEEE) SystemVerilog 3.1a (thanks to @hankhsu1996)
  • ANSI input ports without an explicit port kind (net or var) are specified by the LRM to be nets. slang instead used to default them to variables, so that cases like input int p wouldn't error (since 2-state types are not valid for nets). Now they are defaulted to nets to match the LRM, with a carve out for the 2-state net type check to suppress the error for these implicit cases only. This behavior better matches the LRM and several commercial tools. --infer-input-ports-as-vars (included by default in 'vcs' compat mode) can be used to get the old behavior. (thanks to @likeamahoney)
  • Embedded class covergroups are now allowed to reference class members declared later in textual order. The LRM is not clear about this but all commercial tools agree.
  • All integral types (not just packed arrays) are now allowed to be sliced across instance array port connections. The LRM is not clear about this but all commercial tools agree.

Notable Breaking Changes

  • The minimum required CMake version to build slang is now 3.28
  • fmtlib is now a fully private dependency of slang, to avoid introducing transitive dependencies to downstream users that otherwise have no need for it. In general it should be possible to build slang fully self-contained, so that relying on it does not balloon your dependency tree. See the docs for more details.
  • 3rd party dependencies now require an explicit CMake option to use a local system-installed version (e.g. SLANG_USE_SYSTEM_BOOST). Previously this tried to auto-detect system installations but it caused too many issues where there happened to be a local copy that was undesirable for whatever reason.
  • The pyslang bindings have been ported to nanobind. For the most part downstream user scripts should continue to work the same, but there may be subtle edge cases (that are hard to enumerate or completely unknown to us).

New Features

  • Added support for external diagnostic waivers files for suppressing unwanted warnings (thanks to @sjalloq)
  • Added -Wmissing-else-clause which warns about if statements that look like they were meant to be else if based on being on the same line as a previous end keyword
  • Added -Wimplicit-net which warns for each implicit net that is created (thanks to @hankhsu1996)
  • Added -Wreal-case-eq which warns about using case equality operators ('===' and '!==') on real operands (thanks to @hankhsu1996)

Improvements

  • Depfiles created by --Mall and --Minclude now include system-style included files (via angle brackets) in addition to user-style (via double quotes) (thanks to @AndrewNolte)
  • When using --allow-toplevel-iface-ports, $static_assert constraints in a top-level module body can now pin interface port parameters to specific values or types, which is applied to the synthesized default interface instances (thanks to @AndrewNolte)
  • $static_assert with type reference comparisons now shows a detailed resolution chain for type aliases when the assert fails (thanks to @AndrewNolte)
  • Library search (with --libdir) can now parse files in parallel when threading is enabled (thanks to @ebrevdo)
  • Help text for the slang tool has been reformatted and improved in minor ways
  • Improved diagnostics for missing assignment pattern elements (thanks to @AndrewNolte)

Fixes

  • Fixed a potential crash when a single symbol has many (greater than 16) attributes declared (thanks to @AndrewNolte)
  • Fixed a bug where library search (with --libdir) could sometimes try to load and parse the same file more than once (thanks to @AndrewNolte)
  • Fixed spurious "unused" warnings on symbols that already have a previous error with their type resolution (thanks to @AndrewNolte)
  • Fixed `include files incorrectly being included in depfiles created by --Mmodule (thanks to @AndrewNolte)
  • Fixed a crash when using $static_assert to compare type references (thanks to @AndrewNolte)
  • Fixed false positives for -Wunused-but-set-property when accessing members via arrays of class handles
  • Fixed a crash when using super inside randomize calls on arrays of class handles
  • Fixed the ordering of element expressions in assignment patterns with explicit indices targeting arrays with descending indices
  • Fixed a parsing error where a labeled restrict property concurrent assertion was rejected
  • Fixed a bug that prevented interconnect nets from being used in alias directives
  • Fixed loop unrolling in data flow analysis to more conservatively handle loops that modify the iteration variable within their body
  • Fixed names explicitly imported into a package incorrectly being made visible to other units that import that package even when not re-exported
  • Fixed several internal assertions that could occur when recovering from invalid syntax
  • Fixed a malformed diagnostic for missing identifier tokens that go through the implicit net search logic
  • Fixed a crash when trying to analyze checkers with invalid port connections
  • Fixed ICE that could occur when a randsequence inside an unrolled for loop used a side-effecting index to drive an array element
  • Fixed ICE that could occur when analyzing a case statement over an enum that has a value with an erroneous initializer
  • Fixed output port initializers to count as drivers for multi-driver checking (thanks to @x-Aksara-x)
  • Fixed a bug where package exports that go through multiple layers of re-export from other packages would not work correctly (thanks to @AndrewNolte)
  • Fixed ICE during constant evaluation of tagged packed union member access with unknown tag (thanks to @EylonKrause)
  • Fixed ICE during constant evaluation of a queue read at one past the end (thanks to @EylonKrause)
  • Fixed ICE during constant evaluation of a streaming concat reorder on an irregular slice boundary (thanks to @EylonKrause)
  • Fixed ICE during constant evaluation of a streaming 'with' range past the array extent (thanks to @EylonKrause)
  • Fixed ICE during constant evaluation of string formatting using '%u/%z' with unpacked unions (thanks to @EylonKrause)
  • Fixed ICE during constant evaluation of string formatting using integer/char specifiers with a null handle (thanks to @EylonKrause)
  • Fixed ICE due to unbounded recursion of generic class specializations with changing param values (thanks to @EylonKrause)
  • Fixed a bug where SVInt::set() would drop high words when promoting from 2-state to 4-state, corrupting the value (thanks to @EylonKrause)
  • Fixed potentially incorrect instance caching when a module has an interface array port that is connected to different interface types (thanks to @hankhsu1996)
  • Fixed constant evaluation of string ato* methods to work correctly for inputs larger than 2^31 (thanks to @hankhsu1996)
  • Fixed a potential crash when using the --libext flag (thanks to @x-Aksara-x)
  • Fixed JSON AST serialization of randsequence productions to include the statement bodies of code blocks
  • Fixed -Wunused-subroutine firing on subroutines named in an export "DPI-C" directive, since the export makes them reachable from C

Tools & Bindings

pyslang

  • As mentioned above, the bindings have been ported to nanobind (previously using pybind11) (thanks to @jpienaar)
  • Fixed binding of symbols that match Python keyword names (thanks to @slide and @allRisc)
  • Improved performance of visiting nodes when using the lookup_table dict of callbacks (thanks to @hankhsu1996)

slang-tidy

  • Added a "NoCaseX" rule that warns about uses of casex (thanks to @Ozzy1423)
  • Added a "NoDefParam" rule that warns about uses of defparam (thanks to @Ozzy1423)
  • Added a "TypedefEnums" rule that warns about enums not declared via a typedef (thanks to @Ozzy1423)
  • Added a "TypedefStructUnion" rule that warns about structs and unions not declared via a typedef (thanks to @Ozzy1423)
  • Added new checks for naming of various constructs, configured via regex: cover groups, crosses, cover points, enums, structs, unions, typedefs (thanks to @Ozzy1423)
  • Added a "StructFieldsInSameProcess" rule that warns about struct fields being assigned from multiple processes (thanks to @spomata)
  • Fixed the resetIsActiveHigh config having inverted polarity, and changed default to false so that it stays consistent with the default resetName of rst_ni (thanks to @spomata)
  • Fixed the "OnlyAssignedOnReset" check to issue the right diagnostics (previously was erroneously using "RegisterNotAssignedOnReset") (thanks to @spomata)
  • Fixed the "EnforceModuleInstantiationPrefix" check to actually apply to non-top level modules (thanks to @nwistoffTT)

slang-unifdef

  • Added a new tool that can be used to rewrite code as if certain macros were either defined or not defined, while leaving other idefs alone (thanks to @AndrewNolte)

v11.0

Choose a tag to compare

@github-actions github-actions released this 15 May 00:29
Immutable release. Only release title and notes can be modified.
v11.0
7ddf405

Highlights

This release contains many changes designed to increase compatibility with non-standard extensions and behaviors allowed by commercial tools, along with many new linting and static analysis warnings. It also improves performance and reduces memory usage, includes a number of quality of life features, and fixes many bugs.

As usual, a big thank you to everyone who submitted issues and patches to help improve slang.

Language Compatibility

  • Added a --allow-virtual-iface-with-override flag to allow interface instances that are bind/defparam targets to be assigned to virtual interfaces (thanks to @thomasnormal)
  • The error for invalid arguments to std::randomize has been made downgradeable via -Wnonstandard-randomize (thanks to @AndrewNolte)
  • Added support for conatenating strings with operator '+' (which will now issue -Wnonstandard-string-concat) (thanks to @AndrewNolte)
  • The error for nested block comments is now a warning by default (-Wnested-comment), and turned off by default in VCS compat mode
  • extern and pure method prototypes are now allowed to have an implicit return type (thanks to @mampcs)
  • The error for qualifiers on out-of-block method definitions is now downgradeable via -Wqualifiers-on-out-of-block (thanks to @mampcs)
  • The error for missing implementations of extern methods is now downgradeable via -Wmember-impl-not-found (thanks to @mampcs)
  • Unqualified task and function calls will now perform upward name resolution up the hierarchy if there is no declaration visible locally. The LRM is not entirely clear here but all major tools allow this and now slang does as well. (thanks to @mampcs)
  • The error for missing for loop variable initializers is now downgradeable via -Winitializer-required (thanks to @mampcs)
  • The error for use of package imports within class scopes is now downgradeable via -Wpackage-import-in-class (thanks to @mampcs)
  • Made the diagnostics for multiple overlapping assignments downgradeable to warnings (via the new warnings -Wmixed-var-assigns, -Wmultiple-cont-assigns, and -Wmultiple-always-assigns)
  • The string formatting functions now allow passing class handles, chandles, and null literals as arguments to integer format specifiers (thanks to @thomasnormal)
  • Misplaced trailing separator errors are now downgradeable to a warning (via the new warning -Wmisplaced-trailing-separator) (thanks to @thomasnormal)
  • Coverage cross items can now specify another cross as a target (thanks to @mampcs)
  • Coverage cross items can now contain dotted / hierarchical names, flagged via -Wnonstandard-hierarchical-cross (thanks to @AndrewNolte)
  • inside expressions can now specify a single element without the usually required braces, flagged via -Wnonstandard-inside (thanks to @AndrewNolte)
  • foreach array references can now contain function call expressions, flagged via -Wforeach-call-expr (thanks to @mampcs)
  • Added support for the $deposit system task, which is non-standard but very common in older codebases (thanks to @mampcs)
  • --relax-string-conversions now also allows implicit conversions from integers to strings (thanks to @mampcs)
  • Structured assignment patterns can now be written without the leading apostrophe, flagged by -Wnonstandard-bare-assoc-pattern (an error by default) (thanks to @mampcs)
  • Added --allow-array-concat-assign-pattern which allows assignment patterns (which usually require an assignment-like context) to be used in an unpacked array concatenation (thanks to @mampcs)
  • The error for leading underscores in vector literals is now downgradeable via -Wliteral-leading-underscore
  • The error for use of ref args in static functions is now downgradeable via -Wref-arg-automatic
  • The error for concats between strings and ints is now downgradeable via -Wstring-int-concat
  • The error for reversed range select ordering is now downgradeable via -Wrange-select-reversed
  • Default expressions in structured assignment patterns can now themselves be nested assignment patterns
  • Dynamic array new expressions can now have a structured assignment pattern initializer expression
  • Immediate assertions are now correctly disallowed in non-procedural contexts
  • Streaming operators are now allowed as branches of conditional (ternary) expressions (thanks to @likeamahoney)
  • In single-unit mode, named library files still result in their own compilation units (each one a single unit), to better match how other tools partition compilation units when libraries are involved
  • Assertion local variables can now be declared with any bitstream type, not just the types allowed in sequences
  • Invalid nested constraint blocks can now be allowed via -Wnonstandard-constraint-block
  • String format functions can now allow empty arguments and unused trailing arguments via -Wformat-empty-arg and -Wformat-too-many-args
  • The error for trying to override a parameter that doesn't exist is now downgradeable via -Wundefined-param-override
  • The error for mismatching virtual method argument names is now downgradeable via -Wvirtual-arg-name-mismatch
  • The error for indexing a single bit type is now downgradeable via -Wcannot-index-scalar
  • The error for using a ref arg in a fork-join block is now downgradeable via -Wref-arg-in-fork-join
  • The error for referencing a cover cross in a binsof expression is now downgradeable via -Wcross-ident-in-binsof
  • The error for using a string type in constraint expressions is now downgradeable via -Wstring-in-constraint
  • The error for redefining a symbol with the same name in the same scope is now downgradeable via -Wredefinition and -Wredefinition-different-type
  • The error for assigning to the target of a clocking variable is now downgradeable via -Wclockvar-target-assign

Notable Breaking Changes

  • pyslang bindings are now separated into submodules matching the C++ API namespaces, which will require adding imports to your existing scripts to make them continue to run
  • The ASTVisitor template now takes a VisitFlags enum instead of a bunch of bool parameters
  • -Wimplicit-conv has been moved from the default warning set to the -Wextra group due to being a little too noisy for a default. If you want it on and aren't using -Wextra you'll need to readd it to your command line.
  • The LSPUtilities class has been replaced by the more capable ValuePath class. Users of the old API will need to migrate to the new one.

New Features

  • Instantiations of unknown modules can now be ignored by putting a (* maybe_unknown *) attribute on the instantiation itself (thanks to @AndrewNolte)
  • Added -Wread-write and -Wmulti-write for detecting undefined sequencing of operations involving a single variable (both on by default)
  • Added -Wunused-subroutine, -Wunused-dpi-import, -Wunused-class-method, -Wunused-local-class-method, and -Wunused-constructor for detecting various kinds of unused tasks and functions
  • Added -Wunused-class-property, -Wunused-but-set-property, -Wunassigned-property, -Wunused-local-class-property, -Wunused-but-set-local-property, and -Wunassigned-local-property for detecting various forms of unused class properties
  • Added -Wunused-package-var, -Wunused-package-typedef, -Wunused-package-parameter, -Wunused-package-type-parameter, -Wunused-package-assertion-decl, and -Wunused-package-subroutine for detecting unused items declared inside packages
  • -Wunconnected-port has been split into three separate warnings: -Wunconnected-input-port, -Wunconnected-output-port, and -Wunconnected-inout-port, for more precise control over which warnings you want to see. The original -Wunconnected-port is now a group that controls all three at once, so existing command lines should continue to function the same way.
  • Added -Wempty-input-connection, -Wempty-output-connection, and -Wempty-inout-connection (grouped under -Wempty-connection) which warn about port connections that are explicitly connected to nothing
  • Added -Wrandomize-var-shadow which detects inline randomize constraint blocks that use class members which shadow local variable declarations
  • Added -Wshadow-value and -Wshadow-hierarchy which detect declarations that shadow others with the same name from outer scopes
  • Added -Wshadow-property which warns about class properties that shadow members of a base class
  • Added -Winc-dec-bit which detects increment and decrement of single-bit operands
  • Added -Wdangling-else which detects confusingly nested if/else blocks that are missing begin/end delimiters
  • Added -Wshift-count-overflow and -Wshift-count-negative which warn about potentially invalid constant shift values
  • Added -Wconstraint-func-cycle and -Wonstraint-solve-cycle which warn about potential cycles in constraint function calls and so...
Read more

v10.0

Choose a tag to compare

@MikePopoloski MikePopoloski released this 15 Jan 23:23
v10.0
ace09c5

Language Support

  • Implemented all of the rules related to assertion local variable definite assignment flow. slang will now diagnose use of assertion locals before they have been assigned, according to the rules in the LRM.
  • Explicit package export directives now correctly require a corresponding import (wildcard or explicit)
  • Non-variable and non-output ANSI port declarations are now correctly prevented from specifying an initializer expression
  • Parameter port declarations now correctly require an explicit keyword when an implicit type syntax with dimensions or signing keyword is used
  • Covergroup formal arguments are now correctly always considered const
  • Checker arguments that reference automatic variables or have const casts are now correctly disallowed from being used in procedural code
  • Checker procedures are now correctly disallowed from referencing covergroup types
  • Removed the restriction that covergroup expressions must be constant expressions -- the implementation was buggy, other tools don't implement it, and the details in the LRM are not well defined
  • Modport ports now correctly require that their target references are members of their parent interface
  • Explicit port expressions now correctly require that their target references are members of their parent module
  • Tasks that contain blocking timing controls are now correctly disallowed from being called from always_comb/latch/ff blocks

Notable Breaking Changes

  • AST serialization: typedefs and enum type references are now printed as links to the original definition instead of repeating the type for each usage

New Features

  • Added -Wcase-none which warns about constant case statements that don't match on any items
  • Added -Wunnamed-generate which warns for generate blocks that don't have a user-provided name
  • Added -Wvacuous-cover which warns about cover statements for properties that allow vacuous success (which can result in misleading cover results)
  • Added -Wnested-solve-before which allows downgrading the error issued for nested solve before constraints, for compatibility with other tools (on by default for 'vcs' compat mode)
  • Added a --cst-json option to serialize the concrete syntax tree to JSON (thanks to @AndrewNolte)
  • Added --allow-genblk-reference as a compatibility option to allow referencing unnamed generate blocks via their external names (thanks to @toddstrader)
  • Added a --diag-column-unit option to control whether column numbers in diagnostics respect UTF-8 encoding and tab stop widths, which is now the new default. The old behavior can be selected with --diag-column-unit=byte.
  • Added a --depfile-sort option to sort dependencies written to depfiles in topological order according to their use in the design (thanks to @AndrewNolte)
  • Added a --depfile-trim option to remove dependencies from the written depfile that aren't actually used in the design (thanks to @AndrewNolte)
  • The --compat flag now accepts all to enable all compatibility flags at once, to maximize the chances that slang will accept your code that works with other tools but may not comply with the LRM
  • Added a --disable-local-includes flag to mimic the behavior of VCS where `include directives don't search relative to the including file
  • The --std argument now accepts 1364-2005 as a value, which disables all SystemVerilog keywords during parsing for Verilog compatibility (thanks to @povik)
  • Added a --map-keyword-version option to allow overriding language keyword versions for specified groups of files (thanks to @likeamahoney)

Improvements

  • -Wcase-dup no longer warns if the duplicate items are all constant case items that don't match a known constant case expression
  • Performing concatenation of two slashes in a macro expansion now expands to a line comment, matching the behavior of other tools
  • The preprocessor will now implicitly concatenate tokens that result from back-to-back macro expansions even if there is no explicit macro concatenation operator used, to increase compatibility with other tools
  • Instances that have type parameters set to identical but not technically "matching" struct types are now eligible for instance caching, which can speed up elaboration of certain designs
  • -Wpacked-array-conv now also applies to cases where one side of the assignment has a multi-dimensional array type and the other does not (previously both sides had to be multi-dimensional arrays)
  • The AnalysisManager API has been reworked to allow providing listener callbacks for various analysis events, to retrieve the results of assertion analysis, and to allow substituting custom data flow analysis passes in place of the default
  • Duplicate packages are now diagnosed with -Wduplicate-definition, allowing them to be downgraded to a warning just like duplicate modules (thanks to @sjalloq)
  • Improved the diagnostic message and source ranges reported for duplicate drivers involving modport ports to be more clear about where the connections are going
  • The preprocessor now supports processing `include directives inside of macro expansions
  • Drivers through ref ports are now correctly applied to their connections hierarchically
  • Warnings related to wildcard port connections now contain additional context showing which port triggered the warning
  • Made several tweaks to slightly improve defparam and bind evaluation performance
  • The AST for multi-ports has been reworked to represent each sub port connection expression separately
  • Selection of elements of dynamic types is now a downgradeable warning (-Wdynamic-non-procedural) for compatibility with other tools
  • AST JSON serialization for scalar types now contains an isSigned field (thanks to @dinoruic)

Fixes

  • Unnamed covergroup types now print with a placeholder name in diagnostics and AST dumping instead of just an empty string
  • Fixed a bug where sequences and properties with local variable formal arguments would rewrite their formal args when expanding, potentially resulting in spurious errors
  • Fixed source ranges written by AST serialization for AST nodes that don't have syntax pointers
  • Fixed lint-only mode to not run the analysis pass
  • Fixed a crash in analysis that could occur after exiting elaboration early due to hitting the configured error limit
  • Fixed the source ranges of chained select expression AST nodes
  • Fixed a preprocessor crash when encountering certain specially crafted malformed pragma directives
  • Fixed expansion of __FILE__ and __LINE__ macros to use proper source locations (thanks to @g4rry1)
  • Fixed a spurious error when referring to a generic class declared within a package using an explicit package scope qualifier
  • Fixed a spurious error when an uninstantiated module's parameter values are set using an assignment pattern expression
  • Fixed a spurious error when an uninstantiated module references an unknown instance hierarchically and --disallow-refs-to-unknown-instances is in use
  • Fixed several issues where driver analysis did not correctly apply through non-trivial modport port expressions
  • Fixed a parser bug that misparsed delay controls followed by an assignment pattern expression (thanks to @sjalloq)
  • Fixed the AST representation of implicit named port connections for output (and inout) ports to always use an AssignmentExpression
  • Fixed several bugs with direction checking of explicit ANSI port connections
  • Fixed a bug where multi-driven diagnostics could print an expression path with "" as index values instead of the correct constant value
  • Fixed ICE when sequence and property arguments refer to themselves in their default expressions
  • Fixed ICE when pattern case items have a statement label
  • Fixed ICE when recursive module instances contain certain kinds of variable name conflicts
  • Fixed ICE involving unnamed recursive module instances
  • Fixed a case where the max instance hierarchy depth wasn't being enforced, leading to infinite recursion
  • Fixed ICE when a modport export's method name is empty
  • Fixed ICE involving virtual interface types where the interface instance contains a self-referential virtual interface member
  • Fixed ICE involving analysis of hierarchical calls to subroutines inside cached instance symbols
  • Fixed handling of file patterns starting with recursive wildcards -- they were canonicalized incorrectly on some platforms
  • Fixed infinite loop caused by recursive typedef references across packages
  • Fixed --allow-use-before-declare to also apply for references to parameters
  • Fixed a crash when querying bitstream width of classes containing properties with unpacked arrays of their containing class type

Tools & Bindings

pyslang

  • Upgraded to pybind11 3.0, which brings improved performance, smart_holder and native_enum features
  • The Lexer class is now exposed to the Python bindings (thanks to @paulgrahek)
  • Fixed binding of Diagnostic arguments, exposed DiagnosticEngine::formatArg

slang-tidy

  • The --skip-file and --skip-path slang-tidy options now also imply --suppress-warnings for those same paths
  • Fixed the undriven range checker to handle variables with non-zero lower bounds in their range (thanks to @jameshanlon)

rewriter

  • Added a --squash-blanklines option to remove extra blank lines in the rewritten output (thanks to @AndrewNolte)

v9.1

Choose a tag to compare

@MikePopoloski MikePopoloski released this 25 Sep 12:55
e0b33f9

Fixes

  • Non-blocking assignments with intra-assignment delays are now correctly allowed in always_comb blocks
  • Fixed enum base type check to properly error for multidimensional vector types
  • An appropriate error is now issued for enums that specify themselves as their own base type
  • Fixed a bug when parsing multiple comma separated type parameter declarations in a module port list
  • Fixed a bug in the accounting of how many nested for loop steps have been taken during dataflow analysis
  • Fixed AST serialization to respect the --disable-instance-caching flag
  • Fixed the check for infinite recursion in hierarchy instantiations to actually work
  • Fixed potentially infinite recursion when evaluating variable initializers in a recursive function
  • Fixed potentially infinite recursion with bad for loops with a preceeding statement label
  • Fixed various issues related to handling invalid patterns in conditional statements
  • Fixed a crash when evaluating top-level constant expression with pattern variables
  • We now properly report an error instead of crashing for subroutine formal arguments that call their parent function recursively from their default value expression
  • Fixed a crash in the preprocessor when there are ignored back-to-back macro concatenation tokens inside a macro expansion
  • Fixed check for use of rand variables in dist constraints to work with struct member access
  • Fixed spurious error when using $ in dist constraints
  • Fixed a bug that could cause diagnostics to be issued for assertions used within uninstantiated generate blocks
  • Fixed a bug that could cause "used before declared" errors to be issued for use of super class members in derived classes
  • Fixed a crash that could occur when the lexer gives up due to too many errors while parsing a pragma preprocessor directive

Tools & Bindings

slang-tidy

  • Fixed a crash in OnlyANSIPortDecls checker when ports don't connect to an internal symbol (thanks to @likeamahoney)
  • Fixed assertion in EnforcePortSuffix checker with ports that don't have a name (thanks to @likeamahoney)
  • Fixed a crash when an invalid value is provided for the --code flag (thanks to @likeamahoney)
  • Made the --dump-config option actually work correctly (thanks to @likeamahoney)

v9.0

Choose a tag to compare

@MikePopoloski MikePopoloski released this 31 Jul 01:14
v9.0
54385bb

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::reportCompilation method had part of its functionality split out into Driver::reportDiagnostics to allow for calling the new Driver::runAnalysis method in between. There is a new Driver::runFullCompilation method that wraps all of this for convenience if you don't care about controlling when each pass is done.
  • The DEBUG macro set for debug builds has been renamed to SLANG_DEBUG. NDEBUG is no longer used to conditionally control compilation, which should make it much less likely that using slang as a library will result in conflicting NDEBUG settings 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 -Werror and 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-checking flag has been removed. Its behavior can be regained by setting the new --max-loop-analysis-steps to 0.

New Features

  • slang can now optionally use cpptrace (using the SLANG_USE_CPPTRACE CMake 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-analysis flag, though it should not be needed unless there is a bug in slang.
  • Added a new option --diag-abs-paths to 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-steps to 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 unique or priority that provide a default case
  • Added -Wcase-wildcard-2state for wildcard case statements that have 2-state conditions and items
  • The `celldefine directive is now exposed in the API and in AST serialization (thanks to @whitequark)
  • Added new flags --all-deps, --include-deps, --module-deps, and --depfile-target to 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_comb blocks
  • Added -Winferred-comb which detects combinational logic in always_latch blocks
  • Added new flag --disallow-refs-to-unknown-instances which causes errors to be issued when there are hierarchical references to ignored unknown module instances that were allowed via the existing --ignore-unknown-modules flag

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-caching flag, 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.
  • +libext has 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-rename when 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-config to 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)

v8.1

Choose a tag to compare

@MikePopoloski MikePopoloski released this 24 May 01:42
f579784

This is a point release to get some bug fixes out.

Fixes

  • The restriction on interface instances targeted by defparams not being allowed with virtual interfaces was also erroneously applied to interface port connections
  • Fixed a null pointer crash in slang-tidy (thanks to @rhanqtl)
  • Fixed a bug that could cause infinite recursion when instantiating bind targets that force elaboration due to wildcard package imports
  • Fixed the handling of disable region directives declared in block comments (as opposed to single line comments which were working fine)
  • Fixed a spurious error when cycle delays are used in an uninstantiated context that does not have default clocking specified
  • Fixed an issue with how checker formal ports are looked up from within checker instances
  • Fixed ICE with conditional statements that have pattern matching along with a named statement block
  • Recursive typedef declarations now properly report an error instead of crashing
  • Fixed several issues that led to invalid builds on Linux with LTO enabled
  • Fixed a case where no diagnostic would be issued when incorrectly referring to an instance array element from within an expression
  • Fixed SyntaxPrinter printing of directives that have skipped leading trivia
  • Fixed rewiring of interface array port connections with opposite declared range directions
  • Fixed a bug in the constant evaluation of division between two positive signed integers; the sign flag was lost and the result was always treated as unsigned
  • Fixed JSON serialization of definition symbol attributes
  • The --obfuscate-ids option has been fixed to not generate invalid SystemVerilog names that start with a digit (thanks to @Sustrak)
  • Fixed slang-tidy's module instantiation prefix check to use the correct diagnostic (thanks to @corco)
  • Fixed $static_asserts triggering in uninstantiated contexts (thanks to @AndrewNolte)
  • Fixed --allow-use-before-declare to apply to wildcard port connection expressions

v8.0

Choose a tag to compare

@MikePopoloski MikePopoloski released this 06 Feb 01:51
v8.0
6befee6

Language Support

  • Disallow access to protected members from class scoped randomize constraint blocks -- the LRM is unclear about this but other tools seem to have decided this way made the most sense
  • Added a check that net aliases aren't duplicated, and that nets don't alias to themselves, as mandated by the LRM (thanks to @likeamahoney)
  • Implemented remaining rules for virtual interfaces:
    • Virtual interfaces can't have hierarchical references to objects outside the interface
    • Virtual interfaces can't have interface ports
    • Instances assigned to a virtual interface can't have an instance configuration rule applied to them

Potentially Breaking Changes

  • The minimum supported Xcode version is now 16 and the minimum supported Clang version is now 17 (to allow cleaning up workarounds for various bugs)

New Features

  • Added -Wudp-coverage which warns about edge-sensitive user-defined primitives that don't specify an output state for all edges of all inputs (thanks to @likeamahoney)
  • Added -Wpacked-array-conv which warns for conversions between different multidimensional packed array types even if their overall bit width is the same
  • Added the -Wparentheses warning group for diagnosing common precedence-related syntactical errors, which includes the following new warnings: -Wbitwise-rel-precedence, -Warith-in-shift, -Wlogical-not-parentheses, -Wbitwise-op-parentheses, -Wlogical-op-parentheses, -Wconditional-precedence, -Wconsecutive-comparison
  • Added -Wcase-type to warn about case statements with mismatching types in their item expressions
  • Added -Wcase-default which warns about case statements that don't include a default label
  • Added -Wcase-outside-range which warns for case items that can never be matched because they are outside the range of the case condition expression
  • Added -Wcase-enum and -Wcase-enum-explicit which warns about enum values that are missing from a case statement (with and without the presence of a default label, respectively)
  • Added -Wcase-dup which warns about duplicate item expressions in a case statement
  • Added -Wcase-overlap which warns about overlapping case items (due to wildcard bits)
  • Added -Wcase-not-wildcard and -Wcasez-with-x which warn about potentially misleading wildcard bits in non-wildcard case statements
  • Added initial support for instance caching, which skips elaborating identical module instances to speed up elaboration. This is currently hidden behind the --disable-instance-caching command line flag because when turned on not all multi-driven errors are properly issued. Once all issues have been worked out the feature will be turned on by default.
  • Added the ability to output diagnostics to JSON instead of (or in addition to) plain text
  • Added --translate-off-format which allows specifying comment directives that should act as skipped regions (for example, // pragma translate_off and // pragma translate_on)
  • slang warnings can now be turned on and off within source code using // slang lint_off style comment directives
  • Added --ast-json-detailed-types to include detailed type information in AST JSON output
  • slang-tidy gained a clkNameRegexString option to control how clocks are named (thanks to @spomatasmd)

Improvements

  • Made -Wuseless-cast a bit less noisy -- it now does not warn about expressions involving genvars or cases where types are matching but one or the other has a different typedef alias name
  • -Wsign-compare no longer warns about expressions involving genvars
  • -Wvector-overflow no longer warns about signed literals with binary, octal, or hex bases that place a bit in the MSB
  • Made some build tweaks to support hermetic builds (thanks to @cc10512)
  • Added support for unions to slang-reflect (thanks to @Sustrak)
  • Changed the error issued for sequences that can never be matched to be a warning instead (-Wseq-no-match) and added additional context to the diagnostic message
  • Made minor tweaks to improve defparam and bind resolution performance
  • -Wsign-conversion will no longer warn for certain system functions that have a return type of int but in practice only return a single bit result
  • Made some minor improvements to parser error recovery when struct definitions are missing a closing brace
  • Inline genvars declared in generate loops are now included in the generate loop's members list when serializing the AST
  • The pyslang packaging build is now done in this repo instead of a separate downstream repo (thanks to @parker-research)
  • pyslang wheels now include support for arm64 (thanks to @gadfort)
  • Documentation now includes the READMEs for the various ancillary slang tools
  • Added stub generation to the Python distribution (thanks to @parker-research)

Fixes

  • Fixed a bug with constant evaluation of left-hand side assignment patterns that require implicit conversions to be applied
  • Fixed the locations returned by Trivia::getExplicitLocation for nested trivia involving directives (thanks to @povik)
  • Fixed checking of illegal property negation operator when used within recursive property instantiations (thanks to @likeamahoney)
  • Fixed a bug with serializing UninstantiatedDef AST nodes that use implicit named port connections
  • Fixed a crash when checking duplicate drivers in assignments to invalid ranges of a vector
  • Correctly allow unpacked unions to be used in equality and conditional expressions
  • Fixed spurious warnings inside an unused generic class that instantiates the default specialization of itself
  • Fixed Python bindings build to work with Python 3.13 (thanks to @vowstar)
  • Fixed a spurious error when assigning the empty queue to an unresolved / unknown typed variable
  • Correctly disallow override specifiers on class constructor declarations
  • Correctly report an error for unbased unsized literals that use a ? instead of a z character for high impedance
  • Fixed handling of connections of interface arrays to ports with different declared dimensions
  • Fixed a bug in constant evaluation of packed struct member access
  • Correctly disallow select expressions of a parenthesized subexpression
  • Fixed a bug where some type declarations in two modules with different parameter values could be erroneously considered equivalent to each other (thanks to @povik)
  • Correctly disallow derived class virtual methods from declaring a different visibility level from their base class method
  • Reworked how enum types are implemented to fix various issues related to enum values declared inside subexpressions from being visible to their surrounding scopes
  • Fixed several issues related to enum value initializers that try to refer to themselves or other enum values
  • Fixed a parser crash when an invalid class override specifier is at the very end of a file
  • Fixed a potentially unbounded loop when resolving a specific case of invalid bind directives
  • Fixed bad diagnostic output related to instantiating properties with missing formal argument names
  • Fixed several minor issues with the Python bindings (thanks to @parker-research)
  • Fixed bugs with pattern variables not being visible in certain scopes where they otherwise should have been
  • Pattern variables are now properly usable from static variable initializer expressions
  • $sformat in constant expressions now works properly with %p specifiers
  • Fixed -Wwidth-expand to apply to conditional expressions
  • Fixed [*] and ##[*] sequence repetitions to start from 0 instead of 1 (thanks to @georgerennie)
  • Fixed a case where nested attributes were not properly diagnosed (thanks to @likeamahoney)
  • Fixed type resolution for expressions involving static casts; previously the operand of the cast was considered self determined, but now the type of the cast is correctly propagated to the operand
  • Fixed a bug in SyntaxNode::isEquivalentTo which would cause it to sometimes return the wrong result
  • Fixed the direction of argument binding for n-output gate terminals

v7.0

Choose a tag to compare

@MikePopoloski MikePopoloski released this 26 Sep 23:45
d56a398

Highlights

This release completes support for the changes in the recently released IEEE 1800-2023 version of the SystemVerilog LRM.

Language Support

  • Select expressions of packed arrays now always return an unsigned type, as mandated by the LRM
  • Clocking skew delays now properly require a constant value
  • Enforce that static methods can't have override specifiers
  • The error for invalid state-dependent path conditions in specify blocks can now be downgraded with -Wspecify-condition-expr for compatibility with other tools
  • Added support for the optional system tasks and functions from Annex D in the LRM: $countdrivers, $list, $input, $key, $nokey, $reset, $reset_count, $reset_value, $save, $incsave, $restart, $scope, $scale, $showscopes, $showvars, $sreadmemb, $sreadmemh, $getpattern
  • Added support for the optional compiler directives from Annex E in the LRM: `default_decay_time, `default_trireg_strength, `delay_mode_distributed, `delay_mode_path, `delay_mode_unit, `delay_mode_zero
  • Rules about nondegeneracy of sequences and properties are now enforced (thanks to @likeamahoney)
  • Special case rules about how name resolution works in bind directives are now enforced
  • Changed the definition of "simple types" to include string to allow using it as a target for assignment pattern fields (thanks to @likeamahoney)
  • Rules for inconsistent net types connected via an implicit named port connection are now enforced (thanks to @likeamahoney)

Clarifications in IEEE 1800-2023

  • Assertion clocking events can't reference automatic variables
  • The .* token sequence is actually two separate tokens that can be separated by whitespace
  • Functions in constraints cannot have inout arguments
  • Constraint subexpression can be of any type as long as their final expression type is numeric and they don't reference random variables
  • The argument to $isunbounded must be a parameter name (only enforced as a pedantic warning in slang)
  • Edge-sensitive paths in specify blocks can specify an edge keyword without also including a data source expression
  • Only bidirectional switches allow connections to nets with user-defined net types (other primitives do not)

New Features in IEEE 1800-2023

  • Constraint expressions and random variables can have real types
  • dist expressions can have a default specifier
  • dist expressions can have real types
  • solve-before constraints can specify array.size() as well as regular random variables
  • disable soft constraints can target array.size()
  • Constraint blocks can have override specifiers (initial / extends / final)
  • Covergroups can inherit from covergroups in parent classes
  • Coverpoints can have real types
  • Covergroups have new options: cross_retain_auto_bins and real_interval
  • New system functions $timeunit, $timeprecision, and $stacktrace

General Features

  • Added -Wunsigned-arith-shift which warns about suspicious arithmetic right shifts of unsigned types
  • Added -Wstatic-init-order and -Wstatic-init-value which warn about static initializers that depend on uninitialized values or an undefined order of other static initializers
  • Added -Wfloat-int-conv and -Wint-float-conv which warn about implicit conversions between floating point and integer types
  • Added -Wfloat-narrow and -Wfloat-widen which warn about implicit conversions between floating point types of differing widths
  • Added -Wunused-import and -Wunused-wildcard-import which warn about unused import directives
  • Added -Warith-op-mismatch, -Wbitwise-op-mismatch, -Wcomparison-mismatch, and -Wsign-compare which all warn about different cases of mismatched types in binary expressions
  • slang-netlist has experimental support for detecting combinatorial loops (thanks to @udif)
  • Added --allow-merging-ansi-ports (included in "vcs" compat mode) which allows non-standard behavior in which ANSI module ports can duplicate net and variables declared within the module
  • Added --ast-json-source-info which includes source line information when dumping an AST to JSON (thanks to @KennethDRoe)
  • Added --enable-legacy-protect which enables support for nonstandard / legacy protected envelopes: Verilog-XL style `protect directives and Verilog-A style // pragma protect comments

Improvements

  • Default value expressions for parameters that are overridden are now checked for basic correctness and other parameters they reference will not warn for being "unused"
  • Made several minor improvements to the locations reported for propagated type conversion warnings
  • Sped up Compilation object construction by reorganizing how system subroutines are created and registered
  • Improved the parser error reported when encountering an extraneous end delimiter in a member list
  • Various fixes and improvements were made to slang-netlist (thanks to @jameshanlon, @udif)
  • Added options to slang-tidy to better control what gets output (thanks to @Sustrak)
  • Added a bunch of new checks to slang-tidy (thanks to @JoelSole-Semidyn)
  • Improved handling of source files that contain non-UTF8 comments (thanks to @udif)
  • Fixed and improved various parts of the SyntaxRewriter API (thanks to @sgizler)

Fixes

  • Fixed several AST serialization methods (thanks to @tdp2110, @likeamahoney, @Kitaev2003, @cyuzuzo-j)
  • Fixed the return type of DPI import tasks
  • Fixed a bug that caused some inout ports to warn as "unused"
  • Fixed the checking of the extends override specifier when the containing class has no base class
  • Fixed a case where bracketed delay expressions in sequence concatenations were not checked for correctness
  • Fixed the type of the iterators used in with-expressions for covergroup bins
  • Fixed a bug that sometimes prevented printing the correct scope for type alias names in diagnostic messages
  • Fixed the hierarchical path string created for symbols inside of unnamed generate blocks (thanks to @povik)
  • Fixed spurious errors that could occur when using generic class instantiations inside uninstantiated generate blocks
  • Correctly disallow passing expressions of void type to format style system functions (thanks to @tdp2110)
  • Fixed a bug where parameters that referred to themselves via hierarchical reference would cause a crash instead of reporting a diagnostic
  • Fixed PATHPULSE$ specparam initializers to allow providing only one value instead of requiring two (thanks to @likeamahoney)
  • Fixed PLA tasks to accept concatenation expressions as arguments without reporting an error about the direction of the argument bounds (thanks to @likeamahoney)
  • Fixed a bug that could cause spurious errors in uninstantiated generic class definitions
  • Fixed the Symbol::getHierarchicalPath API to round-trip correctly
  • Fixed JSON serialization of integers to round-trip correctly
  • Fixed a bug in resolving defparam values inside of generate loops
  • Fixed checking of event arguments in system timing check functions
  • Fixed checking of deferred assertion function calls (thanks to @likeamahoney)
  • Correctly issue an error if a sequence or property has a formal argument with the same name as a local variable declaration (thanks to @likeamahoney)
  • Fixed a case of recursive property instantiation that was incorrectly disallowed (thanks to @likeamahoney)
  • Fixed bugs in checking for overlapping user-defined primitive table rows (thanks to @likeamahoney)
  • Fixed infinite loops in the parser when encountering constraint blocks with certain kinds of invalid tokens in them (thanks to @likeamahoney)
  • Fixed errors in assigning to select expressions involving members of virtual interfaces (thanks to @micron-ian)

v6.0

Choose a tag to compare

@MikePopoloski MikePopoloski released this 21 Apr 18:38
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 ...
Read more