Zynq-7000 AP SoC - Protocol Communication Between a Host PC and ZC702 Board Tech Tip

Zynq-7000 AP SoC - Protocol Communication Between a Host PC and ZC702 Board Tech Tip

 

Zynq-7000 AP SoC - Protocol Communication Between a Host PC and ZC702 Board Tech Tip

 

Table of Contents

Document History

Introduction

Block Diagram

Communication Protocol through UART

Example Commands

Example Response

Power Demo GUI input commands

Power Demo GUI output response structure and details

Document History

Date

Version

Author

Description of Revisions

27 May 2014

0.0

Prush

Initial Version

11 June, 2014

0.1

Upender

Added Command and response structures




Introduction

The host machine communicates with the application running on ZC702 board through UART channel. The GUI running on the target machine sends appropriate commands to the target application based on the user selection. For the GUI to successfully send command and receive a response a simple protocol is designed in the power demo setup. This Techtip explains this protocol that is used for command and response.

Block Diagram

This design example uses the UART protocol to communicate data between the GUI on host PC and Zynq-7000 AP SoC. The GUI example reference design will have the following components

  1. 1. On Windows Visual C# GUI

    1. a. Display the UART ports available on the host PC,

    2. b. Two text boxes

i. one for the input from the user and
ii. display the processed data from the Zynq-7000 AP SoC of the user input

  1. 2. Application running on Zynq-7000 AP SoC

    1. a. Receives the input string from user through the GUI

    2. b. Reserves the input string and sends back the reversed sting to the GUI

When user initiates the UART connection by selecting the corresponding UART port, GUI will enable the input text box for the user inputs. The user inputs will be transferred to the Zynq-7000 AP SoC and will be processed (reversed) and sends back the processed data back to the GUI through the UART port.




Figure1: GUI example block diagram

Communication Protocol through UART


The command packet starts with “SOC” delimiter, short for Start Of Command and ends with “EOC” delimiter short for End of Command. The data between SOC and EOC is the actual command that the application will look for.

S

O

C

X

X

X

E

O

C



After executing the command received from the HOST, the UART application will send out the response in the following two formats. The format of the response when there is an error message is as mentioned below.

E

R

R

ANY

STR

ING


E

O

R


The format of the response after successful completion of the command is as mentioned below. This response packet will be send continuously at a rate of 2Hz, such that the GUI updates the values of voltage, current and power graph twice in a second. The response packet starts with a “SOR” delimiter short for Start Of Response and end with a “EOR” delimiter short for “End Of Response”.

S

O

R

nVoltage

nCurrent

nPower

Additional Data

E

O

R



The actual data that the GUI will use to update the graph is highlighted in yellow in the above table. The data includes Voltage, Current, Power for all 10 voltage rails and additional data which includes CPU frequency, DDR frequency, CPU utilization, Total Power consumed, MAX power consumed and temperature. Total Power is the total power consumed on all the rails at that instant and MAX power is the highest “Total Power” during the life of the application. The data in the response packet is with a precision of 2 decimal places.

Example Commands


1) Change CPU frequency to 222 MHz

S

O

C

1

1

x

E

O

C




2) Change CPU frequency to 333 MHz

S

O

C

1

2

x

E

O

C



3) Change CPU frequency to 667 MHz

S

O

C

1

3

x

E

O

C



1) Change CPU load to idle (no load)

S

O

C

1

x

1

E

O

C




2) Run Spec2000 load on one core

S

O

C

1

x

2

E

O

C



1) Run Spec2000 load on two cores

S

O

C

1

x

3

E

O

C



Example Response


SOR:1.00:255.00:255.47:1.00:274.69:274.55:1.80:15.31:27.47:1.80:84.06:150.90:2.5 1:12.19:30.59:1.50:417.19:625.09:1.81:6.88:12.40:1.00:8.75:8.73:3.29:357.50:1173 .65:2.50:7.81:19.52:666.00:533.00:0.00:0.00:2578.36:2578.36:25.17:EOR

Power Demo GUI input commands


Figure 2 : Power demo GUI Command Input



Power Demo GUI inputs commands and possible values for each parameter in command.
The list is not limited to the below table. There will be many combinations of commands with different values shown in the table below



PS Configuration

PL Configuration

S/No

COMMANDS

PS FREQUENCY INDEX

PS LOAD INDEX

PL FREQUENCY INDEX

PL UTILIZATION INDEX

ACCUMULATOR

LFSR

TOGGLE FLIP-FLOP










1

SOC1111111EOC

1(667MHz)

1

1

1

UN CHECKED

UN CHECKED

UN CHECKED

2

SOC1211111EOC

2(333MHz)

1

1

1

UN CHECKED

UN CHECKED

UN CHECKED

3

SOC1311111EOC

3(222MHz)

1(CPU_IDLE)

1

1

UN CHECKED

UN CHECKED

UN CHECKED

4

SOC1121111EOC

1

2(Spec 2000:1 Load)

1

1