[Add] software simulator add

This commit is contained in:
bLueriVerLHR
2023-05-11 17:55:41 +08:00
parent 4e39007d17
commit 0bf1c68d94
16 changed files with 535 additions and 10 deletions

19
labus/include/memory.hh Normal file
View File

@@ -0,0 +1,19 @@
#pragma once
#include <device.hh>
class Memory : public WRDevice<Memory> {
char *data;
bool wen;
bool ren;
bool xen;
public:
Memory(size_t siz, bool w = true, bool r = true, bool x = true);
~Memory();
void load(const char *path);
void load(Memory *mem, size_t addr, size_t len);
void write(char *buf, size_t addr, size_t len);
void read(char *buf, size_t addr, size_t len);
};