clash-protocols
Safe HaskellNone
LanguageGHC2021

Protocols.Experimental.Wishbone.Standard

Description

Circuits and utilities for working with Standard-mode Wishbone circuits.

Synopsis

Documentation

roundrobin :: forall (n :: Nat) (dom :: Domain) (addressBits :: Nat) (dataBytes :: Nat). (KnownNat n, HiddenClockResetEnable dom, KnownNat addressBits, KnownNat dataBytes, 1 <= n) => Circuit (Wishbone dom 'Standard addressBits dataBytes) (Vec n (Wishbone dom 'Standard addressBits dataBytes)) Source #

Distribute requests amongst N slave circuits

sharedBus Source #

Arguments

:: forall (n :: Nat) (m :: Nat) (dom :: Domain) (addressBits :: Nat) (dataBytes :: Nat). (KnownNat n, KnownNat m, HiddenClockResetEnable dom, KnownNat addressBits, KnownNat dataBytes) 
=> (Signal dom (Index n, Index m, Vec n (WishboneM2S addressBits dataBytes)) -> Signal dom (Index n, Index m))

Function used to select which M-S pair should be connected next.

-> Circuit (Vec n (Wishbone dom 'Standard addressBits dataBytes)) (Vec m (Wishbone dom 'Standard addressBits dataBytes)) 

General-purpose shared-bus with N masters and M slaves.

A selector signal is used to compute the next M-S pair.

crossbarSwitch :: forall (n :: Nat) (m :: Nat) (dom :: Domain) (addressBits :: Nat) (dataBytes :: Nat). (KnownNat n, KnownNat m, KnownDomain dom, KnownNat addressBits, KnownNat dataBytes) => Circuit (CSignal dom (Vec n (Index m)), Vec n (Wishbone dom 'Standard addressBits dataBytes)) (Vec m (Wishbone dom 'Standard addressBits dataBytes)) Source #

Crossbar switch allowing N masters to be routed dynamically to M slaves.

data MemoryDelayState Source #

State used to guarantee correct response timing in memoryWb.

Constructors

Wait 
AckRead 

Instances

Instances details
NFDataX MemoryDelayState Source # 
Instance details

Defined in Protocols.Experimental.Wishbone.Standard

Generic MemoryDelayState Source # 
Instance details

Defined in Protocols.Experimental.Wishbone.Standard

Associated Types

type Rep MemoryDelayState 
Instance details

Defined in Protocols.Experimental.Wishbone.Standard

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

Defined in Protocols.Experimental.Wishbone.Standard

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

memoryWb :: forall (dom :: Domain) (addressBits :: Nat) (dataBytes :: Nat). (KnownDomain dom, KnownNat addressBits, KnownNat dataBytes, HiddenClockResetEnable dom) => (Signal dom (BitVector addressBits) -> Signal dom (Maybe (BitVector addressBits, BitVector (dataBytes * 8))) -> Signal dom (BitVector (dataBytes * 8))) -> Circuit (Wishbone dom 'Standard addressBits dataBytes) () Source #

Memory component circuit using a specific RAM function

This circuit uses Standard mode and only supports the classic cycle type. Because of this, the data rate is limited by the one-cycle delay of the RAM function when reading and the inserted stall-cycle.

The data rate could be increased by using registered feedback cycles or by using a pipelined circuit which would eliminate one wait cycle.

Since the underlying block RAM operates on the whole bitvector, the only accepted bus selector value is maxBound. All other bus selector values will cause an ERR response.

TODO create pipelined memory circuit