UPGRADE YOUR BROWSER

We have detected your current browser version is not the latest one. Xilinx.com uses the latest web technologies to bring you the best online experience possible. Please upgrade to a Xilinx.com supported browser:Chrome, Firefox, Internet Explorer 11, Safari. Thank you!

cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Contributor
Contributor
10,506 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
1 Solution

Accepted Solutions
Observer rik.visser
Observer
19,644 Views
Registered: ‎11-27-2012

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

Jump to solution

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.

2 Replies
Observer rik.visser
Observer
19,645 Views
Registered: ‎11-27-2012

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

Jump to solution

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.

Contributor
Contributor
10,425 Views
Registered: ‎09-15-2008

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

Jump to solution

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

0 Kudos