Skip to content

Commit

Permalink
fixup! TEST: use whoami probe to ensure that CPUs are placed correctl…
Browse files Browse the repository at this point in the history
…y in JTAG chain
  • Loading branch information
rslawson committed Feb 20, 2025
1 parent 4a977e2 commit 98c291b
Showing 1 changed file with 11 additions and 4 deletions.
15 changes: 11 additions & 4 deletions bittide-instances/src/Bittide/Instances/Hitl/Driver/Demo.hs
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ import Bittide.Instances.Hitl.Utils.Vivado

import Control.Monad (forM_, zipWithM)
import Control.Monad.IO.Class
import Data.List.Extra (trim)
import Data.Maybe (fromMaybe)
import Data.String.Interpolate (i)
import Project.FilePath
Expand Down Expand Up @@ -260,8 +261,11 @@ driverFunc testName targets = do
liftIO
$ tryWithTimeout "Reading MU whoami over GDB" 15_000_000
$ readUntil gdb.stdoutHandle "END OF WHOAMI"
liftIO $ putStrLn [i|Output from MU whoami probe:\n#{gdbRead}|]
return ExitSuccess
let
idLine = trim . L.head . lines $ trim gdbRead
success = idLine == "(gdb) 0xe0000000:\t109 'm'\t103 'g'\t109 'm'\t116 't'"
liftIO $ putStrLn [i|Output from MU whoami probe:\n#{idLine}|]
return $ if success then ExitSuccess else ExitFailure 1

ccGdbCheck :: (HwTarget, DeviceInfo) -> ProcessStdIoHandles -> VivadoM ExitCode
ccGdbCheck (_, _) gdb = do
Expand All @@ -277,8 +281,11 @@ driverFunc testName targets = do
liftIO
$ tryWithTimeout "Reading CC whoami over GDB" 15_000_000
$ readUntil gdb.stdoutHandle "END OF WHOAMI"
liftIO $ putStrLn [i|Output from CC whoami probe:\n#{gdbRead}|]
return ExitSuccess
let
idLine = trim . L.head $ lines gdbRead
success = idLine == "(gdb) 0xe0000000:\t115 's'\t119 'w'\t99 'c'\t99 'c'"
liftIO $ putStrLn [i|Output from CC whoami probe:\n#{idLine}|]
return $ if success then ExitSuccess else ExitFailure 1

forM_ targets assertTestStart
tryWithTimeout "Wait for handshakes successes from all boards" 30_000_000 awaitHandshakes
Expand Down

0 comments on commit 98c291b

Please sign in to comment.