ARM DS-5 Development Studio

Transcription

ARM DS-5 Development StudioQUICK START GUIDEDS-5 supports all ARM IP, from Cortex -A, R and Mprocessors to the latest technologies likebig.LITTLE , multi-clusters and ARMv8.Crafted to give you everything you need to deal withthe complexity of modern SoCs, DS-5 lets you takefull advantage of the ARM architecture.Use this Quick Start Guide as a reference for yourfirst steps with DS-5, from installation tolaunching and using each tool.Inside:Get StartedIDE, Project Manager & TutorialsTarget Connection & Debug UnitsLinux & Android Application DebugDebug ConfigurationDS-5 Debug PerspectiveDebugger System ViewsInstruction, Data & System TracePerformance AnalysisStreamline Profiling ReportsStreamline Quick ReferenceThe Architecture for the Digital World

Quick Start GuideARM DS-5 DEVELOPMENT STUDIO GET STARTED WITH DS-5DS-5 DownloadsTo license your copy of DS-5, select Help - ARM LicenseManager and then click Add License. If you already have anaccount at ARM.com, you can use your existing username andpassword.Start your next project with a 30-day free trial of DS-5Professional Edition. Download DS-5 from ds.arm.com/downloads and use your evaluation license to explore the fullfeatures of DS-5 Pro.To upgrade or change a license, return to the ARM LicenseManager and either add a license file, or enter a valid serialnumber.The ds.arm.com website also provides documentation,tutorials and blogs to help you learn how to use DS-5 to itsmaximum potential.Environment VariablesFirst Time SetupThe DS-5 installer does not modify any environment variablesin your system.Install DS-5 following the on-screen prompts and launch theEclipse for DS-5 application. Create a new Workspacefolder to store your projects and settings.DS-5 only requires that the path environment variablepoints to the install directory \bin directory. This isdone automatically if you launch the tools from the Eclipsefor DS-5 or the DS-5 Command Prompt items in theWindows Start Menu.Welcome Screen and LicensingNext, you’ll see the Welcome screen, which gives you a quickway of importing the included example applications as well astutorials, hints and tips. To close the welcome screen, click onthe Go to Workbench link.You can get back to this screen atany time by selecting Help - Welcome.Running the tools from a Linux console requires you tomanually set the path environment variable.Eclipse Perspectives and ViewsA typical Eclipse workbench window contains one or moreperspectives, each of them including a set of related views,editors, menus, and toolbars.Minimum System RequirementsThe main Eclipse perspectives in DS-5 are: C/C : used to import and manage software projects, andto edit source files. DS-5 Debug: graphical interface for the DS-5 Debugger.DS-5 is supported on the x86 host platforms listed belowwith at least: 2 GHz dual-core host processor, 2 GB RAM (4GB recommended), 2 GB hard disk space.DS-5 also includes other perspectives, such as PyDev forcoding debugger Jython scripts. Windows XP Professional SP3 (32-bit)To open an Eclipse view, go to Window - Show View. Windows 7 Professional SP1 (32/64-bit)Reposition any view by left-clicking on its tab and dragging it. RHEL 5 Desktop & Workstation (32/64-bit)Detach (undock) the view to drag it to a second monitor, orright-click on its name to add it to the FastView bar. RHEL 6 Workstation (32/64-bit)Import Example Projects Ubuntu Desktop Edition 12.04 LTS (32/64-bit)From the C/C perspective, select File - Import. General - Existing Projects into Workspace. Mac OS X 10.7 (DS-5 Community Edition only)Activate Select archive file and choose an example .zip from install directory \examples\example.zip.The examples are decompressed into your workbenchdirectory and appear in the Project Explorer view.2

IDE, PROJECT MANAGER & TUTORIALSCreate and Build ProjectsRight-click on the Project Explorer and select New - C orC Project.DS-5 Example ProjectsSelect one of the six project templates in the DS-5 projectwizard: bare-metal executable or library, Linux executable,shared library or static library, and makefile project. Thiscreates a new project with working pre-defined compilersettings.cDS-5 comes complete with a range of examples to get youstarted including: Startup examples include reset, MMU and cacheinitialization code for ARM processors.Template-based source and header files can easily be added toa project. Right click on the project in the Project Explorerview and select New - Source File. Fireworks is a bare-metal example ported to theSnowball, Beagle and Panda boards.The DS-5 IDE includes powerful features to assist coding ofC/C and assembler files. These include syntax highlighting,code auto-completion, and quick-jump to declaration ofvariables and functions (F3 short-cut). Distribution is a complete Linux distribution to enabledriver and application development. N.B. requiresadditional download. Gnometris is an open source Linux application similarto the game Tetris.Find-in-files tools are grouped under the Search menu.To make or build a project, select Project - Build. Threads is a simple multi-threaded Linux application thatillustrates how the tools handle multiple threads. Xaos is an example fractal application, which comes witha pre-generated Streamline report.Source code editing features in DS-5 include C/C /asm syntaxcoloring, code autocompletion, refactoring and function, class andvariable definition. Example library demonstrates how to create a simpleshared library in C for ARM Linux. Application Rewind 1 & 2 allow you to rewindthrough two simple examples to locate software bugsusing reverse debugging techniques.ARM Compiler TutorialsAt ds.arm.com/tutorials, you can gain a deeperunderstanding of the ARM Compiler and the optimizationtechniques that it uses.By understanding how to control optimizations such asNEON autovectorization, instruction scheduling andcommon subexpression elimination, you can get the most outof your ARM processor and ensure that you have maximumvisibility during debug.Other DS-5 tutorials available online include projectmanagement and code editing, Streamline performanceoptimization and bare metal, Linux and Android debugging.3

Quick Start GuideARM DS-5 DEVELOPMENT STUDIO TARGET CONNECTION & DEBUG UNITSDSTREAM: High-Performance Debug & TraceLeft: DSTREAMThe DSTREAM Debug and Trace Unit provides DS-5Debugger with low-level debug and trace connection tohardware targets.Center: ULINKpro DDSTREAM enables DS-5 Debugger to bring up a platform anddebug bare metal software in stop-mode, with full access tothe processor and system resources.Thanks to its large buffer DSTREAM supports long-termoff-chip trace. This enables the debug of complex, time relatedsoftware bugs and performance optimization of critical code.ULINKpro D: Easy DebugThe ARM Keil ULINKpro family can be used with DS-5for software debug on popular devices based on the ARMCortex -M, Cortex-R and Cortex-A processor series.An ideal fit for equipment manufacturers using off-the-shelfprocessor devices, the ULINKpro family enables cost efficientrun-control debug on devices ranging from MCUs to multicoreapplication processors.DS-5 Configuration DatabaseDSTREAMDS-5 provides pre-configured JTAG and trace for catalogdevices. Just choose a device on the Debug Configurationsdialog to connect the debugger to one of these targets.Debug InterfaceJTAG and Serial-Wire DebugJTAG Speed60 MHzDownload2.5 MB/sTrace Buffer4 GBTrace Speed600 Mbps/pin (16-bit)Trace Frequency300 MHz DDRThe default DS-5 configuration database is stored on installdirectory \sw\debugger\configdb.You can also add customconfiguration databases by selecting Window - Preferences- DS-5 - Target Database.Debugging Custom DevicesLearn more: ds.arm.com/dstream/DS-5 ships with powerful tools for custom device bring-up: CSAT: This command line-based tool enables manualcontrol of the registers of a CoreSight Debug Access Portand script access to the IP blocks connected to it.ULINKpro D Debug Hardware Configuration: This graphical utilityreads the contents of a CoreSight ROM Table to autoconfigure the target connection. Manual configuration is alsoenabled. ConfigDB Import: Use it to import the new debughardware configuration into a configuration database. Thisutility outputs DTSL Python scripts (.py), which can beused to manually modify the configuration of each IP blockwith a simple scripting language.Debug InterfaceJTAG and Serial-Wire DebugJTAG Speed50 MHzDownload1 MB/sTraceETB trace supportSupported DevicesUp to quad-core Cortex-A9Learn more: ds.arm.com/ulinkpro/4

LINUX & ANDROID APPLICATION DEBUGConnecting to the TargetAll you need to debug and analyze Linux applications on anARM processor-based target is a TCP/IP connection betweenthe target and the host computer.Application Rewind - Go Back to the BugAndroid middleware and native application developmentnormally uses an Android Debug Bridge (ADB)connection over USB.User-space Linux application development in DS-5 isassisted by Application Rewind, which allows you to“reverse debug” your software once an error has occurred.DS-5 Debugger supports both connection types and can usethem to automatically download applications into the targetfile system, launch the gdbserver debug agent on the targetand connect to it.Application Rewind runs on a lightweight debug agent onyour target, so there’s no need for JTAG or CoreSightinstruction trace; simply connect over TCP/IP.DS-5 includes gdbserver v7.0, which enables debuggingNEON code and multi-threaded Android libraries.Read more: ds.arm.com/application-rewindLinux Target File SystemDS-5 integrates a Remote System Explorer (RSE) toaccess the Linux file system on hardware targets that supportthe Secure Shell (SSH). The target must include a secure shelldaemon (sshd) and sftp-server.Fixed Virtual Platforms (FVPs)RSE enables the following functionality: Automated software image download: DS-5 Debuggeruses RSE connections to automate the download of imagesto the target, executing gdbserver and connecting to it.Start bare metal and Linux software development without ahardware target. SFTP Files View: Access the target’s Linux file system usingan FTP connection. Navigate, copy, paste, drag and drop, andedit files on the target.DS-5 includes a sample FVP, which is a fast simulation modelof a complete ARM-based SoC with a processor, systemmemory, and peripherals such as keyboard, mouse, UARTs,Ethernet, and LCD. SSH Shell/Terminal View: Opens a shell or a terminalwindow connected to the target in order to execute Linuxcommands, for example to run an application.FVPs run at speeds comparable to the real hardware andsignificantly cut your development time.To run the example applications, download the ARM Linuxdistribution. When launched, the model automaticallyboots Linux and enters a state in which you can load anddebug your applications.Configure Remote System ExplorerOpen RSE by selecting Window - Show View - Other. Remote Systems - Remote Systems.FVPs are configured to mount a Virtual File System(VFS). The processor running in simulation can access filesin the host computer’s file system as if they were part of itsARM Linux file system.Click on the New Connection button. Select Linux and clickNext.Fill the host name box with the IP address of the target system,or its network name if it is registered on a DNS server. Definea name for the connection and click Next.For 64-bit applications, the ARMv8 ArchitectureEnvelope Model (AEM) is available for download forLinux, Android and bare-metal development.In the next configuration steps choose the Secure Shell(ssh) option, then click Finish.5

Quick Start GuideARM DS-5 DEVELOPMENT STUDIO DEBUG CONFIGURATIONLaunching DS-5 DebuggerClick on the down arrow of the Debug button on the menubar, or right-click on the Debug Control View to open theDebug Configurations dialog.Debug and Trace Services Layer (DTSL)Right-click on DS-5 Debugger and select New, or browseexisting debug configurations. If you have imported the DS-5examples into the Workbench, the Debug ConfigurationsDialog is populated with pre-configured target connections.DTSL is the ‘glue’ between the debugger and the target.This layer of the debugger is accessible from python scriptswhich are used to configure the debug and trace settings forindividual components of the SoC and the overall topology.Existing debug configurations can be launched by doubleclicking on the Debug Control View.Select Linux OS awareness or an RTOS per connection.These scripts are auto-generated by the debugger and canalso be modified to extend debugger functionality or workaround broken components on the SoC. Every device in theDS-5 database has a corresponding DTSL Python script.Use the DTSL options dialog to configure target specificoptions like PTM and ETM instruction and data trace, crosstriggers, clocks, power and ITM and STM instrumentationtrace.When used in conjunction with the optional DSTREAMTemplate Development Kit (TDK) it is even possible tomake the DS-5 debugger work with new user defined IPblocks.Add ELF images to the configuration for source level debug.Create a new DS-5Debug configuration andcustomize its nameSelect a target from theconfiguration database, or agdbserver connectionIn the Files tab, select anapplication and check “Loadsymbols” to enable sourcelevel debug.Customize and controltrace options from theDTSL configurationBrowse through themultiple tabs to configuredifferent IP blocks6

DS-5 DEBUG PERSPECTIVEDS-5 includes a powerful graphical C/C debugger, openedby launching the debugger from the Debug Configurationsdialog, or by clicking Window - Open Perspective Other. - DS-5 Debug. Alternatively, the debugger can beused from the host’s command line interface, or driven by aJython script.Each debug view is self-contained, so there is no need toconfigure any options using the Eclipse main menu. Note thatsome of the debugger views, for example the Trace view, areonly enabled for JTAG target connections. Each view has anoptions toolbar with further functions which can be explored.Click to focus the systemviews on a connection,core, thread or stack frameControl target executionwith source and assemblylevel steppingType GDB-style commandsDrag & drop lines fromwith auto-completion and history view to scripts viewhelpto create a scriptFast View bar forminimizing often-useddebug viewsSource and assembly codeviews synchronized withcolor codingClick the down arrow forthe sub-menu, to freeze andreplicate views7Screen buffer and systemviews have multipleformatting optionsSwitch between C/C and DS-5 DebuggerperspectivesLink the view to the activeconnection, or to a fixedconnection or processor

Quick Start GuideARM DS-5 DEVELOPMENT STUDIO DEBUGGER SYSTEM VIEWSSystem ViewsThe variables view shows the value of all the application’svariables under three groups: locals, file statics, and globals.It also displays each variable’s type, size, value, and location(either register or memory).If you are interested in a defined set of variables or registers,just type them or drag them to an expressions view. Thisview also offers the flexibility to watch any C-like expression.For bare metal development, use the register view to viewthe processor, co-processor, NEON and peripheral registerswith the same format as in the target’s documentation.The functions view lists all the functions in the target’sapplication, and can be used to set breakpoints and tracepoints, or navigate to the source code of a function.Using the System ViewsAll the system views use color-coding to highlight content thathas recently changed, and most support drag & drop.System views can be frozen or replicated for comparingdata between two points in time. Most views also accept C-likeexpressions. For example, you can set the value of a registerwith an expression such as (*my ptr) & 0xffffff.Address ModifiersThe way the debugger accesses the memory system isconfigured via the memory map.View the memory map withthe info mem command and configure it with mem.You can use address modifiers to select a certain type ofmemory. For instance, if you type S:0x0, the debugger readsthe memory at address 0x0 in TrustZone secure mode.Breakpoints and WatchpointsSet new breakpoints or tracepoints by double clicking onthe left column of the source code or disassembly views.The following address modifiers are supported in DS-5: P: Physical memory (MMU disabled)Set new watchpoints (data breakpoints) by right-clicking ona cell of the memory view or a global variable in the variableor expression view. S: TrustZone secure mode N: TrustZone non-secure modeEdit the properties of breakpoints to assign: H: Hypervisor mode Condition: the breakpoint only stops the execution if thecondition (a C-like expression) is evaluated true. Ignore count: number of times the breakpoint is hit untilthe application stops.You can also debug a running target with direct access tomemory via the CoreSight Debug Access Ports. Use theprefix APB:, AHB: or AXI: to select a particular DAPinterface to memory. Run script: the debugger performs an action (e.g log amessage) automatically when the breakpoint is hit.For AArch64, memory spaces can be accessed for EL1N:,EL1S:, EL2: and EL3: exception levels. Thread and virtual machine-specific breakpoints stopthe processor only when hit from a certain thread.8

INSTRUCTION, DATA & SYSTEM TRACEInstruction and Data TraceInstruction trace enables the non-intrusive debug of randomtime-related issues, which are difficult to replicate by steppingthrough the code, and the performance analysis of criticalareas of software.CoreSight Library & Snapshot ViewerData trace optionally records address and register values fromload and store instructions. Combined with the instructiontrace this gives a complete record of execution.The CoreSight on-target access library enables thesoftware running on your ARM target to interact directlywith CoreSight devices, enabling “flight-recorder” trace. Thisremoves the need to attach an external debugger, allowingyou to debug software crashes in the field. DS-5 includes anexample application to illustrate the use of the CoreSightlibrary on a hardware target. The collected data can then beexported for use in DS-5 Debugger.When trace is enabled, DS-5 begins to capture instructionsand data. Trace can be downloaded from the trace bufferat any time, or once the capture is complete. Trace data issynchronized with the code view.System TraceFor easy use of the CoreSight on-target access library, DS-5Debugger contains DS-5 snapshot viewer, which enablesyou to open register values, memory values and debugsymbols captured from software in the field. For instance,this allows you to analyze trace data collected during acrash dump.The Instrumentation Trace Macrocell (ITM) and SystemTrace Macrocell (STM) provide high-bandwidth, low latency“printf-style” instrumentation links. ITM and STM output isrouted to the on-chip trace bus, and can be collected by thedebugger and displayed in its Event Viewer or exported to atext file. Using the CoreSight Global Timestamp, trace fromall these sources can be synchronized and cross referenced.Using Tracepoints and FiltersUse the Capture Device,Source and Ranges tabs toconfigure traceBy default, DS-5 traces everything executed by a processorinto a circular buffer.Heat map of activity andpercentage activity toidentify local hotspotsTrace start and trace stop points enable you to restricttrace to certain areas of the code. This is useful to optimizethe analysis of certain functions when tracing to an ETB, or toprevent ETM FIFO overflows when the trace port is slow.Ranges (also called filters) can be used in conjunction withtrace start and trace stop points. They enable you to select anaddress range outside of which trace is always disabled.Triggers are highlighted in the trace view and the tools can beconfigured to collect trace around, before, or after the trigger.Just check the ETM Triggers Halt Execution box in thedebug configuration menu to trace around a trigger point.Trace RequirementsTrace typically requires a JTAG connection to devices featuringan Embedded Trace Macrocell (ETM) or Program TraceMacrocell (PTM). Data trace is not available on all cores. Theamount of trace recorded is limited by the size of the on-chipEmbedded Trace Buffer (ETB). If you need a larger buffer;trace off-chip to the 4GB buffer in DSTREAM.From the Trace view, synchronize other views usingtimestamps, view address and values for memoryaccesses, and view tracepoints and triggers embedded inthe trace list9

Quick Start GuideARM DS-5 DEVELOPMENT STUDIO PERFORMANCE ANALYSISARM Streamline Performance Analyzer is a system-levelperformance analysis tool for Linux and Android systems. Ituses sample-based profiling, Linux kernel trace and softwareannotation techniques.Streamline for RTOSSetting up your systemTo get started with Streamline you need:New to DS-5 is the ability to profile and optimize RTOSand bare-metal software on Cortex-M3 and M4 processorsusing Streamline. TCP/IP connection to the target, using WiFi, Ethernet orADB over USB (Android targets).Making use of the Data Watchpoint and Trace (DWT)and Instrumentation Trace Macrocell (ITM), Streamlineconnects through DSTREAM to collect system informationwith near-zero intrusion. Enable Linux kernel config options required by gator. Build the gator.ko module and gator daemon from install dir \arm\gator\ with the target’s Linux kernel.In addition you can get more out of Streamline if you: Add frame pointers to your application and libraries usingthe -fno-omit-frame-pointer compiler flag. This allowsStreamline to generate call-path reports.Turning on event based sampling isreflected in the Streamline report Annotate your code with a printf-style interface to thegator driver, to highlight important software events. Add custom counters to the gator driver. Connect an ARM Energy Probe or NI DAQ to thetarget to measure voltage and current consumption.Launching StreamlineIn Eclipse, open the ARM Streamline Data View. By defaultStreamline generates profiling reports by sampling the programcounter at a constant time interval.When you enable event-based sampling, Streamline takessamples when an event counter reaches the threshold valueselected. For example, event-based sampling can be used toexplore which parts of the code are causing cache misses.The simplifiedStreamline Dataview generates andanalyzes reportswith a double-clickCounter ConfigurationSelect energy measurementtool and set shunt resistorvaluesStreaming data over TCP/IP enables long-term datacaptureOpen the counter configuration panel to view and selectfrom available counters, as well as importing custom counters.For event-based sampling, the event threshold can also be set.Call path and stack reportsare enabled by checking callstack unwindingStreamline generatessource-code level reportsfor selected images10

STREAMLINE PROFILING REPORTSNavigating a Streamline reportStart from a high-levelanalysis and drill down tosource code levelStreamline provides a comprehensive, intuitive report onoverall system performance, from big.LITTLE CPU clustersto interconnect fabric, GPUs and also MCUs. Streamlineenables analysis of the interaction between software and all thecritical hardware components in complex SoCs.Isolate and expand on aperiod of time with thecaliper toolStart with the Timeline pane which provides a complete timeorientated view of performance and highlights areas of interest.Drill down to function level using the other views.Use the tabs to navigate between the panes. Or, right-click on afunction name to highlight it in another pane.Detailed analysisAverage performance and hot functions can be assessedimmediately in the Call Paths and Code views. Anomaliescan be identified visually from charts, with reference to theFilmstrip or with a user defined printf-like Annotation.Once identified, the calipers can be used to isolate a region ofthe timeline and recalculate the other reports.The process heat map can be switched to focus on kernelscheduling or GPU activity by clicking on the green button.CPU Wait charts reveal why the Linux kernel rescheduled athread, for example, due to blocking a I/O operation.Switch process/thread heat Heat map of activity can bemap between alternative broken down per cluster orsourcescore in X-ray mode11

Quick Start GuideARM DS-5 DEVELOPMENT STUDIOStreamline Quick Reference Hints & TipsConnect an ARMEnergy Probe for energymeasurementsUse X-ray mode for percore and per cluster threadactivityCapture GPU activity anddata from Mali OpenGL ESand OpenCL driversFilter threads toreconfigure the heatmapand chartsQuickly zoom to predefined time levels, or usethe magnifierBlue dashes show CPUcontention, red show delaycaused by IOHighlight a subset ofExpand charts per core andprocesses to focus on theirthreads per process, andoverall impactconfigure expressionsHover over charts to usethe quick access tooltip fordata at a glanceEasily create charts forcounter ratios with theSnippets menuAll brand names or product names are the property of their respective holders. Neither the whole nor any part of the information contained in, or the product described in, this document maybe adapted or reproduced in any material form except with the prior written permission of the copyright holder. The products described in this document are subject to continuous developmentsand improvements. All particulars of the product and its use contained in this document are given in good faith. All warranties implied or expressed, including but not limited to implied warrantiesof satisfactory quality or fitness for purpose are excluded. This document is intended only to provide information to the reader about the product. To the extent permitted by local laws ARM shallnot be liable for any loss or damage arising from the use of any information in this document or any error or omission in such information. Copyright 2014 ARM Ltd.Program examples and detailed technical information are available from your distributor and our web site (ds.arm.com). ARM Ltd. DS-5 Quick Start Guide 02.14

Android middleware and native application development normally uses an Android Debug Bridge (ADB) User-space Linux application development in DS-5 is connection over USB. DS-5 Debugger supports both connection types and can use them to automatically download applications into the target file system, launch the gdbserver debug agent on the target