Changeset 172 for trunk/platforms
- Timestamp:
- May 16, 2011, 12:55:28 PM (14 years ago)
- Location:
- trunk/platforms/tsarv4_generic_xbar
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/platforms/tsarv4_generic_xbar/Makefile
r154 r172 1 1 2 2 simulator.x: top.cpp top.desc 3 soclib-cc -P -p top.desc -I. -b caba:vci_local_crossbar-o simul.x3 soclib-cc -P -p top.desc -I../../modules -o simul.x 4 4 5 5 clean: -
trunk/platforms/tsarv4_generic_xbar/soclib.conf
r156 r172 1 config.lib_systemcass_openmp_mine = Library( 2 parent = config.systemc, 3 dir = "/users/outil/nbsdtsar/systemcass", 4 libdir = "%(dir)s/lib-linux", 5 cflags = config.systemc.cflags+['-fopenmp']+['-O3'], 6 #cflags = config.systemc.cflags, 7 libs = ['-ldl', '-lm', '-lpthread', '-L%(libdir)s', '-lsystemc', '-rdynamic', '-fopenmp'], 8 #libs = ['-ldl', '-lm', '-lpthread', '-L%(libdir)s', '-lsystemc', '-rdynamic'], 9 ) 10 11 config.systemcass_openmp_mine = BuildEnv( 12 parent = config.systemc_64, 13 libraries = [ config.lib_systemcass_openmp_mine ], 14 #base = config.systemc_32, 15 repos = "/dsk/l1/misc/alain/soclib-cc/head/systemcass-mine", 16 cache_file = "/dsk/l1/misc/alain/soclib-cc/head/systemcass-mine/soclib_cc.cache", 17 toolchain = config.toolchain_64, 18 #toolchain = config.dist_toolchain, 19 ) 20 21 #config.default = config.systemcass 22 config.default = config.systemcass_openmp_mine 23 1 24 config.default.toolchain.set("cflags", config.default.toolchain.cflags + ['-DI_WANT_ILLEGAL_VCI']) 2 25 -
trunk/platforms/tsarv4_generic_xbar/top.cpp
r156 r172 59 59 /////////////////////////////////////////////////// 60 60 61 #define USE_OPENMP 0 62 #define OPENMP_THREADS_NR 8 63 64 #if USE_OPENMP 61 #define OMP_THREADS 8 62 63 #ifdef _OPENMP 65 64 #include <omp.h> 66 65 #endif … … 105 104 #define L1_DSETS 64 106 105 107 #define FBUF_X_SIZE 1 28108 #define FBUF_Y_SIZE 1 28109 110 #define BDEV_SECTOR_SIZE 1 28111 #define BDEV_IMAGE_NAME "../../softs/soft_ transpose_giet/images.raw"112 113 #define BOOT_SOFT_NAME "../../softs/soft_ transpose_giet/bin.soft"106 #define FBUF_X_SIZE 1024 107 #define FBUF_Y_SIZE 1024 108 109 #define BDEV_SECTOR_SIZE 1024 110 #define BDEV_IMAGE_NAME "../../softs/soft_filter_giet/philips_image.raw" 111 112 #define BOOT_SOFT_NAME "../../softs/soft_filter_giet/bin.soft" 114 113 115 114 ///////////////////////////////////////////////////////// … … 277 276 bool trace_ok = false; // debug activated 278 277 size_t from_cycle = 0; // debug start cycle 278 size_t omp_threads = OMP_THREADS; // number of cores for OpenMP 279 279 280 280 ////////////// command line arguments ////////////////////// … … 292 292 assert( ((nprocs == 1) || (nprocs == 2) || (nprocs == 4)) && 293 293 "NPROCS must be equal to 1, 2, or 4"); 294 } 295 else if( (strcmp(argv[n],"-THREADS") == 0) && (n+1<argc) ) 296 { 297 omp_threads = atoi(argv[n+1]); 294 298 } 295 299 else if( (strcmp(argv[n],"-XMAX") == 0) && (n+1<argc) ) … … 356 360 std::cout << " -XFB fram_buffer_number_of_pixels" << std::endl; 357 361 std::cout << " -YFB fram_buffer_number_of_lines" << std::endl; 362 std::cout << " -THREADS number_of_cores_for_OpenMP" << std::endl; 358 363 exit(0); 359 364 } … … 366 371 std::cout << std::endl; 367 372 368 #if USE_OPENMP373 #ifdef _OPENMP 369 374 omp_set_dynamic(false); 370 omp_set_num_threads(threads_nr); 371 std::cerr << "Built with openmp version " << _OPENMP << std::endl; 375 omp_set_num_threads(omp_threads); 376 std::cout << "Built with openmp version " << _OPENMP << std::endl; 377 std::cout << "Number of threads = " << omp_threads << std::endl; 372 378 #endif 373 379 … … 607 613 TsarV4ClusterXbar<vci_param, proc_iss, cmd_width, rsp_width>* clusters[xmax][ymax]; 608 614 609 #if USE_OPENMP615 #ifdef _OPENMP 610 616 611 617 #pragma omp parallel 612 618 { 613 619 #pragma omp for 614 for( size_t i = 0 ; i <(xmax * ymax); i++)620 for( int i = 0 ; i < (int)(xmax * ymax); i++) 615 621 { 616 622 size_t x = i / ymax; … … 618 624 619 625 #pragma omp critical 626 { 620 627 std::ostringstream sc; 621 628 sc << "cluster_" << x << "_" << y; … … 652 659 loader); 653 660 } 654 655 #else // USE_OPENMP 661 } 662 } 663 664 #else // _OPENMP 656 665 657 666 for( size_t x = 0 ; x < xmax ; x++) … … 701 710 } 702 711 703 #endif // USE_OPENMP712 #endif // _OPENMP 704 713 705 714 /////////////////////////////////////////////////////////////// … … 831 840 signal_resetn = true; 832 841 842 sc_start(sc_core::sc_time(ncycles, SC_NS)); 843 844 /* 833 845 for ( size_t n=0 ; n<ncycles ; n++) 834 846 { 835 847 sc_start(sc_core::sc_time(1, SC_NS)); 848 836 849 if ( trace_ok && (n > from_cycle) ) 837 850 { 838 851 std::cout << "****************** cycle " << std::dec << n ; 839 852 std::cout << " ***********************************" << std::endl; 840 /* 841 clusters[0][0]->proc[0]->print_trace(); 853 clusters[5][7]->proc[2]->print_trace(); 854 print_vci_signal("proc_5_7_2_d", clusters[5][7]->signal_vci_ini_d_proc[2]); 855 842 856 clusters[0][0]->proc[1]->print_trace(); 843 857 clusters[0][0]->proc[2]->print_trace(); 844 858 clusters[0][0]->proc[3]->print_trace(); 845 846 859 std::cout << std::endl; 847 860 … … 855 868 clusters[1][0]->proc[0]->print_trace(); 856 869 clusters[1][0]->proc[1]->print_trace(); 857 */858 870 clusters[1][0]->iniwrapperd->print_trace(); 859 871 clusters[1][0]->proc[2]->print_trace(); … … 867 879 print_dspin_signal("g2l_1_0_d RSP", clusters[1][0]->signal_dspin_rsp_g2l_d); 868 880 print_vci_signal("l2g_1_0_d", clusters[1][0]->signal_vci_l2g_d); 869 /*870 881 clusters[1][0]->proc[3]->print_trace(); 871 882 … … 939 950 if ( clusters[0][0]->signal_irq_bdev.read() != 0) std::cout << " IRQ_BDEV" << std::endl; 940 951 if ( clusters[0][0]->signal_proc_it[0].read() != 0) std::cout << " IRQ_PROC" << std::endl; 952 } 953 } 941 954 */ 942 } 943 } 955 944 956 return EXIT_SUCCESS; 945 957 } -
trunk/platforms/tsarv4_generic_xbar/tsarv4_cluster_xbar/caba/source/src/tsarv4_cluster_xbar.cpp
r168 r172 104 104 l1_d_ways,l1_d_sets,16, // DCACHE size 105 105 4, // WBUF width 106 4// WBUF depth106 8 // WBUF depth 107 107 ); 108 108 }
Note: See TracChangeset
for help on using the changeset viewer.