# EE382C Embedded Software Systems - Homework #2 Hints

• Kahn Process Networks: Here is a description of the operation of a process network using a directed graph notation:
• Nodes are concurrently running
• Arcs represent FIFO queues, and queues can be of infinite length
• When a node reads an input port, the read will block until enough tokens are available on that input port
• Problem 2.2: State is the collection of tokens on the arcs. This problem asserts that every Kahn Process Network has a finite number of states. That is, at every point in the execution of a Kahn Process Network, the state is finite. You will either have to prove the statement to be true for all possible Kahn Process Networks, or find a counterexample.
• Problem 2.3: You will either have to prove that each statement is true for all possible SDF graphs, or provide a counterexample.
• Problem 2.4: A tree-structured SDF graph is acyclic. A binary tree-structured SDF has the following form:
```          ---> D
---> B
/       ---> E
/
A                  etc.
\
\       ---> F
---> C
---> G
```
You will either have to prove the statement for all tree-structured SDF graphs or find a counterexample.
• Problem 2.7(a): A graph is static if the topology of the graph (arrangement of nodes and arcs) is fixed. That is, nodes and arcs are neither being added nor deleted.
• For Ptolemy Classic to run, be sure to copy over the login files in my LRC ECE account: ~bevans/.cshrc, ~bevans/.mycshrc, and ~bevans/.mylogin. Please remove your ~/.login file. If you don't use my login scripts, then you will have to set several environment variables as explained in the README file.
• Ptolemy 0.7.1 runs fine on sunfire1 and sunfire2. When running Ptolemy, you will be prompted about two warnings. Please answer yes to both.
• If you would like to work remotely, then be sure to run a standards-compliant X windows emulator, e.g. Exceed or Xwin32. I run Ptolemy remotely using Xwin32 frequently, and I have seen Ptolemy work properly under Exceed.
• Ptolemy Classic User's Manual is searchable.
• Ptolemy 0.7.1 under Linux RedHat 6.0 is available at ftp://ftp.tu-ilmenau.de/pub/unix/ptolemy/ptolemy0.7.1.linux/. Note the you may have to downgrade Rpm-3.x to rpm-2.5.6-6.0 for the Ptolemy installation to be successful.
• Remember to kill both the `vem` and `pigiRpc` processes if Ptolemy hangs. You can find a process identification number on Solaris by executing
```ps -auxwww | grep pigi
```
The process identification number is in the second column. Then, use
```kill -9 processId
```
• Ptolemy should be able to show static schedules for graphs (all graphs in the finite state machine, Synchronous Dataflow, and Synchronous/Reactive domains, and some Boolean Dataflow graphs). You will need to leave the run-control panel up and then display the schedule. Closing the run-control panel will delete the schedule.

The schedule will list the firing for each star by a unique name. The unique name is the concatenation of the names of the parent subsystems, the name of the star not including its domain, the parameters used to create the icon, and the instance number of the star in its subsystem. For example,

```sinMod.modulator1.Mpy.input=21
```
is the first instance of the multiply star `Mpy` with two inputs (`input=2`) in the `modulator1` subsystem in the `sinMod` system. The domain is not given in the name. This is to allow retargetting of one subsystem to another domain by simply changing the domain. The domain is given earlier in the schedule.

Updated 03/08/04.