Skip to content

Instantly share code, notes, and snippets.

@bgamari
Created November 30, 2017 19:57
Show Gist options
  • Save bgamari/94cf12785f520f35809b7dc33d0a0cf3 to your computer and use it in GitHub Desktop.
Save bgamari/94cf12785f520f35809b7dc33d0a0cf3 to your computer and use it in GitHub Desktop.
module Hello where
import Clash.Prelude
{-# ANN maybeTest (defTop { t_name = "test"
, t_inputs = [PortName "hi"]
, t_output = PortName "out"}) #-}
maybeTest :: Signal clk (Unsigned 32) -> Signal clk (Unsigned 16) -> Signal clk (Unsigned 32)
maybeTest x y = x
@bgamari
Copy link
Author

bgamari commented Nov 30, 2017

Clash.Prelude> :verilog Hello.hs
Loading dependencies took 0.724603588s
Compiling: Hello.maybeTest
Applied 1 transformations
Normalisation took 0.001997219s
*** Exception: Clash.Netlist.Util(82): Not in normal from: no Letrec:

Λclk ->
λ(x :: Clash.Signal.Internal.Signal
         clk (Clash.Sized.Internal.Unsigned.Unsigned 32)) ->
λ(y :: Clash.Signal.Internal.Signal
         clk (Clash.Sized.Internal.Unsigned.Unsigned 16)) ->
x

Which has type:

∀ (clk :: Clash.Signal.Internal.Domain).
Clash.Signal.Internal.Signal
  clk (Clash.Sized.Internal.Unsigned.Unsigned 32)
-> Clash.Signal.Internal.Signal
     clk (Clash.Sized.Internal.Unsigned.Unsigned 16)
-> Clash.Signal.Internal.Signal
     clk (Clash.Sized.Internal.Unsigned.Unsigned 32)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment