UPGRADE YOUR BROWSER

We have detected your current browser version is not the latest one. Xilinx.com uses the latest web technologies to bring you the best online experience possible. Please upgrade to a Xilinx.com supported browser:Chrome, Firefox, Internet Explorer 11, Safari. Thank you!

Adam Taylor’s MicroZed Chronicles Part 48: Bare-Metal AMP (Asymmetric Multiprocessing)

by Xilinx Employee ‎09-08-2014 10:01 AM - edited ‎09-08-2014 01:51 PM (33,254 Views)

 

By Adam Taylor

 

In the last blog, we had the Zynq SoC up and running using both ARM Cortex-A9 MPCore processor cores using AMP—asymmetric multiprocessing. However I did not talk much about the software running on the processors because the blog was already rather long.

 

The software I have up and running on both cores is very simple. Its simplicity allows me to show you how to get the two Zynq SoC processor cores communicating via the OCM (on-chip memory). However, the software is doing simple things at the moment so that we have a baseline to move on from.

 

The software currently running in the example from last week performs the following tasks:

 

  • Core 0 is the master and starts the execution of Core 1. It also uses the on-chip UART to print a message to a terminal program at a fixed delay. This delay does not use the timers, etc. although it could easily use the private timer for this and I shall do so in the future to show the two private timers in use simultaneously.
  • Once it is started by Core 0, Core 1 initializes its private resources and outputs a toggling pattern on the eight LED’s located on the MicroZed I/O Carrier Card. We need to use Core 1’s private timer and to enable interrupts via the GIC to achieve this.

 

These applications are in no way linked and they do not share resources. However, as we progress we will want these applications to be able to do just that.

 

The application running on Core 0 is very simple. It starts the software on Core 1 and then prints out a simple message in a forever loop using UART 0:

 

 

Image1.jpg

 

 

However, we plan to use the Core 1’s interrupt controller so we must first configure the GIC (General Interrupt Controller) using the code below as part of the Core 0 application:

 

 

Image 2.jpg

 

 

The Core 1 code must be a little more complex because we are using the GPIO block within the Zynq SoC’s PL (programmable logic) side to drive the LEDs on the MicroZed I/O Carrier Card. As with all other interfaces Xilinx, the standalone OS provides a simple set of drivers for this using #include "xgpio.h" This file differs slightly from the xgpio_ps.h file we used previously to drive MIO / EMIO GPIO connected to the Zynq SoC’s PS (processing system) side. However in this instance I wanted to show you how to use GPIO in the Zynq SoC’s PL side as well.

 

 

Image 3.jpg

 

 

To ensure that we can see the LEDs toggle on and off, we will be using Core 1’s private timer, which is identical to using the private timer on core 0 as we have done in the past.

 

Before Core 1’s program begins to execute its main application we need to disable the cache on the On Chip Memory (OCM), initialize the GPIO, initialize the private timer, and configure the interrupt controller so that the private timer’s interrupts can be used to toggle the LEDS. We would likely do all of this with any Zynq SoC application, with the exception of disabling the cache.

 

 

Image 4.jpg

 

 

We can now begin to write the rather simple interrupt service routine to toggle the LEDs when the private timer elapses and restarts. This process will continue forever. I have selected alternate hex patterns of AA and 55 for the LEDS. These choices will exercise all of the LEDs and is slightly different to an all-on/all-off approach.

 

Here is the result of the Program’s execution, as reported by Core 0’s output to the terminal window:

 

 

Image 5.jpg

 

 

Over the next few blogs, we look in more depth at inter-processor communication, how we can communicate between processors using the OCM and interrupts, and how we can share resources between the two processor cores, which is a lot like sharing resources between tasks in an OS.

 

 

Please see the previous entries in this MicroZed series by Adam Taylor:

 

Adam Taylor’s MicroZed Chronicles Part 47: AMP—Asymmetric Multiprocessing on the Zynq SoC

 

Adam Taylor’s MicroZed Chronicles Part 46: Using both of the Zynq SoC’s ARM Cortex-A9 Cores

 

Adam Taylor’s MicroZed Chronicles Part 44: MicroZed Operating Systems—FreeRTOS

 

Adam Taylor’s MicroZed Chronicles Part 43: XADC Alarms and Interrupts 

 

Adam Taylor’s MicroZed Chronicles MicroZed Part 42: MicroZed Operating Systems Part 4

 

Adam Taylor’s MicroZed Chronicles MicroZed Part 41: MicroZed Operating Systems Part 3

 

Adam Taylor’s MicroZed Chronicles MicroZed Part 40: MicroZed Operating Systems Part Two

 

Adam Taylor’s MicroZed Chronicles MicroZed Part 39: MicroZed Operating Systems Part One

 

Adam Taylor’s MicroZed Chronicles MicroZed Part 38 – Answering a question on Interrupts

 

Adam Taylor’s MicroZed Chronicles Part 37: Driving Adafruit RGB NeoPixel LED arrays with MicroZed Part 8

 

Adam Taylor’s MicroZed Chronicles Part 36: Driving Adafruit RGB NeoPixel LED arrays with MicroZed Part 7

 

Adam Taylor’s MicroZed Chronicles Part 35: Driving Adafruit RGB NeoPixel LED arrays with MicroZed Part 6

 

Adam Taylor’s MicroZed Chronicles Part 34: Driving Adafruit RGB NeoPixel LED arrays with MicroZed Part 5

 

Adam Taylor’s MicroZed Chronicles Part 33: Driving Adafruit RGB NeoPixel LED arrays with the Zynq SoC

 

Adam Taylor’s MicroZed Chronicles Part 32: Driving Adafruit RGB NeoPixel LED arrays

 

Adam Taylor’s MicroZed Chronicles Part 31: Systems of Modules, Driving RGB NeoPixel LED arrays

 

 Adam Taylor’s MicroZed Chronicles Part 30: The MicroZed I/O Carrier Card

 

Zynq DMA Part Two – Adam Taylor’s MicroZed Chronicles Part 29

 

The Zynq PS/PL, Part Eight: Zynq DMA – Adam Taylor’s MicroZed Chronicles Part 28  

 

The Zynq PS/PL, Part Seven: Adam Taylor’s MicroZed Chronicles Part 27

 

The Zynq PS/PL, Part Six: Adam Taylor’s MicroZed Chronicles Part 26

 

The Zynq PS/PL, Part Five: Adam Taylor’s MicroZed Chronicles Part 25

 

The Zynq PS/PL, Part Four: Adam Taylor’s MicroZed Chronicles Part 24

 

The Zynq PS/PL, Part Three: Adam Taylor’s MicroZed Chronicles Part 23

 

The Zynq PS/PL, Part Two: Adam Taylor’s MicroZed Chronicles Part 22

 

The Zynq PS/PL, Part One: Adam Taylor’s MicroZed Chronicles Part 21

 

Introduction to the Zynq Triple Timer Counter Part Four: Adam Taylor’s MicroZed Chronicles Part 20

 

Introduction to the Zynq Triple Timer Counter Part Three: Adam Taylor’s MicroZed Chronicles Part 19

 

Introduction to the Zynq Triple Timer Counter Part Two: Adam Taylor’s MicroZed Chronicles Part 18

 

Introduction to the Zynq Triple Timer Counter Part One: Adam Taylor’s MicroZed Chronicles Part 17

 

The Zynq SoC’s Private Watchdog: Adam Taylor’s MicroZed Chronicles Part 16

 

Implementing the Zynq SoC’s Private Timer: Adam Taylor’s MicroZed Chronicles Part 15

 

MicroZed Timers, Clocks and Watchdogs: Adam Taylor’s MicroZed Chronicles Part 14

 

More About MicroZed Interrupts: Adam Taylor’s MicroZed Chronicles Part 13

 

MicroZed Interrupts: Adam Taylor’s MicroZed Chronicles Part 12

 

Using the MicroZed Button for Input: Adam Taylor’s MicroZed Chronicles Part 11

 

Driving the Zynq SoC's GPIO: Adam Taylor’s MicroZed Chronicles Part 10

 

Meet the Zynq MIO: Adam Taylor’s MicroZed Chronicles Part 9

 

MicroZed XADC Software: Adam Taylor’s MicroZed Chronicles Part 8

 

Getting the XADC Running on the MicroZed: Adam Taylor’s MicroZed Chronicles Part 7

 

A Boot Loader for MicroZed. Adam Taylor’s MicroZed Chronicles, Part 6 

 

Figuring out the MicroZed Boot Loader – Adam Taylor’s MicroZed Chronicles, Part 5

 

Running your programs on the MicroZed – Adam Taylor’s MicroZed Chronicles, Part 4

 

Zynq and MicroZed say “Hello World”-- Adam Taylor’s MicroZed Chronicles, Part 3

 

Adam Taylor’s MicroZed Chronicles: Setting the SW Scene

 

Bringing up the Avnet MicroZed with Vivado

 

 

Comments
by Newbie maxabsolem
on ‎01-19-2016 05:59 AM

Hi,

 

First of all, I had to tell thank you for your hard work on developping this chronicle series.

It has helped me a lot while take under hand the microZED board.

 

I'm wondering if you still have the project at this stage. Because I have some problem to make it running. As I'm using the latest version of vivado (2015.4) I still have some error.

 

Kind regards,

Maxime

 

 

by Observer taylo_ap
on ‎01-19-2016 02:44 PM

Hi,

The Vivado project is pretty straight forward any design will do Smiley Happy 

 

The software is what makes the difference for AMP you can get the files for this example off my Github https://github.com/ATaylorCEngFIET

 

Let me now if you still have issues and I will pehaps re look at it in Vivado HLS as I am sure some things have changed slightly 

 

Best Regards

 

Adam 

Labels
About the Author
  • Be sure to join the Xilinx LinkedIn group to get an update for every new Xcell Daily post! ******************** Steve Leibson is the Director of Strategic Marketing and Business Planning at Xilinx. He started as a system design engineer at HP in the early days of desktop computing, then switched to EDA at Cadnetix, and subsequently became a technical editor for EDN Magazine. He's served as Editor in Chief of EDN Magazine, Embedded Developers Journal, and Microprocessor Report. He has extensive experience in computing, microprocessors, microcontrollers, embedded systems design, design IP, EDA, and programmable logic.