@@ -18,6 +18,8 @@ import Clash.Prelude (type (^), type (-), type (*))
1818-- strict-tuple
1919import Data.Tuple.Strict (T4 )
2020
21+ import Control.DeepSeq
22+
2123-- | Simple wrapper to achieve "named arguments" when instantiating an AXI protocol
2224data IdWidth = IdWidth Nat
2325
@@ -70,10 +72,10 @@ data SKeepStrobe (strobeType :: KeepStrobe) where
7072 SNoStrobe :: SKeepStrobe 'NoStrobe
7173
7274-- | Extracts Nat from 'IdWidth', 'AddrWidth', and 'LengthWidth'
73- type family Width (a :: k ) :: Nat where
74- Width ('IdWidth n ) = n
75- Width ('AddrWidth n ) = n
76- 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
7779
7880-- | Enables or disables 'BurstMode'
7981type family BurstType (keepBurst :: KeepBurst ) where
@@ -102,7 +104,7 @@ type family LockType (keepLockType :: KeepLock) where
102104
103105-- | Enables or disables 'Privileged', 'Secure', and 'InstructionOrData'
104106type family PermissionsType (keepPermissions :: KeepPermissions ) where
105- PermissionsType 'KeepPermissions = T3 Privileged Secure InstructionOrData
107+ PermissionsType 'KeepPermissions = ( Privileged , Secure , InstructionOrData )
106108 PermissionsType 'NoPermissions = ()
107109
108110-- | Enables or disables 'Qos'
@@ -245,6 +247,19 @@ data Resp
245247 | RDecodeError
246248 deriving (Show , C.ShowX , Generic , C.NFDataX )
247249
250+ -- | Status of a read or write transaction on AXI4 Lite.
251+ data RespLite
252+ -- | Normal access success. Indicates that a normal access has been
253+ -- successful.
254+ = RLOkay
255+ -- | Slave error. Used when the access has reached the slave successfully, but
256+ -- the slave wishes to return an error condition to the originating master.
257+ | RLSlaveError
258+ -- | Decode error. Generated, typically by an interconnect component, to
259+ -- indicate that there is no slave at the transaction address.
260+ | RLDecodeError
261+ deriving (Show , C.ShowX , Generic , C.NFDataX )
262+
248263-- | Whether a resource is accessed with exclusive access or not
249264data AtomicAccess
250265 = NonExclusiveAccess
@@ -260,12 +275,14 @@ data Modifiable
260275data Secure
261276 = Secure
262277 | NonSecure
278+ deriving (Show , Generic , C.NFDataX , NFData , C.ShowX , Eq )
263279
264280-- | An AXI master might support more than one level of operating privilege,
265281-- and extend this concept of privilege to memory access.
266282data Privileged
267283 = NotPrivileged
268284 | Privileged
285+ deriving (Show , Generic , C.NFDataX , NFData , C.ShowX , Eq )
269286
270287-- | Whether the transaction is an instruction access or a data access. The AXI
271288-- protocol defines this indication as a hint. It is not accurate in all cases,
@@ -276,3 +293,4 @@ data Privileged
276293data InstructionOrData
277294 = Data
278295 | Instruction
296+ deriving (Show , Generic , C.NFDataX , NFData , C.ShowX , Eq )
0 commit comments