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

Use SPIRV-Tools during flow #14

Open
krisjdev opened this issue Oct 12, 2024 · 1 comment
Open

Use SPIRV-Tools during flow #14

krisjdev opened this issue Oct 12, 2024 · 1 comment

Comments

@krisjdev
Copy link
Collaborator

KhronosGroup/SPIRV-Tools provides some helper utilities for SPIR-V, the majority of which only work on the binary form, but spirv-cfg generates a control flow visualisation diagram using GraphViz - this is similar to what is done by the compiler currently.

def generate_dot_graph(self, file_name_suffix: str = "", clean_nodes = None, dark_mode: bool = False):
""" Generates Graphviz dot graphs of the dataflow of a function. Requires the ``graphviz`` package.
Args:
file_name_suffix: String to append to the filename.
clean_nodes: List of clean/optimised nodes.
"""

The outputs of both Titan and spirv-cfg should (in theory) be identical, but differences may reveal issues in generating the nodes properly. Similarly, MaikKlein/rspirv-cfg may prove to be more useful, as it contains slightly more information about the program.


spirv-val validates the binary form of the given SPIR-V (which can be generated using spirv-as), but may be helpful in determining whether the SPIR-V assembly output of the program is correct and valid, so that it can be used with other SPIR-V capable hardware. This would provide some much needed testing for the outputs.


spirv-opt could potentially be useful to optimise a SPIR-V binary, then disassemble it using spirv-dis and generate SystemVerilog off of that.


The downside is that as of the time of writing this post, the majority of their tools are still listed as being in development, so it's probably worth returning to this at a later date.

@krisjdev
Copy link
Collaborator Author

krisjdev commented Oct 12, 2024

Testing SPIR-V may also be possible with keith2018/spvm, but it's also WIP. dfranx/SPIRV-VM could be a possible alternative?

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

No branches or pull requests

1 participant