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

@ -11,12 +11,13 @@ module DecodeTypes(
Opcode(..)
) where
import Clash.Prelude
import RegFiles(RegFileIdx, RegVal)
type FUNCT7 = Unsigned 7
type RS2 = Unsigned 5
type RS1 = Unsigned 5
type RS2 = RegVal
type RS1 = RegVal
type RD = RegFileIdx
type FUNCT3 = Unsigned 3
type RD = Unsigned 5
type OPCODE = Unsigned 7
type IMM12 = Unsigned 12
@ -24,12 +25,12 @@ type IMM13 = Unsigned 13
type IMM20 = Unsigned 20
type IMM21 = Unsigned 21
data RTypeFields = RTypeFields OPCODE RD FUNCT3 RS1 RS2 FUNCT7 deriving (Generic, Show, Eq, NFDataX)
data ITypeFields = ITypeFields OPCODE RD FUNCT3 RS1 IMM12 deriving (Generic, Show, Eq, NFDataX)
data STypeFields = STypeFields OPCODE FUNCT3 RS1 RS2 IMM12 deriving (Generic, Show, Eq, NFDataX)
data BTypeFields = BTypeFields OPCODE FUNCT3 RS1 RS2 IMM13 deriving (Generic, Show, Eq, NFDataX)
data UTypeFields = UTypeFields OPCODE RD IMM20 deriving (Generic, Show, Eq, NFDataX)
data JTypeFields = JTypeFields OPCODE RD IMM21 deriving (Generic, Show, Eq, NFDataX)
data RTypeFields = RTypeFields RD FUNCT3 RS1 RS2 FUNCT7 deriving (Generic, Show, Eq, NFDataX)
data ITypeFields = ITypeFields RD FUNCT3 RS1 IMM12 deriving (Generic, Show, Eq, NFDataX)
data STypeFields = STypeFields FUNCT3 RS1 RS2 IMM12 deriving (Generic, Show, Eq, NFDataX)
data BTypeFields = BTypeFields FUNCT3 RS1 RS2 IMM13 deriving (Generic, Show, Eq, NFDataX)
data UTypeFields = UTypeFields RD IMM20 deriving (Generic, Show, Eq, NFDataX)
data JTypeFields = JTypeFields RD IMM21 deriving (Generic, Show, Eq, NFDataX)
data Opcode
=