The build script is derived from building ghdl_mcode on OS X and uses an svn 
download to obtain
ghdl from the gna.org repository.

It expects a gnat and gcc in the search path that can generate a 32 bit 
executable without modifying Makefiles.  The mcode version of ghdl is a 
compiled program that performs direct compile (translating IR representation to 
macros of i386 instructions) just in time (the elaboration phase is collapsed 
into the run (-r) command).

The script will download (checkout ro) a specific svn revision of ghdl from 
gna.org (-r150) into a subdirectory ghdl in the directory it is invoked.

You could note that it builds ghdl in place, where the svn download is invoked 
by executing the script.  By default it removes everything superfluous to ghdl 
mcode mode unless the command line option --keep-build is given.

Installation consists of linking the man page and the executable (as ghdl) into 
/usr/local (man/man1 and bin).  The installation portion of this script is 
currently commented out.  The actual executable is  
ghdl/translate/ghdldrv/ghdl_mcode and it's linked as 'ghdl'.  The directory 
tree structure of the build/install directory is necessary for ghdl (mcode 
version) to find the VHDL libraries.

The place to invoke any patches would be right after the svn operation.

A binary distribution can be created by archiving the build/install directory 
after it's built and stripped (no --keep-build CLI option).

Installation consists of unarchiving  the build/install tree in the 
corresponding place.  (Absolute paths are compiled in).  After which the 
executable is linked (ln -s /opt/ghdl/translated/ghdldrv/ghdl_mcode 
/usr/local/bin/ghdl).  The same is done for the man page at the top of the 
build/install tree (e.g. ln -s /opt/ghd/docl/ghdl.1 /usr/local/man/man1/ghdl.1).

The script expects svn gnat and gcc in your search path as well as other 
executables, (see the script itself) and isn't particularly bullet proof or 
robust.  Any error upsetting where the script thinks it is could have 
catastrophic consequences.
I simply checked to see if it would build and clean out the build/install tree 
under lubuntu 12.04 with gcc-4.6 (gnat) and gcc-4.7 (gcc).

Creating a ghdl_mcode.tar.bz2 file with absolute paths to /opt/ghdl took 
2,080,568 bytes.  I can send that or make it available to anyone who is 
interested in having a binary copy built there (note the script).  The tail end 
of the script has commented out commands for creating links for the executable 
and man page in /usr/local and these are relocatable  as long as they show up 
in your search path/man path.  

There are no requirements on having a particular version of gcc available to 
use the mcode version.  
Note that in the /opt/ghdl/doc/ghdl.html file when directing attention to the 
windows version, generally that can be read to mean 'windows version or other 
ghdl mcode version'.

The mcode version of ghdl doesn't produce object code files nor does it support 
foreign object code import.  The -e (elaborate) command isn't necessary in an 
mcode version, but doesn't cause any harm.  Elaboration actually occurs during 
the -r (run) command, jit.  In general pre-existing Makefiles are likely usable 
with the mcode version, simply requiring re-analysis before running (and it's 
quick).

https://dl.dropboxusercontent.com/u/25980826/ghdl_mcode_linux.zip  
(the binary, 2,092,435 bytes, GPL license, binary to install in /opt/ghdl, 
build_distribution script, and README)

There were no source code no modifications  required to generate this ghdl 
mcode version.

Version and warranty information can be found by running ghdl --version (there 
is no warranty whatsoever, nor is there a customer/vendor relationship implied 
herein).

The binary distribution was built using the build_distribution script.  It was 
tested using a VHDL implementation of the Digital Encryption Standard.  No 
regression testing has been performed.

Try it, it's fast, small and swallows big designs that cause the gcc version of 
ghdl to grind slowly or runout of memory.  It does this because it performs to 
optimization on the jit image in memory.





_______________________________________________
Ghdl-discuss mailing list
Ghdl-discuss@gna.org
https://mail.gna.org/listinfo/ghdl-discuss

Reply via email to