Skip to content

Commit

Permalink
Enable JTAG tests
Browse files Browse the repository at this point in the history
Fixes #4
  • Loading branch information
martijnbastiaan committed Mar 29, 2024
1 parent 402f3cb commit 8c8d5a9
Show file tree
Hide file tree
Showing 12 changed files with 11 additions and 182 deletions.
4 changes: 4 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -162,6 +162,10 @@ jobs:
run: |
tar -x -f vexriscv-test-binaries.tar
- name: OpenOCD bin symlink
run: |
ln -s /opt/bin/openocd /opt/bin/openocd-vexriscv
- name: Run `clash-vexriscv` unittests
run: |
cabal run clash-vexriscv:unittests
Expand Down
10 changes: 0 additions & 10 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,5 @@ opt-level = "z"
[workspace]
members = [
"clash-vexriscv-sim/test-programs",
"debug-test",
]
resolver = "2"
1 change: 1 addition & 0 deletions clash-vexriscv-sim/test-programs/src/bin/print_a.expected
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
[CPU] a
File renamed without changes.
1 change: 1 addition & 0 deletions clash-vexriscv-sim/test-programs/src/bin/print_b.expected
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
[CPU] b
File renamed without changes.
11 changes: 5 additions & 6 deletions clash-vexriscv-sim/tests/tests.hs
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import qualified Data.List as L

import Control.Monad (forM)
import Data.Maybe (catMaybes, mapMaybe)
import Data.Tuple.Extra (fst3)
import Data.Word (Word8)
import GHC.Base (when)
import System.Directory (copyFile, doesFileExist, listDirectory)
Expand All @@ -23,8 +24,7 @@ import Test.Tasty.HUnit (Assertion, testCase, (@?=))
import Utils.ProgramLoad (loadProgramDmem)
import Utils.Cpu (cpu)

-- XXX: Disabled, we need to add OpenOCD + GDB to CI (or use the Nix shell?)
-- import qualified Tests.Jtag
import qualified Tests.Jtag

runProgramExpect ::
-- | action to copy ELF file
Expand Down Expand Up @@ -109,8 +109,8 @@ runTest name mode n elfPath expectPath =

main :: IO ()
main = do
debugTests <- findTests sourceDir debugBinDir
releaseTests <- findTests sourceDir releaseBinDir
debugTests <- L.sortOn fst3 <$> findTests sourceDir debugBinDir
releaseTests <- L.sortOn fst3 <$> findTests sourceDir releaseBinDir

when (L.null debugTests) $ do
hPutStrLn stderr "No debug tests found! Was `cargo build` run?"
Expand All @@ -131,8 +131,7 @@ main = do
"VexRiscv Tests"
[ testGroup "Debug builds" debugTestCases
, testGroup "Release builds" releaseTestCases
-- XXX: Disabled, we need to add OpenOCD + GDB to CI (or use the Nix shell?)
-- , Tests.Jtag.tests
, Tests.Jtag.tests
]

defaultMain tests
18 changes: 0 additions & 18 deletions debug-test/Cargo.toml

This file was deleted.

23 changes: 0 additions & 23 deletions debug-test/build.rs

This file was deleted.

18 changes: 0 additions & 18 deletions debug-test/memory.x

This file was deleted.

106 changes: 0 additions & 106 deletions debug-test/src/main.rs

This file was deleted.

0 comments on commit 8c8d5a9

Please sign in to comment.