aboutsummaryrefslogtreecommitdiff
path: root/src/main/stanza/ir-utils.stanza
diff options
context:
space:
mode:
authorazidar2015-03-11 20:21:08 -0700
committerazidar2015-03-11 20:21:08 -0700
commitdbd3a844953fb8630f8b2ca5706c764533b661b0 (patch)
treeee62f7a1ade1f15b2ca4069b7705ac44a4ba7a2e /src/main/stanza/ir-utils.stanza
parent70e1a41b15632afd969fff7ed6100eba0be78297 (diff)
Finished expand accessors pass. Fixed bug in resolve-gender. Added tests, all pass. Minimal removal of letrec to get WritePort to work correctly - a more thorough removeal is still needed
Diffstat (limited to 'src/main/stanza/ir-utils.stanza')
-rw-r--r--src/main/stanza/ir-utils.stanza14
1 files changed, 5 insertions, 9 deletions
diff --git a/src/main/stanza/ir-utils.stanza b/src/main/stanza/ir-utils.stanza
index 74e74679..47f6154b 100644
--- a/src/main/stanza/ir-utils.stanza
+++ b/src/main/stanza/ir-utils.stanza
@@ -139,7 +139,8 @@ defmethod print (o:OutputStream, e:Expression) :
print-all(o, [op(e) "("])
print-all(o, join(concat(args(e), consts(e)), ", "))
print(o, ")")
- (e:ReadPort) : print-all(o, ["ReadPort(" mem(e) ", " index(e) ")"])
+ (e:ReadPort) : print-all(o, ["ReadPort(" mem(e) ", " index(e) ", " enable(e) ")"])
+ (e:WritePort) : print-all(o, ["WritePort(" mem(e) ", " index(e) ", " enable(e) ")"])
(e:Null) : print-all(o, ["Null"])
print-debug(o,e)
@@ -194,9 +195,6 @@ defmethod print (o:OutputStream, e:Element) :
print(o, ")")
print-debug(o,e)
-defmethod print (o:OutputStream, p:WritePort) :
- print-all(o, [index(p) " => WritePort(" value(p) ", " enable(p) ")"])
-
defmethod print (o:OutputStream, t:Type) :
match(t) :
(t:UnknownType) :
@@ -278,7 +276,8 @@ defmethod map (f: Expression -> Expression, e:Expression) -> Expression :
(e:Subfield) : Subfield(f(exp(e)), name(e), type(e))
(e:Index) : Index(f(exp(e)), value(e), type(e))
(e:DoPrim) : DoPrim(op(e), map(f, args(e)), consts(e), type(e))
- (e:ReadPort) : ReadPort(f(mem(e)), f(index(e)), type(e))
+ (e:ReadPort) : ReadPort(f(mem(e)), f(index(e)), type(e), enable(e))
+ (e:WritePort) : WritePort(f(mem(e)), f(index(e)), type(e), enable(e))
(e) : e
public defmulti map<?T> (f: Expression -> Expression, e:?T&Element) -> T
@@ -286,10 +285,7 @@ defmethod map (f: Expression -> Expression, e:Element) -> Element :
match(e) :
(e:Register) :
Register(type(e), f(value(e)), f(enable(e)))
- (e:Memory) :
- val writers* = for w in writers(e) map :
- WritePort(f(index(w)), f(value(w)), f(enable(w)))
- Memory(type(e), writers*)
+ (e:Memory) : e
(e:Node) :
Node(type(e), f(value(e)))
(e:Instance) :