23
FPGA Calculator Core Final Presentation Chen Zukerman Liran Moskovitch Advisor : Moshe Porian Duration: semesterial December 2012

FPGA Calculator Core Final Presentation Chen Zukerman Liran Moskovitch Advisor : Moshe Porian Duration: semesterial December 2012

Embed Size (px)

Citation preview

Page 1: FPGA Calculator Core Final Presentation Chen Zukerman Liran Moskovitch Advisor : Moshe Porian Duration: semesterial December 2012

FPGA Calculator Core

Final Presentation

Chen ZukermanLiran Moskovitch

Advisor : Moshe Porian

Duration: semesterialDecember 2012

Page 2: FPGA Calculator Core Final Presentation Chen Zukerman Liran Moskovitch Advisor : Moshe Porian Duration: semesterial December 2012

Contents

• Project Overview• Top Architecture• Micro Architecture• Testability• Synthesis Results• Hardware Debugging• Project Educational Value• Project Movie• Lab Demo

Page 3: FPGA Calculator Core Final Presentation Chen Zukerman Liran Moskovitch Advisor : Moshe Porian Duration: semesterial December 2012

Project OverviewHardware implementation of calculator core :

• Positive integers

• Operands: ‘+’ , ’-’ , ’x’, ‘^’ , ‘ { ‘ , ‘ } ‘

• Precedence rules compatible

• Manually acquisition Input via Matlab GUI

• Result display + debugging feedback on GUI screen

FPGACalculator Core

Result

Page 4: FPGA Calculator Core Final Presentation Chen Zukerman Liran Moskovitch Advisor : Moshe Porian Duration: semesterial December 2012

Top Architecture

Implemented

integrated

Wis

hbon

e In

terc

on

TX PATH

WN

B2

WBS2

RX PATH

WBM

1

WBS1

CALC_CORE

WBS3

WBM3

Altera Cyclone II FPGA

GUI - MATLAB

Uart Out115200 bits/sec

Uart In 115200 bits/sec

Clock &Reset

FPGA Clock, 50[MHZ]

FPGA Reset

Sys_clk, 100[MHZ]

Sys_reset

Page 5: FPGA Calculator Core Final Presentation Chen Zukerman Liran Moskovitch Advisor : Moshe Porian Duration: semesterial December 2012

Wis

hbon

e In

terc

on

TX PATH

WN

B2

WBS2

RX PATH

WBM

1

WBS1

CALC_CORE

WBS3

WBM3

Altera Cyclone II FPGA

GUI - MATLAB

Uart In 115200 bits/sec

Uart Out115200 bits/sec

Implemented

integrated

Postfix Data..

FF

Infix - Data ..

FF

Result

Type

Address

Data Length

Result

Type

Address

Data Length

Result

SOF

Type

Address

Data Length

CRC

EOF

Data Flow

Clock &Reset

FPGA Clock, 50[MHZ]

FPGA Reset

Sys_clk,100[MHZ]

Sys_reset

SOF

Type

Address

Data Length

Postfix Data..

FF

CRC

EOF

Infix - Data..

FF

Page 6: FPGA Calculator Core Final Presentation Chen Zukerman Liran Moskovitch Advisor : Moshe Porian Duration: semesterial December 2012

Micro Architecture

Page 7: FPGA Calculator Core Final Presentation Chen Zukerman Liran Moskovitch Advisor : Moshe Porian Duration: semesterial December 2012

Calculator Core in action

detailed view

0200070A

1

1

070A

0A

09

090982

0A8209FF

0A

0A

09

09

82 09

09

0A

0A

5A5A

FF

FF 5A

5A

00 00 00 5A

11

03

00

03

1

005A

Page 8: FPGA Calculator Core Final Presentation Chen Zukerman Liran Moskovitch Advisor : Moshe Porian Duration: semesterial December 2012

Testability• Top Level Testing and simulating

environment :

Goals : 1. functionality verification (in system boundaries)2. verification that hardware and software calculation results are equal

• Multi-Level testing environments were implemented

PLL BYPA

SS

Page 9: FPGA Calculator Core Final Presentation Chen Zukerman Liran Moskovitch Advisor : Moshe Porian Duration: semesterial December 2012

PLL Vs. PLL Bypass

• The top level contains PLL unit that produces system clock

• Simulating The top level with PLL unit is slow

• PLL BYPASS

Disables PLL unit and produce system clock manually

Implemented one hierarchy above the PLL unit

in order to get faster simulation time (if … generate)

Choosing between PLL and PLL BYPASS is done by generic

sim_clk_gen_g (if true – PLL is disabled, otherwise enabled)

Page 10: FPGA Calculator Core Final Presentation Chen Zukerman Liran Moskovitch Advisor : Moshe Porian Duration: semesterial December 2012

GUI

Method select

Enter the exercise

Exhibit the data to transmit

Exercise display

Software result

Hardware result

Gui messages

Page 11: FPGA Calculator Core Final Presentation Chen Zukerman Liran Moskovitch Advisor : Moshe Porian Duration: semesterial December 2012

GUI - Capabilities

Operational features:• Receive data from the user• Data abstraction – easy and simple operation• Generates only correct packets with legal values• Method choosing.

Debug features:• Transferred data display• Messages display• Generates text files available for simulation

Page 12: FPGA Calculator Core Final Presentation Chen Zukerman Liran Moskovitch Advisor : Moshe Porian Duration: semesterial December 2012

Operation Table

Select value Hex code Binary code Operation

- 85 10010101 (

- 86 10010110 )

011 83 10000011 ^

010 82 10000010 x

000 80 10000000 +

001 81 10000001 -

- FF 11111111 End of Postfix\infix

Page 13: FPGA Calculator Core Final Presentation Chen Zukerman Liran Moskovitch Advisor : Moshe Porian Duration: semesterial December 2012

Text FilesCalculation string txt file format :• General comment – desired test literally, explanation,

Clarifications etc.• Different notations comment: infix , postfix , postfix in hex + operator

conversion• Data line - full packet calculation string

Postfix data Infix data End of postfix

Wishbone signals

TGA – Client TypeTGD – data lengthADR – Client inner address

SOF CRCEnd of infix EOF• General comment – desired test literally, explanation, Clarifications etc.

Result string txt file format :• Comment : infix notation + result [hex]• Data line – full packet expected result string

Wishbone signals Expected resultSOF EOFCRC

Page 14: FPGA Calculator Core Final Presentation Chen Zukerman Liran Moskovitch Advisor : Moshe Porian Duration: semesterial December 2012

Text File• Calculation string txt file example (4

strings):

Page 15: FPGA Calculator Core Final Presentation Chen Zukerman Liran Moskovitch Advisor : Moshe Porian Duration: semesterial December 2012

String generator + checker

• Allows simple & fast testing and simulation

• Automatic feedback – message in the transcript window

• Working with multiple strings one after the other

Page 16: FPGA Calculator Core Final Presentation Chen Zukerman Liran Moskovitch Advisor : Moshe Porian Duration: semesterial December 2012

String generator + checker example

Full packet calculation stringFull packet result string

String Generator opens the input txt file String Generator closes the input txt file End of successful top level test

String Generator and Checker simulation reports – Transcript Window

Page 17: FPGA Calculator Core Final Presentation Chen Zukerman Liran Moskovitch Advisor : Moshe Porian Duration: semesterial December 2012

Power basic tests:Adder basic tests: Multiplier basic tests:Subtractor basic tests:

Test Plan

• Blocks Basic Tests (inputs/outputs limits and special cases):

• General Tests (inputs/outputs limits and special cases):

Simple string using each operator once

Strings using same operator all along

Strings using different operator in the beginning of the

string

Each operator used twice in a single string

Short string

Long string

Brackets testing (in different location along the string)

Bigger\Smaller Right\Left Operand

• For simulation and hardware as well

Page 18: FPGA Calculator Core Final Presentation Chen Zukerman Liran Moskovitch Advisor : Moshe Porian Duration: semesterial December 2012

Synthesis Results

Page 19: FPGA Calculator Core Final Presentation Chen Zukerman Liran Moskovitch Advisor : Moshe Porian Duration: semesterial December 2012

Max Frequency

• Required frequency : 100 [MHz]• Actual Max frequency : 133.87 [MHz]

Page 20: FPGA Calculator Core Final Presentation Chen Zukerman Liran Moskovitch Advisor : Moshe Porian Duration: semesterial December 2012

Hardware Debugging

• Problem : first programming on FPGA … nothing happens (GUI does not receive the returned full packet result string) .

• Source : The reset button on the DE2 board is active low while the PLL reset polarity (predefined by the MegaWizard) is active high .• Solution : adding the pll_reset signal which insures, that when the FPGA reset button is active ('0'), the PLL reset would be active as well with the appropriate polarity ('1') .• Conclusion :

Fundamental principle - system synthesis MUST come only AFTER successful simulation - Early detection of the problem .

MegaWizard PLL RESET (areset) is always active high ('1'). Special attention should be paid to the reset polarity issue .

Programming indication led could be useful .

Page 21: FPGA Calculator Core Final Presentation Chen Zukerman Liran Moskovitch Advisor : Moshe Porian Duration: semesterial December 2012

• Planning and Specifying a Project

• Writing reusable generic code

• Profound acquaintance with communication protocols : UART,

Wishbone

• Integration of many components

• Verifying logic correctness using smart simulators, waveforms,

text files and scripts (do files)

• Using the GUI for hardware Testing and also as a producer of

text files which are used later by the smart simulators

• Documentation of the work done

• SVN is a very useful tool

• Seriousness, Persistence, spending time and a will to learn and

understand are a Guarantee of success

Project Educational Value

Page 22: FPGA Calculator Core Final Presentation Chen Zukerman Liran Moskovitch Advisor : Moshe Porian Duration: semesterial December 2012

Project Movie

http://www.youtube.com/watch?v=0POkQuCi9Tk

Page 23: FPGA Calculator Core Final Presentation Chen Zukerman Liran Moskovitch Advisor : Moshe Porian Duration: semesterial December 2012

Lab Demo