Closed sequencer closed 6 days ago
Good question but unfortunately SV spec doesn't allow that. Verilator will cause a compile error (and VCS emits a warning that "it might incorrectly compile"). If you import DPI functions with a same function name, the input types must be exactly same in System Verlog level.
We need to define b
as an open array in that case and it's not added yet :)
That’s a sad story. I think I have to duplicate that now. Thanks for your answer!
Think about this case:
some_func
in these two different module should be lowered to a same function, despiteA.b
andB.b
has different types:However firtool will complain:
related code here: https://github.com/llvm/circt/blob/90954e2ae8cd7c230755e83754a87af52bfb8a6e/lib/Dialect/FIRRTL/Transforms/LowerDPI.cpp#L146
This is used to dedup DPI-C functions, e.g. DPI call from different AXI agents, but with different datawidth. The payload type in each might be different, but they can still dedup.