YosysHQ / prjtrellis

Documenting the Lattice ECP5 bit-stream format.
Other
399 stars 87 forks source link

JEDEC file support #233

Open cr1901 opened 1 year ago

cr1901 commented 1 year ago

Some MachXO2 boards (e.g. the STEP-MXO2) have an on-board microcontroller which talks to the FPGA JTAG on the user's behalf. Sometimes, these microcontrollers only accepts Lattice-generated JEDEC files, not .bit or SVD files. So this PR implements JEDEC file generation. I'm marking as draft right now, b/c while the core works, some things are incomplete. However, I would appreciate feedback now that I have something working. I'm also happy to split this into multiple issues/PRs:

  1. For modifying config bits on MachXO2, Lattice's own official tools seem to like parsing JED files instead of SVFs. SVFs seem to be more of a side effect of JED generation/manipulation in Diamond Programmer.
gatecat commented 1 year ago

Sorry for the delay in getting back on this one!

ECP5 support

I don't think this is much interest personally right now, the few things that you can program with a .JED are OTP and so there's a pretty high risk of bricking parts while testing it...

Are there any objections to adding a package field to the textual format?

Yes, although I'd prefer this to be only generated for MachXO2/3 for now, so we don't have an unnecessary compatibility break for the much larger ECP5 user base.

My proposal is to add a .ufm_init/.ufm_start_page. field to the textual format, analogous to .ebr_init for Lattice compat with UFM_INIT_FILE_NAME, with maybe a command-line override to ecppack to change out the UFM image at packing time.

No objections

mmicko commented 1 year ago

@cr1901 and @gatecat Will probably start taking care of JED support since it is also needed for some XO2/3 features. @cr1901 Will let you know about progress

cr1901 commented 1 year ago

@mmicko I already implemented JED support in the PR, so feel free to add to it if you wish.