rdaly525 / coreir

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

Avoid inlining concat nodes from mantle wires #949

Closed leonardt closed 4 years ago

leonardt commented 4 years ago

Follow up to https://github.com/rdaly525/coreir/pull/948 to handle the concat node case.

This improves the addPassthrough logic to avoid forcing the inlining of a generated mantle wire if the wire is driving an instance input and has multiple drivers. In the case of multiple drivers of an instance input, this will generate a concat node in verilog, and we would like to avoid having concat expressions in instance input statements.

We avoid having weird _$_U names by instead generating the mantle wire name based on the instance name + port name (generated from the select path). We add some safety logic to ensure it's a unique name to avoid name conflicts with existing instances.