--- /dev/null
+#include "sv_mmu.h"
+
+#define sv_load_func(type) \
+sv_reg_t sv_mmu_t::load_##type(reg_t const& addr) { \
+ type##_t v = mmu_t::load_##type(addr); \
+ return sv_reg_t(v); \
+}
+
+// load value from memory at aligned address; zero extend to register width
+sv_load_func(uint8)
+sv_load_func(uint16)
+sv_load_func(uint32)
+sv_load_func(uint64)
+
+// load value from memory at aligned address; sign extend to register width
+sv_load_func(int8)
+sv_load_func(int16)
+sv_load_func(int32)
+sv_load_func(int64)
+
+#define sv_store_func(type) \
+void sv_mmu_t::store_##type(sv_reg_t const& addr, type##_t val) { \
+ mmu_t::store_##type(addr, val); \
+}
+
+// store value to memory at aligned address
+sv_store_func(uint8)
+sv_store_func(uint16)
+sv_store_func(uint32)
+sv_store_func(uint64)
+
+#if 0
+#define sv_amo_func(type) \
+template<typename _op> \
+sv_reg_t sv_mmu_t::amo_##type(sv_reg_t const& addr, sv_reg_t const& rhs, _op f) { \
+ type##_t v = mmu_t::amo_##type(addr, rhs, f); \
+ return sv_reg_t(v); \
+}
+
+sv_amo_func(uint32)
+sv_amo_func(uint64)
+#endif
+
+void sv_mmu_t::store_float128(sv_reg_t const& addr, float128_t val)
+{
+ mmu_t::store_float128(addr, val);
+}
+
+sv_float128_t sv_mmu_t::load_float128(sv_reg_t const& addr)
+{
+ return mmu_t::load_float128(addr);
+}
+
+void sv_mmu_t::acquire_load_reservation(sv_reg_t const& vaddr)
+{
+ mmu_t::acquire_load_reservation(vaddr);
+}
+
+bool sv_mmu_t::check_load_reservation(sv_reg_t const& vaddr)
+{
+ return mmu_t::check_load_reservation(vaddr);
+}
+
+
public:
sv_mmu_t(simif_t* sim, processor_t* proc) : mmu_t(sim, proc) {}
- #define sv_load_func(type) \
- inline sv_reg_t load_##type(reg_t const& addr) { \
- type##_t v = mmu_t::load_##type(addr); \
- return sv_reg_t(v); \
- }
- //inline sv_reg_t load_##type(sv_reg_t addr) {
- // type##_t v = mmu_t::load_##type(addr);
- // return sv_reg_t(v);
- //}
+ #define sv_load_func_decl(type) \
+ sv_reg_t load_##type(reg_t const& addr);
// load value from memory at aligned address; zero extend to register width
- sv_load_func(uint8)
- sv_load_func(uint16)
- sv_load_func(uint32)
- sv_load_func(uint64)
+ sv_load_func_decl(uint8)
+ sv_load_func_decl(uint16)
+ sv_load_func_decl(uint32)
+ sv_load_func_decl(uint64)
// load value from memory at aligned address; sign extend to register width
- sv_load_func(int8)
- sv_load_func(int16)
- sv_load_func(int32)
- sv_load_func(int64)
+ sv_load_func_decl(int8)
+ sv_load_func_decl(int16)
+ sv_load_func_decl(int32)
+ sv_load_func_decl(int64)
- #define sv_store_func(type) \
- void store_##type(sv_reg_t const& addr, type##_t val) { \
- mmu_t::store_##type(addr, val); \
- }
+ #define sv_store_func_decl(type) \
+ void store_##type(sv_reg_t const& addr, type##_t val);
// store value to memory at aligned address
- sv_store_func(uint8)
- sv_store_func(uint16)
- sv_store_func(uint32)
- sv_store_func(uint64)
+ sv_store_func_decl(uint8)
+ sv_store_func_decl(uint16)
+ sv_store_func_decl(uint32)
+ sv_store_func_decl(uint64)
#define sv_amo_func(type) \
template<typename _op> \
sv_amo_func(uint32)
sv_amo_func(uint64)
- void store_float128(sv_reg_t const& addr, float128_t val)
- {
- mmu_t::store_float128(addr, val);
- }
-
- sv_float128_t load_float128(sv_reg_t const& addr)
- {
- return mmu_t::load_float128(addr);
- }
-
- void acquire_load_reservation(sv_reg_t const& vaddr)
- {
- mmu_t::acquire_load_reservation(vaddr);
- }
+ void store_float128(sv_reg_t const& addr, float128_t val);
+ sv_float128_t load_float128(sv_reg_t const& addr);
- bool check_load_reservation(sv_reg_t const& vaddr)
- {
- return mmu_t::check_load_reservation(vaddr);
- }
+ void acquire_load_reservation(sv_reg_t const& vaddr);
+ bool check_load_reservation(sv_reg_t const& vaddr);
};