Skip to content

Commit

Permalink
[util,otp] Make OTP Image MEM lines deterministic
Browse files Browse the repository at this point in the history
Sorts the set of word annotations for a MEM line in the OTP image, such
that the MEM line being read by Vivado is the same, but the word
annotations always appear in the same order, making the builds
deterministic. Previously, usage of python's sets meant that for
MEM lines with multiple word attributes, they could appear in different
orders between builds, causing bitstream splice reruns where not
necessary.

Signed-off-by: Alex Jones <[email protected]>
  • Loading branch information
AlexJones0 committed Jan 9, 2025
1 parent 90e0dd4 commit 20c4fb3
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion util/design/lib/OtpMemImg.py
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@ def _to_memfile_with_ecc(data, annotation, config,
# count ECC bits. In a comment, we also include any annotations
# associated with the word.
line = '@{:06x} {} // {}'.format(i_word, word_hex,
', '.join(word_annotations))
', '.join(sorted(word_annotations)))
mem_lines.append(line)

log.info('Done.')
Expand Down

0 comments on commit 20c4fb3

Please sign in to comment.