This repository has been archived on 2025-06-25. You can view files and clone it, but you cannot make any changes to it's state, such as pushing and creating new issues, pull requests or comments.
RiscV-Formal/hs/Types.hs

25 lines
577 B
Haskell

{-# LANGUAGE DataKinds #-}
{-# LANGUAGE NumericUnderscores #-}
module Types(Pc, BusVal(..), Mem, FullWord, Insn, Addr) where
import Clash.Prelude
type Byte = Unsigned 8
type HalfWord = Unsigned 16
type FullWord = Unsigned 32
type DoubleWord = Unsigned 64
type QuadWord = Unsigned 128
type Insn = FullWord
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