FPT and WinFPT Reference Manual - Command-line Commands

| SimCon Home | Reference Manual Home |





When a program is run, the same variable may be assigned multiple times. Sometimes these assignments are different variants of the same quantity. Sometimes the same variable may be used for two or more different quantities. We refer to the different quantities as different lives. A data flow analysis is carried out, and the rule applied is that two assignments or initialisations represent different lives if the two assignments can never reach the same right-hand-side use. They represent the same life if both can reach one or more right-hand-side uses. The output os a program would not change if all of the different lives of each variable were given different names. The command SEPARATE LIVES causes the different lives to be renamed. New declarations are added for the new names.

When a variable has two or more lives, the names of the lives are constructed from the original names with the suffix "_lf1", "_lf2" etc. except that the suffic may be further modified if a name clash would occur with an existing name. Variables with only a single life are not renamed.

In the current implementation of this command, arrays and structured types (Derived types and records of structures) are treated as having single lives.

This command is used to prepare code for execution on machines with novel architectures. Please see "APPRASE: Automatic parallelisation of Fortran to run on an FPGA" Farrimond B.T., Collins J. and Sharma A. 2008, Paper presented at The Summer Conference of the Society for Computer Simulation, Edinburgh, Scotland, June 2008. The command is used in combination with the commands:

Where to use this command:

Operating system command line


Configuration file, config.fsp


Specification (FSP) files, *.fsp


Interactively, to FPT> prompt:


Interactive command files


Embedded in the Fortran code



This change is not made by default (Note that defaults may be modified in the configuration file).


The code shown below has two independent uses of the variable x.

SUBROUTINE find_scale(ilun,maxx) REAL*4 maxx, max_1, max_2, x max_1 = 0 max_2 = 0 DO READ(1,*,END=100) x max_1 = MAX(max_1,x) ENDDO 100 CONTINUE DO READ(1,*,END=200) x max_2 = MAX(max_2,x) ENDDO 200 CONTINUE IF (max_1 > max2) then maxx=max_1 ilun=1 ELSE maxx=max_2 ilun=2 ENDIF RETURN END

The code is modified by the command:

% separate lives

The code is converted to:

SUBROUTINE find_scale(ilun,maxx) ! REAL*4 maxx,max_1,max_2,x_lf1 REAL*4 x_lf2 ! max_1=0 max_2=0 DO READ (1,*,END =100)x_lf1 max_1=MAX(max_1,x_lf1) ENDDO 100 CONTINUE DO READ (1,*,END =200)x_lf2 max_2=MAX(max_2,x_lf2) ENDDO 200 CONTINUE ! IF (max_1>max2) THEN maxx=max_1 ilun=1 ELSE maxx=max_2 ilun=2 ENDIF RETURN ! END

Copyright ©1995 to 2014 Software Validation Ltd. All rights reserved.