v2cc (5) Linux Manual Page
v2cc.libs – VHDL library mapping file for the FreeHDL compiler/simulator.
Description
FreeHDL is a compiler/simulator suite for the hardware description language VHDL. VHDL’93 as well as VHDL’87 standards are supported. FreeHDL translates the original VHDL source FILEs into C++. Then, the C++ source can be compiled and linked to the kernel to build the simulation program. Starting the generated executable will simulate the corresponding VHDL model. The actual build process to generate the simulator from the VHDL source is a complex process which is handled by the gvhdl script. FreeHDL does not have a opaque notion of design libraries. VHDL files are not pre-analyzed and checked into some library data base as in other VHDL compiler/simulator systems. Instead, whenever a reference to a design unit needs to be made, FreeHDL parses the VHDL code of that design unit from fresh. Therefore, it needs to be able to find the source file of a design unit given the VHDL name of that unit. Thus, as far as FreeHDL is concerned, a design library is a mapping from VHDL identifiers to file names. There is also a mapping for getting library names from mapping files. Such a mapping is specified via a "mapping file". It contains a list of pattern rules that each transform a certain class of identifiers into file names. The syntax of a mapping file is:
’
’
version: "v2cc_mapfile" "0"
for each component of the library path, L
if L is a regular file
set LMAP to L
else if L is a directory
set LMAP to L/v2cc.libs
else
continue with next component
translate LIB into FLIB using LMAP with EXT=""
if FLIB.vhdl exists
terminate with FLIB.vhdl as the result
if FLIB.v2cc exists
set UMAP to FLIB.v2cc
else if FLIB is a directory
set UMAP to FLIB/v2cc.units
else
continue with next component
translate UNIT into FUNIT using UMAP with EXT=".vhdl"
terminate with FUNIT as the result
terminate unsuccessfully
This mechanism is used for all design units that are referenced from within VHDL code (or via other means). There is a complication with architectures and package bodies, though, because they are not uniquely identified by a single identifier. For them, a artificial identifier is constructed. Architectures get names of the form
Examples
The simplest situation is when you have no mapping files at all. A design library is then a directory on your library path. The name of that directory is that of the library in VHDL. Each file in that directory with a ".vhdl" extension is used for a design unit with the same name as the file without the extension.
Say you have this directory structure
std/
ieee/
When you put "somedir" into your library path, you have access to the design units
In this situation, you have one file per design unit. When you have one file per design library, it would look like this
fmf.vhdl
All references to design units in the FMF design library would be routed to "fmf.vhdl".
As another example assume that all VHDL libraries are mapped into subdirs starting from root directory "/foo". Further, assume that there are VHDL libraries named "lib1" and "lib2". They shall be mapped to subdir "/foo/lib1_dir" and "/foo/lib2_dir". Hence, the file/directory structure is as follows:
/foo
/foo/v2cc.libs
/foo/lib1_dir
/foo/lib1_dir/comp1.vhdl <- file that contains VHDL model comp1 /foo/lib2_dir
/foo/lib2_dir/comp2.vhdl <- file that contains VHDL model comp2
Then, file "/foo/v2cc.libs" should contain:
v2cc_mapfile 0 lib1 : lib1_dir lib2 : lib2_dir
In order to compile a design named comp1 (stored in file comp1.vhdl) into VHDL library lib1 goto subdir "/foo/lib1_dir" and execute:
Note that option "-l lib1" forces the compiler to associate the model stored in "comp1.vhdl" with VHDL library lib1. Note further, that the compiler switch "-L .." specifies the path to the directory where "v2cc.libs" is stored. You may also specify an absolute path:
Note that comp1 should reside in a file named "comp1.vhdl".
If lib2 contains a design comp2 that makes use of comp1 from lib1 then goto "/foo/lib2_dir" and run the following command to create an executable for model comp2:
See Also
gvhdl(1), freehdl-v2cc(1), freehdl-config(1)
Availability
The latest version of FreeHDL can always be obtained from www.freehdl.seul.org
Reporting Bugs
Known bugs are documented within the BUGS file. If your report addresses a parser related topic then contact Marius Vollmer <mvo [at] zagadka.ping.de>. If it is related to the code generator or compiler then send an email to Edwin Naroska <edwin [at] ds.e-technik.uni-dortmund.de>. If your are not sure send it to Edwin. He will take care of forwarding your report to the appropriate recipient.
Copyright
Edwin Naroska © 1999, 2000, 2001, 2002, 2003, 2004, 2005 <edwin [at] ds.e-technik.uni-dortmund.de>
This is free software; see the source for copying conditions. There is NO warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
Authors
Written by Marius Vollmer <mvo [at] zagadka.ping.de> and Edwin Naroska <edwin [at] ds.e-technik.uni-dortmund.de>.
