gowin_pack: fix PLLA _default_plla_inattrs integer type mismatch#492
Conversation
nextpnr-0.9 stable reads {device}.pickle (gzip+pickle format) from the
installed apycula package via importlib.resources. The package was
previously shipping only *.msgpack.xz, breaking the stable toolchain
CI test with FileNotFoundError.
Fix: after saving the msgpack, also write apycula/{device}.pickle
(gzip-compressed pickle of the Device dataclass) when using the default
output path. Add *.pickle to setup.py package_data so it is included in
the wheel. Update Makefile clean target to also remove *.pickle.
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
|
As for the PLL, no questions there—I was already planning to merge it, but what's the point of messing around with pickle when the nextpnr 0.10 release won't read them anyway? |
|
Sorry I wasn't sure if it was something that was for legacy releases or to remove it to pass the build. Would you like me to revert that commit? |
Yes, that would be great. |
|
Awesome. I'll do that now. Thank you for your hard work, I'm planning on releasing a new ISA on the Tang Primer 25k and having an open source toolchain is invaluable. |
This reverts commit 93d2d04.
fix: GW5A PLLA default attrs — change int literals to binary strings in _default_plla_inattrs
Problem
When packing a GW5A bitstream with any PLLA primitive,
set_pll_attrs()raises a
TypeErrorbecause_default_plla_inattrscontains Pythonintvalues(
0, 1) for ~40 keys, but the function callsint(val, 2)` throughout — which requires a string argument.TypeError: int() can't convert non-string with explicit base
This affects any design targeting GW5A-LV25 (Tang Primer 25K) or similar GW5A
devices that use PLLA (not rPLL, which is used on GW1N/GW2A).
Fix
Change all bare
0and1integer literals in_default_plla_inattrsto thebinary string equivalents
'0'and'1'. The dictionary already uses stringsfor all other value types (e.g.
'TRUE','INTERNAL','100.00'), so this makes the dict consistent.No logic changes — purely a type correction in the default attribute table.
Tested on
GW5A-LV25MG121NES(Engineering Sample)gowin_pack -d GW5A-25A --sspi_as_gpio ...