Skip to content

Conversation

plaes
Copy link

@plaes plaes commented Oct 7, 2025

Add basic MULT cell inferencing to gowin backend for gw1n and gw2a families.
It would be helpful if someone could verify this properly on real FPGA as well (haven't yet figured out how to properly build a real life "test" for it..).

This was motivated by missing MULT18X18 support for gw2a family which was discovered when attempting to synthesize this project: https://github.com/ryomuk/TangNanoDCJ11MEM/tree/main/hdl/unix

Tests have been added, but need some scrutiny.. ;)

@Ravenslofty Ravenslofty self-assigned this Oct 8, 2025
@plaes
Copy link
Author

plaes commented Oct 8, 2025

It seems that there's still some work to be done somewhere (nextpnr?) to populate clocks and other required signals, as I'm getting following error whenever I actually try to run nextpnr on synthesized data:

#7  0x0000000000418fb4 in nextpnr_himbaechel::dict<nextpnr_himbaechel::BelId, nextpnr_himbaechel::(anonymous namespace)::GowinImpl::dsp_net_counters, nextpnr_himbaechel::hash_ops<nextpnr_himbaechel::BelId> >::at (
    this=<optimized out>, key=...) at /home/plaes/code/nextpnr/common/kernel/hashlib.h:598
#8  0x00000000004dccde in nextpnr_himbaechel::(anonymous namespace)::GowinImpl::dsp_valid (this=0x6b84c0, l=..., bel_type=..., explain_invalid=false) at /home/plaes/code/nextpnr/himbaechel/uarch/gowin/gowin.cc:965
#9  nextpnr_himbaechel::(anonymous namespace)::GowinImpl::isBelLocationValid (this=0x6b84c0, bel=..., explain_invalid=<optimized out>) at /home/plaes/code/nextpnr/himbaechel/uarch/gowin/gowin.cc:719
#10 0x00000000005bbe28 in nextpnr_himbaechel::Arch::isBelLocationValid (explain_invalid=false, this=<optimized out>, bel=...) at /home/plaes/code/nextpnr/himbaechel/arch.h:689
#11 nextpnr_himbaechel::HeAPPlacer::legalise_placement_strict(bool) [clone .constprop.0] (this=0x7fffffffbc10, require_validity=true) at /home/plaes/code/nextpnr/common/place/placer_heap.cc:1099
#12 0x00000000005b614b in nextpnr_himbaechel::HeAPPlacer::place (this=0x7fffffffbc10) at /home/plaes/code/nextpnr/common/place/placer_heap.cc:266
#13 0x0000000000461658 in nextpnr_himbaechel::placer_heap (ctx=0x6b6cc0, cfg=...) at /home/plaes/code/nextpnr/common/place/placer_heap.cc:1850
#14 nextpnr_himbaechel::Arch::place (this=0x6b6cc0) at /home/plaes/code/nextpnr/himbaechel/arch.cc:217
#15 0x0000000000441a61 in nextpnr_himbaechel::CommandHandler::executeMain (this=0x7fffffffc630, ctx=...) at /home/plaes/code/nextpnr/common/kernel/command.cc:675
#16 nextpnr_himbaechel::CommandHandler::exec (this=0x7fffffffc630) at /home/plaes/code/nextpnr/common/kernel/command.cc:760
#17 main (argc=<optimized out>, argv=<optimized out>) at /home/plaes/code/nextpnr/himbaechel/main.cc:105

Apparently I was doing some stupid things in the "testbench" I was working with (dsp-mul36x36 in apicula examples), where I tried to push 72 bits of data through a 64 bit wire.

@plaes
Copy link
Author

plaes commented Oct 9, 2025

In order to test the changes on real hardware, I tried modifying existing apicula dsp-mult36x36.v example (YosysHQ/apicula@b924897).
Unfortunately nextpnr just crashes when attempting to look up DSP blocks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants