aboutsummaryrefslogtreecommitdiff
AgeCommit message (Collapse)Author
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
2022-08-04Bump protobuf runtime to avoid CVE-2021-22569 (#2535)Jack Koenig
2022-08-03smt: make SMTExprMap object public (#2534)Kevin Laeufer
The simple functionality is needed in chiseltest.
2022-05-27Update README Prerequisites (#2525)Jack Koenig
* Fix Yosys link * Update SBT version
2022-04-25Update scalatest to 3.2.12 (#2524)Scala Steward
2022-04-21Fix optimization of register with reset but invalid connection (#2520)Jack Koenig
Fixes #2516 Previously, reg r : UInt<8>, clock with : reset => (p, UInt<8>(3)) r is invalid would compile to: reg r : UInt<8>, clock r <= UInt<8>(0) now it compiles to: reg r : UInt<8>, clock wire r_1 : UInt<8> r_1 is invalid r <= mux(reset, UInt<8>(3), r_1) This is consistent with the behavior for a reset with an asynchronous reset.
2022-04-21Update sbt-scalafix to 0.10.0 (#2517)Scala Steward
Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
2022-04-21Update json4s-native to 4.0.5 (#2519)Lucheng Zhang
2022-04-20Update sbt-scalafix to 0.9.34 (#2456)Scala Steward
Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
2022-04-20Update sbt-assembly to 1.2.0 (#2494)Scala Steward
Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
2022-04-20Update sbt to 1.6.2 (#2496)Scala Steward
Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
2022-04-20Update sbt-api-mappings to 3.0.2 (#2499)Scala Steward
Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
2022-04-20Update sbt-mima-plugin to 1.1.0 (#2507)Scala Steward
Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
2022-04-11Fix incorrect deprecation warning for TargetDirAnnotation (#2511)Jack Koenig
2022-04-07Make MemConf's MemPort serialization deterministic (#2508)Chick Markley
Problem: MemConf serialization of MemPorts was not deterministic and the ordering seems to have changed as we move projects to 2.13 Downstream project can be adversely affected by changes in ordering This changes specifies as specific ordering that should be compatible with the historical one.
2022-04-05Use circuit name hashCode for circuit anno hashCode (#2504)Jack Koenig
It is unclear if having more than one circuit annotation even works. If it does, it is implausible that they would have the same circuit name since that would correspond to a namespace collision.
2022-03-25Fix anno deserialization when class field is not first (#2501)Fabian Schuiki
Update `findTypeHints` to allow for the "class" field in JSON objects to appear anywhere in the object. This used to rely on the field being the very first in the object, which is easily violated when reading JSON data generated externally, since an object's order of fields is unspecified and can be arbitrarily scrambled. Fixes #2497.
2022-03-14Add Spec source link to the README (#2493)Megan Wachs
Before it would just download another copy of the PDF every time I wanted to go visit the spec repo.
2022-03-14Update sbt to 1.5.8 (#2458)Scala Steward
Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
2022-03-14Update sbt-scalafmt to 2.4.6 (#2459)Scala Steward
Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
2022-03-14Update sbt-scoverage to 1.9.3 (#2460)Scala Steward
Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
2022-03-14Update scalacheck-1-15 to 3.2.11.0 (#2471)Scala Steward
Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
2022-03-14Update os-lib to 0.8.1 (#2478)Scala Steward
Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
2022-03-14Update sbt-assembly to 1.1.1 (#2482)Scala Steward
Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
2022-03-14Update sbt-buildinfo to 0.11.0 (#2483)Scala Steward
Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
2022-03-05[spec] Change README to point at latest spec PDF (#2489)Schuyler Eldridge
Signed-off-by: Schuyler Eldridge <schuyler.eldridge@sifive.com>
2022-03-04[spec] Remove FIRRTL Specification (#2488)Schuyler Eldridge
This removes the FIRRTL specification as this now lives in its own repository: https://github.com/chipsalliance/firrtl-spec All git history (excluding binary updates to spec.pdf) have been migrated to the new repository. Signed-off-by: Schuyler Eldridge <schuyler.eldridge@sifive.com>
2022-03-02Fold VerilogModulusCleanup into LegalizeVerilog (#2485)Jack Koenig
This fixes handling of signed modulus and removes some redundant work.
2022-03-01Convert firrtl specification to Markdown file (#2236)Jared Barocsi
- Convert FIRRTL spec to Markdown file. - Add PDF generation via pandoc. - Remove old LaTeX specification. Co-authored-by: Schuyler Eldridge <schuyler.eldridge@sifive.com> Signed-off-by: Schuyler Eldridge <schuyler.eldridge@sifive.com>
2022-01-27Fix faulty MemorySynthInit behavior (#2468)John's Brew
- Fix & test MemorySynthInit behavior with MemoryArrayInitAnnotation and MemoryScalarInitAnnotation. Add test case for MemoryRandomInitAnnotation which is, on the contrary, expected not to leak any randomization statement in synthesis context. - Refactor MemoryInitSpec for improved results readability Context: PR #2166 (commit: 4530152) introduced MemorySynthInit annotation to control whether statement generated with Memory*InitAnnotation (emitted within initial begin block in verilog) should be guarded with ifndef SYNTHESIS or not. Unfortunately only one configuration (MemoryFileInlineAnnotation) has been tested while the others have been generating incorrect verilog statements (MemoryArrayInitAnnotation and MemoryScalarInitAnnotation). Signed-off-by: Jean Bruant <jean.bruant@ovhcloud.com>
2022-01-25emission-options flags swapped (#2472)Andrea Nardi
emission-options flags swapped to match their functionality
2022-01-19preset: make PropagatePreset play nice with verification statements (#2453)Kevin Laeufer
Verification statements are guarded by reset. If this reset happens to be a "preset" type reset, they should always be active. The easiest way to achieve that is to replace all uses of "preset" resets with zero.
2022-01-17[smt] correct comparison for out-of-bounds memory access check (#2463)Kevin Laeufer
This fixes an off by one error, where 3 was erroneously accepted as in-bounds for a memory of depth=3
2022-01-17Bump to 1.6-SNAPSHOT (#2462)Jack Koenig
2022-01-12Update master for 1.5.0 release (#2455)Jack Koenig
* Enable CI for 1.5.x branch * Enable Mergify for 1.5.x branch * Drop 1.2.x from Mergify
2022-01-11Update .mergify.yml (#2454)github-actions[bot]
2022-01-06Add FileInfo to asyncResetAlwaysBlocks (#2451)sinofp
* Add FileInfo to asyncResetAlwaysBlocks Always blocks need three FileInfo (if, true, false) to show line numbers, but initially, every always blocks only have one FileInfo (false). RemoveReset adds the extra two FileInfo to sync always blocks, so sync always blocks can have line numbers. Async always blocks don't provide their only FileInfo, so there are no line numbers. This commit gives async always block the extra FileInfo to show line numbers for them. This code: ```scala import chisel3._ import chisel3.stage._ import firrtl.CustomDefaultRegisterEmission class Test extends Module with RequireAsyncReset { val io = IO(new Bundle { val in = Input(Bool()) val out = Output(Bool()) }) val valid = RegInit(false.B) valid := io.in io.out := valid } object Test extends App { new ChiselStage().execute(Array(), Seq( ChiselGeneratorAnnotation(() => new Test()), CustomDefaultRegisterEmission(useInitAsPreset = false, disableRandomization = true) )) } ``` will generate this Verilog: ```verilog module Test( input clock, input reset, input io_in, output io_out ); reg valid; // @[Playground.scala 10:22] assign io_out = valid; // @[Playground.scala 12:10] always @(posedge clock or posedge reset) begin if (reset) begin // @[Playground.scala 10:22] valid <= 1'h0; // @[Playground.scala 10:22] end else begin valid <= io_in; // @[Playground.scala 11:9] end end endmodule ``` they have correct line numbers (10, 10, 11). * Add test for async always block line numbers * Add comment for review
2021-12-27disable random should not contain useInitAsPreset. (#2449)Jiuyang Liu
2021-12-21Remove some warnings (#2448)Jack Koenig
* Fix unreachable code warning by changing match order Simulation Statements did not previously extend IsDeclaration, but now they do so their match blocks need to be above IsDeclaration. * Handle MemoryNoInit case in RtlilEmitter * Remove use of deprecated logToFile * Fix uses of LegalizeClocksTransform Replaced all uses of LegalizeClocksTransform with LegalizeClocksAndAsyncResetsTransform. * Remove use of CircuitForm in ZeroWidth
2021-12-21smt: deal correctly with negative SInt literals (#2447)Kevin Laeufer
2021-12-18Fix width of signed addition when input to mux (#2440)Jack Koenig
Fix bugs related to arithmetic ops inlined into a mux leg. Add formal equivalence checks to lock in this behavior. Signed-off-by: Schuyler Eldridge <schuyler.eldridge@sifive.com>
2021-12-17smt: correctly serialize array index on read (#2446)Kevin Laeufer
This should fix issue #2436
2021-12-17Deprecate all mutable methods on RenameMap (#2444)Jack Koenig
* Add renamemap.MutableRenameMap which includes these methods without deprecation * Deprecate Stringly typed RenameMap APIs which were accidentally undeprecated a while ago Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
2021-12-17Remove some printlns in tests (#2445)Jack Koenig
Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
2021-12-17Modify and optimize performance of propagate annotations (#2393)Jack Koenig
* Change AnnotationSeq underlying from List to Seq It was nothing but pointless copying. * Make propagateAnnotations faster There was lots of expensive logic for very little benefit.
2021-12-16Update sbt to 1.5.7 (#2443)Scala Steward
2021-12-13Update sbt to 1.5.6 (#2441)Scala Steward
Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
2021-12-13Update os-lib to 0.8.0 (#2442)Scala Steward
Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>