sim: fixed misc things
[calu.git] / 3b_sim / ccpu.hpp
1
2
3 #ifndef __CPU__H__
4 #define __CPU__H__
5
6 #include "cdat.hpp"
7 #include "cmem.hpp"
8 #include "cpmem.hpp"
9 #include "Iinstr.hpp"
10
11 class CCpu {
12         private:
13
14                 CDat m_pc, m_pc_next;
15                 CMem<CDat> m_regfile, m_ram;
16                 CPMem<Iinstr*> m_prog;
17
18         public:
19                 void registerExtension() {};
20                 void tick();
21
22                 CDat getRegister(const int) const;
23                 void setRegister(const int, CDat&);
24
25                 CDat getRAM(const int) const;
26                 void setRAM(const int, CDat&);
27
28                 Iinstr* getProg(const int) const;
29                 void setProg(const int, Iinstr*);
30
31                 CDat getNextPC() const;
32
33                 CCpu();
34
35 };
36
37
38 #endif