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_MISC_INTERNAL_H
00035 #define _SIM_POWER_MISC_INTERNAL_H
00036
00037 #include <sys/types.h>
00038
00039
00040 #define MAX_SEL_LEVEL 5
00041
00042
00043
00044
00045
00046 typedef struct {
00047 int model;
00048 int encoding;
00049 u_int data_width;
00050 u_int grp_width;
00051 LIB_Type_max_uint n_switch;
00052 double e_switch;
00053
00054 u_int bit_width;
00055 LIB_Type_max_uint bus_mask;
00056 } SIM_bus_t;
00057
00058 typedef struct {
00059 int model;
00060 u_int width;
00061 LIB_Type_max_uint n_anyreq;
00062 LIB_Type_max_uint n_chgreq;
00063 LIB_Type_max_uint n_grant;
00064 LIB_Type_max_uint n_enc[MAX_SEL_LEVEL];
00065 double e_anyreq;
00066 double e_chgreq;
00067 double e_grant;
00068 double e_enc[MAX_SEL_LEVEL];
00069 } SIM_sel_t;
00070
00071 typedef struct {
00072 int model;
00073 LIB_Type_max_uint n_switch;
00074 LIB_Type_max_uint n_keep_1;
00075 LIB_Type_max_uint n_keep_0;
00076 LIB_Type_max_uint n_clock;
00077 double e_switch;
00078 double e_keep_1;
00079 double e_keep_0;
00080 double e_clock;
00081 double I_static;
00082 } SIM_ff_t;
00083
00084
00085 extern int SIM_bus_init(SIM_bus_t *bus, int model, int encoding, u_int width, u_int grp_width, u_int n_snd, u_int n_rcv, double length, double time);
00086 extern int SIM_bus_record(SIM_bus_t *bus, LIB_Type_max_uint old_state, LIB_Type_max_uint new_state);
00087 extern double SIM_bus_report(SIM_bus_t *bus);
00088 extern LIB_Type_max_uint SIM_bus_state(SIM_bus_t *bus, LIB_Type_max_uint old_data, LIB_Type_max_uint old_state, LIB_Type_max_uint new_data);
00089
00090
00091 extern int SIM_fpfp_init(SIM_ff_t *ff, int model, double load);
00092 extern int SIM_fpfp_clear_stat(SIM_ff_t *ff);
00093 extern double SIM_fpfp_report(SIM_ff_t *ff);
00094
00095
00096 extern int SIM_iwin_sel_record(SIM_sel_t *sel, u_int req, int en, int last_level);
00097 extern double SIM_iwin_sel_report(SIM_sel_t *sel);
00098
00099 #endif