Repository navigation
Replies: 2 comments 9 replies
I have been debating a LUT postprocessing pass to handle things like this; you can use Shannon decomposition to infer these muxes from larger LUTs, and I think that might be the best way to go about this. |
|
I will close this discussion, so here are some conclusions, I will open separate issues as needed when I research them individually:
|
Uh oh!
There was an error while loading. Please reload this page.
Gowin FPGA synthesis does a poor job at mapping multiplexers.
ABC9 only maps to LUTs, so a 4->1 mux is mapped to LUT6 (4 data inputs, 2 select inputs), which consumes 4 LUT4 blocks.
A better mapping would be the vendor primitive MUX6, which consumes just 2 LUT4 blocks.
As I understand it, ABC9 wide LUT mapping can not achieve optimal multiplexer mapping.
While looking at the code this seems to be a common issue across most FPGA architectures, but I did not run any proper tests yet for architectures other than Gowin. If there is an architecture (maybe Xilinx 7 family) with better mapping I could use as reference please tell.
I tried to write
abc9_whiteboxcells for Gowin MUX* primitives, but I could not getabc9to use them.This are the reasons I suspect are behind failures during my attempts:
abc9_whiteboxcells incorrectly, so ABC does not recognize them, therefore ignoring them. In support of this theory would be an error telling the BOX cells have timing but no AIG model. But this error disappeared with the latest ABC9 update (abc-refactor-16).abc_whiteboxjust does not operate the the way I would wish it to, so it is unable to use MUX2/4/8/16/32 boxes during synthesis.In the case ABC should be able to use
abc_whiteboxMUX* models, could you suggest some debugging approaches? I have already extracted thesynth_gowinsteps, so I can add debug code (show,stat,ls) between lines. I did not do the same forabc9yet. I did look at theinput.boxfile, and it seems correct, but I do not know how to check if the AIG model for the MUX BOX was properly handled.I also wrote some
techmap$bmuxmapping files, but$bmuxare just not inferred in my RISC-V SoC design, I will probably try to map other$*muxand$shift*primitives.Adding @hexratcc and @Ravenslofty since they are currently working on ABC9 code. Adding @yrabbit since we recently shortly discussed this issue.
All reactions