Fpga Based Embedded System
Fpga Based Embedded System
System Design
Presented By:
Technomeet on
Techknowledge Updation
Department of Electronics and Communication Engineering,
Mepco Schlenk Engineering College, Sivakasi
Outline
CSE, IITKGP 2
Integrated Circuits
ASIC
3
Programmable Logic Device (PLD)
Logic gates
Inputs and Outputs
(logic variables) programmable (logic functions)
switches
4
Programmable Technologies
One-time programmable
Anti-fuse based
Opposite of a regular fuse
Normally an open circuit until a programming
current is forced on it (approx. 5 mA)
Non-volatile reprogrammable
Flash/EPROM based
Limited reconfiguration cycles
Reprogramming – slow
Volatile reprogrammable
SRAM based
Unlimited number of reconfigurations possible
Microseconds to milliseconds for reprogramming
5
CPLD or FPGA?
CPLD FPGA
Non-volatile SRAM reconfiguration
Combinational Logic Excellent for computer
Building block is the architecture, DSP, registered
macro cell, which contains designs
logic implementing ASIC like design flow
disjunctive normal form PROM required for non-volatile
expressions and more operation
specialized logic Fair Sized Project
operations
Implementations
Small student projects,
lower level courses
6
Island style FPGAs
Programmable
Interconnect
7
Field-Programmable Gate Arrays (FPGAs)
• Fine-grained reconfigurable hardware
• Gate-Array: regular structure of “logic cells”, connected through an interconnection
network
• Configuration stored in SRAM, must be loaded on startup
EPROM
CSE, IITKGP 8
Inside FPGAs
Embedded RAM IP Core
• Programmable Logic Blocks PLB
I/O Buffer
N
LUT/
RAM FF PLB Outputs
PLB Inputs
CSE, IITKGP 9
An Example: 2-input LUT
x1 x1 x2 f1 x1
0 0 1
0/1 0 1 0 1
0/1 1 0 0 0
f 1 1 1 f1
0/1 0
0/1 (b) f 1 = x1x2+ x1x2 1
x2 x2
10
LUT + Flip-flop
Select
Out
Flip-flop
In
1
In LUT D Q
2
In
3
Clock
11
Configurable Logic Block
Other
9%
Actel
7% Xilinx
35%
Lattice
16%
Altera
33%
CSE, IITKGP 14
Xilinx FPGA Product Families
Virtex-II (“Platform FPGA”, 10M gates)
Virtex (1M gates), Virtex-E (3M gates)
Spartan (low cost ASIC replacement)
XC4000 (first FPGA family, now with
enhancements)
CSE, IITKGP 15
Altera FPGA Product Families
APEX-II (up to 7M gates)
APEX20K (up to 1.5M gates)
Mercury (ASIC replacement, “ASSP”)
FLEX 10K
CSE, IITKGP 16
Outline
CSE, IITKGP 17
Xilinx Virtex-4 FPGAs
• Configuration memory: 4.7M to 50.8M bits of
RAM
• PLBs: 1,536 to 22,272
– 4 slices per PLB
• 2 LUTs & 2 FFs per slice
• 2 slices can operate as RAMs/SRs PC
• Block RAMs: 48 to 552 18K-bit dual-port
RAMs
– Also operate as FIFOs
• DSP cores: 32 to 512, each includes:
– 18x18-bit multiplier
– 48-bit adder & accumulator PC
• Up to 2 PowerPC processors
CSE, IITKGP 18
Xilinx Spartan-3 Family
• The Spartan product is a cost reduced, high
volume FPGA. Most Spartan devices are a
close relative to another Xilinx product.
• There are several Spartan FPGA families:
– Spartan-II, Spartan-IIE (similar to Virtex).
– Spartan-3, Spartan-3E (similar to Virtex-4).
Presentation Name 19
Spartan-3 Product Matrix
100X Density Range
Device XC3S50 XC3S200 XC3S400 XC3S1000 XC3S1500 XC3S2000 XC3S4000 XC3S5000
System Gates 50K 200K 400K 1000K 1500K 2000K 4000K 5000K
Logic Cells 1,728 4,320 8,064 17,280 29,952 46,080 62,208 74,880
Block RAM Bits 72K 216K 288K 432K 576K 720K 1,728K 1,872K
Distributed RAM Bits 12K 30K 56K 120K 208K 320K 432K 520K
DCMs 2 4 4 4 4 4 4 4
I/O Standards 24 24 24 24 24 24 24 24
Max Single Ended I/O 124 173 264 391 487 565 712 784
Presentation Name 20
Spartan-3 FPGA Board
Xilinx’s ISE
CSE, IITKGP 24
Outline
CSE, IITKGP 25
Xilinx’s ISE Design Flow
CSE, IITKGP 26
ISE Design flow
Specification
Specification Synthesis
Synthesis
Generic
HDL or Netlist
Schematics
Technology
Technology
Mapping
Mapping
Device
Device Place Dependent
Device Place and
and Netlist
Configuration
Configuration Route
Route
Bit stream
27
FPGA tool flow
HDL
(VHDL / Hardware design is traditionally done by
Verilog)
modeling the system in a hardware
description language
Synthesize
An FPGA “compiler” (synthesis tool)
generates a netlist
Netlist which is then mapped to the FPGA
technology
Map the inferred components are placed on the
chip
Place
and the connecting signals are routed
Route through the interconnection network
Bitstream
28
HDL Synthesis
Map
Register
Place
a D Q output
Route b
clk
clear
Bitstream reset
29
Technology Mapping
Register
HDL
a D Q output
(VHDL /
b
Verilog)
clk
clear
Synthesize
reset
Netlist
Map
Place
Route
Bitstream
30
Place & Route
HDL
(VHDL /
Verilog)
Synthesize
Netlist
Map
Place
Route
Bitstream
31
Outline
CSE, IITKGP 32
Embedded Systems
• An embedded system is a computing system
(other than a general-purpose computer) with
the following general characteristics
– Single-functioned
• Typically, is designed to perform predefined function
– Tightly constrained
• Tuned for low cost
• Single-to-fewer components based
• Performs functions fast enough
• Consumes minimum power
– Reactive and real-time
• Must continually monitor the desired environment and
react to changes
– Hardware and software co-existence
CSE, IITKGP 33
Embedded Systems
• Examples:
– Communication devices
• Wired and wireless routers and switches
– Automotive applications
• Braking systems, traction control, airbag release
systems, and cruise-control applications
– Aerospace applications
• Flight-control systems, engine controllers, auto-
pilots and passenger in-flight entertainment
systems
– Defense systems
• Radar systems, fighter aircraft flight-control
systems, radio systems, and missile guidance
systems
CSE, IITKGP 34
Current Technologies
• Microcontroller-based systems
• DSP processor-based systems
• ASIC technology
• FPGA technology
CSE, IITKGP 35
Embedded Design in an FPGA
Others
NIOS (Altera), ARM, PicoBlaze [soft core; 8-bit] (Xilinx), ...
37
Processor in FPGA
Softcore microprocessor: using FPGA resources only
Synthesize and compiling need: tools are very important
Xilinx offering: MicroBlaze & PicoBlaze
Altera offering: NIOS
38
FPGA Soft Core Processors
Soft-core Processor
HDL description
HDL
Flexible implementation Description
FPGA or ASIC
Technology independent
A soft processor is very FPGA ASIC
configurable
How to optimize the implementation
without too many variants?
Avoid too much low-level and only do Spartan 3 Virtex 2 Virtex 4
it when necessary
MicroBlaze is a mixture of very
detailed implementation and pure
RTL code
39
FPGA Soft Core Processors
Cache
Bus architecture
Altera Nios
FPU
μP MAC
Cache
FPGA
40
Embedded Processors
Virtex-4 Processors:
41
IP Cores
IP Cores are pre-designed HDL codes optimised for
a particular functions
Accepts parameters, and generates behavioural &
optimised HDL structures
Design reuse, ease of design (eg. coregen) for FPGA,
outsourcing
42
PowerPC-based Embedded Design
RocketIO
Dedicated Hard IP
DSOCM ISOCM
BRAM PowerPC BRAM Flexible Soft IP
405 Core IBM CoreConnect™
DCR Bus on-chip bus standard
Instruction Data
PLB, OPB, and DCR
PLB OPB
Arbiter
Arbiter
Bus
Processor Local Bus On-Chip Peripheral Bus
Bridge
e.g.
Hi-Speed Memory GB On-Chip
UART GPIO
Peripheral Controller E-Net Peripheral
I-Cache
Arbiter
Bus
On-Chip Peripheral Bus Bridge
Processor Local Bus
0,1…….32
e.g.
Hi-Speed Memory GB
Custom Custom Peripheral Controller E-Net
Functions Functions
10/100 On-Chip
UART
E-Net Peripheral
Off-Chip FLASH/SRAM
Memory
Source: Xilinx
CSE, IITKGP 44
What is Microblaze?
CSE, IITKGP 46
MicroBlaze v4.00 Block Diagram
Enhanced CPI
Multiplier
FPU
Enhanced
Debug
47
PicoBlaze KCPSM3 processor
48
PicoBlaze KCPSM3 processor
49
Outline
CSE, IITKGP 50
Traditional Embedded System
Power Supply
Ethernet Audio CLK
CLK
MAC Codec
GP I/O Interrupt
Controller
Timer
Address
Decode
Unit
CPU UART
L
(uP / DSP) Co- C
Memory Proc. custom
CLK Controller IF-logic
Power Supply
Ethernet Audio CLK
CLK
MAC FPGA Codec
GP I/O Interrupt
Controller
Timer
Address
Decode
Unit
CPU UART
L
(uP / DSP) Co- C
Memory Proc. custom
CLK Controller IF-logic
Audio
Codec EPROM
Power Supply
L
C
1. Overview:
Xilinx EDK / MicroBlaze Soft CPU core
Design- / Tool-Flow
2. Demonstration:
Create a simple system
Implement the system on a Xilinx Spartan-III FPGA
Soft CPU Core: MicroBlaze (Xilinx Inc.)
MicroBlaze: Architecture & Features
Architecture
OPB
LMB
Features • RISC
• 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 OPB (On-chip Peripheral Bus)
• Separate 32-bit instruction and data buses LMB (Local Memory Bus)
• Hardware multiplier (in Virtex-II and subsequent devices)
MicroBlaze: Bus Configurations
1.
MicroBlaze core
2.
3.
4.
CSE, IITKGP 59
Embedded Development
Tool Flow Overview
Standard Embedded SW Standard FPGA HW
Development Flow Development Flow
C Code VHDL/Verilog
Compiler/Linker Synthesizer
(Simulator) Simulator
? ?
CPU code in CPU code in
off-chip on-chip
memory memory Download to FPGA
Debugger
Source: Xilinx
CSE, IITKGP 60
EDK
• The Embedded Development Kit (EDK) consists of
the following:
– Xilinx Platform Studio – XPS
– Base System Builder – BSB
– Create and Import Peripheral Wizard
– Hardware generation tool – PlatGen
– Library generation tool – LibGen
– Simulation generation tool – SimGen
– GNU software development tools
– System verification tool – XMD
– Virtual Platform generation tool - VPgen
– Software Development Kit (Eclipse)
– Processor IP
– Drivers for IP
– Documentation
• Use the GUI or the shell command tool to run EDK
EDK Tools
• EDK = Embedded Development Kit
• XPS = Xilinx Platform Studio
• PlatGen = Platform Generator
– Uses an MHS file to create an implementation netlist of a
bus-based subsystem
• LibGen = Library Generator
– Uses the MHS and MSS files, software libraries, and source
files to generate an executable image
• SimGen = Simulation Generator
– Uses the MHS file to generate a simulation environment
including simulation models, HDL wrappers, simulation
scripts, etc.
• XMD = Xilinx Microprocessor Debugger
– Provides communication between the GDB and the
processor
• CreateIP = Create/Import Peripheral Wizard
– Helps you create your own peripherals and import them into
EDK compliant repositories or Xilinx Platform Studio (XPS)
projects
EDK Files
Platform Definition
(peripherals, configuration,
connectivity, address space)
*.mhs
Generate
Netlist
Platform Definition
(peripherals, configuration,
connectivity, address space)
*.mhs
Generate
Netlist
ISE
XPS
Generate *.bit
Bitstream
*.c *.asm
Platform Definition Gen.
(peripherals, configuration, Libs
connectivity, address space) *.h
*.mhs
Compile
Generate
&
Netlist
Link
ISE
XPS
Generate *.bit
Bitstream
*.c *.asm
Platform Definition Gen.
(peripherals, configuration, Libs
connectivity, address space) *.h
*.mhs
Compile
Generate
&
Netlist
Link
ISE
XPS
Update
Generate *.bit Bitstrea
Bitstream m
*.bit
EDK: Embedded Development Kit
XPS: Xilinx Platform Studio
ISE: Integrated Software Environment
MHS: Microprocessor Hardware Specification
Outline
CSE, IITKGP 68
Xilinx Spartan 3E kit
CSE, IITKGP 69
Demonstration:
An application using PicoBlaze: [Using Xilinx ISE
tool]
70
Demonstration…
That’s all about FPGA-based(Xilinx)
Embedded System Design
CSE, IITKGP 72
For more information...
Xilinx EDK & MicroBlaze: www.xilinx.com/edk
Embedded Processing:
http://www.xilinx.com/products/design_resources/proc_central/index.htm
http://www.xilinx.com/bvdocs/userguides/ug129.pdf
http://www.xilinx.com/products/boards/s3estarter/reference_designs.htm
http://www.xilinx.com/ipcenter/processor_central/picoblaze/picoblaze_user_resources.htm
CSE, IITKGP 74