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