Xapp1232 Bitstream Id With Usr - Access
Xapp1232 Bitstream Id With Usr - Access
Summary
This application note describes a solution for bitstream identification that is accessible to the
FPGA user design. Instructions are provided for Vivado® Design Suite write_bitstream and for
access to the identification information using Vivado tools.
Introduction
Tracking bitstreams is useful for many applications, for example, identifying versions of a
particular design or having serial numbers to more complex situations such as tracking design
optimization implementation runs. It is possible to embed any form of static code into the
design, allowing limitless possibilities for the size or format of the version data. However, this
results in the need to recompile parts if not all of the entire design, which is tedious at best and
has its limitations. The USR_ACCESS register, present in all 7 series and UltraScale™ FPGAs,
provides the ability to embed version information into a 32-bit fabric-accessible register at the
bitstream generation phase, allowing you the best balance of flexibility with minimal impact to
the design and implementation time.
USR_ACCESS Primitive
The FPGA configuration logic includes a readable and writable 32-bit register called
USR_ACCESS, that is also directly accessible from the user design. The primitive names for the
USR_ACCESS registers are USR_ACCESSE2 in both 7 series and UltraScale devices (see Figure 1).
All further references to the primitives in this document are simplified as USR_ACCESS. This
component provides direct FPGA logic access to the 32-bit value stored by the FPGA bitstream.
For purposes of this document, the USR_ACCESS is considered a static value, although it can be
changed through the configuration interface, JTAG, or the internal configuration access port
(ICAP). The DATAVALID output port toggles when the USR_ACCESS register is updated from the
configuration interface. CFGCLK reflects the configuration clock. This dynamic writing
functionality is outside the scope of this application note. More information on writing to this
register dynamically can be found by searching for the register AXSS in the respective FPGA
family's configuration user guide:
865B$&&(66(
'$7$>@
&)*&/.
'$7$9$/,'
X1232_01_030515
Timestamp
The USR_ACCESS register can be configured with a 32-bit user-specified value or automatically
loaded by the bitstream generation command (write_bitstream) with a timestamp. The
user-specified value can be used for revision, design tracking, or serial number type
applications. The timestamp feature is useful when several implementation runs have been
performed, thereby changing design optimization values, but the source design itself is
unchanged. The timestamp value can then be compared to the timestamp for the bitstream file
to correlate the design in the device to one of the many possible sources. The timestamp
feature is not easily implemented by changing the source code. Implementing the USR_ACCESS
method provides a more accurate timestamp.
When no value or NONE is entered for this option, the behavior is to do nothing to this register,
which defaults to all 0s:
NONE - DEFAULT
When an 8-character hexadecimal value is detected, this value is entered into the USR_ACCESS
register:
0xXXXXXXXX
TIMESTAMP
write_bitstream inserts the current timestamp into the 32-bit USR_ACCESS register in this
format:
ddddd_MMMM_yyyyyy_hhhhh_mmmmmm_ssssss
(bit 31) ……………………………………………………… (bit 0)
Where:
When using the TIMESTAMP value, the minute and second values might not correspond directly
with the timestamp on the file. This occurs because the timestamp value is determined near the
beginning of the bitstream generation process, but the operating system file timestamp is at
the end of the file creation process. Therefore, depending on the speed of the machine and the
complexity of the operations required for write_bitstream, these values might not match exactly
with the file timestamp. Similarly, the same can occur if file generation is started close to the
end of the hour or day.
4. Enter an 8-digit hex value as shown in Figure 2 in the User Access field.
5. Replace the text abcd0123 with TIMESTAMP if the TIMESTAMP feature is desired.
Note: Not entering this option defaults to NONE, which leaves this register with all 0s.
6. Click OK.
7. Click Generate Bitstream.
8. Select Save. XDC is updated. Rerun Synthesis and Implementation.
X-Ref Target - Figure 2
X1232_02_030515
X1232_03_031715
To verify the USR_ACCESS register is set correctly using Tcl, use the get_property of device
REGISTER.USR_ACCESS:
See Figure 4.
X-Ref Target - Figure 4
X1232_04_031715
Conclusion
The USR_ACCESS feature is a method to track bitstreams for revisioning, or to track bitstreams
with specific implementation runs without requiring changes to source code or requiring
reimplementation.
• Artix®-7: USR_ACCESSE2
• Kintex®-7: USR_ACCESSE2
• Virtex®-7: USR_ACCESSE2
Library UNISIM;
use UNISIM.vcomponents.all;
USR_ACCESS_7series_inst : USR_ACCESSE2
port map (
CFGCLK => CFGCLK, -- Not utilized in the static use case in this application note
DATA => DATA, -- 32-bit output Configuration Data output
DATAVALID => DATAVALID -- Not utilized in the static use case in this application note
);
USR_ACCESSE2 USR_ACCESS_7series_inst (
CFGCLK(CFGCLK), // Not utilized in the static use case in this application note
DATA(DATA), // 32-bit output Configuration Data output
DATAVALID(DATAVALID) // Not utilized in the static use case in this application note
);
00110000000000011010000000000001 - 0x3001A001
The 32-bit value after that command is the USR_ACCESS register value. Details on the syntax to
read and write values through the configuration port can be found in the configuration details
chapter of the respective configuration user guide [Ref 1] or [Ref 2].
The following is an annotated section of a Kintex-7 device bitstream (in raw bit file [.rbt] format)
with a TIMESTAMP value.
00110000000000100010000000000001
00000000000000000000000000000000
00110000000000011010000000000001 • Type 1, write, address 01101, one word
01010101000111001111011001100001 • USR_ ACCESS value
00110000000000100110000000000001
00000000000000000000000000000000
Breaking down the 32-bit USR_ACCESS value results in a TIMESTAMP of 10/10/14 3:25:33 pm.
Where:
References
1. UltraScale Architecture Configuration User Guide (UG570)
2. 7 Series FPGAs Configuration User Guide (UG470)
Revision History
The following table shows the revision history for this document.