From b37f91017c9a8ad2800b97a9f27cbc94de0c82f5 Mon Sep 17 00:00:00 2001 From: azidar Date: Wed, 27 Jan 2016 16:28:53 -0800 Subject: Fixed bug where subaccess indexes were being classified as female, mucking up the chirrtl->firrtl transform. #56. --- src/main/stanza/chirrtl.stanza | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'src') 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) : -- cgit v1.2.3