aboutsummaryrefslogtreecommitdiff
path: root/src/test/scala/firrtlTests/ParserSpec.scala
AgeCommit message (Collapse)Author
2023-03-15Update serialization to firrtl-spec 1.2.0 (#2615)Jack Koenig
2023-01-25[smem] fix read-under-write serialization (#2595)Kevin Laeufer
* [smem] fix read-under-write serialization Also adds some tests for the parser and the serializer. * Serializer: always serialize smem ruw behavior * test: simplify smem test circuit
2022-09-13Make the Parser handle errors more gracefully (#2549)Jack Koenig
Ever since introducing the Listener, the firrtl Parser now can hit errors in the code converting from concrete syntax to abstract syntax that may be due to syntax errors. These errors are essentially broken assumptions about the structure of the parsed code because there is an error. These errors are reported before the standard ANTLR syntax errors are aggregated and reported, and thus could result in less than elegant error messages (eg. NullPointerException). Now, the Parser will mask off such errors in the event of standard syntax errors caught by the ANTLR-generated parser. This commit also cleans up some ParserSpec tests slightly to make the ScalaTest style more canonical.
2022-09-12Handle new keyword version as an identifier (#2550)Jack Koenig
2022-08-26FIRRTL version support (#2543)Zachary Yedidia
* Parse version and hardcode emitted version * Throw error if version is too high * Parse version even if rest is invalid * Change pattern match to if statement * Improve version grammar * Update tests * Remove outdated comment * Simplify grammar and use version class * Simplify and add no version test * Fix for conflicting lexer rule
2021-11-29[deprecation clean up] remove firrtl.ExecutionOptionsManager (#2422)Jiuyang Liu
Also remove all related APIs: ComposableOptions HasParser CommonOptions HasCommonOptions FirrtlExecutionOptions HasFirrtlOptions FirrtlExecutionResult FirrtlExecutionSuccess FirrtlExecutionFailure ExecutionOptionsManager firrtl.stage.DriverCompatibility.firrtlResultView logger.Logger.makeScope OutputConfig SingleFile OneFilePerModule * Change default LogLevel to None which means "unset" Logger.getGlobalLevel then returns LogLevel.Warn when the current value is LogLevel.None. This preserves the behavior of the default being "Warn" but now uses LogLevel.None to indicate "I'm not setting the value." This resolves issues where it was not possible to tell if annotations were actually setting the log level or if the default level of warn was just being filled in. Co-authored-by: sinofp <sinofp@tuta.io> Co-authored-by: Jack Koenig <koenig@sifive.com>
2021-11-23fix tests that depend on Driver (#2429)Jiuyang Liu
Co-authored-by: sinofp <sinofp@tuta.io>
2021-10-09Support parsing missing keywords as ids (#2381)Jack Koenig
Reset, AsyncReset, Interval, attach, assert, assume, and cover have all been added as keywords but not added to the allowlist for parsing as ids.
2021-02-17Allow Side Effecting Statement to have Names (#2057)Kevin Laeufer
* firrtl: add optional statement labels for stop, printf, assert, assume and cover * test: parsing of statement labels * ir: ensure that name is properly retained * SymbolTable: add support for labled statements * test: parsing statement labels * test: lower types name collisions with named statements * ignore empty names * Inline: deal with named and unnamed statements * RemoveWires: treat stop, printf and verification statements as "others" * test: fix InlineInstance tests * DeadCodeEliminations: statements are now als declarations * CheckHighForm: ensure that statement names are not used as references * CheckSpec: throw error if statement name collides * add pass to automatically add missing statement names * check: make sure that two statements cannot have the same name * stmtLabel -> stmtName * scalafmt * add statement names to spec * spec: meta data -> metadata * EnsureStatementNames: explain naming algorithm * remove returns * better namespace use * ir: add CanBeReferenced trait * ir: add newline as jack requested
2020-09-16Change to Apache 2.0 License (#1901)Chick Markley
2020-08-14All of src/ formatted with scalafmtchick
2020-07-29[2.13] toSeq, Unit -> (), and postfix fixesKevin Laeufer
2020-07-15ir: store FileInfo string in escaped format (#1690)Kevin Laeufer
This should speed up the common case as the compiler never operates on the unescaped string. The new escape function also fixes a bug where ']' was not escaped even though it is the delimiting character for FileInfo. In order to maintain backwards compatibility for the ProtoBuf format, this patch adds escape/unescape calls when going from/to protobuf format. For better performance we should consider changing the protobuf format.
2020-07-14Fix parsing of info on multi-line registers (#1735)Jack Koenig
For multi-line registers, the parsed source locator is located in a different place in the concrete syntax tree than it is for other Statements. Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
2020-03-26Support octal and binary literal formats as described in the specAlbert Magyar
* Fixes #1464
2020-03-17[RFC] Factor out common test classes; package them (#1412)David Biancolin
* Pull out common test utilities into a separate package * Project a fat jar for test utilities Co-authored-by: Albert Magyar <albert.magyar@gmail.com>
2019-11-04Add explicit EOF to top-level parser rule (#1217)Albert Magyar
* Fixes #1154 * Tests that #1154 example produces SyntaxErrorsException * Generally helps catch trailing syntax errors * Performance-neutral relative to previous grammar * Recommended by antlr4 devs, can help performance in some cases * See antlr/antlr4#1540
2019-08-19Refactor exceptions to remove stack trace from user errors (#1157)Jack Koenig
2018-03-21Add SyntaxErrorsException as a type of ParserException (#770)Jack Koenig
Also make ParserException extend FIRRTLException to better report parsing errors to the user
2017-10-31Fix bug emitting and reparsing ExtModule String parameters (#675)Jack Koenig
2017-05-27Prep for Scala 2.12 (#557)Jim Lawson
* Update dependencies and JavaConverters for Scala 2.12 * Bump Scala (and library) version(s). * replace "error" with "Utils.error"; bump Scala version to 2.11.11
2017-05-03Add test for source locators on multi-line reset registers (#554)Jack Koenig
Test for #468
2017-03-01Allow nested digit fields in subfield expressionsJack Koenig
Workaround for #470. This allows parsing DoubleLits in subfield expressions.
2017-03-01Fix bug in Lexer rule for DoubleLit and add testsJack Koenig
2017-02-23Add support for bundle fields to start with digits (#462)Jack Koenig
Also remove parsing support for ids with characters not supported in Verilog nor in the Firrtl spec
2016-11-04Cleanup license at top of every file (#364)Jack Koenig
Replace with more sensible comment to see LICENSE rather than including the whole license in every file
2016-04-16Add some Parser testsjackkoenig
Need many more, but this at least checks some DefMemory, DefRegister, and keyword cases.