Part Number Hot Search : 
ENA1238 3132W2 1100B FB2425N7 51003 1014A STPS2 Q208I
Product Description
Full Text Search
 

To Download DSPS56SIMUM Datasheet File

  If you can't view the Datasheet, Please click here to try to view without PDF Reader .  
 
 


  Datasheet File OCR Text:
  DSPS56SIMUM/d document rev. 3.0, 07/1999 suite56? dsp simulator users manual, release 6.3 f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
suite56, once, and mfax are trademarks of motorola, inc. motorola reserves the right to make changes without further notice to any products herein. motorola makes no warranty, representation or guarantee regarding the suitability of its products for any particular purpose, nor does motorola assume any liability arising out of the application or use of any product or circuit, and specifically disclaims any and all liability, including without limitation consequential or incidental damages. typical parameters which may be provided in motorola data sheets and/or specifications can and do vary in different applications and actual performance may vary over time. all operating parameters, including typicals must be validated for each customer application by customers technical experts. motorola does not convey any license under its patent rights nor the rights of others. motorola products are not designed, intended, or authorized for use as components in systems intended for surgical implant into the body, or other applications intended to support life, or for any other application in which the failure of the motorola product could create a situation where personal injury or death may occur. should buyer purchase or use motorola products for any such unintended or unauthorized application, buyer shall indemnify and hold motorola and its officers, employees, subsidiaries, affiliates, and distributors harmless against all claims, costs, damages, and expenses, and reasonable attorney fees arising out of, directly or indirectly, any claim of personal injury or death associated with such unintended or unauthorized use, even if such claim alleges that motorola was negligent regarding the design or manufacture of the part. motorola and are registered trademarks of motorola, inc. motorola, inc. is an equal opportunity/affirmative action employer. all other tradenames, trademarks, and registered trademarks are the property of their respective owners. ? copyright motorola, inc., 1999. all rights reserved. f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
motorola iii chapter 1 introduction & getting started 1.1 introduction to motorolas suite56? dsp simulator ..................... 1-1 1.2 dsp simulator features ............................................ 1-2 1.3 entering commands ............................................... 1-2 1.4 getting started with the dsp simulator . . . ............................ 1-3 1.5 setting and clearing the path ........................................ 1-4 1.6 loading object files .............................................. 1-6 1.7 setting up the display environment .................................. 1-7 1.8 using a watch list. ............................................... 1-9 1.9 setting and modifying breakpoints .................................. 1-10 1.10 starting the execution of instructions with go ......................... 1-13 chapter 2 controlling execution 2.1 starting the execution of instructions with go .......................... 2-1 2.2 step through instructions ......................................... 2-1 2.3 trace the execution of instructions ................................. 2-2 2.4 executing the next instruction ..................................... 2-3 2.5 providing an until condition ...................................... 2-4 2.6 pausing execution with wait ...................................... 2-5 2.7 allowing the current function to finish after an until condition or a breakpoint .......................... 2-6 2.8 stopping program execution ........................................ 2-7 2.9 resetting the device .............................................. 2-7 chapter 3 object files and data files 3.1 displaying the current path ....................................... 3-1 3.2 saving object files ............................................... 3-3 table of contents f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
iv suite56 dsp simulator users manual motorola chapter 4 managing memory and registers 4.1 displaying register values ......................................... 4-1 4.2 changing register values .......................................... 4-3 4.3 displaying memory values ......................................... 4-3 4.4 changing memory values .......................................... 4-5 4.5 copying memory from one block to another .......................... 4-6 4.6 disassembling code stored in memory . . . ............................ 4-7 4.7 displaying a history of recent instructions ............................ 4-8 chapter 5 device i/o and peripheral simulation 5.1 introduction to device i/o (input/output) . ............................ 5-1 5.2 how are i/o files formatted? ...................................... 5-1 5.3 repeat punctuation ............................................... 5-2 5.4 comments ...................................................... 5-2 5.5 timing information ............................................... 5-3 5.6 peripheral data . . . ............................................... 5-3 5.7 port data ....................................................... 5-4 5.8 memory data .................................................... 5-5 5.9 pin or pin group data ............................................. 5-6 5.10 terminal input of data values ...................................... 5-7 5.11 assigning an input file ............................................ 5-8 5.12 assigning an output file .......................................... 5-11 chapter 6 simulator and device configurations 6.1 introduction to simulator configuration . . . ............................ 6-1 6.2 setting the default device ........................................ 6-2 6.3 changing the radix ............................................... 6-2 6.4 loading simulator state files ....................................... 6-4 6.5 changing and saving window preferences ............................ 6-6 f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
motorola v chapter 7 debugging c source code 7.1 introduction to debugging c source code . ............................ 7-1 7.2 displaying the call stack .......................................... 7-1 7.3 moving up and down the call stack ................................. 7-2 7.4 dynamically displaying c function calls . ............................ 7-4 7.5 enabling/disabling i/o streams ..................................... 7-5 7.6 redirecting an i/o stream .......................................... 7-5 7.7 display the type of a c variable or expression ......................... 7-6 chapter 8 macros, scripts and log files 8.1 creating and running a command macro . ............................ 8-1 8.2 logging output from the session window . ............................ 8-2 chapter 9 expressions 9.1 introduction to expressions ......................................... 9-1 9.2 evaluate expressions .............................................. 9-1 9.3 using memory space symbols ...................................... 9-2 9.4 using register name symbols ...................................... 9-2 9.5 using assembler debug symbols .................................... 9-3 9.6 using constants . . . ............................................... 9-4 9.7 numeric constants. ............................................... 9-4 9.8 operators in expressions ........................................... 9-5 9.9 operator precedence .............................................. 9-7 9.10 setting up and modifying a watch list . . . ............................ 9-8 chapter 10 simulator tool bar 10.1 using the tool bar. .............................................. 10-1 10.2 go button ...................................................... 10-2 10.3 stop button .................................................... 10-2 10.4 step button .................................................... 10-3 10.5 next button .................................................... 10-4 10.6 finish button ................................................... 10-5 10.7 device button .................................................. 10-6 10.8 repeat button .................................................. 10-7 10.9 reset button .................................................... 10-8 f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
vi suite56 dsp simulator users manual motorola chapter 11 displaying information 11.1 display the current breakpoints .................................... 11-1 11.2 displaying the radix ............................................. 11-2 11.3 command window .............................................. 11-2 11.4 session window . . .............................................. 11-4 11.5 assembly window. .............................................. 11-5 11.6 source window . . . .............................................. 11-6 11.7 stack window .................................................. 11-7 chapter 12 command reference 12.1 command overview ............................................. 12-1 12.2 command syntax. . .............................................. 12-4 12.3 command parameters: list of abbreviations .......................... 12-5 12.4 asm - single line interactive assembler. . . ........................... 12-7 12.5 break - set, modify, or clear breakpoint . . ........................... 12-8 12.6 change - change register or memory value ......................... 12-13 12.7 copy - copy a memory block ..................................... 12-14 12.8 device - multiple device simulation ................................ 12-15 12.9 disassemble - object code disassembler . . .......................... 12-16 12.10 display - display register or memory ............................... 12-17 12.11 down - move down the c function call stack ........................ 12-19 12.12 evaluate - evaluate an expression .................................. 12-20 12.13 finish - execute until end of current subroutine ...................... 12-21 12.14 frame - select c function call stack frame .......................... 12-21 12.15 go - execute dsp program ....................................... 12-22 12.16 help - simulator help text ....................................... 12-23 12.17 history -disassemble previously executed instruction .................. 12-24 12.18 input - assign input file ......................................... 12-24 12.19 list - list source file lines ....................................... 12-27 12.20 load - load dsp files or configuration . . . .......................... 12-28 12.21 log - log commands, session, profile .............................. 12-30 12.22 more - enable/disable session paging control ........................ 12-31 12.23 next- step over subroutine calls or macros .......................... 12-32 12.24 output - assign output file ....................................... 12-33 12.25 path - specify default pathname ................................... 12-35 12.26 quit - quit simulator session ...................................... 12-36 12.27 radix - change input or display radix .............................. 12-36 f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
motorola vii 12.28 redirect - redirect stdin/stdout/stderr for c programs ................... 12-38 12.29 reset - reset device or state ...................................... 12-39 12.30 save - save simulator file ........................................ 12-40 12.31 step - step through dsp program .................................. 12-41 12.32 streams - enable/disable handling of i/o for c programs ............... 12-42 12.33 system - execute system command ................................ 12-43 12.34 trace - trace through dsp program ................................ 12-44 12.35 type - display the result type of c expression ....................... 12-45 12.36 unlock - unlock password protected device type ..................... 12-46 12.37 until - execute until address ..................................... 12-46 12.38 up - move up the c function call stack . . .......................... 12-47 12.39 view - select display mode ....................................... 12-47 12.40 wait - wait specified time ....................................... 12-48 12.41 wasm - gui assembly window .................................... 12-48 12.42 watch - set, modify, view, or clear watch item ...................... 12-49 12.43 wbreakpoint - gui breakpoint window . . . .......................... 12-50 12.44 wcalls - gui c calls stack window ................................ 12-50 12.45 wcommand - gui command window ............................... 12-51 12.46 where - gui c calls stack window ................................ 12-51 12.47 winput - gui file input window ................................... 12-52 12.48 wlist - gui list window .......................................... 12-52 12.49 wmemory - gui memory window ................................. 12-53 12.50 woutput - gui file output window ................................. 12-54 12.51 wregister - gui register window .................................. 12-54 12.52 wsession - gui session window ................................... 12-55 12.53 wsource - gui source window .................................... 12-55 12.54 wstack - gui stack window ...................................... 12-56 12.55 wwatch - gui watch window ..................................... 12-56 f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
viii suite56 dsp simulator users manual motorola chapter 13 c library functions 13.1 c object libraries . .............................................. 13-2 13.2 simulator object library entry points ............................... 13-2 13.3 simulator external memory functions .............................. 13-21 13.4 simulator screen management functions . . .......................... 13-26 13.5 non-display simulator .......................................... 13-31 13.6 multiple device simulation ....................................... 13-33 13.7 reserved function names ........................................ 13-36 13.8 simulator global variables ....................................... 13-36 13.9 modification of simulator global structures ......................... 13-36 13.10 modification of device global structures. . .......................... 13-37 f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
motorola ix 1-1 list of operators ........................................... 1-11 1-2 breakpoint actions ......................................... 1-12 5-1 repeat punctuation input data ................................. 5-2 5-2 input memory data .......................................... 5-6 5-3 pin or pin group input data ................................... 5-7 5-4 terminal input data ......................................... 5-8 9-1 valid forms of symbol names and line numbers ................. 9-3 12-1 command syntax elements in motorola dsp documentation ....... 12-4 12-2 command parameter abbreviations . ........................... 12-5 12-3 asm commands ............................................ 12-7 12-4 breakpoint operators ....................................... 12-9 12-6 break_action parameters ................................... 12-10 12-5 flag variables in a breakpoint expression ...................... 12-10 12-7 break commands ....................................... 12-12 12-8 change commands ...................................... 12-13 12-9 copy commands ......................................... 12-14 12-10 device command ....................................... 12-15 12-11 disassemble commands ................................ 12-16 12-12 display enable keywords ................................ 12-17 12-13 display commands ..................................... 12-18 12-14 display commands without enable keywords ................ 12-18 12-15 down commands ........................................ 12-19 12-16 evaluate commands ................................... 12-20 12-17 frame commands ....................................... 12-21 12-18 go commands ........................................... 12-22 12-19 help syntax ............................................ 12-23 12-20 list of help topic keywords ................................ 12-23 list of tables f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
x suite56 dsp simulator users manual motorola 12-21 input commands ........................................ 12-25 12-22 list commands .......................................... 12-27 12-23 load commands ........................................ 12-29 12-24 log commands .......................................... 12-31 12-25 more commands ........................................ 12-31 12-26 next commands ........................................ 12-32 12-27 output commands ...................................... 12-34 12-28 path commands ......................................... 12-35 12-29 quit commands ......................................... 12-36 12-30 radix commands ....................................... 12-37 12-31 redirect commands .................................... 12-38 12-32 reset commands ........................................ 12-39 12-33 save commands ......................................... 12-40 12-34 step commands ......................................... 12-41 12-35 streams commands ..................................... 12-42 12-36 system commands ...................................... 12-43 12-37 trace commands ....................................... 12-44 12-38 type commands ......................................... 12-45 12-40 until commands ........................................ 12-46 12-39 unlock commands ..................................... 12-46 12-42 view commands ......................................... 12-47 12-41 up commands ........................................... 12-47 12-43 wasm commands ........................................ 12-48 12-44 watch commands ....................................... 12-49 12-45 wbreakpoint commands ............................... 12-50 12-46 wcalls commands ...................................... 12-50 12-47 wcommand commands ................................. 12-51 12-48 where commands ....................................... 12-51 12-50 wlist commands ........................................ 12-52 12-49 winput commands ...................................... 12-52 12-51 wmemory command .................................... 12-53 f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
motorola xi 12-52 woutput commands .................................... 12-54 12-53 wregister commands .................................. 12-54 12-54 wsession commands .................................... 12-55 12-55 wsource commands .................................... 12-55 12-56 wstack commands ..................................... 12-56 12-57 wwatch commands ..................................... 12-57 13-1 higher level functions ..................................... 13-3 13-2 integer code .............................................. 13-4 13-3 external memory functions ................................. 13-21 13-4 screen management functions ............................... 13-27 13-5 lower level structures & define constants .................... 13-38 f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
xii suite56 dsp simulator users manual motorola f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
motorola xiii 1-1 dsp simulator command window . ............................ 1-2 1-2 setting the working directory path . ............................ 1-5 1-3 setting up the display environment ............................ 1-8 1-4 add item to a watch list ..................................... 1-9 1-5 execution instructions with go ............................... 1-14 2-1 step through program instructions . . ............................ 2-2 2-2 trace program execution ..................................... 2-3 2-3 providing an until condition .................................. 2-5 2-4 resetting the device registers ................................. 2-8 3-1 displaying current paths ..................................... 3-2 4-1 dsp simulator register dialog box. ............................ 4-1 4-2 displaying the register values ................................. 4-2 4-3 changing the value of register ................................ 4-3 4-4 dsp simulator memory dialog box ............................ 4-4 4-5 displaying memory values ................................... 4-4 4-6 changing the value in memory ................................ 4-5 4-7 copying memory from one block to another ..................... 4-6 4-8 disassembling code stored in memory .......................... 4-7 5-1 providing input data ......................................... 5-9 5-2 creating an output file ...................................... 5-11 6-1 set default device dialog box ................................. 6-2 6-2 set default radix dialog box ................................. 6-3 6-3 set register or memory radix dialog box ....................... 6-4 6-4 window preferences dialog box . . . ............................ 6-6 7-1 displaying the call stack ..................................... 7-1 7-2 moving up the call stack ..................................... 7-2 7-3 moving down the call stack .................................. 7-3 list of figures f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
xiv suite56 dsp simulator users manual motorola 7-4 dynamic display of c function calls ........................... 7-4 7-5 displaying the type of a c variable or expression ................. 7-6 9-1 evaluating an expression ..................................... 9-1 9-2 displaying a value in a watch list . ............................ 9-8 10-1 go button . . .............................................. 10-2 10-2 stop button . .............................................. 10-2 10-3 step button . .............................................. 10-3 10-4 next button. .............................................. 10-4 10-5 finish button ............................................. 10-5 10-6 device button ............................................. 10-6 10-7 repeat button ............................................. 10-7 10-8 reset button .............................................. 10-8 11-1 displaying the current breakpoints . ........................... 11-1 11-2 displaying the command window . ........................... 11-3 11-3 pausing output to the session window ......................... 11-5 11-4 using the assembly window ................................. 11-5 11-5 displaying the source window ............................... 11-6 f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
motorola xv 5-1 comment code ............................................. 5-2 13-1 dspt_masm_xxxxx ......................................... 13-5 13-2 dspt_unasm_xxxxx ......................................... 13-5 13-3 dsp_exec . . . .............................................. 13-6 13-4 dsp_findmem .............................................. 13-6 13-5 dsp_findpin . .............................................. 13-7 13-6 dsp_findport .............................................. 13-7 13-7 dsp_findrg . . .............................................. 13-8 13-8 dsp_free .................................................. 13-8 13-9 dsp_fmem . . .............................................. 13-9 13-10 dsp_init ................................................. 13-10 13-11 dsp_idmem . ............................................. 13-10 13-12 dsp_load . . . ............................................. 13-11 13-13 dsp_new . . . ............................................. 13-11 13-14 dsp_path . . . ............................................. 13-11 13-15 dsp_rapin. . . ............................................. 13-12 13-16 dsp_rmem . . ............................................. 13-13 13-17 dsp_rpin ................................................. 13-13 13-18 dsp_rport . . . ............................................. 13-14 13-19 dsp_rreg ................................................. 13-14 13-20 dsp_save . . . ............................................. 13-15 13-21 dsp_startup . ............................................. 13-15 13-22 dsp_unlock . ............................................. 13-16 13-23 dsp_wapin . . ............................................. 13-16 13-24 dsp_wmem . ............................................. 13-17 13-25 dsp_wpin . . . ............................................. 13-17 13-26 dsp_wport . . ............................................. 13-18 13-27 dsp_wreg . . . ............................................. 13-19 13-28 sim_docmd . ............................................. 13-19 list of examples f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
xvi suite56 dsp simulator users manual motorola 13-29 sim_gmcmd ............................................. 13-20 13-30 sim_gtcmd . ............................................. 13-21 13-31 dsp_alloc . . . ............................................. 13-22 13-32 dspl_xmfree ............................................. 13-23 13-33 dspl_xminit . ............................................. 13-23 13-34 dspl_xmload ............................................. 13-24 13-35 dspl_xmnew ............................................. 13-24 13-36 dsp_xmrd . . ............................................. 13-25 13-37 dspl_xmsave ............................................. 13-25 13-38 dspl_xmwr . ............................................. 13-26 13-39 code to create new device ................................. 13-32 f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
motorola introduction & getting started 1-1 chapter 1 introduction & getting started 1.1 introduction to motorolas suite56? dsp simulator the dsp simulator is a software tool for developing programs and algorithms for motorola digital signal processors (dsps). the dsp simulator duplicates the functions of supported motorola dsp chips: ? all on-chip peripheral operations ? all memory and register updates associated with program code execution ? all exception processing activity the simulator also simulates the devices pipelined bus activity, enabling the simulator to provide you, the developer, an accurate measurement of code execution timecritical in dsp applications. the simulator executes object code generated by the suite56 dsp assembler (see the suite56 dsp assembler reference manual ) or the simulators internal single-line assembler. the simulator also executes object code generated by c compilers, such as motorolas star*core 100 family c/c++ compiler, or suite56 compilers for the 56000, 56300, 56600 and 56800 families. the object code is loaded into the simulated devices memory map. the entire internal and external memory space of the dsp is simulated. during program debugging you can display and change any of the devices registers or memory locations. instruction execution can proceed until the program encounters a user-defined breakpoint, or, in single-step mode, until it reaches a stopping point by executing a specified number of instructions or cycles. f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
1-2 suite56 dsp simulator users manual motorola dsp simulator features 1.2 dsp simulator features features of the motorola dsp simulator include the following: ? multiple device simulation ? source level symbolic debug of assembly and c source programs ? conditional or unconditional breakpoints ? program patching using a single-line assembler/disassembler ? instruction and cycle timing counters ? session and/or command logging for later reference ? input/output from/to ascii files for device peripherals ? help file and help line display of simulator commands ? command macros (editable scripts for executing multiple simulator commands) ? display enable/disable of registers and memory ? fractional/hexadecimal/decimal/binary calculator 1.3 entering commands you will perform most of your work with the simulator using the menu bar and the toolbar. but, sometimes it is convenient to perform some commands from a command line, and motorolas dsp simulator provides you the option of entering commands at a command line. the command line is a part of the command window, shown in figure 1-1. figure 1-1. dsp simulator command window f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
getting started with the dsp simulator motorola introduction & getting started 1-3 the command window displays several common commands on the help line. you can display the remaining commands by pressing the space bar when the cursor is at the beginning of the command line. you do not have to type the complete command. the simulator recognizes each command when you type the first one to three characters of the command. the help line highlights the minimum number of required characters for each command. the help line displays the syntax for a particular command when you type the required characters and then pressing the space bar. the command line considers any text that follows a semicolon a user comment. you might use comments to log output from the session window or to create and run a command macro . the command line executes the command when you press the enter key or the carriage return key. if you enter a command that is not a valid simulator command, the simulator interprets the command as the name of a command macro and executes the macro, if it exists. for more information about command syntax, see section 12.1, "command overview," section 12.2, "command syntax," and section 12.3, "command parameters: list of abbreviations." 1.4 getting started with the dsp simulator the motorola suite 56 dsp simulator gives you flexibility in debugging your object code. you can take multiple approaches; there is no one correct way in which to go about debugging your code. whichever approach you choose, you will want to become familiar with some fairly common windows and commands. here are a few steps to help you begin a typical session with the simulator. typically, you will want to: 1. set the path of the working directory. 2. load an object file. 3. set up the display environment: open windows to view the source code, assembler code, register values, and memory values. 4. use a watch list. 5. set and modify break points. 6. go or step through instructions. f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
1-4 suite56 dsp simulator users manual motorola setting and clearing the path when you become familiar with the simulator, you will not have to manually perform each step described above. you can position your windows as you like them by saving the windows settings using window preferences . command macros can set the path, load the program, and set up watch expressions. once you are comfortable with these basics, you can proceed to more complex debugging using simulated device input and output (i/o). if you are using c code as your source code, you use specific commands useful in debugging c source code. refer to the following sections of this manual to learn about more advanced techniques: ? section 5.1, "introduction to device i/o (input/output)," on page 5-1 ? section 6.1, "introduction to simulator configuration," on page 6-1 ? section 7.1, "introduction to debugging c source code," on page 7-1 ? section 9.1, "introduction to expressions," on page 9-1 ? section 10.1, "using the tool bar," on page 10-1 ? section 12.1, "command overview," on page 12-1 1.5 setting and clearing the path the suite 56 dsp simulator uses two types of paths to save and access files: ? the working directory path ? alternate directory paths the working directory is the primary path. the simulator uses the working directory as the default when searching for an input file (assuming no path is explicitly specified with the input filename). the simulator automatically searches alternate paths if it does not find the requested input file in the working directory. this allows you to keep object files, source files, and command macros in separate directories, but still access them without constantly redefining the path. to set the path of the working directory: 1. from the file menu choose path then select set . a dialog box similar to the following appears: f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
setting and clearing the path motorola introduction & getting started 1-5 figure 1-2. setting the working directory path 2. if appropriate, select another drive from the volumes menu. 3. move up or down the directory tree until the directory you want is in the list of subdirectories. there are a number of ways to do this. you can: move up and down the directory tree with the left arrow and right arrow buttons; move down the tree by double clicking in the list of subdirectories; move up the tree by selecting a directory from the drop down box that displays the parent directory; select a directory from the history menu, which shows recently selected directories. 4. click once on the desired directory from the list of subdirectories so that it is highlighted.notice that the highlighted directory appears in the area labeled directory. f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
1-6 suite56 dsp simulator users manual motorola loading object files 5. click on select .the selected directory is now the working directory. display the current path to see the absolute path of the working directory to set an alternate path: 1. from the file menu choose path then select add . 2. if appropriate, select another drive from the volumes menu. 3. move up or down the directory tree until the directory you want is in the list of subdirectories. 4. highlight the desired directory by single clicking on it in the list of subdirectories. 5. click on select . the selected directory is now added to the end of the list of alternate paths. display the current path to see the list of alternate paths. to clear the alternate paths: 1. from the file menu, choose path then select clear alternate path list. the list of alternate paths is cleared for all devices. the path of the working directory is not cleared. the simulator maintains a separate working directory for each device. however, all devices share the same alternate directory paths. to be safe, always check the path of the working directory after adding a device or setting the default device. remember that in order to change the path of a device that is not currently the default device, you must first change the default device, discussed in section 6.2, "setting the default device," and section 12.25, "path - specify default pathname," on page 12-35. in chapter 12, "command reference." 1.6 loading object files you can load dsp object module format (omf) files or dsp common object file format (coff) files directly into the simulator memory. omf files are identified by the .lod extension. coff files are identified by the .cld extension. motorolas suite56 dsp assembler generates the omf file format. to generate coff files with the suite56 assembler, you can use the cldlod utility to generate .lod files; the cldlod utility converts files from coff file format (.cld) to omf file format (.lod). you can also generate both of the file formats with the dsp simulator when you save object files. f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
setting up the display environment motorola introduction & getting started 1-7 to load a coff (.cld) file: 1. from the file menu, choose load then select memory coff . 2. under load select memory , debug symbols or both.the simulator will process the symbol and line number information contained in a coff format object file (.cld file) only if the file was compiled or assembled with debugging enabled. (in the motorola dsp assembler this is represented by the Cg option.) if symbol information has been loaded, the evaluator will accept symbol names or source file line numbers and translate them into an associated memory address. 3. under filename specify the filename of the object file to load or click on the file button to browse for the file. 4. click ok . if the .cld file is not found in the selected directory, the simulator will try to load the file from the working directory. if the file does not exist in the working directory, the simulator will try to load the file from the alternate directories. an error message is displayed if the file is not found in any of these directories. to load an omf (.lod) file: 1. from the file menu, choose load then select memory omf 2. specify the filename in the dialog box. it is not necessary to type the extension with the filename. the simulator assumes the .lod extension. 3. click open . keep in mind that the object file is loaded into the memory of the current device. if you want to load the file into another device, you must first select that device as the default device. chapter 6, "simulator and device configurations" provides more details and chapter 12, "command reference" provides a full command description. 1.7 setting up the display environment the simulator displays two windows when it first starts: the session window and the command window. you might need to scroll around to get both windows into view at the same time, but the screen should look something like this: f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
1-8 suite56 dsp simulator users manual motorola setting up the display environment figure 1-3. setting up the display environment when we talk about the display environment we are simply talking about the way you arrange the windows of the simulator on your monitor. there is no right or wrong way to set up the display environment. however, there are some windows that you will commonly want to have opened besides the session and command windows. these include: ? the assembly window ? the source window (if a coff file with debugging information is loaded) ? a window displaying register values ? a window displaying memory values, and perhaps ? a watch list if you are debugging a program written in c, keep the call stack window open so that you can see the call stack. depending on the size and resolution of your monitor, having all of these windows open at once will mean that there will be some overlapping. your own experience with the simulator will lead you to the best configuration of these windows f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
using a watch list motorola introduction & getting started 1-9 1.8 using a watch list you can watch the contents of a specific memory location, register, or expression by setting up a watch list. the watch list is updated every time program execution is stopped. the expression that you watch can be valid even if it is not calculated during program execution. you can use c expressions, but you must enclose them in curly brackets: { c_expression }. you can use symbolic references if you have loaded symbols from the object module. to add an item to a watch list: 1. from the windows menu choose watch . the following dialog box appears: figure 1-4. add item to a watch list 2. under window select the window number that you want to assign to the watch window. this is useful when you have more than one watch window open. 3. under expression , type the expression that you want to appear in the watch window. if the expression is a c expression, enclose it in curly brackets: { c_expression }. 4. under radix , select the radix format in which you want the variables displayed. 5. click ok . the expression that you specified now appears in a watch window: if the expression you type is not valid, you get an error message explaining why the expression is not valid. f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
1-10 suite56 dsp simulator users manual motorola setting and modifying breakpoints keep in mind that a c expression that refers to c variables can only be evaluated in the context in which the watch is established. that is, the variables in the expression are only valid while they are in scope. if one of the variables in an expression goes out of scope (because of either a function call or a return from a function), the value is replaced with the message expression out of scope. when all elements of the expression are back in scope, the watch window displays the value again. an expression that has gone out of scope because of a function call can be evaluated and displayed by selecting the stack frame for the evaluation context. the stack frame assignment remains in effect only until the next instruction is executed. an expression that is out of scope because of a function exit cannot be evaluated until the function is again invoked since the expressions variables no longer exist. refer to the following sections of this manual to learn about more advanced topics: section 7.3, "moving up and down the call stack," on page 7-2; section 9.1, "introduction to expressions," on page 9-1; and section 11.2, "displaying the radix." section 12.42, "watch - set, modify, view, or clear watch item," on page 12-49, provides a complete command description. 1.9 setting and modifying breakpoints you can use the assembly window, (which is updated at each break in program execution), and the source window, (which displays the source code loaded into the simulators memory), to set halt breakpoints. to set a halt breakpoint in the assembly window, double click on an address or label field. to set or clear a halt breakpoint in the source window, double click on any source code line . the assembly window and the source window indicate the breakpoints you have set. enabled breakpoints appear in blue. disabled breakpoints appear in pink. chapter 11, "displaying information" provides a detailed discussion of the simulators display capabilities, including the assembly and source windows. to set a breakpoint with conditions, you specify an action to take when the simulator encounters each breakpoint. you can set more than one breakpoint on the same location, so that more than one action can be taken. to set a breakpoint with conditions: 1. from the execute menu, choose breakpoints then select set . 2. under breakpoint number select the number you want to assign to this breakpoint. the default number that is shown is the next available number. breakpoint numbers do not have to be consecutive; they can be assigned arbitrarily. f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
setting and modifying breakpoints motorola introduction & getting started 1-11 for example, it may be convenient to allocate breakpoints so that one function is assigned breakpoints 1 to 10, another uses 11 to 20, and so on. 3. under type select whether you are setting a breakpoint at a particular memory location, register, or expression. 4. if the breakpoint is being set for a memory location or a register, under access specify what kind of access should be detected by the breakpoint. for example, if you want the breakpoint to detect when a memory location is read but not written to, select read . if you want either a read or a write to be detected, chose read/write . 5. if the breakpoint is being set on a memory location, under memory select the memory space.if the memory address you want to break on is a single location (as opposed to a memory block) type in the address under start address and leave the end address blank.if you want to set the breakpoint on a range of addresses, type in the start address and end address of the range. setting a range means that the breakpoint will be recognized if any address in the range is accessed.you can also define a line number in the source program as a breakpoint. (the source program must contain symbolic debug line number information.) specify the line number under start address in the form: filename @ line_number. for example, to set a breakpoint on line 22 of the source file named clrmem.cld, under the start address you type: clrmem@22 6. if the breakpoint is being set on a register, under register select the register. 7. if the breakpoint is being set on an expression, under expression type the expression. remember, if the expression is a c expression, enclose the expression in curly bracket: { c_expression }. a breakpoint expression can be any logical expression that is valid for the motorola dsp assembler. table 1-1 provides a list of operators that can be used in the breakpoint expression. table1-1. listofoperators operator function < less than && logical and <= less than or equal to || logical "or" == equal to ! logical "negate" f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
1-12 suite56 dsp simulator users manual motorola setting and modifying breakpoints 8. the breakpoint expression usually involves comparison of register or memory values. you can use any register name in the expression. there are also two special flag variables that you may reference in the breakpoint expression: eof is true if an end-of-file condition occurs in an input file assigned to a peripheral or memory location. jump is true if a "jump" change of flow occurs during code execution. 9. under action select what action is taken when the breakpoint is encountered. table 1-2 provides a list of breakpoint actions. >= greater than or equal to & bitwise "and" > greater than | bitwise "or" != not equal to ~ bitwise ones complement + addition ^ bitwise "exclusive or" - subtraction << shift left / division >> shift right table 1-2. breakpoint actions action behavior halt stops program execution when the breakpoint is encountered. note displays the breakpoint expression in the session window each time it is true. program execution continues. the display in the session window is not updated until program execution stops. show displays the enabled register/memory set. program execution continues. table 1-1. list of operators (continued) operator function f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
starting the execution of instructions with go motorola introduction & getting started 1-13 10. if the action specified executes a command, under command type the simulator command. for example, a common command to perform in conjunction with a breakpoint is evaluate - evaluate an expression. 11. click ok . to clear a breakpoint: 1. from the execute menu, choose breakpoints then select clear . a dialog box displays a list of all the current breakpoints. 2. select the breakpoint you want removed so that it is highlighted. if you are clearing consecutive breakpoints you can click and drag to highlight more than one breakpoint. or hold down the ctrl key while clicking on breakpoints to select more than one. 3. click ok to delete the breakpoints you selected. breakpoints will not be renumbered. for example, if you have set breakpoints #1, #2, and #3 and then clear breakpoint #2, the simulator will number the remaining breakpoints #1 and #3. (the simulator does not renumber the breakpoints; it retains the original number you assigned to the breakpoints.) . for more detailed information, see section 9.1, "introduction to expressions," on page 9-1, and section 11.1, "display the current breakpoints," on page 11-1. section 12.5, "break - set, modify, or clear breakpoint," on page 12-8 provides a complete command description. 1.10 starting the execution of instructions with go the most common way to initiate program execution is with go. when you indicate go to the simulator, it fetches, decodes, and executes instructions in the exact manner a device would if you were debugging an actual device. the go command executes the program until one of the following occurs: ? the simulator reaches a breakpoint command executes a simulator command at breakpoint. device execution commands, such as trace or go , will not execute. increment[ n] increments the counter n variable by one. table 1-2. breakpoint actions (continued) action behavior f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
1-14 suite56 dsp simulator users manual motorola starting the execution of instructions with go ? you indicate stop ? the simulator encounters a debug instruction to start executing instructions with go: 1. from the execute menu choose go. you will see the following dialog box: 2. figure 1-5. execution instructions with go 3. under go from , choose whether to go from an address or reset. if you choose reset , the simulator simulates the reset sequence in the processor. the instruction pipeline, instruction counter, and cycle counter will be cleared before program simulation begins. the device registers are reset and execution begins at the reset exception address. 4. if you chose to go from an address, under address , type in the address from which you want to begin executing instructions. if you leave the address blank, execution will begin from the current program counter value. if you specify an address, the instruction pipeline, instruction counter, and cycle counter will be cleared before program simulation. execution will begin from the address you specify. 5. select the go to breakpoints checkbox if you want to stop execution at a particular breakpoint. if selected, all other stop breakpoints will be ignored. f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
starting the execution of instructions with go motorola introduction & getting started 1-15 6. under break number select the breakpoint where you want to stop execution. to see where you have breakpoints set, display the current breakpoints in the breakpoint window. 7. under count specify how many times the simulator should encounter the breakpoint before stopping. for example, if you set the count to 3, the program execution will be stopped on the third time that the breakpoint is encountered. the last instruction executed will be the breakpoint 8. when all conditions are set, click ok . execution begins. notice that during execution, the status bar in the lower left corner of the simulator window shows the number of the device where execution is taking place, the pc (program counter), and the cycle count (updated every 1,000 cycles). as an alternative, you can start program execution using the go button located on the toolbar. fore more details, see section 2.9, "resetting the device," on page 2-7. section 12.15, "go - execute dsp program," on page 12-22, provides a complete command description. f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
1-16 suite56 dsp simulator users manual motorola starting the execution of instructions with go f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
motorola controlling execution 2-1 chapter 2 controlling execution 2.1 starting the execution of instructions with go the most common way to initiate program execution is with go. when you indicate go to the simulator, it fetches, decodes, and executes instructions in the exact manner a device would if you were debugging an actual device. the go command executes the program until one of the following occurs: ? the simulator reaches a breakpoint ? you indicate stop ? the simulator encounters a debug instruction section 1.10, "starting the execution of instructions with go," on page 1-13 provides a step-by-step task description for executing with go from the gui interface. 2.2 step through instructions you can specify the number of instructions, lines, or cycles the suite56 simulator executes before stopping. stepping through instructions is a quick way to specify the execution of a number of instructions without setting a breakpoint. the step instruction is similar to the trace instruction except that the display of the registers and memory blocks occurs only after the specified number of cycles, lines, or instructions have been executed. if the next instruction to be executed calls a subroutine or begins execution of a macro, the subroutine or macro is not executed. however, it is possible to allow the current function to finish. to step through program instructions: 1. from the execute menu choose step . you will see the following dialog box: f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
2-2 suite56 dsp simulator users manual motorola trace the execution of instructions figure 2-1. step through program instructions 2. under increment , select whether to step by cycles , lines ,or instructions . 3. under count specify the number of cycles, lines, or instructions to step. 4. select the checkbox labeled halt at breakpoints if you want breakpoints to be observed. if you do select the checkbox, the simulator ignores breakpoints and does not halt program execution. 5. click ok . notice that the simulator updates the values in the register window, the memory window, and all other windows after it executes the last cycle, line, or instruction. alternatively, use the step button on the toolbar to step one instruction or line at a time. section 12.31, "step - step through dsp program," on page 12-41 provides a complete command description. 2.3 trace the execution of instructions when you trace program execution, you can look at a snapshot of the enabled registers and memory after the simulator executes each instruction or clock cycle. to trace program execution: 1. from the execute menu choose trace . the following dialog box appears: f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
executing the next instruction motorola controlling execution 2-3 figure 2-2. trace program execution 2. under increment select cycle , line ,or instruction . 3. under count specify the total number of cycles, lines, or instructions to trace. execution stops after this number of cycles/lines/instructions. 4. select the checkbox labeled halt at breakpoints if you want to observe breakpoints. 5. if you do not select the checkbox, the simulator ignores breakpoints and does not halt program execution. 6. click ok . notice that the simulator updates values in the register window, the memory window, and all other windows after it executes each cycle, line, or instruction. it updates these values at the speed of execution, so they will pass by very quickly. in order to review the values, scroll back through the session window once execution has stopped. it is often useful to log output from the session window log. section 12.34, "trace - trace through dsp program," on page 12-44, provides a complete command description. 2.4 executing the next instruction you can specify the number of instructions or lines the simulator executes before stopping. when you execute the next specific number of instructions you can quickly control execution without setting a breakpoint. executing instructions with next is similar to performing a step through instructions, except that you can only specify the number of lines or instructions, and not cycles. like stepping through instructions, the simulator displays the registers and memory blocks only after it executes the specified number of lines or instructions. f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
2-4 suite56 dsp simulator users manual motorola providing an until condition the important difference between next and step is the way each instruction handles subroutines. if the next instruction executed calls a subroutine or begins execution of a macro, all the instructions of the subroutine or macro are executed before execution stops. the simulator then displays enabled registers, memory, and other updated values. in order to recognize macros, the symbolic debug information for the program code must be loaded. the debug information is included in the coff format .cld files generated using the motorola suite 56 dsp assemblers -g option. motorolas suite56 c compilers and the star*core 100 c/c++ compiler also provide debug information when you use the -g option. to execute the next program instruction: 1. from the execute menu choose next . 2. under increment , select to execute by lines or by instructions. 3. under count , specify the number of lines or instructions to execute. 4. select the checkbox labeled halt at breakpoints if you want to observe breakpoints. if you do not select the checkbox, the instruction will ignore breakpoints and will not halt program execution. 5. click ok . notice that the simulator updates the values in the register window, the memory window, and all other windows after it executes the last line or instruction. alternatively, you can use the next button on the toolbar to execute the next instruction or line section 10.5, "next button," on page 10-4 provides more advanced information. section 12.23, "next- step over subroutine calls or macros," on page 12-32 provides a complete command description. 2.5 providing an until condition an until condition causes the simulator to execute the currently loaded program until it encounters a specified location. you can specify the location as a program line number, an address, or a label. an until condition works essentially as a temporary breakpoint, cleared when execution stops. to provide an until condition: 1. from the execute menu, choose until . f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
pausing execution with wait motorola controlling execution 2-5 figure 2-3. providing an until condition 2. type the line address or label at which to stop execution. (you can only use line numbers and labels if debug information has been loaded from a coff file.) to specify an address, include the memory space followed by a colon, followed by the address. for example, to execute instructions until address $00c103 is reached, type: p:$00c103 to specify a line number in the currently loaded source file, just type in the line number. or to specify a line number of a particular source file, include the filename. for example, to execute until line number 20 of a source file named clrmem.cld located in the working directory, type: clrmem@20 3. select the checkbox labeled halt at breakpoints if you want the instruction to observe breakpoints. if you do not select the checkbox, the instruction ignores breakpoints and does not halt program execution. 4. click ok . section 12.37, "until - execute until address," on page 12-46 provides a complete command description. 2.6 pausing execution with wait you can pause macro execution by specifying the number of seconds you want the simulator to wait. execution resumes after the pause. the wait instruction is particularly useful when you write a command macro. that is, if you cause the simulation to wait while logging commands, you can then save the log file. a command macro results. the pause that was recorded while logging commands will be replayed when the macro is executed. the wait instruction provides a useful way to pause execution so that you can examine certain values or windows. f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
2-6 suite56 dsp simulator users manual motorola allowing the current function to finish after an until condition or a breakpoint to pause execution: 1. from the execute menu, choose wait . 2. select the number of seconds to pause or click on the checkbox forever to pause indefinitely. 3. click ok . 4. an information box appears to let you know that the simulator is paused. if you dont want to wait for the pause to end automatically, you can resume program execution by clicking cancel . keep in mind that if you click cancel while recording a command macro that the cancellation of the pause is not recorded. so, for example, if you specify a wait of ten seconds and then cancel after three, when the command macro executes, it will pause for the full ten seconds. section 8.1, "creating and running a command macro," on page 8-1 provides more detailed information. section 12.40, "wait - wait specified time," on page 12-48 provides a complete command description. 2.7 allowing the current function to finish after an until condition or a breakpoint sometimes a program execution stops while in the middle of executing a subroutine or function. this might occur for several reasons. execution may stop if you specify that a certain number of steps be executed which happened to end in the middle of the subroutine. or, execution may stop if an until condition or breakpoint is reached while in the middle of a subroutine. section 1.9, "setting and modifying breakpoints," provides a detailed discussion of breakpoint funtions. in any instance where the simulator stops execution in the middle of a subroutine or function, the subroutine or function can be made to finish execution. to finish execution of the current function or subroutine: 1. from the execute menu, choose finish . the simulator continues until it encounters an rts instruction. execution continues only to the end of the current function. if the simulator encounters another function during a finish operation, the execution of the encountered function does not complete. alternatively, you can use the finish button on the toolbar. section 12.13, "finish - execute until end of current subroutine," on page 12-21 provides a complete command description. f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
resetting the device motorola controlling execution 2-7 2.8 stopping program execution you can stop program execution or the execution of a command macro at any time. to stop program or command macro execution: 1. from the execute menu, choose stop : notice that this is the only menu item you can choose while program or command macro execution is in progress. if you began the execution by providing an until condition, the simulator will clear this temporary breakpoint. the assembly window (and the source window if applicable) highlight the next instruction to be executed in red. when program execution is stopped the session window will display simulation aborted . notice that the simulator updates the values in the session window, the register window, the memory window, and all other windows to reflect the last instruction or line executed. alternatively, you can use the stop button on the toolbar to stop program execution. for more details about stopping program execution, see section 2.9, "resetting the device," and section 10.8, "repeat button," on page 10-7. 2.9 resetting the device you can reset the device or the entire simulator state any time instruction execution is halted. resetting the device also allows you to select the operating mode that the device will be set to in response to a simulated hardware reset sequence. to reset the device: 1. before you reset the device you will want to know which operating modes are available to the device that you are simulating. to see the available operating modes, open the command window. at the command line, type: help mode 2. view the session window. it now contains a list of the operating modes available for the device that you are simulating. now that you know the operating modes from which you can choose, proceed in resetting the registers. 3. from the execute menu choose reset , then select device . the following dialog box appears: f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
2-8 suite56 dsp simulator users manual motorola resetting the device figure 2-4. resetting the device registers 4. select the operating mode to which the device should be reset. 5. click ok . to reset the simulation memory: 1. from the execute menu choose reset , then select state . this resets the entire simulator state to the start-up condition. all breakpoints are cleared, the memory is initialized, and all logging and i/o files are closed. section 12.29, "reset - reset device or state," on page 12-39 provides a complete command description. f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
motorola object files and data files 3-1 chapter 3 object files and data files to efficiently manage and use the object files and data files in your project, you will need to understand how the simulator sets and clears paths. for a complete discussion of the working directory path and alternate directory paths, see section 1.5, "setting and clearing the path." 3.1 displaying the current path the dsp simulator uses two types of paths to save and access files: ? the working directory ? alternate directories the simulator uses the working directory as the default directory when searching for an input file (assuming no path is explicitly specified with the input filename). alternate directories are also searched, in turn, if an input file is not found in the working directory. to display the current paths: 1. from the display menu choose path 2. open the session window if not already open. the simulator displays the current working directory and the alternate source paths. f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
3-2 suite56 dsp simulator users manual motorola displaying the current path s figure 3-1. displaying current paths keep in mind that the simulator displays a separate directory path for each device. this means that as you switch from one device to another, the working directory also changes according to the current device. the top left corner of the session window indicates the current path. section 12.25, "path - specify default pathname," on page 12-35 provides a complete command description. f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
saving object files motorola object files and data files 3-3 3.2 saving object files you can save memory blocks in dsp coff or ascii omf object files. the object files can be reloaded in the simulator or in any other environment where such files are used. for a complete description of the steps required to load object files in either coff or omf format, see section 1.6, "loading object files," on page 1-6. to save a coff (.cld) file: 1. from the file menu choose save then select memory coff . 2. under memory space , select the memory to save. 3. under start address , type the beginning address of the memory block. 4. under end address , type the last address of the memory block. 5. under file name , type in the filename of the file to save or click on file to browse the directories. the extension default is .cld. 6. click ok . if no directory path is specified, the file will be saved in the working directory. if the file already exists, you will be prompted to decide whether to overwrite the file or to append it. the simulator does not store symbolic debug information. to save an omf (.lod) file: 1. from the file menu, choose save then select memory omf . 2. under memory space , select the memory to save. 3. under start address , type the beginning address of the memory block. 4. under end address , type the last address of the memory block. 5. under file name , type in the filename of the file to save or click on file to browse the directories.the extension default is .lod. 6. click ok . if no directory path is specified, the file will be saved in the working directory. if the file already exists, you will be prompted to decide whether to overwrite the file or to append it. section 12.30, "save - save simulator file," on page 12-40 provides a complete command description. f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
3-4 suite56 dsp simulator users manual motorola saving object files f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
motorola managing memory and registers 4-1 chapter 4 managing memory and registers to efficiently manage the memory and registers associated with your project, you will need to know how to reset the device. for a complete discussion of the resetting the device, see section 2.9, "resetting the device." 4.1 displaying register values you can display the device registers and memory any time instruction execution is halted. to display the value in a register: 1. from the windows menu choose register . the following dialog box appears: figure 4-1. dsp simulator register dialog box 2. select the peripheral that you want to view. 3. click ok . the register values for the peripheral that you chose appear in a register window: for example, if you choose to display the register values for the core, you see a window similar to the following: f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
4-2 suite56 dsp simulator users manual motorola displaying register values figure 4-2. displaying the register values notice that the title bar of the register window indicates: ? the device number where the peripheral resides, ? the number of the register window. this number is shown because you can display other register windows for other peripherals. ? the type of peripheral. the peripheral type is shown for easy identification. several register windows can be open C each corresponding to a different peripheral. section 12.10, "display - display register or memory," on page 12-17 provides a complete command description. f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
displaying memory values motorola managing memory and registers 4-3 4.2 changing register values you can change the value of the device registers when instruction execution is halted. to change the value of a specific register: 1. from the modify menu choose change register . the following dialog box appears: figure 4-3. changing the value of register 2. select the register whose value you want to change. 3. under value , type in the value to which you want the register to be set 4. click ok . section 12.6, "change - change register or memory value," on page 12-13 provides a complete command description. 4.3 displaying memory values you can display the values in memory any time instruction execution is halted. to display the value in memory: 1. from the windows menu choose memory . the following dialog box appears: f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
4-4 suite56 dsp simulator users manual motorola displaying memory values figure 4-4. dsp simulator memory dialog box 2. from the drop-down list box, select the memory space whose values you want to change. 3. click ok . the memory values for the memory space you choose appear in a memory window. for example, if you display values in the p memory space, you see a window similar to the following: figure 4-5. displaying memory values notice that the title bar of the memory window indicates: ? the device number that you are viewing, ? the number of the memory window. this is shown because you can display other memory windows simultaneously. ? the type of memory space. again, you could have several memory windows open C each corresponding to a different memory space. f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
changing memory values motorola managing memory and registers 4-5 section 12.10, "display - display register or memory," on page 12-17 provides a complete command description. 4.4 changing memory values you can change the values in memory any time instruction execution is halted. to change the value in memory: 1. from the modify menu choose change memory . the following dialog box appears: figure 4-6. changing the value in memory 2. select the memory space that you want to change. 3. under start address , type the value of the beginning address that you want to change. 4. under end address , type the value of the ending address that you want to change. 5. under value , type the value to which the specified addresses should be changed. keep in mind that all values, including the starting and ending values will be changed to the value that you specify.the format of this value (hex, decimal, etc.) will automatically be the same as the current default radix. if you want the format of the value to differ from the default, you must use the appropriate radix specifier. $ denotes value as hexadecimal denotes value as decimal % denotes value as binary 6. click ok . f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
4-6 suite56 dsp simulator users manual motorola copying memory from one block to another section 12.6, "change - change register or memory value," on page 12-13 provides a complete command description. 4.5 copying memory from one block to another you can copy memory blocks from one location to another. the source and destination memory maps may be different. this allows you to move data or program code from one memory map to another or to a different address within the same memory map. to copy memory from one block to another: 1. from the modify menu choose copy memory the following dialog box appears: figure 4-7. copying memory from one block to another 2. in the from memory space pane, select the memory space to copy from. then in the text boxes, type the starting address and the ending address of the block that you want copied. 3. in the to memory space pane, select the memory space to copy to. then type the starting address to begin copying values. 4. click ok . section 12.7, "copy - copy a memory block," on page 12-14 provides a complete command description. f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
disassembling code stored in memory motorola managing memory and registers 4-7 4.6 disassembling code stored in memory you can disassemble instructions that have been loaded so that you can review dsp object code in its assembly language mnemonic format. invalid opcodes are disassembled to a define constant (dc) mnemonic. to disassemble code stored in memory: 1. from the display menu choose disassemble then select memory block . the following dialog box appears: figure 4-8. disassembling code stored in memory 2. select the memory space that you want to disassemble. 3. in the start address text box, typethe addresswhereyou want to begin to disassemble. 4. in the end address text box, type the address where you want to stop disassembling. 5. click ok . 6. view the session window to see the mnemonics of the memory block you specified. section 12.9, "disassemble - object code disassembler," on page 12-16 and section 12.27, "radix - change input or display radix," provide complete command descriptions. f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
4-8 suite56 dsp simulator users manual motorola displaying a history of recent instructions 4.7 displaying a history of recent instructions you can disassemble and display a history of the most recent instructions executed by the device. a typical use for displaying the history would be to determine the sequence of instructions that terminated in a user-defined breakpoint. you would set the breakpoint conditions, then issue the go command. when the break condition is met, instruction execution halts and the currently enabled registers appear. you can then display the history to view the last 32 instructions that executed prior to the breakpoint. to display a history: 1. from the display menu choose history . 2. view the session window to see the last 32 instructions executed by the device. the instructions appear in the order executed, with the most recent instruction appearing at the bottom of the list. the last instruction in the list has been fetched and decoded by the device and enters the execute phase in the next device cycle. it is in the same state as instructions that are disassembled and displayed at the end of each trace display. the device execution history can also be logged continuously to an output file using the simulator output command. the device execution history can also be logged continuously to a file by assigning an output file. when you assign the output file, choose to output from extended history. remember to close the file before viewing its contents. section 5.12, "assigning an output file," on page 5-11provides more detailed information. section 12.17, "history -disassemble previously executed instruction," on page 12-24 provides a complete command description. f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
motorola device i/o and peripheral simulation 5-1 chapter 5 device i/o and peripheral simulation 5.1 introduction to device i/o (input/output) the suite 56 dsp simulator provides you with the ability to simulate the data input and output. if you were actually debugging a dsp device, you would need several pieces of hardware. the hardware includes an actual device and peripheral devices that supply input to the dsp device and recognize output from the dsp device. in the simulator environment, of course, you are not debugging an actual device, which means that there is no communication with peripherals, ports, or pins. instead, the simulator provides simulated input and output by using i/o files. these i/o files communicate with the simulator as if the input and output were coming from an actual peripheral, port, pin, or memory location. you can specify whether the input data is to come from a file or from the keyboard (terminal). the simulator simulates dsp on-chip peripherals on a cycle by cycle basis. 5.2 how are i/o files formatted? simulated input and output is represented in ascii format, which means that you can conveniently edit and print i/o files from a text editor. an input file or output file can contain: ? repeat punctuation ? comments ? timing information ? peripheral data ? port data ? pin data ? memory data f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
5-2 suite56 dsp simulator users manual motorola repeat punctuation 5.3 repeat punctuation the simulator provides a way to specify repeated input or output data values and sequences. a single data value can be repeated by adding the following syntax after a data item: #{ count } enclosing several data items in parentheses indicates that the data items are to be treated as a group. the entire group can then be repeated by placing #{ count } immediately following the closing parenthesis. the parentheses can be nested. a closing parenthesis without a following repeat count causes the data sequence within the parentheses to repeat forever. timed values can appear within a repeat group, and in this case the relative time mode ( +time ) should be used. 5.4 comments any information following a semicolon, up to the end-of-line, is considered to be a user comment and is not interpreted as input data or timing. example 5-1. comment code ffc 333 972 ;next three p memory data words in this example, the first three data values are applied to the device. the information following the semicolon is a user comment. table 5-1. repeat punctuation input data data sample explanation 1ff#20 repeats the untimed data item 1ff twenty times. (+5 cc +10 33)#5 repeats the sequence of timed data pairs +5 cc +10 33 five times. (cc354 cc333 c7000) repeats the untimed data sequence cc354 cc333 c7000 forever. (1#5 0#5) repeats the untimed data sequence 1 111100000forever. f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
peripheral data motorola device i/o and peripheral simulation 5-3 5.5 timing information if the t key character is specified in the input or output command, then the assigned file will contain cycle timing information preceding each piece of i/o data. the timing information relates to the simulator cycle counter value (cyc register) at the time when the data transfer occurs. the timing information is always expressed in decimal. if the timing information is preceded by a plus sign ( + ), it indicates a relative number of cycles from the preceding specified timing value; otherwise it indicates the exact value of the simulator cycle register at the time of the transfer. 5.6 peripheral data you can assign and input or output file to each dsp peripheral. the following general information applies to all peripheral files. the peripheral data value can be represented in hexadecimal, decimal, binary or floating point. specify the default input radix in the input command; specify the output radix in the output command. you can express floating point input in the usual methods.for example, 0.5 5e-1 5.0e-1 are all acceptable data input values. if a data value contains a decimal point, the data will be input as a floating point value, overriding the input radix specification. the number base of data values can also be denoted by preceding the data value with a dollar sign ( $ ), an apostrophe (), or a percent sign ( % ). $ input as hexadecimal input as decimal % input as binary untimed peripheral input data values are applied only during cycles when the peripheral function is enabled. some peripherals retrieve data from the input file when the peripheral would normally receive new data; other peripherals retrieve the data each cycle. the final specified data value remains applied to the peripheral indefinitely. the repeat punctuation and repeat count can specify durations of longer than one cycle. timed peripheral input data values will be applied to the peripheral at the time intervals, or at the exact simulator cycles indicated by the timing information within the file. if the f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
5-4 suite56 dsp simulator users manual motorola port data first timing information in the file is a relative value, (timing preceded by +) the simulator will wait until the peripheral function is enabled before applying the data. if a lower case letter t is placed in a data position of the input file, you will be prompted for the next input data value as described below in section 5.10, "terminal input of data values." storage of data to the peripheral output file will begin when the peripheral is enabled. in the timed output mode, the simulator cycle count and a data value are stored each time the peripheral output changes. in the untimed output mode, a data value and a following repeat count are stored each time the data changes. 5.7 port data when assigned to a dsp port, the input file data value represents the value applied to all the pins of the port. the least significant port bit maps to the least significant bit of the data value. the following general information applies to all port files. a port is simply a convenient grouping of device pins. untimed data applied to a port is retrieved each clock cycle, with one exception: the data bus ports retrieve new data from an assigned input file only once for each memory fetch. the port data value can be represented in hexadecimal, decimal, binary or floating point. the default input radix can be specified when assigning an input file; the output radix can be specified when assigning an output file. floating point input can be expressed in the usual methods. for example, 0.5 5e-1 5.0e-1 are all acceptable data input values. if a data value contains a decimal point, the data will be input as a floating point value, overriding the input radix specification. the number base of data values can also be denoted by preceding the data value with a dollar sign ( $ ), an apostrophe (), or a percent sign ( % ). $ input as hexadecimal input as decimal % input as binary timed port input data values are applied to the port at the specified relative time intervals ( +time ), or at the exact simulator cycle indicated by the timing information within the file. f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
memory data motorola device i/o and peripheral simulation 5-5 if a lower case letter t is placed in a data position of the input file, you will be prompted for the next input data value as described below in section 5.10, "terminal input of data values." storage of data to a port output file will occur any time a write operation occurs to the port. in the timed output mode, the simulator cycle count and a data value are stored each time a word is written. in the untimed output mode, a single data value is stored each time a word is written. no tristate information is stored in the port output data. 5.8 memory data when assigned to a memory location, the input file data value supplies the value that is read when the simulator references that memory location. the least significant memory bit maps to the least significant bit of the data value. the input data value can be in decimal, binary, hexadecimal, or floating point form. the simulator interprets the data based on the input radix specified in the input command. the default input radix is hexadecimal. if a data value contains a decimal point, the data will be input as a floating point value, overriding the input radix specification. the number base of data values can also be denoted by preceding the data value with a dollar sign ( $ ), an apostrophe (), or a percent sign ( % ). $ input as hexadecimal input as decimal % input as binary the simulator applies untimed memory input data values each time the device performs a read operation on the memory location. in other words, the input file acts like a stack of input data; each successive data value is retrieved from the stack file when a read operation occurs. the simulator applies timed input data values to the memory location at the specified relative time intervals ( +time ), or at the exact simulator cycle indicated by the timing information within the file. if the first timing information in the file is a relative value ( +time ) the simulator waits until the first read of that memory location before getting the first data value. otherwise the data application occurs at the exact specified cycle. if a lower case letter t is placed in a data position of the input file, you will be prompted for the next input data value as described below in section 5.10, "terminal input of data values." storage of data to a memory output file occurs any time a write operation occurs to the memory location. in the timed output mode, the simulator cycle count and a data value are f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
5-6 suite56 dsp simulator users manual motorola pin or pin group data stored each time a word is written. in the untimed output mode, a single data value is stored each time a word is written. the output data value can be in decimal, binary, hexadecimal, floating point or string form. specify the output radix in the output command. the default output radix is hexadecimal. the string form of output data uses the value written to the memory location as the starting address in the same memory space of a zero terminated ascii character string. the character string is written to the output file. 5.9 pin or pin group data when assigned to a pin or pin group, the input file data value supplies the zero ( 0 or l ), one ( 1 or h ), a negative pulse within a single cycle ( n ), a positive pulse within a single cycle ( p ) , or a tristate ( x ) value to be applied to the pin or to each pin in the group, with the first specified pin mapping to the least significant bit of the data value. each data word must contain as many characters ( 0 , 1 , l , h , n , p ,or x ) as there are pins in the group. if an analog input file is assigned to a device analog pin, the input command must specify the floating point radix with the -rf radix designator in the input command. likewise, an analog output pin file must be specified with the -rf radix designator in order to generate floating point output for the pin rather than the digital pin values described in the preceding paragraph. floating point io files may only be assigned to a single analog pin. the simulator applies untimed pin input data values to the specified pin in each simulator clock cycle. timed pin input data values will be applied to the specified pin at the specified relative time intervals ( +time ), or at the exact simulator cycle indicated by the timing information within the file. table 5-2. input memory data data sample explanation 7fff 7f3f 5d3c 7fc3 the untimed memory input file causes the data sequence 7fff 7f3f 5d3c 7fc3 to appear during consecutive reads of the specified memory location. (1ff 0) the untimed memory input file causes the data sequence 1ff 0 to appear repeatedly during consecutive reads of the specified memory location. (+10 0.5 +10 0.3) the timed memory input file causes the data sequence 0.5 0.3 to alternate in the specified memory location 10 cycle intervals. 2000 1c3 2005 1cf the timed memory input file causes 1c3 to appear in the specified memory location at cycle 2000, and 1cf to appear at cycle 2005. f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
terminal input of data values motorola device i/o and peripheral simulation 5-7 if a lower case letter t is placed in a data position of the input file, you will be prompted for the next input data value as described in the section below titled, terminal input of data values. storage of pin data to an output file will occur any time the pins data value changes, including changes to tristate, 1, 0, h or l. in the timed output mode, the simulator cycle count and a data value are stored each time a word is written. in the untimed output mode, a single data value is stored each time a word is written. the simulator also provides a special mode that allows pin data input reception from the output of another pin without the necessity of an intermediate disk file. 5.10 terminal input of data values the simulator provides two levels of terminal data input. if the input command specifies term as the input filename, the simulator opens an editor, which allows creation of an input data file without leaving the simulator. the data file is given a temporary name, termxxxx.io or termxxxx.tio (xxxx being a numeral between 0000-9999), and is saved on the disk at the termination of the input command. you can specify the entire contents of the input file in this manner. a second level of terminal data input allows you to be prompted any time the next input data value is needed. this method is triggered if the lower case letter t is encountered in the data field of the input file. this is only valid for the data field, not for the time field. each time a t is encountered, you will be prompted for a single data value from the terminal. the simulator will read the input data using the radix specified in the input command. hexadecimal is the default input radix. if you just type the return key at the prompt, without entering a data value, the previous data value will be repeated. if you type the esc key at the prompt, an end-of-file status will be simulated and the previous data value will repeat forever. table 5-3. pin or pin group input data data sample explanations 001 this untimed reset pin input file causes the reset pin to go low for two cycles, then back high. 12000 0 12010 1 this timed irqa pin input causes the irqa pin to go low at cycle 12000, then back high at cycle 12010. (+200 0 +20 1)#9 this timed irqb pin input causes the irqb pin to go low after 200 cycles and stay low for 20 cycles. the sequence is repeated 9 times. f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
5-8 suite56 dsp simulator users manual motorola assigning an input file see section 6.3, "changing the radix," on page 6-2, for more advanced information about specifying your radix. 5.11 assigning an input file by providing an input file, you can retrieve simulated peripheral, memory location, or device pin data. if you are not sure about the valid peripheral and port names for the device that you are working on, use the simulators help periph and help port commands in the command window to obtain a list of the peripherals and ports. to provide input data: 1. from the file menu choose input then select open . the following dialog box appears: table 5-4. terminal input data data sample explanations (t#45) this untimed irqa pin input file prompts you for a new input value every 45 clock cycles. ffcc c1000 t ab12 t 6444 this untimed memory file input data prompts you for the third and fifth values that are read from the specified memory location. (+10 5555 +10 3333)#3 566 t 800 t this timed port input file prompts you for port input data at cycle 566 and 800 after alternating the input data sequence 5555 3333 three times at ten cycle intervals. f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
assigninganinputfile motorola device i/o and peripheral simulation 5-9 figure 5-1. providing input data 2. under input number select the number you want to assign to this input. the default number shown is the next available number.input numbers do not have to be consecutive they can be assigned arbitrarily, which means that you can assign input numbers in any way that helps you organize the sources of the inputs. 3. mark the checkbox labeled timed if the data contains time-data pairs. 4. under from select the source of the input data. select file if the input data comes from an existing file. select terminal if you will enter the input data directly from the keyboard. 5. under to select the data destination: memory space , port , pin , register ,ora peripheral 6. if the input data is being sent to a memory space, under memory select the memory space. then type the desired address in the address text box. assigning data to a memory address causes all subsequent reads of that memory address to reference the input source. you can use this method to simulate your unique f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
5-10 suite56 dsp simulator users manual motorola assigning an input file memory mapped peripherals, or to short-circuit the simulation of the on-chip peripherals. 7. if the input data is being sent to a port, under port select the name of the port. the list of available ports will vary depending on the device that you are targeting. to see a list of port names and their index and mask, type help port from the command line of the command window . 8. if the input data is being sent to a pin, under pin select the pin location. if the input receiving pin is a single location (as opposed to a range of pins) select the name of the pin under start . if you want the input data to go to a range of pins, select the names of the start and end pins in the appropriate drop-down box. to see a list of pin names and their indices, type help pin from the command line of the command window. 9. if the input data is being sent to a register, under register select the register. 10. if the input data is being sent to a peripheral, under peripheral select the name of the peripheral. the list of available peripherals varies depending on the device that you are targeting. to see a list of peripheral names with indices type help periph , from the command line of the command window . 11. under radix select the input datas number system (hexadecimal, decimal, etc.). 12. if the input data is coming from a file, under file name type in the name of the input file or click on the file button to browse for the file. the default filename extension is .io .the data file may contain only data, in which case each access to the object returns the next value in the data file. alternatively, the file may contain time/data pairs. in this case, each pair specifies the value to input at or after the specified cycle count. repeated accesses will return the same value until the simulated cycle count reaches the time specified in the next time/data pair. 13. click ok .if you are entering the data from the terminal (keyboard), the interactive input dialog box appears, which prompts you for the first data value. type in the first data value and click ok . after you enter a value and click ok , the interactive input dialog box appears, ready for the second data value. continue to enter values and click ok until you have entered all values. when you have entered all values, click cancel in the interactive input dialog box. the simulator creates a file in the working directory that contains the data you entered from the keyboard. the filename will be similar to term0000.io. you can reuse this file as you would any other input file. section 12.18, "input - assign input file," on page 12-24 provides a complete command description. f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
assigning an output file motorola device i/o and peripheral simulation 5-11 5.12 assigning an output file you can write a single data item from the default device to a file or to the session window (terminal). the data item may be a single memory location, a port, a range of pins, a peripheral, or execution history. you must establish a separate output file for each data item written. to create an output file: 1. from the file menu choose output then select open . the following dialog box appears: figure 5-2. creating an output file 2. under output number select the number you want to assign to this output. the default number shown is the next available number. output numbers do not have to be consecutive; they can be assigned arbitrarily, which means that you can assign output numbers in any way that helps you organize the output files. 3. mark the checkbox labeled timed if the data contains time-data pairs f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
5-12 suite56 dsp simulator users manual motorola assigning an output file 4. under to select the destination of the output file select file if the output data is to be written to a file. select terminal if you want to write the output data to the session window. 5. under from select the source of the data: a memory space, port, pin, register, a peripheral, history, or extended history.selecting history writes a record to the file for each instruction execution. the last record in the file is always the next instruction to be executed. selecting extended history writes a record for each execution cycle. the simulator logs additional execution history information to the output file, including device wait state cycles and bus arbitration cycles and indication of other stall conditions. the extra information is preceded by double asterisks in the log file.the output record contains a record number, the optional timing field containing the cycle number, and the data value. for the history file, the data is comprised of the pc (program counter), the instruction word(s) in hexadecimal, and the disassembled instruction. 6. if the output data is being written from a memory space, under memory select the memory space. then type in the address referencing the output data. assigning output to a memory address causes all subsequent writes of that memory address to write the data to the output file 7. if the output data is being sent from a port, under port select the name of the port. the list of available ports varies depending on the device that you are targeting.to see a list of port names and their index and mask, type help port from the command line of the command window . 8. if the output data is being sent from a pin, under pin select the pin location.if the pin that you want to send the data from is a single location (as opposed to a range of pins) select the name of the pin under start . if you want the output data to come from a range of pins, select the name of the start and end pin. to see a list of pin names and their indices, type help pin from the command line of the command window . 9. if the output data is being sent from a register, under register select the register. 10. if the output data is being sent from a peripheral, under peripheral select the name of the peripheral.the list of available peripherals varie depending on the device that you target. to see a list of peripheral names with indices, type help periph from the command line of the command window . 11. under radix selectthenumbersystem(hexadecimal,decimal, etc.)inwhichtheoutput data should be written. 12. if the output data is being sent to a file, under file name type in the name of the output file or click on the file button to browse for the file. the default filename extension f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
assigning an output file motorola device i/o and peripheral simulation 5-13 is .io .the simulator can store data only or time-data pairs. the output time value is always expressed in decimal. the output file is in ascii format. 13. click ok . section 12.24, "output - assign output file," on page 12-33 provides a complete command description. f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
5-14 suite56 dsp simulator users manual motorola assigning an output file f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
motorola simulator and device configurations 6-1 chapter 6 simulator and device configurations 6.1 introduction to simulator configuration you can specify a specific dsp configuration for each device. the selected device configuration determines the internal memory attributes and simulated peripherals. the simulator determines external memory access by the device configuration. to set the configuration of a device: 1. from the modify menu select device . then choose configure . 2. under device select the number of the device that you want to configure. 3. under configure select type . 4. under device type select the type of device that you want to simulate. 5. click ok . the simulator contains the predefined memory map of the default device type as the default memory configuration. you can configure the device to exit its reset state in a pre-defined operating mode. once the simulator is active, you can change the operating mode under program control by changing the value of the device operating mode register (omr). the mode pins are automatically configured to the default operating mode. you can set the operating mode that the device simulates following a simulated hardware reset when resetting the device registers and memory the full external memory map of the device is, by default, ram memory. the large external memory space is simulated using a virtual memory technique which automatically pages memory blocks to disk if the operating environment fails to allocate the required space in memory. by changing memory values, you can change the on-chip bootstrap and data rom areas. you can specify the bootstrap rom by using pr : as the memory space designator.you can specify the data roms by xr :or yr :. loading an assembler output file with the simulator load can also modify the bootstrap rom or data rom areas. you can reinitialize the rom areas by selecting reset from the execute menu, then selecting state . f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
6-2 suite56 dsp simulator users manual motorola setting the default device section 2.9, "resetting the device," on page 2-7 provides more information. 6.2 setting the default device you can specify a particular device as the default device. to set the default device: 1. from the modify menu choose device then select set default . the following dialog box appears: figure 6-1. set default device dialog box 2. under device select the number of the device that you are choosing as the default device (the current device). 3. click ok . the simulator applies commands to the default device. when you change the default device the session window and the command window automatically change to reflect the information for the new device. however, other windows such as the assembly window, source window, etc. do not automatically update themselves to reflect the new device. this allows you to display the information for separate devices in separate windows. to see the information for the new default device, open another assembly window, source window, etc. section 12.8, "device - multiple device simulation," on page 12-15 provides a complete command description. 6.3 changing the radix you can change the default radix (number base) that the simulator uses for command parameters and other values that you input. you can also change the radix used to display specific registers and memory locations. as an alternative to changing the default radix, you can also denote the number base of a value by preceding it with a dollar sign ( $ ), an apostrophe (), or a percent sign ( % ). f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
changing the radix motorola simulator and device configurations 6-3 $ value is hexadecimal value is decimal % value is binary the simulator begins with the default radix set to decimal for input and hexadecimal for most output. changing the default input radix allows you to enter values without having to type the radix specifiers before each value. to change the radix of input: 1. from the modify menu choose radix then select set default . the following dialog box appears: figure 6-2. set default radix dialog box note that the current default radix is automatically selected. 2. under radix select the number system to use. this system will be the default for values that you provide when performing commands. 3. click ok . 6.3.1 changing the radix in which to display a register or memory locations: 1. from the modify menu choose radix then select set display . the following dialog box appears: f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
6-4 suite56 dsp simulator users manual motorola loading simulator state files figure 6-3. set register or memory radix dialog box 2. under radix select the number system to use. 3. under registers select the register that will be displayed with the new radix. to select more than one register, hold down the ctrl key while clicking once on the register names. this does not affect the default input radix. 4. under memory select the memory space and addresses that will be displayed with the new radix. this does not affect the default input radix. 5. click ok . section 11.2, "displaying the radix," on page 11-2 provides more information about the radix; section 12.27, "radix - change input or display radix," on page 12-36 provides a complete command description. 6.4 loading simulator state files you can load a previously saved simulation state file. the state file acts like an initialization file which includes information about: ? the state of all dsp devices in the system, and their device type ? enabled registers, counters, status registers, peripheral registers, etc. ? the entire contents of memory ? the windows settings ? the command history buffer ? the session window output buffer for each device f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
loading simulator state files motorola simulator and device configurations 6-5 essentially, a state file contains all the information needed to exactly duplicate the condition of the simulator as it existed when it saved the state file. you can use a state file in several ways. for example, if you are in a long development session and want to take a break, save the simulator state to a state file so as not to lose your place. or, if a particular part of a program is proving troublesome, you can save the state just before the problem area, simplifying the setup for repeated attempts to isolate the problem. there are, of course, many reasons for saving the state of the simulator. to load a simulator state file: 1. from the file menu, choose load then select state 2. specify the name of the state file in the dialog box. 3. click on open . the current state of the simulator is replaced by the state information in the .sim file. f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
6-6 suite56 dsp simulator users manual motorola changing and saving window preferences 6.5 changing and saving window preferences you can save the window positions when you exit the simulator. thus, when you restart the simulator, it restores all windows to their positions on exit. to save window status on exit: 1. from the file menu choose preferences . figure 6-4. window preferences dialog box 2. mark the checkbox labeled save window status on exit . 3. click ok . f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
motorola debugging c source code 7-1 chapter 7 debugging c source code 7.1 introduction to debugging c source code the suite56 dsp simulator provides several features specifically used in debugging c source code. the following topics will help you understand how best to use the simulator for debugging c source code. (when you compile your source code, remember to include debug information.) section 12.1, "command overview," on page 12-1 also provides complete description of the commands discussed in this chapter. 7.2 displaying the call stack you can display the c function call stack beginning with the frame you specify. to display the call stack: 1. from the display menu choose call stack . 2. the following dialog box appears: figure 7-1. displaying the call stack f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
7-2 suite56 dsp simulator users manual motorola moving up and down the call stack 3. under frames , select whether you want to display the innermost or outermost frames. 4. under count , specify the number of frames you want to display. 5. click ok . if you are writing a script, it can be useful to use the where command to display the c function call stack. section 11.7, "stack window," on page 11-7 provides more information about the stack window. section 12.46, "where - gui c calls stack window," on page 12-51 provides a complete command description. 7.3 moving up and down the call stack you can move the current frame up and down the call stack. to move up the call stack: 1. from the modify menu choose up . the following dialog box appears: figure 7-2. moving up the call stack 2. under frames select the number of frames to move up in the stack. 3. click ok . the frame to which you moved is now the current starting point for evaluations. f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
moving up and down the call stack motorola debugging c source code 7-3 to move down the call stack: 1. from the modify menu choose down . the following dialog box appears: figure 7-3. moving down the call stack 2. under frames select the number of frames to move down the stack. 3. click ok . the frame to which you moved is now the current starting point for evaluations. see section 12.38, "up - move up the c function call stack," on page 12-47 and section 12.11, "down - move down the c function call stack," on page 12-19 for complete command descriptions. f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
7-4 suite56 dsp simulator users manual motorola dynamically displaying c function calls 7.4 dynamically displaying c function calls you can monitor the calls that are made by c functions by displaying the calls window. the calls window dynamically monitors the c function calls as they occur. to monitor c function calls: 1. from the windows menu choose calls . figure 7-4. dynamic display of c function calls the calls window updates as each instruction is executed. if the instruction contains no function call, three question marks are shown ??? to indicate that no function is recognized. 2. double-click on a stack level to select it as the expression context to evaluate expressions. each function call adds another stack frame, each return removes one. entry #0 is the most nested function, that is the top entry on the stack. the highest number is the main function. each entry shows a number to indicate the level to which the call is nested, the pc return address (i.e. the address after the function call), and the name of the function. the top level represents the entry to the debug monitor, and so indicates the next instruction to be executed. the call stack also indicates the context to use for evaluating c expressions. as each function may have its own copy of a named variable, it may be necessary to indicate which instance is required. f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
redirecting an i/o stream motorola debugging c source code 7-5 7.5 enabling/disabling i/o streams you can enable or disable stream i/o for c programs that are running on the current device. the standard stream files are supported: stdin, stdout, and stderr. any references by c programs to these files may be redirected to files on the host. stream file handling may be configured independently for each device. streams handling is enabled by default. if a c program attempts to access a stream file while it is not enabled and redirected, the access is ignored. output is discarded, and a standard value is supplied as input. to enable or disable the stream i/o: 1. from the file menu choose io streams . 2. select enable or disable . section 12.32, "streams - enable/disable handling of i/o for c programs," on page 12-42 provides a complete command description. 7.6 redirecting an i/o stream you can redirect an i/o stream from the current device to a file on the host. each stream file can be assigned individually; unwanted streams do not have to be redirected. streams can be redirected whether stream support is enabled or disabled; however, for the redirection to be effective, stream operations must be enabled. disabling stream support while a stream is redirected does not terminate the redirection. it merely makes it ineffective until streams are enabled again. to redirect the stream i/o: 1. from the file menu choose io redirect then select streams . 2. under streams select the type of stream that you want redirected: stdin , stdout , or stderr . 3. under file name specify the filename to redirect the stream or click on the file button to browse for the file. 4. click ok . to stop redirecting the stream i/o: 1. from the file menu choose io streams , then select off . 2. select the type of stream to stop redirecting. 3. click ok . f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
7-6 suite56 dsp simulator users manual motorola display the type of a c variable or expression to display redirected stream i/o: 1. from the display menu choose redirected io streams . 2. view the session window. the redirected stream will be listed with the filename to which the streams are being directed. section 12.28, "redirect - redirect stdin/stdout/stderr for c programs," on page 12-38 provides a complete command description. 7.7 display the type of a c variable or expression you can display the type of a c variable or expression. keep in mind that you might need to move up or down the call stack to select the desired expression context. you can also change the current context when monitoring c function calls. to display the type of a c variable or expression: 1. from the display menu choose type . the following dialog box appears: figure 7-5. displaying the type of a c variable or expression 2. type in the expression. remember to enclose c expressions in curly brackets. for example: {gi*i} 3. click ok . 4. the data type is displayed in the session window. if the result of the expression is a storage location (for example, a variable name or an element of an array), the address of the storage location will be displayed in addition to its data type. section 9.1, "introduction to expressions," on page 9-1 provides more information about expressions; section 12.35, "type - display the result type of c expression," on page 12-45 provides a complete command description. another useful tool for debugging c source code is the watch list. see section 1.8, "using a watch list," on page 1-9 for step-by-step instructions on setting up a watch list. f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
motorola macros, scripts and log files 8-1 chapter 8 macros, scripts and log files 8.1 creating and running a command macro the command macro is a useful tool for performing multiple simulator commands. the command macro is useful for performing commonly repeated tasks such as setting the path, loading source programs, and setting up watch windows. however, a macro can consist of almost any simulator command. the command macro is a standard ascii text file; you can create or edit it with any text editor. you can also create the macro by recording commands to a log file. to record a command macro : 1. from the file menu, choose log , then select commands . 2. specify the filename and save.the default filename extension is .cmd. a different extension can be used, for the sake of consistency we do not recommend this. if you specify a filename that already exists, you can choose to overwrite the file or append the new commands to the end of the existing file. 3. the log file is now recording all simulator commands, whether issued from the menu bar or from the command line in the command window. use the simulator commands just as you would during normal program execution. note that there is an exception. if you stop program execution while recording commands, the stop is not recorded. the only way to pause execution from within a macro is to use step, next, trace, until, wait or use a breakpoint. if you have any question about whether a command can be recorded, think of it this way: if it appears in the command window it is recorded. 4. to stop recording, from the file menu choose log , then select close . 5. from the dialog box select commands . 6. click ok . the command macro is now saved and can be replayed or edited. f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
8-2 suite56 dsp simulator users manual motorola logging output from the session window to run a command macro: 1. from the file menu, choose macro . 2. specify the file to run and click open .the command macro begins. the commands are displayed in the command window as they are executed. the commands are also echoed in the session window, along with any output that is generated. you can stop the command macro by choosing stop from the execute menu or by clicking on the stop button on the tool bar. section 2.6, "pausing execution with wait," on page 2-5 and section 2.8, "stopping program execution," on page 2-7 provide more information about stopping or pausing a command. section 12.21, "log - log commands, session, profile," on page 12-30 provides a complete command description. 8.2 logging output from the session window you can log all output that the simulator displays in the session window. this is especially useful if you are capturing information that spans several screens. to log output displayed in the session window: 1. from the file menu choose log , then select session . 2. specify the filename that you want to give the log file and click ok . the simulator writes all output that is echoed in the session window to the log file you specified. section 12.21, "log - log commands, session, profile," on page 12-30 provides a complete command description. f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
motorola expressions 9-1 chapter 9 expressions 9.1 introduction to expressions the simulator allows you to use an expression in most places where a constant is valid. for example, an expression can take the place of the start and stop location in the specification of an address range. an expression comprises a combination of symbols, constants, operators, and parentheses. expressions follow the conventional rules of algebra and boolean arithmetic. expressions may contain any combination of integers, floating-point numbers, memory space symbols and register symbols. 9.2 evaluate expressions you can evaluate dsp assembler expressions and c expressions and write the result to the session window. to evaluate an expression: 1. from the evaluate menu choose evaluate . the following dialog box appears: figure 9-1. evaluating an expression f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
9-2 suite56 dsp simulator users manual motorola using memory space symbols 2. under expression type the expression that you want to evaluate if the expression is a c expression, enclose it in curly braces: { c_expression } 3. under radix select the radix in which to display the result of the expression. c expressions display the type of the expression and the value in normal format for the expression type if all is selected.selecting all when evaluating a dsp assembler expression displays select radices depending on the expression itself. 4. click ok . the session window displays the result of your evaluation. c expressions are evaluated in the context of the current stack frame by default C that is, the value displayed is that which would have been returned if the expression had been included in the program at the current execution point. c expressions can be evaluated in the context of any of the functions on the call path to the current function. section 12.12, "evaluate - evaluate an expression," on page 12-20 provides a complete command description. 9.3 using memory space symbols the simulator evaluator interprets a memory space symbol followed by an expression as the contents of a memory location. use the simulators help mem command to obtain a list of the valid memory space prefixes and their corresponding address ranges. the following expression is converted to an integer constant in the address range of the dsp. some memory space symbols, such as p :or x: , require the evaluator to first read the device operating mode register (omr). others, such as xi :or pr: , refer to an exact memory location regardless of the chip operating mode. 9.4 using register name symbols the simulator evaluator interprets a register symbol as the contents of that register. to obtain a list of valid register names use the simulator help reg command on the command line in the command window note that some hexadecimal constants, such as a0 or d1 , may also be valid register names for the selected dsp. it is usually best to precede such hexadecimal constants by a dollar sign ( $ ) to distinguish them from registers of the same name. section 4.1, "displaying register values," on page 4-1 provides more information on register values. f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
using assembler debug symbols motorola expressions 9-3 9.5 using assembler debug symbols the simulator load command processes the symbol and line number information present in a coff format object file (.cld file) which has been generated with the assemblers Cg option. if symbol information has been loaded, the evaluator will accept symbol names or source file line numbers and translate them into an associated memory address. in general you can reference a symbol name in the simulator just as it was defined in the original source file, except that symbol names which conflict with a simulator register name must be preceded by the @ character. a symbol name may be further delimited by specifying a containing section name in the form section_name@symbol_name , with the @ character being used as the separator. the section name global may be used for the global section. if a symbol is specified without a preceding section name, the evaluator assumes the section containing the current pc. line numbers may be expressed simply as a decimal integer preceded by the @ character when referring to a line in the current source file. if an address field is being specified in a command, the line numbers preceding @ character may be omitted. a line number in a particular source file may be expressed in the form source_filename@line_number . below are valid forms of symbol names and line numbers: table 9-1. valid forms of symbol names and line numbers name form explanation symbol_name translates to the address associated with symbol_name example: change pc lab_d @symbol_name translates to the address associated with symbol_name example: disassemble @start_1 section_name@symbol_name translates to the address associated with symbol_name in section section_name example: display sec3@xdata @section_name@symbol_name translates to the address associated with symbol_name in section section_name example: display @sec3@xdata line_number translates to the address associated with line_number in the current source file. example: break 30 @line_number translates to the address associated with line_number in the current source file. example: change pc @30 f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
9-4 suite56 dsp simulator users manual motorola using constants 9.6 using constants constants represent quantities of data that do not vary in value during the execution of a program. 9.7 numeric constants numeric constants can be in one of three bases: ? binary constants consist of a percent sign ( % ) followed by a string of binary digits ( 0,1 ). for example: %11010 %1001100 ? hexadecimal constants consist of a dollar sign ( $ ) followed by a string of hexadecimal digits ( 0-9,a-f or a-f ). for example: $ff $12ff $12ff ? decimal constants can be either floating point or integer. integer decimal constants consist of a string of decimal (0-9) digits. floating-point constants are indicated either by a preceding, following, or included decimal point or by the presence of an upper or lower case e followed by the exponent. the special constants inf and nan can be used in floating-point expressions to represent the ieee floating-point values of infinity and not-a-number for dsp devices which operate with ieee floating-point values. for example: source_filename@line_number translates to the address associated with line_number in the named source file. example: change pc test.asm@30 @source_filename@line_number translates to the address associated with line_number in the named source file. example: change pc @test.asm@30 source_filename translates to the address associated with the first line in the named source file. example: list test.asm @source_filename translates to the address associated with the first line in the named source file. example: list @test.asm table 9-1. valid forms of symbol names and line numbers name form explanation f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
operators in expressions motorola expressions 9-5 12345 (integer) 6e10 (floating point) .6 (floating point) 2.7e2 (floating point) a constant can be written without a leading radix indicator by changing the radix. for example, a hexadecimal constant can be written without the leading dollar sign ( $ ) if the input radix is set to hex. the input radix defaults to decimal. section 6.3, "changing the radix," on page 6-2 provides more information about setting your radices. 9.8 operators in expressions you can use some of the evaluator operators with both floating-point and integer values. if one of the operands of the operator has a floating-point value and the other has an integer value, the integer will be converted to a floating-point value before the operator is applied and the result will be floating-point. if both operands of the operator are integers, the result will be an integer value. similarly, if both the operands are floating point, the result will be a floating-point value. operators recognized by the assembler include the following: unary operators: minus ( - ) negate ( ~ ) - integer only logical negate ( ! ) - integer only the unary negate operator will return the ones complement of the following operand. the unary logical negation operator will return an integer 1 if the operand following it is 0 and will return a 0 otherwise. the operand must have an integer value. arithmetic operators: addition ( + ) subtraction ( - ) multiplication ( * ) division ( / ) mod ( % ) f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
9-6 suite56 dsp simulator users manual motorola operators in expressions the divide operator applied to integer numbers produces a truncated integer result. the mod operator applied to integers will yield the remainder from the division of the first expression by the second. if the mod operator is used with floating-point operands, the mod operator will apply the following rules: y%z=yifz=0 =xifz<>0 where x has the same sign as y, is less than z, and satisfies the relationship: y=i*z+x where i is an integer. bitwise operators (binary): and ( & ) - integer only inclusive or ( | ) - integer only exclusive or ( ^ ) - integer only bitwise operators cannot be applied to floating-point operands. shift operators (binary): shift right ( >> ) - integer only shift left ( << ) - integer only the shift right operator causes the left operand to be shifted to the right (and zero-filled) by the number of bits specified by the right operand. the shift left operator causes the left operand to be shifted to the left by the number of bits specified by the right operand. the sign bit will be replicated. shift operators cannot be applied to floating-point operands. relational operators: less than ( < ) greater than ( > ) equal ( == )or( = ) less than or equal ( <= ) greater than or equal ( >= ) not equal ( != ) relational operators all work the same way. if the indicated condition is true, the result of the expression is an integer 1 . if it is false, the result of the expression is an integer 0 . for f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
operator precedence motorola expressions 9-7 example, if d has a value of 3 and e has a value of 5, then the result of the expression de is 0. each operand of the conditional operators can be either floating point or integer. test for equality involving floating-point values should be used with caution, since rounding errors could cause unexpected results. relational operators are primarily intended for use with the simulator break command. logical operators: logical and ( && ) logical or ( || ) the logical and operator returns an integer 1 if both of its operands are non-zero; otherwise, it returns an integer 0. the logical or operator returns an integer 1 if either of its operands is non-zero; otherwise it returns an integer 0. the types of the operands may be either integer or floating point. logical operators are primarily intended for use with the simulator break command. 9.9 operator precedence expressions are evaluated with the following operator precedence: 1. parenthetical expression (innermost first) 2. unary minus, unary negate, unary logical negation 3. multiplication, division, mod 4. addition, subtraction 5. shift 6. less than, greater than, less or equal, greater or equal 7. equal, not equal 8. bitwise and 9. bitwise eor 10. bitwise or 11. logical and 12. logical or operators of the same precedence are evaluated left to right. all integer results (including intermediate) of expression evaluation are 32-bit, truncated integers. valid operands include numeric constants, memory addresses, or register symbols. the logical, bitwise, f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
9-8 suite56 dsp simulator users manual motorola setting up and modifying a watch list unary negate, unary logical negation, and shift operators cannot be applied to floating-point operands. that is, if the evaluation of an expression (after operator precedence has been applied) results in a floating-point number on either side of any of these operators, an error will be generated. 9.10 setting up and modifying a watch list you can watch the contents of a specific memory location, register, or any arbitrary value or expression by setting up a watch window. watch items are kept on a watch list that gets updated every time program execution is stopped. the value or expression that you watch can be valid even if it is not calculated during program execution. c expressions can be used, enclosed in braces: {c_expression} . symbolic references can be used if symbols have been loaded from the object module. the values are re-calculated and output at each break in execution. to display a value in a watch list: 1. from the windows menu choose watch . the following dialog box appears: 2. select the window number where you want the expression to appear. you will want to do this when you have more than one watch window open. figure 9-2. displaying a value in a watch list f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
setting up and modifying a watch list motorola expressions 9-9 3. under expression , type in the expression that you want to appear in the watch window. 4. under radix , select the radix format in which you want the variables displayed. 5. click ok . the expression that you specified now appears in a watch window. if the expression you type is not valid, you will get an error message explaining why the expression is not valid. a c expression which refers to c variables can only be evaluated in the context in which the watch is established. that is, while all the variables used in the expression are in scope. so if one (or more) of the variables in an expression goes out of scope (either because a function call or return from a function), the value is replaced with the message expression out of scope . when all elements of the expression are back in scope, the value is again displayed. an expression which has gone out of scope because of function a call may be evaluated and displayed by selecting the stack frame for the evaluation context. the stack frame assignment remains in effect only until the next instruction is executed. an expression that is out of scope because of an exit from a function cannot be evaluated until the function is called again as its variables no longer exist. section 12.42, "watch - set, modify, view, or clear watch item," on page 12-49 provides a complete command description. a watch list can also be used in conjunction with the evaluate command. see section 9.2, "evaluate expressions," on page 9-1 for more information. f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
9-10 suite56 dsp simulator users manual motorola setting up and modifying a watch list f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
motorola simulator tool bar 10-1 chapter 10 simulator tool bar 10.1 using the tool bar you can use the toolbar to control program execution. the icons located on the toolbar duplicate the same kind of control commands found under the execute menu. the icons on the toolbar are: go button starts program execution from the next address. all breakpoints are observed stop button stops program execution or a command macro, if running. step button executes next instruction or line. next button executes next instruction or line. finish button allows the current function to execute to completion. device button allows setting of the default device to which all commands will be directed. repeat button repeats the last command in the history buffer. reset button resets the current device. f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
10-2 suite56 dsp simulator users manual motorola go button 10.2 go button the go button starts program execution from the next address. figure 10-1. go button section 1.10, "starting the execution of instructions with go," on page 1-13 provides more information about starting program execution. section 12.15, "go - execute dsp program," on page 12-22 provides a complete command description. 10.3 stop button the stop button stops program execution, or if a command macro is running, stops the macro. figure 10-2. stop button section 2.8, "stopping program execution," on page 2-7 provides more information about stopping program execution. f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
step button motorola simulator tool bar 10-3 10.4 step button the step button executes the next instruction or line. figure 10-3. step button if the source window is open, displaying the program source, the step button executes one line of code. otherwise, the step button executes one instruction. on encountering a jsr instruction, the simulator begins with the first instruction of the function, and steps through it one instruction at a time. to step one instruction at a time from the toolbar: 1. make sure that program execution is halted and that the source window is not open. 2. click on the step button on the toolbar.the simulator executes the next assembly instruction. to step one line at a time from the toolbar: 1. make sure that program execution is halted and that the source window is open. if the source window is not open, the simulator automatically executes the next instruction in the assembly window rather than then next line in the source window. 2. click on the step button on the toolbar. the simulator executes the next executable line of code in the source window. (comment lines in the source code are ignored.) notice that the values in the register window, the memory window, and all other simulator windows are updated each time you click on step . section 2.2, "step through instructions," on page 2-1 and section 2.4, "executing the next instruction," on page 2-3 provide more information about stepping through instructions. f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
10-4 suite56 dsp simulator users manual motorola next button section 12.31, "step - step through dsp program," on page 12-41 provides a complete command description. 10.5 next button the next button executes the next instruction or line. figure 10-4. next button if the next instruction to be executed calls a subroutine or begins execution of a function, all the instructions of the subroutine or function are executed before stopping. the enabled registers, memory, and other updated values are then displayed. in order to recognize functions, the symbolic debug information for the program code must be loaded. to execute the next instruction from the toolbar: 1. make sure that program execution is halted and that the source window is not open. 2. click on the next button on the toolbar. the simulator executes the next assembly instruction. f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
finish button motorola simulator tool bar 10-5 to execute the next line from the toolbar: 1. make sure that program execution is halted and that the source window is open. if the source window is not open, the simulator automatically executes the next instruction in the assembly window rather than then next line in the source window. 2. click on the next button on the toolbar. the simulator executes the next executable line of code in the source window. (comments lines in the source code are ignored.) notice that the values in the register window, the memory window, and all other simulator windows are updated each time you click on next . section 12.23, "next- step over subroutine calls or macros," on page 12-32 provides a complete command description. 10.6 finish button the finish button allows the current function to execute to completion. figure 10-5. finish button when stepping through a program, it is possible that execution will stop in the middle of a function or subroutine. clicking on the finish button completes the execution of the function or subroutine. the simulator continues until encountering an rts instruction. if another function is encountered during a finish operation, execution continues to the end of the current function. section 2.7, "allowing the current function to finish after an until condition or a breakpoint," on page 2-6 provides more information. section 12.13, "finish - execute f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
10-6 suite56 dsp simulator users manual motorola device button until end of current subroutine," on page 12-21 provides a complete command description. 10.7 device button the device button allows you to set the default device to which all commands will be directed figure 10-6. device button notice that when you designate another device as the default device that the session window and command window automatically reflect information for the new device. however, other windows such as the assembly window, source window, stack window, etc. must be specifically opened to reflect the information for the new default device. section 6.2, "setting the default device," on page 6-2 provides more information about setting default devices. section 12.8, "device - multiple device simulation," on page 12-15 provides a complete command description. f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
repeat button motorola simulator tool bar 10-7 10.8 repeat button the repeat button repeats the last command in the history buffer. figure 10-7. repeat button the repeat button repeats the last command in the history buffer - that is, listed in the command window. pressing this button is the same as clicking on the last command in the history buffer in the command window and pressing . section 11.3, "command window," on page 11-2 provides more details about the command window. f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
10-8 suite56 dsp simulator users manual motorola reset button 10.9 reset button the reset button resets the current device. figure 10-8. reset button the reset button generates a reset command for the current device. the device will be reset in the same operating mode. section 2.9, "resetting the device," on page 2-7 provides more information about resetting devices. section 12.29, "reset - reset device or state," on page 12-39 provides a complete command description. f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
motorola displaying information 11-1 chapter 11 displaying information 11.1 display the current breakpoints it is often useful to display the enabled and disabled breakpoints for the current device by opening the breakpoints window. to display the current breakpoints: 1. from the windows menu, choose breakpoints . a dialog box shows a list of the breakpoints set for the current device. the following dialog box shows an example of a list of six breakpoints. figure 11-1. displaying the current breakpoints disabled breakpoints such as the break #2 , are indicated with the word disabled . 2. double click on a breakpoint from the list to toggle it from disabled to enabled, or from enabled to disabled. breakpoints that were set by double clicking on the source window, such as break #5 above, are identified by the line number. breakpoints that were set by double clicking on the assembly window, such as break #6 above, are identified by the address. f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
11-2 suite56 dsp simulator users manual motorola displaying the radix 11.2 displaying the radix you can display the default radix (number base) that is currently used for command parameters and other values that you input. that is, the radix that is used when you type a value into a dialog box or at the command line. this is what is meant by the default radix. to display the current default radix: 1. from the display menu, choose radix . 2. the default radix is displayed in the session window. if the default radix for the simulator is set to decimal, this means that values can be entered in decimal without typing a preceding apostrophe (). if the default radix for the simulator is set to hexadecimal, this means that values can be entered in hexadecimal without typing a preceding dollar ( $ ). similarly, if the default radix is unsigned or binary, their respective specifiers do not need to be typed before the value. be careful to distinguish the input radix from the output radix. the default radix refers to the input radix. the output radix is the radix in which values are displayed. you can change the radix for a particular register or for a particular memory location. so be careful to note when you have changed the output radix of a particular register or memory location. section 6.3, "changing the radix," on page 6-2 provides more information about changing the radix. 11.3 command window the command window permits you to enter simulator commands on a command line. in this way, the command window provides an alternative to using the menu bar or the toolbar; the command line also let you monitor the syntax of the simulator commands. the command window is also a useful source of information in that it echoes the commands from the menu bar and from the toolbar. it also provides a source of history. the command history buffer holds the ten most recent commands. if the last command is repeated exactly, the duplicate is not stored. to display the command window: 1. from the windows menu, choose command . the command window appears: f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
command window motorola displaying information 11-3 figure 11-2. displaying the command window 2. notice that the device number is indicated. this is the device to which the commands are applied. in order to affect another device, the default device must be changed. the command window also provides device specific information that is not available elsewhere in the simulator. to display device specific information: 1. from the command line of the command window, type: help 2. a list of help topics is displayed in the session window. check the list for the device specific information that you are wanting. you might have to scroll back up the session window to see the whole list. 3. from the command line of the command window, type help followed by the name of the help topic. for example, to list the on-chip i/o registers and their addresses, type: help io the help information is displayed in the session window. some of this information can be lengthy, so it might be useful to log the session window output. see section 8.2, "logging output from the session window," on page 8-2 for information about logging output. f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
11-4 suite56 dsp simulator users manual motorola session window 11.4 session window the session window is the main output for the simulator. the session window displays: ? an echo of all commands input at the command line (from the command window) ? output from commands ? information from the display menu ? views of source code and assembly code ? registers and memory locations enabled for display at breakpoints and after execution ? error messages to display the session window : 1. from the window menu, choose session . 2. the session window opens. you will probably have to scroll and resize the window to be suitably visible. note that it is not possible to have more than one session window open at a time. the session window displays output for the current device only. however, each device writes output to its own buffer. that is, each device retains its own session buffer. in order to see the session window for another device, you must specify the other device as the current device. when another device is selected as the current device, the session window is refreshed with the buffer for that device. the session window buffers the last 100 lines of output. it might be necessary to scroll through the session window to see previous output. at times, you might have a command that displays more than 100 lines of output to the session window. in this case you will want to pause the output to the session window. to pause output to the session window: 1. from the display menu, choose more . then select on . 2. the session window will now pause if more than 100 lines of information are displayed at once. for example, if you perform a command such as typing help io from the command line, it is likely that the resulting output to the session window will be greater than 100 lines. the following dialog box will appear: f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
assembly window motorola displaying information 11-5 figure 11-3. pausing output to the session window 3. click on ok to display the next 100 lines in the session window. 11.5 assembly window the assembly window allows you to display and edit the contents of memory, set and clear breakpoints, and follow program execution. as the program executes, the display is updated at each break in execution. the next instruction to be executed is always displayed, highlighted in red. to use the assembly window : 1. from the windows menu, choose assembly . the assembly window appears: figure 11-4. using the assembly window 2. to scroll to a specific address, type the address in the box labeled scroll to address and press e nter . f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
11-6 suite56 dsp simulator users manual motorola source window 3. to edit an instruction single click on the mnemonic. notice that the mnemonic text is now highlighted. type the new assembly instruction and press e nter . notice that the next instruction is highlighted. in order to avoid accidentally typing over that instruction click on an area outside of the mnemonic. 4. breakpoints can be set, disabled, or cleared by double clicking on an address or label field. double click on the address or label to set the breakpoint. double click again on the address or label to disable the breakpoint. double click again on the address or label to remove the breakpoint. enabled breakpoints appear in blue. disabled breakpoints appear in pink. 11.6 source window the source window displays the source code that has been loaded in memory. the source code may reside in the directory containing the object module or any or the directories specified in the path. 1. from the windows menu, choose source the source window indicates the current program counter (pc) and highlights the corresponding source line red. to display the source window : figure 11-5. displaying the source window 2. you can use the source window to set halt breakpoints. to set or clear a breakpoint double-click on any line in the source window.the breakpoint is added to the breakpoint list, displayed in the breakpoint window and highlighted in blue in the assembly window. f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
stack window motorola displaying information 11-7 11.7 stack window you can watch the hardware stack by opening the stack window. to display the hardware stack: 1. from the windows menu, choose stack . the hardware stack will be displayed. section 7.1, "introduction to debugging c source code," on page 7-1 provides more information about the simulators hardware stack. f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
11-8 suite56 dsp simulator users manual motorola stack window f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
motorola command reference 12-1 chapter 12 command reference 12.1 command overview there are a total of fifty-two suite56 dsp simulator commands that you can perform from the command line. (the command line is a part of the command window.) these commands, and their syntax, are useful to know if you are writing a command macro. the simulator commands can be grouped into six categories: ? memory/register modification ? file i/o ? simulation execution control ? c source code debug commands ? miscellaneous tasks ? windows controls (used especially in writing command macros) 12.1.1 memory/register modification the following commands relate to modifying memory and registers. these allow you to: ? assemble (asm) dsp instructions ? change register or memory locations ? copy a block of memory to a new location ? disassemble code stored in the simulated dsp memory space ? display registers and memory values ? display the simulator revision number or memory configuration ? reset the device ?usethe history command to disassemble and display the previous thirty-two instructions executed by the device ?usea watch list to display a variable whenever single stepping or program execution is halted f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
12-2 suite56 dsp simulator users manual motorola command overview 12.1.2 file i/o the following commands relate to file input and output. these allow you to: ? input peripheral or memory location values from a file ? output peripheral or memory location values to a file ? load dsp assembler object module files or previous simulation state files ? log simulator commands, session display output or dsp program execution profile ? save simulator memory to an object module file or the simulator state to a state file 12.1.3 simulation execution control the following commands relate to control of program execution: ? specify break conditions ? go until a break condition is met ? step a specified number of instructions or cycles before displaying register and memory changes ? trace a specified number of instructions or cycles displaying register and memory changes at each step ?the next instruction operates essentially the same as the step instruction, except that if the instruction being executed calls a subroutine or function, execution continues until return from the subroutine or function. ?the until instruction has the effect of setting a temporary breakpoint at a specified address, executing until a breakpoint is encountered, then clearing the temporary breakpoint. ?the finish instruction executes instructions until the current subroutine or function completes. 12.1.4 c source code debug commands the following commands relate to debugging c source code: ? where to display the c function call stack ? up , down and frame are used to traverse the call stack ? redirect is used to redirect data from stdin/stdout/stderr to files ? streams enable the io streams ? type displays the data type of a variable, function or c expression f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
command overview motorola command reference 12-3 12.1.5 miscellaneous tasks the following commands include miscellaneous tasks: ? device specifies a new device and its device type ? evaluate evaluates expressions in five different radices ? help displays device specific information in the session window ? path defines the working directory and alternate directories ? quit ends a simulation session ? radix specifies the default number base (hex, decimal, etc.) used during expression evaluation and data entry or data display ? system executes an operating system command in two modes ? wait specifies a number of seconds to pause a macro before proceeding to the next command ? list displays a specified source file when symbolic debug is in effect ? view allows selection of the simulator display mode - source, assembly or register ? unlock provides password enabling of unannounced device types 12.1.6 windows controls the following commands control the display of windows and are particularly useful in writing command macros: ? wasm opens an assembly window displaying addresses, labels, and mnemonics ? wbreakpoint opens a breakpoint window displaying current breakpoints ? wcalls opens a c call stack window ? wcommand opens a command window ? winput opens an input window ? wlist opens a list window displaying contents of a specified file ? wmemory opens a memory window ? woutput opens an output window ? wregister opens a register window ? wsession opens the session window ? wsource opens a source window ? wstack opens a hardware stack window ? wwatch opens a watch window displaying expressions that have been specified for the watch list for more information about macros, see section 8.1, creating and running a command macro. f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
12-4 suite56 dsp simulator users manual motorola command syntax 12.2 command syntax the command syntax line contains special punctuation to indicate command keywords, required or optional fields, repeated fields, and implied actions. for example, the syntax of the display , evaluate , wait commands looks like this: d isplay [ on/off/r/w/rw ] [reg[_block/_group]/addr[_block]]... e valuate [ b (binary)/ d (dec)/ f (float)/ h (hex)/ u (unsigned)] expression/ { c_expression } w ait [count(seconds)] the punctuation of the syntax line includes: table 12-1. command syntax elements in motorola dsp documentation syntax syntax description caps capitalized words indicate command keywords. the user must enter command keywords exactly as shown (as opposed to variables or arguments that are provided by the user). command keywords can be entered in either uppercase or lowercase in the software tool. bold in the command syntax line, boldface is only used in command keywords. the portion of the command keyword shown in boldface represents the minimum portion of the keyword that must be typed in order for the command to be valid. the portion of the keyword that is not in boldface can be typed if desired, but is not required. for example, in the wait command, the user only needs to type the letter w for the command to be recognized. / the slash is used to separate a list of mutually exclusive choices. the slash is not entered as a part of the command. for example, in the evaluate command, the first parameter can be one, and only one, ofthefollowing:b,d,f,h,oru. () parentheses surround a description of an implied action. this is included to help clarify some of the abbreviations used in the command syntax line. neither the parentheses nor the description within are entered as part of the command. for example, when entering the evaluate command, the optional first parameter consists of one letter. the words binary, dec, float, hex, and unsigned are only included in the command syntax line for clarity. ... an ellipsis (three consecutive periods) indicates that a parameter can be repeated several times in a command line. for example, the display command can specify multiple registers (or register blocks). [ ] square brackets indicate enclose command parameters that are optional. the brackets themselves are not entered as a part of the command. for example, in the wait command the count parameter is optional. f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
command parameters: list of abbreviations motorola command reference 12-5 12.3 command parameters: list of abbreviations many of the command parameters, such as addr and reg , are abbreviations. the following is a list of abbreviations used for parameters on the command syntax line: table 12-2. command parameter abbreviations abbreviation meaning addr an address may be specified as a source file line number or as a symbol name if a previously loaded coff object file contains symbolic debug information. otherwise, a memory space designator must be used. use the help mem c ommand from the command line of the command window t o obtain a list of the valid memory space prefixes. addr_block addr .. location/addr # count bn break number. a decimal integer constant in the range 1 to 99. break_action h (halt)/ i n(increment cntn)/ n (note)/ s (show)/ x [command] count positive integer expression in range 1 to $7fffffff. dev_num device number in the form dvn , where n represents the number of the device. range is dv0 to dv31 . dev_type device type. expression any arithmetic expression valid for the dsp assembler. register names can also be used in the expression. c_expression any expression valid in the current c program. a c_expression must be enclosed in curly braces: { } file any valid filename, including relative and absolute paths. ioradix -rd (decimal)/ -rf (float or fractional)/ -rh (hexadecimal)/ -ru (unsigned) location integer expression. it will be mapped into the device address range. for ex-ample, -1 translates to the maximum address. mode device operating mode in the form mn . pathname any valid pathname. periph valid peripheral names are displayed by the simulator help periph command. pin validpinnamesaredisplayedbythesimulator help pin command. a pin name may optionally be preceded by pin: in order to resolve conflicts that may exist between pin and register names or constants. pin_block pin .. pin port valid port names are displayed by the simulator help port command f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
12-6 suite56 dsp simulator users manual motorola command parameters: list of abbreviations reg valid register names are displayed by the simulator display all command . a register name may optionally be preceded by reg: in order to resolve conflicts that may exist between register and pin names or constants. reg_block reg .. reg reg_group an address may be specified as a source file line number or as a symbol name if a previously loaded coff object file contains symbolic debug information. otherwise, a memory space designator must be used. use the help mem c ommand from the command line of the command window t o obtain a list of the valid memory space prefixes. topic addr .. location/addr # count table 12-2. command parameter abbreviations (continued) abbreviation meaning f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
asm - single line interactive assembler motorola command reference 12-7 12.4 asm - single line interactive assembler a sm [ b (byte wide)] [(beginning at)addr] [assembler_mnemonic] the asm command allows you to create or edit dsp object code in memory using assembly language mnemonics. the assembler mnemonic is immediately converted into machine language code and stored in memory. the line of assembly source code is not saved. [ b (byte wide)] optional. when provided, this parameter causes the assembler_mnemonic to be divided and stored as a sequence of single bytes. this option is typically used to store a program as a byte-wide program in the bootstrap rom area of the target device. this option could also be used to store a byte-wide program in external memory, which might hold, for example, overlay program code. [(beginning at)addr] optional. the addr parameter specifies the beginning address to be edited. the address can be in any of the memory maps (p, x, y, pr, etc.) of the target device. (the y memory is only valid for dsp56000 and dsp96002 family members. use the simulators help mem command to obtain a list of the valid memory space prefixes.) if no address is specified, assembly begins in the p (program) memory space using the cu rrent program c ounter value as the beginning address. the pr memory designation specifies the special bootstrap rom area of the dsp. [assembler_mnemonic] optional. the mnemonic to be written to memory. if no assembler_mnemonic is specified on the command line, an interactive mode of the asm command will be initiated. invoking the intereactive mode causes the object code at the begin ning address to be disassembled and displayed on the screen. you can then edit the instruction. if the new instruction cannot be assembled correctly an error message is displayed on the error line of the command window and the cursor is placed at the point of error. pressing the esc key causes the interactive asm command to terminate. table 12-3. asm commands command resulting simulator action asm p:$50 starts the interactive assembler at address 50 (hex) in p memory asm x:0 move r0,r1 writes the instruction move r0,r1 to address 0 in the x memory space. asm starts the interactive assembler at the current program counter value. asm lab_d+5 starts the interactive assembler at symbolic address lab_d+5. asm myfile.asm@7 starts the interactive assembler at the address corresponding to myfile.asm line 7. f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
12-8 suite56 dsp simulator users manual motorola break - set, modify, or clear breakpoint 12.5 break - set, modify, or clear breakpoint b reak [ # bn] [expression] [break_action] b reak [ # bn] r ( read )/ w ( write )/ rw ( access ) reg/addr[_block] [break_action] b reak [ # bn[,bn,...]] off / e (enable)/ d (disable) b reak [ # bn] dr ( dma read )/ dw ( write )/ drw ( access ) addr[_block] [break_action] the break command can be used to set, modify, or clear a breakpoint condition and to specify the action that occurs if the breakpoint condition is true. the break command has four possible forms as indicated by the four command syntax lines above. the first form causes a break condition if the evaluated expression is non-zero. the second form causes a break c ondition if a selected register or memory location is accessed by the core. the third form permits a breakpoint, or list of b reakpoints, to be selectively enabled, disabled or deleted. the fourth form causes a break condition if a selected memory location is accessed by a dsp dma (direct memory access) controller. it is valid only for devices with on-chip dma controllers. [#bn] optional. break number. the break number is used to assign a number to a breakpoint definition or to specify an existing b reakpoint. a break number can be any positive decimal integer in the range 1 to 99. if you do not specify a breakpoint number, the simulator automatically assigns the lowest unused number. [expression] optional. a breakpoint expression can be any logical expression that is valid for the dsp assembler. if the .cld file contains c symbolic debug information, breakpoint expressions can include any valid c expression for the program. (remember to enclose c expressions in curly brackets.) another useful form of a breakpoint expression breaks at an address only when the opcode from that memory location is being decoded for next cycle execution. other forms of the breakpoint expressions that check the value of the pc register or check for a read of a p memory location are less definitive due to the pipelined p refetch of the device. this special form of breakpoint is indicated by specifying the breakpoint expression as a single address in p memory. asm b y:$040100 performs byte-wide assembly from address $40100 in the pr memory space. each byte of the instruction is stored in successive locations, so that two or three locations are required to store each 16- or 24-bit instruction. if assembled into program memory, this code cannot be executed directly; it is intended for use with code similar to the byte-wide loader in the rom bootstrap code. byte-wide assembly may be used interactively (as in this example) or to assemble a single instruction. table 12-3. asm commands command resulting simulator action f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
break - set, modify, or clear breakpoint motorola command reference 12-9 the following is a list of operators that can be used in the breakpoint expression: table 12-4. breakpoint operators operator operator function < less than && logical "and" <= less than or equal to || logical "or" == equal to ! logical "negate" >= greater than or equal to & bitwise "and" > greater than | bitwise "or != not equal to ~ bitwise ones complement + addition ^ bitwise "exclusive or" - subtraction << shift left / division >> shift right f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
12-10 suite56 dsp simulator users manual motorola break - set, modify, or clear breakpoint see chapter 5, "device i/o and peripheral simulation," on page 5-1 for more detailed information on expression evaluation. the breakpoint expression usually involves comparison of register or memory values. any register name may be used in an expression. there are also two special flag variables that may be referenced in the breakpoint expression: [break_action] optional. the simulator can take various actions when a breakpoint is encountered during dsp program execution. if no break_action parameter is entered, the default action is to halt program simulation and to display all enabled registers and memory blocks. alternative simulator actions can be specified by entering one of the following break_action parameters: table 12-6. break_action parameters r (read)/ w (write)/ rw (access) used with the second form of the break command. indicates the type of access (read, write, or both) of a register or address that should be detected in order for the breakpoint condition to be true. reg/addr[_block] register or address (or address block). a range of addresses can be specified in two ways. one way is to type the beginning address followed by two periods and the ending adress. for example: table 12-5. flag variables in a breakpoint expression variable expression returns eof true if an end-of-file condition occurs in an input file assigned to a peripheral or memory location. jump true if a "jump" change of flow occurs during code execution. parameter resulting simulator action h halts execution. this is the default when no break_action is specified. i n increments the n counter register (cnt n) , where n represents the number of the counter to increment. there are four possible counters (n=1..4). n note - displays the breakpoint expression in the session window and continues with execution. s show - displays the enabled register/memory set in the session window and continues with execution. x executes a simulator command at the breakpoint. the command can be any valid simulator command, except for commands that are related to device execution. device execution commands, such as step, trace or go, will not execute. f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
break - set, modify, or clear breakpoint motorola command reference 12-11 p:$101..p:$107 . another way is to type the beginning address followed by the pound sign and the size of the range. for example, to specify a range from address p:$101 to p:$107 type: p:$100#7. if the .cld file contains symbolic debug line number information, breakpoint addresses may also be specified by using line numbers in source code that correspond to an address in memory. [ # bn[,bn,...]] optional. break number(s). used with the third form of the break command to specify one or more break numbers. each break number should be separated by a comma. consecutive numbers can be represented by two periods. for example, to indicate break numbers 3 through 8, type: #3..8 off / e ( enable )/ d ( disable ) used with the third form of the break command. this form of the beak command is used to indicate that the breakpoint should be removed ( off ), enabled ( e ), or disabled ( d ). dr (dma read)/ dw (write)/ drw (access) used with the fourth form of the break command. indicates the type of access by a dsp dma (direct memory access) c ontroller that should be detected for the breakpoint condition to be true. f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
12-12 suite56 dsp simulator users manual motorola break - set, modify, or clear breakpoint table 12-7. break commands command resulting simulator action break display all currently enabled breakpoints. break off remove all breakpoints. break #1,3,5..9 off remove breakpoints numbers 1, 3 and 5 through 9. break pc>=$500 halt dsp program simulation and display enabled registers and memory when the program counter register is greater than or equal to hexadecimal 500. break (lc<10)&&(pc>100) halt if the loop counter is less than 10 and the program counter is greater than 100. break jump n display breakpoint message if a jump change of flow occurs during execution. break eof||pc>$fff halt if an end of file condition occurs in an assigned peripheral input file or if the program counter is greater that hexadecimal fff. break r0==r1 halt when the value of register r0 equals the value of register r1. break lc>0&&jump i1 increment variable cnt1 if a jump occurs and the loop counter is greater than 0. break r r0 halt if register r0 is accessed for a read operation. break p:100 halt if the execution address is p:100. break w lc halt if the loop counter register is written during code execution. break 10 x evaluate h r0 set a breakpoint at the address corresponding to line 10 of the current source file. execute the simulator command "evaluate h r0" when the breakpoint occurs. break myfile.asm@20 set a breakpoint at the address corresponding to line 20 of source file myfile.asm. break r xdat..xdat+50 halt if a read occurs from one of the 50 addresses beginning at the address associated with the symbol xdat. break rw p:30..40 s display enabled registers and memory and continue program simulation if any program memory location from decimal 30 to 40 is accessed. break #1..10 d disable breakpoints numbers 1 through 10. break {j==2} halt if the c expression "j==2" is true. break e enable all breakpoints. f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
change - change register or memory value motorola command reference 12-13 12.6 change - change register or memory value c hange [register[_block]/addr[_block] [expression]]... the change command can be used to change the value of a register, memory location, block of registers, or block of memory. [register[_block]/addr[_block] optional. the regist er(s) or adress(es) to be changed. a re gister block is represented by two register names separated by two periods. for example, r0..r3 means registers r0 through r3. a memory block can be specified using start_addr # count, where count represents the size of the block. an address block can also be specified with start_addr..end_addr . for example: p:$5#20 indicates 20 locations beginning from program memory location 5; p:5..24 indicates program memory locations 5 through 24. [expression]] optional. the expression to write to the specified register or address. the expression can be a simple constant value or a complex expression with multiple operators and operands. a more extensive discussion of valid expressions is presented in chapter 5, "device i/o and peripheral simulation," on page 5-1. multiple register names, memory locations and expressions can be specified on the same command line. each specified destination must be followed by the value or expression to be assigned to it. an interactive mode of the change command can be initiated by specifying a single register or memory location without an associated expression. in this mode each register or memory location can be examined and optionally modified. typing the esc key causes the interactive mode of the change command to terminate. table 12-8. change commands command resulting simulator action change pc displays register values individually starting with the program counter and prompts you for new values. change xi:$55 displays internal x memory location hexadecimal 55 and prompts you for a new value. change p:$20 $123456 changes the value at p memory address hexadecimal 20 to hexadecimal 123456. change xdat $234 changes the value at the x memory address that corresponds to symbolic label xdat to hexadecimal 234. change xdat..xdat+5 35 changes the values in the memory block beginning at the address corresponding to symbolic label xdat and ending at xdat+5 to decimal value 35. f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
12-14 suite56 dsp simulator users manual motorola copy - copy a memory block 12.7 copy - copy a memory block co py (from)addr[_block] (to)addr the copy command copies memory blocks from one location to another. the source and destination memory maps may be different. this allows you to move data or program code from one memory map to another or to a different address wi thin the same memory map. (from)addr[_block] the memory address or memory address block from which to copy. a memory block can be specified using start_addr # count, where count represents the size of the block. an address block can also be specified with start_addr..end_addr . for example: p:$5#20 indicates 20 locations beginning from program memory location 5; p:5..24 indicates program memory locations 5 through 24. (to)addr the memory address to which the data will be copied. if an addr_block was specified, this address will be the beginning address to which the data will be copied. change r0..r3 0 pi:$30..$300 0 x:$fffe $55 pc 100 changes the values in registers r0 through r3 to 0, internal p memory addresses hexadecimal 30 through 300 to 0, x memory address hex fffe to hex 55 and the program counter to decimal 100. table 12-9. copy commands copy pi:$100..$500 x:$500 copies the values located in internal program memory, addresses hexadecimal 100 through hexadecimal 500 to x memory starting at address hexadecimal 500. copy x:0#100 p:0 copies one hundred memory locations beginning at x memory address 0 to p memory beginning at address 0. copy lab_1#100 lab_2 copies one hundred memory locations beginning at the memory location corresponding to symbolic label lab_1 to memory beginning at the address corresponding to symbolic label lab_2. copy xdat..xdat+40 ydat copies 40 memory locations beginning at the address corresponding to symbolic label xdat to the block beginning at the address corresponding to symbolic label ydat. copy p:0..20 p:40 copies p memory addresses 0 through 20 to p memory addresses 40 through 60. table 12-8. change commands (continued) command resulting simulator action f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
device - multiple device simulation motorola command reference 12-15 12.8 device - multiple device simulation de vice [ dv n [dev_type/ on / off / x ]] the device command allows you to create and manage simulated target systems consisting of multiple dsp devices. it allows you to add a simulated device on which commands can be executed, to disable or enable existing devices, or to delete a device. if the device command is typed with no parameters, a list of all the possible device numbers that you can assign will be displayed including each devices status and device type. dv n optional. device munber. the device number is a number assigned to a particular device. the number is in the form dvn , where n is an integer from 0 to 31. (a target system can be comprised of up to 32 devices.) if the device command is executed with a device number and no dev_ type, the device number specified will become the default device. if the device does not yet exist, it will be created with the default device type and made active. [dev_type] optional. specifies the device structure to be simulated by device dvn . non-disclosed devices must be unlocked with the unlock command prior to using the device command. on optional. enables the specified device (dvn). this means that the device will respond to commands that cause device execution ( go , step or trace ). during execution cycles, each enabled device executes a single clock cycle in turn. device to device pin interconnections specified by the input command are updated following each cycle for active devices. off optional. disables the specified device (dvn). disabling a device causes the device to not respond to commands that cause device execution ( go , step or trace ). x optional. deletes device dvn. if device dvn is the current device, it will be deleted and another device will become the current device. the simulator requires at least one device to be allocated, which means that it is not possible to delete the current device if it is the only device in the target system. table 12-10. device command command resulting simulator action device displays a list of all devices and their current status. also displays the list of possible device types. device dv9 makes device dv9 the current device. if device dv9 does not exist, creates device dv9. because no device type is specified, it is initialized with the default device type. device dv1 on enables device dv1 cycle execution. if device dv1 doesnt exist, creates it with the default device type. device dv0 56116 creates device dv0 and initializes it as device type 56116. f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
12-16 suite56 dsp simulator users manual motorola disassemble - object code disassembler 12.9 disassemble - object code disassembler di sassemble [ b (byte wide)] [addr[_block]] the disassemble command allows you to review dsp object code in its machine language and assembly language mnemonic format. invalid opcodes are disassembled to a define constant (dc) mnemonic. [b (byte-wide)] optional. constructs the instruction words by taking one byte from each word of memory, starting from the specified address. [addr[_block] optional. specifies the address or range of addresses to disassemble. (symbolic labels, and line numbers in source code that co rrespond to an address in memory can also be used.) a range of addresses can be specified by typing start_addr # count, where start_addr is the first address of the block and count represents the size of the block. an address block can also be specified by typing start_addr..end_addr . for example: p:5#20 indicates 20 locations beginning from program memory location 5; p:5..24 indicates program memory locations 5 through 24. if no address is specified, the next 20 instructions will be disassembled, beginning with the address indicated by the value in the program counter. table 12-11. disassemble commands command resulting simulator action disassemble disassemble the next 20 instructions beginning with instruction pointed to by the program counter. repeatedly entering this command will result in consecutive 20 instruction blocks being disassembled. disassemble pr:0..20 disassembleprogram bootstrap rom memory address block 0 to 20. disassemble lab_1..lab_2 disassemble memory address block beginning at the address corresponding to symbolic label lab_1 and ending at lab_2 . disassemble xdat#20 disassemble10 instructions beginning at the address corresponding to symbolic label xdat . disassemble 7 disassemble instructions beginning at the address corresponding to line 7 in the current source file. disassemble test.asm@8 disassemble instructions beginning at the address corresponding to line 8 in the source file test.asm . disassemble x:$50#10 disassemble10 instructions starting at x memory map hex 50. disassemble b y:$1000#$40 disassemble40 instructions starting at address y:$1000. the instruction words are constructed by taking one byte from each location; thus depending on the target processor, two or three locations are required to hold each instruction word. f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
display - display register or memory motorola command reference 12-17 12.10 display - display register or memory d isplay [ on / off / r / w / rw ] [reg[_block/_group]/addr[_block]]... d isplay v (version) the display command allows you to examine the contents of a specific register, a register group or a memory block. it can also be used to enable, conditionally enable, or disable the particular registers or memory locations that are displayd when a debug command such as step or trace is executed. you can also display the simulator version number. entering the display command with no parameters will display all enabled registers and memory blocks in the session window. the default radix for the display of most registers and memory locations is hexadecimal. however, you can specify the display radix of each register and memory location individually by using the radix command . [ on / off / r / w / rw ] registers and memory locations can be enabled or disabled by entering the command with one of these keywords: the r, w, and rw functions initiate the accumulation of a list of accesses from display to display. all accesses to register locations can be saved. the memory lists store a maximum of 16 memory accesses (for each memory space). if more than 16 locat ions were accessed since the previous display, only the last 16 will be stored. register and memory locations that have been accessed for a write operation are highlighted when displayed. table 12-12. display enable keywords enable keyword resulting simulator action on enables the specified registers and memory locations so that they are always automatically displayed when program execution is stopped. if no registers or memory locations are specified, all registers are enabled for display. off disables the specified registers and memory locations so that they are not automatically displayed when program execution is stopped. if no registers or memory locations are specified, all registers and memory locations are disabled for display. r displays the following registers and memory locations if they were accessed for a read operation since the last display. w displays the following register and memory locations if they were accessed for a write operation since the last display. rw displays the following register and memory locations if they were accessed for read or write operations since the last display. f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
12-18 suite56 dsp simulator users manual motorola display - display register or memory [reg[_block/_group]/addr[_block]]... optional. the register(s) or address(es) to display. entering the display command with a register or address parameter, but without one of the "enable" keywords, will cause immediate display of the registers/addresses locations. this does not affect their "enable" status. peripheral names can be used in the place of register names to enable or display all the registers associated with that peripheral. the valid peripheral names for the selected device can be obtained by using the simulators help periph command. the word all can be used to enable or display all of the device registers. v (version) entering the display command with the single parameter v will display the simulator version number in the session window. table 12-13. display commands command resulting simulator action display on enables all registers for display display on pi:0..20 xi:30..40 enable internal p memory address block 0 to 20 and internal x memory address block 30 to 40 for display. display off display on core ssi0 disables display of all registers and addresses, then enables display of the dsp core registers and the ssi0 peripheral registers. display w r0..r3 x:0..100 displays registers r0 through r3 and x memory locations 0 through 100 if they have been written to since the last display. table 12-14. display commands without enable keywords command resulting simulator action display immediately displays all currently enabled registers and memory. display p:0..300 immediately displays p memory addresses 0 through 300. display test.asm@7 immediately displays memory location corresponding to line 7 of source file test.asm. display xdat immediately displays memory location corresponding to symbolic label xdat. display all immediately displays all registers plus the enabled memory locations. f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
down - move down the c function call stack motorola command reference 12-19 12.11 down - move down the c function call stack do wn [n] the down command is used to move down the call stack. it can be used in conjunction with the where , frame ,and up commands to display and traverse the c function call stack. after entering a new call stack frame using down , that call stack frame becomes the current scope for evaluation. this means that for c expressions, the evaluate command acts as though this new frame is the proper place to start looking for variables. [n] optional. the number of frames to move down. if no number is specified, the simulator moves down one frame in the call stack. table 12-15. down commands command resulting simulator action down moves down the call stack by one stack frame. down 2 moves down the call stack by two stack frames. f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
12-20 suite56 dsp simulator users manual motorola evaluate - evaluate an expression 12.12 evaluate - evaluate an expression evaluate [ b (binary)/ d (dec)/ f (float)/ h (hex)/ u (unsigned)] expression/ { c_expression } the evaluate command is used as a calculator for evaluating arithmetic expressions or for converting values from one radix to another. [ b (binary)/ d (dec)/ f (float)/ h (hex)/ u (unsigned)] optional. specifies the radix in which the result of the expression will be displayed. if a radix is not specified in the evaluate command line, the current default radix (specified by the radix command ) will be used. expression/ { c_expression } an expression consists of an arithmetic combination of operators and operands. an operand can be a register name, a memory location, or a constant value. the order of evaluation of an expressions operators will be associated from left to right. parentheses can be used to force the order of evaluation of the expression. a more extensive discussion of the expressions which are valid for the evaluate command is presented in chapter 5, "device i/o and peripheral simulation," on page 5-1. when values held in the devices re gisters or memory spaces are used in an expression that involves a multiply op erator, the display radix (specified by the radix command ) will determine whether the operation executed is a floating point or integer multiply. table 12-16. evaluate commands command resulting simulator action evaluate r0+p:$50 adds the value in r0 register to the value in program memory address hexadecimal 50 and displays the result using the default radix. evaluate b $345 converts hexadecimal 345 to binary and displays the result. evaluate lab_d displays the address of the location associated with symbolic label lab_d . evaluate {count} displays the value of the c variable count . evaluate h %10101010&p:r0 calculates the bitwise and of the program memory address specified by the value in r0 register and the binary value 10101010 and displays the result in hexadecimal. f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
frame - select c function call stack frame motorola command reference 12-21 12.13 finish - execute until end of current subroutine f inish the finish command executes instructions until the current subroutine or function call is completed. this is useful if execution has for some reason been halted in the middle of a subroutine or function. 12.14 frame - select c function call stack frame fr ame [ # n] the frame command is used to select the current call stack frame. it can be used in conjunction with the where , down ,and up command s to display and traverse the c function call stack. [ # n ] optional. specifies the number of the frame in the call stack which will be selected as the current call stack frame. after entering a new call stack frame using the frame command , that call stack frame becomes the current scope for evaluation. the frame command executes instructions until a return -from- subroutine (rts) instruction is executed within the current subroutine. the simulator simply steps, checking if any instruction is an rts. if so, that rts is executed, and instruction execution halts immediately afterward. while stepping, if a branch to subroutine or jump to subroutine instruction is encountered, tests for the rts instruction are suspended until execution resumes at the address following the subroutine call.. table 12-17. frame commands command resulting simulator action frame #2 selects call stack frame number two. frame #0 selects call stack frame number zero (innermost frame). f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
12-22 suite56 dsp simulator users manual motorola go - execute dsp program 12.15 go - execute dsp program g o [(from)location/ r (reset)] [(to break number) # bn] [(occurrence) : count] the go command begins execution of dsp code. the simulator fetches, de-codes, and executes instructions in the exact manner as the device that is being simulated. the go command will pass control to the simulator until a breakpoint is reached, or until program execution is otherwise stopped. entering the go command with no parameters will start simulation from the current program counter value. [(from)location/ r (reset)] optional. the location parameter represents the address, symbolic label or line number (if symbolic debug information has been loaded) from which execution will begin.the reset ( r ) parameter causes a simulation of the reset sequence in the processor. the device registers are reset and execution begins at the reset exception address. if an address or reset parameter is inc luded, the instruction pipeline, instruction counter, and cycle counter will be cleared before program execution begins. [(to break number) # bn] optional. the optional # bn parameter may be used to cause execution to halt if the breakpoint condition represented by break number # bn occurs. all other b reakpoint conditions are ignored. [(occurrence) : count] optional. the :count parameter causes execution to halt only if the breakpoint has occurred count times. if # bn is not specified, simulation will stop if count number of breakpoint conditions have occurred. table 12-18. go commands command resulting simulator action go starts program simulation from the current instruction. stops at the first occurrence of any breakpoint. go $100 starts program simulation at program memory address hex 100 after clearing the instruction pipeline. stops at the first occurrence of any breakpoint. go r clears the simulator pipeline and starts program execution at the reset vector. the simulated machine state is also reset according to the processor reset sequence. go #5 begins execution from the current instruction. halts on the first occurrence of breakpoint number 5. go #5 :3 begins execution from the current instruction. halts on the third occurrence of breakpoint number 5. go lab_d #5 :3 starts execution from symbolic address lab_d after clearing the simulator pipeline. halts on the third occurrence of breakpoint number 5. f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
help - simulator help text motorola command reference 12-23 12.16 help - simulator help text h elp [command/reg/topic] the help command provides syntax and examples of simulator commands, descriptions of device register bit fields, and help on other topics related to device or simulator operation. if no keyword is entered the simulator displays a summary of the possible help topics. [command/reg/topic] optional. the command, register, or topic for which to display help. if the keyword is a command name the simulator displays a summary of that commands parameters along with a brief description and examples. if the keyword is a register name the simulator displays the specified registers contents along with the help text associated with the register. table 12-19. help syntax the topic keywords in table 12-20 provide online help for the described topics. table 12-20. list of help topic keywords command resulting simulator action help displays a summary of all available commands and their parameters. help asm displays a summary of the assemble command and its parameters. help omr displays the contents of the dsps operating mode register. keyword help topic io list of on-chip io registers and their addresses int list of interrupt vector addresses for the device periph list of peripheral names pin list of pin names and numbers, and the current pin states port list of port names mode initial chip operating mode summary map memory map descriptions for various omr settings mem memory names with block addresses sym display program symbol table names and values reg display register size, register and peripheral index stack display of values on the device stack f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
12-24 suite56 dsp simulator users manual motorola history -disassemble previously executed instruction 12.17 history -disassemble previously executed instruction hi story the history command disassembles and displays the previous 32 instructions executed by the device. the instructions are displayed in the order that they were executed, with the most recent instruc tion appearing at the bottom of the list. the last instruction in the list has been fetched and decoded by the device and will enter the execute phase in the next device cycle. it is in the same state as instructions that are disassembled and displayed at the end of each trace display. a typical use for this command would be to determine the sequence of instructions that terminated in a user-defined breakpoint. you would set the breakpoint condition using the break command , then issue the go command . when the break condition is met, instruction execution halts and the cu rrently enabled registers are displayed. you can then issue the history command to view the last 32 instructions that executed prior to the breakpoint. the device execution history can also be logged continuously to an output file using the simulator output command . 12.18 input - assign input file i nput [#n] [ t (timed)] addr/port/periph/pin[_group] off / term /file [ -rd / -rf / -rh / -ru ] i nput [ # n] pin (from)[ dv n:]pin i nput [ # n] addr (from)[ dv n:]addr the input command causes the retrieval of data from a source that you specify to a peripheral, memory location, or device pin . the input data is in ascii format. valid port, peripheral and pin names for the device can be listed with the help port , help periph and help pin commands. there are three forms of the input command. the first form allows input to a memory location, port, peripheral, or pin from data pr ovided either in a file or from the keyboard. the second form allows input to a device pin from another device pin without having to store the data in a disk file. the third form of the input command causes the simulator to read the memory location of a specified source (specified by (from)[ dv n:]addr ) each time the destination memory address is accessed for a read. this enables simulation of a system consisting of multiple devices via dual-port memory. data values may be expressed in hexadecimal, decimal, or floating point for memory and peripheral name assignments, as one of 5 input values (0,1,n,p or x) for assignment to individual digital pins, or as single precision floating-point values for analog input pins. [#n] optional. the number that will be assigned to this input. input numbers do not have to be consecutive - they can be assigned arbitrarily, which means that you can assign input numbers in any way that helps you organize the sources of the inputs. if no number is provided, the simulator will automatically assign the next available number. [ t (timed)] optional. when included with the input command, this parameter indicates that the source data is in the form of time-data pairs. addr/port/periph/pin[_group] f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
input - assign input file motorola command reference 12-25 the destination of the input data. all subsequent reads of the destination will reference the source of the input data. off / term /file the source of the input data. providing the off parameter disables the input specified by # n . providing the term parameter indicates that the input data will be typed from the keyboard. providing a filename indicates that the input data is contained in file . if a filename suffix is not specified, the simulator will assume " .io " for a non-timed input file and ". tio " for a timed input file. [ -rd / -rf / -rh / -ru ] optional. the default input radix for the data may be specified by using -rd for decimal, -rf for fractional, -rh for hexadecimal, or -ru for unsigned. hexadecimal input is the default for addr, port and peripheral data values. input analog pin data files must be assigned with the -rf radix designator, and the file data must be single precision floating point values. the time value is always expressed in decimal. chapter 3, "object files and data files," on page 3-1, contains an extensive description of the input file format. pin in the second form of the input command, this parameter represents the name of the pin that is the destination of the input data. the second form of the input command allows input to a device pin from another device pin without having to store the data in a disk file. (from)[ dv n:]pin in the second form of the input command, this parameter represents the name of the pin that is the source of the input data. the source pin may optionally be preceded by a device number to allow the simulation of pin to pin connections in systems consisting of multiple devices. addr used with the third form of the input command, this parameter represents the destination address. all subsequent reads of this memory address will reference the address specified as the input source. (from)[ dv n:]addr used with the third form of the input command, this parameter represents the address of the source of the input data. the address may optionally be preceded by a device number ( dv n ). the third form of the command causes the simulator to read the memory location of a specified source (specified by dv n:addr ) each time the destination memory address is accessed for a read. this enables simulation of a system consisting of multiple devices via dual-port memory. the source device must exist (new devices can be added with the device command )prior to issuing this form of the input command. table 12-21. input commands command resulting simulator action input xe:$800 xfile -rd gets values for external memory location x:800 from input file "xfile.io". the data values are stored in decimal form in the input file. input ssi0 hfile g ets values for the ssi0 peripheral from input file "hfile.io". f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
12-26 suite56 dsp simulator users manual motorola input - assign input file input d15..d0 dfile gets values for pins d15 through d0 from input file "dfile.io". input d15..d0 dfile gets values for pins d15 through d0 from input file "dfile.io". input irqb dv1:pb0 inputs values for the current devices irqb pin from device dv1s pb0 pin. input t irqa term inputs time and data pairs from the terminal for the device irqa pin. input x:500 dv5:x:3000 inputs data for memory reads of x:500 of the current device from device number 5 address x:3000. input #2 x:$800 xfile -rd gets values for external memory location x:800 from input file "xfile.io". the data values are stored in decimal form in the input file. input assignment number 2 is explicitly replaced due to the #2 in this command form. input #2 off inputs assignment number 2 is explicitly deleted by index number. input mic micfile -rf inputs untimed analog pin data for the mic analog pin from the file "micfile.io". command resulting simulator action f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
list - list source file lines motorola command reference 12-27 12.19 list - list source file lines li st [+/-/./addr] the list command displays source lines or disassembled instructions from the specified source file, or beginning at the specified address. the current display mode determines whether a source file or assembly mnemonics will be displayed. if the simulator is in the register display mode, this command will switch it to the source display mode and display the source file lines associated with the specified address or line number. if the display mode is already source or assembly, the display mode is not altered. the assembly display mode displays disassembled instructions corresponding to the specified address or line number. [+/-/./addr] optional. the next or previous pages of the currently displayed source file may be selected by specifying + or - . in addition, the source or assembly associated with the current execution address may be selected by specifying . (period) or by using the list command without a parameter. if the addr parameter is used with the list command, the disassembled instructions from the specified address will be displayed. alternatively, a line number can be provided in place of addr (symbolic debug information must be loaded). table 12-22. list commands command resulting simulator action list 20 lists source or assembly corresponding to line 20 of the current source file. list test.asm@20 lists source or assembly corresponding to line 20 of the source file test.asm. list test.asm lists source or assembly corresponding to line 1 of the source file test.asm. list + displays the next page of the current source file or assembly. list . displays source or assembly corresponding to the current execution address. list- displays the previous page of the current source file or assembly. list test.asm lists source or assembly corresponding to line 1 of the source file test.asm. list lab_1 lists source or assembly corresponding to symbolic address lab_1. f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
12-28 suite56 dsp simulator users manual motorola load - load dsp files or configuration 12.20 load - load dsp files or configuration l oad [ s (state)| m (memory-only)| d (debug symbols-only)] (from)file the load command can be used to load dsp object module format (.lod) files or dsp coff (.cld) files into the simulator memory or to load a previously saved simulation state file. [ s (state)| m (memory-only)| d (debug symbols-only)] optional. if the s key character is specified, the simulator will load filename as a simulator state file. the simulator state file can be created using the simulator save s command. loading the simulator state changes the entire setup of the simulator to the previous definition saved in the state file. if the m key character is specified, the simulator will load object file without modifying the simulator s symbolic debug information. if the d keycharacter is specified, the simulator will load only the symbolic debug information from the object file. the device memory contents are not altered. only the coff format files (.cld suffix) are supported by this option. (from)file if only a file p arameter is specified, the simulator assumes that the file is an object file. the object file may be in either the special ascii omf format chapter 3, "object files and data files," on page 3-1, or in the dsp coff format generated by the dsp assembler. the omf format file can be created using the simulator save command or with a text editor. a directory path may be specified with the filename. if no filename suffix is specified, the simulator will search first for an omf format ".lod" file, then for a coff format ".cld" file. loading a coff format file replaces the simulators symbolic debug information unless the m option is specified. if the s parameter is specified but no filename suffix is specified, the ".sim" file extension is assumed. f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
load - load dsp files or configuration motorola command reference 12-29 table 12-23. load commands command resulting simulator action load \source\testloop.obj loads the omf format "testloop.obj" file from directory "source". load \source\testloop.cld loads the coff format "testloop.cld" file from directory "source", including the memory contents and any symbolic debug information contained in the file. load lasttest loads the omf format "lasttest.lod" file from current directory. load d test.cld loads the symbolic debug information from the coff format "test.cld" file, ignoring the memory contents of the file. load m test.cld loads the coff format "test.cld" file, ignoring any symbolic debug information in it. load s lunchbrk loads "lunchbrk.sim", replacing the entire current simulator state. f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
12-30 suite56 dsp simulator users manual motorola log - log commands, session, profile 12.21 log - log commands, session, profile lo g[ off ][ c (commands)/ s (session)/ p (profile) [file [- a /- o /- c ]]] lo g[ off ] v (source display status line) the log command allows you to record command entries, to record all session display output, or to record an analysis of dsp program execution. record of commands is useful as a method of generating macro command files. recording all session display output provides a convenient way for you to review the results of an extended sequence of commands. since the output log files are in ascii format, they can easily be printed or reviewed using an editor program. recording a program profile assists in the analysis of program structure and execution characteristics. entering the log command with no parameters will cause the simulator to display the currently opened log filenames. [ off ] optional. the off parameter is used to terminate logging. [ c (commands)/ s (session)/ p (profile) [file [- a /- o /- c ]]] the c and s parameters are used to specify whether the logfile will contain only commands ( c ), or all session output ( s ). a keycharacter -a , -o , or -c may be specified to select append, overwrite, or cancel if the filename already exists. if no append/overwrite option is included with the log command, you will be prompted during command execution. if no suffix is specified for file , the suffixes ".cmd" is automatically added to the command log file; similarly ".log" is automatically added to the session log file. the p parameter specifies that a program execution profile is to be created. the program to be profiled must be loaded before issuing the log p command. both memory and symbols must be loaded. information is gathered as program execution is simulated, and the profile output files are written when the profiling is terminated with the command log off p . for profile logging, two suffixes are used, a ".log" file which contains plain text which may be printed on any 80-column printer, and a ".ps" file which is formatted for a postscript printer. v (source display status line) used with the second form of the log command, the v parameter enables logging of the source display status line to a session log file. it is primarily intended for testing the simulator display. in multiple device simulations, there is a separate session log file associated with each simulated device, but there is only a single command log associated with the entire multiple device simulation. if a device type is changed using the device command, the user interface informa tion associated with the discarded device type, including the session log file name, is cle ared; so it is best to specify the log s command following the device command for a particular device. f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
more - enable/disable session paging control motorola command reference 12-31 table 12-24. log commands 12.22 more - enable/disable session paging control m ore [ off ] the more command allows you to enable or disable the paging of data in the session window. this is particularly useful when displaying large amounts of data and you wish to examine page by page. [ off ] optional. turns off paging. the paging feature is turned off by default. data will scroll vertically across the screen when it is larger than the size of the screen. command resulting simulator action log displays currently opened log files. log s \debugger\session1 logs all display entries to session1.log in directory \debugger log c macro1 -a logs all commands to the file "macro1.cmd". append if it already exists. log off c terminates command logging. log off terminates all logging. log v log s session1 logs source display status line and all display entries to "session1.log" load px41v17.cld log p px41v17 -o loads memory and symbols for program px41v17 and log the program profile in files px41v17.log and px41v17.ps. overwrites these files without warning if they already exist. note that the program(s) to be profiled must have been loaded before this log command is issued. table 12-25. more commands command resulting simulator action more turns on session display paging control. more off disables session display paging control (reset or default state). f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
12-32 suite56 dsp simulator users manual motorola next- step over subroutine calls or macros 12.23 next- step over subroutine calls or macros n ext [count] [ li ( lines )/ in ( instructions )] [ h ( halt at breakpoints )] the next command functions the same as the step command, except that if the next instruction to be executed calls a subroutine or begins execution of a m acro, all the instruc tions of the subroutine or macro are executed before stopping to display the enabled registers. in order to recognize macros, the symbolic debug information for the program code must be loaded. [count] optional. when included, the count parameter indicates the number of lines/instructions to execute before halting execution. if no count is specified, the default count is 1. [ li ( lines )/ in ( instructions )] optional. as the default, the next command executes the next instruction if viewing the assembly or register screens, and the next line if viewing the source screen. the li and in parameters permit source line or instruction increments to be specified explicitly. [ h ( halt at breakpoints )] optional. as the default, all breakpoints are ignored while the next command is executing. the h parameter enables halting at breakpoints. table 12-26. next commands command resulting simulator action next steps over subroutine calls or macros; or otherwise just advances one instruction or source line, depending on the display mode, and displays the enabled registers and memory blocks. next li steps over subroutine calls or macros; or otherwise just advances one source line and displays the enabled registers and memory blocks. next in steps over subroutine calls or macros; or otherwise just advances one assembly instruction and displays the enabled registers and memory blocks. next 10 executes the equivalent of the next 10 instructions, halting to display the enabled registers and memory blocks only after the tenth instruction is completed. next 10 li executes the equivalent of the next 10 lines, halting to display the enabled registers and memory blocks only after the tenth line is completed. next 10 h executes the equivalent of the next 10 instructions, halting to display the enabled registers and memory blocks after the tenth instruction is complete, or when a breakpoint is encountered. f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
output - assign output file motorola command reference 12-33 12.24 output - assign output file o utput [#n] [ t ] addr/port/periph/pin[_group] off / term /file [- rd / -rf / -rh / -ru / -rs ][ -a / -o / -c ] o utput [#n] [ t ] history off / term /file [ -a / -o / -c ] o utput [#n] [ t ] ehistory off / term /file [ -a / -o / -c ] the output command stores data from a peripheral, memory location, or device pin to a specified destination. the output data is in ascii format. valid port, periph eral and pin names for the device can be listed with the help port , help periph and help pin commands. there are three forms of the output command. the first form allows output from a memory location, port, peripheral, or pin to either a file or to the session window ( term ). the second form of the output command creates a continuous log of the device execution addresses and disassembled opcodes. the output format is similar to the output gen erated by the simulator history command. the third form of the command, which specifies ehistory , is an extended version of the output history command. additional execution history information is logged to the output file. only one of output history or output ehistory may be active. [#n] optional. the number that will be assigned to this output. output numbers do not have ot be consecutive - they can be assigned arbitrarily, which means that you can assign output numbers in any way that helps you organize the outputs. if no number is provided, the simulator will automatically assign the next available number. [ t ] optional. when included with the output command, this parameter indicates that the output data is in the form of time-data pairs. addr/port/periph/pin[_group] the source of the data. assignment to a memory address causes all subsequent writes of that memory address to store data in the output file/session window. off / term /file the destination of the output data. providing the off parameter disables the output specified by # n . providing the term parameter indicates that the output data will be typed to the session window. providing a filename indicates that the output data will be written to file . if a filename suffix is not specified, the simulator will assume " .io " for a non-timed output file and ". tio " for a timed output file. [- rd / -rf / -rh / -ru / -rs ] optional. the default output radix for the data may be specified by using -rd for decimal, -rf for fractional, -rh for hexadecimal, -ru for unsigned, or -rs for character string. the -rf radix, when specified for a single output pin, will output the analog single precision floating point value associated with the pins analog function. the -rs radix is valid only for output memory locations. it interprets values written to the specified memory location to be the address of a null terminated character string in the same memory space.the character string will be di splayed or f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
12-34 suite56 dsp simulator users manual motorola output - assign output file written to an output file. this string radix is provided primarily for use when debugging programs created with the c compiler. the output time value is always expressed in decimal. chapter 3 contains a thorough description of the output file format. [ -a / -o / -c ] optional. the -a , -o ,or -c parameter may be used to indicate append, overwrite, or cancel if the filename already exists. if you do not specify this parameter, and the filename al ready exists, you will be prompted during command execution to make the decision to append, overwrite, or cancel. history used with the second form of the output command. this usage creates a continuous log of the device execution addresses and disassembled opcodes. the output format is similar to the output generated by the simulator history command. ehistory used with the third form of the output command. this usage is an extended version of the output history command. additional execution history is included in the output, including device wait state cycles and bus arbitration cycles and indication of other stall conditions. the extra information is preceded by double asterisks in the log file. table 12-27. output commands command resulting simulator action o utput x:$0 xfile -rd stores values written to memory location x:0 in output file "xfile.io". the data values will be stored in decimal. o utput ssi0 ssi0file -a stores values from the ssi0 peripheral to output file "ssi0file.io". appends to the file if it already exists. o utput a15..a0 afile stores output values for address pins a15 through a0 to output file "afile.io". o utput #2 t bg term outputs time and data pairs from the device bg pin to the terminal. output number 2 is explicitly replaced by this command. o utput #2 off output number 2 is explicitly turned off by index number reference. o utput spkp spfile -rf outputs untimed single precision floating point values for the analog pin spkp to the output file "spfile.io". o utput xdat1 xfile stores values written to memory location associated with the symbolic label xdat1 to the output file "xfile.io". the data values will be stored in the default hexadecimal radix. o utput history hisfile stores device execution history to output file "hisfile.io". o utput ehistory hisfile stores extended device execution history to output file "hisfile.io". f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
path - specify default pathname motorola command reference 12-35 12.25 path - specify default pathname p ath [pathname] p ath +pathname[,pathname,...] p ath - the path command defines the default pathname that is used by the simulator to store temporary files, log files, macro command files, object files, and peripheral i/o files. if no parameters are specified, the current default pathname is displayed in the session window. the default pathname can be overridden by explicitly specifying a pathname as a prefix to the filename in any of the commands which reference a file. [pathname] optional. used in the first form of the path command, indicates the directory to use as the pathname. +pathname[,pathname,...] used in the second form of the path command. alternate source pathnames may be specified using the path + form of the command. each time the command is issued, the specified pathname, or comma-separated list of pathnames, is added the current list. when s earching for files, the simulator will first search the default pathname, then search in each of the alternate source pathnames, in the order that they were specified. - the third form of the command, "path -", deletes the entire list of alternate source path-names. table 12-28. path commands command resulting simulator action path \sim defines the default working directory for simulator files as "\sim". path \sim\day2 defines the default working directory for simulator files as "\sim\day2". path + ..\src adds pathname "..\src" to the list of alternate source pathnames. path + ..\src,..\src2 adds pathnames "..\src" and "..\src2" to the list of alternate source pathnames. path C clears the list of alternate source pathnames. path shows the default working directory and help file directory for the current device, and the list of alternate source pathnames. f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
12-36 suite56 dsp simulator users manual motorola quit - quit simulator session 12.26 quit - quit simulator session quit [ e (enable)/ d (disable)] the quit command passes control back to the operating system after closing all log files, input and output files, and macro files. [ e ( enable )/ d (disable)] optional. quit enable ( e ) and quit disable ( d ) control the action taken by the simulator if an error occurs during the execution of a macro command. the quit enable specifies that the macro command sh ould be aborted and the simulator quit immediately with a non-zero exit status. the quit disable command specifies that the simulator should not exit. . 12.27 radix - change input or display radix r adix [ b (binary)/ d (dec)/ f (float)/ h (hex)/ u (unsigned)] [reg[_block]/addr[_block]]... the radix command allows you to change the default number base for command entry or for display of registers and memory locations. the simulator, by default, uses decimal input radix and hexadecimal display radix when it is initially invoked. changing the default input radix allows you to enter constants in the chosen radix without typing a radix specifier before each constant. if no parameters are used with the radix command, the current default radix is displayed in the session window. [ b (binary)/ d (dec)/ f (float)/ h (hex)/ u (unsigned)] optional. this parameter, when not followed by a register name or memory location, specifies the radix to use as the default input radix. when followed by a register name or memory location, the radix will be applied as the default display radix when displaying the values conatined in the register/memory location. [reg[_block]/addr[_block]]... optional. specifying a list of register and/or memory locations following the radix specifier will set the display radix of the registers and memory to the radix specified. this does not affect the default input radix. a range of registers can be specified by typing start_reg..end_reg , where start_reg is the beginning register and end_reg is the last register of the block. table 12-29. quit commands command resulting simulator action quit closes all currently open files and returns to the operating system. quit e specifies that errors in a macro command will cause the simulator to exit with a non-zero status. f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
radix - change input or display radix motorola command reference 12-37 a range of addresses can be specified by typing start_addr # count, where start_addr is the first address of the block and count represents the size of the block. an address block can also be specified by typing start_addr..end_addr . for example: p:5#20 indicates 20 locations beginning from program memory location 5; p:5..24 indicates program memory locations 5 through 24. the radix command is used to define the default number base. however, the default radix can be overridden on a individual usage basis. hexadecimal constants can always be specified by preceding the constant with a dollar sign ( $ ). likewise, a decimal value can be specified by preceding the constant with a grave accent (), and a binary value may be specified by preceding the constant with a percent sign ( % ). table 12-30. radix commands command resulting simulator action radix displays the default input radix currently enabled. radix h changes default input radix to hexadecimal. hexadecimal constant entries no longer require a preceding dollar sign, but any decimal constants will require a preceding grave accent. radix f x:0..10 x0 y0 a b change the display radix for the specified registers and memory blocks to floating point. f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
12-38 suite56 dsp simulator users manual motorola redirect - redirect stdin/stdout/stderr for c programs 12.28 redirect - redirect stdin/stdout/stderr for c programs red irect stdin off /file red irect stdout / stderr off /file [ -a / -o / -c ] red irect [ off ] the redirect command is used to redirect the stdin/stdout/stderr for c programs. it allows you to redirect stdin from a file, and redirect stdout/stderr to files. p erforming the redirect command with no parameters will display the status of each i/o stream in the session window. beware that no i/o processing or handling of redirection occurs if i/o streaming has been disabled with the streams command. stdin used with the first form of the redirect command. the stdin parameter indicates that the standard input is to be redi rected. off /file used with the first and second forms of the redirect command. the off parameter indicates that the redirection of the specified input/output is to be turned off. in the context of the first form of the redirect command, the file parameter indicates the name of the file from which standard input will be provided. in the context of the second form of the redirect command, the file parameter indicates the name of the file to which standard output or standard error will be written. in all cases, if no file extension is specified when specifying file with the redirect command, the simulator will assume the .cio file extension. stdout / stderr used with the second form of the redirect command. the stdout/stderr parameter indicates that standard out or standard error is to be redirected. [ -a / -o / -c ] optional. the -a , -o ,or -c parameter may be used to indicate append, overwrite, or cancel if the filename file already exists. if you do not specify this parameter, and the filename already exists, you will be prompted during command execution to make the decision to append, overwrite, or cancel. [ off ] optional. used with the third form of the redirect command. when used as the only parameter, the off parameter turns off all redirected stdin , stdout ,and stderr . table 12-31. redirect commands command resulting simulator action redirect displays the redirect list, which shows each of the three streams that can be redirected, along with where they are being redirected to. redirect stdin input redirects the c stdin (standard input) stream from the file input.cio (.cio is the default ex-tension). f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
reset - reset device or state motorola command reference 12-39 12.29 reset - reset device or state re set s (state)/ d (device) [mode] the reset command can be used to reset the device registers ( d ) or the entire simulator state ( s ). it can also be used to select the operating mode that the device will be set to in response to a simulated hardware reset sequence. s (state)/ d (device) the s parameter indicates that the the entire simulator state should be reset to the start-up condition. all breakpoints are cleared, the memory is initialized, and all logging and i/o files are closed. the d parameter indicates that the device should be reset to the start-up condition. all device registers are reset to the defined reset conditions. [mode] optional. the mode parameter specifies the dsp operating mode in the form m n ( n =decimal digit). to see the operating modes that are available for a particular device: 1. at the command line, type: help mode 2. view the session window. it will contain a list of operating modes available to the particular device that you are simulating. redirect stdout output.txt redirects the c stdout (standard output) stream to the file output.txt. redirect stderr errors redirects the c stderr (standard error) stream to the file errors.cio. redirect stdout output -o redirects the c stdout stream to the file output.cio, overwriting the file if it already exists. redirect stdout output -a redirects the c stdout stream to the file output.cio, appending to the end of the file if it already exists. redirect stdout output -c redirects the c stdout stream to the file output.cio, but doesnt redirect if the file already exists. table 12-32. reset commands command resulting simulator action reset d resets all device registers to the defined reset conditions. reset d m0 resets the device registers and select operating mode 0 as the default operating mode following subsequent hardware reset sequences. reset s resets the entire simulator state to the start-up condition. all breakpoints are cleared, the memory is initialized, and all logging and i/o files are closed. command resulting simulator action f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
12-40 suite56 dsp simulator users manual motorola save - save simulator file 12.30 save - save simulator file s ave s (state)/addr[_block]... filename [ -a / -o / -c ] the save command allows creation of a simulator state file from the current simulator state, or crea tion of an object module format file or a coff format file from specified memory blocks. s (state)/addr[_block]... if s is specified as the second parameter, a simulator state file is created. it contains the entire simulation state, including memory contents, breakpoint settings, and the current pointer position of any open files. this file is in an internal format that is efficient for the simulator to store and load (see the load s command description). the default suffix for a simulator state filename is ".sim". if the addr[_block] parameter is used, the memory areas specified are stored in object format so the file can be reloaded with the simulator load command. the default object format is the omf format described in chapter 6. if no file extension is explicitly specified, the extension for an omf file ".lod", will be appended to filename . if the coff file extension, ".cld", is specified explicitly in the filename, the memory contents will be stored in the dsp coff object file format. the simulator does not store symbolic debug information in the output coff object file. an address block can be specified by typing start_addr # count, where start_addr is the first address of the block and count represents the size of the block. an address block can also be specified by typing start_addr..end_addr . for example: p:5#20 indicates 20 locations beginning from program memory location 5; p:5..24 indicates program memory locations 5 through 24. filename the name of the file to be saved. [ -a / -o / -c ] optional. the -a , -o ,or -c parameter may be used to indicate append, overwrite, or cancel if the file filename already exists. if you do not specify this parameter, and the filename already exists, you will be prompted during command execution to make the decision to append, overwrite, or cancel. appending is not a valid option for state files. table 12-33. save commands command resulting simulator action save p:0..$ff x:0..$20 session1 -a saves all three memory maps to omf file "session1.lod". if the file already exists, append to it. save s lunchbrk saves the simulator state to filename "lunchbrk.sim". save s lunchbrk.b -c saves the simulator state to filename "lunchbrk.b". if the file already exists, cancel this command. f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
step - step through dsp program motorola command reference 12-41 12.31 step - step through dsp program st ep [count] [ cy ( cycles )/ li ( lines )/ in ( instructions )] [ h ( halt at breakpoints )] the step command allows you to execute count instructions or clock cycles before displaying the enabled registers and memory blocks. this command gives you a quick way to specify execution of a number of instructions without having to set a breakpoint. it is similar to the trace command except that display occurs only after the count number of cycles or instructions have occurred. unlike the next command, if the next instruction to be executed calls a subroutine or begins execution of a macro, the instructions of the subroutine or macro are counted towards the total number of instructions that were specified to be executed with the step command. if execution stops in the middle of a subroutine or function, execution can continue to the end of the subroutine or function by using the finish command. [count] optional. when included, the count parameter indicates the number of cycles/lines/instructions to execute before halting execution. if no count is specified, the default count is 1. [ cy ( cycles )/ li ( lines )/ in ( instructions )] optional. as the default, the step command steps in instruction increments if viewing the assembly or register screens, and in source line increments if viewing the source screen. the cy , li and in options permit cycles, source line or instruction increments to be specified explicitly. [ h ( halt at breakpoints )] optional. the default is to ignore all breakpoints while the step command is executing. the h parameter enables halting at breakpoints. table 12-34. step commands command resulting simulator action step steps one instruction or source line, depending on the display mode, and displays the enabled registers and memory blocks. step li steps one source line, regardless of the display mode, and displays the enabled registers and memory blocks. step $50 executes hex 50 instructions or source lines, depending on the display mode, then stops and displays the enabled registers and memory blocks at the end of the hex 50th instruction. step $50 in h executes hex 50 instructions, regardless of the display mode, then stops and displays the enabled registers and memory blocks at the end of the hex 50th instruction. halts if a breakpoint is encountered during the execution. step 20 cy executes 20 clock cycles and displays the enabled registers and memory blocks at the end of the 20th clock cycle. f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
12-42 suite56 dsp simulator users manual motorola streams - enable/disable handling of i/o for c programs 12.32 streams - enable/disable handling of i/o for c programs str eams [ e nable/ d isable] the streams command is used to enable and disable the handling of input and output on the host side for c programs. by default, streaming is enabled. when enabled, all input and output that is done in the c program running on the device is handled on the host side. for example, when an fopen() call is made in the c program running on the dsp call, the host software intercepts the call and does the fopen() on the host side. if the streams command is performed with no parameters, the current status of streaming is displayed in the session window. [ e nable/ d isable] optional. enables or disables streaming.. table 12-35. streams commands command resulting simulator action streams e enables handling of c input/output. all input/output calls done in a c program running on the dsp will be handled by the host software (e.g. fopen(), fwrite(), printf(), etc.). streams d disables handling of c input/output. f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
system - execute system command motorola command reference 12-43 12.33 system - execute system command sy stem [ -c ( continue immediately )] [system_command [parameter_list]] the system command allows you to execute an operating system command from within the simulator. operating system command s invoked from within the simulator are not logged to the session window for review. [ -c ( continue immediately )] optional. the -c parameter causes control to return to the simulator after the operating system command is completed without prompting you. this may be useful in m acro commands, a llowing system commands to be used without requiring operator intervention. if the -c parameter is not specified, before control returns to the simulator you are prompted to hit return to continue. this allows you to inspect the command output before it is destroyed. [system_command [parameter_list]] optional. if a system_command is included in the system command, the specified system_command is executed, including any parameters specified in the parameter_list . if the command line does not contain a system_command , then a mode is entered in which multiple system commands may be entered. return to the simulator occurs when you enter exit on the operating system command line. table 12-36. system commands command resulting simulator action system dir executes the system "dir" command and immediately returns to the simulator. system dir *.io executes the system "dir *.io" command system dir *.io del he.io exit leaves the simulator temporarily. executes the system "dir *.io" and "del he.io" commands. returns to the simulator when the system "exit" command is executed. system -c del e:\temp\*.lod deletes the specified temporary files and continue without issuing the continuation prompt. f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
12-44 suite56 dsp simulator users manual motorola trace - trace through dsp program 12.34 trace - trace through dsp program t race [count] [ cy ( cycles )/ li ( lines )/ in ( instructions )] [ h ( halt at breakpoints )] the trace command gives a snap shot of the enabled registers and memory after each instruction or clock cycle is executed. execution terminates after count number of cycles, lines, or instructions. [count] optional. when included, the count parameter indicates the number of cycles/lines/instructions to execute before halting execution. if no count is specified, the default count is 1. [ cy ( cycles )/ li ( lines )/ in ( instructions )] optional. as the default, the trace command steps in instruction increments if viewing the assembly or register screens, and in source line increments if viewing the source screen. the cy , li and in options permit cycles, source line or instruction in crements to be specified explicitly. [ h ( halt at breakpoints )] optional. the default is to ignore all breakpoints while the trace command is executing. the h parameter enables halting at breakpo ints. table 12-37. trace commands command resulting simulator action trace executes one instruction or source line, depending on the display mode, then stops and displays the enabled registers and memory blocks. trace li executes one source line, regardless of the display mode, then stops and displays the enabled registers and memory blocks. trace 20 executes 20 instructions or source lines, depending on the display mode, and displays the enabled registers and memory blocks after each trace execution. ignores breakpoints. trace 20 in executes 20 instructions, regardless of the display mode, and displays the enabled registers and memory blocks after each instruction. ignores breakpoints. trace 20 h executes 20 instructions and displays the enabled registers and memory blocks after each instruction. halts if a breakpoint is encountered. trace 10 cy executes 10 clock cycles and displays the enabled registers and memory blocks after each clock cycle. ignores breakpoints. f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
type - display the result type of c expression motorola command reference 12-45 12.35 type - display the result type of c expression ty pe { c_expression } the type command is used to display the result type of a c expression in the session window. { c_expression } the c expression to be examined (remember to enclose in curly brackets). if the result of the expression is a storage location (e.g. just a variable name, or an element of an array), the address of the storage location, in addition to its data type will be displayed. table 12-38. type commands command resulting simulator action type { count } displays the type and location of the variable count . type { 0.5+i } displays the type of the given expression: 0.5+i . f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
12-46 suite56 dsp simulator users manual motorola unlock - unlock password protected device type 12.36 unlock - unlock password protected device type un lock dev_type password the unlock command provides unlocks unannounced device types. once unlocked, the device type may be selected for simulation using device command. dev_type the type of device that is to be unlocked. password the password to unlock the device. 12.37 until - execute until address u ntil addr [ h ( halt at breakpoints )] the until command sets a temporary break point at the specified line or address, then begins execution from the address indicated by the current program counter until that breakpoint is encountered. the simulator then clears the temporary breakpoint and displays the enabled registers and memory blocks in the same manner as the step command. addr the addr parameter specifies the address in memory at which execution will be halted. the addr parameter may also be expressed as a line number in the program source file. specification of a line number is valid only if the symbolic debug information has been loaded from a coff format .cld file. (the debug information is generated at the time of assembly using the assemblers Cg option.) line numbers may be specified as filename@line_number for a line number in a particular file or simply by line_number for line numbers in the currently displayed file. [ h ( halt at breakpoints )] optional. the default is to ignore all breakpoints while the until command is executing. the h parameter enables halting at breakpo ints. table 12-40. until commands table 12-39. unlock commands command resulting simulator action unlock 56001 x51-234 enables device type 56001 for simulation using the password x51-234. command resulting simulator action until 20 executes until the instruction associated with line 20 in the current file is reached. until p:$50 executes until the instruction at hexadecimal address p:50 is reached. ignores breakpoints. until p:$50 h executes until the instruction at hexadecimal address p:50 is reached. does not ignore breakpoints. until lab_2 executes until the instruction at label lab_2 is reached. f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
view - select display mode motorola command reference 12-47 12.38 up - move up the c function call stack up [n] the up command is used to move up the call stack. it can be used in conjunction with the where , frame , and down commands to display and traverse the c function call stack. after entering a new call stack frame using up , that call stack frame becomes the current scope for evaluation. this means that for c expressions, the evaulate command acts as though this new frame is the proper place to start looking for variables. [n] optional. the number of frames to move up. if no number is specified, the simulator moves up one frame in the call stack. 12.39 view - select display mode v iew [ a (assembly)/ s (source)/ r (register)] the view command changes the simulator display mode. there are three display modes: assembly, source and register. section 1.7, setting up the display environment, describes the display environment. when no parameter is entered, the display mode cycles to the next display mode in the order: source - assembly - register. the same results can be obtained by typing ctrl-w . [ a (assembly)/ s (source)/ r (register)] optional. the mode that is to be displayed in the session window. the assembly and source views will indicate the next instruction to be executed with a pointer to the left of the instruction. the register mode will display the values of registers enabled for display (see the display command), including highlighted values for registers that were written to in the last executed instruction. table 12-42. view commands table 12-41. up commands command resulting simulator action up movesupthecallstackbyonestackframe. up 3 moves up the call stack by three stack frames command resulting simulator action view selects the next display mode among source, assembly and register modes. view s selects source display mode. view a selects assembly display mode. view r selects register display mode. f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
12-48 suite56 dsp simulator users manual motorola wait - wait specified time 12.40 wait - wait specified time w ait [count(seconds)] the wait command pauses for count seconds or until you click on cancel before continuing to the next command. this command is particularly useful in command macros. if the wait command is entered without a count parameter, the pause will continue indefinitely and will only terminate if you click on cancel . [count(seconds)] optional. the number of seconds to pause. 12.41 wasm - gui assembly window wa sm [ off ] the wasm command opens an assembly window. multiple device windows may be opened for debugging simulations with multiple dsps. [ off ] optional. closes the assembly window. table 12-43. wasm commands command resulting simulator action wasm opens the assembly window for the current device. wasm off closes the assembly window for the current device. f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
watch - set, modify, view, or clear watch item motorola command reference 12-49 12.42 watch - set, modify, view, or clear watch item wat ch [#wn] [radix] reg/addr/expression/ { c_expression} wat ch [#wn] off the watch command is used to add, modify, view, and clear items on the watch list. the watch list is a list of registers, addresses, and expressions that gets updated every time execution is halted or a breakpoint condition is met. if the watch command is performed without any parameters, the current watch list is displayed in the session window. [#wn] optional. an arbit rary number a ssigned to each watch list. multiple lists can be defined, each being displayed in a separate window. if no number is specified, the simulator will automatically add the watch item to the lowest numbered watch list. [radix] optional. the radix parameter indicates the number base in which to display the watch item. the radix may be specified by using d for decimal, f for fractional, h for hexadecimal, or u for unsigned. if no radix is specified, the default radix of the specified item is used. the default display radix of a watch item can be changed with the radix command. reg/addr/expression/{c_expression} this parameter specifies the watch item to be added to the watch list. a watch item can be a register, address, expression, or c expression. off used with the second form of the watch command. turns off all watched registers, addresses, and expressions. table 12-44. watch commands command resulting simulator action watch r0 adds register r0 to the watch list. watch x:0 adds x:0 to the watch list. watch {(count+1)%total} addsthegivencexpressiontothewatchlist. watch h {count/2} adds the given c expression to the watch list, in display radix hex. watch b {flag} adds the given c variable to the watch list, in display radix binary. watch r0+x:0 adds the expression r0+x:0 to the watch list. watch displays the watch list. watch #3 off removes item number three from the watch list. watch off removes all items from the watch list. f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
12-50 suite56 dsp simulator users manual motorola wbreakpoint - gui breakpoint window 12.43 wbreakpoint - gui breakpoint window wb reakpoint [ off ] the wbreakpoint command opens a breakpoint window. multiple device windows may be opened for debugging simulations with multiple dsps. [ off ] optional. closes the wbreakpoint window. 12.44 wcalls - gui c calls stack window wc alls [ off ] the wcalls command opens a c call stack window. multiple device windows may be opened for debugging simulations with multiple dsps. [ off ] optional. closes the stack window. table 12-45. wbreakpoint commands command resulting simulator action wbreakpoint opens a breakpoint window for the current device. wbreakpoint off closes the breakpoint window for the current device. table 12-46. wcalls commands command resulting simulator action wcalls opens a c call stack window for the current device. wcalls off closes the c call stack window for the current device. f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
where - gui c calls stack window motorola command reference 12-51 12.45 wcommand - gui command window wco mmand [ off ] the wcommand command opens a command window. only one command window may be open. the current device is always the device that is related to the command window. use the device command to change the current device. [ off ] optional. closes the command window. table 12-47. wcommand commands 12.46 where - gui c calls stack window w here [[+/-]n] the where command displays the c function calls in the session window. it can be used in conjunction with the frame , down ,and up command s to display and traverse the c function call stack. [[ + / - ]n] optional. this parameter indicates the number of frames of the call stack to display, where n is the number of frames. optional, the + (plus) sign and the - (minus) sign can be used to indicate the whether to display the call stack beginning with the innermost or outermost frames. the + (plus) sign indicates innermost frames. the - (minus) sign indicates the outermost frames. if no sign is specified, the simulator will assume that the innermost frames are intended for display. command resulting simulator action wcommand opens a command window. wcommand off closes the command window for the current device. table 12-48. where commands command resulting simulator action where display the call stack. where 3 display the three innermost frames in the call stack. where -5 display the five outermost frames in the call stack. f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
12-52 suite56 dsp simulator users manual motorola winput - gui file input window 12.47 winput - gui file input window wi nput [ off ] the winput command opens an input window, listing all of the assigned inputs. see the input command for more information. multiple input windows may be opened for separate devices when debugging on systems with multiple dsps. [ off ] optional. closes the winput window. 12.48 wlist - gui list window wl ist [off] the wlist command opens a list window. multiple device windows may be opened for debugging simulations with multiple dsps. [ off ] optional. closes the list window. table 12-50. wlist commands table 12-49. winput commands command resulting simulator action winput opens an input window for the current device. winput off closes the input window for the current device. commands resulting simulator action wlist lfile.1st opens a list window with the text file lfile.1st displayed. wlist win2 lfile.1st opens a list window with a window number of 2 with text lfile.txt displayed. if list window 2 already exists, replaces the contents with lfile.1st. wlist win2 off closes list window number 2. wlist off closes all open list windows. wlist win3 opens a list window with a window number of 3 with no text file displayed. f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
wmemory - gui memory window motorola command reference 12-53 12.49 wmemory - gui memory window wm emory [ # wn] space [addr] wm emory [ # wn] [ off ] the wmemory command opens a memory window. multiple device windows may be opened for debugging simulations with multiple dsps. [ # wn] optional. window number. the window number is an arbit rarily assigned number, used to keep track of possible multiple memory windows. if no window number is specified when opening a new window, the simulator will automatically assign the next available number. space the space parameter indicates the memory space to display. [addr] optional. used with the first form of the wmemory command. indicates the address in memory at which to begin displaying values. [ off ] optional. closes the memory window. if no window number ( # wn )is specified when closing a window, all memory windows will be closed. table 12-51. wmemory command command resulting simulator action wmemory pi opens a memory window for the internal program (pi) memory space for the current device. wmemory xi 0 opens a memory window for the xi memory space containing address 0 for the current device. wmemory win3 x opens a memory window for memory space x with a window number of 3 for the current device. wmemory off closes all memory windows for the current device. wmemory win3 off closes memory window 3 for the current device. f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
12-54 suite56 dsp simulator users manual motorola woutput - gui file output window 12.50 woutput - gui file output window wo utput [ off ] the woutput command opens a file output window, listing all of the assigned outputs. see the output command for more information. multiple output windows may be opened for each separate device when debugging on systems with multiple dsps. [ off ] optional. closes the output window. 12.51 wregister - gui register window wr egister [ win n] [periph/ off ] the wregister command opens a register window. multiple register windows may be opened for each peripheral or for separate devices when de bugging on systems with multiple dsps. [ win n] optional. window number. the window number is an arbitrarily assigned number, used to keep track of multiple register windows. if no window number is specified when opening a new window, the simulator will automatically assign the next available number. [periph/ off ] optional. the periph parameter is the name of a peripheral and indicates that only the registers of that particular peripheral should be displayed. if no peripheral name is specified, the simulator will display the core registers. the off parameter closes the register window. if no window number ( win n ) is specified when closing a window, all register windows will be closed. table 12-52. woutput commands command resulting simulator action woutput opens an output window for the current device. woutput off closes the output window for the current device. table 12-53. wregister commands command resulting simulator action wregister opens a register window for the current device. wregister win3 host opens a register window with a window number of 3, and displays only the registers associated with the host peripheral for the current device. wregister off closes all register windows for the current device. f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
wsource - gui source window motorola command reference 12-55 12.52 wsession - gui session window wse ssion [ off ] the wsession command opens a session window. only one session window may be open at a time. the current device is always the device that is displayed in the session window. use the device command to change the current device. [ off ] optional. closes the session window. 12.53 wsource - gui source window ws ource [ off ] the wsource command opens a source code window which list the source code of the currently loaded program (.cld file). source debug information must be included in the source file for source code to appear in this window. [ off ] optional. closes the source window. table 12-54. wsession commands command resulting simulator action wsession opens a session window for the current device wsession off closes the session window. table 12-55. wsource commands command resulting simulator action wsource opens a source window for the current device. wsource off closes the source windows for the current device. f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
12-56 suite56 dsp simulator users manual motorola wstack - gui stack window 12.54 wstack - gui stack window wst ack [ off ] the wstack command opens a device stack window, which displays the current call stack. multiple stack windows may be opened for debugging on systems with multiple dsps. [ off ] optional. closes the stack window. 12.55 wwatch - gui watch window ww atch [ win _num] [ # n] [radix] reg/addr/expression/{c_expression} ww atch [ win _num] [ # n] [ off ] the wwatch command opens a watch window. multiple watch windows may be opened - one for each watch list or for separate devices when debugging on systems with multiple dsps. [ win _num] optional. an arbitrary number assigned to each watch window. multiple lists can be defined, each being displayed in a separate window. if no number is specified, the simulator will automatically add the watch item to the lowest numbered watch window. [ # n] optional. watch item number. if no number is specified, the simulator will assign the next available number to the watch item. [radix] optional. the radix parameter indicates the number base in which to display the watch item. the radix may be specified by using d for decimal, f for fractional, h for hexadecimal, or u for unsigned. if no radix is specified, the default radix of the specified item is used. the default display radix of a watch item can be changed with the radix command. reg/addr/expression/{c_expression} this parameter specifies the watch item to be added to the watch list. a watch item can be a register, address, expression, or c expression. [ off ] optional. closes the specified watch window. if no window number is specified, closes all watch windows. table 12-56. wstack commands command resulting simulator action wstack opens a stack window for the current device. wstack off closes the stack window for the current device. f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
wwatch - gui watch window motorola command reference 12-57 table 12-57. wwatch commands command resulting simulator action wwatch r0 opens a watch window for the current device with the register r0 displayed. if the window already exists, adds r0 to the list of watched items. wwatch x:$100 opens a watch window for the current device with the memory location x:$100 displayed. if the window already exists, adds x:$100 to the list of watched items. wwatch r2+3 opens a watch window for the current device with the expression r2+3 displayed. if the window already exists, adds r2+3 to the list of watched items. wwatch win2 r0 opens a watch window for the current device with a window number of 2 with the register r0 displayed. if the window already exists, adds r0 to the list of watched items. wwatch off closes all watch windows for the current device. wwatch win3 off closes watch window 3 for the current device. wwatch #2 off removes watch element #2 from first watch windows list of watched elements. wwatch win4 @2 off removes watch element #2 from watch window 4s list of watched elements. f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
12-58 suite56 dsp simulator users manual motorola wwatch - gui watch window f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
motorola c library functions 13-1 chapter 13 c library functions the simdsp simulator package includes several object code libraries of simulator functions that were used to create the simulator. the libraries allow the user to build his own customized simulator and integrate it with your unique project. the simulator package includes the source code for many of the simulator functions, including the code that defines the dsp external memory accesses, the code for the main entry point, the code for the terminal i/o functions, and example code for a non-display version of the simulator. the source code can be modified to create a simulator customized for a particular application. object libraries are supplied which support display or non-display versions of the simulator. the user may choose to eliminate the user interface functions altogether and control the simulation directly through lower level function calls. the rest of this chapter covers these aspects plus the following aspects of the specification and use of the libraries: ? section 13.2, "simulator object library entry points," lists each simulator entry point that is available to you the user. ? section 13.3, "simulator external memory functions," provides a description of the external memory access functions. ? section 13.4, "simulator screen management functions," provides a description of the terminal i/o functions. ? section 13.5, "non-display simulator," topics concerning the non-display version of the simulator are discussed in section 13.5. ? section 13.6, "multiple device simulation," simulation of multiple dsp devices is fully supported by the dsp library functions. ? section 13.6, "multiple device simulation," discusses topics related to simulating and interconnecting multiple dsp devices. ? section 13.7, "reserved function names," provides a description of the public function names used by the simulator. f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
13-2 suite56 simulator reference manual motorola c object libraries ? section 13.8, "simulator global variables," describes the global variables used by the simulator. ? section 13.9, "modification of simulator global structures," describes modifications that can be made to the simulator global structures. ? section 13.10, "modification of device global structures," describes modifications that can be made to device global structures. 13.1 c object libraries the simulator software includes object libraries that enable you to rebuild the simulator. a separate set of display and non-display libraries are provided, so that you have the option of generating a non-display version of the simulator. the libraries with the prefix ww, followed by the family device number, contain the display version of the object modules. the libraries with the prefix nw, followed by the family device number, contain the non-display versions of the same object modules. in addition, the libraries with the prefix cm, followed by the family device number, contain object modules required by both the display and non-display versions of the simulator. as an example, relinking the display version of the sim56100 simulator requires libraries ww56100 and cm56100; a non-display version of the simulator requires the libraries nw56100 and cm56100. 13.2 simulator object library entry points the following is a quick reference list of the higher level simulator entry points provided in the simulator object libraries. the prefix indicates whether or not the function is available in the non-display version of the simulator. function names beginning with the prefix dsp_ or dspt_ are available to both the display and non-display versions of the simulator, while function names beginning with sim_ are only available when using a display version of the simulator. the dspt_ prefix indicates a device dependent function. the _xxxxx suffix on these indicate a device family number. lower level simulator functions, which have a prefix of dspl_, siml_ or dsptl_, are not intended for direct access by the users program. they are not described in this document. the higher level functions listed below are described in detail in section 13.2.1, "dspt_masm_xxxxx: assemble dsp mnemonic," through section 13.2.30, "sim_gtcmd: get command string from terminal," . table 13-1 lists the higher level functions. f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
simulator object library entry points motorola c library functions 13-3 table 13-1. higher level functions function description dspt_masm_xxxxx(mnemonic,ops,err); assemble mnemonic string to ops dspt_unasm_xxxxx(ops,sr,omr,sdbp); disassemble dsp opcodes dsp_exec(devn); execute one clock cycle for dsp device dsp_findmem(devn,memname,map); get map index for memory prefix dsp_findpin(devn,pinname,pinnum); get pin number for pin name dsp_findport(devn,portname,pnum,pmas k); get port number and mask for port name dsp_findreg(devn,regname,pval,rval); get peripheral and register index for register dsp_fmem(devn,map,addr,blocksz,val); fill memory block with a value dsp_free(devn); free memory allocated for a dsp device dsp_init(devn,mode); initialize selected device and mode dsp_ldmem(devn,filename); load device memory from filename dsp_load(filename); load all device states from filename dsp_new(devn,device_type); create new dsp device dsp_path(path,base,suffix,new_name); create filename from path, base and suffix dsp_rapin(devn,pin_number,val); read output analog pin state from device dsp_rmem(devn,map,addr,mem_val); read dsp memory map address to mem_val dsp_rpin(devn,pin_number); read output pin state from device dsp_rport(devn,port,data,force); read output port state from device dsp_rreg(devn,periphn,regn,regval); read dsp peripheral register to regval dsp_save(filename); save the state of all devices to filename dsp_startup(); initialize simulator structures dsp_unlock(device_type,password); unlock password protected device type f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
13-4 suite56 simulator reference manual motorola simulator object library entry points 13.2.1 dspt_masm_xxxxx: assemble dsp mnemonic int dspt_masm_xxxxx(mnemonic,ops,error_ptr) char *mnemonic; /* pointer to assembler mnemonic string */ unsigned long *ops; /* where to put the words of assembled opcode */ char **error_ptr; /* will point to error message if an error occurs */ this function invokes the single line assembler to assemble a dsp mnemonic. table 13-2 list the different integer code it returns: note: note that the xxxxx in the function name should be replaced by a device family number. it should be 56k for the 56000 family devices, 56100 for the 56100 family devices, and 96k for the 96000 family devices. dsp_wapin(devn,pin,value); write device analog input pin with value dsp_wmem(devn,map,addr,val); write dsp memory map address with val dsp_wpin(devn,pin,value); write device input pin with value dsp_wport(devn,port,mask,data,force) ; write device port with data and force value dsp_wreg(devn,periphn,regn,regval); write dsp peripheral register with regval sim_docmd(devn,command_string); perform simulator command on dsp device sim_gmcmd(devn,command_string); get command string from macro file sim_gtcmd(devn,command_string); get command string from terminal table 13-2. integer code code description -1 an error occurred. the user supplied error pointer will point to a message that explains the error. 0 the line mnemonic provided was a comment 1 the mnemonic assembled correctly and required 1 word of code. the code will be in the ops[0] location. 2 the mnemonic assembled correctly and required 2 words of code. the first word will be in placed in ops[0], the second in ops[1]. 3 the mnemonic assembled correctly and required 3 words of code. the first word will be in placed in ops[0], the second in ops[1], the third in ops[2]. table 13-1. higher level functions function description f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
simulator object library entry points motorola c library functions 13-5 example 13-1 shows how to use the dspt_masm_xxxxx function. example 13-1. dspt_masm_xxxxx /* assemble the instruction "move r0,r1" */ unsigned long opcodes[3]; char *error_ptr; int retval; retval=dspt_masm_56k("move r0,r1",&opcodes[0],&error_ptr); 13.2.2 dspt_unasm_xxxxx: disassemble dsp mnemonics int dspt_unasm_xxxxx(ops,return_string,sr,omr,gdbp) unsigned long *ops; /* pointer to opcodes to be disassembled */ unsigned long sr; /* value of device status register */ unsigned long omr; /* value of device operating mode register */ char *gdbp; /* return value reserved for use by debugger*/ char *return_string; /* pointer to return character buffer */ this function disassembles ops[0] (and possibly ops[1] and ops[2] if ops [0] requires a second or third word) and places the disassembled mnemonic in the return_string buffer supplied by the user. if correct disassembly requires a device status register and/or operating mode register value, the values should be provided in the sr and omr parameters. the gdbp parameter is a pointer reserved for use by the symbolic debugger, and should be null for other applications. the mnemonic may require as many as 120 characters of return buffer. the function returns the number (1 to 3) of words consumed by the disassembly. it returns 0 for illegal opcodes and a return string containing a dc directive. see example 13-2. note: the xxxxx in the function name should be replaced by a device family number. it should be 56k for the 56000 family devices, 56100 for the 56100 family devices, and 96k for the 96000 family devices. example 13-2. dspt_unasm_xxxxx /* disassembly of the opcode representing nop */ unsigned long ops[3]; /*instruction words to be disassembled.*/ char return_string[120];/*the return mnemonic goes here.*/ int numwords; /*number of operands used by disassembler.*/ ops[0]=0l; ops[1]=0l; ops[2]=0l; numwords=dspt_unasm_56k(ops,return_string,0l,0l,null); /* now numwords==1, return_string=="nop"*/ f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
13-6 suite56 simulator reference manual motorola simulator object library entry points 13.2.3 dsp_exec: execute single device clock cycle dsp_exec(device_index) int device_index; /* dsp device index to be affected by command */ this function executes a single dsp device cycle and updates the selected dsp device structure. all device inputs, outputs and registers are updated as a result of this call. in addition, it tests user-defined breakpoint conditions and clears the devices executing status flag if a breakpoint occurs. it also calls the functions which handle cycle by cycle i/o from assigned input or output files. see example 13-3. example 13-3. dsp_exec /*execute 1000 cycles on a device*/ int devn; int cycles; dsp_startup(); devn=0; dsp_new(devn,"56116"; /* allocate new device */ for(cycles=0;cycles<1000;cycles++) dsp_exec(devn); 13.2.4 dsp_findmem: get map index for memory prefix dsp_findmem(device_index,memory_name,memory_map) int device_index; /* dsp device index to be affected by command */ char *memory_name; /* memory space name */ enum memory_map *memory_map; /* return memory map type */ this function searches the dt_var.mem structure for a match to the memory_name string provided in the function call. if a match is found, dsp_findmem returns the memory map maintype structure value through the memory_map parameter and 1 as the function return value; otherwise it just returns 0 as the function return value. see example 13-4. for a list of memory names use the simulator help mem command. example 13-4. dsp_findmem #include "coreaddr.h" int devn; enum memory_map map; int ok; dsp_startup(); devn=0; dsp_new(devn,"56116"); /* allocate structure for device 0, a 56116 */ ok=dsp_findmem(devn,"p",&map) /* get memory map index for "p" memory */ f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
simulator object library entry points motorola c library functions 13-7 13.2.5 dsp_findpin: get pin number for pin name dsp_findpin(device_index,pin_name,pin_number) int device_index; /* dsp device index to be affected by command */ char *pin_name; /* pin name */ int *pin_number; /* return pin index */ this function searches the dt_var.xpin structures for a match to the pin_name string provided in the function call. if a match is found, dsp_findpin returns the pin number through the pin_number parameter and 1 as the function return value; otherwise it just returns 0 as the function return value. see example 13-5. use the simulators help pin command to produce a list of the valid pin names. example 13-5. dsp_findpin int devn; int pinnum; int ok; dsp_startup(); devn=0; dsp_new(devn,"56116"); /* allocate structure for device 0, a 56116 */ ok=dsp_findpin(devn,"reset",&pinnum);/* get index for "reset" pin */ 13.2.6 dsp_findport: get port number and mask for port name dsp_findport(device_index,port_name,port_number,mask_val) int device_index; /* dsp device index to be affected by command */ char *port_name; /* port or peripheral name */ int *port_number; /* return memory map index */ unsigned long *mask_val;/* pin mask for this port or peripheral name */ this function searches the dt_var.xport structure and the dt_var.periph structures for a match to the port_name string provided in the function call. if a match is found, dsp_findport returns the port number through the port_number parameter, the port mask value through the mask_val parameter, and 1 as the function return value; otherwise it just returns 0 as the function return value. the simulator help port and help periph commands may also be used to produce a list of valid port and peripheral information. see example 13-6. example 13-6. dsp_findport int devn; int pnum; unsigned long pmask; int ok; dsp_startup(); devn=0; dsp_new(devn,"56116"); /* allocate structure for device 0, a 56116 */ ok=dsp_findport(devn,"portb",&pnum,&pmask);/* get info for "portb" */ f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
13-8 suite56 simulator reference manual motorola simulator object library entry points 13.2.7 dsp_findreg: get peripheral and register index for register name dsp_findreg(device_index,reg_name,periph_number,reg_number) int device_index; /* dsp device index to be affected by command*/ char *reg_name; /* register name */ int *periph_number; /* return peripheral index */ int *reg_number; /* return register index */ this function searches the dt_var.periph structures for a match to the reg_name string provided in the function call. if a match is found, dsp_findreg returns the peripheral index through periph_number, the register number through the reg_number parameter and 1 as the function return value; otherwise it just returns 0 as the function return value. you may also use the simulator help reg command to obtain a list of the valid periph_num and reg_num values, and reg_val size for each register. see example 13-7. example 13-7. dsp_findrg int devn; int regnum; int pnum; int ok; dsp_startup(); devn=0; dsp_new(devn,"56116"); /* allocate structure for device 0, a 56116 */ ok=dsp_findreg(devn,"pc",&pnum,®num);/* get index for "pc" register */ 13.2.8 dsp_free: free a device structure dsp_free(device_index) int device_index; /* dsp device index to be affected by command */ this function frees all allocated memory associated with a device structure and closes any open files associated with the device structure. see example 13-8. example 13-8. dsp_free /* create three new device structures, then get rid of device 2. */ dsp_startup(); dsp_new(0,"56116"); /* allocate structure for device 0, a 56116 */ dsp_new(1,"56116"); /* allocate structure for device 1, a 56116 */ dsp_new(2,"56116"); /* allocate structure for device 2, a 56116 */ dsp_free(1); /* free structure previously allocated for device 1 */ f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
simulator object library entry points motorola c library functions 13-9 13.2.9 dsp_fmem: fill memory block with a value dsp_fmem(device_index,memory_map,address,block_size,value) int device_index; /* dsp device index to be affected by command */ enum memory_map memory_map; /* memory designator */ unsigned long address; /* dsp memory start address to write */ unsigned long block_size; /* number of locations to write */ unsigned long *value; /* pointer to value to write to memory location */ this function writes a memory block of selected dsp memory. the memory_map parameter is a memory type that selects the appropriate dt_memory structure from dt_var.mem for the selected device. these structures are describe in the simdev.h file which is included with the simulator. the memory_map parameter can be obtained with the function dsp_findmem by using the memory name as a key. use the simulator help mem command for a list of valid memory names. the memory_map enum is memory_map_ concatenated with a valid memory name. as an example, memory_map_pa refers to off chip pa memory on the 96002 device. if the selected memory map requires two word values, the least significant word should be at the value location and the most significant word at the value+1 location. if the memory address selects an external memory location, the dspl_xmwr function will be called. the dspl_xmwr function is provided in source form in the file simvmem.c and can be modified to simulate special external memory characteristics. see example 13-9. example 13-9. dsp_fmem /* write 300 locations beginning at p:$200 with the value 4 */ int devn; unsigned long address, memval, blocksize; address=0x200l; blocksize=300; memval=4l; dsp_startup(); devn=0; dsp_new(devn,"56116"); /* allocate structure for device 0, a 56116 */ dsp_fmem(devn,memory_map_p,address,blocksize,&memval); 13.2.10 dsp_init: initialize a single dsp device structure dsp_init(device_index) int device_index; /* dsp device index to be affected by command */ this function initializes a device to the same state that existed following the dsp_new() call which created it. it is equivalent to performing the simulator reset s command. all memory spaces are cleared, the registers are reset, breakpoints and input/output file assignments are cleared. see example 13-10. f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
13-10 suite56 simulator reference manual motorola simulator object library entry points example 13-10. dsp_init dsp_startup(); dsp_new(0,"56116"); /* create new dsp structure */ . . /* other simulator commands */ . dsp_init(0); /* reinitialize device 0 */ 13.2.11 dsp_ldmem: load dsp memory from omf file int dsp_ldmem(device_index,filename) int device_index; /* dsp device index to be affected by command */ char *filename; /* full pathname of omf format file to be loaded */ this function loads the memory space of a specified dsp device from an object file. the file may be created as the output from the dsp macro assembler, or by using the simulator save command, and may be either coff format or . lod format. in order to specify a coff format file, the filename suffix must be . cld. a filename with any other suffix is assumed to be in .lod format. this is a lower level function that does not invoke the user interface modules for pathname and automatic .lod suffix extension. the entire pathname must be specified. the function returns 1 if the load is successful, 0 if an error occurred loading the file. see example 13-11 example 13-11. dsp_idmem /* create dsp device structures for a three device simulation. */ int devn; int err; dsp_startup(); for (devn=0;devn<3;devn++) dsp_new(devn,"56116"); /* create new dsp structures */ /* load device 1 with a program named filter2.lod .*/ err=dsp_ldmem(1,"filter2.lod"); 13.2.12 dsp_load: load all dsp structures from state file int dsp_load(filename) char *filename; /* full name of state file to be loaded */ this function loads the simulator state of all devices from a specified simulator state file. it is not necessary to allocate the device structures prior to calling dsp_load . this function does not invoke the user interface modules for pathname and automatic .sim suffix extension; the entire filename must be specified. see example 13-12. f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
simulator object library entry points motorola c library functions 13-11 example 13-12. dsp_load int err; dsp_startup(); err=dsp_load("lunchbrk.sim"); 13.2.13 dsp_new: create new dsp device structure dsp_new(device_index,device_type) int device_index; /* dsp device index to be affected by command */ char *device_type; /* name corresponding to dsp device type */ this function creates a new dsp structure that represents a dsp device and initializes it. it will be necessary to use the dsp_unlock() function call prior to dsp_new() if the selected device type is password protected. see example 13-13. example 13-13. dsp_new /* create dsp device structures for a three device simulation. */ int devn; dsp_startup(); for (devn=0;devn<3;devn++) dsp_new(devn,"56116"); /* create new dsp structures */ 13.2.14 dsp_path: construct filename dsp_path(path_name,base_name,suffix,new_name) char *path_name; /* directory pathname */ char *base_name; /* base filename to be appended to path_name */ char *suffix; /* suffix string to be appended to base_name */ char *new_name; /* pointer to return buffer for constructed pathname */ this function concatenates the user-provided pathname, base name and suffix. if the base_name begins with a pathname separator or with a device designator, the path_name will not be prepended to the base_name . if the base_name already ends with . and some suffix, the suffix will not be appended. see example 13-14. example 13-14. dsp_path /* load a file named filter2.lod from the current working directory for device 0. */ #include "simcom.h" #include "simdev.h" extern struct dev_const dv_const;/* simulator device structures */ char newfn[80]; dsp_startup(); dsp_new(0,"56116"); /* create new dsp structure */ dsp_path(dv_const.sv[0]->pathwork,"filter2","lod",newfn); dsp_ldmem(0,newfn); /* load file into dsp device 0 */ f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
13-12 suite56 simulator reference manual motorola simulator object library entry points 13.2.15 dsp_rapin: read dsp analog pin state int dsp_rapin(device_index,pin,retvf) int device_index; /* dsp device index to be affected by command */ int pin; /* pin number to read */ float *retvf; /* pointer to floating point (single precision) return value */ this function reads a dsp analog device pin value. it is only valid for device pins which are defined as having analog values, such as codec output pins; other pins will return 0.0 as the analog value. the function return value will be dsp_pinval_l and a floating point value returned in retvf if found; or dsp_err if there is an error condition. use the simulators help pin command to produce a list of the valid pin names and each pins corresponding pin index. the device pin number can also be obtained by using the pin name as a key and calling the function dsp_findpin . the dsp_pinval return values are defined in the simdev.h file. see example 13-15. example 13-15. dsp_rapin int devn; int pinnum; int err; float aval; dsp_startup(); devn=0; dsp_new(devn,"56156"); /* allocate structure for device 0, a 56156 */ dsp_findpin(devn,"spkp",&pinnum); /* get pin number for pin named spkp */ err=dsp_rapin(devn,pinnum,&aval); /* read value of device 0 pin spkp*/ 13.2.16 dsp_rmem: read dsp memory location int dsp_rmem(device_index,memory_map,address,return_value) int device_index; /* dsp device index to be affected by command */ enum memory_map memory_map; /* memory designator */ unsigned long address; /* dsp memory address to read */ unsigned long *return_value; /* memory value (or values) will be returned here */ this function reads the contents of a selected dsp memory location and writes it to return_value . if the memory_map implies a two word value, the least significant word will be returned to return_value ; the most significant word will be returned to the return_value+1 location. this function also returns a flag that indicates whether or not the memory location exists. it returns 1 if the location exists, 0 otherwise. the memory_map parameter selects the appropriate dt_memory structure from dt_var.mem for the selected device. these structures are describe in the simdev.h file which is included with the simulator. the memory_map parameter can be obtained with the function dsp_findmem by using the memory name as a key. use the simulator help mem command for a list of valid memory names. the memory_map enum is memory_map_ concatenated f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
simulator object library entry points motorola c library functions 13-13 with a valid memory name. as an example, memory_map_pa refers to off chip pa memory on the 96002 device. this function calls the function dspl_xmrd() if the address indicates an external memory location. the dspl_xmrd() function is provided in source form in the file simvmem.c and can be modified to simulate special external memory characteristics. see example 13-16. example 13-16. dsp_rmem /* read x memory location 100 from device 0. */ unsigned long address; unsigned long memval; int devn; int ok; dsp_startup(); devn=0; dsp_new(devn,"56116"); /* allocate structure for device 0, a 56116 */ address=100l; ok=dsp_rmem(devn,memory_map_x,address,&memval); 13.2.17 dsp_rpin: read dsp pin state int dsp_rpin(device_index,pin) int device_index; /* dsp device index to be affected by command */ int pin; /* pin number to read */ this function reads a dsp device pin value. the return value may be dsp_pinval_l , dsp_pinval_h, dsp_pinval_f, dsp_pinval_0, or dsp_pinval_1 indicating low output, high output, floating, low input or high input pin state. use the simulators help pin command to produce a list of the valid pin names and each pins corresponding pin index. the device pin number can also be obtained by using the pin name as a key and calling the function dsp_findpin . the dsp_pinval return values are defined in the simdev.h file. see example 13-17. example 13-17. dsp_rpin int devn; int pinnum; int pin_value; dsp_startup(); devn=0; dsp_new(devn,"56116"); /* allocate structure for device 0, a 56116 */ dsp_findpin(devn,"rw",&pinnum);/* get pin number for pin named rw */ pin_value=dsp_rpin(devn,pinnum);/* read value of device 0 pin rw */ f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
13-14 suite56 simulator reference manual motorola simulator object library entry points 13.2.18 dsp_rport: read dsp port state dsp_rport(device_index,port,data,force) int device_index; /* dsp device index to be affected by command */ int port; /* port number to read */ unsigned long *data; /* return port data value goes here */ unsigned long *force; /* return port forcing state goes here */ this function reads a dsp device port state. it returns two values. the value returned in the data parameter contains the current pin data state for all pins in the port. in the case of input pins, this is the last value written to the input pin; in the case of output pins the data state is the last data written to the port by the device. the value returned in the force parameter indicates which port bits are actually being driven as outputs by the device. the port parameter acts as the index to the dev_var.xportval array. a list of port names and the corresponding port index can be obtained using the simulators help port and help periph commands. the port index can also be determined by using the port name as a key when calling dsp_findport . see example 13-18. example 13-18. dsp_rport int devn; int portnum; unsigned long portbdata, portbforce; unsigned long portmask; dsp_startup(); devn=0; dsp_new(devn,"56116"); /* allocate structure for device 0, a 56116 */ dsp_findport(devn,"portb",&portnum,&portmask); dsp_rport(devn,portnum,&portbdata,&portbforce); 13.2.19 dsp_rreg: read a dsp device register dsp_rreg(device_index,periph_num,reg_num,reg_val) int device_index; /* dsp device index to be affected by command */ int periph_num; /* dsp peripheral number */ int reg_num; /* dsp register number */ unsigned long *reg_val; /* return register value goes here */ this function reads a selected register from the regval array in a dsp dev_periph structure. registers which return more than one word as the register value will return the least significant word in reg_val[0]. use the simulator help reg command to obtain a list of the valid periph_num and reg_num values, and reg_val size for each register. also, dsp_findreg can be used to obtain the peripheral and register number by using the register name as a key. see example 13-19. example 13-19. dsp_rreg int devn; f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
simulator object library entry points motorola c library functions 13-15 int periph_num, reg_num; unsigned long regval; dsp_startup(); devn=0; dsp_new(devn,"56116"); /* allocate structure for device 0, a 56116 */ if (dsp_findreg(devn,"pc",&periph_num,®_num)) dsp_rreg(devn,periph_num,reg_num,®val); 13.2.20 dsp_save: save all dsp structures to state file int dsp_save(filename) char *filename; /* full name of state file to be saved */ this function saves a dsp device structure to a simulation state file. this function does not invoke the user interface functions which provide pathname and . sim suffix extension, so the entire filename must be specified. the function returns 1 if the save is successful, 0 if an error occurs when saving the file. this function will call the function dspl_xmsave as one of the steps of saving the dsp structure. see example 13-20. example 13-20. dsp_save int ok; dsp_startup(); dsp_new(0,"56116"); /* allocate structure for device 0, a 56116 */ dsp_new(1,"56116"); /* allocate structure for device 1, a 56116 */ /* save device 0 and 1 to state file lunchbrk.sim .*/ ok=dsp_save("lunchbrk.sim"); 13.2.21 dsp_startup: initialize dsp structures int dsp_startup(); this function initializes dsp structures. it should be called once (and only once) at the first of your program prior to any calls to dsp_new . see example 13-21 example 13-21. dsp_startup dsp_startup(); dsp_new(0,"56116"); /* allocate structure for device 0, a 56116 * dsp_new(1,"56116"); /* allocate structure for device 1, a 56116 * 13.2.22 dsp_unlock: unlock password protected device type dsp_unlock(device_type, password) char *password; /* pointer to string containing password */ char *device_type; /* name corresponding to dsp device type */ this function provides the password for protected device types. it must be used prior to the dsp_new function call if the device type is password protected. see example 13-22. f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
13-16 suite56 simulator reference manual motorola simulator object library entry points example 13-22. dsp_unlock /* create a device simulation of the password protected 56001 device */ int devn; dsp_startup(); dsp_unlock("56001","x51-234"); /* provide password for device */ devn=0; dsp_new(devn,"56001"); /* create new dsp structures */ 13.2.23 dsp_wapin: write dsp analog pin state int dsp_wapin(device_index,pin,value) int device_index; /* dsp device index to be affected by command */ int pin; /* pin number to write*/ float value; /* input value for specified pin */ this function writes a selected dsp device pin with a single precision floating point input value. use the simulators help pin command to produce a list of the valid pin names and each pins corresponding pin index. the device pin number can also be obtained by using the pin name as a key and calling the function dsp_findpin . see example 13-23. example 13-23. dsp_wapin #include "simcom.h" #include "simdev.h" /* write the reset pin of device 0 with a high level. */ int devn; int pinnum; float pinval; dsp_startup(); devn=0; dsp_new(devn,"56156"); /* allocate structure for device 0, a 56156 */ dsp_findpin(devn,"mic",&pinnum);/* get pin number for pin named mic */ pinval=0.709; dsp_wapin(devn,pinnum,pinval); 13.2.24 dsp_wmem: write dsp memory location dsp_wmem(device_index,memory_map,address,value) int device_index; /* dsp device index to be affected by command */ enum memory_map memory_map; /* memory designator */ unsigned long address; /* dsp memory address to write */ unsigned long *value; /* pointer to value to write to memory location */ this function writes a selected dsp memory location. the memory_map parameter is selects the appropriate dt_memory structure from dt_var.mem for the selected device. these structures are describe in the simdev.h file which is included with the simulator. the memory_map parameter can be obtained with the function dsp_findmem by using the memory name as a key. use the simulator help mem command f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
simulator object library entry points motorola c library functions 13-17 for a list of valid memory names. the memory_map enum is memory_map_ concatenated with a valid memory name. as an example, memory_map_pa refers to off chip pa memory on the 96002 device. if the selected memory map requires two word values, the least significant word should be at the value location and the most significant word at the value+1 location. if the memory address selects an external memory location, the dspl_xmwr function will be called. the dspl_xmwr function is provided in source form in the file simvmem.c and can be modified to simulate special external memory characteristics. see example 13-24. example 13-24. dsp_wmem int devn; unsigned long address, memval; address=200l; memval=0l; dsp_startup(); devn=0; dsp_new(devn,"56116"); /* allocate structure for device 0, a 56116 */ dsp_wmem(devn,memory_map_p,address,&memval); 13.2.25 dsp_wpin: write dsp pin state int dsp_wpin(device_index,pin,value) int device_index; /* dsp device index to be affected by command */ int pin; /* pin number to write*/ int value; /* input value for specified pin */ this function writes a selected dsp device pin with a value dsp_pinval_l, dsp_pinval_h, dsp_pinval_f, dsp_pinval_n, or dsp_pinval_p indicating low, high, floating, negative pulse, or positive pulse. use the simulators help pin command to produce a list of the valid pin names and each pins corresponding pin index. the device pin number can also be obtained by using the pin name as a key and calling the function dsp_findpin . the dsp_pinval values are defined in the simdev.h file. see example 13-25. example 13-25. dsp_wpin #include "simcom.h" #include "simdev.h" /* write the reset pin of device 0 with a high level. */ int devn; int pinnum; dsp_startup(); devn=0; dsp_new(devn,"56116"); /* allocate structure for device 0, a 56116 */ dsp_findpin(devn,"reset",&pinnum);/* get pin number for pin named reset */ dsp_wpin(devn,pinnum,dsp_pinval_h); f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
13-18 suite56 simulator reference manual motorola simulator object library entry points 13.2.26 dsp_wport: write dsp port state dsp_wport(device_index,port,mask,data,force) int device_index; /* dsp device index to be affected by command */ int port; /* port number to write */ unsigned long mask; /* pin mask for this port */ unsigned long data; /* port data value */ unsigned long force; /* port forcing state */ this function forces data on a dsp device port from outside the device. the value supplied in the data parameter contains the new input data to be written to the port. the value supplied in the force parameter indicates which port bits are actually being driven as inputs to the device. the value supplied in the mask parameter specifies which pins in the port are to be affected by this write; the other pins in the port remain in their previous state. the port parameter acts as the index to the dev_var.xportval array. a list of port names and the corresponding port index can be obtained using the simulators help port and help periph commands. the port index and mask value can also be obtained by using the port name as a key when calling dsp_findport . this function call can be paired with the dsp_rport function to simulate a port to port connection between devices. see example 13-26. example 13-26. dsp_wport /* write portb of device 1 from portb of device 0 */ int portnum; unsigned long portbdata, portbforce; unsigned long portmask; dsp_startup(); dsp_new(0,"56116"); /* allocate structure for device 0, a 56116 */ dsp_new(1,"56116"); /* allocate structure for device 1, a 56116 */ dsp_findport(0,"portb",&portnum,&portmask); dsp_rport(0,portnum,&portbdata,&portbforce) dsp_wport(1,portnum,portmask,portbdata,portbforce) 13.2.27 dsp_wreg: write a dsp device register dsp_wreg(device_index,periph_num,reg_num,reg_val) int device_index; /* dsp device index to be affected by command */ int periph_num; /* dsp peripheral number */ int reg_num; /* dsp register number */ unsigned long *reg_val; /* value to be written to register */ this function writes a selected register in the a dsp structure. use the simulator help reg command to obtain a list of the valid periph_num and reg_num values, and reg_val size for each register. also, the function dsp_findreg can be used to obtain the peripheral and register number by using the register name as a key. f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
simulator object library entry points motorola c library functions 13-19 if a register requires more than one word to represent the data value the least significant word should be at reg_val , with more significant words at reg_val+1 , etc. see example 13-27. example 13-27. dsp_wreg int devn; int periph_num, reg_num; unsigned long regval; dsp_startup(); devn=0; dsp_new(devn,"56116"); /* allocate structure for device 0, a 56116 */ regval=100l; if (dsp_findreg(devn,"pc",&periph_num,®_num)) dsp_wreg(devn,periph_num,reg_num,®val); 13.2.28 sim_docmd: execute simulator user interface command sim_docmd(device_index,command_string) int device_index; /* dsp device index to be affected by command */ char *command_string; /* user interface command to be executed */ this function executes any simulator command that the simulator normally accepts from the terminal. simdsp normally calls sim_gtcmd() to get a valid command string from the terminal, then calls sim_docmd to execute it. the device_index determines which dsp device (in a multiple dsp simulation) is affected by the command execution. the devices are numbered 0,1,2...n-1 in an n-device system, so be very careful, for example, to use 0 for the device_index parameter in a single device system. if the command_string begins macro execution the selected device structure in_macro flag will be set by sim_docmd . simdsp retrieves valid commands from the macro file by calling sim_gmcmd () as long as the in_macro flag is set. the commands are still executed by sim_docmd , whether they come from the terminal or a macro file. commands which initiate device cycle execution (such as go or trace ) will set the device structure sim_var.stat.executing flag. simdsp executes device cycles until the executing flag is cleared by an execution breakpoint. see example 13-28 example 13-28. sim_docmd int devn; dsp_startup(); devn=0; dsp_new(devn,"56116"); /* allocate structure for device 0, a 56116 */ sim_docmd(devn,"change pc $40");/* change device 0 pc register to $40 */ sim_docmd(devn,"break r p:$80");/* set a breakpoint for device 0 */ sim_docmd(devn,"go"); /* begin execution of device 0 */ f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
13-20 suite56 simulator reference manual motorola simulator object library entry points 13.2.29 sim_gmcmd: get command string from macro file sim_gmcmd(device_index,command_string) int device_index; /* dsp device index to be affected by command */ char *command_string; /* pointer to return buffer for command line */ this function reads the next simulator command string from a macro file. the sim_docmd() function will normally determine that a command is a macro, open the macro file and set the device structure sim_const.in_macro flag. the sim_gmcmd() function returns the next line from the open macro file each time it is called. it will clear the in_macro flag at the end of macro execution or if an invalid macro command is processed. the command_string buffer should be at least 80 characters. see example 13-29. example 13-29. sim_gmcmd /* execute the macro command file startup.cmd on dsp device structure 0. */ #include "simcom.h" #include "simusr.h" extern struct sim_const sv_const; /* simulator device structures */ char command_string[80]; int devn; dsp_startup(); devn=0; dsp_new(devn,"56116"); /* create new dsp structure */ sim_docmd(devn,"startup"); /* begin the startup macro */ while (sv_const.in_macro){ sim_gmcmd(devn,command_string); /* get command string from macro file */ sim_docmd(devn,command_string); /* execute command string */ } 13.2.30 sim_gtcmd: get command string from terminal sim_gtcmd(device_index,command_string) int device_index; /* dsp device index to be affected by command */ char *command_string; /* pointer to return buffer for command line */ this function gets the next command string from the terminal in an interactive mode. the command line editing, command expansion and on-line help functions are invoked by this terminal command input function. the command string is fully checked for errors prior to returning. the command_string buffer should be at least 80 characters. see example 13-30. f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
simulator external memory functions motorola c library functions 13-21 example 13-30. sim_gtcmd /* get and execute simulator commands for device 0 until a go type command is */ /* entered. */ #include "simcom.h" #include "simusr.h" extern struct sim_const sv_const; /* simulator device structures */ char command_string[80]; int devn; dsp_startup(); devn=0; dsp_new(devn,"56116"); /* create new dsp structure */ while (!sv_const.sv[devn]->stat.executing){/* check for go */ sim_gtcmd(devn,command_string); /* get command */ sim_docmd(devn,command_string); /* execute command */ } 13.3 simulator external memory functions the following sections describe functions which are provided in source code form in the simulator package in the file simvmem.c . these functions define all the operations associated with reading, writing or storing dsp external memory locations. the simulator memory allocation function is also included in this module since the representation of external memory is implemented with a virtual memory technique that is integrated with the memory allocation service. the external memory functions, with the exception of dsp_alloc , would not normally be called directly from the users code. they are referenced from other simulator functions, such as dsp_load or dsp_rmem , described in section 13.2. table 13-3 is a reference list of the external memory functions: table 13-3. external memory functions function description dsp_alloc(num_bytes); allocate simulator program memory dspl_xmend(devn,map); end dsp external memory access dspl_xmfree(devn); free dsp device external memory dspl_xminit(devn); initialize dsp device external memory dspl_xmload(devn,fp); load dsp external memory from state file dspl_xmnew(devn); create new external memory structure dspl_xmrd(devn,map,add,val,fetch) ; read dsp external memory location to val f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
13-22 suite56 simulator reference manual motorola simulator external memory functions the external memory access functions are provided in source form so that the external memory map attributes can be customized. this is especially useful for multiple dsp simulations in which complex configurations such as dual-port memory may be required. the functions in simvmem.c simulate the entire external memory space of up all dsp devices. 13.3.1 dsp_alloc: allocate simulator program memory void *dsp_alloc(numbytes) unsigned int numbytes; /* size of memory block needed in bytes */ this function must return a character pointer to the requested number of bytes of memory. it is not necessary for the memory to be cleared. a simple version could just call malloc() . the simulator will not recover if the dsp_alloc() call fails, so an exit() must occur within dsp_alloc() if the requested memory cannot be allocated. see example 13-31. example 13-31. dsp_alloc /* allocate memory for a new structure. */ void *dsp_alloc(); struct new_struct{ char buf[1000]; int bufindex; } *newp; newp=(struct new_struct *) dsp_alloc(sizeof(struct new_struct)); 13.3.2 dspl_xmend: end dsp external memory access dspl_xmend(device_index,memory_map) int device_index; /* dsp device index to be affected by command */ enum memory_map memory_map; /* memory designator */ the core simulation calls this function during the last clock cycle of each external memory access. the memory_map parameter will be a memory designator as returned by dsp_findmem . use the simulator help mem command for a list of valid memory names. the memory_map enum is memory_map_ concatenated with a valid memory name. as an example, memory_map_pa refers to off chip pa memory on the 96002 device. dspl_xmsave(devn,fp); save dsp external memory to state file dspl_xmstart(devn,map); start dsp external memory access dspl_xmwr(devn,map,add,val,store) ; write dsp external memory with val table 13-3. external memory functions (continued) function description f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
simulator external memory functions motorola c library functions 13-23 13.3.3 dspl_xmfree: free dsp device external memory dspl_xmfree(device_index) int device_index; /* dsp device index to be affected by command */ this function must free any memory that has been allocated to represent the external memory space of a selected device. note that this function should not be called directly by the users code. it is called as one of the steps in freeing an entire device structure by dsp_free() . see example 13-32. example 13-32. dspl_xmfree /* free external memory of dsp device structure 0. */ int devn; devn=0; dspl_xmfree(devn); 13.3.4 dspl_xminit: initialize dsp device external memory dspl_xminit(device_index) int device_index; /* dsp device index to be affected by command */ this function must initialize the values in any structures used to represent the external memory of a dsp device. the simulator commands reset s and load s will call dspl_xminit() in the processes of initializing or reloading the simulator state. see example 13-33. example 13-33. dspl_xminit /* initializing external memory for device 1 */ int devn; devn=1; dspl_xminit(devn); 13.3.5 dspl_xmload: load dsp external memory from state file int dspl_xmload(device_index,fp) int device_index; /* dsp device index to be affected by command */ file *fp; /* pointer to file opened in text read mode ("r") */ this function must restore external memory from a simulator state file. note that this function should not be called directly by the users code. the dspl_xmload() call is the last step of the dsp_load() function which loads a simulator state file. the file pointer provided to dspl_xmload will have been opened with fp=fopen (filename,r) and the remainder of the simulator state will have already been restored from the state file. the steps used to restore the external memory should complement the steps used to save external memory in the dspl_xmsave() function. the return value of dspl_xmload() should be 1 if successful, 0 if an error occurred. the dsp_load() function will close the file following the dspl_xmload() call. see example 13-34. f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
13-24 suite56 simulator reference manual motorola simulator external memory functions example 13-34. dspl_xmload /* call of dspl_xmload() from dsp_load() */ int status; file *fp; fp=fopen(filename,"r"); ./* loading of other simulator state structures */ . status=dspl_xmload(devn,fp); 13.3.6 dspl_xmnew: create new external memory structure dspl_xmnew(device_index) int device_index; /* dsp device index to be affected by command */ this function must create and initialize the external memory for a device. note that this function should not be called directly by the users code. the dsp_new() function calls dspl_xmnew() as part of the process of creating a new dsp device structure. see example 13-35 example 13-35. dspl_xmnew /* call to dspl_xmnew() from dsp_new() */ dspl_xmnew(devn); 13.3.7 dspl_xmrd: read dsp external memory location int dspl_xmrd(device_index,mem_map,address,return_value,fetch) int device_index; /* dsp device index to be affected by command */ enum memory_map memory_map; /* memory designator */ unsigned long address; /* dsp memory address to read */ unsigned long *return_value; /* memory value will be returned here */ int fetch; /* flag indicating that a dsp fetch is in progress */ this function must return the value of a dsp devices external memory location. the simulator calls dspl_xmrd() when a dsp device reads an external memory location, or when the simulator user interface reads the location for display purposes. this function also returns a flag value of 1 if the memory location exists, 0 if it doesnt exist. the fetch parameter indicates to dspl_xmrd () whether or not the read is being executed by the dsp device. if fetch=1 , the dsp device is fetching the memory location during execution of a device cycle. if fetch=0 , dspl_xmrd () is being called from some other source not associated with device cycle execution (for example, from the memory display routines). although the fetch parameter is not used in the version of dspl_xmrd () provided in the file simvmem.c , it is provided to enable special processing that should only occur when the device cycle simulation is taking place. the memory_map parameter will be a value representing the memory space being accessed. use the simulator help mem command for a list of valid memory names. the memory_map enum is memory_map_ concatenated with f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
simulator external memory functions motorola c library functions 13-25 a valid memory name. as an example, memory_map_pa refers to off chip pa memory on the 96002 device. see example 13-36. example 13-36. dsp_xmrd /* read "pe" memory location $5000 of device 2 */ unsigned long address; int devindex; unsigned long retval; int ok; int fetch; address=0x5000l; devindex=2; fetch=0; ok= dspl_xmrd(devindex,memory_map_pe,address,&retval,fetch); 13.3.8 dspl_xmsave: save dsp external memory to state file int dspl_xmsave(device_index,fp) int device_index; /* dsp device index to be affected by command */ file *fp; /* pointer to file opened in write mode */ this function must save the external memory state to a simulator state file. the dspl_xmsave() call is the last step of the dsp_save() function which saves a simulator state file. the file pointer provided to dspl_xmsave will have been opened with fp=fopen (filename, w+ ) and the remainder of the simulator state will have already been saved to the state file. the return value of dspl_xmsave() should be 1 if successful, 0 if an error occurred. the dsp_save() function will close the file following the dspl_xmsave() call. see example 13-37. example 13-37. dspl_xmsave /* call of dspl_xmsave() from dsp_save() */ int status; file *fp; fp=fopen(filename,"w+"); ./* saving of other simulator state structures */ . status=dspl_xmsave(devindex,fp); 13.3.9 dspl_xmstart: start dsp external memory access dspl_xmstart(device_index,memory_map) int device_index; /* dsp device index to be affected by command */ enum memory_map memory_map; /* memory designator */ the core simulation calls this function during the first clock cycle of each external memory access. the memory_map parameter will be a value as returned by dsp_findmem . use the simulator help mem command for a list of valid memory names. the memory_map f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
13-26 suite56 simulator reference manual motorola simulator screen management functions enum is memory_map_ concatenated with a valid memory name. as an example, memory_map_pa refers to off chip pa memory on the 96002 device. 13.3.10 dspl_xmwr: write dsp external memory location int dspl_xmwr(device_index,mem_map,address,value,store) int device_index; /* dsp device index to be affected by command */ enum memory_map memory_map; /* memory designator */ unsigned long address; /* dsp memory address to write */ unsigned long value; /* value to be written to memory location */ int store; /* flag indicating that a device store is in effect */ this function must store a value to a dsp devices external memory location. the simulator calls dspl_xmwr() when a dsp device writes an external memory location, or when the simulator user interface alters the location. the store parameter will indicate if the reference is from the dsp device ( store=1 ) during simulation of device cycle execution, or some other source ( store=0 ) not related to device cycle execution. for example, the change memory simulator command will set the parameter store to 0. the store parameter is not used in the dspl_xmwr function provided in the file simvmem.c , but is available to the user if modifications are made to the simvmem.c file for special external memory processing. the memory_map parameter will be a value representing the memory space being accessed. use the simulators help mem command to obtain a list of the valid memory space prefixes. see example 13-38. example 13-38. dspl_xmwr /* write value of 3 to "xe" memory location 5 of device 2 */ unsigned long address; int devindex; int ok; unsigned long newval; int store; address=5l; devindex=2; newval=3l; store=0; ok= dspl_xmwr(devindex,memory_map_xe,address,newval,store); 13.4 simulator screen management functions the following sections describe functions which are provided in source code form in the simulator package in the file scrmgr.c . these functions define all the operations associated with simulator terminal i/o. the code includes conditionally compiled sections for msdos, unix, and vms. the code is provided to allow customization of the simulator terminal i/o for a particular environment. the user may, for example, wish to f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
simulator screen management functions motorola c library functions 13-27 redefine the control characters used by the simulator so that they map to some particular terminal. table 13-4 is a quick reference list of the simulator screen management functions: 13.4.1 simw_ceol: clear to end of line simw_ceol() this function must clear the display from the current column to the end of line, then return the cursor to the previous position. table 13-4. screen management functions function description simw_ceol(); clear to end of line simw_ctrlbr(); check for ctrl-c signal simw_cursor(line,column); move cursor to specified line, column simw_endwin(); end the simulator display simw_getch(); non-translated keyboard input simw_gkey(); translated keyboard input simw_putc(c); output character to terminal simw_puts(line,column,text,flag) ; output string to terminal at line and column simw_redo(device); repaint screen with output from device simw_redraw(count); redraw screen after scrolling count simw_refresh(); screen update after buffering output simw_scrnest(); nest output buffering another level simw_unnest(); pop output buffering one level simw_winit(); initialize window parameters simw_wscr(string,commandflag); write string and perform logging functions f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
13-28 suite56 simulator reference manual motorola simulator screen management functions 13.4.2 simw_ctrlbr: check for ctrl-c signal simw_ctrlbr() this function must check for the occurrence of a ctrl-c signal from the terminal. if the ctrl-c signal occurs, it sets a flag for the active breakpoint dsp (defined by sv_const.breakdev ). it returns the sim_var.stat.ctrlbr flag for the current device. this allows the program to select the device that will halt in response to the ctrl-c signal from the keyboard in a multiple device simulation. 13.4.3 simw_cursor: move cursor to specified line and column simw_cursor(line,column) this function must move the cursor to the specified line and column and update the sim_const.curline and sim_const.curclm variables. 13.4.4 simw_endwin: end simulator window simw_endwin() this function is normally called when returning to the operating system level from the simulator. it must terminate any special processing associated with terminal i/o for the simulator and clear the display. 13.4.5 simw_getch: non-translated keyboard input simw_getch() this function gets a single character in a non-translated mode from the terminal. it is not used much by the simulator - only when returning from the execution of the system command prior to the time when the simulators special terminal i/o processing is reinitialized. 13.4.6 simw_gkey: translated keyboard input simw_gkey() this function gets a keystroke from the terminal and maps it to one of the accepted internal codes used by the simulator. the internal codes are defined in simusr.h . this function should not output the character to the terminal. this function is a good candidate for modification if you want to change the set of input control characters used by the simulator. f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
simulator screen management functions motorola c library functions 13-29 13.4.7 simw_putc: output character to terminal simw_putc(c) char c; this function outputs the character in the variable c at the current cursor and column position. it advances and updates the sim_const.curclm variable. this function is not used often by the simulator, and it is not very time critical when it is used, so the simulator implementation is just to call simw_puts() after creating a temporary string from the character c . 13.4.8 simw_puts: output string to terminal simw_puts(line,column,text,flag) int line; /* move cursor to this line for output */ int column; /* move cursor to this column for output */ char *text; /* text string to be output */ int flag; /* 0=non-bold, 1=bold on/off by {}, 2=all bold */ this function outputs a string to the terminal at the specified line and column. highlighting of output can be enabled either by setting the flag parameter to 2 or by enclosing text in curly braces and setting the flag parameter to 1. 13.4.9 simw_redo: repaint screen with output from device simw_redo(device) int device; /* use screen buffer from this device to repaint screen */ this function repaints the screen from a device screen buffer. it is normally only called when re-entering the simulator following a system command, after loading the device state with the load s filename command, or after switching devices in a multiple device simulation with the device command. 13.4.10 simw_redraw: redraw screen after scroll count simw_redraw(count) int count; /* number of lines to scroll before repainting the screen */ this function scrolls up or down count lines in the display buffer, then redisplays the text in the buffer at that position. this function only displays the text that is in the scrolling portion of the display. f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
13-30 suite56 simulator reference manual motorola simulator screen management functions 13.4.11 simw_refresh: screen update after buffering output simw_refresh() the simulator buffers screen output in implementations other than msdos in order to decrease the time spent repainting the screen. this provides a fixed display effect for consecutive trace commands. the simw_refresh() function will take care of refreshing the screen following buffering of screen output. it also resets the sim_const.scrnest variable to 0 to coincide with the non-buffered status of the screen following the refresh. 13.4.12 simw_scrnest: increase screen buffering one level simw_scrnest() this function increments a counter to signify the screen output buffering level. the companion simw_unnest () and simw_refresh () functions provide the output buffering operations for the simulator. the sim_const.scrnest variable is incremented each time this function is called. 13.4.13 simw_unnest: decrease screen buffering one level simw_unnest() this function decrements the sim_const.scrnest variable each time it is called. if the screen buffering level drops below one, simw_unnest() will call simw_refresh() to update the screen. 13.4.14 simw_winit: initialize window parameters simw_winit() this function initializes any screen or keyboard parameters that are required for the simulator terminal i/o environment. it is called whenever the simulator is entered from the operating system level, which includes the initial simulator entry and re- entry following the system command. 13.4.15 simw_wscr: write string and perform logging simw_wscr(text,command_flag) char *text; /* text string to write to screen */ int command_flag; /* flag 1=string is a command, 0= not a command */ this function outputs the string to the terminal above the command line after scrolling the display up one line. it also takes care of writing the text string to the proper log files specified by the simulator log s or log c commands. f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
non-display simulator motorola c library functions 13-31 13.5 non-display simulator the simulator package contains object libraries which support both display and non- display versions of the simulator. the library nwsim contains functions available to the non-display version of the simulator. the library wwsim contains functions that may only be used in a display version of the simulator. for each device type there are also display and non-display device-specific libraries named wwxxxxx and nwxxxxx where the xxxxx is the device number. the source code contained in snwdsp.c can be linked with the nwxxxxx and nwsim libraries to create a non-display version of the simulator. elimination of the user interface functions cuts the code size of the simulator almost in half. however, all of the functions listed in section 13.4 and sim_docmd () , sim_gmcmd () and sim_gtcmd () described in section 13.2, are sacrificed. the remainder of the functions in section 13.2 and all of the functions in section 13.3 are available in the non-display simulator libraries. some major features of the simulator are eliminated by the loss of the sim_docmd() function. in particular, there are no low-level entry points provided to set a breakpoint or to assign input or output files to dsp peripheral functions. however, the basic functions required to create a device, load a program, execute the code, and test or modify device registers are all still available. in addition, the dsp_save() function provides the capability to save the state of the non-display version. the state file can later be reloaded by a display version of the simulator for visual examination of the registers and memory contents. the following sections cover several topics that concern the non-display version of the simulator. section 13.5.1 deals with creating a new device. section 13.5.2 describes how to load a program or state file. section 13.5.3 describes how to execute device cycles. section 13.5.4 describes how to test breakpoint conditions. 13.5.1 creating a new device the simcom.h file defines the maximum number of dsp devices in the constant dsp_maxdevices . a new device can be created and numbered from 0 to dsp_maxdevices-1 . the structures are allocated by calls to the dsp_new () function described in section 13.2.13, "dsp_new: create new dsp device structure," . see example 13-39 f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
13-32 suite56 simulator reference manual motorola non-display simulator example 13-39. code to create new device the following c source code illustrates the steps necessary to create 3 dsp devices. dsp_startup(); dsp_new(0,"56116"); /* allocate structure for device 0, a 56116 */ dsp_new(1,"56116"); /* allocate structure for device 1, a 56116 */ dsp_new(2,"56116"); /* allocate structure for device 2, a 56116 */ 13.5.2 loading program code or device state the display version of the simulator provides the high level sim_docmd() function interface. it allows the user to simply execute the high level load or load s simulator commands to load program code or a simulator state file. the non-display version of the simulator makes use of the lower level function calls, dsp_ldmem () and dsp_load () ,to accomplish the same results. they are described in section 13.2. the major difference from their high-level counterparts is that no file-name expansion is provided in the lower level calls. the program code loaded by the dsp_ldmem () function may be any coff format or omf format file. the omf format is created as the output of versions of the macro assembler prior to release 4.0 and of the simulator save command.the coff format files are the output of the macro assembler beginning with release 4.0, or those saved by the simulator save command with the suffix .cld. the simulator state loaded by the dsp_load () function may have previously been saved by a display or non-display version of the simulator. the formats are the same. the dsp_save () function is provided as a low-level entry point that saves the simulator state for a non-display version of the simulator. it is the same function that is called during execution of the high level save s command, which is only available in the display version. the only limitation is that the full save filename must be specified. no automatic expansion is done for the working path or filename suffix as in the higher level simulator calls. the dsp_save () function is described in section 13.2, "simulator object library entry points," . 13.5.3 executing device cycles after creating a new device - as described in section 13.5.1, "creating a new device," - and loading a program or state file - as described in section 13.5.2, "loading program code or device state," - the simulator is ready to execute the program code. f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
multiple device simulation motorola c library functions 13-33 execution will begin at the start address specified in the load file, or continue from the previous location in a simulator state file. the users code may select a new execution address by writing register pc using the dsp_wreg function. the simulator will advance the device state by one clock cycle each time the dsp_exec function is called. the device pin states are updated each clock cycle, and can be examined or changed using the dsp_rpin, dsp_wpin, dsp_rport, or dsp_wport functions. 13.5.4 testing breakpoint conditions the display version of the simulator provides a way to specify breakpoint conditions that are evaluated each time dsp_exec is called. if the breakpoint condition is met, the simulator displays the enabled registers and clears the device structure sim_var.stat.executing flag (assuming the breakpoint action is halt ). the non-display simulator does not provide a way to specify breakpoint conditions. it is up to the users code to examine device registers or memory conditions and decide whether or not to continue cycle execution. the device registers and memory can be examined using the dsp_rreg and dsp_rmem functions. the example program snwdsp.c simply checks the simulator cycle counter for device 0 and terminates execution after some number of cycles. another variable that may be particularly useful in breakpoint testing is dev_var.flg_stat . it maintains bit flags which signal end-of-instruction ( dsp_geoi ), end of repeat cycle ( dsp_geor ), and illegal opcode (dsp_gilleg ). the bit flag definitions are defined in simdev.h . 13.6 multiple device simulation the simdsp simulator initially simulates a single dsp device; but additional devices can be created using the device command. device to device pin connections or device to device memory map connections can be specified with the simulator input command. the following sections describe some details about the way the simulator handles multiple device simulation. section 13.6.1 describes the required steps which allocate and initialize multiple dsp structures. section 13.6.2 describes the method of interleaving device execution in order to maintain multiple device synchronization. section 13.6.3 describes simulation of the external memory space of the dsp devices. section 13.6.4 describes multiple device pin connections. section 13.6.5 describes display of device output in the multiple device environment. f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
13-34 suite56 simulator reference manual motorola multiple device simulation 13.6.1 allocation and initialization of multiple devices most of the higher level simulator functions require a device index as one of the parameters. the simulator uses the device index to select a previously allocated dsp structure. the dsp structures are allocated dynamically by calling the dsp_new function for each device. the device type is also selected in the dsp_new function call. in the display version of the simulator, the device command handles the details of calling dsp_new . the proper sequence of instructions necessary to allocate three dsp devices is shown below. dsp_startup(); dsp_new(0,"56116"); /* allocate structure for device 0, a 56116 */ dsp_new(1,"56116"); /* allocate structure for device 1, a 56116 */ dsp_new(2,"56116"); /* allocate structure for device 2, a 56116 */ 13.6.2 interleaving multiple dsp simulations the dsp_exec function executes a single dsp clock cycle and updates the selected dsp device structure. in order to simulate simultaneous multiple dsp execution, dsp_exec should be called for every device before proceeding to the next clock cycle. the simdsp simulator executes a single clock cycle for each active dsp device, then halts if any active device has cleared its sim_var.stat .executing flag. it allows simulator commands, such as register or memory modifications, on the viewed device until a command sets the executing flag again. the device which causes a breakpoint becomes the viewed device by default, but the viewed device can be changed with the device command without changing the status of any device. a particular device can be halted by setting the ctrlbr flag in its sim_var.stat structure. this has the same effect as typing ctrl-c at the keyboard while a device is running. it breaks device execution at the end of the current instruction. note that it is not mandatory to wait for the sim_var.stat .executing flag to be set to begin device execution, or to halt if the executing flag is clear. these are just convenience features for the simulator user interface. device cycle execution can be advanced in single cycle increments at any time by calling dsp_exec . 13.6.3 external memory definition the simulator package contains the c source file simvmem.c which contains all the external memory access functions used by the simdsp simulator. these functions are described in detail in section 13.3. the functions, as written, will automatically simulate the entire external memory space of all dsp devices, assuming that the operating system can allocate enough memory to store the device structures for the devices. the user may wish to modify the simvmem.c functions in order to define special external memory configurations. the functions can be modified, for example, to simulate the f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
multiple device simulation motorola c library functions 13-35 response of dual-port ram or special memory-mapped peripherals. another good reason to modify the external memory functions is to increase the speed of the simulation. if the users simulation only requires some minimum amount of external memory, then the virtual memory management functions provided with the simulator are probably overkill. 13.6.4 multiple dsp pin interconnections the dsp_exec function will automatically update the dsp device pin states by one clock cycle change each time it is called. the display version of the simulator will also retrieve or send data to assigned i/o files as defined by the input and output commands. the input command supplies a method of connecting device pins back to other device pins on the same device as well as to device pins on another device. the device pin states for any device can be examined or written using the dsp_rpin and dsp_wpin functions described in section 13.2. simulation of pin to pin connection simply requires reading the state of the output pin each cycle with dsp_rpin and writing it to the input pin with dsp_wpin . a bidirectional pin connection requires reading and writing both pins. the simulator maintains separate buffers for input and output data for each pin, so there is no problem writing a pin, even if it is defined as an output. the input value will be stored, but will only be used if the pin is subsequently reconfigured as an input. an entire port state can be read or written using the dsp_rport and dsp_wport functions described in section 13.2. the port and pin states are derived from the same storage variables in the device structure. the dsp_rport, dsp_wport, dsp_rpin, and dsp_wpin functions just provide a convenient method of retrieving the data from this structure. 13.6.5 multiple dsp simulator display the simulator display functions are contained in the source file scrmgr.c in the simulator package. this code supports a virtual screen for each simulated dsp. the supplied display code uses a single window. the lines above the command line form a scrollable region in which session output is displayed. the command line, error line and help line are the three bottom lines of the display. each allocated device contains screen buffer memory which saves the previous 100 lines of output which is written to a devices scroll region. the terminal screen update is inhibited unless the sim_const.viewdev value matches the device index, but the output is always placed in the devices screen buffer. the screen can be completely refreshed from a selected device screen buffer by executing the simw_redo function. the device command allows the user to switch the displayed device. when it switches to a new device, it refreshes the entire screen from the devices display buffer. f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
13-36 suite56 simulator reference manual motorola reserved function names 13.7 reserved function names the public function names used in the simulator all begin with the prefixes dsp or sim . functions which begin with sim are only available when a display version of the simulator is created. functions which begin with dsp are available to both display and non display versions. the screen management functions all begin with simw_ . in general, functions which begin with dsp_ or sim_ are higher level functions available for direct reference from the users code; those beginning with dspl_ or siml_ are meant only for internal use by the simulator. the higher level functions and the screen management functions are documented in sections 13.2, 13.3, and 13.4. the public function names are listed in the file named global.sym which is included with the distribution. 13.8 simulator global variables in order to reduce conflicts with user variable names, the simulator global variables have been grouped together into several large structures. in general, the structure names beginning with s are used defined in simusr.h and are only used in the display version of the simulator; while those beginning with d are defined in simdev.h and are used by both the display and non-display versions of the simulator. the prefixes st_ and dt_ are used for structure names of device-type structures, that is structures which must be defined for each device type. the prefixes sim_ and dev_ are used for structure names of general device or simulation structures. global variable names may have a prefix dx_, dv_, sx_, or sv_ . the prefix dx_ is used for variables of dt_ structures. the prefix dv_ is used for variables of dev_ structures. the prefix sx_ is used for variables of st_ structures. the prefix sv_ is used for variables of sev_ structures. a list of simulator global variables is included in the distribution file named global.sym. 13.9 modification of simulator global structures the source file simglob.c , which is included in the simulator package, contains the global structures sv_const and dv_const . there are some useful modifications, described below, that can be made to the constant definitions at the beginning of simglob.c . the simglob.c module must then be recompiled and relinked using the make file provided with the simulator package. in addition to these, there may be device-specific modifications that can be made to the simulator. dsp_maxdevices this define constant determines the maximum number of devices that can be allocated using the simulators device command. as a default it is set to 32. f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
modification of device global structures motorola c library functions 13-37 dsp_cmdsz this define constant determines the size of the previous command stack. the simulator commands are stored in the stack and can be reviewed using the ctrl-f and ctrl-b key entries. as a default the previous command stack size is set to 10. dsp_histsz this define constant determines the size of the execution history buffer, which stores device instructions as the simulator executes. the buffer is used by the simulator history command, and has a default size that can save 32 instruction words. dsp_winsz this define constant determines the size of the screen buffer that is maintained and displayed by the scrmgr.c functions. it specifies the number of display lines that will be allocated for each device as they are created with the simulator device command. the user can use the ctrl-u , ctrl-t , ctrl-v , and ctrl-d key sequences to review display lines that have scrolled off the screen. this constant should not be set to a value smaller than the number of lines in the display window. 13.10 modification of device global structures the device types available to the simulation are defined in the source module named with the prefix dsp followed by the device family name. as an example, the file dsp56100.c contains the global structures dx_56116 and sx_56116 , which define device-specific information about the dsp56116 device in the 56100 family. you may wish to modify this module to define a new device type that can then be created by the simulators device command. the basic idea is to create a new device type and definition by modifying a previous definition in the dsp file. as an example, using the 56116 device in the file dsp56100.c , the procedure would be: make a copy of dsp56100.c and name it something else. modify the makefile file to include this new module name for compilation and linking in the same manner that makefile handles the dsp56116. in the new file, rename the dx_56116 structure to some name other than dx_56116 , and put a pointer to this new structure in the dx_all array in the file simglob.c. in the new dt_var structure, change the device type name to some name other than 56116 - this is in the first member of the dt_var structure in the new file, change the sx_56116 structure to some name other than sx_56116 , and put a pointer to this new structure in the sx_all array in the file simglob.c . f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
13-38 suite56 simulator reference manual motorola modification of device global structures after the above steps are completed, lower level structures and define constants in the new module can be modified to change such parameters as on-chip memory size, number of peripherals, or number and names of pins. continuing with the 56116 example, table 13-5 is a list of the lower level structures and define constants associated with the 56116 that may be changed in the new file: table 13-5. lower level structures & define constants function description dsp_pi_size_116 this define constant determines the size of the on-chip program memory. dsp_pr_size_116 this define constant determines the size of the on-chip bootstrap rom memory. dsp_xi_size_116 this define constant determines the size of the on-chip x data memory. dsp_xp_size_116 this define constant determines the size of the on-chip x memory-mapped peripheral register space. dx_periph_56116 this structure can be modified to add peripherals to or remove peripherals from the newly defined device. if you modify this structure, you must also modify the sx_periph_56116 structure in a similar manner. the file portb100.c is provided in source form with the simulator package as a model to be used when creating new peripheral structures. bootrom this is the default initialization data for the on-chip bootstrap rom. it is loaded at start-up and in response to the reset s command. you can also change the contents of the bootstrap rom with the simulator asm , load , and change commands. xpin this structure determines the names assigned to device pins, as well as the order in which the pins are displayed in output pin lists. it also provides a cross-reference from the pin name to the physical bit and storage port in which the simulator maintains the pin data. the portindex cross-reference is an offset to the proper dev_xpval structure from the xportval pointer in the dev_var structure. each pin has a primary name and a possible alternate peripheral function pin name. you may modify the names or delete or add dt_xpin structures from this array, but do not change the portindex and pinmask members of the dt_xpin structures. mem_56116 this array of dt_memory structures can be modified to change parameters associated with the dsp56116 memory attributes. the name member is the memory name used by the simulator commands to reference the memory space. the memsize member determines the size of arrays allocated for on-chip memory. the memattr member determines whether the memory is located on or off chip and whether it is ram or rom. the romval pointer can point to initialization data for the memory space. if it is null, the memory space will be initialized to zero at start-up and in response to the reset s command. although you may change the memory names, memory size, memory attributes, and initialization data, do not add or delete dt_memory structures from the mem_56116 array. pval this array of dt_xpidata structures is used by the simulator to initialize the input pin data in the dev_var.xportval structures at simulator start-up and in response to the reset s command. f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
modification of device global structures motorola c library functions 13-39 xports this array of dt_xpid structures determines port names that can be used in the simulator input and output commands. these names are in addition to the peripheral names that are specified in the individual peripheral modules. the port names are just a convenient way to specify a subgroup of pins within a single physical port for input and output operations. dx_56116 this structure is mostly a conglomeration of the other substructures defined within the module for this device type. the only member of this structure that should be modified is devname , which will be used to specify the new device type in the simulator device command mem_dispfw56116 this structure provides display field width information for the different memory spaces defined in the mem_56116 defined previously. hlp_56116 this structure provides the help pointers that will be used by the simulator when help is requested for this device type. sx_periph_56116 this structure points to display information for the registers of each peripheral; the actual display information is defined locally in each peripheral module. the file portb100.c is provided in source form with the simulator package as a model to be used when creating new peripheral structures. table 13-5. lower level structures & define constants function description f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
13-40 suite56 simulator reference manual motorola modification of device global structures f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
motorola i-i a alternate directory 3-1 asm examples 12-7 , 12-8 asm - single line interactive assembler 12-7 assembly 11-5 , 11-6 assign 5-11 output file 5-11 , 5-12 , 5-13 b binary 6-3 break 2-4 , 2-7 , 12-8 breakpoint 1-15 , 12-12 action 12-10 clear 13-9 examples 12-12 testing 13-6 , 13-19 , 13-33 breakpoints 1-13 , 11-1 , 11-5 , 11-6 byte wide 12-7 c c7-1 call stack 7-1 , 7-2 calls 7-4 change 13-26 change 12-13 examples 12-14 .cld 13-10 .cmd 13-20 coff 3-3 command 8-1 , 8-2 , 11-2 , 11-3 , 12-5 , 12-6 asm 12-7 device 12-15 disassemble 12-16 display 12-18 down 12-19 entering 1-2 finish 12-21 history 12-24 input 12-24 , 12-25 list 12-27 command entry command line editing 13-20 expansion 13-20 from macro file 13-19 , 13-20 from terminal 13-19 , 13-20 , 13-28 command execution go mode 13-19 macros 13-19 , 13-20 trace mode 13-19 , 13-30 command overview 12-1 command syntax 12-4 commands load 13-32 system 13-28 , 13-29 comment from dspt_masm 13-4 configuration custom external memory 13-22 , 13-34 copy 12-14 examples 12-14 copy memory 4-6 create 8-1 ctrlbr 13-34 ctrl-c 13-28 , 13-34 d data 5-9 , 5-10 debugging 7-1 decimal 6-3 default 6-2 device 5-11 , 5-12 , 6-2 , 11-3 device button 10-6 device io 5-1 , 6-2 introduction 5-1 device type 12-15 directory 3-1 , 3-2 disable 11-1 , 11-6 disassemble 4-7 , 11-5 display 6-6 , 11-1 , 11-2 , 11-3 , 11-5 display menu 3-1 path 3-1 , 3-2 down 7-2 , 7-3 , 12-19 down examples 12-19 dsp_alloc 13-22 dsp_exec 13-6 dsp_findmem 13-6 dsp_findpin 13-7 dsp_findport 13-7 dsp_findreg 13-8 dsp_fmem 13-9 index f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
i-ii suite56 dsp simulator users manual motorola dsp_free 13-8 dsp_geoi 13-33 dsp_geor 13-33 dsp_gilleg 13-33 dsp_init 13-10 dsp_ldmem 13-10 , 13-32 dsp_load 13-11 , 13-32 dsp_new 13-11 , 13-16 , 13-31 dsp_path 13-11 dsp_rapin 13-12 dsp_rmem 13-13 dsp_rpin 13-13 , 13-35 dsp_rport 13-14 , 13-35 dsp_rreg 13-15 dsp_save 13-15 , 13-32 dsp_startup 13-15 dsp_unlock 13-16 dsp_wapin 13-16 dsp_wmem 13-17 dsp_wpin 13-17 , 13-35 dsp_wport 13-18 , 13-35 dsp_wreg 13-19 dspl_xmend 13-22 dspl_xmfree 13-23 dspl_xminit 13-23 dspl_xmload 13-23 dspl_xmnew 13-24 dspl_xmrd 13-24 dspl_xmsave 13-25 dspl_xmstart 13-25 dspl_xmwr 13-26 dspt_masm_xxxxx 13-5 dspt_unasm_xxxxx 13-5 during 2-6 e edit 11-5 , 11-6 enable 11-1 , 11-5 entering commands 1-2 , 11-2 evaluate 9-1 , 9-2 execute 2-7 go command 12-22 pause 2-6 execute menu 2-7 finish 2-6 go 1-13 , 1-15 , 2-1 reset 2-7 , 2-8 stop 2-7 executing 13-6 , 13-19 , 13-33 exit 6-6 expression 12-20 evaluate 12-20 expressions 9-1 introduction 9-1 f features 1-2 file i/o comands 13-20 commands 13-19 filename 13-11 initialization 13-9 memory 13-32 object module 13-10 state file 13-10 , 13-15 , 13-23 , 13-25 , 13-32 file menu 3-3 load 6-4 , 6-5 macro 8-1 , 8-2 save 3-3 filename suffixes .cld 13-10 .lod 13-10 .sim 13-10 , 13-15 files 6-4 finish 2-6 finish 2-6 finish button 10-5 fonts 6-6 format 5-1 i/o files 5-1 frame 7-2 , 7-3 frame 12-21 examples 12-21 function 2-6 g getting started 1-3 global variables 13-36 go 12-22 h help 12-23 help 11-3 hexadecimal 6-3 history 4-8 , 11-2 i i/o files 5-1 formatting 5-1 in_macro 13-19 , 13-20 initialization of a particular device 13-9 of external memory 13-23 initialization f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
motorola i-iii by dsp_new 13-11 dsp_init 13-9 of external memory 13-24 of window parameters 13-30 input 5-8 , 5-9 , 5-10 , 12-24 , 12-25 examples 12-26 instruction 2-1 , 2-2 , 11-5 , 11-6 interrupt 2-7 introduction to the dsp simulator 1-1 io redirect 7-5 io streams 7-5 l line 1-2 , 1-3 , 2-2 list 11-1 , 12-27 examples 12-27 load 1-6 , 6-4 .lod 13-10 log 8-2 log - log commands profile 12-30 session 12-30 profile 12-31 log files 8-1 m macro command file execution 13-19 , 13-20 macros 8-1 malloc 13-22 memory access functions 13-1 , 13-22 , 13-24 , 13-25 , 13-26 , 13-34 allocation 13-22 change values 12-13 change values in 4-5 display 4-3 , 4-4 free 13-8 , 13-23 initialization 13-23 initialize 13-9 load 13-10 load from state file 13-23 read 13-12 resetting 2-7 save to state file 13-25 write 13-9 , 13-16 mnemonic 12-7 modify 4-3 memory 4-5 registers 4-3 modify menu 6-3 device 6-2 radix 6-2 multiple dsp simulation device index 13-19 halting 13-28 interleaving execution 13-34 n next 2-3 , 11-5 , 11-6 examples 12-32 next 12-32 next button 10-4 , 10-5 non-display simulation executing device cycles 13-33 library file 13-31 loading program code 13-32 testing breakpoint conditions 13-33 numbering system 6-2 nwsim 13-31 nwxxxxx 13-31 o object code 1-6 , 3-3 , 11-5 , 12-16 object module loading 13-10 omf 3-3 output 5-11 , 5-12 , 5-13 , 11-7 , 12-33 p parameters 12-5 path 3-1 , 12-35 examples 12-35 pause 2-7 peripheral 5-8 , 5-9 , 5-10 pins 5-10 preferences 6-4 q quit- quit simulator session 12-36 r radix 6-3 , 6-4 , 11-2 , 12-36 radix - change input or display radix 12-36 redirect 12-38 examples 12-39 redirect- redirect stdin/stdout/stderr for c programs 12-38 register 4-1 , 4-2 , 12-17 , 12-18 change values 12-13 program counter 13-33 read function 13-14 f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
i-iv suite56 dsp simulator users manual motorola write function 13-18 registers 2-7 change values of 4-3 resetting 2-7 repeat button 10-7 reset 2-7 examples 12-39 reset button 10-8 reset- reset device or state 12-39 rts 2-6 run 8-2 s save 3-3 , 6-6 , 12-40 examples 12-40 save- save simulator file 12-40 screen buffer 13-30 scripts 8-1 scrmgr.c 13-26 , 13-35 session 11-4 , 11-5 .sim 13-10 , 13-15 sim_docmd 13-19 sim_gmcmd 13-20 sim_gtcmd 13-21 simulator 1-1 introduction 1-1 memory configuration 6-1 preferences 6-6 running 1-3 simvmem.c 13-22 , 13-34 simw_ceol 13-27 simw_ctrlbr 13-28 simw_cursor 13-28 simw_endwin 13-28 simw_getch 13-28 simw_gkey 13-28 simw_putc 13-29 simw_puts 13-29 simw_redo 13-29 , 13-35 simw_redraw 13-29 simw_refresh 13-30 simw_scrnest 13-30 simw_unnest 13-30 simw_winit 13-30 simw_wscr 13-30 source 11-6 source code 1-6 , 3-3 , 7-1 , 11-5 stack 7-2 , 7-3 , 11-7 start execution 1-13 state 2-7 , 2-8 , 6-4 , 6-5 resetting 2-7 state file create 13-15 , 13-25 load 13-23 step 12-41 examples 12-41 step 12-32 step - step through dsp program 12-41 step button 10-3 stop 2-6 , 2-7 stop button 10-2 streams 12-42 examples 12-42 streams - enable/disable handling of i/o for c programs 12-42 subroutine 2-6 syntax 12-4 of commands 12-4 system examples 12-43 system - execute system command 12-43 t terminal i/o functions 13-1 trace 2-3 , 12-44 examples 12-44 trace - trace through dsp program 12-44 type 7-6 examples 12-45 type - display the result type of c expression 12-45 u unlock 12-15 unlock - unlock password protected device type 12-46 until 2-4 examples 12-46 until - step until address 12-46 up 7-2 up - move up the c function call stack 12-47 using the tool bar 10-1 v view - select display mode 12-47 w wait 12-48 wasm 12-48 watch 9-8 , 9-9 examples 12-49 watch - set 12-49 modify view f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
motorola i-v or clear watch item 12-49 wbreakpoint - gui breakpoint window 12-50 wcalls - gui c calls stack window 12-50 wcommand - gui command window 12-51 where - gui c calls stack window 12-51 windows 6-6 , 11-2 , 11-5 winput - gui file input window 12-52 wlist - gui list window 12-52 working directory 3-1 , 3-2 wregister - gui register window 12-54 wsession - gui session window 12-55 wsource - gui source window 12-55 wstack - gui stack window 7-2 , 12-56 wwatch examples 12-57 wwatch - gui watch window 12-56 wwsim 13-31 wwxxxxx 13-31 f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .
motorola suite56 dsp simulator users manual vi f r e e s c a l e s e m i c o n d u c t o r , i freescale semiconductor, inc. f o r m o r e i n f o r m a t i o n o n t h i s p r o d u c t , g o t o : w w w . f r e e s c a l e . c o m n c . . .


▲Up To Search▲   

 
Price & Availability of DSPS56SIMUM

All Rights Reserved © IC-ON-LINE 2003 - 2022  

[Add Bookmark] [Contact Us] [Link exchange] [Privacy policy]
Mirror Sites :  [www.datasheet.hk]   [www.maxim4u.com]  [www.ic-on-line.cn] [www.ic-on-line.com] [www.ic-on-line.net] [www.alldatasheet.com.cn] [www.gdcy.com]  [www.gdcy.net]


 . . . . .
  We use cookies to deliver the best possible web experience and assist with our advertising efforts. By continuing to use this site, you consent to the use of cookies. For more information on cookies, please take a look at our Privacy Policy. X