@:~$ xilinx Xilinx tools available tools at /opt/Xilinx :- 1) 2021.2 - Vivado - SDK - Vitis - PetaLinux 0) Exit Please select tools required or exit : 1 Tools are as follows :- vivado @ /opt/Xilinx/Vivado/2021.2/bin/vivado vitis @ /opt/Xilinx/Vitis/2021.2/bin/vitis petalinux-build @ /opt/Xilinx/PetaLinux/2021.2/tool/tools/common/petalinux/bin/petalinux-build
@:~$ cd @:$ git clone -b v3.0 https://bitbucket.org/spacewire_firmware/zedboard_leds_switches @:$ cd zedboard_leds_switches @:/zedboard_leds_switches$ create_vivado_project.sh
@:~$ cd @:$ git clone -b v9.0 https://bitbucket.org/spacewire_firmware/zedboard_linux
@:~$ cd /zedboard_leds_switches
@:/zedboard_leds_switches$ vivado -nojournal -nolog -notrace fw/vivado/project.xpr &
@:/zedboard_leds_switches$ subl fw/src/design/axi_identification.v
@:/zedboard_leds_switches$ wget https://spacewire.co.uk/tutorial/shared/repos/0018/zedboard_leds_switches/fw/src/design/axi_identification.v -O fw/src/design/axi_identification.v
@:/zedboard_leds_switches$ git difftool fw/src/design/axi_identification.v
The axi_identification_0 module in the block design should now show an extra input port called id_hash. Bring the new port out of the block design by right clicking on it and selecting Make External from the context menu. Rename the new external port to id_hash by removing the _0 from its name.
Verify the block design is error free by clicking on the Validate Design
icon. Once validated save the block design.
@:/zedboard_leds_switches$ subl fw/src/diagram/system/hdl/system_wrapper.sv
@:/zedboard_leds_switches$ wget https://spacewire.co.uk/tutorial/shared/repos/0018/zedboard_leds_switches/fw/src/diagram/system/hdl/system_wrapper.sv -O fw/src/diagram/system/hdl/system_wrapper.sv
@:/zedboard_leds_switches$ git difftool fw/src/diagram/system/hdl/system_wrapper.sv
@:/zedboard_leds_switches$ subl fw/project.txt
@:/zedboard_leds_switches$ wget https://spacewire.co.uk/tutorial/shared/repos/0018/zedboard_leds_switches/fw/project.txt -O fw/project.txt
@:/zedboard_leds_switches$ git difftool fw/project.txt
@:/zedboard_leds_switches$ subl fw/src/script/pre_synth.tcl
@:/zedboard_leds_switches$ wget https://spacewire.co.uk/tutorial/shared/repos/0018/zedboard_leds_switches/fw/src/script/pre_synth.tcl -O fw/src/script/pre_synth.tcl
@:/zedboard_leds_switches$ git difftool fw/src/script/pre_synth.tcl
@:/zedboard_leds_switches$ git rm fw/src/script/post_bit.tcl
@:/zedboard_leds_switches$ subl .gitignore
@:/zedboard_leds_switches$ wget https://spacewire.co.uk/tutorial/shared/repos/0018/zedboard_leds_switches/.gitignore -O .gitignore
@:/zedboard_leds_switches$ git rm fw/system_wrapper.xsa
@:/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 <file>..." 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 <file>..." to update what will be committed) (use "git restore <file>..." 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
@:/zedboard_leds_switches$ git log -1 commit 42e2ca1aceecb80a55942e7540060b3a1b75d17f (HEAD -> master, tag: v3.0, origin/master, origin/HEAD) Author: Steve Haywood <@spacewire.co.uk> Date: Sun Jan 16 12:48:44 2022 +0000 Added AXI Identification to the design.
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.
@:/zedboard_leds_switches$ git commit -am "Updated Firmware Identification fields to use static information from GIT." @:/zedboard_leds_switches$ git tag -a v4.0 -m "ZYNQ, GPIO, Register Bank & Identification (timestamp & hash from GIT)"
@:/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
@:/zedboard_leds_switches$ git log -1 commit cc42e7ba8be329a22b17f7a78f3d28d9784f59a0 (HEAD -> master, tag: v4.0) Author: Steve Haywood <@spacewire.co.uk> Date: Sun Oct 23 09:25:16 2022 +0100 Updated Firmware Identification fields to use static information from GIT
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.
@:/zedboard_leds_switches$ git push
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.
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.
@:/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 - @:/zedboard_leds_switches$ md5sum fw/vivado/project.runs/impl_1/system_wrapper.bin aa330b5b405de83453b6bdb36abf8197 fw/vivado/project.runs/impl_1/system_wrapper.bin
@:/zedboard_leds_switches$ cd .. @:$ rm -rf zedboard_leds_switches
@:$ git clone git@:zedboard_leds_switches.git @:$ cd zedboard_leds_switches @:/zedboard_leds_switches$ git checkout cc42e7ba8be329a22b17f7a78f3d28d9784f59a0 @:/zedboard_leds_switches$ create_vivado_project.sh build
@:/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 -
@:/zedboard_leds_switches$ cd /common
@:/common$ subl other/src/script/petalinux-build-id.sh
@:/common$ wget https://spacewire.co.uk/tutorial/shared/repos/0019/common/other/src/script/petalinux-build-id.sh -O other/src/script/petalinux-build-id.sh
@:/common$ chmod +x other/src/script/petalinux-build-id.sh
@:/common$ git status On branch master Your branch is up-to-date with 'origin/master'. Untracked files: (use "git add <file>..." to include in what will be committed) other/src/script/petalinux-build-id.sh nothing added to commit but untracked files present (use "git add" to track)
@:/common$ git add -A @:/common$ git commit -a -m "Added PetaLinux build script that updates the project information file with timestamp & hash." @:/common$ git push @:/common$ git tag -a v2.0 -m "Common files update" @:/common$ git push origin v2.0
Steve@:/common$ cd /zedboard_linux
@:/zedboard_linux$ subl os/petalinux/project-spec/meta-user/recipes-apps/website/files/project.txt
@:/zedboard_linux$ wget https://spacewire.co.uk/tutorial/shared/repos/0021/zedboard_linux/os/petalinux/project-spec/meta-user/recipes-apps/website/files/project.txt -O os/petalinux/project-spec/meta-user/recipes-apps/website/files/project.txt
@:/zedboard_linux$ subl os/petalinux/project-spec/meta-user/recipes-apps/website/website.bb
@:/zedboard_linux$ wget https://spacewire.co.uk/tutorial/shared/repos/0020/zedboard_linux/os/petalinux/project-spec/meta-user/recipes-apps/website/website.bb -O os/petalinux/project-spec/meta-user/recipes-apps/website/website.bb
@:/zedboard_linux$ git difftool os/petalinux/project-spec/meta-user/recipes-apps/website/website.bb
@:/zedboard_linux$ subl os/petalinux/project-spec/meta-user/recipes-apps/website/files/cgi-bin/index.cgi
@:/zedboard_linux$ wget https://spacewire.co.uk/tutorial/shared/repos/0020/zedboard_linux/os/petalinux/project-spec/meta-user/recipes-apps/website/files/cgi-bin/index.cgi -O os/petalinux/project-spec/meta-user/recipes-apps/website/files/cgi-bin/index.cgi
@:/zedboard_linux$ git difftool os/petalinux/project-spec/meta-user/recipes-apps/website/files/cgi-bin/index.cgi
@:/zedboard_linux$ subl os/petalinux/project-spec/meta-user/recipes-apps/website/files/uptime.js
@:/zedboard_linux$ wget https://spacewire.co.uk/tutorial/shared/repos/0020/zedboard_linux/os/petalinux/project-spec/meta-user/recipes-apps/website/files/uptime.js -O os/petalinux/project-spec/meta-user/recipes-apps/website/files/uptime.js
@:/zedboard_linux$ git difftool os/petalinux/project-spec/meta-user/recipes-apps/website/files/uptime.js
@:/zedboard_linux$ cd os/petalinux
@:/zedboard_linux/os/petalinux$ petalinux-config --get-hw-description ../../../zedboard_leds_switches/fw/system_wrapper.xsa
Select Ok to confirm the save.
Select Exit to continue.
Select Exit to exit the menu.
@:/common/os/petalinux$ git status On branch master Your branch is up-to-date with 'origin/master'. Changes not staged for commit: (use "git add <file>..." to update what will be committed) (use "git restore <file>..." to discard changes in working directory) modified: project-spec/meta-user/recipes-apps/website/files/cgi-bin/index.cgi modified: project-spec/meta-user/recipes-apps/website/files/uptime.js modified: project-spec/meta-user/recipes-apps/website/website.bb Untracked files: (use "git add <file>..." to include in what will be committed) project-spec/meta-user/recipes-apps/website/files/project.txt no changes added to commit (use "git add" and/or "git commit -a")
@:/zedboard_linux/os/petalinux$git add -A@:/zedboard_linux/os/petalinux$ git commit -a -m "Updated webpage to include PetaLinux ID table & add hash field to Firmware ID table." @:/zedboard_linux/os/petalinux$ git push @:/zedboard_linux/os/petalinux$ git tag -a v10.0 -m "PetaLinux, Peek/Poke, LED Runner, Webserver, Peek/Poke CGI, PL Access, Style Sheet, Register Bank & ID Strings (PetaLinux & Firmware hash) with XSA from zedboard_leds_switches v4.0" @:/zedboard_linux/os/petalinux$ git push origin v10.0
@:/zedboard_linux/os/petalinux$ source ~/.bashrc @:/zedboard_linux/os/petalinux$ petalinux-build
NOTE: Building PetaLinux with the following identification Description ... Zedboard PetaLinux Example Design Company ....... SpaceWire UK Author ........ Steve Haywood Version ....... 10.0 (unstaged) Timestamp ..... 23-Oct-2022 - 10:04:44 Hash .......... 980d0a89f629f246e18f79df9f69bb7d35c0a185
@:/zedboard_linux/os/petalinux$ git add project-spec/meta-user/recipes-apps/website/files/project.txt @:/zedboard_linux/os/petalinux$ git commit -am "Updated webpage to include PetaLinux ID table & add hash field to Firmware ID table." @:/zedboard_linux/os/petalinux$ git tag -d v10.0 @:/zedboard_linux/os/petalinux$ git tag -a v10.0 -m "PetaLinux, Peek/Poke, LED Runner, Webserver, Peek/Poke CGI, PL Access, Style Sheet, Register Bank & ID Strings (PetaLinux & Firmware hash) with XSA from zedboard_leds_switches v4.0" @:/zedboard_linux/os/petalinux$ git push origin v10.0
@:/zedboard_linux/os/petalinux$ petalinux-build
NOTE: Building PetaLinux with the following identification Description ... Zedboard PetaLinux Example Design Company ....... SpaceWire UK Author ........ Steve Haywood Version ....... 10.0 Timestamp ..... 23-Oct-2022 - 10:08:02 Hash .......... 9bea7fd2705efc6da3b975e0e05b28ec57872afd
@:/zedboard_linux/os/petalinux$ petalinux-package --prebuilt --force
Set the boot mode jumpers on the Zedboard for JTAG.
Power on the Zedboard.
@:~$ minized
Welcome to minicom 2.7.1
OPTIONS: I18n
Compiled on Dec 23 2019, 02:06:26.
Port /dev/ttyACM0, 06:34:25
Press CTRL-A Z for help on special keys
@:/zedboard_linux/os/petalinux$ petalinux-boot --jtag --prebuilt 3