1 / 51

LAB3 SUMMARY -- Material coming from XUP

LAB3 SUMMARY -- Material coming from XUP. YangLi MicroElectronics school. OPB Bus. PLB Bus. UART. GPIO. DIP Switches. PLB2OPB. PPC. GPIO. Push Buttons. PLB BRAM Cntlr. PLB BRAM . MY IP. LEDs. PLB BRAM Cntlr. PLB BRAM . Timer. INTC. ICON. IBA. Lab 3 Adding Custom IP.

maddock
Download Presentation

LAB3 SUMMARY -- Material coming from XUP

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. LAB3 SUMMARY-- Material coming from XUP YangLi MicroElectronics school

  2. OPB Bus PLB Bus UART GPIO DIP Switches PLB2OPB PPC GPIO Push Buttons PLB BRAM Cntlr PLB BRAM MY IP LEDs PLB BRAM Cntlr PLB BRAM Timer INTC ICON IBA Lab 3 Adding Custom IP • The Create/Import Peripheral Wizard • The wizard creates the necessary directory structure and adds the necessary files (MPD:Microprocessor Peripheral Definition , PAO:Peripheral Analyze Order ) to the project directory. 嵌入式系统 -2008年春

  3. Overview • The peripherals are connected to the microprocessor by using the data and address buses • Xilinx has implemented IBM's CoreConnect bus architecture • On-chip Peripheral Bus (OPB) version 2.1 of the CoreConnect architecture is designed for easy connection of on-chip peripheral devices • Any custom peripheral that connects to the OPB bus must do the following: • Meet the principles of the OPB protocol • Meet the requirements of the Platform Generator • This allows you to take advantage of the simple automated flow that generates the system-level architecture 嵌入式系统 -2008年春

  4. <Sln>_xferAck <Sln>_errAck <Sln>_toutSup <Sln>_retry <Sln>_DBus OPB Bus Logic OPB Slave OPB_select OPB_RNW OPB_BE OPB_seqAddr OPB_ABus OPB_DBus Interface Signals • Global OPB slave signals • Slave signals • <Sln>_xferAck • <Sln>_errAck • <Sln>_toutSup • <Sln>_retry • <Sln>_DBus • OPB bus signals • OPB_select • OPB_RNW • OPB_BE • OPB_seqAddr • OPB_Abus • OPB_DBus 嵌入式系统 -2008年春

  5. Project Directory MyProcessorIPLib pcores pcores <ip_name> <ip_name> data simmodels hdl devl verilog vhdl MPD PAO BBD XPS Directory Structure • Platform Generator searches the following directories for IP: • pcores directory (located in theproject directory) • MyProcessorIPLib directory(user defined) • Repository Directory listed usingProjectProject OptionsDevice and Repository tab 嵌入式系统 -2008年春

  6. File Usage • There are two ways to integrate your own IP into XPS • As a blackbox • Synthesized with XST or a third-party synthesis tool • Requires MPD and BBD • As HDL • Synthesized with the rest of the processor system • Uses XST • Requires MPD and PAO 嵌入式系统 -2008年春

  7. Where Can I Learn More? • Tool documentation • Platform Specification Format Reference Manual • Processor IP Reference Guide • Embedded System Tools Guide  Create/Import Peripheral Wizard • Embedded System Tools Guide  Microprocessor Peripheral Description • Embedded System Tools Guide  Peripheral Analyze Order • Xilinx Drivers • Support website • EDK Home Page: support.xilinx.com/edk 嵌入式系统 -2008年春

  8. LAB4 SUMMARY-- Material coming from XUP YangLi MicroElectronics school 嵌入式系统 -2008年春

  9. Writing Basic Software Applications Echo DIP switch settings on the LEDs OPB Bus PLB Bus UART GPIO DIP Switches PLB2OPB PPC GPIO Push Buttons PLB BRAM Cntlr PLB BRAM MY IP LEDs PLB BRAM Cntlr PLB BRAM Timer INTC ICON IBA 嵌入式系统 -2008年春

  10. Summary • XPS can be used to define, develop, and integrate the software components of the embedded system. • A device driver interface can be defined for each of the peripherals and the processor. • XPS creates an MSS file that represents the software side of the processor system. • The peripheral-specific functional software can be developed and compiled. • The executable file can be generated from the compiled object codes and libraries. • The linker script can be edited to control placement of various code segments into target memory 嵌入式系统 -2008年春

  11. Embedded Development Target Computer • Development takes place on one machine (host) and is downloaded to the embedded system (target) Host Computer A cross-compiler is run on the host 嵌入式系统 -2008年春

  12. Embedded Development • Different set of problems • Unique hardware for every design • Reliability • Real-time response requirement (sometimes) • RTOS versus OS • Code compactness • High-level languages and assembly 嵌入式系统 -2008年春

  13. Software Platform Settings • Software settings can be assigned to individual processor instance by selecting Software  Software Platform Settings or clicking button on the toolbar • In case of multiple processors in the design software platform settings allow you to select each processor instance and set parameters 嵌入式系统 -2008年春

  14. Software Platform 1 Select Software Platform panel Select processor instance Select OS Check desired libraries and their version 2 1 2 3 3 4 4 嵌入式系统 -2008年春

  15. OS and Libraries 1 Select OS and Libraries panel Select processor instance Set stdin and stdout devices as well as assign fpu, malloc, and profiling related parameters Configure selected libraries parameters 2 1 3 2 4 3 4 嵌入式系统 -2008年春

  16. Drivers 1 Select Drivers panel Select drivers and version for each device in the design 1 2 2 嵌入式系统 -2008年春

  17. Interrupt Handlers 1 Select Interrupt Handler panel If an interrupt signal is used from any peripheral then a corresponding entry will be listed Enter interrupt handler function name 1 2 2 3 3 嵌入式系统 -2008年春

  18. Software Design Environment • The Library Generator (LibGen) utility generates the necessary libraries and drivers for the embedded processors • LibGen takes an MSS (Microprocessor Software Specification) file created by the user as input. The MSS file defines the drivers associated with peripherals, standard input/output devices, interrupt handler routines, and other related software features • The MSS file is generated by XPS by using the software settings specified 嵌入式系统 -2008年春

  19. project_directory Processor instance directory code directory include directory lib directory libsrc directory LibGen • code directory • A repository for EDK executables • include directory • C header files that are required by drivers • xparameters.h • Defines base and high addresses of the peripherals in the system • Defines the peripheral IDs required by the drivers and user programs • Defines the function prototypes LibGen Generated Directories Note: The number of processor instance directoriesgenerated is related to the number of processor instances present in the system 嵌入式系统 -2008年春

  20. project_directory processor instance directory code directory include directory lib directory libsrc directory LibGen • lib directory • libc.a, libm.a and libxil.a libraries • The libxil library contains driver functions that the particular processor can access • libsrc directory • Intermediate files and makefiles that compile the libraries and drivers • Peripheral-specific driver files that are copied from the EDK and user driver directories LibGen Generated Directories Note: The processor instance directories content is overwritten every time LibGen is run 嵌入式系统 -2008年春

  21. GNU Tools: GCC • GCC translates C source code into assembly language • GCC also functions as the user interface to the GNU assembler and to the GNU linker, calling the assembler and the linker with the appropriate parameters • Supported cross-compilers: • PowerPC processor compiler • GNU GCC (powerpc-eabi-gcc) • Wind River Diab compiler (dcc) • MicroBlaze processor compiler • GNU GCC (mb-gcc) • Command line only; uses the settings set through the GUI C files Cross-compiler Assembly files 嵌入式系统 -2008年春

  22. GNU Tools • Calls four different executables • Preprocessor (cpp0) • Language specific c-compiler • cc1 C-programming language • cc1plus C++ language • Assembler • mb-as (MicroBlaze processor) • powerpc-eabi-as (PowerPC processor) • Linker and loader • mb-ld (MicroBlaze processor) • powerpc-eabi-ld (PowerPC processor) 嵌入式系统 -2008年春

  23. Binutils: Binary Utilities • AR Archiver • Create, modify, and extract from libraries • Used in EDK to combine the object files of the Board Support Package (BSP) in a library • Used in EDK to extract object files from different libraries • OBJDUMP • Display information from object files and executables • Header information, memory map • Data • Disassemble code • GNU executables • powerpc-eabi-objdump • mb-objdump 嵌入式系统 -2008年春

  24. Where Can I Learn More? • Tool documentation • Platform Specification Format Reference Manual • Microprocessor Software Specifications • Microprocessor Driver Definition • Microprocessor Library Definition • EDK OS and Libraries Reference Guide  LibXil File, Net, and Kernel • Processor IP Reference Guide • Xilinx Drivers • Processor documentation • PowerPC Processor Reference Guide • PowerPC 405 Processor Block Reference Guide • Support website • EDK Home Page: support.xilinx.com/edk 嵌入式系统 -2008年春

  25. Address Management • Embedded processor design requires you to manage the following: • Address map for the peripherals • Location of the application code in the memory space • Block RAM • External memory • Memory requirements for your programs are based on the following: • The amount of memory required for storing the instructions • The amount of memory required for storing the data associated with the program 嵌入式系统 -2008年春

  26. 0xFFFF_FFFC Reset Address PLB/OPB Memory 0xFFFF_0000 PLB/OPB Memory Peripherals 0x0000_0000 PowerPC Processor • Memory and peripherals • PPC405 uses 32-bit addresses • Special addresses • Every PowerPC™ system should havethe boot section starting at0xFFFFFFFC • Default linker options • Program space occupies a contiguousaddress space from 0xFFFF0000 to0xFFFFFFFF • Stack size: 4 KB • Heap size: 4 KB 嵌入式系统 -2008年春

  27. Advanced UserAddress Space • Different base address, noncontiguous user address space • You can place different components of your program in different memories • For example, on PowerPC systems, you can keep your code on instruction cache memory and the data on ZBT memory • Noncontiguous executables that represent the application must be created • To do this, a linker script must be used 嵌入式系统 -2008年春

  28. Object File Sections • What is an object file? • An object file is an assembled piece of code • Machine language: li r31,0 = 0x3BE0 0000 • Constant data • There may be references to external objects that are defined elsewhere • This file may contain debugging information 嵌入式系统 -2008年春

  29. Object File Sections .text .rodata .sdata2 .data .sdata .sbss .bss …… Text section Read-only data section Small read-only data section (less than eight bytes) Read-write data section Small read-write data section Small uninitialized data section Uninitialized data section 嵌入式系统 -2008年春

  30. Sections Example int ram_data[10] = {0,1,2,3,4,5,6,7,8,9}; /* DATA */ const int rom_data[10] = {9,8,7,6,5,4,3,2,1}; /* RODATA */ int I; /* BSS */ main(){ ... I = I + 10; /* TEXT */ ... } 嵌入式系统 -2008年春

  31. Linker Scripts • Linker scripts • Control the linking process • Map the code and data to a specified memory space • Set the entry point to the executable • Reserve space for the stack • Required if the design contains a discontinuous memory space 嵌入式系统 -2008年春

  32. Link Linker and Locator Flows Executable Image foo1.o Merged Output Sections 0xFFFF .text1 Code .text .data1 0xF000 Locate 0xEFFF .bss1 uninitialized data 0xEF00 .data 0xEEFF foo2.o .bss Unused .text2 0x2000 .data2 0x1FFF Initialized data .bss2 0x0000 嵌入式系统 -2008年春

  33. PowerPC Processor Script Example STACKSIZE = 4k; MEMORY { ddr : ORIGIN = 0x00000000, LENGTH = 32m sram : ORIGIN = 0x10000000, LENGTH = 2m flash : ORIGIN = 0x18000000, LENGTH = 32m bram : ORIGIN = 0xffff8000, LENGTH = 32k - 4 boot : ORIGIN = 0xfffffffc, LENGTH = 4 } SECTIONS { .text : { *(.text) } > bram .boot : { *(.boot) } > boot .data : { *(.data) *(.got2) *(.rodata) *(.fixup)} > bram .bss : { *(.bss) } > bram __bss_start = ADDR(.bss); __bss_end = ADDR(.bss) + SIZEOF(.bss); } 嵌入式系统 -2008年春

  34. Sections Command • This is where most of the work takes place • Output sections are named, and the input sections are grouped and linked together into the output sections • Example: • Explanation: • .text is the name of the output section • { *(.text) *.(init) } includes all input sections named text and init from the object files being linked • > bram locates the .text output section in the next available memory in the block RAM area • .text : { *(.text) *(.init) } > bram 嵌入式系统 -2008年春

  35. Linker Script Generator GUI • XPS contains a graphical Linker Script Generator • Table-based GUI allows you to define the memory space for any section • Launch from Software → Generate LinkerScript, or from the Applications Tab, right-click on <project> → Generate LinkerScript • The tool will create a new linker script (the old script is backed up) 嵌入式系统 -2008年春

  36. Where Can I Learn More? • Tool documentation • Embedded System Tools Guide  Address Management • Embedded Systems Tools Guide  Stand-Alone Board Support Package • Embedded Systems Tools Guide  GNU Compiler Tools • Support Website • EDK Website: www.xilinx.com/edk • GNU Website: http://gcc.gnu.org/onlinedocs/gcc-3.4.4/gcc 嵌入式系统 -2008年春

  37. LAB5~6 SUMMARY-- Material coming from XUP YangLi MicroElectronics school 嵌入式系统 -2008年春

  38. Add Timer and Interrupt Controller Write Interrupt Service Routine OPB Bus PLB Bus UART GPIO DIP Switches PLB2OPB PPC GPIO Push Buttons PLB BRAM Cntlr PLB BRAM MY IP LEDs PLB BRAM Cntlr PLB BRAM Timer INTC ICON IBA 嵌入式系统 -2008年春

  39. OPB Bus PLB Bus UART GPIO DIP Switches PLB2OPB PPC GPIO Push Buttons PLB BRAM Cntlr PLB BRAM MY IP LEDs PLB BRAM Cntlr PLB BRAM Timer INTC ICON IBA Add Chipscope Cores Cross Debug with SDK Debugger and Chipscope-Pro Analyzer • performing cross debug with GNU Debugger and Chipscope-Pro. • The Software Development Kit (SDK) will be used to debug the software code and monitor variables and memory content. 嵌入式系统 -2008年春

  40. Xilinx Platform Studio Software Development Kit (SDK) • Java-based application development environment • Based on the open-source effort by the Eclipse Consortium\ • Feature-rich C/C++ code editor and compilation environment • Project management • Application build configuration and automatic Makefile generation • Error Navigation • Well-integrated environment for seamless debugging of embedded targets • Source code version control 嵌入式系统 -2008年春

  41. Platform Studio SDK SDK Application Development Flow Platform Studio Generate Hardware Platform Create software App Project Generate Software Platform Add sources + Edit libraries, drivers Compile + Link Debug / Profile Done? Import ELF file, Download to board Yes 嵌入式系统 -2008年春

  42. SDK Workbench C/C++ project outline displays the elements of a project with file decorators (icons) for easy identification C/C++ editor for integrated software creation Code outline displays elements of the software file under development with file decorators (icons) for easy identification Problems, Console, Properties view lists output information associated with the software development flow 1 2 1 3 2 3 4 4 嵌入式系统 -2008年春

  43. Debugging • Debugging is an integral part of embedded systems development • The debugging process is defined as testing, stabilizing, localizing, and correcting errors • Two methods of debugging • Hardware debugging • via a logic probe, logic analyzer, in-circuit emulator, or background debugger • Software debugging via a debugging instrument • A software debugging instrument is source code that is added to the program for the purpose of debugging • Debugging types • Functional debugging • Performance debugging 嵌入式系统 -2008年春

  44. Hardware Debugging Support • ChipScope™ Pro tool cores are now included for adding to a Xilinx Platform Studio design • PLB IBA (Integrated Bus Analyzer) • OPB IBA • VIO (Virtual I/O) • ChipScope Pro tool available thru donation • Enables co-debug of software with GNU gdb and hardware with ChipScope Analyzer 嵌入式系统 -2008年春

  45. Software Debugging Support • EDK supports software debugging via: • GNU Debugger (GDB) tools • Unified interface for debugging and verifying MicroBlaze and PowerPC systems • Xilinx Microprocessor Debugger (XMD) • Runs all of the hardware debugging tools and communicates with the hardware • GNU tools communicate with the hardware through XMD 嵌入式系统 -2008年春

  46. GDB Functionality • GDB is a source-level debugger that helps you debug your program: • Start your program • Set breakpoints (make your program stop on specified conditions) • Examine what has happened, when your program encounters breakpoints • Registers • Memory • Stack • Variables • Expressions • Change things in your program, so you can experiment with correcting the effects of one bug and go on to learn about another • You can use GDB to debug programs written in C and C++ 嵌入式系统 -2008年春

  47. XMD Functionality • Xilinx Microprocessor Debug (XMD) engine • A program that facilitates a unified GDB interface • A Tool command language(TCL) interface • XMD supports debugging user programs on different targets • Cycle-accurate PowerPC processor instruction set simulator • PowerPC system on a hardware board • GDBcommunicates with xmd by using the Remote TCP protocol and control the corresponding targets • GDB can connect to xmd on the same computer or on a remote computer on the Internet 嵌入式系统 -2008年春

  48. MDM IBA IBA Simultaneous HW/SW Debug Minimal “skid-by” as cross triggering is done on chip between IBA cores and PPC & MicroBlaze debug interfaces • ChipScope™ Pro PLB & IBA cores in target • ChipScope Pro Analyzer on host • GDB debugger on host • XMD supports simultaneous access over Xilinx parallel cables • PLB/OPB IBA instantiation in XPS • Are treated like the peripheral cores Set breakpoint in GDB – when hit → triggers ChipScope Set trigger in ChipScope – when hit → halts CPU and debugger stops 嵌入式系统 -2008年春

  49. Simultaneous HW/SW Debug Active trigger when addr bus = 0xC200 Trigger out signal from IBA to CPU debug halt signal in XMD Xilinx Parallel Cable 嵌入式系统 -2008年春

  50. SDK Debug Perspective The stack frame for target threads that you are debugging. Each thread in your program is represented as a node in the tree Variables, Breakpoints, and Registers views allow for viewing and real-time interaction with the view contents for more powerful debugging potential C/C++ editor highlights the location of the execution pointer, along with allowing the setting of breakpoints Code outline and disassembly view provide compiler level insight to what is occurring in the running source Console view lists output information 1 1 2 2 3 3 4 4 5 5 嵌入式系统 -2008年春

More Related