Typical Power States for 2021.1 (ZU+ and Versal)
This tutorial explains procedure to measure transition times and respected power values when either PS or PL suspends or wake up. By following below procedure, user can see/measure the suspend/wake-up time and power. These procedures are for 2021.1 release.
Table of Contents
- 1 Different power states and measure transition time
- 1.1.1 Workloads on each domain
- 1.2 Prebuilt binaries for reference
- 1.2.1 For ZynqMP
- 1.2.2 For Versal
- 1.3 Generating required images/binaries
- 1.3.1 Steps to build Linux images
- 1.3.1.1 Create petalinux project
- 1.3.1.2 Build petalinux
- 1.3.1.2.1 For Versal:
- 1.3.1.2.2 For ZynqMP:
- 1.3.2 Steps to build RPU baremetal
- 1.3.3 Steps to build BOOT.BIN
- 1.3.3.1 For ZynqMP
- 1.3.3.2 For Versal
- 1.3.1 Steps to build Linux images
- 1.4 Steps to run the images
- 1.4.1 Boot Linux with RPU
- 1.4.2 Measure the power and transition times
- 1.4.3 Start the demo
- 2 Related Links
Different power states and measure transition time
Workloads on each domain
PLD: Petalinux prebuilt design which does not contain any specific logic
FPD: APU is running Linux script which controls PLD on/off and handshakes RPU for self suspend/off/resume
LPD: RPU is running baremetal application which controls FPD domain on/off
Prebuilt binaries for reference
For ZynqMP
Petalinux 2020.2 generated images (including other intermediate files):
ZCU102 rev1.0: zcu102.tar
Linux log: zynqmp-linux-log.txt
rpu source: rpu_src.tar
For Versal
Petalinux 2020.2 generated images (including other intermediate files):
VCK190 Prod: vck190-prod.tar
Linux log: vck190-linux-log.txt
rpu source: rpu_src.tar
To generate binaries on your own please refer below steps for generating required images/binaries.
Generating required images/binaries
Steps to build Linux images
Create petalinux project
Run below commands from bash terminal to create petalinux project.
source <petalinux-install-dir>/settings.sh petalinux-create -t project -s <xilinx zcu102/vck190 BSP location> cd <petalinux_proj_dir>
Build petalinux
For Versal:
Configure petalinux to use custom XSA (provided in prebuilt section) and enable the custom user application
petalinux-config --silentconfig --get-hw-description=<path to xsa directory> petalinux-create -t apps --template install --name myapp --enable
Use below command to apply patch for plm (patch file is provided in prebuilt section)
mkdir -p project-spec/meta-user/recipes-bsp/plm-firmware/files/ cp plm.patch project-spec/meta-user/recipes-bsp/plm-firmware/files/ vim project-spec/meta-user/recipes-bsp/plm-firmware/plm-firmware_%.bbappend
Add below content to plm-firmware_%.bbappend file
copy apu_script.sh and another PL bitfiles (partial.pdi, partial.dtbo, greybox.pdi and greybox.dtbo) to myapp (All files provided in prebuilt section)
Update myapp.bb (located at project-spec/meta-user/recipes-apps/myapp) as shown below
Replace rootfs_config file (provided in prebuilt section) with <petalinux-proj-dir>/project-spec/configs/rootfs_config file
Build the petalinux as shown below
For ZynqMP:
Use below command to create and enable custom petalinux application
Copy apu_script.sh (provided in prebuilt section) to myapp folder
Update myapp.bb (located at project-spec/meta-user/recipes-apps/myapp/) as shown below
Enable ECC in FSBL code:
Create directory <plnx-proj-root>/project-spec/meta-user/recipes-bsp/fsbl/files/ (if not present)
Copy patch file to <plnx-proj-root>/project-spec/meta-user/recipes-bsp/fsbl/files/ (Patch attached in prebuilt section)
Open file <plnx-proj-root>/project-spec/meta-user/recipes-bsp/fsbl/fsbl-firmware_%.bbappend (create if not present)
Add below lines in file:
Now build petalinux using below command
Steps to build RPU baremetal
Open Vitis and start with empty application as shown below
Select “create a new hardware platform“ and select petalinux prebuilt XSA file as shown below (uncheck generate boot components option in case of ZynqMP)
Select target processor as "psu_cortexr5_0" and give the application name (ex. rpu_app)
Click next and leave all options unchanged
Click next and select "Empty Application" from the template list
Click finish which will show the project window as shown below
Now click on "Navigate to BSP" settings and click "Modify BSP settings"
Now select the "xilpm" library option as shown below.
Select psu_cortexr5_0 and add “-DDEBUG_MODE“ in extra_compiler_flags as shown below and click ok.
Right click on "rpu_app" from explorer and select "import sources" option
Download rpu_src.tar and extract it to local folder
Select the source and target path as shown below and click ok
Right click on "rpu_app" from explorer and select "build project"
Steps to build BOOT.BIN
For ZynqMP
Create a new folder and copy pmufw.elf, zynqmp_fsbl.elf, bl31.elf, u-boot.elf and system.bit from petalinux generated images (present at <plnx-proj-root>/images/linux/).
Create RPU_0 application rpu_app.elf from Vitis as described in above section and copy rpu_app.elf into same new folder.
Create boot.bif file in same folder as shown below.
Create BOOT.BIN file using following command.
For Versal
Create a new folder and copy plm.elf, psmfw.elf, bl31.elf, u-boot.elf and system.dtb from petalinux generated images (present at <plnx-proj-root>/images/linux/).
Copy CDO files (pmc_data.cdo, lpd_data.cdo, fpd_data.cdo, top_wrapper.rnpi, topology_xcvc1902.v3.cdo, topology_board.cdo) present in prebuilt section to same new folder.
Create RPU_0 application rpu_app.elf from Vitis as described in above section and copy rpu_app.elf into same new folder.
Copy boot.bif (present in prebuilt section) to same folder and use below command to create BOOT.BIN
Steps to run the images
Boot Linux with RPU
Create a boot partition in SD card and copy BOOT.BIN, Image, system.dtb and rootfs.cpio.gz.u-boot file (present at <plnx-proj-root>/images/linux/) to boot partition.
Boot the board (ZCU102 in case of ZynqMP and VCK190 in case of Versal) in SD boot mode.
Boot the linux from u-boot console using fatload command
Measure the power and transition times
Use Power Advantage tool for measuring power values.
Start the demo
Copy apu_script.sh file from /usr/bin/ and run the script as shown below (For Versal only: also copy partial.pdi, partial.dtbo, greybox.pdi and greybox.dtbo form /usr/bin/ to same folder)
Note: User can open the script and edit the below parameters as per his convenient before running script
DelayVal : Amount of delay between 2 power modes (should be between 10 to 255 seconds)
IterationCnt: Total looping count to measure different APU power states latency (should be between 0 to 5Triggering the script starts the demo and it will switch the transition from one state to next dimer state after specific amount of time (default 30 seconds)
User can measure the power readings using power advantage tool between intervals
Latency measurement values is shown as per below window
Once system reaches to lowest power state, it will starts reverting back to original (normal) power state as shown below
At the end, it will show below completion message (Full log is attached to pre-built images section)
User can re-trigger the apu_script.sh to re-run the demo again.
Related Links
© Copyright 2019 - 2022 Xilinx Inc. Privacy Policy