sim: added uart extension
[calu.git] / 3b_sim / ccpu.hpp
index 4a8724004733e5812d3006f57bb4ede00e7ad5c5..fb9447db2c6fb1aee57abcc70f2d4785b95c6b0a 100644 (file)
@@ -8,7 +8,9 @@
 #include "ccolor.h"
 
 class Iinstr;
+class Iext;
 
+#include "iext.hpp"
 #include <boost/regex.hpp>
 #include "Iinstr.hpp"
 
@@ -22,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;
@@ -37,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();