blob: f7d8460000ef5e16457794a350f7e118c0602db1 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
|
include<"core/stringeater.stanza">
include<"compiler/lexer.stanza">
include<"compiler/parser.stanza">
include<"compiler/rdparser.stanza">
include<"compiler/macro-utils.stanza">
include("firrtl-ir.stanza")
include("ir-utils.stanza")
include("ir-parser.stanza")
include("passes.stanza")
include("widthsolver.stanza")
defpackage firrtl-main :
import core
import verse
import firrtl.parser
import firrtl.passes
import stanza.lexer
import stanza.parser
import firrtl.ir-utils
defn set-printvars! (p:List<Char>) :
if contains(p,'t') : PRINT-TYPES = true
if contains(p,'k') : PRINT-KINDS = true
if contains(p,'w') : PRINT-WIDTHS = true
if contains(p,'T') : PRINT-TWIDTHS = true
if contains(p,'g') : PRINT-GENDERS = true
if contains(p,'c') : PRINT-CIRCUITS = true
defn main () :
val args = commandline-arguments()
val lexed = lex-file(args[1])
val c = parse-firrtl(lexed)
if length(args) >= 4 :
set-printvars!(to-list(args[3]))
run-passes(c,to-list(args[2]))
main()
|