ELECTRICAL ENGINEERING DEPARTMENT
School of Engineering and Applied Science
University of California, Los Angeles

EE113L DSP Lab.
Fall 1995
Experiment A - The Software Development Environment TA: Kei-Yong Khoo
Prof: Abeer Alwan

Purpose

    To gain familiarity with the software environment used to develop and test DSP56000 codes.

Introduction

  1. The development software for the DSP56000 chip family consists of an assembler (ASM56000), a linker (DSPLNK), a simulator (SIM56000), and an Application Development System interface program (ADS56002). We will be working with the first three programs in this experiment.

  2. The assembler accepts an assembly file (<filename>.asm) as its input and produces an object file (<filename>.cln). The linker resolves the addresses in the object file and produces an absolute executable file (<filename>.cld). The executable file is either downloaded to the DSP chip and run (using the ADS56002), or it is run on the simulator. The simulator runs on a PC and simulates the execution of the program as it would run on the chip.

Procedure

  1. The software you will be using in EE113L all runs on a 3/486 PC. The directory structure containing the programs you will need is shown below:
    C:\DSP\
           113L\
                COMMON\    - files prepared by TA
                EXP_A\     - files for experiment A
                EXP_B\     - files for experiment B
                 ....
                PROJECT\   - files for final project
           BIN\
           ADS\
    
    The subdirectory COMMON is used to stored files prepared for the class. You should put all your files for each experiment in a separate subdirectory (EXP_A, EXP_B,... etc.), which will be referred to as the working directories. You must not leave any files outside the working directories since they may be deleted without warning.

  2. Change to the working directory for this experiment by
        cd DSP\113L\EXP_A
    
    and copy the file "sort.asm" from the COMMON subdirectory to the EXP_A subdirectory:
        copy ..\COMMON\SORT.ASM
    
    Assemble the file by:
        asm56000 -L -B sort
    
    The -L option instructs the assembler to produce the listing file "sort.lst" which contains information helpful for debugging a program with errors. The -B option instructs the assembler to create the object file "sort.cln." Once your program has assembled correctly, you will have to link it by:
        dsplnk -B sort
    
    You will notice that the linker has created the executable file "sort.cld." Once you have this, you will no longer need "sort.cln." If your program ends up running correctly (in this case, it will), you will also have no need for "sort.lst." You may delete these two files by:
        del *.cln
        del *.lst
    
  3. You will now run the simulator by:
        sim56000
    
    Once the simulator is running, you may load your new program by typing
        load sort
    
    All of the available commands for the simulator are listed at the bottom of the screen (you may scroll through the list by hitting the space bar). The simulator has an excellent online help facility which explains how each command is used. For instance, if you type
        help display
    
    you will see a list of explanations telling you how to use the "display" command.

  4. We will be looking at the DSP56002's registers as we run the program. We will also want to see the contents of the X-memory locations where the sorted data is stored. Type
        display on x:$10..$17 
    
    to tell the simulator to include the X-memory locations $0010 through $0017 in the display. Next, type
        display 
    
    to enable the simulator display of the DSP56002's registers and the X-memory locations. Run the sort program by entering
        go
    
    The program ends with an infinite self-loop to "trap" the program's execution. Stop the simulator by typing ctrl-C (i.e., hold down the "Control" key and type "c"). Verify that the values in X-memory have indeed been sorted in ascending order.

  5. Sometimes, we may want to execute the instructions one at a time to observe the progress of the program. This is called "stepping through" the program. Reload the sort program by typing
        load sort
    
    Turn on the display again by typing
        display
    
    You may step through the program line by line with the command
        step
    
    Hit RETURN to continue stepping along. Try to verify the execution of the program line by line (look at the program counter, the current and previous instructions, the various registers, and the X- memory locations as you step through). Notice that the register(s) most recently updated by an instruction will be highlighted. This helps you to see what the previous instruction did. (Unfortunately, this is not true of the memory locations displayed, so keep a close eye on those as you step through). There may be times where we only want to step through a certain part of a program, skipping all of that which comes before that part. We may do this by setting a "break point." Use the stepping process to find the program memory address of the first DO instruction (say the address is $xxxx). Set a break point at that address by entering
        break pc>=$xxxx
    
    This will cause the simulator to halt when the program counter register is greater than or equal to $xxxx. Reload the sort program, enable the display, and type "go." You will notice that the simulator stops when the program counter is at $xxxx. From there, you may follow the procedure outlined above to step through the program from that point. Use the help command in conjunction with the following commands: change, list, trace, radix and reset. This will give you some idea of what these commands do and how they are used.

  6. Notice that the sort program assumes that the registers m1 and m2 contain $FFFF prior to program execution. After doing a reset (type "reset "), use the "change" command to alter the contents of m1 and m2 to 0. Run the program again. After stopping the program, determine whether or not the array in X-memory was sorted correctly.

khoo @ Oct. 95