FPGA & Verilog Today’s lecture: Soft core processors A short course on

Slides:



Advertisements
Similar presentations
Comparison of Altera NIOS II Processor with Analog Device’s TigerSHARC
Advertisements

Chapter 2 Data Manipulation Dr. Farzana Rahman Assistant Professor Department of Computer Science James Madison University 1 Some sldes are adapted from.
Internal Logic Analyzer Final presentation-part B
EEE226 MICROPROCESSORBY DR. ZAINI ABDUL HALIM School of Electrical & Electronic Engineering USM.
Khaled A. Al-Utaibi  Computers are Every Where  What is Computer Engineering?  Design Levels  Computer Engineering Fields  What.
Avalon Switch Fabric. 2 Proprietary interconnect specification used with Nios II Principal design goals – Low resource utilization for bus logic – Simplicity.
Graduate Computer Architecture I Lecture 15: Intro to Reconfigurable Devices.
Week 1- Fall 2009 Dr. Kimberly E. Newman University of Colorado.
Extensible Processors. 2 ASIP Gain performance by:  Specialized hardware for the whole application (ASIC). −  Almost no flexibility. −High cost.  Use.
Processor Technology and Architecture
Term Project Overview Yong Wang. Introduction Goal –familiarize with the design and implementation of a simple pipelined RISC processor What to do –Build.
Project Testing; Processor Examples. Project Testing --thorough, efficient, hierarchical --done by “independent tester” --well-documented, repeatable.
Configurable System-on-Chip: Xilinx EDK
Chapter 4 Processor Technology and Architecture. Chapter goals Describe CPU instruction and execution cycles Explain how primitive CPU instructions are.
Technion – Israel Institute of Technology Department of Electrical Engineering High Speed Digital Systems Lab Project performed by: Naor Huri Idan Shmuel.
1 Fast Communication for Multi – Core SOPC Technion – Israel Institute of Technology Department of Electrical Engineering High Speed Digital Systems Lab.
ECE Department: University of Massachusetts, Amherst Lab 1: Introduction to NIOS II Hardware Development.
Lecture 7 Lecture 7: Hardware/Software Systems on the XUP Board ECE 412: Microcomputer Laboratory.
Using FPGAs with Embedded Processors for Complete Hardware and Software Systems Jonah Weber May 2, 2006.
Prardiva Mangilipally
Microcontroller based system design
Octavo: An FPGA-Centric Processor Architecture Charles Eric LaForest J. Gregory Steffan ECE, University of Toronto FPGA 2012, February 24.
EKT303/4 PRINCIPLES OF PRINCIPLES OF COMPUTER ARCHITECTURE (PoCA)
Technion – Israel Institute of Technology Department of Electrical Engineering High Speed Digital Systems Lab Spring 2009.
Computer Architecture ECE 4801 Berk Sunar Erkay Savas.
Microcontrollers in FPGAs Tomas Södergård University of Vaasa.
ECE Department: University of Massachusetts, Amherst Using Altera CAD tools for NIOS Development.
1 3-General Purpose Processors: Altera Nios II 2 Altera Nios II processor A 32-bit soft core processor from Altera Comes in three cores: Fast, Standard,
© 2005 Altera Corporation SOPC Builder: a Design Tool for Rapid System Prototyping on FPGAs Kerry Veenstra Workshop on Architecture Research using FPGA.
집적회로 Spring 2007 Prof. Sang Sik AHN Signal Processing LAB.
Stanford µSequencer December Motivation Control, initialization, and constant maintenance of Avalon peripherals –Perfectly deterministic Microprocessor.
J. Christiansen, CERN - EP/MIC
ECE 448 – FPGA and ASIC Design with VHDL Lecture 12 PicoBlaze Overview.
NIOS II Ethernet Communication Final Presentation
ECE 448 – FPGA and ASIC Design with VHDL Lecture 12 PicoBlaze Overview.
Lecture #3 Page 1 ECE 4110–5110 Digital System Design Lecture #3 Agenda 1.FPGA's 2.Lab Setup Announcements 1.HW#2 assigned Due.
EE3A1 Computer Hardware and Digital Design
EKT303/4 PRINCIPLES OF PRINCIPLES OF COMPUTER ARCHITECTURE (PoCA)
A Monte Carlo Simulation Accelerator using FPGA Devices Final Year project : LHW0304 Ng Kin Fung && Ng Kwok Tung Supervisor : Professor LEONG, Heng Wai.
Lab 2 Parallel processing using NIOS II processors
Tools - LogiBLOX - Chapter 5 slide 1 FPGA Tools Course The LogiBLOX GUI and the Core Generator LogiBLOX L BX.
Computer Architecture 2 nd year (computer and Information Sc.)
Chapter 13 – I/O Systems (Pgs ). Devices  Two conflicting properties A. Growing uniformity in interfaces (both h/w and s/w): e.g., USB, TWAIN.
© 2010 Altera Corporation - Public Lutiac – Small Soft Processors for Small Programs David Galloway and David Lewis November 18, 2010.
Processor Structure and Function Chapter8:. CPU Structure  CPU must:  Fetch instructions –Read instruction from memory  Interpret instructions –Instruction.
Proposal for an Open Source Flash Failure Analysis Platform (FLAP) By Michael Tomer, Cory Shirts, SzeHsiang Harper, Jake Johns
Lecture 7: Overview Microprocessors / microcontrollers.
CDA 4253 FPGA System Design The PicoBlaze Microcontroller
Teaching Digital Logic courses with Altera Technology
Survey of Reconfigurable Logic Technologies
CSIT 301 (Blum)1 Instructions at the Lowest Level Some of this material can be found in Chapter 3 of Computer Architecture (Carter)
Embedded Systems Design with Qsys and Altera Monitor Program
FPGA Technology Overview Carl Lebsack * Some slides are from the “Programmable Logic” lecture slides by Dr. Morris Chang.
Lecture 23 Softcore Processors
Introduction to the FPGA and Labs
Programmable Logic Devices
Basic Computer Organization and Design
Lab 1: Using NIOS II processor for code execution on FPGA
ECE354 Embedded Systems Introduction C Andras Moritz.
Introduction to Programmable Logic
Lecture 15 PicoBlaze Overview
Instructor: Dr. Phillip Jones
Instructions at the Lowest Level
Avalon Switch Fabric.
Lecture 14 PicoBlaze Overview
Lecture 16 PicoBlaze Overview
FPro Bus Protocol and MMIO Slot Specification
Lecture 23 Softcore Processors
The performance requirements for DSP applications continue to grow and the traditional solutions do not adequately address this new challenge Paradigm.
Presentation transcript:

FPGA & Verilog Today’s lecture: Soft core processors A short course on Hosted @ School of Electrical and Electronic Engineering; Uni. of Johannesburg A short course on FPGA & Verilog presented by Dr. Simon Winberg Software Defined Radio Research Group (SDRG), UCT John-Philip Taylor Pelindaba Laboratory for Accelerator and Beam-line Sciences (PLABS) at NECSA November 2014 Day #2 Today’s lecture: Soft core processors

Mission Brief FPGA soft core processors Overview of soft cores Ingredients needed for a soft core Soft cores vs. hard core: a fair contest? Considerations when using soft cores Case studies NIOS II PicoBlaze DUGONG

Soft core Processors: Processors within FPGAs What is a ‘soft core’? It is essentially an item of Intellectual Property (IP) that contains the design of a processor. A soft core can be incorporated into a design and then the design synthesized, place & routed to generate an executable. Examples of these: Altera NIOS II Xilinx Microblaze & Xilinx Picoblaze A variety of ARM processors How do these compare to hard cores? … see later!

How a Soft core typically fits in to a design Soft Core Processor

Address Bus for the Processor FFT Engine Timer GPIO Eth MAC VGA … etc …

Ingredients Needed for Soft Cores Could implement it all as gates, but that can be rather inefficient and wasteful On-chip resources that soft core processors typically use: RAM blocks - various configurations Full adders DSP cores (e.g. integer multipliers, etc.) State machines

Softcore = Lite/Easy?? Hardcore = Difficult?? Hard core vs. Soft core ?! Softcore = Lite/Easy?? Hardcore = Difficult?? Not necessarily…

Hard Core Processor Characteristics Not implemented as gateware programmed into the FPGA logic Implemented in silicon / ASIC; unchangeable Benefits: Usually much higher performance Manufacturer typically provides optimized compiler for their chips

Considerations for Using Soft Core Processors A major purpose is: Make it easier to transfer data Highly configurable processor structure – e.g. add a custom instruction to baseline processor Set up the initial conditions of your design / HDL block configuration Of course also e.g. testing novel processor designs Should consider the soft core processor is More an aid to control the system facilitate comms, advantages of software running in system, e.g. O/S The soft core processor shouldn’t Be provide the main solution to you digital accelerator, unless there is good reason such as experimenting with performance of a cluster of processors on FPGA

Case Studies (shortly) NIOS II Altera’s soft core processor, 32 bit, configurable Commercial NIOS II Gen2 improved, more options Alternate soft cores: MP32 / MIPS32, ARM Picoblaze 8 bit, simple RISC instructions Free for use on Xilinx DUGONG Planning to be control module Opensource More powerful, closer to full CPU Simpler, closer to simple FSM

Soft Core Case Studies Nios II PicoBlaze Xilinx DUGONG (Open source)

Altera Nios II Processor A 32-bit soft core processor from Altera Three standard cores versions: Fast, Standard, Light The cores have tradeoffs in: FPGA LEs needed  power  speed RISC architecture: Simple instructions Harvard Architecture: Separated data and instruction memories (a likely safer approach to the Von Neumann arch. style) 32 interrupt levels Avalon Bus interface C/C++ compilers; can also use plain assembly

NIOS II Architecture Let’s have a closer look at the core Image source: www.altera.com

NIOS II Core

How do you get a NIOS II soft core and set it up?

Generating a Nios II Processor Using the Altera SOPC Builder to configure and generate a soft core The SOPC tool is in Quartus II version 9 and earlier versions The SOPC Builder has subsequently been replaced by the Altera Qsys tool

Altera Qsys: In later versions of Quartus II 1. Select Tools 2. Select Qsys

Altera QSys

SOPC Builder (in Quatus II you are using) whirlwind tour of SOPC Builder (in Quatus II you are using)

1. Select Tools 2. Select SOPC Builder

Use the library tree to select from available components (e. g Use the library tree to select from available components (e.g. serial communication standards) to add. …

Each component you add may have a variety of configuration options that you can choose from. E.g. when adding a UART you are asked what the baudrate should be, data bits, etc. Many of the settings may be pre-assigned to defaults. Press to continue

Adds the new component to the list Look for errors that may crop up; does various dependency checks as you build up the system.

You can also add your own custom-coded components..

Eventually culminates in a structure like this Eventually culminates in a structure like this. Note visual display shows address range each peripheral is assigned to, and their IRQ lines, etc.

Soft Core Case Studies Nios II PicoBlaze Xilinx DUGONG (Open source)

PicoBlaze Soft Core Processor Info available from: www.xilinx.com/picoblaze Size: Takes on 96 slices !! (slice = group of PLBs) Big advantage considering low cost FPGAs have a few 100 slices; and 1000s slices for medium range Not coded as behavioral VHDL It is manually pre-compiled (IP block) Built by instantiation of Xilinx raw primitives Can still be simulated using Modelsim

PicoBlaze Soft Core Processor Main Uses Control / configuration of parameters Some data processing (add / integer operations) Comms / UI facilities (i.e. ‘talk’ to control PC, especially UART, USB connection) Testing & debugging your design on hardware

PicoBlaze Soft Core Processor Can be very helpful to speed-up & simplify development Changing the instructions running on the softcore PicoBlaze is likely faster than changing the HDL code (especially with rebuilding time) Has a simple and easy to learn instruction set, also offers opportunities for reuse of the PicoBlaze code in other systems.

PicoBlaze Architecture ECE 448 – FPGA and ASIC Design with VHDL

Overview of the PicoBlaze

Interfacing to the PicoBlaze clock PicoBlaze KCPSM = constant (K) Coded Programmable State Machine

PicoBlaze Interface Name Direction Size Function clk input 1 System clock signal in reset Reset signal address output 10 Address of instruction mem. Specifies address of the instruction to be retrieved. Instruction 18 Fetched instruction. port_id 8 Address of the input or output port. in_port Input data from I/O peripherals. read_strobe Strobe associated with the input operation. out_port Output data to I/O peripherals. write_strobe Strobe associated with the output operation. interrupt Interrupt request from I/O peripherals. interrupt_ack Interrupt acknowledgment to I/O peripherals

PicoBlaze Addressing Modes Instruction example Explanation s2+08+C  s2 s7–7  s7 Immediate mode ADDCY s2,08 SUB s7, 7 Direct mode INPUT s5, 2a ADD sa, sf PORT[2a] s5 sa + sf  sa Indirect mode INPUT s9, (s2) STORE s3, (sa) PORT[RAM[s2]]s9 s3 RAM[RAM[sa]]

Example Program ; DEMONSTRATION PROGRAM ; EXERCISE THE 7 SEGMENT DISPLAYS cold_start: LOAD s3, 11 ; clear all time values OUTPUT s3, 04 LOAD s4, 00 OUTPUT s4, 05 main_loop: OUTPUT s5,04 ; Update 4 digit 7 seg display OUTPUT s3,06 JUMP main_loop

Soft Core Case Studies Nios II PicoBlaze DUGONG Xilinx (Open source)

DUGONG Developed by Matthew Bridges (SDRG student), part of a larger research project Designed from scratch (a solution to a need) Design around compatibility with Wishbone interface Designed with a focus on simplicity with scalability Available at: https://github.com/matthewbridges/dugong But what is it???

‘DUGONG’ name? A dugong is actually a type of underwater mammal, colloquially called ‘sea cow’ that is found in the Indian Ocean (similarities to ‘manatees’) The DUGONG controller was given this name as it’s a ‘underwater’ hidden feature, and no one else is likely to choose the name… and it is a kind of grazer like a RHINO

DUGONG Essentially it is a glorified state machine But has limited number of states and transition types (i.e. predefined list of triggers, operations, transitions, etc.)

DUGONG Essentially it is a glorified state machine Works as follows: A list of timing and transfer operations are loaded into it, and it runs through these sequentially Send config OP1 OP2 OP3 OP1 OP2 OP3 Data in MODES: Config Redirect Various other modes, some simultaneous.

To control processor interface (GPMC bus on RHINO) DUGONG Structure Has one register, the accumulator, through which data is transferred. To control processor interface (GPMC bus on RHINO) WISHBONE

Connecting to DUGONG Serves as the Master on the wishbone bus Wishbone bus: Open source hardware interconnect bus structure for connecting computational blocks within ICs / reconfigurable computers. This bus structure is commonly used by designs provided by OpenCores.

How DUGONG fits in to a Wishbone-based design Controls the wishbone clock lines, etc.

DUGONG Designed around simplicity & scalability (connect up and configure small to big designs) Has no function unit (FU) – with good reason Can I use it for processing? Comparisons? Sorry, no can do: that is someone else's problem (or rather use a CPU e.g. Nios II) There are lots of other opensource soft cores available, see e.g.: OpenCores.org: http://opencores.org/ Open Hardware Repository: http://www.ohwr.org/

DUGONG Instruction Set 4 bit Instruction Set Structure: <CODE:4 bits> <DATA:28 bits> Code Instruction Description 0000 NOP No operation 0001 WRITE Write data to addr 0010 READA Read from addr to acc 0011 WRITEA Write from acc to addr 0100 BRANCH write data to pc / controller 1000 WAIT Wait for a number of clock cycles equal to data field

DUGONG Typical Program WRITE #0, [0xFF000000] // write 0 to address READA [0xFF100000] // read from addr into A WAIT #4 // wait for 4 clock cycles WRITEA [0xFF200000] // write A to addr BRANCH // send data in A to controller NOP NOP …

DUGONG & BORPH BORPH = Berkeley Operating system for ReProgrammable Hardware (BORPH) A modification of the Linux kernel that caters for a processor connected to an FPGA Borph BOF files (a type of executable program in Borph) A bit file the FPGA is programmed with Collection of drivers that are loaded together with corresponding bitfile (sets up devices in /dev) Finding out more: Borph: http://www.eecs.berkeley.edu/Pubs/TechRpts/2007/EECS-2007-92.html Borph port for RHINO: https://github.com/brandonhamilton/BORPH RHINO platform: http://www.ohwr.org/projects/rhino-hardware-01

Q & A

Day 2 TutorialS