I have a project for which I would like to generate multiple versions of the same design differing *only* in the firmware loaded into SRAM. I obviously don't want to have to do a full recompile for each version, but it seems oddly difficult to make it happen.
quartus_cpf appears to have a command that does exactly what I'm looking for:
To update embedded memory block data in a SOF, specify the
Memory Initialization File (.mif) with the data for the
embedded memory block and its Address Mapping Information File (.amif),
along with the original SRAM Object File (.sof) file name and the
desired updated .sof file name.
quartus_cpf --update_emb <input_mif_file> <input_amif_file> <input_sof_file> <output_sof_file>
However, I have not been able to find any documentation at all about how to generate said .amif file, which I am guessing contains the metadata for quartus_cpf to know which bits correspond to the contents of the memory in question.
The section option, which seems far more tedious, is to create a new temporary revision of the project using quartus_cdb create_revision -based_on -copy_results and then --update_mif, but for the flow to work in any kind of sensible way, it has to be able to use a different .mif file (dynamically swapping out the .mif file in the filesystem would be a nightmare to get right in all cases), but the pathname to the .mif file is embedded in the database; so it would have to be changed/overridden without triggering a recompile. I thought manipulating parameters in quartus_cdb might be able to do it, but no matter what I have tried I have not been able to find any parameters whatsoever using get_all_parameters, get_parameters, etc; and so I have still no idea what I would even need to modify, how to do it, and whether or not it would avoid the recompile.
Many thanks for any hints.
There have been some suggestions on the net to generate the RAM blocks in HDL and then replace the .mif files directly in the database directory. This, presumably, would work, although is perhaps more than a bit cantankerous?
I am using a Cyclone IV E.
I ended up handling this for now at least by making a hard-link copy (cp -al) of the database, .qsf and .qpf files into another directory, and putting the replacement .mif files in the corresponding relative path location inside that other directory. After that, quartus_cdb --update_mif does what one would like.
It is very clumsy but it works.