{-# LANGUAGE DataKinds #-}
{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE MagicHash #-}
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE TypeOperators #-}
module Clash.Xilinx.DDR
( iddr
, oddr
)
where
import GHC.Stack (HasCallStack, withFrozenCallStack)
import Clash.Explicit.Prelude
import Clash.Explicit.DDR
iddr
:: ( HasCallStack
, fast ~ 'Dom n pFast
, slow ~ 'Dom n (2*pFast)
, KnownNat m )
=> Clock slow gated
-> Reset slow synchronous
-> Signal fast (BitVector m)
-> Signal slow ((BitVector m),(BitVector m))
iddr clk rst = withFrozenCallStack ddrIn# clk rst 0 0 0
{-# NOINLINE iddr #-}
oddr
:: ( slow ~ 'Dom n (2*pFast)
, fast ~ 'Dom n pFast
, KnownNat m )
=> Clock slow gated
-> Reset slow synchronous
-> Signal slow (BitVector m,BitVector m)
-> Signal fast (BitVector m)
oddr clk rst = uncurry (withFrozenCallStack oddr# clk rst) . unbundle
oddr# :: ( slow ~ 'Dom n (2*pFast)
, fast ~ 'Dom n pFast
, KnownNat m )
=> Clock slow gated
-> Reset slow synchronous
-> Signal slow (BitVector m)
-> Signal slow (BitVector m)
-> Signal fast (BitVector m)
oddr# clk rst = ddrOut# clk rst 0
{-# NOINLINE oddr# #-}