SATA AHCI-IP Demo Instruction

Rev1.3  5-Jul-23

 

1     Environment Setup. 2

2     Hardware setup. 5

3     Linux Setup. 10

3.1     ZC706 and Zynq Mini-ITX board. 10

3.2     ZCU106 board. 12

4     Example Linux command. 13

4.1     Create Disk Partition.. 13

4.2     Format Disk. 14

4.3     Mount Disk. 14

5     Performance test 15

5.1     Performance test by diskTestApp. 15

5.1.1     Raw Data Mode. 15

Use following command to run test application in raw data format. 15

>> ./benchmark/diskTestApp –r” 15

>> sudo dgdisktest -r 15

Five input parameters are required, 15

Figure 5‑2 and Figure 5‑3 show the example of write test in raw data mode by dummy data and increment data. Figure 5‑4 and Figure 5‑5 show the example of read test in raw data mode without and with data verification. Comparing to increment/decrement pattern, using dummy mode for both write and read achieve better performance because of using less CPU resource for handling data. 15

5.1.2     File System Mode. 18

Before run test application in File system mode, user needs to create disk partition, format disk, and mount the disk. Use following command to run test application in file system mode. 18

>> ./benchmark/diskTestApp –f /media/hdd. 18

>> sudo dgdisktest -f /mnt/ 18

Five input parameters are required. 18

5.2     Bonnie++ Software. 21

6      Revision History. 22

 


 

 

 This document describes the instruction to run SATA AHCI-IP and SATA-IP on Zynq platform for SATA-II/III device access by ARM CPU which runs PetaLinux OS (PetaLinux 2013.10 is used for ZC706 and Zynq mini-ITX while PetaLinux 2022.1 is used for ZCU106). In the demo, FPGA is boot and configured by using SD Card.

 

1       Environment Setup

To run the SATA AHCI-IP demo on FPGA development board, please prepare the following hardware.

1)    Supported FPGA development board: ZC706, Zynq Mini-ITX 7Z100, and ZCU106

2)    SATA connector:

a)    ZC706/ZCU106: AB09-FMCRAID board

b)    Zynq Mini-ITX: SATA cable

3)    SATA device

a)    ZC706/Zynq Mini-ITX: SATA-II or SATA-III device

b)    ZCU106: SATA-III device

4)    Xilinx Power adapter for Xilinx board except Zynq Mini-ITX board.

5)    ATX power supply for Zynq Mini-ITX board and SATA device.

6)    USB cable for Serial console

a)    ZC706: mini USB cable

b)    ZCU106/Zynq Mini-ITX: micro USB cable

7)    SD card with boot loader (BOOT.BIN) and LINUX image (image.ub), downloaded from http://www.dgway.com/SATA-IP_X_E.html

 

Figure 11 SATA AHCI-IP Demo Environment Setup on ZC706


 

Figure 12 SATA AHCI-IP Demo Environment Setup on Zynq Mini-ITX 7Z100


 

Figure 13 SATA AHCI-IP Demo Environment Setup on ZCU106


 

2       Hardware setup

 

1)    Copy PetaLinux boot images to SD card. SD Card must be formatted by FAT32. It consists of two or three files, i.e., BOOT.BIN, boot.scr (required for ZCU106 only), and image.ub.

 

Figure 21 SD Card image for SATA AHCI-IP demo

 

2)    Check board power is OFF and insert SD card to the socket on the FPGA board.

3)    Set Boot mode to select configuration option = SD mode, as shown in Figure 2‑2.

a.    For ZC706 and Zynq Mini-ITX board: SW11/SW7 = OFF OFF ON ON OFF

b.    For ZCU106: SW6 = ON OFF OFF OFF

 

Figure 22 Boot mode setting

 


4)    Connect the SATA device to the board by the following steps.

a)    For ZC706 and ZCU106,

i)     Connect AB09-FMCRAID board to FMC-HPC/HPC0 connector on ZC706 (J37)/ZCU106 (J5).

ii)    Connect SATA device to CN0 on FMCRAID board.

iii)   Connect power to power connector on FMCRAID board.

Figure 23 AB09-FMCRAID connection

 

b)    For Zynq Mini ITX board

i)     Connect the SATA device to the SATA connector (J12) on the board using SATA cable.

ii)    Connect SATA Power cable to the device.

Figure 24 SATA-II/III device connection for Zynq Mini ITX


 

5)    For ZC706 and Zynq Mini-ITX board, set DIPSW bit 1-2 to select SATA speed mode.

 

Figure 25 DIPSW to select SATA speed mode

 

DIPSW[2]

DIPSW[1]

Description

‘1’

‘1’

Fixed-speed at SATA3 (6.0 Gbps)

‘1’

‘0’

Fixed-speed at SATA2 (3.0 Gbps)

‘0’

‘X’

Auto-speed negotiation mode

Table 21 Description of DIPSW for SATA speed

 

6)    Connect mini/micro USB cable from FPGA board to PC for Serial console.

7)    Power on FPGA development board and power supply for SATA device. After that, FPGA starts the operation and print the message on the Serial console.

8)    Open Serial monitoring software such as HyperTerminal. Terminal settings: Baud Rate=115,200, Data=8 bit Non-Parity, Stop=1. If Serial console is opened too late, the user may not see any boot messages.


 

9)    After finishing the initialization process, check LED0 and LED1 on FPGA board. They must be ON, as shown in Figure 2‑6. The LED description is described as follows.

Figure 26 LED status after finishing system initialization by SATA-3 speed

 

LED

ON

OFF

0

OK

150 MHz of SATA clock on FMCRAID board cannot lock. Please check 150 MHz clock source on FMCRAID board.

1

OK

SATA-IP cannot detect SATA device. Please check SATA device and the connection.

2

SATA-III

SATA-II

3

SATA AHCI-IP in processing

SATA AHCI-IP in idle

Table 22 LED Status of AHCI reference design


 

10) On PC serial console, please wait PetaLinux boot-up until login required, as shown in Figure 2‑7.

 

Figure 27 Linux Bootup


 

3       Linux Setup

 

3.1      ZC706 and Zynq Mini-ITX board

1)    User login on the demo.

Login                     : root

Password             : root

After login, system is ready to receive user command.

 

Figure 31 Linux Login on ZC706

 

2)    To run SATA AHCI-IP demo, two modules are required to insert, i.e, libahci.ko (common AHCI SATA low-level routines) and dg_ahciDemo.ko (AHCI SATA platform driver). Both are stored in “/home/root/driver” directory. To insert module, use following command.

>> insmod /home/root/driver/libahci.ko skip_cpu_sync=1

>> insmod /home/root/driver/dg_ahciDemo.ko


 

3)    After insert modules, disk information is displayed, as shown in Figure 3‑2. After that, SATA device is ready to use.

 

Figure 32 Insert module to Linux kernel on ZC706


 

3.2      ZCU106 board

1)    User login on the demo.

Login                     : petalinux

Password             : petalinux

After login, system is ready to receive user command.

 

Figure 33 Linux Login on ZCU106

 

2)    To run SATA AHCI-IP demo, AHCI SATA platform driver (dgahci) must be added by using following command.

>> sudo modprobe dgahci

 

After adding the module, the disk information is displayed, as shown in Figure 3‑4. After that, SATA device is ready to use.

 

Figure 34 Add module to Linux kernel on ZCU106


 

4       Example Linux command

 

4.1      Create Disk Partition

 

To create new disk partition, run following step, as shown in Figure 4‑1.

 

>> fdisk /dev/sda

Call the tool to manage disk partition.

 

>> n

Create new partition.

 

Select the option following the recommended value in the tool.

 

>> w

Write table to the disk.

 

After that, one partition named sda1 is created in the disk.

 

Figure 41 fdisk command

 

Note: User can type ‘m’ to show all fdisk options.


 

4.2      Format Disk

 

To format the disk, user needs to select file system type such as FAT, EXT4. This example shows only the command to format to EXT4 by using following command.

>> mkfs.ext4 /dev/sda1

 

Figure 42 Format disk

 

4.3      Mount Disk

 

Before running any application to access the disk by file system such as Bonnie++, disk must be mounted firstly by following command.

>> mount /dev/sda1 /media/hdd

 

Figure 43 Mount disk


 

5       Performance test

 

This topic shows the example to run the test for checking the performance. Two test applications are used, i.e., diskTestApp and Bonnie++. diskTestApp is the test application developed by Design Gateway to check write/read performance in both raw data format and file system.

 

5.1      Performance test by diskTestApp

 

Figure 51 diskTestApp usage

 

As shown in Figure 5‑1, diskTestApp can run in two data formats, i.e., raw data or file system.

Warning: If running raw data test, file system in that disk partition will be lost.

 

5.1.1    Raw Data Mode

Use following command to run test application in raw data format.

a)    For ZC706 and Zynq Mini-ITX board:

>> ./benchmark/diskTestApp –r”

b)    For ZCU106:

>> sudo dgdisktest -r

 

Five input parameters are required,

1)    Disk selection to select the disk to test performance.

2)    Operation type: ‘0’-Read disk test, ‘1’-Write disk test.

3)    Test pattern:

‘0’: Write by dummy data or read without verification

‘1’: Write or verify by 32-bit increment pattern

‘2’: Write or verify by 32-bit decrement pattern

4)    Disk offset: Disk start address in sector unit to write/read data. 0x prefix is added as a prefix for hex unit input while default value without prefix is decimal unit.

5)    Operation length: Transfer length in sector unit to write/read data. 0x prefix is added as a prefix for hex unit input while default value without prefix is decimal unit.

 

Figure 5‑2 and Figure 5‑3 show the example of write test in raw data mode by dummy data and increment data. Figure 5‑4 and Figure 5‑5 show the example of read test in raw data mode without and with data verification. Comparing to increment/decrement pattern, using dummy mode for both write and read achieve better performance because of using less CPU resource for handling data.

 


 

Figure 52 Write performance in raw data mode by dummy data

 

Figure 53 Write performance in raw data mode by 32-bit increment data


 

Figure 54 Read performance in raw data mode without data verification

 

Figure 55 Read performance in raw data mode and verify by 32-bit increment data


 

5.1.2    File System Mode

Before run test application in File system mode, user needs to create disk partition, format disk, and mount the disk. Use following command to run test application in file system mode.

a)    For ZC706 and Zynq Mini-ITX board:

>> ./benchmark/diskTestApp –f /media/hdd

b)    For ZCU106:

>> sudo dgdisktest -f /mnt/

 

Five input parameters are required.

1)    File name input: File name to run the test

2)    Operation type: ‘0’-Read file test, ‘1’-Write file test

3)    Test pattern:

‘0’: Write by dummy data or read without verification

‘1’: Write or verify by 32-bit increment pattern

‘2’: Write or verify by 32-bit decrement pattern

4)    File number: Total number of files to run write/read file test

5)    File size: Size of each file in sector unit to run write/read file test

 

Similar to raw data mode, when write test by dummy pattern or read test without data verification, the performance is better than using increment/decrement pattern, as shown in Figure 5‑6 - Figure 5‑9.

 


 

Figure 56 Write file performance by dummy data

 

Figure 57 Write file performance by 32-bit increment data


 

Figure 58 Read file performance without data verification

 

Figure 59 Read file performance and verify by 32-bit increment data

 


 

5.2      Bonnie++ Software

 

 This topic shows how to test disk performance by using Bonnie++ software. The brief option of Bonnie++ software is belows.

 

กล่องข้อความ: bonnie++  [-d  dir]  [-s size(MB)[:chunk-size(b)]]  [-n number-to-stat(*1024) [:max-size[:min-size] [:num-directories]]] [-m machine-name] [-r ram-size-in-MB] [-x number-of-tests]  [-u  uid-to-use:gid-to-use]  [-g  gid-to-use] [-q] [-f size-for-char-io]  [-b]  [-D]  [-p processes | -y p|s]  [-z seed-num|-Z random-file]

 

 More details about Bonnie++ user manual can be found from http://linux.die.net/man/8/bonnie++.

 

 The example command to run Bonnie++ is shown as follows.

a)    For ZC706 and Zynq Mini-ITX board:

>> ./benchmark/bonnie++ -d /media/hdd/ -s 2g -n 0 -m test -f -u root

b)    For ZCU106:

>> sudo bonnie++ -d /media/hdd/ -s 8g -n 0 -m test -f -u root

 

Figure 510 Test performance from Bonnie++ benchmark

 


 

6       Revision History

 

Revision

Date

Description

1.3

9-Nov-22

Support ZCU106

1.2

9-Nov-16

Zynq Mini-ITX 7Z100

1.1

16-Jul-15

Add new test application

1.0

10-Nov-14

Initial version release