micro blaze

33
Introducción al EDK

Upload: mdzakirhussain

Post on 27-Oct-2015

26 views

Category:

Documents


0 download

DESCRIPTION

soft core from xilinx

TRANSCRIPT

Page 1: Micro Blaze

Introducción al EDK

Page 2: Micro Blaze

Embedded DevelopmentTool Flow Overview

Data2MEM

Download Combined Image to FPGA

Compiled ELF Compiled BIT

RTOS, Board Support Package

EmbeddedDevelopment Kit

Instantiate the ‘System Netlist’ and Implement

the FPGA

?

HDL Entry

Simulation/Synthesis

Implementation

Download BitstreamInto FPGA

Chipscope

Standard FPGAHW Development Flow

VHDL or Verilog

System NetlistInclude the BSPand Compile theSoftware Image

?

Code Entry

C/C++ Cross Compiler

Linker

Load SoftwareInto FLASH

Debugger

Standard EmbeddedSW Development Flow

C Code

Board SupportPackage

12 3 Compiled BITCompiled ELF

Page 3: Micro Blaze

Embedded DevelopmentTool Flow Overview

• While seemingly complex when viewed in total, the system design flow simply combines the standard hardware flow used to create FPGA bitstreams and standard software flow used to create processor ELF files. In fact, unless on-chip memory resources are used to store the software image, the Embedded Developers Kit can be viewed as nothing more than an extension to the Xilinx core generation tool CoreGen.

• The first step is to create the ‘System Netlist’ using the Embedded Developers Kit and instantiate that netlist into the design’s HDL code. The hardware design is then synthesized, merged and implemented using the exact same flow as used with any other ‘black box’ core. While it is common to include a portion of the yet created software image inside the FPGA using block RAM, the ‘Compiled BIT’ file created during this phase of development only contains the systems hardware description.

Page 4: Micro Blaze

Embedded DevelopmentTool Flow Overview

• The second step is to create the ‘Board Support Package’ (BSP) using the Embedded Developers Kit (EDK) and include the required drivers in the system’s C code. The code is then compiled and linked with the various functions available in the BSP as is the same with any other processor system. Because the embedded system is built using the FPGA fabric, the BSP is customized for the particular set of peripherals included in the ‘System Netlist’. Unlike an off the shelf general purpose processor, embedded systems in Xilinx FPGA can include any combination of Xilinx provided and user created peripherals. This means that every BSP is potentially unique and as such EDK is tasked with customizing a generic set of drivers as required to properly support the ‘arbitrary processor system’.

• Once the final set of peripherals and bus structures have been solidified, the software and hardware flows can be run independently. Even if part or all of the software image is stored using on-chip block RAM, the software flow does not require running the hardware flow from scratch when making software changes. Only if a change is made to the instantiated ‘System Netlist’ does the hardware need to be implemented again before a the new software image which relies on the architectural change can be loaded and run.

Page 5: Micro Blaze

Embedded DevelopmentTool Flow Overview

• If the software image is completely stored externally, configuring the FPGA and loading the external storage device are performed in exactly the same way as a typical two chip solution. If part or all of the software image is stored using on-chip block RAM and as such is embedded within the FPGA’s bitstream, an additional step is required before the FPGA can be configured. EDK provides a tool called Data2MEM which merges the appropriate sections of the ‘Compiled ELF’ file with the ‘Compiled BIT’ file. The resulting BIT file is created is typically created in a few seconds and can then be used to configured the FPGA. When the entire software image is stored within the FPGA, only the BIT file is needed to both configure the system and load the software image. If only portion of the software image, such as the bootstrap, is stored within the FPGA, then Data2MEM is run to create a combined BIT file and the system is once again configured/loaded as any two chip solution using the unmerged ELF sections and the combined BIT file.

Page 6: Micro Blaze

Embedded DevelopmentTool Flow Overview

• Debugging the software running on the system is performed in the same manner as would be on any general purpose processor. GDB or other debug tool is used to connect to the target and provide runtime control of the target and even load new images when desired. Unlike general purpose processors, the physical system can be probed using ChipScope modules. This capability provides a level of visibility into the operation of the system unmatched by external processors.

Page 7: Micro Blaze

EDK tools• Xilinx® EDK comprises the following tools:

– Xilinx Platform Studio (XPS) • XPS provides an integrated environment for creating software and

hardware specification flows for embedded processor systems based on MicroBlaze™ and PowerPC® processors.

• XPS offers customization of tool flow configuration options and provides a graphical system editor for connection of processors, peripherals, and buses.

–  Hardware Platform Generation Tool • The Hardware Platform Generation tool (Platgen) customizes and

generates the embedded processor system, in the form of hardware netlists (Hardware Description Language (HDL) files).

• By default, Platgen synthesizes each processor IP core instance found in your embedded hardware design using the XST compiler. Platgen also generates the system-level HDL file that interconnects all the IP cores, to be synthesized later as part of the overall Xilinx® ISE® implementation flow.

Page 8: Micro Blaze

EDK tools

• Base System Builder Wizard – The Base System Builder (BSB) wizard allows you to quickly create a

working embedded design, using any features of a supported development board or using basic functionality common to most embedded systems. After you create a basic system, you can then customize it using the tools in XPS and ISE. Xilinx recommends using the BSB.

•  Simulation Model Generation Tool – The Simulation Model Generation tool (Simgen) generates simulation

models of your embedded hardware system based either on your original embedded hardware design (behavioral) or finished FPGA implementation (timing-accurate). Simgen can also incorporate your embedded software to run on the model.

• Create and Import Peripheral Wizard – The Create and Import Peripheral wizard helps you create your own

peripherals and import them into EDK-compliant repositories or XPS projects. The wizard can create an HDL template for your custom logic and provides an interface to one of the supported IBM CoreConnect or Xilinx FSL buses.

•  

Page 9: Micro Blaze

EDK tools

• Software Development Kit – The Xilinx Software Development Kit (SDK) is the recommended

development environment for software application projects. SDK is based on the Eclipse open source standard.

– Note XPS can also be used for software development. However, all software development tools available in XPS is deprecated and will be removed in the 12.1 release.

• Library Generation Tool – The Library Generation tool (Libgen) configures libraries, device drivers,

file systems, and interrupt handlers for the embedded processor system, creating a software platform.

• Version Management Tools – The Format Revision Tool updates design files to the current format.

The Version Management wizard helps migrate IPs and drivers created

with an earlier EDK release to the latest version.

Page 10: Micro Blaze

EDK tools

•  Bitstream Initializer – The Bitstream Initializer (Bitinit) updates an FPGA configuration bitstream

to initialize the on-chip instruction memory with the software executable.  

•  Flash Memory Programming – Allows you to use your target processor to program on-board Common

Flash Interface (CFI)-compliant parallel flash devices with software and data.

•  GNU Software Development Tools – Embedded software applications written in C, C++, or Assembler are

compiled using the GNU compiler tool chain. The GNU tool chain is part of the EDK and customized to target the PowerPC and MicroBlaze processors.

•  Xilinx Microprocessor Debugger and GNU Software Debugging Tools– Using Xilinx Microprocessor Debugger (XMD) and GNU Debugger (GDB),

you can debug your embedded application either on the host development system using an instruction set simulator, or on a board that has a Xilinx FPGA loaded with your hardware bitstream.

Page 11: Micro Blaze

EDK tools

•   System ACE™ File Generation – The System ACE file generation tool (GenACE) generates a Xilinx

System ACE™ configuration file based on the FPGA configuration bitstream and software executable to be stored in a non-volatile device in a production system.

•  Xilinx Bash Shell – A Cygwin-based UNIX emulation shell that allows you to run command-

line tools provided in the XPS and GNU tool chains.

Page 12: Micro Blaze

MicroBlaze based embedded systems

• Compuesto por:– MicroBlaze soft processor core:– On-chip block RAM– Standard bus interconnects– On-chip Peripheral Bus (OPB) peripherals.

• A MicroBlaze system can range from a processor core with a minimum of local memory to a large system with many MicroBlaze processors, sizable external memory, and numerous OPB peripherals.

• MicroBlaze applications can range from software-based simple state machines to complex controllers for Internet appliances or other embedded applications.

Page 13: Micro Blaze

MicroBlaze based embedded systems

• MicroBlaze soft processor core:– Orthogonal instruction set– 32 general purpose registers– Separate instruction and data buses (Harvard

architecture)– Built-in interfaces to fast on-chip memory and to IBM’s

industry-standard On-chip– Peripheral Bus (OPB)

• On-chip block RAM• Standard bus interconnects• On-chip Peripheral Bus (OPB) peripherals.

Page 14: Micro Blaze

MicroBlaze based embedded systems

• MicroBlaze soft processor core:• On-chip block RAM• Standard bus interconnects

– The data side and instruction side bus interfaces each have an interface to local memory (called the Local Memory Bus, or LMB) and an interface to IBM’s On-chip Peripheral Bus (OPB).

– LMB: single master bus protocol, apto para acceso rápido a Memoria en chip. (un ciclo)

– OPB: 32 bits wide multi master bus protocol, apto para acceso a Periféricos y memoria externa.

• On-chip Peripheral Bus (OPB) peripherals.

Page 15: Micro Blaze

MicroBlaze based embedded systems

• MicroBlaze soft processor core• On-chip block RAM• Standard bus interconnects• On-chip Peripheral Bus (OPB) peripherals.

– OPB peripherals complete the MicroBlaze hardware system and provide functions such as the following:

• Watchdog timer• General purpose timer/counters• Interrupt controller• UARTs• General purpose I/O• Memory controllers.

– In addition, you can define and add peripherals for custom functions, or as an interface to a design residing in the FPGA.

Page 16: Micro Blaze

MicroBlaze Architecture

Page 17: Micro Blaze

MicroBlaze Architecture

• The MicroBlaze embedded soft core includes the following features:– Thirty-two 32-bit general purpose registers– 32-bit instruction word with three operands and two addressing

modes– Separate 32-bit instruction and data buses that conform to IBM’s

OPB (On-chip Peripheral Bus) specification– Separate 32-bit instruction and data buses with direct connection

to on-chip block RAM through a LMB (Local Memory Bus)– 32-bit address bus– Single issue pipeline– Hardware multiplier (in Virtex-II and subsequent devices)

Page 18: Micro Blaze

Pipeline Architecture• The MicroBlaze pipeline is a parallel pipeline, divided into three

stages:– Fetch– Decode– Execute

• In general, each stage takes one clock cycle to complete. Consequently, it takes three clockcycles (ignoring any delays or stalls) for the instruction to complete.

Page 19: Micro Blaze

Load/Store Architecture• MicroBlaze can access memory in the following three data sizes:

– Byte (8 bits)– Halfword (16 bits)– Word (32 bits)

• Memory accesses are always data-size aligned. For halfword accesses, the least significant address bit is forced to 0. Similarly, for word accesses, the two least significant address bits are forced to 0.

• MicroBlaze is a Big-Endian processor and uses the Big-Endian address and labeling conventions shown in Figure 2 when accessing memory. The following abbreviations are used:– MSByte: Most Significant Byte– LSByte: Least Significant Byte– MSBit: Most Significant Bit– LSBit: Least Significant Bit

Page 20: Micro Blaze
Page 21: Micro Blaze

MicroBlaze Bus Interfaces• Arquitectura Harvard: buses independientes para instrucciones y datos• Cada Bus además, está replicado:

– LMB: Local Memory Bus– OPB: On-Chip Peripherical Bus

• Hay 6 configuraciones posibles del MicroBlaze:

Page 22: Micro Blaze

MicroBlaze Bus Interfaces

Page 23: Micro Blaze

Ejemplos

Page 24: Micro Blaze

Ejemplos. Configuración 1

Page 25: Micro Blaze

Ejemplos.

Page 26: Micro Blaze

Ejemplos: Configuración 3

Page 27: Micro Blaze

Ejemplos

Page 28: Micro Blaze

Ejemplos: Configuración 5

Page 29: Micro Blaze

Microprocessor Hardware Specification (MHS) format

• In the initial phase of MicroBlaze platform design, you create an MHS (Microprocessor Hardware Specification) file that is used by the Platform Generator (PlatGen es una herramienta del SDK) . This file defines your platform configuration, and includes the following:– Peripherals– One of six configurations of the MicroBlaze bus interfaces– Connectivity of the system– Address space

• Este archivo se crea automáticamente mediante las herramientas del EDK, pero es bueno conocer su sintaxis. Referenciar el manual de MicroBlaze.

Page 30: Micro Blaze

Microprocessor Peripheral Definition Format

• The Platform Generator allows you to partition your peripherals into one or more reusable modules. The MPD file provides peripheral information to the Platform Generator, and has the following characteristics:– Lists ports and default connectivity for the OPB interface (as

defined by IBM). Forexample, the MPD file can include information that maps a signal UART_xferAck to Sl_xferAck.

– Can contain attributes set by you– Supplied by the IP provider– Any MPD option is overwritten by the equivalent MHS

assignment (refer to theMicroprocessor Hardware Specification Format document for more details)

– Individual peripheral documentation contains information on all MPD file options

Page 31: Micro Blaze

MicroBlaze Processor• Scalable 32-bit Core

– Single-Issue pipeline• Supports either 3-stage (resource focused) or 5-stage pipeline (performance

focused)– Configurable Instruction and Data Caches

• Direct mapped (1-way associative)– Optional Memory Mgt or Memory Protection Unit

• Required for Linux OS (Linux 2.6 is currently supported)– Floating-point unit (FPU)

• Based upon IEEE 754 format– Barrel Shifter– Hardware multiplier

• 32x32 multiplication to generate a 64-bit result– Hardware Divider– Fast Simplex Link FIFO Channels for Easy, Direct Access to Fabric and

Hardware Acceleration– Hardware Debug and Trace Module

Page 32: Micro Blaze

Busses 101

MicroBlaze™

DPLBLocal

Memory

DLMB

IIC

PLB ARB

GPIO

UART

Ethernet

Timer/PWM

BRAM

InterruptController

ILMB

LMB Buses

IXCLDXCL

CacheLinks

The MicroBlaze processor core is organized as a Harvard architecture

Multi-Port MemoryController

FSL

Co-Processor

IPLB

Separate busses fordata and instruction

Page 33: Micro Blaze

MicroBlaze System

MicroBlaze32-Bit RISC Core

UART10/100E-Net

Memory Controller

Off-ChipMemory

FLASH/SRAM

Fast Simplex Link

0,1….15

CustomFunctions

CustomFunctions

BRAM Local Memory

BusD-CacheBRAM

I-CacheBRAM

ConfigurableSizes

Arb

iter PLB

Processor Local Bus

CacheLink

SDRAM

On-Chip Peripheral Bus

GPIO

BusBridge

OPB

Arb

iter

On-ChipPeripheral