Changeset 966 for trunk/platforms/tsar_generic_iob/top.cpp
- Timestamp:
- Apr 6, 2015, 12:37:30 AM (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/platforms/tsar_generic_iob/top.cpp
r965 r966 3 3 // Author: Alain Greiner 4 4 // Copyright: UPMC/LIP6 5 // Date : august 2013 5 // Date : august 2013 / updated march 2015 6 6 // This program is released under the GNU public license 7 7 /////////////////////////////////////////////////////////////////////////////// … … 18 18 // 19 19 // This I/0 bus is connected to internal address space through two IOB bridges 20 // located in cluster[0][0] and cluster[X_SIZE-1][ Åž_SIZE-1].20 // located in cluster[0][0] and cluster[X_SIZE-1][Y_SIZE-1]. 21 21 // 22 22 // The internal physical address space is 40 bits, and the cluster index … … 78 78 // 79 79 // The main hardware parameters must be defined in the hard_config.h file : 80 // - X_WIDTH : number of bits for x cluster coordinate 81 // - Y_WIDTH : number of bits for y cluster coordinate 82 // - P_WIDTH : number of bits for local processor coordinate 80 83 // - X_SIZE : number of clusters in a row 81 84 // - Y_SIZE : number of clusters in a column … … 91 94 // - XCU_NB_WTI : number of XCU WTIs (>= 4*NB_PROCS_MAX) 92 95 // - XCU_NB_OUT : number of XCU output IRQs (>= 4*NB_PROCS_MAX) 96 // - USE_IOC_XYZ : IOC type (XYZ in HBA / BDV / SDC) 93 97 // 94 // Some secondaryhardware parameters must be defined in this top.cpp file:98 // Some other hardware parameters must be defined in this top.cpp file: 95 99 // - XRAM_LATENCY : external ram latency 96 100 // - MEMC_WAYS : L2 cache number of ways … … 319 323 size_t ncycles = 4000000000; // simulated cycles 320 324 char disk_name[256] = DISK_IMAGE_NAME; // pathname: disk image 321 ssize_t threads _nr= 1; // simulator's threads number325 ssize_t threads = 1; // simulator's threads number 322 326 bool debug_ok = false; // trace activated 323 327 size_t debug_memc_id = 0xFFFFFFFF; // index of traced memc … … 353 357 { 354 358 ncycles = atoi(argv[n+1]); 355 }356 else if ((strcmp(argv[n],"-ROM") == 0) && (n+1<argc) )357 {358 strcpy(soft_name, argv[n+1]);359 359 } 360 360 else if ((strcmp(argv[n],"-DEBUG") == 0) && (n+1<argc) ) … … 374 374 if( (x>=XMAX) || (y>=YMAX) ) 375 375 { 376 std::cout << "MEMCID parameter does 'nt fit XMAX/YMAX" << std::endl;376 std::cout << "MEMCID parameter doesn't fit XMAX/YMAX" << std::endl; 377 377 std::cout << " - MEMCID = " << std::hex << debug_memc_id << std::endl; 378 378 std::cout << " - XMAX = " << std::hex << XMAX << std::endl; … … 413 413 else if ((strcmp(argv[n], "-THREADS") == 0) && ((n+1) < argc)) 414 414 { 415 threads _nr= atoi(argv[n+1]);416 threads _nr = (threads_nr < 1) ? 1 : threads_nr;415 threads = atoi(argv[n+1]); 416 threads = (threads < 1) ? 1 : threads; 417 417 } 418 418 else if ((strcmp(argv[n], "-FROZEN") == 0) && (n+1 < argc)) … … 425 425 std::cout << " The order is not important." << std::endl; 426 426 std::cout << " Accepted arguments are :" << std::endl << std::endl; 427 std::cout << " - ROM pathname_for_embedded_soft" << std::endl;428 std::cout << " - DISK pathname_for_disk_image" << std::endl;429 427 std::cout << " - NCYCLES number_of_simulated_cycles" << std::endl; 430 428 std::cout << " - DEBUG debug_start_cycle" << std::endl; … … 432 430 std::cout << " - FROZEN max_number_of_lines" << std::endl; 433 431 std::cout << " - MEMCID index_memc_to_be_traced" << std::endl; 434 std::cout << " - XRAMID index_xram_to_be_traced" << std::endl;435 432 std::cout << " - PROCID index_proc_to_be_traced" << std::endl; 436 433 std::cout << " - IOB non_zero_value" << std::endl; … … 473 470 assert( (NB_CMA_CHANNELS <= 4) and 474 471 "The NB_CMA_CHANNELS parameter cannot be larger than 4" ); 472 473 assert( (X_WIDTH == 4) and (Y_WIDTH == 4) and 474 "You must have X_WIDTH == Y_WIDTH == 4"); 475 475 476 476 std::cout << std::endl << std::dec … … 487 487 << " - MAX_FROZEN = " << frozen_cycles << std::endl 488 488 << " - NCYCLES = " << ncycles << std::endl 489 << " - SOFT_FILENAME = " << soft_name << std::endl 490 << " - DISK_IMAGENAME = " << disk_name << std::endl 491 << " - OPENMP THREADS = " << threads << std::endl 489 492 << " - DEBUG_PROCID = " << debug_proc_id << std::endl 490 493 << " - DEBUG_MEMCID = " << debug_memc_id << std::endl … … 495 498 #if USING_OPENMP 496 499 omp_set_dynamic(false); 497 omp_set_num_threads(threads _nr);500 omp_set_num_threads(threads); 498 501 std::cerr << "Built with openmp version " << _OPENMP << std::endl; 499 502 #endif … … 958 961 959 962 #if ( USE_IOC_HBA ) 963 960 964 VciMultiAhci<vci_param_ext>* disk; 961 965 disk = new VciMultiAhci<vci_param_ext>( "disk", … … 967 971 64, // burst size (bytes) 968 972 0 ); // disk latency 969 #elif ( USE_IOC_BDV ) 973 #elif ( USE_IOC_BDV or USE_IOC_SDC ) 974 970 975 VciBlockDeviceTsar<vci_param_ext>* disk; 971 976 disk = new VciBlockDeviceTsar<vci_param_ext>( "disk", … … 977 982 64, // burst size (bytes) 978 983 0 ); // disk latency 979 #else980 std::cout << "Error in tsar_generic_iob : only HBA & BDV are supported" << std::endl;981 exit(0);982 984 #endif 983 985
Note: See TracChangeset
for help on using the changeset viewer.