Changeset 468 for trunk/platforms/tsar_generic_xbar/top.cpp
- Timestamp:
- Jul 24, 2013, 8:47:40 AM (11 years ago)
- Location:
- trunk/platforms/tsar_generic_xbar
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/platforms/tsar_generic_xbar
-
Property
svn:mergeinfo
set to
/branches/v5/platforms/tsar_generic_xbar merged eligible
-
Property
svn:mergeinfo
set to
-
trunk/platforms/tsar_generic_xbar/top.cpp
r465 r468 151 151 //////////////////////i///////////////////////////////////// 152 152 153 154 153 #ifdef USE_ALMOS 155 154 #include "almos/hard_config.h" … … 157 156 #endif 158 157 #ifdef USE_GIET 158 #include "giet_vm/hard_config.h" 159 159 #define PREFIX_OS "giet_vm/" 160 #include "giet_vm/hard_config.h"161 160 #endif 162 161 … … 190 189 #ifdef USE_GIET 191 190 #define BDEV_SECTOR_SIZE 512 192 #define BDEV_IMAGE_NAME "giet_vm/display/images.raw"191 #define BDEV_IMAGE_NAME PREFIX_OS"display/images.raw" 193 192 #endif 194 193 #ifdef USE_ALMOS … … 196 195 #define BDEV_IMAGE_NAME PREFIX_OS"hdd-img.bin" 197 196 #endif 198 199 197 200 198 #define NIC_RX_NAME PREFIX_OS"nic/rx_packets.txt" … … 212 210 213 211 #ifdef USE_ALMOS 214 #define soft_name PREFIX_OS"bootloader.bin",\215 PREFIX_OS"kernel-soclib.bin@0xbfc10000:D",\216 PREFIX_OS"arch-info.bib@0xBFC08000:D"212 #define soft_name PREFIX_OS"bootloader.bin",\ 213 PREFIX_OS"kernel-soclib.bin@0xbfc10000:D",\ 214 PREFIX_OS"arch-info.bib@0xBFC08000:D" 217 215 #endif 218 216 #ifdef USE_GIET 219 #define soft_pathname 217 #define soft_pathname PREFIX_OS"soft.elf" 220 218 #endif 221 219 … … 285 283 286 284 #ifdef USE_GIET 287 char soft_name[256] = soft_pathname; 288 #endif 289 size_t ncycles = 1000000000;// simulated cycles285 char soft_name[256] = soft_pathname; // pathname to binary code 286 #endif 287 uint64_t ncycles = 100000000000; // simulated cycles 290 288 char disk_name[256] = BDEV_IMAGE_NAME; // pathname to the disk image 291 289 char nic_rx_name[256] = NIC_RX_NAME; // pathname to the rx packets file … … 299 297 uint32_t frozen_cycles = MAX_FROZEN_CYCLES; // monitoring frozen processor 300 298 size_t cluster_io_id = 0; // index of cluster containing IOs 301 struct timeval t1,t2;299 struct timeval t1,t2; 302 300 uint64_t ms1,ms2; 303 301 … … 541 539 // Horizontal inter-clusters DSPIN signals 542 540 DspinSignals<dspin_cmd_width>*** signal_dspin_h_cmd_inc = 543 alloc_elems<DspinSignals<dspin_cmd_width> >("signal_dspin_h_cmd_inc", XMAX-1, YMAX, 2);541 alloc_elems<DspinSignals<dspin_cmd_width> >("signal_dspin_h_cmd_inc", XMAX-1, YMAX, 3); 544 542 DspinSignals<dspin_cmd_width>*** signal_dspin_h_cmd_dec = 545 alloc_elems<DspinSignals<dspin_cmd_width> >("signal_dspin_h_cmd_dec", XMAX-1, YMAX, 2);543 alloc_elems<DspinSignals<dspin_cmd_width> >("signal_dspin_h_cmd_dec", XMAX-1, YMAX, 3); 546 544 DspinSignals<dspin_rsp_width>*** signal_dspin_h_rsp_inc = 547 545 alloc_elems<DspinSignals<dspin_rsp_width> >("signal_dspin_h_rsp_inc", XMAX-1, YMAX, 2); … … 551 549 // Vertical inter-clusters DSPIN signals 552 550 DspinSignals<dspin_cmd_width>*** signal_dspin_v_cmd_inc = 553 alloc_elems<DspinSignals<dspin_cmd_width> >("signal_dspin_v_cmd_inc", XMAX, YMAX-1, 2);551 alloc_elems<DspinSignals<dspin_cmd_width> >("signal_dspin_v_cmd_inc", XMAX, YMAX-1, 3); 554 552 DspinSignals<dspin_cmd_width>*** signal_dspin_v_cmd_dec = 555 alloc_elems<DspinSignals<dspin_cmd_width> >("signal_dspin_v_cmd_dec", XMAX, YMAX-1, 2);553 alloc_elems<DspinSignals<dspin_cmd_width> >("signal_dspin_v_cmd_dec", XMAX, YMAX-1, 3); 556 554 DspinSignals<dspin_rsp_width>*** signal_dspin_v_rsp_inc = 557 555 alloc_elems<DspinSignals<dspin_rsp_width> >("signal_dspin_v_rsp_inc", XMAX, YMAX-1, 2); … … 561 559 // Mesh boundaries DSPIN signals 562 560 DspinSignals<dspin_cmd_width>**** signal_dspin_false_cmd_in = 563 alloc_elems<DspinSignals<dspin_cmd_width> >("signal_dspin_false_cmd_in" , XMAX, YMAX, 2, 4);561 alloc_elems<DspinSignals<dspin_cmd_width> >("signal_dspin_false_cmd_in" , XMAX, YMAX, 4, 3); 564 562 DspinSignals<dspin_cmd_width>**** signal_dspin_false_cmd_out = 565 alloc_elems<DspinSignals<dspin_cmd_width> >("signal_dspin_false_cmd_out", XMAX, YMAX, 2, 4);563 alloc_elems<DspinSignals<dspin_cmd_width> >("signal_dspin_false_cmd_out", XMAX, YMAX, 4, 3); 566 564 DspinSignals<dspin_rsp_width>**** signal_dspin_false_rsp_in = 567 alloc_elems<DspinSignals<dspin_rsp_width> >("signal_dspin_false_rsp_in" , XMAX, YMAX, 2, 4);565 alloc_elems<DspinSignals<dspin_rsp_width> >("signal_dspin_false_rsp_in" , XMAX, YMAX, 4, 2); 568 566 DspinSignals<dspin_rsp_width>**** signal_dspin_false_rsp_out = 569 alloc_elems<DspinSignals<dspin_rsp_width> >("signal_dspin_false_rsp_out", XMAX, YMAX, 2, 4);567 alloc_elems<DspinSignals<dspin_rsp_width> >("signal_dspin_false_rsp_out", XMAX, YMAX, 4, 2); 570 568 571 569 … … 680 678 for (size_t x = 0; x < (XMAX-1); x++){ 681 679 for (size_t y = 0; y < YMAX; y++){ 682 for (size_t k = 0; k < 2; k++){680 for (size_t k = 0; k < 3; k++){ 683 681 clusters[x][y]->p_cmd_out[EAST][k] (signal_dspin_h_cmd_inc[x][y][k]); 684 682 clusters[x+1][y]->p_cmd_in[WEST][k] (signal_dspin_h_cmd_inc[x][y][k]); 685 683 clusters[x][y]->p_cmd_in[EAST][k] (signal_dspin_h_cmd_dec[x][y][k]); 686 684 clusters[x+1][y]->p_cmd_out[WEST][k] (signal_dspin_h_cmd_dec[x][y][k]); 685 } 686 687 for (size_t k = 0; k < 2; k++){ 687 688 clusters[x][y]->p_rsp_out[EAST][k] (signal_dspin_h_rsp_inc[x][y][k]); 688 689 clusters[x+1][y]->p_rsp_in[WEST][k] (signal_dspin_h_rsp_inc[x][y][k]); … … 699 700 for (size_t y = 0; y < (YMAX-1); y++){ 700 701 for (size_t x = 0; x < XMAX; x++){ 701 for (size_t k = 0; k < 2; k++){702 for (size_t k = 0; k < 3; k++){ 702 703 clusters[x][y]->p_cmd_out[NORTH][k] (signal_dspin_v_cmd_inc[x][y][k]); 703 704 clusters[x][y+1]->p_cmd_in[SOUTH][k] (signal_dspin_v_cmd_inc[x][y][k]); 704 705 clusters[x][y]->p_cmd_in[NORTH][k] (signal_dspin_v_cmd_dec[x][y][k]); 705 706 clusters[x][y+1]->p_cmd_out[SOUTH][k] (signal_dspin_v_cmd_dec[x][y][k]); 707 } 708 709 for (size_t k = 0; k < 2; k++){ 706 710 clusters[x][y]->p_rsp_out[NORTH][k] (signal_dspin_v_rsp_inc[x][y][k]); 707 711 clusters[x][y+1]->p_rsp_in[SOUTH][k] (signal_dspin_v_rsp_inc[x][y][k]); … … 717 721 for (size_t y = 0; y < YMAX; y++) 718 722 { 723 for (size_t k = 0; k < 3; k++) 724 { 725 clusters[0][y]->p_cmd_in[WEST][k] (signal_dspin_false_cmd_in[0][y][WEST][k]); 726 clusters[0][y]->p_cmd_out[WEST][k] (signal_dspin_false_cmd_out[0][y][WEST][k]); 727 clusters[XMAX-1][y]->p_cmd_in[EAST][k] (signal_dspin_false_cmd_in[XMAX-1][y][EAST][k]); 728 clusters[XMAX-1][y]->p_cmd_out[EAST][k] (signal_dspin_false_cmd_out[XMAX-1][y][EAST][k]); 729 } 730 719 731 for (size_t k = 0; k < 2; k++) 720 732 { 721 clusters[0][y]->p_cmd_in[WEST][k] (signal_dspin_false_cmd_in[0][y][k][WEST]); 722 clusters[0][y]->p_cmd_out[WEST][k] (signal_dspin_false_cmd_out[0][y][k][WEST]); 723 clusters[0][y]->p_rsp_in[WEST][k] (signal_dspin_false_rsp_in[0][y][k][WEST]); 724 clusters[0][y]->p_rsp_out[WEST][k] (signal_dspin_false_rsp_out[0][y][k][WEST]); 725 726 clusters[XMAX-1][y]->p_cmd_in[EAST][k] (signal_dspin_false_cmd_in[XMAX-1][y][k][EAST]); 727 clusters[XMAX-1][y]->p_cmd_out[EAST][k] (signal_dspin_false_cmd_out[XMAX-1][y][k][EAST]); 728 clusters[XMAX-1][y]->p_rsp_in[EAST][k] (signal_dspin_false_rsp_in[XMAX-1][y][k][EAST]); 729 clusters[XMAX-1][y]->p_rsp_out[EAST][k] (signal_dspin_false_rsp_out[XMAX-1][y][k][EAST]); 733 clusters[0][y]->p_rsp_in[WEST][k] (signal_dspin_false_rsp_in[0][y][WEST][k]); 734 clusters[0][y]->p_rsp_out[WEST][k] (signal_dspin_false_rsp_out[0][y][WEST][k]); 735 clusters[XMAX-1][y]->p_rsp_in[EAST][k] (signal_dspin_false_rsp_in[XMAX-1][y][EAST][k]); 736 clusters[XMAX-1][y]->p_rsp_out[EAST][k] (signal_dspin_false_rsp_out[XMAX-1][y][EAST][k]); 730 737 } 731 738 } … … 734 741 for (size_t x = 0; x < XMAX; x++) 735 742 { 743 for (size_t k = 0; k < 3; k++) 744 { 745 clusters[x][0]->p_cmd_in[SOUTH][k] (signal_dspin_false_cmd_in[x][0][SOUTH][k]); 746 clusters[x][0]->p_cmd_out[SOUTH][k] (signal_dspin_false_cmd_out[x][0][SOUTH][k]); 747 clusters[x][YMAX-1]->p_cmd_in[NORTH][k] (signal_dspin_false_cmd_in[x][YMAX-1][NORTH][k]); 748 clusters[x][YMAX-1]->p_cmd_out[NORTH][k] (signal_dspin_false_cmd_out[x][YMAX-1][NORTH][k]); 749 } 750 736 751 for (size_t k = 0; k < 2; k++) 737 752 { 738 clusters[x][0]->p_cmd_in[SOUTH][k] (signal_dspin_false_cmd_in[x][0][k][SOUTH]); 739 clusters[x][0]->p_cmd_out[SOUTH][k] (signal_dspin_false_cmd_out[x][0][k][SOUTH]); 740 clusters[x][0]->p_rsp_in[SOUTH][k] (signal_dspin_false_rsp_in[x][0][k][SOUTH]); 741 clusters[x][0]->p_rsp_out[SOUTH][k] (signal_dspin_false_rsp_out[x][0][k][SOUTH]); 742 743 clusters[x][YMAX-1]->p_cmd_in[NORTH][k] (signal_dspin_false_cmd_in[x][YMAX-1][k][NORTH]); 744 clusters[x][YMAX-1]->p_cmd_out[NORTH][k] (signal_dspin_false_cmd_out[x][YMAX-1][k][NORTH]); 745 clusters[x][YMAX-1]->p_rsp_in[NORTH][k] (signal_dspin_false_rsp_in[x][YMAX-1][k][NORTH]); 746 clusters[x][YMAX-1]->p_rsp_out[NORTH][k] (signal_dspin_false_rsp_out[x][YMAX-1][k][NORTH]); 753 clusters[x][0]->p_rsp_in[SOUTH][k] (signal_dspin_false_rsp_in[x][0][SOUTH][k]); 754 clusters[x][0]->p_rsp_out[SOUTH][k] (signal_dspin_false_rsp_out[x][0][SOUTH][k]); 755 clusters[x][YMAX-1]->p_rsp_in[NORTH][k] (signal_dspin_false_rsp_in[x][YMAX-1][NORTH][k]); 756 clusters[x][YMAX-1]->p_rsp_out[NORTH][k] (signal_dspin_false_rsp_out[x][YMAX-1][NORTH][k]); 747 757 } 748 758 } … … 761 771 for (size_t x = 0; x < XMAX ; x++){ 762 772 for (size_t y = 0; y < YMAX ; y++){ 763 for (size_t k = 0; k < 2; k++){ 764 for (size_t a = 0; a < 4; a++){ 765 signal_dspin_false_cmd_in [x][y][k][a].write = false; 766 signal_dspin_false_cmd_in [x][y][k][a].read = true; 767 signal_dspin_false_cmd_out[x][y][k][a].write = false; 768 signal_dspin_false_cmd_out[x][y][k][a].read = true; 769 770 signal_dspin_false_rsp_in [x][y][k][a].write = false; 771 signal_dspin_false_rsp_in [x][y][k][a].read = true; 772 signal_dspin_false_rsp_out[x][y][k][a].write = false; 773 signal_dspin_false_rsp_out[x][y][k][a].read = true; 773 for (size_t a = 0; a < 4; a++){ 774 for (size_t k = 0; k < 3; k++){ 775 signal_dspin_false_cmd_in [x][y][a][k].write = false; 776 signal_dspin_false_cmd_in [x][y][a][k].read = true; 777 signal_dspin_false_cmd_out[x][y][a][k].write = false; 778 signal_dspin_false_cmd_out[x][y][a][k].read = true; 779 } 780 781 for (size_t k = 0; k < 2; k++){ 782 signal_dspin_false_rsp_in [x][y][a][k].write = false; 783 signal_dspin_false_rsp_in [x][y][a][k].read = true; 784 signal_dspin_false_rsp_out[x][y][a][k].write = false; 785 signal_dspin_false_rsp_out[x][y][a][k].read = true; 774 786 } 775 787 } … … 786 798 } 787 799 788 for ( size_t n = 1; n < ncycles; n++)800 for (uint64_t n = 1; n < ncycles; n++) 789 801 { 790 802 // Monitor a specific address for L1 & L2 caches … … 811 823 } 812 824 } 813 814 825 815 826 if (debug_ok and (n > debug_from) and (n % debug_period == 0))
Note: See TracChangeset
for help on using the changeset viewer.