Skip to content

Update printf readme and fixed some typos #1288

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jan 12, 2023
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 21 additions & 2 deletions DirectProgramming/C++SYCL_FPGA/Tutorials/Features/printf/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand All @@ -185,7 +193,18 @@ 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:
* 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)
printf.fpga.exe (Windows)
Expand All @@ -208,7 +227,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.
Expand Down