Canonical and Logical File Names

VOV clients and server exchange dependency information by using file names; each file needs a single name that is valid on both the client and the server.

It may seems that each file, could use its full path as its unique name. However, a file may and will have more than one name for the following reasons:
  • Links, both hard and symbolic, allows multiple full paths for the same file.
  • For any file, it is possible to generate an infinite number of full paths by using the "dot" and "dot-dot" notation (for example, /usr/bin/ls can also be written as /usr/../usr/bin/./ls).
  • The same file may have different full paths on different hosts due to how the file systems are network mounted.

Canonical Names

VOV defines the canonical name of a file to be the full path obtained by removing all symbolic links and all "dots".

In this example, a file system contains the following link:
/users/john/projects --> /sandbox/projects
With the relative path ~/projects/vhdl/vtech/../syn/vtech.v, with respect to the user john, the following transformations would apply:
The non-canonical path ~/projects/vhdl/vtech/../syn/vtech.v
after tilde expansion becomes /users/john/projects/vhdl/vtech/../syn/vtech.v
after removing the symbolic link becomes /sandbox/projects/vhdl/vtech/../syn/vtech.v
by removing the double dot becomes canonical /sandbox/projects/vhdl/syn/vtech.v

Logical Names

A canonical name is then turned into a logical name. A logical name is one in which the file name begins with the value of a variable.

For example, the name ${HOME}/foo.c is logical, while /users/home/john/foo.c is not.

The use of logical names is critical because the value of the variable used in the name is allowed to be different on different hosts. This is to account for the different ways the file systems are mounted across the network.

For example, the variable ${HOME} may point to /users/home/john on a UNIX machine and to h:/john on a Windows NT machine.

All filenames in VOV are logical and canonical names. The logical names are formed according to the rules defined in the equiv.tcl file.

There are two further advantages in using logical canonical names:
  • The average length of names is reduced, which reduces the storage requirements for the trace.
  • The trace can be easily moved from one file system to another.