llvm / circt

Circuit IR Compilers and Tools
https://circt.org
Other
1.64k stars 286 forks source link

[FIRRTL][ExportVerilog] Emit integers on DPI function as two state C-compatible types and clarify ABI #7163

Closed uenoku closed 3 months ago

uenoku commented 3 months ago

This PR modifies ExportVerilog to emit two state types (bit in general) for DPI import op. Furthermore, for specific bit width (8, 16, 32 and 64) it emits C-types (byte, shortint, int and longint).

This PR also rejects small integer types other than 8, 16, 32 and 64 bit width since otherwise we have to usebit but they are passed by references in DPI. So this PR defines the ABI as "small integers are passed by values, and larger integers are passed by references.