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

sst/elements/include/memoryDev.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 
00013 
00014 #ifndef _MEMORY_DEV_H
00015 #define _MEMORY_DEV_H
00016 
00017 #include <sst/elements/include/memoryIF.h>
00018 #include <sst/elements/include/memoryChannel.h>
00019 
00020 #define MEMORYDEV_DBG 1 
00021 #ifndef MEMORYDEV_DBG
00022 #define MEMORYDEV_DBG 0
00023 #endif
00024 
00025 using namespace SST;
00026 
00027 template < typename addrT = unsigned long,
00028             typename cookieT = unsigned long, 
00029             typename dataT = unsigned long,
00030             typename fooT = std::pair< cookieT, dataT* >  >
00031 class MemoryDev : 
00032     protected MemoryChannel< addrT, fooT*, dataT >,
00033     public MemoryIF< addrT, cookieT >
00034 {
00035     public: // types
00036 
00037         typedef addrT addr_t;
00038         typedef dataT data_t;
00039         typedef cookieT cookie_t;
00040         typedef MemoryChannel< addrT, fooT*, dataT> dev_t;
00041         typedef typename dev_t::event_t event_t;
00042         typedef fooT foo_t;
00043     
00044     public: // functions 
00045 
00046         MemoryDev( Component& comp, Component::Params_t params,
00047                                                         std::string name );
00048         virtual bool read( addr_t, cookie_t );
00049         virtual bool write( addr_t, cookie_t );
00050         virtual bool read( addr_t, data_t*, cookie_t );
00051         virtual bool write( addr_t, data_t*, cookie_t );
00052         virtual bool popCookie( cookie_t& );
00053         
00054         bool send( addr_t, data_t*, cookie_t, typename event_t::reqType_t );
00055 
00056     private: // data
00057         Log< MEMORYDEV_DBG >&   m_dbg;
00058 };
00059 
00060 #define MEMORYDEV( retType ) \
00061 template < typename addrT, typename cookieT, typename dataT, typename fooT >\
00062 retType MemoryDev< addrT, cookieT, dataT, fooT >\
00063 
00064 #include <sst/elements/include/memoryDev2.h>
00065 
00066 #endif

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