@@ -20,29 +20,30 @@ set(FPGA_TARGET_MANUAL_REVERT ${TARGET_NAME_MANUAL_REVERT}.fpga)
20
20
# FPGA board selection
21
21
if (NOT DEFINED FPGA_DEVICE)
22
22
set (FPGA_DEVICE "Agilex" )
23
- set (DEVICE_FLAG "-DAgilex " )
23
+ set (DEVICE_FLAG "Agilex " )
24
24
set (MANUAL_REVERT_FLAGS "-Xshyper-optimized-handshaking=on -Xssfc-exit-fifo-type=default" )
25
25
message (STATUS "FPGA_DEVICE was not specified.\
26
26
\n Configuring the design to the default FPGA family: ${FPGA_DEVICE} \
27
27
\n Please refer to the README for information on target selection." )
28
28
else ()
29
- if (FPGA_DEVICE MATCHES ".*a10*" )
30
- set (DEVICE_FLAG "-DA10" )
29
+ string (TOLOWER ${FPGA_DEVICE} FPGA_DEVICE_NAME)
30
+ if (FPGA_DEVICE_NAME MATCHES ".*a10*" )
31
+ set (DEVICE_FLAG "A10" )
31
32
set (MANUAL_REVERT_FLAGS "-Xssfc-exit-fifo-type=default" )
32
- elseif (FPGA_DEVICE MATCHES ".*s10*" )
33
- set (DEVICE_FLAG "-DS10 " )
33
+ elseif (FPGA_DEVICE_NAME MATCHES ".*s10*" )
34
+ set (DEVICE_FLAG "S10 " )
34
35
set (MANUAL_REVERT_FLAGS "-Xshyper-optimized-handshaking=on -Xssfc-exit-fifo-type=default" )
35
- elseif (FPGA_DEVICE MATCHES ".*agilex*" )
36
- set (DEVICE_FLAG "-DAgilex " )
36
+ elseif (FPGA_DEVICE_NAME MATCHES ".*agilex*" )
37
+ set (DEVICE_FLAG "Agilex " )
37
38
set (MANUAL_REVERT_FLAGS "-Xshyper-optimized-handshaking=on -Xssfc-exit-fifo-type=default" )
38
39
endif ()
39
40
message (STATUS "Configuring the design with the following target: ${FPGA_DEVICE} " )
40
41
endif ()
41
42
42
43
if (NOT DEFINED DEVICE_FLAG)
43
44
message (FATAL_ERROR "An unrecognized or custom board was passed, but DEVICE_FLAG was not specified. \
44
- Please make sure you have set -DDEVICE_FLAG=-DA10 , -DDEVICE_FLAG=-DS10 or \
45
- -DDEVICE_FLAG=-DAgilex ." )
45
+ Please make sure you have set -DDEVICE_FLAG=A10 , -DDEVICE_FLAG=S10 or \
46
+ -DDEVICE_FLAG=Agilex ." )
46
47
endif ()
47
48
48
49
# This is a Windows-specific flag that enables exception handling in host code
@@ -54,12 +55,12 @@ endif()
54
55
# 1. The "compile" stage compiles the device code to an intermediate representation (SPIR-V).
55
56
# 2. The "link" stage invokes the compiler's FPGA backend before linking.
56
57
# For this reason, FPGA backend flags must be passed as link flags in CMake.
57
- set (EMULATOR_COMPILE_FLAGS "-Wall ${WIN_FLAG} -fsycl -fintelfpga -DFPGA_EMULATOR ${DEVICE_FLAG} " )
58
+ set (EMULATOR_COMPILE_FLAGS "-Wall ${WIN_FLAG} -fsycl -fintelfpga -DFPGA_EMULATOR -D ${DEVICE_FLAG} " )
58
59
set (EMULATOR_LINK_FLAGS "-fsycl -fintelfpga" )
59
- set (SIMULATOR_COMPILE_FLAGS "-Wall ${WIN_FLAG} -fsycl -fintelfpga -DFPGA_SIMULATOR ${DEVICE_FLAG} " )
60
- set (SIMULATOR_LINK_FLAGS "-fsycl -fintelfpga -Xssimulation -Xstarget=${FPGA_DEVICE} ${DEVICE_FLAG} ${USER_HARDWARE_FLAGS} " )
61
- set (HARDWARE_COMPILE_FLAGS "-Wall ${WIN_FLAG} -fsycl -fintelfpga -DFPGA_HARDWARE ${DEVICE_FLAG} " )
62
- set (HARDWARE_LINK_FLAGS "-fsycl -fintelfpga -Xshardware -Xstarget=${FPGA_DEVICE} ${DEVICE_FLAG} ${USER_HARDWARE_FLAGS} " )
60
+ set (SIMULATOR_COMPILE_FLAGS "-Wall ${WIN_FLAG} -fsycl -fintelfpga -DFPGA_SIMULATOR -D ${DEVICE_FLAG} " )
61
+ set (SIMULATOR_LINK_FLAGS "-fsycl -fintelfpga -Xssimulation -Xstarget=${FPGA_DEVICE} -D ${DEVICE_FLAG} ${USER_HARDWARE_FLAGS} " )
62
+ set (HARDWARE_COMPILE_FLAGS "-Wall ${WIN_FLAG} -fsycl -fintelfpga -DFPGA_HARDWARE -D ${DEVICE_FLAG} " )
63
+ set (HARDWARE_LINK_FLAGS "-fsycl -fintelfpga -Xshardware -Xstarget=${FPGA_DEVICE} -D ${DEVICE_FLAG} ${USER_HARDWARE_FLAGS} " )
63
64
# use cmake -D USER_HARDWARE_FLAGS=<flags> to set extra flags for FPGA backend compilation
64
65
65
66
###############################################################################
0 commit comments