diff options
| author | azidar | 2015-05-15 16:34:34 -0700 |
|---|---|---|
| committer | azidar | 2015-05-15 16:34:34 -0700 |
| commit | 2702e571040e7a07317b79f9c5cfdbd61b9ab2bf (patch) | |
| tree | 0e5973d175be18851865b712e16871764157889f /src/main/stanza/compilers.stanza | |
| parent | 521a4277bfc1d764dc9ee771c604200525e871cb (diff) | |
Updated firrtl for its passes to be a bit more modular, and to enable plugging in other backends. Also updated a lot of tests, but not all of them because its annoying.
Diffstat (limited to 'src/main/stanza/compilers.stanza')
| -rw-r--r-- | src/main/stanza/compilers.stanza | 49 |
1 files changed, 49 insertions, 0 deletions
diff --git a/src/main/stanza/compilers.stanza b/src/main/stanza/compilers.stanza new file mode 100644 index 00000000..33b64b8b --- /dev/null +++ b/src/main/stanza/compilers.stanza @@ -0,0 +1,49 @@ +defpackage firrtl/compiler : + import core + import verse + import firrtl/passes + import firrtl/errors + import firrtl/flo + import firrtl/ir2 + import firrtl/ir-utils + +public defstruct StandardFlo <: Compiler : + file: String with: (as-method => true) + +public defmethod passes (c:StandardFlo) -> List<Pass> : + to-list $ [ + CheckHighForm() + TempElimination() + ToWorkingIR() + MakeExplicitReset() + ResolveKinds() + CheckKinds() + InferTypes() + CheckTypes() + ResolveGenders() + CheckGenders() + ExpandAccessors() + LowerToGround() + ExpandIndexedConnects() + ExpandWhens() + InferWidths() + Inline() + SplitExp() + ToRealIR() + Flo(file(c)) + ] + +;============= DRIVER ====================================== +public defn run-passes (c:Circuit,comp:Compiler) : + run-passes(c,passes(comp)) +public defn run-passes (c:Circuit,ls:List<Pass>) : + var c*:Circuit = c + println("Compiling!") + if PRINT-CIRCUITS : println("Original Circuit") + if PRINT-CIRCUITS : print(c) + for p in ls do : + if PRINT-CIRCUITS : println(name(p)) + c* = pass(p)(c*) + if PRINT-CIRCUITS : print(c*) + if PRINT-CIRCUITS : println-all(["Finished " name(p) "\n"]) + println("Done!") |
