00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013 #ifndef SMPMEMORY_H
00014 #define SMPMEMORY_H
00015
00016 #include "sharedMemory.h"
00017 #include "level1/SW2.h"
00018
00019 class smpProc;
00020
00021
00022
00023 class smpMemory : public sharedMemory, public SW2 {
00024 public:
00025 typedef vector<smpProc*> smpVec;
00026 protected:
00027 smpVec smps;
00028 static const int postSizeBits = 8;
00029 void registerPost() {
00030 portCount[TO_DRAM] -= postSizeBits;
00031 portCount[FROM_DRAM] -= postSizeBits * (smps.size() - 1);
00032 }
00033 public:
00034 smpMemory(string cfgstr, const vector<DRAM*>& d) : sharedMemory(cfgstr), SW2(cfgstr,d) {;}
00035 void registerProcessor(sharedMemProc* p, smpProc* sm) {
00036 sharedMemory::registerProcessor(p);
00037 smps.push_back(sm);
00038 }
00039 const smpVec& getSMPs() const {return smps;}
00040 virtual void setup(){SW2::setup();}
00041 virtual void finish(){SW2::finish();}
00042 virtual void handleParcel(parcel *p){SW2::handleParcel(p);}
00043 virtual void preTic(){SW2::preTic();}
00044 virtual void postTic(){;}
00045 };
00046
00047 #endif