digital system design overview ene434[07][v1]_01

28
November 16, 2007 ENE 433 Digital System Design and Implementation 1 Lecture 1 ภาพรวมการออกแบบระบบดิจิตอล Digital System Design Overview พินิจ กําหอม Pinit Kumhom VLSI Laboratory Dept. of Electronic and Telecommunication Engineering (KMUTT) Faculty of Engineering King Mongkut’s University of Technology Thonburi [email protected] November 16, 2007 ENE 433 Digital System Design and Implementation 2 Outlines ภาพรวมและความสัมพันธกันของ ระบบดิจิตอล ระบบสมองกลฝงตัว และระบบบนชิพ (Digital System, Embedded System and System-on- Chip: An Overview) นิยามของระบบดิจิตอล (Digital System Definition) ระบบสมองกลฝงตัวและระบบดิจิตอล (Embedded System and Digital System) ระบบสมองกลฝงตัวและระบบบนชิพ (Embedded System and System-on-Chip (SoC)) กระบวนการออกแบบระบบดิจิตอลสมัยใหมและเทคโนโลยีเปาหมาย (Modern Digital Design Process and Target Technology) ระเบียบวิธีการออกแบบและเครื่องมือการออกระบบอิเล็กทรอนิกสแบบอัตโนมัติ (Methodologies and Electronic Design Automation Tools (EDA Tools)) Hardware Description Language (1st Visit)

Upload: grid-g

Post on 18-Nov-2014

111 views

Category:

Documents


0 download

DESCRIPTION

Not my document

TRANSCRIPT

Page 1: Digital System Design Overview Ene434[07][v1]_01

November 16, 2007 ENE 433 Digital System Design and Implementation 1

Lecture 1ภาพรวมการออกแบบระบบดิจิตอลDigital System Design Overview

พินิจ กําหอมPinit Kumhom

VLSI LaboratoryDept. of Electronic and Telecommunication Engineering (KMUTT)

Faculty of EngineeringKing Mongkut’s University of Technology Thonburi

[email protected]

November 16, 2007 ENE 433 Digital System Design and Implementation 2

Outlines• ภาพรวมและความสัมพันธกนัของ ระบบดิจิตอล ระบบสมองกลฝงตัว

และระบบบนชิพ (Digital System, Embedded System and System-on-Chip: An Overview)

– นิยามของระบบดิจิตอล (Digital System Definition)– ระบบสมองกลฝงตัวและระบบดิจิตอล (Embedded System and Digital System)– ระบบสมองกลฝงตัวและระบบบนชพิ (Embedded System and System-on-Chip (SoC))

• กระบวนการออกแบบระบบดจิิตอลสมัยใหมและเทคโนโลยีเปาหมาย (Modern Digital Design Process and Target Technology)

– ระเบียบวิธีการออกแบบและเครือ่งมือการออกระบบอิเลก็ทรอนิกสแบบอตัโนมัติ (Methodologies and Electronic Design Automation Tools (EDA Tools))

– Hardware Description Language (1st Visit)

Page 2: Digital System Design Overview Ene434[07][v1]_01

November 16, 2007 ENE 433 Digital System Design and Implementation 3

Electronic Systems

ElectronicSystem. . . . . .

Input

SignalsOutput

Signals

AnalogSystem

Amplifier

DigitalSystem

Counter

Input information Output

information

(process)

Small-scale electrical signalsVoices

analog (continuous) signalsanalog (continuous) signals

Voices

digital signalsdigital signals

November 16, 2007 ENE 433 Digital System Design and Implementation 4

Analog Systems V.S. Digital Systems• Analog system

– Process information encoded in analog signals

• Continuous-time (time varying) signal

• Continuous value

– Emulate the nature• Sensors naturally

convert physical properties to analog signals

• Actuators naturally convert analog signals to physical properties

• Digital System– Process information

encoded in digital signals• The signal is time-varying

but we interest in – discrete-time signal

– 2 values represented by ‘0’ and ‘1’ (binary)

– Need ADC and DAC• convert physical property

in terms of analog signal to digital

• convert digital output to analog signals

(Note: a discrete-time signal with multiple values is called a discrete signal)

Page 3: Digital System Design Overview Ene434[07][v1]_01

November 16, 2007 ENE 433 Digital System Design and Implementation 5

Expanded Digital System

ADC

DigitalSystem

DAC

Analog-to-Digital Converter

Digital-to-Analog Converter

Analog signal

Analog signal

Digital signals

Digital signals

Sensor

Actuator

Microphone

Speakers

November 16, 2007 ENE 433 Digital System Design and Implementation 6

การใชงานระบบดิจิตอล• คอมพิวเตอรทั่วไป (general computers)

• ระบบดิจิตอลสําหรับทําการใชงานเฉพาะ (Application-Specific Digital Systems) ในปจจุบันระบบดิจติอลในกลุมนีจ้ะเปน ระบบฝงตัว (embedded systems)

• ในวิชานีเ้ราโฟกัสที่การออกแบบระบบดิจติอลสําหรับทําหนาที่เฉพาะ

Page 4: Digital System Design Overview Ene434[07][v1]_01

November 16, 2007 ENE 433 Digital System Design and Implementation 7

Embedded System and Digital SystemAn embedded system is an electronic system that is embedded into something

making it works in a certain way.

• ระบบสมองกลฝงตัวคือระบบอิเลก็ทรอนิกสที่ฝงอยูกบัอะไรบางอยางเพื่อทาํใหมันทํางานในลักษณะใดลักษณะหนึ่งตามตองการ

• ระบบสมองกลฝงตัวสวนใหญเปน microprocessor-based digital systems– ตองมีโปรแกรม (ซอฟทแวร) (software)– บางสวนของระบบอาจเปนการออกแบบและสรางบนฮารดแวร (hardware)– ปญหาหนึ่งของการออกแบบระบบคือการแบงวางานสวนใดควรจะเปน

ฮารดแวรสวนใดควรจะเปนซอฟทแวร (hardware/software partitioning)

November 16, 2007 ENE 433 Digital System Design and Implementation 8

Embedded System and System-on-Chip• เราอาจสรางระบบสมองกลฝงตัว microprocessor-based

embedded system บน– บนบอรด (PCB)– บนชิพเดี่ยว (on a single chip)

• เราเรียกการออกแบบระบบดิจิตอลเพื่อนาํทั้งระบบลงในชิพเดี่ยววาsystem-on-chip (SoC) design

• ในการออกแบบ SoC ทั้ง MCU และสวนฮารดแวรจะอยูในรูปของ intellectual property core (IP core)

Page 5: Digital System Design Overview Ene434[07][v1]_01

November 16, 2007 ENE 433 Digital System Design and Implementation 9

Digital System, Embedded System, and System-on-Chip

Digital Systems

System-on-Chip (SoC)

Embedded Systems Digital Systems

Embedded Systems

System-on-Chip (SoC)

Digital-based Embedded Systems

Digital system implemented on a single chip

Digital-based embedded system implemented on a single chip

November 16, 2007 ENE 433 Digital System Design and Implementation 10

Digital-based Embedded Systems

ADC

Microprocessor-basedDigital system

DAC

Analog-to-Digital Converter

Digital-to-Analog Converter

Analog signals

Analog signal

Digital signals

Digital signals

Sensors

Actuators

Microphone

Optical sensors

Thermo sensors

etc.

Speakers

Motors

etc

Human/MachineInterface

Customized Hardware/IP Cores

(Hardware Design)

Processors(Software Design)

Page 6: Digital System Design Overview Ene434[07][v1]_01

November 16, 2007 ENE 433 Digital System Design and Implementation 11

Digital-based Embedded System on a Single Chip

ADC

Microprocessor-basedDigital system

DAC

Analog-to-Digital Converter

Digital-to-Analog Converter

Analog signals

Analog signal

Digital signals

Digital signals

Sensors

Actuators

Microphone

Optical sensors

Thermo sensors

etc.

Speakers

Motors

etc

Human/MachineInterface

Customized Hardware/IP Cores

(Hardware Design)

Processor Cores(Software Design)

Hardware/Software Co-design

November 16, 2007 ENE 433 Digital System Design and Implementation 12

Hardware/Software Co-Design Concept• ระบบสมองกลฝงตัวทํางานหลายอยางในลักษณะที่เปนอลักอริธึม

– step-by-step– แตละขัน้ตอนอาจจะทํางานตามอัลกอริธึม A step itself may be carried out by another

algorithm• อลักอริธึมหนึ่ง ๆ สามารถสราง

– บนคอมพิวเตอรดวยการเขียนโปรแกรมเรียกวา software implementation หรือ– ดวยระบบดิจิตอลที่ออกแบบมาใหทําอัลกอริธึมนัน้โดยเฉพาะเรียกวา hardware

implementation• Hardware/software partitioning

– บางอัลกอริธึมเหมาะที่จะสรางดวยซอฟทแวร บางอัลกอริธึมก็เหมาะกับการสรางดวยฮารแวร.

– Hardware/Software partitioning คือการแยกวาอัลกอริธึมหรือบางสวนของอัลกอริธึมใดเหมาะกับการสรางดวยฮารดแวร สวนใดเหมาะกับซอฟทแวร

Page 7: Digital System Design Overview Ene434[07][v1]_01

November 16, 2007 ENE 433 Digital System Design and Implementation 13

Hardware V.S. Software• ฮารดแวร (Hardware)

– ทํางานพรอมกัน (Concurrent) ทําใหขีดจํากัดดานสมรรถนะสูง

– ประสิทธิภาพในการใชพื้นที่และพลังงานสูง (Higher efficiency of space and/or energy utilization)

– ตนทุนการออกแบบสูง (Higher cost of design)

– มีความยืดหยุนต่ํา (Low flexibility)

• ซอฟทแวร (Software)– ทํางานตามลําดับ (Sequential) ทํา

ใหมีขีดจํากัดดานสมรรถนะต่ําลง– ประสิทธิภาพในการใชพื้นที่และ

พลังงานต่ํา(Higher efficiency of space and/or energy utilization)

– ตนทุนการออกแบบต่ํากวา (Lower cost of design)

– มีความยืดหยุนสูง (High flexibility)

November 16, 2007 ENE 433 Digital System Design and Implementation 14

Hardware Design: What it takes• ความรูพื้นฐาน (Fundamental knowledge)

– Information representation (encoding)– Boolean algebra & Digital circuits– Devices & Technology

• Skills on a Design Language, Tools, and Methodology– Hardware Description Language (HDL) e.g. VHDL and Verilog– Electronic Design Automation (EDA) Tools– System Representations– Design methodology (Flow)

• ทักษะในการแกปญหา (Problem-solving skills)

Page 8: Digital System Design Overview Ene434[07][v1]_01

November 16, 2007 ENE 433 Digital System Design and Implementation 15

อุปกรณและเทคโนโลยีการสรางอุปกรณ• อุปกรณอิเล็กทรอนิกสสําหรับระบบดิจิตอลอยูในรูปของวงจรรวม

(Integrated Circuits (IC)) สวนใหญแลวเปนวงจรรวมขนาดใหญ (Very Large Scale Integration (VLSI))

• อุปกรณที่เปน building block พื้นฐานในไอซีสําหรับดจิิตอลคือ ทรานซิสเตอร

• การรูหลักการของกระบวนการผลิตไอซีเปนประโยชนตอการออกแบบ• ในกระบวนการผลิตไอซีใชกระบวนการเรียกวา lithography

– นํา layout ของวงจรไปสราง mask ของทกุ layers– นํา mask ของแตละ layer ไปผานขั้นตอนตาง ๆ

November 16, 2007 ENE 433 Digital System Design and Implementation 16

Layout และชั้น (layers) ตาง ๆ ของไอซีcut line

p well

Page 9: Digital System Design Overview Ene434[07][v1]_01

November 16, 2007 ENE 433 Digital System Design and Implementation 17

Layout และชั้น (layers) ตาง ๆ ของไอซี

p-

p-epi

p well n well

p+n+

gate oxide

Al (Cu)

tungsten

SiO2

SiO2

TiSi2

Dual-Well Trench-Isolated CMOS

field oxide

November 16, 2007 ENE 433 Digital System Design and Implementation 18

Photolithographic Processoxidation

optical mask

processstep

photoresist coatingphotoresist removal (ashing)

spin, rinse, dry

acid etch

photoresist development

stepper exposure

ข้ึนอยูกับสวนที่ตองการผลิต

Page 10: Digital System Design Overview Ene434[07][v1]_01

November 16, 2007 ENE 433 Digital System Design and Implementation 19

ชนิดของไอซดีิจิตอล• สรางดวยการนําไป fab –ไอซีที่ออกแบบเพื่องานเฉพาะเรียกวา ASIC

(Application Specific Integration Circuit)– Full-custom ASIC– Stand-cell ASIC– Gate Array ASIC

• สรางมากอน--ผูออกแบบนํางานที่ออกแบบไปสรางบนไอซีเหลานี้ที่สนามการใชงาน (Field Programmable Devices)– Complex Field Programmable Logic Devices (CPLD/FPGA)– Simple Filed Programmable Logic Devices (PLD, PAL/GAL devices)– Off-the-shelf small and medium scale IC (SSI/MSI) components

November 16, 2007 ENE 433 Digital System Design and Implementation 20

Full-Custom ASIC• ผูออกแบบทาํทกุอยางเอง ลงไปถึง layout ในระดบัทรานซิสเตอร• ออกแบบทั้งระบบเปนไปไดยาก เพราะใชเวลานาน โดยเฉพาะระบบใน

ปจจบุนัที่มีขนาดใหญและซับซอนสูง• ปจจบุนัมีการออกแบบลกัษณะนี้สําหรับ

– ออกแบบ components ของระบบเพื่อจะใหมีสมรรถนะสูง กําลังต่ํา – ออกแบบ slice สําหรับระบบที่สามารถแบงมาเปน slices โดยแตละ slice

เหมือนกัน

• ตองทําการ fab และตองทาํ masks ใหมของแตละ layers ของ layout

Page 11: Digital System Design Overview Ene434[07][v1]_01

November 16, 2007 ENE 433 Digital System Design and Implementation 21

Standard-Cell ASIC• บริษัทผูผลิตมี libraries ของ components ใหเรียกวา standard cells ไว

– ออกแบบไวกอน พรอมมี layout ที่ verify แลว• ผูออกแบบใช standard cells เหลานั้นเปน building blocks

– Basic gates: NAND, NOR, NOT, XOR, XNOR– Multiplexers, decoders– Flip-flops, registers, counters– Memory blocks: RAMs, FIFOs

• Layout ของแตละงานเปนของตัวเอง• ตองทําการ fab และตองทาํ masks ใหมของแตละ layers

November 16, 2007 ENE 433 Digital System Design and Implementation 22

Gate Array ASIC• ลักษณะคลายกบั stand-cell ASIC คือผูออกแบบสรางวงจรของตัวเอง

จาก building blocks ทีบ่ริษัทผูผลิตจัดให • แต building block มีเพียงชนิดเดียวเรียกวา base cells• ผูผลิตนํา base cells มา fab เตรียมไวเปน array • ผลจากผูออกแบบจะเปน interconnection ของ base cells • ผูผลิตบางรายมี libraries ของ components เรียกวา macro cells ที่สรางมา

จาก base cell• ตองมีการ fab แตงายกวา stand-cell ASIC และ custom ASIC มาก

Page 12: Digital System Design Overview Ene434[07][v1]_01

November 16, 2007 ENE 433 Digital System Design and Implementation 23

Complex Filed Programmable Devices• กลุมไอซี fab กอนการออกแบบ• ผูใชออกแบบแลวนําไปสรางดวย IC เหลานี้ ณ. สนามการใชงาน (Field)• คุณสมบัติสําคัญคือ programmable หรือ field programmable โดย

โปรแกรมไดทั้ง Logic cell และ Interconnection• มี 2 โครงสรางหลัก

– Complex Programmable Logic Devices (CPLDs)• Logic cells เปนโครงสราง AND-OR สามารถสรางฟงกชันที่ซับซอนได

– Field Programmable Gate Array (FPGA)• Logic cells สรางในรูป Look-Up-Table (LUT)

November 16, 2007 ENE 433 Digital System Design and Implementation 24

Simple Field Programmable Logic Devices• เปนอุปกรณกลุมที่โปรแกรมได ณ. สนามรุนแรก ๆ ซึ่งมีโครงสรางเปน AND-OR

planes• Programmable Logic Array (PLA)

– โปรแกรมไดทั้ง AND plane และ OR plane– ปจจบุนัไมมีขาย แตอาจจะเปนโครงสรางภายใน CPLD or ASIC

• Programmable Array Logic (PAL) Devices และ Generic Array Logic (GAL) Devices

– Fixed OR plane โปรแกรมไดเฉพาะ AND plane– อาจมี Flip-flops ที่เอาทพทุ

• Programmable Read-Only Memory (PROM)– Fixed AND plane โปรแกรมไดเฉพาะ OR plane

Page 13: Digital System Design Overview Ene434[07][v1]_01

November 16, 2007 ENE 433 Digital System Design and Implementation 25

การแทนระบบ (System Representation)• การออกแบบเริ่มจากโจทยแลวนําไปสูขอกาํหนด (Specification)• เมื่อเริ่มออกแบบเราตองมีวิธีที่จะเขียนอธิบายระบบ เรียกวา การแทนระบบ (System Representation)

• มีหลายวิธีในการแทนระบบขึน้อยูกบั มุมมอง (View) และระดับของความคิดรวบยอด (Level of Abstraction)

• มุมมองในการมองระบบดิจิตอลมี 3 มุม– Behavioral View – มุมมองในแงพฤติกรรมของระบบ– Structural View – มุมมองในแงโครงสราง– Physical View – มุมมองทางดานกายภาพ

November 16, 2007 ENE 433 Digital System Design and Implementation 26

การแทนระบบ (System Representation): Behavioral View• อธบิายฟงกชัน (ซึ่งก็คือพฤติกรรม) ของระบบ• มองระบบเปนเพียงกลองดํา (Black Box) โดย

– ไมสนใจสิ่งที่จะสรางอยูขางใน– สนใจเฉพาะความสัมพันธระหวางสัญญาณเอาทพุทกับอินพุท โดยนิยามคา

เอาทพุทเมื่ออนิพุทมีคาตาง ๆ• มีหลายวิธีทีจ่ะอธิบายความสัมพันธระหวางอินพุทกบัเอาทพทุ

– ตารางความจริง– State Diagram– Flow charts– High-level of languages or subset of them such as C/C++, SystemC

Page 14: Digital System Design Overview Ene434[07][v1]_01

November 16, 2007 ENE 433 Digital System Design and Implementation 27

การแทนระบบ (System Representation): Structural View• อธิบายสิ่งที่จะสรางอยูภายใน (ซึ่งก็คือโครงสราง) ของระบบ• ประกอบดวย

– Components ตาง ๆ ทีจ่ะใชสราง– การเชื่อมตอของ components เหลานั้น

• ใชคําวา Net แทนเซ็ตของสายที่ตอมายังโหนดเดียวกัน• Netlist หมายถึงเซ็ตของ Nets • Netlists จึงอธิบายโครงสรางของระบบ

• โครงสรางของระบบขึ้นอยูกับระดับความคิดรวบยอด (Level of Abstraction)

November 16, 2007 ENE 433 Digital System Design and Implementation 28

การแทนระบบ (System Representation): Physical View• อธบิายคุณลักษณะทางกายภาพของระบบ (Physical characteristics of the

system)• เปนการนํา Structural View มาเพิ่มขอมูลลงไปวาแตละ components และ

แตละสายเชื่อมตอเหลานั้นจะสรางไดอยางไร– บอกขนาด (sizes) ของ components และเสนทางเชื่อมตอ (paths or wires)– บอกตําแหนง (locations) ของ components และเสนทางเชื่อมตอ (paths or

wires)• เปนมุมมองที่มีรายละเอียดมากที่สดุ• ตัวอยางของ Physical View ไดแก Layouts ของ PCB, Layouts ของ

ASIC

Page 15: Digital System Design Overview Ene434[07][v1]_01

November 16, 2007 ENE 433 Digital System Design and Implementation 29

ระดับความคดิรวบยอด (Level of Abstraction)• ระบบดิจิตอลในปจจุบันมีความซับซอนสูงมาก เปนไปไมไดที่จะมอง

รายละเอียดของระบบในครั้งเดียว• ความคิดรวบยอด (Abstraction): ตัดรายละเอียดบางอยางออกกอนเพื่อให

เขาใจประเด็นที่สนใจ• ระดับความคิดรวบยอด (Level of Abstraction) ตรงขามกบัระดับ

รายละเอียด• ระดับความคิดรวบยอด ในการออกแบบระบบดจิิตอล

– Transistor Level– Gate Level– Register Transfer (RT) Level– Process Level

November 16, 2007 ENE 433 Digital System Design and Implementation 30

ระดับความคดิรวบยอด (Level of Abstraction)• ใช building block พื้นฐานเปนตัวแบงระดับความคิดรวบยอดของระบบ

ดิจิตอล– Transistor Level – the basic build block = transistors, resistors,

– Gate Level – the basic building block = gates, flip-flops

– Register Transfer (RT) Level – basic building block = registers, mux, adder

– Process Level = basic building block = processors, memory, I/O interface

• มุมมองและระดับความคิดรวบยอดเปน 2 มิติที่เปนอิสระตอกันในการพิจารณาระบบดิจติอล

• วีธีหนึ่งในการรวม 2 มิติไวดวยกันคือใช Y-chart

Page 16: Digital System Design Overview Ene434[07][v1]_01

November 16, 2007 ENE 433 Digital System Design and Implementation 31

The Y Chart

พิจารณาแตละระดับในรูปของ

• Basic building block

• Signal representations

• Time representations

• Behavioral representations

• Physical representations

November 16, 2007 ENE 433 Digital System Design and Implementation 32

Transistor-Level Abstraction• Basic building blocks: transistors, resistors, capacitors• Behavioral representation:

– เซ็ตของ differential equations– Voltage-current diagram– ใช Simulation Tools เชน PSPICE หาความสัมพันธระหวางอินพุทเอาทพุท

• Signal and timing representation: สัญญาณอนาล็อก• Physical representation:

– Detail layout ที่พรอมจะนําไป fab– วัดตนทุนในรูป พื้นที่ (area) หรือ ขนาด (size)

Page 17: Digital System Design Overview Ene434[07][v1]_01

November 16, 2007 ENE 433 Digital System Design and Implementation 33

Gate-Level Abstraction• Basic building blocks:

– Logic Gates ไดแก AND, NAND, OR, NOR, NOT, BUFFER, XOR, XNOR– Multiplexers (MUXs)– Memory devices ไดแก Flip-flop, Latches

• Behavioral representation: – เซ็ตของสมการบูรลีน (Boolean equations)

• Signal representation: สัญญาณดิจิตอล (มี 2 ระดบั และเปน discrete)• Timing Representation: Propagation delays, setup time, hold time• Physical representation:

– ตําแหนงการวางเกทและสายเชื่อมตอ– วัดตนทุนในรูปของจํานวนเกท (gate counts)

November 16, 2007 ENE 433 Digital System Design and Implementation 34

Signal and Timing Representation: Transistor Level to Gate Level

Transistor level

Gate level

Page 18: Digital System Design Overview Ene434[07][v1]_01

November 16, 2007 ENE 433 Digital System Design and Implementation 35

Register-Transfer-Level (RTL or RT-level) Abstraction• Basic building blocks: Modules ที่ประกอบขึ้นจากเกทหลายตัวเพื่อทําหนาที่

อยางใดอยางหนึ่ง– โมดูลสําหรับทําหนาที่ทางคณิตศาสตร เชน Adders, Comparators– โมดูลสําหรับเก็บขอมูล (Storage modules) เชน หนวยความจํา และรีจีสเตอร– โมดูลสําหรับเลือกเสนทางเดินของขอมูล (Routing) เชน MUXs

• Behavioral representation: ใชวิธีการอธิบายทั่วไปสําหรับอธิบายฟงชันก การเลือกเสนทางของขอมลู และใชการอธิบาย Finite State Machine (FSM) ในการอธิบายการควบคุมการไหลและฟงกชันตาง ๆ

• Signal and timing representation: กลุมของสัญญาณดิจิตอลเขารหัสแทนสารสนเทศ เชนตัวเลข ตัวหนังสือ

November 16, 2007 ENE 433 Digital System Design and Implementation 36

Register-Transfer-Level (RTL or RT-level) Abstraction• Physical representation: Floor plan• Register Transfer มี 2 ความหมาย

– เริ่มตนใชหมายถึง ระเบียบวีธีการออกแบบ– ระดับความคิดรวบยอด

• เราใชความหมายหลังและใช RT Methodology แทนระบบวิธกีารออกแบบ (ความหมายแรก)

• สัญญาณนาฬิกามีความสําคัญมากใน RT-level abstraction– เปนสัญญาณควบคมุการเก็บขอมูลในโมดูลการจํา ทําใหเกิดการทํางานเปน

จังหวะเดียวกัน (Synchronous)– คาบของสัญญาณนาฬิกาตองยาวพอที่จะทําใหขอมลูที่เอาทพุทของโมดูลตาง ๆ

เสถียรกอน

Page 19: Digital System Design Overview Ene434[07][v1]_01

November 16, 2007 ENE 433 Digital System Design and Implementation 37

Processor Level Abstraction• Basic building blocks: Intellectual Properties (IP)

– Processors,– Memory Unit– Bus interfaces

• Behavioral representation: อัลกอริธึม หรือโปรแกรมที่อธิบายขั้นตอนการทํางานของระบบ

• Signal and timing representation: Data types แบบตาง ๆ• Physical representation: Floor plan

November 16, 2007 ENE 433 Digital System Design and Implementation 38

Development Tasks and EDA Tools• การพัฒนาฮารดแวรดิจิตอลประกอบดวยการใสรายละเอียด (refining)

แลว ตรวจสอบวาใชไดหรือไม (validating)• งานที่ตองทําสําหรับการพัฒนาฮารดแวร

– การสังเคราะห (Synthesis)– การออกแบบทางกายภาพ (Physical Design)– การตรวจสอบ (Verification)– การทดสอบ (Testing)

• กระบวนการออกแบบเริ่มจากโจทยที่จนถึงฮารดแวรจริง (chip, boards)• กระบวนการออกแบบจากระดบัของความคิดรวบยอดสูงลงไปยังระดับ

ความคิดรวบยอดต่ํา เรียกวา Top-down Design Methodology

Page 20: Digital System Design Overview Ene434[07][v1]_01

November 16, 2007 ENE 433 Digital System Design and Implementation 39

November 16, 2007 ENE 433 Digital System Design and Implementation 40

การสังเคราะห (Synthesis)• กระบวนการเพิ่มรายละเอียดใหกับระบบ และเปนการกาวจาก

ระดับความคิดรวบยอดสูงสูระดับที่ต่ําลง• การสังเคราะหในกระบวนการออกแบบดิจติอลจากบนลงลาง

– High-level synthesis: เปนการสังเคราะหจากอัลกอริธมึไปยัง RT-level ในรูปของ RT-level operators

– RT-level synthesis: เปนการแปลง RT-level behavioral description ไปเปน RT-level components และ interconnection (หรือ RT-level structural description)

• อาจมีการลดจํานวน components ใหใชเทาที่จําเปน

Page 21: Digital System Design Overview Ene434[07][v1]_01

November 16, 2007 ENE 433 Digital System Design and Implementation 41

การสังเคราะห (Synthesis)• การสังเคราะหในกระบวนการออกแบบดิจติอลจากบนลงลาง

– Gate-level synthesis: • เปนการแปลง RT-level description ไปเปน gate-level components• Components ที่ใชจะเปน generic components ซึ่งจะไมขึ้นกับ target

technology

– Technology mapping: เปนการนํา netlist ในระดับเกทไป map ลงเปน devices จริง เปนขั้นตอนสุดทายในการสังเคราะห

November 16, 2007 ENE 433 Digital System Design and Implementation 42

Physical Design• การออกแบบกายภาพ (Physics) ของระบบ มี 2 สวนที่สําคัญ

– เปนการเพิ่มรายละเอียดใหกบั structural view– เปนการวิเคราะหและปรับคุณสมบัติทางไฟฟาของวงจรที่ออกแบบทางกายภาพไปแลว

• งาน Physical Design ในระดับตาง ๆ– Floor plan ทาํในระดับ RT และ Processor Level – เปนการวางพื้นที่วาหนวยใหญ ๆ ของระบบจะอยูที่ใด

– Placement and Routing นํา component ไปวางลงในพื้นที่และการลากสายเชื่อมตอ

Page 22: Digital System Design Overview Ene434[07][v1]_01

November 16, 2007 ENE 433 Digital System Design and Implementation 43

Verification• เปนการตรวจสอบและตรวจเช็ควาระบบในระดับตาง ๆ ทํางานทําขอกาํหนดไดหรือไม

• มี 2 แงมมุ (aspects): Function และ Performance Verification

• ดู Performance ในรปูของ Timing constraints จึงเรียกวา Timing verification

November 16, 2007 ENE 433 Digital System Design and Implementation 44

Functional Verification• การออกแบบมักเริ่มจาก high-level behavioral description• สนใจวาระบบจะทาํงานไดตามขอกาํหนดไดหรือไม• การตรวจสอบเปนการเช็ควา เมื่อเรามีอินพุทตาง ๆ ภายใตเงื่อนไขที่จะใช

งานแลวเอาทพทุเปนไปตามที่เราตองการ (desired outputs) หรือไม• เมื่อตรวจสอบวาระบบทาํงานไดตามฟงกชันแลวเราจึงคอย ๆ เพิ่ม

รายละเอียด (Synthesis)• เราตองตรวจสอบฟงกชันของระบบในทกุ ๆ ระดบัหลงัการสังเคราะห วา

ยังทํางานไดเหมือนเดิมหรือไม– การเพิ่มรายละเอียด (การสังเคราะห) อาจมีผลทําใหฟงกชันการทํางานผิดไป

จากเดิมได

Page 23: Digital System Design Overview Ene434[07][v1]_01

November 16, 2007 ENE 433 Digital System Design and Implementation 45

Timing Verification• ตรวจสอบวาระบบมีสมรรถนะตามเปาหมายดานสมรรถนะ (Performance Goals)

ไดหรือไม– ความเร็วต่ําสุด ของสญัญาณนาฬกิา (minimal clock period) หรือ– Minimal propagation delay

• RT-level: – ใชการบวก delays ของทกุ modules ที่อยูใน path จากเอาทพุทของรีจสีเตอรหนึ่งไปยังอนิพุท

ของรจีสีเตอรหนึ่ง– เปนเพียง Delays โดยประมาณ

• Gate Level: – Delays ของเกท + Delays ของสายสัญญาณ (wires) ในแตละ path

• Timing verification ยากเพราะหาคาจริงไดหลังจาก Placement and Routing Process เทานั้น (ผลจากการสังเคราะหเปนเพียงการประมาณ)

November 16, 2007 ENE 433 Digital System Design and Implementation 46

Methods of Verification: การจําลองการทํางาน (Simulation)• ขั้นตอนใชการจําลองการทํางานในการตรวจสอบ

– สรางแบบจาํลอง (Model)– ปอนอนิพุทใหแบบจาํลองทํางาน– Monitor คาเอาทพทุและตรวจสอบวาถกูตองหรือไม

• แบบจําลองมีหลายรูป– Functional model– Structural model– Functional model ที่รวมเอาขอมูล propagation delay เขาไปดวย

Page 24: Digital System Design Overview Ene434[07][v1]_01

November 16, 2007 ENE 433 Digital System Design and Implementation 47

Methods of Verification: การจําลองการทํางาน (Simulation)ขอดี• การจําลองการทํางานทําใหเรา

สามารถตรวจสอบหาขอผิดพลาดของสิ่งที่ออกแบบโดยไมตองสรางระบบจริง

• สามารถใชการจําลองการทํางานในทกุระดับ

• บงบอกและหาขอผิดพลาดใหญ ๆ ได

ขอจํากดัของการจําลองการทาํงาน• ไมสามารถรับประกันไดวาจะไม

มี errors• ความซับซอนของการคํานวณ

– ใชเวลาโดยเฉพาะในระดับต่ําที่จํานวน components มีเปนมหาศาล

November 16, 2007 ENE 433 Digital System Design and Implementation 48

Methods of Verification: Timing Analysis• โฟกัสเฉพาะเรื่อง timing ของวงจรไมดูฟงกชัน

– วิเคราะหโครงสรางของวงจรเพื่อหา เสนทาง (path) ทกุเสนทางจากอินพุทไปยงัเอาทพุท

– ประมาณคา propagation delays ของแตละเสนทาง– หา timing parameters ที่เกีย่วของ

• Worst-case propagation delay -> critical paths• Maximum clock frequency

– การจําลองสามารถบอก timing ของแตละ input pattern ได แตมันอาจจะไมทําใหเกดิ critical paths

Page 25: Digital System Design Overview Ene434[07][v1]_01

November 16, 2007 ENE 433 Digital System Design and Implementation 49

Methods of Verification: Formal Verification• ใช formal mathematical techniques ในการตรวจสอบวาระบบ

ทํางานไดถูกตอง• วิธีที่นิยมคือ Equivalence Checking

– เปรียบเทียบผลจากระบบที่แทนในสองรูปแบบ (Two representations)

– ใชในการสังเคราะห โดยเปรียบเทียบ representation จากการสังเคราะหกับ representation ทเีปนอนิพุทของการสังเคราะห

– ใช mathematical reasoning ในการตรวจสอบ ไมไดใชการจําลอง

November 16, 2007 ENE 433 Digital System Design and Implementation 50

Methods of Verification: Hardware Emulation• สรางฮารดแวรเพื่อเลียนแบบการทํางานของสิ่งที่ออกแบบ

– นําระบบทีอ่อกแบบไปลงใน FPGA เพื่อเลียนแบบวงจรที่จะไปสรางบน ASIC

– แม FPGA จะชากวา ASIC แตกเ็ร็วกวาการใชการจําลองมาก

Page 26: Digital System Design Overview Ene434[07][v1]_01

November 16, 2007 ENE 433 Digital System Design and Implementation 51

การทดสอบ (Testing)• ในการออกแบบระบบดจิิตอล Testing แตกตางจาก Verification• Verification: กระบวนการตรวจสอบวาระบบทาํงานไดตามขอกาํหนด• Testing: กระบวนการตรวจหา deflects

– รูแลววาระบบทํางานตามฟงกชัน แตตองการทดสอบใหมั่นใจวาสิ่งที่สรางมายังทํางานได

– มีอินพทุมีจํานวนมาก ตองหา test patterns ที่เหมาะสม -> test pattern generator– การออกแบบเพื่อการทดสอบ (Design for Test)

• Scan chains, built-in-self-test circuit (BIS

November 16, 2007 ENE 433 Digital System Design and Implementation 52

EDA Software และ ขอจํากัด• ในอดุมคติ

– นักออกแบบใหใชเวลาเฉพาะการคิดและอธิบายพฤติกรรมของระบบในระดบัสูง

– Electronic Design Automation (EDA) ชวยทาํงานสังเคราะหและตรวจสอบในระดับที่ต่ําลงมาจนนําไปสรางไดโดยอัตโนมัติ

• ในทางปฏิบัติ– ซอฟทแวรการสังเคราะหทําไดเพียงการแปลงจากระดบัสูงไปสูระดับต่ําโดยพยายามหาผลการแปลงที่ตนทุน (cost) ต่ําสุด

– ไมสามารถเปลี่ยนสิ่งที่ออกแบบมาจากไมดีเปนด ีหรือ จากดีเปนไมดี

Page 27: Digital System Design Overview Ene434[07][v1]_01

November 16, 2007 ENE 433 Digital System Design and Implementation 53

Flow of a Medium-Sized Design Targeting FPGA• Medium-sized Design

– ไมตองทําการแยกเปนสวน (no partition)– ไมจําเปนตองมี IP cores ที่ออกแบบไวกอนแลว– เปนวงจรที่มีเกทรวมไมเกิน 50,000 เกท– ซอฟทแวรสังเคราะหสามารถสังเคราะหวงจรขนาดนี้ไดอยางมีประสิทธิภาพ

– ตัวอยางวงจรใชงานจริงในระดบันี้ เชน processor อยางงาย และ bus interfaces

November 16, 2007 ENE 433 Digital System Design and Implementation 54

Testbench1

RTL Description1

simulation

Synthesis Netlist

3

2

Delayfile

simulation

4

Placement&Routing

5Configuration

file

Delayfile

Simulation/Timing analysis

6

Deviceprogramming

7

FPGA chip

8

Synthesis

Verification

Physical Design

Flow of a Medium-Sized Design Targeting FPGA

Page 28: Digital System Design Overview Ene434[07][v1]_01

November 16, 2007 ENE 433 Digital System Design and Implementation 55

Flow of a Medium-Sized Design Targeting FPGA1. พัฒนา design file และ testbench2. ใช design file เปนตัวอธิบายระบบ แลวทําการจําลองการทํางานเพื่อตรวจสอบ

ฟงกชันโดยใช testbench เปนตัวปอนอนิพุทและรับเอาทพุท3. สังเคราะหจะได netlist และ delay file4. ใช netlist จากการสังเคราะหเปนตัวอธิบายระบบ แลวทําการจําลองการทํางาน

และ timing analysis 5. Placement&Routing6. ผูก (annotate) timing information เขากับ netlist แลวทําการจําลองการทํางาน

และ timing analysis7. สราง configuration file และโปรแกรมลง devices8. ตรวจสอบการทํางานของระบบ

November 16, 2007 ENE 433 Digital System Design and Implementation 56

Flow of a Large-Sized Design Targeting FPGA1. System partitioning ในแตละสวนที่แยกออกมา อาจจะมทีั้งที่

เปน IP cores ที่ออกแบบแลวและสวนที่ออกแบบใหม2. ทําการพัฒนาสวนที่ออกแบบใหมตาม Flow ของ medium-

size design targeting FPGA3. ทํา Verification รวมกันในระดับเกท อาจตองใช formal

verification techniques หรือ cycle-based simulation เพราะจํานวน components สูง