Lab 5 - INUesc.inu.ac.kr/~seban90/Lab5.pdf · 2017. 11. 20. · Clock domain crossing A clock...

33
Jaeyong Chung System-on-Chip(SoC) Laboratory Incheon National University Digital Integrated Circuits Lab 5

Transcript of Lab 5 - INUesc.inu.ac.kr/~seban90/Lab5.pdf · 2017. 11. 20. · Clock domain crossing A clock...

Page 1: Lab 5 - INUesc.inu.ac.kr/~seban90/Lab5.pdf · 2017. 11. 20. · Clock domain crossing A clock domain crossing(CDC) is the traversal of a signal in a synchronous digital circuit from

Jaeyong Chung

System-on-Chip(SoC) Laboratory

Incheon National University

Digital Integrated Circuits

Lab 5

Page 2: Lab 5 - INUesc.inu.ac.kr/~seban90/Lab5.pdf · 2017. 11. 20. · Clock domain crossing A clock domain crossing(CDC) is the traversal of a signal in a synchronous digital circuit from

Outline

BCD Counter

FPGA Board

Chung EPC6055 2

Page 3: Lab 5 - INUesc.inu.ac.kr/~seban90/Lab5.pdf · 2017. 11. 20. · Clock domain crossing A clock domain crossing(CDC) is the traversal of a signal in a synchronous digital circuit from

BCD Counter

Introduction

Make a decade counter by using a counter module.

A data from the decade counter is changed into the FND

data by the FND decoder.

Express a decade number by using the FND data and the

fndscan.

Chung EPC6055 3

Page 4: Lab 5 - INUesc.inu.ac.kr/~seban90/Lab5.pdf · 2017. 11. 20. · Clock domain crossing A clock domain crossing(CDC) is the traversal of a signal in a synchronous digital circuit from

BCD Counter

7-Segment

The numerals 0, 1, 6, 7 and 9 may be represented by 7 leds.

Chung EPC6055 4

Page 5: Lab 5 - INUesc.inu.ac.kr/~seban90/Lab5.pdf · 2017. 11. 20. · Clock domain crossing A clock domain crossing(CDC) is the traversal of a signal in a synchronous digital circuit from

BCD Counter

7-Segment

Binarycode encodings for displaying the digits.

DATA value

ADigits B C D E F G DP ADigits B C D E F G DP

Chung EPC6055 5

Page 6: Lab 5 - INUesc.inu.ac.kr/~seban90/Lab5.pdf · 2017. 11. 20. · Clock domain crossing A clock domain crossing(CDC) is the traversal of a signal in a synchronous digital circuit from

BCD Counter

7-Segment

By adjusting some values, each of the segments displays a

different number.

DATA value SCAN value

Digits

Chung EPC6055 6

Page 7: Lab 5 - INUesc.inu.ac.kr/~seban90/Lab5.pdf · 2017. 11. 20. · Clock domain crossing A clock domain crossing(CDC) is the traversal of a signal in a synchronous digital circuit from

BCD Counter

Implementation

The device is initialized by reset signal.

The counter increment once for every second.

Display form

The device display the digits by using 7-Segments.

Chung EPC6055 7

Page 8: Lab 5 - INUesc.inu.ac.kr/~seban90/Lab5.pdf · 2017. 11. 20. · Clock domain crossing A clock domain crossing(CDC) is the traversal of a signal in a synchronous digital circuit from

BCD Counter

Block Diagram

Chung EPC6055 8

Page 9: Lab 5 - INUesc.inu.ac.kr/~seban90/Lab5.pdf · 2017. 11. 20. · Clock domain crossing A clock domain crossing(CDC) is the traversal of a signal in a synchronous digital circuit from

BCD Counter

Code

clockGenerator

Chung EPC6055 9

Page 10: Lab 5 - INUesc.inu.ac.kr/~seban90/Lab5.pdf · 2017. 11. 20. · Clock domain crossing A clock domain crossing(CDC) is the traversal of a signal in a synchronous digital circuit from

BCD Counter

Code

clockDivider

Chung EPC6055 10

Page 11: Lab 5 - INUesc.inu.ac.kr/~seban90/Lab5.pdf · 2017. 11. 20. · Clock domain crossing A clock domain crossing(CDC) is the traversal of a signal in a synchronous digital circuit from

Code

clockDivider

BCD Counter

Chung EPC6055 11

Page 12: Lab 5 - INUesc.inu.ac.kr/~seban90/Lab5.pdf · 2017. 11. 20. · Clock domain crossing A clock domain crossing(CDC) is the traversal of a signal in a synchronous digital circuit from

BCD Counter

Code

counter

Chung EPC6055 12

Page 13: Lab 5 - INUesc.inu.ac.kr/~seban90/Lab5.pdf · 2017. 11. 20. · Clock domain crossing A clock domain crossing(CDC) is the traversal of a signal in a synchronous digital circuit from

BCD Counter

Code

fndDecoder

Chung EPC6055 13

Page 14: Lab 5 - INUesc.inu.ac.kr/~seban90/Lab5.pdf · 2017. 11. 20. · Clock domain crossing A clock domain crossing(CDC) is the traversal of a signal in a synchronous digital circuit from

BCD Counter

Code

fndDecoder

Chung EPC6055 14

Page 15: Lab 5 - INUesc.inu.ac.kr/~seban90/Lab5.pdf · 2017. 11. 20. · Clock domain crossing A clock domain crossing(CDC) is the traversal of a signal in a synchronous digital circuit from

BCD Counter

Code

Testbench

Chung EPC6055 15

Page 16: Lab 5 - INUesc.inu.ac.kr/~seban90/Lab5.pdf · 2017. 11. 20. · Clock domain crossing A clock domain crossing(CDC) is the traversal of a signal in a synchronous digital circuit from

BCD Counter

Simulation result

Chung EPC6055 16

Page 17: Lab 5 - INUesc.inu.ac.kr/~seban90/Lab5.pdf · 2017. 11. 20. · Clock domain crossing A clock domain crossing(CDC) is the traversal of a signal in a synchronous digital circuit from

BCD Counter

Code

Main

rstMain -> Reset signal

clkMain -> Main Clock

fndData -> Data

fndScan -> Com data

Chung EPC6055 17

Page 18: Lab 5 - INUesc.inu.ac.kr/~seban90/Lab5.pdf · 2017. 11. 20. · Clock domain crossing A clock domain crossing(CDC) is the traversal of a signal in a synchronous digital circuit from

BCD Counter

Code

UCF

connecting the module with FPGA PIN

Chung EPC6055 18

Page 19: Lab 5 - INUesc.inu.ac.kr/~seban90/Lab5.pdf · 2017. 11. 20. · Clock domain crossing A clock domain crossing(CDC) is the traversal of a signal in a synchronous digital circuit from

Outline

BCD Counter

FPGA Board

Chung EPC6055 19

Page 20: Lab 5 - INUesc.inu.ac.kr/~seban90/Lab5.pdf · 2017. 11. 20. · Clock domain crossing A clock domain crossing(CDC) is the traversal of a signal in a synchronous digital circuit from

FPGA Board

Chung EPC6055 20

Page 21: Lab 5 - INUesc.inu.ac.kr/~seban90/Lab5.pdf · 2017. 11. 20. · Clock domain crossing A clock domain crossing(CDC) is the traversal of a signal in a synchronous digital circuit from

FPGA Board

Block Diagram

Chung EPC6055 21

Page 22: Lab 5 - INUesc.inu.ac.kr/~seban90/Lab5.pdf · 2017. 11. 20. · Clock domain crossing A clock domain crossing(CDC) is the traversal of a signal in a synchronous digital circuit from

Create New Project

File -> New Project

Enter a name and a path of your project.

Chung EPC6055 22

Page 23: Lab 5 - INUesc.inu.ac.kr/~seban90/Lab5.pdf · 2017. 11. 20. · Clock domain crossing A clock domain crossing(CDC) is the traversal of a signal in a synchronous digital circuit from

Create New Project

Setting some values.

Chung EPC6055 23

Page 24: Lab 5 - INUesc.inu.ac.kr/~seban90/Lab5.pdf · 2017. 11. 20. · Clock domain crossing A clock domain crossing(CDC) is the traversal of a signal in a synchronous digital circuit from

Create New Project

Next

Chung EPC6055 24

Page 25: Lab 5 - INUesc.inu.ac.kr/~seban90/Lab5.pdf · 2017. 11. 20. · Clock domain crossing A clock domain crossing(CDC) is the traversal of a signal in a synchronous digital circuit from

Create New Project

Add files

Chung EPC6055 25

Page 26: Lab 5 - INUesc.inu.ac.kr/~seban90/Lab5.pdf · 2017. 11. 20. · Clock domain crossing A clock domain crossing(CDC) is the traversal of a signal in a synchronous digital circuit from

Create New Project

Project was created successfully.

Chung EPC6055 26

Page 27: Lab 5 - INUesc.inu.ac.kr/~seban90/Lab5.pdf · 2017. 11. 20. · Clock domain crossing A clock domain crossing(CDC) is the traversal of a signal in a synchronous digital circuit from

Synthesize (XST)

Click the run menu.

Chung EPC6055 27

Page 28: Lab 5 - INUesc.inu.ac.kr/~seban90/Lab5.pdf · 2017. 11. 20. · Clock domain crossing A clock domain crossing(CDC) is the traversal of a signal in a synchronous digital circuit from

Synthesize (XST)

Run succeeded.

Chung EPC6055 28

Page 29: Lab 5 - INUesc.inu.ac.kr/~seban90/Lab5.pdf · 2017. 11. 20. · Clock domain crossing A clock domain crossing(CDC) is the traversal of a signal in a synchronous digital circuit from

Download

Double click ”Configure Device (iMPACT)” button.

Chung EPC6055 29

Page 30: Lab 5 - INUesc.inu.ac.kr/~seban90/Lab5.pdf · 2017. 11. 20. · Clock domain crossing A clock domain crossing(CDC) is the traversal of a signal in a synchronous digital circuit from

Download

Double click ‘xc3s2000’

Download the bit file

Chung EPC6055 30

Page 31: Lab 5 - INUesc.inu.ac.kr/~seban90/Lab5.pdf · 2017. 11. 20. · Clock domain crossing A clock domain crossing(CDC) is the traversal of a signal in a synchronous digital circuit from

Download

Click the right button and the program

Chung EPC6055 31

Page 32: Lab 5 - INUesc.inu.ac.kr/~seban90/Lab5.pdf · 2017. 11. 20. · Clock domain crossing A clock domain crossing(CDC) is the traversal of a signal in a synchronous digital circuit from

BCD Counter

Implementation

Chung EPC6055 32

Page 33: Lab 5 - INUesc.inu.ac.kr/~seban90/Lab5.pdf · 2017. 11. 20. · Clock domain crossing A clock domain crossing(CDC) is the traversal of a signal in a synchronous digital circuit from

Clock domain crossing

A clock domain crossing(CDC) is the traversal of a

signal in a synchronous digital circuit from one clock

domain into another

Avoid if possible (Metastability, etc…)

Exercise

Remove CDC in BCD counter

D Q D Q

CLK1 CLK2

Chung EPC6055 33