From c561cb225ed564c83ea636644af96fd2e6dee0ab Mon Sep 17 00:00:00 2001 From: azidar Date: Fri, 28 Aug 2015 13:21:05 -0700 Subject: Moved check type and check kind after check gender --- src/main/stanza/compilers.stanza | 4 ++-- src/main/stanza/errors.stanza | 3 ++- src/main/stanza/passes.stanza | 3 +-- test/passes/infer-types/bundle.fir | 6 +++--- test/passes/infer-types/gcd.fir | 8 ++++---- test/passes/to-verilog/shr.fir | 2 +- 6 files changed, 13 insertions(+), 13 deletions(-) diff --git a/src/main/stanza/compilers.stanza b/src/main/stanza/compilers.stanza index b9a3028a..1e978a2e 100644 --- a/src/main/stanza/compilers.stanza +++ b/src/main/stanza/compilers.stanza @@ -49,11 +49,11 @@ public defmethod passes (c:StandardVerilog) -> List : TempElimination() ;R ToWorkingIR() ;R -> W ResolveKinds() ;W - CheckKinds() ;W InferTypes() ;R - CheckTypes() ;R ResolveGenders() ;W CheckGenders() ;W + CheckKinds() ;W + CheckTypes() ;R ExpandAccessors() ;W LowerToGround() ;W ExpandIndexedConnects() ;W diff --git a/src/main/stanza/errors.stanza b/src/main/stanza/errors.stanza index 69073f9f..4bcf8dd7 100644 --- a/src/main/stanza/errors.stanza +++ b/src/main/stanza/errors.stanza @@ -653,7 +653,8 @@ public defn check-types (c:Circuit) -> Circuit : (s:Connect) : if type(loc(s)) != type(exp(s)) : add(errors,InvalidConnect(info(s))) (s:BulkConnect) : - if not bulk-equals?(type(loc(s)),type(exp(s))) : add(errors,InvalidConnect(info(s))) + 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))) diff --git a/src/main/stanza/passes.stanza b/src/main/stanza/passes.stanza index fead9ac2..99fb8172 100644 --- a/src/main/stanza/passes.stanza +++ b/src/main/stanza/passes.stanza @@ -217,7 +217,7 @@ defn hasWidth (e:?) : defn hasType (e:?) : e typeof Ref|Subfield|Index|DoPrim|WRef|WSubfield |WIndex|DefWire|DefRegister|DefMemory|DefPoison - |VectorType|Port|Field|UIntValue|SIntValue + |VectorType|Port|UIntValue|SIntValue defn hasKind (e:?) : e typeof WRef @@ -600,7 +600,6 @@ defn resolve-kinds (c:Circuit) : kinds[name(m)] = ModuleKind() for p in ports(m) do : kinds[name(p)] = PortKind() - println(name(m)) match(m) : (m:InModule) : find-stmt(body(m)) (m:ExModule) : false diff --git a/test/passes/infer-types/bundle.fir b/test/passes/infer-types/bundle.fir index 50f1c84b..89f9ac22 100644 --- a/test/passes/infer-types/bundle.fir +++ b/test/passes/infer-types/bundle.fir @@ -6,8 +6,8 @@ circuit top : wire z : { x : UInt, flip y: SInt} z.x := UInt(1) z.y := SInt(1) - node x = z.x ;CHECK: node x = z@, flip y : SInt@}>.x@ - node y = z.y ;CHECK: node y = z@, flip y : SInt@}>.y@ + node x = z.x ;CHECK: node x = z@.x@ + node y = z.y ;CHECK: node y = z@.y@ wire a : UInt<3>[10] ;CHECK: wire a : UInt<3>[10]@@[10]@> a[0] := UInt(1) a[1] := UInt(1) @@ -22,8 +22,8 @@ circuit top : node b = a[2] ;CHECK: node b = a@[10]@>[2]@ read accessor c = a[UInt(3)] ;CHECK: read accessor c = a@[10]@>[UInt("h3")@] ; CHECK: Finished Infer Types + ; CHECK: Resolve Genders ; CHECK: read accessor c = a@[10]@>[UInt("h3")@] ; CHECK: Finished Resolve Genders - diff --git a/test/passes/infer-types/gcd.fir b/test/passes/infer-types/gcd.fir index fa14eb38..24860b91 100644 --- a/test/passes/infer-types/gcd.fir +++ b/test/passes/infer-types/gcd.fir @@ -24,13 +24,13 @@ circuit top : when gt(x, y) : ;CHECK: when gt(x@, y@)@ : inst s of subtracter - ;CHECK: inst s of subtracter@, flip y : UInt@, z : UInt@}> + ;CHECK: inst s of subtracter@ s.x := x s.y := y x := s.z - ;CHECK: s@, flip y : UInt@, z : UInt@}>.x@ := x@ - ;CHECK: s@, flip y : UInt@, z : UInt@}>.y@ := y@ - ;CHECK: x@ := s@, flip y : UInt@, z : UInt@}>.z@ + ;CHECK: s@.x@ := x@ + ;CHECK: s@.y@ := y@ + ;CHECK: x@ := s@.z@ else : inst s2 of subtracter s2.x := x diff --git a/test/passes/to-verilog/shr.fir b/test/passes/to-verilog/shr.fir index f710dc51..c4b4e4d2 100644 --- a/test/passes/to-verilog/shr.fir +++ b/test/passes/to-verilog/shr.fir @@ -1,7 +1,7 @@ ; RUN: firrtl -i %s -o %s.v -X verilog -p cTd 2>&1 | tee %s.out | FileCheck %s ;CHECK: Infer Widths -;CHECK: node s1_addr = cat(dtlb>}>.resp$ppn>, bits(s1_req$addr>, 11, 0)>)> +;CEHCK: node s1_addr = cat(dtlb}>.resp$ppn>, bits(s1_req$addr>, 11, 0)>)> ;CHECK: Finished Infer Widths circuit HellaCache : -- cgit v1.2.3