v0.4: Polish and refactoring
Highlights
This release contains a lot of internal refactoring and cleanup, with the goals of correctly handling all corner cases as well as dramatically speeding up compilation time -- some projects and workloads may see up to a 10x speedup.
Language Support
- Support for intra-assignment timing controls
- Full support for dynamic arrays in type checking and constant expressions
- Full support for associative arrays in type checking and constant expressions
- Partial support for queues in type checking and constant expressions (still missing expressions involving the '$' magic value)
- Added $dimensions and $unpacked_dimensions system functions
- Added $printtimescale, $timeformat, and $system functions
- Added $ferror, $fgets, $fscanf, $sscanf, and $fread system functions
- Support for disable statements
- Support for unpacked array concatenations
- Support for min:typ:max expressions
- Support for disable-fork and wait-fork statements
- String literals can now correctly be implicitly assigned to unpacked arrays of bytes (thanks to @thingkingland )
General Features
- Reworked how definitions and instances are represented, both to make the code clearer as well as to allow caching of identical instances.
- Timing controls are now included in AST->JSON serialization (thanks to @Kuree ).
- Added initial support for generating simulation code for designs using LLVM. There's enough support here to simulate a basic "Hello World" example but not much else.
- To facilitate code generation, a mid-level IR representation was added to sit between the AST and LLVM. In the future this could grow to be useful to other consumers as well.
- Went through and removed experimental code analysis services from the repository and ported the CI build to GitHub actions, fixing the automated release and deployment pipeline in the process.
- Split slang into several component libraries to make it easier to link in only subsets of functionality.
- Added a bunch more API reference documentation.
- The remaining 3rd party dependencies have been vendored into the repo under the external/ folder. The conan package manager has been removed from the build process.
Fixes
- Fixed a bug where stringifying certain integer literals could produce garbage results.
- Improved parser error recovery in more scenarios.
- Fixed several crashes found by fuzz testing.
- Empty concatenations now correctly report an error.
- Fixed a faulty error reported when range-selecting a single bit from a big-endian vector.
- Fixed the type that is inferred for implicitly typed parameters.
- Rewrote lvalue handling in constant expressions to fix several corner cases.
- Fixed a crash in the preprocessor involving a rare case of macro replacing a token that then becomes another macro.
- Fixed parsing of cycle delays.
- Fixed ANSI color output on Windows terminals.
- Fixed variable lifetimes of task arguments.
- Packed dimensions on enum declarations were previously being ignored.
- Added additional error checking for various array creation rules.
- Fixed an infinite loop in the parser caused by unsupported statements (thanks to @thingkingland ).
- Fixed a bunch of issues with parsing new expressions.
- Fixed a bunch of issues with parsing clocking blocks.
- The error reported for non-standard character escape codes has been downgraded to a warning.