content: {-# LANGUAGE ScopedTypeVariables #-}
  module Gen where
  
  import Arch_Defs
  import GPR_File
  import CSR_File
  import Forvis_Spec_I
  import Memory
  
  import Data.Bits
  
  import Encoder
  import PIPE
  
  import qualified Data.Map.Strict as Data_Map
  import qualified Data.Set as Data_Set
  import Data.Set (Set)
  import Data.Maybe (isJust, fromJust)
  import qualified Data.List as Data_List
  
  -- TODO: Maybe it would be better to delete all the Reader stuff??
  import Control.Monad.Reader
  
  import Machine_State
  
  import Control.Arrow (second)
  import Test.QuickCheck
  
  import Control.Monad.Reader
  
  import Debug.Trace
  import Run_Program_PIPE
  
  initMachine = 
    let initial_PC     = 0
        misa           = ((    shiftL  1  misa_A_bitpos)
                          .|. (shiftL  1  misa_I_bitpos)
                          .|. (shiftL  1  misa_M_bitpos)
                          .|. (shiftL  1  misa_S_bitpos)
                          .|. (shiftL  1  misa_U_bitpos)
                          .|. (shiftL  xl_rv32  misa_MXL_bitpos_RV32))
        mem_base       = 0
        mem_size       = 0xFFFFFFFFFFFFFFFF
        addr_ranges    = [(mem_base, mem_base + mem_size)]
        addr_byte_list = []
    in mkMachine_State  RV32  misa  initial_PC  addr_ranges  addr_byte_list
  
  