+ All Categories
Home > Documents > ECE 448: Spring 2013 Lab 5 FPGA Design Flow Based on Aldec Active-HDL Fast Reflex Game

ECE 448: Spring 2013 Lab 5 FPGA Design Flow Based on Aldec Active-HDL Fast Reflex Game

Date post: 31-Jan-2016
Category:
Upload: oakley
View: 54 times
Download: 0 times
Share this document with a friend
Description:
ECE 448: Spring 2013 Lab 5 FPGA Design Flow Based on Aldec Active-HDL Fast Reflex Game. Agenda for today. Part 1: Distribution of FPGA boards Part 2: Diagnostics of FPGA boards Part 3: Introduction to FPGA Design Flow based on Aldec Active-HDL Part 4: Introduction to Lab 5 - PowerPoint PPT Presentation
37
ECE 448: Spring 2013 Lab 5 FPGA Design Flow Based on Aldec Active-HDL Fast Reflex Game
Transcript
Page 1: ECE 448: Spring 2013 Lab 5 FPGA Design Flow Based on  Aldec Active-HDL Fast Reflex Game

ECE 448: Spring 2013Lab 5

FPGA Design Flow Based on Aldec Active-HDL

Fast Reflex Game

Page 2: ECE 448: Spring 2013 Lab 5 FPGA Design Flow Based on  Aldec Active-HDL Fast Reflex Game

Part 1: Distribution of FPGA boards

Part 2: Diagnostics of FPGA boards

Part 3: Introduction to FPGA Design Flow based on Aldec Active-HDL

Part 4: Introduction to Lab 5

Part 5: Demos of Lab 4 & late demos of Lab 3

Agenda for today

Page 3: ECE 448: Spring 2013 Lab 5 FPGA Design Flow Based on  Aldec Active-HDL Fast Reflex Game

Parts 1 & 2

Distribution and Diagnostics

of FPGA Boards

Page 4: ECE 448: Spring 2013 Lab 5 FPGA Design Flow Based on  Aldec Active-HDL Fast Reflex Game

Part 3

Hands-on Session on

FPGA Design Flow

based on Aldec Active-HDL

Page 5: ECE 448: Spring 2013 Lab 5 FPGA Design Flow Based on  Aldec Active-HDL Fast Reflex Game

Part 4

Introduction to Lab 5

Page 6: ECE 448: Spring 2013 Lab 5 FPGA Design Flow Based on  Aldec Active-HDL Fast Reflex Game

Task 1

Experimental Testing of

Lab 4 for Task 5

& Lab 4 for Task 6

Page 7: ECE 448: Spring 2013 Lab 5 FPGA Design Flow Based on  Aldec Active-HDL Fast Reflex Game

LAB4 for TASK5BTNL BTNR BTNU BTND BTNS

loadA loadB step run

BTNL BTNR BTNU BTND BTNS

loadA loadB step run

BUTTON_UNIT SWITCH_UNIT

SW

SW

IVA IVB

LAB3e

SEG AN

SEG AN

hex0hex1hex2hex3

hex0hex1hex2hex3

SSD_DRIVER

XSGN YSGN Xout Yout Aout Bout k

XSGN YSGN X Y A B k

next_out

LED

LED

TASK5

CLOCK

CLK_RST_1

BTNR

clk rst

clk rst

clk

rst

clkrst

clk

rst

8

8 8

88 8 8 8 8

8 7 4

4444

10

BTNL

Page 8: ECE 448: Spring 2013 Lab 5 FPGA Design Flow Based on  Aldec Active-HDL Fast Reflex Game

rstclk

enCNTRUP

rstclk

enMISR

ld

rst clk

enLFSR

X”00” 8

8

8

IVBloadB

rst

OR

loadB

nexti

10cnz

ld

rst clk

enLFSR

X”00” 8

8

8

IVAloadA

rst

OR

loadA

10cnz

clkclk

LAB2

A B

X Y

sel

En ‘0’

8

clkrst

8

YSGN

nexti

nextorst

clk

enMISR

8

clkrst

8

XSGN

nexto

10k

k9..8

2

k7..0

8

≠ 0

cnz

= X”3FF”10

done

rstclk

nexto

OR

AND not done

nexto

step run

AND

cnz

LAB3eXout Aout

A8 8

B8 8

Yout

8

Bout kout

10k

Page 9: ECE 448: Spring 2013 Lab 5 FPGA Design Flow Based on  Aldec Active-HDL Fast Reflex Game

BTNL

BTNS

Debouncer RED loadA

Debouncer RED

runD Q‘1’

en

rst

clk

rst

clk

BTNR Debouncer RED loadB

rst

clk

rst

clk

rst

clk

rst

clk clk

BUTTON_UNIT

BTNU Debouncer RED step

rst

clk

rst

clk

BTND Debouncer RED next_out

rst

clk

rst

clk rst

Page 10: ECE 448: Spring 2013 Lab 5 FPGA Design Flow Based on  Aldec Active-HDL Fast Reflex Game

Debouncer

rst clk

Page 11: ECE 448: Spring 2013 Lab 5 FPGA Design Flow Based on  Aldec Active-HDL Fast Reflex Game

Generics of the Debouncer

k – size of the counter

DD – debouncing period in clock cycles

Please make sure that:

DD TCLK ≈ 10 ms

2k > DD

Page 12: ECE 448: Spring 2013 Lab 5 FPGA Design Flow Based on  Aldec Active-HDL Fast Reflex Game

Rising Edge Detector - RED

input

clk

output

rst

Page 13: ECE 448: Spring 2013 Lab 5 FPGA Design Flow Based on  Aldec Active-HDL Fast Reflex Game

SW IVA

SWITCH_UNIT

IVB

8 8

8

Page 14: ECE 448: Spring 2013 Lab 5 FPGA Design Flow Based on  Aldec Active-HDL Fast Reflex Game

Counter UPCOUNTER UP

Counter UP

q(k-1..k-2)

AN

Counter UP

SEG(6..0)

Counter UP

Counter UPrst

clkOC

SSD_DRIVER

OC – One’s Complement

Page 15: ECE 448: Spring 2013 Lab 5 FPGA Design Flow Based on  Aldec Active-HDL Fast Reflex Game

Multiplexing Digits

Page 16: ECE 448: Spring 2013 Lab 5 FPGA Design Flow Based on  Aldec Active-HDL Fast Reflex Game

Generics of the SSD_DRIVER

1 ms ≤ Refresh period ≤ 16 ms

1 ms ≤ 2k TCLK ≤ 16 ms

fCLK = 100 MHz

k = ?

k – size of the internal counter. Refresh period = 2k clock cycles.

Page 17: ECE 448: Spring 2013 Lab 5 FPGA Design Flow Based on  Aldec Active-HDL Fast Reflex Game

CLOCK

BTNL

CLK_RST_1

BTNRrst

clk

Page 18: ECE 448: Spring 2013 Lab 5 FPGA Design Flow Based on  Aldec Active-HDL Fast Reflex Game

LAB4 for TASK6BTNL BTNR BTNU BTND BTNS

loadA loadB step run

BTNL BTNR BTNU BTND BTNS

loadA loadB step run

BUTTON_UNIT SWITCH_UNIT

SW

SW

IVA IVB

LAB3e

SEG AN

SEG AN

hex0hex1hex2hex3

hex0hex1hex2hex3

SSD_DRIVER

XSGN YSGN Xout Yout Aout Bout k

XSGN YSGN X Y A B k

next_out

LED

LED

TASK5

CLOCK

CLK_RST_2

BTNR

clk rst

clk rst

clk

rst

clkrst

clk

rst

8

8 8

88 8 8 8 8

8 7 4

4444

10

BTNL

Page 19: ECE 448: Spring 2013 Lab 5 FPGA Design Flow Based on  Aldec Active-HDL Fast Reflex Game

CLK_RST_2

DCM_SP

IBUFG BUFGCLOCK

locked

clk_ibufg clk100

rst

clkin

clkfb

clk0

rstBTNL

BTNR

rst_or

clkfxclkfx

clkBUFGclkfx_obufg

clk0_obufg

‘0’

0

1

BUFGMUX

Page 20: ECE 448: Spring 2013 Lab 5 FPGA Design Flow Based on  Aldec Active-HDL Fast Reflex Game

Task 2

Verifying Maximum

Experimental Clock Frequency

Page 21: ECE 448: Spring 2013 Lab 5 FPGA Design Flow Based on  Aldec Active-HDL Fast Reflex Game

CLK_RST_3

IBUFG BUFGCLOCK

locked

clk_ibufg clk100

rst

clkin

clkfb

clk0

rstBTNL

BTNR

rst_or

clkfxclkfx

clkBUFGclkfx_obufg

clk0_obufg

0

1

BUFGMUX

SW(0)

ODDR2D0 D1 C0 C1 CE R S

Q

CLOCKFX

‘1’ ‘0’ ‘1’ ‘0’ ‘0’

clkfx clkfx_180

ODDR2D0 D1 C0 C1 CE R S

Q

CLOCK100

‘1’ ‘0’ ‘1’ ‘0’ ‘0’

clk100 clk100_180

clk180

clkfx180

BUFGclk100_180

clk180_obufg

BUFGclkfx_180

clkfx180_obufg

Page 22: ECE 448: Spring 2013 Lab 5 FPGA Design Flow Based on  Aldec Active-HDL Fast Reflex Game

LAB5 for TASK2BTNL BTNR BTNU BTND BTNS

loadA loadB step run

BTNL BTNR BTNU BTND BTNS

loadA loadB step run

BUTTON_UNIT SWITCH_UNIT

SW

SW

IVA IVB

LAB3e

SEG AN

SEG AN

hex0hex1hex2hex3

hex0hex1hex2hex3

SSD_DRIVER

XSGN YSGN Xout Yout Aout Bout k

XSGN YSGN X Y A B k

next_out

LED

LED

TASK5

CLOCK

CLK_RST_3

BTNR

clk rst

clk rst

clk

rst

clkrst

clk

rst

8

8 8

88 8 8 8 8

8 7 4

4444

10

SW(0)

CLOCKFX

CLOCK100

BTNL

Page 23: ECE 448: Spring 2013 Lab 5 FPGA Design Flow Based on  Aldec Active-HDL Fast Reflex Game

Verifying Maximum Clock Frequency

The circuit should work correctly for

SW(0) = 1 => clk = clk100 => fCLK = 100 MHz

The circuit should fail for

SW(0) = 0 => clk = clkfx => fCLK > maximum fCLK

Page 24: ECE 448: Spring 2013 Lab 5 FPGA Design Flow Based on  Aldec Active-HDL Fast Reflex Game

DCM_SP_inst : DCM_SPgeneric map ( CLKDV_DIVIDE => 2.0,-- CLKDV divide value-- (1.5,2,2.5,3,3.5,4,4.5,5,5.5,6,6.5,7,7.5,8,9,10,11,12,13,14,15,16).-- Divide value on CLKFX outputs - D - (1-32)-- Multiply value on CLKFX outputs - M - (2-32)-- CLKIN divide by two (TRUE/FALSE)-- Input clock period specified in nS-- Output phase shift (NONE, FIXED, VARIABLE)-- Feedback source (NONE, 1X, 2X)CLKFX_DIVIDE => ………….,CLKFX_MULTIPLY => ………,CLKIN_DIVIDE_BY_2 => FALSE,CLKIN_PERIOD => 10.0,CLKOUT_PHASE_SHIFT => "NONE",CLK_FEEDBACK => "1X”,

Setting frequency of clkFX during DCM_SP Instantiation

Page 25: ECE 448: Spring 2013 Lab 5 FPGA Design Flow Based on  Aldec Active-HDL Fast Reflex Game

Observing CLOCK100 and CLOCKFXusing Oscilloscope

Using oscilloscope and two versions of your implementation(with different values of generics of DCM_SP)show the clock signal for the following three cases:

A.fCLK = 100 MHz

B.fCLK = maximum clock frequency returned by the tools

C.fCLK = 10 MHz

Document your findings using digital photos.Discuss your observations.

Page 26: ECE 448: Spring 2013 Lab 5 FPGA Design Flow Based on  Aldec Active-HDL Fast Reflex Game

NET "CLOCK100" LOC = "…….." | IOSTANDARD = "LVCMOS33";

NET "CLOCKFX" LOC = "…….." | IOSTANDARD = "LVCMOS33”;

New Lines in theUser Constraint File (UCF)

Select two arbitrary board pins that would be the most easy

to observe, and have a relatively large physical distance

from each other (to avoid interference).

Page 27: ECE 448: Spring 2013 Lab 5 FPGA Design Flow Based on  Aldec Active-HDL Fast Reflex Game

Task 3

Fast Reflex Game

Page 28: ECE 448: Spring 2013 Lab 5 FPGA Design Flow Based on  Aldec Active-HDL Fast Reflex Game

Rules of the Game (1)

BCD Counter is initialized with 10.00 seconds.

After pressing start_stop the counter starts counting down every 0.01 second: 9.99, 9.98, 9.97, …, 0.02, 0.01, 0.00, -0.01, -0.02 …

The goal is to press the start_stop button againas close as possible to 0.00.

After the second press, the counter is stopped.

Page 29: ECE 448: Spring 2013 Lab 5 FPGA Design Flow Based on  Aldec Active-HDL Fast Reflex Game

Rules of the Game (2)The last obtained result can be a. stored with the press of the store button b. skipped with the press of the skip button.After performing these operations the counter is againinitialized to 10.00.

Only the last 4 stored results are remembered by the system.

The minimum and the maximum absolute value of these last 4 stored results is calculated.

The clear button clears the storage, and initializesthe counter to 10.00.

Page 30: ECE 448: Spring 2013 Lab 5 FPGA Design Flow Based on  Aldec Active-HDL Fast Reflex Game

Meaning of Buttons

clear start_stop next_out

store

skip

BTNL BTNR

BTNU

BTND

BTNS

Page 31: ECE 448: Spring 2013 Lab 5 FPGA Design Flow Based on  Aldec Active-HDL Fast Reflex Game

Rules of the Game (3)The next_out button allows displaying

1. current value of the counter 2. the last stored result 3. the result with the minimum absolute value 4. the result with the maximum absolute value.

After each press of the next_out button, the mode of display changes to the next one in the wrap-around fashion.

The current mode is also indicated with an appropriate number of the rightmost LEDs turned on(1 for the current value of the counter, 2 for the last stored result, etc.)

Page 32: ECE 448: Spring 2013 Lab 5 FPGA Design Flow Based on  Aldec Active-HDL Fast Reflex Game

CD_mod_9 b(3)

X”1”4

4

b(4)enbout

init

ld

rstrst clk

D(3)

CD_mod_9

X”0”4

4

enbout

init

ld

rstrst clk

D(2)

CD_mod_9

X”0”4

4

enbout

init

ld

rstrst clk

D(1)

CD_mod_9 b(0)=bin

X”0”4

4

enbout

init

ld

rstrst clk

D(0)

b(2) b(1)

minus

rst

initclk

set

DFF

4-digit BCD Counter DownBCD_CD

clk rst

CD_mod_9 – Counter Down mod 9bin – borrow in

bout – borrow out

minimumminimum = 1 Counter = -9.99

dir

minus

dir

minus

dir

minus

dir

minus

dir = 0 : count downdir = 1 : count up

Page 33: ECE 448: Spring 2013 Lab 5 FPGA Design Flow Based on  Aldec Active-HDL Fast Reflex Game

Result Storage & Processing - RSP

enclk

rstrst

13

13

REG

enclk

rstrst

13

REG

enclk

rstrst

13

REG

enclk

rstrst

13

REG

storeresult

lastlast

MAXABS

maxMINABS min

output13

sel_out2

0 1 2 3

min maxlastresult

clk rst

MAXABS – Maximum Absolute Value

MINABS – Minimum Absolute Value

Page 34: ECE 448: Spring 2013 Lab 5 FPGA Design Flow Based on  Aldec Active-HDL Fast Reflex Game

BTNL

BTNS

Debouncer RED clear

Debouncer RED

rst

clk

rst

clk

BTNR Debouncer RED next_out

rst

clk

rst

clk

rst

clk

rst

clk

BUTTON_UNIT

BTNU Debouncer RED store

rst

clk

rst

clk

BTND Debouncer RED skip

rst

clk

rst

clk

start_stop

Page 35: ECE 448: Spring 2013 Lab 5 FPGA Design Flow Based on  Aldec Active-HDL Fast Reflex Game

CLOCK

BTNL

CLK_RST_4

BTNDrst

clk

Page 36: ECE 448: Spring 2013 Lab 5 FPGA Design Flow Based on  Aldec Active-HDL Fast Reflex Game

Top-Level of Fast Reflex Game

CU_mod_N: Counter Up mod N

0

BTNL

BTNR

BTNU

BTND

BTNS

clear

next_out

store

skip

start_stop

BUTTON_UNIT

CONTROLLER

CU_mod_N

SEG AN

SEG AN

hex0hex1hex2hex3

SSD_DRIVER

clk rst

8 4

RSP

BCD_CD

OUT_FORMAT

13

result

sel_outoutput

store

binminus & D(2..0)

init

ld en

cout

13

hex0hex1hex2hex3

4444

LED

LED8

CLK_RST_4

BTND

clk rst

CLOCK

k

clk

rst

clk rstrst

sel_out

clk

rstrst

sel_out

init

count

count

store_res

D(3)

D3

D3

4

4

clk

clear_res

rst

rst

cdown

minimumminimum

clear_res

rst

init

rst

rst clk

2

BTNL

Page 37: ECE 448: Spring 2013 Lab 5 FPGA Design Flow Based on  Aldec Active-HDL Fast Reflex Game

Part 5

Demos of Lab 4

&

Late Demos of Lab 3


Recommended