aboutsummaryrefslogtreecommitdiff
path: root/src/test/scala/firrtl
AgeCommit message (Collapse)Author
2022-12-150-bit literals (#2544)Kevin Laeufer
* allow for zero-width integer literals * CheckWidths: ensure that width is non-negative
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-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
2021-12-21smt: deal correctly with negative SInt literals (#2447)Kevin Laeufer
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-11-30[deprecation clean up] remove trait firrtl.util.BackendCompilationUtilities ↵Jiuyang Liu
(#2423) Co-authored-by: Jack Koenig <koenig@sifive.com>
2021-11-10smt: fix handling of div primitive in formal backend (#2409)Kevin Laeufer
We never tested the case where the width of the numerator was less than the denominator. This should fix any issue with this combination.
2021-09-29Add RTLIL Backend. (#2331)Nicolas Machado
* Added RTLIL Backend. * Add test for Rtlil Backend, fix per-module file emission, scalafmt, and apply bugfixes for inconsistencies found during testing. * Fix build on scala 2.13 * Add additional equivalence test, make some bugfixes and perf opts to the emitter. * Final changes as requested by Kevin, code cleanup, add support for formal cells.
2021-09-08smt: refactor SMT expression library (#2347)Kevin Laeufer
2021-08-30[smt] treat stop with non-zero ret like an assertion (#2338)Kevin Laeufer
We treat it as an assertion that the stop will never be enabled. stop(0) will still be ignored (but now demoted to a info from a warning).
2021-08-10[smt] make SMTLib + Btor2 emitters public objects (#2326)Kevin Laeufer
This will make it easier for formal verification libraries to make use of these emitters.
2021-08-10[smt] PropagatePresetAnnotations is now a real prereq (#2325)Kevin Laeufer
2021-08-02add emitter for optimized low firrtl (#2304)Kevin Laeufer
* rearrange passes to enable optimized firrtl emission * Support ConstProp on padded arguments to comparisons with literals * Move shr legalization logic into ConstProp Continue calling ConstProp of shr in Legalize. Co-authored-by: Jack Koenig <koenig@sifive.com> Co-authored-by: Jack Koenig <koenig@sifive.com>
2021-07-27ir: make HashCode.toHashString public (#2302)Kevin Laeufer
This will allow chiseltest to save the hash code to disk for the purpose of caching simulation binaries.
2021-07-07Replace hard coded line separators with system specific ones (#2281)Boyang Han
2021-06-17smt: include firrtl statement names in SMT and btor2 output (#2270)Kevin Laeufer
* smt: include firrtl statement names in SMT and btor2 output * smt: remove println * smt: make tests run again and fix stale ones Apparently `private` classes aren't found by th sbt test runner.
2021-06-17Add --start-from option (#2273)Schuyler Eldridge
Add a new option to the FIRRTL compiler, "--start-from = <form>". If used, this will cause the compiler to assume that the input FIRRTL circuit is already in the specific form. It will then skip unnecessary passes given this information. E.g., if a user requests to run "firrtl -X verilog --start-from low" then the compiler will only run transforms necessary to get from low FIRRTL to Verilog. Transforms necessary for ingesting FIRRTL IR will be run if needed (checks and type/kind/flow resolution). To implement this, a CurrentFirrtlStateAnnotation is added. Advanced users can use this directly to tell the FIRRTL compiler exactly what transforms have already been run, including the ability to ignore checks or type/kind/flow resolution if they so desire. Signed-off-by: Schuyler Eldridge <schuyler.eldridge@sifive.com>
2021-05-17Use os-lib to rewrite Z3ModelChecker (#2223)Jiuyang Liu
* add os-lib to dependency. * use os-lib in Z3ModelChecker * fix for review by Kevin.
2021-03-19Legalize neg: -x becomes 0 - x (#2128)Jack Koenig
This fixes an error with negating a negative SInt literal and a [debatable] lint warning in Verilator when negating any value. This behavior matches that of Chisel (which directly emits the 0 - x already).
2021-03-18Ensure InlineCasts does not inline complex Expressions (#2130)Jack Koenig
Previously, InlineCasts could inline complex (ie. non-cast) Expressions into other complex Expressions. Now it will only inline so long as there no more than 1 complex Expression in the current nested Expression. Co-authored-by: Albert Magyar <albert.magyar@gmail.com>
2021-03-09SMT Backend: model Invalid and Division by Zero with DefRandom nodes (#2104)Kevin Laeufer
This finally removes all randomization code from the transition system conversion and into a separate pass using DefRandom nodes.
2021-03-08SMT: memory port inout fields cannot be used as RHS expressions (#2105)Kevin Laeufer
* SMT: memory port inout fields cannot be used as RHS expressions * smt: add end2end check for read enable modelling
2021-03-04SMT Backend: move undefined memory behavior modelling to firrtl IR level (#2095)Kevin Laeufer
With this PR the smt backend now supports memories with more than two write ports and the conservative memory modelling can be selectively turned off with a new annotation.
2021-03-02Remove Scala 2.11 (#2062)Jack Koenig
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
2021-01-28Stop padding multiply and divide ops (#2058)Jack Koenig
Fixes bug with mul or div followed by cat. Also fixes some Verilog lint issues.
2021-01-19Restore scalafmt CI check (#2047)Jack Koenig
Fix scalafmtCheckAll failures that snuck through
2021-01-19smt: run DeadCodeElimination after PropagatePresetAnnotations (#2036)Kevin Laeufer
2020-12-15Improve performance of LowerTypes renaming (#2024)Jack Koenig
This is done by having LowerTypes uses two RenameMaps instead of one for each module. There is one for renaming instance paths, and one for renaming everything within modules. Also add some utilities: * TargetUtils for dealing with InstanceTargets * RenameMap.fromInstanceRenames
2020-12-02smt: add support for uninterpreted ext modules (#1994)Kevin Laeufer
Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
2020-11-11smt: add support for write-first memories (#1948)Kevin Laeufer
2020-11-10Fix SMT Memory Bug (#1942)Kevin Laeufer
* smt: add test for write port collision * smt: add missing call to insertDummyAssignsForMemoryOutputs * smt: fix typo in write port code Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
2020-11-09smt: ensure that all signals have a unique name (#1943)Kevin Laeufer
* smt: add tests for assert name clashes * smt: ensure unique signal names with a namespace this fixes issues #1934
2020-09-16Change to Apache 2.0 License (#1901)Chick Markley
2020-08-28Add custom transforms 'upstream' of emitter annotation in equiv testsAlbert Magyar
2020-08-28Deprecate CompilerAnnotation (#1870)Schuyler Eldridge
* CompilerAnnotation$ emits RunFirrtlTransform Change the CompilerAnnotation object to emit RunFirrtlTransformAnnotations containing the associated emitter. This requires a fix in the Driver compatibility layer to know how to enable one-file-per module emission if either a CompilerAnnotation or a RunFirrtlTransformAnnotation(_: Emitter) is present. Signed-off-by: Schuyler Eldridge <schuyler.eldridge@ibm.com> * Add ConvertCompilerAnnotation phase Add a phase, ConvertCompilerAnnotation, that converts a CompilerAnnotation to a RunFirrtlTransformAnnotation. This provides a warning to the user if this path is taken. Signed-off-by: Schuyler Eldridge <schuyler.eldridge@ibm.com> * Add test of ConvertCompilerAnnotation Signed-off-by: Schuyler Eldridge <schuyler.eldridge@ibm.com> * Deprecate CompilerAnnotation$, move helper methods Deprecate the CompilerAnnotation companion object and move it's private utility inside the RunFirrtlTransformAnnotation companion object. Signed-off-by: Schuyler Eldridge <schuyler.eldridge@ibm.com> * Make ConvertCompilerAnnotations private[firrtl] Make this phase private to avoid adding a deprecation warning. Also, remove an unused string value. Signed-off-by: Schuyler Eldridge <schuyler.eldridge@ibm.com> * Fix incorrect string in test Signed-off-by: Schuyler Eldridge <schuyler.eldridge@ibm.com> * Add test that '-X verilog', no emitter yields file Signed-off-by: Schuyler Eldridge <schuyler.eldridge@ibm.com>
2020-08-26smt: ignore clock signals when converting to transition system (#1866)Kevin Laeufer
If there is more than one clock, this will be detected and the user will be promted to run the StutteringClock transform.
2020-08-14All of src/ formatted with scalafmtchick
2020-08-15experimental SMTLib and btor2 emitter (#1826)Kevin Laeufer
This adds an experimental new SMTLib and Btor2 emitter that converts a firrtl module into a format suitable for open source model checkers. The format generally follows the behavior of yosys' write_smt2 and write_btor commands. To generate btor2 for the module in m.fir run > ./utils/bin/firrtl -i m.fir -E experimental-btor2 for SMT: > ./utils/bin/firrtl -i m.fir -E experimental-smt2 If you have a design with multiple clocks or an asynchronous reset, try out the new StutteringClockTransform. You can designate any input of type Clock to be your global simulation clock using the new GlobalClockAnnotation. If your toplevel module instantiates submodules, you need to inline them if you want the submodule logic to be included in the formal model.
2020-08-14tests: Decrease Dependency on Deprecated APIs (#1839)Kevin Laeufer
* test: add LeanTransformSpec to replace the old SimpleTransformSpec SimpleTransformSpec isn't simple anymore! * AnnotationTests: remove deprecated Compiler code * LeanTransformSpec: implicitly add right EmitCircuitAnnotation * AsyncResetSpec: move to new lean spec * CheckCombLoopsSpec: remove deprecated Compiler code * ChirrtlMemSpec: remove deprecated compiler code * CompilerTest: remove use of deprecated Compiler API
2020-08-12Combined Uniquify and LowerTypes pass (#1784)Kevin Laeufer
* Utils: add to_dir helper function * firrt.SymbolTable trait for scanning declarations * ir: RefLikeExpression trait to represent SubField, SubIndex, SubAccess and Reference nodes * add new implementation of the LowerTypes pass * replace LowerTypes with NewLowerTypes * remove dependencies on Uniquify * GroupComponentSpec: GroupComponents is run before lower types * NewLowerTypes: address Adam's suggestions * LoweringCompilerSpec: Uniquify was removed and NewLowerTypes * LowerTypesSpec: add newline at the end of file * LowerTypesSpec: port Uniquify tests to combined pass * NewLowerTypes: ensure that internal methods are not visible * NewLowerTypes: extend DependencyAPIMigration * NewLowerTypes: lower ports without looking at the body * LowerTypesSpec: use TransformManager instead of hard coded passes. * NewLowerTypes: names are already assumed to be part of the namespace * LowerTypesSpec: test name clashes between ports and nodes, inst, mem * NewLowerTypes: correctly rename nodes, mems and instances that clash with port names * NewLowerTypes: Iterable[String] instead of Seq[String] for 2.13 * NewLowerTypes: add a fast path for ground types without renaming * LowerTypesSpec: remove trailing commans for 2.11 * LowerTypesSpec: explain why there are two * Uniquify: use loweredName from NewLowerType * replace old LowerTypes pass with NewLowerTypes pass * Uniquify: deprecate pass usage There are some functions that are still used by other passes. * LowerTypes: InstanceKeyGraph now has a private constructor * LowerTypes: remove remaining references to NewLowerTypes * LoweringCompilerSpec: fix transform order to LowerTypes * SymbolTable: add improvements from PR * LoweringCompilerSpec: ignore failing CustomTransform tests
2020-08-11File Serialization of Annotations (#1277)Schuyler Eldridge
* Transform, not run in LegalizeAndReduction test Switch from using FirrtlStage.transform to FirrtlStage.run in one test. The latter is problematic as it doesn't include wrappers or pre/post phases which are how things will work in the future for doing file writing (via HowToSerialize ideas). Signed-off-by: Schuyler Eldridge <schuyler.eldridge@ibm.com> * Use execute in FIRRTL testing infra (not run) Changes the FirrtlStage method in FIRRTL testing infrastructure from "run" (which does not include Stage-global Phases) to "execute" (which does). Signed-off-by: Schuyler Eldridge <schuyler.eldridge@ibm.com> * Add HowToSerialize Annotation mix-in This adds an Annotation mix-in, HowToSerialize, that allows an annotation to declare how it should be serialized to a file. The mix-in is abstract in a baseFileName and a suffix (used to generate a filename), a howToSerialize method (defining the string contents of the file), and a howToResume method (that defines a replacement for the file-serialized annotation that allows this to be resumed) [^1]. A default implementation for generating a filename (called filename) is defined that will put the baseFileName+suffix file in the target directory. This can be overridden by the annotation if desired. [^1]: When an annotation is serialized to a file, it should be removed from the emitted JSON-serialized annotations. The howToResume method defines a way of adding replacement annotations to the JSON-serialized annotations that tell a downstream tool how to find the serialized file. E.g., if a FIRRTL circuit is written to a file, this could be used to add a FirrtlFileAnnotation defining the location of the new file. Signed-off-by: Schuyler Eldridge <schuyler.eldridge@ibm.com> * Handle HowToSerialize in WriteOutputAnnotations This extends firrtl.options.phase.WriteOutputAnnotations to serialize HowToSerialize annotations to files. Signed-off-by: Schuyler Eldridge <schuyler.eldridge@ibm.com> * Test HowToSerialize in WriteOutputAnnotationsSpec This adds tests of the HowToSerialize mix-in inside the WriteOutputAnnotationsSpec. Signed-off-by: Schuyler Eldridge <schuyler.eldridge@ibm.com> * [skip chisel tests] Migrate to HowToSerialize This migrates EmittedAnnotations (and its children) to mixin the HowToSerialize trait. This enables this annotations to be automatically written to files via WriteOutputAnnotations Signed-off-by: Schuyler Eldridge <schuyler.eldridge@ibm.com> * Deprecated firrtl.stage.phases.WriteEmitted Signed-off-by: Schuyler Eldridge <schuyler.eldridge@ibm.com> * Use streams in HowToSerialize This converts the HowToSerialize trait to use a Stream[Char] when defining how an annotation should be serialized. Signed-off-by: Schuyler Eldridge <schuyler.eldridge@ibm.com> * Switch from Stream[Char] to Stream[Byte] Signed-off-by: Schuyler Eldridge <schuyler.eldridge@ibm.com> * Change howToSerialize method to Iterable Change the type of the HowToSerialize.howToSerialize method from a stream to an iterable. Using the latter (the superset of both lazy streams and non-lazy things like String) avoids problems with users having to choose laziness when they already have an eager object. In effect, this makes the API more general. Signed-off-by: Schuyler Eldridge <schuyler.eldridge@ibm.com> * Add Scaladoc to HowToSerialize trait Signed-off-by: Schuyler Eldridge <schuyler.eldridge@ibm.com> * Change HowToSerialize to CustomFileEmission Signed-off-by: Schuyler Eldridge <schuyler.eldridge@ibm.com> * Add default implementation of replacements Add a default implementation of CustomFileEmission.replacements. Signed-off-by: Schuyler Eldridge <schuyler.eldridge@ibm.com> * Avoid unnecessary 2x monad in CustomFileEmission Change the type of CustomFileEmission.replacements from Option[AnnotationSeq] to AnnotationSeq. The latter has all the properties of the former that I'm trying to express here: (1) can emptiness and (2) monadicity (if the AnnotationSeq is converted to a sequence first). The latter property is exploited in the WriteOutputAnnotations phase to concisely flatMap over the annotations and doing the double-monad is unnecessary. Signed-off-by: Schuyler Eldridge <schuyler.eldridge@ibm.com> * Restrict CustomFileEmission filename API Change the API of CustomFileEmission to use a final def for the actual filename. The baseFileName is then made a method with an AnnotationSeq parameter to allow the filename to change as a function of other annotations, e.g., by an output circuit annotation. By restricting this API, we have more control over the default behavior of where things are written using the fixed behavior of the filename method---files will always be written using the behavior that StageOptions define. Previously, if users want customized behavior, they would need to duplicate this StageOptions functionality (and likely subtly deviate from the standard behavior and introduce problems with their build). Signed-off-by: Schuyler Eldridge <schuyler.eldridge@ibm.com> * Add file conflict behavior for CustomFileEmission Set behavior of file conflicts in CustomFileEmission to be the following: No two annotations in the same annotation sequence can serialize to the same file during the WriteOutputAnnotations phase. However, if the output annotation file already exists, it will be overwritten. Signed-off-by: Schuyler Eldridge <schuyler.eldridge@ibm.com> * Return relative path from getBuildFileName Change FirrtlOptions.getBuildFileName to simply serialize the underlying Java File instead of converting this to its canonical path. This should improve the relocatability of files produced by the CustomFileEmission API. Signed-off-by: Schuyler Eldridge <schuyler.eldridge@ibm.com> * Normalize paths in StageOptions.getBuildFile Normalize paths inside the getBuildFileName utility of StageOptions. Add a check to prevent a null pointer dereference. Co-authored-by: Jack Koenig <koenig@sifive.com> Co-authored-by: Schuyler Eldridge <schuyler.eldridge@ibm.com> Signed-off-by: Schuyler Eldridge <schuyler.eldridge@ibm.com> * Refer to CustomFIleEmission in deprecation message Co-authored-by: Jack Koenig <koenig@sifive.com> Signed-off-by: Schuyler Eldridge <schuyler.eldridge@ibm.com> * Simplify CustomFileEmission toBytes implementation Co-authored-by: Jack Koenig <koenig@sifive.com> Co-authored-by: Schuyler Eldridge <schuyler.eldridge@ibm.com> Signed-off-by: Schuyler Eldridge <schuyler.eldridge@ibm.com> * Use toBytes, not getBytes, in CustomFileEmission Signed-off-by: Schuyler Eldridge <schuyler.eldridge@ibm.com> Co-authored-by: Jack Koenig <koenig@sifive.com>
2020-07-08dedup: use structural sha256 hash instead of agnostify and serialize (#1731)Kevin Laeufer
* benchmark: add hot.DedupBenchmark * dedup: use structural md5 hash instead of agnostify and serialize * StructuralHash: generate PrimOp LUT * StructuralHash: change MessageDigestHasher to not be a case class * StructuralHash: we want Blocks and EmptyStmt to be ignored * StructuralHash: use SHA-256 instead of MD5 * StructuralHash: clarify extmodule port name agnistification * StructuralHash: hash the name of width vars instead of trying to agnostify This should be in line with the old Dedup behavior. The prior use of n(..) was incorrect since the namespace of these vars is different from the normal module scope namespace. * StructuralHash: address Schuyler's review comments Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
2020-06-22Convert PreservesAll to explicit invalidates=falseSchuyler Eldridge
Signed-off-by: Schuyler Eldridge <schuyler.eldridge@ibm.com>
2020-05-28Implement InstanceTarget Behavior for Dedup + EliminateTargetPaths (#1539)Albert Chen
- RenameMap Behavior -- Prevent transitive renaming A -> B -> C (continueRenaming) -- Prevent transitive renaming for self-renames - Target -- Override toString as serialize for CompleteTarget -- Expansion of stripHierarchy to enable stripping InstanceTargets to become ModuleTargets Annotations -- Bugfix in extractComponents where Products were not iterated over -- Converts renamed targets to local targets using Target.referringModule to preserve sticky behavior - Eliminate Target Paths -- Make DuplicationHelper use LinkedHashMap, as we iterate over its contents and convert to Seq in def makePathless -- Add DupedResult to map original module to new module targets -- Update renaming to record a map from all relative instance paths to original module, to new module target -- Consumes DedupedResult to give better name to new duplicated module if it was originally deduplicated -- Reorder modules in attempt to preserve original ordering, pre-deduplication -- Move utility functions to object -- Bugfix: add self-renames to prevent ofModule _ of target _ cannot be renamed to Vector(_, _, _, ...) errors - Dedup -- Changed NoDedupAnnotation to contain ModuleTarget, rather than ModuleName -- Added DedupedResult to map original module to the duplicate module -- Consumes DupedResult to pick better name, if it existed -- Updates renaming to chain the following: instancify deduped modules, remap differently named internal signals, then remap AST modules -- Move utility functions to object -- Remove annotations as part of determination of dedup correctness -- Bugfix: add instance renames so that deduped modules have their instances properly renamed - Dead Code Elimination -- Add deletion of ASTModules - Tests -- Morphism Spec to ensure Dedup -> EliminateTargetPaths and EliminateTargetPaths -> Dedup patterns work properly -- Update existing tests to make sure they work properly -- Add Dedup tests to demonstrate instance renaming bug, EliminateTargetPaths for ofModule rename bug, and update RenameMap tests Co-authored-by: Schuyler Eldridge <schuyler.eldridge@ibm.com> Co-authored-by: Adam Izraelevitz <adam.izraelevitz@sifive.com> Co-authored-by: Adam Izraelevitz <azidar@gmail.com> Co-authored-by: Jack Koenig <koenig@sifive.com>
2020-05-26[API change] Absorb repetitive WIR nodes into IRAlbert Magyar
* Absorb WRef into Reference * Absorb WSubField into SubField * Absorb WSubIndex into SubIndex * Absorb WSubAccess into SubAccess * Absorb WDefInstance into DefInstance ------------------------- API CHANGE SEVERITY -------------------------- This is projected to not break source-level compatibility with any known user code. However, it will break *binary* compatibility with all existing user FIRRTL passes, as is generally allowed with major releases of FIRRTL. --------------------------- DESCRIPTION -------------------------------- Previously, there were several nodes in WIR.scala that had a one-to-one correspondance with existing nodes in the standard firrtl.ir hierarchy. These nodes would have a case class resembling the corresponding standard IR node, but with the addition of one or more "analysis" fields. Since these fields (such as kind) represent helpful info that can be invalidated or set to Unknown (e.g. UnknownKind for Kind), it does not cause any issues to simply include these fields on any in-memory representation of FIRRTL IR. Although other systems for tracking FIRRTL analyses have evolved over time, the ubiquity of pattern-matching on these fields has lead most core and custom transforms to be written against WIR, rather than IR. This PR unifies the IRs by adding the fields that would be in an "augmented" WIR node directly into the corresponding IR node; i.e., the "type" and "kind" fields from WRef are added directly to the definition of the Reference case class, while these "repetitive" WIR case classes are removed entirely. -------------------- SOURCE-COMPATIBILITY ADAPTERS --------------------- Several object methods are added to WIR.scala to maintain source-compatiblity for passes that used WIR. These objects define factory methods and unapply methods, so passes that relied on implicit case class factories or pattern matching for the removed WIR types will remain perfectly source-compatible. However, these do not guarantee compatibility at the binary level. The types of the removed WIR case classes are also added as type aliases to the top-level firrtl package, which allows code that relies on explicit constructor calls or reflection to retain source-compatibility. Finally, additional explicit factory methods are added to the companion objects of the newly-augmented IR case classes, which allows user code to avoid having to specify any of the new analysis fields. Existing code that created non-WIR IR nodes will be able to continue using the previous factory signatures, which will cause all omitted analysis fields to be set to Unknown. ---------------------- UNMITIGATED API CHANGES ------------------------- While passes that used WIR will be source-compatible with this change, there is one significant change that affects any pass currently using non-WIR IR: the signatures of pattern-matching cases for Reference, SubField, SubIndex, SubAccess, and DefInstance must change to accommodate the extra fields. This cannot be worked at the API level due to restrictions on unapply overloading, but it could theoretically be solved with macros or other static rewriting. However, only four core transforms (RemoveProto, ToWorkingIR, Dedup, and RemoveChirrtl) use non-WIR IR, and it is expected that no user code currently relies on it, so the expected migration strategy is simply to change the small fraction of code relying on these nodes.
2020-05-18Fix equivalence tests (#853)Albert Chen
* - modify firrtlEquivalenceTest to use yosys equiv_simple/equiv_induct instead of miter - add RemoveValidIf pass to MinimumLowFirrtlOptimization * add EquivalenceTest to FirrtlSpec.scala, make classes in IntegrationSpec.scala abstract * change types of inputForm/outputForm to CircuitForm * change EquivalenceTest message * remove ICache equivalence tests * fix rebase errors * Add Ops scalatests to LEC suite * Only run compiler-path-comparison LEC tests on Ops design * Fixup issues with merge Co-authored-by: Albert Magyar <albert.magyar@gmail.com>
2020-05-06Update scalatest to 3.1.1 (#1405)Scala Steward
* Update scalatest to 3.1.1 * Update scalatest to 3.1.1 * Update scalatest to 3.1.1 Co-authored-by: Jim Lawson <ucbjrl@berkeley.edu> Co-authored-by: Schuyler Eldridge <schuyler.eldridge@ibm.com>
2020-05-05before/after initial block macros (#1550)Deborah Soung
* adding init macros * fix missing tick * adding more documentation; fixing up emitter tests * adding initial-guarding macro test * prefixing macros with FIRRTL * cleanup * typo fix Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>