EE382C Embedded Software Systems - Hints for Homework #3
For the programming parts of the homework assignments, please e-mail
the source code and a makefile (if there are multiple source code files)
to the grader.
- Xgraph block:
The Xgraph block in Ptolemy will call the
program to plot the data.
pxgraph program in Ptolemy 0.7.1 is a shell
script that by default calls a Java program written in version
1.0 of the Java Developer's Kit (JDK).
To use JDK 1.0, please set the following in your login scripts:
# C shell
setenv JAVA /usr/local/packages/java1.1
setenv JAVA_LIB $JAVA/lib/sparc
setenv JAVAHOME $JAVA
# Korn shell
export JAVA JAVA_LIB JAVAHOME
If the Xgraph block still gives an error, then revert back
to the binary program for
Ptolemy Classic 0.7:
mkdir -p ~/bin/sol2.5
cp /usr/local/packages/ptolemy0.7/bin.sol2.5/pxgraph ~/bin/sol2.5
The last line should return a path equal to
Otherwise, you will need to add $HOME/bin/sol2.5 to your
path before the Ptolemy directories.
- Problem 3.1:
The Motorola 56000 tools seem to have been removed from
/usr/local/packages on the LRC Solaris machines.
Please add the following line to your .cshrc file:
set path=(/home/ecelrc/faculty/bevans/Motorola/clas56/bin $path)
The demonstration to run is under CG56 ... Simulator ... DTMFCodec.
You can enlarge the icons by resizing the window and hitting
the keyboard shortcut 'f' for full size.
(a) The program and data memory usage should be reported by default.
Recall that the Motorola 56000 has a modified Harvard architecture
with two data memory banks (x and y) and a program memory bank (p).
(c) Please use the maximum clock speed for the Motorola 56300,
which you can find on the Berkeley Design Technology Inc.'s
Pocket Guide to
Processors for DSP.
(d) You will need to look at the schedule to determine how many
telephone touchtone dual-tone multiple-frequency (DTMF) samples
are generated for four iterations.
A DTMF signal is typically sampled at a rate of 8000 samples/s
at a telephone central office.
- Problem 3.2:
The CGC Butterfly demo uses the native C compiler (invoked by cc)
by default, which is not installed on the LRC Solaris machines.
To change the choice of compiler, please hit the keyboard shortcut
'T' for edit-target.
Change the compileCommand from "cc" to "gcc" so that the GNU
C compiler will be invoked.
You can measure the runtime of the SDF Butterfly demo, choose
the appropriate option in the run-control panel.
It is called something like "time the run".
- Problem 3.3:
To determine the production and consumption of tokens on the
arcs, you'll need to look at the parameter settings (via edit
parameters or 'e' key) for the nodes for each input/output port.
- Problem 3.4:
At least one student has been able to get the dynamic linking
to work from Ptolemy Classic by using the make-star command.
The make-star command will try to create a shared object from
the object file.
The student found that
adding -fPIC to the compilation step allows the
"g++ -shared" cmd executed by ptolemy to work.
The other route is to perform most of the work at the command
line and then use the make-star command in Ptolemy Classic.
For the manual step, the GNU C++ compiler will be used:
sunfire2.ece 28# g++ --version
sunfire2.ece 29# which g++
The GNU C++ 2.95.2 compiler is not allowing an implicit data
type on method declarations to default to int.
Since I could not find the right option for the GNU C++ 2.95.2 compiler
to allow this default, I've modified three of the core Ptolemy
include files to explicitly declare the return type to be an int.
Here's the modified command to compile SDFMyFIR.cc:
g++ -shared -fPIC -c -I/home/ecelrc/faculty/bevans/Ptolemy/src/kernel -I$PTOLEMY/src/domains/sdf/kernel SDFMyFIR.cc