YosysHQ / icestorm

Project IceStorm - Lattice iCE40 FPGAs Bitstream Documentation (Reverse Engineered)
ISC License
983 stars 224 forks source link

[SUGGESTION] Add support for Radiant-style names. #319

Open FavoritoHJS opened 10 months ago

FavoritoHJS commented 10 months ago

TLDR: Lattice Radiant uses different names than those shown in the Technology Library, breaking some projects.

Sorry if i'm raising this issue in the wrong project, but since this is a problem with Lattice's naming and not with anything else, I'm guessing this is the right place.

So, I was setting up a yosys-based build for the Commander X16 VERA when I noticed something odd:

ERROR: Module `\WARMBOOT' referenced in module `\top' in cell `\warmboot' is not part of the design.

This is slightly weird because in the ICE Technology Library, a near-identical module is under the name SB_WARMBOOT - in fact, changing this in the source fixes this error... and makes another appear:

ERROR: Module `\pmi_dsp' referenced in module `\mult_accum' in cell `\i_mult16x16' is not part of the design.

...which is not even close to ANYTHING in the library.

In desperation, I searched for "pmi_dsp" on the internets, finding a hit in a mirror of a "Migrating iCEcube2 Designs to Lattice Radiant 2.0 Software User Guide" document.

Not only did it say what this was, including its relation to the known SB_MAC16, it had a hint that more information was available in the software help. And you can download the software help over on Lattice's website, at https://www.latticesemi.com/products/designsoftwareandip/fpgaandlds/radiant, no registration required. (WARNING: might bind you to a shrink-wrap license including a non-reverse-engineering clause, see "You may not modify, reverse engineer, or disassemble any of the software[...]", if any lawyers are reading. The document doesn't contain this, however, just having a normal "don't copy, no warranty" disclaimer instead. I hate legalese.)

And indeed, over on chapters 16 and 17, this contains information about both pmi_dsp and the WARMBOOT primitive! I can only assume the powers that be decided to change the names up to "nicer" versions, even if it broke compatibility.

So, is cleaning up after Lattice's mess in scope for this project?

FavoritoHJS commented 10 months ago

further notes on cleaning up lattice's mess:

along with the different module names, it appears the constraint file format got changed from a custom PCF to a mixture of ldc, sdc, fdc and pdc... yay?