-
Notifications
You must be signed in to change notification settings - Fork 225
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
icebin2nvcm: tool to generate .nvcm file from iCE40 .bin #272
base: master
Are you sure you want to change the base?
Conversation
Great tool! You might want to replace |
Thanks @djedditt. I have added the suggested change. |
I would like to add that I have programmed an NVCM generated in this fashion from @majbthrd 's fork and it worked as expected on a design with an iCE40 UP5K in the 30-ball WLSCP package. It would be very nice to have this feature merged into the main line. =) |
Thanks! With Diamond Programmer 3.12.1.454.2, trying to load a file for an iCE40UP5K target, I got the following error:
Adding a stub comment to the beginning of the NVCM file allowed Diamond to accept the file, and NVCM Program,Verify succeeded after that:
I think Diamond programmer is supposed to validate both the #DN and #PT fields, but it doesn't appear this is the case. I was also able to generate this higher up in the toolchain by adding the comment to my .asc file:
but it doesn't appear that nextpnr has a feature to do this automatically: |
Hi I would have add, line 31, ... len = 0; For new utilities like that, one has some examples using the C++ and the streams in https://github.com/ElecGeek/HealthMeter . It can be compiled directly on many plate-forms, using GCC8.5, and can handle files and paths names using GCC10 or more. There is a workflow example to compile and place the binaries in the artefact. |
I've tested this by verifying its output compares with pre-existing matching .bin and .nvcm files from Lattice tools. I've also been able to use the generated .nvcm with Lattice Diamond Programmer.
It should be obvious to anyone familiar with 25 series PROMs that the .nvcm is a text version of the SPI transactions to program the NVCM. Lattice's app note acknowledges that this is the case. Note that the page size is 8 bytes.
IMPORTANT: the NVCM is ONE-TIME PROGRAMMABLE!!! Just because it is programmable doesn't make it re-programmable.
Hopefully, this tool will enable yosys iCE40 users to generate .nvcm files. It might also help Lattice users who only have a .bin and need a .nvcm; the Lattice tools don't seem to provide such a conversion.