cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
fpgatanaka
Observer
Observer
451 Views
Registered: ‎04-17-2019

flipflop init value in bitstream file

I want to chane the flipflop init value quickly.

Therefore I aim to change the flipflop init value by editting the bitstream file directly.

 

But I don't understand how to change the flipflop init value in the bitstream file.

 

Is it possible to change the flipflop init value by editting bitstream file directly?

 

And I want to know the struture of bitstream.

0 Kudos
Reply
4 Replies
u4223374
Advisor
Advisor
432 Views
Registered: ‎04-26-2015

Xilinx (a) doesn't tell anyone the structure of their bitstream, and (b) doesn't tell anyone how to generate the checksum that is used to verify correctness of their bitstream.

 

If you store the value in block RAM, then (with some work) the tools can update that without having to rebuild the whole bitstream - see here:

 

https://forums.xilinx.com/t5/Adaptable-Advantage-Blog/MicroZed-Chronicles-Updating-Block-RAM/ba-p/1018720

 

Tags (2)
0 Kudos
Reply
avrumw
Guide
Guide
370 Views
Registered: ‎01-23-2009

The flip-flop INIT value is a property of the slice flip-flop. While there is no mechanism to change it in the bitstream directly, you can come close.

The fully routed .dcp file is the "final" representation of the design - this contains all the information required to generate the bitstream; the "write_bitstream" command merely takes the information from the routed design and formats it properly to be a bistream.

While you can't edit the bitstream, it is very easy to open the _routed.dcp file, change the INIT property of a particular flip-flop (or bunch of flip-flops) - you have the complete Tcl language available here to help you - and then save the new, modified .dcp file and/or write out a bitstream with the modified information.

Avrum

fpgatanaka
Observer
Observer
334 Views
Registered: ‎04-17-2019

@avrumw
Thank you. I tried it immediately.

By opening the "_routed.dcp" file, I changed the flip-flop INIT value and updated the bitstream file.


In this method, I can update the bitstream file quickly without re-implementation.


I want to update the bitstream by this method as fast as possible.


Is there anything I can do to make it even faster?

0 Kudos
Reply
avrumw
Guide
Guide
312 Views
Registered: ‎01-23-2009

Is there anything I can do to make it even faster?

There is no different method of doing this that I know of - the compute time required (reading the .dcp and writing the .bit are both somewhat compute intensive processes). The only thing I can point out is that you can script this - you can write a Tcl script that takes in the name of the .dcp file, and some information about what values you want to change, that then runs the complete process. This can be done from a single command line
 
vivado -mode tcl -source change_init.tcl -tclargs <name_of_module> <list_of_init_values>
 
(The format of the list of init values will have to be determined by you - I don't know if its just one vector you want to change, or a whole bunch of values scattered throughout the design).
 
The script can run without user intervention to do the steps we outlined - open the .dcp file, change the init values, write the bitstream and exit.
Avrum
0 Kudos
Reply