From eb795270d4102ebe4b1023ce8a90a98ecd25ef0d Mon Sep 17 00:00:00 2001 From: "Yang, Hao Xiang" Date: Tue, 10 Jan 2023 14:58:15 -0800 Subject: [PATCH 1/2] Added simulation instructions to README for 2023.1 --- .../Tutorials/Features/printf/README.md | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/DirectProgramming/C++SYCL_FPGA/Tutorials/Features/printf/README.md b/DirectProgramming/C++SYCL_FPGA/Tutorials/Features/printf/README.md index 021fa2d20c..ec5f5fe8fe 100755 --- a/DirectProgramming/C++SYCL_FPGA/Tutorials/Features/printf/README.md +++ b/DirectProgramming/C++SYCL_FPGA/Tutorials/Features/printf/README.md @@ -124,6 +124,10 @@ PRINTF("Hello: %d\n", 123); ``` make fpga_emu ``` + * Compile for simulation (medium compile time, targets simulated FPGA device): + ``` + make fpga_sim + ``` * Generate the optimization report: ``` make report @@ -160,6 +164,10 @@ PRINTF("Hello: %d\n", 123); ``` nmake fpga_emu ``` + * Compile for simulation (medium compile time, targets simulated FPGA device): + ``` + nmake fpga_sim + ``` * Generate the optimization report: ``` nmake report @@ -185,7 +193,12 @@ From the report, you can find the compilation information of the design and the ./printf.fpga_emu (Linux) printf.fpga_emu.exe (Windows) ``` -2. Run the sample on the FPGA device: +2. Run the sample on the FPGA simulator: + ``` + ./printf.fpga_sim (Linux) + printf.fpga_sim.exe (Windows) + ``` +3. Run the sample on the FPGA device: ``` ./printf.fpga (Linux) printf.fpga.exe (Windows) @@ -208,7 +221,7 @@ Result11: ABCD ## Known issues and limitations -There are some known issues with the `experimental::printf()` and that's why the function is in the experimental namespace. The following limitations exist when using `experimental::printf()` on FPGA hardware: +There are some known issues with the `experimental::printf()` and that's why the function is in the experimental namespace. The following limitations exist when using `experimental::printf()` on FPGA simulation and hardware: * Printing string literals %s is not supported yet. You can put the string directly in the format as a workaround. For example: `PRINTF("Hello, World!\n")`. * Printing pointer address %p is not supported yet. From d190b73688fd39f023d95a5dc351de7f71264e76 Mon Sep 17 00:00:00 2001 From: "Yang, Hao Xiang" Date: Wed, 11 Jan 2023 11:27:03 -0800 Subject: [PATCH 2/2] Corrected for running simulation since windows need multiple commmands to run --- .../Tutorials/Features/printf/README.md | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/DirectProgramming/C++SYCL_FPGA/Tutorials/Features/printf/README.md b/DirectProgramming/C++SYCL_FPGA/Tutorials/Features/printf/README.md index ec5f5fe8fe..ffa9282fa5 100755 --- a/DirectProgramming/C++SYCL_FPGA/Tutorials/Features/printf/README.md +++ b/DirectProgramming/C++SYCL_FPGA/Tutorials/Features/printf/README.md @@ -194,10 +194,16 @@ From the report, you can find the compilation information of the design and the printf.fpga_emu.exe (Windows) ``` 2. Run the sample on the FPGA simulator: - ``` - ./printf.fpga_sim (Linux) - printf.fpga_sim.exe (Windows) - ``` + * On Linux + ``` + CL_CONTEXT_MPSIM_DEVICE_INTELFPGA=1 ./printf.fpga_sim + ``` + * On Windows + ``` + set CL_CONTEXT_MPSIM_DEVICE_INTELFPGA=1 + printf.fpga_sim.exe + set CL_CONTEXT_MPSIM_DEVICE_INTELFPGA= + ``` 3. Run the sample on the FPGA device: ``` ./printf.fpga (Linux)