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