advanced vlsi sopc design flowaccess.ee.ntu.edu.tw/.../course_outline/sopc1.pdf · pp. 2 outline...

71
ACCESS IC LAB Graduate Institute of Electronics Engineering, NTU Advanced VLSI Advanced VLSI SOPC design flow SOPC design flow Advisor: 吳安宇 Speaker: 沈文中

Upload: others

Post on 21-Aug-2020

1 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Advanced VLSI SOPC design flowaccess.ee.ntu.edu.tw/.../course_outline/sopc1.pdf · pp. 2 Outline What’s SOC? IP classification IP reusable & benefit SOPC solution on FPGA SOPC design

ACCESS IC LAB

Graduate Institute of Electronics Engineering, NTU

Advanced VLSIAdvanced VLSISOPC design flowSOPC design flow

Advisor: 吳安宇Speaker: 沈文中

Page 2: Advanced VLSI SOPC design flowaccess.ee.ntu.edu.tw/.../course_outline/sopc1.pdf · pp. 2 Outline What’s SOC? IP classification IP reusable & benefit SOPC solution on FPGA SOPC design

ACCESS IC LAB Graduate Institute of Electronics Engineering, NTU

pp. 2

OutlineOutlineWhat’s SOC?IP classificationIP reusable & benefitSOPC solution on FPGASOPC design flow

Page 3: Advanced VLSI SOPC design flowaccess.ee.ntu.edu.tw/.../course_outline/sopc1.pdf · pp. 2 Outline What’s SOC? IP classification IP reusable & benefit SOPC solution on FPGA SOPC design

ACCESS IC LAB Graduate Institute of Electronics Engineering, NTU

pp. 3

OutlineOutlineWhat’s SOC?

Definition of SOCAdvantage of SOC

IP classificationIP reusable & benefitSOPC solution on FPGASOPC design flow

Page 4: Advanced VLSI SOPC design flowaccess.ee.ntu.edu.tw/.../course_outline/sopc1.pdf · pp. 2 Outline What’s SOC? IP classification IP reusable & benefit SOPC solution on FPGA SOPC design

ACCESS IC LAB Graduate Institute of Electronics Engineering, NTU

pp. 4

SystemSystem--onon--aa--ChipChip

1. Use standard bus, to transfer data among blocks.

2. For bus IO, block reusable is benefit.3. IO pad of chip is the limit of freq. But freq. in

the same chip can be higher.

Page 5: Advanced VLSI SOPC design flowaccess.ee.ntu.edu.tw/.../course_outline/sopc1.pdf · pp. 2 Outline What’s SOC? IP classification IP reusable & benefit SOPC solution on FPGA SOPC design

ACCESS IC LAB Graduate Institute of Electronics Engineering, NTU

pp. 5

Changes in the Nature of IC Changes in the Nature of IC DesignDesign

Page 6: Advanced VLSI SOPC design flowaccess.ee.ntu.edu.tw/.../course_outline/sopc1.pdf · pp. 2 Outline What’s SOC? IP classification IP reusable & benefit SOPC solution on FPGA SOPC design

ACCESS IC LAB Graduate Institute of Electronics Engineering, NTU

pp. 6

Ex: JPEG video systemEx: JPEG video system

Page 7: Advanced VLSI SOPC design flowaccess.ee.ntu.edu.tw/.../course_outline/sopc1.pdf · pp. 2 Outline What’s SOC? IP classification IP reusable & benefit SOPC solution on FPGA SOPC design

ACCESS IC LAB Graduate Institute of Electronics Engineering, NTU

pp. 7

SOCSOC製製程演進階段程演進階段

Page 8: Advanced VLSI SOPC design flowaccess.ee.ntu.edu.tw/.../course_outline/sopc1.pdf · pp. 2 Outline What’s SOC? IP classification IP reusable & benefit SOPC solution on FPGA SOPC design

ACCESS IC LAB Graduate Institute of Electronics Engineering, NTU

pp. 8

SystemSystem--level IC Developmentlevel IC Development

Page 9: Advanced VLSI SOPC design flowaccess.ee.ntu.edu.tw/.../course_outline/sopc1.pdf · pp. 2 Outline What’s SOC? IP classification IP reusable & benefit SOPC solution on FPGA SOPC design

ACCESS IC LAB Graduate Institute of Electronics Engineering, NTU

pp. 9

OutlineOutlineWhat’s SOC?IP classification

Soft IPFirm IPHard IP

IP reusable & benefitSOPC solution on FPGASOPC design flow

Page 10: Advanced VLSI SOPC design flowaccess.ee.ntu.edu.tw/.../course_outline/sopc1.pdf · pp. 2 Outline What’s SOC? IP classification IP reusable & benefit SOPC solution on FPGA SOPC design

ACCESS IC LAB Graduate Institute of Electronics Engineering, NTU

pp. 10

Types of IPTypes of IP1. Soft IP: (“Code”)

1. Synthesizable HDL description at RTL level2. Flexible: can be changed to suit an application3. Technology independent: may be re-synthesized

across process4. Significant IP protection risk

Page 11: Advanced VLSI SOPC design flowaccess.ee.ntu.edu.tw/.../course_outline/sopc1.pdf · pp. 2 Outline What’s SOC? IP classification IP reusable & benefit SOPC solution on FPGA SOPC design

ACCESS IC LAB Graduate Institute of Electronics Engineering, NTU

pp. 11

Types of IPTypes of IP1. Firm IP: (“synthesizable netlist +

structure”)1. Gate-level netlist optimized

structurally and topologically for performance and size

2. Floorplanning or placement without routing

Page 12: Advanced VLSI SOPC design flowaccess.ee.ntu.edu.tw/.../course_outline/sopc1.pdf · pp. 2 Outline What’s SOC? IP classification IP reusable & benefit SOPC solution on FPGA SOPC design

ACCESS IC LAB Graduate Institute of Electronics Engineering, NTU

pp. 12

Types of IP (cont.)Types of IP (cont.)3. Hard IP: (“physical”)

1. Ready for “drop in”2. Include layout and timing information3. Optimized for performance, size,

and power4. IP is easily protected

Page 13: Advanced VLSI SOPC design flowaccess.ee.ntu.edu.tw/.../course_outline/sopc1.pdf · pp. 2 Outline What’s SOC? IP classification IP reusable & benefit SOPC solution on FPGA SOPC design

ACCESS IC LAB Graduate Institute of Electronics Engineering, NTU

pp. 13

Categorizing Reusable BlocksCategorizing Reusable Blocks

Page 14: Advanced VLSI SOPC design flowaccess.ee.ntu.edu.tw/.../course_outline/sopc1.pdf · pp. 2 Outline What’s SOC? IP classification IP reusable & benefit SOPC solution on FPGA SOPC design

ACCESS IC LAB Graduate Institute of Electronics Engineering, NTU

pp. 14

Tradeoffs among types of blocksTradeoffs among types of blocks

Page 15: Advanced VLSI SOPC design flowaccess.ee.ntu.edu.tw/.../course_outline/sopc1.pdf · pp. 2 Outline What’s SOC? IP classification IP reusable & benefit SOPC solution on FPGA SOPC design

ACCESS IC LAB Graduate Institute of Electronics Engineering, NTU

pp. 15

OutlineOutlineWhat’s SOC?IP classificationIP reusable & benefitSOPC solution on FPGASOPC design flow

Page 16: Advanced VLSI SOPC design flowaccess.ee.ntu.edu.tw/.../course_outline/sopc1.pdf · pp. 2 Outline What’s SOC? IP classification IP reusable & benefit SOPC solution on FPGA SOPC design

ACCESS IC LAB Graduate Institute of Electronics Engineering, NTU

pp. 16

Engineering Productivity GapEngineering Productivity Gap

1. Engineering productivity has not been keeping up with silicon gate capacity for several years.

2. Companies have been using larger design teams, making engineers work longer hours, etc., but clearly the limit is being reached.

Page 17: Advanced VLSI SOPC design flowaccess.ee.ntu.edu.tw/.../course_outline/sopc1.pdf · pp. 2 Outline What’s SOC? IP classification IP reusable & benefit SOPC solution on FPGA SOPC design

ACCESS IC LAB Graduate Institute of Electronics Engineering, NTU

pp. 17

Why must IP Reuse?Why must IP Reuse?

Page 18: Advanced VLSI SOPC design flowaccess.ee.ntu.edu.tw/.../course_outline/sopc1.pdf · pp. 2 Outline What’s SOC? IP classification IP reusable & benefit SOPC solution on FPGA SOPC design

ACCESS IC LAB Graduate Institute of Electronics Engineering, NTU

pp. 18

OutlineOutlineWhat’s SOC?IP classificationIP reusable & benefitSOPC solution on FPGASOPC design flow

Page 19: Advanced VLSI SOPC design flowaccess.ee.ntu.edu.tw/.../course_outline/sopc1.pdf · pp. 2 Outline What’s SOC? IP classification IP reusable & benefit SOPC solution on FPGA SOPC design

ACCESS IC LAB Graduate Institute of Electronics Engineering, NTU

pp. 19

What is SOPC?What is SOPC?

FPGAEmbeddedProcessor Memory

Logic

High-Performance

I/O

Processor

CompleteSOPC Solution(System-On-a-Programmable-Chip)

Page 20: Advanced VLSI SOPC design flowaccess.ee.ntu.edu.tw/.../course_outline/sopc1.pdf · pp. 2 Outline What’s SOC? IP classification IP reusable & benefit SOPC solution on FPGA SOPC design

ACCESS IC LAB Graduate Institute of Electronics Engineering, NTU

pp. 20

Introduce to SOPC solutionIntroduce to SOPC solutionSoft embedded processor design & prototyping environment

Page 21: Advanced VLSI SOPC design flowaccess.ee.ntu.edu.tw/.../course_outline/sopc1.pdf · pp. 2 Outline What’s SOC? IP classification IP reusable & benefit SOPC solution on FPGA SOPC design

ACCESS IC LAB Graduate Institute of Electronics Engineering, NTU

pp. 21

Introduce to SOPC solutionIntroduce to SOPC solution

Hard embedded processor design & prototyping environment

Page 22: Advanced VLSI SOPC design flowaccess.ee.ntu.edu.tw/.../course_outline/sopc1.pdf · pp. 2 Outline What’s SOC? IP classification IP reusable & benefit SOPC solution on FPGA SOPC design

ACCESS IC LAB Graduate Institute of Electronics Engineering, NTU

pp. 22

Excalibur Excalibur NiosNios Device SupportDevice SupportPerformance

(MIPS) Future PLD Architectures

EmbeddedEmbeddedCoreCore

TMTM

Excalibur MIPSExcalibur ARM200

APEX™ Devices

ACEX™ Devices30

50

100Mercury™ Devices

FLEX™ 10K Devices

0

Page 23: Advanced VLSI SOPC design flowaccess.ee.ntu.edu.tw/.../course_outline/sopc1.pdf · pp. 2 Outline What’s SOC? IP classification IP reusable & benefit SOPC solution on FPGA SOPC design

ACCESS IC LAB Graduate Institute of Electronics Engineering, NTU

pp. 23

Low-CostEmbedded Processor

High-PerformanceCustom DSP

Multi-ProcessorSystem

Flexibility & ScalabilityFlexibility & Scalability

500K GatesAvailable

ESB

ESB

ESB

ESB

ESB

ESB

ESB

ESB

ESB

ESB

ESB

ESB

ESB

ESB

ESB

ESB

ESB

ESB

ESB

ESB

ESB

ESB

ESB

ESB

Excalibur ARM Stripe

150K GatesAvailable

DSPDSP75K Gates Available

ACEX™ EP1K100

APEX EP20K200E

Excalibur XA10

Page 24: Advanced VLSI SOPC design flowaccess.ee.ntu.edu.tw/.../course_outline/sopc1.pdf · pp. 2 Outline What’s SOC? IP classification IP reusable & benefit SOPC solution on FPGA SOPC design

ACCESS IC LAB Graduate Institute of Electronics Engineering, NTU

pp. 24

NiosNios Development KitDevelopment KitNios 32-Bit and 16-Bit RISC CPU PeripheralsDevelopment Board Development Tools

Page 25: Advanced VLSI SOPC design flowaccess.ee.ntu.edu.tw/.../course_outline/sopc1.pdf · pp. 2 Outline What’s SOC? IP classification IP reusable & benefit SOPC solution on FPGA SOPC design

ACCESS IC LAB Graduate Institute of Electronics Engineering, NTU

pp. 25

Timer

IRQ

PBM CPU

UART

FLASH

SRAM

SerialPort

Configurable Soft Core Processor32-Bit Pipelined RISC ArchitectureLarge Internal Register FileFully synchronous interfaceConfigurable Data Path30 to 80 MIPS PerformanceDynamic Bus Sizing 12% of

NiosNios Embedded Processor CoreEmbedded Processor Core

Your DesignHere

EP20K200EAltera PLD

Page 26: Advanced VLSI SOPC design flowaccess.ee.ntu.edu.tw/.../course_outline/sopc1.pdf · pp. 2 Outline What’s SOC? IP classification IP reusable & benefit SOPC solution on FPGA SOPC design

ACCESS IC LAB Graduate Institute of Electronics Engineering, NTU

pp. 26

OutlineOutlineWhat’s SOC?IP classificationIP reusable & benefitSOPC solution on FPGASOPC design flow

Page 27: Advanced VLSI SOPC design flowaccess.ee.ntu.edu.tw/.../course_outline/sopc1.pdf · pp. 2 Outline What’s SOC? IP classification IP reusable & benefit SOPC solution on FPGA SOPC design

ACCESS IC LAB Graduate Institute of Electronics Engineering, NTU

pp. 27

NiosNios System OverviewSystem OverviewA complete Nios system module contains a Nios embedded processor and its associated system peripherals.

The SOPC Builder helps you easily specify options for the Nios system module.

Nios system module contains hardware and software sections

Page 28: Advanced VLSI SOPC design flowaccess.ee.ntu.edu.tw/.../course_outline/sopc1.pdf · pp. 2 Outline What’s SOC? IP classification IP reusable & benefit SOPC solution on FPGA SOPC design

ACCESS IC LAB Graduate Institute of Electronics Engineering, NTU

pp. 28

NiosNios System Overview(cont.)System Overview(cont.)Peripheral components

Memory InterfaceRAM, ROM

Serial I/OUART

PIO(parallel IO)Seven SegmentLED, LCDUser defined Interface

Timer

Page 29: Advanced VLSI SOPC design flowaccess.ee.ntu.edu.tw/.../course_outline/sopc1.pdf · pp. 2 Outline What’s SOC? IP classification IP reusable & benefit SOPC solution on FPGA SOPC design

ACCESS IC LAB Graduate Institute of Electronics Engineering, NTU

pp. 29

NiosNios System Overview(cont.)System Overview(cont.)The SOPC builder let NIOS module easy specified by using wizard

Almost constraint can be changed to fit our own design, such as peripheral library.

Page 30: Advanced VLSI SOPC design flowaccess.ee.ntu.edu.tw/.../course_outline/sopc1.pdf · pp. 2 Outline What’s SOC? IP classification IP reusable & benefit SOPC solution on FPGA SOPC design

ACCESS IC LAB Graduate Institute of Electronics Engineering, NTU

pp. 30

NiosNios System Overview(cont.)System Overview(cont.)Hardware & Software generation

Nios system module contains:Hardware : (HDL code) describe the hardware module -download by QuartsII

Software : (header file) define c program library to develop your own program

-download by NIOS SDK

Page 31: Advanced VLSI SOPC design flowaccess.ee.ntu.edu.tw/.../course_outline/sopc1.pdf · pp. 2 Outline What’s SOC? IP classification IP reusable & benefit SOPC solution on FPGA SOPC design

ACCESS IC LAB Graduate Institute of Electronics Engineering, NTU

pp. 31

Tool Design FlowTool Design Flow

Processor Design

Simulation Test Bench

C Header files

Custom Library

Boot monitor

Synthesis Place & Route

Cygnus/Red HatGNUPro

AlteraPLD

JTAGSerial

User Design

Purchased IP

ExecutableCode

HardwareConfiguration

File

Configure Processor

Select Peripherals

GenerateHardware Software

Download& Debug

User Code

S/W Libraries

RTOS

Peripheral Library

Page 32: Advanced VLSI SOPC design flowaccess.ee.ntu.edu.tw/.../course_outline/sopc1.pdf · pp. 2 Outline What’s SOC? IP classification IP reusable & benefit SOPC solution on FPGA SOPC design

ACCESS IC LAB Graduate Institute of Electronics Engineering, NTU

pp. 32

StepsStepsCreate your design

Create project fileCreate *.BDF file

Add SOPC into your designConnect your own block & IO pad to Nios CPUCompile & Pin AssignmentSoftware developmentDownload your design

Page 33: Advanced VLSI SOPC design flowaccess.ee.ntu.edu.tw/.../course_outline/sopc1.pdf · pp. 2 Outline What’s SOC? IP classification IP reusable & benefit SOPC solution on FPGA SOPC design

ACCESS IC LAB Graduate Institute of Electronics Engineering, NTU

pp. 33

Create a new projectCreate a new projectSelect File => New Project Wizard

Working DirectoryProject nameTop-level design name

Create a new project in the path C:\AVLSI\<your id>\lab2

Click finish

Page 34: Advanced VLSI SOPC design flowaccess.ee.ntu.edu.tw/.../course_outline/sopc1.pdf · pp. 2 Outline What’s SOC? IP classification IP reusable & benefit SOPC solution on FPGA SOPC design

ACCESS IC LAB Graduate Institute of Electronics Engineering, NTU

pp. 34

Create a new schematicCreate a new schematicCreate a *.bdf file, for placing SOPC system, include NIOS CPU & other block

Block design file

Page 35: Advanced VLSI SOPC design flowaccess.ee.ntu.edu.tw/.../course_outline/sopc1.pdf · pp. 2 Outline What’s SOC? IP classification IP reusable & benefit SOPC solution on FPGA SOPC design

ACCESS IC LAB Graduate Institute of Electronics Engineering, NTU

pp. 35

StepsStepsCreate your designAdd SOPC into your design

Create CPUAdd peripheralsGenerate hardware & software design

Connect your own block & IO pad to Nios CPUCompile & Pin AssignmentSoftware developmentDownload your design

Page 36: Advanced VLSI SOPC design flowaccess.ee.ntu.edu.tw/.../course_outline/sopc1.pdf · pp. 2 Outline What’s SOC? IP classification IP reusable & benefit SOPC solution on FPGA SOPC design

ACCESS IC LAB Graduate Institute of Electronics Engineering, NTU

pp. 36

Create NIOS32 CPUCreate NIOS32 CPUSelect symbol from tool menu bar, And click Mega Wizard Plug-In Manager

Page 37: Advanced VLSI SOPC design flowaccess.ee.ntu.edu.tw/.../course_outline/sopc1.pdf · pp. 2 Outline What’s SOC? IP classification IP reusable & benefit SOPC solution on FPGA SOPC design

ACCESS IC LAB Graduate Institute of Electronics Engineering, NTU

pp. 37

Create Create megafunctionmegafunctionSOPC is one block of megafunction

Create a new megafunction, to familiar with it’s content

Page 38: Advanced VLSI SOPC design flowaccess.ee.ntu.edu.tw/.../course_outline/sopc1.pdf · pp. 2 Outline What’s SOC? IP classification IP reusable & benefit SOPC solution on FPGA SOPC design

ACCESS IC LAB Graduate Institute of Electronics Engineering, NTU

pp. 38

Use SOPC BuilderUse SOPC BuilderSelect Altera Excalibur Nios

Choose VerilogHDL to perform the soft core CPU

Page 39: Advanced VLSI SOPC design flowaccess.ee.ntu.edu.tw/.../course_outline/sopc1.pdf · pp. 2 Outline What’s SOC? IP classification IP reusable & benefit SOPC solution on FPGA SOPC design

ACCESS IC LAB Graduate Institute of Electronics Engineering, NTU

pp. 39

Add CPUAdd CPU

Click “Next”

Choose 32 bit RISC CPU,then click “Finish”

Page 40: Advanced VLSI SOPC design flowaccess.ee.ntu.edu.tw/.../course_outline/sopc1.pdf · pp. 2 Outline What’s SOC? IP classification IP reusable & benefit SOPC solution on FPGA SOPC design

ACCESS IC LAB Graduate Institute of Electronics Engineering, NTU

pp. 40

Add ComponentsAdd ComponentsClick “Add Peripheral” for adding it into your design

Page 41: Advanced VLSI SOPC design flowaccess.ee.ntu.edu.tw/.../course_outline/sopc1.pdf · pp. 2 Outline What’s SOC? IP classification IP reusable & benefit SOPC solution on FPGA SOPC design

ACCESS IC LAB Graduate Institute of Electronics Engineering, NTU

pp. 41

Current List of PeripheralsCurrent List of PeripheralsUARTPIOTimerSPIPWMIDEKeyboardPS2 MouseVGA

EthernetPCISRAMSDRAMFlashCompact FlashOn-chip RAMOn-chip ROMUser-Defined

Page 42: Advanced VLSI SOPC design flowaccess.ee.ntu.edu.tw/.../course_outline/sopc1.pdf · pp. 2 Outline What’s SOC? IP classification IP reusable & benefit SOPC solution on FPGA SOPC design

ACCESS IC LAB Graduate Institute of Electronics Engineering, NTU

pp. 42

PIO PeripheralPIO Peripheral1 to 32-bit Parallel I/O Port

Input OnlyOutput OnlyBi-directional Port

Edge Detection on InputsInterrupt Generation

Mask-ableIRQ Source

Page 43: Advanced VLSI SOPC design flowaccess.ee.ntu.edu.tw/.../course_outline/sopc1.pdf · pp. 2 Outline What’s SOC? IP classification IP reusable & benefit SOPC solution on FPGA SOPC design

ACCESS IC LAB Graduate Institute of Electronics Engineering, NTU

pp. 43

AddonAddon ComponentComponentPeripheral components

Memory InterfaceRAM, ROM, flash

Serial I/OUART

PIO(parallel IO)Seven SegmentLED, LCDUser defined Interface

Timer

NiosCPU

Ava

lon

™B

us

UserI/FNios System

Module

ExternalDevice

I/O

I/O

I/O

I/O

Altera PLD

Page 44: Advanced VLSI SOPC design flowaccess.ee.ntu.edu.tw/.../course_outline/sopc1.pdf · pp. 2 Outline What’s SOC? IP classification IP reusable & benefit SOPC solution on FPGA SOPC design

ACCESS IC LAB Graduate Institute of Electronics Engineering, NTU

pp. 44

The demo boardThe demo board

Page 45: Advanced VLSI SOPC design flowaccess.ee.ntu.edu.tw/.../course_outline/sopc1.pdf · pp. 2 Outline What’s SOC? IP classification IP reusable & benefit SOPC solution on FPGA SOPC design

ACCESS IC LAB Graduate Institute of Electronics Engineering, NTU

pp. 45

StepsStepsCreate your designAdd SOPC into your design

Create CPUAdd peripheralsGenerate hardware & software design

Connect your own block & IO pad to Nios CPUCompile & Pin AssignmentSoftware developmentDownload your design

Page 46: Advanced VLSI SOPC design flowaccess.ee.ntu.edu.tw/.../course_outline/sopc1.pdf · pp. 2 Outline What’s SOC? IP classification IP reusable & benefit SOPC solution on FPGA SOPC design

ACCESS IC LAB Graduate Institute of Electronics Engineering, NTU

pp. 46

Choose OnChoose On--chip Memorychip MemoryFor Add boot_rom

Choose GERMS Monitor

Page 47: Advanced VLSI SOPC design flowaccess.ee.ntu.edu.tw/.../course_outline/sopc1.pdf · pp. 2 Outline What’s SOC? IP classification IP reusable & benefit SOPC solution on FPGA SOPC design

ACCESS IC LAB Graduate Institute of Electronics Engineering, NTU

pp. 47

UART

GERMS MonitorGERMS Monitor

Monitor Program Runs from On-Chip ROMDebugger Runs on Host PC or UNIX PlatformBasic Development Facilities:

Download CodeBurn FlashExamine/Modify MemoryRun Programs

DebugMonitor

Page 48: Advanced VLSI SOPC design flowaccess.ee.ntu.edu.tw/.../course_outline/sopc1.pdf · pp. 2 Outline What’s SOC? IP classification IP reusable & benefit SOPC solution on FPGA SOPC design

ACCESS IC LAB Graduate Institute of Electronics Engineering, NTU

pp. 48

GERMSGERMSG – GoE – Erase FlashR – RelocateM – MemoryS – Motorola S record: – Intel Hex recordCR – show next 64 Bytes of memoryEscape – Restart GERMS monitor

Page 49: Advanced VLSI SOPC design flowaccess.ee.ntu.edu.tw/.../course_outline/sopc1.pdf · pp. 2 Outline What’s SOC? IP classification IP reusable & benefit SOPC solution on FPGA SOPC design

ACCESS IC LAB Graduate Institute of Electronics Engineering, NTU

pp. 49

StepsStepsCreate your designAdd SOPC into your design

Create CPUAdd peripheralsGenerate hardware & software design

Connect your own block & IO pad to Nios CPUCompile & Pin AssignmentSoftware developmentDownload your design

Page 50: Advanced VLSI SOPC design flowaccess.ee.ntu.edu.tw/.../course_outline/sopc1.pdf · pp. 2 Outline What’s SOC? IP classification IP reusable & benefit SOPC solution on FPGA SOPC design

ACCESS IC LAB Graduate Institute of Electronics Engineering, NTU

pp. 50

System ConfigurationSystem ConfigurationMain Program Memory

Code ExecutionMain Data Memory

Variables & StackHost Communication

Monitor STDIODebug Communication

GDB PortBoot ID Message

Monitor Prints at Start-up

Page 51: Advanced VLSI SOPC design flowaccess.ee.ntu.edu.tw/.../course_outline/sopc1.pdf · pp. 2 Outline What’s SOC? IP classification IP reusable & benefit SOPC solution on FPGA SOPC design

ACCESS IC LAB Graduate Institute of Electronics Engineering, NTU

pp. 51

System ConfigurationSystem ConfigurationBoot Device

Boot_romInterrupt Vector Table

sramHighest Performance Bus

Standard busSynthesis Target Family

APEX 20K Devices

Page 52: Advanced VLSI SOPC design flowaccess.ee.ntu.edu.tw/.../course_outline/sopc1.pdf · pp. 2 Outline What’s SOC? IP classification IP reusable & benefit SOPC solution on FPGA SOPC design

ACCESS IC LAB Graduate Institute of Electronics Engineering, NTU

pp. 52

Generate System ModuleGenerate System ModuleSoftware Development Kit (SDK)Hardware DesignSynthesis

Page 53: Advanced VLSI SOPC design flowaccess.ee.ntu.edu.tw/.../course_outline/sopc1.pdf · pp. 2 Outline What’s SOC? IP classification IP reusable & benefit SOPC solution on FPGA SOPC design

ACCESS IC LAB Graduate Institute of Electronics Engineering, NTU

pp. 53

What happen after GenerateWhat happen after GenerateSoftware

nios.h :define the peripheral address:define the memory map

Hardware A NIOS CPU module constructed by verilog code

Page 54: Advanced VLSI SOPC design flowaccess.ee.ntu.edu.tw/.../course_outline/sopc1.pdf · pp. 2 Outline What’s SOC? IP classification IP reusable & benefit SOPC solution on FPGA SOPC design

ACCESS IC LAB Graduate Institute of Electronics Engineering, NTU

pp. 54

IO have their addr./*

* File: nios.h

*

* This file is a machine generated address map

* for a Nios cpu named cpu.

* f:/我的文件/avlsi/r91943088/lab2/nios32.ptf

* Generated: 2002.12.21 19:29:11

*/

// The Memory Map

#define na_uart_1_debug ((np_uart *) 0x00000420)

#define na_uart_1_debug_irq 17

#define na_timer_0 ((np_timer *) 0x00000440)

#define na_timer_0_irq 18

#define na_led_pio ((np_pio *) 0x00000460)

#define na_button_pio ((np_pio *) 0x00000470)

#define na_button_pio_irq 19

#define na_ext_ram ((void *) 0x00040000)

#define na_ext_ram_end ((void *) 0x00080000)

#define na_ext_ram_size ((void *) 0x00040000)

#define na_ext_flash ((void *) 0x00100000)

Software GenerationSoftware Generation

Page 55: Advanced VLSI SOPC design flowaccess.ee.ntu.edu.tw/.../course_outline/sopc1.pdf · pp. 2 Outline What’s SOC? IP classification IP reusable & benefit SOPC solution on FPGA SOPC design

ACCESS IC LAB Graduate Institute of Electronics Engineering, NTU

pp. 55

Hardware Hardware GenereationGenereationAfter generation, a NIOS module appears in Symbol

Page 56: Advanced VLSI SOPC design flowaccess.ee.ntu.edu.tw/.../course_outline/sopc1.pdf · pp. 2 Outline What’s SOC? IP classification IP reusable & benefit SOPC solution on FPGA SOPC design

ACCESS IC LAB Graduate Institute of Electronics Engineering, NTU

pp. 56

StepsStepsCreate your designAdd SOPC into your designConnect your own block & IO pad to Nios CPUCompile & Pin AssignmentSoftware developmentDownload your design

Page 57: Advanced VLSI SOPC design flowaccess.ee.ntu.edu.tw/.../course_outline/sopc1.pdf · pp. 2 Outline What’s SOC? IP classification IP reusable & benefit SOPC solution on FPGA SOPC design

ACCESS IC LAB Graduate Institute of Electronics Engineering, NTU

pp. 57

Add IO PadAdd IO PadUse add symbol to add IO pad to schematic.

Page 58: Advanced VLSI SOPC design flowaccess.ee.ntu.edu.tw/.../course_outline/sopc1.pdf · pp. 2 Outline What’s SOC? IP classification IP reusable & benefit SOPC solution on FPGA SOPC design

ACCESS IC LAB Graduate Institute of Electronics Engineering, NTU

pp. 58

StepsStepsCreate your designAdd SOPC into your designConnect your own block & IO pad to Nios CPUPin Assignment & CompileDownload your design

Page 59: Advanced VLSI SOPC design flowaccess.ee.ntu.edu.tw/.../course_outline/sopc1.pdf · pp. 2 Outline What’s SOC? IP classification IP reusable & benefit SOPC solution on FPGA SOPC design

ACCESS IC LAB Graduate Institute of Electronics Engineering, NTU

pp. 59

Assign PinsAssign PinsCompile first

Assign the IO pins to the I/O Interface on develop board

Compile then

Page 60: Advanced VLSI SOPC design flowaccess.ee.ntu.edu.tw/.../course_outline/sopc1.pdf · pp. 2 Outline What’s SOC? IP classification IP reusable & benefit SOPC solution on FPGA SOPC design

ACCESS IC LAB Graduate Institute of Electronics Engineering, NTU

pp. 60

StepsStepsCreate your designAdd SOPC into your designConnect your own block & IO pad to Nios CPUCompile & Pin AssignmentSoftware developmentDownload your design

Page 61: Advanced VLSI SOPC design flowaccess.ee.ntu.edu.tw/.../course_outline/sopc1.pdf · pp. 2 Outline What’s SOC? IP classification IP reusable & benefit SOPC solution on FPGA SOPC design

ACCESS IC LAB Graduate Institute of Electronics Engineering, NTU

pp. 61

Software DevelopSoftware DevelopCPU contains hardware part and software part

Hardware part was created above

Software part is written in c or c++ language, then compiled into assembly code

Take an example for writing c++ program to control CPU change light when press switch

Page 62: Advanced VLSI SOPC design flowaccess.ee.ntu.edu.tw/.../course_outline/sopc1.pdf · pp. 2 Outline What’s SOC? IP classification IP reusable & benefit SOPC solution on FPGA SOPC design

ACCESS IC LAB Graduate Institute of Electronics Engineering, NTU

pp. 62

Define memory map& peripheral addr.

0111

0: input1:output2:bidrection

button

led

How to write codeHow to write code

Page 63: Advanced VLSI SOPC design flowaccess.ee.ntu.edu.tw/.../course_outline/sopc1.pdf · pp. 2 Outline What’s SOC? IP classification IP reusable & benefit SOPC solution on FPGA SOPC design

ACCESS IC LAB Graduate Institute of Electronics Engineering, NTU

pp. 63

How to write code(cont.)How to write code(cont.)

Change led light

Get data

Write data

Page 64: Advanced VLSI SOPC design flowaccess.ee.ntu.edu.tw/.../course_outline/sopc1.pdf · pp. 2 Outline What’s SOC? IP classification IP reusable & benefit SOPC solution on FPGA SOPC design

ACCESS IC LAB Graduate Institute of Electronics Engineering, NTU

pp. 64

StepsStepsCreate your designAdd SOPC into your designConnect your own block & IO pad to Nios CPUCompile & Pin AssignmentSoftware developmentDownload your design

Page 65: Advanced VLSI SOPC design flowaccess.ee.ntu.edu.tw/.../course_outline/sopc1.pdf · pp. 2 Outline What’s SOC? IP classification IP reusable & benefit SOPC solution on FPGA SOPC design

ACCESS IC LAB Graduate Institute of Electronics Engineering, NTU

pp. 65

Memory UsageMemory Usage*.srec is downloaded into SRAM, can’t still exist after reset

Flash memory store the data executed automatically when boot

SRAM256Kb

Data

Address

1Mb Flash

APEX

ROMFactory Factory APEX ImageAPEX Image

UserAPEX Image

User User SoftwareSoftware

140000

Page 66: Advanced VLSI SOPC design flowaccess.ee.ntu.edu.tw/.../course_outline/sopc1.pdf · pp. 2 Outline What’s SOC? IP classification IP reusable & benefit SOPC solution on FPGA SOPC design

ACCESS IC LAB Graduate Institute of Electronics Engineering, NTU

pp. 66

NIOS SDKNIOS SDKUNIX like environment

Open from ”Start Menu/program files/Altera/Excalibur NIOS 2.0/NIOS SDK Shell”

Page 67: Advanced VLSI SOPC design flowaccess.ee.ntu.edu.tw/.../course_outline/sopc1.pdf · pp. 2 Outline What’s SOC? IP classification IP reusable & benefit SOPC solution on FPGA SOPC design

ACCESS IC LAB Graduate Institute of Electronics Engineering, NTU

pp. 67

NIOS CommandNIOS Commandnios-build: Compile, Assemble & Link

Transpose c program into <program>.srec

nios-run: Download Executable & Runburn flash with <project>.hexout(hardware) or <program>.flash(software)Download *.srec to SRAM

srec2flash: Create Flash-bootable CodeConvert <program>.srec to <program>.flash

Page 68: Advanced VLSI SOPC design flowaccess.ee.ntu.edu.tw/.../course_outline/sopc1.pdf · pp. 2 Outline What’s SOC? IP classification IP reusable & benefit SOPC solution on FPGA SOPC design

ACCESS IC LAB Graduate Institute of Electronics Engineering, NTU

pp. 68

NiosNios RoutinesRoutinesnios-build hello.c (nb hello.c)

Builds program including compile, link and convert to SRECnios-run hello.srec (nr hello.srec)

Downloads using com1 and enters terminal modenr –p com2 hello.srec

Downloads using com2nr –x hello.srec

Downloads without entering terminal modenr –t

Enters terminal mode without download (Ctrl + C to exit)

Page 69: Advanced VLSI SOPC design flowaccess.ee.ntu.edu.tw/.../course_outline/sopc1.pdf · pp. 2 Outline What’s SOC? IP classification IP reusable & benefit SOPC solution on FPGA SOPC design

ACCESS IC LAB Graduate Institute of Electronics Engineering, NTU

pp. 69

Download routineDownload routinenr <project>.hexout -download hardware

designnr <program>.srec -download software

design

Page 70: Advanced VLSI SOPC design flowaccess.ee.ntu.edu.tw/.../course_outline/sopc1.pdf · pp. 2 Outline What’s SOC? IP classification IP reusable & benefit SOPC solution on FPGA SOPC design

ACCESS IC LAB Graduate Institute of Electronics Engineering, NTU

pp. 70

LABLABNIOS Tutorial Have a C code to generate sine wave and display to 7-segment LED. Program should read data from DIP SW as a value of delay loop. ( pi / 10)

Page 71: Advanced VLSI SOPC design flowaccess.ee.ntu.edu.tw/.../course_outline/sopc1.pdf · pp. 2 Outline What’s SOC? IP classification IP reusable & benefit SOPC solution on FPGA SOPC design

ACCESS IC LAB Graduate Institute of Electronics Engineering, NTU

pp. 71

HomeworkHomeworkUse Mega Plug-In Manager to generate NIOS with DIP SW and necessary peripheral device.Use Mega Plug-In Manager to generate a 4 by 4 multiplier.Have a verilog code to decode 8 bit binary to 7-segment.Have a C code to read two 4-bit data from DIP SW and send data to 4 by 4 multiplier. The multiplier output should connect to decoder directly to display answer.Use LA to read answer-data to verify, too.