rdaly525 / coreir

BSD 3-Clause "New" or "Revised" License
100 stars 24 forks source link

[verilog] Simplify instance input connection logic #936

Closed leonardt closed 4 years ago

leonardt commented 4 years ago

This improves the input connection logic for instance statements to use an existing identifier if it's the sole driver of an input. This avoids having to emit an input wire for all instance inputs (this was leading to a code size explosion compared to the old logic which would just directly insert the driver's identifier). We avoid the inlining issue by marking the driver as blacklisted from inlining (the original reason we introduced these inputs wires was so we could mark them as blacklisted so expressions weren't inlined into the instance statement for tool compatability, but now we can just mark the driver instead of emitting a new wire).

This should reduce the code size explosion, since now we'll only introduce an input wire if we encounter a non-identifier driver (e.g. a concat for a non-bulk connection, or assignments to the input wire for elements of a unpacked array). This will be particularly good for the non-inline case where all we were doing was introducing extra wires (since inlining wasn't being run, the inline expressions issue isn't a problem).