blob: 16351edd31a649284df3526a408a8fc81601c9ab (
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<"core/macro-utils.stanza">
#include<"compiler/stz-algorithms.stanza">
#include<"compiler/stz-lexer.stanza">
#include<"compiler/stz-parser.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 stz/lexer
import stz/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()
|