package TopSim where import App import GetPut import Uart mkTopSim :: Module Empty mkTopSim = module timer :: Reg (Bit 8) <- mkReg 0 uart <- mkUart 1 app <- mkApp uart.recv uart.send fakeUart <- mkUart 1 rules when True ==> timer := timer + 1 when True ==> uart.rxPin fakeUart.txPin when (timer == 0x00) ==> fakeUart.send.put 0x30 when (timer == 0x01) ==> fakeUart.send.put 0x31 when (timer == 0x40) ==> $finish -- vim: set ft=haskell :