1. Oct 13, 2018
    • Schuyler Eldridge's avatar
      Merge pull request #909 from seldridge/issue-729.2 · 7e1dcb7c
      Schuyler Eldridge authored
      Verilog renaming uses "_", works on whole AST
      7e1dcb7c
    • Schuyler Eldridge's avatar
      Refactor VerilogRename -> RemoveKeywordCollisions · d426eb76
      Schuyler Eldridge authored
      
      
      This moves VerilogRename out of Passes.scala and genericizes it as the new
      Transform KemoveKeywordCollisions. This new Transform will remove keywords
      for arbitrary sets of reserved keyword.
      
      This adds VerilogRename back as a class instead of an object.
      
      Signed-off-by: default avatarSchuyler Eldridge <schuyler.eldridge@ibm.com>
      d426eb76
    • Schuyler Eldridge's avatar
      Verilog renaming uses "_", works on whole AST · 95d907bd
      Schuyler Eldridge authored
      
      
      Summary of changes to firrtl.passes.VerilogRename:
        - Use "_" to mangle names that conflict with Verilog
          keywords (previously "$")
        - Rewrite to operate on the whole AST to propogate mangled ports and
          module names
        - Make VerilogRename a Transform (was previously a Pass)
        - Renames are now propagated
        - Adds documentation for new VerilogRename
      
      This makes the VerilogRename Transform (previously a Pass) use an
      underscore ('_') instead of a dollar sign ('$') to mangle names that
      conflict with Verilog keywords. This prevents problems with potentially
      buggy tools that are not expecting '$' in Verilog names.
      
      This reimplements VerilogRename to be safe for name collisions that may
      occur anywhere in the AST, e.g., in ports, module names, circuit names, or
      in any statements/expressions. Previously, names were only mangled in
      statements and in place. This resulted in problems where renames of ports
      in a child's namespace would not be guaranteed to be mangled the same way
      in a parent's namespace. The algorithm is reimplemented to walk all
      modules in reverse topological order (from leafs to main) and relying on a
      RenameMap to track name changes.
      
      Signed-off-by: default avatarSchuyler Eldridge <schuyler.eldridge@ibm.com>
      95d907bd
  2. Oct 05, 2018
  3. Oct 04, 2018
    • Schuyler Eldridge's avatar
      Inlining uses "_", respects namespaces · ff8bd4ec
      Schuyler Eldridge authored
      
      
      Summary of changes:
        - Use "_" as an inlining delimiter instead of "$"
        - Makes inlining avoid namespace conflicts
      
      This changes the delimiter used for inlining to "_" instead of "$". This
      avoids problems with buggy parsers that may not handle "$" correctly. As
      ClockListTransform relies on the explicit use of "$", the delimiter is a
      FIRRTL-private val that the ClockListTransform overrides (to the original
      "$").
      
      Namespace conflicts could occur previously, but are very rare as users
      will almost never use "$" in a name (even though it's allowed by both the
      FIRRTL and Verilog specifications). Moving to "_" increases the
      probability of namespace conflicts occurring. This adds explicit checking
      that inlined names will not introduce namespace conflicts and that
      generated names are prefix unique (as defined in the spec).
      
      Note: inlined modules may not have unique prefixes. A test is included
      that this is the case and an ignored test shows what prefix uniqueness
      would look like.
      
      MISC:
        - [skip chisel tests]: Changing the delimiter causes the Chisel
          InlineSpec to fail as this explicitly checks for "$".
      
      Signed-off-by: default avatarSchuyler Eldridge <schuyler.eldridge@ibm.com>
      ff8bd4ec
    • Schuyler Eldridge's avatar
      Make some Uniquify methods private [firrtl] · 5fdd0b5a
      Schuyler Eldridge authored
      
      
      This makes findValidPrefix and enumerateNames both private to
      FIRRTL (previously, these were private). This enables their use for name
      generation by other FIRRTL passes/transforms.
      
      Signed-off-by: default avatarSchuyler Eldridge <schuyler.eldridge@ibm.com>
      5fdd0b5a
    • Schuyler Eldridge's avatar
      Add cloneUnderlying method to Namespace · e98f8efc
      Schuyler Eldridge authored
      
      
      This adds a method, cloneUnderlying, to Namespace that returns a copy of
      the underlying mutable.HashSet. This is useful for constructing a
      Namespace that you would like to manipulate manually without using
      Namespace's methods to generate temporaries.
      
      Signed-off-by: default avatarSchuyler Eldridge <schuyler.eldridge@ibm.com>
      e98f8efc
  4. Oct 02, 2018
  5. Sep 28, 2018
    • Ben Marshall's avatar
      Number all code examples & add specification build to Makefile (#894) · 29e5c088
      Ben Marshall authored
      * Merge makefile changes from dev/specification-fixes
      
      - New top level makefile target: `specification`
        - Builds the specification document.
      
      * Number all code examples.
      
      This is more a change of convenience than anything. Referring to syntax
      examples is much easier when they are numbered!
      
      This commit is in the context of freechipsproject/firrtl#890 - Updating
      examples and syntax specification is made easier if they are numbered.
      
      - Change `verbatim` environments to `lstlisting`
      - Add very basic keyword highlighting.
      - Rebuild specification PDF.
      
       On branch dev/number-code-examples
       Changes to be committed:
      	modified:   spec/spec.pdf
      	modified:   spec/spec.tex
      29e5c088
    • Schuyler Eldridge's avatar
      Add Utils.expandPrefixes as Prefix Unique helper (#900) · 953deb5d
      Schuyler Eldridge authored
      
      
      This adds a utility, expandPrefixes, that expands a string into all
      possible prefixes based on a delimiter. Any repeated occurrence of the
      delimiter is viewed as a contributing to a prefix. E.g., "foo_bar" expands
      to Seq("foo_", "foo_bar"). This is useful for inlining and keyword
      mangling on LowForm. You would like to be able to generate a new name that
      is prefix unique with respect to a namespace.
      
      Signed-off-by: default avatarSchuyler Eldridge <schuyler.eldridge@ibm.com>
      953deb5d
  6. Sep 27, 2018
  7. Sep 22, 2018
  8. Sep 14, 2018
  9. Sep 08, 2018
  10. Aug 31, 2018
  11. Aug 30, 2018
  12. Aug 29, 2018
    • Jim Lawson's avatar
      Filter resource file names to avoid including the same file multiple times. (#883) · 6a9710a8
      Jim Lawson authored
      * Filter resource file names to avoid including the same file multiple times.
      Addresses issue #882.
      
      * Use a Set instead of a Map to filter Verilog files.
      
      * Use canonical paths for file name comparison and unify name generation.
      Provide a common method for copying resources to a directory to ensure the same resource ends up with the same name if it's copied by multiple clients.
      
      * Reduce confusion - another absolute -> canonical switch.
      Use the canonical path on the verilator command line for the filter additional Verilog sources.
      6a9710a8
  13. Aug 25, 2018
  14. Aug 24, 2018
  15. Aug 22, 2018
  16. Aug 18, 2018
  17. Aug 15, 2018
  18. Aug 11, 2018
  19. Aug 09, 2018
  20. Aug 08, 2018
  21. Aug 04, 2018
  22. Jul 27, 2018
    • Chick Markley's avatar
      Support for load memory annotations in chisel (#833) · 1dcf9907
      Chick Markley authored
      * Support for load memory annotations in chisel
      This PR
       * Delays the BlackBoxSourceHelper transformation to the Emitter stage of the VerilogCompiler
         * remove from VerilogCompiler
         * move to VerilogEmitter
       * Changes the verilog emitter to allow programmatic access to the verilog module declaration
         * Creating a bindable module requires headers to match
       * Provides a unit test that shows how to generate a bindable module.
      
      * Binding support
      Treadle needed LoadMemoryAnnotation to be in firrtl instead of chisel in order to recognize the annotations and use them for memory loading
      
      * Binding support
      - Fixed bug that handled suffixes on memory initializing files
      
      * Binding support
      - Add a bit more doc to the API provided by the VerilogRenderer
      1dcf9907
  23. Jul 21, 2018
    • albertchen-sifive's avatar
      Constant prop add (#849) · 7dff9278
      albertchen-sifive authored
      * add FoldADD to const prop, add yosys miter tests
      
      * add option for verilog compiler without optimizations
      
      * rename FoldLogicalOp to FoldCommutativeOp
      
      * add GetNamespace and RenameModules, GetNamespace stores namespace as a ModuleNamespaceAnnotation
      
      * add constant propagation for Tail DoPrims
      
      * add scaladocs for MinimumLowFirrtlOptimization and yosysExpectFalure/Success, add constant propagation for Head DoPrim
      
      * add legalize pass to MinimumLowFirrtlOptimizations, use constPropBitExtract in legalize pass
      7dff9278
  24. Jul 12, 2018