00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034 #ifndef _SIM_POWER_ALU_H
00035 #define _SIM_POWER_ALU_H
00036
00037 #include "SIM_parameter.h"
00038
00039
00040 #define WaluNOTp (2 * Lamda)
00041 #define WaluNOTn (1 * Lamda)
00042 #define Walu2NANDp (2 * Lamda)
00043 #define Walu2NANDn (2 * Lamda)
00044 #define Walu3NANDp (3 * Lamda)
00045 #define Walu3NANDn (2 * Lamda)
00046 #define Walu4NANDp (4 * Lamda)
00047 #define Walu4NANDn (2 * Lamda)
00048 #define Walu2NORp (4 * Lamda)
00049 #define Walu2NORn (1 * Lamda)
00050 #define Walu3NORp (6 * Lamda)
00051 #define Walu3NORn (1 * Lamda)
00052 #define Walu4NORp (8 * Lamda)
00053 #define Walu4NORn (1 * Lamda)
00054 #define WaluXORp (8 * Lamda)
00055 #define WaluXORn (2 * Lamda)
00056 #define WaluPASSp (3 * Lamda)
00057 #define WaluPASSn (3 * Lamda)
00058
00059 typedef struct {
00060 int model;
00061 u_int data_width;
00062 LIB_Type_max_uint n_chg_blk[PLX_BLK];
00063 double e_blk[PLX_BLK];
00064
00065 LIB_Type_max_uint a_d1;
00066 LIB_Type_max_uint a_d2;
00067 LIB_Type_max_uint l_d1;
00068 LIB_Type_max_uint l_d2;
00069 u_int type;
00070 } SIM_ALU_t;
00071
00072 extern int SIM_ALU_init(SIM_ALU_t *alu, int model, u_int data_width);
00073 extern int SIM_ALU_record(SIM_ALU_t *alu, LIB_Type_max_uint d1, LIB_Type_max_uint d2, u_int type);
00074 extern double SIM_ALU_report(SIM_ALU_t *alu);
00075 extern double SIM_ALU_stat_energy(SIM_ALU_t *alu, int max);
00076
00077 #endif