-
Notifications
You must be signed in to change notification settings - Fork 299
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
[ESI][Runtime] Generate C++ header files for constants #7517
Conversation
0e1b7b3
to
f5a7f62
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Missing a test/check on the generated .h file. Would also make this PR a bit easier to review if there was something that one could inspect to see the output of the generator.
s = f""" | ||
/// Generated header for {system_name} module {module_info.name}. | ||
#pragma once | ||
#include "types.h" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Way too generic, and alias-prone. ESITypes.h
at a minimum. Ideally, there'd be some include path here (#include "ESI/types.h"
).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The idea is that users could choose the name of the folder in which to output the files. (e.g. ESI/
or <system-specific-name>/
) so the output file would be something like ESI/types.h
.
"--platform", | ||
type=str, | ||
help="Name of backend for live accelerator connection.") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
platform or backend? Seems like it's referring to backends, but maybe im misunderstanding the scope of backends/(platforms?).
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Backend ~= platform. Technically, a backend is a particular runtime implementation of an FPGA platform. I do expect a 1:1 mapping in most cases. I tend to refer to platform for anything user facing.
Start of static C++ header file generation. Just integer constants for now. Can work off of any manifest and will even connect to a live accelerator and read the manifest from there.
Generates a
types.h
file and one per module listed in the manifest. Inside the module header file, generates one class per module and adds the constants to that class. Puts everything in a namespace specified by the user assystem_name
.