From 5694a8808bd724b820caca2f5f1176b8c1e3f40d Mon Sep 17 00:00:00 2001 From: azidar Date: Thu, 20 Aug 2015 15:35:43 -0700 Subject: Added tests, cleaned up repo --- src/main/stanza/errors.stanza | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'src') diff --git a/src/main/stanza/errors.stanza b/src/main/stanza/errors.stanza index 321349d6..77e48263 100644 --- a/src/main/stanza/errors.stanza +++ b/src/main/stanza/errors.stanza @@ -532,10 +532,14 @@ defn OpNotAllSameType (info:FileInfo, op:Symbol) : PassException $ string-join $ [info ": [module " mname "] Primop " op " requires all operands to have the same type."] -defn NodeWithFlips (info:FileInfo) : +defn NodeIllegalFlips (info:FileInfo) : PassException $ string-join $ [info ": [module " mname "] Node cannot be a bundle type with flips."] +defn OnResetIllegalFlips (info:FileInfo) : + PassException $ string-join $ + [info ": [module " mname "] The register in onreset cannot be a bundle type with flips."] + ;---------------- Helper Functions -------------- defmethod equal? (t1:Type,t2:Type) -> True|False : @@ -673,10 +677,11 @@ public defn check-types (c:Circuit) -> Circuit : if not bulk-equals?(type(loc(s)),type(exp(s))) : add(errors,InvalidConnect(info(s))) (s:OnReset) : if type(loc(s)) != type(exp(s)) : add(errors,InvalidConnect(info(s))) + if has-flip?(type(loc(s))) : add(errors,OnResetIllegalFlips(info(s))) (s:Conditionally) : if type(pred(s)) != u() : add(errors,PredNotUInt(info(s))) (s:DefNode) : - if has-flip?(type(value(s))) : add(errors,NodeWithFlips(info(s))) + if has-flip?(type(value(s))) : add(errors,NodeIllegalFlips(info(s))) (s) : false s }() -- cgit v1.2.3