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 <McNiagara.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 McNiagara *mcCpu; 00049 unsigned long cyclesAtLastClock; 00050 const char *inputfile; 00051 const char *iprobfile; 00052 const char *perffile; 00053 const char *outputfile; 00054 unsigned long memCookie; 00055 00056 memDev_t::addr_t m_pc; 00057 memDev_t::addr_t m_pcStop; 00058 00059 memDev_t* m_memory; 00060 00061 Log< CPUV2_DBG >& m_dbg; 00062 Log<> m_log; 00063 }; 00064 00065 #endif