aboutsummaryrefslogtreecommitdiff
path: root/src/main/stanza/passes.stanza
diff options
context:
space:
mode:
authorAdam Izraelevitz2015-07-29 15:00:37 -0700
committerAdam Izraelevitz2015-07-29 15:00:37 -0700
commit7646c2e3edf90ea13a83b76c97f35877263c5e63 (patch)
tree9d28739a22cd14996d53a4df808b18f3793e8949 /src/main/stanza/passes.stanza
parent6ce20db7e2f81cd3ef8f859614f423bea897484b (diff)
Finished supporting Chisel 2.0 Ref Chip
Diffstat (limited to 'src/main/stanza/passes.stanza')
-rw-r--r--src/main/stanza/passes.stanza12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/main/stanza/passes.stanza b/src/main/stanza/passes.stanza
index 255354a3..db1a056e 100644
--- a/src/main/stanza/passes.stanza
+++ b/src/main/stanza/passes.stanza
@@ -1151,7 +1151,7 @@ defn expand-connect-indexed-stmt (s: Stmt,sh:HashTable<Symbol,Int>) -> Stmt :
to-list $
for (i in 0 to false, l in locs(s)) stream : Conditionally(
info(s),
- equality(ref,UIntValue(BigIntLit(i),UnknownWidth())),
+ equality(ref,UIntValue(BigIntLit(i,32),UnknownWidth())),
Connect(info(s),l,exp(s)),
EmptyStmt()
)
@@ -1165,7 +1165,7 @@ defn expand-connect-indexed-stmt (s: Stmt,sh:HashTable<Symbol,Int>) -> Stmt :
to-list $
for (i in 1 to false, e in tail(exps(s))) stream : Conditionally(
info(s),
- equality(ref,UIntValue(BigIntLit(i),UnknownWidth())),
+ equality(ref,UIntValue(BigIntLit(i,32),UnknownWidth())),
Connect(info(s),loc(s),e),
EmptyStmt()
)
@@ -1211,8 +1211,8 @@ public defmethod short-name (b:ExpandWhens) -> String : "expand-whens"
; ======== Expression Computation Library ===========
-val zero = UIntValue(BigIntLit("b0"),IntWidth(1))
-val one = UIntValue(BigIntLit("b1"),IntWidth(1))
+val zero = UIntValue(BigIntLit(0,32),IntWidth(1))
+val one = UIntValue(BigIntLit(1,32),IntWidth(1))
defmethod equal? (e1:Expression,e2:Expression) -> True|False :
match(e1,e2) :
@@ -1548,7 +1548,7 @@ public defn expand-whens (c:Circuit) -> Circuit :
(e:Expression) :
val ref = WRef(name(s),type(s),NodeKind(),FEMALE)
val en = to-exp(optimize $ get-write-enable(table[name(s)])) as Expression
- if en == UIntValue(BigIntLit("b1"),UnknownWidth()) :
+ if en == one :
add{cons,_} $ Connect(info(s),ref,e)
else :
add{cons,_} $ Conditionally(info(s),en,Connect(info(s),ref,e),EmptyStmt())
@@ -1563,7 +1563,7 @@ public defn expand-whens (c:Circuit) -> Circuit :
match(e) :
(e:Expression) :
val en = (to-exp $ optimize $ get-write-enable(table[n])) as Expression
- if en == UIntValue(BigIntLit("b1"),UnknownWidth()) :
+ if en == one :
add{cons,_} $ Connect(info(s),ref,e)
else :
add{cons,_} $ Conditionally(info(s),en,Connect(info(s),ref,e),EmptyStmt())