make server map, normalize uart interfaces
This commit is contained in:
parent
7290af88fb
commit
842c19d441
35
bs/ServerMap.bs
Normal file
35
bs/ServerMap.bs
Normal file
|
@ -0,0 +1,35 @@
|
||||||
|
package ServerMap(
|
||||||
|
ramServerStart,
|
||||||
|
ramServerEnd,
|
||||||
|
uartServerStart,
|
||||||
|
uartServerEnd,
|
||||||
|
serverMap
|
||||||
|
) where
|
||||||
|
|
||||||
|
import Types
|
||||||
|
import BusTypes
|
||||||
|
|
||||||
|
bytesInRam :: Types.Addr
|
||||||
|
bytesInRam = 1024
|
||||||
|
|
||||||
|
-- number of servers currently supported by this bus map
|
||||||
|
type NumServers = 2
|
||||||
|
|
||||||
|
ramServerStart :: Types.Addr
|
||||||
|
ramServerStart = 0x80000000
|
||||||
|
ramServerEnd :: Types.Addr
|
||||||
|
ramServerEnd = ramServerStart + (bytesInRam - 1)
|
||||||
|
|
||||||
|
uartServerStart :: Types.Addr
|
||||||
|
uartServerStart = 0x10000000
|
||||||
|
uartServerEnd :: Types.Addr
|
||||||
|
uartServerEnd = uartServerStart + 7
|
||||||
|
|
||||||
|
-- be careful when hooking up the servers that
|
||||||
|
-- the uart is attached to index 0 whilst the ram
|
||||||
|
-- is attached to index 1
|
||||||
|
serverMap :: Types.Addr -> Maybe (MkServerIdx 2)
|
||||||
|
serverMap addr =
|
||||||
|
if addr >= ramServerStart && addr <= ramServerEnd then Just 1
|
||||||
|
else if addr >= uartServerStart && addr <= uartServerEnd then Just 0
|
||||||
|
else Nothing
|
|
@ -13,6 +13,7 @@ import ActionSeq
|
||||||
import Vector
|
import Vector
|
||||||
import BusTypes
|
import BusTypes
|
||||||
import Uart
|
import Uart
|
||||||
|
import ServerMap
|
||||||
|
|
||||||
import TagEngineTester
|
import TagEngineTester
|
||||||
|
|
||||||
|
|
|
@ -23,4 +23,4 @@ mkUartPhy dedicatedServerInterface = do
|
||||||
interface UartPhy
|
interface UartPhy
|
||||||
bitOut = 1
|
bitOut = 1
|
||||||
bitIn bitVal = do
|
bitIn bitVal = do
|
||||||
action {}
|
deserializer.putBitIn bitVal
|
Loading…
Reference in a new issue