diff options
Diffstat (limited to 'soc.cpp')
| -rw-r--r-- | soc.cpp | 51 |
1 files changed, 51 insertions, 0 deletions
@@ -0,0 +1,51 @@ +#include <verilated.h> +#include <verilated_vcd_c.h> +#include "Vsystem.h" +#include <iostream> + +#include "DRAM.h" + +struct Bench { + Vsystem *system; + DRAM *dram; + + Bench() { + system = new Vsystem(); + dram = new DRAM(); + + system->eval(); + eval(); + } + ~Bench() { + delete dram; + delete system; + } + + void eval() { + // Apply signals to the DRAM + dram->apply( + system->clk, + system->mem_we, + system->mem_claddr, + &system->mem_cldata + ); + // Eval the DRAM + dram->eval(); + + // Eval the system + system->eval(); + } + + void tick() { + system->clk ^= 1; + eval(); + } +}; + +int main() { + Bench bench; + + + for (int i = 0; i < 10000; i++) + bench.tick(); +}
\ No newline at end of file |
