google / google/xls

FFI: Allow for out-of-band configuration

Open
#1,398 0 comments 0 reactions 0 assignees View on GitHub
enhancement ffi
Dominant language
C++
Stars
1.9k
Forks
283
Avg merge
2d 10h
Merged PRs (30d)
135

Description

Right now, FFI annotations are always given directly at the dslx function as annotation.

It migth be useful to have that in a separate configuration: just the function prototypes + corresponding FFI annotation. This would allow for separate configurations in experiments, different availability of vendor IP etc.

All the relevant information about the original function needs to be available (as all the variable and constant fields need to be available), so this probably means that the full function prototype. Things to look out fo

* Prototype might go out of sync, e.g. the original code adds a parameter so suddenly they don't match anymore. This should result in an an error when reading the prototype+annotation file complaining that there is no match
* Function parameter names might go out of sync, which should in the simple case be an error or in the more sophisticated implementation be allowed, but taking care of properly match the template parameters in the annotation on the prototype-side, but then matching that to the proper internal values in IR (not sure if 'sophisticated' is worth the trouble).

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.