Changeset 752 for trunk/platforms/tsar_generic_xbar/top.cpp
- Timestamp:
- Jul 18, 2014, 11:38:54 AM (10 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/platforms/tsar_generic_xbar/top.cpp
r749 r752 632 632 { 633 633 for (size_t y = 0; y < Y_SIZE ; y++) 634 { 634 { 635 635 636 636 sc_uint<vci_address_width> offset; … … 676 676 // Mesh boundaries DSPIN signals 677 677 DspinSignals<dspin_cmd_width>**** signal_dspin_false_cmd_in = 678 alloc_elems<DspinSignals<dspin_cmd_width> >("signal_dspin_false_cmd_in" , X_SIZE, Y_SIZE, 4, 3);678 alloc_elems<DspinSignals<dspin_cmd_width> >("signal_dspin_false_cmd_in" , X_SIZE, Y_SIZE, 4, 3); 679 679 DspinSignals<dspin_cmd_width>**** signal_dspin_false_cmd_out = 680 alloc_elems<DspinSignals<dspin_cmd_width> >("signal_dspin_false_cmd_out", X_SIZE, Y_SIZE, 4, 3);680 alloc_elems<DspinSignals<dspin_cmd_width> >("signal_dspin_false_cmd_out", X_SIZE, Y_SIZE, 4, 3); 681 681 DspinSignals<dspin_rsp_width>**** signal_dspin_false_rsp_in = 682 alloc_elems<DspinSignals<dspin_rsp_width> >("signal_dspin_false_rsp_in" , X_SIZE, Y_SIZE, 4, 2);682 alloc_elems<DspinSignals<dspin_rsp_width> >("signal_dspin_false_rsp_in" , X_SIZE, Y_SIZE, 4, 2); 683 683 DspinSignals<dspin_rsp_width>**** signal_dspin_false_rsp_out = 684 alloc_elems<DspinSignals<dspin_rsp_width> >("signal_dspin_false_rsp_out", X_SIZE, Y_SIZE, 4, 2); 685 684 alloc_elems<DspinSignals<dspin_rsp_width> >("signal_dspin_false_rsp_out", X_SIZE, Y_SIZE, 4, 2); 686 685 687 686 //////////////////////////// … … 730 729 sc.str().c_str(), 731 730 NB_PROCS_MAX, 732 NB_TTY_CHANNELS, 733 NB_DMA_CHANNELS, 731 NB_TTY_CHANNELS, 732 NB_DMA_CHANNELS, 734 733 x, 735 734 y, … … 772 771 debug_from, 773 772 debug_ok and (cluster(x,y) == debug_memc_id), 774 debug_ok and (cluster(x,y) == debug_proc_id) 773 debug_ok and (cluster(x,y) == debug_proc_id) 775 774 ); 776 775 … … 815 814 } 816 815 } 817 std::cout << std::endl << "Horizontal connections established" << std::endl; 816 std::cout << std::endl << "Horizontal connections established" << std::endl; 818 817 819 818 // Inter Clusters vertical connections … … 844 843 for (size_t k = 0; k < 3; k++) 845 844 { 846 clusters[0][y]->p_cmd_in[WEST][k] (signal_dspin_false_cmd_in [0][y][WEST][k]);845 clusters[0][y]->p_cmd_in[WEST][k] (signal_dspin_false_cmd_in [0][y][WEST][k]); 847 846 clusters[0][y]->p_cmd_out[WEST][k] (signal_dspin_false_cmd_out[0][y][WEST][k]); 848 clusters[X_SIZE-1][y]->p_cmd_in[EAST][k] (signal_dspin_false_cmd_in[X_SIZE-1][y][EAST][k]);849 clusters[X_SIZE-1][y]->p_cmd_out[EAST][k] 847 clusters[X_SIZE-1][y]->p_cmd_in[EAST][k] (signal_dspin_false_cmd_in [X_SIZE-1][y][EAST][k]); 848 clusters[X_SIZE-1][y]->p_cmd_out[EAST][k](signal_dspin_false_cmd_out[X_SIZE-1][y][EAST][k]); 850 849 } 851 850 852 851 for (size_t k = 0; k < 2; k++) 853 852 { 854 clusters[0][y]->p_rsp_in[WEST][k] (signal_dspin_false_rsp_in [0][y][WEST][k]);853 clusters[0][y]->p_rsp_in[WEST][k] (signal_dspin_false_rsp_in [0][y][WEST][k]); 855 854 clusters[0][y]->p_rsp_out[WEST][k] (signal_dspin_false_rsp_out[0][y][WEST][k]); 856 clusters[X_SIZE-1][y]->p_rsp_in[EAST][k] (signal_dspin_false_rsp_in[X_SIZE-1][y][EAST][k]);857 clusters[X_SIZE-1][y]->p_rsp_out[EAST][k] 855 clusters[X_SIZE-1][y]->p_rsp_in[EAST][k] (signal_dspin_false_rsp_in [X_SIZE-1][y][EAST][k]); 856 clusters[X_SIZE-1][y]->p_rsp_out[EAST][k](signal_dspin_false_rsp_out[X_SIZE-1][y][EAST][k]); 858 857 } 859 858 } … … 864 863 for (size_t k = 0; k < 3; k++) 865 864 { 866 clusters[x][0]->p_cmd_in[SOUTH][k] (signal_dspin_false_cmd_in[x][0][SOUTH][k]);867 clusters[x][0]->p_cmd_out[SOUTH][k] (signal_dspin_false_cmd_out[x][0][SOUTH][k]);868 clusters[x][Y_SIZE-1]->p_cmd_in[NORTH][k] (signal_dspin_false_cmd_in[x][Y_SIZE-1][NORTH][k]);869 clusters[x][Y_SIZE-1]->p_cmd_out[NORTH][k] 865 clusters[x][0]->p_cmd_in[SOUTH][k] (signal_dspin_false_cmd_in [x][0][SOUTH][k]); 866 clusters[x][0]->p_cmd_out[SOUTH][k] (signal_dspin_false_cmd_out[x][0][SOUTH][k]); 867 clusters[x][Y_SIZE-1]->p_cmd_in[NORTH][k] (signal_dspin_false_cmd_in [x][Y_SIZE-1][NORTH][k]); 868 clusters[x][Y_SIZE-1]->p_cmd_out[NORTH][k](signal_dspin_false_cmd_out[x][Y_SIZE-1][NORTH][k]); 870 869 } 871 870 872 871 for (size_t k = 0; k < 2; k++) 873 872 { 874 clusters[x][0]->p_rsp_in[SOUTH][k] (signal_dspin_false_rsp_in[x][0][SOUTH][k]);875 clusters[x][0]->p_rsp_out[SOUTH][k] (signal_dspin_false_rsp_out[x][0][SOUTH][k]);876 clusters[x][Y_SIZE-1]->p_rsp_in[NORTH][k] (signal_dspin_false_rsp_in[x][Y_SIZE-1][NORTH][k]);877 clusters[x][Y_SIZE-1]->p_rsp_out[NORTH][k] 873 clusters[x][0]->p_rsp_in[SOUTH][k] (signal_dspin_false_rsp_in [x][0][SOUTH][k]); 874 clusters[x][0]->p_rsp_out[SOUTH][k] (signal_dspin_false_rsp_out[x][0][SOUTH][k]); 875 clusters[x][Y_SIZE-1]->p_rsp_in[NORTH][k] (signal_dspin_false_rsp_in [x][Y_SIZE-1][NORTH][k]); 876 clusters[x][Y_SIZE-1]->p_rsp_out[NORTH][k](signal_dspin_false_rsp_out[x][Y_SIZE-1][NORTH][k]); 878 877 } 879 878 } … … 899 898 signal_dspin_false_cmd_out[x][y][a][k].read = true; 900 899 } 901 902 900 for (size_t k = 0; k < 2; k++){ 903 901 signal_dspin_false_rsp_in [x][y][a][k].write = false; … … 913 911 signal_resetn = true; 914 912 913 #define SC_TRACE 914 #ifdef SC_TRACE 915 sc_trace_file * tf = sc_create_vcd_trace_file("my_trace_file"); 916 917 if (X_SIZE > 1){ 918 for (size_t x = 0; x < (X_SIZE-1); x++){ 919 for (size_t y = 0; y < Y_SIZE; y++){ 920 for (size_t k = 0; k < 3; k++){ 921 signal_dspin_h_cmd_inc[x][y][k].trace(tf, "dspin_h_cmd_inc"); 922 signal_dspin_h_cmd_dec[x][y][k].trace(tf, "dspin_h_cmd_dec"); 923 } 924 925 for (size_t k = 0; k < 2; k++){ 926 signal_dspin_h_rsp_inc[x][y][k].trace(tf, "dspin_h_rsp_inc"); 927 signal_dspin_h_rsp_dec[x][y][k].trace(tf, "dspin_h_rsp_dec"); 928 } 929 } 930 } 931 } 932 933 if (Y_SIZE > 1) { 934 for (size_t y = 0; y < (Y_SIZE-1); y++){ 935 for (size_t x = 0; x < X_SIZE; x++){ 936 for (size_t k = 0; k < 3; k++){ 937 signal_dspin_v_cmd_inc[x][y][k].trace(tf, "dspin_v_cmd_inc"); 938 signal_dspin_v_cmd_dec[x][y][k].trace(tf, "dspin_v_cmd_dec"); 939 } 940 941 for (size_t k = 0; k < 2; k++){ 942 signal_dspin_v_rsp_inc[x][y][k].trace(tf, "dspin_v_rsp_inc"); 943 signal_dspin_v_rsp_dec[x][y][k].trace(tf, "dspin_v_rsp_dec"); 944 } 945 } 946 } 947 } 948 949 for (size_t x = 0; x < (X_SIZE); x++){ 950 for (size_t y = 0; y < Y_SIZE; y++){ 951 std::ostringstream signame; 952 signame << "cluster" << x << "_" << y; 953 clusters[x][y]->trace(tf, signame.str()); 954 } 955 } 956 #endif 957 915 958 if (debug_ok) { 916 959 #if USE_OPENMP … … 932 975 { 933 976 934 if (gettimeofday(&t2, NULL) != 0) 977 if (gettimeofday(&t2, NULL) != 0) 935 978 { 936 979 perror("gettimeofday"); … … 942 985 std::cerr << "platform clock frequency " << (double) 5000000 / (double) (ms2 - ms1) << "Khz" << std::endl; 943 986 944 if (gettimeofday(&t1, NULL) != 0) 987 if (gettimeofday(&t1, NULL) != 0) 945 988 { 946 989 perror("gettimeofday"); … … 966 1009 } 967 1010 968 if ( debug_ok and(n > debug_from) and (n % debug_period == 0))1011 if ((n > debug_from) and (n % debug_period == 0)) 969 1012 { 970 1013 std::cout << "****************** cycle " << std::dec << n ; 971 1014 std::cout << " ************************************************" << std::endl; 972 1015 973 // trace proc[debug_proc_id] 1016 // trace proc[debug_proc_id] 974 1017 size_t l = debug_proc_id % NB_PROCS_MAX ; 975 1018 size_t y = (debug_proc_id / NB_PROCS_MAX) % Y_SIZE ; … … 992 1035 //clusters[x][y]->signal_dspin_rsp_g2l_d.print_trace("[SIG]G2L RSP"); 993 1036 994 // trace memc[debug_memc_id] 1037 // trace memc[debug_memc_id] 995 1038 x = debug_memc_id / Y_SIZE; 996 1039 y = debug_memc_id % Y_SIZE;
Note: See TracChangeset
for help on using the changeset viewer.