| Safe Haskell | None |
|---|---|
| Language | GHC2021 |
Protocols.Experimental.Wishbone
Description
Types modelling the Wishbone bus protocol.
Synopsis
- data WishboneM2S (addressBits :: Nat) (dataBytes :: Natural) = WishboneM2S {
- addr :: "ADR" ::: BitVector addressBits
- writeData :: "DAT_MOSI" ::: BitVector (dataBytes * 8)
- busSelect :: "SEL" ::: BitVector dataBytes
- lock :: "LOCK" ::: Bool
- busCycle :: "CYC" ::: Bool
- strobe :: "STB" ::: Bool
- writeEnable :: "WE" ::: Bool
- cycleTypeIdentifier :: "CTI" ::: CycleTypeIdentifier
- burstTypeExtension :: "BTE" ::: BurstTypeExtension
- data WishboneS2M (dataBytes :: Natural) = WishboneS2M {}
- newtype CycleTypeIdentifier = CycleTypeIdentifier (BitVector 3)
- pattern Classic :: CycleTypeIdentifier
- pattern ConstantAddressBurst :: CycleTypeIdentifier
- pattern IncrementingBurst :: CycleTypeIdentifier
- pattern EndOfBurst :: CycleTypeIdentifier
- data BurstTypeExtension
- data WishboneMode
- data Wishbone (dom :: Domain) (mode :: WishboneMode) (addressBits :: Nat) (dataBytes :: Nat)
- emptyWishboneM2S :: forall (addressBits :: Nat) (dataBytes :: Nat). (KnownNat addressBits, KnownNat dataBytes) => WishboneM2S addressBits dataBytes
- emptyWishboneS2M :: forall (dataBytes :: Nat). KnownNat dataBytes => WishboneS2M dataBytes
- hasBusActivity :: forall (addressBits :: Nat) (dataBytes :: Natural). (WishboneM2S addressBits dataBytes, WishboneS2M dataBytes) -> Bool
- hasTerminateFlag :: forall (dataBytes :: Natural). WishboneS2M dataBytes -> Bool
- forceResetSanity :: forall (dom :: Domain) (mode :: WishboneMode) (aw :: Nat) (dw :: Nat). (KnownDomain dom, HiddenReset dom, KnownNat aw, KnownNat dw) => Circuit (Wishbone dom mode aw dw) (Wishbone dom mode aw dw)
Documentation
data WishboneM2S (addressBits :: Nat) (dataBytes :: Natural) Source #
Data communicated from a Wishbone Master to a Wishbone Slave
Constructors
| WishboneM2S | |
Fields
| |
Instances
data WishboneS2M (dataBytes :: Natural) Source #
Data communicated from a Wishbone Slave to a Wishbone Master
Constructors
| WishboneS2M | |
Fields
| |
Instances
| KnownNat dataBytes => BitPack (WishboneS2M dataBytes) Source # | |||||
Defined in Protocols.Experimental.Wishbone Associated Types
Methods pack :: WishboneS2M dataBytes -> BitVector (BitSize (WishboneS2M dataBytes)) # unpack :: BitVector (BitSize (WishboneS2M dataBytes)) -> WishboneS2M dataBytes # | |||||
| KnownNat dataBytes => NFDataX (WishboneS2M dataBytes) Source # | |||||
Defined in Protocols.Experimental.Wishbone Methods deepErrorX :: String -> WishboneS2M dataBytes # hasUndefined :: WishboneS2M dataBytes -> Bool # ensureSpine :: WishboneS2M dataBytes -> WishboneS2M dataBytes # rnfX :: WishboneS2M dataBytes -> () # | |||||
| KnownNat dataBytes => ShowX (WishboneS2M dataBytes) Source # | |||||
Defined in Protocols.Experimental.Wishbone Methods showsPrecX :: Int -> WishboneS2M dataBytes -> ShowS # showX :: WishboneS2M dataBytes -> String # showListX :: [WishboneS2M dataBytes] -> ShowS # | |||||
| NFData (WishboneS2M dataBytes) Source # | |||||
Defined in Protocols.Experimental.Wishbone Methods rnf :: WishboneS2M dataBytes -> () # | |||||
| Generic (WishboneS2M dataBytes) Source # | |||||
Defined in Protocols.Experimental.Wishbone Associated Types
Methods from :: WishboneS2M dataBytes -> Rep (WishboneS2M dataBytes) x # to :: Rep (WishboneS2M dataBytes) x -> WishboneS2M dataBytes # | |||||
| KnownNat dataBytes => Show (WishboneS2M dataBytes) Source # | |||||
Defined in Protocols.Experimental.Wishbone Methods showsPrec :: Int -> WishboneS2M dataBytes -> ShowS # show :: WishboneS2M dataBytes -> String # showList :: [WishboneS2M dataBytes] -> ShowS # | |||||
| KnownNat dataBytes => Eq (WishboneS2M dataBytes) Source # | |||||
Defined in Protocols.Experimental.Wishbone Methods (==) :: WishboneS2M dataBytes -> WishboneS2M dataBytes -> Bool # (/=) :: WishboneS2M dataBytes -> WishboneS2M dataBytes -> Bool # | |||||
| type BitSize (WishboneS2M dataBytes) Source # | |||||
Defined in Protocols.Experimental.Wishbone type BitSize (WishboneS2M dataBytes) = CLog 2 (GConstructorCount (Rep (WishboneS2M dataBytes))) + GFieldSize (Rep (WishboneS2M dataBytes)) | |||||
| type Rep (WishboneS2M dataBytes) Source # | |||||
Defined in Protocols.Experimental.Wishbone type Rep (WishboneS2M dataBytes) = D1 ('MetaData "WishboneS2M" "Protocols.Experimental.Wishbone" "clash-protocols-0.1-inplace" 'False) (C1 ('MetaCons "WishboneS2M" 'PrefixI 'True) ((S1 ('MetaSel ('Just "readData") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 ("DAT_MISO" ::: BitVector (dataBytes * 8))) :*: S1 ('MetaSel ('Just "acknowledge") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 ("ACK" ::: Bool))) :*: (S1 ('MetaSel ('Just "err") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 ("ERR" ::: Bool)) :*: (S1 ('MetaSel ('Just "stall") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 ("STALL" ::: Bool)) :*: S1 ('MetaSel ('Just "retry") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 ("RTY" ::: Bool)))))) | |||||
newtype CycleTypeIdentifier Source #
Identifier for different types of cycle-modes, used to potentially increase throughput by reducing handshake-overhead
Constructors
| CycleTypeIdentifier (BitVector 3) |
Instances
| BitPack CycleTypeIdentifier Source # | |||||
Defined in Protocols.Experimental.Wishbone Associated Types
Methods pack :: CycleTypeIdentifier -> BitVector (BitSize CycleTypeIdentifier) # unpack :: BitVector (BitSize CycleTypeIdentifier) -> CycleTypeIdentifier # | |||||
| NFDataX CycleTypeIdentifier Source # | |||||
Defined in Protocols.Experimental.Wishbone Methods deepErrorX :: String -> CycleTypeIdentifier # hasUndefined :: CycleTypeIdentifier -> Bool # ensureSpine :: CycleTypeIdentifier -> CycleTypeIdentifier # rnfX :: CycleTypeIdentifier -> () # | |||||
| ShowX CycleTypeIdentifier Source # | |||||
Defined in Protocols.Experimental.Wishbone Methods showsPrecX :: Int -> CycleTypeIdentifier -> ShowS # showX :: CycleTypeIdentifier -> String # showListX :: [CycleTypeIdentifier] -> ShowS # | |||||
| NFData CycleTypeIdentifier Source # | |||||
Defined in Protocols.Experimental.Wishbone Methods rnf :: CycleTypeIdentifier -> () # | |||||
| Generic CycleTypeIdentifier Source # | |||||
Defined in Protocols.Experimental.Wishbone Associated Types
Methods from :: CycleTypeIdentifier -> Rep CycleTypeIdentifier x # to :: Rep CycleTypeIdentifier x -> CycleTypeIdentifier # | |||||
| Show CycleTypeIdentifier Source # | |||||
Defined in Protocols.Experimental.Wishbone Methods showsPrec :: Int -> CycleTypeIdentifier -> ShowS # show :: CycleTypeIdentifier -> String # showList :: [CycleTypeIdentifier] -> ShowS # | |||||
| Eq CycleTypeIdentifier Source # | |||||
Defined in Protocols.Experimental.Wishbone Methods (==) :: CycleTypeIdentifier -> CycleTypeIdentifier -> Bool # (/=) :: CycleTypeIdentifier -> CycleTypeIdentifier -> Bool # | |||||
| type BitSize CycleTypeIdentifier Source # | |||||
Defined in Protocols.Experimental.Wishbone | |||||
| type Rep CycleTypeIdentifier Source # | |||||
Defined in Protocols.Experimental.Wishbone type Rep CycleTypeIdentifier = D1 ('MetaData "CycleTypeIdentifier" "Protocols.Experimental.Wishbone" "clash-protocols-0.1-inplace" 'True) (C1 ('MetaCons "CycleTypeIdentifier" 'PrefixI 'False) (S1 ('MetaSel ('Nothing :: Maybe Symbol) 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 (BitVector 3)))) | |||||
pattern Classic :: CycleTypeIdentifier Source #
Classic Wishbone cycle type
pattern ConstantAddressBurst :: CycleTypeIdentifier Source #
Burst Wishbone cycle using a constant address (and operation)
pattern IncrementingBurst :: CycleTypeIdentifier Source #
Burst incrementing the address based on burst-types
pattern EndOfBurst :: CycleTypeIdentifier Source #
Cycle-Type-Identifier signalling the end of a non-classic cycle
data BurstTypeExtension Source #
Burst-mode types when IncrementingBurst cycle type is used
Constructors
| LinearBurst | Linear address-increase |
| Beat4Burst | Wrap-4, address LSBs are modulo 4 |
| Beat8Burst | Wrap-8, address LSBs are modulo 8 |
| Beat16Burst | Wrap-16, address LSBs are modulo 16 |
Instances
| BitPack BurstTypeExtension Source # | |||||
Defined in Protocols.Experimental.Wishbone Associated Types
Methods pack :: BurstTypeExtension -> BitVector (BitSize BurstTypeExtension) # unpack :: BitVector (BitSize BurstTypeExtension) -> BurstTypeExtension # | |||||
| NFDataX BurstTypeExtension Source # | |||||
Defined in Protocols.Experimental.Wishbone Methods deepErrorX :: String -> BurstTypeExtension # hasUndefined :: BurstTypeExtension -> Bool # ensureSpine :: BurstTypeExtension -> BurstTypeExtension # rnfX :: BurstTypeExtension -> () # | |||||
| ShowX BurstTypeExtension Source # | |||||
Defined in Protocols.Experimental.Wishbone Methods showsPrecX :: Int -> BurstTypeExtension -> ShowS # showX :: BurstTypeExtension -> String # showListX :: [BurstTypeExtension] -> ShowS # | |||||
| NFData BurstTypeExtension Source # | |||||
Defined in Protocols.Experimental.Wishbone Methods rnf :: BurstTypeExtension -> () # | |||||
| Generic BurstTypeExtension Source # | |||||
Defined in Protocols.Experimental.Wishbone Associated Types
Methods from :: BurstTypeExtension -> Rep BurstTypeExtension x # to :: Rep BurstTypeExtension x -> BurstTypeExtension # | |||||
| Show BurstTypeExtension Source # | |||||
Defined in Protocols.Experimental.Wishbone Methods showsPrec :: Int -> BurstTypeExtension -> ShowS # show :: BurstTypeExtension -> String # showList :: [BurstTypeExtension] -> ShowS # | |||||
| Eq BurstTypeExtension Source # | |||||
Defined in Protocols.Experimental.Wishbone Methods (==) :: BurstTypeExtension -> BurstTypeExtension -> Bool # (/=) :: BurstTypeExtension -> BurstTypeExtension -> Bool # | |||||
| type BitSize BurstTypeExtension Source # | |||||
Defined in Protocols.Experimental.Wishbone | |||||
| type Rep BurstTypeExtension Source # | |||||
Defined in Protocols.Experimental.Wishbone type Rep BurstTypeExtension = D1 ('MetaData "BurstTypeExtension" "Protocols.Experimental.Wishbone" "clash-protocols-0.1-inplace" 'False) ((C1 ('MetaCons "LinearBurst" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "Beat4Burst" 'PrefixI 'False) (U1 :: Type -> Type)) :+: (C1 ('MetaCons "Beat8Burst" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "Beat16Burst" 'PrefixI 'False) (U1 :: Type -> Type))) | |||||
data WishboneMode Source #
Wishbone protocol mode that a component operates in
Constructors
| Standard | Standard mode, generally using a "wait-for-ack" approach |
| Pipelined | Pipelined mode, generally allowing for more asynchronous requests |
Instances
| Generic WishboneMode Source # | |||||
Defined in Protocols.Experimental.Wishbone Associated Types
| |||||
| Show WishboneMode Source # | |||||
Defined in Protocols.Experimental.Wishbone Methods showsPrec :: Int -> WishboneMode -> ShowS # show :: WishboneMode -> String # showList :: [WishboneMode] -> ShowS # | |||||
| Eq WishboneMode Source # | |||||
Defined in Protocols.Experimental.Wishbone | |||||
| type Rep WishboneMode Source # | |||||
Defined in Protocols.Experimental.Wishbone | |||||
data Wishbone (dom :: Domain) (mode :: WishboneMode) (addressBits :: Nat) (dataBytes :: Nat) Source #
The Wishbone protocol (http:/cdn.opencores.orgdownloads/wbspec_b4.pdf)
Instances
| (KnownNat aw, KnownNat dw) => IdleCircuit (Wishbone dom mode aw dw) Source # | |||||||||
| Protocol (Wishbone dom mode addressBits dataBytes) Source # | |||||||||
Defined in Protocols.Experimental.Wishbone Associated Types
| |||||||||
| type Bwd (Wishbone dom mode addressBits dataBytes) Source # | |||||||||
Defined in Protocols.Experimental.Wishbone | |||||||||
| type Fwd (Wishbone dom mode addressBits dataBytes) Source # | |||||||||
Defined in Protocols.Experimental.Wishbone | |||||||||
emptyWishboneM2S :: forall (addressBits :: Nat) (dataBytes :: Nat). (KnownNat addressBits, KnownNat dataBytes) => WishboneM2S addressBits dataBytes Source #
Construct "default" Wishbone M2S signals
emptyWishboneS2M :: forall (dataBytes :: Nat). KnownNat dataBytes => WishboneS2M dataBytes Source #
Construct "default" Wishbone S2M signals
hasBusActivity :: forall (addressBits :: Nat) (dataBytes :: Natural). (WishboneM2S addressBits dataBytes, WishboneS2M dataBytes) -> Bool Source #
Given a tuple of a wishbone request and corresponding response, determine
whether transactions are in progress(returns true for any hasTerminateFlag).
This is useful to determine whether a Wishbone bus is active.
>>>:{let m2s = (emptyWishboneM2S @32 @4){busCycle = True, strobe = True} s2m = emptyWishboneS2M{acknowledge = True} in hasBusActivity (m2s, s2m) :} True
>>>:{let m2s = (emptyWishboneM2S @32 @4){busCycle = True, strobe = True} s2m = emptyWishboneS2M{retry = True} in hasBusActivity (m2s, s2m) :} True
>>>:{let m2s = (emptyWishboneM2S @32 @4){busCycle = True} s2m = emptyWishboneS2M{acknowledge = True} in hasBusActivity (m2s, s2m) :} False
>>>:{let m2s = (emptyWishboneM2S @32 @4){busCycle = True, strobe = True} s2m = emptyWishboneS2M in hasBusActivity (m2s, s2m) :} False
>>>:{let m2s = emptyWishboneM2S @32 @4 s2m = emptyWishboneS2M{acknowledge = True} in hasBusActivity (m2s, s2m) :} False
hasTerminateFlag :: forall (dataBytes :: Natural). WishboneS2M dataBytes -> Bool Source #
Helper function to determine whether a Slave signals the termination of a cycle.
forceResetSanity :: forall (dom :: Domain) (mode :: WishboneMode) (aw :: Nat) (dw :: Nat). (KnownDomain dom, HiddenReset dom, KnownNat aw, KnownNat dw) => Circuit (Wishbone dom mode aw dw) (Wishbone dom mode aw dw) Source #
Force a nack on the backward channel and no data on the forward channel if reset is asserted.