summaryrefslogtreecommitdiff
path: root/tb/top/conspiracion.cpp
diff options
context:
space:
mode:
authorAlejandro Soto <alejandro@34project.org>2022-11-19 19:36:21 -0600
committerAlejandro Soto <alejandro@34project.org>2022-11-19 19:36:27 -0600
commit8ec66f50c64501e30ed6adae94f89b90b48de7f0 (patch)
treedf0cd1fdd699d179ff87aa40410cabb047f9a9f1 /tb/top/conspiracion.cpp
parent0aabf3cb8e11409506bf90d6cd0c1125f3df7c04 (diff)
Implement interval timer simulation
Diffstat (limited to '')
-rw-r--r--tb/top/conspiracion.cpp8
1 files changed, 8 insertions, 0 deletions
diff --git a/tb/top/conspiracion.cpp b/tb/top/conspiracion.cpp
index 984cb58..d710bde 100644
--- a/tb/top/conspiracion.cpp
+++ b/tb/top/conspiracion.cpp
@@ -25,6 +25,7 @@
#include "../const.hpp"
#include "../mem.hpp"
#include "../jtag_uart.hpp"
+#include "../interval_timer.hpp"
#include "../null.hpp"
#include "../window.hpp"
#include "../vga.hpp"
@@ -251,6 +252,7 @@ int main(int argc, char **argv)
mem<std::uint32_t> hps_ddr3(0x0000'0000, 512 << 20);
jtag_uart ttyj0(0x3000'0000);
+ interval_timer timer(0x3002'0000);
mem<std::uint32_t> vram(0x3800'0000, 64 << 20);
null vram_null(0x3800'0000, 64 << 20, 2);
window vram_window(vram, 0x0000'0000);
@@ -266,6 +268,7 @@ int main(int argc, char **argv)
avl.attach(hps_ddr3);
avl.attach(ttyj0);
+ avl.attach(timer);
for(auto &slave : consts)
{
@@ -329,6 +332,11 @@ int main(int argc, char **argv)
top.clk_clk = !top.clk_clk;
top.eval();
+ if(top.clk_clk)
+ {
+ timer.tick();
+ }
+
if(!avl.tick(top.clk_clk))
{
failed = true;