firmware based array sorting and matlab testing suite midterm presentation may 4 th , 2011

27
Firmware based array sorting and Matlab testing suite midterm presentation may 4 th , 2011 Elad Barzilay Uri Natanzon Supervisor: Moshe Porian

Upload: eugene

Post on 10-Feb-2016

30 views

Category:

Documents


0 download

DESCRIPTION

Firmware based array sorting and Matlab testing suite midterm presentation may 4 th , 2011. Elad Barzilay Uri Natanzon Supervisor: Moshe Porian. Project Goals. Building a generic integer array sort firmware on an FPGA board Develop a comprehensive testing - PowerPoint PPT Presentation

TRANSCRIPT

Page 1: Firmware based array sorting  and  Matlab  testing  suite midterm  presentation may 4 th  , 2011

Firmware based array sorting

and Matlab testing suite

midterm presentationmay 4th , 2011

Elad BarzilayUri Natanzon

Supervisor: Moshe Porian

Page 2: Firmware based array sorting  and  Matlab  testing  suite midterm  presentation may 4 th  , 2011

Project Goals

•Building a generic integer array sort firmware on an FPGA board •Develop a comprehensive testing and debugging environment.

Page 3: Firmware based array sorting  and  Matlab  testing  suite midterm  presentation may 4 th  , 2011

The need for HistogramsMany image processing algorithms relay on the use of histograms.

For example - Photo “auto fix” – histogram equalization

minmax min

fixed originalFull Dynamic RangePixel Pixel photoPhoto Photo

PhotoMin

PhotoMax

0

Full Dynamic Range

#2 bits

Page 4: Firmware based array sorting  and  Matlab  testing  suite midterm  presentation may 4 th  , 2011

For example:

Page 5: Firmware based array sorting  and  Matlab  testing  suite midterm  presentation may 4 th  , 2011

Project OverviewSystem capabilities & requirements

– Sorting an array of finite integers set.– Zero latency system.– Fully debug-able.– System operation via PC interface.

Design principles– Generic implementation.– Top down design.– Error detection and handling.

System implementation on the DE2 evaluation card. PC GUI implementation on MATLAB.Complete development process: Characterization->

debugging platform.

Page 6: Firmware based array sorting  and  Matlab  testing  suite midterm  presentation may 4 th  , 2011

SORT_TOP – Inputs & OutputsTime Diagram

Page 7: Firmware based array sorting  and  Matlab  testing  suite midterm  presentation may 4 th  , 2011

High-level overview

Page 8: Firmware based array sorting  and  Matlab  testing  suite midterm  presentation may 4 th  , 2011

High-level overview

msgdata

header

footer

Page 9: Firmware based array sorting  and  Matlab  testing  suite midterm  presentation may 4 th  , 2011

High-level overview

Page 10: Firmware based array sorting  and  Matlab  testing  suite midterm  presentation may 4 th  , 2011

High-level overview

header

footer

msgdata

Page 11: Firmware based array sorting  and  Matlab  testing  suite midterm  presentation may 4 th  , 2011

High-level overview

footer

header

msgdata

footer

header

msgdata

footer

header

msgdata

Page 12: Firmware based array sorting  and  Matlab  testing  suite midterm  presentation may 4 th  , 2011

High-level overview

footer

header

msgdata

footer

header

msgdata

footer

header

msgdata

Done

Page 13: Firmware based array sorting  and  Matlab  testing  suite midterm  presentation may 4 th  , 2011

High-level overview

footer

header

msgdata

footer

header

msgdata

footer

header

msgdata

Page 14: Firmware based array sorting  and  Matlab  testing  suite midterm  presentation may 4 th  , 2011

High-level overview

footer

header

msgdata

footer

header

msgdata

footer

header

msgdata

footer

header

msgdata

footer

header

msgdata

footer

header

msgdata

Page 15: Firmware based array sorting  and  Matlab  testing  suite midterm  presentation may 4 th  , 2011

High-level overview

Page 16: Firmware based array sorting  and  Matlab  testing  suite midterm  presentation may 4 th  , 2011

SORT_TOP – Block diagramSORT_TOP

DPR_BLOCKDPR_update

F_VAL

DATA

D_VAL

en

Rd_addr

Rd_pipe1 Rd_pipe2 Rd_pipe3

Wr_pipe3 Wr_pipe2 Wr_pipe1 Write_port

Rd_data

Dpr_update_logic

+1

+2

Rd_addr

DPR_reader

F_VAL

DATA

Write

Rd_addr

D_VAL

FSM

St_Frame

Waits for a falling edge on FRAME_V

St_1st_valid

Stores data from DPR address 0 to pipeline 2nd

stage

St_2nd_valid

Stores data from DPR address 1 to pipeline 1st

stage.

St_output

Count down and outputs constant data for several

cycles

St_read_next

Propagates pipeline -rd&wr addr, output data

If address 0 value > 1 If address 0 value = 1,0

Count = 0

Value >1

If read value = 1,0

Pipe stg1 Pipe stg2

Rd_data

DPR1 DPR2

switch

Page 17: Firmware based array sorting  and  Matlab  testing  suite midterm  presentation may 4 th  , 2011

DPR_update

F_VAL

DATA

D_VAL

en

Rd_addr

Rd_pipe1 Rd_pipe2 Rd_pipe3

Wr_pipe3 Wr_pipe2 Wr_pipe1 Write_port

Rd_data

Dpr_update_logic

+1

+2

Rd_addr

DPR_update – Block diagram

Page 18: Firmware based array sorting  and  Matlab  testing  suite midterm  presentation may 4 th  , 2011

DPR_block – Block diagram

Page 19: Firmware based array sorting  and  Matlab  testing  suite midterm  presentation may 4 th  , 2011

DPR_reader – Block diagram

Page 20: Firmware based array sorting  and  Matlab  testing  suite midterm  presentation may 4 th  , 2011

Message Pack StructureSOFID

Data Length

Data (Payload)

CRCEOF

8 bits

1 Byte. Some constant predefined flag1 Byte. For message tracking

2 Bytes. Specifies the length of the data segment in bytes.

1 Byte. The CRC type will be defined later.1 Byte. Some constant predefined flag

address 1 Byte. Specifies the addressed blockaddress 1 Byte. Type options are : set, query, sort

[Data Length] X Bytes. (up to 65535 bytes)Holds the data and control signal to be fed into SORT_TOP

Page 21: Firmware based array sorting  and  Matlab  testing  suite midterm  presentation may 4 th  , 2011

MSG_decoder FSM

UART_Rx

Idle

Store_Addr

Store_ID

Store_Type

Load_tFIFOStore_lengthx2

Store_CRC

Wait4copy(tFIFO to dFIFo)

Error_check

Timout

St_error

Wait4enc

Data = sof

Rx flag = 1

Rx flag = 1

Rx flag = 1

Rx flag = 1

Rx flag = 1Count++

Count = length

Rx flag = 1

CRC err /DATA!=EOF

CRC goodData = EOF

Copy done

After 1 ms

Data = sof

TempFIFO

DataFIFO

Fifocopy

Meta_dataFIFO

Meta_dataRegister

Encoder done

Page 22: Firmware based array sorting  and  Matlab  testing  suite midterm  presentation may 4 th  , 2011

MSG_encoder FSM

UARTTx

Idle

tx_Addr

tx_ID

tx_Type

ReadFIFO

tx_lengthx2

Data_Tx(Count--)

Tx_CRC

Wordupdate

Tx_EOF

Tx done

Copy done

Meta_dataFIFO

DataFIFO

start

Tx done

Data read

1st Data read

Count = 0

Tx done

Tx done

Page 23: Firmware based array sorting  and  Matlab  testing  suite midterm  presentation may 4 th  , 2011

Firmware Testing - simulation• All FW sub-modules were tested in VHDL

TestBenches.– Verification of module behavior by MODELSIM waveform

analysis.– All blocks - Tests included valid operation conditions.– Sorting block - Tests also included “worst case”

scenarios:• Sort_update – repetitions, fast toggling.• Sort_reader – zero repetitions, single repetitions, multiple

repetitions.• Communication path - tested in firmware.

– Error handling and CRC – not yet implemented. Will be tested separately.

Comprehensive tests will be held via “DUDE” – Our Matlab GUI

Page 24: Firmware based array sorting  and  Matlab  testing  suite midterm  presentation may 4 th  , 2011

“DUDE” – Debugging Under Development Environment

MATLAB based GUI for data injection, result validation and status query

Page 25: Firmware based array sorting  and  Matlab  testing  suite midterm  presentation may 4 th  , 2011

“DUDE” – implementation goals achievements

• Send user defined arrays of data to be sorted. -Done• Send random arrays of data to be sorted. -Done• Verify the correctness of the sorted returned data array. –

partially done. Not yet In GUI but capability implemented and used for debug.

• Create fully user generated packets to generate errors. –Not implemented yet.

• View bit representation of the messages sent and received . – Capability exists but not in GUI.

• Logging of out/in-bound messages. –Not implemented yet.

Page 26: Firmware based array sorting  and  Matlab  testing  suite midterm  presentation may 4 th  , 2011

“DUDE” – implementation guidelines

• OOP based GUI.• 2 main classes implemented: • CSettings – holds all the framework data and manages the

messages list• CMessage – holds all the data per one given message and

manages the dynamic data creation such as CRC and data length calculation.

• This modular design allows the GUI to be versatile and parameter independent.

• All non implemented features are easily implemented with small effort.

• Easily adjustable to additional requested features.

Page 27: Firmware based array sorting  and  Matlab  testing  suite midterm  presentation may 4 th  , 2011

project characterization

VHDL sorting code + sim

Exams

VHDL comm code +sim

syn, P&R, HW tests

FPGA - PC conectivity

Matlab GUI

software debug

full system debug

29/10/10 18/12/10 6/2/11 28/3/11 17/5/11 6/7/11

Project Time Line