Skip to content

Commit 17337fe

Browse files
committed
[Infra]: removing the Surelog and Yosys-F4PGA-Plugin submodules and adding them as External Project to VTR CMake
Signed-off-by: Seyed Alireza Damghani <sdamghan@unb.ca>
1 parent 4f7eeca commit 17337fe

File tree

8 files changed

+66
-74
lines changed

8 files changed

+66
-74
lines changed

.github/scripts/build.sh

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,6 @@ set -e
44

55
source $(dirname "$0")/common.sh
66

7-
# Update VtR submodules
8-
if [[ $CMAKE_PARAMS == *"-DYOSYS_SV_UHDM_PLUGIN=ON"* ]]; then
9-
make update_submodules
10-
fi
11-
127
$SPACER
138

149
start_section "vtr.build" "${GREEN}Building..${NC}"

.github/scripts/run-vtr.sh

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,8 +13,6 @@ if ! { [ $VTR_TEST == "vtr_reg_strong" ] || [ $VTR_TEST == "odin_reg_strong" ] \
1313
source $SCRIPT_DIR/vtr-full-setup.sh
1414
fi
1515

16-
# Update VtR submodules
17-
source $SCRIPT_DIR/vtr-submodules.sh
1816
# Build VtR
1917
source $SCRIPT_DIR/vtr-build.sh
2018
# Run the reg test.

.github/scripts/vtr-submodules.sh

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

.gitmodules

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

Makefile

Lines changed: 0 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,6 @@ export CTEST_OUTPUT_ON_FAILURE=TRUE
5959
#For a BUILD_TYPE without 'pgo', a single stage (non-pgo) compilation is performed.
6060

6161
#Forward any targets that are not named 'distclean' or 'clean' to the generated Makefile
62-
ifneq ($(MAKECMDGOALS),update_submodules)
6362
ifneq ($(MAKECMDGOALS),distclean)
6463
ifneq ($(MAKECMDGOALS),clean)
6564
all $(MAKECMDGOALS):
@@ -109,12 +108,6 @@ endif #BUILD_TYPE
109108
@+$(MAKE) -C $(BUILD_DIR) $(MAKECMDGOALS)
110109
endif #clean
111110
endif #distclean
112-
endif #update_submodules
113-
114-
# Update GitHub submodules exist in VTR repository
115-
update_submodules:
116-
@echo "Performing Git Submodule Recursive Update on the VTR Submodules..."
117-
git submodule update --init --recursive
118111

119112
#Call the generated Makefile's clean, and then remove all cmake generated files
120113
distclean: clean

libs/EXTERNAL/CMakeLists.txt

Lines changed: 66 additions & 41 deletions
Original file line numberDiff line numberDiff line change
@@ -27,31 +27,35 @@ if(${ODIN_USE_YOSYS} OR ${WITH_YOSYS})
2727

2828
add_subdirectory(libyosys)
2929

30-
# adding a custom target to download (submodules), and compile Yosys plugins
31-
if(${YOSYS_SV_UHDM_PLUGIN})
32-
# keep record of the yosys DAT dir
33-
set(YOSYS_DATDIR ${libyosys_BINARY_DIR}/share/yosys)
34-
# keep record of the yosys-uhdm-plugin-integration path
35-
set(SURELOG_SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/Surelog)
36-
set(SURELOG_BINARY_DIR ${SURELOG_SOURCE_DIR}/build)
37-
set(YOSYS_F4PGA_PLUGINS_SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/yosys-f4pga-plugins)
38-
39-
ExternalProject_Add(surelog
40-
# root directory for Surelog project
41-
PREFIX ""
30+
# building Surelog and UHDM in a custom target to avoid any target conflict with VTR targets
31+
if(${YOSYS_SV_UHDM_PLUGIN})
32+
# keep record of the yosys DAT dir
33+
set(YOSYS_DATDIR ${libyosys_BINARY_DIR}/share/yosys)
34+
# keep record of the yosys-uhdm-plugin-integration path
35+
set(SURELOG_SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/Surelog)
36+
set(SURELOG_BINARY_DIR ${SURELOG_SOURCE_DIR}/build)
37+
set(YOSYS_F4PGA_PLUGINS_SOURCE_DIR ${CMAKE_CURRENT_SOURCE_DIR}/yosys-f4pga-plugins)
38+
39+
# Surelog
40+
ExternalProject_Add(surelog
41+
# root directory for Surelog project
42+
PREFIX ""
43+
44+
GIT_REPOSITORY https://github.com/chipsalliance/Surelog.git
45+
GIT_TAG 8da6fcba650826219ead335a3382c52f1c1d5690 # yosys-systemverilog release c7f1ded-2022-08-10
46+
GIT_PROGRESS TRUE
4247

43-
# setting source, build and install directories
44-
SOURCE_DIR "${SURELOG_SOURCE_DIR}"
45-
# BINARY_DIR "${SURELOG_BINARY_DIR}"
46-
BUILD_IN_SOURCE ON
47-
INSTALL_DIR "${SURELOG_BINARY_DIR}"
48-
49-
# define Surelog cache values
50-
CMAKE_CACHE_DEFAULT_ARGS
51-
"-DCMAKE_BUILD_TYPE:STRING=Release"
52-
"-DCMAKE_INSTALL_PREFIX:FILEPATH=${libyosys_BINARY_DIR}"
53-
"-DCMAKE_POSITION_INDEPENDENT_CODE:BOOL=ON"
54-
"-DCMAKE_WARN_DEPRECATED:BOOL=OFF"
48+
# setting source, build and install directories
49+
SOURCE_DIR "${SURELOG_SOURCE_DIR}"
50+
BUILD_IN_SOURCE TRUE
51+
INSTALL_DIR "${SURELOG_BINARY_DIR}"
52+
53+
# define Surelog cache values
54+
CMAKE_CACHE_ARGS
55+
"-DCMAKE_BUILD_TYPE:STRING=Release"
56+
"-DCMAKE_INSTALL_PREFIX:PATH=${libyosys_BINARY_DIR}"
57+
"-DCMAKE_POSITION_INDEPENDENT_CODE:BOOL=ON"
58+
"-DCMAKE_WARN_DEPRECATED:BOOL=OFF"
5559

5660
# redirect logs to a logfile
5761
LOG_BUILD ON
@@ -61,23 +65,44 @@ if(${ODIN_USE_YOSYS} OR ${WITH_YOSYS})
6165
LOG_CONFIGURE ON
6266
LOG_OUTPUT_ON_FAILURE ON
6367

64-
# usefull flags
65-
EXCLUDE_FROM_ALL ON
66-
DEPENDS yosys
67-
)
68-
69-
# building Surelog and UHDM in a custom target to avoid any target conflict with VTR targets
70-
add_custom_target(yosys-plugins ALL DEPENDS surelog yosys
71-
# uhdm
72-
COMMAND ${MAKE_PROGRAM} -C ${YOSYS_F4PGA_PLUGINS_SOURCE_DIR}
73-
PATH=${libyosys_BINARY_DIR}/bin/:$ENV{PATH}
74-
UHDM_INSTALL_DIR=${libyosys_BINARY_DIR}
75-
install
76-
-j${CMAKE_BUILD_PARALLEL_LEVEL}
77-
78-
WORKING_DIRECTORY ${CMAKE_CURRENT_SOURCE_DIR}
79-
)
80-
endif()
68+
# usefull flags
69+
ALWAYS TRUE
70+
DEPENDS yosys
71+
)
72+
73+
ExternalProject_Add(yosys-plugins
74+
# root directory for the Yosys-F4PGA-Plugins project
75+
PREFIX ""
76+
77+
GIT_REPOSITORY https://github.com/chipsalliance/yosys-f4pga-plugins.git
78+
GIT_TAG 3b3dcc5cc216f7a39d26a6d894c53b8aa3e10d71 # yosys-systemverilog release c7f1ded-2022-08-10
79+
GIT_PROGRESS TRUE
80+
81+
# setting source, build and install directories
82+
SOURCE_DIR "${YOSYS_F4PGA_PLUGINS_SOURCE_DIR}"
83+
BUILD_IN_SOURCE TRUE
84+
INSTALL_DIR ""
85+
86+
INSTALL_COMMAND ""
87+
CONFIGURE_COMMAND ""
88+
BUILD_COMMAND ${MAKE_PROGRAM} -C ${YOSYS_F4PGA_PLUGINS_SOURCE_DIR}
89+
PATH=${libyosys_BINARY_DIR}/bin/:$ENV{PATH}
90+
UHDM_INSTALL_DIR=${libyosys_BINARY_DIR}
91+
install -j${CMAKE_BUILD_PARALLEL_LEVEL}
92+
93+
# redirect logs to a logfile
94+
LOG_BUILD ON
95+
LOG_UPDATE ON
96+
LOG_INSTALL ON
97+
LOG_DOWNLOAD ON
98+
LOG_CONFIGURE ON
99+
LOG_OUTPUT_ON_FAILURE ON
100+
101+
# usefull flags
102+
ALWAYS TRUE
103+
DEPENDS surelog yosys
104+
)
105+
endif()
81106

82107
# In addition to libyosys in the build folder, we copy the libyosys directory
83108
# into a temporary folder in the VTR root, named Yosys, to have access to Yosys

libs/EXTERNAL/Surelog

Lines changed: 0 additions & 1 deletion
This file was deleted.

libs/EXTERNAL/yosys-f4pga-plugins

Lines changed: 0 additions & 1 deletion
This file was deleted.

0 commit comments

Comments
 (0)