clash-protocols
Safe HaskellNone
LanguageGHC2021

Protocols.Experimental.Wishbone

Description

Types modelling the Wishbone bus protocol.

Synopsis

Documentation

data WishboneM2S (addressBits :: Nat) (dataBytes :: Natural) Source #

Data communicated from a Wishbone Master to a Wishbone Slave

Constructors

WishboneM2S 

Fields

  • addr :: "ADR" ::: BitVector addressBits

    The address output array [ADR_O()] is used to pass a binary address. The higher array boundary is specific to the address width of the core, and the lower array boundary is determined by the data port size and granularity. For example the array size on a 32-bit data port with BYTE granularity is [ADR_O(n..2)]. In some cases (such as FIFO interfaces) the array may not be present on the interface.

  • writeData :: "DAT_MOSI" ::: BitVector (dataBytes * 8)

    The data output array [DAT_O()] is used to pass binary data. The array boundaries are determined by the port size, with a maximum port size of 64-bits (e.g. [DAT_I(63..0)]).

  • busSelect :: "SEL" ::: BitVector dataBytes

    The select output array [SEL_O()] indicates where valid data is expected on the [DAT_I()] signal array during READ cycles, and where it is placed on the [DAT_O()] signal array during WRITE cycles. The array boundaries are determined by the granularity of a port. For example, if 8-bit granularity is used on a 64-bit port, then there would be an array of eight select signals with boundaries of [SEL_O(7..0)]. Each individual select signal correlates to one of eight active bytes on the 64-bit data port.

  • lock :: "LOCK" ::: Bool

    The lock output [LOCK_O] when asserted, indicates that the current bus cycle is uninterruptible. Lock is asserted to request complete ownership of the bus. Once the transfer has started, the INTERCON does not grant the bus to any other MASTER, until the current MASTER negates [LOCK_O] or [CYC_O].

  • busCycle :: "CYC" ::: Bool

    The cycle output [CYC_O], when asserted, indicates that a valid bus cycle is in progress. The signal is asserted for the duration of all bus cycles. For example, during a BLOCK transfer cycle there can be multiple data transfers. The [CYC_O] signal is asserted during the first data transfer, and remains asserted until the last data transfer. The [CYC_O] signal is useful for interfaces with multi-port interfaces (such as dual port memories). In these cases, the [CYC_O] signal requests use of a common bus from an arbiter.

  • strobe :: "STB" ::: Bool

    The strobe output [STB_O] indicates a valid data transfer cycle. It is used to qualify various other signals on the interface such as [SEL_O()]. The SLAVE asserts either the [ACK_I], [ERR_I] or [RTY_I] signals in response to every assertion of the [STB_O] signal.

  • writeEnable :: "WE" ::: Bool

    The write enable output [WE_O] indicates whether the current local bus cycle is a READ or WRITE cycle. The signal is negated during READ cycles, and is asserted during WRITE cycles.

  • cycleTypeIdentifier :: "CTI" ::: CycleTypeIdentifier

    The Cycle Type Identifier [CTI_IO()] Address Tag provides additional information about the current cycle. The MASTER sends this information to the SLAVE. The SLAVE can use this information to prepare the response for the next cycle.

  • burstTypeExtension :: "BTE" ::: BurstTypeExtension

    The Burst Type Extension [BTE_O()] Address Tag is sent by the MASTER to the SLAVE to provide additional information about the current burst. Currently this information is only relevant for incrementing bursts, but future burst types may use these signals.

Instances

Instances details
(KnownNat addressBits, KnownNat dataBytes) => BitPack (WishboneM2S addressBits dataBytes) Source # 
Instance details

Defined in Protocols.Experimental.Wishbone

Associated Types

type BitSize (WishboneM2S addressBits dataBytes) 
Instance details

Defined in Protocols.Experimental.Wishbone

type BitSize (WishboneM2S addressBits dataBytes) = CLog 2 (GConstructorCount (Rep (WishboneM2S addressBits dataBytes))) + GFieldSize (Rep (WishboneM2S addressBits dataBytes))

Methods

pack :: WishboneM2S addressBits dataBytes -> BitVector (BitSize (WishboneM2S addressBits dataBytes)) #

unpack :: BitVector (BitSize (WishboneM2S addressBits dataBytes)) -> WishboneM2S addressBits dataBytes #

(KnownNat addressBits, KnownNat dataBytes) => NFDataX (WishboneM2S addressBits dataBytes) Source # 
Instance details

Defined in Protocols.Experimental.Wishbone

Methods

deepErrorX :: String -> WishboneM2S addressBits dataBytes #

hasUndefined :: WishboneM2S addressBits dataBytes -> Bool #

ensureSpine :: WishboneM2S addressBits dataBytes -> WishboneM2S addressBits dataBytes #

rnfX :: WishboneM2S addressBits dataBytes -> () #

(KnownNat addressBits, KnownNat dataBytes) => ShowX (WishboneM2S addressBits dataBytes) Source # 
Instance details

Defined in Protocols.Experimental.Wishbone

Methods

showsPrecX :: Int -> WishboneM2S addressBits dataBytes -> ShowS #

showX :: WishboneM2S addressBits dataBytes -> String #

showListX :: [WishboneM2S addressBits dataBytes] -> ShowS #

NFData (WishboneM2S addressBits dataBytes) Source # 
Instance details

Defined in Protocols.Experimental.Wishbone

Methods

rnf :: WishboneM2S addressBits dataBytes -> () #

Generic (WishboneM2S addressBits dataBytes) Source # 
Instance details

Defined in Protocols.Experimental.Wishbone

Associated Types

type Rep (WishboneM2S addressBits dataBytes) 
Instance details

Defined in Protocols.Experimental.Wishbone

type Rep (WishboneM2S addressBits dataBytes) = D1 ('MetaData "WishboneM2S" "Protocols.Experimental.Wishbone" "clash-protocols-0.1-inplace" 'False) (C1 ('MetaCons "WishboneM2S" 'PrefixI 'True) (((S1 ('MetaSel ('Just "addr") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 ("ADR" ::: BitVector addressBits)) :*: S1 ('MetaSel ('Just "writeData") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 ("DAT_MOSI" ::: BitVector (dataBytes * 8)))) :*: (S1 ('MetaSel ('Just "busSelect") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 ("SEL" ::: BitVector dataBytes)) :*: S1 ('MetaSel ('Just "lock") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 ("LOCK" ::: Bool)))) :*: ((S1 ('MetaSel ('Just "busCycle") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 ("CYC" ::: Bool)) :*: S1 ('MetaSel ('Just "strobe") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 ("STB" ::: Bool))) :*: (S1 ('MetaSel ('Just "writeEnable") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 ("WE" ::: Bool)) :*: (S1 ('MetaSel ('Just "cycleTypeIdentifier") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 ("CTI" ::: CycleTypeIdentifier)) :*: S1 ('MetaSel ('Just "burstTypeExtension") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 ("BTE" ::: BurstTypeExtension)))))))

Methods

from :: WishboneM2S addressBits dataBytes -> Rep (WishboneM2S addressBits dataBytes) x #

to :: Rep (WishboneM2S addressBits dataBytes) x -> WishboneM2S addressBits dataBytes #

(KnownNat addressBits, KnownNat dataBytes) => Show (WishboneM2S addressBits dataBytes) Source # 
Instance details

Defined in Protocols.Experimental.Wishbone

Methods

showsPrec :: Int -> WishboneM2S addressBits dataBytes -> ShowS #

show :: WishboneM2S addressBits dataBytes -> String #

showList :: [WishboneM2S addressBits dataBytes] -> ShowS #

(KnownNat addressBits, KnownNat dataBytes) => Eq (WishboneM2S addressBits dataBytes) Source # 
Instance details

Defined in Protocols.Experimental.Wishbone

Methods

(==) :: WishboneM2S addressBits dataBytes -> WishboneM2S addressBits dataBytes -> Bool #

(/=) :: WishboneM2S addressBits dataBytes -> WishboneM2S addressBits dataBytes -> Bool #

type BitSize (WishboneM2S addressBits dataBytes) Source # 
Instance details

Defined in Protocols.Experimental.Wishbone

type BitSize (WishboneM2S addressBits dataBytes) = CLog 2 (GConstructorCount (Rep (WishboneM2S addressBits dataBytes))) + GFieldSize (Rep (WishboneM2S addressBits dataBytes))
type Rep (WishboneM2S addressBits dataBytes) Source # 
Instance details

Defined in Protocols.Experimental.Wishbone

type Rep (WishboneM2S addressBits dataBytes) = D1 ('MetaData "WishboneM2S" "Protocols.Experimental.Wishbone" "clash-protocols-0.1-inplace" 'False) (C1 ('MetaCons "WishboneM2S" 'PrefixI 'True) (((S1 ('MetaSel ('Just "addr") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 ("ADR" ::: BitVector addressBits)) :*: S1 ('MetaSel ('Just "writeData") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 ("DAT_MOSI" ::: BitVector (dataBytes * 8)))) :*: (S1 ('MetaSel ('Just "busSelect") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 ("SEL" ::: BitVector dataBytes)) :*: S1 ('MetaSel ('Just "lock") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 ("LOCK" ::: Bool)))) :*: ((S1 ('MetaSel ('Just "busCycle") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 ("CYC" ::: Bool)) :*: S1 ('MetaSel ('Just "strobe") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 ("STB" ::: Bool))) :*: (S1 ('MetaSel ('Just "writeEnable") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 ("WE" ::: Bool)) :*: (S1 ('MetaSel ('Just "cycleTypeIdentifier") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 ("CTI" ::: CycleTypeIdentifier)) :*: S1 ('MetaSel ('Just "burstTypeExtension") 'NoSourceUnpackedness 'NoSourceStrictness 'DecidedLazy) (Rec0 ("BTE" ::: BurstTypeExtension)))))))

data WishboneS2M (dataBytes :: Natural) Source #

Data communicated from a Wishbone Slave to a Wishbone Master

Constructors

WishboneS2M 

Fields

  • readData :: "DAT_MISO" ::: BitVector (dataBytes * 8)

    The data output array [DAT_O()] is used to pass binary data. The array boundaries are determined by the port size, with a maximum port size of 64-bits (e.g. [DAT_I(63..0)]).

  • acknowledge :: "ACK" ::: Bool

    The acknowledge output [ACK_O], when asserted, indicates the termination of a normal bus cycle. Also see the [ERR_O] and [RTY_O] signal descriptions.

  • err :: "ERR" ::: Bool

    The error output [ERR_O] indicates an abnormal cycle termination. The source of the error, and the response generated by the MASTER is defined by the IP core supplier. Also see the [ACK_O] and [RTY_O] signal descriptions.

  • stall :: "STALL" ::: Bool

    The pipeline stall signal [STALL_O] indicates that the slave cannot accept additional transactions in its queue. This signal is used in pipelined mode

  • retry :: "RTY" ::: Bool

    The retry output [RTY_O] indicates that the interface is not ready to accept or send data, and that the cycle should be retried. When and how the cycle is retried is defined by the IP core supplier. Also see the [ERR_O] and [RTY_O] signal descriptions.

Instances

Instances details
KnownNat dataBytes => BitPack (WishboneS2M dataBytes) Source # 
Instance details

Defined in Protocols.Experimental.Wishbone

Associated Types

type BitSize (WishboneS2M dataBytes) 
Instance details

Defined in Protocols.Experimental.Wishbone

type BitSize (WishboneS2M dataBytes) = CLog 2 (GConstructorCount (Rep (WishboneS2M dataBytes))) + GFieldSize (Rep (WishboneS2M dataBytes))

Methods

pack :: WishboneS2M dataBytes -> BitVector (BitSize (WishboneS2M dataBytes)) #

unpack :: BitVector (BitSize (WishboneS2M dataBytes)) -> WishboneS2M dataBytes #

KnownNat dataBytes => NFDataX (WishboneS2M dataBytes) Source # 
Instance details

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 # 
Instance details

Defined in Protocols.Experimental.Wishbone

Methods

showsPrecX :: Int -> WishboneS2M dataBytes -> ShowS #

showX :: WishboneS2M dataBytes -> String #

showListX :: [WishboneS2M dataBytes] -> ShowS #

NFData (WishboneS2M dataBytes) Source # 
Instance details

Defined in Protocols.Experimental.Wishbone

Methods

rnf :: WishboneS2M dataBytes -> () #

Generic (WishboneS2M dataBytes) Source # 
Instance details

Defined in Protocols.Experimental.Wishbone

Associated Types

type Rep (WishboneS2M dataBytes) 
Instance details

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))))))

Methods

from :: WishboneS2M dataBytes -> Rep (WishboneS2M dataBytes) x #

to :: Rep (WishboneS2M dataBytes) x -> WishboneS2M dataBytes #

KnownNat dataBytes => Show (WishboneS2M dataBytes) Source # 
Instance details

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 # 
Instance details

Defined in Protocols.Experimental.Wishbone

Methods

(==) :: WishboneS2M dataBytes -> WishboneS2M dataBytes -> Bool #

(/=) :: WishboneS2M dataBytes -> WishboneS2M dataBytes -> Bool #

type BitSize (WishboneS2M dataBytes) Source # 
Instance details

Defined in Protocols.Experimental.Wishbone

type BitSize (WishboneS2M dataBytes) = CLog 2 (GConstructorCount (Rep (WishboneS2M dataBytes))) + GFieldSize (Rep (WishboneS2M dataBytes))
type Rep (WishboneS2M dataBytes) Source # 
Instance details

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

Instances details
BitPack CycleTypeIdentifier Source # 
Instance details

Defined in Protocols.Experimental.Wishbone

NFDataX CycleTypeIdentifier Source # 
Instance details

Defined in Protocols.Experimental.Wishbone

ShowX CycleTypeIdentifier Source # 
Instance details

Defined in Protocols.Experimental.Wishbone

NFData CycleTypeIdentifier Source # 
Instance details

Defined in Protocols.Experimental.Wishbone

Methods

rnf :: CycleTypeIdentifier -> () #

Generic CycleTypeIdentifier Source # 
Instance details

Defined in Protocols.Experimental.Wishbone

Associated Types

type Rep CycleTypeIdentifier 
Instance details

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))))
Show CycleTypeIdentifier Source # 
Instance details

Defined in Protocols.Experimental.Wishbone

Eq CycleTypeIdentifier Source # 
Instance details

Defined in Protocols.Experimental.Wishbone

type BitSize CycleTypeIdentifier Source # 
Instance details

Defined in Protocols.Experimental.Wishbone

type Rep CycleTypeIdentifier Source # 
Instance details

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

Instances details
BitPack BurstTypeExtension Source # 
Instance details

Defined in Protocols.Experimental.Wishbone

NFDataX BurstTypeExtension Source # 
Instance details

Defined in Protocols.Experimental.Wishbone

ShowX BurstTypeExtension Source # 
Instance details

Defined in Protocols.Experimental.Wishbone

NFData BurstTypeExtension Source # 
Instance details

Defined in Protocols.Experimental.Wishbone

Methods

rnf :: BurstTypeExtension -> () #

Generic BurstTypeExtension Source # 
Instance details

Defined in Protocols.Experimental.Wishbone

Associated Types

type Rep BurstTypeExtension 
Instance details

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)))
Show BurstTypeExtension Source # 
Instance details

Defined in Protocols.Experimental.Wishbone

Eq BurstTypeExtension Source # 
Instance details

Defined in Protocols.Experimental.Wishbone

type BitSize BurstTypeExtension Source # 
Instance details

Defined in Protocols.Experimental.Wishbone

type Rep BurstTypeExtension Source # 
Instance details

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

Instances details
Generic WishboneMode Source # 
Instance details

Defined in Protocols.Experimental.Wishbone

Associated Types

type Rep WishboneMode 
Instance details

Defined in Protocols.Experimental.Wishbone

type Rep WishboneMode = D1 ('MetaData "WishboneMode" "Protocols.Experimental.Wishbone" "clash-protocols-0.1-inplace" 'False) (C1 ('MetaCons "Standard" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "Pipelined" 'PrefixI 'False) (U1 :: Type -> Type))
Show WishboneMode Source # 
Instance details

Defined in Protocols.Experimental.Wishbone

Eq WishboneMode Source # 
Instance details

Defined in Protocols.Experimental.Wishbone

type Rep WishboneMode Source # 
Instance details

Defined in Protocols.Experimental.Wishbone

type Rep WishboneMode = D1 ('MetaData "WishboneMode" "Protocols.Experimental.Wishbone" "clash-protocols-0.1-inplace" 'False) (C1 ('MetaCons "Standard" 'PrefixI 'False) (U1 :: Type -> Type) :+: C1 ('MetaCons "Pipelined" 'PrefixI 'False) (U1 :: Type -> Type))

data Wishbone (dom :: Domain) (mode :: WishboneMode) (addressBits :: Nat) (dataBytes :: Nat) Source #

The Wishbone protocol (http:/cdn.opencores.orgdownloads/wbspec_b4.pdf)

Instances

Instances details
(KnownNat aw, KnownNat dw) => IdleCircuit (Wishbone dom mode aw dw) Source # 
Instance details

Defined in Protocols.Experimental.Wishbone

Methods

idleFwd :: Proxy (Wishbone dom mode aw dw) -> Fwd (Wishbone dom mode aw dw) Source #

idleBwd :: Proxy (Wishbone dom mode aw dw) -> Bwd (Wishbone dom mode aw dw) Source #

Protocol (Wishbone dom mode addressBits dataBytes) Source # 
Instance details

Defined in Protocols.Experimental.Wishbone

Associated Types

type Fwd (Wishbone dom mode addressBits dataBytes) 
Instance details

Defined in Protocols.Experimental.Wishbone

type Fwd (Wishbone dom mode addressBits dataBytes) = Signal dom (WishboneM2S addressBits dataBytes)
type Bwd (Wishbone dom mode addressBits dataBytes) 
Instance details

Defined in Protocols.Experimental.Wishbone

type Bwd (Wishbone dom mode addressBits dataBytes) = Signal dom (WishboneS2M dataBytes)
type Bwd (Wishbone dom mode addressBits dataBytes) Source # 
Instance details

Defined in Protocols.Experimental.Wishbone

type Bwd (Wishbone dom mode addressBits dataBytes) = Signal dom (WishboneS2M dataBytes)
type Fwd (Wishbone dom mode addressBits dataBytes) Source # 
Instance details

Defined in Protocols.Experimental.Wishbone

type Fwd (Wishbone dom mode addressBits dataBytes) = Signal dom (WishboneM2S addressBits dataBytes)

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.