Changeset 504 for trunk/platforms/tsar_generic_xbar
- Timestamp:
- Aug 30, 2013, 6:28:10 PM (11 years ago)
- Location:
- trunk/platforms/tsar_generic_xbar
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/platforms/tsar_generic_xbar/soclib.conf
r486 r504 1 1 2 config.addDescPath("/Users/alain/soc/tsar-trunk-svn-2013/") -
trunk/platforms/tsar_generic_xbar/top.cpp
r493 r504 98 98 /////////////////////////////////////////////////// 99 99 100 //#define USE_ALMOS 101 #define USE_GIET100 #define USE_ALMOS 1 101 //#define USE_GIET 102 102 103 103 #ifdef USE_ALMOS … … 116 116 // Parallelisation 117 117 /////////////////////////////////////////////////// 118 #define USE_OPENMP 118 #define USE_OPENMP 0 119 119 120 120 #if USE_OPENMP … … 123 123 124 124 // cluster index (computed from x,y coordinates) 125 #define cluster(x,y) (y + YMAX *x)125 #define cluster(x,y) (y + YMAX * x) 126 126 127 127 /////////////////////////////////////////////////////////// … … 139 139 #define vci_cell_width_ext 8 140 140 141 #ifdef USE_ALMOS 142 #define vci_address_width 32 143 #endif 144 #ifdef USE_GIET 145 #define vci_address_width 40 146 #endif 141 147 #define vci_plen_width 8 142 #define vci_address_width 40143 148 #define vci_rerror_width 1 144 149 #define vci_clen_width 1 … … 224 229 //////////////////////i///////////////////////////////////// 225 230 226 #define MAX_FROZEN_CYCLES 10000 231 #define MAX_FROZEN_CYCLES 100000 227 232 228 233 ///////////////////////////////////////////////////////// … … 240 245 241 246 #define FBUF_BASE 0x00B2000000 242 #define FBUF_SIZE FBUF_X_SIZE * FBUF_Y_SIZE * 2247 #define FBUF_SIZE (FBUF_X_SIZE * FBUF_Y_SIZE * 2) 243 248 244 249 #define BDEV_BASE 0x00B3000000 … … 260 265 #define MEMC_SIZE 0x0010000000 // 256 Mbytes per cluster 261 266 262 #define XICU_BASE 0x00B0000000 267 #ifdef USE_ALMOS 268 #define XICU_BASE 0x0030000000 269 #endif 270 #ifdef USE_GIET 271 #define XICU_BASE 0x00B0000000 272 #endif 263 273 #define XICU_SIZE 0x0000001000 // 4 Kbytes 264 274 265 #define MDMA_BASE 0x00B1000000 275 #ifdef USE_ALMOS 276 #define MDMA_BASE 0x0031000000 277 #endif 278 #ifdef USE_GIET 279 #define MDMA_BASE 0x00B1000000 280 #endif 266 281 #define MDMA_SIZE 0x0000001000 * NB_DMA_CHANNELS // 4 Kbytes per channel 267 282 … … 281 296 #define CDMA_TGTID 8 282 297 298 bool stop_called = false; 299 283 300 ///////////////////////////////// 284 301 int _main(int argc, char *argv[]) … … 291 308 char soft_name[256] = soft_pathname; // pathname to binary code 292 309 #endif 293 uint64_t ncycles = 1000000000;// simulated cycles310 uint64_t ncycles = 0xFFFFFFFFFFFFFFFF; // simulated cycles 294 311 char disk_name[256] = BDEV_IMAGE_NAME; // pathname to the disk image 295 312 char nic_rx_name[256] = NIC_RX_NAME; // pathname to the rx packets file … … 302 319 uint32_t debug_from = 0; // trace start cycle 303 320 uint32_t frozen_cycles = MAX_FROZEN_CYCLES; // monitoring frozen processor 304 size_t cluster_io_id = 0;// index of cluster containing IOs321 size_t cluster_io_id; // index of cluster containing IOs 305 322 struct timeval t1,t2; 306 323 uint64_t ms1,ms2; … … 311 328 for (int n = 1; n < argc; n = n + 2) 312 329 { 313 if ((strcmp(argv[n], "-NCYCLES") == 0) && (n+1<argc))314 { 315 ncycles = atoi(argv[n +1]);316 } 317 else if ((strcmp(argv[n], "-SOFT") == 0) && (n+1<argc))330 if ((strcmp(argv[n], "-NCYCLES") == 0) && (n + 1 < argc)) 331 { 332 ncycles = atoi(argv[n + 1]); 333 } 334 else if ((strcmp(argv[n], "-SOFT") == 0) && (n + 1 < argc)) 318 335 { 319 336 #ifdef USE_ALMOS … … 321 338 #endif 322 339 #ifdef USE_GIET 323 strcpy(soft_name, argv[n +1]);324 #endif 325 } 326 else if ((strcmp(argv[n],"-DISK") == 0) && (n +1<argc))327 { 328 strcpy(disk_name, argv[n +1]);329 } 330 else if ((strcmp(argv[n],"-DEBUG") == 0) && (n +1<argc))340 strcpy(soft_name, argv[n + 1]); 341 #endif 342 } 343 else if ((strcmp(argv[n],"-DISK") == 0) && (n + 1 < argc)) 344 { 345 strcpy(disk_name, argv[n + 1]); 346 } 347 else if ((strcmp(argv[n],"-DEBUG") == 0) && (n + 1 < argc)) 331 348 { 332 349 debug_ok = true; 333 debug_from = atoi(argv[n +1]);334 } 335 else if ((strcmp(argv[n], "-MEMCID") == 0) && (n+1<argc))336 { 337 debug_memc_id = atoi(argv[n +1]);338 assert( (debug_memc_id < (XMAX*YMAX)) &&350 debug_from = atoi(argv[n + 1]); 351 } 352 else if ((strcmp(argv[n], "-MEMCID") == 0) && (n + 1 < argc)) 353 { 354 debug_memc_id = atoi(argv[n + 1]); 355 assert((debug_memc_id < (XMAX * YMAX)) && 339 356 "debug_memc_id larger than XMAX * YMAX" ); 340 357 } 341 else if ((strcmp(argv[n], "-PROCID") == 0) && (n+1<argc))342 { 343 debug_proc_id = atoi(argv[n +1]);344 assert( (debug_proc_id < (XMAX * YMAX * NB_PROCS_MAX)) &&345 "debug_proc_id larger than XMAX * YMAX * NB_PROCS" 346 } 347 else if ((strcmp(argv[n], "-THREADS") == 0) && ((n +1) < argc))348 { 349 threads_nr = atoi(argv[n +1]);358 else if ((strcmp(argv[n], "-PROCID") == 0) && (n + 1 < argc)) 359 { 360 debug_proc_id = atoi(argv[n + 1]); 361 assert((debug_proc_id < (XMAX * YMAX * NB_PROCS_MAX)) && 362 "debug_proc_id larger than XMAX * YMAX * NB_PROCS"); 363 } 364 else if ((strcmp(argv[n], "-THREADS") == 0) && ((n + 1) < argc)) 365 { 366 threads_nr = atoi(argv[n + 1]); 350 367 threads_nr = (threads_nr < 1) ? 1 : threads_nr; 351 368 } 352 else if ((strcmp(argv[n], "-FROZEN") == 0) && (n +1 < argc))353 { 354 frozen_cycles = atoi(argv[n +1]);355 } 356 else if ((strcmp(argv[n], "-PERIOD") == 0) && (n +1 < argc))357 { 358 debug_period = atoi(argv[n +1]);369 else if ((strcmp(argv[n], "-FROZEN") == 0) && (n + 1 < argc)) 370 { 371 frozen_cycles = atoi(argv[n + 1]); 372 } 373 else if ((strcmp(argv[n], "-PERIOD") == 0) && (n + 1 < argc)) 374 { 375 debug_period = atoi(argv[n + 1]); 359 376 } 360 377 else … … 401 418 #ifdef USE_GIET 402 419 assert( (vci_address_width == 40) and 403 "VCI address width must be 40 bits" ); 404 #endif 420 "VCI address width with the GIET must be 40 bits" ); 421 #endif 422 423 #ifdef USE_ALMOS 424 assert( (vci_address_width == 32) and 425 "VCI address width with ALMOS must be 32 bits" ); 426 #endif 427 405 428 406 429 std::cout << std::endl; … … 454 477 else if (XMAX <= 4) x_width = 2; 455 478 else if (XMAX <= 8) x_width = 3; 456 else 479 else x_width = 4; 457 480 458 481 if (YMAX == 1) y_width = 0; … … 460 483 else if (YMAX <= 4) y_width = 2; 461 484 else if (YMAX <= 8) y_width = 3; 462 else y_width = 4; 485 else y_width = 4; 486 487 488 #ifdef USE_ALMOS 489 cluster_io_id = 0xbfc00000 >> (vci_address_width - x_width - y_width); // index of cluster containing IOs 490 #else 491 cluster_io_id = 0; 492 #endif 463 493 464 494 ///////////////////// … … 808 838 } 809 839 810 for (uint64_t n = 1; n < ncycles ; n++)840 for (uint64_t n = 1; n < ncycles && !stop_called; n++) 811 841 { 812 842 // Monitor a specific address for L1 & L2 caches … … 823 853 } 824 854 825 ms1 = (uint64_t) t1.tv_sec * 1000ULL + (uint64_t)t1.tv_usec / 1000;826 ms2 = (uint64_t) t2.tv_sec * 1000ULL + (uint64_t)t2.tv_usec / 1000;827 std::cerr << "platform clock frequency " << (double) 5000000 / (double)(ms2 - ms1) << "Khz" << std::endl;855 ms1 = (uint64_t) t1.tv_sec * 1000ULL + (uint64_t) t1.tv_usec / 1000; 856 ms2 = (uint64_t) t2.tv_sec * 1000ULL + (uint64_t) t2.tv_usec / 1000; 857 std::cerr << "platform clock frequency " << (double) 5000000 / (double) (ms2 - ms1) << "Khz" << std::endl; 828 858 829 859 if (gettimeofday(&t1, NULL) != 0) … … 919 949 sc_start(sc_core::sc_time(1, SC_NS)); 920 950 } 951 952 953 for (size_t i = 0; i < (XMAX * YMAX); i++) 954 { 955 size_t x = i / YMAX; 956 size_t y = i % YMAX; 957 delete clusters[x][y]; 958 } 959 921 960 return EXIT_SUCCESS; 922 961 } 923 962 963 964 void handler(int dummy = 0) { 965 stop_called = true; 966 sc_stop(); 967 } 968 969 924 970 int sc_main (int argc, char *argv[]) 925 971 { 972 signal(SIGINT, handler); 973 926 974 try { 927 975 return _main(argc, argv); -
trunk/platforms/tsar_generic_xbar/top.desc
r438 r504 7 7 8 8 vci_plen_size = 8 9 vci_addr_size = 409 vci_addr_size = 32 10 10 vci_rerror_size = 1 11 11 vci_clen_size = 1 -
trunk/platforms/tsar_generic_xbar/tsar_xbar_cluster/caba/source/src/tsar_xbar_cluster.cpp
r485 r504 145 145 IntTab(cluster_id, tgtid_memc), // TGTID direct space 146 146 (cluster_id << l_width) + nb_procs, // CC_GLOBAL_ID 147 x_width, // Number of x bits in platform 148 y_width, // Number of y bits in platform 147 149 memc_ways, memc_sets, 16, // CACHE SIZE 148 150 3, // MAX NUMBER OF COPIES
Note: See TracChangeset
for help on using the changeset viewer.