Skip to content

Commit d628c14

Browse files
mithrosbourdeauducq
authored andcommittedSep 27, 2015
Sort constants in csr generation.
Previously the order of constant output depended on Python's hashing order which changes every run. This caused the file to change every run. With this change the csr.h file will always be the same. This can be verified this with the following; ```bash CSR=software/include/generated/csr.h for i in 1 2 3 4 5 6; do rm -f $CSR; python make.py build-headers cp $CSR $CSR.$i done md5sum $CSR.* ```
1 parent 4fe0f60 commit d628c14

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed
 

Diff for: ‎make.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,7 @@ def _get_args():
167167
write_to_file(os.path.join(genhdir, "sdram_phy.h"), boilerplate + sdram_phy_header)
168168
mem_header = cpuif.get_mem_header(memory_regions, getattr(soc, "flash_boot_address", None))
169169
write_to_file(os.path.join(genhdir, "mem.h"), boilerplate + mem_header)
170-
csr_header = cpuif.get_csr_header(csr_regions, soc.get_constants())
170+
csr_header = cpuif.get_csr_header(csr_regions, sorted(soc.get_constants()))
171171
write_to_file(os.path.join(genhdir, "csr.h"), boilerplate + csr_header)
172172

173173
if actions["build-csr-csv"]:

0 commit comments

Comments
 (0)
Please sign in to comment.