Skip to content

Commit

Permalink
Add 'tests/shouldfail/Cores/' from commit '4a6a82ab88b43de7e1b2639d3b…
Browse files Browse the repository at this point in the history
…c42f0e5788589c'

git-subtree-dir: tests/shouldfail/Cores
git-subtree-mainline: e205083
git-subtree-split: 4a6a82a
  • Loading branch information
t-wallet committed Aug 26, 2024
2 parents e205083 + 4a6a82a commit 6e65384
Show file tree
Hide file tree
Showing 7 changed files with 106 additions and 0 deletions.
15 changes: 15 additions & 0 deletions tests/shouldfail/Cores/Xilinx/VIO/DuplicateInputNames.hs
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
module DuplicateInputNames where

import Clash.Prelude
import Clash.Cores.Xilinx.VIO

type Dom = XilinxSystem

inNames = "a" :> "a" :> Nil
outNames = "b" :> Nil

topEntity ::
"clk" ::: Clock Dom ->
"in" ::: Signal Dom (Bit, Bit) ->
"out" ::: Signal Dom Bit
topEntity = vioProbe @Dom inNames outNames 0
15 changes: 15 additions & 0 deletions tests/shouldfail/Cores/Xilinx/VIO/DuplicateInputOutputNames.hs
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
module DuplicateInputOutputNames where

import Clash.Prelude
import Clash.Cores.Xilinx.VIO

type Dom = XilinxSystem

inNames = "a" :> Nil
outNames = "a" :> Nil

topEntity ::
"clk" ::: Clock Dom ->
"in" ::: Signal Dom Bit ->
"out" ::: Signal Dom Bit
topEntity = vioProbe @Dom inNames outNames 0
14 changes: 14 additions & 0 deletions tests/shouldfail/Cores/Xilinx/VIO/DuplicateOutputNames.hs
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
module DuplicateOutputNames where

import Clash.Prelude
import Clash.Cores.Xilinx.VIO

type Dom = XilinxSystem

inNames = Nil
outNames = "a" :> "a" :> Nil

topEntity ::
"clk" ::: Clock Dom ->
"out" ::: Signal Dom (Bit, Bit)
topEntity = vioProbe @Dom inNames outNames (0, 0)
15 changes: 15 additions & 0 deletions tests/shouldfail/Cores/Xilinx/VIO/InputBusWidthExceeded.hs
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
module InputBusWidthExceeded where

import Clash.Prelude
import Clash.Cores.Xilinx.VIO

type Dom = XilinxSystem

inNames = singleton "probe_in"
outNames = Nil

topEntity ::
"clk" ::: Clock Dom ->
"in" ::: Signal Dom (BitVector 257) ->
"out" ::: Signal Dom ()
topEntity = vioProbe @Dom inNames outNames ()
17 changes: 17 additions & 0 deletions tests/shouldfail/Cores/Xilinx/VIO/InputProbesExceeded.hs
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
module InputProbesExceeded where

import Clash.Prelude
import Clash.Cores.Xilinx.VIO

import qualified Data.List as L

type Dom = XilinxSystem

inNames = $(listToVecTH (L.map (("probe_in_" <>) . show) [0::Int, 1..256]))
outNames = Nil

topEntity ::
"clk" ::: Clock Dom ->
"in" ::: Signal Dom (Vec 257 Bool) ->
"out" ::: Signal Dom ()
topEntity = vioProbe @Dom inNames outNames ()
14 changes: 14 additions & 0 deletions tests/shouldfail/Cores/Xilinx/VIO/OutputBusWidthExceeded.hs
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
module OutputBusWidthExceeded where

import Clash.Prelude
import Clash.Cores.Xilinx.VIO

type Dom = XilinxSystem

inNames = Nil
outNames = singleton "probe_out"

topEntity ::
"clk" ::: Clock Dom ->
"out" ::: Signal Dom (BitVector 257)
topEntity = vioProbe @Dom inNames outNames 0
16 changes: 16 additions & 0 deletions tests/shouldfail/Cores/Xilinx/VIO/OutputProbesExceeded.hs
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
module OutputProbesExceeded where

import Clash.Prelude
import Clash.Cores.Xilinx.VIO

import qualified Data.List as L

type Dom = XilinxSystem

inNames = Nil
outNames = $(listToVecTH (L.map (("probe_out_" <>) . show) [0::Int, 1..256]))

topEntity ::
"clk" ::: Clock Dom ->
"out" ::: Signal Dom (Vec 257 Bit)
topEntity = vioProbe @Dom inNames outNames (replicate (SNat @257) low)

0 comments on commit 6e65384

Please sign in to comment.