Home

Wasabi® Software Development Tools User`s Guide for Intel XScale

image

Contents

1. Wasabi Software Development Tools User s Guide 51 Reference Objdump This section describes specific features of the GNU binary utility objdump for Intel XScale Microarchitecture Command Line Switch A command line switch has been added to objdump The switch is target data long version or M short version The switch takes an argument that can be any arbitrary piece of text This text is passed on to the code specific to the target object file being dumped and can be used to fine tune the dumping for that target In the case of Intel XScale Microarchitecture the target specific code will look to see if one of the following names is provided If they are there then the corresponding register name set will be used when displaying a disassembly Name Register Name Set raw r0 rl r2 r3 r4 r5 r6 r7 r8 r9 r10 r11 r12 r13 r14 r15 std r0 rl r2 r3 r4 r5 r6 r7 r8 r9 r10 r11 r12 sp dlr pc apcs al a2 a3 a4 vl v2 v3 v4 v5 v6 sl fp ip sp lr pc atpcs al a2 a3 a4 v v2 v3 v4 v5 v6 v7 v8 IP SP LR PC Special atpcs al a2 a3 a4 v v2 v3 WR v5 SB SL FP IP SP LR PC The sca set is the default register name set For example this assembler source code add xi Be c3 when disassembled with the apcs register set specified objdump d target data apcs will produce 00000000 lt text gt 0 e0821003 add a2 a3 a4 Whereas if the same assembler object file is disassembled without specifying
2. 41 Reference C Language Calling Conventions Argument Representation A floating point value occupies one or two words as appropriate to its type Floating point values are encoded in IEEE 754 format with the most significant word of a double having the lowest address NOTE When targeting little endian ARMs the words that make up a double will be stored in big endian order while the bytes inside each word will be stored in little endian order The C compiler widens arguments of type float to type double to support inter working between ANSI C and classic C Char short pointer and other integral values occupy one word in an argument list Character and short values are widened by the C compiler during argument marshalling A structure always occupies an integral number of words unless this is overridden by the mstructure size boundry command line option Argument List Collation Argument values are collated in the order written in the source program The first four words of the argument values are loaded into ro through r3 and the remainder are pushed on to the stack in reverse order so that arguments later in the argument list have higher addresses than those earlier in the argument list As a consequence a FP value can be passed in integer registers or even split between an integer register and the stack 42 Wasabi Software Development Tools User s Guide ABI Summary Function Return Values The f
3. 14 r Wasabi Software Development Tools User s Guide Create Source Code Create Source Code Create the following sample source code and save it as hello c This program will be used throughout the tutorial and also can be used to verify correct installation include lt stdio h gt int a Cc void foo int b c a t b printf d d Sd n a b c int main int b a 3 b 4 printf Hello world n foo b return 0 Wasabi Software Development Tools User s Guide 15 Tutorial Compile Assemble and Link To compile assemble and link this example to run on the GDB built in instruction set simulator type xscal lf gcc g hello c o hello The g option generates debugging information and the o option specifies the name of the executable to be produced Other useful options include o for standard optimization and 02 for extensive optimization When no optimization option is specified GCC will not optimize It is not necessary to specify the endian ness of the program little endian is the default For a list of available generic compiler options refer to GCC Command Options at http www gnu org manual manual html IMPORTANT It is important to remember throughout the tutorial that the Wasabi Developer Toolkit is case sensitive on all operating systems Therefore enter all commands and options exactly as indicated in this document Programs can also be compiled t
4. pc L6 align 2 L5 006c 00000000 word a Wasabi Software Development Tools User s Guide 23 Tutorial 24 r Wasabi Software Development Tools User s Guide 4 Asabi Reference This section describes the ABI and attributes of the main GNU tools specific to Intel XScale Microarchitecture Compiler ABI Summary Assembler Linker Debugger Simulator Wasabi Software Development Tools User s Guide 25 Reference Compiler This section describes features of the GNU Compiler specific to Intel XScale Microarchitecture Command Line Options For a list of available generic compiler options refer to GCC Command Options at http www gnu org manual manual html In addition the following command line options for Intel XScale Microarchitecture are supported mabort on noreturn Generate a call to the function abort at the end of a noreturn function It will be executed if the function tries to return malign literal pools32 mno align literal pools32 The malign literal pools32 switch disabled by default causes the compiler to align literal pools to a 32 byte boundary the cache line size on processors based upon Intel XScale Microarchitecture malignment traps Generate code that will not trap if the MMU has alignment traps enabled On ARM architectures prior to ARMV4 there were no instructions to access half word objects stored in memory
5. specific linker script 1 Simulator GDB s built in instruction set simulation of the processor allows the debugging of programs compiled for the Intel XScale Microarchitecture without requiring any access to actual hardware To debug on the simulator no specifications file is required at compile time To activate the simulator mode in GDB type target sim Then use the 1oad command to load the code 2 Remote target board To debug on an actual evaluation board a board specific specifications file must be included at compilation For example the specs i980310 specs compiler option selects the 1380310 specs file Here is a list of Intel amp boards and their required compiler settings Board Compiler Settings 80310 specs iq80310 specs 80321 specs redboot specs IWMMXT specs redboot specs mcpu iwmmxt IXDP425 specs redboot specs mbig endian GRG specs redboot specs mbig endian To connect to the target board in GDB using the command target remote device name where device name will be a serial device such as dev ttya Linux or com2 Windows Then load the code onto the target board by typing loaa After being 54 r Wasabi Software Development Tools User s Guide Debugger downloaded the program can be executed NOTE When using the remote target GDB does not accept the run command However since downloading the program has the side effect of setting the PC to the star
6. However when reading from memory a feature of the ARM architecture allows a word load to be used even if the address is unaligned and the processor core will rotate the data as it is being loaded This option tells the compiler that such misaligned accesses will cause a MMU trap and that it should instead synthesize the access as a series of byte accesses The compiler can still use word accesses to load half word data if it knows that the address is aligned to a word boundary This option is ignored when compiling for ARM architecture 4 or later since these processors have instructions to directly access half word objects in memory mno alignment traps Generate code that assumes that the MMU will not trap unaligned accesses This produces better code when the target instruction set does not have half word memory operations i e implementations prior to ARMv4 Note that you cannot use this option to access unaligned word objects since the processor will only fetch one 32 bit aligned object from memory The default setting for most targets is mno alignment traps since this produces better code when there are no half word memory instructions available 26 r Wasabi Software Development Tools User s Guide Compiler mapcs This is a synonym for mapcs frame mapcs frame Generate a stack frame that is compliant with the ARM Procedure Call Standard for all functions even if this is not strictly necessary for correct ex
7. Sensitivity The following strings are case sensitive under Linux and Windows XP command line options assembler labels linker script commands section names file names within makefiles file names are case sensitive under Linux The following strings are not case sensitive under Linux or Windows XP GDB commands assembler instructions and register names Case sensitivity for Windows XP is dependent on system configuration By default file names under Windows XP are not case sensitive 4 n Wasabi Software Development Tools User s Guide Installation and Rebuilding This section describes how to correctly install the Wasabi Software Development Tools and to rebuild the binaries from source code on systems running the Red Hat Linux 9 operating system and on systems running the Windows XP operating system Wasabi Software Development Tools User s Guide 5 Installation and Rebuilding Red Hat Linux 9 This section describes how to install the Wasabi Developer Tools on a system running Red Hat Linux 9 and how to rebuild the tools from source code Installation The name of the file containing the complete set of binary tools is called toolname tools YYYYMMDD linux tar gz where the variable toolname is replaced with tool name found on the CD and YYYYMMDD is replaced with the release date found on the CD The file may be installed in the default location usr 10ca1 using root privileges or in any
8. a bash window The file containing your sources should expand to a directory hierarchy with src at the top 1 Choose a directory to contain the src structure and your build directories For example cd mkdir xscale tools cd xscale tools 2 Next unpack your sources For example tar xvzf path where received toolname tools YYYYMMDD src tar gz where the variable toolname is replaced with tool name found on the CD and YYYYMMDD is replaced with the release date found on the CD 3 Next create a build directory mkdir build cd build 10 FT Wasabi Software Development Tools User s Guide Windows XP 4 5 6 Configure the sources src configur target xscal lf prefix cygdrive c wasabi The prefix option should give the directory you want the tools to be installed in cygdrive c wasabi is the default location but you can specify any location for which you have write access The tools will not be installed there until the final nake command Build the tools make all Install the tools make install NOTE This is the command that requires write access to your prefix directory 7 If you no longer wish to work in the bash environment type exit The rest of these steps can be completed in a Windows command prompt window and the syntax of the following commands reflect that To use the tools they must be placed on your path For example set PATH PATH c wasabi A basic test is to comp
9. anyway and kill it y or n y CENG 22 Wasabi Software Development Tools User s Guide Assembler Listing from Source Code Assembler Listing from Source Code 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 The following command produces an assembler listing xscal lf gcc g 02 Wa al c hello c The compiler debugging option g gives the assembler the necessary debugging information The 02 option produces optimized code output The wa option tells the compiler to pass the text immediately following the comma as a command line to the assembler The assembler option a1 requests an assembler listing The c option tells GCC to compile or assemble the source files but not to link Here is a partial excerpt of the on screen output align 2 global main type main function main LFB5 loc 1 12 0 args 0 pretend 0 frame 0 frame_needed 1 uses_anonymous_args 0 003c ODCOAOE1 mov ip SP LCFI1 0040 O0D82DE9 stmfd Sp fp ip lr pc LCFI2 0044 04B04CE2 sub fp ip 4 LCFI3 loc 1 15 0 0048 1CCO9FE5 ldr ip L5 004c 0330A0E3 mov r3 3 loc 1 17 0 LBB2 0050 18009FE5 ldr r0 L5 4 loc 1 15 0 0054 00308CE5 str r3 ip 0 loc 1 17 0 0058 FEFFFFEB bl puts loc 1 18 0 005c 0400A0E3 mov r0 4 0060 FEFFFFEB bl foo loc 1 20 0 LBE2 0064 0000AO0ES3 mov r0 0 0068 00A81BE9 ldmea fp fp sp
10. calls that appear within the line of code are executed without stopping Execution stops when control reaches a different line of code at the original stack level that was executing when you gave the next command See how the program got to the current line backtrace A backtrace is a summary of how your program got to its current position The backtrace command shows one line per frame for many frames starting with the currently executing frame frame zero followed by its caller frame one and on up the stack Exit the program and quit the debugger quit 20 r Wasabi Software Development Tools User s Guide Debugging with GDB Debug with the Built in Instruction Set Simulator GDB can be used to debug executables with the built in Instruction Set Simulator which does not require access to any hardware In the following sample debugging session we use the target sim command to specify the Instruction Set Simulator as the target C gt xscale elf gdb hello GNU gdb 2003 08 25 cvs Copyright 2003 Free Software Foundation Inc GDB is free software covered by the GNU General Public License and you are welcome to change it and or distribute copies of it under certain conditions Type show copying to see the conditions There is absolutely no warranty for GDB Type show warranty for details This GDB was configured as host i386 pc cygwin target xscale elf gdb target sim Connected to the simulator gdb lo
11. monospace bold code that you are to enter is in monospace font C gt processor elf run hello hello world 3 pori E qj CENS ii Wasabi Software Development Tools User s Guide Contents Introduction e E N a a N a a a yay aa 1 nel n v NS MN EA AE erer 2 ye va CS ziii aka aa repre Ea mm bda 2 Sues di iuc k k 2 Supported EOsts 1 entre ibit te Heer Meere ed b yan Na KAN a N Ete ERR AR a g n NE r n na 2 Object Fil Format ic ii4 4yx yi54 a0554i MH 2 Tool Naming Conventions sess reee ke ee k nana kk kek kek KAK KE KA KAKA KAK nnne 3 Case Sensitivity OP 4 Installation and Rebuilding ccccssccssscccssscsssccessccsssccssscsenscesssccceaaeesssesesaesesscssnaccesaeeesees 5 Red Hat Linux yA re a KANA GA SANAN AN GN t kak An es Kak emos ero a dao an k ea W K ANA AKAN 6 JANGE SAAT aana DD A Kg aa d pan AG GA A da aa a a ga Pe aana gaga E aaa ak aa TE 6 Rebuilding From Source Code E aane anna nane one eke keke keka nenen ane KAKE aan KAKA KAHR 7 WAWI AP kaa ak KASAN ana ANA tt KAE AAN etr ete ga BANG CREE a SA a ANA A ala eaten 9 HUS EMERGERE 9 Rebuilding From Source Code sess eene 10 J 7 7 7 asi lse ian Heyi Qa Ree REV N Kat 13 Create Source Code ie bir Kek KEKE V e Kevan Palins FER B TR NAR ER ANA o 15 Compile Assemble and Link esee adek PE W
12. them too So that it is possible to repeatedly define the same local label using the same number N although you can only refer to the most recently defined local label of that number for a backwards reference or the next definition of a specific local label for a forward reference It is also worth noting that the first 10 local labels 0 9 are implemented in a slightly more efficient manner than the others Here is an example Ls branch 1f 2 branch 1b 1s branch 2f 2 branch 1b Which is the equivalent of label 1 branch label 3 label 2 branch label 1 46 Wasabi Software Development Tools User s Guide Assembler label 3 branch label 4 label 4 branch label 3 Local symbol names are only a notational device They are immediately transformed into more conventional symbol names before the assembler uses them The symbol names stored in the symbol table appearing in error messages and optionally emitted to the object file The names are constructed using these parts L All local labels begin with 1 Normally both the assembler as and the linker 1d forget symbols that start with L These labels are used for symbols you are never intended to see If you use the L option then the assembler retains these symbols in the object file If you also instruct the linker to retain these symbols you may use them in debugging number This is the number that was used in the local label definition Therefore if the label
13. 3436 htm Using and Porting GNU CC by Richard M Stallman July 1999 GNU Press ISBN 1 882114 38 8 Debugging with GDB The GNU Source Level Debugger by Richard M Stallman Roland Pesch Stan Shebs et al January 2002 GNU Press ISBN 1 882114 88 4 StrongARMTDMI Data Sheet ARMDDI0029E Advanced RISC Machines Ltd ARM August 1995 System V Application Binary Interface Prentice Hall 1990 Advanced RISC Machine Architecture Reference Manual Prentice Hall 1996 ISBN 0 13 736299 4 Wasabi Software Development Tools User s Guide 57 Bibliography 58 r Wasabi Software Development Tools User s Guide
14. A leaf function does not need to allocate a stack frame if one is not needed A frame pointer need not be allocated The stack pointer shall always be aligned to 4 byte boundaries At a public interface the stack pointer shall always be aligned to 8 byte boundaries The stack pointer always points to the lowest addressed word currently stored on the stack Stack frames for functions that take a fixed number of arguments look like this FP Before call After call High Local variables register Local variables register memory save area etc save area etc Reserved space for largest argument list SP yi TI Argumentis on stack Register save area Local variables Alloca allocations Reserved space for Low largest argument list memory 40 Wasabi Software Development Tools User s Guide ABI Summary Stack frames for functions that take a variable number of arguments look like this FP Before call After call High Local variables register Local variables register memory save area etc save area etc Reserved space for largest argument list Arumes On stack SP Save area for anonymous parms passed in registers the size of this area may be zero Register save area Local variables FP Alloca allocations Reserved space for Low largest argument list memory sp Wasabi Software Development Tools User s Guide
15. ARANA BNN nennen 16 Run the Executable n eret e tet eerta eter rrr 17 Run on the Stand alone SimUlator E keke anae 17 Debugging with GDB irren e EN lenr kak V RR NENG HH WE Da AA 18 Debugging Examples sery be lanya k kele ked s y aren ake n werdene Wer s seya dayn RL 19 Assembler Listing from Source Code eee 23 I dij E SERO 25 oui 26 Command Line Optiofis eei eit teinte era HR UR l We ka nek a RAS oi 26 Preprocessor Symbols deret er ete n Re E WE ENTE EE eW WW M e Be eue G 33 P EIT gt sisi jana ek IEE La aa OE abah AA A A BAANG KA GA DANA SN AKNG NAGA A NAMA Aia aaa 33 Wasabi Software Development Tools User s Guide iii ARM Pras mas 2 tabernae K Ka KON kenu HES q de d Hay eareke d H RR n E 35 Vector TL VD S s ck MM M 35 Vector Intrinsic Functions 4 25xxc d lane epe e ee edente da k E ua be N andere 36 ABI Summary 5 2 2 bene bi eir ee Ee AR Ke uk ecient Ega Ann AR AWAR 38 Data Type Sizes and Alignments anana enen anana ananem nana ke k k kek kek 38 Subroutme Calls eden l pr iP qa hi al 33an adan cab kak ed belaya 39 Stack Brame AA N rx Ana RN BANA TAN a Ra a a EAEE 40 C Language Calling Conventions e
16. Debugging with GDB The debugger can be accessed by graphic user interface GUI or in command line mode To start Insight the GUI debugger enter the command xscale elf insight hello exe To start GDB in command line mode and run the sample program enter the command xscal lf gdb hello ex After the initial copyright and configuration information GDB returns its own prompt gdb C gt xscale elf gdb hello GNU gdb 2003 08 25 cvs Copyright 2003 Free Software Foundation Inc GDB is free software covered by the GNU General Public License and you are welcome to change it and or distribute copies of it under certain conditions Type show copying to see the conditions There is absolutely no warranty for GDB Type show warranty for details This GDB was configured as host i386 pc cygwin target xscale elf gdb In our examples we have selected the command line interface to GDB Command line operation is useful when you wish to capture program output for making transcripts like these or to display and capture code when reporting a bug in GDB To exit GDB enter the quit command at the gdb prompt gdb quit GENG 18 r Wasabi Software Development Tools User s Guide Debugging with GDB Debugging Examples The following example debugging session was run on the GDB built in instruction set simulator First we will step through and explain the sequence of commands in the sample debugging session
17. WASABI SYSTEMS INC Wasabi Software Development Tools User s Guide for Intel XScale Microarchitecture Version 1 0 March 2004 asabi Copyright 2004 Wasabi Systems Inc All rights reserved No part of this document may be reproduced modified or distributed in any form or by any means without the prior express written consent of Wasabi Systems Inc Wasabi and the Wasabi logo are registered trademarks of Wasabi Systems Inc All other brand and product names are trademarks of their respective owners Part Number WUGO001 V1 00 How to Contact Wasabi Wasabi Systems Inc 500 E Main Street Suite 1520 Norfolk VA 23510 USA EMAIL info wasabisystems com PHONE 1 757 248 9601 FAX 1 509 461 7283 URL http www wasabisystems com Font Conventions This manual uses the following highlighting conventions Boldface indicates graphical user interface GUI controls such as the names of fields buttons or menus J talics indicates cross references book titles and emphasized words Monospace indicates code commands file names directory paths and user entered text in program samples Monospace Italics indicates a variable in a command that you should replace with a value of the appropriate type Blue monospace indicates complete Internet addresses URLs http www wasabisystems com The following format indicates code displayed on screen Prompts and program output are displayed in
18. a register set objdump d this output will be produced 00000000 lt text gt 0 e0821003 add rl r2 3 52 r Wasabi Software Development Tools User s Guide Objdump Abbreviations M Can be used instead of target data For example objdump d Mstandard names add o Will also produce 0 e0821003 add rl X2y E2 Can be used instead of standard names For example objdump d M s add o Will also produce 0 e0821003 add rl r2 r3 Can be used instead of apcs names For example objdump d M a add o Will also produce e0821003 add a2 a3 a4 Only standard names apcs names s and a are recognized Any other text will produce an error message For example objdump d Mbleah add o Will produce Unrecognised target data bleah 0 e0821003 add a2 a3 a4 Wasabi Software Development Tools User s Guide 53 Reference Debugger This section describes features of the GNU Debugger for Intel XScale Microarchitecture For a more complete description of the GNU Debugger see the GDB User Manual at http www gnu org manual manual html The debugger can be accessed in two modes command line or in GUI mode To get the GDB command line run xscale elf gdb To get the graphical version run xscale elf insight There are two ways for GDB to communicate with a target based upon Intel XScale Microarchitecture Each target requires that the program be compiled with a target
19. ad Loading section init size Oxlc vma 0x8000 Loading section text size 0x926c vma 0x801c Loading section fini size 0x18 vma 0x11288 Loading section rodata size 0x354 vma 0x112a0 Loading section data size 0x8c0 vma 0x11710 Loading section eh frame size 0x4 vma 0x11fd0 Loading section ctors size 0x8 vma 0x11lfd4 Loading section dtors size 0x8 vma 0x1lfdc Loading section jcr size 0x4 vma 0x1lfe4 Start address 0x8120 Transfer rate 325216 bits in 1 sec gdb break main Breakpoint 1 at 0x82a0 file hello c line 15 gdb run Starting program C hello Breakpoint 1 main at hello c 15 15 a 3 gdb print a 12 0 gdb step 16 b 4 gdb print a 2 2 3 gdb list Wasabi Software Development Tools User s Guide 21 Tutorial 11 int main 12 13 int b 14 15 a 3 16 b 4 17 printf Hello world n 18 foo b 19 return 0 20 gdb list foo 1 include lt stdio h gt 2 3 int a c 4 5 void foo int b 6 7 c a t b 8 printf sd d d n a b c 9 10 gdb break 7 Breakpoint 2 at 0x824c file hello c line 7 gdb continue Continuing Hello world Breakpoint 2 foo b 4 at hello c 7 7 c a b gdb step 8 printf sd d d n a b c gdb print c 3 2 7 gdb next 34427 9 gdb backtrace 0 foo b 4 at hello c 9 1 0x000082c4 in main at hello c 18 gdb quit The program is running Quit
20. builtin arm wand builtin arm wandn builtin arm wavg2b builtin arm wavg2br builtin arm wavg2h builtin arm wavg2hr builtin arm wcmpeqb builtin arm wcmpegh builtin arm wcmpeqw builtin arm wcmpgtsb builtin arm wcmpgtsh builtin arm wcmpgtsw builtin arm wcmpgtub builtin arm wcmpgtuh builtin arm wcmpgtuw builtin arm wmacs builtin arm wmacsz builtin arm wmacu builtin arm wmacuz builtin arm wmadds builtin arm wmaddu builtin arm wmaxsb builtin arm wmaxsh builtin arm wmaxsw builtin arm wmaxub builtin arm wmaxuh builtin arm wmaxuw builtin arm wminsb builtin arm wminsh builtin arm wminsw builtin arm wminub builtin arm wminuh builtin arm wminuw builtin arm wmulsh builtin arm wmuluh builtin arm wmulul builtin arm wor builtin arm wpackhss builtin arm wpackhus builtin arm wpackwss builtin arm wrord builtin arm wrordi builtin arm wrorh builtin arm wrorhi builtin arm wrorw builtin arm wrorwi builtin arm wsadb builtin arm wsadbz builtin arm wsadh builtin arm wsadhz builtin arm wshufh builtin arm wslld builtin arm wslldi builtin arm wsllh builtin arm wsllhi builtin arm wsllw builtin arm wsllwi 36 Wasabi Software Development Tools User s Guide Compiler builtin arm wsrad builtin arm wsradi builtin arm wsrah builtin arm wsrahi builtin arm wsraw builtin arm w
21. ction s caller A pointer to this area of memory is passed to the function as a hidden first argument generated at compile time LargeType t t func arg is implemented as LargeType t void func amp t arg Wasabi Software Development Tools User s Guide 43 Reference Assembler This section describes the features of the GNU Assembler for Intel XScale amp Microarchitecture For a more complete description of the GNU assembler see Using as at http www gnu org manual manual html Command Line Options The following are assembler options for Intel XScale Microarchitecture mcpu processor extension This option specifies the target processor The assembler will issue an error message if an attempt is made to assemble an instruction which will not execute on the target processor Permissible processor names are arma arm250 J arzm3 Jam arm60 arm600 arm610 arm620 arm7 arm7m arm7d arm7dm arm7di arm7dmi arm70 arm700 arm7001 jarm710 arm7lO0c farm7100 arm7500 arm7500fe arm7tdmi arm8 arm810 arm9 arm9e arm920 arm920t arm940t arm9tdmi armiOtdmi arm1020t strongarm strongarm110 strongarm1100 xscale core3 iwmmxt The special name a11 may be used to allow the assembler to accept instructions valid for any ARM processor In addition to the basic instruction set the assembler can be told to accept various extension mnemonics that e
22. e Wasabi Developer Tools on a system running Windows XP and how to rebuild the tools from source code Installation The Wasabi Developer Tools for Windows XP work under Cygwin 1 5 7 Cygwin is a Linux like environment for Windows Cygwin consists of a DLL cygwin1 d11 that is a Linux emulation layer and a collection of tools that provide a Linux look and feel In addition to the standard installation of Cygwin you need to install the GNU Internationalization runtime library 1ibint1 If you do not have Cygwin 1 5 7 and the GNU Internationalization runtime library on your system point your web browser at http oyqwin conm and click on the Install Cygwin now icon at the top right of the web page to invoke the setup exe installation program Follow the online installation instructions to install the standard Cygwin 1 5 7 installation and then to install 1ipbint1i The name of the file containing the complete set of binary tools for Windows systems is called toolname tools YYYYMMDD cygwin zip where the variable toolname is replaced with tool name found on the CD and yyyymmpp is replaced with the release date found on the CD IMPORTANT These tools have been built against Cygwin DLL version 1 5 7 Please make sure your system has this version of Cygwin installed Follow these instructions to correctly install the Wasabi Developer Tools 1 The zip file should be unpacked using a utility such as WinZip The tools are normally unpack
23. e and alignment for all data types Type Size bytes Alignment bytes char 1 byte 1 byte short 2 bytes 2 bytes int 4 bytes 4 bytes unsigned 4 bytes 4 bytes long 4 bytes 4 bytes long long 8 bytes 8 bytes float 4 bytes 4 bytes double 8 bytes 8 bytes pointer 4 bytes 4 bytes Alignment within aggregates structures and unions is as above with padding added if needed Aggregates have alignment equal to that of their most aligned member Aggregates have sizes which are a multiple of their alignment 38 r Wasabi Software Development Tools User s Guide ABI Summary Subroutine Calls The following describes the calling conventions for subroutine calls The first table outlines the registers used for passing parameters The second table outlines other register usage Parameter registers General purpose r0 r3 Register usage Volatile r0 r3 r12 Non volatile r4 r10 Frame pointer ri Stack pointer ri3 Return address r14 Program counter E15 Structures that are less than or equal to 32 bits in length are passed as values Structures that are greater than 32 bits in length are passed as pointers Wasabi Software Development Tools User s Guide 39 Reference Stack Frame This section describes the stack frame for the Intel XScale Microarchitecture The stack grows downwards from high addresses to low addresses
24. e instruction set being generated The value 16 selects Thumb and the value 32 selects ARM thumb This performs the same action as code 16 arm This performs the same action as code 32 force thumb This directive forces the selection of Thumb instructions even if the target processor does not support those instructions thumb func This directive specifies that the following symbol is the name of a Thumb encoded function This information is necessary in order to allow the assembler and linker to generate correct code for interworking between Arm and Thumb instructions and should be used even if interworking is not going to be performed The presence of this directive also implies thumb Wasabi Software Development Tools User s Guide 49 Reference thumb set This performs the equivalent of a set directive in that it creates a symbol which is an alias for another symbol possibly not yet defined This directive also has the added property in that it marks the aliased symbol as being a thumb function entry point in the same way that the thumb_func directive does ltorg This directive causes the current contents of the literal pool to be dumped into the current section which is assumed to be the text section at the current location aligned to a word boundary pool This is a synonym for 1torg Assembler Error Messages Error Unrecognized opcode This instruction is misspelled or there is a syntax error s
25. ecution of the code Specifying fomit frame pointer with this option will cause the stack frames not to be generated for leaf functions The default is nno apcs frame mapcs 26 Generate code for a processor running with a 26 bit program counter and conforming to the function calling standards for the APCS 26 bit option This option replaces the m2 and m3 options of previous releases of the compiler mapcs 32 Generate code for a processor running with a 32 bit program counter and conforming to the function calling standards for the APCS 32 bit option This option replaces the m6 option of previous releases of the compiler march NAME This specifies the name of the target ARM architecture GCC uses this name to determine what kind of instructions it can emit when generating assembly code This option can be used in conjunction with or instead of the mcpu option Permissible names are armv2 armv2a armv3 armv3m armv4 armv4t armv5 armv5t armv5te iwmmxt matpcs Generate code that conforms to the ATPCS ARM Thumb Procedure Call Standard This ABI standard is slightly different from the APCS standard and is incompatible in the way that small structures are returned from a function For the APCS a structure like this struct char a char b would be returned in memory whereas for the ATPCS it is returned in a register mbig endian Generate code for a processor running in big endian mode the default is to c
26. ed for a big endian processor Wasabi Software Development Tools User s Guide 45 Reference EL This option specifies that the output generated by the assembler should be marked as being encoded for a little endian processor k This option specifies that the output of the assembler should be marked as position independent code PIC moabi This indicates that the code should be assembled using the old ARM ELF conventions based on a beta release release of the ARM ELF specifications rather than the default conventions which are based on the final release of the ARM ELF specifications Syntax For a complete description of Assembler syntax see Intel XScale Microarchitecture Programmers Reference Manual at http www intel com design intelxscale 273436 htm Local Symbol Names Local symbols help compilers and programmers use names temporarily They create symbols which are guaranteed to be unique over the entire scope of the input source code and which can be referred to by a simple notation To define a local symbol write a label of the form N where N represents any positive integer To refer to the most recent previous definition of that symbol write Nb using the same number as when you defined the label To refer to the next definition of a local label write Nf The b stands for backwards and the f stands for forwards There is no restriction on how you can use these labels and you can reuse
27. ed in C WASABI 2 After unpacking the tools open a Windows Command Prompt dialog box You will need to modify the following three environment variables set GCC EXEC PREFIX C NWASABINusrNMlocalNMlibNgcc libN set PATH PATH C WASABI usr local bin set PATH SPATH C cygwin bin NOTE If you wish to unpack the tools in a directory other than c WASABI you will need to make the appropriate substitutions in the above commands If you installed Cygwin in a directory other than the default modify the final Wasabi Software Development Tools User s Guide 9 Installation and Rebuilding command You can now use the tools from within the Windows Command Prompt box 3 A simple test to verify correct installation is to compile this canonical hello world program and then run it on the simulator a Create the text file foo c int main printf Hello world n return 0 b Compile the program xscale elf gcc foo c o foo x c Runthe executable oo x on the simulator xscale elf run foo x If the toolchain is properly installed you should see Hello world on your console as a result of executing this program on the simulator Rebuilding From Source Code When rebuilding the toolchain in a Cygwin environment the build system requires a shell such as bash Before you begin open a bash window The Cygwin installation program can place a Cygwin icon on your desktop that opens
28. en assembling little endian code The default is dependent on the processor selected For Architecture 5 or later the default is to assembler for VFP instructions for earlier architectures the default is to assemble for FPA instructions mthumb This option specifies that the assembler should start assembling Thumb instructions that is it should behave as though the file starts with a code 16 directive mthumb interwork This option specifies that the output generated by the assembler should be marked as supporting interworking mapcs 2632 This option specifies that the output generated by the assembler should be marked as supporting the indicated version of the Arm Procedure Calling Standard matpcs This option specifies that the output generated by the assembler should be marked as supporting the Arm Thumb Procedure Calling Standard If enabled this option will cause the assembler to create an empty debugging section in the object file called arm atpcs Debuggers can use this to determine the ABI being used by mapcs float This indicates the the floating point variant of the APCS should be used In this variant floating point arguments are passed in FP registers rather than integer registers mapcs reentrant This indicates that the reentrant variant of the APCS should be used This variant supports position independent code EB This option specifies that the output generated by the assembler should be marked as being encod
29. ess of the function into a register and then performing a subroutine call on this register This switch is needed if the target function will lie outside of the 64 megabyte addressing range of the offset based version of subroutine call instruction Even if this switch is enabled not all function calls will be turned into long calls The heuristic is that static functions functions which have the short call attribute functions that are inside the scope of a 4pragma no long calls directive and functions whose definitions have already been compiled within the current compilation unit will not be turned into long calls The exception to this rule is that weak function definitions functions with the 1o0ng ca11 attribute or the section attribute and functions that are within the scope of a pragma long calls directive will always be turned into long calls This feature is not enabled by default Specifying mno long calls will restore the default behavior as will placing the function calls within the scope of a pragma long calls off directive Note these switches have no effect on how the compiler generates code to handle function calls via function pointers mmerge literal pools mno merge literal pools The mmerge literal pools switch disabled by default causes the compiler to merge literal pools across function boundary if possible This allows for smaller pools due to re used values and fewer alignment paddings mnop fun d
30. example to add two word sized vectors using tte WADDW instruction the following code would be used result vector _ builtin arm waddw first vector second vector To perform a similar operation using the WADDHSS instruction to sum half word sized vectors using signed saturation the invocation would be result vector builtin arm waddhss first vector second vector The following is a complete list of all of these intrinsic vector functions builtin arm getwcx builtin arm setwcx builtin arm textrmsb builtin arm textrmsh builtin arm textrmsw builtin arm textrmub builtin arm textrmuh builtin arm textrmuw builtin arm tinsrb builtin arm tinsrh builtin arm tinsrw builtin arm tmia builtin arm tmiabb builtin arm tmiabt builtin arm tmiaph builtin arm tmiatb builtin arm tmiatt builtin arm tmovmskb builtin arm tmovmskb builtin arm tmovmskh builtin arm tmovmskh builtin arm getwcx builtin arm setwcx builtin arm textrmsb builtin arm tmovmskw builtin arm tmovmskw builtin arm waccb builtin arm waccb builtin arm wacch builtin arm wacch builtin arm waccw builtin arm waccw builtin arm waddb builtin arm waddbss builtin arm waddbus builtin arm waddh builtin arm waddhss builtin arm waddhus builtin arm waddw builtin arm waddwss builtin arm waddwus builtin arm walign
31. gz where the variable toolname is replaced with tool name found on the CD and YYYYMMDD is replaced with the release date found on the CD Next create a build directory mkdir build cd build Configure the sources src configur target xscale elf prefix usr local The prefix option should give the directory you want the tools to be installed in usr local is the usual location but you can specify any location for which you have write access The tools will not be installed there until the final make command Build the tools make all Install the tools make install NOTE This is the command that requires write access to your prefix directory 7 To use the tools they must be placed on your path For example for Borne Shell users PATH usr local bin PATH or for C Shell csn users setenv PATH usr local bin PATH Wasabi Software Development Tools User s Guide 7 Installation and Rebuilding 8 A simple test is to compile the canonical hello world program and then run it on the simulator Create a file oo c with the following text int main printf Hello world n return 0 9 Then execute these commands xscale elf gcc foo c o foo xscale elf run foo If the toolchain is properly installed you should see Hello world on your console 8 m Wasabi Software Development Tools User s Guide Windows XP Windows XP This section describes how to install th
32. ile the canonical hello world program and then run it on the simulator Using a text editor create a file called oo c containing the following text int main printf Hello world n return 0 10 Then execute these commands xscale elf gcc foo c o foo exe xscale elf run foo exe If the toolchain is properly installed you should see Hello world on your console as a result of executing this program on the simulator Wasabi Software Development Tools User s Guide 11 Installation and Rebuilding 12 Wasabi Software Development Tools User s Guide 3 asabi Tutorial In this tutorial we will Create source code for a sample Hello World program Compile assemble and link the source code Run the executable on the stand alone simulator Step through a sample debugging session using the GDB built in simulator Create an assembler listing from source code For more detail on any of the individual utilities refer to the open source utility manuals Wasabi Software Development Tools User s Guide 13 Tutorial The following chart outlines the sequence of steps in the tutorial Create source code Compile assemble Create assembler and link the source listing from source code code Run the executable Debug with GDB on the stand alone on the built in simulator simulator NOTE The assembler listing from source code is optional in the tutorial sequence
33. improvements however in others it causes the instruction scheduling pass to generate less suboptimal code This option may be used in conjunction with no schedule insns to disable the first instruction scheduling pass and improve the quality of generated code 32 r Wasabi Software Development Tools User s Guide Compiler Preprocessor Symbols Following are some relevant preprocessor symbols supported by the compiler for the Intel XScale Microarchitecture The complete list can be found by invoking the compiler as xscal lf gcc dD E P xc dev null You may add other options that you would normally use between xc and aev nu11 Attributes Symbol Condition arm Is always defined APCS 32 If mapcs 26 has NOT been specified LAPCS 26 If mapcs 26 hasbeenspecified SOFTFP If mhard float has NOT been specified ARMWEL If mbig endian and mwords littl ndian have been specified ARMEB If mbig endian has been specified CARMEL If mbig endian has NOT been specified ARM ARCH 5TE Is defined by default ARM XSCALE Is defined by default IWMMXT If mcpu iwmmxt has been specified There are a few function attributes which are specific to the ARM target For more information see Declaring Attributes of Functions in Extensions to the C Language Family at http www gnu org manual manua
34. is written 55 then the number is 55 C B This unusual character is included so you do not accidentally invent a symbol of the same name The character has an ASCII value of X002 control B ordinal number This is a serial number to keep the labels distinct The first definition of 0 gets the number 1 The 15th definition of 0 gets the number 15 and so on Likewise the first definition of 1 gets the number 1 and its 15th defintion gets 15 as well For example the first 1 is named L1c B1 the 44th 3 is named L3c B44 Special Characters Assembler comments start with the at symbol e and extend to the end of the line Multiple assembler statements can appear on the same line providing that they are separated by the semicolon symbol Wasabi Software Development Tools User s Guide 47 Reference Register Names These are the register names supported for the Intel XScale Microarchitecture in the format register name register number General registers rO 0 rl 1 r2 2 r3 3 r4 4 r5 5j r6 6 r7 7 r8 8 ir9 9 El LO rl WI r12 12 r13 135 r14 14 irli5 153 Accumulators accO 0 APCS names for the general registers al 0 a2 1 a3 2 a4 3 v1 4 v2 5 v3 6 v4 7 v5 8 v6 9 sb 9 v7 10 sl 10 fp 11 ip 12 sp 13 lr 14 pc 15 Floating point registe
35. l html long call short call These attributes specify how a particular function is called on ARM Both attributes override the mlong calls and pragma long calls settings The long call attribute causes the compiler to always call the function by first loading its address into a register and then using the contents of that register The short cal1 attribute always places the offset to the function from the call site into the BL instruction directly For example void fn void attribute long call Wasabi Software Development Tools User s Guide 33 Reference interrupt This attribute indicates that the specified function is an interrupt handler The compiler will generate appropriate function entry and exit sequences You can specify the kind of interrupt to be handled by adding an optional parameter to the interrupt attribute The permissible values for this parameter are IRQ FIQ SWI ABORT UNDEF For example void fn void attribute _ interrupt IRQ naked This attribute indicates that the specified function does not need prologue epilogue sequences generated by the compiler The programmer must provide these sequences as required For example void fn void attribute naked 34 r Wasabi Software Development Tools User s Guide Compiler ARM Pragmas The ARM target defines pragmas for controlling the default addition of 10ng ca11 and short call attributes to functions Fo
36. llimport Disable support for the dllimport attribute mpic register REG Specify the register to be used for PIC addressing The default is R10 unless stack checking is enabled when R9 is used Wasabi Software Development Tools User s Guide 29 Reference mpoke function name Write the name of each function into the text section directly preceding the function prologue The generated code is similar to this t0 ascii arm poke function name 0 align t1 word Oxff000000 El t0 arm poke function name mov ip sp stmfd Sp fp ip lr pc sub fp ip 4 When performing a stack backtrace code can inspect the value of pc stored at fp 0 If the trace function then looks at location pc 12 and the top 8 bits are set then we know that there is a function name embedded immediately preceding this location and has length pc 3 amp Oxf 000000 msched prolog mno sched prolog Prevent the reordering of instructions in the function prolog or the merging of those instruction with the instructions in the function s body This means that all functions will start with a recognizable set of instructions or in fact one of a choice from a small set of different function prologues and this information can be used to locate the start if functions inside an executable piece of code The default is msched prolog mshort load bytes mno short load bytes These are deprecated aliases for malignment traps and mno align
37. ment traps respectively mshort load words mno short load words These are deprecated aliases for mno alignment traps and malignment traps respectively msingle pic bas Treat the register used for PIC addressing as read only rather than loading it in the prologue for each function The run time system is responsible for initializing this register with an appropriate value before execution begins msoft float Generate output containing library calls for floating point WARNING The requisite libraries are not available for all ARM targets Normally the facilities of the machine s usual C compiler are used but this cannot be done directly in cross compilation You must make your own arrangements to 30 Wasabi Software Development Tools User s Guide Compiler provide suitable library functions for cross compilation msoft float changes the calling convention in the output file therefore it is only useful if you compile all of a program with this option In particular you need to compile 1ibgcc a the library that comes with GCC with msoft float in order for this to work mstrict prototypes mno strict prototypes The mstrict prototypes switch enabled by default causes the compiler to implement functions and function calls with parameter sizes according to their types wherever possible With mno strict prototypes the compiler will ensure all call parameters have at least integer size Also function p
38. o run on specific hardware platforms To compile a program for a specific board a specifications file for that board must be included at compilation Each specifications file contains board specific compiler settings For example the specs iq80310 specs compiler option selects the 1480310 specs file Some boards require a combination of a specifications file and other compiler settings Here is a list of Intel boards and their required compiler settings Board Compiler Settings 80310 specs iq80310 specs 80321 specs redboot specs IWMMXT specs redboot specs mcpu iwmmxt IXDP425 specs redboot specs mbig endian GRG specs redboot specs mbig endian 16 r Wasabi Software Development Tools User s Guide Run the Executable Run the Executable Throughout these examples on screen sample sessions are shown with a green background Code input is shown in plain monofont Code output is shown in bold monofont The following examples were made using GDB GNU Debugger in command line mode on the Windows operating system The system command prompt is shown as c gt Run on the Stand alone Simulator To run this program on the stand alone simulator enter xscale elf run hello The simulator executes the program and returns the system prompt when the program exits C gt xscale elf run hello hello world 3 4 7 CEN gt Wasabi Software Development Tools User s Guide 17 Tutorial
39. ollowing sections describe how different data types are returned Floats and Integer like Values If ATPCS compliancy is enabled via matpcs then any type that is less than 32 bits in size is zero or sign extended to 32 bits and returned in register x0 Any type that is 32 bits in size is returned in register r0 Larger values are returned in memory The only exception being doubles and long long integers which are handled as described below If ATPCS compliancy is not enabled this is the default then the following rules are obeyed Floats and integer like values are returned in register ro A type is integer like if its size is less than or equal to one word and if the type is a structure union or array then all of its addressable sub fields must have an offset of zero For example struct int aig b 8 C48 d B is integer like as is union int i char p but struct char A char B char c char D is not because it is possible to take the address of fields B C or D and their offsets from the start of the structure are not zero Doubles and long long Integers Doubles and long long integers are returned in registers ro and r1 For doubles ro always contains the most significant word of the double For long long values ro only contains the most significant word if the target is big endian Other Values All other values are returned by placing them into a suitably sized area of memory provided for this purpose by the fun
40. omewhere Warning operand out of range An immediate value was specified that is too large for the instruction 50 Wasabi Software Development Tools User s Guide Linker Linker This section describes features of the GNU Linker for Intel XScale Microarchitecture For a more complete description of the GNU Linker see Using ld at http www gnu org manual manual html Command Line Options There are no specific linker options for Intel XScale Microarchitecture Interworking Between ARM and Thumb Code For the ARM the linker 1a will generate code stubs to allow functions calls between ARM and Thumb code These stubs only work with code that has been compiled and assembled with the mthumb interwork command line option If it is necessary to link with old ARM object files or libraries which have not been compiled with the mthumb interwork option then the support old code command line switch should be given to the linker This will make it generate larger stub functions which will work with non interworking aware ARM code NOTE The linker does not support generating stubs for function calls to non interworking aware Thumb code The thumb entry switch is a duplicate of the generic ent ry switch in that it sets the program s starting address However it also sets the bottom bit of the address so that it can be branched to using a BX instruction and the program will start executing in Thumb mode straight away
41. ompile code for a little endian processor mcallee super interworking Gives all externally visible functions in the file being compiled an ARM instruction set header which switches to Thumb mode before executing the rest of the function This allows these functions to be called from non interworking code Wasabi Software Development Tools User s Guide 27 Reference mcaller super interworking Allows calls via function pointers including virtual functions to execute correctly regardless of whether the target code has been compiled for interworking or not There is a small overhead in the cost of executing a function pointer if this option is enabled mcpu NAME This specifies the name of the target ARM processor GCC uses this name to determine what kind of instructions it can emit when generating assembly code Permissible names are arm2 arm250 arm3 arm6 arm60 arm600 arm610 arm620 arm7 arm7m arm7d arm7dm arm7di arm7dmi arm70 arm700 arm700i arm710 arm710c arm7100 arm7500 arm7500fe arm7tdmi arm8 arm810 arm9 arm9e arm920 arm920t arm940t arm9tdmi armlO0tdmi arm1020t strongarm strongarm110 strongarm1100 xscale core3 iwmmxt IMPORTANT If you want the compiler to use the Intel Wireless MMX instructions you must use the mcpu iwmmxt command line switch If mcpu iwmmxt is not specified code is generated for processors based upon Intel XScale Microarchitecture with
42. omplete solution for C and C development for Intel XScale Microarchitecture The tools include the compiler interactive debugger and utilities libraries The Wasabi Software Development Tools User s Guide consists of the following sections Introduction An introduction to the features of the Wasabi Software Development Tools Installation Installation instructions for the software Tutorial Instructions for compiling linking and debugging a sample program Reference Intel XScale Microarchitecture features of the main Tools Bibliography Wasabi Software Development Tools User s Guide 1 Introduction Toolkit Features This section describes features of the Wasabi Software Development Tools specific to the Intel XScale Microarchitecture Processor Version Processors based upon Intel XScale Microarchitecture Supported Targets Wasabi Instruction Set Simulator Both big endian and little endian mode may be selected The default is little endian The target boards are only supported in little endian mode Supported Hosts CPU Operating System Vendor x86 Red Hat Linux 9 Red Hat Inc x86 Windows XP Microsoft Object File Format The tools support the ELF object file format Refer to Chapter 4 System V Application Binary Interface Prentice Hall 1990 Use 14 or objcopy to produce S records For information on using 14 see Using LD the GNU linker at http www gnu
43. org manual manual html For information on objcopy see GNU Binary Utilities at http www gnu org manual manual html 2 r Wasabi Software Development Tools User s Guide Tool Naming Conventions Tool Naming Conventions Wasabi cross development tools normally have names that reflect the target processor and the object file format output by the tools for example ELF This makes it possible to install more than one set of tools in the same binary directory including both native and cross development tools The complete tool name is a three part hyphenated string The first part indicates the processor family xsca1e The second part indicates the file format output by the tool e1 The third part is the generic tool name gcc For example the GCC ELF compiler for the Intel XScale Microarchitecture is xscale elf gcc The Intel XScale Microarchitecture package includes the following supported tools Tool Description Tool Name ELF GCC compiler xscale elf gcc C compiler xscale elf gt GAS assembler xscale elf as GNU LD linker xscale elf ld Stand alone simulator xscale elf run Binary Utilities xscale elf ar xscale elf nm xscale elf objcopy xscale elf objdump xscale elf ranlib xscale elf readelf xscale elf size xscale elf strings xscale elf strip GDB debugger xscale elf gdb xscale elf insight Wasabi Software Development Tools User s Guide 3 Introduction Case
44. other convenient directory Follow these instructions to correctly install the Wasabi Developer Tools on a system running Red Hat Linux 9 1 Login as the user who owns the install directory install dir 2 Usethis command to make the install directory current cd install dir 3 Usethis command to unpack the files tar xvzf path where received toolname tools YYYYMMDD linux tar gz 4 To access the compiler make sure that the install directory is on your path For example for Borne Shell users PATH install dir bin PATH export PATH or for C Shell csn users setenv PATH install dir bin PATH In addition if you did not install in usr local you must set an environment variable For Borne Shell users GCC EXEC PREFIX install dir lib gcc lib export GCC EXEC PREFIX or for C Shell csn users setenv GCC EXEC PREFIX install dir lib gcc lib NOTE In the code example above the trailing forward slash character is required 6 r Wasabi Software Development Tools User s Guide Red Hat Linux 9 Rebuilding From Source Code The file containing your sources should expand to a directory hierarchy with src at the top 1 Choose a directory to contain the src structure and your build directories For example cd mkdir xscale tools cd xscale tools Next unpack your sources For example tar xvzf path where received toolname tools YYYYMDD src tar
45. out the Intel Wireless MMXTM technology mfp NUMBER mfpe NUMBER This specifies the version of the floating point emulation available on the target Permissible values are 2 and 3 m p is a synonym for mfpe for compatibility with older versions of GCC mfunc pad nop mno func pad nop Some processors based upon Intel XScale Microarchitecture have a performance problem which can cause a function return instruction to take longer to execute than it should This problem can be worked around by inserting no op instructions in the function epilogue This switch disabled by default tells the compiler to do this mhard float Generate output containing floating point instructions This is the default 28 Wasabi Software Development Tools User s Guide Compiler mldm stm mno ldm stm The ARM architecture has load multiple LDM and store multiple STM instructions which are used in various places by the compiler On processors based upon Intel XScale Microarchitecture the LDM and STM instructions have a high issue latency and thus are often slower than individual load and store instructions The mno 1dm stnm switch disables the use of LDM and STM instructions The default is m1dm stm mlittle endian Generate code for a processor running in little endian mode This is the default for all standard configurations mlong calls mno long calls Tells the compiler to perform function calls by first loading the addr
46. r more information on these attributes see Attributes on page 33 GCC supports these ARM pragmas long calls Set all subsequent functions to have the 1ong ca11 attribute no long calls Set all subsequent functions to have the short ca11 attribute long calls off Do not affect the long_call or short call attributes of subsequent functions Vector Types GCC includes limited support for vectors Vectors are short fixed length arrays which map onto the data types that correspond to Intel Wireless MMX Technology Vectors are declared using the compiler s attribute mechanism GCC supports three vector types two 32 bit values four 16 bit values and eight 8 bit values Two 32 bit values typedef long long int vector X attribute _ mode V2SI Four 16 bit values typedef long long short vector X attribute _ _ mode V4HI Eight 8 bit values typedef long long char vector attribute _ mode V8QI These vector types can be regarded as if they were arrays of the same length and size However they can also be operated upon by the instructions of the Intel Wireless MMX Technology by using the intrinsic functions feature of the compiler Wasabi Software Development Tools User s Guide 35 Reference Vector Intrinsic Functions Vector types can be passed to special built in functions which GCC will replace with invocations of the corresponding instructions from Intel Wireless MMXTM Technology For
47. rame that is compliant with the Thumb Procedure Call Standard for all leaf functions A leaf function is one that does not call any other functions The default is mno apcs 1eaf fram Wasabi Software Development Tools User s Guide 31 Reference mtune CPU TYPE This option is very similar to the mcpu option except that instead of specifying the actual target processor type and hence restricting which instructions can be used it specifies that GCC should tune the performance of the code as if the target were of the type specified in this option but still choosing the instructions that it will generate based on the cpu specified by a mcpu option For some ARM implementations better performance can be obtained by using this option For a list of permissible values for cPU TYPE see the mcpu option mwords littl ndian This option only applies when generating code for big endian processors Generate code for a little endian word order but a big endian byte order That is a byte order of the form 32107654 NOTE This option should only be used if you need compatibility with code for big endian ARM processors generated by versions of the compiler prior to 2 8 mxscale schedule mult Processors based upon Intel XScale Microarchitecture have a non pipelined multiplier unit with a variable result latency that requires accurate modelling to avoid pipeline stalls Using this option with some source code leads to good performance
48. rologues will convert parameters back to the sizes of their declared types This may be necessary for compatibility with older object code mstructure size boundary N The size of all structures and unions will be rounded up to a multiple of the number of bits set by this option Permissible values are 8 and 32 The default value varies for different toolchains For example a COFF targeted toolchain has a default value of 8 Specifying the larger number can produce faster more efficient code but can also increase the size of the program The two values are potentially incompatible Code compiled with one value cannot necessarily expect to work with code or libraries compiled with the other value if they exchange information using structures or unions mthumb Generate code for the 16 bit Thumb instruction set The default is to use the 32 bit ARM instruction set mthumb interwork mno thumb interwork Generate code which supports calling between the ARM and Thumb instruction sets Without this option the two instruction sets cannot be reliably used inside one program The default is mno thumb interwork since slightly larger code is generated when mthumb interwork is specified mtpcs frame Generate a stack frame that is compliant with the Thumb Procedure Call Standard for all non leaf functions A leaf function is one that does not call any other functions The default is mno tpcs frame mtpcs leaf fram Generate a stack f
49. rs 0 16 EL ITI L E2 18 3 19 4 20 HED 21 f6 22 HEVZA 23 c0 32 cl 33 c2 34 c3 35 c4 36 te5 37 c6 38 c7 39 c8 40 c9 41 c10 42 cll 43 c12 44 c13 45 cl4 46 c15 47 cr0 32 icri 233 icrz 34 icr3 35 cr4 36 fers 37 icro 38 icr7 39 cr8 40 cr9 41 crl0 42 crll 43 crl2 44 Grl13 45 terl4 46 cr15 47 48 n Wasabi Software Development Tools User s Guide Assembler Floating point Both the assembler and the compiler support hardware floating point Opcodes For detailed information on the machine instruction set for Intel XScale Microarchitecture see Intel KScale Microarchitecture Programmers Reference Manual at http www intel com design intelxscale 273436 htm The GNU Assembler GAS implements all the opcodes including both the standard ARM opcodes and Intel s extensions ARM Machine Directives The assembler supports the following ARM machine directives align expression expression This is the generic align directive For the ARM however if the first argument is zero i e no alignment is needed the assembler will behave as if the argument had been 2 i e pad to the next four byte boundary This is for compatability with ARM s own assembler name req register_nam This creates an alias for register_name called name For example foo req r0 code 16 32 This directive selects th
50. s then we will show the actual transcripts of the session In each of the following steps type the indicated command at the command prompt and press the Enter key 1 2 10 11 Start GDB xscal lf gdb hello ex Specify the target the program will run on with the target command To specify the instruction set simulator use target sim Load the program into memory load Set a breakpoint at main break main Start the executable To run the executable on the instruction set simulator use run The program starts running and then stops at the breakpoint 66 23 Display the value of the variable a print a Execute the next line in the program step Display the current value of the variable a print a Display the source code of the program being debugged list Display the source code of the foo function list 00 Set a breakpoint at line seven break 7 You can set a breakpoint at any line by entering break 1inenumber where linenumber is the specific line number in the source code Wasabi Software Development Tools User s Guide 19 Tutorial 12 13 14 15 16 17 Resume normal execution of the program up to the next breakpoint continue Step to the next line and execute it step Display the value of the variable c print c Continue to the next source line in the current innermost stack frame next This is similar to the step command but function
51. srawi builtin arm wsrld builtin arm wsrldi builtin arm wsrlh builtin arm wsrlhi builtin arm wsrlw builtin arm wsrlwi builtin arm wsubb builtin arm wsubbss builtin arm wsubbus builtin arm wsubh builtin arm wsubhss builtin arm wsubhus builtin arm wsubw builtin arm wsubwss builtin arm wsubwus builtin arm wunpckehsb builtin arm wunpckehsb Jbuiltin arm wunpckehsh builtin arm wunpckehsh builtin arm wunpckehsw Jbuiltin arm wunpckehsw builtin arm wunpckehub builtin arm wunpckehub builtin arm wunpckehuh builtin arm wunpckehuh builtin arm wunpckehuw Jbuiltin arm wunpckehuw builtin arm wunpckelsb builtin arm wunpckelsb Jbuiltin arm wunpckelsh builtin arm wunpckelsh builtin arm wunpckelsw Jbuiltin arm wunpckelsw builtin arm wunpckelub builtin arm wunpckelub Jbuiltin arm wunpckeluh builtin arm wunpckeluh builtin arm wunpckeluw Jbuiltin arm wunpckeluw builtin arm wunpckihb builtin arm wunpckihh builtin arm wunpckihw builtin arm wunpckilb builtin arm wunpckilh builtin arm wunpckilw builtin arm wxor builtin arm wzero Wasabi Software Development Tools User s Guide 37 Reference ABI Summary The tools for Intel XScale Microarchitecture adhere by default to the APCS ARM Procedure Call Standard The following ABI summary is consistent with this standard Data Type Sizes and Alignments The following table shows the siz
52. ssent nen nem nen nenne 42 Function Return Values 4 2 eee icit bee ti iii 43 Assemblet 23 Sei oe tel ete RR e FR E ERR hee ed Here eH HERR ad d k Reden vo e AZ 44 Command Line Opuons ideni Eee e OD kek yan b Reden 44 SA dT Et 46 Local Symbol NaMES sagu sas sanese anane anaa AN NG NGENE EA een GA DHE NGGAWA D REN M aa SERRA 46 Special Character Sky sasasi k k yara kirl GAGE NAN i i UH WA B k aw n 47 Register Names RC 48 Eloating point iecit eredi etd e a doe dek Ke keda d 49 Sir C KA a ie 49 ARM Machine Directives irre eed ederet eec Kab ee o oed 49 Assembler Error Messages erinnert ee y k w da ER ot lek ek Hed ek xa k 50 Til D NDJ n mme mnmmm 51 Command Line Options toii lac Keyan te bei Wk ep pa on e H ka EMEK Lig 51 Interworking Between ARM and Thumb Code eee 51 Objduimp ntt d eR EE Poe HO qe EU e n n ether 52 Command Line Switch ci iiec neatis ee de baee eee ede Cu H k ae Ng ka 52 bog H 54 Command Line Opuons su sada k k leke de e e re ie tad sani 55 NnEiro ge ni 56 Command Line Opuons nd prec te Dee e ep Pg Hekar K 56 LIMhIgnip ge s 57 iv Wasabi Software Development Tools User s Guide 1 asabi Introduction The Wasabi Software Development Tools are a c
53. t address you can start your program by typing continue Or jump start The jump start command can be used to rerun the program when it has continued as well as starting the program from the beginning Command Line Options There are no specific debugger command line options for Intel XScale Microarchitecture Wasabi Software Development Tools User s Guide 55 Reference Simulator The simulator can simulate any ARM processor including processors based upon Intel XScale Microarchitecture The simulator can simulate any ARM instruction including the instructions specific to Intel XScale Microarchitecture It is not a cycle accurate simulator nor is it a board level simulator The simulator supports co processors CP4 CP5 CP13 CP14 and CP15 The simulator also supports the ARM MMU registers The simulator has limited pass through capability to the host operating system For example it is able to simulate basic file operations including writing to stdout and memory allocation The simulator is theoretically capable of simulating any address space providing that memory is available on the host operating system Command Line Options There are no specific simulator command line options for Intel XScale Microarchitecture 56 r Wasabi Software Development Tools User s Guide A asabi Bibliography Intel XScale Microarchitecture Programmers Reference Manual http www intel com design intelxscale 27
54. xtend the processor using the co processor instruction space For example mcpu arm920 maverick is equivalent to specifying mcpu ep9312 The following extensions are currently supported maverick and xscale march architecture extension This option specifies the target architecture The assembler will issue an error message if an attempt is made to assemble an instruction which will not execute on the target architecture The following architecture names are recognized armvl armv2 armv2a armv2s armv3 armv3m armv4 armv4xm armv4t armv4txm armv5 armv5t armv5txm armv5te armv5texp and xscale NOTE If both mcpu and march are specified the assembler will use the setting for mcpu The architecture option can be extended with the same instruction set extension 44 r Wasabi Software Development Tools User s Guide Assembler options as the mcpu option mfpu floating point format This option specifies the floating point format to assemble for The assembler will issue an error message if an attempt is made to assemble an instruction which will not execute on the target floating point unit The following format options are recognized softfpa fpe fpe2 fpe3 fpa fpa10 fpa11 arm7500fe softvfp softvfptvfp vfp vfp10 vfp10 r0 vfp9 vfpxd arm1020t and arm1020e In addition to determining which instructions are assembled this option also affects the way in which the double assembler directive behaves wh

Download Pdf Manuals

image

Related Search

Related Contents

Dialogic® Vision™ Capacity Upgrade Manual  Amana NED4705EW Dimension Guide    Cooler Master NotePal X-Slim  Ewent EW3543  Product user manual  étude détaillée - Grand Livre d`Illustrator  (1 500 modèles) / 1999-02 V8-6,0 l Silverado  Manual Fluke 52-II  亜硝酸エステル類用 急性中毒症例調査用紙 基本情報  

Copyright © All rights reserved.
Failed to retrieve file