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

sst/core/techModels/libORION/SIM_permu.h

00001 /*-------------------------------------------------------------------------
00002  *                             ORION 2.0 
00003  *
00004  *                                              Copyright 2009 
00005  *      Princeton University, and Regents of the University of California 
00006  *                         All Rights Reserved
00007  *
00008  *                         
00009  *  ORION 2.0 was developed by Bin Li at Princeton University and Kambiz Samadi at
00010  *  University of California, San Diego. ORION 2.0 was built on top of ORION 1.0. 
00011  *  ORION 1.0 was developed by Hangsheng Wang, Xinping Zhu and Xuning Chen at 
00012  *  Princeton University.
00013  *
00014  *  If your use of this software contributes to a published paper, we
00015  *  request that you cite our paper that appears on our website 
00016  *  http://www.princeton.edu/~peh/orion.html
00017  *
00018  *  Permission to use, copy, and modify this software and its documentation is
00019  *  granted only under the following terms and conditions.  Both the
00020  *  above copyright notice and this permission notice must appear in all copies
00021  *  of the software, derivative works or modified versions, and any portions
00022  *  thereof, and both notices must appear in supporting documentation.
00023  *
00024  *  This software may be distributed (but not offered for sale or transferred
00025  *  for compensation) to third parties, provided such third parties agree to
00026  *  abide by the terms and conditions of this notice.
00027  *
00028  *  This software is distributed in the hope that it will be useful to the
00029  *  community, but WITHOUT ANY WARRANTY; without even the implied warranty of
00030  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  
00031  *
00032  *-----------------------------------------------------------------------*/
00033 
00034 #ifndef _SIM_POWER_PERMU_H
00035 #define _SIM_POWER_PERMU_H
00036 
00037 #include "SIM_parameter.h"
00038 
00039 #define FIRST_STG       0x01
00040 #define SECOND_STG      0x02
00041 #define THIRD_STG       0x04
00042 #define FOURTH_STG      0x08
00043 #define ALL_PASS        0x0F
00044 #define is_omega(x)     (!(x))
00045 #define is_flip(x)      (x)
00046 
00047 typedef struct {
00048         u_int data_width;
00049         LIB_Type_max_uint n_chg_in;
00050         LIB_Type_max_uint n_chg_out;
00051         LIB_Type_max_uint n_chg_stg;
00052         LIB_Type_max_uint n_chg_int;
00053         LIB_Type_max_uint n_chg_pass;
00054         LIB_Type_max_uint n_chg_ctr;
00055         double e_chg_in;
00056         double e_chg_out;
00057         double e_chg_stg;
00058         double e_chg_int;
00059         double e_chg_pass;
00060         double e_chg_ctr;
00061         /* state variable */
00062         LIB_Type_max_uint in;
00063         LIB_Type_max_uint out;
00064         LIB_Type_max_uint stg[3];
00065         LIB_Type_max_uint inn[4];
00066         uint pass;
00067         LIB_Type_max_uint ctr[4];
00068         /* redundant field */
00069         LIB_Type_max_uint data_mask;
00070         LIB_Type_max_uint ctr_mask;
00071 } SIM_omflip_t;
00072 
00073 #define ZBIT    1
00074 #define WBIT    0
00075 #define N_ONEHOT        (32 + 16 + 8 + 4 + 2 + 1)
00076 
00077 /* WHS: maximum bit width: 64 */
00078 typedef struct {
00079         u_int data_width;
00080         LIB_Type_max_uint n_chg_in;
00081         LIB_Type_max_uint n_chg_zin[6]; /* z/w input node */
00082         LIB_Type_max_uint n_chg_lin[6]; /* left one-hot node */
00083         LIB_Type_max_uint n_chg_rin[6]; /* right one-hot node */
00084         LIB_Type_max_uint n_chg_oin;    /* OR gate input node */
00085         LIB_Type_max_uint n_chg_out;
00086         double e_chg_in;
00087         double e_chg_zin[6];
00088         double e_chg_lin[6];
00089         double e_chg_rin[6];
00090         double e_chg_oin;
00091         double e_chg_out;
00092         /* state variable */
00093         LIB_Type_max_uint in;
00094         LIB_Type_max_uint zin[6];
00095         LIB_Type_max_uint win[6];
00096         /* one-hot numbers */
00097         u_int lin[N_ONEHOT];
00098         u_int rin[N_ONEHOT];
00099         LIB_Type_max_uint zoin;
00100         LIB_Type_max_uint woin;
00101         LIB_Type_max_uint out;
00102         /* redundant field */
00103         u_int n_stg;
00104         LIB_Type_max_uint mask;
00105 } SIM_grp_t;
00106 
00107 typedef struct {
00108         int model;
00109         union {
00110                 SIM_omflip_t omflip;
00111                 SIM_grp_t grp;
00112         } u;
00113 } SIM_permu_t;
00114 
00115 
00116 extern int SIM_permu_init(SIM_permu_t *permu, int model, u_int data_width);
00117 extern int SIM_permu_record(SIM_permu_t *permu, LIB_Type_max_uint in, u_int mode, LIB_Type_max_uint op, int reset);
00118 extern LIB_Type_max_uint SIM_permu_record_test(SIM_permu_t *permu, LIB_Type_max_uint in, u_int mode, LIB_Type_max_uint op);
00119 extern double SIM_permu_report(SIM_permu_t *permu);
00120 extern double SIM_permu_max_energy(SIM_permu_t *permu);
00121 
00122 #endif  /* _SIM_POWER_PERMU_H */

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