From 13884426be31ba9cbb298927fcb3727d610a6a22 Mon Sep 17 00:00:00 2001 From: "Alejandro W. Sior" Date: Sat, 19 Aug 2023 12:08:26 +0200 Subject: getting started --- soc.cpp | 51 +++++++++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 51 insertions(+) create mode 100644 soc.cpp (limited to 'soc.cpp') diff --git a/soc.cpp b/soc.cpp new file mode 100644 index 0000000..c6c378b --- /dev/null +++ b/soc.cpp @@ -0,0 +1,51 @@ +#include +#include +#include "Vsystem.h" +#include + +#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 -- cgit v1.2.3