Index: lib/BSVSource/Axi/AxiDefines.bsv =================================================================== --- lib/BSVSource/Axi/AxiDefines.bsv (revision 26065) +++ lib/BSVSource/Axi/AxiDefines.bsv (working copy) @@ -588,7 +588,7 @@ return length; endfunction -function AxiSize getAxiSize(TLMBurstSize#(`TLM_PRM) incr); +function AxiSize getAxiSize(Bit#(n) incr); Bit#(8) value = cExtend(incr); case (value) ( 1 - 1): return 0; @@ -665,8 +665,8 @@ endcase endfunction -function TLMBurstSize#(`TLM_PRM) fromAxiSize(AxiSize size); - Bit#(TAdd#(SizeOf#(TLMBurstSize#(`TLM_PRM)), 1)) incr; +function Bit#(n) fromAxiSize(AxiSize size); + Bit#(TAdd#(n, 1)) incr; incr = (1 << size) - 1; return zExtend(incr); endfunction Index: lib/BSVSource/AHB/AHBDefines.bsv =================================================================== --- lib/BSVSource/AHB/AHBDefines.bsv (revision 26065) +++ lib/BSVSource/AHB/AHBDefines.bsv (working copy) @@ -367,7 +367,7 @@ endcase endfunction -function AHBSize getAHBSize(TLMBurstSize#(`TLM_PRM) incr); +function AHBSize getAHBSize(Bit#(n) incr); Bit#(8) value = zExtend(incr); case (value) ( 1 - 1): return BITS8; @@ -456,7 +456,7 @@ endcase endfunction -function TLMBurstSize#(`TLM_PRM) fromAHBSize(AHBSize size); +function Bit#(n) fromAHBSize(AHBSize size); Bit#(8) value = 0; case (size) BITS8: value = ( 1 - 1); Index: comp/TCheck.hs =================================================================== --- comp/TCheck.hs (revision 26065) +++ comp/TCheck.hs (working copy) @@ -2134,10 +2134,7 @@ (qs :=> ft0, xts) <- freshInstT "G" f sc rt -- Fields might be defined using type constructors (like SizeOf), -- so replace them with vars and return the preds that determine the vars - -- XXX disable expanding of type synonyms until failures with TLM - -- XXX (type synonyms which drop parameters) is resolved - -- XXX (tcon_ps, ft) <- expPrimTCons (expandSyn ft0) - (tcon_ps, ft) <- expPrimTCons ft0 + (tcon_ps, ft) <- expPrimTCons (expandSyn ft0) -- Unify the field type and the context expected return type, -- possibly returning preds which express type equality (t,eq_ps) <- unifyFnTo f e ft rt Index: comp/CtxRed.hs =================================================================== --- comp/CtxRed.hs (revision 26065) +++ comp/CtxRed.hs (working copy) @@ -379,10 +379,7 @@ -- (and do it here, after "convCQType", so that "expPrimTCons" sees -- the qualified types) (qs, t) <- if isInstHead - then do -- XXX disable expanding of type synonyms until - -- XXX failures with TLM instances are resolved - -- XXX (vqs_extra, t1) <- expPrimTCons t0 (expandSyn t0) - (vqs_extra, t1) <- expPrimTCons t0 + then do (vqs_extra, t1) <- expPrimTCons (expandSyn t0) let qs_extra = map toPredWithPositions vqs_extra return (qs0 ++ qs_extra, t1) else return (qs0, t0) Index: comp/MakeSymTab.hs =================================================================== --- comp/MakeSymTab.hs (revision 26065) +++ comp/MakeSymTab.hs (working copy) @@ -781,7 +781,10 @@ convCQType :: SymTab -> CQType -> Either EMsg (Qual Type) convCQType r ct = --trace ("convCQType " ++ ppReadable ct) $ - convCQTypeVars r (tv ct) ct + -- Expand all synonyms before adding types to the symtab + case (convCQTypeVars r (tv ct) ct) of + Right qt -> Right $ expandSynQualType qt + res -> res convCQTypeWithAssumps :: SymTab -> [(Id, Kind)] -> CQType -> Either EMsg (Qual Type) @@ -917,3 +920,16 @@ in lookup (unQualId i) deps ----- + +expandSynQualType :: Qual Type -> Qual Type +expandSynQualType (qs :=> t) = (qs' :=> t') + where qs' = map expandSynPredWP qs + t' = expandSyn t + +expandSynPredWP :: PredWithPositions -> PredWithPositions +expandSynPredWP (PredWithPositions (IsIn c ts) poss) = pwp' + where pwp' = PredWithPositions p' poss + p' = IsIn c ts' + ts' = map expandSyn ts + +-----