oneAPI-samples icon indicating copy to clipboard operation
oneAPI-samples copied to clipboard

[FPGA] Support FPGA Simulator

Open mendell27 opened this issue 3 years ago • 16 comments

Add support for the FPGA simulator to run the code samples for loop_carried_dependency, triangular_loop, stall_enable

Uses ext::intel::fpga_simulator_selector class to choose the simulator.

Existing Sample Changes

DirectProgramming/DPC++FPGA/Tutorials/DesignPatterns/loop_carried_dependency DirectProgramming/DPC++FPGA/Tutorials/DesignPatterns/triangular_loop DirectProgramming/DPC++FPGA/Tutorials/Features/stall_enable

Description

Add support for running these code samples on the FPGA simulator. Reduced data sizes to ensure reasonable execution times, as simulator is 1000-10000x slower than hardware

Type of change

  • [X] New feature (non-breaking change which adds functionality)

How Has This Been Tested?

This has been run manually on Linux and Windows

  • [X] Command Line
  • [ ] oneapi-cli
  • [ ] Visual Studio
  • [ ] Eclipse IDE
  • [ ] VSCode
  • [X] When compiling the compiler flag "-Wall -Wformat-security -Werror=format-security" was used

mendell27 avatar Sep 07 '22 17:09 mendell27

Please use the target instead of board in the newly added cmake commands to transition nicely with https://github.com/oneapi-src/oneAPI-samples/pull/1111

yuguen avatar Sep 30 '22 07:09 yuguen

Please use the target instead of board in the newly added cmake commands to transition nicely with #1111

I don't think #1111 is correct yet. -target isn't an optional accepted by aoc.

mendell27 avatar Oct 03 '22 12:10 mendell27

Please use the target instead of board in the newly added cmake commands to transition nicely with #1111

I don't think #1111 is correct yet. -target isn't an optional accepted by aoc.

I have been told -target is now supported. Changes made for 1111

mendell27 avatar Oct 03 '22 15:10 mendell27

Please use the target instead of board in the newly added cmake commands to transition nicely with #1111

I'm not going to make those changes. They are complicated and Ajay is working on them.

mendell27 avatar Oct 06 '22 13:10 mendell27

Ok, we'll fix these afterwards then - just need passing regtests on Linux and Windows for me to merge

yuguen avatar Oct 06 '22 13:10 yuguen

Ok, we'll fix these afterwards then - just need passing regtests on Linux and Windows for me to merge

It is a little more complicated. It needs some other changes from dpcpp -> icpx -fsycl as well, which I am not doing. Don't merge yet

mendell27 avatar Oct 06 '22 14:10 mendell27

I am doing the dpcpp -> icpx -fsycl change, so I'll update my PR with these changes as well if this gets merged before the icpx change

yuguen avatar Oct 06 '22 14:10 yuguen

I am doing the dpcpp -> icpx -fsycl change, so I'll update my PR with these changes as well if this gets merged before the icpx change

I need to fix the actual regtests too, so please wait until I am ready. I have the PRs going...

mendell27 avatar Oct 06 '22 14:10 mendell27

I am doing the dpcpp -> icpx -fsycl change, so I'll update my PR with these changes as well if this gets merged before the icpx change

I need to fix the actual regtests too, so please wait until I am ready. I have the PRs going...

I have now checked in the changes for the regtests for these. This can either be merged and Ajay's change for FPGA_DEVICE can include the new simulator sections in his change (or it can be done later), or I can wait for his change and then update my PR before a merge

mendell27 avatar Oct 06 '22 15:10 mendell27

I think that Ajay's change is about to be ready, so let's wait for that, run your regression tests and merge it

yuguen avatar Oct 07 '22 08:10 yuguen

https://github.com/oneapi-src/oneAPI-samples/pull/1111 has now been merged

yuguen avatar Oct 07 '22 12:10 yuguen

@mendell27 This changelist was used as an example to all the other code samples that will have to be modified. Many of us have hit the exact same issues as you have. Thank you for continuing to figure them out.

@yuguen-intel My work on updating the memory team's code samples is paused until a merged example is provided. I'm sure other teams have similar experiences.

artemrad avatar Oct 11 '22 16:10 artemrad

@yuguen-intel All 3 tests now pass reg_exe --flow=simulation. Please approve & merge

mendell27 avatar Oct 12 '22 14:10 mendell27

@yuguen-intel All 3 tests now pass reg_exe --flow=simulation. Please approve & merge

Can you please provide link to successful runs, for the rest of us to reference.

artemrad avatar Oct 12 '22 15:10 artemrad

@yuguen-intel All 3 tests now pass reg_exe --flow=simulation. Please approve & merge

Can you please provide link to successful runs, for the rest of us to reference.

I ran them manually on my /tmp Stella using this command: arc shell perl/5.8.8 regutils/22.2/4 testutils/22.2/94 sycl/trunk/[qualified=1] aclsycltest/2023.1 rocket/main/20220930.1585 hldregutil/main/20220930.1585 hld_regtest_files/main/20220930.1599 acdskit/22.3/104 gcc/7.4.0/2 -- reg_exe --flow=simulator --localr --repo-user=mendell27 --repo-branch=add_simulator

mendell27 avatar Oct 12 '22 18:10 mendell27

This is still pending windows regtests for me to merge the change

yuguen avatar Oct 13 '22 06:10 yuguen

This is still pending windows regtests for me to merge the change

This now successfully runs the windows regtests. Please merge.

mendell27 avatar Oct 19 '22 16:10 mendell27