Skip to content

Instantly share code, notes, and snippets.

@cemerick
Last active February 22, 2018 19:55
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save cemerick/ee3016e55db93a44bfe98f323e701488 to your computer and use it in GitHub Desktop.
Save cemerick/ee3016e55db93a44bfe98f323e701488 to your computer and use it in GitHub Desktop.
module Core.Shift where
import CLaSH.Prelude
import CLaSH.Signal
import CLaSH.Sized.BitVector
import Data.Word
import Data.Bits
type Word256 = BitVector 256
shiftT :: Word256 -> Word256 -> (Word256, Word256)
shiftT _ inp = (0, shiftL inp 32)
{-# ANN topEntity
(defTop
{ t_name = "core_shift"
, t_inputs = ["input"]
, t_outputs = ["shifted"]
, t_extraIn = [ ("CLOCK_100", 1)
]
, t_clocks = [ clockWizard "clkwiz100" "CLOCK_100(0)" "" ]
}) #-}
topEntity :: Signal Word256 -> Signal Word256
topEntity = mealy shiftT 0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment