Check the current status of the GIT repository.
steve@Desktop:~/projects/zedboard_leds_switches$ git status
On branch master
Your branch is up-to-date with 'origin/master'.
Changes to be committed:
(use "git restore --staged ..." to unstage)
new file: .gitignore
deleted: fw/src/script/post_bit.tcl
deleted: fw/system_wrapper.xsa
Changes not staged for commit:
(use "git add ..." to update what will be committed)
(use "git restore ..." to discard changes in working directory)
modified: fw/project.txt
modified: fw/src/design/axi_identification.v
modified: fw/src/diagram/system/hdl/system_wrapper.sv
modified: fw/src/diagram/system/system.bd
modified: fw/src/script/pre_synth.tcl
Examine the last log entry for the GIT repository.
steve@Desktop:~/projects/zedboard_leds_switches$ git log -1
commit 42e2ca1aceecb80a55942e7540060b3a1b75d17f (HEAD -> master, tag: v3.0, origin/master, origin/HEAD)
Author: Steve Haywood <steve@spacewire.co.uk>
Date: Sun Jan 16 12:48:44 2022 +0000
Added AXI Identification to the design.
Run synthesis to see what values are placed in the identification parameters by the pre_synth TCL script. Click on
Run Synthesis under the
SYNTHESIS heading inside the
Flow Navigator section.
Examine the
Log tab at the bottom of the
Vivado cockpit window, scrolling down a little to see the parameter report.
The
id_timestamp &
id_hash are as shown in the log of the last GIT commit. The
id_version is as entered in the project.txt file but is appended with
(unstaged) to illustrate the bitstream will NOT be produced from files committed in the local repository.
Commit the files.
steve@Desktop:~/projects/zedboard_leds_switches$ git commit -am "Updated Firmware Identification fields to use static information from GIT"
steve@Desktop:~/projects/zedboard_leds_switches$ git tag -a v4.0 -m "ZYNQ, GPIO, Register Bank & Identification (timestamp & hash from GIT)"
Rerun GIT status & log.
steve@Desktop:~/projects/zedboard_leds_switches$ git status
On branch master
Your branch is ahead of 'origin/master' by 1 commit.
(use "git push" to publish your local commits)
nothing to commit, working tree clean
steve@Desktop:~/projects/zedboard_leds_switches$ git log -1
commit cc42e7ba8be329a22b17f7a78f3d28d9784f59a0 (HEAD -> master, tag: v4.0)
Author: Steve Haywood <steve@spacewire.co.uk>
Date: Sun Oct 23 09:25:16 2022 +0100
Updated Firmware Identification fields to use static information from GIT
Reset the synthesis run by right clicking on
Run Synthesis under
SYNTHESIS and selecting
Reset Synthesis Run,.
Run synthesis again.
Examine the
Log tab again.
The
id_timestamp &
id_hash are as shown in the log of the last GIT commit (now updated). The
id_version is as entered in the project.txt file but is appended with
(unpushed) to illustrate the bitstream will NOT be produced from files pushed to the remote repository.
Push the files to the remote repository.
steve@Desktop:~/projects/zedboard_leds_switches$ git push
Again, reset the synthesis run, run the synthesis and check the parameter report in the log tab.
Bingo! The
id_timestamp &
id_hash are as shown in the log of the last GIT commit. The
id_version is as entered in the project.txt and is clean (no appended text) illustrating the bitstream will be produced from source safely held in the remote repository.
A generated bitstream (.bit) contains a 112 byte header that contains various pieces of dynamic information such as the build timestamp. A secondary bitstream (.bin) file can also be created that doesn't contain this header. To enable the creatation of the alternative bitstream navigate
Tools »
Settings... from the main menu and select
Bitstream under
Project Settings. Check the
-bin_file option and click
OK to commit the changes.
Generate the programmable logic bitstream by clicking on
Generate Bitstream under the
PROGRAM AND DEBUG heading inside the
Flow Navigator section.
Obtain the checksum of the bitstream by using either system_wrapper.bit (less the header) or system_wrapper.bin.
steve@Desktop:~/projects/zedboard_leds_switches$ dd if=fw/vivado/project.runs/impl_1/system_wrapper.bit skip=112 bs=512 iflag=skip_bytes | md5sum
7901+1 records in
7901+1 records out
4045564 bytes (4.0 MB, 3.9 MiB) copied, 0.00829275 s, 488 MB/s
aa330b5b405de83453b6bdb36abf8197 -
steve@Desktop:~/projects/zedboard_leds_switches$ md5sum fw/vivado/project.runs/impl_1/system_wrapper.bin
aa330b5b405de83453b6bdb36abf8197 fw/vivado/project.runs/impl_1/system_wrapper.bin
Quit Vivado and delete (or rename) the project folder.
steve@Desktop:~/projects/zedboard_leds_switches$ cd ..
steve@Desktop:~/projects$ rm -rf zedboard_leds_switches
Clone the GIT repository of the project, checkout the version as shown by the hash held in the Firmware and rebuilt the project from scratch. The hardware platform is automatically exported by the build script after the bitstream is generated.
steve@Desktop:~/projects$ git clone git@192.168.2.20:zedboard_leds_switches.git
steve@Desktop:~/projects$ cd zedboard_leds_switches
steve@Desktop:~/projects/zedboard_leds_switches$ git checkout cc42e7ba8be329a22b17f7a78f3d28d9784f59a0
steve@Desktop:~/projects/zedboard_leds_switches$ create_vivado_project.sh build
Obtain the checksum of the bitstream by using system_wrapper.bit (less the header).
steve@Desktop:~/projects/zedboard_leds_switches$ dd if=fw/vivado/project.runs/impl_1/system_wrapper.bit skip=112 bs=512 iflag=skip_bytes | md5sum
7901+1 records in
7901+1 records out
4045564 bytes (4.0 MB, 3.9 MiB) copied, 0.00829275 s, 488 MB/s
aa330b5b405de83453b6bdb36abf8197 -
Lovely Jubbly! The bitstreams from the previous build and the new build are identical.