Top Up Prev Next Bottom Contents Index Search

17.4 Targets


Three C50 targets are included in the Ptolemy distribution. To choose one of these targets, with your mouse cursor in a schematic window, execute the Edit:edit-target command (or just type "T"). You will get a list of the available Targets in the C50 domain. The default-C50 target is the default value. When you click OK, the dialog box appears with the parameters of the target. You can edit these, or accept the defaults. The next time you run the schematic, the selected target will be used.

17.4.1 Default C50 (default-C50) target

The default target is used only for code generation. It has the following set of options:

host (STRING) Default =
The default is the empty string. Host machine to compile or assemble code on. All code is written to and compiled and run on the computer specified by this parameter. If a remote computer is specified here then rsh commands are used to place files on that computer and to invoke the compiler. You should verify that your .rhosts file is properly configured so that rsh will work.
directory (STRING) Default = $HOME/PTOLEMY_SYSTEMS/C50
This is the directory to which all generated files will be written to.
file (STRING) Default =
The default is the empty string. This represents the prefix for file names for all generated files.
Looping Level Specifies if the loop scheduler should be used. Please refer to the section "default-CG" on page 13-2 for more details on this option. Refer to "Default SDF target" on page 5-65 and "The loop-SDF target" on page 5-67 for more details on loop scheduling.
display? (INT) Default = YES
If this flag is set to YES, then the generated code will be displayed on the screen.
compile? This is a dummy flag since the default target only generates code.
run? This is a dummy flag since the default target only generates code.
bMemMap (STRING) Default = 768-1279
Address range for C50 Dual Access RAM blocks. C50 Instructions that operate on data run faster if the data is stored in one of the DARAM blocks. Disjoint segments of memory can be specified by separating the contiguous ranges with spaces, e.g. "768-800 1200-1279."
uMemMap (STRING) Default = 2432-6848
Data address range in the C50 Single Access RAM block. This can also specify a valid address range in external memory.
subroutines? (INT) Default = -1
Setting this parameter to N makes the target attempt to generate a subroutine instead of in-line code for a star if the number of repetitions of that star is greater than N (use N=0 to generate subroutines even for stars with just 1 repetition). Set subroutines? to -1 (or any other negative integer) to disable the feature.

17.4.2 C50 Subroutine (sub-C50) target

This target is used to generate subroutines that can be called from hand-written C50 code. The options are identical to those of default-C50 target.

17.4.3 C50 DSP Starter Kit (DSKC50) target

This target is used to generate C50 code to be run on Texas Instruments' DSP Starter Kit board. In addition to the regular file.asm generated by the other targets, this target will produce a second file (fileDSK.asm) which is the same as the original file but with all lines truncated to 80 characters. This is done because the TI DSK assembler will give false error messages if lines in the input file exceed 80 characters. The options are identical to those of default-C50 target with four exceptions:

compile? If this flag is set the target will issue the command asmc50 fileDSK.asm where fileDSK.asm is the name of the file containing the generated code. This should run the DSK assembler and produce a file fileDSK.dsk. Note that asmc50 can be a shell script that invokes the user's DSK assembler. Scripts to use the TI DSK assembler and loader in Linux are presented at the end of this section.
run? If this flag is set the target will issue the command loadc50 fileDSK.dsk which should load fileDSK.dsk to the DSK board. Note that loadc50 can be a shell script that invokes the user's DSK loader.
bMemMap (STRING) Default = 768-1270
Valid addresses on the Dual Access RAM block 1. The last 9 words in this (addresses 1271 - 1279) are reserved by the target to store configuration information for the Analog Interface Chip.
uMemMap (STRING) Default = 2432-6847
Valid addresses on the Single Access RAM memory. Locations 6848 - 11263 are reserved to store the user's program and locations 2048-2431 are reserved by the TI DSK debugger kernel.
The following scripts invoke the TI DSK assembler and loader from Linux through dosemu (a DOS emulator). Note that before invoking the assembler and loader Ptolemy executes a cd to the directory target parameter. Since you need to unmount the DOS partition to run dosemu you can not have directory set to the DOS partition. One solution is to set directory to your home directory and set file to include the path to the directory where you want the file written. For example, if your home directory is /ptuser, the dos partition dosemu will use is /dos/c and you want the output files written to /dos/c/dsk/src the you could set directory to /users/ptdesign and file to /dos/c/dsk/filename where filename is the name of the output file. These scripts are also included in $PTOLEMY/src/domains/c50.

#!/bin/sh
# Version: @(#)asmc50	1.6	04/07/97
# Copyright (c) 1996-1997 The Regents of the University of California.
# All Rights Reserved.
#
# asmc50
# script to assemble files with TI's DSK assembler(dsk5a.exe)
# Uses dosemu to run dsk5a.exe.  The person running it must be root to
# mount/unmount the dos partition.
# This script was tested on a machine running linux (red-hat 3.0.3 
# distribution) with dosemu-0.63.1.33 installed.
#
# Written by Luis Gutierrez.
# Converted from csh to sh by Brian L. Evans

# User's home directory.
homedir=/root

# User's dos partition.
dospartition=/dos/c

# The root path of DOS drive where DSK files and DOS binaries are stored.
dosroot=c:

# The DOS directory(relative to dosroot)where the *.asm and *.dsk files 
# are stored. Replace the \ in the DOS path with \\.
dsksrc=dsk\\src

# The DOS directory(relative to dosroot) where the DSK 
# executables(dsk5a.exe, dsk5l.exe) are stored.  
# Replace the \ in the DOS path with \\.
dskbin=dsk

# The file used to temporarily save autoexec.emu.
autoexecsave=autoexec.bak

cd $dospartition
mv autoexec.emu $autoexecsave

# The text between the first xxxx and the second xxxx will be
# piped to unix2dos and will end up in autoexec.emu.

unix2dos > $dospartition/autoexec.emu << xxxx
path $dosroot\\$dskbin;$dosroot\\dos
cd $dosroot\\$dsksrc
dsk5a.exe $1:t
exitemu
xxxx
cd $homedir

# Unmount DOS partition to run dosemu
umount $dospartition
dos > /dev/null

# Mount DOS partition after running dosemu
mount -t msdos /dev/sda1 $dospartition

# Restore autoexec.emu
cd $dospartition
mv -f $dospartition/$autoexecsave  $dospartition/autoexec.emu

The following script is used to load files.

#!/bin/csh
# Version: @(#)loadc50	1.5 03/29/97
# Copyright (c) 1996-1997 The Regents of the University of California.
# All Rights Reserved.
#
# loadc50
# script to load files with TI's DSK loader(dsk5l.exe)
# Uses xdos to run dsk5l.exe.  The person running it must be root to
# mount/unmount the dos partition.
# This script was tested on a machine running linux(red-hat 3.0.3 
# diistribution) with dosemu-0.63.1.33 installed.
# Written by Luis Gutierrez.
#
# Converted from csh to sh by Brian L. Evans

# User's home directory.
homedir=/root

# User's dos partition.
dospartition=/dos/c

# The root path of DOS drive where DSK files and DOS binaries are stored.
dosroot=c:

# The DOS directory(relative to dosroot\)where the *.asm and *.dsk files 
# are stored. Replace the \ in the DOS path with \\.
dsksrc=dsk\\src

# The DOS directory(relative to dosroot) where the DSK 
# executables(dsk5a.exe, dsk5l.exe) are stored.  
# Replace the \ in the DOS path with \\.
dskbin=dsk

# The file used to temporarily save autoexec.emu
autoexecsave=autoexec.bak

cd $dospartition
mv autoexec.emu $autoexecsave

# The text between the first xxxx and the second xxxx will be
# piped to unix2dos and will end up in autoexec.emu.

unix2dos  > $dospartition/autoexec.emu << xxxx
path $dosroot\\$dskbin;$dosroot\\dos
cd $dosroot\\$dsksrc
dsk5l.exe  $1:t
exitemu
xxxx
cd $homedir

# Unmount DOS partition to run xdos
umount $dospartition
xdos

# After running xdos mount DOS partition
mount -t msdos /dev/sda1 $dospartition

# Restore autoexec.emu
cd $dospartition
mv -f $dospartition/$autoexecsave  $dospartition/autoexec.emu



Top Up Prev Next Bottom Contents Index Search

Copyright © 1990-1997, University of California. All rights reserved.