-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Adding resources to build the SystemC library with Sample example.
Adding the build script and Sample example to test the SystemC environment.
- Loading branch information
Showing
7 changed files
with
142 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -26,3 +26,6 @@ | |
*.exe | ||
*.out | ||
*.app | ||
|
||
# do not add temp backup files | ||
*~ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
This folder contains resources for setting up the SystemC library on you system. | ||
|
||
File: build.sh | ||
This file contains commands necessary to build and install the SystemC libray on you system. | ||
File: links.txt | ||
This files contains resources pertaining to SystemC library from the Acellera website. | ||
It will be updated to point to other online resources available for the SystemC library. | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,89 @@ | ||
#!/bin/bash | ||
|
||
# This script will download the SystemC library from Accelera website and configure the build and build it for you. | ||
echo "======================================================" | ||
echo "Downloading the SystemC library from accellera website" | ||
echo "======================================================" | ||
wget -c http://www.accellera.org/images/downloads/standards/systemc/systemc-2.3.1.tgz | ||
|
||
echo "======================================================" | ||
echo "Extracting the SystemC source code" | ||
echo "======================================================" | ||
tar xf systemc-2.3.1.tgz | ||
|
||
pd=$PWD | ||
|
||
cd systemc-2.3.1 | ||
|
||
echo "======================================================" | ||
echo "Creating build directory" | ||
echo "======================================================" | ||
if [ -d "objdir" ]; then | ||
echo "!!!Directory Already Exists!!!" | ||
else | ||
mkdir objdir | ||
fi | ||
|
||
cd objdir | ||
|
||
# Create Installation Directory | ||
SYSTEMC=$HOME/systemcInstall | ||
mkdir -p $HOME/systemcInstall | ||
|
||
# Configure the SystemC library | ||
echo "============================================================================" | ||
echo "Configuring the SystemC library" | ||
echo "SystemC library will be installed in $SYSTEMC" | ||
echo "============================================================================" | ||
../configure --prefix=$HOME/systemcInstall | ||
|
||
# Find the Number of CPUS to utilize all the cores to build the SystemC llibrary | ||
CPUS=`nproc` | ||
echo "======================================================" | ||
echo "Using $CPUS Threads to build SystemC" | ||
echo "======================================================" | ||
|
||
# Build the SystemC library | ||
echo "======================================================" | ||
echo "Building the SystemC library" | ||
echo "======================================================" | ||
make -j $CPUS | ||
|
||
# Check the build SystemC library | ||
echo "===========================================================" | ||
echo "Checking the Built library by building examples application" | ||
echo "===========================================================" | ||
make check | ||
|
||
# Do the Installation | ||
echo "======================================================" | ||
echo "SystemC Installation" | ||
echo "======================================================" | ||
make install | ||
|
||
cd $pd | ||
|
||
echo "=====================================================================================================================================================" | ||
echo "Please Add the contents of this SystemC.config to the end of your .bashrc file located in your $HOME folder" | ||
echo "=====================================================================================================================================================" | ||
|
||
echo "export SYSTEMC=$SYSTEMC" > SystemC.config | ||
echo "export SYSTEMC_HOME=\$SYSTEMC" >> SystemC.config | ||
MACHINE_TYPE=`uname -m` | ||
if [ ${MACHINE_TYPE} = "x86_64" ]; then | ||
echo "export TARGET_ARCH=linux64" >> SystemC.config | ||
else | ||
echo "export TARGET_ARCH=linux" >> SystemC.config | ||
fi | ||
|
||
#if [ ${LD_LIBRARY_PATH} == "" ]; then | ||
# echo "export LD_LIBRARY_PATH=\$SYSTEMC/lib-\$TARGET_ARCH" >> SystemC.config | ||
#else | ||
# echo "export LD_LIBRARY_PATH=\$LD_LIBRARY_PATH:\$SYSTEMC/lib-\$TARGET_ARCH" >> SystemC.config | ||
#fi | ||
|
||
echo "export LD_LIBRARY_PATH=${LD_LIBRARY_PATH:+$LD_LIBRARY_PATH:}\$SYSTEMC/lib-\$TARGET_ARCH" >> SystemC.config | ||
|
||
echo "======================================================" | ||
echo "Build and Installation finished" | ||
echo "======================================================" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
http://www.accellera.org/images/downloads/standards/systemc/systemc-2.3.1.tgz | ||
http://www.accellera.org/images/downloads/standards/systemc/systemc_regressions-2.3.1.tgz | ||
http://www.accellera.org/images/downloads/standards/systemc/SystemC_AMS_2_0_LRM.pdf | ||
http://www.accellera.org/images/downloads/standards/systemc/scv-2.0.0.tgz | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
CXX=g++ | ||
RM= rm -rf | ||
CXX_FLAGS= -c -g -Wall -I$(SYSTEMC)/include | ||
|
||
LD_FLAGS= -L$(SYSTEMC)/lib-$(TARGET_ARCH) -lsystemc | ||
|
||
SRCS_CXX= basic.cpp | ||
|
||
OBJS_CXX= $(SRCS_CXX:.cpp=.o) | ||
|
||
PROJECT=01_SystemCTest | ||
|
||
all: $(PROJECT) | ||
./$(PROJECT) | ||
|
||
$(PROJECT): $(OBJS_CXX) | ||
$(CXX) -o $@ $< $(LD_FLAGS) | ||
|
||
.cpp.o: | ||
$(CXX) $(CXX_FLAGS) $< -o $@ | ||
|
||
clean: | ||
$(RM) $(OBJS_CXX) $(PROJECT) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
This Sample application just checks if the Copyright information is being printed | ||
on the console for proper configuration for building sample SystemC application. | ||
|
||
Please add the configuration (SystemC.config) generated by the build.sh script | ||
after the SystemC library has been built by it. | ||
|
||
Note: Please restart your shell session or just source the .bashrc file to update | ||
Environment variables. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
#include <systemc.h> | ||
|
||
int sc_main(int argc, char *argv[]) { | ||
return 0; | ||
} | ||
|