Skip to content

Commit 12cb42b

Browse files
committed
update install.sh/CMake: fix issues, don't re-download/re-build llvm/clang, build/install both debug&release SystemC libraries; include gdb pretty-printers for SystemC
1 parent bb4bda0 commit 12cb42b

File tree

8 files changed

+391
-101
lines changed

8 files changed

+391
-101
lines changed

.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,3 +81,6 @@ dkms.conf
8181

8282
# Misc
8383
sc_tool/arc
84+
build/
85+
build_*/
86+

CMakeLists.txt

Lines changed: 14 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ add_custom_command(OUTPUT ${SYSTEMC_PCH}
5151
COMMAND
5252
${CLANG_CXX_EXECUTABLE} -Xclang -emit-pch -x c++-header
5353
${CMAKE_SOURCE_DIR}/systemc/src/systemc.h -o ${SYSTEMC_PCH} ${MSVC_FLAGS}
54-
-D__SC_TOOL__ -D__SC_TOOL_ANALYZE__ -DNDEBUG -std=c++14
54+
-D__SC_TOOL__ -D__SC_TOOL_ANALYZE__ -DNDEBUG -std=c++17
5555
-I${CMAKE_SOURCE_DIR}/systemc/src
5656
DEPENDS systemc
5757
COMMENT "Generating SystemC precompiled header ${SYSTEMC_PCH}"
@@ -73,12 +73,12 @@ include(cmake/svc_target.cmake)
7373
enable_testing()
7474

7575
# Compile tests and test designs
76-
if( ${CMAKE_BUILD_TYPE} STREQUAL "Debug" )
77-
message (STATUS "Debug mode: add tests and test designs")
78-
add_subdirectory(tests)
79-
add_subdirectory(examples)
80-
add_subdirectory(designs)
81-
endif()
76+
#if( ${CMAKE_BUILD_TYPE} STREQUAL "Debug" )
77+
# message (STATUS "Debug mode: add tests and test designs")
78+
# add_subdirectory(tests)
79+
# add_subdirectory(examples)
80+
# add_subdirectory(designs)
81+
#endif()
8282

8383
###############################################################################
8484

@@ -101,12 +101,10 @@ install(FILES ${PROJECT_BINARY_DIR}/SVCConfig.cmake cmake/svc_target.cmake
101101
# Install sctCommon
102102
install(DIRECTORY components/common/sctcommon DESTINATION include)
103103

104-
# Install release mode CMakeLists and scripts
105-
if( ${CMAKE_BUILD_TYPE} STREQUAL "Release" )
106-
message (STATUS "Release mode: copy CMakeLists and scripts")
107-
install(FILES cmake/CMakeLists.txt
108-
cmake/setenv.sh
109-
cmake/README
110-
DESTINATION $ENV{ICSC_HOME})
111-
112-
endif()
104+
# Install setenv scripts
105+
install(FILES cmake/setenv.sh gdb/gdbinit-example.txt
106+
DESTINATION $ENV{ICSC_HOME})
107+
108+
# Install GDB pretty-printers
109+
install(FILES gdb/sysc23x_printers/sysc23x_printers.py
110+
DESTINATION $ENV{ICSC_HOME}/share/gdb/python/sysc23x_printers)

README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ ICSC is distributed under the [Apache License v2.0 with LLVM Exceptions](https:/
1818

1919
## Getting started
2020

21-
ICSC is based on Clang/LLVM frontend and can be installed at most Linux OS. There is ```install.sh``` script that downloads and builds ICSC and the required dependecies at **Ubuntu 20.04**.
21+
ICSC is based on Clang/LLVM frontend and can be installed at most Linux OS. There is ```install.sh``` script that downloads and builds ICSC and the required dependencies at **Ubuntu 20.04**.
2222

2323
An instruction how to install and run ISCS is given at [Getting started](https://github.com/intel/systemc-compiler/wiki/Getting-started).
2424

cmake/CMakeLists.txt

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

cmake/README

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

gdb/gdbinit-example.txt

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
# To enable pretty-printing for SystemC/SingleSource data types
2+
# copy/move gdbinit-example.txt to ~/.gdbinit
3+
4+
python
5+
import sys, os
6+
libstdcxx_printers_path = '/usr/intel/pkgs/gcc/10.1.0/share/gcc-10.1.0/python/'
7+
sysc23x_printers_path = '$ICSC_HOME/share/gdb/python/sysc23x_printers/'
8+
libstdcxx_printers_path = os.path.expandvars(libstdcxx_printers_path)
9+
sysc23x_printers_path = os.path.expandvars(sysc23x_printers_path)
10+
sys.path.insert(0, libstdcxx_printers_path)
11+
sys.path.insert(0, sysc23x_printers_path)
12+
from libstdcxx.v6.printers import register_libstdcxx_printers
13+
register_libstdcxx_printers (None)
14+
from sysc23x_printers import register_sysc23x_printers
15+
register_sysc23x_printers (None)
16+
end
17+
18+
# If you are debugging systemc, the following idioms break in the debugger
19+
# when you hit an error
20+
#break sc_core::sc_report_handler::report if (severity >= sc_core::SC_ERROR)
21+
#break sc_core::sc_report_handler::report

0 commit comments

Comments
 (0)