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

sst/core/techModels/libORION/SIM_misc.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_MISC_INTERNAL_H
00035 #define _SIM_POWER_MISC_INTERNAL_H
00036 
00037 #include <sys/types.h>
00038 
00039 /* maximum level of selection arbiter tree */
00040 #define MAX_SEL_LEVEL   5
00041 
00042 
00043 /*
00044  * FIXME: cannot handle bus wider than 64-bit
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         /* redundant field */
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 /* bus model interface */
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 /* flip-flop model interface */
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 /* instruction window interface */
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  /* _SIM_POWER_MISC_INTERNAL_H */

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