next up previous contents index
Next: Interface with the Foresys Up: TSF: A Tool Set Previous: Installation and upgrade

A simple tour in TSF

This section describes the steps of a simple use of FORESYS/TSF. We do not focus on the use of FORESYS but on that of TSF. The graphical interface is briefly described but more informations are given in section 5.2. The goal of this exemple is to normalize a Fortran loop.

  $\blacktriangleright$ Step 1 - Starting Foresys
 

Before starting Foresys, we must create a Forlib that contains all the Fortran files used in your project. The simplest method is to execute a forlib_create command in the directory that contains your fortran codes:

forlib_create -name "ProjectName" *.f

A graphical interface is also provided in Foresys for this task (see the menu Files). Then we can execute the foresys command. We should obtain a window similar to the one given in figure 2.


  
Figure 2: The main window of Foresys
\begin{figure}
\begin{center}
\includegraphics[width=14cm]{tour/foresys.eps}\end{center}\end{figure}

  $\blacktriangleright$ Step 2 - The fortran window
Each fortran unit (i.e program, subroutine, function, module, ...) is associated to a window displaying the source code. The TSF window is created by using the Connect entry in the TSF menu. The FFTPDE window (see the Figure 3) is obtained by selecting this unit name in the main Foresys window. The TSF menu appears only if your version of Foresys supports TSF. In the contrary case see section 3. It is possible to open only one TSF window per Foresys session. By default all TSF actions are applied to the window where the menu was used for the last time.


  
Figure 3: A Foresys fortran window with the TSF/Connect menu
\begin{figure}
\begin{center}
\includegraphics[width=14cm]{tour/fortran1.eps}\end{center}\end{figure}

  $\blacktriangleright$ Step 3 - The TSF window

An exemple of TSF window is given in the Figure 4. More detailled informations are given in section 5.2. The 'Loop Normalization' transformation is selected.


  
Figure 4: The main window of TSF
\begin{figure}
\begin{center}
\includegraphics[width=8cm]{tour/tsf.eps}\end{center}\end{figure}

  $\blacktriangleright$ Step 4 - The main actions

The normalization transformation must be applied to a specific loop so the first step is to define the target. The simplest and most used method is to select a statement by hand in the fortran window. Another way is to use the pattern (see section 11) provided for the normalization ; the Search button in the TSF window allows to select one by one the loops in the fortran window (see the selection in the left window of the figure 5). More complex patterns can be used. For instance to ignore the loops with a step equal to 1. The right part of the figure 5 shows the resulting code after that the Apply button is pressed. The changes can be cancelled by the Undo button and then restored by Redo button.


  
Figure 5: The Fortran window before and after the normalization
\begin{figure}
\begin{center}
\includegraphics[width=8cm]{tour/select1.epsi} \includegraphics[width=8cm]{tour/result1.epsi}\end{center}\end{figure}


next up previous contents index
Next: Interface with the Foresys Up: TSF: A Tool Set Previous: Installation and upgrade
Yann Mevel
1999-04-30