sim: arith. fixes, optimized mem access
[calu.git] / 3b_sim / cmem.hpp
index 05739dbcb037b31f2445de3ddca4ac7a756ec7f0..8e348c7f7f49a203280c249c2665367e853dca89 100644 (file)
@@ -21,8 +21,13 @@ private:
        const int MAX_MEMORY;
        std::vector<T> m_memory;
 public:
+       /* aligns to BIT_LEN words, aka. does calc direct memorycell from address */
        void set(const MEMORY_ADDRESS address, const T data);
        T get(const MEMORY_ADDRESS address) const;
+
+       /* doesn't align, user has to do */
+       void setDirect(const MEMORY_ADDRESS address, const T data);
+       T getDirect(const MEMORY_ADDRESS address) const;
        CMem(int size) : MAX_MEMORY(size), m_memory(size) {};
 };