Oddities of the yosys $macc cell. To all "losses" in modifications, add in your head the necessity of creating a v2 cell with compatibility wrapping of some kind.
Length of the factor length fields, known as variable num_bits in docs and code, is recorded in the CONFIG parameter and capped at effectively 15. We can set it to const 16 for example, simplifying CONFIG parsing.
Gains: simplifies from_cell, to_cell, simlib.v,
Losses: RTLIL becomes slightly less size efficient for $macc, which is typically an internal-only cell.
Second factors having zero length is special cased as if they were fed with a constant 1.
Gains: simplifies everything around macc
Losses: techmap limitations? Adds constant 1 whenever a simple unmultiplied addition is folded into $macc
The B port, also called bit_ports in struct Macc
, containts single bit unmultiplied summands and is equivalent and in the current codebase always considered equivalent. The optimize method of struct Macc
shows that it's preferred over having single bit summands be part of the A port.
Gains: simplifies everything around macc
Losses: techmap limitations? Same as above, plus harder to special case carry aware hardware?