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 56: The Zynq and the PicoBlaze

by Xilinx Employee ‎11-03-2014 08:58 AM - edited ‎11-03-2014 09:08 AM (68,322 Views)

 

 

By Adam Taylor

 

So far in this series we have looked at both the PS and PL side of the Zynq SoC and the operating systems we can run on the Zynq SoC’s PS-side ARM Cortex-A9 MPCore processors. One area we have not explored is the use of a soft core processor within the PL side of the device. One commonly used Xilinx soft-core processor is the PicoBlaze, which is an 8-bit processor. Due to its highly deterministic nature—each instruction takes 2 cycles to execute—many systems based on Xilinx All Programmable devices use the PicoBlaze processor to replace state machines and other control structures. You can even use the PicoBlaze processor for serial communications over I2C and RS232 if required, allowing for a much simplified and reduced design time. You can read more about the PicoBlaze processor in my article, “Getting the Most out of Your PicoBlaze Processor,” which appeared in Xcell Journal Issue 89. (Also, you can look at “Hidden Gems: The Xilinx PicoBlaze Microcontroller—a tiny RISC processor for FPGAs.”)

 

The first thing we must do is to download the latest version of the PicoBlaze processor from the PicoBlaze lounge. The latest version of the PicoBlaze processor supports both the UltraScale and 7 series All Programmable devices (including the Zynq SoC).

 

Our goal is to have a component as a standalone IP block that we can package and add into our VIVADO block diagram. However before we can that, the first step is to understand a little more about what comes with the PicoBlaze processor and its associated development flow. Within the directory we downloaded you will see the following files:

 

 

1. KCPSM6.Vhd: This is the actual source code for the PicoBlaze processor

 

2. KCPSM6.exe: This is the assembler program used to generate the machine code and required memory files.

 

3. ROM_Form.vhd: This is used by the assembler executable to generate the VHDL file that will contain our created object program.

 

4. KCPSM6_design_template.vhd: A template instantiation of a PicoBlaze processor.

 

5. All_kcpsm6_syntax.psm: A definition of all assembler commands and syntax

 

 

The development flow we will be undertaking to implement the PicoBlaze within the PL is:

 

  1. Write the program executable PicoBlaze program. In this example, we will simply flashe a LED. We can use the all_KCPSM6_syntax.psm file as a quick reference for the PicoBlaze instructions available to us. There is also a great user guide PDF included in the download to get us started.
  2. Having written the simple program, we assemble it using the KCPSM6.exe assembler, which creates a RAM file using our specified program name. This file contains the program to be executed by the PicoBlaze controller. We must connect this file to the PicoBlaze processor to create a functional system.
  3. Modify the RAM file produced to show 7S in place of 6S for the device family and select a 2K memory size as below:

 

 Image1.jpg

 

 

  1. Within the same directory, create a top-level file that connects the processor and RAM together along with additional code as required by the PicoBlaze. For example, registering of its output port when it is written to:

 

Image2.jpg

 

 

  1. Package these three files in the directory as IP using Vivado’s tool-> create and package IP option to create a new IP location.
  2. After packaging this program, we check to make sure it has been included as a repository—if not, we add it manually—and place the IP block within the block diagram:

 

Image3.jpg

 

 

  1. Connect up the PicoBlaze block to FPGA clock (set to 40 MHz) and define three outputs connected to LEDs on the MicroZed IO carrier card:

 

Image4.jpg

 

 

  1. Build the design and export to SDK.

 

 

Once we have built the design we can download the bit stream and see the LED start flashing if we have a JTAG connector or we can export to SDK and create a boot file to run the program from power on.

 

I will explore the design we have just created in a little more depth next time. Meanwhile, the files I used in this demo are attached to this blog post. I have provided the PSM file and the top-level file. You can use the PicoBlaze assembler to create the test.vhd memory file once you have the PicoBlaze core downloaded.

 

 

 

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

 

Adam Taylor’s MicroZed Chronicles Part 55: Linux on the Zynq SoC

 

Adam Taylor’s MicroZed Chronicles Part 54: Peta Linux SDK for the Zynq SoC

 

Adam Taylor’s MicroZed Chronicles Part 53: Linux and SMP

 

Adam Taylor’s MicroZed Chronicles Part 52: One year and 151,000 views later. Big, Big Bonus PDF!

 

Adam Taylor’s MicroZed Chronicles Part 51: Interrupts and AMP

 

Adam Taylor’s MicroZed Chronicles Part 50: AMP and the Zynq SoC’s OCM (On-Chip Memory)

 

Adam Taylor’s MicroZed Chronicles Part 49: Using the Zynq SoC’s On-Chip Memory for AMP Communications

 

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

 

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 Visitor demke234
on ‎02-10-2015 10:26 AM

 Sorry for being dense, but where can I locate the files that should be attached to your posts?

by Xilinx Employee
on ‎02-10-2015 10:30 AM

demke234,

 

Your question is not dense at all. It's most appropriate. The Xilinx Lithium blogging tool limits what can be attached to the posts so Adam Taylor has gathered all of the code in a  github repository at:

 

https://github.com/ATaylorCEngFIET/MicroZed-Chronicles

by Visitor demke234
on ‎02-10-2015 10:35 AM

Many thanks for your quick response!

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.