sim: fixed misc things
[calu.git] / 3b_sim / ccpu.hpp
diff --git a/3b_sim/ccpu.hpp b/3b_sim/ccpu.hpp
new file mode 100644 (file)
index 0000000..89867ef
--- /dev/null
@@ -0,0 +1,38 @@
+
+
+#ifndef __CPU__H__
+#define __CPU__H__
+
+#include "cdat.hpp"
+#include "cmem.hpp"
+#include "cpmem.hpp"
+#include "Iinstr.hpp"
+
+class CCpu {
+       private:
+
+               CDat m_pc, m_pc_next;
+               CMem<CDat> m_regfile, m_ram;
+               CPMem<Iinstr*> m_prog;
+
+       public:
+               void registerExtension() {};
+               void tick();
+
+               CDat getRegister(const int) const;
+               void setRegister(const int, CDat&);
+
+               CDat getRAM(const int) const;
+               void setRAM(const int, CDat&);
+
+               Iinstr* getProg(const int) const;
+               void setProg(const int, Iinstr*);
+
+               CDat getNextPC() const;
+
+               CCpu();
+
+};
+
+
+#endif