Skip to content

Commit 0345b87

Browse files
Pretty printers fixed, build.sh added
1 parent b181a7c commit 0345b87

File tree

5 files changed

+73
-46
lines changed

5 files changed

+73
-46
lines changed

build.sh

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
#!/bin/bash -e
2+
3+
##################################################################################
4+
# This bash script builds and installs ICSC after update, runs ICSCS examples #
5+
##################################################################################
6+
7+
test -z $ICSC_HOME && { echo "ICSC_HOME is not configured"; exit 1; }
8+
echo "Using ICSC_HOME = $ICSC_HOME"
9+
10+
export CWD_DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
11+
echo $CWD_DIR
12+
export CMAKE_PREFIX_PATH=$ICSC_HOME:$CMAKE_PREFIX_PATH
13+
export GCC_INSTALL_PREFIX="$(realpath "$(dirname $(which g++))"/..)"
14+
15+
# ################################################################################
16+
# Build and install ISCC
17+
cd $CWD_DIR
18+
(
19+
mkdir build_icsc_rel -p && cd build_icsc_rel
20+
cmake ../ -DCMAKE_BUILD_TYPE=Release -DCMAKE_INSTALL_PREFIX=$ICSC_HOME -DCMAKE_CXX_STANDARD=17
21+
make -j12
22+
make install
23+
24+
cd ..
25+
26+
mkdir build_icsc_dbg -p && cd build_icsc_dbg
27+
cmake ../ -DCMAKE_BUILD_TYPE=Debug -DCMAKE_INSTALL_PREFIX=$ICSC_HOME -DCMAKE_CXX_STANDARD=17 -DCMAKE_DEBUG_POSTFIX=d
28+
make -j12
29+
make install
30+
31+
cp $CWD_DIR/cmake/CMakeLists.top $ICSC_HOME/CMakeLists.txt
32+
)
33+
34+
echo "*** ISCC Build and Installation Complete! ***"
35+
36+
37+
# ################################################################################
38+
# Build and run examples
39+
echo "*** Building Examples ***"
40+
cd $ICSC_HOME
41+
(
42+
source setenv.sh
43+
mkdir build -p && cd build
44+
cmake ../ # prepare Makefiles
45+
cd designs/examples # run examples only
46+
ctest -j12 # compile and run Verilog generation
47+
# use "-jN" key to run in "N" processes
48+
)

cmake/CMakeLists.top

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@
1010
# *****************************************************************************
1111

1212
cmake_minimum_required(VERSION 3.12)
13+
project (icsc_designs)
1314

1415
## C++ standard
1516
set(CMAKE_CXX_STANDARD 17)

designs/README

Lines changed: 0 additions & 35 deletions
This file was deleted.

gdb/gdbinit-example.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33

44
python
55
import sys, os
6-
libstdcxx_printers_path = '/usr/intel/pkgs/gcc/10.1.0/share/gcc-10.1.0/python/'
6+
libstdcxx_printers_path = '/usr/share/gcc/python/'
77
sysc23x_printers_path = '$ICSC_HOME/share/gdb/python/sysc23x_printers/'
88
libstdcxx_printers_path = os.path.expandvars(libstdcxx_printers_path)
99
sysc23x_printers_path = os.path.expandvars(sysc23x_printers_path)

install.sh

Lines changed: 23 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,12 @@
11
#!/bin/bash -e
22

3+
#################################################################################
4+
# This bash script downloads and builds Protobuf, Clang/LLVM, GDB (optional), #
5+
# builds and installs ICSC, runs ICSCS examples. #
6+
# To build GDB with Python3 compatible with SystemC pretty printers use: #
7+
# ./install.sh gdb #
8+
#################################################################################
9+
310
test -z $ICSC_HOME && { echo "ICSC_HOME is not configured"; exit 1; }
411
echo "Using ICSC_HOME = $ICSC_HOME"
512

@@ -11,6 +18,7 @@ export GCC_INSTALL_PREFIX="$(realpath "$(dirname $(which g++))"/..)"
1118
echo "Downloading and building Protobuf/LLVM at $CWD_DIR/build_deps..."
1219
mkdir build_deps -p && cd build_deps
1320

21+
# ################################################################################
1422
# Download, unpack, build, install Protobuf 3.13
1523
wget -N https://github.com/protocolbuffers/protobuf/archive/v3.13.0.tar.gz --no-check-certificate
1624
tar -xf v3.13.0.tar.gz --skip-old-files
@@ -22,6 +30,7 @@ tar -xf v3.13.0.tar.gz --skip-old-files
2230
make install
2331
)
2432

33+
# ################################################################################
2534
# Download, unpack, build, install Clang and LLVM
2635
wget -N https://github.com/llvm/llvm-project/releases/download/llvmorg-12.0.1/clang-12.0.1.src.tar.xz --no-check-certificate
2736
wget -N https://github.com/llvm/llvm-project/releases/download/llvmorg-12.0.1/llvm-12.0.1.src.tar.xz --no-check-certificate
@@ -36,17 +45,21 @@ ln -sf ../../clang-12.0.1.src llvm-12.0.1.src/tools/clang
3645
make install
3746
)
3847

48+
# ################################################################################
3949
# Download, unpack, build, install GDB with Python3
40-
#wget -N https://ftp.gnu.org/gnu/gdb/gdb-11.2.tar.gz --no-check-certificate
41-
#tar -xf gdb-11.2.tar.gz --skip-old-files
42-
#(
43-
# cd gdb-11.2
44-
# ./configure --prefix="$ICSC_HOME" --with-python="$(which python3)"
45-
# make -j12
46-
# make install
47-
#)
48-
50+
if [[ $1 == gdb ]]
51+
then
52+
wget -N https://ftp.gnu.org/gnu/gdb/gdb-11.2.tar.gz --no-check-certificate
53+
tar -xf gdb-11.2.tar.gz --skip-old-files
54+
(
55+
cd gdb-11.2
56+
./configure --prefix="$ICSC_HOME" --with-python="$(which python3)"
57+
make -j12
58+
make install
59+
)
60+
fi
4961

62+
# ################################################################################
5063
# Build and install ISCC
5164
cd $CWD_DIR
5265
(
@@ -77,6 +90,6 @@ cd $ICSC_HOME
7790
mkdir build -p && cd build
7891
cmake ../ # prepare Makefiles
7992
cd designs/examples # run examples only
80-
ctest -j4 # compile and run Verilog generation
93+
ctest -j12 # compile and run Verilog generation
8194
# use "-jN" key to run in "N" processes
8295
)

0 commit comments

Comments
 (0)