diff options
| author | azidar | 2015-08-20 15:35:43 -0700 |
|---|---|---|
| committer | azidar | 2015-08-20 15:35:43 -0700 |
| commit | 5694a8808bd724b820caca2f5f1176b8c1e3f40d (patch) | |
| tree | 92817e13e0639c9a4c4b9341c147242e7d3d2040 /src | |
| parent | 169164c3ad828ccae89c43d4bdbb531f3a2e6237 (diff) | |
Added tests, cleaned up repo
Diffstat (limited to 'src')
| -rw-r--r-- | src/main/stanza/errors.stanza | 9 |
1 files changed, 7 insertions, 2 deletions
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 }() |
