clash-prelude-0.99.1: CAES Language for Synchronous Hardware - Prelude library

Copyright(C) 2015-2016 University of Twente
2017 Myrtle Software Ltd Google Inc.
LicenseBSD2 (see the file LICENSE)
MaintainerChristiaan Baaij <christiaan.baaij@gmail.com>
Safe HaskellTrustworthy
LanguageHaskell2010
Extensions
  • Cpp
  • MonoLocalBinds
  • ScopedTypeVariables
  • BangPatterns
  • TypeFamilies
  • DataKinds
  • FlexibleContexts
  • MagicHash
  • KindSignatures
  • TypeOperators
  • ExplicitNamespaces
  • ExplicitForAll
  • TypeApplications

Clash.Explicit.RAM

Contents

Description

RAM primitives with a combinational read port.

Synopsis

RAM synchronised to an arbitrary clock

asyncRam Source #

Arguments

:: (Enum addr, HasCallStack) 
=> Clock wdom wgated

Clock to which to synchronise the write port of the RAM

-> Clock rdom rgated

Clock to which the read address signal, r, is synchronised

-> SNat n

Size n of the RAM

-> Signal rdom addr

Read address r

-> Signal wdom (Maybe (addr, a))

(write address w, value to write)

-> Signal rdom a

Value of the RAM at address r

Create a RAM with space for n elements

Additional helpful information:

asyncRamPow2 Source #

Arguments

:: (KnownNat n, HasCallStack) 
=> Clock wdom wgated

Clock to which to synchronise the write port of the RAM

-> Clock rdom rgated

Clock to which the read address signal, r, is synchronised

-> Signal rdom (Unsigned n)

Read address r

-> Signal wdom (Maybe (Unsigned n, a))

(write address w, value to write)

-> Signal rdom a

Value of the RAM at address r

Create a RAM with space for 2^n elements

Additional helpful information:

Internal

asyncRam# Source #

Arguments

:: HasCallStack 
=> Clock wdom wgated

Clock to which to synchronise the write port of the RAM

-> Clock rdom rgated

Clock to which the read address signal, r, is synchronised

-> SNat n

Size n of the RAM

-> Signal rdom Int

Read address r

-> Signal wdom Bool

Write enable

-> Signal wdom Int

Write address w

-> Signal wdom a

Value to write (at address w)

-> Signal rdom a

Value of the RAM at address r

RAM primitive