aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorazidar2016-01-27 16:28:53 -0800
committerazidar2016-01-28 09:25:05 -0800
commitb37f91017c9a8ad2800b97a9f27cbc94de0c82f5 (patch)
treeb8514921c9ba9f03c4556f3c5688d60ae4941614 /src
parentcfedffd1fc7d5846e9f633bf13ea194b8ab2293d (diff)
Fixed bug where subaccess indexes were being classified as female,
mucking up the chirrtl->firrtl transform. #56.
Diffstat (limited to 'src')
-rw-r--r--src/main/stanza/chirrtl.stanza5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/main/stanza/chirrtl.stanza b/src/main/stanza/chirrtl.stanza
index e92cab61..6bce8ce4 100644
--- a/src/main/stanza/chirrtl.stanza
+++ b/src/main/stanza/chirrtl.stanza
@@ -345,7 +345,7 @@ defn remove-chirrtl (c:Circuit) :
var has-write-mport? = false
var has-readwrite-mport? = false
defn remove-chirrtl-e (e:Expression,g:Gender) -> Expression :
- match(map(remove-chirrtl-e{_,g},e)) :
+ match(e) :
(e:Ref) :
if key?(repl,name(e)) :
val vt = repl[name(e)]
@@ -357,7 +357,8 @@ defn remove-chirrtl (c:Circuit) :
has-readwrite-mport? = SubField(exp(vt),`wmode,UIntType(IntWidth(1)))
SubField(exp(vt),female(vt),type(e))
else : e
- (e) : e
+ (e:SubAccess) : SubAccess(remove-chirrtl-e(exp(e),g),remove-chirrtl-e(index(e),MALE),type(e))
+ (e) : map(remove-chirrtl-e{_,g},e)
defn get-mask (e:Expression) -> Expression :
match(map(get-mask,e)) :
(e:Ref) :