- Timestamp:
- Jul 23, 2013, 5:23:13 PM (11 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
branches/v5/platforms/tsar_generic_xbar/top.cpp
r466 r467 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 /////////////////////////////////////////////////// … … 142 152 //////////////////////i///////////////////////////////////// 143 153 144 #include "hard_config.h" 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/" 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 #define BDEV_IMAGE_NAME "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" 192 #define BDEV_IMAGE_NAME PREFIX_OS"display/images.raw" 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 "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 uint64_t ncycles = 100000000000; // 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 397 #ifdef USE_GIET 352 398 assert( (vci_address_width == 40) and 353 399 "VCI address width must be 40 bits" ); 400 #endif 354 401 355 402 std::cout << std::endl; … … 528 575 //////////////////////////// 529 576 530 #if USE_ALMOS531 soclib::common::Loader loader(almos_bootloader_pathname,532 almos_archinfo_pathname,533 almos_kernel_pathname);534 #else535 577 soclib::common::Loader loader(soft_name); 536 #endif537 578 538 579 typedef soclib::common::GdbServer<soclib::common::Mips32ElIss> proc_iss; … … 754 795 signal_resetn = true; 755 796 797 if (gettimeofday(&t1, NULL) != 0) 798 { 799 perror("gettimeofday"); 800 return EXIT_FAILURE; 801 } 802 756 803 for (uint64_t n = 1; n < ncycles; n++) 757 804 { … … 759 806 //clusters[0][0]->proc[0]->cache_monitor(0x800002c000ULL); 760 807 //clusters[1][0]->memc->copies_monitor(0x800002C000ULL); 808 809 if( (n % 5000000) == 0) 810 { 811 812 if (gettimeofday(&t2, NULL) != 0) 813 { 814 perror("gettimeofday"); 815 return EXIT_FAILURE; 816 } 817 818 ms1 = (uint64_t)t1.tv_sec * 1000ULL + (uint64_t)t1.tv_usec / 1000; 819 ms2 = (uint64_t)t2.tv_sec * 1000ULL + (uint64_t)t2.tv_usec / 1000; 820 std::cerr << "platform clock frequency " << (double)5000000 / (double)(ms2 - ms1) << "Khz" << std::endl; 821 822 if (gettimeofday(&t1, NULL) != 0) 823 { 824 perror("gettimeofday"); 825 return EXIT_FAILURE; 826 } 827 } 761 828 762 829 if (debug_ok and (n > debug_from) and (n % debug_period == 0))
Note: See TracChangeset
for help on using the changeset viewer.