summaryrefslogtreecommitdiff
path: root/app/Arch/Dummy.hs
diff options
context:
space:
mode:
authorPaul Oliver <contact@pauloliver.dev>2024-02-29 02:55:06 +0100
committerPaul Oliver <contact@pauloliver.dev>2024-02-29 02:55:06 +0100
commita5a5e7f275de6ec9784f75a3e2d313e4eee807fa (patch)
treeffdb76e5a312ce4490b04265c7301463b8958729 /app/Arch/Dummy.hs
Initial (WIP)HEADmaster
Diffstat (limited to 'app/Arch/Dummy.hs')
-rw-r--r--app/Arch/Dummy.hs56
1 files changed, 56 insertions, 0 deletions
diff --git a/app/Arch/Dummy.hs b/app/Arch/Dummy.hs
new file mode 100644
index 0000000..4d26369
--- /dev/null
+++ b/app/Arch/Dummy.hs
@@ -0,0 +1,56 @@
+{-# LANGUAGE Strict #-}
+{-# LANGUAGE TemplateHaskell #-}
+{-# LANGUAGE TypeFamilies #-}
+
+module Arch.Dummy
+ ( Process(..)
+ , procAncestor
+ , procMemBlocks
+ , procRep
+ , procSliceM
+ , procStepM
+ , bimapMnemonic
+ , bimapSymbol
+ ) where
+
+import Control.Monad.ST (ST)
+import Data.Bimap (Bimap, fromList)
+import Data.Vector.Unboxed.Deriving (derivingUnbox)
+import qualified Data.Vector.Unboxed.Mutable as M (STVector)
+import Data.Word (Word64, Word8)
+import Text.Printf (printf)
+
+data Process =
+ Process
+ deriving (Show)
+
+$(derivingUnbox "Process" [t|Process -> Word64|] [|const 1|] [|const Process|])
+
+procAncestor :: Process
+procAncestor = Process
+
+procMemBlocks :: Process -> [(Word64, Word64)]
+procMemBlocks _ = []
+
+procRep :: Process -> [(String, String)]
+procRep _ = [("dmmy", "----")]
+
+procSliceM :: M.STVector s Process -> M.STVector s Word8 -> Word64 -> ST s Word64
+procSliceM _ _ _ = return 1
+
+procStepM :: M.STVector s Process -> M.STVector s Word8 -> Word64 -> ST s (Maybe Process)
+procStepM _ _ _ = return Nothing
+
+bimapMnemonic :: Bimap Word8 [String]
+bimapMnemonic = fromList [(i, ["dmmy", printf "0x%x" i]) | i <- [0 .. 0xff]]
+
+bimapSymbol :: Bimap Word8 Char
+bimapSymbol =
+ fromList
+ $ zip [0 .. 0xff]
+ $ concat
+ [ "⠀⠁⠂⠃⠄⠅⠆⠇⡀⡁⡂⡃⡄⡅⡆⡇⠈⠉⠊⠋⠌⠍⠎⠏⡈⡉⡊⡋⡌⡍⡎⡏⠐⠑⠒⠓⠔⠕⠖⠗⡐⡑⡒⡓⡔⡕⡖⡗⠘⠙⠚⠛⠜⠝⠞⠟⡘⡙⡚⡛⡜⡝⡞⡟"
+ , "⠠⠡⠢⠣⠤⠥⠦⠧⡠⡡⡢⡣⡤⡥⡦⡧⠨⠩⠪⠫⠬⠭⠮⠯⡨⡩⡪⡫⡬⡭⡮⡯⠰⠱⠲⠳⠴⠵⠶⠷⡰⡱⡲⡳⡴⡵⡶⡷⠸⠹⠺⠻⠼⠽⠾⠿⡸⡹⡺⡻⡼⡽⡾⡿"
+ , "⢀⢁⢂⢃⢄⢅⢆⢇⣀⣁⣂⣃⣄⣅⣆⣇⢈⢉⢊⢋⢌⢍⢎⢏⣈⣉⣊⣋⣌⣍⣎⣏⢐⢑⢒⢓⢔⢕⢖⢗⣐⣑⣒⣓⣔⣕⣖⣗⢘⢙⢚⢛⢜⢝⢞⢟⣘⣙⣚⣛⣜⣝⣞⣟"
+ , "⢠⢡⢢⢣⢤⢥⢦⢧⣠⣡⣢⣣⣤⣥⣦⣧⢨⢩⢪⢫⢬⢭⢮⢯⣨⣩⣪⣫⣬⣭⣮⣯⢰⢱⢲⢳⢴⢵⢶⢷⣰⣱⣲⣳⣴⣵⣶⣷⢸⢹⢺⢻⢼⢽⢾⢿⣸⣹⣺⣻⣼⣽⣾⣿"
+ ]