initial support for exceptions

This commit is contained in:
Yehowshua Immanuel 2025-03-02 23:12:02 -05:00
parent 5552ad3d4a
commit 88ec010f98
9 changed files with 116 additions and 42 deletions

View file

@ -12,7 +12,7 @@ import Data.Maybe (listToMaybe)
import Data.List (isPrefixOf)
import Text.Show.Pretty (ppShow)
import Simulation (simulation, Args(..), Simulation(..))
import Simulation (simulation, Args(..), Simulation(..), RISCVCPU(..), Machine(..))
main :: IO ()
main = do
@ -23,7 +23,7 @@ main = do
case simResult of
Success states -> do
-- mapM_ (putStrLn . ppShow) states -- Uncomment to print each state, if needed.
putStrLn $ "Last state: " ++ show (last states)
putStrLn $ "GPR last state: " ++ (show $ gpr $ cpu $ last states)
putStrLn $ "Executed for " ++ show (length states) ++ " cycles"
putStrLn "Simulation complete"
Failure err -> do