diff options
Diffstat (limited to 'src/TopSim.bs')
-rw-r--r-- | src/TopSim.bs | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/src/TopSim.bs b/src/TopSim.bs index 5ba7232..93fef14 100644 --- a/src/TopSim.bs +++ b/src/TopSim.bs @@ -1,16 +1,23 @@ package TopSim where +import GetPut import Top +import Uart mkTopSim :: Module Empty mkTopSim = module timer :: Reg (Bit 8) <- mkReg 0 + uart <- mkUart 1 + rules when True ==> do timer := timer + 1 - when (timer == 0xff) ==> do + when (timer == 0x00) ==> uart.send.put 0x81 + when (timer == 0x01) ==> uart.send.put 0x18 + when (timer == 0x02) ==> uart.send.put 0x81 + when (timer == 0x40) ==> do $finish -- vim: set ft=haskell : |