Skip to content

Commit

Permalink
Got it to build. Disabled segment20176 for now until refactoring can …
Browse files Browse the repository at this point in the history
…be done
  • Loading branch information
lisphacker committed Oct 22, 2023
1 parent 1620cbf commit 89330db
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 7 deletions.
12 changes: 7 additions & 5 deletions src/TIS100/Sim/Run.hs
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,13 @@ type RWTileVector = MV.MVector RealWorld CPU.PositionedTile

dumpSimState :: String -> SimState -> IO ()
dumpSimState prefix s = do
print $ prefix
print $ " " ++ show (((flip (V.!)) 1) . CPU.tiles . cpu $ s)
print $ " " ++ show (((flip (V.!)) 2) . CPU.tiles . cpu $ s)
print $ " IN1: " ++ show (IM.lookup 1 $ inputs s)
print $ " IN2: " ++ show (IM.lookup 2 $ inputs s)
return ()

-- print $ prefix
-- print $ " " ++ show (((flip (V.!)) 1) . CPU.tiles . cpu $ s)
-- print $ " " ++ show (((flip (V.!)) 2) . CPU.tiles . cpu $ s)
-- print $ " IN1: " ++ show (IM.lookup 1 $ inputs s)
-- print $ " IN2: " ++ show (IM.lookup 2 $ inputs s)

loopUntilNoChange :: Int -> SimState -> IO SimState
loopUntilNoChange i s = do
Expand Down
2 changes: 1 addition & 1 deletion src/TIS100/Tiles/T21.hs
Original file line number Diff line number Diff line change
Expand Up @@ -245,7 +245,7 @@ instance IsConnectedTile T21 where
Nothing -> t
Just (MOV (Port p') dst) ->
if p == p'
then case getPortVal p t of
then case getPortVal True p t of
(t', Just v) -> incPC $ writeRegOrPort dst (t', Just v)
(t', Nothing) -> t'
else t
Expand Down
3 changes: 2 additions & 1 deletion test/Sim/Tests.hs
Original file line number Diff line number Diff line change
Expand Up @@ -32,4 +32,5 @@ testExampleAsm n asmFilePath cfgFilePath = do
simTestsSpec :: Spec
simTestsSpec = parallel $ do
testExampleAsm "segment00150" "examples/segment00150/segment00150.asm" "examples/segment00150/segment00150.cfg"
testExampleAsm "segment20176" "examples/segment20176/segment20176.asm" "examples/segment20176/segment20176.cfg"

-- testExampleAsm "segment20176" "examples/segment20176/segment20176.asm" "examples/segment20176/segment20176.cfg"

0 comments on commit 89330db

Please sign in to comment.