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

Add vitis rules for HLS. #124

Open
wants to merge 3 commits into
base: main
Choose a base branch
from
Open

Conversation

stridge-cruxml
Copy link
Collaborator

@stridge-cruxml stridge-cruxml commented Dec 13, 2022

This is the final port from rules_xilinx.

It adds support for vitis enabling verilog generation from cc. In particular it defines:

load("@rules_hdl//vitis:defs.bzl", "vitis_generate")

vitis_generate(
    name = "adder_vivado",
    out = "adder_vivado.tar.gz",
    clock_period = "10.0",
    tags = ["manual"],
    # Note need namespace with vivado_hls.
    top_func = "vitis::adder",
    use_vivado_hls = True,
    xilinx_env = ":xilinx_env_vivado.sh",
    deps = [":hls_adder_vivado"],
)

This will generate verilog from the cc definition.

Vitis defines a number of structures in cc (ap_fixed, hls_stream, etc). These are installed with vitis.
I have copied 2 different versions of these libraries here to allow code to build outside of vitis for testing purposes.
These are versions v2021_2 and v2020_1.

@stridge-cruxml
Copy link
Collaborator Author

Not sure what this message means: [_USERNAME -> $(commit.author.login)]: generic::invalid_argument: failed ParseJSONPath: author is not found.

Also gentle ping :)

@QuantamHD
Copy link
Collaborator

/gcbrun

@QuantamHD
Copy link
Collaborator

I also added you as a maintainer so you can merge things now.

Comment on lines +1 to +31
// 67d7842dbbe25473c3c32b93c0da8047785f30d78e8a024de1b57352245f9689
/*
#- (c) Copyright 2011-2019 Xilinx, Inc. All rights reserved.
#-
#- This file contains confidential and proprietary information
#- of Xilinx, Inc. and is protected under U.S. and
#- international copyright and other intellectual property
#- laws.
#-
#- DISCLAIMER
#- This disclaimer is not a license and does not grant any
#- rights to the materials distributed herewith. Except as
#- otherwise provided in a valid license issued to you by
#- Xilinx, and to the maximum extent permitted by applicable
#- law: (1) THESE MATERIALS ARE MADE AVAILABLE "AS IS" AND
#- WITH ALL FAULTS, AND XILINX HEREBY DISCLAIMS ALL WARRANTIES
#- AND CONDITIONS, EXPRESS, IMPLIED, OR STATUTORY, INCLUDING
#- BUT NOT LIMITED TO WARRANTIES OF MERCHANTABILITY, NON-
#- INFRINGEMENT, OR FITNESS FOR ANY PARTICULAR PURPOSE; and
#- (2) Xilinx shall not be liable (whether in contract or tort,
#- including negligence, or under any other theory of
#- liability) for any loss or damage of any kind or nature
#- related to, arising under or in connection with these
#- materials, including for any direct, or any indirect,
#- special, incidental, or consequential loss or damage
#- (including loss of data, profits, goodwill, or any type of
#- loss or damage suffered as a result of any action brought
#- by a third party) even if such damage or loss was
#- reasonably foreseeable or Xilinx had been advised of the
#- possibility of the same.
#-
Copy link
Collaborator

Choose a reason for hiding this comment

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

We can't add non-open source code to the repo.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Ok, this is an issue. Ill have to think about how I can point to a copy in vivado somehow.

This library is installed with vitis hls in a path like: Vitis_HLS/2021.2/include/ and all cc includes for hls come from there.
Maybe some .bazelrc setting or something.

Copy link
Collaborator

Choose a reason for hiding this comment

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

We could also explore adding it in a toolchain configuration. https://bazel.build/extending/toolchains

@QuantamHD
Copy link
Collaborator

This change is abnormally large, and might be causing some issues with Google Cloud build. I'll need to debug more.

@stridge-cruxml
Copy link
Collaborator Author

This change is abnormally large, and might be causing some issues with Google Cloud build. I'll need to debug more.

After i remove the cpp headers, it will be small

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.

3 participants