sim: added uart extension
[calu.git] / 3b_sim / ccpu.hpp
index 11f615212b9c32ea4e5798cc3da5f11e64a313ec..fb9447db2c6fb1aee57abcc70f2d4785b95c6b0a 100644 (file)
@@ -8,7 +8,10 @@
 #include "ccolor.h"
 
 class Iinstr;
+class Iext;
 
+#include "iext.hpp"
+#include <boost/regex.hpp>
 #include "Iinstr.hpp"
 
 
@@ -21,10 +24,15 @@ class CCpu {
                CMem<CDat> m_reg, m_ram;
                CPMem<Iinstr*> m_prog;
 
+               vector<Iext*> m_exts;
+
                CDat m_stack;
 
+               static const int EXT_MODEL_OFFSET = 0x2000;
+
        public:
                void registerExtension() {};
+               void applyToExtensions(const vector<string>& in);
                void tick();
 
                CDat getRegister(const int) const;
@@ -36,6 +44,8 @@ class CCpu {
                Iinstr* getProg(const int) const;
                void setProg(const int, Iinstr*);
 
+               void registerExtension(Iext*);
+
                CDat getPerf() const;
                void setPerf(CDat);
                void incPerf();
@@ -63,6 +73,8 @@ class CCpu {
                int getStack() const;
                void setStack(const int);
 
+               string colorifyInstr(string instr);
+
                CCpu(int,int,int);
 
 };