aboutsummaryrefslogtreecommitdiff
path: root/src/test
AgeCommit message (Collapse)Author
2019-02-05Add "mverilog" Compiler Option, Compiler FixesSchuyler Eldridge
This adds "mverilog" to the "--compiler" command line option. This will run the MinimumVerilogCompiler. This additionally fixes the MinimumVerilogCompiler such that DeadCodeElimination will not be run (it's not supposed to be). This is done by adding a MinimumVerilogEmitter, subclassing VerilogVerilog, that strips the DeadCodeElimination step from its parent. Additionally, BlackBoxSourceHelper is removed from the MinimumVerilogCompiler since this will be run by the VerilogEmitter already. Signed-off-by: Schuyler Eldridge <schuyler.eldridge@ibm.com>
2019-02-05Missed constprop opportunity (#1009)Andrew Waterman
* Enhance constant propagation across registers * Add more elaborate test case for register const prop
2019-01-31Use apache commons for string escaping instead of reflection (#1008)Jack Koenig
2019-01-26Use default test_run_dir for more DriverSpec tests. (#1006)Jim Lawson
2019-01-23Improve Shl codegen; eliminate Shlw WIR node (#994)Andrew Waterman
* Improve Shl codegen; eliminate Shlw WIR node If we emit shl(x, k) as {x, k'h0} instead of (x << k), then there's no need for Verilog-specific padding in the PadWidths pass. Avoiding the redundant padding improves compiler/simulator performance and renders Shlw unnecessary. * [skip formal checks] Add test
2019-01-21Merge branch 'master' into top-wiring-aggregatesDavid Biancolin
2019-01-13Constant Propagate dshl and dshr with constant amountsJack Koenig
Fixes #990 h/t @pentin-as and @abejgonzalez
2019-01-13Keep constant propagating expressions until done optimizingJack Koenig
2019-01-08Avoid enforcing time constrains during coverage tests. (#989)Jim Lawson
This fixes issue #988 I tried one alternative to this fix: record the time to do a *no rename* run (`depth = 0`) and check that the time to do the *deep rename* (`depth = 500`) was a reasonable multiple of the *no rename* test. Unfortunately, the discrepancies were all over the map, sometime as much three orders of magnitude difference. I decided the current fix was the simplest - don't enforce timing checks if we're doing coverage testing, although determining the latter is brittle.
2019-01-04Fix GroupComponents to work with unused componentsJack Koenig
Previously, components that did not affect the output would cause exceptions because they were missing from the label2group Map. This commit treats them as "reachable" by the ports so they are included in the default "ungrouped" group.
2019-01-02Make GroupComponents run ResolveKindsJack Koenig
This fixes an issue where expressions created by GroupComponents would be improperly lowered because they were not marked as references to instance ports.
2018-12-25Performance fix of Uniquify for deep bundles (#980)Adam Izraelevitz
2018-12-21Enhance CheckCombLoops to support annotated ExtModule paths (#962)Albert Magyar
2018-12-18Give better error when mport references non-existant memory. (#975)Paul Rigge
* Give better error when mport references non-existent memory * Closes #796
2018-12-13[Top Wiring] Expand top wiring to work on aggregatesDavid Biancolin
2018-12-06Fix bug in dedup where lots of annotations could prevent dedup (#958)Jack Koenig
Iterating on a HashSet could cause identical modules (including annotations) to not dedup
2018-11-29Replace Mappers with Foreachers in several passes (#954)Albert Magyar
2018-11-27Add "none" compiler (#953)Jack Koenig
Where the high form compiler removes Chirrtl (and runs some checks), this compiler does nothing but read in the circuit and then emit it
2018-11-21Change firrtl.options API, add PhaseSchuyler Eldridge
This breaks firrtl.options.Stage into a small type hierarchy: * Phase: something that transforms an AnnotationSeq * Stage extends Phase: a Phase with a Command Line Interface Some of the old "common options" (input annotation file and target directory) are moved into firrtl.options and provided as part of the Stage class. Stage will automatically preprocess an input annotation sequence to resolve all input annotation files and add a default target directory. Minor changes: * Adds ViewException * Stops mixing in the DoNotTerminateOnExit trait into the default Shell parser * Add StageOptionsView Signed-off-by: Schuyler Eldridge <schuyler.eldridge@ibm.com>
2018-11-15Combine cats (#851)Albert Chen
- Add firrtl.transforms.CombineCats - Use CombineCats in LowFirrtlOptimization - Modify Verilog emitter to allow for nested Cat DoPrims - Modify firrtlEquivalenceTest to write input FIRRTL string to test directory
2018-11-07Add FirrtlOptionsSchuyler Eldridge
Signed-off-by: Schuyler Eldridge <schuyler.eldridge@ibm.com>
2018-11-07Add firrtl.options testsSchuyler Eldridge
Signed-off-by: Schuyler Eldridge <schuyler.eldridge@ibm.com>
2018-11-05Better error message for UninferredWidth exceptionSchuyler Eldridge
This changes the CheckTypes.UniferredWidth exception to include the pretty printed Target that was uninferred and suggests to the user that they may have forgotten to assign to it. This changes the CheckTypes pass to communicate the necessary Target information during AST traversal such that when an uninferred width is found, the Target is known and available. This also adds one test checking the message of the UniferredWidth exception. Signed-off-by: Schuyler Eldridge <schuyler.eldridge@ibm.com>
2018-11-05Add prettyPrint method to TargetSchuyler Eldridge
This adds a pretty printer for firrtl.annotation.Target and associated tests. This uses a tree-like output where the following target ~Circuit|Module/foo:Foo>ref.field[0] will serialize to: circuit Circuit: └── module Module: └── foo of Foo: └── ref.field[0] This enables better error messages and a human readable syntax better than the existing serialize method (and avoiding the need for users to understand the Target serialization syntax), but that is not intended to be deserialized nor space efficient. Signed-off-by: Schuyler Eldridge <schuyler.eldridge@ibm.com>
2018-11-02Fix renaming in UniquifyPorts (#930)Albert Chen
2018-10-31Remove all uses of get_flip and deprecateJack Koenig
It is O(n) and every use is in an O(n) iteration resulting in O(n^2). Same information can be extracted from create_exps which happens to also be called at every use of get_flip.
2018-10-31Don't include verilog header files in "FileList" for VCS/Verilator. (#918)Jim Lawson
When constructing the black box helper file list (firrtl_black_box_resource_files.f), filter out Verilog header files (*.vh) - Fixes #917
2018-10-30Instance Annotations (#926)Adam Izraelevitz
Formerly #865 Major Code Changes/Features Added: Added Target trait as replacement for Named Added TargetToken as token in building Target Added GenericTarget as a catch-all Target Added CircuitTarget, ModuleTarget, ReferenceTarget, and InstanceTarget Added ResolvePaths annotation Added EliminateTargetPaths (and helper class DuplicationHelper) Updated Dedup to work with instance annotations Updated RenameMap to work with instance annotations DCE & ConstantProp extend ResolveAnnotationPaths
2018-10-27Revert "Instance Annotations (#865)" (#925)Adam Izraelevitz
This reverts commit 7e2f787e125227dc389d5cf1d09717748ecfed2e.
2018-10-24Instance Annotations (#865)Adam Izraelevitz
Added Target, which now supports Instance Annotations. See #865 for details.
2018-10-24Better error message on missing BlackBox resourceSchuyler Eldridge
This wraps interactions with a BlackBox resource file such that a FileNotFoundException are wrapped in a BlackBoxNotFoundException and rethrown. This provides a better, verbose error message to the user and avoids a FileNotFoundException showing up as an internal FIRRTL error. This adds tests that the expected exception is thrown for both BlackBoxResourceAnno and BlackBoxResourceAnno. Signed-off-by: Schuyler Eldridge <schuyler.eldridge@ibm.com>
2018-10-12Refactor VerilogRename -> RemoveKeywordCollisionsSchuyler Eldridge
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: Schuyler Eldridge <schuyler.eldridge@ibm.com>
2018-10-12Verilog renaming uses "_", works on whole ASTSchuyler Eldridge
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: Schuyler Eldridge <schuyler.eldridge@ibm.com>
2018-10-03Inlining uses "_", respects namespacesSchuyler Eldridge
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: Schuyler Eldridge <schuyler.eldridge@ibm.com>
2018-10-01add BlackBoxPathAnno (#903)albertchen-sifive
2018-09-27Add Utils.expandPrefixes as Prefix Unique helper (#900)Schuyler Eldridge
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: Schuyler Eldridge <schuyler.eldridge@ibm.com>
2018-09-26Enforce port uniqueness in Chirrtl/High ChecksSchuyler Eldridge
Signed-off-by: Schuyler Eldridge <schuyler.eldridge@ibm.com>
2018-09-26Another TopWiring Bug Fix (Multi-Level Annotations) (#889)alonamid
When different levels of the circuit were annotated, the TopWiring signals of the lower levels would "run-over" the TopWiring signals of the higher levels
2018-09-13Do not remove ExtMods with no ports by default (#888)albertchen-sifive
2018-09-07Bug Fixes in TopWiring (#885)alonamid
* bug fixes in TopWiring
2018-08-30Emit Verilog Comments (#874)albertchen-sifive
add description nodes, transform; modify VerilogEmitter to emit comments
2018-08-23Fix NoDedupMem to be cognizant of Module scope (#876)Jack Koenig
Previously, mems marked no dedup would prevent mems with the same instance name in other modules from deduping
2018-08-14Add targetDirName test (#869)Leway Colin
2018-08-08Use LinkedHashSet in propagateAnnotations (#855)albertchen-sifive
Fixes #780
2018-08-07Make RemoveWires properly include registers in dependency graphJack Koenig
Fixes a bug where registers could be instantiated after nodes that referred to them Also add WRef.apply utility for nodes
2018-07-26Support for load memory annotations in chisel (#833)Chick Markley
* 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
2018-07-20Constant prop add (#849)albertchen-sifive
* 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
2018-07-11Make InstanceGraph have deterministic and use defined iteration order (#843)Jack Koenig
2018-07-10Fix bug in zero-width renaming (#845)Jack Koenig
Previously, Vecs of Bundles that contained a zero-width element would result in a ClassCastException
2018-07-10Combinational Dependency Annotation (#809)Adam Izraelevitz