Skip to content
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

Updating front-end code to accommodate Intel HLS and add library for … #206

Closed
wants to merge 12 commits into from

Conversation

JackXinhangGUO
Copy link

…compiling HLS code to bitstream for Intel FPGA

Description

Updated front-end code to accommodate Intel HLS and add library for compiling HLS code to bitstream for Intel FPGA

Problems

The Intel HLS option was not available for the user

Proposed Solutions

updated the code to allow users to choose a mode to output Intel HLS code in the command line, output source HLS as a file, or compile the HLS code to an Intel FPGA emulator .exe file. added library under harness/intel_oneapi to support DPC++ compilation for FPGA.

Copy link
Member

@chhzh123 chhzh123 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for contributing. It seems you're not using the included headers for now. I would suggest removing the intel_oneapi folder. Also, some test cases using ihls should be included. Please refer to this test file for details.

}, "Invalid mode"

if project is not None:
filename = f"{project}"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

filename is different from project. For example, users can specify the project as a nested folder test/out.prj.

if mode == "fpga_emulator":
result = subprocess.run(
[
f" icpx -fintelfpga -DFPGA_EMULATOR .//{filename} -o {filename}.exe"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use linux instruction. Also, how do you handle the non-emulator situations?

Comment on lines 198 to 204
elif mode == "source_file_only":
print(
f"Generated Intel HLS source file kernel.cpp has been created successfully in your current directory under '{filename}' folder."
)
print(
"mode has been set to source_file_only, the output will only be the souce intel HLS code"
)
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think we need this mode. Users can always access the source code from the built folder

Comment on lines 321 to 326
if platform.lower() != "ihls":
with open(f"{project}/host.cpp", "w", encoding="utf-8") as outfile:
outfile.write(self.host_code)
else:
print("Platform is intel HLS; skipping generation of host.cpp.")

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The host code is also set as empty. No need to skip the generation. Otherwise, you'd better change the name of kernel.cpp as this one has already contained both host and device code.

Comment on lines 667 to 672
if target == "ihls":
platform = "ihls"
elif target == "vitis_hls":
platform = "vitis_hls"
else:
platform = "vivado_hls"
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"vivado_hls" if target == "vhls" else target

@chhzh123
Copy link
Member

As the LLVM version has changed, this PR is no longer available. #277 implements the latest Intel HLS support.

@chhzh123 chhzh123 closed this Dec 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants