I am writing a Makefile for Lattice Diamond and have come as far as to cover all steps from synthesis to bitfile.

To program the FPGA (a MachXO3L in my case) I looked for a command line tool, and found pgrcmd.exe in the bin folder of Lattice Diamond. However this tool demands a XCF file as input. I cannot figure out how to generate this XCF file from the command line at all.

I was able to create a XCF file from the Lattice Diamond GUI. but can't spot any log message which shows what command was run to achieve this. But I don't want to manually generate that file from the GUI every time I need it.
On a sidenote, the documentation for Lattice Diamond command line tools is just ghastly and full of errors and omissions.

Is there any way to generate the XCF file from the command line at all?


1 Answer 1


The xcf file is a configuration file that does not change with the image. Rather, it has a pointer to the image file (.jed, for example). So, you can generate it once using the Lattice programmer, then commit it in your version control system and just leave it there, and it should work fine with your scripted environment.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.