aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorjackbackrack2015-05-20 04:46:56 -0700
committerjackbackrack2015-05-20 04:46:56 -0700
commit69f08e3110c12aebf902ee8e1729469948c61011 (patch)
tree7eca66a74ba3b9e14a4ed8e858f23799e3d6538b /src
parent994fc58aa9a65eb4a5e287e121ee2e77d91db403 (diff)
fix writeport emission for flo
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 4bab7025..bf71e2a7 100644
--- a/src/main/stanza/flo.stanza
+++ b/src/main/stanza/flo.stanza
@@ -145,19 +145,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) :