still compiling after refactoring field types

This commit is contained in:
Yehowshua Immanuel 2025-03-07 20:31:41 -05:00
parent 73d5e1204c
commit 3f50fe32f8
5 changed files with 95 additions and 74 deletions

View file

@ -2,24 +2,33 @@
{-# LANGUAGE NumericUnderscores #-}
module Read(Read.read) where
import DecodeTypes(
Opcode(..),
RTypeFields(..), ITypeFields(..), STypeFields(..),
BTypeFields(..), UTypeFields(..), JTypeFields(..),
)
import Clash.Prelude
import Types(DoubleWord, Addr)
import Decode(DecodeResult)
-- import Types(DoubleWord, RegFileIdx, Addr)
data RegVal = Value DoubleWord
| Borrowed
deriving (Generic, Show, Eq, NFDataX)
data SRC = GPR RegVal
| FPR RegVal
| CSR RegVal
| PC Addr
deriving (Generic, Show, Eq, NFDataX)
-- data SRC = GPR RegVal
-- | FPR RegVal
-- | CSR RegVal
-- | PC Addr
-- deriving (Generic, Show, Eq, NFDataX)
data ReadResult = ReadResult
{ src1 :: SRC,
src2 :: SRC,
src3 :: SRC
}
deriving (Generic, Show, Eq, NFDataX)
-- data ReadResult = ReadResult
-- { src1 :: SRC,
-- src2 :: SRC,
-- src3 :: SRC
-- }
-- deriving (Generic, Show, Eq, NFDataX)
read = 2
-- opcodeToReadResult :: Opcode -> ReadResult
-- opcodeToReadResult (ADD (RTypeFields _ rd funct3 rs1 rs2 funct7)) = undefined
-- opcodeToReadResult _ = undefined