aboutsummaryrefslogtreecommitdiff
path: root/fpga/src/TopSim.bs
blob: bf5d59c6e245e08c4b1a636df16364db721353ec (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
-- | The top-level module for simulation.
package TopSim where

import Numini

mkTopSim :: Module Empty
mkTopSim = module
  ch559_uart_rx <- mkWire
  inkplate_uart_rx <- mkWire
  usb_uart_rx <- mkWire
  hyperbus_rwds_in <- mkWire
  hyperbus_dq_in <- mkWire
  i2c_sda_in <- mkWire
  numini <- mkNumini ch559_uart_rx inkplate_uart_rx usb_uart_rx
    hyperbus_rwds_in hyperbus_dq_in i2c_sda_in

  timer :: Reg (Bit 8) <- mkReg 0
  rules
    when True ==> timer := timer + 1
    when (timer == 0xff) ==> $finish

-- vim: set ft=haskell :