• Main Page
  • Related Pages
  • Modules
  • Data Structures
  • Files
  • File List
  • Globals

sst/elements/genericProc/FE/ptoVMapper.h

00001 // Copyright 2009-2010 Sandia Corporation. Under the terms
00002 // of Contract DE-AC04-94AL85000 with Sandia Corporation, the U.S.
00003 // Government retains certain rights in this software.
00004 // 
00005 // Copyright (c) 2009-2010, Sandia Corporation
00006 // All rights reserved.
00007 // 
00008 // This file is part of the SST software package. For license
00009 // information, see the LICENSE file in the top level directory of the
00010 // distribution.
00011 
00012 #ifndef SST_PTOVMAPPER_H
00013 #define SST_PTOVMAPPER_H
00014 
00015 #include "global.h" // for simAddress
00016 #include <map>
00017 //#include "sst/boost.h"
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     //: This creates a virtual-to-physical mapping
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     //: This tests whether the address is "WC" (aka write-cached)
00061     virtual bool addrWC(const simAddress addr) const;
00062     //: This tests whether the address is "CACHED"
00063     virtual bool addrCached(const simAddress addr) const;
00064     //: This returns what type of address the address is
00065     virtual memType_t memType(const simAddress addr) const;
00066     //: This transforms a virtual address into a physical address
00067     virtual simAddress getPhysAddr(const simAddress addr) const;
00068 };
00069 
00070 #endif

Generated on Fri Oct 22 2010 11:02:22 for SST by  doxygen 1.7.1