Below is how we did it
http://www.systemc.org
and untar it so that it is adjacent to the Metropolis directory.
It should be adjacent because the MSVC project files look for SystemC
using a relative path.
If SystemC is not adjacent to Metropolis, then you will need to adjust
the path to the include files and libraries.
$METRO/src/metropolis/metamodel/backends/systemc
requires getrusage()
which is not usually part of Windows.
To compile port_rusage.cpp
under MSVC, you must download
psapi.h
and psapi.lib
. To run, you probably
need psapi.dll
.
The easiest way to obtain these files is to look for them on the web
using Google.
psapi.h
and psapi.lib
should be placed in
$METRO/src/metropolis/metamodel/backends/systemc
.
psapi.dll
should be placed in your C:\Windows
directory.
$METRO/src/metropolis/metamodel/backends/systemc/systemc.dsw
cd $METRO/examples/producers_consumer make
$METRO/examples/producers_consumer/producers_consumer.dsp
file and build the producers_consumer executable.
Under Microsoft Visual C, you might see:
metro\examples\producers_consumer\sc_main.cpp(114) : error C2143: syntax error : missing ';' before '[' metro\examples\producers_consumer\sc_main.cpp(117) : error C2143: syntax error : missing ';' before '['The solution is to change:
_sb.enabledSynchEventPC = new (ProgramCounter**)[0];to
_sb.enabledSynchEventPC = new (ProgramCounter**[0]);and
_sb.enabledSynchEventPC[i] = new (ProgramCounter*)[_sb.numSynchEventEachGroup[i]];to
_sb.enabledSynchEventPC[i] = new (ProgramCounter*[_sb.numSynchEventEachGroup[i]]);
regtests-2.0.1.tar.gz
from
http://www.systemc.org
and untar it
regtests-2.0.1/scripts/verify.pl
and change the first line to
#!/usr/bin/perland the Cygwin version check line to
} elsif( $uname_s eq "CYGWIN_NT-5.1" ) {
SYSTEMC_HOME
to point to your
systemc-2.0.1
directory. I did:
SYSTEMC_HOME=c:/cxh/src/systemc-2.0.1 export SYSTEMC_HOME
CXX
to cl so that the testsuite knows to use
Microsoft Visual C++
CXX=cl export CXX
cd regtests-2.0.l c:/cxh/src/regtests-2.0.1/scripts/verify.pl -no-cleanup -v systemc