Home
TMS320C3X/C4X CODE GENERATION TOOLS GETTING
Contents
1. 41 System Requirements s ne 4 2 Mounting the CD ROM and Installing the Tools 43 Setting Up the Environment anes ee ee ee e a e 4 4 Where to Go From Here i m ee ne eee eenen System Reguirements 4 1 System Requirements To install the TMS320C3x C4x code generation tools on an HP workstation you need the following items j HP 9000 Series 700 PA RISC computer 4 Mbytes of disk space for the software tools HP UX 9 0x operating system CD ROM drive Root privileges to mount and unmount the CD ROM 4 2 Mounting the CD ROM and Installing the Tools 4 2 Mounting the CD ROM and Installing the Tools To install the software tools you must mount the CD ROM copy the files to your system and unmount the CD ROM Note You must have root privileges to mount or unmount the CD ROM If you do not get help from your system administrator Mounting the CD ROM Installing the tools The code generation tools package is shipped on CD ROM As root you can mount the CD ROM using the UNIX mount command or the SAM System Administration Manager To use the UNIX mount command enter mount rt cdfs dev dsk your cdrom device cdrom exit Make the hp directory on the CD ROM the current directory For example if the CD ROM is mounted at cdrom enter cd cdrom hp Touse SAM to mount the CD ROM see System Administration Tasks the HP documentation abo
2. e eis 1 2 1 2 Installing the Tools 0 ees tele oerte eite nae etis seen nn 1 3 1 3 Setting Up the Environment eee een 1 4 Performance Considerations s 1 10 i 5ueWhereitoi GolEromillere E ee ei 1 11 1 1 System Reguirements 1 1 System Requirements 1 2 To install the TMS320C3x C4x code generation tools on a PC you need the following items Lj 80386 80486 or Pentium based PC running MS DOS PC DOS or Windows 3 1 4 16 Mbytes of free memory 16 Mbytes is recommended to ensure optimum performance when compiling large C functions 1 10 Mbytes of disk space for the executable files and libraries CD ROM drive Note Memory Needed The code generation tools when installed on a PC require at least 4 Mbytes of memory but you can expect some performance problems when using only 4 Mbytes 16 Mbytes is recommended You may want to free as much memory as possible before installing the tools especially if you have less than 16 Mbytes eee Installing the Tools 1 2 Installing the Tools The code generation tools package is shipped on CD ROM The installation instructions vary according to your operating system Installing the tools on DOS systems To install the tools on a DOS system follow these steps 1 2 3 4 Insert the TMS320C3x C4x Software Toolkit CD ROM into your CD ROM drive Change to the CD ROM drive replace d wi
3. profile file for Bourne or Korn shells to avoid entering the commands each time you invoke a new shell The remainder of this section describes these environment variables and other variables that you can define Identifying the directory that contains the executable files path statement 4 4 You must include the tool dirdirectory in your path statement This allows you to specify the assembler and compiler tools without specifying the name of the directory that contains the executable files Lj Ifyou modify your cshrcfile for C shells or profile file for Bourne or Korn shells to change the path information add the following to the end of the path statement tool dir If you set the path statement from the command line use this format m For C shells set path too dir path B For Bourne or Korn shells PATH tfool_dir PATH The addition of path PATH ensures that this path statement does not undo the path statements in the cshrc or profile file Setting Up the Environment Identifying alternate directories for the assembler A DIR By default the assembler searches for copy include files or macro libraries in the current directory and then in directories named by the i name alternate directories option Use the A DIR environment variable to define additional search paths The format of the command for assigning the environment variable is as follows ForC shells setenv A DIR pathname1 pathnam
4. 281 274 2323 Fax Fax 214 638 7742 281 274 2324 Email dsph ti com DSP Internet BBS via anonymous ftp to ftp ftp ti com pub tms320bbs Europe Middle East Africa European Product Information Center EPIC Hotlines Multi Language Support Deutsch English Francais Italiano EPIC Modem BBS European Factory Repair 33 1 30 70 11 69 49 8161 80 33 11 or 33 1 30 70 11 68 33 1 30 70 11 65 33 1 30 70 11 64 33 1 30 70 11 67 33 1 30 70 11 99 33 4 93 22 25 40 Fax Fax 33 130701032 Email epic ti com 49 81 61 80 40 10 Europe Customer Training Helpline g Asia Pacific Literature Response Center Hong Kong DSP Hotline Korea DSP Hotline Korea DSP Modem BBS Singapore DSP Hotline Taiwan DSP Hotline Taiwan DSP Modem BBS 852 2 956 7288 852 2 956 7268 82 2 551 2804 82 2 551 2914 886 2 377 1450 886 2 376 2592 Fax Fax Fax Fax Fax 852 2 956 2200 852 2 956 1002 82 2 551 2828 65 390 7179 886 2 377 2718 Taiwan DSP Internet BBS via anonymous ftp to ftp dsp ee tit edu tw pub TI Japan Product Information Center 0120 81 0026 in Japan 03 3457 0972 or INTL 813 3457 0972 DSP Hotline DSP BBS via Nifty Serve 03 3769 8735 or INTL 813 3769 8735 Type Go TIASP Fax Fax Fax 0120 81 0036 in Japan 03 3457 1259 or INTL 813 3457 1259 03 3457 7071 or INTL 813 3457 7071 Documentation When making suggestions or report
5. C44 I 2 Now enter the following command to assemble file2 asm asm30 file2 asm 1 This time the assembler creates an object file called file2 obj The I lowercase L option tells the assembler to create a listing file the listing file for this example is called file2 Ist It is not necessary to create a listing file but it gives you information and assures you that the assembly has resulted in the desired object code The listing file for this example is shown in Example 5 3 Example 5 3 file2 Ist the Listing File Created by asm30 file2 asm Fr fi 1 2 3 4 5 6 7 No TMS320C3x 4x COFF Assembler Version 5 00 Copyright c 1987 1996 Texas Instruments Incorporated i Dec 20 11 01 34 1996 le2 asm PAGE 1 file file2 asm def addvec 00000000 text 00000000 07608000 addvec Idf 0 r0 00000001 13f b0003 rpts 3 00000002 01c02001 addf ar0 r0 00000003 78800000 rets Errors No Warnings 3 Now enter the following command to link file1 obj and file2 obj lnk30 filel file2 m lnker2 map o prog out Getting Started With the Code Generation Tools 5 3 Getting Started With the Assembler and Linker The Ink30 command invokes the linker The input object files are file1 obj and file2 obj If the input file extension is obj you do not have to specify the extension the linker uses obj as the default The linker combines file1 obj and file2 obj to create an executable object mod
6. INITIALIZATION TABLES CONSTANTS SYSTEM STACK DYNAMIC MEMORY DELETE IF NOT USI VARIABLES Release Notes x xy R M x D Appendix A Troubleshooting DOS Systems DOS 4GW is a memory manager that is embedded into the TMS320C3x C4x code generation tools so you may occasionally see DOS 4GW error messages while you are using the tools The executable files for DOS 4GW are not shipped as such nor is any documentation provided on this tool except for the list of error messages Section A 2 Kernel Error Messages and Section A 3 DOS 4G Error Messages are excerpted from the DOS 4GW User s Manual reproduced here with the permission of Tenberry Software Inc Included are lists of error messages with descriptions of the circumstances in which the error is most likely to occur and suggestions for remedying the problem Portions of the excerpt have been modified to provide you with specific information about using TI tools Topic Page A 1 Troubleshooting in the Protected Mode Environment A 2 Kernel Error Messages a a n 1 1 1 2 5 stare 108 3 a ola oje ess A 5 ASS DOS 4GIErronMessages E rrr eri A 1 Troubleshooting in the Protected Mode Environment A 1 Troubleshooting in the Protected Mode Environment A 2 Getting 32 bit programs to execute properly under DOS can be frustrating Your computer s configuration and memory management can cause problems that may be
7. PC Running Windows NT or Windows 95 This chapter helps you install release 5 00 of the TMS320C3x C4x code generation tools and set up your code development environment on a PC running Windows NTM or Windows 95 These tools include an optimizing C compiler and a full set of assembly language tools for developing and manipulating assembly language and object executable code The C compiler tools include Parser Optimizer Code generator Interlist utility Library build utility O O O C L The assembly language tools are composed of the following Assembler Archiver Linker Absolute lister Cross reference lister Hex conversion utility O O O O O L Topic Page 2 1 System Requirements s s es sanra seara EET 2 2 InstallingithesTooIs 0 1 2 3 Setting Up the Environment eee 2 4 WhereitolGoiEromillere dr eT EE 2 1 System Reguirements 2 1 System Requirements 2 2 To install the TMS320C3x C4x code generation tools on a PC you need the following 32 bit x86 or Pentium based PC running m Windows NT 3 51 or higher m Windows 95 1 4 16 Mbytes of free memory 16 Mbytes is recommended to ensure optimum performance when compiling large C functions 10 Mbytes of disk space for the executable files and libraries CD ROM drive Note Memory Needed The code generation tools when installed on a PC require at least 4 Mbytes of memory but you can expect s
8. and compiler 5 1 Getting Started With the Assembler and Linker 00 00 ccc cece een eeeees 5 2 Getting Started With the C Compiler 440000000 5 5 6 Release NGS sis eso Hosen r aste Rae euawd 5 1 Provides information on tools and new features revised since the last release including all en hancements made to the TMS320C3x C4x assembly language tools and optimizing C compil er 6 1 Release Enhancements 66b db rnr EaaOEI dalo VA ANE NEN REA TAS 6 2 CAME PM POPP O peces E O rd padri oput dor O L 6 4 A Troubleshooting DOS Systems sssssss III menn A 1 Lists kernel and DOS 4G error messages and explains how you can resolve them A 1 Troubleshooting in the Protected Mode Environment The PMINFO EXE program ene mn A 2 Kernel Error Messages cece eee een k A 3 DOS 4G Error Messages 2 eee teen nett eae Contents B Tables of Peripheral Registers Structure Member Names and Bit Field Names C Lists the data structure member names that are used to access each of the peripheral registers and bit fields through C peripheral pointers This appendix is provided as an update to the paral lel runtime support table cj cop rrr E 1 Defines acronyms and key terms used in this book Contents xi Tables A 1 PMINEO Fields renen gie aot wetr acai O O eR s B 1 Bus Control Registers B 2 DMA Control Registers Examples 5 1 file1 asm 5 2 flle2 aS
9. assembler walkthrough 2 to 5 4 au option benchmark improvements 6 3 branch instructions Index bss section defined bus control example registers B 2 C compiler defined walkthrough to 5 8 C I O support 6 3 C DIR environment variable for DOS for HP workstations for SPARCstations for Windows 3 1 for Windows 95 for Windows NT C OPTION environment variable for DOS for HP workstations 4 6 to 4 7 for SPARCstations to 3 8 for Windows 3 1 for Windows 95 for Windows NT cl30 defined C 1 invoking 5 5 COFF common object file format defined COFF2 format command line options added in this release 6 2 removed in this release 6 2 const section constants placed in const section Index 1 Index delay slots DMA control example registers B 3 DOS DOS4GVM environment variable 1 7 to 1 9 installing the tools 1 3 memory requirements PMINFO A Slto A 1O setting up the environment 1 4 to 1 9 system requirements virtual memor defined a Er s management VMM 1 7 to 1 9 1 10 DOS 16M defined DOS 4G defined error messages A 9 to A 10 DOS 4GW defined C 2 definition error messages A 1 to A 10 DOS4GVM environment variable 1 7 to 1 9 enhancements 6 2 environment variables defined for DOS to 1 9 for HP workstations for SPARCstations for Windows 3 1 for Windows 95 error messages DOS 4G A e to A 10 kernel A 5 to A 8
10. command or directive is in a bold typeface and parameters are in an italic typeface Portions of a syntax that are in bold should be entered as shown portions of a syntax that are in italics describe the type of information that should be entered Here is an example of a command syntax sfloat value Square brackets and identify an optional parameter If you use an op tional parameter you specify the information within the brackets you do not enter the brackets themselves Here is an example of a command that has optional parameters set DOS4GVM option value option tvalue This command allows you to specify one or more options and to indicate values with each option if appropriate In this example you must include the symbol if you enter a value Related Documentation From Texas Instruments Related Documentation From Texas Instruments The following books describe the TMS320C3x C4x floating point DSPs and related support tools To obtain a copy of any of these TI documents call the Texas Instruments Literature Response Center at 800 477 8924 When ordering please identify the book by its title and literature number TMS320C3x C4x Assembly Language Tools User s Guide literature number SPRUO35 describes the assembly language tools assembler linker and other tools used to develop assembly language code assembler directives macros common object file format and symbolic debugging directives for
11. you might find it useful to set default options for the compiler assembler and linker using the C OPTION environment variable After reading the command line options and input file names the shell reads the contents of the C OPTION environment variable Notice that options defined with C OPTION do not override the options specified on the command line Setting up default options with the C OPTION environment variable is especially useful when you want to run consecutive times with the same set of options and or input files The options and or input filenames that you define with C OPTION are used every time you run the shell The syntax for the C OPTION environment variable is g ForCshells setenv C OPTION option option2 For Bourne or Korn shells C OPTION option1 option2 export C OPTION Options specified in the environment variable are specified in the same way and have the same meaning as they do on the command line For more information about compiler and assembler options see the TMS320C3x C4x Optimizing C Compiler User s Guide and the TMS320C3x C4x Assembly Language Tools User s Guide For example if you want to always run quietly the g option enable C source interlisting the s option and link the z option set up the C OPTION environment variable as follows setenv C OPTION qs z for C shells C OPTION qs z tor Bourne or Korn shells export C OPTION In this example each
12. 16M This error most often occurs because of an unrecoverable stack segment exception stack overflow but can also occur if the Global Descriptor Table or Interrupt Descriptor Table is corrupted Action Restart your computer If the problem persists contact technical support 2 nota DOS 16M executable lt filename gt Description DOSAG EXE or a bound DOS 4G application has probably been corrupted in some way Action Recopy the file from the source media 6 notenough memory to load program Description There is not enough memory to load DOS 4G Action Make more memory available and try again 8 cannot open file filename Description The DOS 16M loader cannot load DOS 4G probably because DOS has run out of file units Action Set a larger FILES entry in the CONFIG SYS file reboot and try again Troubleshooting DOS Systems A 5 Kernel Error Messages A 6 9 cannot allocate tstack Description There is not enough memory to load DOS 4G Action Make more memory available and try again 10 cannot allocate memory for GDT Description There is not enough memory to load DOS 4G Action Make more memory available and try again 11 no passup stack selectors GDT too small Description There is an internal error in DOS 4G or an incompatibility with other software Action Contact technical support 12 no control program selectors GDT too small Description There is an internal error in DOS 4G or an inco
13. C4x Optimizing C Compiler User s Guide Identifying alternate directories for the compiler C DIR By default the compiler searches the current directory for include files and object libraries such as the runtime support and C I O libraries Use the C DIR environment variable to define additional search paths The format of the command for assigning the environment variable is as follows set C DIRzpathnameT pathname 2 You can separate the pathnames with a semicolon or a blank Once you set C DIR you can use the include directive in your C source code without specifying path information Setting Up the Tools on a PC Running DOS or Windows 3 1 1 5 Setting Up the Environment Setting default shell options C OPTION 1 6 When using the shell program cl30 you might find it useful to set default options for the compiler assembler and linker using the C_OPTION environment variable After reading the command line options and input file names the shell reads the contents of the C_OPTION environment variable Notice that options defined with C_OPTION do not override the options specified on the command line Setting up default options with the C_OPTION environment variable is especially useful when you want to run consecutive times with the same set of options and or input files The options and or input filenames that you define with C_OPTION are used every time you run the shell The syntax for the C_OPTION environment va
14. Protected real switch rate Purpose Shows the CPU processor equivalent and the speed of the CPU in MHz Shows the configured memory in DOS and extended memory as provided by the BIOS interrupts 12h and 15h function 88h Shows the configuration obtained directly from the CMOS RAM as set by the com puter s setup program It is displayed only if the numbers are different from those in the BIOS line They are different if the BIOS has reserved memory for itself or if another program has allocated memory and is intercepting the BIOS configura tion requests to report less memory available than is physically configured If displayed shows the low and high addresses available to DOS 4GW in extended memory PMINFO tries to determine the memory architecture Some architectures perform well under some circumstances and poorly under others PMINFO shows the best and worst cases The architectures detected are cache interleaved page mode or static column and direct Measurements are made by using 32 bit accesses and are reported as the num ber of megabytes per second that can be transferred The number of wait states is reported in parentheses The wait states can be a fractional number like 0 5 if there is a wait state on writes but not on reads Memory bandwidth that is how fast the CPU can access memory accounts for 60 to 70 of the performance for typical programs those that are not heavily dependent on floating point math Sho
15. and hardware devel opment tools speech recognition image processing noise cancellation modems etc Trademarks Trademarks DOS 4G is a trademark of Tenberry Software Inc HP 9000 Series 700 PA RISC and HP UX are trademarks of Hewlett Packard Company IBM OS 2 OS 2 Warp PC DOS and PC are trademarks of International Busi ness Machines Corp MS DOS MS Windows Windows NT and Windows 95 are registered trade marks of Microsoft Corp OpenWindows SunOS and Solaris are trademarks of Sun Microsystems Inc Pentium is a trademark of Intel Corporation SPARCstation is licensed exclusively to Sun Microsystems Inc UNIX is a registered trademark of Unix System Laboratories Inc 320 Hotline On line is a trademark of Texas Instruments Incorporated Read This First vii If You Need Assistance If You Need Assistance a World Wide Web Sites TI Online Semiconductor Product Information Center PIC DSP Solutions 320 Hotline On line http www ti com http www ti com sc docs pic home htm http www ti com dsps http www ti com sc docs dsps support htm North America South America Central America Product Information Center PIC TI Literature Response Center U S A Software Registration Upgrades U S A Factory Repair Hardware Upgrades U S Technical Training Organization DSP Hotline DSP Modem BBS 972 644 5580 800 477 8924 214 638 0333 281 274 2285 972 644 5580 281 274 2320
16. directory where the source resides this is useful for protected directories To set the TMP environment variable use this syntax A For C shells setenv TMP temp g For Bourne or Korn shells TMP temp export TMP Where to Go From Here 3 4 Where to Go From Here Your code generation tools are now installed At this point you should do the following Go to Chapter 5 Getting Started With the Code Generation Tools This chapter provides you with an overview of how to invoke and use the assembler linker and compiler Read Chapter 6 Release Notes to understand the new features included in the 5 00 release of the code generation tools Setting Up the Tools on a SPARCstation 3 9 Chapter 4 Setting Up the Tools on an HP Workstation This chapter helps you install release 5 00 of the TMS320C3x C4x code generation tools and set up your code development environment on an HP 9000 Series 700 PA RISC computer with HP UX 9 0x These tools include an optimizing C compiler and a full set of assembly language tools for developing and manipulating assembly language and object executable code The C compiler tools include Parser Optimizer Code generator Interlist utility Library build utility O O O O L The assembly language tools are composed of the following Assembler Archiver Linker Absolute lister Cross reference lister Hex conversion utility O O O O O L Topic Page
17. environment variable to specify default compiler and linker options and then specify additional compiler and linker options on the shell command line If you have set z in the environment variable and want to compile only use the c option of the shell These additional examples assume C OPTION is set as shown above CL30 Fag compiles and links V CL30 E nE only compiles c130 oc z c30 cmd compiles and links using a command file cl130 c c z c30 cmd only compiles c overrides z Setting Up the Environment For more information on linker options see the Linker Options section in the TMS320C3x C4x Assembly Language Tools User s Guide Specifying a temporary file directory TMP The shell program creates intermediate files as it processes your program For example the parser phase of the shell creates a temporary file used as input by the code generator phase By default the shell puts intermediate files in the current directory However you can name a specific directory for temporary files by using the TMP environment variable This feature allows use of a RAM disk or other file systems It also allows source files to be compiled from a remote directory without writing any files into the directory where the source resides this is useful for protected directories To set the TMP environment variable use this syntax ForCshells setenv TMP temp g For Bourne or Korn shells TMP temp expo
18. example assembler compiler Index 2 extended precision 40 bit format long doubles 6 2 arithmetic functions 6 3 far calls 6 2 global symbols defined GROUP statement hex converter support for Motorola formats HP workstations installing the tools 4 3 setting up the environment k 4to 1 7 system requirements initialized sections defined installation for DOS for HP workstations for SPARCstations for Windows 3 1 for Windows 95 for Windows NT interlist utility defined intrinsics invoking assembler 5 2 to 5 4 compiler 5 5 to 5 8 linker kernel error messages A 5 to A 8 library build utiliy linker defined linker walkthrough B 2 to 5 4 listing file defined Ink30 defined invoking 5 3 long doubles extended precision 40 bit format map file defined memory requirements for DOS for Windows 3 1 for Windows 95 for Windows NT mf option ml option mounting the CD ROM for HP workstations 4 3 for SPARCstations mp option MPYI instruction ms option MS DOS command line length 6 4 mtc option mx option optimizer defined C 3 os option Index PATH statement for DOS for Windows 3 1 for Windows 95 for Windows NT path statement for HP workstations 4 4 for SPARCstations performance considerations 1 10 peripheral control library PMINFO A 3 to A 10 pragma defined protected mode environment troubleshooting h 4 programs defi
19. linker continuously allocates output sections For example MEMORY EXTO org 0x001000 len 0x0800 RAMO org 0x809800 len 0x0400 SECTIONS UNION run RAMO textl load EXTO filel obj text file2 obj text text2 load EXTO file3 obj text file4 obj text If you have multiple sections that need to start atthe same run address and they require alignment by different amounts you can use overlays This is one way to simulate what would happen if you could nest GROUP directives in UNION directives The one thing to be aware of is that some loaders may use the page information to place code into different banks of memory All of the TI loaders EVM emulator and simulator do not use the page information in the COFF file org 0x001000 len org 0x809800 len org 0x809800 len RAMO PAGE 0 run RAMO PAGE 0 run RAMO PAGE 0 run RAMO PAGE 0 run 0x0800 0x0400 0x0400 RAMO PAGE 1 align 128 RAMO PAGE 1 align 64 RAMO PAGE 2 align 512 RAMO PAGE 2 align 8 Release Notes Useful Tips 6 6 An alternative to using mk30 to build a library is to use use cl30 to compile all of the c and h files and then use ar30 to archive all of the obj files to an object archive SPARC cd float rts ar30 x float rts src c130 03 010 op0 i ar30 a rts lib obj DOS cd c float rts ar30 x c float rts src c130 03 o10 op0
20. some memory for the DOS 4G application 1005 not enough memory for dispatcher data Description There is not enough memory for DOS 4G to manage user installed interrupt handlers properly Action Free some memory for the DOS 4G application 1007 can t find file lt program gt to load Description DOS 4G could not open the specified program The file probably does not exist It is possible that DOS ran out of file handles or that a network or similar utility has prohibited read access to the program Action Make sure that the filename was spelled correctly 1008 can t load executable format for file filename lt error code gt Description DOS 4G did not recognize the specified file as a valid execut able file DOS 4G can load linear executables LE and LX and EXPs BW Action Recopy the file from the source media Troubleshooting DOS Systems A 9 DOS 4G Error Messages A 10 3301 unhandled EMPTYFWD GATE16 or unknown relocation 3302 unhandled ALIAS16 reference to unaliased object 3304 unhandled or unknown relocation Description If your program was built for another platform that supports the LINEXE format it may contain a construct that DOS 4G does not currently support such as a call gate One of these messages may also appear if your program has a problem mixing 16 and 32 bit code A linker error is another likely cause Action Check for viruses and reinstall the tools from the source m
21. time you run the shell program it runs the linker Any options following z on the command line or in C OPTION are passed to the linker This enables you to use the C OPTION environment variable to specify default compiler and linker options and then specify additional compiler and linker options on the shell command line If you have set z in the environment variable and want to compile only use the c option of the shell These additional examples assume C OPTION is set as shown above c130 X ue compiles and links GIS0 6 only compiles c130 c z c30 cmd compiles and links using a command file c130 c c z c30 cmd only compiles c overrides z Setting Up the Tools on a SPARCstation 3 7 Setting Up the Environment For more information on linker options see the Linker Options section in the TMS320C3x C4x Assembly Language Tools User s Guide Specifying a temporary file directory TMP 3 8 The shell program creates intermediate files as it processes your program For example the parser phase of the shell creates a temporary file used as input by the code generator phase By default the shell puts intermediate files in the current directory However you can name a specific directory for temporary files by using the TMP environment variable This feature allows use of a RAM disk or other file systems It also allows source files to be compiled from a remote directory without writing any files into the
22. tools specifi cally designed for the TMS320C3x C4x floating point DSPs Following are the topics covered in this user s guide For information about Installing the code generation tools or setting environment variables on a PC running MS DOS PC DOS or Windows 3 1 Windows NT or Windows 95 Installing the code generation tools or setting environment variables on a SPARCstation running SunOS Installing the code generation tools or setting environment variables on an HP 9000 Series 700 PA RISC computer running HP UX Getting started using the code generation tools Release notes Troubleshooting DOS systems Accessing TMS320C3x peripherals through C pointers Refer to Chapter 1 Chapter 2 Chapter 3 Chapter 4 Chapter 5 Chapter 6 Appendix A Appendix B Notational Conventions Notational Conventions This document uses the following conventions Lj Program listings program examples and interactive displays are shown in a special typeface Examples use a bold version of the special typeface for emphasis interactive displays use abold verson of the spe cial typeface to distinguish commands that you enter from items that the system displays such as prompts command output error messages etc Here is an example of a command that you might enter mkdir tool dir In this example you should type mkdir as shown and replace tool dir with the name of your directory Lj In syntax descriptions the instruction
23. you do not get your system administrator s help CD ROM drive Root privileges to mount and unmount the CD ROM if you have SunOS 4 1 x SunOS 5 0 or SunOS 5 1 Mounting the CD ROM and Installing the Tools 3 2 Mounting the CD ROM and Installing the Tools To install the software tools you must mount the CD ROM copy the files to your system and unmount the CD ROM Note If you are running SunOS 4 1 x 5 0 or 5 1 you musthave root privileges to mount or unmount the CD ROM If you do not get help from your system administrator Mounting the CD ROM The code generation tools package is shipped on CD ROM The steps to mount the CD ROM vary according to your operating system version m If you have a SunOS 4 1 x as root load the CD ROM into the drive and enter the following from a command shell mount rt hsfs dev sr0 cdrom exit cd cdrom sparc If you have SunOS 5 0 or 5 1 as root load the CD ROM into the drive and enter the following from a command shell mount rF hsfs dev sr0 cdrom exit cd cdrom cdrom0 sparc If you have SunOS 5 2 or higher m If the CD ROM drive is already attached load the CD ROM into the drive Enter cd cdrom cdrom0 sparc B Ifthe CD ROM drive is not attached you must shut down your system to the PROM level at the OK prompt and attach the CD ROM drive As root enter boot r Log on load the CD ROM into the drive and enter cd cdrom cdrom0 spa
24. 0C30 Evaluation Module Selected Application Notes literature number SPRAO21 contains useful information for people who are preparing and debugging code The book gives additional information about the TMS320C30 EVM as well as C coding tips TMS320 Family Development Support Reference Guide literature number SPRUO 11 describes the 320 family of digital signal processors and cov ers the various products that support this product line This includes code generation tools compilers assemblers linkers etc and system integration and debug tools simulators emulators evaluation modules etc Also covered are available documentation seminars the universi ty program and factory repair and exchange Digital Signal Processing Applications with the TMS320 Family Volumes 1 2 and 3 literature numbers SPRA012 SPRA016 SPRA017 Vol umes 1 and 2 cover applications using the C10 and C20 families of fixed point processors Volume 3 documents applications using both fixed point processors as well as the C30 floating point processor TMS320 DSP Designer s Notebook Volume 1 SPRT125 Presents solu tions to common design problems using C2x C3x CAx C5x and other TI DSPs TMS320 Third Party Support Reference Guide literature number SPRUO52 alphabetically lists over 100 third parties that provide various products that serve the family of 320 digital signal processors A myriad of products and applications are offered software
25. IT oos REL RESO ERERRPRERY eh 4x tere o AA dase be DE RO awh 5 3 file2 Ist the Listing File Created by asm30 file2 asm 5 4 Output Map File Inker2 map sssssssessssesseee ene tenet neees 5 5 Sample C File for the C Compiler Walkthrough function c 5 6 Diagnostic Messages Produced by the Compiler B 1 Bus Control B 2 DMA Control xii Chapter 1 Setting Up the Tools ona PC Running DOS or Windows 3 1 This chapter helps you install release 5 00 of the TMS320C3x C4x code generation tools and set up your code development environment on a PC running MS DOS PC DOS or Windows 3 1 These tools include an optimizing C compiler and a full set of assembly language tools for developing and manipulating assembly language and object executable code The C compiler tools include Parser Optimizer Code generator Interlist utility Library build utility The assembly language tools are composed of the following O O O O L Assembler Archiver Linker Absolute lister Cross reference lister Hex conversion utility O O O O C L Release 5 00 supports extended memory on DOS Extended memory lets you compile or assemble large files that could not be built previously under DOS Extended memory is enabled by the DOS 4GW memory extender from Tenberry Software Inc formerly Rational Systems Inc which is embedded in the TMS320C3x C4x code generation tools package Topic Page 1 System Reguirements 32223 aaa 1
26. MP Section 4 2 5 The register calling convention has been modified All registers are now assigned by the compiler COMP Section 4 3 There are three runtime support arithmetic functions specifically for extended precision arithmetic MPY_LD multiply DIV_LD divide and INV_LD inverse reciprocals These functions support the 40 bit long double data type COMP Section 4 7 The compiler uses the MPYI instruction more effectively for integer multiplication COMP Section 4 7 When the mp option is specified the SOR inline function is used for squaring which reduces cycle time COMP Section 4 7 The runtime support library includes C I O support COMP Appendix B The following version symbols have been added to the assembler ALT Section 3 9 3 C3x C30 C31 C32 C4x C40 C44 The assembler supports the regalias directive which allows registers named Fn to be aliases for floating point versions of Rn data registers ALT Chapter 4 The archiver ar30 now accepts command files ALT Section 7 2 The archiver includes the u option This option used in conjunction with the r option causes the archiver to replace specified members in the library only ifthey have a more recent modification date ALT Section 7 2 The absolute lister abs30 a debugging tool that allows you to create a listing of absolute addresses of object code has been added to the product ALT Chapter 9 The hex converter in
27. Memory ON set DOSAG If you choose not to have the environment variables set up automatically you can modify your autoexec bat file to include the SET commands above The remainder of this section describes these environment variables and other variables that you can define Identifying the directory that contains the executable files PATH statement You must include the foo dir directory in your PATH statement This allows you to specify the assembler and compiler tools without specifying the name of the directory that contains the executable files Modify your autoexec bat file to change the path information and add the following to the end of the PATH statement C Wool dir Setting Up the Environment Identifying alternate directories for the assembler A DIR By default the assembler searches for copy include files or macro libraries in the current directory and then in directories named by the i name alternate directories option Use the A DIR environment variable to define additional search paths The format of the command for assigning the environment variable is as follows set A DIRzpathnameT pathname 2 You can separate the pathnames with a semicolon or a blank Once you set A DIR you can use the copy include or mlib directive in assembly source without specifying path information For more information on the i option see the TMS320C3x C4x Assembly Language Tools User s Guide or the TMS320C3x
28. Note that the linker command file allocates the space but it is the file move1 c that contains the code that actually moves functions main_run and test from their load addresses to their run addresses KOK KKK kckckckck X X KK ck ckckckckck k KKK kk MOVE cmd X X Xx KK KKK KK KK KK OK KOK KK KK Ok c stack 0x100 heap 0x100 sles 3 0 25 m c3x map O c3x out SPECIFY THE MEMORY ROM org EXTO org XBUS org IOBUS org RAMO org RAMI org EXT1 org SYSTEM MEMORY MAP 0x0 0x1000 0x800000 0x804000 0x809800 0x809c00 0x80a000 SPECIFY THE SECTIONS boot gt boot o movel exit o text lo move o te move o cinit gt Const gt stack gt sysmem gt bss gt len len len len len len len 0x1000 Ox7 000 0x2000 0x2000 0x400 0x400 0x1000 USE C ROM MODEL STACK HEAP UN TIME SUPPORT LIBRARY R G MAP FILE NAME OUTPUT FILE REREAD LIBRARIES WAR INTERNAL 4K ROM EXTERNAL MEMORY EXPANSION BUS I O BUS RAM BLOCK 0 RAM BLOCK 1 EXTERNAL MEMORY SECTIONS ALLOCATION INTO MEMORY EXTO bj text obj text bj text ad EXTO run RAM1 bj load xt bj end RAM1 RAM1 RAM1 fe RAM1 RAM1 block 0x10000 Useful Tips
29. O TMS320C3x C4x Code Generation Tools Getting Started Guide Release 5 00 SPRU119B March 1997 5 TEXAS INSTRUMENTS Printed on Recycled Paper IMPORTANT NOTICE Texas Instruments TI reserves the right to make changes to its products or to discontinue any semiconductor product or service without notice and advises its customers to obtain the latest version of relevant information to verify before placing orders that the information being relied on is current Tl warrants performance of its semiconductor products and related software to the specifications applicable at the time of sale in accordance with Tl s standard warranty Testing and other quality control techniques are utilized to the extent TI deems necessary to support this warranty Specific testing of all parameters of each device is not necessarily performed except those mandated by government requirements Certain applications using semiconductor products may involve potential risks of death personal injury or severe property or environmental damage Critical Applications TI SEMICONDUCTOR PRODUCTS ARE NOT DESIGNED INTENDED AUTHORIZED OR WARRANTED TO BE SUITABLE FOR USE IN LIFE SUPPORT APPLICATIONS DEVICES OR SYSTEMS OR OTHER CRITICAL APPLICATIONS Inclusion of TI products in such applications is understood to be fully at the risk of the customer Use of TI products in such applications requires the written approval of an appropriate TI officer Questions c
30. You may notice a speed degradation when you use the code generation tools Much of this speed degradation is due to the switch rate from protected to real mode necessitated by DOS calls Higher speed processors and later generation processors in the 80386 80486 and Pentium series minimize the time needed for this switch Virtual memory management VMM may also degrade system performance It is recommended that VMM be enabled only for programs that cannot be built with VMM disabled If you encounter error messages when you use the code generation tools on a PC with DOS run PMINFO to determine the configuration of your system before you contact technical support For more information about PMINFO see Appendix A Troubleshooting DOS Systems Where to Go From Here 1 5 Where to Go From Here Your code generation tools are now installed At this point you should do the following Go to Chapter 5 Getting Started With the Code Generation Tools This chapter provides you with an overview of how to invoke and use the assembler linker and compiler Read Chapter 6 Release Notes to understand the new features included in the 5 00 release of the code generation tools 1 Use Appendix A Troubleshooting DOS Systems as necessary This appendix lists kernel and DOS 4G error messages and explains how you can resolve the messages Setting Up the Tools on a PC Running DOS or Windows 3 1 1 11 Chapter 2 Setting Up the Tools ona
31. ceded by an exclamation point Comments that follow option settings must be preceded by white space Do not insert blank lines processing stops at the first blank line Sample VMC file This file shows the default parameter values physmin 512K At least 512 bytes of RAM reguired physmax 4M Uses no more than 4MB of RAM virtualsize 16M Swap file allocated memory is 16MB See Appendix A Troubleshooting DOS Systems for information on problems and solutions when using DOS 4GW Specifying a temporary file directory TMP The shell program creates intermediate files as it processes your program For example the parser phase of the shell creates a temporary file used as input by the code generator phase By default the shell puts intermediate files in the current directory However you can name a specific directory for temporary files by using the TMP environment variable This feature allows the use of a RAM disk or other file systems It also allows source files to be compiled from a remote directory without writing any files into the directory where the source resides this is useful for protected directories To set the TMP environment variable use this syntax set TMP pathname For example to set up a directory named temp for intermediate files on your hard drive enter set TMP C temp Setting Up the Tools on a PC Running DOS or Windows 3 1 1 9 Performance Considerations 1 4 Performance Considerations 1 10
32. cludes the m1 m2 and m3 options to support the Motorola S1 S2 and S3 formats respectively ALT Section 10 11 3 COFF2 is the default format generated by the compiler assembler and linker This version of COFF supports subsections conditional linking and long names ALT Chapter 2 and Appendix A Benchmark improvements average 10 over version 4 70 Release Notes 6 3 Useful Tips 6 2 Useful Tips 6 4 The mf compiler option ensures that pointer access to an external variable never uses direct addressing If you do not use the mf option the compiler may use direct addressing if a local variable pointer is assigned the address of the external variable Use of the option will not make all addressing to all external variables indirect When the compiler generates code for the C4x it assumes that the SET COND bit in the ST register is setto 0 The compiler will not work correctly if the SET COND is set to 1 When you use the option with asm30 or the ax option with cl30 a COPY section with cross reference information is included in the COFF file Although the COPY section is not supposed to be loaded TI loaders with core debugger versions older than 3 33 will attempt to load the section You can use the mv option on the debugger command line to find the debugger core version The C3x simulator version 2 20 and the C4x simulator version 1 30 1 31 loaders have this problem The following loaders do no
33. ct load Ys asm global _ load addr yos asm global run addr y asm label load addr y asm run addr text mis extern int test int in int main run int in int out test in return out asm sect V end id ee asm global load end iy asm label load end wys Release Notes Useful Tips 6 8 The file move1 c contains the C code that moves the function main run from its load address to its run address KKK KK KK KKK KK KKK kk k kk k movel c KEK KEK KKK KKK KKK KK KKK KKK extern int _load_addr extern int _load_end extern int _run_addr extern int main_run int in main int ptr_main int n main_run int load_addr amp _load_addr int load_end 6 load end int run addr 6 run addr int len load end load addr int i for i 0 i lt len i run addr load addr t i ptr main 100 The file move2 c contains a function call to the function test Note that the code that relocates the function must run before the function can be called KAEKK KKK KK KKK ck KK KKK ck ck KKK move2 c kckckckckckckckckckckck ck KK KKK ck kk kk int test int in return in The file move cmd contains a linker command file for the preceding example The most important part of this command file for the purpose of the example is the SECTIONS directive that allocates move obj and move2 obj to load into external memory and run in RAM block 1
34. ctories for the assembler A DIR nnaaa Identifying alternate directories for the compiler C DIR nananana Setting default shell options C OPTION 0000 e cece eee eh Specifying a temporary file directory TMP anann anan 3 4 Where to Go From Here ssssssseeeessesessss hn 4 Setting Up the Tools on an HP Workstation eee eee Provides installation instructions for HP 9000 Series 700 PA RISC computers running with HP UX 4 1 System Requirements 0000 c cece eee ete teens 4 2 Mounting the CD ROM and Installing the Tools 220 ce cece e ee eee eee Mounting the CD ROM mis siise ici ia maiaa gd iag dan sens Installing the tools 132 345 34s eta dak a e SA E a dBA ea E Baki EA Unmounting the CD ROM 00 0 ccc ett nn 4 3 Setting Up the Environment 0 00 eee eens Identifying the directory that contains the executable files path statement Identifying alternate directories for the assembler A DIR nenna Identifying alternate directories for the compiler C DIR nena Setting default shell options C OPTION 60 cee cece eee ee eee Specifying a temporary file directory TMP 060e cee ee eee e eens 4 4 Where to Go From Here 02 cece she 5 Getting Started With the Code Generation Tools 4 Provides an overview of how to invoke and use assembler linker
35. difficult to find because many programs are interacting This list of error messages is reproduced here because they may occur when executing any tools since all of the tools have been assembled along with the DOS 4GW memory extender When reading this material keep these considerations in mind E When an Action directs you to technical support determine the configura tion of your system by using the PMINFO on page A 3 programs before contacting technical support To contact technical support call the following telephone number DSP Hotline 281 274 2320 Some error messages are not included in this section because they are rarely seen when using DOS 4GW with the TMS320C3x C4x tools Also many of the messages that are documented here are seldom seen when using DOS 4GW with the TMS320C3x C4x tools Nevertheless you may find this text to be useful in debugging your programs Should you encounter any error message not listed here or should problems persist contact technical support as directed above Troubleshooting in the Protected Mode Environment The PMINFO EXE program Purpose Run PMINFO EXE to determine the performance of protected real mode switching and extended memory Notes The time based measurements made by PMINFO may vary slightly from run to run If this error message appears DOS 16M error 17 system software does not follow VCPI or DPMI specifications check for a statement in your CONFIG SYS co
36. e DPMI MEMORY LIMIT in the DOS box settings 35 general protection fault Description An internal error in DOS 4G was probably detected Faults generated by your program should cause error 2001 instead Action Contact technical support 38 cannot use extended memory HIMEM SYS not version 2 Description An incompatibility with an old version of HIMEM SYS was detected Action Upgrade to a more recent copy of DOS or upgrade your DOS memory extender 40 notenough available extended memory XMIN Description An incompatibility with your memory manager or its configu ration was detected Action Configure the memory manager to provide more extended memory or change memory managers DOS 4G Error Messages A 3 DOS 4G Error Messages DOS 4G errors are more common than kernel errors when using DOS 4G or DOS 4GW with the TMS320C3x C4x code generation tools They are usually related to an unknown path name corrupt files or memory problems Memory problems can include inadequate memory poor configuration or corrupted memory 1000 can t hook interrupts Description A DPMI host has prevented DOS 4G from loading Action Contact technical support 1001 error in interrupt chain Description A DOS 4G internal error was detected Action Contact technical support 1003 can t lock extender kernel in memory Description DOS 4G couldn t lock the kernel in physical memory probably because of a memory shortage Action Free
37. e applications are included TMS320C32 Addendum to the TMS320C3x User s Guide literature num ber SPRU132 describes the TMS320C32 floating point microprocessor developed for digital signal processing as well as general applications Discusses its architecture internal register structure specifications and DMA and serial port operation Hardware applications are also included Head This First V Related Documentation From Texas Instruments vi TMS320C4x User s Guide literature number SPRUO63 describes the C4x 32 bit floating point processor developed for digital signal processing as well as parallel processing applications Covered are its architecture in ternal register structure instruction set pipeline specifications and op eration of its six DMA channels and six communication ports Parallel Processing with the TMS320C4x literature number SPRAO31 de scribes parallel processing and how the C4x can be used in parallel pro cessing Also provides sample parallel processing applications TMS320C4x General Purpose Applications User s Guide literature num ber SPRU159 describes software and hardware applications for the C4x processor Also includes development support information parts lists and XDS510 emulator design considerations TMS320C30 Evaluation Module Technical Reference literature number SPRUO69 describes board level operation of the TMS320C30 EVM Digital Signal Processing Applications With the TMS32
38. e number SPRU034G The OS 2 operating system is not supported in this release C1 The following command line options have been added COMP Section 2 1 3 adname Predefines the constant name for the assembler auname Undefines the constant name for the assembler ml Runtime support assembly calls use far calls mp Performs speed optimizations atthe cost of increased code size ms Assumes all memory is accessible when optimizing mtc Generates an additional header for every C function compiled allowing it to be used with the Tartan LAJ function calling method 0s Interlists optimizer comments into the compiler s assembly language output ss Invokes the interlist utility which interlists C source statements into the compiler s assembly language output C1 The mx command line option has been removed J Six new runtime support libraries are included COMP Section 2 3 rts30g lib rts30gr lib rts30r lib rts40g lib rts40gr lib rts40r lib New intrinsics have been added fast ftoi ansi_ftoi fast imult fast_invf COMP Section 2 8 41 Long doubles are now represented in extended precision 40 bit format COMP Section 3 2 1 The compiler supports far calls COMP Section 3 7 Release Enhancements The compiler includes enhanced support for filling the three delay slots generated for branches COMP Section 3 8 The big memory model places constants in a const section CO
39. e2 For Bourne or Korn shells A DIRz pathnamet pathname2 export A DIR You can separate the pathnames with a semicolon or a blank Once you set A DIR you can use the copy include or mlib directive in assembly source without specifying path information For more information on the i option see the TMS320C3x C4x Assembly Language Tools User s Guide or the TMS320C3x C4x Optimizing C Compiler User s Guide Identifying alternate directories for the compiler C DIR By default the compiler searches the current directory for include files and object libraries such as the runtime support and C I O libraries Use the C DIR environment variable to define additional search paths The format of the com mand for assigning the environment variable is as follows J ForC shells setenv C DIR pathnamet pathname2 J For Bourne or Korn shells C DIR pathname1 pathname2 export C DIR You can separate the pathnames with a semicolon or a blank Once you set C DIR you can use the include directive in your C source code without specifying path information Setting Up the Tools on an HP Workstation 4 5 Setting Up the Environment Setting default shell options C OPTION 4 6 When using the shell program cl30 you might find it useful to set default options for the compiler assembler and linker using the C OPTION environment variable After reading the command line options and input fi
40. ecause more memory is managed than is actually needed You might want to restrict the amount of physical memory VMM uses for the following reasons Your code is small and you know its maximum memory requirement You can speed up startup by telling VMM not to manage everything J You need to spawn another program that uses extended memory and you need to leave enough memory available for the other program Setting Up the Tools on a PC Running DOS or Windows 3 1 1 7 Setting Up the Environment 1 8 PhysMin SwapFileName Swaplnc SwapMin VirtualSize PhysMin n K M G PhysMin specifies the minimum amount of physical memory RAM managed by VMM The default is 1024 Kbytes Set PhysMin to the minimum hardware requirement necessary for running your code If your code requires a 4 Mbyte machine set PhysMin to 4 Mbytes If your code is small and can run in 512 Kbytes set PhysMin to 512 Kbytes SwapFileName path filename SwapFileName specifies the filename of the swap file The default filename is DOS4GVM SWP and the file is placed in the directory where the executable file resides Specify the complete path name if you want to keep the swap file in another directory Swaplne n K M G Swaplnc specifies the size by which the swap file grows The default size is 4096 Kbytes As your program runs the swap file increases by 4 Mbytes when the file needs to grow A smaller size causes the swap file to take less
41. ect file called function obj To create an executable object module run the linker separately by invoking Ink30 as in the following example lnk30 c function obj c30 cmd o function out 1 rts30 lib Getting Started With the C Compiler The c linker option tells the linker to observe the C language linking conventions The linker command file Ink cmd is shipped with the code generation tools The o option names the output module function out if you do not use the o option the linker names the output module a out The option names the runtime support library You must have a runtime support library before you can create an executable object module the prebuilt runtime support library rts lib is included with the code generation tools b Inthis example use the z option which tells the shell program to run the linker The z option is followed by linker options c130 o function c z c30 cmd o function out 1 rts30 lib This example runs the two compiler passes the optimizer the assembler and the linker as follows ac30 C parser opt30 Optimizer cg30 Code generator asm30 Assembler Ink30 Linker For more information on linker commands see the Linker Description chapter of the TMS320C3x C4x Assembly Language Tools User s Guide and the Linking C Code chapter of the TMS320C3x C4x Optimizing C Compiler User s Guide The TMS320C3x C4x compiler package also includes an interlist utilit
42. ed With the C Compiler 5 2 Getting Started With the C Compiler The TMS320C3x C4x C compiler consists of two passes the first pass parses the code and the second pass produces a single assembly language source file that must be assembled and linked You can specify an optional optimization pass after the first pass The simplest way to compile assemble and link a C program is to use the compiler shell program with the z option This section provides a quick walkthrough so that you can get started without reading the entire TMS320C3x C4x Optimizing C Compiler User s Guide 1 Create a sample file called function c that contains the code shown in Example 5 5 Example 5 5 Sample C File for the C Compiler Walkthrough function c kk kk kk kk kk kk kk kk kk k k kCk KCkCKCk kCk KA kk k Ck k ck k ck k ck ck ck ck kk ck kk ke X ke x function c y Sample file for walkthrough kk kk kk kk kk kk kk kk kk kk kk KCkCkCk KCkCKCk Ck k k k k ck k ck ck ck k ck ck ck ck ck ks ke e ke x int abs func int i int temp 1 if temp lt 0 temp 1 return temp void main void int x 3 x abs func x 2 To invoke the shell program to compile and assemble function c enter c130 o function The o option invokes the optimizer at the default level The shell program prints the following information as it compiles the program Getting Started With the Code Generation Tools 5 5 Getting S
43. edia If the problem persists contact technical support Appendix B Tables of Peripheral Registers Structure Member Names and Bit Field Names The TMS2320C3x peripheral control library provides C data structures for manipulating the TMS320C3x peripherals The tables in this appendix list the data structure member names that are used to access each of the peripheral registers and bit fields through C peripheral pointers For a detailed explanation of the register and bit field descriptions refer to the TMSS20C3x User s Guide This appendix provides an update to the parallel runtime support table The first entry for each register shows how to access that register as an integer The remaining entries show how to access the register s bit fields individually Each table is followed by an example B 1 Tables of Peripheral Registers Structure Member Names and Bit Field Names Table B 1 Bus Control Registers Register Assignment STRBO Bus Control Integer Bit field STRB1 Bus Control Integer Bit field IOSTRB Bus Control Integer Bit field Example B 1 Bus Control include lt bus32 h gt BUS_REG bus_ptr BUS_ADDR bus ptr gt iostrb gcontrol 0 Bit Field STRB Switch STRB Config Sign Ext Zero Fill Physical Memory Width Data Size BNKCMP WTCNT SWW HIZ NOHOLD HOLDST Sign Ext Zero Fill Physical Memory Width Data Size BNKCMP WTCNT SWW WTCNT SWW Member name gt strb0_gcontrol gt s
44. i ar30 a rts lib obj The branch instructions BR BRD CALL RPTB RPTBD LAJ Bcond BcondAF BcondAT BconaD CALLcond DBcond DBconaD LAJcond LATcond RETIcond RETIconaD RETScond etc have either 16 or 24 bit displacement fields 32K or 8M words respectively In most cases the compiler uses the conditional branches with 16 bit offsets However there are several ways that you can specify 24 bit calls m Use a function pointer to call the function This will use the register addressing mode rather than the PC displacement addressing mode m Use the far modifier when defining the function For example extern far int function parameters tells the compiler to use the 24 bit version of the call B Usethe mloption This option tells the compiler to use 24 bit far calls when calling internal RTS functions such as MPY 130 Using the sect directive to define a user definable initialized section in C code does not always work correctly This method is often used when you want to give a portion of code different run and load addresses The compiler may generate text information then it may generate const or cinit information and then go back to generating more text information This means that a portion of the code that was intended forthe user section may be placed in the text section The label directive can be used with any initialized section like text data or other user definable initialized
45. ile1 asm and file2 asm See Example 5 1 and Example 5 2 Example 5 1 file1 asm file filel asm ref addvec global stack global start Stack usect stack 0 text stack a word stack vector float 10 0 20 0 30 0 40 0 vector a word vector start ldp stack_a ldi stack_a sp ldi vector_a ar0 call addvec bu Example 5 2 file2 asm file file2 asm def addvec text addvec laf 0 r0 rpts 3 addf ar0 r0 rets 1 Getting Started With the Assembler and Linker Enter the following command to assemble file1 asm asm30 filel The asm30 command invokes the assembler The input source file is file1 asm Ifthe input file extension is asm you do not have to specify the extension the assembler uses asm as the default This example creates an object file called file1 obj The assembler creates an object file only if there are no errors You can specify a name for the object file but if you do not the assembler uses the input filename with an extension of obj Note The v30 Option is the Assembler Default The asm30 command invokes the TMS320C3x C4x assembler By default the assembler generates code for the C30 as if the v30 option had been used Use the v31 option to generate code for the C31 Use the v32 option to generate code for the C32 Use the v40 option to generate code for the C40 Use the v44 option to generate code for the
46. ing errors in documentation please include the following information that is on the title page the full title of the book the publication date and the literature number Email comments books sc ti com Mail Texas Instruments Incorporated Technical Documentation Services MS 702 P O Box 1443 Houston Texas 77251 1443 Note viii When calling a Literature Response Center to order documentation please specify the literature number of the book Contents Setting Up the Tools on a PC Running DOS or Windows 3 1 Provides installation instructions for PCs running MS DOS PC DOS or Windows 3 1 1 1 System Requirements 2 eee nett 12 Installing the Tools oscri en a a III en Installing the tools on DOS systems 0000 e eee teenies Installing the tools on Windows 3 1 systems 00 c cece ees 1 3 Setting Up the Environment 00 0 eee n Identifying the directory that contains the executable files PATH statement Identifying alternate directories for the assembler A DIR LLsse Identifying alternate directories for the compiler C DIR aeaaaee Setting default shell options C OPTION 00 0c cece eee eh Using virtual memory DOS4GVM isssssssssssss ee ee eee Specifying a temporary file directory TMP lt cece eee eee eee 1 4 Performance Considerations cece eect tenet eens 15 Whereto Go From Here sui
47. le names the shell reads the contents of the C OPTION environment variable Notice that options defined with C OPTION do not override the options specified on the command line Setting up default options with the C OPTION environment variable is especially useful when you want to run consecutive times with the same set of options and or input files The options and or input filenames that you define with C OPTION are used every time you run the shell The syntax for the C OPTION environment variable is For C shells setenv C OPTION option option2 g For Bourne or Korn shells C OPTION option1 option2 export C OPTION Options specified in the environment variable are specified in the same way and have the same meaning as they do on the command line For more information about compiler and assembler options see the TMSS20C3x CAx Optimizing C Compiler User s Guide and the TMS320C3x C4x Assembly Language Tools User s Guide For example if you wantto always run quietly the q option enable C source interlisting the s option and link the option set up the C OPTION environment variable as follows setenv C OPTION qs z for C shells C OPTION qs z for Bourne or Korn shells export C OPTION In this example each time you run the shell program it runs the linker Any options following z on the command line or in C OPTION are passed to the linker This enables you to use the C OPTION
48. memory DOS4GVM Virtual memory management VMM allows protected mode programs to use more RAM than your computer actually has available The DOS4GVM environment variable controls VMM You can set the DOS4GVM environment variable using the following format set DOS4GVM option value option value You must use a colon before the value for each option the DOS command shell does not accept an equal sign in place of the colon Unless you specify otherwise for your system these options are not case sensitive DOS4GVM options take effect only when VMM is enabled which causes the default values to be used for all options To enable VMM enter set DOS4GVM VirtualMemory ON The DOS4GVM options are described below DeleteSwapFile DeleteSwapFile ON OFF By default a new swap file is created each time your code runs which slows down program startup If you run your code over and over again and you can spare the disk space you can set DeleteSwapFile to OFF so that an existing swap file is reused If your code spawns another program that uses extended memory do not set DeleteSwapFile PhysMax PhysMax n K M G PhysMax specifies the maximum amount of physical memory RAM managed by VMM The default is all available memory up to 64 Mbytes This setting minimizes disk swapping so that large programs run as fast as possible However the default setting might actually slow down small programs on machines with a lot of memory b
49. mpatibility with other software Action Contact technical support 13 cannot allocate transfer buffer Description There is not enough memory to load DOS 4G Action Make more memory available and try again 14 premature EOF Description DOS4G EXE or a bound DOS 4G application has probably been corrupted Action Recopy the file from the source media 15 protected mode available only with 386 or 486 Description DOS 4G requires an 80386 or later CPU It cannotrun on an 80286 or earlier CPU Action Reinstall and run the tools on a 386 or later PC Kernel Error Messages 17 system software does not follow VCPI or DPMI specifications Description Some memory resident program has put your 386 or 486 CPU into Virtual 8086 mode This is done to provide special memory services to DOS programs such as EMS simulation EMS interface without EMS hardware or high memory In this mode it is not possible to switch into protected mode unless the resident software follows a standard that DOS 16M supports DPMI VCPI and XMS are the most common Action Contact the vendor of your memory management software 22 cannot free memory Description Memory was probably corrupted during execution of your program Action Make more memory available and try again 23 no memory for VCPI page table Description There is not enough memory to load DOS 4G Action Make more memory available and try again 24 VCPI page table address i
50. name of the compiler shell program for the TMS320C3x C4x Note that the second character in the shell name is a lowercase L common object file format COFF A binary object file format that promotes modular programming by supporting the concept of sections C 1 Glossary C 2 DOS 4G The base version for DOS 4GW You may occasionally see this term in an error message If so refer to Appendix A Troubleshooting DOS Systems for the appropriate action DOS AGW A memory extender that is bound with the MS DOS version of the TMS320C3x C4x tools The executable DOS 4GW rile is not shipped separately but is embedded within the other executables Error messages from DOS 4GW are included in Appendix A Troubleshooting DOS Systems to assist you in debugging If you receive one of these error messages contact technical support for assistance and remember that the tools are shipped as object files with the memory extender embedded DOS 16M The executable filename for a tool that is embedded in the TMS320C3x C4x code generation tools You may occasionally see this term in an error message If so refer to Appendix A Troubleshooting DOS Systems for the appropriate action environment variables System symbols that you define and assign to a string They are usually included in batch files for example in the AUTOEXEC BAT file global A kind of symbol that is either 1 defined in the current module and accessed in another or 2 acces
51. nc 9control bit decdst 9control bit incdst 9control bit decsrc 9control bit incsrc 9control bit stat 9control bit start gt gcontrol gt gcontrol_bit tcint 9control bit tc 9control bit sync 9control bit decdst 9control bit incdst 9control bit decsrc 9control bit incsrc 9control bit stat 9control bit start gt source gt destination gt transfer_counter Define pointer to DMAO Stop DMA by setting start bits Tables of Peripheral Registers Structure Member Names and Bit Field Names B 3 Appendix C Glossary ANSI American National Standards Institute An organization that establishes standards voluntarily followed by industries asm30 The name of the command that invokes the assembler for the TMS320C3x C4x assembler A software program that creates a machine language program from a source file that contains assembly language instructions directives and macro directives The assembler substitutes absolute operation codes for symbolic operation codes and absolute or relocatable addresses for symbolic addresses bss One of the default COFF sections You can use the bss directive to reserve a specified amount of space in the memory map that can later be used for storing data The bss section is uninitialized C compiler A program that translates C source statements into assembly language source statements cl30 The
52. ncorrect Description This is an internal error Action Contact technical support 25 cannotinitialize VCPI Description An incompatibility with other software was detected DOS 16M has detected that VCPI is present but VCPI returns an error when DOS 16M tries to initialize the interface Action Find the other software that uses VCPI and disable it stop its execution 28 memory error avail loop Description Memory was probably corrupted during execution of your program Using an invalid or stale alias selector may cause this error Incorrect manipulation of segment descriptors may also cause it Action Rerun the program and or restart your computer Troubleshooting DOS Systems A 7 Kernel Error Messages A 8 29 memory error out of range Description Memory was probably corrupted during execution of your program Writing through an invalid or stale alias selector may cause this error Action Check your source code for references to variables that are not declared or are no longer in scope 32 DPMI host error possibly insufficient memory 33 DPMI host error need 64K XMS 34 DPMI host error cannot lock stack Description Memory under DPMI is probably insufficient Action Under Windows make more physical memory available by eliminating or reducing any RAM drives or disk caches You can also edit DEFAULT PIF so that at least 64K bytes of XMS memory is available to non Windows programs Under OS 2 increase th
53. ned real mode defined regalias directive 6 3 register calling convention modified relocating code at runtime runtime support libraries 6 2 sect directive section defined C 4 SET COND bit SPARCstations installing the tools B 3 to 3 4 setting up the environment 3 5 to B 8 system reguirements ss option static variable defined string table defined Index 3 Index subsection defined swap file defined symbolic debugging defined system requirements for DOS for HP workstations for SPARCstations for Windows 3 1 for Windows 95 for Windows NT text section defined tips 6 4 TMP environment variable for DOS for HP workstations for SPARCstations for Windows 3 1 for Windows 95 for Windows NT uninitialized sections defined UNION statement unmounting the CD ROM for HP workstations 4 3 for SPARCstations 8 4 Index 4 virtual memor defined virtual memory management VMM performance considerations 1 10 using the DOS4GVM environment variable 1 7 to 1 9 walkthrough assembler 5 2 to 5 4 C compiler 5 5 to 5 8 linker 5 2 to Windows 3 1 installing the tools 1 3 memory requirements 1 2 setting up the environment 1 4 to 1 9 system requirements Windows 95 installing the tools memory requirements setting up the environment P 4 to 7 System requirements Windows NT installing the tools memory requirements setting up the environment P 4 t
54. ntaining NOEMS If such a statement exists remove it and reboot your computer If the computer is not equipped with extended memory or if none is available for DOS 4GW the extended memory measurements will not display Other DOS 4GW error messages are in Section A 3 DOS 4G Error Messages Example The following example shows the output of the PMINFO pro gram on an 80486 AT compatible machine running at 33 MHz PMINFO Protected Mode and Extended Memory Performance Measurement 4 45 Copyright c Tenberry Software Inc 1987 1995 DOS memory Extended memory CPU performance equivalent to 33 0 MHz 80486 640 17854 K bytes configured according to BIOS 640 31744 K bytes physically present SETUP 550 17585 K bytes available for DOS 16M programs 21 6 0 0 I9 l 05 5 MB sec word transfer rate wait states 35 4 0 5 34 4 0 5 MB sec 32 bit transfer rate wait states Overall cpu and memory performance non floating point for typical DOS programs is 7 78 0 62 times an 8MHz IBM PC AT Protected Real switch rate 18078 sec 55 usec switch 33 up 21 down DOS 16M switch mode 11 VCPI Troubleshooting DOS Systems A 3 Troubleshooting in the Protected Mode Environment PMINFO provides the information shown in Table A 1 Table A 1 PMINFO Fields Measurement CPU performance According to BIOS SETUP DOS 16M programs Transfer rates Overall CPU and memory performance
55. nually to include the SET commands above Setting Up the Environment Identifying the directory that contains the executable files PATH statement You must include the foo dir directory in your PATH statement This allows you to specify the assembler and compiler tools without specifying the name of the directory that contains the executable files Lj If you modify your autoexec bat file to change the path information add the following to the end of the PATH statement 3C tool_dir If you set the PATH statement from the command line use this format set PATH C tool_din PATH The addition of PATH ensures that this PATH statement does not undo the PATH statements in any other batch files including the autoexec bat file Identifying alternate directories for the assembler A_DIR By default the assembler searches for copy include files or macro libraries in the current directory and then in directories named by the i name alternate directories option Use the A_DIR environment variable to define additional search paths The format of the command for assigning the environment variable is as follows set A DIRzpathnameT pathname 2 You can separate the pathnames with a semicolon or a blank Once you set A_DIR you can use the copy include or mlib directive in assembly source without specifying path information For more information on the i option see the TMS320C3x C4x Assembly Language Tools User s G
56. o 2 7 system requirements x option
57. ome performance problems when using only 4 Mbytes 16 Mbytes is recommended You may want to free as much memory as possible before installing the tools especially if you have less than 16 Mbytes LLLLLLL 3 Installing the Tools 2 2 Installing the Tools The code generation tools package is shipped on CD ROM To install the tools on a PC running Windows NT or Windows 95 follow these steps 1 Insert the TMS320C3x C4x Software Toolkit CD ROM into your CD ROM drive 2 Start Windows NT or Windows 95 3 From the File menu Windows NT 3 51 or the Start menu Windows NT 4 0 or Windows 95 select Run 4 Inthe dialog box enter the following command replace d with the name of your CD ROM drive d setup exe 5 Click on OK 6 Follow the on screen instructions Setting Up the Tools on a PC Running Windows NT or Windows 95 2 3 Setting Up the Environment 2 3 Setting Up the Environment Before or after you install the tools you can define environment variables that set certain code generation tool parameters you normally use An environment variable is a system symbol that you define and assign to a string When you use environment variables default values are set making each individual invocation of the tools simpler because these parameters are automatically specified When you invoke a tool you can use command line options to
58. oncerning potential risk applications should be directed to TI through a local SC sales office In order to minimize risks associated with the customer s applications adequate design and operating safeguards should be provided by the customer to minimize inherent or procedural hazards TI assumes no liability for applications assistance customer product design software performance or infringement of patents or services described herein Nor does TI warrant or represent that any license either express or implied is granted under any patent right copyright mask work right or other intellectual property right of TI covering or relating to any combination machine or process in which such semiconductor products or services might be or are used Copyright 1997 Texas Instruments Incorporated About This Manual Preface Read This First This manual tells you how to install release 5 00 of the TMS320C3x C4x float ing point DSP code generation tools on your system It also does the following often formation PC running DOS MS DOS or PC DOS How to Use This Manual Gets you started using the compiler linker and assembler Tells you how to set environment variables for parameters that you use Details the enhancements included and tells you where to find further in Describes how you can resolve problems that you may encounter on a The goal of this book is to get you started using the development
59. onment Specifying a temporary file directory TMP The shell program creates intermediate files as it processes your program For example the parser phase of the shell creates a temporary file used as input by the code generator phase By default the shell puts intermediate files in the current directory However you can name a specific directory for temporary files by using the TMP environment variable This feature allows use of a RAM disk or other file systems It also allows source files to be compiled from a remote directory without writing any files into the directory where the source resides this is useful for protected directories To set the TMP environment variable use this syntax set TMP pathname For example to set up a directory named temp for intermediate files on your hard drive enter set TMP C temp Setting Up the Tools on a PC Running Windows NT or Windows 95 2 7 Where to Go From Here 2 4 Where to Go From Here 2 8 Your code generation tools are now installed At this point you should do the following Go to Chapter 5 Getting Started With the Code Generation Tools This chapter provides you with an overview of how to invoke and use the as sembler linker and compiler 1 Read Chapter 6 Release Notes to understand the new features included in the 5 00 release of the code generation tools Chapter 3 Setting Up the Tools on a SPARCstation This chapter helps you install release 5 00 of
60. over ride many of the defaults that are set with environment variables The code generation tools use environment variables for finding or obtaining certain types of information By default the installation program sets up these environment variables set PATH C Ntool dir PATH set A DIR C Ntool dir set C DIR C Xtool dir The remainder of this section describes these environment variables and other variables and discusses alternative ways that variables can be defined Setting environment variables under Windows NT Under Windows NT the environment variables are set up in the registry under HKEY CURRENT USERNENVIRONMENT If you choose notto have the environment variables automatically set up in the registry it is recommended that you set up the environment variables in the System applet of the Control Panel To set up the environment variables in the System applet of the Control Panel simply open the System applet and for each environment variable listed above enter the name of the Variable and its associated Value then select Set In the System applet you can make the environment variables available to all users or you can define them for specific individuals Setting environment variables under Windows 95 Under Windows 95 the environment variables are set up in your autoexec bat file If you choose not to have the environment variables set up automatically you can modify your autoexec bat file ma
61. path tool dir path J For Bourne or Korn shells C DIR tool dir A DIR tool dir PATH tool dir PATH You can move these commands into your login or cshrc file for C shells or profile file for Bourne or Korn shells to avoid entering the commands each time you invoke a new shell The remainder of this section describes these environment variables and other variables that you can define Identifying the directory that contains the executable files path statement You must include the tool dirdirectory in your path statement This allows you to specify the assembler and compiler tools without specifying the name of the directory that contains the executable files Ifyou modify your cshrc file for C shells or profile file for Bourne or Korn shells to change the path information add the following to the end of the path statement tool dir If you set the path statement from the command line use this format B ForC shells set pathz too dir path m For Bourne or Korn shells PATH too dir PATH The addition of path PATH ensures that this path statement does not undo the path statements in the cshrc or profile file Setting Up the Tools on a SPARCstation 3 5 Setting Up the Environment Identifying alternate directories for the assembler A DIR By default the assembler searches for copy include files or macro libraries in the current directory and then in directories named by the i name alterna
62. rc Setting Up the Tools on a SPARCstation 3 3 Mounting the CD ROM and Installing the Tools Installing the tools Be sure you are not logged on as root To install the software tools follow these steps 1 If you do not already have a tools directory create one Enter mkdir tool_dir Replace fool dir with your own directory name including the path information to install the tools 2 Copy the files to your directory cp r tool dir Unmounting the CD ROM 3 4 You must unmount the CD ROM after copying the files Ifyou have a SunOS 4 1 x SunOS 5 0 or SunOS 5 1 as root enter cd umount cdrom eject dev sr0 exit J If you have SunOS 52 or higher enter cd eject Setting Up the Environment 3 3 Setting Up the Environment Before or after you install the tools you can define environment variables that set certain code generation tool parameters you normally use An environment variable is a system symbol that you define and assign to a string When you use environment variables default values are set making each individual invocation of the tools simpler because these parameters are automatically specified When you invoke a tool you can use command line options to over ride many of the defaults that are set with environment variables To set up the environment enter these commands Be sure you are not logged on as root g For C shells setenv C DIR tool dir setenv A DIR tool dir set
63. riable is set C OPTIONzoption1 option2 Options specified in the environment variable are specified in the same way and have the same meaning as they do on the command line For more information about compiler and assembler options see the TMS320C3x C4x Optimizing C Compiler User s Guide and the TMS320C3x C4x Assembly Language Tools User s Guide For example if you wantto always run quietly the q option enable C source interlisting the s option and link the option set up the C OPTION environment variable as follows set C OPTION qs z In this example each time you run the shell program it runs the linker Any options following z on the command line or in C OPTION are passed to the linker This enables you to use the C OPTION environment variable to specify default compiler and linker options and then specify additional compiler and linker options on the shell command line If you have set z in the environment variable and want to compile only use the c option of the shell These additional examples assume C OPTION is set as shown above QESQ Fc compiles and links e130 ic only compiles c130 Q o z 0c30 cmd compiles and links using a command file cl130 c c z c30 cmd only compiles c overrides z For more information on linker options see the Linker Options section in the TMS320C3x C4x Assembly Language Tools User s Guide Setting Up the Environment Using virtual
64. rt TMP Setting Up the Tools on an HP Workstation 4 7 Where to Go From Here 4 4 Where to Go From Here 4 8 Your code generation tools are now installed At this point you should do the following Go to Chapter 5 Getting Started With the Code Generation Tools This chapter provides you with an overview of how to invoke and use the assembler linker and compiler 1 Read Chapter 6 Release Notes to understand the new features included in the 5 00 release of the code generation tools Chapter 5 Getting Started With the Code Generation Tools This chapter helps you start using the assembler linker and compiler tools by providing basic startup information For more information about invoking and using these tools see the TMS320C3x C4x Assembly Language Tools User s Guide and the TMS320C3x C4x Optimizing C Compiler User s Guide Topic Page 5 1 Getting Started With the Assembler and Linker 5 2 5 2 Getting Started With the C Compiler esee eee 5 5 5 1 Getting Started With the Assembler and Linker 5 1 Getting Started With the Assembler and Linker This section provides a guick walkthrough of the assembler and linker so that you can get started without reading the entire TMS320C3x C4x Assembly Language Tools User s Guide These examples show the most common methods for invoking the assembler and linker Create two short source files to use for the walkthrough call them f
65. sections sect directive to place a label at the load address It does not make sense to have a run address for the cinit section since the data is copied to bss at boot time or load time and then never referenced again Uninitialized sections like bss stack or sysmem only have runtime addresses Therefore it does not make sense to have a separate load address Useful Tips A general method of placing C code at a separate load address is illustrated in the following code segments The example consists of four C files move c move1 c move2 c and exit c and an assembly language file boot asm The C file exit c and the assembly language file boot asm are not reproduced here as they are included in the runtime supportlibrary The linker command file move cmd controls the linking process The five files are compiled assembled and linked with the following command line c130 g move c movel c move2 c exit c boot asm z move cmd The file move c contains the function main run that we want to relocate at runtime The asm statement is used to embed TMS320C3x C4x assembly language statements The sects statement create named sections called load and end The label statement creates a special label that refers to the load address of thelabels load addrand load end that mark the beginning and ending of the code to be relocated at run time KR KK KKK KK KR KK KKK KKK k k kk move c KEK KKK KKK KKK KK ck ck kck ck kk ko asm se
66. sed in the current module but defined in another initialized section A COFF section that contains executable code or initialized data An initialized section can be built up with the data text or sect directive interlist utility A utility that inserts as comments your original C source statements into the assembly language output from the assembler The C statements are inserted next to the equivalent assembly instructions Glossary linker A software tool that combines object files to form an object module that can be allocated into TMS320C3x C4x system memory and executed by the device listing file An output file created by the assembler that lists source statements their line numbers and their effects on the section program counter SPC Ink30 The name of the command that invokes the linker for the TMS320C3x C4x map file An output file created by the linker that shows the memory configuration section composition section allocation and symbol definitions and the addresses at which the symbols were defined for your program optimization Improvement in the execution speed of a program or in the reduction of the size of C programs pragma Preprocessor directive that provides directions to the compiler about how to treat a particular statement protected mode programs 32 bit extended MS DOS programs These programs reguire an extended memory manager and run on 80386 80486 and Pentium based PCs only Pro
67. t have the problem B C4x XDS510 XDS510WS debugger version 2 40 B C3x XDS510 XDS510WS debugger version 5 00 A work around to this problem is to specify in the SECTIONS directive of the linker command file that the xref section be allocated at a specific memory location that will not disturb the program The other option is not to use the x option if you intend to use one of the affected loaders DOS restricts the length of the command line to a total of 128 characters The 128 character restriction also exists for the command lines that cl30 creates for calling the other tools ac30 opt30 cg30 etc When these command lines are generated the entire path is included for the executable for example c tools rel460 ac30 exe This means that more options can be included if you run the tools from the directory where they exist or if you shorten the length of the path to the executable files Another solution is to use the shell option This option causes the compiler to read shell options and commands from a command file MEMORY PAGI PAGI PAGI 1 2 EM Bi ES n ECTIONS textl text2 text3 text4 RAMO RAMO RAMO load load load load Useful Tips You cannot nest GROUP group output sections and UNION directives in a linker command file You can however group input sections within a UNION directive A GROUP directive groups output sections This accomplishes the same thing since the
68. t it can be used by a debugging tool such as a simulator or an emulator text One of the default COFF sections The text section is an initialized section that contains executable code You can use the text directive to assemble code into the text section uninitialized section A COFF section that reserves space in the memory map but that has no actual contents These sections are built up with the bss and usect directives Glossary virtual memory The ability of a program to use more memory than a computer actually has available as RAM This is accomplished by using a swap file on disk to augment RAM When RAM is not sufficient part of the program is swapped out to a disk file until it is needed again The combination of the swap file and available RAM is the virtual memory The TMS370C16 tools use the DOS 4GW memory extender to provide virtual memory management VMM This memory extender is not provided as an executable file but is embedded in several of the tools shipped by TI Contact technical support for more information Glossary C 5 A DIR environment variable for DOS for HP workstations for SPARCstations for Windows 3 1 for Windows 95 for Windows NT abs30 absolute lister 6 3 absolute lister ad option ANSI defined ar30 archiver archiver command files u option arithmetic functions extended precision asm30 defined invoking 5 3 assembler regalias directive defined version symbols
69. tarted With the C Compiler Example 5 6 Diagnostic Messages Produced by the Compiler 5 6 function TMS320C3x 4x Copyright c TMS320C3x 4x Copyright c TMS320C3x 4x Copyright c TMS320C3x 4x Copyright c PASS 1 PASS 2 No Errors function function function function function function ANSI C Compiler Version 5 00 1987 1997 Texas Instruments Incorporated ex gt abs_func c gt main ANSI C Optimizer Version 5 00 1987 1997 Texas Instruments Incorporated ee gt abs_func e gt main C Code Generator Version 5 00 1987 1997 Texas Instruments Incorporated c gt abs func c gt main COFF Assembler Version 5 00 1987 1997 Texas Instruments Incorporated No Warnings The shell program runs the two compiler passes the optimizer and the assembler as follows ac30 gt opt30 gt cg30 gt asm30 C parser Optimizer Code generator Assembler By default the shell deletes the assembly language file from the current directory after the file is assembled If you want to inspect the assembly language output use the k option to retain the assembly language file cl30 o k function 3 Also by default the shell creates a COFF object file as output however if you use the z option the output is an executable object module The following examples show two ways of creating an executable object module a The example in step 2 creates an obj
70. te directories option Use the A DIR environment variable to define additional search paths The format of the command for assigning the environment variable is as follows For C shells setenv A DIR pathname1 pathname2 For Bourne or Korn shells A DIR pathnamet pathname2 export A_DIR You can separate the pathnames with a semicolon or a blank Once you set A_DIR you can use the copy include or mlib directive in assembly source without specifying path information For more information on the i option see the TMS320C3x C4x Assembly Language Tools User s Guide or the TMS320C3x C4x Optimizing C Compiler User s Guide Identifying alternate directories for the compiler C_DIR 3 6 By default the compiler searches the current directory for include files and object libraries such as the runtime support and C I O libraries Use the C DIR environment variable to define additional search paths The format of the command for assigning the environment variable is as follows For C shells setenv C DIR pathnamet pathname2 g For Bourne or Korn shells C DIRz pathnamet pathname2 export C DIR You can separate the pathnames with a semicolon or a blank Once you set C DIR you can use the include directive in your C source code without specifying path information Setting Up the Environment Setting default shell options C OPTION When using the shell program cl30
71. tected mode programs can use all available RAM on the computer up to 64 Mbytes real mode 16 bit native MS DOS mode This mode limits the available memory to 640K bytes Calls to DOS may involve switching from protected to real mode DOS real mode tools are no longer supported by the TMS320C3x C4x code generation tools Glossary C 3 Glossary C 4 section A relocatable block of code or data that will ultimately occupy contiguous space in the TMS320C3x C4x memory map static variable A kind of variable whose scope is confined to a function or a program The values of static variables are not discarded when the function or program is exited their previous value is resumed when the function or program is re entered string table A table that stores symbol names that are longer than eight characters symbol names of eight characters or longer cannot be stored in the symbol table instead they are stored in the string table The name portion of the symbol s entry points to the location of the string in the string table subsection A relocatable block of code or data that will ultimately occupy contiguous space in the TMS320C3x C4x memory map Subsections are smaller sections within larger sections Subsections give you tighter control of the memory map swapfile The file where virtual memory secondary memory is allocated on the hard disk symbolic debugging The ability of a software tool to retain symbolic information so tha
72. th the name of your CD ROM drive d Enter the following command install Follow the on screen instructions Installing the tools on Windows 3 1 systems To install the tools on a Windows 3 1 system perform the following steps Insert the TMS320C3x C4x Software Toolkit CD ROM into your CD ROM drive Start Windows 3 1 From the File menu select Run In the dialog box enter the following command replace d with the name of your CD ROM drive d setup exe Click on OK Follow the on screen instructions Setting Up the Tools on a PC Running DOS or Windows 3 1 1 3 Setting Up the Environment 1 3 Setting Up the Environment Before or after you install the tools you can define environment variables that set certain code generation tool parameters you normally use An environment variable is a system symbol that you define and assign to a string When you use environment variables default values are set making each individual invocation of the tools simpler because these parameters are automatically specified When you invoke a tool you can use command line options to over ride many of the defaults that are set with environment variables The code generation tools use environment variables for finding or obtaining certain types of information By default the installation program sets up these environment variables set PATH C Ntool dir PATH set A DIR C Ntool dir set C DIR C Ntool dir set DOSAGVM Virtual
73. the C3x and C4x generations of devices TMS320C3x C4x Optimizing C Compiler User s Guide literature number SPRU034 describes the TMS320 floating point C compiler This C compiler accepts ANSI standard C source code and produces TMS320 assembly language source code for the C3x and C4x generations of devices TMS320C3x C Source Debugger User s Guide literature number SPRUO53 tells you howto invoke the C3x emulator evaluation module and simulator versions of the C source debugger interface This book discusses various aspects of the debugger interface including window management command entry code execution data management and breakpoints It also includes a tutorial that introduces basic debugger functionality TMS320C4x C Source Debugger User s Guide literature number SPRUO54A tells you how to invoke the C4x emulator and simulator ver sions of the C source debugger interface This book discusses various aspects of the debugger interface including window management com mand entry code execution data management and breakpoints It also includes a tutorial that introduces basic debugger functionality TMS320C3x User s Guide literature number SPRUO31 describes the C3x 32 bit floating point microprocessor developed for digital signal proces sing as well as general applications its architecture internal register structure instruction set pipeline specifications and DMA and serial port operation Software and hardwar
74. the TMS320C3x C4x code generation tools and set up your code development environment on a SPARCstation running SunOS versions 4 1 x or higher These tools include an optimizing C compiler and a full set of assembly language tools for developing and manipulating assembly language and object executable code The C compiler tools include Parser Optimizer Code generator Interlist utility Library build utility O O O O L The assembly language tools are composed of the following Assembler Archiver Linker Absolute lister Cross reference lister Hex conversion utility O O O O O L This release is dynamically linked to take advantage of shared libraries Topic Page 3 1 System Requirements c e aeaee eee e aE 3 2 3 2 Mounting the CD ROM and Installing the Tools B 3 3 3 Setting Up the Environment ee 8 5 3 4 Where to Go From Here 5 9 3 1 System Reguirements 3 4 System Requirements 3 2 To install the TMS320C3x C4x code generation tools on a SPARCstation you need the following items Ll m SPARCsiation or compatible system with SPARCstation 2 class or higher performance 4 Mbytes of disk space for the software tools OpenWindows version 3 0 or higher running under SunOS version 4 1 x or higher If you are using SunOS 5 x also known as Solaris 2 x you must have the Binary Compatibility Package BCP installed if
75. time to increase but to increase more frequently A larger size causes the swap file to take longer to increase but to increase less frequently To have a static swap file rather than a dynamic swap file set SwapInc to 0 and set SwapMin to the static size you want SwapMin n K M G SwapMin specifies the minimum or initial size of the swap file The default is 0 bytes If you want VMM to create a full size swap file at startup time set SwapMin to the full size of the swap file and set Swaplnc to 0 VirtualSize n K M G VirtualSize specifies the size of the virtual memory space The default is 16384 Kbytes Set VirtualSize to a larger size if your program uses more than 16 Mbytes of code and data but do not set it to more than twice the size of your program s memory requirement Setting Up the Environment You can change the defaults in two ways 1 Specify parameter values as arguments to the DOS4GVM environment variable as shown in the example below Note that you must have at least 8192 Kbytes of free memory to use this example set DOS4GVM deleteswapfile ON physmax 8192K swapfilename c swap tmp 2 Create a configuration file with the filetype extension VMC and call that file as an argument to the DOS4GVM environment variable as shown below set DOS4GVM NEW4G VMC A VMC file contains VMM parameters and settings as shown in the example below You can include comments Comments on lines by them selves must be pre
76. trb0_gcontrol_bit strosw gt strb0_gcontrol_bit strocnfg gt strb0_gcontrol_bit signext gt strb0_gcontrol_bit memwidth strbO gcontrol bit datasize StrbO gcontrol bit bnkcmp strbO gcontrol bit wtcnt gt strb0_gcontrol_bit sww gt strb0_gcontrol_bit hiz gt strb0_gcontrol_bit nohold strbO gcontrol bit holdst Sstrb1 gcontrol gt strb1_gcontrol_bit signext gt strb1_gcontrol_bit memwidth strb1 gcontrol bit datasize gt strb1 gcontrol bit bnkcmp strb1 gcontrol bit wtcnt gt strb1_gcontrol_bit sww gt strb1_gcontrol strb1 gcontrol bit wtcnt iostrb gcontrol bit sww Define pointer to bus peripheral zero wait states on IOSTRB bus Tables of Peripheral Registers Structure Member Names and Bit Field Names Table B 2 DMA Control Registers Register Assignment DMAO Global Control Integer Bit field DMA1 Global Control Integer Bit field DMAx Source Address Integer DMAx Destination Address Integer DMAx Transfer Counter Integer Example B 2 DMA Control include lt dma32 h gt DMA REG dma0 DMA ADDR 0 dma0 gcontrol bit start STOP Bit Fleld PRIORITY MODE DMA PRI TCINT TC SYNC DECDST INCDST DECSRC INCSRC STAT START TCINT TC SYNC DECDST INCDST DECSRC INCSRC STAT START Member Name gt gcontrol gcontrol bit pri mode gcontrol bit dma pri 9control bit tcint 9control bit tc 9control bit sy
77. ud ee rh eae bees deed a v ck TREE Ba a EA Setting Up the Tools on a PC Running Windows NT or Windows 95 Provides installation instructions for PCs running Windows NT or Windows 95 2 System Requirements 00 6 cece eee re 2 2 Installing the Tools III III 2 3 Setting Up the Environment ete eens Setting environment variables under Windows NT Setting environment variables under Windows 95 Identifying the directory that contains the executable files PATH statement Identifying alternate directories for the assembler A DIR LLuse Identifying alternate directories for the compiler C DIR naana Setting default shell options C OPTION 2 e Specifying a temporary file directory TMP ssssssese enn 2 4 Where to Go From Here he Setting Up the Tools on a SPARCstation eere eere Provides installation instructions for SPARCstations running SunOS 3 4 System Requirements 06 eee eee eee ees 3 2 Mounting the CD ROM and Installing the Tools 0000 e cece eee ees Mounting the CD ROM eisses adini aa ank ai enaA EA N AE a EE EEE E AEE A Contents Installing the tOOlS z 2 5 z49x0 d Rie r et dee Ree Renee Bee Edu Bald er ees Unmounting the CD ROM sssssssessses sss ns 39 3 Setting Up the Environment e Identifying the directory that contains the executable files path statement Identifying alternate dire
78. uide or the TMS320C3x C4x Optimizing C Compiler User s Guide Identifying alternate directories for the compiler C DIR By default the compiler searches the current directory for include files and object libraries such as the runtime support and C I O libraries Use the C DIR environment variable to define additional search paths The format of the command for assigning the environment variable is as follows set C DIRzpathnameT pathname 2 You can separate the pathnames with a semicolon or a blank Setting Up the Tools on a PC Running Windows NT or Windows 95 2 5 Setting Up the Environment Once you set C DIR you can use the include directive in your C source code without specifying path information Setting default shell options C OPTION 2 6 When using the shell program cl30 you might find it useful to set default options for the compiler assembler and linker using the C OPTION environment variable After reading the command line options and input file names the shell reads the contents of the C OPTION environment variable Notice that options defined with C OPTION do not override the options specified on the command line Setting up default options with the C OPTION environment variable is especially useful when you want to run consecutive times with the same set of options and or input files The options and or input filenames that you define with C OPTION are used every time you run the shell The synta
79. ule called prog out The o option supplies the name of the output module Example 5 4 shows the map file resulting from this operation The map file is produced only if you use the m option Example 5 4 Output Map File Inker2 map output section page UTPUT FILE NAME ENTRY POINT SYMBOL lt prog out gt 0 KKK KKK KKK KKK AK ZA AK A A K AA ZA AX ck ck ck ck KKK KKK KKK KKK KKK KKK KK KKK KK TMS320C3x 4x COFF Linker Version 5 00 KKK KK KKK KKK KKK KK KKK KKK A KA KKK KKK KK KKK KKK KKK KKK KK KKK KK Fri Dec 20 11 03 11 1996 O SECTION ALLOCATION MAP text 0 data 0 bss 0 stack 0 GLOBAL SYMBOLS address name 00000000 bss 00000000 data 00000000 text 0000000f stack 0000000b addvec 00000000 edata 00000000 end 0000000f etext 00000006 start 10 symbols attributes origin length input sections 00000000 0000000 00000000 0000000b filel obj text 0000000b 00000004 file2 obj text 00000000 00000000 UNINITIALIZE 00000000 00000000 filel obj data 00000000 00000000 file2 obj data 00000000 00000000 UNINITIALIZE 00000000 00000000 filel obj bss 00000000 00000000 file2 obj bss 0000000 00000400 UNINITIALIZED 0000000 00000000 filel obj stack 00000400 STACK SIZE address name OG 09 69 OO C9 CC 5 4 Getting Start
80. ut SAM for instructions Be sure you are not logged on as root To install the software tools follow these steps 1 If you do not already have a tools directory create one Enter mkdir tool dir Replace fool dir with your own directory name including the path information to install the tools 2 Copy the files to your directory cp r tool dir Unmounting the CD ROM You must unmount the CD ROM after copying the files As root enter cd umount cdrom exit Setting Up the Tools on an HP Workstation 4 3 Setting Up the Environment 4 3 Setting Up the Environment Before or after you install the tools you can define environment variables that setcertain code generation tool parameters you normally use An environment variable is a system symbol that you define and assign to a string When you use environment variables default values are set making each individual invocation of the tools simpler because these parameters are automatically specified When you invoke a tool you can use command line options to over ride many of the defaults that are set with environment variables To setupthe environment enter these commands Be sure you are not logged on as root J For C shells setenv C DIR tool dir setenv A DIR tool dir set path tool dir path For Bourne or Korn shells C DIR tool dir A DIR tool dir PATH tool dir PATH You can move these commands into your login or cshrc file for C shells or
81. ws a performance metric developed by Tenberry Software Inc formerly known as Rational Systems Inc indicating the expected throughput for the com puter relative to a standard 8 MHz IBM PC AT disk accesses and floating point operations are both excluded Shows the speed with which the computer can switch between real and protected modes both as the maximum number of round trip switches that can occur per second and as the time for a single round trip switch broken into the real to protected up and protected to real down components Kernel Error Messages A 2 Kernel Error Messages This section describes error messages from the DOS 16M kernel embedded in the TMS320C3x C4x code generation tools Kernel error messages can occur because of severe resource shortages corruption of the executable file corruption of memory operating system incompatibilities or internal errors All of these messages are quite rare DOS 16M protected mode available only with 386 or 486 Description DOS 4G did not detect the presence of a 386 486 or Pentium based processor You may see this error message even if you are using a 386 PC or later Action If you are running the tools on a 386 or later PC rerun the program If you are running the tools on a 286 PC reinstall and run the tools on a 386 PC or later 0 involuntary switch to real mode Description The computer was in protected mode but switched to real mode without going through DOS
82. x for the C OPTION environment variable is set C OPTION zoption1 option2 Options specified in the environment variable are specified in the same way and have the same meaning as they do on the command line For more information about compiler and assembler options see the TMS320C3x C4x Optimizing C Compiler User s Guide and the TMS320C3x C4x Assembly Language Tools User s Guide For example if you wantto always run quietly the q option enable C source interlisting the s option and link the option set up the C OPTION environment variable as follows set C OPTION qs z In this example each time you run the shell program it runs the linker Any options following z on the command line or in C OPTION are passed to the linker This enables you to use the C OPTION environment variable to specify default compiler and linker options and then specify additional compiler and linker options on the shell command line If you have set z in the environment variable and want to compile only use the c option of the shell These additional examples assume C OPTION is set as shown above cl16 eC compiles and links cl16 G 796 only compiles C16 og z c30 cmd compiles and links using a command file cl16 c c z c30 cmd only compiles c overrides z For more information on linker options see the Linker Options section in the TMS320C3x C4x Assembly Language Tools User s Guide Setting Up the Envir
83. y This program interlists the C source statements as comments in the assembly language compiler output allowing you to inspect the assembly language generated for each line of C To run the interlist utility invoke the shell program with the ss option For example c130 ss function z c30 cmd o function out The output of the interlist utility is written to the assembly language file created by the compiler The shell ss option implies k that is when you use the interlist utility the assembly file is automatically retained Getting Started With the Code Generation Tools 5 7 Chapter 6 Release Notes This chapter contains documentation of tools and features that are new or have been changed since the last release It details all enhancements made to the TMS320C3x C4x floating point DSP assembly language tools and optimizing C compiler Topic Page 6 1 Release Enhancements ee cece teen eee 6 2 B 200USaTU Mpa hts s ET 6 1 Release Enhancements 6 1 Release Enhancements 6 2 This section lists the release enhancements for version 5 00 of the TMS320C3x C4x floating point DSP code generation tools Each enhancement includes a reference to the manual in which it is further detailed The following abbreviations are used ALT See the TMS320C3x C4x Assembly Language Tools User s Guide literature number SPRUO35C COMP See the TMS320C3x C4x Optimizing C Compiler User s Guide literatur
Download Pdf Manuals
Related Search
Related Contents
Manual de instalação e instruções de uso SILENT-100 Marek`s Disease Vaccine Vacuna Contra la Enfermedad de scarica pdf TIBCO Spotfire Clinical 3.3 - TIBCO Product Documentation OPERATORTS MANUAL - Troy-Bilt Manual de instruções Samsung SRT575JB User Manual 伊保処理場沈砂池機械設備工事 [253KB pdfファイル] Copyright © All rights reserved.
Failed to retrieve file