{-# LANGUAGE AllowAmbiguousTypes #-}
{-# LANGUAGE RankNTypes #-}
{-# LANGUAGE ScopedTypeVariables #-}
{-# LANGUAGE TypeApplications #-}
{-# LANGUAGE TypeFamilies #-}
module Clash.Signal.Internal.Ambiguous
( knownVDomain
, clockPeriod
, activeEdge
, resetKind
, initBehavior
, resetPolarity
) where
import Clash.Signal.Internal
import Clash.Promoted.Nat (SNat)
clockPeriod
:: forall dom period
. (KnownDomain dom, DomainPeriod dom ~ period)
=> SNat period
clockPeriod :: SNat period
clockPeriod =
case KnownDomain dom => SDomainConfiguration dom (KnownConf dom)
forall (dom :: Domain).
KnownDomain dom =>
SDomainConfiguration dom (KnownConf dom)
knownDomain @dom of
SDomainConfiguration _dom :: SSymbol dom
_dom period :: SNat period
period _edge :: SActiveEdge edge
_edge _sync :: SResetKind reset
_sync _init :: SInitBehavior init
_init _polarity :: SResetPolarity polarity
_polarity ->
SNat period
SNat period
period
{-# NOINLINE clockPeriod #-}
activeEdge
:: forall dom edge
. (KnownDomain dom, DomainActiveEdge dom ~ edge)
=> SActiveEdge edge
activeEdge :: SActiveEdge edge
activeEdge =
case KnownDomain dom => SDomainConfiguration dom (KnownConf dom)
forall (dom :: Domain).
KnownDomain dom =>
SDomainConfiguration dom (KnownConf dom)
knownDomain @dom of
SDomainConfiguration _dom :: SSymbol dom
_dom _period :: SNat period
_period edge :: SActiveEdge edge
edge _sync :: SResetKind reset
_sync _init :: SInitBehavior init
_init _polarity :: SResetPolarity polarity
_polarity ->
SActiveEdge edge
SActiveEdge edge
edge
{-# NOINLINE activeEdge #-}
resetKind
:: forall dom sync
. (KnownDomain dom, DomainResetKind dom ~ sync)
=> SResetKind sync
resetKind :: SResetKind sync
resetKind =
case KnownDomain dom => SDomainConfiguration dom (KnownConf dom)
forall (dom :: Domain).
KnownDomain dom =>
SDomainConfiguration dom (KnownConf dom)
knownDomain @dom of
SDomainConfiguration _dom :: SSymbol dom
_dom _period :: SNat period
_period _edge :: SActiveEdge edge
_edge sync :: SResetKind reset
sync _init :: SInitBehavior init
_init _polarity :: SResetPolarity polarity
_polarity ->
SResetKind sync
SResetKind reset
sync
{-# NOINLINE resetKind #-}
initBehavior
:: forall dom init
. (KnownDomain dom, DomainInitBehavior dom ~ init)
=> SInitBehavior init
initBehavior :: SInitBehavior init
initBehavior =
case KnownDomain dom => SDomainConfiguration dom (KnownConf dom)
forall (dom :: Domain).
KnownDomain dom =>
SDomainConfiguration dom (KnownConf dom)
knownDomain @dom of
SDomainConfiguration _dom :: SSymbol dom
_dom _period :: SNat period
_period _edge :: SActiveEdge edge
_edge _sync :: SResetKind reset
_sync init_ :: SInitBehavior init
init_ _polarity :: SResetPolarity polarity
_polarity ->
SInitBehavior init
SInitBehavior init
init_
{-# NOINLINE initBehavior #-}
resetPolarity
:: forall dom polarity
. (KnownDomain dom, DomainResetPolarity dom ~ polarity)
=> SResetPolarity polarity
resetPolarity :: SResetPolarity polarity
resetPolarity =
case KnownDomain dom => SDomainConfiguration dom (KnownConf dom)
forall (dom :: Domain).
KnownDomain dom =>
SDomainConfiguration dom (KnownConf dom)
knownDomain @dom of
SDomainConfiguration _dom :: SSymbol dom
_dom _period :: SNat period
_period _edge :: SActiveEdge edge
_edge _sync :: SResetKind reset
_sync _init :: SInitBehavior init
_init polarity :: SResetPolarity polarity
polarity ->
SResetPolarity polarity
SResetPolarity polarity
polarity
{-# NOINLINE resetPolarity #-}
knownVDomain
:: forall dom
. KnownDomain dom
=> VDomainConfiguration
knownVDomain :: VDomainConfiguration
knownVDomain =
SDomainConfiguration dom (KnownConf dom) -> VDomainConfiguration
forall (dom :: Domain) (conf :: DomainConfiguration).
SDomainConfiguration dom conf -> VDomainConfiguration
vDomain (KnownDomain dom => SDomainConfiguration dom (KnownConf dom)
forall (dom :: Domain).
KnownDomain dom =>
SDomainConfiguration dom (KnownConf dom)
knownDomain @dom)