@@ -81,7 +81,7 @@ import SrcLoc (SrcSpan, leftmost_smallest)
8181import Clash.Core.DataCon (DataCon )
8282import Clash.Core.Literal (Literal )
8383import Clash.Core.Name (Name (.. ))
84- import {- # SOURCE #-} Clash.Core.Subst () -- instance Eq/Ord Type
84+ import {- # SOURCE #-} Clash.Core.Subst (acmpTerm , aeqTerm ) -- instance Eq/Ord Type
8585import {- # SOURCE #-} Clash.Core.Type (Type )
8686import Clash.Core.Var (Var , Id , TyVar )
8787import Clash.Util (curLoc , thenCompare )
@@ -124,19 +124,31 @@ data TickInfo
124124 | NoDeDup
125125 -- ^ Do not deduplicate, i.e. /keep/, an expression inside a case-alternative;
126126 -- do not try to share expressions between multiple branches.
127- deriving (Eq , Show , Generic , NFData , Binary )
127+ | Attributes Type Term
128+ -- ^ Synthesis attributes brough into scope by
129+ -- 'Clash.Annotations.SynthesisAttributes.annotateReg'
130+ deriving (Show , Generic , NFData , Binary )
131+
132+ instance Eq TickInfo where
133+ SrcSpan s1 == SrcSpan s2 = s1 == s2
134+ NameMod m1 t1 == NameMod m2 t2 = m1 == m2 && t1 == t2
135+ Attributes t1 a1 == Attributes t2 a2 = t1 == t2 && aeqTerm a1 a2
136+ _ == _ = False
128137
129138instance Ord TickInfo where
130139 compare (SrcSpan s1) (SrcSpan s2) = leftmost_smallest s1 s2
131140 compare (NameMod m1 t1) (NameMod m2 t2) =
132141 compare m1 m2 `thenCompare` compare t1 t2
142+ compare (Attributes t1 a1) (Attributes t2 a2) =
143+ compare t1 t2 `thenCompare` acmpTerm a1 a2
133144 compare t1 t2 = compare (getRank t1) (getRank t2)
134145 where
135146 getRank :: TickInfo -> Word
136- getRank SrcSpan {} = 0
137- getRank NameMod {} = 1
138- getRank DeDup = 2
139- getRank NoDeDup = 3
147+ getRank SrcSpan {} = 0
148+ getRank NameMod {} = 1
149+ getRank DeDup = 2
150+ getRank NoDeDup = 3
151+ getRank Attributes {} = 4
140152
141153-- | Tag to indicate which instance/register name modifier was used
142154data NameMod
0 commit comments