08-20-2018 08:27 AM
(N.B. I have initially posted that question on StackExchange: https://electronics.stackexchange.com/questions/391555/vivado-export-hardware-packs-unknown-bitstream).
I have a Vivado project (ARTY-Z7 Zynq board with PL modifications) linked to a PetaLinux project. Whenever we add a new feature in the PL, a new bitstream is generated and I import this new hardware in the PetaLinux project.
The bitstream is generated into proj/proj.runs/impl_1/mybitstream.bit.
Now, I realized that the bitstream embedded in the BOOT.BIN file is not correct, but one from a previous generation. I check the generated .hdf in the exported directory (unzipped it), and the bitstream is not the one from proj.runs/impl_1 directory.
It is not a very big deal right now because we didn't add any new PL features so I can just manually copy the bitstream into my petalinux project before packaging the BOOT.BIN, but I'm afraid deeper modifications (e.g. adding a new BRAM module) will not reflect when importing the hardware description.
So, where does Vivado get its files to generate the hdf?
08-20-2018 12:24 PM
Here is what write_hwdef command Vivado documentation says:
The write_hwdef command is run after place_design and creates a hardware container file with .hwdef extension. The container file includes device metadata and hardware design files.
It means it uses post-place database inside <project_name>.runs/<implementation_run_name>.
One more option would be loading post-place .dcp file, and then running write_hdwef command to generate .hdf.
08-21-2018 01:26 PM
Thank you Evgeni, I can see the .hwdef file in proj.runs/impl_1, which contains all drivers and PS7 C files. It actually is exactly the exported .hdf, without the bitstream.
I am still puzzled though, where does the bitstream Vivado embeds in the .hdf. It is not the one in proj.runs/impl_1 (I checked the diff).
Now that my system upgraded to Ubuntu 18, petalinux is not working anymore so I will try and run some tests on a VM...
08-22-2018 01:30 PM
After a few tests, I see a proj.sysdef file generated in the impl_1 directory (where the correct bitstream is). This is the same content as the .hwdef and includes the bitstream, but it seems that file was not cleaned/regenerated and an old one was left.
I removed it and regenerated the bitstream in Vivado (which was quick) and a new, correct .sysdef file was there. The Export Hardware basically copies the .sysdef to .hdf.
Still not sure why that file was not removed before generating the bitstream in the first place, but I at least have a procedure to follow to guarantee my hardware files are up-to-date. Thanks for the pointers.