Component.hh

Go to the documentation of this file.
00001 #ifndef COMPONENT_HH
00002 #define COMPONENT_HH
00003 
00004 // Copyright (c) 2002-2005 The University of Cincinnati.  All rights
00005 // reserved.
00006 
00007 // You may modify, distribute, and use the software contained in this
00008 // package under the terms of the "GNU LIBRARY GENERAL PUBLIC LICENSE"
00009 // version 2, June 1991. A copy of this license agreement can be found in
00010 // the file "LGPL", distributed with this archive.
00011 
00012 // Authors: Sameer Kher                    kherss@ececs.uc.edu
00013 //          Vinod Chamarty                 chamarv@ececs.uc.edu
00014 //          Shriram Subramanian            subramsi@ececs.uc.edu
00015 
00016 #include <iostream>
00017 #include <string>
00018 #include <list>
00019 
00020 extern "C" {
00021 #include "spmatrix.h"
00022 }
00023 #include "tyvis/vhdl.hh"
00024 #include "tyvis/Wait.hh"
00025 #include "tyvis/CallStack.hh"
00026 #include "tyvis/Constants.hh"
00027 #include "tyvis/AMSKernel_state.hh"
00028 #include "tyvis/AMSKernel.hh"
00029 #include "tyvis/Quantity.hh"
00030 #include "tyvis/vhdl_ams.hh"
00031 #include "tyvis/Tolerance.hh"
00032 
00033 using std::list;
00034 
00035 class AMSKernel;
00036 class Quantity;
00037 class branchEquation;
00038 class AMSProcess;
00039 class VHDLType;
00040 
00041 template <class type> class set;
00042 
00047 class component  {
00048 public:
00049 
00051   component(const char* ); 
00052 
00054   virtual ~component(void) { }
00055 
00058   virtual void init()=0;
00059 
00062   virtual eqnType getEquationType()=0;
00063 
00066   virtual void setBranch();
00067 
00069   virtual Quantity **getQuantities();
00070 
00072   virtual int getNumberOfQuantities();
00073 
00075   virtual bool getConsCheck();
00076   
00078   virtual void addToCurrentEquations();
00079 
00083   virtual void buildQuantitySet(list<Quantity *> * quantitySet);
00084 
00086   bool getBranchSetFlag() {
00087     return branchSetFlag;
00088   }
00089 
00091   virtual void definePointers(void);
00092 
00100   virtual int findBranch(int posNode, int negNode);
00101   
00109   virtual int checkCurrent(int posNode, int negNode, int index);
00110   
00112   void setLoadedFlagInQtys();
00113   
00115   virtual int pointerAllocation() {
00116     return 0;  
00117   }
00118   
00121   virtual int load() = 0;
00122   
00124   _savant_entity_elab *getEnclosingBlock();
00125 
00129   void setEnclosingBlock(_savant_entity_elab * toSet);
00130 
00132   virtual int getThroFreeNumber(){
00133     return (noOfThroOrFreeQuantities);
00134   }
00135 
00137   const char* getName(){
00138     return name;
00139   }
00140 
00142   component * getNext(){
00143     return next;
00144   }
00145 
00149   void setNext(component * nextP ){
00150     next = nextP;
00151   } 
00152 
00154   AMSKernel * getCkt(){
00155     return ckt;
00156   }  
00157   
00161   void setCkt(AMSKernel * cktP){
00162     ckt=cktP;
00163   }
00164 
00166   virtual void updateQuantityValues();
00167 
00169   virtual void add(component *comp);
00170 
00173   virtual component* getImplicitEquationList();
00174   
00180   virtual int trunc(double* timeStep);
00181 
00189   virtual int load(Quantity* qty, int);
00190 
00191 protected:
00193   component(){};
00194 
00196   bool branchSetFlag;
00197   
00199   int noOfThroOrFreeQuantities;
00200   
00202   eqnType equationType;
00203 
00205   AMSKernel *ckt;     
00206 
00207 private:
00209   component* next; 
00210   
00212   _savant_entity_elab *enclosingBlock;
00213   
00215   const char* name;   
00216 
00217 };
00218 
00219 #endif

Generated on Fri Mar 31 11:05:08 2006 for Tyvis by  doxygen 1.4.6