-
Notifications
You must be signed in to change notification settings - Fork 24
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 a Custom Name for CoreIR Generator When Generate Verilog #941
Comments
@rdaly525 Any update on this feature? I found the name is too long for some circumstances. |
There's a metadata field called Here's an example from the ice40 generator: Lines 19 to 20 in 7a81062
|
Thanks Lenny. It does not work for me. In the verilog generated from coreIR, the name of that module is not override by the |
Hmm that's odd, any chance you can link me to a branch or something where the code is written? Perhaps we're setting the metadata in the wrong place, let me review the code generation logic for generators, maybe it's different and ignoring the metadata field (the example I provided was just a module not a generator, so maybe it only works for modules) |
Yeah, I think the difference between module and generator may affect. I print out the meta-data in that instance and it's empty. |
@joyliu37 it looks like you are adding the verilog metadata to the instance instead of the module or generator. The following should add it to the generator
You could also try adding it to the generated module.
|
@rdaly525 Thanks for the suggestion. I try both way but none of them generate the corresponding name in verilog.
Is this correct? |
@joyliu37m that is still referencing an instance. Do you see the generator itself somewhere else in the json file? |
No. I only see those instances of memory tile in the json. Should I add the rungenerator passes while save the json? |
Maybe something like: buf->getModuleRef()->getMetaData()["verilog_name"] = "lake_"+genargs.at("ID")->get<string>(); could work? Basically get the module that the instance is of and set the metadata on it. |
It seems that if I dump the metadata in module or generator, the metadata will be lost when I save the top level into json. |
You could try doing it the way the binary does it. You get a handle to the verilog pass: https://github.com/rdaly525/coreir/blob/master/src/binary/coreir.cpp#L250-L251 |
You'll probably need to load the verilog libraries: https://github.com/rdaly525/coreir/blob/master/src/binary/coreir.cpp#L227-L229 There are also some passes you may need to run if you haven't already: https://github.com/rdaly525/coreir/blob/master/src/binary/coreir.cpp#L245-L247 |
Should work with #1016 |
I am using coreIR to generate a memory placeholder in RTL for further power analysis.
I want the RTL module which coreIR generator generated have the specific name matching with RTL implementation.
Currently the RTL module name is automatic generated from the
gen_arg
. For instance, my generated verilog have this wield name resulted from the type. https://github.com/dillonhuff/clockwork/blob/ef2d82ee46539c682c0f04263ece4b821def4da0/conv33_naive_compute.v#L118Could we have a function to set custom name for RTL generation?
The text was updated successfully, but these errors were encountered: