- Timestamp:
- Aug 14, 2013, 11:19:29 PM (11 years ago)
- Location:
- soft/giet_vm
- Files:
-
- 2 deleted
- 20 edited
Legend:
- Unmodified
- Added
- Removed
-
soft/giet_vm/Makefile
r252 r253 5 5 DU = mipsel-unknown-elf-objdump 6 6 7 MAP_XML = mappings/1c_4p_gameoflife.xml7 MAP_XML = mappings/4c_1p_iob.xml 8 8 9 9 SYS_OBJS = build/sys/vm_handler.o \ -
soft/giet_vm/boot/boot_init.c
r249 r253 806 806 { 807 807 mapping_header_t * header = (mapping_header_t *) & seg_mapping_base; 808 mapping_cluster_t * cluster = boot_get_cluster_base(header);809 mapping_periph_t * periph = boot_get_periph_base(header);810 808 811 809 // checking mapping availability … … 835 833 boot_exit(); 836 834 } 837 // checking hardware 838 unsigned int periph_id; 839 unsigned int cluster_id; 840 unsigned int tty_found = 0; 841 unsigned int nic_found = 0; 842 for (cluster_id = 0; cluster_id < NB_CLUSTERS; cluster_id++) 843 { 844 // NB_PROCS_MAX 845 if (cluster[cluster_id].procs > NB_PROCS_MAX) 846 { 847 boot_puts("\n[BOOT ERROR] too many processors in cluster "); 848 boot_putd(cluster_id); 849 boot_puts(" : procs = "); 850 boot_putd(cluster[cluster_id].procs); 851 boot_puts("\n"); 852 boot_exit(); 853 } 854 855 for (periph_id = cluster[cluster_id].periph_offset; 856 periph_id < cluster[cluster_id].periph_offset + cluster[cluster_id].periphs; 857 periph_id++) 858 { 859 // NB_TTY_CHANNELS 860 if (periph[periph_id].type == PERIPH_TYPE_TTY) 861 { 862 if (tty_found) 863 { 864 boot_puts("\n[BOOT ERROR] TTY component should not be replicated\n"); 865 boot_exit(); 866 } 867 if (periph[periph_id].channels > NB_TTY_CHANNELS) 868 { 869 boot_puts("\n[BOOT ERROR] Wrong NB_TTY_CHANNELS in cluster "); 870 boot_putd(cluster_id); 871 boot_puts(" : ttys = "); 872 boot_putd(periph[periph_id].channels); 873 boot_puts("\n"); 874 boot_exit(); 875 } 876 tty_found = 1; 877 } 878 // NB_NIC_CHANNELS 879 if (periph[periph_id].type == PERIPH_TYPE_NIC) 880 { 881 if (nic_found) 882 { 883 boot_puts("\n[BOOT ERROR] NIC component should not be replicated\n"); 884 boot_exit(); 885 } 886 if (periph[periph_id].channels != NB_NIC_CHANNELS) 887 { 888 boot_puts("\n[BOOT ERROR] Wrong NB_NIC_CHANNELS in cluster "); 889 boot_putd(cluster_id); 890 boot_puts(" : nics = "); 891 boot_putd(periph[periph_id].channels); 892 boot_puts("\n"); 893 boot_exit(); 894 } 895 nic_found = 1; 896 } 897 // NB_TIMERS 898 if (periph[periph_id].type == PERIPH_TYPE_TIM) 899 { 900 if (periph[periph_id].channels > NB_TIM_CHANNELS) 901 { 902 boot_puts("\n[BOOT ERROR] Too much user timers in cluster "); 903 boot_putd(cluster_id); 904 boot_puts(" : timers = "); 905 boot_putd(periph[periph_id].channels); 906 boot_puts("\n"); 907 boot_exit(); 908 } 909 } 910 // NB_DMAS 911 if (periph[periph_id].type == PERIPH_TYPE_DMA) 912 { 913 if (periph[periph_id].channels > NB_DMA_CHANNELS) 914 { 915 boot_puts("\n[BOOT ERROR] Too much DMA channels in cluster "); 916 boot_putd(cluster_id); 917 boot_puts(" : channels = "); 918 boot_putd(periph[periph_id].channels); 919 boot_puts(" - NB_DMA_CHANNELS : "); 920 boot_putd(NB_DMA_CHANNELS); 921 boot_puts("\n"); 922 boot_exit(); 923 } 924 } 925 } // end for periphs 926 } // end for clusters 835 836 #if BOOT_DEBUG_MAPPING 837 boot_puts("\nclusters = "); 838 boot_putd( header->clusters ); 839 boot_puts("\nprocs = "); 840 boot_putd( header->procs ); 841 boot_puts("\nperiphs = "); 842 boot_putd( header->periphs ); 843 boot_puts("\nvspaces = "); 844 boot_putd( header->vspaces ); 845 boot_puts("\ntasks = "); 846 boot_putd( header->tasks ); 847 boot_puts("\n"); 848 849 unsigned int cluster_id; 850 mapping_cluster_t * cluster = boot_get_cluster_base(header); 851 for (cluster_id = 0; cluster_id < NB_CLUSTERS; cluster_id++) 852 { 853 boot_puts("\n cluster = "); 854 boot_putd( cluster_id ); 855 boot_puts("\n procs = "); 856 boot_putd( cluster[cluster_id].procs ); 857 boot_puts("\n psegs = "); 858 boot_putd( cluster[cluster_id].psegs ); 859 boot_puts("\n periphs = "); 860 boot_putd( cluster[cluster_id].periphs ); 861 boot_puts("\n"); 862 } 863 #endif 864 865 boot_puts("\n[BOOT] Mapping check completed at cycle "); 866 boot_putd(boot_proctime()); 867 boot_puts(" for "); 868 boot_puts( header->name ); 869 boot_puts("\n"); 870 927 871 } // end boot_check_mapping() 928 872 … … 971 915 } 972 916 } 917 918 boot_puts("\n[BOOT] Pseg allocators initialisation completed at cycle "); 919 boot_putd(boot_proctime()); 920 boot_puts("\n"); 921 973 922 } // end boot_psegs_init() 974 923 … … 1037 986 #endif 1038 987 } 988 989 boot_puts("\n[BOOT] Page Tables initialisation completed at cycle "); 990 boot_putd(boot_proctime()); 991 boot_puts("\n"); 992 1039 993 } // end boot_pt_init() 1040 994 … … 1216 1170 } 1217 1171 } // end loop on vspaces 1172 1173 boot_puts("\n[BOOT] Vobjs initialisation completed at cycle : "); 1174 boot_putd(boot_proctime()); 1175 boot_puts("\n"); 1176 1218 1177 } // end boot_vobjs_init() 1219 1178 … … 1423 1382 } // end for coprocs 1424 1383 } // end for clusters 1384 1385 boot_puts("\n[BOOT] Peripherals initialisation completed at cycle "); 1386 boot_putd(boot_proctime()); 1387 boot_puts("\n"); 1388 1425 1389 } // end boot_peripherals_init() 1426 1390 … … 1858 1822 } // end loop on tasks 1859 1823 } // end loop on vspaces 1824 1825 boot_puts("\n[BOOT] Schedulers initialisation completed at cycle "); 1826 boot_putd(boot_proctime()); 1827 boot_puts("\n"); 1828 1860 1829 } // end boot_schedulers_init() 1861 1830 … … 1879 1848 boot_check_mapping(); 1880 1849 1881 boot_puts("\n[BOOT] Mapping check completed at cycle ");1882 boot_putd(boot_proctime());1883 boot_puts("\n");1884 1885 1850 // pseg allocators initialisation 1886 1851 boot_psegs_init(); 1887 1852 1888 boot_puts("\n[BOOT] Pseg allocators initialisation completed at cycle ");1889 boot_putd(boot_proctime());1890 boot_puts("\n");1891 1892 1853 // page table building 1893 1854 boot_pt_init(); 1894 1855 1895 boot_puts("\n[BOOT] Page Tables initialisation completed at cycle "); 1896 boot_putd(boot_proctime()); 1897 boot_puts("\n"); 1898 1899 // mmu activation ( with page table [Ã] ) 1856 // mmu activation ( with page table [0] ) 1900 1857 boot_set_mmu_ptpr((unsigned int) (boot_ptabs_paddr[0] >> 13)); 1901 1858 boot_set_mmu_mode(0xF); … … 1905 1862 boot_puts("\n"); 1906 1863 1907 1908 1864 // vobjs initialisation 1909 1865 boot_vobjs_init(); 1910 1866 1911 boot_puts("\n[BOOT] Vobjs initialisation completed at cycle : ");1912 boot_putd(boot_proctime());1913 boot_puts("\n");1914 1915 1867 // peripherals initialisation 1916 1868 boot_peripherals_init(); 1917 1869 1918 boot_puts("\n[BOOT] Peripherals initialisation completed at cycle ");1919 boot_putd(boot_proctime());1920 boot_puts("\n");1921 1922 1870 // schedulers initialisation 1923 1871 boot_schedulers_init(); 1924 1925 boot_puts("\n[BOOT] Schedulers initialisation completed at cycle ");1926 boot_putd(boot_proctime());1927 boot_puts("\n");1928 1872 1929 1873 // start all processors -
soft/giet_vm/giet_config.h
r249 r253 15 15 /* Debug parameters */ 16 16 17 #define BOOT_DEBUG_ PERI 0 /* trace peripherals initialisation*/17 #define BOOT_DEBUG_MAPPING 1 /* trace map_info checking */ 18 18 #define BOOT_DEBUG_PT 0 /* trace page tables initialisation */ 19 19 #define BOOT_DEBUG_VOBJS 0 /* trace vobjs initialisation */ 20 #define BOOT_DEBUG_PERI 0 /* trace peripherals initialisation */ 20 21 #define BOOT_DEBUG_SCHED 0 /* trace schedulers initialisation */ 21 22 … … 29 30 /* software parameters */ 30 31 31 #define GIET_CLUSTER_INCREMENT 0x100000 /* address increment for replicated peripherals */32 32 #define GIET_NB_VSPACE_MAX 64 /* max number of virtual spaces */ 33 33 #define GIET_TICK_VALUE 0x100000 /* context switch period (number of cycles) */ -
soft/giet_vm/libs/mwmr_channel.h
r228 r253 15 15 /////////////////////////////////////////////////////////////////////////////////// 16 16 17 typedef struct mwmr_channel_s { 17 typedef struct mwmr_channel_s 18 { 18 19 unsigned int ptr; // index of the first valid data word 19 20 unsigned int ptw; // index of the first empty slot -
soft/giet_vm/libs/stdio.c
r238 r253 13 13 #include <stdio.h> 14 14 15 #define SYSCALL_PROCID 0x00 16 #define SYSCALL_PROCTIME 0x01 17 #define SYSCALL_TTY_WRITE 0x02 18 #define SYSCALL_TTY_READ 0x03 19 #define SYSCALL_TIMER_START 0x04 20 #define SYSCALL_TIMER_STOP 0x05 21 #define SYSCALL_GCD_WRITE 0x06 22 #define SYSCALL_GCD_READ 0x07 23 #define SYSCALL_HEAP_INFO 0x08 24 #define SYSCALL_PROC_TASK_ID 0x09 25 #define SYSCALL_GLOBAL_TASK_ID 0x0A 26 #define SYSCALL_CTX_SWITCH 0x0D 27 #define SYSCALL_EXIT 0x0E 28 #define SYSCALL_PROC_NUMBER 0x0F 29 #define SYSCALL_FB_SYNC_WRITE 0x10 30 #define SYSCALL_FB_SYNC_READ 0x11 31 #define SYSCALL_FB_WRITE 0x12 32 #define SYSCALL_FB_READ 0x13 33 #define SYSCALL_FB_COMPLETED 0x14 34 #define SYSCALL_IOC_WRITE 0x15 35 #define SYSCALL_IOC_READ 0x16 36 #define SYSCALL_IOC_COMPLETED 0x17 37 #define SYSCALL_IOC_BLOCK_SIZE 0x18 38 #define SYSCALL_VOBJ_GET_VBASE 0x1A 39 #define SYSCALL_NIC_WRITE 0x1B 40 #define SYSCALL_NIC_READ 0x1C 41 #define SYSCALL_NIC_COMPLETED 0x1D 15 #define SYSCALL_PROCID 0x00 16 #define SYSCALL_PROCTIME 0x01 17 #define SYSCALL_TTY_WRITE 0x02 18 #define SYSCALL_TTY_READ 0x03 19 #define SYSCALL_TIMER_START 0x04 20 #define SYSCALL_TIMER_STOP 0x05 21 #define SYSCALL_GCD_WRITE 0x06 22 #define SYSCALL_GCD_READ 0x07 23 #define SYSCALL_HEAP_INFO 0x08 24 #define SYSCALL_LOCAL_TASK_ID 0x09 25 #define SYSCALL_GLOBAL_TASK_ID 0x0A 26 #define SYSCALL_FB_CMA_INIT 0x0B 27 #define SYSCALL_FB_CMA_WRITE 0x0C 28 #define SYSCALL_FB_CMA_STOP 0x0D 29 #define SYSCALL_EXIT 0x0E 30 #define SYSCALL_PROC_NUMBER 0x0F 31 #define SYSCALL_FB_SYNC_WRITE 0x10 32 #define SYSCALL_FB_SYNC_READ 0x11 33 #define SYSCALL_FB_DMA_WRITE 0x12 34 #define SYSCALL_FB_DMA_READ 0x13 35 #define SYSCALL_FB_DMA_COMPLETED 0x14 36 #define SYSCALL_IOC_WRITE 0x15 37 #define SYSCALL_IOC_READ 0x16 38 #define SYSCALL_IOC_COMPLETED 0x17 39 #define SYSCALL_IOC_BLOCK_SIZE 0x18 40 #define SYSCALL_CTX_SWITCH 0x19 41 #define SYSCALL_VOBJ_GET_VBASE 0x1A 42 #define SYSCALL_NIC_CMA_RX_INIT 0x1B 43 #define SYSCALL_NIC_CMA_TX_INIT 0x1C 44 #define SYSCALL_NIC_CMA_STOP 0x1D 45 #define SYSCALL_NIC_SYNC_READ 0x1E 46 #define SYSCALL_NIC_SYNC_WRITE 0x1F 42 47 43 48 ////////////////////////////////////////////////////////////////////////////////// … … 47 52 // and tells GCC what has been modified by system call execution. 48 53 ////////////////////////////////////////////////////////////////////////////////// 49 static inline unsigned int sys_call(unsigned int call_no, 50 unsigned int arg_0, 51 unsigned int arg_1, 52 unsigned int arg_2, 53 unsigned int arg_3) { 54 static inline unsigned int sys_call( unsigned int call_no, 55 unsigned int arg_0, 56 unsigned int arg_1, 57 unsigned int arg_2, 58 unsigned int arg_3 ) 59 { 54 60 register unsigned int reg_no_and_output asm("v0") = call_no; 55 61 register unsigned int reg_a0 asm("a0") = arg_0; … … 109 115 110 116 111 ////// 117 ////// TTY device related system calls ///// 112 118 113 119 //////////////////////////////////////////////////////////////////////////////////// … … 123 129 return sys_call(SYSCALL_TTY_WRITE, (unsigned int) (&byte), 1, 0, 0); 124 130 } 125 126 127 131 //////////////////////////////////////////////////////////////////////////////////// 128 132 // giet_tty_puts() … … 140 144 return sys_call(SYSCALL_TTY_WRITE, (unsigned int) buf, length, 0, 0); 141 145 } 142 143 144 146 //////////////////////////////////////////////////////////////////////////////////// 145 147 // giet_tty_putw() … … 161 163 return sys_call(SYSCALL_TTY_WRITE, (unsigned int) buf, 10, 0, 0); 162 164 } 163 164 165 165 //////////////////////////////////////////////////////////////////////////////////// 166 166 // giet_tty_getc() … … 180 180 return 0; 181 181 } 182 183 184 182 //////////////////////////////////////////////////////////////////////////////////// 185 183 // giet_tty_gets() … … 226 224 return 0; 227 225 } 228 229 230 226 //////////////////////////////////////////////////////////////////////////////////// 231 227 // giet_tty_getw() … … 325 321 return 0; 326 322 } 327 328 329 323 //////////////////////////////////////////////////////////////////////////////////// 330 324 // giet_tty_printf() … … 448 442 // - Returns 0 if success, > 0 if error. 449 443 ////////////////////////////////////////////////////////////////////////////////// 450 unsigned int giet_timer_start() { 444 unsigned int giet_timer_start() 445 { 451 446 return sys_call(SYSCALL_TIMER_START, 0, 0, 0, 0); 452 447 } 453 454 455 448 ////////////////////////////////////////////////////////////////////////////////// 456 449 // giet_timer_stop() … … 459 452 // - Returns 0 if success, > 0 if error. 460 453 ////////////////////////////////////////////////////////////////////////////////// 461 unsigned int giet_timer_stop() { 454 unsigned int giet_timer_stop() 455 { 462 456 return sys_call(SYSCALL_TIMER_STOP, 0, 0, 0, 0); 463 457 } … … 477 471 // - Returns 0 if success, > 0 if error. 478 472 ////////////////////////////////////////////////////////////////////////////////// 479 unsigned int giet_gcd_set_opa(unsigned int val) { 473 unsigned int giet_gcd_set_opa(unsigned int val) 474 { 480 475 return sys_call(SYSCALL_GCD_WRITE, GCD_OPA, val, 0, 0); 481 476 } 482 483 484 477 ////////////////////////////////////////////////////////////////////////////////// 485 478 // giet_gcd_set_opb() … … 488 481 // - Returns 0 if success, > 0 if error. 489 482 ////////////////////////////////////////////////////////////////////////////////// 490 unsigned int giet_gcd_set_opb(unsigned int val) { 483 unsigned int giet_gcd_set_opb(unsigned int val) 484 { 491 485 return sys_call(SYSCALL_GCD_WRITE, GCD_OPB, val, 0, 0); 492 486 } 493 494 495 487 ////////////////////////////////////////////////////////////////////////////////// 496 488 // giet_gcd_start() … … 499 491 // - Returns 0 if success, > 0 if error. 500 492 ////////////////////////////////////////////////////////////////////////////////// 501 unsigned int giet_gcd_start() { 493 unsigned int giet_gcd_start() 494 { 502 495 return sys_call(SYSCALL_GCD_WRITE, GCD_START, 0, 0, 0); 503 496 } 504 505 506 497 ////////////////////////////////////////////////////////////////////////////////// 507 498 // giet_gcd_get_status() … … 510 501 // - The value is 0 when the coprocessor is idle (computation completed). 511 502 ////////////////////////////////////////////////////////////////////////////////// 512 unsigned int giet_gcd_get_status(unsigned int * val) { 503 unsigned int giet_gcd_get_status(unsigned int * val) 504 { 513 505 return sys_call(SYSCALL_GCD_READ, GCD_STATUS, (unsigned int) val, 0, 0); 514 506 } 515 516 517 507 ////////////////////////////////////////////////////////////////////////////////// 518 508 // giet_gcd_get_result() … … 520 510 // This function gets the result of the computation from the GCD coprocessor. 521 511 ////////////////////////////////////////////////////////////////////////////////// 522 unsigned int giet_gcd_get_result(unsigned int * val) { 512 unsigned int giet_gcd_get_result(unsigned int * val) 513 { 523 514 return sys_call(SYSCALL_GCD_READ, GCD_OPA, (unsigned int) val, 0, 0); 524 515 } … … 536 527 // - Returns 0 if success, > 0 if error (e.g. memory buffer not in user space). 537 528 ////////////////////////////////////////////////////////////////////////////////// 538 unsigned int giet_ioc_write( unsigned int lba, void * buffer, unsigned int count) { 529 unsigned int giet_ioc_write( unsigned int lba, 530 void * buffer, 531 unsigned int count) 532 { 539 533 return sys_call(SYSCALL_IOC_WRITE, lba, (unsigned int) buffer, count, 0); 540 534 } 541 542 543 535 ////////////////////////////////////////////////////////////////////////////////// 544 536 // giet_ioc_read() … … 550 542 // - Returns 0 if success, > 0 if error (e.g. memory buffer not in user space). 551 543 ////////////////////////////////////////////////////////////////////////////////// 552 unsigned int giet_ioc_read(unsigned int lba, void * buffer, unsigned int count) { 544 unsigned int giet_ioc_read( unsigned int lba, 545 void * buffer, 546 unsigned int count ) 547 { 553 548 return sys_call(SYSCALL_IOC_READ, lba, (unsigned int) buffer, count, 0); 554 549 } 555 556 557 550 ////////////////////////////////////////////////////////////////////////////////// 558 551 // giet_ioc_completed() … … 561 554 // successfully completed, and returns 1 if an address error has been detected. 562 555 ////////////////////////////////////////////////////////////////////////////////// 563 unsigned int giet_ioc_completed() { 556 unsigned int giet_ioc_completed() 557 { 564 558 return sys_call(SYSCALL_IOC_COMPLETED, 0, 0, 0, 0); 565 559 } 566 567 568 560 ////////////////////////////////////////////////////////////////////////////////// 569 561 // giet_ioc_block_size() … … 571 563 // This blocking function returns the block_size (in bytes) of the block device 572 564 ////////////////////////////////////////////////////////////////////////////////// 573 unsigned int giet_ioc_block_size() { 565 unsigned int giet_ioc_block_size() 566 { 574 567 return sys_call(SYSCALL_IOC_BLOCK_SIZE, 0, 0, 0, 0); 575 568 } … … 588 581 // - Returns 0 if success, > 0 if error (e.g. memory buffer not in user space). 589 582 ////////////////////////////////////////////////////////////////////////////////// 590 unsigned int giet_fb_sync_write(unsigned int offset, void * buffer, unsigned int length) { 583 unsigned int giet_fb_sync_write( unsigned int offset, 584 void * buffer, 585 unsigned int length ) 586 { 591 587 return sys_call(SYSCALL_FB_SYNC_WRITE, offset, (unsigned int) buffer, length, 0); 592 588 } 593 594 595 589 ////////////////////////////////////////////////////////////////////////////////// 596 590 // giet_fb_sync_read() … … 603 597 // - Returns 0 if success, > 0 if error (e.g. memory buffer not in user space). 604 598 ////////////////////////////////////////////////////////////////////////////////// 605 unsigned int giet_fb_sync_read(unsigned int offset, void * buffer, unsigned int length) { 599 unsigned int giet_fb_sync_read( unsigned int offset, 600 void * buffer, 601 unsigned int length ) 602 { 606 603 return sys_call(SYSCALL_FB_SYNC_READ, offset, (unsigned int) buffer, length, 0); 607 604 } 608 609 610 ////////////////////////////////////////////////////////////////////////////////// 611 // giet_fb_write() 605 ////////////////////////////////////////////////////////////////////////////////// 606 // giet_fb_dma_write() 612 607 ////////////////////////////////////////////////////////////////////////////////// 613 608 // This non-blocking function use the DMA coprocessor to transfer data from a … … 620 615 // - Returns 0 if success, > 0 if error (e.g. memory buffer not in user space). 621 616 ////////////////////////////////////////////////////////////////////////////////// 622 unsigned int giet_fb_write(unsigned int offset, void * buffer, unsigned int length) { 623 return sys_call(SYSCALL_FB_WRITE, offset, (unsigned int) buffer, length, 0); 624 } 625 626 627 ////////////////////////////////////////////////////////////////////////////////// 628 // giet_fb_read() 617 unsigned int giet_fb_dma_write( unsigned int offset, 618 void * buffer, 619 unsigned int length ) 620 { 621 return sys_call(SYSCALL_FB_DMA_WRITE, offset, (unsigned int) buffer, length, 0); 622 } 623 ////////////////////////////////////////////////////////////////////////////////// 624 // giet_fb_dma_read() 629 625 ////////////////////////////////////////////////////////////////////////////////// 630 626 // This non-blocking function use the DMA coprocessor to transfer data from the … … 637 633 // - Returns 0 if success, > 0 if error (e.g. memory buffer not in user space). 638 634 ////////////////////////////////////////////////////////////////////////////////// 639 unsigned int giet_fb_read(unsigned int offset, void * buffer, unsigned int length) { 640 return sys_call(SYSCALL_FB_READ, offset, (unsigned int) buffer, length, 0); 641 } 642 643 644 ////////////////////////////////////////////////////////////////////////////////// 645 // giet_fb_completed() 635 unsigned int giet_fb_dma_read( unsigned int offset, 636 void * buffer, 637 unsigned int length ) 638 { 639 return sys_call(SYSCALL_FB_DMA_READ, offset, (unsigned int) buffer, length, 0); 640 } 641 ////////////////////////////////////////////////////////////////////////////////// 642 // giet_fb_dma_completed() 646 643 ////////////////////////////////////////////////////////////////////////////////// 647 644 // This blocking function returns when the transfer is completed. 648 645 // - Returns 0 if success, > 0 if error. 649 646 ////////////////////////////////////////////////////////////////////////////////// 650 unsigned int giet_fb_completed() { 651 return sys_call(SYSCALL_FB_COMPLETED, 0, 0, 0, 0); 652 } 653 654 655 ////////////////////////////////////////////////////////////////////////////////// 656 // giet_nic_write() 657 ////////////////////////////////////////////////////////////////////////////////// 658 // This non-blocking function use the DMA coprocessor to transfer data from the 659 // NIC device to an user buffer. 660 // - offset : offset (in bytes) in the NIC 661 // - buffer : base address of the memory buffer 662 // - length : number of bytes to be transfered 663 // The transfer completion is signaled by an IRQ, and must be tested by the 664 // nic_completed() function. 647 unsigned int giet_fb_dma_completed() 648 { 649 return sys_call(SYSCALL_FB_DMA_COMPLETED, 0, 0, 0, 0); 650 } 651 ////////////////////////////////////////////////////////////////////////////////// 652 // giet_fb_cma_init() 653 ////////////////////////////////////////////////////////////////////////////////// 654 // This function initializes the two chbuf SRC an DST used by the CMA controller 655 // and activates the CMA channel allocated to the calling task. 656 // - buf0 : first user buffer virtual address 657 // - buf0 : second user buffer virtual address 658 // - length : buffer size (bytes) 659 // - Returns 0 if success, > 0 if error. 660 ////////////////////////////////////////////////////////////////////////////////// 661 unsigned int giet_fb_cma_init( void * buf0, 662 void * buf1, 663 unsigned int length ) 664 { 665 return sys_call(SYSCALL_FB_CMA_INIT, (unsigned int)buf0, (unsigned int)buf1, length, 0); 666 } 667 ////////////////////////////////////////////////////////////////////////////////// 668 // giet_fb_cma_write() 669 ////////////////////////////////////////////////////////////////////////////////// 670 // This function set the valid status for one of the SRC user buffer. 671 // and reset the valid status for the DST frame buffer. 672 // - bufffer_id : 0 => buf0 valid is set / not 0 => buf1 valid is set 673 // - Returns 0 if success, > 0 if error. 674 ////////////////////////////////////////////////////////////////////////////////// 675 unsigned int giet_fb_cma_write( unsigned int buffer_id ) 676 { 677 return sys_call(SYSCALL_FB_CMA_WRITE, buffer_id, 0, 0, 0); 678 } 679 ////////////////////////////////////////////////////////////////////////////////// 680 // giet_fb_cma_stop() 681 ////////////////////////////////////////////////////////////////////////////////// 682 // This function desactivates the CMA channel allocated to the calling task. 683 // - Returns 0 if success, > 0 if error. 684 ////////////////////////////////////////////////////////////////////////////////// 685 unsigned int giet_fb_cma_stop( ) 686 { 687 return sys_call(SYSCALL_FB_CMA_STOP, 0, 0, 0, 0); 688 } 689 690 691 //////// NIC related system calls //////// 692 693 ////////////////////////////////////////////////////////////////////////////////// 694 // giet_nic_cma_rx_init() 695 ////////////////////////////////////////////////////////////////////////////////// 696 // This function initializes the two chbuf SRC an DST used by the CMA controller 697 // and activates the NIC RX channel allocated to the calling task, and the 698 // CMA channel used for RX transfer. 699 // - buf0 : first user buffer virtual address 700 // - buf0 : second user buffer virtual address 701 // - length : buffer size (bytes) 665 702 // - Returns 0 if success, > 0 if error (e.g. memory buffer not in user space). 666 703 ////////////////////////////////////////////////////////////////////////////////// 667 668 unsigned int giet_nic_write(unsigned int offset, void * buffer, unsigned int length) { 669 return sys_call(SYSCALL_NIC_WRITE, offset, (unsigned int) buffer, length, 0); 670 } 671 672 673 ////////////////////////////////////////////////////////////////////////////////// 674 // giet_nic_read() 675 ////////////////////////////////////////////////////////////////////////////////// 676 // This non-blocking function use the DMA coprocessor to transfer data from the 677 // NIC device to an user buffer. 678 // - offset : offset (in bytes) in the NIC 679 // - buffer : base address of the memory buffer 680 // - length : number of bytes to be transfered 681 // The transfer completion is signaled by an IRQ, and must be tested by the 682 // nic_completed() function. 704 unsigned int giet_nic_cma_rx_init( void * buf0, 705 void * buf1, 706 unsigned int length ) 707 { 708 return sys_call(SYSCALL_NIC_CMA_RX_INIT, (unsigned int)buf0, (unsigned int)buf1, length, 0); 709 } 710 ////////////////////////////////////////////////////////////////////////////////// 711 // giet_nic_cma_tx_init() 712 ////////////////////////////////////////////////////////////////////////////////// 713 // This function initializes the two chbuf SRC an DST used by the CMA controller 714 // and activates the NIC TX channel allocated to the calling task, and the two 715 // CMA channel used for TX transfer. 716 // - buf0 : first user buffer virtual address 717 // - buf0 : second user buffer virtual address 718 // - length : buffer size (bytes) 683 719 // - Returns 0 if success, > 0 if error (e.g. memory buffer not in user space). 684 720 ////////////////////////////////////////////////////////////////////////////////// 685 686 unsigned int giet_nic_read(unsigned int offset, void * buffer, unsigned int length) { 687 return sys_call(SYSCALL_NIC_READ, offset, (unsigned int) buffer, length, 0); 688 } 689 690 691 ////////////////////////////////////////////////////////////////////////////////// 692 // giet_nic_completed() 693 ////////////////////////////////////////////////////////////////////////////////// 694 // This blocking function returns when the transfer is completed. 695 // - Returns 0 if success, > 0 if error. 696 ////////////////////////////////////////////////////////////////////////////////// 697 unsigned int giet_nic_completed() { 698 return sys_call(SYSCALL_NIC_COMPLETED, 0, 0, 0, 0); 699 } 700 701 702 ///// Miscellaneous related system calls ///// 721 unsigned int giet_nic_cma_tx_init( void * buf0, 722 void * buf1, 723 unsigned int length ) 724 { 725 return sys_call(SYSCALL_NIC_CMA_TX_INIT, (unsigned int)buf0, (unsigned int)buf1, length, 0); 726 } 727 ////////////////////////////////////////////////////////////////////////////////// 728 // giet_nic_cma_stop() 729 ////////////////////////////////////////////////////////////////////////////////// 730 // This function desactivates the NIC channel and the two CMA channels 731 // allocated to the calling task. 732 // - Returns 0 if success, > 0 if error. 733 ////////////////////////////////////////////////////////////////////////////////// 734 unsigned int giet_nic_cma_stop( ) 735 { 736 return sys_call(SYSCALL_NIC_CMA_STOP, 0, 0, 0, 0); 737 } 738 739 740 ///// Miscellaneous system calls ///// 703 741 704 742 ////////////////////////////////////////////////////////////////////////////////// … … 711 749 // - Returns the address if success, 0 if error ( not defined or wrong type ) 712 750 ////////////////////////////////////////////////////////////////////////////////// 713 unsigned int giet_vobj_get_vbase(char * vspace_name, char * vobj_name, unsigned int vobj_type, unsigned int * vobj_vaddr) { 751 unsigned int giet_vobj_get_vbase( char* vspace_name, 752 char* vobj_name, 753 unsigned int vobj_type, 754 unsigned int* vobj_vaddr ) 755 { 714 756 return sys_call(SYSCALL_VOBJ_GET_VBASE, 715 757 (unsigned int) vspace_name, … … 718 760 (unsigned int) vobj_vaddr); 719 761 } 720 721 722 762 //////////////////////////////////////////////////////////////////////////////////// 723 763 // giet_proc_number() … … 727 767 // - Returns 0 if success, > 0 if error ( cluster index too large ) 728 768 //////////////////////////////////////////////////////////////////////////////////// 729 unsigned int giet_proc_number(unsigned int cluster_id, unsigned int * buffer) { 769 unsigned int giet_proc_number( unsigned int cluster_id, 770 unsigned int* buffer ) 771 { 730 772 return sys_call(SYSCALL_PROC_NUMBER, cluster_id, (unsigned int) buffer, 0, 0); 731 773 } 732 733 734 ///// Miscellaneous system calls ///// 735 736 ////////////////////////////////////////////////////////////////////////////////// 737 // giet_task_exit() 774 ////////////////////////////////////////////////////////////////////////////////// 775 // giet_exit() 738 776 ////////////////////////////////////////////////////////////////////////////////// 739 777 // This function stops execution of the calling task with a TTY message, 740 // and enter an infinite loop. 741 // The task is blocked, but it still consume processor cycles ... 742 ////////////////////////////////////////////////////////////////////////////////// 743 void giet_exit() { 778 // and the task is descheduled and becomes not runable. 779 // It does not consume processor cycles anymore. 780 ////////////////////////////////////////////////////////////////////////////////// 781 void giet_exit() 782 { 744 783 sys_call(SYSCALL_EXIT, 0, 0, 0, 0); 745 784 } 746 785 ////////////////////////////////////////////////////////////////////////////////// 786 // giet_context_switch() 787 // The user task calling this function is descheduled and 788 // the processor is allocated to another task. 789 ////////////////////////////////////////////////////////////////////////////////// 790 unsigned int giet_context_switch() 791 { 792 return sys_call(SYSCALL_CTX_SWITCH, 0, 0, 0, 0); 793 } 794 ////////////////////////////////////////////////////////////////////////////////// 795 // giet_proc_task_id() 796 // This functions returns the local task id, i.e. the processor task id (ranging 797 // from 0 to n-1(p) for each processor if p has n tasks) 798 ////////////////////////////////////////////////////////////////////////////////// 799 unsigned int giet_proc_task_id() 800 { 801 return sys_call(SYSCALL_LOCAL_TASK_ID, 0, 0, 0, 0); 802 } 803 ////////////////////////////////////////////////////////////////////////////////// 804 // giet_heap_info() 805 // This function returns the base address and size of the current task's heap 806 ////////////////////////////////////////////////////////////////////////////////// 807 unsigned int giet_heap_info( unsigned int* vaddr, 808 unsigned int* length) 809 { 810 return sys_call(SYSCALL_HEAP_INFO, (unsigned int)vaddr, (unsigned int)length, 0, 0); 811 } 812 ////////////////////////////////////////////////////////////////////////////////// 813 // giet_global_task_id() 814 // This functions returns the global task id, which is unique in all the giet. 815 ////////////////////////////////////////////////////////////////////////////////// 816 unsigned int giet_global_task_id() 817 { 818 return sys_call(SYSCALL_GLOBAL_TASK_ID, 0, 0, 0, 0); 819 } 820 /////////////////////////////////////////////////////////////////////////////////// 821 // giet_assert() 822 // This function 823 /////////////////////////////////////////////////////////////////////////////////// 824 void giet_assert( unsigned int condition, 825 char* string ) 826 { 827 if ( condition == 0 ) 828 { 829 giet_tty_puts( string ); 830 giet_exit(); 831 } 832 } 833 834 ////// Pseudo system calls (no syscall instruction) /////// 747 835 748 836 /////////////////////////////////////////////////////////////////////////////////// … … 751 839 // count. This value is comprised between 0 & 65535. 752 840 /////////////////////////////////////////////////////////////////////////////////// 753 unsigned int giet_rand() { 841 unsigned int giet_rand() 842 { 754 843 unsigned int x = sys_call(SYSCALL_PROCTIME, 0, 0, 0, 0); 755 844 if ((x & 0xF) > 7) { … … 761 850 } 762 851 763 764 //////////////////////////////////////////////////////////////////////////////////765 // giet_context_switch()766 // The user task calling this function is descheduled and767 // the processor is allocated to another task.768 //////////////////////////////////////////////////////////////////////////////////769 unsigned int giet_context_switch() {770 return sys_call(SYSCALL_CTX_SWITCH, 0, 0, 0, 0);771 }772 773 //////////////////////////////////////////////////////////////////////////////////774 // giet_proc_task_id()775 // This functions returns the local task id, i.e. the processor task id (ranging776 // from 0 to n-1(p) for each processor if p has n tasks)777 //////////////////////////////////////////////////////////////////////////////////778 unsigned int giet_proc_task_id() {779 return sys_call(SYSCALL_PROC_TASK_ID, 0, 0, 0, 0);780 }781 782 //////////////////////////////////////////////////////////////////////////////////783 // giet_heap_info()784 // This function returns the base address and size of the current task's heap785 //////////////////////////////////////////////////////////////////////////////////786 unsigned int giet_heap_info(unsigned int * vaddr, unsigned int * length) {787 return sys_call(SYSCALL_HEAP_INFO, (unsigned int) vaddr, (unsigned int) length, 0, 0);788 }789 790 791 //////////////////////////////////////////////////////////////////////////////////792 // giet_global_task_id()793 // This functions returns the global task id, which is unique in all the giet794 //////////////////////////////////////////////////////////////////////////////////795 unsigned int giet_global_task_id() {796 return sys_call(SYSCALL_GLOBAL_TASK_ID, 0, 0, 0, 0);797 }798 852 799 853 // Local Variables: -
soft/giet_vm/libs/stdio.h
r237 r253 15 15 /* TTY device related functions */ 16 16 unsigned int giet_tty_putc(char byte); 17 unsigned int giet_tty_puts(char 17 unsigned int giet_tty_puts(char* buf); 18 18 unsigned int giet_tty_putw(unsigned int val); 19 unsigned int giet_tty_getc_no_irq(char 20 unsigned int giet_tty_getc(char 21 unsigned int giet_tty_gets(char 22 unsigned int giet_tty_getw(unsigned int 23 unsigned int giet_tty_printf(char 19 unsigned int giet_tty_getc_no_irq(char* byte); 20 unsigned int giet_tty_getc(char* byte); 21 unsigned int giet_tty_gets(char* buf, unsigned int bufsize); 22 unsigned int giet_tty_getw(unsigned int* val); 23 unsigned int giet_tty_printf(char* format,...); 24 24 25 /* TIMER device related functions */ 26 unsigned int giet_timer_start(); 27 unsigned int giet_timer_stop(); 28 25 29 /* GCD coprocessor related functions */ 26 30 unsigned int giet_gcd_set_opa(unsigned int val); 27 31 unsigned int giet_gcd_set_opb(unsigned int val); 28 32 unsigned int giet_gcd_start(); 29 unsigned int giet_gcd_get_result(unsigned int 30 unsigned int giet_gcd_get_status(unsigned int 33 unsigned int giet_gcd_get_result(unsigned int* val); 34 unsigned int giet_gcd_get_status(unsigned int* val); 31 35 32 36 /* Block device related functions */ 33 unsigned int giet_ioc_read(unsigned int lba, void 34 unsigned int giet_ioc_write(unsigned int lba, void 37 unsigned int giet_ioc_read(unsigned int lba, void* buffer, unsigned int count); 38 unsigned int giet_ioc_write(unsigned int lba, void* buffer, unsigned int count); 35 39 unsigned int giet_ioc_completed(); 36 40 unsigned int giet_ioc_block_size(); 37 41 38 42 /* Frame buffer device related functions */ 39 unsigned int giet_fb_sync_read(unsigned int offset, void * buffer, unsigned int length ); 40 unsigned int giet_fb_sync_write(unsigned int offset, void * buffer, unsigned int length); 41 unsigned int giet_fb_read(unsigned int offset, void * buffer, unsigned int length); 42 unsigned int giet_fb_write(unsigned int offset, void * buffer, unsigned int length); 43 unsigned int giet_nic_write(unsigned int offset, void * buffer, unsigned int length); 44 unsigned int giet_nic_read(unsigned int offset, void * buffer, unsigned int length); 45 unsigned int giet_fb_completed(); 46 unsigned int giet_nic_completed(); 43 unsigned int giet_fb_sync_read(unsigned int offset, void* buffer, unsigned int length ); 44 unsigned int giet_fb_sync_write(unsigned int offset, void* buffer, unsigned int length); 45 unsigned int giet_fb_dma_read(unsigned int offset, void* buffer, unsigned int length); 46 unsigned int giet_fb_dma_write(unsigned int offset, void* buffer, unsigned int length); 47 unsigned int giet_fb_dma_completed(); 48 unsigned int giet_fb_cma_init(void* buf0, void* buf1, unsigned int length); 49 unsigned int giet_fb_cma_write(unsigned int buf_id); 50 unsigned int giet_fb_cma_stop(); 51 52 /* Network controller relate functions */ 53 unsigned int giet_nic_cma_rx_init(void* buf0, void* buf1, unsigned int length); 54 unsigned int giet_nic_cma_tx_init(void* buf0, void* buf1, unsigned int length); 55 unsigned int giet_nic_cma_stop(); 47 56 48 57 /* Misc */ 49 unsigned int giet_vobj_get_vbase(char * vspace_name, char * vobj_name, unsigned int vobj_type, unsigned int * vobj_vaddr); 58 unsigned int giet_vobj_get_vbase(char* vspace_name, char* vobj_name, 59 unsigned int vobj_type, unsigned int* vobj_vaddr); 60 unsigned int giet_procnumber(); 50 61 void giet_exit(); 51 unsigned int giet_rand();52 62 unsigned int giet_context_switch(); 53 63 unsigned int giet_proc_task_id(); 54 unsigned int giet_heap_info(unsigned int * vaddr, unsigned int* size);64 unsigned int giet_heap_info(unsigned int* vaddr, unsigned int* size); 55 65 unsigned int giet_global_task_id(); 56 57 unsigned int giet_ procnumber();66 void giet_assert( unsigned int, char* string); 67 unsigned int giet_rand(); 58 68 59 69 #endif -
soft/giet_vm/mappings/1c_4p_four.xml
r235 r253 1 1 <?xml version="1.0"?> 2 2 3 <mapping_info signature = "0xdeadbeef" name = "1c_4p_four" cluster_x = "1" cluster_y = "1" vspaces = "4" > 3 <mapping_info signature = "0xdeadbeef" 4 name = "1c_4p_four" 5 cluster_x = "1" 6 cluster_y = "1" 7 vspaces = "4" 8 increment = "0x10000" > 4 9 5 10 *** This section describes an instance of the "caba_vgsb_xicu_mmu" generic architecture … … 70 75 <periph type = "TTY" psegname = "PSEG_TTY" channels = "8" /> 71 76 <periph type = "DMA" psegname = "PSEG_DMA" channels = "1" /> 72 <periph type = "X ICU" psegname = "PSEG_ICU" channels = "5" />77 <periph type = "XCU" psegname = "PSEG_ICU" channels = "5" /> 73 78 <periph type = "FBF" psegname = "PSEG_FBF" /> 74 79 -
soft/giet_vm/mappings/1c_4p_four_dhrystone.xml
r241 r253 1 1 <?xml version="1.0"?> 2 2 3 <mapping_info signature = "0xdeadbeef" name = "1c_4p_four_dhrystone" cluster_x = "1" cluster_y = "1" vspaces = "4" > 3 <mapping_info signature = "0xdeadbeef" 4 name = "1c_4p_four_dhrystone" 5 cluster_x = "1" 6 cluster_y = "1" 7 vspaces = "4" 8 increment = "0x10000" > 4 9 5 10 <clusterset> … … 9 14 10 15 <pseg name = "PSEG_RAM" type = "RAM" base = "0x0000000000" length = "0x0010000000" /> 11 <pseg name = "PSEG_X ICU"type = "PERI" base = "0x00B0000000" length = "0x0000001000" />16 <pseg name = "PSEG_XCU" type = "PERI" base = "0x00B0000000" length = "0x0000001000" /> 12 17 <pseg name = "PSEG_DMA" type = "PERI" base = "0x00B1000000" length = "0x0000001000" /> 13 18 <pseg name = "PSEG_FBF" type = "PERI" base = "0x00B2000000" length = "0x0000200000" /> … … 61 66 <periph type = "TTY" psegname = "PSEG_TTY" channels = "8" /> 62 67 <periph type = "DMA" psegname = "PSEG_DMA" channels = "1" /> 63 <periph type = "X ICU" psegname = "PSEG_XICU"channels = "5" />68 <periph type = "XCU" psegname = "PSEG_XCU" channels = "5" /> 64 69 <periph type = "FBF" psegname = "PSEG_FBF" /> 65 70 … … 103 108 104 109 *** XICU / A[31:28] = 0xE 105 <vseg name = "seg_icu" vbase = "0xE0000000" mode = "__W_" clusterid = "0" psegname = "PSEG_X ICU">110 <vseg name = "seg_icu" vbase = "0xE0000000" mode = "__W_" clusterid = "0" psegname = "PSEG_XCU" > 106 111 <vobj name = "icu" type = "PERI" length = "0x00001000" /> 107 112 </vseg> -
soft/giet_vm/mappings/1c_4p_gameoflife.xml
r251 r253 1 1 <?xml version="1.0"?> 2 2 3 <mapping_info signature = "0xdeadbeef" name = "1c_4p_gameoflife" cluster_x = "1" cluster_y = "1" vspaces = "1" > 3 <mapping_info signature = "0xdeadbeef" 4 name = "1c_4p_gameoflife" 5 cluster_x = "1" 6 cluster_y = "1" 7 vspaces = "1" 8 increment = "0x10000 > 4 9 5 10 <clusterset> … … 9 14 10 15 <pseg name = "PSEG_RAM" type = "RAM" base = "0x0000000000" length = "0x0010000000" /> 11 <pseg name = "PSEG_X ICU"type = "PERI" base = "0x00B0000000" length = "0x0000001000" />16 <pseg name = "PSEG_XCU" type = "PERI" base = "0x00B0000000" length = "0x0000001000" /> 12 17 <pseg name = "PSEG_DMA" type = "PERI" base = "0x00B1000000" length = "0x0000001000" /> 13 18 <pseg name = "PSEG_FBF" type = "PERI" base = "0x00B2000000" length = "0x0000200000" /> … … 64 69 <periph type = "TTY" psegname = "PSEG_TTY" channels = "2" /> 65 70 <periph type = "DMA" psegname = "PSEG_DMA" channels = "1" /> 66 <periph type = "X ICU" psegname = "PSEG_XICU" channels = "5" />71 <periph type = "XCU" psegname = "PSEG_XCU" channels = "5" /> 67 72 <periph type = "FBF" psegname = "PSEG_FBF" /> 68 73 … … 109 114 </vseg> 110 115 111 *** X ICU / A[31:28] = 0xE112 <vseg name = "seg_icu" vbase = "0xE0000000" mode = "__W_" clusterid = "0" psegname = "PSEG_X ICU">116 *** XCU / A[31:28] = 0xE 117 <vseg name = "seg_icu" vbase = "0xE0000000" mode = "__W_" clusterid = "0" psegname = "PSEG_XCU" > 113 118 <vobj name = "icu" type = "PERI" length = "0x00001000" /> 114 119 </vseg> -
soft/giet_vm/mappings/4c_1p_40.xml
r245 r253 5 5 cluster_x = "2" 6 6 cluster_y = "2" 7 vspaces = "4"> 7 vspaces = "4" 8 increment = "0x0010000" > 8 9 9 10 *** This first section describes an instance of the "tsar_generic_xbar" architecture … … 14 15 <cluster index = "0" > 15 16 <pseg name = "PSEG_RAM" type = "RAM" base = "0x0000000000" length = "0x0010000000" /> 16 <pseg name = "PSEG_X ICU"type = "PERI" base = "0x00B0000000" length = "0x0000002000" />17 <pseg name = "PSEG_XCU" type = "PERI" base = "0x00B0000000" length = "0x0000002000" /> 17 18 <pseg name = "PSEG_DMA" type = "PERI" base = "0x00B1000000" length = "0x0000008000" /> 18 19 … … 45 46 <irq type = "HARD" icuid = "29" isr = "ISR_TTY" channel = "13" /> 46 47 <irq type = "HARD" icuid = "30" isr = "ISR_TTY" channel = "14" /> 47 <irq type = "HARD" icuid = "31" isr = "ISR_IOC" />48 <irq type = "HARD" icuid = "31" isr = "ISR_IOC" channel = "0" /> 48 49 </proc> 49 50 50 51 <periph type = "DMA" psegname = "PSEG_DMA" channels = "4" /> 51 <periph type = "X ICU" psegname = "PSEG_XICU" channels = "18" />52 <periph type = "XCU" psegname = "PSEG_XCU" channels = "1" /> 52 53 <periph type = "IOC" psegname = "PSEG_IOC" channels = "1" /> 53 54 <periph type = "TTY" psegname = "PSEG_TTY" channels = "8" /> … … 58 59 <cluster index = "1" > 59 60 <pseg name = "PSEG_RAM" type = "RAM" base = "0x4000000000" length = "0x0010000000" /> 60 <pseg name = "PSEG_X ICU"type = "PERI" base = "0x40B0000000" length = "0x0000002000" />61 <pseg name = "PSEG_XCU" type = "PERI" base = "0x40B0000000" length = "0x0000002000" /> 61 62 <pseg name = "PSEG_DMA" type = "PERI" base = "0x40B1000000" length = "0x0000008000" /> 62 63 … … 67 68 68 69 <periph type = "DMA" psegname = "PSEG_DMA" channels = "4" /> 69 <periph type = "X ICU" psegname = "PSEG_XICU"channels = "2" />70 <periph type = "XCU" psegname = "PSEG_XCU" channels = "2" /> 70 71 </cluster> 71 72 72 73 <cluster index = "2" > 73 74 <pseg name = "PSEG_RAM" type = "RAM" base = "0x8000000000" length = "0x0010000000" /> 74 <pseg name = "PSEG_X ICU"type = "PERI" base = "0x80B0000000" length = "0x0000002000" />75 <pseg name = "PSEG_XCU" type = "PERI" base = "0x80B0000000" length = "0x0000002000" /> 75 76 <pseg name = "PSEG_DMA" type = "PERI" base = "0x80B1000000" length = "0x0000008000" /> 76 77 … … 81 82 82 83 <periph type = "DMA" psegname = "PSEG_DMA" channels = "4" /> 83 <periph type = "X ICU" psegname = "PSEG_XICU"channels = "2" />84 <periph type = "XCU" psegname = "PSEG_XCU" channels = "2" /> 84 85 </cluster> 85 86 86 87 <cluster index = "3" > 87 88 <pseg name = "PSEG_RAM" type = "RAM" base = "0xC000000000" length = "0x0010000000" /> 88 <pseg name = "PSEG_X ICU"type = "PERI" base = "0xC0B0000000" length = "0x0000002000" />89 <pseg name = "PSEG_XCU" type = "PERI" base = "0xC0B0000000" length = "0x0000002000" /> 89 90 <pseg name = "PSEG_DMA" type = "PERI" base = "0xC0B1000000" length = "0x0000008000" /> 90 91 … … 95 96 96 97 <periph type = "DMA" psegname = "PSEG_DMA" channels = "4" /> 97 <periph type = "XICU" psegname = "PSEG_XICU"channels = "2" />98 <periph type = "XCU" psegname = "PSEG_XCU" channels = "2" /> 98 99 </cluster> 99 100 </clusterset> 100 101 102 101 103 102 <globalset> … … 148 147 </vseg> 149 148 150 *** Replicated ICUS / A[31:28] = 0xE / Increment = 0x10000 0151 152 <vseg name = "seg_icu_0" vbase = "0xE0000000" mode = "__W_" clusterid = "0" psegname = "PSEG_X ICU">149 *** Replicated ICUS / A[31:28] = 0xE / Increment = 0x10000 150 151 <vseg name = "seg_icu_0" vbase = "0xE0000000" mode = "__W_" clusterid = "0" psegname = "PSEG_XCU" > 153 152 <vobj name = "icu_0" type = "PERI" length = "0x00001000" /> 154 153 </vseg> 155 <vseg name = "seg_icu_1" vbase = "0xE0 100000" mode = "__W_" clusterid = "1" psegname = "PSEG_XICU">154 <vseg name = "seg_icu_1" vbase = "0xE0010000" mode = "__W_" clusterid = "1" psegname = "PSEG_XCU" > 156 155 <vobj name = "icu_1" type = "PERI" length = "0x00001000" /> 157 156 </vseg> 158 <vseg name = "seg_icu_2" vbase = "0xE0 200000" mode = "__W_" clusterid = "2" psegname = "PSEG_XICU">157 <vseg name = "seg_icu_2" vbase = "0xE0020000" mode = "__W_" clusterid = "2" psegname = "PSEG_XCU" > 159 158 <vobj name = "icu_2" type = "PERI" length = "0x00001000" /> 160 159 </vseg> 161 <vseg name = "seg_icu_3" vbase = "0xE0 300000" mode = "__W_" clusterid = "3" psegname = "PSEG_XICU">160 <vseg name = "seg_icu_3" vbase = "0xE0030000" mode = "__W_" clusterid = "3" psegname = "PSEG_XCU" > 162 161 <vobj name = "icu_3" type = "PERI" length = "0x00001000" /> 163 162 </vseg> 164 163 165 *** Replicated DMAs / A[31:28] = 0xD / Increment = 0x10000 0164 *** Replicated DMAs / A[31:28] = 0xD / Increment = 0x10000 166 165 167 166 <vseg name = "seg_dma_0" vbase = "0xD0000000" mode = "__W_" clusterid = "0" psegname = "PSEG_DMA" > 168 167 <vobj name = "dma_0" type = "PERI" length = "0x00008000" /> 169 168 </vseg> 170 <vseg name = "seg_dma_1" vbase = "0xD0 100000" mode = "__W_" clusterid = "1" psegname = "PSEG_DMA" >169 <vseg name = "seg_dma_1" vbase = "0xD0010000" mode = "__W_" clusterid = "1" psegname = "PSEG_DMA" > 171 170 <vobj name = "dma_1" type = "PERI" length = "0x00008000" /> 172 171 </vseg> 173 <vseg name = "seg_dma_2" vbase = "0xD0 200000" mode = "__W_" clusterid = "2" psegname = "PSEG_DMA" >172 <vseg name = "seg_dma_2" vbase = "0xD0020000" mode = "__W_" clusterid = "2" psegname = "PSEG_DMA" > 174 173 <vobj name = "dma_2" type = "PERI" length = "0x00008000" /> 175 174 </vseg> 176 <vseg name = "seg_dma_3" vbase = "0xD0 300000" mode = "__W_" clusterid = "3" psegname = "PSEG_DMA" >175 <vseg name = "seg_dma_3" vbase = "0xD0030000" mode = "__W_" clusterid = "3" psegname = "PSEG_DMA" > 177 176 <vobj name = "dma_3" type = "PERI" length = "0x00008000" /> 178 177 </vseg> 179 178 180 *** Replicated schedulers / A[31:28] = 0xF / Increment = 0x10000 0179 *** Replicated schedulers / A[31:28] = 0xF / Increment = 0x10000 181 180 182 181 <vseg name = "seg_sched_0" vbase = "0xF0000000" mode = "C_W_" clusterid = "0" psegname = "PSEG_RAM" > 183 182 <vobj name = "sched_0" type = "SCHED" length = "0x00008000" /> 184 183 </vseg> 185 <vseg name = "seg_sched_1" vbase = "0xF0 100000" mode = "C_W_" clusterid = "1" psegname = "PSEG_RAM" >184 <vseg name = "seg_sched_1" vbase = "0xF0010000" mode = "C_W_" clusterid = "1" psegname = "PSEG_RAM" > 186 185 <vobj name = "sched_1" type = "SCHED" length = "0x00008000" /> 187 186 </vseg> 188 <vseg name = "seg_sched_2" vbase = "0xF0 200000" mode = "C_W_" clusterid = "2" psegname = "PSEG_RAM" >187 <vseg name = "seg_sched_2" vbase = "0xF0020000" mode = "C_W_" clusterid = "2" psegname = "PSEG_RAM" > 189 188 <vobj name = "sched_2" type = "SCHED" length = "0x00008000" /> 190 189 </vseg> 191 <vseg name = "seg_sched_3" vbase = "0xF0 300000" mode = "C_W_" clusterid = "3" psegname = "PSEG_RAM" >190 <vseg name = "seg_sched_3" vbase = "0xF0030000" mode = "C_W_" clusterid = "3" psegname = "PSEG_RAM" > 192 191 <vobj name = "sched_3" type = "SCHED" length = "0x00008000" /> 193 192 </vseg> -
soft/giet_vm/mappings/4c_1p_display.xml
r249 r253 5 5 cluster_x = "2" 6 6 cluster_y = "2" 7 vspaces = "1"> 7 vspaces = "1" 8 increment = "0x10000 > 8 9 9 10 *** This first section describes an instance of the "tsar_generic_iob" architecture … … 14 15 <cluster index = "0" > 15 16 <pseg name = "PSEG_RAM" type = "RAM" base = "0x0000000000" length = "0x0010000000" /> 16 <pseg name = "PSEG_X ICU"type = "PERI" base = "0x00B0000000" length = "0x0000002000" />17 <pseg name = "PSEG_XCU" type = "PERI" base = "0x00B0000000" length = "0x0000002000" /> 17 18 <pseg name = "PSEG_DMA" type = "PERI" base = "0x00B1000000" length = "0x0000008000" /> 18 19 <pseg name = "PSEG_MMC" type = "PERI" base = "0x00B2000000" length = "0x0000001000" /> … … 50 51 51 52 <periph type = "DMA" psegname = "PSEG_DMA" channels = "4" /> 52 <periph type = "X ICU" psegname = "PSEG_XICU"channels = "18" />53 <periph type = "XCU" psegname = "PSEG_XCU" channels = "18" /> 53 54 <periph type = "MMC" psegname = "PSEG_MMC" channels = "1" /> 54 55 <periph type = "IOC" psegname = "PSEG_IOC" channels = "1" /> … … 62 63 <cluster index = "1" > 63 64 <pseg name = "PSEG_RAM" type = "RAM" base = "0x4000000000" length = "0x0010000000" /> 64 <pseg name = "PSEG_X ICU"type = "PERI" base = "0x40B0000000" length = "0x0000002000" />65 <pseg name = "PSEG_XCU" type = "PERI" base = "0x40B0000000" length = "0x0000002000" /> 65 66 <pseg name = "PSEG_DMA" type = "PERI" base = "0x40B1000000" length = "0x0000008000" /> 66 67 <pseg name = "PSEG_MMC" type = "PERI" base = "0x40B2000000" length = "0x0000001000" /> … … 72 73 73 74 <periph type = "DMA" psegname = "PSEG_DMA" channels = "4" /> 74 <periph type = "X ICU" psegname = "PSEG_XICU"channels = "2" />75 <periph type = "XCU" psegname = "PSEG_XCU" channels = "2" /> 75 76 <periph type = "MMC" psegname = "PSEG_MMC" channels = "1" /> 76 77 </cluster> … … 78 79 <cluster index = "2" > 79 80 <pseg name = "PSEG_RAM" type = "RAM" base = "0x8000000000" length = "0x0010000000" /> 80 <pseg name = "PSEG_X ICU"type = "PERI" base = "0x80B0000000" length = "0x0000002000" />81 <pseg name = "PSEG_XCU" type = "PERI" base = "0x80B0000000" length = "0x0000002000" /> 81 82 <pseg name = "PSEG_DMA" type = "PERI" base = "0x80B1000000" length = "0x0000008000" /> 82 83 <pseg name = "PSEG_MMC" type = "PERI" base = "0x80B2000000" length = "0x0000001000" /> … … 88 89 89 90 <periph type = "DMA" psegname = "PSEG_DMA" channels = "4" /> 90 <periph type = "X ICU" psegname = "PSEG_XICU"channels = "2" />91 <periph type = "XCU" psegname = "PSEG_XCU" channels = "2" /> 91 92 <periph type = "MMC" psegname = "PSEG_MMC" channels = "1" /> 92 93 </cluster> … … 94 95 <cluster index = "3" > 95 96 <pseg name = "PSEG_RAM" type = "RAM" base = "0xC000000000" length = "0x0010000000" /> 96 <pseg name = "PSEG_X ICU"type = "PERI" base = "0xC0B0000000" length = "0x0000002000" />97 <pseg name = "PSEG_XCU" type = "PERI" base = "0xC0B0000000" length = "0x0000002000" /> 97 98 <pseg name = "PSEG_DMA" type = "PERI" base = "0xC0B1000000" length = "0x0000008000" /> 98 99 <pseg name = "PSEG_MMC" type = "PERI" base = "0xC0B2000000" length = "0x0000001000" /> … … 104 105 105 106 <periph type = "DMA" psegname = "PSEG_DMA" channels = "4" /> 106 <periph type = "X ICU" psegname = "PSEG_XICU"channels = "2" />107 <periph type = "XCU" psegname = "PSEG_XCU" channels = "2" /> 107 108 <periph type = "MMC" psegname = "PSEG_MMC" channels = "1" /> 108 109 </cluster> … … 163 164 </vseg> 164 165 165 *** segments for replicated ICUS / A[31:28] = 0xE / Increment = 0x10000 0166 167 <vseg name = "seg_icu_0" vbase = "0xE0000000" mode = "__W_" clusterid = "0" psegname = "PSEG_X ICU">166 *** segments for replicated ICUS / A[31:28] = 0xE / Increment = 0x10000 167 168 <vseg name = "seg_icu_0" vbase = "0xE0000000" mode = "__W_" clusterid = "0" psegname = "PSEG_XCU" > 168 169 <vobj name = "icu_0" type = "PERI" length = "0x00001000" /> 169 170 </vseg> 170 <vseg name = "seg_icu_1" vbase = "0xE0 100000" mode = "__W_" clusterid = "1" psegname = "PSEG_XICU">171 <vseg name = "seg_icu_1" vbase = "0xE0010000" mode = "__W_" clusterid = "1" psegname = "PSEG_XCU" > 171 172 <vobj name = "icu_1" type = "PERI" length = "0x00001000" /> 172 173 </vseg> 173 <vseg name = "seg_icu_2" vbase = "0xE0 200000" mode = "__W_" clusterid = "2" psegname = "PSEG_XICU">174 <vseg name = "seg_icu_2" vbase = "0xE0020000" mode = "__W_" clusterid = "2" psegname = "PSEG_XCU" > 174 175 <vobj name = "icu_2" type = "PERI" length = "0x00001000" /> 175 176 </vseg> 176 <vseg name = "seg_icu_3" vbase = "0xE0 300000" mode = "__W_" clusterid = "3" psegname = "PSEG_XICU">177 <vseg name = "seg_icu_3" vbase = "0xE0030000" mode = "__W_" clusterid = "3" psegname = "PSEG_XCU" > 177 178 <vobj name = "icu_3" type = "PERI" length = "0x00001000" /> 178 179 </vseg> 179 180 180 *** segments for replicated DMAs / A[31:28] = 0xD / Increment = 0x10000 0181 *** segments for replicated DMAs / A[31:28] = 0xD / Increment = 0x10000 181 182 182 183 <vseg name = "seg_dma_0" vbase = "0xD0000000" mode = "__W_" clusterid = "0" psegname = "PSEG_DMA" > 183 184 <vobj name = "dma_0" type = "PERI" length = "0x00008000" /> 184 185 </vseg> 185 <vseg name = "seg_dma_1" vbase = "0xD0 100000" mode = "__W_" clusterid = "1" psegname = "PSEG_DMA" >186 <vseg name = "seg_dma_1" vbase = "0xD0010000" mode = "__W_" clusterid = "1" psegname = "PSEG_DMA" > 186 187 <vobj name = "dma_1" type = "PERI" length = "0x00008000" /> 187 188 </vseg> 188 <vseg name = "seg_dma_2" vbase = "0xD0 200000" mode = "__W_" clusterid = "2" psegname = "PSEG_DMA" >189 <vseg name = "seg_dma_2" vbase = "0xD0020000" mode = "__W_" clusterid = "2" psegname = "PSEG_DMA" > 189 190 <vobj name = "dma_2" type = "PERI" length = "0x00008000" /> 190 191 </vseg> 191 <vseg name = "seg_dma_3" vbase = "0xD0 300000" mode = "__W_" clusterid = "3" psegname = "PSEG_DMA" >192 <vseg name = "seg_dma_3" vbase = "0xD0030000" mode = "__W_" clusterid = "3" psegname = "PSEG_DMA" > 192 193 <vobj name = "dma_3" type = "PERI" length = "0x00008000" /> 193 194 </vseg> 194 195 195 *** segments for replicated MMC / A[31:28] = 0xC / Increment = 0x10000 0196 *** segments for replicated MMC / A[31:28] = 0xC / Increment = 0x10000 196 197 197 198 <vseg name = "seg_memc_0" vbase = "0xC0000000" mode = "__W_" clusterid = "0" psegname = "PSEG_MMC" > 198 199 <vobj name = "memc_0" type = "PERI" length = "0x00001000" /> 199 200 </vseg> 200 <vseg name = "seg_memc_1" vbase = "0xC0 100000" mode = "__W_" clusterid = "1" psegname = "PSEG_MMC" >201 <vseg name = "seg_memc_1" vbase = "0xC0010000" mode = "__W_" clusterid = "1" psegname = "PSEG_MMC" > 201 202 <vobj name = "memc_1" type = "PERI" length = "0x00001000" /> 202 203 </vseg> 203 <vseg name = "seg_memc_2" vbase = "0xC0 200000" mode = "__W_" clusterid = "2" psegname = "PSEG_MMC" >204 <vseg name = "seg_memc_2" vbase = "0xC0020000" mode = "__W_" clusterid = "2" psegname = "PSEG_MMC" > 204 205 <vobj name = "memc_2" type = "PERI" length = "0x00001000" /> 205 206 </vseg> 206 <vseg name = "seg_memc_3" vbase = "0xC0 300000" mode = "__W_" clusterid = "3" psegname = "PSEG_MMC" >207 <vseg name = "seg_memc_3" vbase = "0xC0030000" mode = "__W_" clusterid = "3" psegname = "PSEG_MMC" > 207 208 <vobj name = "memc_3" type = "PERI" length = "0x00001000" /> 208 209 </vseg> 209 210 210 *** segments for replicated schedulers / A[31:28] = 0xF / Increment = 0x10000 0211 *** segments for replicated schedulers / A[31:28] = 0xF / Increment = 0x10000 211 212 212 213 <vseg name = "seg_sched_0" vbase = "0xF0000000" mode = "C_W_" clusterid = "0" psegname = "PSEG_RAM" > 213 214 <vobj name = "sched_0" type = "SCHED" length = "0x00008000" /> 214 215 </vseg> 215 <vseg name = "seg_sched_1" vbase = "0xF0 100000" mode = "C_W_" clusterid = "1" psegname = "PSEG_RAM" >216 <vseg name = "seg_sched_1" vbase = "0xF0010000" mode = "C_W_" clusterid = "1" psegname = "PSEG_RAM" > 216 217 <vobj name = "sched_1" type = "SCHED" length = "0x00008000" /> 217 218 </vseg> 218 <vseg name = "seg_sched_2" vbase = "0xF0 200000" mode = "C_W_" clusterid = "2" psegname = "PSEG_RAM" >219 <vseg name = "seg_sched_2" vbase = "0xF0020000" mode = "C_W_" clusterid = "2" psegname = "PSEG_RAM" > 219 220 <vobj name = "sched_2" type = "SCHED" length = "0x00008000" /> 220 221 </vseg> 221 <vseg name = "seg_sched_3" vbase = "0xF0 300000" mode = "C_W_" clusterid = "3" psegname = "PSEG_RAM" >222 <vseg name = "seg_sched_3" vbase = "0xF0030000" mode = "C_W_" clusterid = "3" psegname = "PSEG_RAM" > 222 223 <vobj name = "sched_3" type = "SCHED" length = "0x00008000" /> 223 224 </vseg> -
soft/giet_vm/mappings/4c_1p_iob.xml
r252 r253 5 5 cluster_x = "2" 6 6 cluster_y = "2" 7 vspaces = "4"> 7 vspaces = "4" 8 increment = "0x10000" > 8 9 9 10 *** This first section describes an instance of the "tsar_generic_iob" architecture … … 14 15 <cluster index = "0" > 15 16 <pseg name = "PSEG_RAM" type = "RAM" base = "0x0000000000" length = "0x0010000000" /> 16 <pseg name = "PSEG_X ICU"type = "PERI" base = "0x00B0000000" length = "0x0000002000" />17 <pseg name = "PSEG_XCU" type = "PERI" base = "0x00B0000000" length = "0x0000002000" /> 17 18 <pseg name = "PSEG_DMA" type = "PERI" base = "0x00B1000000" length = "0x0000008000" /> 18 19 <pseg name = "PSEG_MMC" type = "PERI" base = "0x00B2000000" length = "0x0000001000" /> … … 50 51 51 52 <periph type = "DMA" psegname = "PSEG_DMA" channels = "4" /> 52 <periph type = "X ICU" psegname = "PSEG_XICU"channels = "18" />53 <periph type = "XCU" psegname = "PSEG_XCU" channels = "18" /> 53 54 <periph type = "MMC" psegname = "PSEG_MMC" channels = "1" /> 54 55 <periph type = "IOC" psegname = "PSEG_IOC" channels = "1" /> … … 63 64 <cluster index = "1" > 64 65 <pseg name = "PSEG_RAM" type = "RAM" base = "0x4000000000" length = "0x0010000000" /> 65 <pseg name = "PSEG_X ICU"type = "PERI" base = "0x40B0000000" length = "0x0000002000" />66 <pseg name = "PSEG_XCU" type = "PERI" base = "0x40B0000000" length = "0x0000002000" /> 66 67 <pseg name = "PSEG_DMA" type = "PERI" base = "0x40B1000000" length = "0x0000008000" /> 67 68 <pseg name = "PSEG_MMC" type = "PERI" base = "0x40B2000000" length = "0x0000001000" /> … … 73 74 74 75 <periph type = "DMA" psegname = "PSEG_DMA" channels = "4" /> 75 <periph type = "X ICU" psegname = "PSEG_XICU"channels = "2" />76 <periph type = "XCU" psegname = "PSEG_XCU" channels = "2" /> 76 77 <periph type = "MMC" psegname = "PSEG_MMC" channels = "1" /> 77 78 </cluster> … … 79 80 <cluster index = "2" > 80 81 <pseg name = "PSEG_RAM" type = "RAM" base = "0x8000000000" length = "0x0010000000" /> 81 <pseg name = "PSEG_X ICU"type = "PERI" base = "0x80B0000000" length = "0x0000002000" />82 <pseg name = "PSEG_XCU" type = "PERI" base = "0x80B0000000" length = "0x0000002000" /> 82 83 <pseg name = "PSEG_DMA" type = "PERI" base = "0x80B1000000" length = "0x0000008000" /> 83 84 <pseg name = "PSEG_MMC" type = "PERI" base = "0x80B2000000" length = "0x0000001000" /> … … 89 90 90 91 <periph type = "DMA" psegname = "PSEG_DMA" channels = "4" /> 91 <periph type = "X ICU" psegname = "PSEG_XICU"channels = "2" />92 <periph type = "XCU" psegname = "PSEG_XCU" channels = "2" /> 92 93 <periph type = "MMC" psegname = "PSEG_MMC" channels = "1" /> 93 94 </cluster> … … 95 96 <cluster index = "3" > 96 97 <pseg name = "PSEG_RAM" type = "RAM" base = "0xC000000000" length = "0x0010000000" /> 97 <pseg name = "PSEG_X ICU"type = "PERI" base = "0xC0B0000000" length = "0x0000002000" />98 <pseg name = "PSEG_XCU" type = "PERI" base = "0xC0B0000000" length = "0x0000002000" /> 98 99 <pseg name = "PSEG_DMA" type = "PERI" base = "0xC0B1000000" length = "0x0000008000" /> 99 100 <pseg name = "PSEG_MMC" type = "PERI" base = "0xC0B2000000" length = "0x0000001000" /> … … 105 106 106 107 <periph type = "DMA" psegname = "PSEG_DMA" channels = "4" /> 107 <periph type = "X ICU" psegname = "PSEG_XICU"channels = "2" />108 <periph type = "XCU" psegname = "PSEG_XCU" channels = "2" /> 108 109 <periph type = "MMC" psegname = "PSEG_MMC" channels = "1" /> 109 110 </cluster> … … 163 164 </vseg> 164 165 165 *** segments for replicated ICUS / A[31:28] = 0xE / Increment = 0x10000 0166 167 <vseg name = "seg_icu_0" vbase = "0xE0000000" mode = "__W_" clusterid = "0" psegname = "PSEG_X ICU">166 *** segments for replicated ICUS / A[31:28] = 0xE / Increment = 0x10000 167 168 <vseg name = "seg_icu_0" vbase = "0xE0000000" mode = "__W_" clusterid = "0" psegname = "PSEG_XCU" > 168 169 <vobj name = "icu_0" type = "PERI" length = "0x00001000" /> 169 170 </vseg> 170 <vseg name = "seg_icu_1" vbase = "0xE0 100000" mode = "__W_" clusterid = "1" psegname = "PSEG_XICU">171 <vseg name = "seg_icu_1" vbase = "0xE0010000" mode = "__W_" clusterid = "1" psegname = "PSEG_XCU" > 171 172 <vobj name = "icu_1" type = "PERI" length = "0x00001000" /> 172 173 </vseg> 173 <vseg name = "seg_icu_2" vbase = "0xE0 200000" mode = "__W_" clusterid = "2" psegname = "PSEG_XICU">174 <vseg name = "seg_icu_2" vbase = "0xE0020000" mode = "__W_" clusterid = "2" psegname = "PSEG_XCU" > 174 175 <vobj name = "icu_2" type = "PERI" length = "0x00001000" /> 175 176 </vseg> 176 <vseg name = "seg_icu_3" vbase = "0xE0 300000" mode = "__W_" clusterid = "3" psegname = "PSEG_XICU">177 <vseg name = "seg_icu_3" vbase = "0xE0030000" mode = "__W_" clusterid = "3" psegname = "PSEG_XCU" > 177 178 <vobj name = "icu_3" type = "PERI" length = "0x00001000" /> 178 179 </vseg> 179 180 180 *** segments for replicated DMAs / A[31:28] = 0xD / Increment = 0x10000 0181 *** segments for replicated DMAs / A[31:28] = 0xD / Increment = 0x10000 181 182 182 183 <vseg name = "seg_dma_0" vbase = "0xD0000000" mode = "__W_" clusterid = "0" psegname = "PSEG_DMA" > 183 184 <vobj name = "dma_0" type = "PERI" length = "0x00008000" /> 184 185 </vseg> 185 <vseg name = "seg_dma_1" vbase = "0xD0 100000" mode = "__W_" clusterid = "1" psegname = "PSEG_DMA" >186 <vseg name = "seg_dma_1" vbase = "0xD0010000" mode = "__W_" clusterid = "1" psegname = "PSEG_DMA" > 186 187 <vobj name = "dma_1" type = "PERI" length = "0x00008000" /> 187 188 </vseg> 188 <vseg name = "seg_dma_2" vbase = "0xD0 200000" mode = "__W_" clusterid = "2" psegname = "PSEG_DMA" >189 <vseg name = "seg_dma_2" vbase = "0xD0020000" mode = "__W_" clusterid = "2" psegname = "PSEG_DMA" > 189 190 <vobj name = "dma_2" type = "PERI" length = "0x00008000" /> 190 191 </vseg> 191 <vseg name = "seg_dma_3" vbase = "0xD0 300000" mode = "__W_" clusterid = "3" psegname = "PSEG_DMA" >192 <vseg name = "seg_dma_3" vbase = "0xD0030000" mode = "__W_" clusterid = "3" psegname = "PSEG_DMA" > 192 193 <vobj name = "dma_3" type = "PERI" length = "0x00008000" /> 193 194 </vseg> 194 195 195 *** segments for replicated MMC / A[31:28] = 0xC / Increment = 0x10000 0196 *** segments for replicated MMC / A[31:28] = 0xC / Increment = 0x10000 196 197 197 198 <vseg name = "seg_memc_0" vbase = "0xC0000000" mode = "__W_" clusterid = "0" psegname = "PSEG_MMC" > 198 199 <vobj name = "memc_0" type = "PERI" length = "0x00001000" /> 199 200 </vseg> 200 <vseg name = "seg_memc_1" vbase = "0xC0 100000" mode = "__W_" clusterid = "1" psegname = "PSEG_MMC" >201 <vseg name = "seg_memc_1" vbase = "0xC0010000" mode = "__W_" clusterid = "1" psegname = "PSEG_MMC" > 201 202 <vobj name = "memc_1" type = "PERI" length = "0x00001000" /> 202 203 </vseg> 203 <vseg name = "seg_memc_2" vbase = "0xC0 200000" mode = "__W_" clusterid = "2" psegname = "PSEG_MMC" >204 <vseg name = "seg_memc_2" vbase = "0xC0020000" mode = "__W_" clusterid = "2" psegname = "PSEG_MMC" > 204 205 <vobj name = "memc_2" type = "PERI" length = "0x00001000" /> 205 206 </vseg> 206 <vseg name = "seg_memc_3" vbase = "0xC0 300000" mode = "__W_" clusterid = "3" psegname = "PSEG_MMC" >207 <vseg name = "seg_memc_3" vbase = "0xC0030000" mode = "__W_" clusterid = "3" psegname = "PSEG_MMC" > 207 208 <vobj name = "memc_3" type = "PERI" length = "0x00001000" /> 208 209 </vseg> 209 210 210 *** segments for replicated schedulers / A[31:28] = 0xF / Increment = 0x10000 0211 *** segments for replicated schedulers / A[31:28] = 0xF / Increment = 0x10000 211 212 212 213 <vseg name = "seg_sched_0" vbase = "0xF0000000" mode = "C_W_" clusterid = "0" psegname = "PSEG_RAM" > 213 214 <vobj name = "sched_0" type = "SCHED" length = "0x00008000" /> 214 215 </vseg> 215 <vseg name = "seg_sched_1" vbase = "0xF0 100000" mode = "C_W_" clusterid = "1" psegname = "PSEG_RAM" >216 <vseg name = "seg_sched_1" vbase = "0xF0010000" mode = "C_W_" clusterid = "1" psegname = "PSEG_RAM" > 216 217 <vobj name = "sched_1" type = "SCHED" length = "0x00008000" /> 217 218 </vseg> 218 <vseg name = "seg_sched_2" vbase = "0xF0 200000" mode = "C_W_" clusterid = "2" psegname = "PSEG_RAM" >219 <vseg name = "seg_sched_2" vbase = "0xF0020000" mode = "C_W_" clusterid = "2" psegname = "PSEG_RAM" > 219 220 <vobj name = "sched_2" type = "SCHED" length = "0x00008000" /> 220 221 </vseg> 221 <vseg name = "seg_sched_3" vbase = "0xF0 300000" mode = "C_W_" clusterid = "3" psegname = "PSEG_RAM" >222 <vseg name = "seg_sched_3" vbase = "0xF0030000" mode = "C_W_" clusterid = "3" psegname = "PSEG_RAM" > 222 223 <vobj name = "sched_3" type = "SCHED" length = "0x00008000" /> 223 224 </vseg> … … 314 315 </vseg> 315 316 316 <task name = "main_display" clusterid = "3" proclocid = "0" stackname = "stack" heapname = "heap" startid = "0" usetty = "1" use dma = "1" />317 <task name = "main_display" clusterid = "3" proclocid = "0" stackname = "stack" heapname = "heap" startid = "0" usetty = "1" usecma = "1" /> 317 318 </vspace> 318 319 </vspaceset> -
soft/giet_vm/sys/common.h
r249 r253 22 22 extern _ld_symbol_t seg_nic_base; 23 23 extern _ld_symbol_t seg_icu_base; 24 extern _ld_symbol_t seg_xcu_base; 24 25 extern _ld_symbol_t seg_tim_base; 25 26 extern _ld_symbol_t seg_tty_base; … … 29 30 extern _ld_symbol_t seg_ioc_base; 30 31 extern _ld_symbol_t seg_mmc_base; 32 extern _ld_symbol_t seg_cma_base; 33 34 extern _ld_symbol_t vseg_cluster_increment; 31 35 32 36 extern _ld_symbol_t seg_mapping_base; -
soft/giet_vm/sys/drivers.c
r249 r253 5 5 // Copyright (c) UPMC-LIP6 6 6 /////////////////////////////////////////////////////////////////////////////////// 7 // The drivers.c and drivers.h files are part ot the GIET-VM nano kernel. 7 // The drivers.c and drivers.h files are part ot the GIET-VM kernel. 8 // 8 9 // They contains the drivers for the peripherals available in the SoCLib library: 9 10 // - vci_multi_tty … … 11 12 // - vci_multi_dma 12 13 // - vci_multi_icu 13 // - vci_xicu & vci_multi_icu14 // - vci_xicu 14 15 // - vci_gcd 15 16 // - vci_frame_buffer 16 17 // - vci_block_device 17 // 18 // For the peripherals replicated in each cluster (ICU, TIMER, DMA), 18 // - vci_multi_nic 19 // - vci_chbuf_dma 20 // 21 // For the peripherals replicated in each cluster (ICU, TIMER, XCU, DMA, MMC), 19 22 // the corresponding (virtual) base addresses must be completed by an offset 20 23 // depending on the cluster index. 21 //22 // The following global parameter must be defined in the giet_config.h file:23 // - GIET_CLUSTER_INCREMENT24 24 // 25 25 // The following global parameters must be defined in the hard_config.h file: … … 32 32 // The following virtual base addresses must be defined in the giet_vsegs.ld file: 33 33 // - seg_icu_base 34 // - seg_xcu_base 34 35 // - seg_tim_base 35 36 // - seg_dma_base … … 42 43 // - seg_iob_base 43 44 // - seg_mmc_base 44 // 45 // - vseg_cluster_increment 45 46 /////////////////////////////////////////////////////////////////////////////////// 46 47 … … 68 69 #if (NB_PROCS_MAX > 8) 69 70 # error: NB_PROCS_MAX cannot be larger than 8! 70 #endif71 72 #if !defined(GIET_CLUSTER_INCREMENT)73 # error: You must define GIET_CLUSTER_INCREMENT in the giet_config.h file74 71 #endif 75 72 … … 153 150 // The (virtual) base address of the associated segment is: 154 151 // 155 // timer_address = seg_icu_base + cluster_id * GIET_CLUSTER_INCREMENT 156 // 157 // - cluster id is an explicit argument of all access functions 158 // - seg_icu_base must be defined in the giet_vsegs.ld file 159 // - GIET_CLUSTER_INCREMENT must be defined in the giet_config.h file 152 // timer_address = seg_tim_base + cluster_id * vseg_cluster_increment 153 // or timer_address = seg_xcu_base + cluster_id * vseg_cluster_increment 154 // 160 155 //////////////////////////////////////////////////////////////////////////////// 161 156 … … 184 179 185 180 #if USE_XICU 186 unsigned int * timer_address = (unsigned int *) ((char *) &seg_icu_base +187 (cluster_id * GIET_CLUSTER_INCREMENT));181 unsigned int* timer_address = (unsigned int *) ((unsigned int)&seg_xcu_base + 182 (cluster_id * (unsigned int)&vseg_cluster_increment)); 188 183 189 184 timer_address[XICU_REG(XICU_PTI_PER, local_id)] = period; 190 185 #else 191 unsigned int* timer_address = (unsigned int *) (( char *)&seg_tim_base +192 (cluster_id * GIET_CLUSTER_INCREMENT));186 unsigned int* timer_address = (unsigned int *) ((unsigned int)&seg_tim_base + 187 (cluster_id * (unsigned int)&vseg_cluster_increment)); 193 188 194 189 timer_address[local_id * TIMER_SPAN + TIMER_PERIOD] = period; … … 212 207 213 208 #if USE_XICU 214 unsigned int * timer_address = (unsigned int *) (( char *) &seg_icu_base +215 (cluster_id * GIET_CLUSTER_INCREMENT));209 unsigned int * timer_address = (unsigned int *) ((unsigned int)&seg_xcu_base + 210 (cluster_id * (unsigned int)&vseg_cluster_increment)); 216 211 217 212 timer_address[XICU_REG(XICU_PTI_PER, local_id)] = 0; 218 213 #else 219 unsigned int* timer_address = (unsigned int *) (( char *)&seg_tim_base +220 (cluster_id * GIET_CLUSTER_INCREMENT));214 unsigned int* timer_address = (unsigned int *) ((unsigned int)&seg_tim_base + 215 (cluster_id * (unsigned int)&vseg_cluster_increment)); 221 216 222 217 timer_address[local_id * TIMER_SPAN + TIMER_MODE] = 0; … … 224 219 return 0; 225 220 } 226 227 221 228 222 ////////////////////////////////////////////////////////////////////////////// … … 242 236 243 237 #if USE_XICU 244 unsigned int * timer_address = (unsigned int *) (( char *) &seg_icu_base +245 (cluster_id * GIET_CLUSTER_INCREMENT));238 unsigned int * timer_address = (unsigned int *) ((unsigned int)&seg_xcu_base + 239 (cluster_id * (unsigned int)&vseg_cluster_increment)); 246 240 247 241 unsigned int bloup = timer_address[XICU_REG(XICU_PTI_ACK, local_id)]; 248 242 bloup++; // to avoid a warning 249 243 #else 250 unsigned int * timer_address = (unsigned int *) (( char *)&seg_tim_base +251 (cluster_id * GIET_CLUSTER_INCREMENT));244 unsigned int * timer_address = (unsigned int *) ((unsigned int)&seg_tim_base + 245 (cluster_id * (unsigned int)&vseg_cluster_increment)); 252 246 253 247 timer_address[local_id * TIMER_SPAN + TIMER_RESETIRQ] = 0; … … 255 249 return 0; 256 250 } 257 258 259 251 260 252 /////////////////////////////////////////////////////////////////////// … … 263 255 // This function resets the period at the end of which 264 256 // an interrupt is sent. To do so, we re-write the period 265 // in ithe proper register, what causes the count to restart.257 // in the proper register, what causes the count to restart. 266 258 // The period value is read from the same (TIMER_PERIOD) register, 267 259 // this is why in appearance we do nothing useful (read a value … … 269 261 // This function is called during a context switch (user or preemptive) 270 262 /////////////////////////////////////////////////////////////////////// 271 unsigned int _timer_reset_irq_cpt(unsigned int cluster_id, unsigned int local_id) { 263 unsigned int _timer_reset_irq_cpt( unsigned int cluster_id, 264 unsigned int local_id) { 272 265 // parameters checking 273 266 if (cluster_id >= NB_CLUSTERS) { … … 279 272 280 273 #if USE_XICU 281 unsigned int * timer_address = (unsigned int *) ((char *) &seg_icu_base + (cluster_id * GIET_CLUSTER_INCREMENT)); 274 unsigned int * timer_address = (unsigned int *) ((unsigned int) &seg_xcu_base + 275 (cluster_id * (unsigned int)&vseg_cluster_increment)); 276 282 277 unsigned int timer_period = timer_address[XICU_REG(XICU_PTI_PER, local_id)]; 283 278 284 // we write 0 first because if the timer is currently running, the corresponding timer counter is not reset 279 // we write 0 first because if the timer is currently running, 280 //the corresponding timer counter is not reset 285 281 timer_address[XICU_REG(XICU_PTI_PER, local_id)] = 0; 286 282 timer_address[XICU_REG(XICU_PTI_PER, local_id)] = timer_period; 287 283 #else 288 284 // We suppose that the TIMER_MODE register value is 0x3 289 unsigned int * timer_address = (unsigned int *) ((char *) &seg_tim_base + (cluster_id * GIET_CLUSTER_INCREMENT)); 285 unsigned int * timer_address = (unsigned int *) ((unsigned int)&seg_tim_base + 286 (cluster_id * (unsigned int)&vseg_cluster_increment)); 287 290 288 unsigned int timer_period = timer_address[local_id * TIMER_SPAN + TIMER_PERIOD]; 291 289 … … 295 293 return 0; 296 294 } 297 298 295 299 296 ///////////////////////////////////////////////////////////////////////////////// … … 412 409 // This hardware component is replicated in all clusters. 413 410 // There is one vci_multi_icu (or vci_xicu) component per cluster, 414 // and the number of independant ICUs is equal to NB_PROCS_MAX,411 // and the number of ICU channels is equal to NB_PROCS_MAX, 415 412 // because there is one private interrupt controler per processor. 416 413 //////////////////////////////////////////////////////////////////////////////// 417 414 // The (virtual) base address of the associated segment is: 418 415 // 419 // icu_address = seg_icu_base + cluster_id * GIET_CLUSTER_INCREMENT 420 // 421 // - cluster id is an explicit argument of all access functions 422 // - seg_icu_base must be defined in the giet_vsegs.ld file 423 // - GIET_CLUSTER_INCREMENT must be defined in the giet_config.h file 416 // icu_address = seg_icu_base + cluster_id * vseg_cluster_increment 417 // or icu_address = seg_xcu_base + cluster_id * vseg_cluster_increment 418 // 424 419 //////////////////////////////////////////////////////////////////////////////// 425 420 … … 434 429 unsigned int proc_id, 435 430 unsigned int value, 436 unsigned int is_ timer)431 unsigned int is_PTI) 437 432 { 438 433 // parameters checking … … 440 435 if (proc_id >= NB_PROCS_MAX) return 1; 441 436 442 unsigned int * icu_address = (unsigned int *) ((char *) &seg_icu_base +443 (cluster_id * GIET_CLUSTER_INCREMENT));444 437 #if USE_XICU 445 if (is_timer) 438 unsigned int * icu_address = (unsigned int *) ((unsigned int)&seg_xcu_base + 439 (cluster_id * (unsigned int)&vseg_cluster_increment)); 440 if (is_PTI) 446 441 { 447 442 icu_address[XICU_REG(XICU_MSK_PTI_ENABLE, proc_id)] = value; … … 452 447 } 453 448 #else 449 unsigned int * icu_address = (unsigned int *) ((unsigned int)&seg_icu_base + 450 (cluster_id * (unsigned int)&vseg_cluster_increment)); 451 454 452 icu_address[proc_id * ICU_SPAN + ICU_MASK_SET] = value; 455 453 #endif 456 454 return 0; 457 455 } 458 459 456 460 457 //////////////////////////////////////////////////////////////////////////////// … … 473 470 if (proc_id >= NB_PROCS_MAX) return 1; 474 471 475 unsigned int * icu_address = (unsigned int *) ((char *) &seg_icu_base +476 (cluster_id * GIET_CLUSTER_INCREMENT));477 472 #if USE_XICU 473 unsigned int * icu_address = (unsigned int *) ((unsigned int)&seg_xcu_base + 474 (cluster_id * (unsigned int)&vseg_cluster_increment)); 475 478 476 unsigned int prio = icu_address[XICU_REG(XICU_PRIO, proc_id)]; 479 477 unsigned int pti_ok = (prio & 0x00000001); … … 488 486 else { *buffer = 32; } 489 487 #else 488 unsigned int * icu_address = (unsigned int *) ((unsigned int)&seg_icu_base + 489 (cluster_id * (unsigned int)&vseg_cluster_increment)); 490 490 491 *buffer = icu_address[proc_id * ICU_SPAN + ICU_IT_VECTOR]; 491 492 #endif 492 493 return 0; 493 494 } 494 495 495 496 496 //////////////////////////////////////////////////////////////////////////////// … … 912 912 // The (virtual) base address of the associated segment is: 913 913 // 914 // dma_address = seg_dma_base + cluster_id * GIET_CLUSTER_INCREMENT 915 // 916 // - seg_dma_base must be defined in the giet_vsegs.ld file 917 // - GIET_CLUSTER_INCREMENT must be defined in the giet_config.h file 914 // dma_address = seg_dma_base + cluster_id * vseg_cluster_increment 915 // 918 916 //////////////////////////////////////////////////////////////////////////////// 919 917 … … 942 940 943 941 // compute DMA base address 944 unsigned int * dma_address = (unsigned int *) (( char *)&seg_dma_base +945 (cluster_id * GIET_CLUSTER_INCREMENT));942 unsigned int * dma_address = (unsigned int *) ((unsigned int)&seg_dma_base + 943 (cluster_id * (unsigned int)&vseg_cluster_increment)); 946 944 947 945 dma_address[channel_id * DMA_SPAN + DMA_RESET] = 0; … … 951 949 #endif 952 950 } 953 954 951 955 952 ////////////////////////////////////////////////////////////////////////////////// … … 966 963 967 964 // compute DMA base address 968 unsigned int * dma_address = (unsigned int *) (( char *)&seg_dma_base +969 (cluster_id * GIET_CLUSTER_INCREMENT));965 unsigned int * dma_address = (unsigned int *) ((unsigned int)&seg_dma_base + 966 (cluster_id * (unsigned int)&vseg_cluster_increment)); 970 967 971 968 *status = dma_address[channel_id * DMA_SPAN + DMA_LEN]; … … 975 972 #endif 976 973 } 977 978 974 979 975 ////////////////////////////////////////////////////////////////////////////////// … … 1031 1027 unsigned int cluster_id = dma_id / NB_DMA_CHANNELS; 1032 1028 unsigned int channel_id = dma_id % NB_DMA_CHANNELS; 1033 unsigned int * dma_vbase = (unsigned int *) ((char *)&seg_dma_base +1034 (cluster_id * GIET_CLUSTER_INCREMENT));1029 unsigned int * dma_vbase = (unsigned int *) ((unsigned int)&seg_dma_base + 1030 (cluster_id * (unsigned int)&vseg_cluster_increment)); 1035 1031 // get page table address 1036 1032 unsigned int user_ptab = _get_context_slot(CTX_PTAB_ID); … … 1196 1192 } // end _dma_transfer() 1197 1193 1198 1199 1194 ////////////////////////////////////////////////////////////////////////////////// 1200 1195 // _dma_completed() … … 1257 1252 // VciFrameBuffer driver 1258 1253 ////////////////////////////////////////////////////////////////////////////////// 1259 // The vci_frame_buffer device can be accessed directly by software with memcpy(), 1260 // or it can be accessed through a multi-channels DMA component: 1254 // There three methods to access the VciFrameBuffer device: 1261 1255 // 1262 // The '_fb_sync_write' and '_fb_sync_read' functions use a memcpy strategy to1263 // implement the transfer between a data buffer (user space) and the frame1256 // 1) The _fb_sync_write() and _fb_sync_read() functions use a memcpy strategy 1257 // to implement the transfer between a data buffer (user space) and the frame 1264 1258 // buffer (kernel space). They are blocking until completion of the transfer. 1265 1259 // 1266 // The '_fb_write()', '_fb_read()' and '_fb_completed()' functions use the 1267 // VciMultiDma components (distributed in the clusters) to transfer data 1268 // between the user buffer and the frame buffer. A DMA channel is 1269 // allocated to each task requesting it in the mapping_info data structure. 1260 // 2) The _fb_dma_write(), _fb_dma_read() and _fb_mdma_completed() functions use 1261 // the VciMultiDma components (distributed in the clusters) to transfer data 1262 // between the user buffer and the frame buffer. 1263 // A DMA channel is allocated to the task requesting it in the mapping_info, 1264 // and stored in the task context. 1265 // 1266 // 3) The _fb_cma_init(), _fb_cma_write() and _fb_cma_stop() functions use 1267 // the VciChbufDma component (non replicated) to transfer a flow of images from 1268 // an user space chained buffer (two buffers) to the frame buffer. 1269 // A CMA channel is allocated to the task requesting it in the mapping_info, 1270 // and stored in the task context. 1270 1271 ////////////////////////////////////////////////////////////////////////////////// 1271 1272 … … 1306 1307 1307 1308 ////////////////////////////////////////////////////////////////////////////////// 1308 // _fb_ write()1309 // _fb_dma_write() 1309 1310 // Transfer data from a memory buffer to the frame_buffer device using DMA. 1310 1311 // - offset : offset (in bytes) in the frame buffer. … … 1313 1314 // Returns 0 if success, > 0 if error. 1314 1315 ////////////////////////////////////////////////////////////////////////////////// 1315 unsigned int _fb_ write( unsigned int offset,1316 const void* buffer,1317 unsigned int length)1316 unsigned int _fb_dma_write( unsigned int offset, 1317 const void* buffer, 1318 unsigned int length) 1318 1319 { 1319 1320 return _dma_transfer( 0, // frame buffer … … 1323 1324 length ); 1324 1325 } 1325 1326 1327 ////////////////////////////////////////////////////////////////////////////////// 1328 // _fb_read() 1326 ////////////////////////////////////////////////////////////////////////////////// 1327 // _fb_dma_read() 1329 1328 // Transfer data from the frame_buffer device to a memory buffer using DMA. 1330 1329 // - offset : offset (in bytes) in the frame buffer. 1331 // - buffer : base address of the memorybuffer.1332 // - length : number of bytes to be transfered.1330 // - buffer : virtual base address of the user buffer. 1331 // - length : buffer size (number of bytes) 1333 1332 // Returns 0 if success, > 0 if error. 1334 1333 ////////////////////////////////////////////////////////////////////////////////// 1335 unsigned int _fb_ read( unsigned int offset,1336 const void* buffer,1337 unsigned int length )1334 unsigned int _fb_dma_read( unsigned int offset, 1335 const void* buffer, 1336 unsigned int length ) 1338 1337 { 1339 1338 return _dma_transfer( 0, // frame buffer … … 1343 1342 length ); 1344 1343 } 1345 1346 1347 1344 ////////////////////////////////////////////////////////////////////////////////// 1348 1345 // _fb_completed() … … 1352 1349 // (1 == read error / 2 == DMA idle error / 3 == write error) 1353 1350 ////////////////////////////////////////////////////////////////////////////////// 1354 unsigned int _fb_ completed()1351 unsigned int _fb_dma_completed() 1355 1352 { 1356 1353 return _dma_completed(); 1357 1354 } 1358 1355 1356 // This structure contains two chbuf descriptors that can be used by 1357 // the VciChbufDma component to tranfer a flow of images: 1358 // - The SRC chbuf descriptor contain two slots (two user buffers) 1359 // - The DST chbuf descriptor contains only one slot (frame buffer) 1360 typedef struct fb_cma_channel_s 1361 { 1362 paddr_t buf0; // physical address + status for user buffer 0 1363 paddr_t buf1; // physical address + status for user buffer 1 1364 paddr_t fbf; // physical address + status for frame buffer 1365 } fb_cma_channel_t; 1366 1367 in_unckdata volatile fb_cma_channel_t _fb_cma_channel[NB_CMA_CHANNELS]; 1368 1369 ////////////////////////////////////////////////////////////////////////////////// 1370 // _fb_cma_init() 1371 // This function does two things: 1372 // 1) Initialises the SRC chbuf descriptor (two buffers), and the DST 1373 // chbuf descriptor (one single frame buffer), after translating 1374 // virtual addresses to physical addresses, and checking access rights. 1375 // 2) Starts the CMA hardware channel, that will permanently try to display 1376 // images as soon as the SRC buffers are filled. 1377 // Arguments are: 1378 // - vbase0 : virtual base address of the first user buffer. 1379 // - vbase1 : virtual base address of the second user buffer. 1380 // - length : user buffer size (number of bytes) 1381 // Returns 0 if success, > 0 if error 1382 ////////////////////////////////////////////////////////////////////////////////// 1383 unsigned int _fb_cma_init( const void* vbase0, 1384 const void* vbase1, 1385 unsigned int length ) 1386 { 1387 #if NB_CMA_CHANNELS > 0 1388 1389 unsigned int channel_id; // CMA channel index 1390 unsigned int user_ptab; // page table virtual address 1391 unsigned int ko; // unsuccessfull V2P translation 1392 unsigned int vpn; // virtual page number 1393 unsigned int flags; // protection flags 1394 unsigned int ppn; // physical page number 1395 paddr_t src_chbuf_pbase; // physical address for SRC chbuf descriptor 1396 paddr_t dst_chbuf_pbase; // physical address for SRC chbuf descriptor 1397 1398 // get CMA channel index 1399 channel_id = _get_context_slot(CTX_CMA_ID); 1400 if ( channel_id >= NB_CMA_CHANNELS ) 1401 { 1402 _get_lock(&_tty_put_lock); 1403 _puts("\n[GIET ERROR] in _fb_cma_init() : CMA channel index too large\n"); 1404 _release_lock(&_tty_put_lock); 1405 return 1; 1406 } 1407 1408 // check user buffer virtual addresses and length alignment 1409 if ( ((unsigned int)vbase0 & 0x3) || ((unsigned int)vbase1 & 0x3) || (length & 0x3) ) 1410 { 1411 _get_lock(&_tty_put_lock); 1412 _puts("\n[GIET ERROR] in _fb_cma_init() : user buffer not word aligned\n"); 1413 _release_lock(&_tty_put_lock); 1414 return 1; 1415 } 1416 1417 // get page table virtual address 1418 user_ptab = _get_context_slot(CTX_PTAB_ID); 1419 1420 // get frame buffer virtual address 1421 1422 // compute and register frame buffer physical address 1423 vpn = ((unsigned int)&seg_fbf_base) >> 12; 1424 ko = _v2p_translate( (page_table_t*) user_ptab, 1425 vpn, 1426 &ppn, 1427 &flags ); 1428 if (ko) 1429 { 1430 _get_lock(&_tty_put_lock); 1431 _puts("\n[GIET ERROR] in _fb_cma_init() : frame buffer unmapped\n"); 1432 _release_lock(&_tty_put_lock); 1433 return 1; 1434 } 1435 _fb_cma_channel[channel_id].fbf = ((paddr_t)ppn << 12) | (vpn & 0x00000FFF); 1436 1437 // Compute and register first user buffer physical address 1438 vpn = (unsigned int)vbase0 >> 12; 1439 ko = _v2p_translate( (page_table_t*) user_ptab, 1440 vpn, 1441 &ppn, 1442 &flags ); 1443 if (ko) 1444 { 1445 _get_lock(&_tty_put_lock); 1446 _puts("\n[GIET ERROR] in _fb_cma_init() : user buffer 0 unmapped\n"); 1447 _release_lock(&_tty_put_lock); 1448 return 1; 1449 } 1450 if ((flags & PTE_U) == 0) 1451 { 1452 _get_lock(&_tty_put_lock); 1453 _puts("[GIET ERROR] in _fb_cma_init() : user buffer 0 not in user space\n"); 1454 _release_lock(&_tty_put_lock); 1455 return 1; 1456 } 1457 _fb_cma_channel[channel_id].buf0 = ((paddr_t)ppn << 12) | (vpn & 0x00000FFF); 1458 1459 // Compute and register second user buffer physical address 1460 vpn = (unsigned int)vbase1 >> 12; 1461 ko = _v2p_translate( (page_table_t*) user_ptab, 1462 vpn, 1463 &ppn, 1464 &flags ); 1465 if (ko) 1466 { 1467 _get_lock(&_tty_put_lock); 1468 _puts("\n[GIET ERROR] in _fb_cma_init() : user buffer 1 unmapped\n"); 1469 _release_lock(&_tty_put_lock); 1470 return 1; 1471 } 1472 if ((flags & PTE_U) == 0) 1473 { 1474 _get_lock(&_tty_put_lock); 1475 _puts("[GIET ERROR] in _fb_cma_init() : user buffer 1 not in user space\n"); 1476 _release_lock(&_tty_put_lock); 1477 return 1; 1478 } 1479 _fb_cma_channel[channel_id].buf1 = ((paddr_t)ppn << 12) | (vpn & 0x00000FFF); 1480 1481 // Compute physical adress of the SRC chbuf descriptor 1482 vpn = ((unsigned int)(&_fb_cma_channel[channel_id].buf0)) >> 12; 1483 ko = _v2p_translate( (page_table_t*) user_ptab, 1484 vpn, 1485 &ppn, 1486 &flags ); 1487 if (ko) 1488 { 1489 _get_lock(&_tty_put_lock); 1490 _puts("\n[GIET ERROR] in _fb_cma_init() : SRC chbuf descriptor unmapped\n"); 1491 _release_lock(&_tty_put_lock); 1492 return 1; 1493 } 1494 src_chbuf_pbase = (((paddr_t)ppn) << 12) | (vpn & 0x00000FFF); 1495 1496 // Compute physical adress of the DST chbuf descriptor 1497 vpn = ((unsigned int)(&_fb_cma_channel[channel_id].fbf)) >> 12; 1498 ko = _v2p_translate( (page_table_t*) user_ptab, 1499 vpn, 1500 &ppn, 1501 &flags ); 1502 if (ko) 1503 { 1504 _get_lock(&_tty_put_lock); 1505 _puts("\n[GIET ERROR] in _fb_cma_init() : DST chbuf descriptor unmapped\n"); 1506 _release_lock(&_tty_put_lock); 1507 return 1; 1508 } 1509 dst_chbuf_pbase = (((paddr_t)ppn) << 12) | (vpn & 0x00000FFF); 1510 1511 // CMA channel activation 1512 unsigned int* cma_vbase = (unsigned int *)&seg_cma_base; 1513 unsigned int offset = channel_id * CHBUF_CHANNEL_SPAN; 1514 1515 cma_vbase[offset + CHBUF_SRC_DESC] = (unsigned int)(src_chbuf_pbase & 0xFFFFFFFF); 1516 cma_vbase[offset + CHBUF_SRC_EXT] = (unsigned int)(src_chbuf_pbase >> 32); 1517 cma_vbase[offset + CHBUF_SRC_NBUFS] = 2; 1518 cma_vbase[offset + CHBUF_DST_DESC] = (unsigned int)(dst_chbuf_pbase & 0xFFFFFFFF); 1519 cma_vbase[offset + CHBUF_DST_EXT] = (unsigned int)(dst_chbuf_pbase >> 32); 1520 cma_vbase[offset + CHBUF_DST_NBUFS] = 1; 1521 cma_vbase[offset + CHBUF_BUF_SIZE] = length; 1522 cma_vbase[offset + CHBUF_PERIOD] = 300; 1523 cma_vbase[offset + CHBUF_RUN] = 1; 1524 1525 return 0; 1526 1527 #else 1528 1529 _get_lock(&_tty_put_lock); 1530 _puts("\n[GIET ERROR] in _fb_cma_init() : no CMA channel allocated\n"); 1531 _release_lock(&_tty_put_lock); 1532 1533 return 1; 1534 #endif 1535 } 1536 ////////////////////////////////////////////////////////////////////////////////// 1537 // _fb_cma_write() 1538 // This function updates the status of the SRC and DST chbuf descriptors 1539 // to allows the CMA component to transfer another buffer. 1540 // - buffer_id : user buffer index (0 => buf0 / not 0 => buf1) 1541 // Returns 0 if success, > 0 if error 1542 ////////////////////////////////////////////////////////////////////////////////// 1543 unsigned int _fb_cma_write( unsigned int buffer_id ) 1544 { 1545 #if NB_CMA_CHANNELS > 0 1546 1547 // get CMA channel index 1548 unsigned int channel_id = _get_context_slot(CTX_CMA_ID); 1549 if ( channel_id >= NB_CMA_CHANNELS ) 1550 { 1551 _get_lock(&_tty_put_lock); 1552 _puts("\n[GIET ERROR] in _fb_cma_write() : CMA channel index too large\n"); 1553 _release_lock(&_tty_put_lock); 1554 return 1; 1555 } 1556 // set SRC full 1557 if ( buffer_id == 0 ) 1558 _fb_cma_channel[channel_id].buf0 = _fb_cma_channel[channel_id].buf0 1559 | 0x8000000000000000ULL; 1560 else 1561 _fb_cma_channel[channel_id].buf1 = _fb_cma_channel[channel_id].buf1 1562 | 0x8000000000000000ULL; 1563 // set DST empty 1564 _fb_cma_channel[channel_id].fbf = _fb_cma_channel[channel_id].fbf 1565 & 0x7FFFFFFFFFFFFFFFULL; 1566 return 0; 1567 1568 #else 1569 1570 _get_lock(&_tty_put_lock); 1571 _puts("\n[GIET ERROR] in _fb_cma_channel() : no CMA channel allocated\n"); 1572 _release_lock(&_tty_put_lock); 1573 return 1; 1574 1575 #endif 1576 } 1577 ////////////////////////////////////////////////////////////////////////////////// 1578 // _fb_cma_stop() 1579 // This function desactivates the CMA channel allocated to the calling task. 1580 // Returns 0 if success, > 0 if error 1581 ////////////////////////////////////////////////////////////////////////////////// 1582 unsigned int _fb_cma_stop( unsigned int buffer_id ) 1583 { 1584 #if NB_CMA_CHANNELS > 0 1585 1586 // get CMA channel allocated 1587 unsigned int channel_id = _get_context_slot(CTX_CMA_ID); 1588 if ( channel_id >= NB_CMA_CHANNELS ) 1589 { 1590 _get_lock(&_tty_put_lock); 1591 _puts("\n[GIET ERROR] in _fb_cma_stop() : CMA channel index too large\n"); 1592 _release_lock(&_tty_put_lock); 1593 return 1; 1594 } 1595 // CMA channel desactivation 1596 unsigned int* cma_vbase = (unsigned int *)&seg_cma_base; 1597 unsigned int offset = channel_id * CHBUF_CHANNEL_SPAN; 1598 cma_vbase[offset + CHBUF_RUN] = 0; 1599 return 0; 1600 1601 #else 1602 1603 _get_lock(&_tty_put_lock); 1604 _puts("\n[GIET ERROR] in _fb_cma_stop() : no CMA channel allocated\n"); 1605 _release_lock(&_tty_put_lock); 1606 return 1; 1607 1608 #endif 1609 } 1610 1359 1611 ////////////////////////////////////////////////////////////////////////////////// 1360 1612 // VciMultiNic driver 1361 1613 ////////////////////////////////////////////////////////////////////////////////// 1362 1614 // The VciMultiNic device can be accessed directly by software with memcpy(), 1363 // or it can be accessed through a multi-channels DMA component:1615 // or it can be accessed through a multi-channels CMA component: 1364 1616 // 1365 1617 // The '_nic_sync_write' and '_nic_sync_read' functions use a memcpy strategy to … … 1367 1619 // buffer (kernel space). They are blocking until completion of the transfer. 1368 1620 // 1369 // The '_nic_write()', '_nic_read()' and '_nic_completed()' functions use the 1370 // VciMultiDma components (distributed in the clusters) to transfer data 1371 // between the user buffer and the NIC. A NIDMA channel is allocated to each 1372 // task requesting it in the mapping_info data structure. 1621 // The _nic_cma_init() and _nic_cma_stop() functions use the VciChbufDma component 1622 // to transfer a flow of packets from the NIC RX hard chbuf (two containers) 1623 // to an user RX chbuf (two containers), and to transfer another flow of packets 1624 // from an user TX chbuf (two containers) to the NIC TX chbuf (two containers). 1625 // One NIC channel and two CMA channels must be allocated to the task 1626 // in the mapping_info data structure. 1373 1627 ////////////////////////////////////////////////////////////////////////////////// 1374 1628 … … 1376 1630 // _nic_sync_write() 1377 1631 // Transfer data from an memory buffer to the NIC device using a memcpy. 1378 // - offset : offset (in bytes) in the frame buffer.1379 1632 // - buffer : base address of the memory buffer. 1380 1633 // - length : number of bytes to be transfered. 1381 1634 ////////////////////////////////////////////////////////////////////////////////// 1382 unsigned int _nic_sync_write( unsigned int offset, 1383 const void* buffer, 1635 unsigned int _nic_sync_write( const void* buffer, 1384 1636 unsigned int length ) 1385 1637 { 1386 unsigned char* nic_address = (unsigned char *) &seg_nic_base + offset; 1387 memcpy((void *) nic_address, (void *) buffer, length); 1388 return 0; 1389 } 1390 1391 1638 // To be defined 1639 // unsigned char* nic_address = (unsigned char *) &seg_nic_base; 1640 // memcpy((void *) nic_address, (void *) buffer, length); 1641 return 0; 1642 } 1392 1643 ////////////////////////////////////////////////////////////////////////////////// 1393 1644 // _nic_sync_read() 1394 1645 // Transfer data from the NIC device to a memory buffer using a memcpy. 1395 // - offset : offset (in bytes) in the frame buffer.1396 1646 // - buffer : base address of the memory buffer. 1397 1647 // - length : number of bytes to be transfered. 1398 1648 ////////////////////////////////////////////////////////////////////////////////// 1399 unsigned int _nic_sync_read(unsigned int offset, const void * buffer, unsigned int length) { 1400 unsigned char *nic_address = (unsigned char *) &seg_nic_base + offset; 1401 memcpy((void *) buffer, (void *) nic_address, length); 1402 return 0; 1403 } 1404 1405 1406 ////////////////////////////////////////////////////////////////////////////////// 1407 // _nic_write() 1408 // Transfer data from a memory buffer to the NIC device using DMA. 1409 // - offset : offset (in bytes) in the frame buffer. 1410 // - buffer : base address of the memory buffer. 1411 // - length : number of bytes to be transfered. 1649 unsigned int _nic_sync_read( const void* buffer, 1650 unsigned int length ) 1651 { 1652 // To be defined 1653 // unsigned char* nic_address = (unsigned char *) &seg_nic_base; 1654 // memcpy((void *) buffer, (void *) nic_address, length); 1655 return 0; 1656 } 1657 ////////////////////////////////////////////////////////////////////////////////// 1658 // _nic_cma_rx_init() 1412 1659 // Returns 0 if success, > 0 if error. 1413 1660 ////////////////////////////////////////////////////////////////////////////////// 1414 unsigned int _nic_write(unsigned int offset, const void * buffer, unsigned int length) { 1415 return _dma_transfer( 1416 1, // NIC 1417 0, // write 1418 offset, 1419 (unsigned int) buffer, 1420 length ); 1421 } 1422 1423 1424 ////////////////////////////////////////////////////////////////////////////////// 1425 // _nic_read() 1426 // Transfer data from the NIC device to a memory buffer using DMA. 1427 // - offset : offset (in bytes) in the frame buffer. 1428 // - buffer : base address of the memory buffer. 1429 // - length : number of bytes to be transfered. 1661 unsigned int _nic_cma_rx_init( const void* buf0, 1662 const void* buf1, 1663 unsigned int length ) 1664 { 1665 // to be defined 1666 // unsigned char* nic_address = (unsigned char *) &seg_nic_base; 1667 return 0; 1668 } 1669 ////////////////////////////////////////////////////////////////////////////////// 1670 // _nic_cma_tx_init() 1430 1671 // Returns 0 if success, > 0 if error. 1431 1672 ////////////////////////////////////////////////////////////////////////////////// 1432 unsigned int _nic_read(unsigned int offset, const void * buffer, unsigned int length) { 1433 return _dma_transfer( 1434 1, // NIC 1435 1, // read 1436 offset, 1437 (unsigned int) buffer, 1438 length ); 1439 } 1440 1441 1442 ////////////////////////////////////////////////////////////////////////////////// 1443 // _nic_completed() 1444 // This function checks completion of a DMA transfer to or fom a NIC channel. 1445 // As it is a blocking call, the processor is busy waiting. 1446 // Returns 0 if success, > 0 if error 1447 // (1 == read error / 2 == DMA idle error / 3 == write error) 1448 ////////////////////////////////////////////////////////////////////////////////// 1449 unsigned int _nic_completed() 1450 { 1451 return _dma_completed(); 1452 } 1673 unsigned int _nic_cma_tx_init( const void* buf0, 1674 const void* buf1, 1675 unsigned int length ) 1676 { 1677 // to be defined 1678 // unsigned char* nic_address = (unsigned char *) &seg_nic_base; 1679 return 0; 1680 }////////////////////////////////////////////////////////////////////////////////// 1681 // _nic_cma_stop() 1682 // Returns 0 if success, > 0 if error. 1683 ////////////////////////////////////////////////////////////////////////////////// 1684 unsigned int _nic_cma_stop() 1685 { 1686 // to be defined 1687 // unsigned char* nic_address = (unsigned char *) &seg_nic_base; 1688 return 0; 1689 } 1690 1453 1691 1454 1692 ////////////////////////////////////////////////////////////////////////////////// … … 1458 1696 // as a set of uncached, memory mapped registers. 1459 1697 /////////////////////////////////////////////////////////////////////////////////// 1698 // The (virtual) base address of the associated segment is: 1699 // 1700 // mmc_address = seg_mmc_base + cluster_id * vseg_cluster_increment 1701 // 1702 //////////////////////////////////////////////////////////////////////////////// 1460 1703 1461 1704 /////////////////////////////////////////////////////////////////////////////////// … … 1470 1713 unsigned int cluster_id = (unsigned int)((buf_paddr>>32)/(256/NB_CLUSTERS)); 1471 1714 1472 unsigned int * mmc_address = (unsigned int *) (( char *)&seg_mmc_base +1473 (cluster_id * GIET_CLUSTER_INCREMENT));1715 unsigned int * mmc_address = (unsigned int *) ((unsigned int)&seg_mmc_base + 1716 (cluster_id * (unsigned int)&vseg_cluster_increment)); 1474 1717 1475 1718 // get the lock protecting exclusive access to MEMC … … 1485 1728 mmc_address[MEMC_LOCK] = 0; 1486 1729 } 1730 1487 1731 /////////////////////////////////////////////////////////////////////////////////// 1488 1732 // _heap_info() -
soft/giet_vm/sys/drivers.h
r249 r253 62 62 63 63 /////////////////////////////////////////////////////////////////////////////////// 64 // Multi DMA variables 64 // Multi DMA variables and access functions (vci_multi_dma) 65 65 /////////////////////////////////////////////////////////////////////////////////// 66 66 … … 74 74 unsigned int _dma_get_status(unsigned int cluster_id, unsigned int local_id, unsigned int * status); 75 75 76 unsigned int _dma_transfer( 77 unsigned int dev_type, 78 unsigned int to_user, 79 unsigned int offset, 80 unsigned int user_vaddr, 81 unsigned int length); 76 unsigned int _dma_transfer( unsigned int dev_type, 77 unsigned int to_user, 78 unsigned int offset, 79 unsigned int user_vaddr, 80 unsigned int length ); 82 81 83 82 unsigned int _dma_completed(); … … 87 86 /////////////////////////////////////////////////////////////////////////////////// 88 87 89 unsigned int _fb_sync_write(unsigned int offset, const void * buffer, unsigned int length); 90 unsigned int _fb_sync_read( unsigned int offset, const void * buffer, unsigned int length); 91 unsigned int _fb_write( unsigned int offset, const void * buffer, unsigned int length); 92 unsigned int _fb_read( unsigned int offset, const void * buffer, unsigned int length); 88 unsigned int _fb_sync_write( unsigned int offset, 89 const void * buffer, 90 unsigned int length); 91 unsigned int _fb_sync_read( unsigned int offset, 92 const void * buffer, 93 unsigned int length); 93 94 94 unsigned int _fb_completed(); 95 unsigned int _fb_dma_write( unsigned int offset, 96 const void * buffer, 97 unsigned int length); 98 unsigned int _fb_dma_read( unsigned int offset, 99 const void * buffer, 100 unsigned int length); 101 unsigned int _fb_dma_completed(); 102 103 unsigned int _fb_cma_init( const void* vbase0, 104 const void* vbase1, 105 unsigned int length ); 106 unsigned int _fb_cma_write( unsigned int buffer_id ); 107 unsigned int _fb_cma_stop(); 95 108 96 109 /////////////////////////////////////////////////////////////////////////////////// … … 98 111 /////////////////////////////////////////////////////////////////////////////////// 99 112 100 unsigned int _nic_sync_write( unsigned int offset, const void * buffer, unsigned int length);101 unsigned int _nic_sync_read( unsigned int offset, const void * buffer,unsigned int length);102 unsigned int _nic_ write( unsigned int offset, const void * buffer, unsigned int length);103 unsigned int _nic_read( unsigned int offset, const void * buffer,unsigned int length);113 unsigned int _nic_sync_write( const void* buffer, 114 unsigned int length); 115 unsigned int _nic_sync_read( const void* buffer, 116 unsigned int length); 104 117 105 unsigned int _nic_completed(); 118 unsigned int _nic_cma_rx_init( const void* buf0, 119 const void* buf1, 120 unsigned int length ); 121 unsigned int _nic_cma_tx_init( const void* buf0, 122 const void* buf1, 123 unsigned int length ); 124 unsigned int _nic_cma_stop(); 106 125 107 126 /////////////////////////////////////////////////////////////////////////////////// -
soft/giet_vm/sys/hwr_mapping.h
r252 r253 49 49 DMA_END = 7, 50 50 DMA_SPAN = 8, 51 }; 52 53 /* CMA */ 54 enum CMA_registers 55 { 56 CHBUF_RUN = 0, // write-only : channel activated 57 CHBUF_STATUS = 1, // read-only : channel fsm state 58 CHBUF_SRC_DESC = 2, // read/write : source chbuf : descriptor base address 59 CHBUF_DST_DESC = 3, // read/write : destination chbuf : descriptor base address, 60 CHBUF_SRC_NBUFS = 4, // read/write : source chbuf : number of buffers, 61 CHBUF_DST_NBUFS = 5, // read/write : destination chbuf : number of buffers, 62 CHBUF_BUF_SIZE = 6, // read/write : buffer size for both source & destination 63 CHBUF_PERIOD = 7, // read/write : period for status polling 64 CHBUF_SRC_EXT = 8, // read/write : source chbuf : descriptor base address 65 CHBUF_DST_EXT = 9, // read/write : destination chbuf : descriptor base address, 66 /****/ 67 CHBUF_CHANNEL_SPAN = 1024, 51 68 }; 52 69 -
soft/giet_vm/sys/sys_handler.c
r238 r253 21 21 // Initialize the syscall vector with syscall handlers 22 22 //////////////////////////////////////////////////////////////////////////// 23 const void * _syscall_vector[32] = { 23 const void * _syscall_vector[32] = 24 { 24 25 &_procid, /* 0x00 */ 25 26 &_proctime, /* 0x01 */ … … 33 34 &_local_task_id, /* 0x09 */ 34 35 &_global_task_id, /* 0x0A */ 35 &_ sys_ukn,/* 0x0B */36 &_ sys_ukn,/* 0x0C */37 &_ context_switch,/* 0x0D */36 &_fb_cma_init, /* 0x0B */ 37 &_fb_cma_write, /* 0x0C */ 38 &_fb_cma_stop, /* 0x0D */ 38 39 &_exit, /* 0x0E */ 39 40 &_procs_number, /* 0x0F */ 40 41 &_fb_sync_write, /* 0x10 */ 41 42 &_fb_sync_read, /* 0x11 */ 42 &_fb_ write,/* 0x12 */43 &_fb_ read,/* 0x13 */44 &_fb_ completed,/* 0x14 */43 &_fb_dma_write, /* 0x12 */ 44 &_fb_dma_read, /* 0x13 */ 45 &_fb_dma_completed, /* 0x14 */ 45 46 &_ioc_write, /* 0x15 */ 46 47 &_ioc_read, /* 0x16 */ 47 48 &_ioc_completed, /* 0x17 */ 48 49 &_ioc_get_block_size, /* 0x18 */ 49 &_ sys_ukn,/* 0x19 */50 &_ctx_switch, /* 0x19 */ 50 51 &_vobj_get_vbase, /* 0x1A */ 51 &_nic_ write,/* 0x1B */52 &_nic_ read,/* 0x1C */53 &_nic_c ompleted,/* 0x1D */54 &_ sys_ukn,/* 0x1E */55 &_ sys_ukn,/* 0x1F */52 &_nic_cma_rx_init, /* 0x1B */ 53 &_nic_cma_tx_init, /* 0x1C */ 54 &_nic_cma_stop, /* 0x1D */ 55 &_nic_sync_read, /* 0x1E */ 56 &_nic_sync_write, /* 0x1F */ 56 57 }; 57 58 -
soft/giet_vm/xml/mapping_info.h
r249 r253 5 5 // Copyright (c) UPMC-LIP6 6 6 //////////////////////////////////////////////////////////////////////////// 7 // The MAPPING_INFO data structure can be used with the GIET. 8 // It contains the mapping directive for one or several virtual spaces. 9 // Ech virtual space contains a variable number of virtual segments 7 // The MAPPING_INFO data structure, used by the GIET_VM kernel contains: 8 // 9 // 1) a description of a clusterized hardware architecture. 10 // The number of cluster is variable (can be one). The number of processors 11 // per cluster is variable (can be one). The number of peripherals per cluser 12 // and coprocessor per cluster is variable. The number of physical memory 13 // banks per cluster is variable. 14 // 15 // 2/ a description of the applications (called vspaces) to be - statically - 16 // launched on the platform. The number of parallel tasks per application is 17 // variable (can be one). Multi-Writer/Multi-Reader communication channels 18 // betwwen tasks are supported. Each vspace contains a variable number 19 // of virtual segments (called vsegs). 20 // 21 // 3/ the mapping directives: both tasks on processors, and software objects 22 // (vobjs and vsegs) on the physical memory banks (called psegs). 10 23 // and a variable number of tasks. The number of virtual space can be one. 11 24 // 12 // The mapping tabledata structure is organised as the concatenation of13 // a fixed size header, and 6variable size arrays:25 // The mapping_info data structure is organised as the concatenation of 26 // a fixed size header, and 11 variable size arrays: 14 27 // 15 28 // - mapping_cluster_t cluster[] … … 19 32 // - mapping_vseg_t vobj[] 20 33 // - mapping_task_t task[] 21 // - mapping_irq_t irq[irqs] 34 // - mapping_proc_t proc[] 35 // - mapping_irq_t irq[] 22 36 // - mapping_coproc_t coproc[] 23 37 // - mapping_cp_port_t cp_port[] 24 38 // - mapping_periph_t periph[] 25 39 // 26 // It is intended to be stored in the boot ROMat address MAPPING_BOOT_BASE.40 // It is intended to be stored in memory at address MAPPING_BOOT_BASE. 27 41 //////////////////////////////////////////////////////////////////////////// 28 42 … … 75 89 }; 76 90 91 // The enum definitions for psegType and periphType must be kept 92 // consistent with the definitions in the xml_driver.c file... 77 93 78 94 enum periphType … … 82 98 PERIPH_TYPE_DMA = 2, 83 99 PERIPH_TYPE_MMC = 3, 84 85 100 PERIPH_TYPE_CMA = 4, 86 101 PERIPH_TYPE_IOC = 5, … … 90 105 PERIPH_TYPE_IOB = 9, 91 106 PERIPH_TYPE_GCD = 10, 92 93 PERIPH_TYPE_MAX_VALUE = 11, 107 PERIPH_TYPE_XCU = 11, 108 109 PERIPH_TYPE_MAX_VALUE = 12, 94 110 }; 95 111 … … 112 128 unsigned int globals; // number of vsegs mapped in all vspaces 113 129 unsigned int vspaces; // number of virtual spaces 130 unsigned int increment; // vseg cluster increment for replicated periphs 114 131 115 132 unsigned int tty_cluster; // index of cluster containing TTY controler … … 270 287 typedef struct __attribute__((packed)) mapping_periph_s 271 288 { 272 unsigned int type; // IOC / TTY / TIM / DMA / FBF / NIC / IOB289 unsigned int type; 273 290 unsigned int psegid; // pseg index in cluster 274 291 unsigned int channels; // number of channels -
soft/giet_vm/xml/xml_driver.c
r238 r253 61 61 "ICU", 62 62 "TIM", 63 "XICU",64 63 "DMA", 64 "MMC", 65 "CMA", 65 66 "IOC", 66 67 "TTY", … … 68 69 "NIC", 69 70 "IOB", 71 "GCD", 72 "XCU", 70 73 }; 71 74 -
soft/giet_vm/xml/xml_parser.c
r249 r253 6 6 /////////////////////////////////////////////////////////////////////////////////////// 7 7 // This program translate a "map.xml" source file to a binary file "map.bin" that 8 // can be directly loaded in the boot ROMand used by the GIET-VM operating system.8 // can be directly loaded in memory and used by the GIET-VM operating system. 9 9 // 10 10 // This map.xml file contains : … … 14 14 // The corresponding C structures are defined in the "mapping_info.h" file. 15 15 // 16 // This p rogramalso generates the "hard_config.h" and the "giet_vsegs.ld" files,16 // This parser also generates the "hard_config.h" and the "giet_vsegs.ld" files, 17 17 // required to compile the GIET-VM code. 18 18 /////////////////////////////////////////////////////////////////////////////////////// … … 100 100 char found_timer = 0; 101 101 char found_icu = 0; 102 char found_xcu = 0; 102 103 char found_dma = 0; 103 104 char found_mmc = 0; … … 122 123 123 124 unsigned int use_iob = 0; // using IOB component 124 unsigned int use_x icu = 0; // using XICU (not ICU)125 unsigned int use_xcu = 0; // using XCU (not ICU) 125 126 126 127 … … 130 131 131 132 unsigned int periph_vbase_array[PERIPH_TYPE_MAX_VALUE] 132 = { [0 ... (PERIPH_TYPE_MAX_VALUE - 1)] = 0xFFF FFFFF};133 = { [0 ... (PERIPH_TYPE_MAX_VALUE - 1)] = 0xFFF00000 }; 133 134 134 135 ////////////////////////////////////////////////////////////////////// … … 278 279 } // end getStringValue() 279 280 280 /////////////////////////////////////////////////////// 281 void set_periph_vbase_array( unsigned int vseg_index ) 282 { 283 unsigned int vbase = vseg[vseg_index]->vbase; // peripheral vbase address 284 unsigned int psegid = vseg[vseg_index]->psegid; // pseg global index 285 unsigned int type; // peripheral type 286 unsigned int periph_id; 287 288 for ( periph_id = 0 ; periph_id < header->periphs ; periph_id++) 289 { 290 if( periph[periph_id]->psegid == psegid ) 291 { 292 type = periph[periph_id]->type; 293 if ( periph_vbase_array[type] == 0xFFFFFFFF ) 294 periph_vbase_array[type] = vbase; 295 } 281 /////////////////////////////////////////////////////////////////////////////////// 282 // This function set the vbase address for all peripheral types. 283 // For replicated peripherals with the same type the virtual base address must be: 284 // vbase = seg_type_base & 0XFFF00000 + 285 // (cluster_id * vbase_cluster_increment) & 0x000FFFFF 286 void set_periph_vbase_array() 287 { 288 unsigned int vseg_id; // vseg global index 289 unsigned int periph_id; // periph global index 290 unsigned int pseg_id; // pseg global index 291 unsigned int cluster_id; // cluster global index 292 unsigned int type; // peripheral type 293 294 unsigned int msb_mask = 0xFFF00000; 295 unsigned int lsb_mask = 0x000FFFFF; 296 297 // We are looking for any vseg matching a peripheral 298 // (i.e. they are associated to the same pseg) 299 300 // scan all vsegs 301 for (vseg_id = 0 ; vseg_id < header->vsegs ; vseg_id++) 302 { 303 // keep only vseg corresponding to a periph 304 if ( vobj[vseg[vseg_id]->vobj_offset]->type == VOBJ_TYPE_PERI ) 305 { 306 pseg_id = vseg[vseg_id]->psegid; 307 cluster_id = pseg[pseg_id]->cluster; 308 309 // scan all periphs 310 for ( periph_id = 0 ; periph_id < header->periphs ; periph_id++) 311 { 312 if( periph[periph_id]->psegid == pseg_id ) // matching !!! 313 { 314 type = periph[periph_id]->type; 315 if ( periph_vbase_array[type] == 0xFFF00000 ) // vbase not set 316 { 317 periph_vbase_array[type] = vseg[vseg_id]->vbase; 318 } 319 else // vbase already set 320 { 321 // checking 12 MSB bits for replicated peripherals 322 if( (vseg[vseg_id]->vbase & msb_mask) != 323 (periph_vbase_array[type] & msb_mask) ) 324 { 325 printf("[XML ERROR] All peripherals with same type "); 326 printf(" should share the same 12 MSB for vbase address\n"); 327 printf("periph index = %d / periph type = %d / vbase = %x\n", 328 periph_id, type, vseg[vseg_id]->vbase); 329 exit(1); 330 } 331 // checking 20 LSB bits for replicated peripherals 332 if( (vseg[vseg_id]->vbase & lsb_mask) != 333 (header->increment * cluster_id) ) 334 { 335 printf("[XML ERROR] All peripherals with same type "); 336 printf(" must have the 20 LSB bits = cluster_id * increment"); 337 printf("periph index = %d / periph type = %d / vbase = %x\n", 338 periph_id, type, vseg[vseg_id]->vbase); 339 exit(1); 340 } 341 } 342 } 343 } 344 } 296 345 } 297 346 } // end set_periph_vbase_array() … … 336 385 unsigned int vobj_max = vobj_min + vspace_max; 337 386 338 for (vobj_id = vobj_min; vobj_id < vobj_max; vobj_id++) { 339 if (strcmp(vobj[vobj_id]->name, vobj_name) == 0) { 340 return (vobj_id - vobj_min); 341 } 387 for (vobj_id = vobj_min; vobj_id < vobj_max; vobj_id++) 388 { 389 if (strcmp(vobj[vobj_id]->name, vobj_name) == 0) return (vobj_id - vobj_min); 342 390 } 343 391 return -1; 344 392 } 345 393 346 347 ///////////////////////////////////////// 394 ////////////////////////////////////// 348 395 void taskNode(xmlTextReaderPtr reader) 349 396 { … … 352 399 char * str; 353 400 354 if (xmlTextReaderNodeType(reader) == XML_READER_TYPE_END_ELEMENT) { return; }401 if (xmlTextReaderNodeType(reader) == XML_READER_TYPE_END_ELEMENT) return; 355 402 356 403 if (task_index >= MAX_TASKS) 357 404 { 358 405 printf("[XML ERROR] The number of tasks is larger than %d\n", MAX_TASKS); 406 exit(1); 359 407 } 360 408 … … 540 588 } // end taskNode() 541 589 542 543 590 ////////////////////////////////////// 544 591 void vobjNode(xmlTextReaderPtr reader) … … 548 595 char * str; 549 596 550 if (xmlTextReaderNodeType(reader) == XML_READER_TYPE_END_ELEMENT) { return; }597 if (xmlTextReaderNodeType(reader) == XML_READER_TYPE_END_ELEMENT) return; 551 598 552 599 if (vobj_index >= MAX_VOBJS) … … 583 630 printf(" type = %s\n", str); 584 631 #endif 585 if (ok && (strcmp(str, "ELF") == 0)) 586 { 587 vobj[vobj_index]->type = VOBJ_TYPE_ELF; 588 589 assert( (vobj_count == 0) && "[XML ERROR] an ELF vobj must be alone in a vseg"); 590 } 591 else if (ok && (strcmp(str, "PERI") == 0)) 592 { 593 vobj[vobj_index]->type = VOBJ_TYPE_PERI; 594 595 assert( (vobj_count == 0) && "[XML ERROR] a PERI vobj must be alone in a vseg"); 596 597 // fill the peripheral base address array 598 set_periph_vbase_array( vseg_index ); 599 } 632 633 if (ok && (strcmp(str, "ELF") == 0)) { vobj[vobj_index]->type = VOBJ_TYPE_ELF; } 634 else if (ok && (strcmp(str, "PERI") == 0)) { vobj[vobj_index]->type = VOBJ_TYPE_PERI; } 600 635 else if (ok && (strcmp(str, "BLOB") == 0)) { vobj[vobj_index]->type = VOBJ_TYPE_BLOB; } 601 636 else if (ok && (strcmp(str, "PTAB") == 0)) { vobj[vobj_index]->type = VOBJ_TYPE_PTAB; } … … 613 648 exit(1); 614 649 } 650 // some more checking 651 if ( (vobj[vobj_index]->type == VOBJ_TYPE_ELF) || 652 (vobj[vobj_index]->type == VOBJ_TYPE_PERI) ) 653 { 654 assert( (vobj_count == 0) && 655 "[XML ERROR] an ELF or PERI vobj must be alone in a vseg"); 656 } 657 615 658 616 659 ////////// get length attribute … … 680 723 } // end vobjNode() 681 724 682 683 725 ////////////////////////////////////// 684 726 void vsegNode(xmlTextReaderPtr reader) … … 690 732 vobj_count = 0; 691 733 692 if (xmlTextReaderNodeType(reader) == XML_READER_TYPE_END_ELEMENT) { return; }734 if (xmlTextReaderNodeType(reader) == XML_READER_TYPE_END_ELEMENT) return; 693 735 694 736 if (vseg_index >= MAX_VSEGS) … … 833 875 return; 834 876 } 835 else { 877 else 878 { 836 879 printf("[XML ERROR] Unknown tag %s", tag); 837 880 exit(1); … … 841 884 } // end vsegNode() 842 885 843 844 ////////////////////////////////////////// 845 void vspaceNode(xmlTextReaderPtr reader){886 //////////////////////////////////////// 887 void vspaceNode(xmlTextReaderPtr reader) 888 { 846 889 char * str; 847 890 unsigned int ok; … … 852 895 task_loc_index = 0; 853 896 854 if (xmlTextReaderNodeType(reader) == XML_READER_TYPE_END_ELEMENT) { 855 return; 856 } 897 if (xmlTextReaderNodeType(reader) == XML_READER_TYPE_END_ELEMENT) return; 857 898 858 899 // checking source file consistency … … 877 918 strncpy(vspace[vspace_index]->name, str, 31); 878 919 } 879 else { 920 else 921 { 880 922 printf("[XML ERROR] illegal or missing <name> attribute for vspace %d\n", 881 923 vspace_index); … … 899 941 //used after parsing the vobjs 900 942 } 901 else { 943 else 944 { 902 945 printf("[XML ERROR] illegal or missing <startname> attribute for vspace %s\n", 903 946 vspace[vspace_index]->name); … … 925 968 // get index of the vobj containing the start vector 926 969 int index = getVobjLocId(vspace_index, str , vobj_loc_index); 927 if (index == -1) { 970 if (index == -1) 971 { 928 972 printf("[XML ERROR] vobj containing start vector not found in vspace %s\n", 929 973 vspace[vspace_index]->name); 930 exit(-1); 931 } 932 else { 974 exit(1); 975 } 976 else 977 { 933 978 vspace[vspace_index]->start_offset = index; 934 979 #if XML_PARSER_DEBUG … … 944 989 int task_max = task_min + vspace[vspace_index]->tasks; 945 990 for (task_id = task_min; task_id < task_max; task_id++) { 946 if (task[task_id]->startid >= vspace[vspace_index]->tasks) { 991 if (task[task_id]->startid >= vspace[vspace_index]->tasks) 992 { 947 993 printf("[XML ERROR] <startid> too large for task (%d,%d)\n", 948 994 vspace_index, task_id ); … … 955 1001 return; 956 1002 } 957 else { 1003 else 1004 { 958 1005 printf("[XML ERROR] Unknown tag %s", tag); 959 1006 exit(1); … … 963 1010 } // end vspaceNode() 964 1011 965 966 /////////////////////////////////////////// 967 void cpPortNode(xmlTextReaderPtr reader){1012 //////////////////////////////////////// 1013 void cpPortNode(xmlTextReaderPtr reader) 1014 { 968 1015 char * str; 969 1016 unsigned int ok; 970 1017 971 if (xmlTextReaderNodeType(reader) == XML_READER_TYPE_END_ELEMENT) { 972 return; 973 } 974 975 if (cp_port_index >= MAX_CP_PORTS) { 976 printf("[XML ERROR] The number of ports (for coprocs) is larger than %d\n", MAX_CP_PORTS); 1018 if (xmlTextReaderNodeType(reader) == XML_READER_TYPE_END_ELEMENT) return; 1019 1020 if (cp_port_index >= MAX_CP_PORTS) 1021 { 1022 printf("[XML ERROR] The number of ports (for coprocs) is larger than %d\n", 1023 MAX_CP_PORTS); 1024 exit(1); 977 1025 } 978 1026 … … 984 1032 cp_port_vobj_ref[cp_port_index] = (vobj_ref_t *) malloc(sizeof(vobj_ref_t)); 985 1033 986 987 988 1034 ///////// get direction attribute 989 1035 str = getStringValue(reader, "direction", &ok); 990 if (ok) { 1036 if (ok) 1037 { 991 1038 #if XML_PARSER_DEBUG 992 1039 printf(" direction = %s\n", str); 993 1040 #endif 994 if (strcmp(str, "TO_COPROC") == 0) { 1041 if (strcmp(str, "TO_COPROC") == 0) 1042 { 995 1043 cp_port[cp_port_index]->direction = PORT_TO_COPROC; 996 1044 } 997 else if (strcmp(str, "FROM_COPROC") == 0) { 1045 else if (strcmp(str, "FROM_COPROC") == 0) 1046 { 998 1047 cp_port[cp_port_index]->direction = PORT_FROM_COPROC; 999 1048 } 1000 else { 1049 else 1050 { 1001 1051 printf("[XML ERROR] illegal <direction> for cp_port %d in cluster %d\n", 1002 1052 cp_port_index, cluster_index); … … 1004 1054 } 1005 1055 } 1006 else { 1056 else 1057 { 1007 1058 printf("[XML ERROR] missing <direction> for cp_port %d in cluster %d\n", 1008 1059 cp_port_index, cluster_index); … … 1015 1066 printf(" vspacename = %s\n", str); 1016 1067 #endif 1017 if (ok) { 1068 if (ok) 1069 { 1018 1070 strncpy(cp_port_vobj_ref[cp_port_index]->vspace_name, str, 31); 1019 1071 } 1020 else { 1072 else 1073 { 1021 1074 printf("[XML ERROR] missing <vspacename> for cp_port %d in cluster %d\n", 1022 1075 cp_port_index, cluster_index); … … 1029 1082 printf(" vobjname = %s\n", str); 1030 1083 #endif 1031 if (ok) { 1084 if (ok) 1085 { 1032 1086 strncpy(cp_port_vobj_ref[cp_port_index]->vobj_name, str, 31); 1033 1087 } 1034 else { 1088 else 1089 { 1035 1090 printf("[XML ERROR] missing <vobjname> for cp_port %d in cluster %d\n", 1036 1091 cp_port_index, cluster_index); 1037 1092 exit(1); 1038 1093 } 1039 1040 1094 cp_port_index++; 1041 1095 cp_port_loc_index++; 1042 1043 1096 } // end cpPortNode() 1044 1045 1097 1046 1098 //////////////////////////////////////// … … 1051 1103 unsigned int ok; 1052 1104 1053 if (xmlTextReaderNodeType(reader) == XML_READER_TYPE_END_ELEMENT) { return; }1105 if (xmlTextReaderNodeType(reader) == XML_READER_TYPE_END_ELEMENT) return; 1054 1106 1055 1107 if (periph_index >= MAX_PERIPHS) 1056 1108 { 1057 1109 printf("[XML ERROR] The number of periphs is larger than %d\n", MAX_PERIPHS); 1110 exit(1); 1058 1111 } 1059 1112 … … 1194 1247 cma_channels = periph[periph_index]->channels; 1195 1248 } 1196 else if (header-> nic_cluster_bis == 0xFFFFFFFF)1249 else if (header->cma_cluster_bis == 0xFFFFFFFF) 1197 1250 { 1198 1251 header->cma_cluster_bis = cluster_index; … … 1221 1274 } 1222 1275 // The TIM, ICU, XICU, DMA, MEMC peripherals are replicated in all clusters 1223 // but only one componentper cluster1276 // but it must exist only one component of each type per cluster 1224 1277 else if (strcmp(str, "TIM") == 0 ) 1225 1278 { 1226 1279 periph[periph_index]->type = PERIPH_TYPE_TIM; 1227 if (found_timer || use_x icu) error = 1;1280 if (found_timer || use_xcu) error = 1; 1228 1281 found_timer = 1; 1229 1282 if (tim_channels < periph[periph_index]->channels) … … 1235 1288 { 1236 1289 periph[periph_index]->type = PERIPH_TYPE_ICU; 1237 if (found_icu ) error = 1;1290 if (found_icu || use_xcu) error = 1; 1238 1291 found_icu = 1; 1239 1292 } 1240 else if (strcmp(str, "X ICU") == 0)1241 { 1242 periph[periph_index]->type = PERIPH_TYPE_ ICU;1293 else if (strcmp(str, "XCU") == 0) 1294 { 1295 periph[periph_index]->type = PERIPH_TYPE_XCU; 1243 1296 if (found_icu || found_timer) error = 1; 1244 found_icu = 1; 1245 if (tim_channels == 0) 1246 { 1247 tim_channels = 32; 1248 } 1249 use_xicu = 1; 1297 found_xcu = 1; 1298 found_timer = 1; 1299 tim_channels = 32; 1300 use_xcu = 1; 1250 1301 } 1251 1302 else if (strcmp(str, "DMA") == 0) … … 1291 1342 } // end periphNode 1292 1343 1293 1294 ///////////////////////////////////////// 1295 void coprocNode(xmlTextReaderPtr reader){1344 //////////////////////////////////////// 1345 void coprocNode(xmlTextReaderPtr reader) 1346 { 1296 1347 char * str; 1297 1348 unsigned int ok; … … 1299 1350 cp_port_loc_index = 0; 1300 1351 1301 if (xmlTextReaderNodeType(reader) == XML_READER_TYPE_END_ELEMENT) { 1302 return; 1303 } 1304 1305 if (coproc_index >= MAX_COPROCS) { 1352 if (xmlTextReaderNodeType(reader) == XML_READER_TYPE_END_ELEMENT) return; 1353 1354 if (coproc_index >= MAX_COPROCS) 1355 { 1306 1356 printf("[XML ERROR] The number of coprocs is larger than %d\n", MAX_COPROCS); 1357 exit(1); 1307 1358 } 1308 1359 … … 1315 1366 /////////// get name attribute 1316 1367 str = getStringValue(reader, "name", &ok); 1317 if (ok) { 1368 if (ok) 1369 { 1318 1370 #if XML_PARSER_DEBUG 1319 1371 printf(" name = %s\n", str); … … 1321 1373 strncpy(coproc[coproc_index]->name, str, 31); 1322 1374 } 1323 else { 1375 else 1376 { 1324 1377 printf("[XML ERROR] illegal or missing <name> for coproc %d in cluster %d\n", 1325 1378 coproc_index, cluster_index); … … 1329 1382 /////////// get psegname attribute 1330 1383 str = getStringValue(reader, "psegname", &ok); 1331 if (ok == 0) { 1384 if (ok == 0) 1385 { 1332 1386 printf("[XML ERROR] illegal or missing <psegname> for coproc %d in cluster %d\n", 1333 1387 coproc_index, cluster_index); … … 1337 1391 /////////// set psegid attribute 1338 1392 int index = getPsegId(cluster_index, str); 1339 if (index >= 0) { 1393 if (index >= 0) 1394 { 1340 1395 #if XML_PARSER_DEBUG 1341 1396 printf(" clusterid = %d\n", cluster_index); … … 1346 1401 assert(pseg[index]->type == PSEG_TYPE_PERI && "coproc psegname attribute must refer to a pseg of type PERI" ); 1347 1402 } 1348 else { 1403 else 1404 { 1349 1405 printf("[XML ERROR] pseg not found for coproc %d / clusterid = %d / psegname = %s\n", 1350 1406 coproc_index, cluster_index, str ); … … 1360 1416 1361 1417 int status = xmlTextReaderRead(reader); 1362 while (status == 1) { 1418 while (status == 1) 1419 { 1363 1420 const char * tag = (const char *) xmlTextReaderConstName(reader); 1364 1421 1365 if (strcmp(tag, "port") == 0 ) { 1422 if (strcmp(tag, "port") == 0 ) 1423 { 1366 1424 cpPortNode(reader); 1367 1425 } 1368 1426 else if (strcmp(tag, "#text") == 0 ) { } 1369 1427 else if (strcmp(tag, "#comment") == 0 ) { } 1370 else if (strcmp(tag, "coproc") == 0 ) { 1428 else if (strcmp(tag, "coproc") == 0 ) 1429 { 1371 1430 coproc[coproc_index]->ports = cp_port_loc_index; 1372 1431 cluster[cluster_index]->coprocs++; … … 1375 1434 return; 1376 1435 } 1377 else { 1436 else 1437 { 1378 1438 printf("[XML ERROR] Unknown tag %s", tag); 1379 1439 exit(1); … … 1384 1444 1385 1445 1386 /////////////////////////////////////// 1387 void irqNode(xmlTextReaderPtr reader) { 1446 ///////////////////////////////////// 1447 void irqNode(xmlTextReaderPtr reader) 1448 { 1388 1449 unsigned int ok; 1389 1450 unsigned int value; 1390 1451 char * str; 1391 1452 1392 if (xmlTextReaderNodeType(reader) == XML_READER_TYPE_END_ELEMENT) { 1393 return; 1394 } 1453 if (xmlTextReaderNodeType(reader) == XML_READER_TYPE_END_ELEMENT) return; 1395 1454 1396 1455 if (irq_index >= MAX_IRQS) { … … 1406 1465 ///////// get type attribute 1407 1466 str = getStringValue(reader, "type", &ok); 1408 if (ok) { 1467 if (ok) 1468 { 1409 1469 #if XML_PARSER_DEBUG 1410 1470 printf(" type = %s\n", str); 1411 1471 #endif 1412 if (strcmp(str, "HARD") == 0 ) { 1413 irq[irq_index]->type = 0; 1414 } 1415 else { 1416 irq[irq_index]->type = 1; 1417 } 1418 } 1419 else { 1472 if (strcmp(str, "HARD") == 0 ) irq[irq_index]->type = 0; 1473 else irq[irq_index]->type = 1; 1474 } 1475 else 1476 { 1420 1477 printf("[XML ERROR] missing IRQ <type> for processor %d in cluster %d\n", 1421 1478 cluster_index, proc_loc_index); … … 1425 1482 ///////// get icuid attribute 1426 1483 value = getIntValue(reader, "icuid", &ok); 1427 if (ok) { 1484 if (ok) 1485 { 1428 1486 #if XML_PARSER_DEBUG 1429 1487 printf(" icuid = %d\n", value); 1430 1488 #endif 1431 1489 irq[irq_index]->icuid = value; 1432 if (value >= 32) { 1490 if (value >= 32) 1491 { 1433 1492 printf("[XML ERROR] IRQ <icuid> too large for processor %d in cluster %d\n", 1434 1493 cluster_index, proc_loc_index); … … 1436 1495 } 1437 1496 } 1438 else { 1497 else 1498 { 1439 1499 printf("[XML ERROR] missing IRQ <icuid> for processor %d in cluster %d\n", 1440 1500 cluster_index, proc_loc_index); … … 1444 1504 ///////// get isr attribute 1445 1505 str = getStringValue(reader, "isr", &ok); 1446 if (ok) { 1506 if (ok) 1507 { 1447 1508 #if XML_PARSER_DEBUG 1448 1509 printf(" isr = %s\n", str); … … 1453 1514 else if (strcmp(str, "ISR_TTY" ) == 0) { irq[irq_index]->isr = ISR_TTY; } 1454 1515 else if (strcmp(str, "ISR_TIMER" ) == 0) { irq[irq_index]->isr = ISR_TIMER; } 1455 else { 1516 else 1517 { 1456 1518 printf("[XML ERROR] illegal IRQ <isr> for processor %d in cluster %d\n", 1457 1519 cluster_index, proc_loc_index); … … 1462 1524 #endif 1463 1525 } 1464 else { 1526 else 1527 { 1465 1528 printf("[XML ERROR] missing IRQ <isr> for processor %d in cluster %d\n", 1466 1529 cluster_index, proc_loc_index); … … 1470 1533 ///////// get channel attribute (optionnal : 0 if missing) 1471 1534 value = getIntValue(reader, "channel", &ok); 1472 if (ok) { 1535 if (ok) 1536 { 1473 1537 #if XML_PARSER_DEBUG 1474 1538 printf(" channel = %d\n", value); … … 1476 1540 irq[irq_index]->channel = value; 1477 1541 } 1478 else { 1542 else 1543 { 1479 1544 irq[irq_index]->channel = 0; 1480 1545 } … … 1486 1551 1487 1552 1488 ///////////////////////////////////////// 1489 void procNode(xmlTextReaderPtr reader) { 1553 ////////////////////////////////////// 1554 void procNode(xmlTextReaderPtr reader) 1555 { 1490 1556 unsigned int ok; 1491 1557 unsigned int value; … … 1493 1559 irq_loc_index = 0; 1494 1560 1495 if (xmlTextReaderNodeType(reader) == XML_READER_TYPE_END_ELEMENT) { 1496 return; 1497 } 1498 1499 if (proc_index >= MAX_PROCS) { 1561 if (xmlTextReaderNodeType(reader) == XML_READER_TYPE_END_ELEMENT) return; 1562 1563 if (proc_index >= MAX_PROCS) 1564 { 1500 1565 printf("[XML ERROR] The number of procs is larger than %d\n", MAX_PROCS); 1566 exit(1); 1501 1567 } 1502 1568 … … 1506 1572 1507 1573 proc[proc_index] = (mapping_proc_t *) malloc(sizeof(mapping_proc_t)); 1508 1509 1574 1510 1575 /////////// get index attribute (optional) 1511 1576 value = getIntValue(reader, "index", &ok); 1512 if (ok && (value != proc_loc_index)) { 1577 if (ok && (value != proc_loc_index)) 1578 { 1513 1579 printf("[XML ERROR] wrong proc index / expected value is %d", 1514 1580 proc_loc_index); … … 1524 1590 1525 1591 int status = xmlTextReaderRead(reader); 1526 while (status == 1) { 1592 while (status == 1) 1593 { 1527 1594 const char * tag = (const char *) xmlTextReaderConstName(reader); 1528 1595 1529 if (strcmp(tag, "irq") == 0) { 1596 if (strcmp(tag, "irq") == 0) 1597 { 1530 1598 irqNode(reader); 1531 1599 } 1532 1600 else if (strcmp(tag, "#text") == 0) { } 1533 1601 else if (strcmp(tag, "#comment") == 0) { } 1534 else if (strcmp(tag, "proc") == 0) { 1602 else if (strcmp(tag, "proc") == 0) 1603 { 1535 1604 proc[proc_index]->irqs = irq_loc_index; 1536 1605 cluster[cluster_index]->procs++; … … 1539 1608 return; 1540 1609 } 1541 else { 1610 else 1611 { 1542 1612 printf("[XML ERROR] Unknown tag %s", tag); 1543 1613 exit(1); … … 1548 1618 1549 1619 1550 ////////////////////////////////////////// 1551 void psegNode(xmlTextReaderPtr reader) { 1620 ////////////////////////////////////// 1621 void psegNode(xmlTextReaderPtr reader) 1622 { 1552 1623 unsigned int ok; 1553 1624 paddr_t ll_value; 1554 1625 char * str; 1555 1626 1556 if (xmlTextReaderNodeType(reader) == XML_READER_TYPE_END_ELEMENT) { 1557 return; 1558 } 1559 1560 if (pseg_index >= MAX_PSEGS) { 1627 if (xmlTextReaderNodeType(reader) == XML_READER_TYPE_END_ELEMENT) return; 1628 1629 if (pseg_index >= MAX_PSEGS) 1630 { 1561 1631 printf("[XML ERROR] The number of psegs is larger than %d\n", MAX_PSEGS); 1562 1632 exit(1); … … 1574 1644 printf(" name = %s\n", str); 1575 1645 #endif 1576 if (ok) { 1646 if (ok) 1647 { 1577 1648 strncpy(pseg[pseg_index]->name, str, 31); 1578 1649 } 1579 else { 1650 else 1651 { 1580 1652 printf("[XML ERROR] illegal or missing <name> for pseg %d in cluster %d\n", 1581 1653 pseg_index, cluster_index); … … 1591 1663 else if (ok && (strcmp(str, "ROM" ) == 0)) { pseg[pseg_index]->type = PSEG_TYPE_ROM; } 1592 1664 else if (ok && (strcmp(str, "PERI") == 0)) { pseg[pseg_index]->type = PSEG_TYPE_PERI; } 1593 else { 1665 else 1666 { 1594 1667 printf("[XML ERROR] illegal or missing <type> for pseg %s in cluster %d\n", 1595 1668 pseg[pseg_index]->name, cluster_index); … … 1602 1675 printf(" base = 0x%llx\n", ll_value); 1603 1676 #endif 1604 if (ok) { 1677 if (ok) 1678 { 1605 1679 pseg[pseg_index]->base = ll_value; 1606 1680 } … … 1616 1690 printf(" length = 0x%llx\n", ll_value); 1617 1691 #endif 1618 if (ok) { 1692 if (ok) 1693 { 1619 1694 pseg[pseg_index]->length = ll_value; 1620 1695 } 1621 else { 1696 else 1697 { 1622 1698 printf("[XML ERROR] illegal or missing <length> for pseg %s in cluster %d\n", 1623 1699 pseg[pseg_index]->name, cluster_index); … … 1659 1735 found_timer = 0; 1660 1736 found_icu = 0; 1737 found_xcu = 0; 1661 1738 found_dma = 0; 1662 1739 found_mmc = 0; … … 1667 1744 1668 1745 // checking source file consistency 1669 if (cluster_index >= header->clusters) { 1746 if (cluster_index >= header->clusters) 1747 { 1670 1748 printf("[XML ERROR] The cluster index is too large : %d\n", cluster_index); 1671 1749 exit(1); … … 1679 1757 /////////// check cluster index attribute (optional) 1680 1758 value = getIntValue(reader, "index", &ok); 1681 if (ok && (value != cluster_index)) { 1759 if (ok && (value != cluster_index)) 1760 { 1682 1761 printf("[XML ERROR] wrong cluster index / expected value is %d", 1683 1762 cluster_index); … … 1714 1793 { 1715 1794 1716 ///////// ///////// peripherals checks /////////////////////////1717 if ( (found_timer && use_xicu) || (!found_timer && !use_xicu))1718 { 1719 printf("[XML ERROR] illegal ormissing timer peripheral in cluster %d\n", cluster_index);1795 ///////// TIMER and ICU peripheral are mandatory ////////////// 1796 if (!found_timer && !found_xcu) 1797 { 1798 printf("[XML ERROR] missing timer peripheral in cluster %d\n", cluster_index); 1720 1799 exit(1); 1721 1800 } 1722 1801 1723 if (!found_icu )1724 { 1725 printf("[XML ERROR] illegal ormissing icu peripheral in cluster %d\n", cluster_index);1802 if (!found_icu && !found_xcu) 1803 { 1804 printf("[XML ERROR] missing icu peripheral in cluster %d\n", cluster_index); 1726 1805 exit(1); 1727 1806 } 1728 1729 if (!found_dma)1730 {1731 printf("[XML ERROR] illegal or missing dma peripheral in cluster %d\n", cluster_index);1732 exit(1);1733 }1734 1735 1807 1736 1808 if (nb_proc_max < cluster[cluster_index]->procs) … … 1757 1829 void clusterSetNode(xmlTextReaderPtr reader) 1758 1830 { 1759 if (xmlTextReaderNodeType(reader) == XML_READER_TYPE_END_ELEMENT) { return; }1831 if (xmlTextReaderNodeType(reader) == XML_READER_TYPE_END_ELEMENT) return; 1760 1832 1761 1833 #if XML_PARSER_DEBUG … … 1798 1870 return; 1799 1871 } 1800 else { 1872 else 1873 { 1801 1874 printf("[XML ERROR] Unknown tag in clusterset node : %s",tag); 1802 1875 exit(1); … … 1807 1880 1808 1881 1809 ///////////////////////////////////////////// 1810 void globalSetNode(xmlTextReaderPtr reader) { 1811 if (xmlTextReaderNodeType(reader) == XML_READER_TYPE_END_ELEMENT) { 1812 return; 1813 } 1882 /////////////////////////////////////////// 1883 void globalSetNode(xmlTextReaderPtr reader) 1884 { 1885 if (xmlTextReaderNodeType(reader) == XML_READER_TYPE_END_ELEMENT) return; 1814 1886 1815 1887 #if XML_PARSER_DEBUG … … 1825 1897 else if (strcmp(tag, "#text") == 0) { } 1826 1898 else if (strcmp(tag, "#comment") == 0) { } 1827 else if (strcmp(tag, "globalset") == 0) { 1899 else if (strcmp(tag, "globalset") == 0) 1900 { 1828 1901 #if XML_PARSER_DEBUG 1829 1902 printf(" end global set\n\n"); … … 1833 1906 return; 1834 1907 } 1835 else { 1908 else 1909 { 1836 1910 printf("[XML ERROR] Unknown tag in globalset node : %s",tag); 1837 1911 exit(1); … … 1842 1916 1843 1917 1844 ///////////////////////////////////////////// 1845 void vspaceSetNode(xmlTextReaderPtr reader) { 1918 /////////////////////////////////////////// 1919 void vspaceSetNode(xmlTextReaderPtr reader) 1920 { 1846 1921 if (xmlTextReaderNodeType(reader) == XML_READER_TYPE_END_ELEMENT) { 1847 1922 return; … … 1861 1936 else if (strcmp(tag, "#text" ) == 0 ) { } 1862 1937 else if (strcmp(tag, "#comment" ) == 0 ) { } 1863 else if (strcmp(tag, "vspaceset") == 0 ) { 1938 else if (strcmp(tag, "vspaceset") == 0 ) 1939 { 1864 1940 // checking source file consistency 1865 if (vspace_index != header->vspaces) { 1941 if (vspace_index != header->vspaces) 1942 { 1866 1943 printf("[XML ERROR] Wrong number of vspaces\n"); 1867 1944 exit(1); 1868 1945 } 1869 else { 1946 else 1947 { 1870 1948 header->vsegs = vseg_index; 1871 1949 header->vobjs = vobj_index; … … 1874 1952 } 1875 1953 } 1876 else { 1954 else 1955 { 1877 1956 printf("[XML ERROR] Unknown tag in vspaceset node : %s",tag); 1878 1957 exit(1); … … 1883 1962 1884 1963 1885 //////////////////////////////////////// //1964 //////////////////////////////////////// 1886 1965 void headerNode(xmlTextReaderPtr reader) 1887 1966 { … … 1890 1969 unsigned int ok; 1891 1970 1892 if (xmlTextReaderNodeType(reader) == XML_READER_TYPE_END_ELEMENT) { return; }1971 if (xmlTextReaderNodeType(reader) == XML_READER_TYPE_END_ELEMENT) return; 1893 1972 1894 1973 #if XML_PARSER_DEBUG … … 1900 1979 ////////// get name attribute 1901 1980 name = getStringValue(reader, "name", &ok); 1902 if (ok) { 1981 if (ok) 1982 { 1903 1983 #if XML_PARSER_DEBUG 1904 1984 printf(" name = %s\n", name); … … 1906 1986 strncpy( header->name, name, 31); 1907 1987 } 1908 else { 1988 else 1989 { 1909 1990 printf("[XML ERROR] illegal or missing <name> attribute in header\n"); 1910 1991 exit(1); … … 1913 1994 /////////// get cluster_x attribute 1914 1995 cluster_x = getIntValue(reader, "cluster_x", &ok); 1915 if (ok) { 1996 if (ok) 1997 { 1916 1998 #if XML_PARSER_DEBUG 1917 1999 printf(" cluster_x = %d\n", cluster_x); … … 1919 2001 header->cluster_x = cluster_x; 1920 2002 } 1921 else { 2003 else 2004 { 1922 2005 printf("[XML ERROR] illegal or missing <cluster_x> attribute in header\n"); 1923 2006 exit(1); … … 1926 2009 /////////// get cluster_y attribute 1927 2010 cluster_y = getIntValue(reader, "cluster_y", &ok); 1928 if (ok) { 2011 if (ok) 2012 { 1929 2013 #if XML_PARSER_DEBUG 1930 2014 printf(" cluster_y = %d\n", cluster_y); … … 1932 2016 header->cluster_y = cluster_y; 1933 2017 } 1934 else { 2018 else 2019 { 1935 2020 printf("[XML ERROR] illegal or missing <cluster_y> attribute in header\n"); 1936 2021 exit(1); … … 1939 2024 //check the number of cluster 1940 2025 value = cluster_x * cluster_y; 1941 if (value >= MAX_CLUSTERS) { 2026 if (value >= MAX_CLUSTERS) 2027 { 1942 2028 printf("[XML ERROR] The number of clusters is larger than %d\n", MAX_CLUSTERS); 1943 2029 exit(1); … … 1952 2038 ///////// get vspaces attribute 1953 2039 value = getIntValue(reader, "vspaces", &ok); 1954 if (ok) { 1955 if (value >= MAX_VSPACES) { 2040 if (ok) 2041 { 2042 if (value >= MAX_VSPACES) 2043 { 1956 2044 printf("[XML ERROR] The number of vspaces is larger than %d\n", MAX_VSPACES); 1957 2045 exit(1); … … 1962 2050 header->vspaces = value; 1963 2051 } 1964 else { 2052 else 2053 { 1965 2054 printf("[XML ERROR] illegal or missing <vspaces> attribute in mapping\n"); 2055 exit(1); 2056 } 2057 2058 ///////// get increment attribute 2059 value = getIntValue(reader, "increment", &ok); 2060 if (ok) 2061 { 2062 if ( (value != 0x10000) && (value != 0x8000) && 2063 (value != 0x4000) && (value != 0x2000) ) 2064 2065 { 2066 printf("[XML ERROR] The vseg increment must be one of the following: "); 2067 printf(" 0x00010000 / 0x00008000 / 0x00004000 / 0x00002000"); 2068 exit(1); 2069 } 2070 #if XML_PARSER_DEBUG 2071 printf(" increment = %d\n", value); 2072 #endif 2073 header->increment = value; 2074 } 2075 else 2076 { 2077 printf("[XML ERROR] illegal or missing <increment> attribute in mapping\n"); 1966 2078 exit(1); 1967 2079 } … … 1985 2097 1986 2098 int status = xmlTextReaderRead(reader); 1987 while (status == 1) { 2099 while (status == 1) 2100 { 1988 2101 const char * tag = (const char *) xmlTextReaderConstName(reader); 1989 2102 1990 if (strcmp(tag, "clusterset") == 0) { 2103 if (strcmp(tag, "clusterset") == 0) 2104 { 1991 2105 clusterSetNode(reader); 1992 2106 } … … 1995 2109 else if (strcmp(tag, "#text") == 0) { } 1996 2110 else if (strcmp(tag, "#comment") == 0) { } 1997 else if (strcmp(tag, "mapping_info") == 0) { 2111 else if (strcmp(tag, "mapping_info") == 0) 2112 { 1998 2113 #if XML_PARSER_DEBUG 1999 2114 printf("end mapping_info\n"); … … 2001 2116 return; 2002 2117 } 2003 else { 2118 else 2119 { 2004 2120 printf("[XML ERROR] Unknown tag in header node : %s\n",tag); 2005 2121 exit(1); … … 2012 2128 /////////////////////////////////////// 2013 2129 void BuildTable(int fdout, const char * type, unsigned int nb_elem, 2014 unsigned int elem_size, char ** table) { 2130 unsigned int elem_size, char ** table) 2131 { 2015 2132 unsigned int i; 2016 2133 // write element … … 2027 2144 } 2028 2145 2029 2030 int open_file(const char * file_path) {2031 2146 ///////////////////////////////////// 2147 int open_file(const char * file_path) 2148 { 2032 2149 //open file 2033 2150 int fdout = open( file_path, (O_CREAT | O_RDWR), (S_IWUSR | S_IRUSR) ); 2034 if (fdout < 0) { 2151 if (fdout < 0) 2152 { 2035 2153 perror("open"); 2036 2154 exit(1); … … 2038 2156 2039 2157 //reinitialise the file 2040 if (ftruncate(fdout, 0)) { 2158 if (ftruncate(fdout, 0)) 2159 { 2041 2160 perror("truncate"); 2042 2161 exit(1); … … 2051 2170 2052 2171 2053 /////////////////////////// 2054 void buildBin(const char * file_path) { 2172 ///////////////////////////////////// 2173 void buildBin(const char * file_path) 2174 { 2055 2175 unsigned int length; 2056 2176 2057 2177 int fdout = open_file(file_path); 2178 2179 #if XML_PARSER_DEBUG 2180 printf("Building map.bin for %s\n", header->name); 2181 printf("signature = %x\n", header->signature); 2182 printf("clusters = %d\n", header->clusters); 2183 printf("vspaces = %d\n", header->vspaces); 2184 printf("psegs = %d\n", header->psegs); 2185 printf("vobjs = %d\n", header->vobjs); 2186 printf("vsegs = %d\n", header->vsegs); 2187 printf("tasks = %d\n", header->tasks); 2188 printf("procs = %d\n", header->procs); 2189 printf("irqs = %d\n", header->irqs); 2190 printf("coprocs = %d\n", header->coprocs); 2191 printf("periphs = %d\n", header->periphs); 2192 #endif 2058 2193 2059 2194 // write header to binary file 2060 2195 length = write(fdout, (char *) header, sizeof(mapping_header_t)); 2061 if (length != sizeof(mapping_header_t)) { 2196 if (length != sizeof(mapping_header_t)) 2197 { 2062 2198 printf("write header error : length = %d \n", length); 2063 2199 exit(1); … … 2160 2296 int fdout = open_file(file_path); 2161 2297 2162 char * prol = "/* Generated from the mapping_info file */\n\n"; 2163 char * ifdef = "#ifndef _HD_CONFIG_H\n#define _HD_CONFIG_H\n\n"; 2164 char * epil = "\n#endif //_HD_CONFIG_H"; 2298 char prol[80]; 2299 sprintf(prol, "/* Generated from file %s.xml */\n\n",header->name); 2300 2301 char * ifdef = "#ifndef _HARD_CONFIG_H\n#define _HARDD_CONFIG_H\n\n"; 2302 char * epil = "\n#endif //_HARD_CONFIG_H"; 2165 2303 2166 2304 file_write(fdout, prol); … … 2187 2325 file_write(fdout, "\n"); 2188 2326 2189 def_int_write(fdout, "USE_XICU ", use_x icu);2327 def_int_write(fdout, "USE_XICU ", use_xcu); 2190 2328 def_int_write(fdout, "USE_IOB ", use_iob); 2191 2329 … … 2210 2348 unsigned int vseg_id; 2211 2349 2212 char * prol = "/* Generated from the mapping_info file */\n\n"; 2350 char prol[80]; 2351 sprintf(prol, "/* Generated from file %s.xml */\n\n",header->name); 2352 2213 2353 file_write(fdout, prol); 2214 2354 … … 2273 2413 file_write(fdout, "\n"); 2274 2414 2415 // fill the peripheral base address array 2416 set_periph_vbase_array(); 2417 2275 2418 // non replicated peripherals 2276 2419 ld_write(fdout, "seg_cma_base ", periph_vbase_array[PERIPH_TYPE_CMA]); … … 2285 2428 2286 2429 // replicated peripherals 2430 ld_write(fdout, "seg_xcu_base ", periph_vbase_array[PERIPH_TYPE_XCU]); 2287 2431 ld_write(fdout, "seg_icu_base ", periph_vbase_array[PERIPH_TYPE_ICU]); 2288 2432 ld_write(fdout, "seg_tim_base ", periph_vbase_array[PERIPH_TYPE_TIM]); 2289 2433 ld_write(fdout, "seg_dma_base ", periph_vbase_array[PERIPH_TYPE_DMA]); 2290 2434 ld_write(fdout, "seg_mmc_base ", periph_vbase_array[PERIPH_TYPE_MMC]); 2435 2436 file_write(fdout, "\n"); 2437 2438 ld_write(fdout, "vseg_cluster_increment ", header->increment); 2291 2439 2292 2440 close(fdout); … … 2323 2471 } 2324 2472 2325 2326 2473 char * map_path = buildPath(argv[2], "map.bin"); 2327 2474 char * ld_path = buildPath(argv[2], "giet_vsegs.ld"); … … 2333 2480 xmlTextReaderPtr reader = xmlReaderForFile(argv[1], NULL, 0); 2334 2481 2335 if (reader != NULL) { 2482 if (reader != NULL) 2483 { 2336 2484 status = xmlTextReaderRead (reader); 2337 while (status == 1) { 2485 while (status == 1) 2486 { 2338 2487 const char * tag = (const char *) xmlTextReaderConstName(reader); 2339 2488 2340 if (strcmp(tag, "mapping_info") == 0) { 2489 if (strcmp(tag, "mapping_info") == 0) 2490 { 2341 2491 headerNode(reader); 2342 2492 prepareBuild(); … … 2345 2495 genLd(ld_path); 2346 2496 } 2347 else { 2497 else 2498 { 2348 2499 printf("[XML ERROR] Wrong file type: \"%s\"\n", argv[1]); 2349 2500 return 1; … … 2353 2504 xmlFreeTextReader(reader); 2354 2505 2355 if (status != 0) { 2506 if (status != 0) 2507 { 2356 2508 printf("[XML ERROR] Wrong Syntax in \"%s\" file\n", argv[1]); 2357 2509 return 1;
Note: See TracChangeset
for help on using the changeset viewer.