Mini-table of contents:
- Compilation and installation
- Instructions how to use the sc2vhdl program
- List of command line options for sc2vhdl
Compilation and installation
The program was developed and tested on OS Linux,
specifically Fedora 10 x86-64 and
Eee PC 1.0.1 (Xandros / Debian 4.0, x86).
Instruction how to get going:
- Check the dependencies - see section [Dependencies].
- Prepare a patched GCC - see section [Preparing the patched GCC].
- Compile the programs. It shall be sufficient to run the command
in the top-level directory of the source package.
- Run the automatised tests. Change to directory
and run the script
run.sh. Then run in the same way the script in
You need the following C++ libraries have installed to compile the SCVHDL:
- expat - XML parser library (SAX parser);
- boost - C++ tools library
Furthemore you need the following programs/tools/utilities:
- gcc+make toolchain;
- cmake - the program generates the Makefiles;
- graphviz - the program renders diagrams from .dot files;
- ghdl - VHDL simulator. It is used to check syntax
and basic semantics of VHDL files generated by the SCVHDL program.
Preparing the patched GCC
You have to compile and install GCC 4.3.0 with plugin support.
Then, the plugin itself is located in
sc2vhdl/gcc-4.3.0-p/src and it will be compiled alongside with the main program.
The source text of the plugin uses GCC internal header files.
Therefore, you should keep the relative position of directories which is specified bellow
(this constraint can be relaxed by editing
After executing the steps bellow you will have the 'GCC with plugin support'
installed in a directory
The names of binaries shall begin with "p430" prefix (eg. p430g++)
so the collision with your system GCC won't happen.
Plugins can be loaded to the GCC by using new command line options -fplugin and -fplugin-arg:
- GCC source codes:
- Download from the Internet the source codes of GCC 4.3.0 (exactly this version!)
- Unpack the tarball to same directory where the directory sc2vhdl/ is.
That is, you shall have directories eg. $HOME/sc2vhdl and $HOME/gcc-4.3.0
- Please rename the directory "gcc-4.3.0" to "gcc-4.3.0-plugin".
- GCC plugin support:
Apply the patch "gcc-4.3.0-plugin-support.patch" on the GCC source texts.
That is, change to
gcc-4.3.0-plugin and run the command:
patch -p1 <../sc2vhdl/gcc-4.3.0-p/gcc-4.3.0-plugin-support.patch
Note: The plugin patch is taken from project Mozilla Dehydra/Treehydra.
- Configure GCC:
- Create a directory gcc-4.3.0-plugin-obj in the same directory where
sc2vhdl and gcc-4.3.0-plugin are located. The GCC compilation will
run in this directory (out-of-tree build).
- Create directory $HOME/altgcc. Compiled GCC will be installed here.
- Configure gcc - the script "configure" HAS TO BE run
from the directory gcc-4.3.0-plugin-obj! :
--enable-languages=c,c++ --program-prefix=p430 \
--disable-bootstrap --without-libstdcxx \
--enable-checking CFLAGS="-g3 -O0" --enable-__cxa_atexit \
--program-prefix=p430 : names of the compiled binaries will begin by "p430" prefix,
eg. p430gcc, p430g++, so a name collision with system GCC won't happen.
--prefix=$HOME/altgcc : binaries will be installed to
--enable-targets=x86_64 : select this option depending on your system's architecture
to compile a 64b compiller.
- GCC compilation and installation: run in the directory gcc-4.3.0-plugin-obj:
make && make install
- Add the newly installed GCC to your PATH:
- in the file
$HOME/.bash_profile append directory
$HOME/altgcc/bin at the end of PATH, eg:
- then you should restart your session for changes to take effect.
Instructions how to use the sc2vhdl program
To process SYSTEMC source text by SCVHDL:
- In the SYSTEMC source texts comment out the parts which set up
and call functions writing VCD files
- Comment out all the prints:
cout and so on.
- Source texts consisting of multiple .cpp files have to be compactified.
Create a new file foo.cpp into which all the other shall be included
#include directive (see eg.
You will compile only this one file foo.cpp.
- Compile the file (foo.cpp) with the patched GCC, scc plugin and
supplied SYSTEMC libraries.
Use the following template, changing paths to relevant files:
p430g++ foo.cpp -c -DSC_SYNTHESIS -I../../../systemc/ \
- File foo.ast, which was generated by GCC, will be processed by SCVHDL program.
Use the following template, changing paths to relevant files:
sc2vhdl --elab-conf resrc/sc2vhdl-config.xml tst.ast
When in doubt please take a look at script in
List of command line options for sc2vhdl
Command line options for SCVHDL
|name of input AST file
|append arg as another command line parameter of the emulated
program (into its argv array)
|check that the return code of the emulated program equals the
specified value arg
|stop the processing right before the emulation would start
|the parameter arg specifies a name of configuration
file for the elaboration phase.
The standard file is
|generate all the VHDL code into one big file
|replace port type OUT by type BUFFER
|create an auxiliary signals for OUTput ports.
All assignments (and readbacks) shall go through this aux. signals.
This solves the issue where it is permitted in SYSTEMC
to read OUTput ports, while in VHDL it is not.
|Controlling the listings
|parameter arg specifies a name of directory
into which various HTML files will be written.
Default value is
|list all declarations
|write CFG and DFG diagrams during the transformation passes.
|write HTML files with lists of all instances existing at the end of emulation phase
|write CFG and DFG diagrams of the specified function arg
|write DFG diagrams showing the results of backtracking of objects
to their declarations in original SYSTEMC.
|write timing and memory consumption information
into the specified file arg.
|make the emulator write tracing information during the interpretation
|enable reports of the specified severity arg:
Options are: DEBUG, DUMP, TRACE, HBEAT, INFO, WARN, ERROR.
|disable reports of the specified severity arg.
This document was generated using the
LaTeX2HTML translator Version 2002-2-1 (1.71)
Copyright © 1993, 1994, 1995, 1996,
Computer Based Learning Unit, University of Leeds.
Copyright © 1997, 1998, 1999,
Mathematics Department, Macquarie University, Sydney.
The command line arguments were:
latex2html -split 0 app_manual-en.tex
The translation was initiated by Jaroslav Sýkora on 2009-06-22