00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012 #ifndef SST_PTOVMAPPER_H
00013 #define SST_PTOVMAPPER_H
00014
00015 #include "global.h"
00016 #include <map>
00017
00018
00019 typedef enum { CACHED, UNCACHED, WC } memType_t;
00020
00021 struct ptoVMapEntry {
00022 #if 0 // WANT_CHECKPOINT_SUPPORT
00023 BOOST_SERIALIZE {
00024 ar & BOOST_SERIALIZATION_NVP(region);
00025 ar & BOOST_SERIALIZATION_NVP(len);
00026 ar & BOOST_SERIALIZATION_NVP(kaddr);
00027 ar & BOOST_SERIALIZATION_NVP(type);
00028 }
00029 #endif
00030 int region;
00031 int len;
00032 simAddress kaddr;
00033 memType_t type;
00034 };
00035
00036 typedef std::map<simAddress,ptoVMapEntry> ptoVMemMap;
00037
00038 class ptoVmapper
00039 {
00040 #if 0 // WANT_CHECKPOINT_SUPPORT
00041 BOOST_SERIALIZE {
00042 ar & BOOST_SERIALIZATION_NVP(memMap);
00043 }
00044 #endif
00045 ptoVMemMap *memMap;
00046
00047 public:
00048 ptoVmapper() : memMap(new ptoVMemMap) {}
00049 ptoVmapper(ptoVMemMap *p) : memMap(p) {}
00050 ptoVmapper(ptoVmapper *p) : memMap(p->memMap) {}
00051
00052 virtual ~ptoVmapper() {;}
00053
00054 virtual int CreateMemRegion(const int region,
00055 const simAddress vaddr,
00056 const int len,
00057 const simAddress kaddr,
00058 const memType_t type = CACHED);
00059
00060
00061 virtual bool addrWC(const simAddress addr) const;
00062
00063 virtual bool addrCached(const simAddress addr) const;
00064
00065 virtual memType_t memType(const simAddress addr) const;
00066
00067 virtual simAddress getPhysAddr(const simAddress addr) const;
00068 };
00069
00070 #endif