initial support for Bus types
This commit is contained in:
parent
66464daf0c
commit
21a3ee7f7a
7
bs/Bus.bs
Normal file
7
bs/Bus.bs
Normal file
|
@ -0,0 +1,7 @@
|
||||||
|
package Bus(a) where
|
||||||
|
|
||||||
|
import Types
|
||||||
|
import BusTypes
|
||||||
|
|
||||||
|
a :: UInt 5
|
||||||
|
a = 3
|
33
bs/BusTypes.bs
Normal file
33
bs/BusTypes.bs
Normal file
|
@ -0,0 +1,33 @@
|
||||||
|
package BusTypes(BusVal, TransactionSize) where
|
||||||
|
|
||||||
|
import Types
|
||||||
|
|
||||||
|
data BusError
|
||||||
|
= UnMapped
|
||||||
|
| UnAligned
|
||||||
|
deriving (Bits, Eq, FShow)
|
||||||
|
|
||||||
|
data TransactionSize
|
||||||
|
= SizeByte
|
||||||
|
| SizeHalfWord
|
||||||
|
| SizeFullWord
|
||||||
|
| SizeDoubleWord
|
||||||
|
| SizeQuadWord
|
||||||
|
deriving (Bits, Eq, FShow)
|
||||||
|
|
||||||
|
data BusVal
|
||||||
|
= BusByte Byte
|
||||||
|
| BusHalfWord HalfWord
|
||||||
|
| BusFullWord FullWord
|
||||||
|
| BusDoubleWord DoubleWord
|
||||||
|
| BusQuadWord QuadWord
|
||||||
|
deriving (Bits, Eq, FShow)
|
||||||
|
|
||||||
|
data ReadRequest = ReadRequest Addr TransactionSize
|
||||||
|
deriving (Bits, Eq, FShow)
|
||||||
|
|
||||||
|
data WriteRequest = WriteRequest Addr BusVal
|
||||||
|
deriving (Bits, Eq, FShow)
|
||||||
|
|
||||||
|
a :: UInt 5
|
||||||
|
a = 3
|
|
@ -5,6 +5,7 @@ import Core
|
||||||
import Serializer
|
import Serializer
|
||||||
import BRAM
|
import BRAM
|
||||||
import CBindings
|
import CBindings
|
||||||
|
import Bus
|
||||||
|
|
||||||
type FCLK = 25000000
|
type FCLK = 25000000
|
||||||
type BAUD = 9600
|
type BAUD = 9600
|
||||||
|
|
15
bs/Types.bs
Normal file
15
bs/Types.bs
Normal file
|
@ -0,0 +1,15 @@
|
||||||
|
package Types(
|
||||||
|
Pc, Insn, Addr,
|
||||||
|
Byte, HalfWord, FullWord, DoubleWord, QuadWord
|
||||||
|
)
|
||||||
|
where
|
||||||
|
|
||||||
|
type Byte = UInt 8
|
||||||
|
type HalfWord = UInt 16
|
||||||
|
type FullWord = UInt 32
|
||||||
|
type DoubleWord = UInt 64
|
||||||
|
type QuadWord = UInt 128
|
||||||
|
type Insn = FullWord
|
||||||
|
|
||||||
|
type Pc = DoubleWord
|
||||||
|
type Addr = DoubleWord
|
Loading…
Reference in a new issue