Skip to content

Commit 8e2d7ed

Browse files
authored
FPGA: Switch to default seed 2 to avoid Stratix10 timing failures in the stall_enable sample (#2035)
This avoids a timing failure on Stratix10 for the default seed
1 parent 99c9659 commit 8e2d7ed

File tree

1 file changed

+16
-1
lines changed
  • DirectProgramming/C++SYCL_FPGA/Tutorials/Features/stall_enable/src

1 file changed

+16
-1
lines changed

DirectProgramming/C++SYCL_FPGA/Tutorials/Features/stall_enable/src/CMakeLists.txt

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,21 @@ if(WIN32)
3030
set(WIN_FLAG "/EHsc")
3131
endif()
3232

33+
# Choose the random seed for the hardware compile
34+
# e.g. cmake .. -DSEED=7
35+
if(NOT DEFINED SEED)
36+
# Seed 1 fails for S10 on Windows
37+
set(SEED 2)
38+
else()
39+
message(STATUS "Seed explicitly set to ${SEED}")
40+
endif()
41+
42+
if(IGNORE_DEFAULT_SEED)
43+
set(SEED_FLAG "")
44+
else()
45+
set(SEED_FLAG "-Xsseed=${SEED}")
46+
endif()
47+
3348
# A SYCL ahead-of-time (AoT) compile processes the device code in two stages.
3449
# 1. The "compile" stage compiles the device code to an intermediate representation (SPIR-V).
3550
# 2. The "link" stage invokes the compiler's FPGA backend before linking.
@@ -39,7 +54,7 @@ set(EMULATOR_LINK_FLAGS "-fsycl -fintelfpga")
3954
set(SIMULATOR_COMPILE_FLAGS "-fsycl -fintelfpga -Wall ${WIN_FLAG} ${HYPER_FLAG} -Xssimulation -DFPGA_SIMULATOR")
4055
set(SIMULATOR_LINK_FLAGS "-fsycl -fintelfpga -Xssimulation -Xstarget=${FPGA_DEVICE} ${HYPER_FLAG} ${USER_HARDWARE_FLAGS}")
4156
set(HARDWARE_COMPILE_FLAGS "-fsycl -fintelfpga -Wall ${WIN_FLAG} ${HYPER_FLAG} -DFPGA_HARDWARE")
42-
set(HARDWARE_LINK_FLAGS "-fsycl -fintelfpga -Xshardware -Xstarget=${FPGA_DEVICE} ${HYPER_FLAG} ${USER_HARDWARE_FLAGS}")
57+
set(HARDWARE_LINK_FLAGS "-fsycl -fintelfpga -Xshardware ${SEED_FLAG} -Xstarget=${FPGA_DEVICE} ${HYPER_FLAG} ${USER_HARDWARE_FLAGS}")
4358
# use cmake -D USER_HARDWARE_FLAGS=<flags> to set extra flags for FPGA backend compilation
4459

4560
###############################################################################

0 commit comments

Comments
 (0)