Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Class Members | File Members

constants.h

Go to the documentation of this file.
00001 
00002 /*
00003  * constants.h
00004  *
00005  * This program is free software; you can redistribute it and/or
00006  * modify it under the terms of the GNU General Public License,
00007  * version 2, as published by the Free Software Foundation.
00008  *
00009  * This program is distributed in the hope that it will be useful,
00010  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00011  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00012  * GNU General Public License for more details.
00013  *
00014  * You should have received a copy of the GNU General Public License along
00015  * with this program; if not, write to the Free Software Foundation, Inc.,
00016  * 59 Temple Place, Suite 330, Boston, MA 02111-1307, USA.
00017  *
00018  * Author: Lavina Jain
00019  *
00020  */
00021 
00026 
00027 #ifndef _TYPES_H_
00028 #define _TYPES_H_
00029 
00031 #define CURRENT_TIME sc_simulation_time()
00032 
00034 #define NUM_VCS 1
00035 
00036 // parameters for topology
00038 #define MAX_NUM_ROWS 9
00039 
00040 #define MAX_NUM_COLS 9
00041 
00042 #define MAX_NUM_TILES MAX_NUM_ROWS * MAX_NUM_COLS
00043 
00044 // parameters for NWTile
00046 #define NUM_NB 4
00047 
00048 #define NUM_IC 5
00049 
00050 #define NUM_OC 5
00051 
00052 // parameters for mesh (non-toroidal) topology
00054 #define NUM_NB_C 2
00055 
00056 #define NUM_IC_C 3
00057 
00058 #define NUM_OC_C 3
00059 
00060 // parameters for mesh (non-toroidal) topology
00062 #define NUM_NB_B 3
00063 
00064 #define NUM_IC_B 4
00065 
00066 #define NUM_OC_B 4
00067 
00068 // direction ids
00070 #define N 0
00071 
00072 #define S 1
00073 
00074 #define E 2
00075 
00076 #define W 3
00077 
00078 #define C 4
00079 
00081 #define ND 5
00082 
00083 // buffer parameters
00084 #define BUF_BITSIZE     4
00085 
00086 #define MAX_NUM_BUFS    16
00087 
00088 // parameters for bitwidth
00089 #define ADDR_SIZE 32
00090 #define VCS_BITSIZE 2
00091 
00095 enum flit_type{
00096         HEAD,
00097         DATA,
00098         TAIL,
00099         HDT
00100 };
00101 
00105 enum pkt_type {
00106         ANT,
00107         NOC
00108 };
00109 
00113 enum ant_type {
00114         FORWARD,
00115         BACKWARD
00116 };
00117 
00121 enum routing_type {
00122         SOURCE,
00123         XY,
00124         OE
00125 };
00126 
00130 enum request_type {
00131         NONE,
00132         ROUTE,
00133         UPDATE
00134 };
00135 
00139 enum topology {
00140         MESH,
00141         TORUS
00142 };
00143 
00144 #define UI  unsigned int
00145 #define UL  unsigned long
00146 #define ULL unsigned long long
00147 
00148 #define borderN(ID) ((ID) < num_cols)
00149 #define borderS(ID) ((ID) >= num_tiles - num_cols)
00150 #define borderE(ID) (((ID) + 1) % num_cols == 0)
00151 #define borderW(ID) (((ID) % num_cols) == 0)
00152 
00153 #define border(ID) (borderN(ID) || borderS(ID) || borderE(ID) || borderW(ID))
00154 
00155 #define cornerNW(ID) ((ID) == 0)
00156 #define cornerNE(ID) ((ID) == num_cols - 1)
00157 #define cornerSW(ID) ((ID) == num_tiles - num_cols)
00158 #define cornerSE(ID) ((ID) == num_tiles - 1)
00159 
00160 #define corner(ID) (cornerNW(ID) || cornerNE(ID) || cornerSW(ID) || cornerSE(ID))
00161 
00162 #endif

Generated on Mon May 7 19:03:19 2007 for NIRGAM by  doxygen 1.3.9.1