jbush001 / NyuziProcessor

GPGPU microprocessor architecture
Apache License 2.0
1.97k stars 349 forks source link

Support active serial bitstream for DE2-115 board #156

Open jbush001 opened 6 years ago

jbush001 commented 6 years ago

Currently, the synthesize and program targets for the DE2-115 board only support JTAG mode, generating a .sof (SRAM Object File) file and loading it using quartus_pgm. This is only stored as long as the board has power and need to be reloaded every time the board is powered on. Adding active serial mode would allow the bitstream to be persistent on the board, which is handy for software testing.

Modify to generate a .pof (programmer object file) file in addition to the .sof file and add a target to load this onto the board instead.

jbush001 commented 6 years ago

Section 2-16, 2-22: https://www.altera.com/content/dam/altera-www/global/en_US/pdfs/literature/manual/tclscriptrefmnl.pdf

To convert SOF to POF, use quartus_cpf (convert programming file):

quartus_cpf -c -d <config_device_name> <input_sof_file> <output_pof_file>

The config_device_name presumably refers to the chip that loads the bitstream. I can't find documentation that lists exactly what this parameter should contain, but it seems to work if I specify EPCS64 (it returns an error if I try other values like the FPGA part number EP4CE115F29C7).

jbush001 commented 6 years ago

This page suggests EPCS64 is the correct parameter: https://www.altera.com/content/dam/altera-www/global/en_US/pdfs/literature/hb/cfg/cyc_c51014.pdf

jbush001 commented 6 years ago

It would successfully erase the part, but would return strange errors while trying to program like: "unexpected error in JTAG server: error code 127" and "can't access JTAG chain." The documentation is fairly scant for the command line tools.

jbush001 commented 6 years ago

I tried using the GUI tool to flash one of the pre-built images from the CD image that comes with the board. It got to 4% and the failed in the same way. This suggests it isn't an issue with the quartus_cpf tool specifically:

screen shot 2018-03-07 at 6 52 48 pm