aboutsummaryrefslogtreecommitdiff
path: root/src/main
diff options
context:
space:
mode:
authorazidar2015-07-07 10:13:29 -0700
committerazidar2015-07-14 11:29:55 -0700
commitd696dd01de8a1a83a376c719490f475be991f387 (patch)
treeca5d8f21c0f7787cc6eb00e078f0c0ae1e20a182 /src/main
parent3c8f283b445ca99d4ed4c1e04e2bc8bdcdbd72f6 (diff)
Pass most tests. The ones that do not pass are not expected to, yet
Diffstat (limited to 'src/main')
-rw-r--r--src/main/stanza/passes.stanza12
1 files changed, 7 insertions, 5 deletions
diff --git a/src/main/stanza/passes.stanza b/src/main/stanza/passes.stanza
index d170ee1c..e931e7c2 100644
--- a/src/main/stanza/passes.stanza
+++ b/src/main/stanza/passes.stanza
@@ -207,7 +207,7 @@ defmethod print (o:OutputStream, k:Kind) :
(k:WriteAccessorKind) : "wacc"
defn hasGender (e:?) :
- e typeof WRef|WSubfield|WIndex
+ e typeof WRef|WSubfield|WIndex|DefAccessor
defn hasWidth (e:?) :
e typeof UIntType|SIntType|UIntValue|SIntValue
@@ -622,7 +622,7 @@ defn resolve-genders (c:Circuit) :
get-gender(name(s),MALE)
DefInstance(info(s),name(s),resolve-expr(module(s),MALE))
(s:DefAccessor) :
- val gender* = get-gender(name(s),UNKNOWN-GENDER)
+ val gender* = get-gender(name(s),gender(s))
val index* = resolve-expr(index(s),MALE)
val source* = resolve-expr(source(s),gender*)
DefAccessor(info(s),name(s),source*,index*,to-acc-dir(gender*))
@@ -702,17 +702,19 @@ defn expand-stmt (s:Stmt) -> Stmt :
else :
val vtype = type(type(source(s)) as VectorType)
val wire = DefWire(info(s),name(s),vtype)
- switch {gender(s) == _} :
- MALE : Begin{list(wire,_)} $ ConnectFromIndexed(
+ switch {acc-dir(s) == _} :
+ READ : Begin{list(wire,_)} $ ConnectFromIndexed(
info(s),
index(s),
WRef(name(wire),vtype,NodeKind(),FEMALE),
expand-vector(source(s)))
- FEMALE: Begin{list(wire,_)} $ ConnectToIndexed(
+ WRITE : Begin{list(wire,_)} $ ConnectToIndexed(
info(s),
index(s),
expand-vector(source(s)),
WRef(name(wire),vtype,NodeKind(),MALE))
+ INFER : error("Shouldn't be here")
+ RDWR : error("Haven't implemented RDWR yet")
(s) : map(expand-stmt,s)
defn expand-accessors (c:Circuit) :