@:~$ 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 /zedboard_leds_switches
@:/zedboard_leds_switches$ vivado -nojournal -nolog -notrace fw/vivado/project.xpr &
Select Create AXI4 Peripheral in the Create and Package New IP - Create Peripheral, Package IP or Package a Block Design dialog and click Next to proceed.
Populate the following details in the Create and Package New IP - Peripheral Details dialog and click Next to proceed.
In the Create and Package New IP - Add Interfaces dialog leave the defaults as shown and click Next to proceed.
Review the information provided in the Create and Package New IP - Create Peripheral dialog and click Finish to proceed.
Quite a few useful files have now been created in the ip_repo directory, including a testbench that uses the Xilinx AXI4 Verification IP. The two main files of interest are the HDL sources, which can be found in the hdl directory. Examine these to get a better understanding of what they are doing. The operational code is provided in register_bank_v1_0_S00_AXI.v along with a wrapper provided in register_bank_v1_0.v.
@:/zedboard_leds_switches$ subl fw/src/ip_repo/register_bank_1.0/hdl/{register_bank_v1_0_S00_AXI.v,register_bank_v1_0.v}
icon.
and then selecting AXI Register Bank from the context menu.
Connect the Register Bank to the rest of the system by clicking on Run Connection Automation.
Verify the block design is error free by clicking on the Validate Design
icon. All being well the Validation successful dialog should now appear.
Save the Block Design.
@:/zedboard_leds_switches$ subl fw/src/testbench/testbench.sv
@:/zedboard_leds_switches$ wget https://spacewire.co.uk/tutorial/shared/repos/0014/zedboard_leds_switches/fw/src/testbench/testbench.sv -O fw/src/testbench/testbench.sv
@:/zedboard_leds_switches$ git difftool fw/src/testbench/testbench.sv
@:/zedboard_leds_switches$ git add fw/src/ip_repo @:/zedboard_leds_switches$ git commit -a -m "Added general purpose AXI register bank." @:/zedboard_leds_switches$ git push @:/zedboard_leds_switches$ git tag -a v2.0 -m "ZYNQ, GPIO & Register Bank" @:/zedboard_leds_switches$ git push origin v2.0
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_leds_switches$ cd ../zedboard_linux/os/petalinux @:/zedboard_linux/os/petalinux$ petalinux-boot --jtag --prebuilt 3
In the HARDWARE MANAGER click on Open target and select Auto Connect from the context menu.
In the HARDWARE MANAGER click on Program device.
In the Program Device dialog click Program to program the PL.
@:/zedboard_linux/os/petalinux$ curl -w "\nReceived %{size_download} bytes\n" "http:///cgi-bin/peek?0x43C00000" 0x00000000 Received 10 bytes @:/zedboard_linux/os/petalinux$ curl -w "\nReceived %{size_download} bytes\n" "http:///cgi-bin/poke?0x43C00000&0x456789ab" Success Received 7 bytes @:/zedboard_linux/os/petalinux$ curl -w "\nReceived %{size_download} bytes\n" "http:///cgi-bin/peek?0x43C00000" 0x456789AB Received 10 bytes
@:/zedboard_linux/os/petalinux$ cd ../..
@:/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/0015/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
,
,
) into /home//zedboard_linux/os/petalinux/project-spec/meta-user/recipes-apps/website/files. Note the second & third images are a play-once animations.
@:/zedboard_linux$ wget https://spacewire.co.uk/tutorial/shared/repos/0015/zedboard_linux/os/petalinux/project-spec/meta-user/recipes-apps/website/files/{amber.gif,green.gif,red.gif} -P os/petalinux/project-spec/meta-user/recipes-apps/website/files
@:/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/0015/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$ subl os/petalinux/project-spec/meta-user/recipes-apps/website/website.bb
@:/zedboard_linux$ wget https://spacewire.co.uk/tutorial/shared/repos/0015/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$ sshpass -p root scp os/petalinux/project-spec/meta-user/recipes-apps/website/files/cgi-bin/index.cgi root@:/srv/www/cgi-bin @:/zedboard_linux$ sshpass -p root scp os/petalinux/project-spec/meta-user/recipes-apps/website/files/uptime.js root@:/srv/www @:/zedboard_linux$ sshpass -p root scp os/petalinux/project-spec/meta-user/recipes-apps/website/files/amber.gif root@:/srv/www @:/zedboard_linux$ sshpass -p root scp os/petalinux/project-spec/meta-user/recipes-apps/website/files/green.gif root@:/srv/www @:/zedboard_linux$ sshpass -p root scp os/petalinux/project-spec/meta-user/recipes-apps/website/files/red.gif root@:/srv/www
The controls in the Peek & Poke section of the enhanced website are as follows :-
@:/zedboard_linux$ wget https://spacewire.co.uk/tutorial/shared/repos/0015/zedboard_linux/os/src/other/zedboard_leds_switches.txt -O os/src/other/zedboard_leds_switches.txt
@:/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.
@:/zedboard_linux/os/petalinux$ petalinux-build @:/zedboard_linux/os/petalinux$ petalinux-package --prebuilt --force
@:/zedboard_linux/os/petalinux$ petalinux-boot --jtag --prebuilt 3
@:/zedboard_linux/os/petalinux$ git add project-spec/hw-description/drivers @:/zedboard_linux/os/petalinux$ git add project-spec/meta-user/recipes-apps/website/files/amber.gif @:/zedboard_linux/os/petalinux$ git add project-spec/meta-user/recipes-apps/website/files/green.gif @:/zedboard_linux/os/petalinux$ git add project-spec/meta-user/recipes-apps/website/files/red.gif @:/zedboard_linux/os/petalinux$ git commit -a -m "Enhanced webpage for website application to have multiple location access into PL address space." @:/zedboard_linux/os/petalinux$ git push @:/zedboard_linux/os/petalinux$ git tag -a v8.0 -m "PetaLinux, Peek/Poke, LED Runner, Webserver, Peek/Poke CGI, PL Access, Style Sheet & Register Bank with XSA from zedboard_leds_switches v2.0" @:/zedboard_linux/os/petalinux$ git push origin v8.0
@:~$ cd @:$ git clone -b v2.0 https://bitbucket.org/spacewire_firmware/zedboard_leds_switches @:$ cd zedboard_leds_switches @:/zedboard_leds_switches$ create_vivado_project.sh
@:~$ cd @:$ git clone -b v8.0 https://bitbucket.org/spacewire_firmware/zedboard_linux @:$ cd zedboard_linux/os/petalinux