-
Notifications
You must be signed in to change notification settings - Fork 237
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
"Late generators" to generate toplevel #250
Comments
Even if you resolved the dependencies first, it's not clear how fusesoc would know to pass the required information to the generator. I think the simplest solution would be to just use the fusesoc package inside the generator to parse the core file and find the config file. Recursive fusesoc all the way down! More generally this is the issue that the chisel people were trying to solve with Diplomacy. It would be good for fusesoc to have a compatible mechanism for cores to pass parameters to parent generators. |
How about if a core had a 'back_parameters' property? If a generator has a dependency on a core with a 'back_parameters' property then those parameters are passed to the generate executable. |
The dependency list is actually resolved by the time the generators are executed. There's also a new (since 1.9.1) parameter called |
An implementation we use in OpenTitan is at lowRISC@d97a348. Needs to be prepared for a PR once all dependencies are in. |
Looking at it today I see several potential ways to fix this, but it depends a bit on what information we have and need. If this would operate with the EDAM file as both input and output, it would actually be better suited to be implemented as a node in the next-gen Edalize https://github.com/olofk/edalize/wiki/Edalize-(Slight-return) At the same time, this is a bit further ahead in the future. So what could we do in the context of FuseSoC instead? We need to hook in at the point where the EDAM is completely created and we know all cores, right? This is normally after the top-level core has been analyzed But not always, since we can have genetarors with |
I'd like to use a generator to build our toplevel file. We have the following setup:
Step (ii), getting the config file for a core is easy: just add the config file as type=data source file to the *.core file.
Step (i) is the tricky one. Ideally, I'd get a list of resolved dependencies from fusesoc, look up the "vendor:ip:uart" name there, and go from there. AFAIK, that's currently not possible: generators run and create a *.core file and other generated source code files before the dependency tree is resolved.
So what I'm looking for is a generator that (a) generates its core file during the dependency tree building, and (b) again after the dependency tree is resolved to generate the SystemVerilog toplevel file.
Is there another (easier?) way of doing that? Otherwise I think this feature might be easy to add: just call the generator script twice with a parameter in which phase it is called.
@olofk @benreynwar any thoughts or ideas?
The text was updated successfully, but these errors were encountered: