diff options
author | Nathan Ringo <nathan@remexre.com> | 2024-09-18 10:14:57 -0500 |
---|---|---|
committer | Nathan Ringo <nathan@remexre.com> | 2024-09-18 10:14:57 -0500 |
commit | 46457cc330049bb38c0af9a3f671b33b8f534c55 (patch) | |
tree | f2852d85dceaf67e75bd7d5688f2d3a28b61bb71 /src/TopSim.bs | |
parent | 03d5906c48812d6c03ab0483c502e5464eaa583b (diff) |
Add the simulator.
Diffstat (limited to 'src/TopSim.bs')
-rw-r--r-- | src/TopSim.bs | 16 |
1 files changed, 16 insertions, 0 deletions
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 : |