aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorazidar2015-05-20 12:32:59 -0400
committerazidar2015-05-20 12:32:59 -0400
commit81905d9fdd0debe8f666658607c2a20728baa86d (patch)
treeb6e3d256be85dcf7da4367802e2b79ab59ded11f /src
parented04a9040f20c5e04880a18ec036c1a641443c50 (diff)
parent6e38684be79cf67cbfb4126b03503832914f37d2 (diff)
Merge branch 'master' of github.com:ucb-bar/firrtl
Diffstat (limited to 'src')
-rw-r--r--src/main/stanza/flo.stanza25
1 files changed, 14 insertions, 11 deletions
diff --git a/src/main/stanza/flo.stanza b/src/main/stanza/flo.stanza
index 3e39c526..2cea9757 100644
--- a/src/main/stanza/flo.stanza
+++ b/src/main/stanza/flo.stanza
@@ -200,19 +200,22 @@ defn emit-s (s:Stmt, v:List<Symbol>, top:Symbol) :
val vtype = type(s) as VectorType
emit-all([top "::" name(s) " = mem'" prim-width(type(vtype)) " " size(vtype) "\n"], top)
(s:DefNode) :
- if value(s) typeof WritePort :
- val e = value(s) as WritePort
- val n = firrtl-gensym(`F)
- emit-all([top "::" n " = wr'" prim-width(type(e)) " " enable(e) " " mem(e) " " index(e) " " top "::" name(s) "\n"], top)
- else :
- emit-all([top "::" name(s) " = " maybe-mov(value(s)) value(s) "\n"], top)
+ emit-all([top "::" name(s) " = " maybe-mov(value(s)) value(s) "\n"], top)
(s:Begin) : do(emit-s{_, v, top}, body(s))
(s:Connect) :
- val n = name(loc(s) as Ref)
- if contains?(v,n) :
- emit-all([top "::" n " = out'" prim-width(type(loc(s))) " " exp(s) "\n"], top)
- else :
- emit-all([top "::" n " = " maybe-mov(exp(s)) exp(s) "\n"], top)
+ match(loc(s)) :
+ (r:Ref) :
+ val n = name(r)
+ if contains?(v,n) :
+ emit-all([top "::" n " = out'" prim-width(type(r)) " " exp(s) "\n"], top)
+ else :
+ emit-all([top "::" n " = " maybe-mov(exp(s)) exp(s) "\n"], top)
+ (w:WritePort) :
+ val n = firrtl-gensym(`F)
+ emit-all([top "::" n " = wr'" prim-width(type(w)) " " enable(w) " " mem(w) " " index(w) " " exp(s) "\n"], top)
+ (o) :
+ println-all(["CONNEcT LOC " loc(s)])
+ error("Unknown Connect")
(s) : s
defn emit-module (m:Module) :