aboutsummaryrefslogtreecommitdiff
path: root/fpga/src/CPU.bs
diff options
context:
space:
mode:
authorNathan Ringo <nathan@remexre.com>2024-09-24 00:47:49 -0500
committerNathan Ringo <nathan@remexre.com>2024-09-24 00:47:49 -0500
commit5088967b9db6e8bcc5feddbea6f53da5b33cb77c (patch)
treece3fdd093ebc03548e4a20ec955ed6d8b90c2499 /fpga/src/CPU.bs
parentfc1959bd9887ecc4d4ceb62a53e87abc6f49ef00 (diff)
Another reorg.
Diffstat (limited to 'fpga/src/CPU.bs')
-rw-r--r--fpga/src/CPU.bs20
1 files changed, 20 insertions, 0 deletions
diff --git a/fpga/src/CPU.bs b/fpga/src/CPU.bs
new file mode 100644
index 0000000..566ae92
--- /dev/null
+++ b/fpga/src/CPU.bs
@@ -0,0 +1,20 @@
+package CPU where
+
+import GetPut
+
+-- | The interface the CPU exposes.
+interface CPU =
+ -- UART
+ uart_tx :: Get (Bit 8)
+ uart_rx :: Put (Bit 8)
+
+mkCPU :: Module CPU
+mkCPU = module
+ byte :: Reg (Bit 8) <- mkReg 0
+
+ interface CPU
+ uart_tx = toGet byte
+ uart_rx = toPut $ \b -> do
+ byte := b
+
+-- vim: set ft=haskell :