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 00060 00061 typedef struct _fu_memory_pspec_t { 00062 char *name; /* name */ 00063 fu_pmodel_mode_t pmodel; /* power model mode */ 00064 double opfreq, svolt; /* operating frequency/supply voltage */ 00065 00066 /* predictor array specification */ 00067 unsigned nrows, ncols; 00068 fu_memory_spec_t *spec; 00069 /* nrows: number of entries / ncols: number of columns in bits */ 00070 buffer_t *xbus, *ybus; /* address / data bus */ 00071 unsigned xsize, ysize; /* address/data bus 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_memory_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 bpred space */ 00083 fu_memory_pspec_t * 00084 create_memory_panalyzer( 00085 char *name, /* memory name */ 00086 fu_pmodel_mode_t pmodel, /* bpred power model mode */ 00087 double opfreq, double svolt, /* operating frequency/supply voltage */ 00088 00089 unsigned nrows, unsigned ncols, /* number of rows / cols (2^n) */ 00090 unsigned rwports, unsigned rports, unsigned wports, 00091 00092 /* x/y switching/internal/lekage effective capacitances */ 00093 double xCeff, double yCeff, double iCeff, double lCeff); 00094 00095 /* memory panalyzer: estimate pdissipatino of the structure with the given 00096 * in/out bus value and access statistics */ 00097 void 00098 memory_panalyzer( 00099 fu_memory_pspec_t *pspec, /* memory pspec*/ 00100 buffer_t *xbus, /* in bus: y = f(X) */ 00101 buffer_t *ybus, /* out bus: Y = f(x) */ 00102 tick_t now /* current simulation time */); 00103 #endif /* MEMORY_PANALYZER_H */ 00104