Edge Detection. 256x256 Byte image UART interface PC FPGA 1 Byte every a few hundred cycles of FPGA Sobel circuit Edge and direction.

Slides:



Advertisements
Similar presentations
SD1020 Number of Members :3 Vidura Manu Wijayasekara Ridhima Agarwal Bhaskar Kumar Advisor : Dr. Sudarshan Srinivasan.
Advertisements

Dr. Subbarao Wunnava June 2006 “ Functional Microcontroller Design and Implementation ” Paper Authors : Vivekananda Jayaram Dr. Subbarao Wunnava Research.
L18 – VHDL for other counters and controllers. Other counters  More examples Gray Code counter Controlled counters  Up down counter  Ref: text Unit.
6/27/20061 Sequence Detectors Lecture Notes – Lab 5 Sequence detection is the act of recognizing a predefined series of inputs A sequence detector is a.
6/12/20151 Sequence Detectors Lecture Notes – Lab 4 Sequence detection is the act of recognizing a predefined series of inputs A sequence detector is a.
1 TK2633TK Microprocessor Architecture DR MASRI AYOB.
DLX Instruction Format
George Mason University ECE 448 – FPGA and ASIC Design with VHDL Finite State Machines State Diagrams, State Tables, Algorithmic State Machine (ASM) Charts,
Capacitance Sensor Project
ECE 332 Digital Electronics and Logic Design Lab Lab 5 VHDL Design Styles Testbenches.
Advanced Digital Circuits ECET 146 Week 7 Professor Iskandar Hack ET 221B,
Design Verification VHDL ET062G & ET063G Lecture 5 Najeem Lawal 2012.
Digital Kommunikationselektronik TNE027 Lecture 2 1 FA x n –1 c n c n1- y n1– s n1– FA x 1 c 2 y 1 s 1 c 1 x 0 y 0 s 0 c 0 MSB positionLSB position Ripple-Carry.
Finite State Machines VHDL ET062G & ET063G Lecture 6 Najeem Lawal 2012.
VHDL Introduction. V- VHSIC Very High Speed Integrated Circuit H- Hardware D- Description L- Language.
1/8/ L20 Project Step 8 - Data Path Copyright Joanne DeGroat, ECE, OSU1 State Machine Design with an HDL A methodology that works for documenting.
George Mason University ECE 545 – Introduction to VHDL ECE 545 Lecture 5 Finite State Machines.
Copyright © 1997 Altera Corporation & 提供 What is VHDL Very high speed integrated Hardware Description Language (VHDL) –is.
ENG241 Digital Design Week #8 Registers and Counters.
George Mason University Finite State Machines State Diagrams, State Tables, Algorithmic State Machine (ASM) Charts, and VHDL Code ECE 448 Lecture 6.
Reaction Timer Project
1 Implementation in Hardware of Video Processing Algorithm Performed by: Yony Dekell & Tsion Bublil Supervisor : Mike Sumszyk SPRING 2008 High Speed Digital.
Introduction to VHDL Simulation … Synthesis …. The digital design process… Initial specification Block diagram Final product Circuit equations Logic design.
Introduction to FPGA Tools
2’s Complement 4-Bit Saturator Discussion D2.8 Lab 2.
Feb. 26, 2001Systems Architecture I1 Systems Architecture I (CS ) Lecture 12: State Elements, Registers, and Memory * Jeremy R. Johnson Mon. Feb.
VHDL Discussion Sequential Sytems. Memory Elements. Registers. Counters IAY 0600 Digital Systems Design Alexander Sudnitson Tallinn University of Technology.
Introduction to ASIC flow and Verilog HDL
ECE 448 Lecture 6 Finite State Machines State Diagrams vs. Algorithmic State Machine (ASM) Charts.
July 2, 2001Systems Architecture I1 Systems Architecture II (CS 282) Lab 3: State Elements, Registers, and Memory * Jeremy R. Johnson Monday July 2, 2001.
Sequential Logic Flip-Flop Circuits By Dylan Smeder.
ECE 3450 M. A. Jupina, VU, 2016 Capacitance Sensor Project Goal: Creation of a digital capacitance sensor circuit where a variation in capacitance changes.
EE3A1 Computer Hardware and Digital Design Lecture 9 Pipelining.
George Mason University Behavioral Modeling of Sequential-Circuit Building Blocks ECE 545 Lecture 8.
Implementing JPEG Encoder for FPGA ECE 734 PROJECT Deepak Agarwal.
Reconfigurable Computing - Options in Circuit Design John Morris Chung-Ang University The University of Auckland ‘Iolanthe’ at 13 knots on Cockburn Sound,
ECE 448 – FPGA and ASIC Design with VHDL George Mason University ECE 448 Lab 2 Implementing Combinational Logic in VHDL.
Buffering Techniques Greg Stitt ECE Department University of Florida.
1 Introduction to Engineering Spring 2007 Lecture 18: Digital Tools 2.
State Machine Design with an HDL
George Mason University Finite State Machines Refresher ECE 545 Lecture 11.
Combinational logic circuit
Registers and Counters
ECE 448 Lecture 6 Finite State Machines State Diagrams, State Tables, Algorithmic State Machine (ASM) Charts, and VHDL Code.
Introduction Introduction to VHDL Entities Signals Data & Scalar Types
8085 Microprocessor Architecture
Digital Logic Last Time … This Time … Control Path, Arithmetic Ops a
ECE 448 Lecture 6 Finite State Machines State Diagrams vs. Algorithmic State Machine (ASM) Charts.
Design of the Control Unit for Single-Cycle Instruction Execution
ECE 448 Lecture 3 Combinational-Circuit Building Blocks Data Flow Modeling of Combinational Logic ECE 448 – FPGA and ASIC Design with VHDL.
ECE 448 Lab 1a Developing Effective Testbenches
VHDL 1. ver.7a VHDL1 INTRODUCTION TO VHDL (VERY-HIGH-SPEED-INTEGRATED-CIRCUITS HARDWARE DESCRIPTION LANGUAGE) KH WONG (w2 begins) (Some pictures are.
IAS 0600 Digital Systems Design
VHDL (VHSIC Hardware Description Language)
8085 Microprocessor Architecture
ECE 448 Lecture 13 Multipliers Timing Parameters
ECE 545 Lecture 12 Design of Controllers Finite State Machines and Algorithmic State Machine (ASM) Charts.
State Machine Design with an HDL
ECE 545 Lecture 11 Design of Controllers Finite State Machines and Algorithmic State Machine (ASM) Charts.
Behavioral Modeling of Sequential-Circuit Building Blocks
ECE 331 – Digital System Design
Data Flow Description of Combinational-Circuit Building Blocks
Figure 8.1. The general form of a sequential circuit.
Data Flow Description of Combinational-Circuit Building Blocks
ECE 448 Lecture 6 Finite State Machines State Diagrams, State Tables, Algorithmic State Machine (ASM) Charts, and VHDL Code.
8085 Microprocessor Architecture
ECE 448 Lecture 6 Finite State Machines State Diagrams, State Tables, Algorithmic State Machine (ASM) Charts, and VHDL code ECE 448 – FPGA and ASIC Design.
ECE 448 Lecture 6 Finite State Machines State Diagrams vs. Algorithmic State Machine (ASM) Charts.
Sequntial-Circuit Building Blocks
(Sequential-Circuit Building Blocks)
Presentation transcript:

Edge Detection

256x256 Byte image UART interface PC FPGA 1 Byte every a few hundred cycles of FPGA Sobel circuit Edge and direction

Block Diagram of Sobel Edge Detector Write Addr producer Memory 3x256 Bytes Read Addr producer 3x3 Table Derivative Absolute edge input Input is stream of pixels Output is stream of: Edge: (0/1) pixel at center of table is an edge Direction: horizontal, vertical, left-diagonal, right-diagonal data & address address direction Magnitude

Hints for the design Try to understand the algorithm Your implementation should match with the Reference Model at each stage Create High Level Model HLM should include 3x256 memory array instead of 256x256 HLM does not need to be synthesizable Verify the functionality of HLM by comparing the results

Hints for the design Create synthesizable code Verify the functionality of the synthesizable code Optimize the synthesizable code Divide the algorithm to pipeline stages Verify the functionality of each stage Optimize each stage using the RTL design optimization techniques Try to use multiple processes instead of one single huge process Explicit state machines are easier to optimize Try to have clear idea of which signals in your code are registered and which ones combinational

Verification Goal: compare the result of your circuit with the Reference Model results: For debugging purpose, use smaller input data, e.g 8x8 For an 8x8 input, you can debug your code without using automatic file comparison: reasonable to do debugging by exploring the wavefroms Once confident of functionality for small size inputs, use real 256x256 data to produce the results for edge and direction

Verification To compare the real results with the Reference Model results: Modify the testbench, or write a new one that can read text files and compare them Use whatever programming language that you are comfortable with to read the files and do the comparison Use Matlab, which is available on SunEE lab machines to easily read the files and compare them

Optimizing pipeline stages: Derivative For example, assume that Derivative stage calculates: P=(a1+2b1+c1)- (a2+2b2+c2) Inputs are 8bit and output is 9bit

Optimizing pipeline stages: + - x + +x a1 c1 b1 a2 c2b2 P

Optimize pipeline stages: If you just synthesize this stage without any optimization: Latency: 2 Max frequency: 86.64MHz Longest path: 11.54ns Total Logic Elements: 114 Total pins: 61

If you optimize the stage: + - x a1 c1 b1 P + x 2 a2 c2 b2

Optimize pipeline stages: optimized Latency42 Fmax147.69MHz86.64MHz Longest path 6.77ns11.54ns Logic Elements Total pins4561 non-optimized

A simple Adder example library ieee; use ieee.std_logic_1164.all; use ieee.numeric_std.all; entity adder is port( clock : in std_logic; reset : in std_logic; a : in unsigned(15 downto 0); b : in unsigned(15 downto 0); z : out unsigned(16 downto 0) ); end adder; architecture main of adder is signal tmp: unsigned(16 downto 0); signal i1,i2: unsigned(15 downto 0); begin process begin wait until rising_edge(clock); i1<=a; i2<=b; end process; process begin wait until rising_edge(clock); if reset='1' then tmp<=to_unsigned(0,17); else tmp<=('0' & i1) + ('0' & i2) ; end if; end process; z<=tmp; end main;

A simple Adder example:.csf.rpt file Chip name: |adder| Device for compilation: |EP20K200EFC484-2X | Total logic elements | 66 / 8320 ( < 1 % )| Total pins | 51 / 379 ( 13 % ) | Total ESB bits | 0 / ( 0 % ) | Info: Clock has Internal fmax of MHz between source register i21 and destination register N_z16 (period= ns)

MOD 3 You may need a circuit that keeps the pixels order in the correct sequence while writing into 3x3 table :

XXXXXXXXXXXXXC2C1C0 B15B14B13B12B11B10B9B8B7B6B5B4B3B2B1B0 A15A14A13A12A11A10A9A8A7A6A5A4A3A2A1A0 ……………… P15P14….P2P1P0 O15O14….O2O1O0 D15D14….D2D1D0 C15C14…. C2 C1C0 B15B14….B2B1B0 A15A14….A2A1A0 16x16 memory 3x16 memory N15N14…N2N1N0 Do edge detection for B1

C10C9C8C7C6C5C4C3C2C1C0 B15B14B13B12B11B10B9B8B7B6B5B4B3B2B1B0 A15A14A13A12A11A10A9A8A7A6A5A4A3A2A1D0 ……………… P15P14….P2P1P0 O15O14….O2O1O0 D15D14….D2D1D0 C15C14….C2C1C0 B15B14….B2B1B0 A15A14….A2A1A0 16x16 memory 3x16 memory C12C11 C13C14C15 N15N14…N2N1N0 D0 C0 B0 Reorder the pixels when Writing to 3x3 table Row Mod

Row count in 256x256 memory: C0 E0 D0 E0 D0 C0 Rowcount for E0=4 (E0 is the last pixel written to 3x256 mem: To fill the third row of 3x3 table, find the location of E0 in 3x256 mem: 4 mod 1=1 in 3x256 mem Grab E0 and copy it to 3 rd row in 3x3 The 2 nd row of 3x3 table: D0=(4-1 mod 3)=0; in 3x256 mem Take D0 and copy it to 2 nd row in 3x3 And so on: Row# of X in 3x3=(row# of X in 3x256) mod 3 Row# of X-1 in 3x3=(row# of X-1 in 3x256) mod 3 Row# of X-2 in 3x3=(row# of X-2 in 3x256) mod … Row count in 3x256 memory: Row count in 3x3 table.. H G F E D C B A mod3 3x256 memory 3x3 table

How to implement mod 3 From numbers theory: d2d1d0 mod 3 is equal to: (d2+d1+d0) mod mod 3 = (1+3+6) mod 3 = 10 mod 3 = (1+0) mod 3= 1 Row count is an 8-bit number (0-255) Design the circuit of mod 3 for a 4-bit input circuit

Mod 3 MSB 4-bits LSB 4-bits Add 2-bits 4-bits 2-bits

Mod 3 xE5 Mod 3=? Mod Add

Mod 3 2 to 4 decoder 8bits Image row 2bits mem0 mem2 mem1 we i_valid FF

Count up to 2 2 to 4 decoder 2bits mem0 mem2 mem1 we i_valid Alternative to mod 3 FF