summaryrefslogtreecommitdiff
path: root/app/Arch/Dummy.hs
blob: 4d2636922d2d621c698003253ee5f29b11a4e879 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
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
        [ "⠀⠁⠂⠃⠄⠅⠆⠇⡀⡁⡂⡃⡄⡅⡆⡇⠈⠉⠊⠋⠌⠍⠎⠏⡈⡉⡊⡋⡌⡍⡎⡏⠐⠑⠒⠓⠔⠕⠖⠗⡐⡑⡒⡓⡔⡕⡖⡗⠘⠙⠚⠛⠜⠝⠞⠟⡘⡙⡚⡛⡜⡝⡞⡟"
        , "⠠⠡⠢⠣⠤⠥⠦⠧⡠⡡⡢⡣⡤⡥⡦⡧⠨⠩⠪⠫⠬⠭⠮⠯⡨⡩⡪⡫⡬⡭⡮⡯⠰⠱⠲⠳⠴⠵⠶⠷⡰⡱⡲⡳⡴⡵⡶⡷⠸⠹⠺⠻⠼⠽⠾⠿⡸⡹⡺⡻⡼⡽⡾⡿"
        , "⢀⢁⢂⢃⢄⢅⢆⢇⣀⣁⣂⣃⣄⣅⣆⣇⢈⢉⢊⢋⢌⢍⢎⢏⣈⣉⣊⣋⣌⣍⣎⣏⢐⢑⢒⢓⢔⢕⢖⢗⣐⣑⣒⣓⣔⣕⣖⣗⢘⢙⢚⢛⢜⢝⢞⢟⣘⣙⣚⣛⣜⣝⣞⣟"
        , "⢠⢡⢢⢣⢤⢥⢦⢧⣠⣡⣢⣣⣤⣥⣦⣧⢨⢩⢪⢫⢬⢭⢮⢯⣨⣩⣪⣫⣬⣭⣮⣯⢰⢱⢲⢳⢴⢵⢶⢷⣰⣱⣲⣳⣴⣵⣶⣷⢸⢹⢺⢻⢼⢽⢾⢿⣸⣹⣺⣻⣼⣽⣾⣿"
        ]