tcfggen user manual
|Title||tcfggen (Task control flow graph extraction MachSUIF pass)|
|Author||Nikolaos Kavvadias 2003, 2004, 2005, 2006, 2007, 2008, 2009, 2010, 2011, 2012, 2013, 2014, 2015, 2016|
|Release Date||14 October 2014|
Updated header comments in all source files. Added File Listing section in README; added AUTHORS. Updated for Github.
Changed documentation format to RestructuredText. Added ChangeLog in separate file.
Fixed problem with parsing input arguments. All options: "-lut","-vcg","-fsm","-cac" should work now.
Initial release. Code clean-up, added code generation options.
tcfggen is an analysis pass built to be used with the SUIF2/MachSUIF2
tcfggen performs (natural) loop analysis in order
tomap the control flow of a given optimization unit (i.e. a procedure in the
input program) to its task control flow graph (TCFG). It is also used to pass
the static information for the loops in the given procedure to the subsequent
stage(s) in the form of pseudo-instructions. These pseudo-instructions pass
- the task transitions
- the points for task entry and task exit
- the loop parameters (loop bounds and stride) and the basic induction register
- which instructions should be removed for ZOLC execution
This pass works for the SUIFrm instruction set and has been tested with MachSUIF 2.02.07.15.
2. File listing
tcfggen distribution includes the following files:
|LICENSE||The modified BSD license governs
|README.html||HTML version of README.|
|README.pdf||PDF version of README.|
|VERSION||Current version of the project sources.|
|lcugen.cpp||Originally part of the loop count unit generator tool
|lcugen.h||C++ header file containing declarations and prototypes for the above.|
|rst2docs.sh||Bash script for generating the HTML and PDF versions of the documentation (README).|
|tcfggen.cpp||Implementation of the
|tcfggen.h||C++ header file containing declarations and prototypes for the above.|
|suif_main.cpp||Entry point for building the standalone program
|suif_pass.cpp||Define the SUIF pass built as the dynamically
|suif_main.h||C++ header file for the above.|
3. Technical information
This pass uses the
cfa libraries of MachSUIF. It
also depends on the
suifrm backend. It first generates the natural
loopanalysis report for the procedure. If formatted for text output, this
information would be as follows:
Loop info: node depth begin end exit int: int Y/N Y/N Y/N ...................................
|-node||the number of the corresponding basic block (integer)|
|-depth||the loop nesting depth (integer)|
|-begin||a boolean flag to report if a loop begins at the specified node|
|-end||a boolean flag to report if a loop ends at the specified node|
|-exit||a boolean flag to report if an exit from the loop is possible from that node.|
Based on the loop analysis results, four different types of pseudo-instructions are generated. Their assembly formats are shown below:
ldst <current-taskid>, <next-taskid>, <next-ttsel>, <next-loop_a> dpti <id>, <first-bb>, <last-bb> loop <loop_a>, <rindex>, <initial>, <step>, <final> overhead <state>
An LDST instruction incorporates all the information needed for creating a task
selection LUT entry: for a given task encoding (
succeeding task (
next-taskid), its type (
next-ttsel) and loop address
next-loop_a) are given. These pseudos are attached to the last assembly
instruction in the task.
DPTI instructions denote the first (
first-bb) and last basic block
last-bb) of a task (its enumeration given by
id). This pseudo is
attached to the first instruction of this data-processing task.
A LOOP provides a given loop address (
loop_a), the actual loop index
rindex) and the loop parameters (
final). This pseudo is attached to the last instruction in the basic block
(typically a BLT = branch if less than).
An OVERHEAD marks its following non-pseudo instruction whether it must be kept
state=0 which is the default), replaced by a no-operation (
or entirely removed (
state=2). These pseudos are attached to the specific
tcfggen archive wherever you like, e.g. in
You don't need to modify anything in the Makefile, if you have a working
MachSUIF 2 installation.
The program binary (
do_tcfggen) will be installed at $NCIHOME/bin and the
shared library (
$NCIHOME/solib, where NCIHOME is the
SUIF 2 top-level directory.
5. Usage details
The pass accepts an input file in CFG form to operate. The output file is a SUIF CFG containing the input CFG with the generated pseudo-instructions.
$ do_tcfggen [options] input.cfg output.cfg
where options can be one (or more) of the following:
- -proc <opt-unit>
- specify the name of the procedure to perform TCFG construction and generation of pseudo-instructions
- generate the VHDL source for the task selection LUT
- visualize the TCFG in VCG format
- generate the VHDL source for an FSM implementation of the task selection unit
- generate C simulation code for the initialization of the task selection unit.
6. Known limitations
- MachSUIF (2.02.07.15) only includes natural loop analysis.
- Currently, there is support for static loops only.
- An 'optimization unit' can only be a single function or procedure.