FPGA: Remove Windows simulator command for memory_attributes (#1374) · oneapi-src/oneAPI-samples@149dbb6 (original) (raw)

2 files changed

lines changed

Original file line number Diff line number Diff line change
@@ -249,10 +249,6 @@ The choice of attributes will be further discussed in the [Examining the Reports
249 249 ```
250 250 nmake fpga_emu
251 251 ```
252 - * Compile for simulation (fast compile time, targets simulated FPGA device, reduced data size):
253 - ```
254 - nmake fpga_sim
255 - ```
256 252 * Generate the optimization report:
257 253 ```
258 254 nmake report
@@ -321,12 +317,6 @@ There are often many ways to generate a stall-free memory system. As a programme
321 317 ```bash
322 318 CL_CONTEXT_MPSIM_DEVICE_INTELFPGA=1 ./memory_attributes.fpga_sim
323 319 ```
324 - * On Windows
325 - ```bash
326 - set CL_CONTEXT_MPSIM_DEVICE_INTELFPGA=1
327 - memory_attributes.fpga_sim.exe
328 - set CL_CONTEXT_MPSIM_DEVICE_INTELFPGA=
329 - ```
330 320 3. Run the sample on the FPGA device (only if you ran `cmake` with `-DFPGA_DEVICE=:`):
331 321 ```
332 322 ./memory_attributes.fpga (Linux)
Original file line number Diff line number Diff line change
@@ -1,9 +1,12 @@
1 1 set(SOURCE_FILE memory_attributes.cpp)
2 2 set(TARGET_NAME memory_attributes)
3 3 set(EMULATOR_TARGET ${TARGET_NAME}.fpga_emu)
4 -set(SIMULATOR_TARGET ${TARGET_NAME}.fpga_sim)
5 4 set(FPGA_TARGET ${TARGET_NAME}.fpga)
6 5
6 +if(UNIX)
7 + set(SIMULATOR_TARGET ${TARGET_NAME}.fpga_sim)
8 +endif()
9 +
7 10 # FPGA board selection
8 11 if(NOT DEFINED FPGA_DEVICE)
9 12 set(FPGA_DEVICE "Agilex")
@@ -46,18 +49,20 @@ set_target_properties(${EMULATOR_TARGET} PROPERTIES LINK_FLAGS "${EMULATOR_LINK_
46 49 add_custom_target(fpga_emu DEPENDS ${EMULATOR_TARGET})
47 50
48 51 ###############################################################################
49 -### FPGA Simulator
52 +### FPGA Simulator (for UNIX)
50 53 ###############################################################################
51 54 # To compile in a single command:
52 55 # icpx -fsycl -fintelfpga -Xssimulation -DFPGA_SIMULATOR mem_channel.cpp -o mem_channel.fpga_sim
53 56 # CMake executes:
54 57 # [compile] icpx -fsycl -fintelfpga -Xssimulation -DFPGA_SIMULATOR -o mem_channel.cpp.o -c mem_channel.cpp
55 58 # [link] icpx -fsycl -fintelfpga -Xssimulation mem_channel.cpp.o -o mem_channel.fpga_sim
56 -add_executable(${SIMULATOR_TARGET} ${SOURCE_FILE})
57 -target_include_directories(${SIMULATOR_TARGET} PRIVATE ../../../../include)
58 -set_target_properties(${SIMULATOR_TARGET} PROPERTIES COMPILE_FLAGS "${SIMULATOR_COMPILE_FLAGS}")
59 -set_target_properties(${SIMULATOR_TARGET} PROPERTIES LINK_FLAGS "${SIMULATOR_LINK_FLAGS}")
60 -add_custom_target(fpga_sim DEPENDS ${SIMULATOR_TARGET})
59 +if(UNIX)
60 + add_executable(${SIMULATOR_TARGET} ${SOURCE_FILE})
61 + target_include_directories(${SIMULATOR_TARGET} PRIVATE ../../../../include)
62 + set_target_properties(${SIMULATOR_TARGET} PROPERTIES COMPILE_FLAGS "${SIMULATOR_COMPILE_FLAGS}")
63 + set_target_properties(${SIMULATOR_TARGET} PROPERTIES LINK_FLAGS "${SIMULATOR_LINK_FLAGS}")
64 + add_custom_target(fpga_sim DEPENDS ${SIMULATOR_TARGET})
65 +endif()
61 66
62 67 ###############################################################################
63 68 ### Generate Report