• Main Page
  • Related Pages
  • Modules
  • Data Structures
  • Files
  • File List
  • Globals

sst/elements/genericProc/ssBackEnd/ssb_mainProc.h

00001 // Copyright 2010 Sandia Corporation. Under the terms
00002 // of Contract DE-AC04-94AL85000 with Sandia Corporation, the U.S.
00003 // Government retains certain rights in this software.
00004 // 
00005 // Copyright (c) 2007-2010, Sandia Corporation
00006 // All rights reserved.
00007 // 
00008 // This file is part of the SST software package. For license
00009 // information, see the LICENSE file in the top level directory of the
00010 // distribution.
00011 
00012 
00013 #ifndef MAINPROC_H
00014 #define MAINPROC_H
00015 
00016 #include "ssb_sim-outorder.h"
00017 #include "FE/pimSysCallTypes.h"
00018 #include "FE/thread.h"
00019 #include "smpProc.h"
00020 
00021 class genericNIC;
00022 class thread;
00023 class genericNetwork;
00024 class PIM_NICChip;
00025 class proc;
00026 
00027 /** Main Processor (Conventional CPU)
00028 
00029  Models the main processor of a conventional system. Connects to
00030  other processors by a NIC and network.
00031 
00032 **/
00033 class mainProc : public convProc {
00034   string confFile;
00035   threadSource *tSource;
00036   processor *myProc;
00037   proc *myP;
00038 public:
00039   //: List of all mainProcs
00040   //static vector<mainProc*> mainProcs;
00041 protected:
00042   //: Latency to NIC
00043   int latToNic;
00044   //: Uniqie MainProcessorID
00045   int mainProcID;
00046   //: NIC
00047   // Provies access to the network
00048   //genericNIC *nic;
00049   //component *nicComp;
00050   //processor *nicProc;
00051   //PIM_NICChip *pimNIC;
00052 public:
00053   virtual uint64_t getCurrentCycle(); 
00054   void setClearPipe(bool p) {
00055     clearPipe = p;
00056   }
00057   thread* getThread() const {return thr;}
00058   void setThread(thread *t) {
00059     if (thr && !thr->isDead() && !pipeClear()) {
00060         ERROR("Trying to overwrite a running thread!");
00061     }
00062     thr = t;    
00063     if (thr) {
00064       fetch_pred_PC = thr->getStartPC();
00065       thr->assimilate(myProc);
00066     }
00067   }
00068   virtual unsigned getFEBDelay() {return 0;}
00069   //component* getNICMem() const {return nicComp;}
00070   //processor* getNICProc() const {return nicProc;}
00071   //PIM_NICChip* getPimNIC() const {return pimNIC;}
00072   int getMainProcID() const {return mainProcID;}
00073   mainProc(string configFile, threadSource &tSource, int maxMMO, processor *p,
00074            int id, map<string,string> prefInit, proc *pp);
00075   virtual void setup();
00076   virtual void finish();
00077   //virtual void handleParcel(parcel *p);
00078   virtual void preTic(bool fast);
00079   virtual void postTic(){;} 
00080 
00081   virtual bool spawnToCoProc(const PIM_coProc, thread* t, simRegister);
00082   virtual bool switchAddrMode(PIM_addrMode) {printf("%s:%i (%s) not sup\n",__FILE__,__LINE__,__func__);return 0;}
00083   virtual exceptType writeSpecial(const PIM_cmd, const int nargs, 
00084                             const uint *args);
00085   virtual exceptType readSpecial(const PIM_cmd, const int nInArgs, 
00086                                  const int nOutArgs, const simRegister *args,
00087                                  simRegister *rets);
00088   void resetStats();
00089   /* coherency protocol stuff */
00090   friend class smpProc;
00091   smpProc coher;
00092   virtual void handleCoher(const simAddress a, const enum mem_cmd cmd) {
00093       coher.handleCoher(a, cmd);
00094   }
00095   virtual void noteWrite(const simAddress a) {
00096       coher.noteWrite(a);
00097   }
00098 };
00099 
00100 #endif

Generated on Fri Oct 22 2010 11:02:24 for SST by  doxygen 1.7.1