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_PARAMETER_H 00035 #define _SIM_PARAMETER_H 00036 00037 #include <unistd.h> 00038 #include <sys/types.h> 00039 00040 /*Useful macros, wrappers and functions */ 00041 #define __INSTANCE__ mainpe__power 00042 #define GLOBDEF(t,n) t mainpe__power___ ## n 00043 #define GLOB(n) mainpe__power___ ## n 00044 #define FUNC(n, args...) mainpe__power___ ## n (args) 00045 #define FUNCPTR(n) mainpe__power___ ## n 00046 #define PARM(x) PARM_ ## x 00047 00048 #define LIB_Type_max_uint u_int64_t 00049 #define LIB_Type_max_int int64_t 00050 00051 #ifndef MAX 00052 #define MAX(a,b) (((a)>(b))?(a):(b)) 00053 #endif 00054 #ifndef MIN 00055 #define MIN(a,b) (((a)>(b))?(b):(a)) 00056 #endif 00057 00058 #define NEXT_DEPTH(d) ((d) > 0 ? (d) - 1 : (d)) 00059 00060 #ifndef BIGNUM 00061 #define BIGNUM (1e30) 00062 #endif 00063 #define BIGONE ((LIB_Type_max_uint)1) 00064 #define BIGNONE ((LIB_Type_max_uint)-1) 00065 #define HAMM_MASK(w) ((u_int)w < (sizeof(LIB_Type_max_uint) << 3) ? (BIGONE << (w)) - 1 : BIGNONE) 00066 00067 #define FALSE 0 00068 #define TRUE 1 00069 /* Used to communicate with the horowitz model */ 00070 #define RISE 1 00071 #define FALL 0 00072 #define NCH 1 00073 #define PCH 0 00074 00075 #define MAX_ENERGY 1 00076 #define AVG_ENERGY 0 00077 /*End useful macros, wrappers and functions */ 00078 00079 /*Available models for technology, router and link */ 00080 /*transistor type model */ 00081 #define LVT 1 00082 #define NVT 2 00083 #define HVT 3 00084 #define SIM_NO_MODEL 0 00085 #include "SIM_ALU_model.h" 00086 #include "SIM_array_model.h" 00087 #include "SIM_link_model.h" 00088 #include "SIM_misc_model.h" 00089 #include "SIM_permu_model.h" 00090 #include "SIM_router_model.h" 00091 /* End available models for router and link */ 00092 00093 /* User-defined router with selected tech node and operating freq and Vdd 00094 * CAUTION: Please do not alter the location of this SIM_port.h file, sequency tricky 00095 */ 00096 #include "SIM_port.h" 00097 /*End user-defined router with selected tech node and operating freq and Vdd */ 00098 00099 /* Useful macros related to parameters defined by users */ 00100 #define Vdd (PARM(Vdd)) 00101 #define Period ((double)1/(double)PARM(Freq)) 00102 00103 #define Powerfactor ((PARM(Freq))*Vdd*Vdd) 00104 #define EnergyFactor (Vdd*Vdd) 00105 /* End useful macros related to parameters defined by users */ 00106 00107 /* Technology file */ 00108 #include "SIM_technology.h" 00109 /* End technology file */ 00110 00111 #endif /* _SIM_PARAMETER_H */