This repository has been archived by the owner on Dec 1, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathveriSCConfig.cmake.in
62 lines (50 loc) · 1.75 KB
/
veriSCConfig.cmake.in
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
set(__VERISC_REL_ROOT "${CMAKE_CURRENT_LIST_DIR}/../../../")
include(CMakeFindDependencyMacro)
set(CMAKE_MIN_VERSION 3.25)
set(CMAKE_CXX_STANDARD @CMAKE_CXX_STANDARD@)
set(USE_VCS @USE_VCS@)
# Include GCC toolchain file first
find_package(gcc CONFIG REQUIRED
PATHS ${__VERISC_REL_ROOT}/*
NO_DEFAULT_PATH
)
include("${__VERISC_REL_ROOT}/cmake/verilator/find_libs.cmake")
if(NOT DEFINED USE_VERILATOR)
set(USE_VERILATOR 1)
endif()
if(USE_VERILATOR)
include("${__VERISC_REL_ROOT}/cmake/verilator/verilator.cmake")
endif()
if(USE_VCS)
include("${__VERISC_REL_ROOT}/cmake/synopsys/vcs.cmake")
endif()
include("${__VERISC_REL_ROOT}/cmake/rtllib.cmake")
function(make_rtl RTL_LIB)
if(USE_VERILATOR)
verilate_rtl(${RTL_LIB} SYSTEMC)
endif()
# if(USE_VCS)
# vcs_rtl(${OUT_LIB} ${RTL_LIB})
# endif()
endfunction()
function(make_tb EXEC)
set(multiValueArgs RTL_LIBS)
set(options "")
set(oneValueArgs "")
cmake_parse_arguments(ARG "${options}" "${oneValueArgs}" "${multiValueArgs}" ${ARGN})
if(USE_VERILATOR)
verilate_tb(${EXEC} RTL_LIBS ${ARG_RTL_LIBS} DEPS ${ARG_DEPS})
endif()
if(USE_VCS)
vcs_tb(${SC_LIB} "${RTL_LIBS}")
endif()
endfunction()
if(NOT TARGET graphviz)
add_custom_target(graphviz
COMMAND ${CMAKE_COMMAND} -E copy ${__VERISC_REL_ROOT}/cmake/CMakeGraphVizOptions.cmake ${CMAKE_BINARY_DIR}
COMMAND ${CMAKE_COMMAND} "--graphviz=graphviz/foo.dot" .
COMMAND python3 ${__VERISC_REL_ROOT}/scripts/graphviz_shorten_path.py -f "${CMAKE_BINARY_DIR}/graphviz/foo.dot" -o "${CMAKE_BINARY_DIR}/graphviz/out.dot" -l
COMMAND dot -Tpng "${CMAKE_BINARY_DIR}/graphviz/out.dot" -o graph.png
WORKING_DIRECTORY "${CMAKE_BINARY_DIR}"
)
endif()