Changeset 464
- Timestamp:
- Jul 22, 2013, 11:56:26 AM (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/platforms/tsar_generic_xbar/top.cpp
r438 r464 96 96 // OS 97 97 /////////////////////////////////////////////////// 98 #define USE_ALMOS 0 99 100 #define almos_bootloader_pathname "bootloader.bin" 101 #define almos_kernel_pathname "kernel-soclib.bin@0xbfc10000:D" 102 #define almos_archinfo_pathname "arch-info.bin@0xBFC08000:D" 98 99 //#define USE_ALMOS 100 #define USE_GIET 101 102 #ifdef USE_ALMOS 103 #ifdef USE_GIET 104 #error "Can't use Two different OS" 105 #endif 106 #endif 107 108 #ifndef USE_ALMOS 109 #ifndef USE_GIET 110 #error "You need to specify one OS" 111 #endif 112 #endif 103 113 104 114 /////////////////////////////////////////////////// … … 137 147 #define vci_trdid_width 4 138 148 #define vci_wrplen_width 1 139 140 149 //////////////////////////////////////////////////////////// 141 150 // Main Hardware Parameters values 142 151 //////////////////////i///////////////////////////////////// 143 152 153 154 #ifdef USE_ALMOS 155 #include "almos/hard_config.h" 156 #define PREFIX_OS "almos/" 157 #endif 158 #ifdef USE_GIET 159 #define PREFIX_OS "giet_vm/" 144 160 #include "giet_vm/hard_config.h" 161 #endif 145 162 146 163 //////////////////////////////////////////////////////////// … … 162 179 #define L1_DSETS 64 163 180 181 #ifdef USE_ALMOS 182 #define FBUF_X_SIZE 512 183 #define FBUF_Y_SIZE 512 184 #endif 185 #ifdef USE_GIET 164 186 #define FBUF_X_SIZE 128 165 187 #define FBUF_Y_SIZE 128 166 188 #endif 189 190 #ifdef USE_GIET 167 191 #define BDEV_SECTOR_SIZE 512 168 192 #define BDEV_IMAGE_NAME "giet_vm/display/images.raw" 169 170 #define NIC_RX_NAME "giet_vm/nic/rx_packets.txt" 171 #define NIC_TX_NAME "giet_vm/nic/tx_packets.txt" 193 #endif 194 #ifdef USE_ALMOS 195 #define BDEV_SECTOR_SIZE 4096 196 #define BDEV_IMAGE_NAME PREFIX_OS"hdd-img.bin" 197 #endif 198 199 200 #define NIC_RX_NAME PREFIX_OS"nic/rx_packets.txt" 201 #define NIC_TX_NAME PREFIX_OS"nic/tx_packets.txt" 172 202 #define NIC_TIMEOUT 10000 173 203 … … 181 211 //////////////////////i///////////////////////////////////// 182 212 183 #define SOFT_NAME "giet_vm/soft.elf" 213 #ifdef USE_ALMOS 214 #define soft_name PREFIX_OS"bootloader.bin",\ 215 PREFIX_OS"kernel-soclib.bin@0xbfc10000:D",\ 216 PREFIX_OS"arch-info.bib@0xBFC08000:D" 217 #endif 218 #ifdef USE_GIET 219 #define soft_pathname PREFIX_OS"soft.elf" 220 #endif 184 221 185 222 //////////////////////////////////////////////////////////// … … 203 240 204 241 #define FBUF_BASE 0x00B2000000 205 #define FBUF_SIZE FBUF_X_SIZE * FBUF_Y_SIZE 242 #define FBUF_SIZE FBUF_X_SIZE * FBUF_Y_SIZE * 2 206 243 207 244 #define BDEV_BASE 0x00B3000000 … … 247 284 using namespace soclib::common; 248 285 249 250 char soft_name[256] = SOFT_NAME; // pathname to binary code 286 #ifdef USE_GIET 287 char soft_name[256] = soft_pathname; // pathname to binary code 288 #endif 251 289 size_t ncycles = 1000000000; // simulated cycles 252 290 char disk_name[256] = BDEV_IMAGE_NAME; // pathname to the disk image … … 261 299 uint32_t frozen_cycles = MAX_FROZEN_CYCLES; // monitoring frozen processor 262 300 size_t cluster_io_id = 0; // index of cluster containing IOs 301 struct timeval t1,t2; 302 uint64_t ms1,ms2; 263 303 264 304 ////////////// command line arguments ////////////////////// … … 273 313 else if ((strcmp(argv[n],"-SOFT") == 0) && (n+1<argc) ) 274 314 { 315 #ifdef USE_ALMOS 316 assert( 0 && "Can't define almos soft name" ); 317 #endif 318 #ifdef USE_GIET 275 319 strcpy(soft_name, argv[n+1]); 320 #endif 276 321 } 277 322 else if ((strcmp(argv[n],"-DISK") == 0) && (n+1<argc) ) … … 350 395 "The NB_NIC_CHANNELS parameter must be smaller than 9" ); 351 396 352 assert( (vci_address_width == vci_address_width) and 353 "address widths must be equal on internal & external networks" ); 354 397 #ifdef USE_GIET 355 398 assert( (vci_address_width == 40) and 356 399 "VCI address width must be 40 bits" ); 400 #endif 357 401 358 402 std::cout << std::endl; … … 369 413 370 414 std::cout << std::endl; 371 372 415 // Internal and External VCI parameters definition 373 416 typedef soclib::caba::VciParams<vci_cell_width_int, … … 531 574 //////////////////////////// 532 575 533 #if USE_ALMOS534 soclib::common::Loader loader(almos_bootloader_pathname,535 almos_archinfo_pathname,536 almos_kernel_pathname);537 #else538 576 soclib::common::Loader loader(soft_name); 539 #endif540 577 541 578 typedef soclib::common::GdbServer<soclib::common::Mips32ElIss> proc_iss; … … 743 780 signal_resetn = true; 744 781 782 if (gettimeofday(&t1, NULL) != 0) 783 { 784 perror("gettimeofday"); 785 return EXIT_FAILURE; 786 } 787 745 788 for (size_t n = 1; n < ncycles; n++) 746 789 { … … 748 791 //clusters[0][0]->proc[0]->cache_monitor(0x800002c000ULL); 749 792 //clusters[1][0]->memc->copies_monitor(0x800002C000ULL); 793 794 if( (n % 5000000) == 0) 795 { 796 797 if (gettimeofday(&t2, NULL) != 0) 798 { 799 perror("gettimeofday"); 800 return EXIT_FAILURE; 801 } 802 803 ms1 = (uint64_t)t1.tv_sec * 1000ULL + (uint64_t)t1.tv_usec / 1000; 804 ms2 = (uint64_t)t2.tv_sec * 1000ULL + (uint64_t)t2.tv_usec / 1000; 805 std::cerr << "platform clock frequency " << (double)5000000 / (double)(ms2 - ms1) << "Khz" << std::endl; 806 807 if (gettimeofday(&t1, NULL) != 0) 808 { 809 perror("gettimeofday"); 810 return EXIT_FAILURE; 811 } 812 } 813 750 814 751 815 if (debug_ok and (n > debug_from) and (n % debug_period == 0))
Note: See TracChangeset
for help on using the changeset viewer.