00001 #ifndef _CPU_H 00002 #define _CPU_H 00003 00004 #include <sst/core/eventFunctor.h> 00005 #include <sst/core/component.h> 00006 #include <sst/elements/include/memoryDev.h> 00007 #include <OffCpuIF.h> 00008 #include <McOpteron.h> 00009 00010 #ifndef CPUV2_DBG 00011 #define CPUV2_DBG 00012 #endif 00013 00014 using namespace SST; 00015 00016 class Cpu : public Component, OffCpuIF { 00017 00018 virtual void memoryAccess(OffCpuIF::access_mode mode, 00019 unsigned long long address, 00020 unsigned long data_size); 00021 virtual void NICAccess(OffCpuIF::access_mode mode, 00022 unsigned long data_size); 00023 00024 typedef enum { RUN, STOP } inst_t; 00025 00026 struct Foo { 00027 inst_t inst; 00028 }; 00029 00030 public: 00031 Cpu( ComponentId_t id, Params_t& params ); 00032 00033 private: 00034 00035 Cpu( const Cpu& c ); 00036 Cpu(); 00037 int Finish(); 00038 00039 bool clock( Cycle_t ); 00040 bool processEvent( Event *e ); 00041 00042 private: 00043 typedef MemoryDev< uint64_t, unsigned int > memDev_t; 00044 00045 ClockHandler_t* m_clockHandler; 00046 std::string m_frequency; 00047 00048 McOpteron *mcCpu; 00049 unsigned long cyclesAtLastClock; 00050 const char *instfile; 00051 const char *configfile; 00052 const char *appfile; 00053 const char *distfile; 00054 const char *outputfile; 00055 const char *debugfile; 00056 unsigned long memCookie; 00057 00058 memDev_t::addr_t m_pc; 00059 memDev_t::addr_t m_pcStop; 00060 00061 memDev_t* m_memory; 00062 00063 Log< CPUV2_DBG >& m_dbg; 00064 Log<> m_log; 00065 }; 00066 00067 #endif