hopefully progressing to a more scalable bus architecture
This commit is contained in:
parent
003a1c8545
commit
1f9bd2f015
13 changed files with 187 additions and 46 deletions
52
hs/BusTypes.hs
Normal file
52
hs/BusTypes.hs
Normal file
|
@ -0,0 +1,52 @@
|
|||
{-# OPTIONS_GHC -Wno-unrecognised-pragmas #-}
|
||||
module BusTypes(
|
||||
BusError(..),
|
||||
TransactionSize(..),
|
||||
Request(..),
|
||||
BusResponse(..),
|
||||
BusVal(..),
|
||||
ReadResponse(..),
|
||||
WriteResponse(..)
|
||||
) where
|
||||
|
||||
import Clash.Prelude
|
||||
|
||||
import Peripherals.Ram(Ram, RamLine)
|
||||
import Machine(Peripherals(..))
|
||||
import Types(Addr,
|
||||
Byte, HalfWord, FullWord, DoubleWord, QuadWord)
|
||||
|
||||
data BusError
|
||||
= UnMapped
|
||||
| UnAligned
|
||||
deriving (Generic, Show, Eq, NFDataX)
|
||||
|
||||
data TransactionSize
|
||||
= SizeByte
|
||||
| SizeHalfWord
|
||||
| SizeWord
|
||||
| SizeDoubleWord
|
||||
| SizeQuadWord
|
||||
deriving (Generic, Show, Eq, NFDataX)
|
||||
|
||||
data Request = Request Addr TransactionSize
|
||||
deriving (Generic, Show, Eq, NFDataX)
|
||||
|
||||
data BusResponse a
|
||||
= Result a
|
||||
| Error BusError
|
||||
deriving (Generic, Show, Eq, NFDataX)
|
||||
|
||||
data BusVal
|
||||
= BusByte Byte
|
||||
| BusHalfWord HalfWord
|
||||
| BusWord FullWord
|
||||
| BusDoubleWord DoubleWord
|
||||
| BusQuadWord QuadWord
|
||||
deriving (Generic, Show, Eq, NFDataX)
|
||||
|
||||
newtype ReadResponse = ReadResponse (BusResponse BusVal)
|
||||
deriving (Generic, Show, Eq, NFDataX)
|
||||
|
||||
newtype WriteResponse = WriteResponse (BusResponse ())
|
||||
deriving (Generic, Show, Eq, NFDataX)
|
Reference in a new issue