{-# OPTIONS --safe --cubical #-}
module Spartan6.Primitive.Clock where
open import Spartan6.Prelude
open import Spartan6.Semantics.Design using (Event; idle; risingEdge)
bufg : Bit → Bit
bufg input = input
bufgce : Bit → Bit → Bit
bufgce input enable = mux enable low input
transportEvent : Event → Event
transportEvent event = event
gateEvent : Bit → Event → Event
gateEvent enable idle = idle
gateEvent false risingEdge = idle
gateEvent true risingEdge = risingEdge
bufg-transports : ∀ input → bufg input ≡ input
bufg-transports input = refl
bufgce-disabled : ∀ input → bufgce input low ≡ low
bufgce-disabled input = refl
bufgce-enabled : ∀ input → bufgce input high ≡ input
bufgce-enabled input = refl
disabled-rising-edge-is-suppressed : gateEvent low risingEdge ≡ idle
disabled-rising-edge-is-suppressed = refl
enabled-rising-edge-is-transported : gateEvent high risingEdge ≡ risingEdge
enabled-rising-edge-is-transported = refl