From 46457cc330049bb38c0af9a3f671b33b8f534c55 Mon Sep 17 00:00:00 2001 From: Nathan Ringo Date: Wed, 18 Sep 2024 10:14:57 -0500 Subject: Add the simulator. --- src/TopSim.bs | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 src/TopSim.bs (limited to 'src/TopSim.bs') diff --git a/src/TopSim.bs b/src/TopSim.bs new file mode 100644 index 0000000..5ba7232 --- /dev/null +++ b/src/TopSim.bs @@ -0,0 +1,16 @@ +package TopSim where + +import Top + +mkTopSim :: Module Empty +mkTopSim = + module + timer :: Reg (Bit 8) <- mkReg 0 + + rules + when True ==> do + timer := timer + 1 + when (timer == 0xff) ==> do + $finish + +-- vim: set ft=haskell : -- cgit v1.2.3