aboutsummaryrefslogtreecommitdiff
path: root/src/main
AgeCommit message (Collapse)Author
2021-10-09Support parsing missing keywords as ids (#2381)Jack Koenig
Reset, AsyncReset, Interval, attach, assert, assume, and cover have all been added as keywords but not added to the allowlist for parsing as ids.
2021-10-04Hotfix for Vector Reg Init LegalizeConnects BugSchuyler Eldridge
Add a private pass, LegalizeConnectsOnly, that behaves like LegalizeConnects, but only pads connects instead of connects and register inits. Padding is necessary for ReplSeqMem, but ReplSeqMem runs before LowerTypes and vector registers can still exist at this point. Connects, conversely, are all blown out by ExpandConnects and can be safely, blindly treated as ground type. Fixes #2379. Signed-off-by: Schuyler Eldridge <schuyler.eldridge@sifive.com>
2021-09-29TopWiring: filter out unnamed declarations when building source lists (#2376)David Biancolin
* Demonstrate a couple failing cases * Have TopWiring ignore unnamed declarations as potential sources
2021-09-29Have Flatten & InlineInstances remove their annotations (#2374)David Biancolin
* Have Flatten & InlineInstances remove their annotations * Format
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-23transforms.formal: ensure named statements as output (#2367)Kevin Laeufer
2021-09-13Bump Scala to 2.12.14 and 2.13.6 (#2356)Jack Koenig
This required also bumping sbt-scalafix to bring in a newer version of semanticdb. The new version of semanticdb had an issue with a regex in SMTLib, fixed by fixing the way '$' is escaped in the regex.
2021-09-11Remove BlackBoxSourceHelper from ReplaceMemTransform (#2355)Jack Koenig
BlackBoxSourceHelper should only run late in compilation to allow transforms to tweak its behavior (eg. changing BlackBoxTargetDirAnno).
2021-09-10MemConf: Do not add another new line when serializing (#2354)Megan Wachs
2021-09-08smt: make SMT + TransitionSystem lib public (#2350)Kevin Laeufer
2021-09-08smt: refactor SMT expression library (#2347)Kevin Laeufer
2021-09-08Multi protobuf module emission and consumption (#2344)Jared Barocsi
* Add compiler option (`-p`) to emit individual module protobufs * Implement multi module combination when reading directory of protobufs Co-authored-by: Jack Koenig <koenig@sifive.com>
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-26Fix dshl zero-width shift behavior (#2339)Schuyler Eldridge
* Fix dshl zero-width shift behavior Add a special case for dshl handling in the ZeroWidths pass. If one expression is shifted by a second, zero-width expression, just return the first expression. This prevents a bug where the width will incorrectly expand due to zero-widths introducing a 1-bit zero expression. Signed-off-by: Schuyler Eldridge <schuyler.eldridge@sifive.com> * fixup! Fix dshl zero-width shift behavior
2021-08-21Add BufferedCustomFileEmission (#2334)Jack Koenig
Uses virtual method .getBytesBuffered: Iterable[Array[Byte]] to optimize file emission.
2021-08-20Fix Serializer for single indented DefModule emission (#2332)Jack Koenig
2021-08-13Modify NoCommonSubexpressionElimination to ↵胡波
NoCommonSubexpressionEliminationAnnotation (#2329) to make it has the same form with NoDCEAnnotation and NoConstantPropagationAnnotation
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-09PropagatePresetAnnotations: remove dep. on SplitExpressions and PadWidths ↵Kevin Laeufer
(#2324) Both transforms are (most likely) not needed.
2021-08-09PropagatePresetAnnotations: remove false prerequisites (#2323)Kevin Laeufer
The SMT backend actually needs to run PropagatePresetAnnotations (as will treadle at some point). None of the Verilog specific passes were actually required!
2021-08-09Implement NoCommonSubexpressionElimination (#2291)Jiuyang Liu
* implement NoCommonSubexpressionElimination to resolve chipsalliance/chisel3#2006 * Update src/main/scala/firrtl/passes/CommonSubexpressionElimination.scala Co-authored-by: Schuyler Eldridge <schuyler.eldridge@sifive.com> Co-authored-by: Schuyler Eldridge <schuyler.eldridge@sifive.com>
2021-08-04Revert "Deprecate DependencyAPIMigration. (#2303)" (#2316)Kevin Laeufer
This reverts commit 2630537cf956eea3768c5bd8e57de839f7d3700a.
2021-08-03Require Andr, Orr, Xorr, Neg to have one operand (#2312)Schuyler Eldridge
Fix an OG bug where Andr, Orr, and Xorr would accept an arbitrary number of operands. Verilog emission doesn't support this and will silently drop all operands after the first. E.g., "andr(a, b)" would emit as "&a". After this commit, "andr(a, b)" will be rejected by checking passes. For archaeological purposes, this appears to have been the behavior dating back to when this was added in d2d3260a. Signed-off-by: Schuyler Eldridge <schuyler.eldridge@sifive.com>
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-29Dedup attribute annos (#2297)Jared Barocsi
* Add new util "groupByIntoSeq" * Restore annotation order when dedupping annotations * Attribute annotations now deduplicate * Implement doc string anno dedup Co-authored-by: Jack Koenig <koenig@sifive.com>
2021-07-27Deprecate DependencyAPIMigration. (#2303)Jiuyang Liu
* deprecate DependencyAPIMigration.
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-25Add typedef in DependencyManager.Jiuyang Liu
This is a bug fix, before this PR, Scala compiler will infer `Nothing`, which makes code below failed to compile: ``` class UserCompiler extends TransformManager(Seq(Dependency(UserPass))) { override def optionalPrerequisiteOf: Seq[TransformDependency] = Seq( Dependency[DedupModules] ) } ```
2021-07-14Fix memory annotation deduplication (#2286)Jared Barocsi
* Add transform to deduplicate memory annotations * Add annotation deduplication to Dedup stage * ResolveAnnotationPaths and EliminateTargetPaths now invalidate the dedup annotations transform * Verilog emitter now throws exception when memory annotations fail to dedup Co-authored-by: Jack Koenig <koenig@sifive.com>
2021-07-11Rm java.io in WriteEmitted (#2275)sinofp
Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
2021-07-11Deprecate BlackBoxResourceAnno (#2262)Schuyler Eldridge
Signed-off-by: Schuyler Eldridge <schuyler.eldridge@sifive.com> Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
2021-06-25Correct a typo in src/main/scala/firrtl/WIR.scala (#2283)Felix Yan
2021-06-22Fix VerilogMemDelays use before declaration (#2278)Jack Koenig
The pass injects pipe registers immediately after the declaration of the memory. This can be problematic if the clock for the associated memory port is defined after the declaration of the memory. For any memory port clocks that are driven by non-ports, we now inject a wire before the pipe register declarations to be sure there are no use-before-declaration issues.
2021-06-18Fix MultiInfo parser + serialization bug (#2265)Jared Barocsi
* Restore parsed MultiInfo structure in firrtl parser * Change erroneous expected output in InfoSpec test FileInfo compression sorts the outputted entries alphabetically, but this test did not reflect that fact * Fix typo in comment * Add unit tests for file locator parsing * Fix syntax issues and typos * More redundant braces removed Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
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-06-17Add Protocol Buffer emission (#2271)Schuyler Eldridge
* Add Protocol Buffer emission export This adds infrastructure and annotations that let a user emit a FIRRTL circuit as a Protocol Buffer. Fixes #1696. Signed-off-by: Schuyler Eldridge <schuyler.eldridge@sifive.com> * fixup! Add Protocol Buffer emission export
2021-06-15make PresetRegAnnotation public (#2254)Kevin Laeufer
* make PresetRegAnnotation public this annotation is useful outside the firrtl compiler: - to implement a pass that creates registers which need to be initialized at the beginning of simulation (e.g., for formal verification) - to support preset registers in treadle * add PresetRegAnnotation test and deal with annotation correctly in RemoveReset pass
2021-06-14Add -X mhigh compiler for minimal high form (#2268)Schuyler Eldridge
Add a compiler/emitter that can target minimal high form. This will produce output that only has CHIRRTL constructs removed. Signed-off-by: Schuyler Eldridge <schuyler.eldridge@sifive.com>
2021-06-08Prepend target dir to default dedup report dirsinofp
Requested by reviewer.
2021-06-08Rm java.io in MustDedupsinofp
2021-06-05Add deprecation annotation in FileUtilssinofp
2021-06-04Rm java.io in FileUtilssinofp
2021-06-03Replace mem macros renaming (#2243)Albert Chen
* ReplaceMemMacros: add target rename test case * ReplaceMemMacros: rename references to instances * fix renaming for deduped mems * use grouped DummyAnnos to preserve order * Apply suggestions from code review Co-authored-by: Jack Koenig <koenig@sifive.com> * run scalafmt * flatten targets Co-authored-by: Jack Koenig <koenig@sifive.com>
2021-05-22Rewrite vlsi_mem_gen into a Firrtl Transform (#2202)sinofp
* Add GenVerilogMemBehaviorModelAnno & vlsiMemGen * Add CLI support for GenVerilogMemBehaviorModelAnno * Add simple test for GenVerilogMemBehaviorModelAnno * Fix for review 1. rename case class Port(prefix, `type`) to Port(prefix, portType) 2. fix AnnotatedMemoriesAnnotation collect function. 3. fix bug that ModuleName is not correct. * Format DumpMemoryAnnotations & ReplSeqMemTests * Fix for review 1. Inline genDecl, genPortSpec, genSequential, genCombinational 2. Add DefAnnotatedMemory informations in header 3. Change helpText 4. Check output Verilog by Verilator, the code is from FirrtlRunners#lintVerilog * Fix ReadWritePort mask name Co-authored-by: Jiuyang Liu <liu@jiuyang.me> Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
2021-05-21Optimize Annotation.getTargets (#2244)Jack Koenig
2021-05-21Fix renaming of local targets in InlineInstances (#2238)Albert Chen
* add more inline renaming test cases * InlineInstances: fix renaming for local targets * run scalafmt Co-authored-by: mergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
2021-05-21Annotation: override getTargets for SingleTargetAnnotation (#2241)Kevin Laeufer
2021-05-21WiringTransform: cannot run after RemoveWires (#2240)Kevin Laeufer