- Timestamp:
- Jan 13, 2014, 5:38:28 PM (11 years ago)
- Location:
- trunk/platforms/tsar_generic_xbar
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/platforms/tsar_generic_xbar/top.cpp
r572 r619 123 123 124 124 // cluster index (computed from x,y coordinates) 125 #define cluster(x,y) (y + YMAX * x) 125 #ifdef USE_ALMOS 126 # define cluster(x,y) (y + x * Y_MAX) 127 #else 128 # define cluster(x,y) (y + (x << Y_WIDTH)) 129 #endif 130 126 131 127 132 #define min(x, y) (x < y ? x : y) … … 173 178 //////////////////////i///////////////////////////////////// 174 179 175 #define XMAX CLUSTER_X176 #define YMAX CLUSTER_Y180 #define XMAX X_SIZE 181 #define YMAX Y_SIZE 177 182 178 183 #define XRAM_LATENCY 0 … … 373 378 if ((strcmp(argv[n], "-NCYCLES") == 0) && (n + 1 < argc)) 374 379 { 375 ncycles = atoi(argv[n + 1]);380 ncycles = (uint64_t) strtol(argv[n + 1], NULL, 0); 376 381 } 377 382 else if ((strcmp(argv[n], "-SOFT") == 0) && (n + 1 < argc)) … … 391 396 { 392 397 debug_ok = true; 393 debug_from = atoi(argv[n + 1]);398 debug_from = (uint32_t) strtol(argv[n + 1], NULL, 0); 394 399 } 395 400 else if ((strcmp(argv[n], "-MEMCID") == 0) && (n + 1 < argc)) 396 401 { 397 debug_memc_id = atoi(argv[n + 1]); 398 assert((debug_memc_id < (XMAX * YMAX)) && 402 debug_memc_id = (size_t) strtol(argv[n + 1], NULL, 0); 403 404 #ifdef USE_ALMOS 405 assert((debug_memc_id < (XMAX * YMAX)) && 399 406 "debug_memc_id larger than XMAX * YMAX" ); 407 #else 408 size_t x = debug_memc_id >> Y_WIDTH; 409 size_t y = debug_memc_id & ((1<<Y_WIDTH)-1); 410 411 assert( (x <= XMAX) and (y <= YMAX) && 412 "MEMCID parameter refers a not valid memory cache"); 413 #endif 400 414 } 401 415 else if ((strcmp(argv[n], "-PROCID") == 0) && (n + 1 < argc)) 402 416 { 403 debug_proc_id = atoi(argv[n + 1]); 417 debug_proc_id = (size_t) strtol(argv[n + 1], NULL, 0); 418 419 #ifdef USE_ALMOS 404 420 assert((debug_proc_id < (XMAX * YMAX * NB_PROCS_MAX)) && 405 421 "debug_proc_id larger than XMAX * YMAX * NB_PROCS"); 422 #else 423 size_t cluster_xy = debug_proc_id / NB_PROCS_MAX ; 424 size_t x = cluster_xy >> Y_WIDTH; 425 size_t y = cluster_xy & ((1<<Y_WIDTH)-1); 426 427 assert( (x <= XMAX) and (y <= YMAX) && 428 "PROCID parameter refers a not valid processor"); 429 #endif 406 430 } 407 431 else if ((strcmp(argv[n], "-THREADS") == 0) && ((n + 1) < argc)) 408 432 { 409 threads_nr = atoi(argv[n + 1]);433 threads_nr = (ssize_t) strtol(argv[n + 1], NULL, 0); 410 434 threads_nr = (threads_nr < 1) ? 1 : threads_nr; 411 435 } 412 436 else if ((strcmp(argv[n], "-FROZEN") == 0) && (n + 1 < argc)) 413 437 { 414 frozen_cycles = atoi(argv[n + 1]);438 frozen_cycles = (uint32_t) strtol(argv[n + 1], NULL, 0); 415 439 } 416 440 else if ((strcmp(argv[n], "-PERIOD") == 0) && (n + 1 < argc)) 417 441 { 418 debug_period = atoi(argv[n + 1]);442 debug_period = (size_t) strtol(argv[n + 1], NULL, 0); 419 443 } 420 444 else … … 513 537 #endif 514 538 515 // Define parameters depending on mesh size 516 size_t x_width; 517 size_t y_width; 539 #ifdef USE_ALMOS 518 540 519 541 if (XMAX == 1) x_width = 0; … … 529 551 else y_width = 4; 530 552 531 532 #ifdef USE_ALMOS533 cluster_io_id = 0xbfc00000 >> (vci_address_width - x_width - y_width); // index of cluster containing IOs534 553 #else 535 cluster_io_id = 0; 536 #endif 554 555 size_t x_width = X_WIDTH; 556 size_t y_width = Y_WIDTH; 557 558 assert( (X_WIDTH <= 4) and (Y_WIDTH <= 4) and 559 "Up to 256 clusters"); 560 561 assert( (XMAX <= (1 << X_WIDTH)) and (YMAX <= (1 << Y_WIDTH)) and 562 "The X_WIDTH and Y_WIDTH parameter are insufficient"); 563 564 #endif 565 566 567 // index of cluster containing IOs 568 cluster_io_id = 0x00bfc00000ULL >> (vci_address_width - x_width - y_width); 537 569 538 570 ///////////////////// -
trunk/platforms/tsar_generic_xbar/tsar_xbar_cluster/caba/source/src/tsar_xbar_cluster.cpp
r602 r619 362 362 mtd, 363 363 nic_channels, 364 mac, // mac_4 address 365 0xBABE, // mac_2 address 364 366 nic_rx_name, 365 nic_tx_name, 366 mac, // mac_4 address 367 0xBABE ); // mac_2 address 367 nic_tx_name); 368 368 369 369 wt_mnic = new VciDspinTargetWrapper<vci_param_int,
Note: See TracChangeset
for help on using the changeset viewer.