Decisions in Flows with IFJOB
Another way to add conditionals into the flows consists of adding the decision code directly into the FDL. This can be done with the procedure IFJOB, as illustrated by the following example.
# Do some design activity...
N "standinDesignActivity"
J vw cp aa bb
# Now add the decision node.
IFJOB -label checkTiming {
puts "Hello: we are inside checkTiming"
set timingOk [expr [file size bb] & 1]
puts "TimingOk = $timingOk Size = [file size bb]"
set sId [S "Result:decision:checkTiming" {
if { $timingOk } {
N "TIMING_OK"
J vw cp bb cc
J vw cp cc dd
J vw cp dd ee
J vw cp ee final
} else {
N "FIX_TIMING"
J vw cp bb cc1
J vw cp bb cc2
J vw cp bb cc3
J vw cp bb cc4
J vw cat cc1 cc2 cc3 cc4 > final
}
}]
AD $env(VOV_JOBID) $sId
# after 5000; START $sId
}
This flow initially creates two jobs, the cp aa bb
and another job
called vovdecision, which depends on the first job based on the
sequence of the code (or we could have used the option -jobid ID in
IFJOB to specify a dependency with another job). The code
fragment provided as last argument to IFJOB is attached to the
decision node as an annotation.
When the decision node is executed, it executes the code fragment. In this case, the code consists of a measurement (pretend that the size of the file bb is an expression of the timing of a circuit), and then decides: if the timing is ok, it creates a flow, otherwise it creates a different flow.
The utility vovdecision is essentially an invocation of vovbuild with a small flow file that can be embedded right into the top-level flow.
% vovbuild -T -f anotherDecisionFlow.tcl