Giáo trình Xây dựng các hệ thống nhúng

Nhìn lại những năm 70 thế kỹ trước, xử lý thông tin thường phải sử dụng các máy tính lớn hay

máy tính mini (ví dụ dòng máy mini PDP 11 của hãng DEC một hệ thống thống trị trong truyền

thông). Cho tới những năm 80, khi vi xử lý và máy tính cá nhân (PC để bàn và xách tay) ra đời,

máy tính trở thành công cụ đắc dụng cho xử lý thông tin bởi khả năng tính toán nhanh, gọn nhẹ

và di động linh hoạt. Giai đoạn tiếp theo là khả năng chế tạo vi mạch kích thước vài trăm micro

mét và nano mét của những năm chín mươi, đã thúc đẩy xu hướng nhỏ hóa (miniaturization) và

đa dạng các dòng vi xử lý, phát triển mạnh mẽ. Các bộ vi xử lý đa năng và sự xuất hiện các vi xử

lý chuyên biệt (ASIC- application-specific integrated circuit) được chế tạo với số lượng lớn chưa

từng thấy. Việc sử dụng các bộ vi xử lý chuyên biệt để tạo ra các thiết bị chuyên xử lý một hay

một vài bài toán kĩ thuật, tạo ra một nghành công nghệ mới, gọi là công nghệ nhúng. Sản phẩm

của công nghệ nhúng này là các hệ thống nhúng.

Vậy hệ thống nhúng (HTN- Embedded system) là gì ?

Có nhiều định nghĩa về HTN, nhưng nếu ta lấy tiêu chí mô tả HTN làm cái gì và sử dụng nó như

thế nào, thì có thể nói về HTN như sau:

Hệ thống nhúng là một thuật ngữ để chỉ một hệ thống có khả năng hoạt động tự trị được

nhúng vào trong một môi trường hay một hệ thống khác qui mô phức tạp hơn. Đó là các hệ thống

tích hợp cả phần cứng (là một hệ thống máy tính được xây dựng trên cơ sở sử dụng vi xử lý -

microprocessor-based system) và phần phềm nhúng trong phần cứng đó, để thực hiện các bài

toán chuyên biệt.

Hay theo định nghĩa của tổ chức IEEE thì hệ thống nhúng là một hệ tính toán (máy tính

số) nằm trong (hay được nhúng vào) sản phẩm khác lớn hơn và rằng thông thường ẩn đối với

người sử dụng. Nói rộng ra, và đơn giản hơn, khi một hệ tính toán (có thể là PC, IPC, PLC, vi xử

lý, vi hệ thống (microcontroller), DSP v.v.) được nhúng vào trong một sản phẩm hay một hệ

thống nào đó và thực hiện một số chức năng cụ thể của hệ thống đó, thì ta gọi hệ tính toán đó là

một hệ thống nhúng. Tuy nhiên thật không dễ gì định nghĩa cho thật đúng về HTN, định nghĩa

trên rất ít nói tới công nghệ và cũng rất đơn giản. Hiện nay chưa có định nghĩa nào thật thỏa đáng

về HTN, ví dụ nếu lấy chức năng xử lý thông tin, thì HTN là một phần xử lý thông tin nhúng

trong các hệ thống lớn hơn và phức tạp hơn, hay cũng có thể là một hệ thống độc lập vận hành tự

động. Ví dụ gần gũi ta có: máy tính cá nhân, hay máy chủ, là một hệ thống phức tạp được xây

dựng từ các thành phần hoạt động độc lập nhưng được đồng bộ với nhau. Vĩ điều khiển đồ họa,

có vi điều khiển rất mạnh xử lý đồ họa, vĩ điều khiển trên đĩa cứng có vi điều khiển chuyên dụng

để xử lý tín hiệu, ghi/đọc dữ liệu từ đĩa từ tính theo yêu cầu của hệ điều hành, vĩ mạng cũng là

một vi điều khiển tinh vi xử lý tín hiệu Đó là các hệ thống con được nhúng trong hệ thống máy

tính nói chung. Mặc dù vậy ta cũng sẽ nêu ra đây một số điểm chung về HTN.

pdf 292 trang yennguyen 2820
Bạn đang xem 20 trang mẫu của tài liệu "Giáo trình Xây dựng các hệ thống nhúng", để tải tài liệu gốc về máy hãy click vào nút Download ở trên

Tóm tắt nội dung tài liệu: Giáo trình Xây dựng các hệ thống nhúng

Giáo trình Xây dựng các hệ thống nhúng
Xây dựng các Hệ thống nhúng 
1 
HỌC VIỆN CÔNG NGHỆ BƯU CHÍNH VIỄN THÔNG 
Khoa Công nghệ thông Tin 
Bộ môn Khoa học máy Tính 
XÂY DỰNG CÁC 
HỆ THỐNG NHÚNG 
Hà Nội, tháng 11 năm 2013 
(bản sửa và bổ sung) 
P
T
I
T
Xây dựng các Hệ thống nhúng 
2 
Lời nói đầu 
 Dạy và học hệ thống nhúng là đề cập tới một chủ đề có phạm vi rộng bao gồm thiết kế, 
môi trường ứng dụng, loại hình công nghệ, qui tắc cần thiết để tiếp cận một cách có hệ thống. 
Lĩnh vực thiết kế và ứng dụng các hệ thống nhúng bao gồm : các hệ thống vi điều khiển (micro-
controller) nhỏ và đơn giản, các hệ thống điều khiển, hệ thống nhúng phân tán, hệ thống trên 
chip, mạng máy tính (có dây và không dây), các hệ thống PC nhúng, các hệ thống ràng buộc thời 
gian, robotic, các thiết bị ngoài của máy tính, xử lý tín hiệu, hệ thống lệnh và điều khiển Nền 
tảng công nghệ hiện đại là kỹ thuật vi điện tử với mật độ tích hợp lớn và rất lớn. Khi muốn thiết 
kế hệ thống nhúng, có nhiều yếu tố cần tuân thủ giống như khi thiết kế máy tính, nhưng lại bị 
ràng buộc bởi đặc thù ứng dụng. Thêm vào đó là sự đan chéo của các kỹ năng rất cần thiết cho 
thiết kế hệ thống nhúng, độc lập vận hành, thiết kế với tiêu chí tiêu hao năng lượng thấp, công 
nghệ phần cứng, công nghệ phần mềm (hệ thống và ứng dụng), hệ thời gian thực, tương tác 
người máy và đôi khi cả vấn đề an ninh hệ thống. Như vậy đào tạo và học hệ thống nhúng cần 
một khối lượng kiến thức tập hợp ít nhất từ các bộ môn khác như khoa học máy tính (computer 
science), khoa học truyền thông (communication), kỹ thuật thiết kế điện tử: các mạch tương tự và 
số, sử dụng tốt các phần mềm thiết kế bo mạch (như Protel, Proteus, DXP), kiến thức về chế 
tạo bán dẫn. Vì là bộ môn công nghệ có tính ứng dụng cao với bài toán cụ thể, nên lại cần có 
chuyên môn của ngành nghề, mà ở đó hệ thống nhúng sẽ ứng dụng. Tóm lại đây là một chủ đề 
hợp nhất và việc thực hiện chủ đề này thực không dễ dàng. 
 Với lượng thời gian nhất định, môn học XÂY DỰNG CÁC HỆ THỐNG NHÚNG sẽ 
mang lại cho người học những vấn đề cơ bản nhất về hệ thống nhúng ở Chương 1. Chương 2 đề 
cập tới kiến trúc phần cứng hệ thống, cách thiết kế một số khối chức năng cơ sở có tính thực tế 
cao. Chương 3 chủ yếu giới thiệu về phần mềm cài đặt trên hệ thống nhúng, bao gồm các trình 
điều khiển thiết bị, các phần mềm trung gian, và phần mềm hệ thống được cài đặt . Đặc biệt nhắc 
lại một số yêu cầu về khái niệm của các hệ thống thời gian thực và hệ điều hành thời gian thực. 
Chương 4 giới thiệu các tiêu chí và phương pháp thiết kế hệ thông nhúng. Cuối chương là một số 
các bài tập lớn kiểu Dự án thiết kế, có thể lựa chọn cho thực hành với các kiểu kiến trúc hệ thống 
nhúng khác nhau. 
 Như đã nêu, đây là chủ đề rộng, mang tính kỹ thuật và kiến thức lại được tổng hợp từ các 
môn khác, nên tài liệu này chắc không thể thật sự đầy đủ. Các phần kiến thức nào không được đề 
cập sâu ở đây, người học cần tham khảo thêm các tài liệu khác, hay từ các môn học liên quan. 
 Tác giả xin chân thành cám ơn các cán bộ, giảng viên Khoa Công nghệ thông tin và bộ 
môn Khoa học máy tính, Học viện Công nghệ BCVT Hà Nội đã góp ý để tác giả hoàn thành giáo 
trình. Tác giả cũng xin đón nhận các ý kiến đóng góp, phê bình từ người đọc, người học, sao cho 
tài liệu này có ích hơn. Địa chỉ theo e-mail: htcuoc@ioit.ac.vn. 
P
T
I
T
Xây dựng các Hệ thống nhúng 
3 
 Hà Nội, tháng 10 năm 2013 
 Huỳnh Thúc Cước, 
 Viện Công nghệ thông tin, VAST, 18, Hoàng Quốc Việt, Hà Nội. 
P
T
I
T
Xây dựng các Hệ thống nhúng 
4 
Lời nói đầu ..................................................................................................................................................... 2 
Một số chữ viết tắt .......................................................................................................................................... 7 
Danh sách các hình vẽ .................................................................................................................................... 9 
Chương 1. GIỚI THIỆU CHUNG VỀ CÁC HỆ THỐNG NHÚNG ........................................................... 15 
1.1 KHÁI NIỆM VỀ HỆ THỐNG NHÚNG (HTN) ................................................................. 15 
1.2 ĐẶC ĐIỂM CỦA HTN ....................................................................................................... 15 
1.3 CÁC YÊU CẦU VỚI HTN ............................................................................................... 18 
1.4 MÔ HÌNH TỔNG THỂ HTN .............................................................................................. 19 
1.4.1 Mô hình cấu trúc phần cứng của máy tính ........................................................................... 19 
1.4.2 Kiến trúc của CPU ............................................................................................................... 23 
1.4.3 Mô hình tổng quát của một HTN ......................................................................................... 25 
1.4 PHÂN LOẠI HTN ............................................................................................................... 27 
1.5 KẾT CHƯƠNG ................................................................................................................... 32 
1.6 CÂU HỎI CUỐI CHƯƠNG ................................................................................................ 33 
Chương 2. CÁC THÀNH PHẦN PHẦN CỨNG CỦA HỆ THỐNG NHÚNG .......................................... 34 
2.1 BỘ XỬ LÍ TRUNG TÂM (Central Processing Unit-CPU)................................................. 34 
2.2.1 Các loại CPU và nguyên lí hoạt động .................................................................................. 34 
2.2.2 Ví dụ về một CPU và nguyên lí hoạt động .......................................................................... 35 
2.2 CPU 8085 VÀ HỆ THỐNG BUS ........................................................................................ 44 
2.2.1 Khái niệm và bản chất vật lý của các BUS .......................................................................... 45 
2.2.2 Khuyếch đại BUS (bus driver)............................................................................................. 47 
2.2.3 Bus đồng bộ (Synchronous bus): ......................................................................................... 48 
2.2.4 Bus không đồng bộ (Asynchronous bus) ............................................................................. 50 
2.2.5 Trọng tài BUS (bus arbitration) .......................................................................................... 51 
2.2.6 Bus mở rộng (Expansion bus) EISA, MCA, Bus cục bộ, PCI ............................................. 54 
2.2.7 Bus SPI (Serial Peripheral Interface ) .................................................................................. 55 
2.2.8 Bus I
2
C (Inter-Integrated Circuit) ....................................................................................... 56 
2.2.9 Thực hiện kĩ thuật của BUS ................................................................................................. 62 
2.3 BO MẠCH một HTN VỚI CẤU HÌNH TỐI THIỂU ......................................................... 66 
2.4 HTN VỚI CÁC CPU KHÁC NHAU .................................................................................. 69 
2.4.1 CPU đa năng 16 bit .............................................................................................................. 69 
2.4.2 Bo mạch với CPU HARVARD (microcontroller Unit-MCU) họ Intel 8051/8052/8xC25173 
P
T
I
T
Xây dựng các Hệ thống nhúng 
5 
2.4.3 Vi mạch Hệ thống khả trình trong một Chip (Programmable System on chip-PsoC) và 
Máy tính thông minh khả trình (Programmable Intelligent Computer-PIC) ...................... 84 
2.5 BỘ NHỚ VÀ THIẾT KẾ BỘ NHỚ .................................................................................... 98 
2.5.1 Một số thông số chính của mạch nhớ .................................................................................. 99 
2.5.2 Phân loại bộ nhớ ................................................................................................................ 101 
2.5.3 Phân cấp bộ nhớ ................................................................................................................. 108 
2.5.4 Tổ chức bộ nhớ vật lý và thiết kế bộ nhớ .......................................................................... 110 
2.6 GHÉP NỐI VỚI THIẾT BỊ NGOẠI VI ............................................................................ 121 
2.6.1 Tổng quan .......................................................................................................................... 121 
2.6.2 Ghép nối CPU chủ động .................................................................................................... 125 
2.6.3 Ghép nối I/O chủ động ...................................................................................................... 130 
2.6.4 Cổng vào/ra ........................................................................................................................ 144 
2.6.5 Ghép nối với tín hiệu tương tự (analog signal) .................................................................. 150 
2.6.6 Biến đổi tương tự thành số (số hóa) ................................................................................... 152 
2.6.7 Biến đổi số thành tương tự (DAC)..................................................................................... 153 
2.7 KẾT CHƯƠNG ................................................................................................................................ 153 
2.8 CÂU HỎI VÀ BÀI TẬP ................................................................................................................. 153 
2.8.1 Câu hỏi cuối chương .......................................................................................................... 153 
2.8.2 Bài tập cuối chương ........................................................................................................... 154 
Chương 3. CÁC THÀNH PHẦN PHẦN MỀM CỦA HỆ THỐNG NHÚNG .......................................... 156 
3.1 TRÌNH ĐIỀU KHIỂN THIẾT BỊ ( viết tắt: TĐKTB) ....................................................... 156 
3.1.1 Tổng quan .......................................................................................................................... 156 
3.1.2 Các loại TĐKTB ................................................................................................................ 160 
3.1.3 3.1.3 Hoạt động của TĐKTB ............................................................................................. 161 
3.1.4 Phát triển TĐKTB .............................................................................................................. 161 
3.1.5 Một số ví dụ về TĐKTB .................................................................................................... 163 
3.2 HỆ THỐNG NHÚNG THỜI GIAN THỰC ...................................................................... 165 
3.2.1 Hệ điều hành đa nhiệm (multitasking) ............................................................................... 165 
3.2.2 Hệ thống thời gian thực ..................................................................................................... 184 
3.2.3 Hệ điều hành thời gian thực (RTOS) ................................................................................. 189 
3.2.4 Hệ thời gian thực không có hệ điều hành thời gian thực ................................................... 195 
3.3 PHẦN MỀM TRUNG GIAN (middleware) ...................................................................... 198 
3.4 PHẦN MỀM ỨNG DỤNG ............................................................................................... 200 
P
T
I
T
Xây dựng các Hệ thống nhúng 
6 
3.5 KẾT CHƯƠNG ................................................................................................................. 201 
3.6 CÂU HỎI CUỐI CHƯƠNG .............................................................................................. 201 
Chương 4 THIẾT KẾ VÀ CÀI ĐẶT CÁC HỆ THỐNG NHÚNG .................................................... 203 
4.1 THIẾT KẾ HỆ THỐNG .................................................................................................... 203 
4.1.1 Các nền tảng cơ bản khi xây dựng kiến trúc HTN ............................................................. 207 
4.1.2 Phân hoạch thiết kế phần cứng, phần mềm........................................................................ 211 
4.1.3 Xây dựng bo mạch khi phát triển hệ thống ........................................................................ 217 
4.2 CÀI ĐẶT VÀ THỬ NGHIỆM HTN ................................................................................. 221 
4.2.1 Chọn CPU cho thiết kế ...................................................................................................... 221 
4.2.2 Bộ nhớ cho HTN................................................................................................................ 223 
4.2.3 Ghép nối với thiết bị .......................................................................................................... 225 
4.2.4 Phát triển phần mềm cho HTN .......................................................................................... 225 
4.2.5 Gở rối và mô phỏng ........................................................................................................... 235 
4.2.6 Phát triển HTN ................................................................................................................... 240 
4.2.7 Ví dụ phát triển HTN ......................................................................................................... 266 
4.3 KẾT CHƯƠNG ................................................................................................................. 267 
4.4 CÂU HỎI CUỐI CHƯƠNG .............................................................................................. 267 
TÀI LIỆU THAM KHẢO ...................................................................................................................... 267 
PHỤ LỤC Các ví dụ .............................................................................................................................. 270 
P
T
I
T
Xây dựng các Hệ thống nhúng 
7 
Một số chữ viết tắt 
CPU Central Processing Unit Đơn vị xử lý trung tâm 
ROM Read Only Memory Bộ nhớ chi đọc 
EPROM Erasable programmable read-only 
memory 
Bộ nhớ chỉ đọc, xóa và lập trình lại được 
RAM Random Access Memory bộ nhớ truy cập ngẫu nhiên 
FLASH 
non-volatile computer storage 
(memory cards, USB flash drives, 
solid-state drives -SSD) 
Bộ nhớ bán dẫn không bị mất nội dung ngay cả khi 
không cung cấp nguồn nuôi 
OS Operating System Hệ điều hành 
RTOS Real Time Operating System Hệ điều hành thời gian thực 
ES Embedded System Hệ thống nhúng 
HTN Embedded System Hệ thống nhúng 
OS hay HĐH Operating System Hệ Điều Hành ... oes fit. 
Dividing by 50 gets back to the correct scale factor of 244. 
So the scale 122/50 works for all input values. 
This is an example of avoiding the use of floating point variables which take up too much 
resources. You can still make the system work but you have to be careful when using fixed 
types and you have to check all input values and outputs to make sure they fit. 
Averaging 
Averaging would be better done in the PC as it has more resources - the same goes for 
calculating and displaying the temperature in Fahrenheit but this gives a demonstration of what 
you can do. 
Note: The RAM is used up since a bug in MikroC 5.0.0.3 puts strings int RAM - in future 
versions this will be corrected. 
Typical output from the temperature recorder 
P
T
I
T
Xây dựng các Hệ thống nhúng 
284 
 96 RAW 234 C 741 F 
The left most value is the RAW ADC value, the next is the temperature sensor output in degrees 
centigrade and the next is the temperature sensor output in degrees Fahrenheit. 
Note: You have to put in the decimal point so the above readings are: 
234 C 23.4°C 
741 F 74.1°F 
Bài đọc thêm: 
E380: Design of Embedded Systems 
Exercises 
Krzysztof Kuchcinski 
Department of Computer Science 
Lund Institute of Technology 
The questions and exercise included in this material represent typical questions which can be asked to the 
contents of the lectures given through the course Design of Embedded Systems (E380). The structure of 
chapters follows directly the structure of the lectures. 
Most of the questions are typical for the course and can be asked during the examinations, however, it is 
not the intention to supply the examination questions. The purpose is to give the guidance for students for 
preparation to examinations. 
Introduction 
1. Give a short definition of embedded systems and discuss main features of such systems. Illustrate 
your discussion with examples of embedded systems. 
2. Discuss differences and similarities between embedded systems and general purpose 
workstations, desktop computers and portable computers. 
3. What are basic characteristics of embedded systems? Discuss both inherent features of such 
systems as well as specific design process challenges. 
4. Discuss and give a motivation why implementation of embedded systems using a single processor 
running a software implementation is not usually possible. What are advantages and 
disadvantages of such a solution? 
5. Explain the term ``design space exploration''. What does it mean for embedded system design? 
What are typical design parameters which are included in a design space. 
P
T
I
T
Xây dựng các Hệ thống nhúng 
285 
6. Design process is often controlled by the time-to-market requirement. Explain this requirement 
and possible consequences on the design methodology. 
Design Methodology 
1. Input to a system design is usually defined as system specifications and a set of functional and 
non-functional requirements. Discuss system specification methods as well as different types of 
requirements. 
2. What are basic features of good requirements? Discuss them briefly. 
3. Discuss how design requirements can be created. 
4. What is design flow? Give an example of design flow paradigm used for embedded system 
design. 
5. Discuss different design flow approaches. Compare them and point out similarities and 
differences between them. 
6. Explain the ideas behind the following design flow models: 
o waterfall model, 
o spiral model, 
o stepwise refinement model, 
o top-down model, 
o bottom-up model. 
7. Hardware/Software co-design methodology becomes popular for embedded systems. Discuss 
basic ideas behind this methodology and compare it to a traditional design methodologies. 
8. What are basic design steps in hardware/software co-design? Why this methodology can improve 
design process and design quality? 
9. Discuss a typical design methodology for embedded systems. Where different design activities, 
such as design specification, design partitioning, component allocation, and communication 
synthesis are performed? 
10. What are main design activities in communication synthesis? 
11. What are IP-components. Discuss briefly hard and soft IP-components and their role in a design 
process. 
12. Discuss different design verification methods and their advantages and disadvantages. 
13. Design automation tools are used in many design methodologies to help designer in solving 
tedious design activities. Discuss theoretical limitations of design automation tools. 
14. Many design automation problems belong to the class of NP-complete or NP-hard problems. 
Discuss briefly how this inherent complexity problem is solved in design automation tools. What 
kind of algorithm are used? 
Specification Languages 
1. Discuss briefly what languages can be used for specification and implementation of embedded 
systems. What are their related advantages and disadvantages. 
2. VHDL is a hardware description language which is often used to specify, simulate and synthesis 
hardware for embedded systems. Discuss basic VHDL constructs. 
3. Hardware is inherently parallel and this need to be modeled in specification and design 
languages. How VHDL supports parallelism for hardware specification. 
P
T
I
T
Xây dựng các Hệ thống nhúng 
286 
4. VHDL simulator is implemented as an event-driven simulator. Describe briefly the main idea of 
event-driven simulation. How time is handled in this simulation paradigm. 
5. Discuss how different modeling styles, such as structural, behavioral, and data-flow can be mixed 
in a single VHDL model. 
6. Present briefly VHDL simulation mechanism. Point out when VHDL code is executed and when 
time and signals are updated? 
7. What is a signal driver in VHDL simulator. How is it used during simulation? How signals are 
updated by the simulator? 
8. What is delta delay in VHDL? How is it used during simulation? 
9. Give the values assigned to signals and variables by the part of the process code included below. 
10. P1: process 
11. variable a, b : integer; 
12. begin 
13. : 
14. -- initial values of s1 = 0, s2 = 0, a = 0, b = 0 
15. s1 <= 10; 
16. a := s1; 
17. b := 3; 
18. s2 <= b + s1; 
19. -- give values of s1, s2, a, b here (1) 
20. wait for 10 ns; 
21. -- give values of s1, s2, a, b here (2) 
22. : 
23. end process; 
24. VHDL is used both for hardware simulation and synthesis. Discuss briefly the language features 
which create problems for synthesis. What are possible solutions to this problem. 
25. Discuss briefly commonly accepted restrictions for VHDL used for high-level synthesis. 
Data-flow computational models 
1. Discuss basic characteristics of data-flow and control-flow models. What are main application 
areas for both models of computation. 
2. A filter is represented by a data-flow graph depicted in Figure 1. Additions have their usual 
meaning and multiplications are always by a constant. Using this data-flow graph determine filter 
equations, i.e., a function which defines y(n). 
P
T
I
T
Xây dựng các Hệ thống nhúng 
287 
Figure 1: An example of data-flow graph 
3. The theory of data-flow models is based on Khan process networks. In this theory it is proved that 
a network process is monotonous if X X F(X F(X'). What does this property means in 
practice? Which computations can be implemented using data-flow models? 
4. Describe informally what are execution rules for data-flow network built of actors. Explain a 
notion of actors, tokens and firing rules. 
5. What is a sufficient condition for a data-flow network to be deterministic. 
6. Discuss briefly subclasses of data-flow networks called synchronous data-flow and boolean data-
flow. Give examples of actors for these networks and their firing rules. 
7. What is a firing rule for a data-flow network? Give examples of firing rule. 
8. What does it mean that a set of firing rules for an actor of data-flow network is sequential? Give 
an algorithm for checking this property. 
Control-flow computational models 
1. Explain the main idea of StateCharts. How they handle concurrency and hierarchy? 
2. Explain the main idea of AND and OR states in StateChart model. Why a notion of AND and OR 
states is defined? 
3. Describe a general idea of Petri nets? How they can be used to model parallel activities. 
4. Draw simple Petri nets which model sequential execution, parallel execution and non-
deterministic choice. 
5. How firing of a transition in a Petri net is defined? What does it mean that a transition is enabled 
and it may fire? 
6. Define the following properties of Petri nets: 
o reachability, 
o liveness, 
o boundness, 
o safeness, 
o conservation. 
Try to relate this formal properties to practical properties of embedded system, i.e., system 
properties which can be analyzed using Petri nets notions. 
7. Explain the reachability tree for Petri nets. What kind of problems can be analyzed using this 
technique? What is a reason for limitation of this method? 
P
T
I
T
Xây dựng các Hệ thống nhúng 
288 
8. Describe Petri nets analysis method based on matrix equations. What are limitations of this 
method? Why the method has these limitations? 
Partitioning 
1. What is embedded system partitioning? What is decided during partitioning? 
2. What is difference between structural and functional partitioning? Which one is more suitable for 
system partitioning? 
3. What does it mean partitioning granularity? Give examples of possible granularity. 
4. How are defined objective or closeness functions for partitioning? Give examples. 
5. How design constraints, such as number of pins in a package or maximal permitted are, are 
handled during partitioning? Give two alternatives. 
6. Describe an algorithm for hierarchical partitioning. 
7. What is a basic method for transformation based (iterative) partitioning? What is a main problem 
with this approach? 
8. Describe briefly Kernighan-Lin algorithm for bi-partitioning. 
9. What is a basic approach to neighborhood search based partitioning. Give an example. 
10. Describe briefly simulated annealing partitioning approach. 
11. What is hardware/software partitioning? What is a goal of this partitioning? 
12. Assume that the weighted graph depicted in Figure 2 represents tasks and their 
intercommunications. The weight of a node represents a size of the task while the weight of an 
edge represents the communication ``cost''. Using hierarchical clustering and appropriate 
closeness function find a partitioning which minimizes communication cost. 
Figure 2: An example system represented as a graph. 
Scheduling 
1. Discuss static and dynamic scheduling approaches. Point out their application areas as well as 
advantages and disadvantages. 
2. Explain difference between time-constrained and resource-constrained scheduling methods. 
P
T
I
T
Xây dựng các Hệ thống nhúng 
289 
3. Explain the following scheduling approaches ASAP, ALAP and list scheduling. What is an 
advantage of list scheduling? 
4. Explain forced-directed scheduling. 
5. Explain a role of chaining and pipelining during scheduling. 
6. What does it mean resource sharing and conditional resource sharing during scheduling? 
7. What is speculative execution during scheduling? 
8. How static scheduling influences register allocation? 
9. How static scheduling influences power consumption? 
10. Make static scheduling of a filter depicted in Figure 1. Assume that a delay defines new 
input/output pair. 
11. Discuss briefly different real-time scheduling policies. Divide them into off-line and on-line. 
Furthermore, discuss different priority assignment strategies. 
12. Explain Rate Monotonic Scheduling (RMS). What is a limitation of this method. 
13. What is priority inversion problem for Rate Monotonic Scheduling (RMS)? What are methods for 
solving this problem? 
14. Describe briefly priority ceiling protocol for solving priority inversion problem. 
15. Describe briefly Earliest Deadline First (EDF) dynamic priority scheduling. 
16. Use the RMS schedulability analysis to check if each of the following task sets is schedulable 
with RMS. If not, identify which tasks will miss their deadlines. 
Task set 1 
Task Period Worst execution time 
1 5 1 
2 3 2 
3 8 4 
Task set 2 
Task Period Worst execution time 
1 2 1 
2 3 1 
Task set 3 
Task Period Worst execution time 
P
T
I
T
Xây dựng các Hệ thống nhúng 
290 
1 5 1 
2 7 2 
3 9 4 
Table 1: Three task sets 
Interface Synthesis 
1. Describe briefly basic steps in communication synthesis. 
2. What are main objectives of channel binding, communication refinement, interface generation? 
3. Describe briefly strobe and handshake protocols for processor communication with other devices. 
4. Why interrupts are used for processor communication with external devices? 
5. What is a role of an interrupt service routine? 
6. Describe briefly functionality of a typical interrupt service routine. 
7. What is DMA controller and what is its role in communication between different devices? 
8. Describe briefly functionality of a DMA controller. 
9. Why there is a need for bus arbitration? What are bus arbitration methods? 
10. Present briefly daisy-chain arbitration method for a bus. 
11. The handshaking protocol discussed on the course is represented in Figure 3. Formalize this 
specifications using, for example, Petri nets and prove that the master after sending a request will 
get data. Extend the example with two slaves and ensure that the protocol is fair, i.e., non of two 
slaves will wait for the possibility to send data forever. How can you include timing analysis in 
the model? 
P
T
I
T
Xây dựng các Hệ thống nhúng 
291 
Figure 3: An example handshaking protocol. 
Low Power Design 
1. What are main sources of power consumption in CMOS technology? How power consumption 
can be minimized? 
2. What is a relation between power consumption and energy consumption? Explain importance of 
power and energy consumption for embedded systems? 
3. What are basic ways of reducing power consumption? 
Testability 
1. Explain the concept of production faults and their models. 
2. Explain stuck-at fault model. 
3. Describe briefly test generation method based on fault sensitization and fault propagation. 
4. What are reconvergent fan-out points? Why do they create problems for test generation? 
5. Discuss basic testability improvement methods. 
6. What is the main goal of all testability improvement methods? 
7. Discuss briefly main idea of SCAN path testability improvement method. 
8. Discuss briefly main idea of BIST testability improvement method. 
P
T
I
T
Xây dựng các Hệ thống nhúng 
292 
9. Explain briefly testability improvement by circuit partitioning and enhancement with specific 
testability improvement methods. 
%%% 
Hà nội 19 tháng 12 năm 2013. 
Kỉ niệm chiến thắng cuộc tập kích 12 ngày đêm vào Hà Nội 1972 của không lực Hoa Kì. 
P
T
I
T

File đính kèm:

  • pdfgiao_trinh_xay_dung_cac_he_thong_nhung.pdf