summaryrefslogtreecommitdiff
path: root/DRAM.h
diff options
context:
space:
mode:
Diffstat (limited to 'DRAM.h')
-rw-r--r--DRAM.h32
1 files changed, 32 insertions, 0 deletions
diff --git a/DRAM.h b/DRAM.h
new file mode 100644
index 0000000..bc36a93
--- /dev/null
+++ b/DRAM.h
@@ -0,0 +1,32 @@
+#pragma once
+
+#include <verilated.h>
+#include <verilated_vcd_c.h>
+
+#include <stdio.h>
+
+/* DRAM
+ * A basic device simulating DRAM.
+ */
+struct DRAM {
+ uint8_t *buf;
+
+ DRAM();
+ ~DRAM();
+
+ CData prev_clk;
+ CData clk;
+ CData we;
+ uint64_t claddr;
+ VlWide<4>* cldata;
+
+ void apply(
+ CData clk,
+ CData we,
+ uint64_t claddr,
+ VlWide<4>* cldata);
+
+ void eval();
+
+ void posedge_clk();
+}; \ No newline at end of file