cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
nrclark
Contributor
Contributor
11,793 Views
Registered: ‎09-15-2008

Post-implement: Loading an ELF file and compressing the bitstream?

Jump to solution

I'm working on scripting our department's FPGA design flow.

 

We've got a design with a Microblaze in it, and I'd like to be able to decouple the Microblaze software development from the FPGA implementation flow (so that our software guys don't need to mess around with the FPGA implementation tools).

 

I've already got an automated flow up and running, and I also figured out how to use updatemem to add a .elf to an existing .bit file. Updatemem doesn't support bitstream compression, however. :( We're working on the Kintex Ultrascale KCU040, so compressing the bitstream makes a huge difference in the FPGA boot time.

 

Is it possible to add a .elf file post-implementation? Ideally, I'd love to be able to do something like the following:

 

1. Run Synthesis

2. Run Implementation and do a software export

3. (software team creates a .elf file)

4. Open the implemented design (or import some post-implement files into a new project)

5. Add the .elf file

6. Set BITSTREAM.GENERAL.COMPRESS and generate an updated .bit file (without reimplementing the design).

 

I'm pretty comfortable with TCL and shell scripting - anybody got some hints for the right sequence of commands?

 

0 Kudos
Reply
1 Solution

Accepted Solutions
rik.visser
Observer
Observer
20,931 Views
Registered: ‎11-27-2012

I use updatemem to update a compressed bitstream / .bin file since vivado 2014.4 in a non-project flow See the below tcl commands to update the bitstream.

 

 

set_property BITSTREAM.GENERAL.COMPRESS True [current_design]
# Available options: False, True Default: False
#write_bmm -force $filename_bd.bmm
write_mem_info -file $report_dir/mem_info.mmi
write_bitstream -force -bin_file $filename.bit 

update_mem -meminfo $report_dir/mem_info.mmi -data software1.elf -proc path/to/microblaze  -data software2.elf -proc $path/to/another/microblaze -bit $projectName.bit -out $projectName.bit -force
write_cfgmem -force -format BIN -interface SPIx4 -loadbit "up 0x0 $projectName.bit" $projectName.bin

 

Another option I used previously is to read and associate the .elf file and open the post_route.dcp, after that rerun write_bitstream and you get an updated bitstream. This took about a half an hour for my project. The method above about 10 mintues.

View solution in original post

2 Replies
rik.visser
Observer
Observer
20,932 Views
Registered: ‎11-27-2012

I use updatemem to update a compressed bitstream / .bin file since vivado 2014.4 in a non-project flow See the below tcl commands to update the bitstream.

 

 

set_property BITSTREAM.GENERAL.COMPRESS True [current_design]
# Available options: False, True Default: False
#write_bmm -force $filename_bd.bmm
write_mem_info -file $report_dir/mem_info.mmi
write_bitstream -force -bin_file $filename.bit 

update_mem -meminfo $report_dir/mem_info.mmi -data software1.elf -proc path/to/microblaze  -data software2.elf -proc $path/to/another/microblaze -bit $projectName.bit -out $projectName.bit -force
write_cfgmem -force -format BIN -interface SPIx4 -loadbit "up 0x0 $projectName.bit" $projectName.bin

 

Another option I used previously is to read and associate the .elf file and open the post_route.dcp, after that rerun write_bitstream and you get an updated bitstream. This took about a half an hour for my project. The method above about 10 mintues.

View solution in original post

nrclark
Contributor
Contributor
11,712 Views
Registered: ‎09-15-2008

Awesome! I didn't know that got added to updatemem. Thanks, rik.visser!

0 Kudos
Reply