Skip to content

Commit

Permalink
Merge pull request #727 from bittide/rs/shake-catch
Browse files Browse the repository at this point in the history
Add a `catch` to the driver function to allow ILA data to be downloaded.
  • Loading branch information
rslawson authored Feb 26, 2025
2 parents df8c8bd + 27532a5 commit d69ed50
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions bittide-shake/src/Clash/Shake/Vivado.hs
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ import Clash.Shake.Extra (hexDigestFile)
import qualified Clash.Sized.Internal.BitVector as BitVector
import Control.Concurrent (threadDelay)
import Control.Concurrent.MVar (MVar, modifyMVar, newMVar)
import Control.Exception (try)
import Control.Exception (Exception (displayException), SomeException, catch, try)
import Control.Monad.Extra (andM, forM, forM_, orM, unless, when)
import Control.Monad.Reader (runReaderT)
import Data.Containers.ListUtils (nubOrd)
Expand Down Expand Up @@ -886,7 +886,13 @@ runHitlTestCase v testCase@HitlTestCase{name, parameters} driverFunc probesFileP
testCaseExitCode <- case driverFunc of
Just fn -> do
putStrLn $ "Running custom driver function for test " <> name
runReaderT (fn name testData) v
let
catchException :: SomeException -> IO ExitCode
catchException e = do
putStrLn $ "Caught exception while running driver function: " <> displayException e
putStrLn "Carrying on to save ILA data."
return $ ExitFailure 3
catch (runReaderT (fn name testData) v) catchException
Nothing -> do
putStrLn $ "Running default driver function for test " <> name

Expand Down

0 comments on commit d69ed50

Please sign in to comment.