File tree Expand file tree Collapse file tree 2 files changed +21
-4
lines changed
Expand file tree Collapse file tree 2 files changed +21
-4
lines changed Original file line number Diff line number Diff line change @@ -72,10 +72,10 @@ data SKeepStrobe (strobeType :: KeepStrobe) where
7272 SNoStrobe :: SKeepStrobe 'NoStrobe
7373
7474-- | Extracts Nat from 'IdWidth', 'AddrWidth', and 'LengthWidth'
75- type family Width (a :: k ) :: Nat where
76- Width ('IdWidth n ) = n
77- Width ('AddrWidth n ) = n
78- Width ('LengthWidth n ) = n
75+ type family Width (a :: k ) :: Nat -- where
76+ type instance Width ('IdWidth n ) = n
77+ type instance Width ('AddrWidth n ) = n
78+ type instance Width ('LengthWidth n ) = n
7979
8080-- | Enables or disables 'BurstMode'
8181type family BurstType (keepBurst :: KeepBurst ) where
Original file line number Diff line number Diff line change @@ -17,6 +17,9 @@ import Control.DeepSeq
1717-- | AXI4 Lite busses are always either 32 bit or 64 bit.
1818data BusWidth = Width32 | Width64 deriving (Show , Eq )
1919
20+ type instance Width 'Width32 = 32
21+ type instance Width 'Width64 = 64
22+
2023-- | AXI4 Lite defines a strobe signal to signify which bytes of the input
2124-- signal should be committed to memory. The strobe signal is encoded in
2225-- the 'Maybe' data type. Strobing is mandatory in AXI4 Lite.
@@ -178,6 +181,13 @@ data M2S_Axi4Lite
178181 m2s_rd :: M2S_ReadData bw
179182 }
180183
184+ deriving instance
185+ ( Show (ReadBusWidthType bw )
186+ , Show (WriteBusWidthType bw )
187+ , KnownNat (Width aw )
188+ , KnownNat (Width bw ))
189+ => Show (M2S_Axi4Lite aw bw )
190+
181191-- | Product type of the types of the five different channels in the direction of slave to master.
182192data S2M_Axi4Lite
183193 (aw :: AddrWidth )
@@ -190,6 +200,13 @@ data S2M_Axi4Lite
190200 s2m_rd :: S2M_ReadData bw
191201 }
192202
203+ deriving instance
204+ ( Show (ReadBusWidthType bw )
205+ , Show (WriteBusWidthType bw )
206+ , KnownNat (Width aw )
207+ , KnownNat (Width bw ))
208+ => Show (S2M_Axi4Lite aw bw )
209+
193210-- | Type for the full AXI4 Lite protocol.
194211data Axi4Lite
195212 (dom :: C. Domain )
You can’t perform that action at this time.
0 commit comments