config_params.h

Go to the documentation of this file.
00001 /*
00002  * =====================================================================================
00003  *
00004  *       Filename:  mc_constants.cc
00005  *
00006  *    Description:  This file inits all the dram parameters based on clock
00007  *    speeds chosen.
00008  *
00009  *        Version:  1.0
00010  *        Created:  08/10/2010 01:11:02 AM
00011  *       Revision:  none
00012  *       Compiler:  gcc
00013  *
00014  *         Author:  Mitchelle Rasquinha (), mitchelle.rasquinha@gatech.edu
00015  *        Company:  Georgia Institute of Technology
00016  *
00017  * =====================================================================================
00018  */
00019 
00020 #ifndef  mc_constants_cc_INC
00021 #define  mc_constants_cc_INC
00022 
00023 #include        "simIrisComponentHeader.h"
00024 #include        "genericData.h"
00025 #include        "mc_constants.h"
00026 #include        "stats.h"
00027 
00028 //#define DEBUG
00029 //#define DEEP_DEBUG
00030 /* Generic topology parameters */
00031 uint no_nodes = 16, 
00032      no_mcs = 2,
00033      do_two_stage_router = 0,
00034      max_phy_link_bits = 128,
00035      links = 0;
00036 uint no_msg_classes = 1;
00037 
00038 uint network_frequency = 1200; //MHz
00039 uint stat_print_level = 1;
00040 
00041 ullint max_sim_time = 10000000;
00042 
00043 IrisStats* istat = new IrisStats();
00044 //Sharda
00045 string network_type = "NONE";
00046 uint no_of_cores = 14;
00047 uint concentration = 1;
00048 
00049 ROUTING_SCHEME rc_method = XY;
00050 SW_ARBITRATION sw_arbitration = ROUND_ROBIN;
00051 ROUTER_MODEL router_model = PHYSICAL;
00052 string router_model_string = "PHYSICAL";
00053 MC_MODEL mc_model = SINK;
00054 string mc_model_string = "SINK";
00055 TERMINAL_MODEL terminal_model = GENERIC_PKTGEN;
00056 string terminal_model_string= "GENERIC_PKTGEN";
00057 message_class priority_msg_type = PRIORITY_REQ;
00058 message_class terminal_msg_class = RESPONSE_PKT;
00059 string terminal_msg_class_string = "RESPONSE_PKT";
00060 uint print_setup = 0;
00061 uint grid_size=4; 
00062 const bool multiple_flit_in_buf = true;
00063 vector<uint> mc_positions;
00064 vector<string> traces;
00065 uint vcs=1, ports=5, buffer_size=2, credits=2;
00066 string trace_name, output_path, msg_type_string;
00067 string routing_scheme, sw_arbitration_scheme;
00068 
00069 /* TPG parameters */
00070 uint mean_irt = 50;
00071 uint pkt_payload_length = 128;
00072 
00073 /* Flat mc and other mc knobs */
00074 uint mc_response_pkt_payload_length = 512;
00075 
00076 string addr_map_scheme_string,mc_scheduling_algorithm_string,dram_page_policy_string;
00077 uint THREAD_BITS_POSITION = 25;
00078 uint MC_ADDR_BITS = 12;
00079 uint BANK_BITS = 13;
00080 bool do_request_reply_network = false;
00081 
00082 DRAM_CONFIG dram_config_string = DDR3_1600_10;
00083 
00084 
00085 DRAM_PAGE_POLICY dram_page_policy = OPEN_PAGE_POLICY; 
00086 MC_SCHEDULLING_ALGO mc_scheduling_algorithm = FR_FCFS;
00087 ADDR_MAP_SCHEME addr_map_scheme = PAGE_INTERLEAVING;
00088 uint NO_OF_THREADS=16;
00089 uint MAX_BUFFER_SIZE = 8;
00090 uint MAX_CMD_BUFFER_SIZE = 16;
00091 uint RESPONSE_BUFFER_SIZE = 56*8; 
00092 
00093 
00094 uint NO_OF_CHANNELS=1;          //  (int)log2() = k bits. 
00095 uint NO_OF_RANKS=1;                     //  (int)log2() = l bits.
00096 
00097 uint NO_OF_BANKS=8;                     //  (int)log2() = b bits. 
00098 //   uint NO_OF_BUFFERS = NO_OF_BANKS;
00099 
00100 uint NO_OF_ROWS = 8192;                 //4096 //  (int)log2() = r bits. 
00101 uint NO_OF_COLUMNS = 128;               //  (int)log2() = c bits. 
00102 uint COLUMN_SIZE = 64;                  //  (int)log2() = v bits.  Column Size = 2bytes
00103 /* uint BLOCKS_PER_ROW = 128;           //  (int)log2() = n bits.  Cache line Per Row
00104    uint CACHE_BLOCK_SIZE = 64;          //  (int)log2() = z bits.  L2 Cache Block Size
00105    uint ROW_SIZE = NO_OF_COLUMNS*COLUMN_SIZE; //(Also equal to BLOCKS_PER_ROW*CACHE_BLOCK_SIZE)
00106    uint DRAM_SIZE =  NO_OF_CHANNELS*NO_OF_RANKS*NO_OF_BANKS*NO_OF_ROWS*ROW_SIZE;
00107  */
00108 uint NETWORK_ADDRESS_BITS = 32;
00109 uint NETWORK_THREADID_BITS = 6;
00110 uint NETWORK_COMMAND_BITS = 3;
00111 
00112 uint MSHR_SIZE= 8;
00113 
00114 float CORE_SPEED = 3000;
00115 float CYCLE_2_NS = (CORE_SPEED*1.0 / 1000);
00116 
00117 uint DDR_BUS_WIDTH;
00118 float BUS_SPEED;
00119 float MEM_SPEED;
00120 float MEM_CYCLE;
00121 float BUS_CYCLE;
00122 float tREFI;
00123 float tRFC;
00124 float tRC;
00125 float tRAS;
00126 uint t_CMD;
00127 uint t_RCD;
00128 uint t_RRD;
00129 uint t_RAS;
00130 uint t_CAS;
00131 uint t_RTRS;
00132 uint t_OST;
00133 uint t_WR;
00134 uint t_WTR;
00135 uint t_RP;
00136 uint t_CCD;
00137 uint t_AL;
00138 uint t_CWD;
00139 uint t_RC;
00140 uint t_RTP;
00141 uint t_RFC;
00142 
00143 void 
00144 init_dram_timing_parameters( void)
00145 {
00146     switch ( dram_config_string )
00147     {      
00148         case DDR3_1333_9:        
00149             {
00150                 //DDR3 1333 -9-9-9 Gbps memory system.  
00151                 //Composed of 2 Gbit chips.  2 ranks, each rank has 8 2Gbit(x8) chips.
00152                 //This is a 64 bit wide interface.
00153                 //Total is 4096 MB
00154                 //Bus Bandwidth is  10.667 GB/s
00155                 //9-9-9 means 9*2 DDR half cycles for t_CAS and (9 / 667) = 13.5ns for t_RCD, t_RP
00156                 DDR_BUS_WIDTH = 8;
00157                 BUS_SPEED = 1333;
00158                 MEM_SPEED = 667;
00159                 MEM_CYCLE = (CORE_SPEED*1.0 / MEM_SPEED);
00160                 BUS_CYCLE = (CORE_SPEED*1.0 / BUS_SPEED);
00161 
00162                 tREFI = 7.8;
00163                 tRFC = 160;
00164                 tRC = 49.5;
00165                 tRAS = 36;
00166 
00167                 t_CMD = ceil (1.0 * BUS_CYCLE);
00168                 t_RCD = ceil (13.5 * CYCLE_2_NS);
00169                 t_RRD = ceil (7.5 * CYCLE_2_NS);
00170                 t_RAS = ceil (36 * CYCLE_2_NS);
00171                 t_CAS = ceil (9.0 * MEM_CYCLE);
00172                 t_RTRS = ceil (1.0 * MEM_CYCLE);
00173                 t_OST = ceil (1.0 * MEM_CYCLE);
00174                 t_WR = ceil (15 * CYCLE_2_NS);
00175                 t_WTR = ceil (7.5 * CYCLE_2_NS);
00176                 t_RP = ceil (13.5 * CYCLE_2_NS);
00177                 t_CCD = ceil (DDR_BUS_WIDTH/2 * MEM_CYCLE); 
00178                 t_AL = 0;
00179                 t_CWD = (ullint)(t_CAS-t_CMD);
00180                 t_RC = ceil (49.5 * CYCLE_2_NS);
00181                 t_RTP = ceil (7.5 * CYCLE_2_NS);
00182                 t_RFC = ceil (160 * CYCLE_2_NS);
00183             }
00184             break;
00185         case DDR3_1600_10:        
00186             {
00187                 //  DDR3 1600 -10-10-10 Gbps memory system.  
00188                 //  Composed of 2 Gbit chips.  2 ranks, each rank has 8 2Gbit(x8) chips.
00189                 //  This is a 64 bit wide interface.
00190                 //  Total is 4096 MB
00191                 //  Bus Bandwidth is  14.4 GB/s
00192                 //  10-10-10 means 10*2 DDR half cycles for t_CAS and (10 / 800) = 12.5ns for t_RCD, t_RP
00193                 DDR_BUS_WIDTH = 8;              // 64 bit = 8 bytes
00194                 BUS_SPEED = 1600;               
00195                 MEM_SPEED = 800;
00196                 MEM_CYCLE = (CORE_SPEED*1.0 / MEM_SPEED);       
00197                 BUS_CYCLE = (CORE_SPEED*1.0 / BUS_SPEED);
00198 
00199                 tREFI = 7.8;
00200                 tRFC = 160;
00201                 tRC = 47.5;
00202                 tRAS = 35;
00203 
00204                 t_CMD   = (ullint)ceil (1.0 * BUS_CYCLE);
00205                 t_RCD   = (ullint)ceil (12.5 * CYCLE_2_NS);             // Taken from datasheet
00206                 t_RRD   = (ullint)ceil (6.0 * CYCLE_2_NS);              // Taken from datasheet
00207                 t_RAS   = (ullint)ceil (35 * CYCLE_2_NS);               // Taken from datasheet
00208                 t_CAS   = (ullint)ceil (10.0 * MEM_CYCLE);              // 10-10-10 So 10 Mem Cycles
00209                 t_RTRS  = (ullint)ceil (1.0 * MEM_CYCLE);
00210                 t_OST   = (ullint)ceil (1.0 * MEM_CYCLE);
00211                 t_WR    = (ullint)ceil (15 * CYCLE_2_NS);               // Taken from datasheet
00212                 t_WTR   = (ullint)ceil (7.5 * CYCLE_2_NS);              // Taken from datasheet
00213                 t_RP    = (ullint)ceil (12.5 * CYCLE_2_NS);             // Taken from datasheet
00214                 t_CCD   = (ullint)ceil (DDR_BUS_WIDTH/2 * MEM_CYCLE);    // Taken from datasheet
00215                 t_AL    = 0;                                            // No posted CAS will have t_AL = 0
00216                 t_CWD   = t_CAS-t_CMD;
00217                 t_RC    = (ullint)ceil (47.5 * CYCLE_2_NS);             // Taken from datasheet
00218                 t_RTP   = (ullint)ceil (7.5 * CYCLE_2_NS);              // Taken from datasheet
00219                 t_RFC   = (ullint)ceil (160 * CYCLE_2_NS);              // Taken from datasheet
00220             }
00221             break;
00222 
00223         case DDR3_1333_6:       
00224             {
00225                 //  DDR3 1333 -6-6-6 Gbps memory system.  
00226                 //  Composed of 2 Gbit chips.  2 ranks, each rank has 8 2Gbit(x8) chips.
00227                 //  This is a 64 bit wide interface.
00228                 //  Total is 4096 MB
00229                 //  Bus Bandwidth is  10.667 GB/s
00230                 //  6-6-6 means 6*2 DDR half cycles for t_CAS and (6 / 667) = 9ns for t_RCD, t_RP
00231                 DDR_BUS_WIDTH = 8;              // 64 bit = 8 bytes
00232                 BUS_SPEED = 1333;               
00233                 MEM_SPEED = 667;
00234                 MEM_CYCLE = (CORE_SPEED*1.0 / MEM_SPEED);       
00235                 BUS_CYCLE = (CORE_SPEED*1.0 / BUS_SPEED);
00236 
00237                 t_CMD   = ceil (1.0 * BUS_CYCLE);
00238                 t_RCD   = ceil (9 * CYCLE_2_NS);                // Taken from DRAMSim spd
00239                 t_RRD   = ceil (6 * CYCLE_2_NS);                // TODO FIXME In most cases doesn't matter
00240                 t_RAS   = ceil (30 * CYCLE_2_NS);               // Taken from DRAMSim spd
00241                 t_CAS   = ceil (6.0 * MEM_CYCLE);               // 6-6-6 So 6 Mem Cycles
00242                 t_RTRS  = ceil (1.0 * MEM_CYCLE);
00243                 t_OST   = ceil (1.0 * MEM_CYCLE);
00244                 t_WR    = ceil (10 * CYCLE_2_NS);               // Taken from DRAMSim spd
00245                 t_WTR   = ceil (t_WR / 2);                      // TODO t_WTR not defined and I took average of 0 and t_WR
00246                 t_RP    = ceil (9 * CYCLE_2_NS);                // Taken from DRAMSim spd
00247                 t_CCD   = ceil (DDR_BUS_WIDTH/2 * MEM_CYCLE);   // TODO Bus Cycle = Half Mem Cycle. burst of 8 beats
00248                 t_AL    = 0;                                    // No posted CAS will have t_AL = 0
00249                 t_CWD   = t_CAS-t_CMD;
00250                 t_RC    = ceil (40.5 * CYCLE_2_NS);             // Taken from DRAMSim spd
00251                 t_RTP   = ceil (3.0 * MEM_CYCLE);               // TODO don't know yet. default in DRAMSim for DDR2 & DDR3 
00252                 t_RFC   = ceil (210 * CYCLE_2_NS);              // FIXME Taken from DRAMSim spd
00253             }
00254             break;
00255         case DDR2_533_4:       
00256             {
00257                 //  DDR2 533 4-4-4 Mbps memory system. 
00258                 //  Composed of 72 512 Mbit chips. 2 ranks   
00259                 //  Total is 4 GB
00260                 //  Bus Bandwidth is 4.3 GB/s
00261                 //  4-4-4 means 4*2 DDR half cycles for t_CAS and (4 / 266); = 15ns for t_RCD, t_RP
00262 
00263                 //  Corresponds to MT36HTJ51272Y-53E 4 GB part from Micron, aka PC2-4200 DRAM
00264                 // non-registered mode (doesn't add a cycle);
00265                 DDR_BUS_WIDTH = 8;              // 64 bit = 8 bytes
00266                 BUS_SPEED = 533;                
00267                 MEM_SPEED = 266;                //  artifact of not knowing correct timing values
00268                 MEM_CYCLE = (CORE_SPEED*1.0 / MEM_SPEED);       // artifact of not knowing correct timing values
00269                 BUS_CYCLE = (CORE_SPEED*1.0 / BUS_SPEED);
00270 
00271                 t_CMD   = ceil (1.0 * BUS_CYCLE);
00272                 t_RCD   = ceil (15 * CYCLE_2_NS);       // Taken from datasheet
00273                 t_RRD   = ceil (7.5 * CYCLE_2_NS);      // TODO Generic for many DDR2. Taken from Data Sheet of some other part
00274                 t_RAS   = ceil (40 * CYCLE_2_NS);       // t_RAS = t_RC - t_RCD 
00275                 t_CAS   = ceil (4.0 * MEM_CYCLE);       // 4-4-4 So 4 Mem Cycles
00276                 t_RTRS  = ceil (1.0 * MEM_CYCLE);
00277                 t_OST   = ceil (1.0 * MEM_CYCLE);
00278                 t_WR    = ceil (15 * CYCLE_2_NS);       // Taken from component data sheet
00279                 t_WTR   = ceil (10 * CYCLE_2_NS);       // TODO Generic for many DDR2. Taken from Data Sheet of some other part
00280                 t_RP    = ceil (15 * CYCLE_2_NS);       // Taken from datasheet
00281                 t_CCD   = ceil (2.0 * MEM_CYCLE);       // TODO Generic for many DDR2. Taken from Data Sheet of some other part
00282                 t_AL    = 0;                            // No posted CAS will have t_AL = 0
00283                 t_CWD   = t_CAS-t_CMD;
00284                 t_RC    = ceil (55 * CYCLE_2_NS);       // Taken from datasheet
00285                 t_RTP   = ceil (7.5 * CYCLE_2_NS);      // TODO Generic for many DDR2. Taken from Data Sheet of some other part 
00286                 t_RFC   = ceil (105 * CYCLE_2_NS);      // Taken from datasheet
00287             }
00288             break;
00289 
00290         case DDR2_667_4:       
00291             {
00292                 //  DDR2 667 4-4-4 Mbps memory system.  
00293                 //  Composed of 1 Gbit chips.  1 rank, each rank has 5 1 Gbit (x8) chips.
00294                 //  The 5th chip is for ECC, otherwise this is a 32 bit wide interface.
00295                 //  Total is 512 MB
00296                 //  Bus Bandwidth is 2.67 GB/s
00297                 //  4-4-4 means 4*2 DDR half cycles for t_CAS and (4 / 333M) = 12ns for t_RCD, t_RP
00298 
00299                 DDR_BUS_WIDTH = 4;                              // 32 bit = 4 bytes
00300                 BUS_SPEED = 667;                
00301                 MEM_SPEED = 333;                                //  artifact of not knowing correct timing values
00302                 MEM_CYCLE = (CORE_SPEED*1.0 / MEM_SPEED);               // artifact of not knowing correct timing values
00303                 BUS_CYCLE = (CORE_SPEED*1.0 / BUS_SPEED);
00304 
00305                 t_CMD   = ceil (1.0 * BUS_CYCLE);
00306                 t_RCD   = ceil (12 * CYCLE_2_NS);               // Taken from DRAMSim spd
00307                 t_RRD   = ceil (6 * CYCLE_2_NS);                // TODO FIXME In most cases doesn't matter
00308                 t_RAS   = ceil (45 * CYCLE_2_NS);               // Taken from DRAMSim spd
00309                 t_CAS   = ceil (4.0 * MEM_CYCLE);               // 4-4-4 So 4 Mem Cycles
00310                 t_RTRS  = ceil (1.0 * MEM_CYCLE);
00311                 t_OST   = ceil (1.0 * MEM_CYCLE);
00312                 t_WR    = ceil (15 * CYCLE_2_NS);               // Taken from DRAMSim spd
00313                 t_WTR   = ceil (t_WR / 2);                      // TODO FIXME  t_WTR not defined and I took average of 0 and t_WR
00314                 t_RP    = ceil (12 * CYCLE_2_NS);               // Taken from DRAMSim spd
00315                 t_CCD   = ceil (DDR_BUS_WIDTH/2 * MEM_CYCLE);   // TODO Bus Cycle = Half Mem Cycle. burst of 4 beats
00316                 t_AL    = 0;                                    // No posted CAS will have t_AL = 0
00317                 t_CWD   = t_CAS-t_CMD;
00318                 t_RC    = ceil (57 * CYCLE_2_NS);               // Taken from DRAMSim spd
00319                 t_RTP   = ceil (3.0 * MEM_CYCLE);               // TODO don't know yet. default in DRAMSim for DDR2 & DDR3
00320                 t_RFC   = ceil (127.5 * CYCLE_2_NS);            // FIXME Taken from DRAMSim spd
00321             }
00322             break;
00323     }
00324 }
00325 #endif   /* ----- #ifndef mc_constants_cc_INC  ----- */
00326 

Generated on Tue Oct 19 17:22:00 2010 for IRIS by  doxygen 1.5.8