RiscV-Formal/hs/Types.hs

26 lines
577 B
Haskell
Raw Normal View History

2025-02-13 04:54:15 +00:00
{-# LANGUAGE DataKinds #-}
{-# LANGUAGE NumericUnderscores #-}
2025-02-19 06:21:02 +00:00
module Types(Pc, BusVal(..), Mem, FullWord, Insn, Addr) where
2025-02-13 04:54:15 +00:00
import Clash.Prelude
type Byte = Unsigned 8
type HalfWord = Unsigned 16
type FullWord = Unsigned 32
type DoubleWord = Unsigned 64
type QuadWord = Unsigned 128
2025-02-19 06:21:02 +00:00
type Insn = FullWord
2025-02-13 04:54:15 +00:00
data BusVal
= BusByte Byte
| BusHalfWord HalfWord
| BusWord FullWord
| BusDoubleWord DoubleWord
| BusQuadWord QuadWord
deriving (Generic, Show, Eq, NFDataX)
type Pc = DoubleWord
type Addr = DoubleWord
type Mem n = Vec n FullWord