00001 /* 00002 * memory_panalyzer.h - basic memory power analyzer data types, strcutres and 00003 * thier manipulation functions. 00004 * 00005 * This file is a part of the PowerAnalyzer tool suite written by 00006 * Nam Sung Kim as a part of the PowerAnalyzer Project. 00007 * 00008 * The tool suite is currently maintained by Nam Sung Kim. 00009 * 00010 * Copyright (C) 2001 by Nam Sung Kim 00011 * 00012 * This source file is distributed "as is" in the hope that it will be 00013 * useful. The tool set comes with no warranty, and no author or 00014 * distributor accepts any responsibility for the consequences of its 00015 * use. 00016 * 00017 * Everyone is granted permission to copy, modify and redistribute 00018 * this tool set under the following conditions: 00019 * 00020 * This source code is distributed for non-commercial use only. 00021 * Please contact the maintainer for restrictions applying to 00022 * commercial use. 00023 * 00024 * Permission is granted to anyone to make or distribute copies 00025 * of this source code, either as received or modified, in any 00026 * medium, provided that all copyright notices, permission and 00027 * nonwarranty notices are preserved, and that the distributor 00028 * grants the recipient permission for further redistribution as 00029 * permitted by this document. 00030 * 00031 * Permission is granted to distribute this file in compiled 00032 * or executable form under the same conditions that apply for 00033 * source code, provided that either: 00034 * 00035 * A. it is accompanied by the corresponding machine-readable 00036 * source code, 00037 * B. it is accompanied by a written offer, with no time limit, 00038 * to give anyone a machine-readable copy of the corresponding 00039 * source code in return for reimbursement of the cost of 00040 * distribution. This written offer must permit verbatim 00041 * duplication by anyone, or 00042 * C. it is distributed by someone who received only the 00043 * executable form, and is accompanied by a copy of the 00044 * written offer of source code that they received concurrently. 00045 * 00046 * In other words, you are welcome to use, share and improve this 00047 * source file. You are forbidden to forbid anyone else to use, share 00048 * and improve what you give them. 00049 */ 00050 00051 #ifndef MEMORY_PANALYZER_H 00052 #define MEMORY_PANALYZER_H 00053 00054 #include "panalyzer.h" 00055 00056 #define _6TWIDTH 1.8 /* um */ 00057 #define _6THEIGHT 3.6 /* um */ 00058 00059 typedef struct _fu_sbank_pspec_t { 00060 char *name; /* name */ 00061 fu_pmodel_mode_t pmodel; /* power model mode */ 00062 double opfreq, svolt; /* operating frequency/supply voltage */ 00063 fu_dimension_t *dimension; 00064 00065 /* sbank specification */ 00066 unsigned nrows, ncols; /* array size */ 00067 unsigned nrwports, nrports, nwports; /* number of ports spec. */ 00068 00069 /* nrows: number of entries / ncols: number of columns in bits */ 00070 buffer_t *bus; /* output bus */ 00071 unsigned bsize; /* output size in bytes */ 00072 00073 /* effective pdissipation capacitances */ 00074 fu_Ceffs_t *Ceffs; 00075 fu_pdissipation_t *pdissipation; /* pdissipation statistics */ 00076 fu_pdissipation_t pmwindow[MaxPMWindows]; /* power monitoring window */ 00077 } fu_sbank_pspec_t; 00078 00079 /* this is for small memory array */ 00080 /* create memory panalyzer database 00081 * return an allocated location pointer. 00082 * caution: please deallocate the memory space */ 00083 fu_sbank_pspec_t * 00084 create_sbank_panalyzer( 00085 char *name, /* memory name */ 00086 fu_pmodel_mode_t pmodel, /* bpred power model mode */ 00087 /* memory operating parameters: operating frequency/supply voltage */ 00088 double opfreq, double svolt, 00089 00090 /* memory size parameters: number of rows / cols (2^n) */ 00091 unsigned nrows, unsigned ncols, 00092 unsigned nrwports, unsigned nrports, unsigned nwports, 00093 00094 /* switching/internal/lekage effective capacitances */ 00095 double sCeff, double iCeff, double lCeff); 00096 00097 /* sbank panalyzer: estimate pdissipatino of the structure with the given 00098 * in/out bus value and access statistics */ 00099 void 00100 sbank_panalyzer( 00101 fu_sbank_pspec_t *pspec, /* memory pspec*/ 00102 buffer_t *buffer, /* out bus */ 00103 tick_t now /* current simulation time */); 00104 00105 /* estimate sbankCeff */ 00106 fu_Ceffs_t 00107 estimate_sbankCeff( 00108 fu_sbank_pspec_t *pspec, 00109 double sCeff); 00110 00111 /* Added for SST */ 00112 double 00113 SSTsbank_panalyzer( 00114 fu_sbank_pspec_t *pspec, /* memory pspec*/ 00115 buffer_t *buffer, /* out bus */ 00116 tick_t now /* current simulation time */); 00117 00118 00119 #endif /* MEMORY_PANALYZER_H */