riscv-bluespec-classic/bs/Uart/Uart.bs
2025-04-20 18:06:17 -04:00

26 lines
791 B
Haskell

package Uart(
mkUartPhy,
UartPhy(..)
) where
import Serializer
import Deserializer
import BusTypes
import Util
-- Out is out from the FPGA and In is in to the FPGA
interface (UartPhy :: # -> # -> *) clkFreq baudRate =
bitOut :: Bit 1
bitIn :: Bit 1 -> Action
mkUartPhy :: (BusTypes.BusServer inFlightTransactions numClients)
-> Module (UartPhy clkFreq baudRate)
mkUartPhy dedicatedServerInterface = do
fileHandle :: Handle <- openFile "mkUartPhy.log" WriteMode
deserializer :: Deserializer clkFreq baudRate <- mkDeserialize fileHandle
serializer :: Serializer clkFreq baudRate <- mkSerialize fileHandle
return |>
interface UartPhy
bitOut = 1
bitIn bitVal = do
deserializer.putBitIn bitVal