SDKZSPF LSI, SDKZSPF Datasheet

no-image

SDKZSPF

Manufacturer Part Number
SDKZSPF
Description
Manufacturer
LSI
Datasheet

Specifications of SDKZSPF

Lead Free Status / Rohs Status
Supplier Unconfirmed
USER’S
GUIDE
ZSP™ Software
Development Kit
M a y 2 0 0 3
Revision 4.3.1
®
DB15-000126-10

SDKZSPF Summary of contents

Page 1

USER’S GUIDE ZSP™ Software Development Kit Revision 4.3.1 ® DB15-000126-10 ...

Page 2

... LSI Logic does not assume any responsibility or liability arising out of the application or use of any product described herein, except as expressly agreed to in writing by LSI Logic; nor does the purchase or use of a product from LSI Logic convey a license under any patent rights, copyrights, trademark rights, or any other of the intellectual property rights of LSI Logic or third parties ...

Page 3

... Preface This book is the primary reference and user’s guide for the ZSP™ Software Development Kit (SDK). The SDK supports digital signal processors based on the ZSP400 core (for example, the LSI402ZX and LSI403LP) and the next generation ZSP G2 architecture. Audience This document assumes that you have some familiarity with the C language, and with the ZSP architecture and assembly language ...

Page 4

... Chapter 10, ZSP MDI Configuration configuration files for the ZSP SDK MDI libraries. Chapter 11, ZSP Integrated Development the SDK Project Manager provided by LSI Logic with Windows 98/NT/2000/XP and Solaris versions of the SDK. Chapter 12, ZSP IDE provided by LSI Logic with Windows 98/NT/2000/XP and Solaris versions of the SDK ...

Page 5

... Man pages for ar, nm, objdump, string, size, objcopy, strip and ranlib from the Free Software Foundation, available from the FTP site prep.ai.mit.edu. We would like to acknowledge Herschel Technologies for providing the standard floating point library included in this release. Preface Copyright © 1999-2003 by LSI Logic Corporation. All rights reserved. v ...

Page 6

... Preface Copyright © 1999-2003 by LSI Logic Corporation. All rights reserved. Meaning and Use Names of commands, files, directories, and code are shown in courier typeface In a command line, command keywords are shown in bold, nonitalic courier typeface. Enter them exactly as shown, including case ...

Page 7

... Preface Copyright © 1999-2003 by LSI Logic Corporation. All rights reserved. Meaning and Use In command formats, you must select one (but not more than one) item enclosed within braces. Do not enter the braces. When vertical bars are used within braces, you may select one (but not more than one) of the items separated by braces ...

Page 8

... Preface Copyright © 1999-2003 by LSI Logic Corporation. All rights reserved. ...

Page 9

... Compiler Conventions 3.2.1 3.2.2 3.2.3 3.2.4 3.2.5 3.2.6 3.2.7 Contents Copyright © 1999-2003 by LSI Logic Corporation. All rights reserved. Installing SDK Tools Restarting Windows Obtaining a License File Starting the License Manager Setting Environment Variables Preprocessing Conventions Data Type Conventions Register Usage ...

Page 10

... Assembly Language Syntax 4.2.1 4.2.2 4.2.3 4.2.4 Chapter 5 Linker 5.1 Introduction x Contents Copyright © 1999-2003 by LSI Logic Corporation. All rights reserved. Vector N-Intrinsics ETSI Functions Syntax Parameterized Assembly Variables and Expressions Explicitly Clobbered Registers Examples of asm Directive Optimization of Inline Assembly Example 1 Example 2 ...

Page 11

... Contents Copyright © 1999-2003 by LSI Logic Corporation. All rights reserved. Batch Mode Interactive Mode alias clear break clear dmem clear imem clear stats disable break disable trace dump dmem dump imem ...

Page 12

... Using ZSIM 8.1.1 8.1.2 8.2 ZSIM Commands 8.2.1 8.2.2 8.2.3 8.2.4 xii Contents Copyright © 1999-2003 by LSI Logic Corporation. All rights reserved. fill dmem fill imem help load dmem load exe load imem reset run script set attr set break ...

Page 13

... Contents Copyright © 1999-2003 by LSI Logic Corporation. All rights reserved. 8-12 8-13 8-13 8-13 8-14 8-14 8-14 8-15 8-15 8-16 8-19 8-21 8-21 ...

Page 14

... Chapter 10 ZSP MDI Configuration Files 10.1 Configuration File Basics 10.1.1 10.1.2 xiv Contents Copyright © 1999-2003 by LSI Logic Corporation. All rights reserved. show rule show size show stats show trace step unalias Functional-Accurate Simulator Connection Cycle-Accurate Simulator Connection UART Connection ...

Page 15

... Help Menu 11.8 Editor Chapter 12 ZSP IDE Debugger 12.1 Features of ZSP IDE Debugger Contents Copyright © 1999-2003 by LSI Logic Corporation. All rights reserved. Fields Device Information Section Device Libs Section ZSP400 ZISIM ZSP400 ZSIM ZSP400 JTAG ZSP500/ZSP600 ZISIM ZSP500/ZSP600 ZSIM ...

Page 16

... G2 E.2.1 E.3 API Specification for 16bit CRC Library Function on G2 E.3.1 xvi Contents Copyright © 1999-2003 by LSI Logic Corporation. All rights reserved. Main Window Title Bar - Project File Name Display Window Area Status Area Main Menu Main Toolbars Debugging Windows (General) ...

Page 17

... E.10 API Specification for Real Block FIR Library Function on G2 E-12 E.10.1 Real Block FIR E.11 API Specification for 256 point FFT Library Function on G2 E-14 E.11.1 256 point FFT Index Customer Feedback Contents Copyright © 1999-2003 by LSI Logic Corporation. All rights reserved. E-6 E-6 E-7 E-7 E-8 E-8 E-9 E-9 ...

Page 18

... Contents Copyright © 1999-2003 by LSI Logic Corporation. All rights reserved. ...

Page 19

... Utilities Menu 11.28 Object File Utility Dialog Box 11.29 Utility Output Window Showing Disassembled Code 11.30 Run User Command Dialog Box Copyright © 1999-2003 by LSI Logic Corporation. All rights reserved. Overview of Software Development Select Components Dialog Box System Reboot Prompt ...

Page 20

... Example Source Code Popup Query Result 12.30 Breakpoint List Window 12.31 Debugging Symbols Window xx Copyright © 1999-2003 by LSI Logic Corporation. All rights reserved. Menu Checkmarks For Debugging Windows Tools Menu - Invoke Toolbars Preferences - Use Images For Toolbar Buttons Toolbar Buttons with Text Annotation ...

Page 21

... Plot Type Dialog Box - Memory Range Option 12.59 Appearance... Dialog Box 12.60 Remove Plot Dialog Box 12.61 Preferences Window - Logging 12.62 Tools Menu - Session Log File 12.63 Session Log Window Copyright © 1999-2003 by LSI Logic Corporation. All rights reserved. 12-29 12-30 12-31 12-31 12-32 ...

Page 22

... Copyright © 1999-2003 by LSI Logic Corporation. All rights reserved. ...

Page 23

... Copyright © 1999-2003 by LSI Logic Corporation. All rights reserved. SDK Tools and GNU Counterparts SDK Utilities and GNU Counterparts SDK CD-ROM High-Level Directories Files Installed in C:\Installation_Directory\doc File Installed in C:\Installation_Directory\ doc\Arch Files Installed in C:\Installation_Directory\ mdi\GNU ...

Page 24

... Copyright © 1999-2003 by LSI Logic Corporation. All rights reserved. Stack Frame Example Run-time Library Location N-Intrinsic Functions Vector N-Intrinsics ETSI to N-Intrinsic Mapping Parameter Output Syntax Argument Constraints SDK Utilities and GNU Counterparts ...

Page 25

... DG Window - Orient Menu 12.6 DG Window - Zoom Menu 12.7 DG Window - Options Menu B.1 ZSP400 Control Registers C.1 G2 Control Registers D.1 Long Intrinsic Functions Copyright © 1999-2003 by LSI Logic Corporation. All rights reserved. 9-2 9-2 9-4 9-5 9-8 9-9 9-11 9-11 9-18 10-4 ...

Page 26

... Copyright © 1999-2003 by LSI Logic Corporation. All rights reserved. ...

Page 27

... Chapter 1 Introduction The ZSP Software Development Kit (SDK) from LSI Logic supports all aspects of software development for systems incorporating devices based on the ZSP400 and ZSPG2 architectures. The ZSP SDK includes an optimizing C cross compiler, assembler, and linker, both a functional- accurate simulator and a cycle-accurate simulator, and a source- and assembly-level debugger ...

Page 28

... Documentation for the GNU project tools can be obtained from the web site www.gnu.org and the FTP site prep.ai.mit.edu. To gain access to the FTP site, log in as ‘anonymous’ 1-2 Introduction Copyright © 1999-2003 by LSI Logic Corporation. All rights reserved. ...

Page 29

... The SDK provides utilities for manipulating the files that are generated by the tools during project creation. These SDK-specific utilities, described in Table 1.2, replace their GNU counterparts. Overview of the SDK Tools Copyright © 1999-2003 by LSI Logic Corporation. All rights reserved. Table 1.1). 1-3 ...

Page 30

... The GUI tools include an IDE and a GUI Debugger for both Windows and Solaris platforms. 1-4 Introduction Copyright © 1999-2003 by LSI Logic Corporation. All rights reserved. SDK Utilities and GNU Counterparts GNU Equivalent Function Creates, modifies, and extracts files from an archive. ...

Page 31

... Chapter 3, "C Cross Compiler" tools can also be accessed using the ZSP Integrated Development Environment (ZSP IDE), (Chapter Overview of Software Development Using the SDK Tools Copyright © 1999-2003 by LSI Logic Corporation. All rights reserved. Figure 1.1. As shown in the figure, the compiler accepts C through (Chapter 11), and the ZSP IDE Debugger 12) ...

Page 32

... Figure 1.1 C Source Files Assembler Source Files 1-6 Introduction Copyright © 1999-2003 by LSI Logic Corporation. All rights reserved. Overview of Software Development Assembler C Compiler Source Files Optimizer Macro- Assembler preprocessor ELF Archiver Object File Libraries Linker ELF Load File Debugger Listing File ...

Page 33

... ZSP Software Development Kit User’s Guide Copyright © 1999-2003 by LSI Logic Corporation. All rights reserved. SDK CD-ROM High-Level Directories Description Contains the complete documentation for the SDK tools and the GNU tools. Also includes documentation for the license manager (FLEXlm) and the ZSP Development Kit ...

Page 34

... Step 1. Insert the CD-ROM in the CD drive. Figure 2.1 2-2 Installation Copyright © 1999-2003 by LSI Logic Corporation. All rights reserved. Before you install the SDK tools, make sure you have uninstalled any older version. Refer to stalling the SDK Tools on Windows Systems.” ...

Page 35

... File Installed in C:\Installation_Directory\ doc\Arch Filename Function ZSIM peripheral library API reference guide peripherial_api.pdf Installation on Windows Systems Copyright © 1999-2003 by LSI Logic Corporation. All rights reserved. through Table 2.16. Function Documentation on sdelfread and zdelfread Errata for ZSP SDK version <vers> “Read Me First” file for SDK version <vers> ...

Page 36

... Filename jtag400.cfg jtag500.cfg zisim400.cfg zisim500.cfg zsim400.cfg zsim500.cfg 2-4 Installation Copyright © 1999-2003 by LSI Logic Corporation. All rights reserved. Files Installed in C:\Installation_Directory\ mdi\GNU Function GNU assembler GNU binutils GNU Compiler Collection, version 2.95 GNU Compiler Collection, version 3.0 GNU debugger GNU linker ...

Page 37

... Files Installed in C:\Installation_Directory\ mdi\Drivers Filename Function JTAG driver file for the ZSP40X family jtagdrv.dll JTAG driver file for the ZSP500 jtagdrvG2.dll ZISIM driver file for the ZSP40X family libdrvzisim400.dll Installation on Windows Systems Copyright © 1999-2003 by LSI Logic Corporation. All rights reserved. 2-5 ...

Page 38

... Installation Copyright © 1999-2003 by LSI Logic Corporation. All rights reserved. Files Installed in C:\Installation_Directory\ mdi\Drivers (Cont.) Function ZISIM driver file for the ZSP500 ZSIM driver file for the ZSP40X family ZSIM driver file for the ZSP500 ...

Page 39

... Table 2.11 Files Installed in C:\Installation_Directory\ sdspI\include Filename assert.h cbuf.h creg.h ctype.h dsp.h float.h Installation on Windows Systems Copyright © 1999-2003 by LSI Logic Corporation. All rights reserved. Function Standard header file Circular buffer Control registers Standard header file L-Intrinsics Floating point support 2-7 ...

Page 40

... Table 2.12 Filename readelf.exe zdelfread.exe libcpig711.dll libzisimg2.dll libzidlmssg2.dll 2-8 Installation Copyright © 1999-2003 by LSI Logic Corporation. All rights reserved. Files Installed in C:\Installation_Directory\ sdspI\include (Cont.) Function SDSP-specific printing Standard header file Math library functions N-Intrinsics Support file (deprecated) Standard header files ...

Page 41

... Optimizer zdopt.exe Optimizer for ZSP400 to ZSP500 code zdxopt.exe Ranlib utility zdranlib.exe Size utility zdsize.exe String print utility zdstrings.exe Symbol discarding utility zdstrip.exe Functional-accurate simulator for ZSP400-based zisimg2.exe devices Installation on Windows Systems Copyright © 1999-2003 by LSI Logic Corporation. All rights reserved. 2-9 ...

Page 42

... Table 2.15 Filename cbuf.h ctype.h creg.h dsp.h float.h 2-10 Installation Copyright © 1999-2003 by LSI Logic Corporation. All rights reserved. Libraries Installed in C:Installation_Directory\ zspg2\lib Function Startup file C library C library with debug information Math function library Basic signal processing functionality -- optimized for ZSP500 core. ...

Page 43

... Used by data graph utility plplot510.dll Used by GUI Debugger rls_semaphore.exe Used by GUI Debugger tktable.dll Installation on Windows Systems Copyright © 1999-2003 by LSI Logic Corporation. All rights reserved. Function SDSP-specific printing Standard header file Math functions N-Intrinsics Support file Standard header files ...

Page 44

... Click Finish to exit from the Setup program.The system is restarted according to the option selected in the preceding Tools Setup dialog box. 2-12 Installation Copyright © 1999-2003 by LSI Logic Corporation. All rights reserved. Files Installed in C:Installation_Directory\ ide\bin (Cont.) Function Used by GUI Debugger to identify command-line ...

Page 45

... Perform the following steps to uninstall the SDK tools: Step 1. Open the Control Panel window. Step 2. In the Control Panel window, double-click on Add/Remove Step 3. Then select the LSI LOGIC SDK tools and click on Figure 2.3 Step 4. Click on Remove and continue with Next to uninstall the tools. ...

Page 46

... Step 8. To use the simulator or debugger, you must include the 2-14 Installation Copyright © 1999-2003 by LSI Logic Corporation. All rights reserved. If your Solaris system has vold, it automatically mounts the CD-ROM after it has been inserted. To access the CD-ROM, change the directory to /cdrom. ...

Page 47

... Random library (ranlib) utility sdranlib Size utility sdsize String print utility sdstrings Symbol discarding utility sdstrip Functional-accurate simulator for ZSP400-based devices zisim400 Cycle-accurate simulator for ZSP400-based devices zsim400 Installation on Solaris Systems Copyright © 1999-2003 by LSI Logic Corporation. All rights reserved. Table 2.17 through 2-15 ...

Page 48

... N_Intrinsic.h math.h q15.h 2-16 Installation Copyright © 1999-2003 by LSI Logic Corporation. All rights reserved. Libraries Installed in $SDSP_HOME/sdspI/lib Function Startup file C library C library with debug information C library with long calls Math functions Header Files Installed in $SDSP_HOME/ sdspI/include ...

Page 49

... Source-level Debugger for the G2 architecture zdbug Compiler zdcc Compiler zdcc1 Preprocessor zdcpp Linker zdld Symbol listing utility zdnm Object file copying utility zdobjcopy Object dump utility zdobjdump Optimizer zdopt Installation on Solaris Systems Copyright © 1999-2003 by LSI Logic Corporation. All rights reserved. 2-17 ...

Page 50

... Filename crt0.o libalg_zsp500.a libalg_zsp600.a libc.a libg.a libm.a 2-18 Installation Copyright © 1999-2003 by LSI Logic Corporation. All rights reserved. Command-Line Tools Installed in $SDSP_HOME/ zspg2/bin (Cont.) Function G1-G2 Cross Debugger G1-G2 Cross Compiler G1-G2 Cross Preprocessor G1-G2 Cross Optimizer Random library (ranlib) utility ...

Page 51

... Control registers creg.h Standard header file ctype.h L-Intrinsics dsp.h Floating point support float.h SDSP-specific printing libsdsp.h Standard header file limits.h N-Intrinsics N_Intrinsic.h Math functions math.h Support file q15.h Installation on Solaris Systems Copyright © 1999-2003 by LSI Logic Corporation. All rights reserved. 2-19 ...

Page 52

... JTAG port (on Windows platforms only). The correct map file is required for hardware-assisted debugging. The map file supplied with the ZSP SDK tools corresponds to the LSI402ZX rev2. If you are using a different ZSP400-based part, you must 2-20 Installation Copyright © 1999-2003 by LSI Logic Corporation. All rights reserved. ...

Page 53

... This section describes how to set up licensing for the SDK tools Release 4.3, the SDK toolset is distributed under a license agreement. Licenses must be obtained from LSI before the SDK will function. For license administration, please also refer to the FLEXlm End User’s Guide, located on the distribution CD at /doc/Flexlm_Enduser.pdf. ...

Page 54

... The registry ZSPLD_LICENSE_FILE (Windows v6.0 $HOME/.flexlmrc (UNIX v7.0+), which functions like the registry for FLEXlm on UNIX. On Windows, the FLEXlm registry location is: HKEY_LOCAL_MACHINE\Software\FLEXlm License Manager On UNIX, the equivalent information is stored in $HOME/.flexlmrc. 2-22 Installation Copyright © 1999-2003 by LSI Logic Corporation. All rights reserved. ...

Page 55

... The command-line options and source file name extension determine the type of compilation. In the simplest case, with no options and a .c source file, the compiler produces an executable, a.out. ZSP Software Development Kit User’s Guide Copyright © 1999-2003 by LSI Logic Corporation. All rights reserved. 3-1 ...

Page 56

... The ZSPG2 architecture has a larger call immediate range (16-bits), so this option is not as critical for it. Better 3-2 C Cross Compiler Copyright © 1999-2003 by LSI Logic Corporation. All rights reserved. Table 3.1. Availability sdcc ...

Page 57

... Code generated with the small data model is more compact and has better performance than code generated with the large data model. The small data model allows a shorter instruction sequence to be used to access memory in the data or bss sections. Compiler Options Copyright © 1999-2003 by LSI Logic Corporation. All rights reserved. 3-3 ...

Page 58

... All optimizations performed at level -O2 are performed, as well as function inlining -O3 and loop unrolling. 3.2 Compiler Conventions This section describes the software conventions defined by the SDK assembler and compiler. 3-4 C Cross Compiler Copyright © 1999-2003 by LSI Logic Corporation. All rights reserved. Table 3.3. ...

Page 59

... Compiler Conventions Copyright © 1999-2003 by LSI Logic Corporation. All rights reserved. Compiler’s Representation of C Data Types Representation 16 bits 16 bits 16 bits 16 bits 16 bits 16 bits 16 bits 16 bits with sdcc/zdxcc ...

Page 60

... It should be remembered that only accumulators r12-r15 have their guard bits preserved across calls. 3-6 C Cross Compiler Copyright © 1999-2003 by LSI Logic Corporation. All rights reserved. Compiler’s Representation of C Data Types (Cont.) Representation 32 bits 32 bits ...

Page 61

... Registers used by the compiler: r0–r15, a0-a7, n0-n7, g0-g7, %fmode, %smode, %amode, %hwflag, %shwflag, %loop0-%loop3, %rpc, %pc, %cb0_beg-%cb3_beg, %cb0_end-%cb3_end. Stack pointer: a7 Compiler Conventions Copyright © 1999-2003 by LSI Logic Corporation. All rights reserved. 3-7 ...

Page 62

... C Cross Compiler Copyright © 1999-2003 by LSI Logic Corporation. All rights reserved. Table 3.5 shows the mode bits that may affect the Required Entry 1 Code Value zdcc sdcc zdcc zdxcc yes 0 yes 0 ...

Page 63

... Note that data includes the stack, and that compiled code does not operate correctly if glo- bal data resides in one memory and the stack resides in another memory. Compiler Conventions Copyright © 1999-2003 by LSI Logic Corporation. All rights reserved. Required Entry 1 Code ...

Page 64

... A pointer value is returned in a0. A non-pointer 32-bit value is returned in r5r4. A 16-bit value is returned in r4. A structure is returned using a hidden pointer, which is passed by the caller in a0. 3-10 C Cross Compiler Copyright © 1999-2003 by LSI Logic Corporation. All rights reserved. ...

Page 65

... Table 3.6 Table 3.6 high address low address Compiler Conventions Copyright © 1999-2003 by LSI Logic Corporation. All rights reserved. shows the layout of a function’s stack frame. Stack Frame Layout Callee saved registers %rpc Local variables and temporaries ...

Page 66

... C Cross Compiler Copyright © 1999-2003 by LSI Logic Corporation. All rights reserved. shows the two example stack frames for the functions foo and Stack Frame Example Callee saved registers of foo locals/temps of foo ...

Page 67

... The following is a sample epilogue that saves r8, r9, a2, and %rpc and reserves 20 words of space on the stack. Note that with optimization, this code is reordered with non-prologue code for better scheduling: pushd r8, a7 mov.e r8, %rpc pushd r8, a7 pushd a2, a7 add a7, -20 Compiler Conventions Copyright © 1999-2003 by LSI Logic Corporation. All rights reserved. 3-13 ...

Page 68

... C Cross Compiler Copyright © 1999-2003 by LSI Logic Corporation. All rights reserved. !! The first argument location on the stack !! Store r0 at r12+1 and r1 at r12+2. !! Compute r12+3 and store in r13. !! Store r2 in r12+3 and r3 in r12+4. ...

Page 69

... The function callee retrieves l5 and l6 from caller’s stack space by loading the values from caller’s outgoing argument space. The first Compiler Conventions Copyright © 1999-2003 by LSI Logic Corporation. All rights reserved. !l5, fifth 32-bit non-pointer parameter passed on stack !l6, sixth 32-bit non-pointer parameter passed on stack ...

Page 70

... These functions are equivalent to those found in other C programming environments, having the same names and parameter lists. Thus existing programs that use these functions may be recompiled 3-16 C Cross Compiler Copyright © 1999-2003 by LSI Logic Corporation. All rights reserved. 1, which has a default value of 0xF7FF for sdcc/zdxcc ...

Page 71

... The filehandles stdin, stdout, and stderr are supported. Pseudo-random number generation functions (stdlib.h) rand, rand_r, srand, _lrand, _lrand_float Memory allocation functions (stdlib.h) calloc, free, malloc Interprocedural control flow functions (setjmp.h) C Run Time Library Functions Copyright © 1999-2003 by LSI Logic Corporation. All rights reserved. 3-17 ...

Page 72

... The prescale divisor can be set to any value from 1-64. The complete interface for using the timers is: ZSP_timer_set(<timer>, unsigned int value) ZSP_timer_mode(<timer>, <mode>) ZSP_timer_prescale(<timer>, unsigned int prescale) ZSP_timer_start(<timer>) 3-18 C Cross Compiler Copyright © 1999-2003 by LSI Logic Corporation. All rights reserved. ...

Page 73

... N-Intrinsic begins with followed by a suffix that indicates the operation’s data type: _s for int, _l for long, and _h for high-order int of a long. To use N-intrinsics, add the following line in each of your C files: #include <N_Intrinsic.h> N-Intrinsics Copyright © 1999-2003 by LSI Logic Corporation. All rights reserved. 3-19 ...

Page 74

... N_abs_s(int ret, int a) N_round_l(long ret, long a) N_shla_l(long ret, int a) N_shla_s(int ret, int a) 3-20 C Cross Compiler Copyright © 1999-2003 by LSI Logic Corporation. All rights reserved. Table 3.9. The older L-intrinsics are still supported Appendix D, “L-Intrinsic Functions.” Generated Code Analogous L-Intrinsic mac.acc x, y L_maca, L_macb macn ...

Page 75

... N-Intrinsics also allow access to processor-supported ETSI functionality, although the interface is different. For example, the ETSI code norm_l(x); can be rewritten with N-Intrinsics as: N_norm_l(y,x); N-Intrinsics Copyright © 1999-2003 by LSI Logic Corporation. All rights reserved. Table 3.10. The vector N-Intrinsics produce more efficient code Functionality for (i=0; i<len; i++) { N_mac(acc,cnst,vec1[i*inc1]); ...

Page 76

... L_abs L_deposit_h L_mac L_macN L_msu L_msuN L_mult L_shl mac_r msu_r mult 3-22 C Cross Compiler Copyright © 1999-2003 by LSI Logic Corporation. All rights reserved. ETSI to N-Intrinsic Mapping N-Intrinsic N_abs_s N_extract_h N_abs_l N_deposit_h N_mac N_mac N_macn N_macn N_mul N_shla_l N_mac N_macn ...

Page 77

... A circular buffer must have at least 4 ints or 2 longs. Circular buffers can be disabled using the following macros with sdcc/zdxcc: disable_rn_cbuf; For zdcc the macro is: disable_cbuf(CBUF_ID); Circular Buffers Copyright © 1999-2003 by LSI Logic Corporation. All rights reserved. ETSI to N-Intrinsic Mapping (Cont.) N-Intrinsic N_mul N_norm_l N_norm_s N_round_l ...

Page 78

... Puts the value of a control register into var. 3-24 C Cross Compiler Copyright © 1999-2003 by LSI Logic Corporation. All rights reserved. You must disable circular-buffer arithmetic immediately after the final use of pt, because the compiler may reuse the register containing pt for other purposes. The code generated in this case does not expect the register to have circular arithmetic ...

Page 79

... The q15 mode bit affects Q15 multiplies and the N-Instrinsics N_mul, N_mac, N_macn, N_mac2, and the vector intrinsics. Q15 arithmetic can be disabled as follows: bitclear_creg(%fmode,Q15_BIT); Q15 Support Copyright © 1999-2003 by LSI Logic Corporation. All rights reserved. 3-25 ...

Page 80

... The parameterized assembly consists of a text string containing the desired assembly output with parameters that are replaced with registers 3-26 C Cross Compiler Copyright © 1999-2003 by LSI Logic Corporation. All rights reserved. “parameterized assembly” : output variable, ... : input expression, ... : explicitly clobbered register, ... ); ...

Page 81

... For example, an instruction that requires an argument particular register would put a constraint on that argument to ensure that the argument is placed in an allowed register. Inline Assembly Copyright © 1999-2003 by LSI Logic Corporation. All rights reserved. Parameter Output Syntax Output register name or constant ...

Page 82

... In example 3 in Directive”, the output argument and the first argument illustrate this technique. 3-28 C Cross Compiler Copyright © 1999-2003 by LSI Logic Corporation. All rights reserved. Section 3.10.5, “Examples of asm Table 3.13. Argument Constraints Effect ...

Page 83

... Note that register r5 is clobbered by this directive. If addr and val is in r15, this directive produces: abs r5, r15 st r5, a0 3.10.5.3 Example 3 asm(“mac.%m0 %2, %o2” : “=c” (acc) : Inline Assembly Copyright © 1999-2003 by LSI Logic Corporation. All rights reserved. 3-29 ...

Page 84

... For purposes of optimization, the compiler assumes that inline assembly has no effect except to modify the output variables. Thus inline assembly can be removed by optimization if none of the output variables is subsequently used. Inline assembly that must not be deleted or 3-30 C Cross Compiler Copyright © 1999-2003 by LSI Logic Corporation. All rights reserved. ...

Page 85

... The output is placed in standard output. The assembly optimizers expect input of the following format: !PROLOGUE(<function name>) !EPILOGUE Assembly Optimizer and Handwritten Assembly Copyright © 1999-2003 by LSI Logic Corporation. All rights reserved. <function body> 3-31 ...

Page 86

... First, the debugging version of the C library is linked, rather than the optimized version. Second, leaf functions save and restore %rpc (without the -g option, this save and restore is removed by optimization). 3-32 C Cross Compiler Copyright © 1999-2003 by LSI Logic Corporation. All rights reserved. REGSAVE_SIZE_<function name>, <stack space used> ...

Page 87

... This command invokes the C compiler, assembler, and linker and produces an executable file with the default name a.out. The -Tdata=0x1 command places the data at address 0x1 to prevent a NULL pointer from being a valid pointer. 3.14.2 Example test.c Code Statistics Copyright © 1999-2003 by LSI Logic Corporation. All rights reserved. 3-33 ...

Page 88

... The assembler and linker are also invoked, and the output is an executable file with the default name a.out. 3-34 C Cross Compiler Copyright © 1999-2003 by LSI Logic Corporation. All rights reserved. optimizations, as well as -O2 ...

Page 89

... ELF format with the default file extension .obj (Windows (UNIX). 4.2 Assembly Language Syntax The basic format of an SDK assembly language statement is: [ label: ] ZSP Software Development Kit User’s Guide Copyright © 1999-2003 by LSI Logic Corporation. All rights reserved. [ statement ] [ !comment ] 4-1 ...

Page 90

... Refer to Using AS: The GNU Assembler for more information on the section syntax and flag definitions. 4-2 Assembler Copyright © 1999-2003 by LSI Logic Corporation. All rights reserved. !“Start” label !“start” is another (different) label bnz start !“start” label reference add r0, r1 !“ ...

Page 91

... ELF flag of 0x1000.0000, the flag setting for G1G2 programs. If this option is not set, the resulting object file has an ELF flag of 0x2000.0000, the flag setting for ZSPG2 programs. Assembly Language Syntax Copyright © 1999-2003 by LSI Logic Corporation. All rights reserved. 4-3 ...

Page 92

... The .section directive assembles the code following it into the section name specified. Example: .section, “.text”, “ax” 4-4 Assembler Copyright © 1999-2003 by LSI Logic Corporation. All rights reserved. ! Align to the next 32-word boundary. ! Increment the location counter by seven. ...

Page 93

... Assembly files for G1G2 programs that are not assembled with the “--defsym g1g2=1” option produce object files with the G2 flag. However, these inappropriately flagged object files can still be used to produce a G1G2 executable. Assembly Language Syntax Copyright © 1999-2003 by LSI Logic Corporation. All rights reserved. 4-5 ...

Page 94

... The ZSP400 linker, sdld, produces an error message if any module does not have an ELF number the ELF flag is not 0x8000.0000. The ZSPG2 linker, zdld, produces an error message if any module does not have an ELF number the ELF flag is not 0x2000.0000 or 0x1000.0000. 4-6 Assembler Copyright © 1999-2003 by LSI Logic Corporation. All rights reserved. ...

Page 95

... UNIX) and produces an executable file in ELF format with the default name a.out. The linker is invoked from the shell using the following command: sdld [options] sourcefile ZSP Software Development Kit User’s Guide Copyright © 1999-2003 by LSI Logic Corporation. All rights reserved. 5-1 ...

Page 96

... By default, program execution begins at __start. The entry point can be altered by specifying an alternate address, using the -e option. For example, the following command causes execution to begin at address 0xABCD: sdld -e 0xabcd The C stack and heap always lie in internal data memory. 5-2 Linker Copyright © 1999-2003 by LSI Logic Corporation. All rights reserved. ...

Page 97

... Otherwise, it uses the default linker script file. The previous example declares the output sections .text, .data, and vectors. Each output section is formed by the corresponding input sections from all files (as indicated by the ‘*’). Linker Command File Copyright © 1999-2003 by LSI Logic Corporation. All rights reserved. 5-3 ...

Page 98

... Linker Copyright © 1999-2003 by LSI Logic Corporation. All rights reserved. Description Replaces the linker’s default script file with the specified linkercommandfile. Names the output file. By default, the output file name is a.out. ...

Page 99

... ELF number the ELF flag is not 0x8000.0000. The ZSPG2 linker, zdld, produces an error message if any module does not have an ELF number the ELF flag is not 0x2000.0000 or 0x1000.0000. ELF Number and Flags Copyright © 1999-2003 by LSI Logic Corporation. All rights reserved. 5-5 ...

Page 100

... Linker Copyright © 1999-2003 by LSI Logic Corporation. All rights reserved. ...

Page 101

... Unless otherwise specified, the description of a utility applies to both the ZSP400 and ZSPG2 versions of the tools. ZSP Software Development Kit User’s Guide Copyright © 1999-2003 by LSI Logic Corporation. All rights reserved. Table 6.1, replace their GNU counterparts. Tools for 6-1 ...

Page 102

... Utilities Copyright © 1999-2003 by LSI Logic Corporation. All rights reserved. SDK Utilities and GNU Counterparts GNU Equivalent Function Creates, modifies, and extracts files from an archive. ar Lists symbols from object files. nm Displays information from object files. ...

Page 103

... Prints the specified members of the archive, to the standard output file. If the ‘v’ modifier p is specified, show the member name before copying its contents to standard output. If you specify no member arguments, all the files in the archive are printed. sdar Copyright © 1999-2003 by LSI Logic Corporation. All rights reserved. 6-3 ...

Page 104

... The ‘u’ modifier is allowed only for the operation ‘r’ (replace). In particular, the combination ‘qu’ is not allowed, since checking the timestamps would lose any speed advantage from the operation ‘q’. q Quick append at end of files 6-4 Utilities Copyright © 1999-2003 by LSI Logic Corporation. All rights reserved. ...

Page 105

... Copyright © 1999-2003 by LSI Logic Corporation. All rights reserved. Description Shows a summary of the options to strip and exit. Removes the named section from the file. You may give this option more than once. Using this option inappropriately may make the object file unusable ...

Page 106

... Utilities Copyright © 1999-2003 by LSI Logic Corporation. All rights reserved. Description Removes symbol symbolname from the source file. You may give this option more than once, and combine it with other strip options ...

Page 107

... Copyright © 1999-2003 by LSI Logic Corporation. All rights reserved. [- objfile Description Precedes each symbol by the name of the input file where it was found, rather than identifying the input file once only before all of its symbols. ...

Page 108

... Utilities Copyright © 1999-2003 by LSI Logic Corporation. All rights reserved. Description Using one of these options, you can choose whether the output from sdsize resembles output from System V UNIX size (using ‘-A’, or ‘--format=sysv’), or Berkeley Software Distribution (BSD) size (using ‘ ...

Page 109

... Options – Table 6.7 sdstrings Options Option -f | --print-file-name -min-len | -n min-len | --bytes=min-len -t radix | --radix=radix sdstrings Copyright © 1999-2003 by LSI Logic Corporation. All rights reserved. size addr 294880 8192 81920 303104 11592 385024 388392 Description Prints the name of the file before each string ...

Page 110

... Options – The long and short forms of options, shown here as alternatives, are equivalent. At least one option from the list must be given. 6-10 Utilities Copyright © 1999-2003 by LSI Logic Corporation. All rights reserved. ...

Page 111

... Copyright © 1999-2003 by LSI Logic Corporation. All rights reserved. Description Displays the assembler mnemonics for the machine instructions from objfile. This option only disassembles those sections which are expected to contain instructions. Displays summary information from the overall header of each of the objfile files ...

Page 112

... When generating an S-record or a raw binary file, it may be helpful to use ‘-S’ to remove sections containing debugging information. In some cases ‘-R’ is useful to remove sections which contain information which is not needed by the binary file. infile outfile 6-12 Utilities Copyright © 1999-2003 by LSI Logic Corporation. All rights reserved. ...

Page 113

... Copyright © 1999-2003 by LSI Logic Corporation. All rights reserved. Description Write the output file using the object format bfdname. Keep only every byteth byte of the input file (header data is not affected). byte can be in the range from 0 to interleave-1, where interleave is given by the -i or --interleave option, or the default of 4 ...

Page 114

... Options Options -h | --file-header -v | --version -H | --help 6-14 Utilities Copyright © 1999-2003 by LSI Logic Corporation. All rights reserved. Description Displays the information contained in the ELF header at the start of the file. Displays the version number of readelf. Displays the command line options understood by readelf. ...

Page 115

... Table 7.1 Name zisim400 zisimg2 ZSP Software Development Kit User’s Guide Copyright © 1999-2003 by LSI Logic Corporation. All rights reserved. Section 7.2, “ZISIM Commands,” Table 7.1 shows available simulators. Functional-Accurate Simulators Use when simulating... code written for ZSP400 architecture. ...

Page 116

... An executable file may or may not be specified, followed by zero or more command-line options separated by spaces The executable file is a ZSP binary file generated using the SDK compiler, assembler, and linker tools, 7-2 ZSP SDK Functional-Accurate Simulator Copyright © 1999-2003 by LSI Logic Corporation. All rights reserved. Section 7.2.21, “script,” page 7-16. ...

Page 117

... Using ZISIM Copyright © 1999-2003 by LSI Logic Corporation. All rights reserved. Section 7.2, “ZISIM Refer also to the description of using Description Limits number of executed instructions to NUM. By default, NUM = 2,000,000,000. Execution continues until a breakpoint is reached or the number of executed instructions hit the limit. Use this option to ensure termination of an algorithm ...

Page 118

... ZSP SDK Functional-Accurate Simulator Copyright © 1999-2003 by LSI Logic Corporation. All rights reserved. Description Enables register trace. All the architectural registers are displayed after executing an instruction. Reads all the simulator commands from file. Enables flow trace. ZISIM prints a trace of the executing program to standard output ...

Page 119

... ZISIM Commands Copyright © 1999-2003 by LSI Logic Corporation. All rights reserved. Description Disables specified breakpoint. Disables run-time instruction tracing. Disables run-time warning messages such as uninitialized memory accesses or invalid circular buffer size. range to a text file. ...

Page 120

... ZSP SDK Functional-Accurate Simulator Copyright © 1999-2003 by LSI Logic Corporation. All rights reserved. Description Pass arg1 to argn to the program as run- time arguments. Assigns value to specified attribute. Creates a new breakpoint at the specified PC address. Creates a new breakpoint at the specified label ...

Page 121

... ZISIM Commands Copyright © 1999-2003 by LSI Logic Corporation. All rights reserved. Description Set internal instruction or internal data memory size starting from 0. Default size is maximum value of 0xF800 words. ...

Page 122

... You specify internal or external memory, the starting address, and the size of the region to clear. Format – clear imem {int|ext} addr size Example – zisim{32} clear imem ext 0x7000 0x1000 7-8 ZSP SDK Functional-Accurate Simulator Copyright © 1999-2003 by LSI Logic Corporation. All rights reserved. show reg r0 ...

Page 123

... You specify internal or external memory, the starting address, and the size of the region to dump. Format – dump dmem {int|ext} filename addr size ZISIM Commands Copyright © 1999-2003 by LSI Logic Corporation. All rights reserved. 7-9 ...

Page 124

... ZSP SDK Functional-Accurate Simulator Copyright © 1999-2003 by LSI Logic Corporation. All rights reserved. /* 0x0000 */ /* 0x0001 */ /* 0x0002 */ /* 0x0003 */ /* 0x0004 */ /* 0x0005 */ /* 0x0006 */ /* 0x00fd */ /* 0x00fe */ /* 0x00ff */ /* 0x1000 */ /* 0x1001 */ /* 0x1002 */ ...

Page 125

... Direction: direction for a discontinuity instruction such as branch or conditional execution. Direction is either forward, or backward and the result is either taken or not taken. For example, (1) 0x000002 6200 mov %fmode, r0 Instruction mov %fmode, r0 modifies %fmode to value 0x0014. ZISIM Commands Copyright © 1999-2003 by LSI Logic Corporation. All rights reserved. !fmode=0x0014 7-11 ...

Page 126

... This command allows you to specify internal or external memory, the starting address, and the size of the region to fill. 7-12 ZSP SDK Functional-Accurate Simulator Copyright © 1999-2003 by LSI Logic Corporation. All rights reserved. ...

Page 127

... Data must be in hex format without 0x prefix. Comments must be enclosed characters. Format – load dmem {int|ext} filename addr size ZISIM Commands Copyright © 1999-2003 by LSI Logic Corporation. All rights reserved. 7-13 ...

Page 128

... Data must be in hex format without the 0x prefix. Comments must be enclosed characters. Format – load imem {int|ext} filename addr size 7-14 ZSP SDK Functional-Accurate Simulator Copyright © 1999-2003 by LSI Logic Corporation. All rights reserved. /* 0x0000 */ /* 0x0001 */ /* 0x0002 */ /* 0x0003 */ /* 0x0004 */ ...

Page 129

... Note: ZISIM Commands Copyright © 1999-2003 by LSI Logic Corporation. All rights reserved. /* 0x0000 */ /* 0x0001 */ /* 0x0002 */ /* 0x0003 */ /* 0x0004 */ /* 0x0005 */ /* 0x0006 */ /* 0x0007 */ zisimg2 does not support the soft reset feature ...

Page 130

... Sample Script File – A simple script is shown following. # This example script demonstrates how to turn on # instruction tracing using a command. load test.exe enable trace write run exit 7-16 ZSP SDK Functional-Accurate Simulator Copyright © 1999-2003 by LSI Logic Corporation. All rights reserved. ...

Page 131

... Format – set break pc addr set break symbol label Example – zisim{2} set break pc 0x0010 ZISIM Commands Copyright © 1999-2003 by LSI Logic Corporation. All rights reserved. Configurable ZISIM Attributes Value Description any integer Number of commands to maintain in history buffer. ...

Page 132

... This command sets the size of internal data memory to 16 Kwords. zisim{32} set size imem 0x4000 This command sets the size of internal instruction memory to 16 Kwords 7-18 ZSP SDK Functional-Accurate Simulator Copyright © 1999-2003 by LSI Logic Corporation. All rights reserved. ...

Page 133

... This command displays the bit and field values for the specified register. Do not use the % specifier for control registers. ZISIM Commands Copyright © 1999-2003 by LSI Logic Corporation. All rights reserved. 7-19 ...

Page 134

... PC 0xf9b9 7.2.29 show dmem This command displays a range of internal or external data memory. You must specify internal or external memory, the starting address, and the 7-20 ZSP SDK Functional-Accurate Simulator Copyright © 1999-2003 by LSI Logic Corporation. All rights reserved. er: 0 ex gt: 0 ...

Page 135

... Table 7.8 Argument {int | ext} addr size Format – show imem {int|ext} [addr] [size] Example – ZISIM Commands Copyright © 1999-2003 by LSI Logic Corporation. All rights reserved. Table 7.7. Default Arguments for show dmem Value int 0x0 16 Table Default Arguments for show imem ...

Page 136

... Like set size, this command is slightly different for the two ZSP architectures. 7.2.32.1 zisim400 This command shows the size of internal data or instruction memory. The output is not affected by the radix attribute. 7-22 ZSP SDK Functional-Accurate Simulator Copyright © 1999-2003 by LSI Logic Corporation. All rights reserved. ...

Page 137

... Examples – zisim{32} show stats zisim{32} show stats opcode 7.2.34 show trace This command shows currently enabled/disabled trace information. Traces currently set to ON are enabled during simulation. ZISIM Commands Copyright © 1999-2003 by LSI Logic Corporation. All rights reserved. 7-23 ...

Page 138

... This command deletes an alias. (Use the alias command to display a list of currently defined aliases.) Format – unalias alias Example – zisim{32} unalias adv 7-24 ZSP SDK Functional-Accurate Simulator Copyright © 1999-2003 by LSI Logic Corporation. All rights reserved. OFF OFF OFF OFF ...

Page 139

... The simulator defines two serial ports and one host processor interface (HPI) port. Each port has a transmit buffer and a receive buffer. corresponding files for the I/O ports for the LSI402ZX, LSI403Z, and ZSP400-core based devices. Table 7.9 I/O Port ...

Page 140

... The simulator output following demonstrates use of the PC breakpoint: a breakpoint is set for address 0x10 and the simulator advances until the PC reaches address 0x10. 7-26 ZSP SDK Functional-Accurate Simulator Copyright © 1999-2003 by LSI Logic Corporation. All rights reserved. r12, 0xfb r12, 0xf7 r13, 0x0 r4, 0x60 ...

Page 141

... Example Session Using ZISIM Copyright © 1999-2003 by LSI Logic Corporation. All rights reserved. r12, 0xfb ! r12, 0xf7 ! r13, 0x0 ! r4, 0x60 ! r4, 0x0 ! ...

Page 142

... Terminate the simulation session with the exit command. zisim{10}> exit ***(info) Exiting ZISIM. 7-28 ZSP SDK Functional-Accurate Simulator Copyright © 1999-2003 by LSI Logic Corporation. All rights reserved. ( 2.23%) ( 9.36%) ( 1.49%) ( 39.68% of conditional branch) ...

Page 143

... Commands,” page “Debugger.“ Table 8.1 ZSP Software Development Kit User’s Guide Copyright © 1999-2003 by LSI Logic Corporation. All rights reserved. Section 8.2, “ZSIM 8-6. For the debugger target ZSIM, see shows available cycle-accurate simulators. ...

Page 144

... Refer also to 8-2 ZSP SDK Cycle-Accurate Simulator Copyright © 1999-2003 by LSI Logic Corporation. All rights reserved. Cycle-Accurate Simulators Use when Simulating... code written for ZSP400 architecture. code written for ZSPG2 architecture. Section 8.2.26, “script,” page ...

Page 145

... An example interactive simulation session is described in “Example Session Using ZSIM” description of using ZSIM as the target of the SDK Debugger in Section 9.2.2, “Cycle-Accurate Simulator Connection,” page Using ZSIM Copyright © 1999-2003 by LSI Logic Corporation. All rights reserved. Table 8.2). Section 8.2, “ZSIM Commands” on page 8-40 ...

Page 146

... ZSP SDK Cycle-Accurate Simulator Copyright © 1999-2003 by LSI Logic Corporation. All rights reserved. Description Invokes the simulator in noninteractive mode. Specifies maximum cycle count. Execution terminated after num cycles. Prints brief usage summary. value. The control register is written without its usual percent (%) sign, and there are no spaces around the equal sign (=) ...

Page 147

... Uses a different memory subsystem library LIBNAME other than default. The default library is libzmiug2. -cpilib LIBNAME Uses coprocessor library LIBNAME. SDK tools come with an example G711 coprocessor library called libzcpig711.so on Solaris or libzcpig711.dll on Windows platforms. Using ZSIM Copyright © 1999-2003 by LSI Logic Corporation. All rights reserved. 8-5 ...

Page 148

... ZSP SDK Cycle-Accurate Simulator Copyright © 1999-2003 by LSI Logic Corporation. All rights reserved. Table 8.5 and in detail in Description Creates alias (tag) for command sequence. Clears specified breakpoint. Invalidates data cache. Clears internal or external data memory ...

Page 149

... Dumps internal or external data dump dmem {int | ext} filename addr size Dumps internal or external imem (Sheet ZSIM Commands Copyright © 1999-2003 by LSI Logic Corporation. All rights reserved. Description Disables specified breakpoint. Disables data unit profile information. Disables instruction unit profile information. ...

Page 150

... ZSP SDK Cycle-Accurate Simulator Copyright © 1999-2003 by LSI Logic Corporation. All rights reserved. Description Enables breakpoint. Enables data unit profile. Enables instruction unit profile. Enables load store unit profile. Enables pipeline unit profile. Enables resource profile. ...

Page 151

... ZSIM Commands Copyright © 1999-2003 by LSI Logic Corporation. All rights reserved. Description Runs for specified number of simulation cycles. Loads and executes ZSIM script file. Passes arg1 to argn to the program as run-time arguments. ...

Page 152

... ZSP SDK Cycle-Accurate Simulator Copyright © 1999-2003 by LSI Logic Corporation. All rights reserved. Description attribute. Displays the bit-level states for the specified register. Shows list of defined breakpoints. x Show data cache contents. Shows contents of a region of internal/external data memory ...

Page 153

... The breakpoint number is assigned when a breakpoint is set. Use the show break command to display a list of breakpoints. Format – clear break breakpoint_number ZSIM Commands Copyright © 1999-2003 by LSI Logic Corporation. All rights reserved. Description Advances simulation by one cycle. Same as run 1. Deletes alias. ...

Page 154

... Example – zsim{32} clear dmem int 0x1000 0x0100 8.2.5 clear icache This command clears the contents of the instruction cache. Format – clear icache Example – zsim{32} clear icache 8-12 ZSP SDK Cycle-Accurate Simulator Copyright © 1999-2003 by LSI Logic Corporation. All rights reserved. ...

Page 155

... This command disables a breakpoint from the current list of active breakpoints. (Use the show break command to display current list.) Format – disable break breakpoint_number Example – zsim{32} disable break 4 ZSIM Commands Copyright © 1999-2003 by LSI Logic Corporation. All rights reserved. 8-13 ...

Page 156

... Example – zsim{32} dump dmem ext data.dat 0x0000 0x100 8-14 ZSP SDK Cycle-Accurate Simulator Copyright © 1999-2003 by LSI Logic Corporation. All rights reserved. Section 8.2.14, “enable profile,” page Section 8.2.15, “enable trace,” page 8-16. 8-19. ...

Page 157

... This command enables a breakpoint from the current list of defined breakpoints. See of how to create a breakpoint. ZSIM Commands Copyright © 1999-2003 by LSI Logic Corporation. All rights reserved. /* 0x0000 */ /* 0x0001 */ /* 0x0002 */ /* 0x0003 */ /* 0x0004 */ /* 0x0005 */ /* 0x0006 */ /* 0x00fd */ /* 0x00fe */ ...

Page 158

... Unit). The PFU_AGN line displays agn status for the loop awakening logic. The next line shows the state of the cl_unv (cache-line unavailable) and cl_disc_unv (cache-line discontinuity unavailable) 8-16 ZSP SDK Cycle-Accurate Simulator Copyright © 1999-2003 by LSI Logic Corporation. All rights reserved. IU_IMEM_READ : address ICACHE hits : address Table ...

Page 159

... The third number, in hexadecimal, is the instruction address. The last column shows the unit in which the instruction is executed. ZSIM Commands Copyright © 1999-2003 by LSI Logic Corporation. All rights reserved. Description Default condition. Prefetch queue is full or memory subsystem asserts retry for a request ...

Page 160

... MSS (memory subsystem) or needs to be retried. The <insn#> field is the sequence number of the instruction associated with the action. The <cond-cycle#> field 8-18 ZSP SDK Cycle-Accurate Simulator Copyright © 1999-2003 by LSI Logic Corporation. All rights reserved. Table 8.7. The <addr> field describes the ...

Page 161

... PC Opcode Store Instruction ! [Memory-Address]=value <cycle> (seqID) PC Opcode Load Instruction ! register=value [Memory-Address] <cycle> (seqID) PC Opcode Branch Instruction ! direction, result ZSIM Commands Copyright © 1999-2003 by LSI Logic Corporation. All rights reserved. LSU Output Description Description Request a read from MSS. Request a write to MSS. ...

Page 162

... Displays the entire instruction cache in every cycle. See show icache command for output description. This command is valid only for G2. pipe Displays the entire pipeline in every cycle. See show pipe command for output description 8-20 ZSP SDK Cycle-Accurate Simulator Copyright © 1999-2003 by LSI Logic Corporation. All rights reserved. fmode=0x0014 ...

Page 163

... This command fills the internal or external instruction memory range with the specified value. Format – fill imem {int|ext} addr size value ZSIM Commands Copyright © 1999-2003 by LSI Logic Corporation. All rights reserved. enable trace {mem|pipe|reg|write} zsim{32} enable trace write 8-21 ...

Page 164

... For zsimg2, you can specify the number of instructions to be executed. Format – istep or is Examples – zsim{22}> istep CYCLE=000012 PC=0x200c 0x2008 mov zsim{23}> is CYCLE=000012 PC=0x200c 8-22 ZSP SDK Cycle-Accurate Simulator Copyright © 1999-2003 by LSI Logic Corporation. All rights reserved. rpc, r13 ...

Page 165

... Example – zsim{32} load dmem int data.dat 0x1000 20 The format of the file is: %cat data.dat 2ce5 3c3f 2000 3006 a00f 80c0 ... ZSIM Commands Copyright © 1999-2003 by LSI Logic Corporation. All rights reserved. r5, 0x10 r5, 0x20 r5 r13, rpc /* 0x0000 */ /* 0x0001 */ /* 0x0002 */ /* 0x0003 */ /* 0x0004 */ /* 0x0005 */ 8-23 ...

Page 166

... Example – % cat inst.txt 2ce5 3c3f 2000 3006 a00f 80c0 bc4c 6f4c zsim{32} load imem int imem.txt 0x1000 8 8-24 ZSP SDK Cycle-Accurate Simulator Copyright © 1999-2003 by LSI Logic Corporation. All rights reserved. /* 0x0000 */ /* 0x0001 */ /* 0x0002 */ /* 0x0003 */ /* 0x0004 */ /* 0x0005 */ /* 0x0006 */ /* 0x0007 */ ...

Page 167

... Examples – zsim{32} run zsim{32} run 100 ZSIM Commands Copyright © 1999-2003 by LSI Logic Corporation. All rights reserved. The reset command does not reload the program into memory. To restart the program, perform one of the follow- ing sequence of commands: zsimg2 no longer supports the soft reset feature. ...

Page 168

... This command allows you to set three internal ZSIM attributes. These configurable attributes are described in 8-26 ZSP SDK Cycle-Accurate Simulator Copyright © 1999-2003 by LSI Logic Corporation. All rights reserved. The same script can be invoked as a command-line argu- ment to the simulator as shown following. %zsim400 -s standard.scr or %zsimg2 -s standard ...

Page 169

... Use the show break command to display a list of current breakpoints. Format – set break pc addr set break symbol label ZSIM Commands Copyright © 1999-2003 by LSI Logic Corporation. All rights reserved. Configurable ZSIM Attributes Value Description any integer Number of commands to maintain in history buffer ...

Page 170

... For example, wait state equals 2 means that data is returned 2 cycles after it is requested. Format – set latency {imem | dmem} {int | ext} num Example – zsim{1} set latency dmem int 10 zsim{2} set latency dmem ext 20 8-28 ZSP SDK Cycle-Accurate Simulator Copyright © 1999-2003 by LSI Logic Corporation. All rights reserved. ...

Page 171

... Mwords). A word is a 16-bit value for the ZSPG2 architecture. ZSIM Commands Copyright © 1999-2003 by LSI Logic Corporation. All rights reserved. This command does not apply to external memory. (The simulator has 1 Mwords for each external instruction and external data memory.) ...

Page 172

... When specifying control registers, do not include the percent (%) sign. Format – show bits register Example – zsim{32} show bits hwflag hwflag = 0x0000 8-30 ZSP SDK Cycle-Accurate Simulator Copyright © 1999-2003 by LSI Logic Corporation. All rights reserved. er: 0 ex gt gsv: 0 ...

Page 173

... R14 - D$[ 3]: ------ I ------ ------ ------ ------ R14 - D$[ 4]: ------ I ------ ------ ------ ------ R14 - D$[ 5]: ------ I ------ ------ ------ ------ R15 - D$[ 6]: ------ I ------ ------ ------ ------ R15 - D$[ 7]: ------ I ------ ------ ------ ------ R15 - D$[ 8]: ------ I ------ ------ ------ ------ UL - D$[ 9]: ------ I ------ ------ ------ ------ UL - D$[10]: ------ I ------ ------ ------ ------ UL - D$[11]: ------ I ------ ------ ------ ------ UL - D$[12]: ------ I ------ ------ ------ ------ UL - D$[13]: ------ I ------ ------ ------ ------ UL - D$[14]: ------ I ------ ------ ------ ------ UL - D$[15]: ------ I ------ ------ ------ ------ UL - D$[16]: ------ I ------ ------ ------ ------ ZSIM Commands Copyright © 1999-2003 by LSI Logic Corporation. All rights reserved. sv 8-31 ...

Page 174

... The default settings for the show dmem command are shown in Table 8.9 Argument {int | ext} addr size 8-32 ZSP SDK Cycle-Accurate Simulator Copyright © 1999-2003 by LSI Logic Corporation. All rights reserved. Table 8.9. Default Arguments for show dmem Value int 0x0 16 ...

Page 175

... The default settings for the show imem command are shown in Table 8.10. Table 8.10 Argument {int | ext} addr size ZSIM Commands Copyright © 1999-2003 by LSI Logic Corporation. All rights reserved. Default Arguments for show imem Value int 0x0 16 8-33 ...

Page 176

... F (Fetch/decode), G (Group), R (Read), E (Execute), and W (Write Back) – followed by two integers representing the number of instructions currently in that stage and the number of instructions that advance to the next stage in the following cycle. 8-34 ZSP SDK Cycle-Accurate Simulator Copyright © 1999-2003 by LSI Logic Corporation. All rights reserved. ...

Page 177

... F(4:2) (13)000d:5448:0:mac2.a (12)000c:788f:0:lddu (11)000b:784e:1:lddu (10)000a:9a00:1:xor.e ------------------------------------------ G(4:2) ZSIM Commands Copyright © 1999-2003 by LSI Logic Corporation. All rights reserved. shows all three possible stalls for G2. Description Full pipe stall occurs by the indicated instruction number. Pipe stalls from AG and up. Pipe stalls from M0 and up. ...

Page 178

... All address and index registers for the ZSPG2 architecture. Thus specific for zsimg2. 8-36 ZSP SDK Cycle-Accurate Simulator Copyright © 1999-2003 by LSI Logic Corporation. All rights reserved. r13, 0x18 r15, 0x0 r13, 0x1 r14, 0x0 fmode, 2 ...

Page 179

... This command shows the size of internal data or instruction memory. The output is not affected by the radix attribute. ZSIM Commands Copyright © 1999-2003 by LSI Logic Corporation. All rights reserved. (%) sign.] r4.e, r8.e r8.e, r15, 2 r4.e, r14 ...

Page 180

... Supported trace information: - Instruction trace: OFF - Pipeline trace: - Register trace: - Memory trace: zsim{33} enable trace pipe ***(info) Pipeline trace is ON. 8-38 ZSP SDK Cycle-Accurate Simulator Copyright © 1999-2003 by LSI Logic Corporation. All rights reserved. OFF OFF OFF ...

Page 181

... The simulator defines two serial ports and one host processor interface (HPI) port. Each port has a transmit buffer and a receive buffer. corresponding files for the I/O ports for the LSI402ZX, LSI403Z, and ZSP400-core based devices. I/O Port Usage Copyright © 1999-2003 by LSI Logic Corporation. All rights reserved. ...

Page 182

... ZSP SDK Cycle-Accurate Simulator Copyright © 1999-2003 by LSI Logic Corporation. All rights reserved. I/O Device Memory Map and Associated Files Read Address File 0xF901 sp0in 0xFA01 ...

Page 183

... R13 - D$[ 2]: ------ I ------ ------ ------ ------ R14 - D$[ 3]: ------ I ------ ------ ------ ------ R14 - D$[ 4]: ------ I ------ ------ ------ ------ R14 - D$[ 5]: ------ I ------ ------ ------ ------ R15 - D$[ 6]: ------ I ------ ------ ------ ------ R15 - D$[ 7]: ------ I ------ ------ ------ ------ R15 - D$[ 8]: ------ I ------ ------ ------ ------ UL - D$[ 9]: ------ I ------ ------ ------ ------ UL - D$[10]: ------ I ------ ------ ------ ------ UL - D$[11]: ------ I ------ ------ ------ ------ UL - D$[12]: ------ I ------ ------ ------ ------ UL - D$[13]: ------ I ------ ------ ------ ------ Example Session Using ZSIM Copyright © 1999-2003 by LSI Logic Corporation. All rights reserved. r13, 0x0 r4, 0x60 8-41 ...

Page 184

... Breakpoint address 0x2010 of main zsim{9}> enable trace write ***(info) Instruction trace is ON. zsim{10}> run 8-42 ZSP SDK Cycle-Accurate Simulator Copyright © 1999-2003 by LSI Logic Corporation. All rights reserved. r5, r4, 0 r5, 0x1 r5, r4 r4, 0x0 r4, 0x60 r13, 0x0 ...

Page 185

... CYCLE=000027 PC=0x20dc CYCLE: 27 ------------------------------------------ F(4:3) (33)20ea:bc34:0:mov (32)20e9:6f7c:1:stu (31)20e8:b910:1:mov (30)20e7:6b2c:1:stdu ------------------------------------------ G(4:3) (29)20e6:3d00:0:movh Example Session Using ZSIM Copyright © 1999-2003 by LSI Logic Corporation. All rights reserved. r12, 0xfb ! r12, 0xf7 ! r13, 0x0 ! r4, 0x60 ! r4, 0x0 ! r5 ...

Page 186

... DSP’s %smode control register. A simulation session is terminated with the exit command. zsim{12}> exit ***(info) Exiting ZSIM. %_ 8-44 ZSP SDK Cycle-Accurate Simulator Copyright © 1999-2003 by LSI Logic Corporation. All rights reserved. r0.e, r12, -2 r13, 0x68 0x20e4 r6, 0x3 r5, r12, 2 r6, r12 r13, r12, -1 ...

Page 187

... GNU command-line interface, available for all platforms. 9.1 Using the Debugger The debugger is invoked from the command line as follows: <debugger name> [options] [executable_file] ZSP Software Development Kit User’s Guide Copyright © 1999-2003 by LSI Logic Corporation. All rights reserved. This chapter 9-1 ...

Page 188

... For example, to target the cycle-accurate simulator: 9-2 Debugger Copyright © 1999-2003 by LSI Logic Corporation. All rights reserved. Debugger Names code written for devices based on the ZSP400 architecture. code originally written for devices based on the ZSP400 architecture, but cross-compiled for the ZSPG2 architecture ...

Page 189

... Target commands that change the behavior of the subordinate ZISIM instance controlled by the SDK debugger are listed in described in detail in The format for sending commands to ZISIM is: Debugger Execution Environments Copyright © 1999-2003 by LSI Logic Corporation. All rights reserved. Section 7.2, “ZISIM Commands,” page Table 7.2 on Table 9.3 and 7-4 ...

Page 190

... With this connection, the cycle-accurate simulator (ZSIM) executes your program under the control of the debugger. The debugger examines the simulator state to process queries from the user. 9-4 Debugger Copyright © 1999-2003 by LSI Logic Corporation. All rights reserved. Description Resets the statistics. 1 Closes file filename. ...

Page 191

... Debugger Execution Environments Copyright © 1999-2003 by LSI Logic Corporation. All rights reserved. Section 8.2, “ZSIM Commands,” page Description Resets the general statistics. 1 Closes file filename. Displays the list of simulator commands that can be invoked. ...

Page 192

... The optional arguments only work in sdbug400. zdbug and zdxbug only supports the display of the grouping rules that are currently active. 9-6 Debugger Copyright © 1999-2003 by LSI Logic Corporation. All rights reserved. Description Prints instruction opcode history to stdout. Prints contents of the pipeline to stdout. ...

Page 193

... To use this connection, your target evaluation board must be able to support UART-based debugging with appropriate hardware and firmware. In addition, your target must be booted from flash memory that Debugger Execution Environments Copyright © 1999-2003 by LSI Logic Corporation. All rights reserved. 9-7 ...

Page 194

... Note: The JTAG target is invoked by the following commands: (sdbug) jtag set_clk (sdbug) target jtag 9-8 Debugger Copyright © 1999-2003 by LSI Logic Corporation. All rights reserved. Table 9.5 to communicate with the target board Description Close file filename. List UART connection commands. Specify the maximum number of files that can be opened at the same time ...

Page 195

... This command may also be invoked without the target name. See Specific Commands” on page Debugger Execution Environments Copyright © 1999-2003 by LSI Logic Corporation. All rights reserved. Table 9.6 Description Close file filename. List JTAG commands. Sets the JTAG clock according to the JTAG interface in question ...

Page 196

... Important: Important: 9-10 Debugger Copyright © 1999-2003 by LSI Logic Corporation. All rights reserved. All breakpoints must be disabled before using hard- ware-assisted debugging. Only one hardware breakpoint may be set, and when it is set, any previously-set break- point is deactivated. You cannot perform I/O during hard- ware-assisted debugging ...

Page 197

... Debugger Execution Environments Copyright © 1999-2003 by LSI Logic Corporation. All rights reserved. Section 9.6.2, “Example 2,” page Description Enable hardware-assisted debugging. Resume execution. Step n cycles. Set a breakpoint when executing an instruction at addr. Set a breakpoint when storing to addr. ...

Page 198

... Debugger Copyright © 1999-2003 by LSI Logic Corporation. All rights reserved. Description Set external breakpoint. Disable external breakpoint. Set a breakpoint when storing to addr. Disables hardware data address breakpoint. Set a breakpoint when storing the value data. Disables hardware data value breakpoint. ...

Page 199

... Debugger Commands – Special Cases Copyright © 1999-2003 by LSI Logic Corporation. All rights reserved. Description Resumes the AHB clock without restarting the core. Makes AHB clock stop when hardware breakpoints are hit. ...

Page 200

... Group (G), the instruction may read the old value. Also, using the ZSIM set to modify a 9-14 Debugger Copyright © 1999-2003 by LSI Logic Corporation. All rights reserved. for details. Section 3.2, “Compiler ...