Integration by Encapsulation
- Write an encapsulation script based on the Encapsulation Procedures
- Invoke the tool with the FlowTracer Wrappers vw or with vw2.
yacc
as
in:% yacc -d -t cc.y
% vw yacc -d -t cc.y
yacc
is called vov_yacc.tcl and looks like
this:set FILEPREFIX "y"
while { [arglength] > 1 } {
set arg [shift]
switch -- $arg {
"-d" { VovOutput "$FILEPREFIX.tab.h" }
"-t" {}
"-b" { set FILEPREFIX [shift] }
default {
VovFatalError "Unknown option $arg"
}
}
}
VovInput [shift]
VovOutput "$FILEPREFIX.tab.c"
For compatibility with Windows NT, in calculating the "name of a tool" we drop the suffixes .bat.exe and .cmd. Therefore, if the tool is called mytool.exe, its capsule is called vov_mytool.tcl.
- In the property "CAPSULE" attached to the job (see Capsule On-the-Fly)
- In the current working directory
- In the directories indicated by the environment variable VOV_CAPSULE_DIR, if it exists; the directory names are separated by a colon on UNIX and by a semicolon on Windows NT
- In the directory $VOVDIR/local/capsules
- In the directory $VOVDIR/tcl/vtcl/capsules
This search order for the capsules facilitates the development of new capsules and the management of a set of site specific capsules.
Simple Capsules
simulator INPUT_FILE OUTPUT_FILE
# This is vov_simulator.tcl
VovInput [shift]
VovOutput [shift]
This is a good starting point. You can build interesting flows using the tool simulator and the simple capsule shown above. As you become more familiar with FlowTracer, you will learn how to increase the accuracy of the encapsulation, by looking at real capsules for real tools.
Capsule Template
When you need a new capsule, start from the standard template, which can be found in $VOVDIR/tcl/vtcl/capsules/vov_capsule_template.tcl
The template illustrates all the procedures that may be useful to write capsules.