1. Sep 13, 2022
    • Jack Koenig's avatar
      Make the Parser handle errors more gracefully (#2549) · 6cf4a175
      Jack Koenig authored
      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.
      6cf4a175
    • Jack Koenig's avatar
      50a1230d
  2. Aug 26, 2022
    • Zachary Yedidia's avatar
      FIRRTL version support (#2543) · 19fe90bb
      Zachary Yedidia authored
      * 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
      19fe90bb
  3. Aug 05, 2022
  4. Aug 04, 2022
  5. May 28, 2022
  6. Apr 26, 2022
  7. Apr 22, 2022
  8. Apr 20, 2022
  9. Apr 12, 2022
  10. Apr 08, 2022
    • Chick Markley's avatar
      Make MemConf's MemPort serialization deterministic (#2508) · f7b4aa8a
      Chick Markley authored
      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.
      f7b4aa8a
  11. Apr 06, 2022
  12. Mar 26, 2022
    • Fabian Schuiki's avatar
      Fix anno deserialization when class field is not first (#2501) · a2d48a58
      Fabian Schuiki authored
      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.
      a2d48a58
  13. Mar 15, 2022
  14. Mar 05, 2022
  15. Mar 03, 2022
  16. Mar 02, 2022
  17. Jan 27, 2022
    • John's Brew's avatar
      Fix faulty MemorySynthInit behavior (#2468) · 475c165c
      John's Brew authored
      
      
      - 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: default avatarJean Bruant <jean.bruant@ovhcloud.com>
      475c165c
  18. Jan 26, 2022
  19. Jan 20, 2022
  20. Jan 18, 2022
  21. Jan 13, 2022
  22. Jan 12, 2022
  23. Jan 06, 2022
    • sinofp's avatar
      Add FileInfo to asyncResetAlwaysBlocks (#2451) · 3e494b5c
      sinofp authored
      * 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
      3e494b5c
  24. Dec 28, 2021