.\" @(#)demoCase1	1.1	12/10/92
.NA demoCase1
.SD
Demonstration of the quasi-static scheduler for a graph with a "case" construct.
.DE
.SV 1.1 2/6/92
.AL "S. Ha"
.LO "~ptolemy/src/domains/cg-ddf/demo"
.LD
.Ir "case construct"
.Ir "quasi-static scheduler"
This demo displays a schedule result applying a quasi-static
scheduling technique to a program graph with a \fIcase\fR construct.
Since there are two inputs to the 
.c Case
star, this \fIcase\fR construct is nothing but an \fIif-then-else\fR
construct. By setting the target parameter of the CG-DDF domain inside
the CGWormhole (green block at the top level), we indicate that 
it is a \fIcase\fR construct (
.c constructType
= case ) with the probability 0.5 to select the
"TRUE" branch (
.c paramType
= geometric, and
.c paramGeo
= 0.5 ). Since the
.c fixedNum
state is 0, we let the scheduler decide the number of processors to
assign to the case construct.
.pp
The CG-DDF galaxy contains two wormholes which contain
CG domains inside to represent the "TRUE" and the "FALSE"
branches. The outside CG domain and these inner CG domains share
the same child targets by setting
.c inheritProcessors
target parameter "YES" in the inner targets. The quasi-static scheduling
idea is that we fix the assignment and the execution order of stars in
the CG targets at the compile time.  At the top level, the "case"
construct is regarded as an atomic block. The blocks inside the
"TRUE" and the "FALSE" branches are also scheduled (assigned and ordered)
at compile-time. At run time, based on the control value to the
.c Case
star, we either
execute the TRUE branch or the FALSE branch.
.pp
The core of the scheduling technique is to determine the assumed
execution profile of the "if-then-else" construct at compile-time,
based on the probability of the "TRUE" branch being taken,
In the displayed Gantt chart we can find out what is the
.Ir "profile, CG-DDF"
estimated profile of the construct. The construct is assigned to three
processors among four processors. Schedules of the "TRUE" and "FALSE"
branches are not displayed. 
Note that we pipeline the program graph by inserting delays on a cutset
manually to increase the possibility of parallelism.
In this release we do not make code generation working yet.
.ES

