From 3a57f3e5cbccf519c546eebed9fa9db7c328d72c Mon Sep 17 00:00:00 2001 From: Joshua Wise Date: Sun, 28 Dec 2008 03:23:34 -0500 Subject: [PATCH] Add testbench --- ram.hex | Bin 0 -> 388 bytes testbench.cpp | 28 ++++++++++++++++++++++++++++ 2 files changed, 28 insertions(+) create mode 100644 ram.hex create mode 100644 testbench.cpp diff --git a/ram.hex b/ram.hex new file mode 100644 index 0000000000000000000000000000000000000000..937ce99cf7e6a9b83d4f9ca1fee0172dcfa7d2c3 GIT binary patch literal 388 fcmYc_v@l3BurTCG#bCG^KmgY$!@z)sfxra-57I{X literal 0 HcmV?d00001 diff --git a/testbench.cpp b/testbench.cpp new file mode 100644 index 0000000..4188d71 --- /dev/null +++ b/testbench.cpp @@ -0,0 +1,28 @@ +#include "Vsystem.h" +#include + +Vsystem *top; + +unsigned int main_time = 0; + +double sc_time_stamp () +{ + return main_time; +} + +int main() +{ + top = new Vsystem; + + top->clk = 0; + while (!Verilated::gotFinish()) + { + top->clk = !top->clk; + + top->eval(); +// if (top->clk == 1) +// printf("%d: Bubble: %d. PC: %08x. Ins'n: %08x\n", main_time/2, top->bubbleshield, top->pc, top->insn); + + main_time++; + } +} -- 2.43.0