Preface |
|
xxv | |
Acknowledgments |
|
xxxi | |
|
1 Overview of Embedded System |
|
|
1 | (10) |
|
|
1 | (2) |
|
1.1.1 Definition of an embedded system |
|
|
1 | (1) |
|
|
2 | (1) |
|
1.2 System design requirements |
|
|
3 | (1) |
|
1.3 Embedded SoPC systems |
|
|
4 | (4) |
|
1.3.1 Basic development flow |
|
|
5 | (3) |
|
|
8 | (1) |
|
|
8 | (3) |
|
PART I BASIC DIGITAL CIRCUITS DEVELOPMENT |
|
|
|
2 Gate-level Combinational Circuit |
|
|
11 | (10) |
|
|
11 | (1) |
|
|
12 | (4) |
|
2.2.1 Basic lexical rules |
|
|
13 | (1) |
|
2.2.2 Library and package |
|
|
13 | (1) |
|
|
13 | (1) |
|
2.2.4 Data type and operators |
|
|
13 | (1) |
|
|
14 | (1) |
|
2.2.6 Code of a 2-bit comparator |
|
|
15 | (1) |
|
2.3 Structural description |
|
|
16 | (2) |
|
|
18 | (1) |
|
|
19 | (1) |
|
2.6 Suggested experiments |
|
|
20 | (1) |
|
2.6.1 Code for gate-level greater-than circuit |
|
|
20 | (1) |
|
2.6.2 Code for gate-level binary decoder |
|
|
20 | (1) |
|
3 Overview of FPGA and EDA Software |
|
|
21 | (28) |
|
|
21 | (5) |
|
3.1.1 Overview of a general FPGA device |
|
|
21 | (2) |
|
3.1.2 Overview of the Altera Cyclone II devices |
|
|
23 | (3) |
|
3.2 Overview of the Altera DE1 and DE2 boards |
|
|
26 | (1) |
|
|
26 | (3) |
|
3.4 Overview of Quartus II |
|
|
29 | (2) |
|
3.5 Short tutorial of Quartus II |
|
|
31 | (11) |
|
3.5.1 Create the design project |
|
|
32 | (5) |
|
3.5.2 Create a testbench and perform the RTL simulation |
|
|
37 | (1) |
|
3.5.3 Compile the project |
|
|
37 | (2) |
|
3.5.4 Perform timing analysis |
|
|
39 | (1) |
|
3.5.5 Program the FPGA device |
|
|
39 | (3) |
|
3.6 Short tutorial on the ModelSim HDL simulator |
|
|
42 | (5) |
|
|
47 | (1) |
|
3.8 Suggested experiments |
|
|
47 | (2) |
|
3.8.1 Gate-level greater-than circuit |
|
|
47 | (1) |
|
3.8.2 Gate-level binary decoder |
|
|
47 | (2) |
|
4 RT-level Combinational Circuit |
|
|
49 | (34) |
|
|
49 | (6) |
|
4.1.1 Relational operators |
|
|
51 | (1) |
|
4.1.2 Arithmetic operators |
|
|
51 | (1) |
|
4.1.3 Other synthesis-related VHDL constructs |
|
|
52 | (2) |
|
|
54 | (1) |
|
4.2 Routing circuit with concurrent assignment statements |
|
|
55 | (5) |
|
4.2.1 Conditional signal assignment statement |
|
|
55 | (3) |
|
4.2.2 Selected signal assignment statement |
|
|
58 | (2) |
|
4.3 Modeling with a process |
|
|
60 | (1) |
|
|
60 | (1) |
|
4.3.2 Sequential signal assignment statement |
|
|
60 | (1) |
|
4.4 Routing circuit with if and case statements |
|
|
61 | (6) |
|
|
61 | (2) |
|
|
63 | (1) |
|
4.4.3 Comparison to concurrent statements |
|
|
64 | (2) |
|
|
66 | (1) |
|
4.5 Constants and generics |
|
|
67 | (2) |
|
|
67 | (1) |
|
|
68 | (1) |
|
|
69 | (11) |
|
4.6.1 Hexadecimal digit to seven-segment LED decoder |
|
|
69 | (3) |
|
4.6.2 Sign-magnitude adder |
|
|
72 | (2) |
|
|
74 | (1) |
|
4.6.4 Simplified floating-point adder |
|
|
75 | (5) |
|
|
80 | (1) |
|
4.8 Suggested experiments |
|
|
80 | (3) |
|
4.8.1 Multi-function barrel shifter |
|
|
80 | (1) |
|
4.8.2 Dual-priority encoder |
|
|
81 | (1) |
|
|
81 | (1) |
|
4.8.4 Floating-point greater-than circuit |
|
|
81 | (1) |
|
4.8.5 Floating-point and signed integer conversion circuit |
|
|
81 | (1) |
|
4.8.6 Enhanced floating-point adder |
|
|
82 | (1) |
|
5 Regular Sequential Circuit |
|
|
83 | (44) |
|
|
83 | (2) |
|
|
84 | (1) |
|
|
84 | (1) |
|
|
85 | (1) |
|
5.2 HDL code of the basic storage elements |
|
|
85 | (8) |
|
|
86 | (3) |
|
|
89 | (1) |
|
|
89 | (4) |
|
|
93 | (1) |
|
5.3 Simple design examples |
|
|
93 | (5) |
|
|
94 | (1) |
|
5.3.2 Binary counter and variant |
|
|
95 | (3) |
|
5.4 Testbench for sequential circuits |
|
|
98 | (3) |
|
|
101 | (3) |
|
|
101 | (2) |
|
5.5.2 Timing considerations in Quartus II |
|
|
103 | (1) |
|
|
104 | (9) |
|
|
104 | (4) |
|
|
108 | (5) |
|
5.7 Cyclone II device embedded memory module |
|
|
113 | (9) |
|
5.7.1 Overview of memory options of DE1 board |
|
|
113 | (1) |
|
5.7.2 Overview of embedded M4K module |
|
|
114 | (1) |
|
5.7.3 Methods to incorporate embedded memory module |
|
|
114 | (2) |
|
5.7.4 HDL module to infer synchronous single-port RAM |
|
|
116 | (1) |
|
5.7.5 HDL module to infer synchronous simple dual-port RAM |
|
|
117 | (2) |
|
5.7.6 HDL module to infer synchronous true dual-port RAM |
|
|
119 | (1) |
|
5.7.7 HDL module to infer synchronous ROM |
|
|
120 | (1) |
|
5.7.8 FIFO buffer revisited |
|
|
121 | (1) |
|
|
122 | (1) |
|
5.9 Suggested experiments |
|
|
122 | (5) |
|
5.9.1 Programmable square wave generator |
|
|
122 | (1) |
|
5.9.2 Pulse width modulation circuit |
|
|
122 | (1) |
|
5.9.3 Rotating square circuit |
|
|
123 | (1) |
|
|
123 | (1) |
|
5.9.5 Rotating LED banner circuit |
|
|
123 | (1) |
|
|
123 | (1) |
|
5.9.7 FIFO with data width conversion |
|
|
124 | (1) |
|
|
124 | (1) |
|
5.9.9 ROM-based sign-magnitude adder |
|
|
124 | (1) |
|
5.9.10 ROM-based temperature conversion |
|
|
124 | (3) |
|
|
127 | (20) |
|
|
127 | (4) |
|
6.1.1 Mealy and Moore outputs |
|
|
128 | (1) |
|
|
128 | (3) |
|
|
131 | (3) |
|
|
134 | (10) |
|
6.3.1 Rising-edge detector |
|
|
134 | (4) |
|
|
138 | (4) |
|
|
142 | (2) |
|
|
144 | (1) |
|
6.5 Suggested experiments |
|
|
144 | (3) |
|
|
144 | (1) |
|
6.5.2 Alternative debouncing circuit |
|
|
144 | (1) |
|
6.5.3 Parking lot occupancy counter |
|
|
144 | (3) |
|
|
147 | (34) |
|
|
147 | (6) |
|
7.1.1 Single RT operation |
|
|
148 | (1) |
|
|
148 | (2) |
|
7.1.3 Decision box with a register |
|
|
150 | (3) |
|
7.2 Code development of an FSMD |
|
|
153 | (6) |
|
7.2.1 Debouncing circuit based on RT methodology |
|
|
153 | (1) |
|
7.2.2 Code with explicit data path components |
|
|
153 | (3) |
|
7.2.3 Code with implicit data path components |
|
|
156 | (1) |
|
|
157 | (2) |
|
|
159 | (15) |
|
7.3.1 Fibonacci number circuit |
|
|
159 | (3) |
|
|
162 | (3) |
|
7.3.3 Binary-to-BCD conversion circuit |
|
|
165 | (3) |
|
|
168 | (3) |
|
7.3.5 Accurate low-frequency counter |
|
|
171 | (3) |
|
|
174 | (1) |
|
7.5 Suggested experiments |
|
|
174 | (7) |
|
7.5.1 Alternative debouncing circuit |
|
|
174 | (1) |
|
7.5.2 BCD-to-binary conversion circuit |
|
|
175 | (1) |
|
7.5.3 Fibonacci circuit with BCD I/O: design approach 1 |
|
|
175 | (1) |
|
7.5.4 Fibonacci circuit with BCD I/O: design approach 2 |
|
|
175 | (1) |
|
7.5.5 Auto-scaled low-frequency counter |
|
|
176 | (1) |
|
|
176 | (1) |
|
7.5.7 Babbage difference engine emulation circuit |
|
|
177 | (4) |
|
PART II BASIC NIOS II SOFTWARE DEVELOPMENT |
|
|
|
8 Nios II Processor Overview |
|
|
181 | (8) |
|
|
181 | (2) |
|
8.2 Register file and ALU |
|
|
183 | (1) |
|
|
183 | (1) |
|
|
184 | (1) |
|
8.3 Memory and I/O organization |
|
|
184 | (3) |
|
8.3.1 Nios II memory interface |
|
|
184 | (1) |
|
8.3.2 Overview of memory hierarchy |
|
|
184 | (1) |
|
|
184 | (1) |
|
|
185 | (1) |
|
|
186 | (1) |
|
8.3.6 Tightly coupled memory |
|
|
186 | (1) |
|
|
186 | (1) |
|
8.3.8 Interconnect structure |
|
|
187 | (1) |
|
8.4 Exception and interrupt handler |
|
|
187 | (1) |
|
|
187 | (1) |
|
|
187 | (1) |
|
|
188 | (1) |
|
8.7.1 Comparison of Nios II and MIPS |
|
|
188 | (1) |
|
9 Nios II System Derivation and Low-Level Access |
|
|
189 | (28) |
|
9.1 Development flow revisited |
|
|
189 | (3) |
|
9.1.1 Hardware development |
|
|
189 | (2) |
|
9.1.2 Software development |
|
|
191 | (1) |
|
9.1.3 Flashing-LED system |
|
|
191 | (1) |
|
9.2 Nios II hardware generation tutorial |
|
|
192 | (8) |
|
9.2.1 Create a hardware project in Quartus II |
|
|
192 | (1) |
|
9.2.2 Create a Nios II system and generate HDL codes |
|
|
192 | (6) |
|
9.2.3 Create a top-level HDL file that instantiates the Nios II system |
|
|
198 | (1) |
|
9.2.4 Compiling and programming |
|
|
199 | (1) |
|
9.3 Nios II SBT GUI tutorial |
|
|
200 | (4) |
|
|
200 | (1) |
|
9.3.2 Configure the BSP using BSP Editor |
|
|
200 | (2) |
|
9.3.3 Create user application directory and add application files |
|
|
202 | (1) |
|
9.3.4 Build and run software |
|
|
203 | (1) |
|
|
204 | (1) |
|
9.4 System id core for hardware-software consistency |
|
|
204 | (2) |
|
9.5 Direct low-level I/O access |
|
|
206 | (2) |
|
9.5.1 Review of C pointer |
|
|
206 | (1) |
|
9.5.2 C pointer for I/O register |
|
|
207 | (1) |
|
9.6 Robust low-level I/O access |
|
|
208 | (2) |
|
|
208 | (1) |
|
|
209 | (1) |
|
|
209 | (1) |
|
9.7 Some C techniques for low-level I/O operations |
|
|
210 | (1) |
|
|
210 | (1) |
|
9.7.2 Packing and unpacking |
|
|
210 | (1) |
|
|
211 | (2) |
|
9.8.1 Basic embedded program architecture |
|
|
211 | (1) |
|
9.8.2 Main program and task routines |
|
|
212 | (1) |
|
|
213 | (1) |
|
9.10 Suggested experiments |
|
|
213 | (2) |
|
9.10.1 Chasing LED circuit |
|
|
213 | (1) |
|
9.10.2 Collision LED circuit |
|
|
214 | (1) |
|
9.10.3 Pulse width modulation circuit |
|
|
214 | (1) |
|
9.10.4 Rotating square circuit |
|
|
214 | (1) |
|
|
214 | (1) |
|
9.11 Complete program listing |
|
|
215 | (2) |
|
10 Predesigned Nios II I/O Peripherals |
|
|
217 | (38) |
|
|
217 | (1) |
|
|
218 | (4) |
|
|
218 | (3) |
|
|
221 | (1) |
|
|
222 | (1) |
|
|
222 | (2) |
|
|
222 | (1) |
|
|
223 | (1) |
|
|
224 | (2) |
|
|
224 | (1) |
|
|
225 | (1) |
|
10.5 Enhanced flashing-LED Nios II system |
|
|
226 | (6) |
|
|
226 | (4) |
|
10.5.2 Top-level HDL file |
|
|
230 | (2) |
|
10.6 Software development of enhanced flashing-LED system |
|
|
232 | (2) |
|
10.6.1 Introduction to device driver |
|
|
232 | (1) |
|
10.6.2 Program structure of the enhanced flashing-LED system |
|
|
233 | (1) |
|
|
233 | (1) |
|
10.6.4 Function naming convention |
|
|
234 | (1) |
|
10.7 Device driver routines |
|
|
234 | (5) |
|
10.7.1 Driver for PIO peripherals |
|
|
234 | (3) |
|
|
237 | (1) |
|
|
238 | (1) |
|
|
239 | (3) |
|
10.8.1 The flashsys_init_v1() function |
|
|
239 | (1) |
|
10.8.2 The sw_get_command.v1() function |
|
|
239 | (1) |
|
10.8.3 The jtaguart_disp_msg_v1() function |
|
|
240 | (1) |
|
10.8.4 The sseg_disp_msg_v1() function |
|
|
240 | (1) |
|
10.8.5 The led_flash_v1() function |
|
|
241 | (1) |
|
10.9 Software construction and testing |
|
|
242 | (1) |
|
10.10 Bibliographic notes |
|
|
242 | (1) |
|
10.11 Suggested experiments |
|
|
242 | (4) |
|
10.11.1 "Uptime" feature in flashing-LED system |
|
|
242 | (1) |
|
10.11.2 Counting with different timer mode |
|
|
243 | (1) |
|
|
243 | (1) |
|
10.11.4 Enhanced collision LED circuit |
|
|
243 | (1) |
|
10.11.5 Rotating LED banner circuit |
|
|
244 | (1) |
|
10.11.6 Enhanced stopwatch |
|
|
244 | (1) |
|
10.11.7 Parking lot occupancy counter |
|
|
244 | (1) |
|
10.11.8 Reaction timer with pushbutton switch control |
|
|
244 | (1) |
|
10.11.9 Reaction timer with keyboard control |
|
|
244 | (1) |
|
10.11.10 Communication with serial port |
|
|
244 | (2) |
|
10.12 Complete program listing |
|
|
246 | (9) |
|
11 Predesigned Nios II I/O Drivers and HAL API |
|
|
255 | (22) |
|
|
255 | (6) |
|
11.1.1 Desktop-like and barebone embedded systems |
|
|
256 | (1) |
|
|
257 | (1) |
|
|
258 | (1) |
|
11.1.4 HAL-compliant device drivers |
|
|
259 | (1) |
|
|
259 | (1) |
|
11.1.6 HAL-based initialization sequence |
|
|
260 | (1) |
|
|
261 | (4) |
|
|
261 | (1) |
|
11.2.2 BSP file structure |
|
|
261 | (1) |
|
|
261 | (4) |
|
11.3 HAL-based flashing-LED program |
|
|
265 | (5) |
|
11.3.1 Functions using generic I/O devices |
|
|
265 | (2) |
|
11.3.2 Functions using non-generic I/O devices |
|
|
267 | (1) |
|
11.3.3 Initialization routine and main program |
|
|
268 | (1) |
|
11.3.4 Software construction and testing |
|
|
269 | (1) |
|
11.4 Device driver consideration |
|
|
270 | (3) |
|
11.4.1 I/O access methods |
|
|
270 | (1) |
|
|
271 | (1) |
|
11.4.3 Device drivers in this book |
|
|
272 | (1) |
|
|
273 | (1) |
|
11.6 Suggested experiments |
|
|
273 | (2) |
|
11.6.1 "Uptime" feature in flashing-LED system |
|
|
273 | (1) |
|
11.6.2 Enhanced collision LED circuit |
|
|
274 | (1) |
|
11.6.3 Parking lot occupancy counter |
|
|
274 | (1) |
|
11.6.4 Reaction timer with keyboard control |
|
|
274 | (1) |
|
11.6.5 Digital alarm clock |
|
|
274 | (1) |
|
11.7 Complete program listing |
|
|
275 | (2) |
|
|
277 | (20) |
|
12.1 Interrupt processing in the HAL framework |
|
|
277 | (3) |
|
|
278 | (1) |
|
12.1.2 Interrupt controller of the Nios II processor |
|
|
278 | (1) |
|
12.1.3 Top-level exception handler |
|
|
279 | (1) |
|
12.1.4 Interrupt service routines |
|
|
280 | (1) |
|
12.2 Interrupt-based flashing-LED program |
|
|
280 | (5) |
|
12.2.1 Interrupt of timer core |
|
|
281 | (1) |
|
12.2.2 Driver of timer core |
|
|
281 | (1) |
|
|
282 | (2) |
|
|
284 | (1) |
|
12.3 Interrupt and scheduling |
|
|
285 | (3) |
|
|
285 | (2) |
|
|
287 | (1) |
|
|
288 | (1) |
|
12.5 Suggested experiments |
|
|
288 | (2) |
|
12.5.1 Flashing-LED system with pushbutton switch ISR |
|
|
288 | (1) |
|
12.5.2 ISR-driven flashing-LED system |
|
|
288 | (1) |
|
12.5.3 "Uptime" feature in flashing-LED system |
|
|
289 | (1) |
|
12.5.4 Reaction timer with keyboard control |
|
|
289 | (1) |
|
12.5.5 Digital alarm clock |
|
|
289 | (1) |
|
12.6 Complete program listing |
|
|
290 | (7) |
|
PART III CUSTOM I/O PERIPHERAL DEVELOPMENT |
|
|
|
13 Custom I/O Peripheral with PIO Cores |
|
|
297 | (8) |
|
|
297 | (1) |
|
13.2 Integration of division circuit to a Nios II system |
|
|
298 | (1) |
|
|
298 | (1) |
|
|
299 | (1) |
|
|
299 | (3) |
|
13.4 Suggested experiments |
|
|
302 | (3) |
|
|
302 | (1) |
|
13.4.2 Division core with eight-bit data |
|
|
302 | (1) |
|
13.4.3 Division core with 64-bit data |
|
|
303 | (1) |
|
13.4.4 Fibonacci number circuit |
|
|
303 | (1) |
|
|
303 | (2) |
|
14 Avalon Interconnect and SOPC Component |
|
|
305 | (36) |
|
|
305 | (4) |
|
|
309 | (4) |
|
14.2.1 Avalon MM slave interface signals |
|
|
309 | (1) |
|
14.2.2 Avalon MM slave interface properties |
|
|
310 | (1) |
|
14.2.3 Avalon MM slave timing |
|
|
310 | (3) |
|
14.3 System interconnect fabric for Avalon interface |
|
|
313 | (2) |
|
14.4 SOPC I/O component wrapping circuit |
|
|
315 | (7) |
|
14.4.1 Interface I/O buffer |
|
|
315 | (3) |
|
|
318 | (1) |
|
14.4.3 Output decoding from an Avalon MM master |
|
|
318 | (2) |
|
14.4.4 Input multiplexing to an Avalon MM master |
|
|
320 | (1) |
|
14.4.5 Practical consideration |
|
|
321 | (1) |
|
14.5 SOPC component construction tutorial |
|
|
322 | (12) |
|
|
322 | (1) |
|
|
323 | (1) |
|
14.5.3 Wrapped division circuit |
|
|
324 | (2) |
|
14.5.4 SOPC component creation |
|
|
326 | (7) |
|
14.5.5 SOPC component instantiation |
|
|
333 | (1) |
|
|
334 | (4) |
|
|
338 | (1) |
|
14.8 Suggested experiments |
|
|
338 | (3) |
|
|
338 | (1) |
|
14.8.2 Alternative buffering scheme for the division core |
|
|
338 | (1) |
|
14.8.3 Division core with eight-bit data |
|
|
338 | (1) |
|
14.8.4 Division core with 64-bit data |
|
|
338 | (1) |
|
14.8.5 Fibonacci number circuit |
|
|
338 | (1) |
|
|
339 | (2) |
|
15 SRAM and SDRAM Controllers |
|
|
341 | (38) |
|
15.1 Memory resources of DE1 board |
|
|
341 | (1) |
|
15.2 Brief overview of timing and clock management |
|
|
342 | (3) |
|
15.2.1 Clock distribution network |
|
|
342 | (1) |
|
15.2.2 Timing consideration of off-chip access |
|
|
343 | (1) |
|
|
344 | (1) |
|
|
345 | (5) |
|
|
345 | (1) |
|
15.3.2 Basic organization |
|
|
346 | (1) |
|
|
347 | (2) |
|
15.3.4 IS61LV25616AL SRAM device |
|
|
349 | (1) |
|
15.4 SRAM controller IP core |
|
|
350 | (4) |
|
|
350 | (2) |
|
15.4.2 Controller circuit |
|
|
352 | (1) |
|
15.4.3 SOPC component creation |
|
|
353 | (1) |
|
|
354 | (5) |
|
|
354 | (2) |
|
15.5.2 Basic DRAM organization |
|
|
356 | (1) |
|
|
357 | (2) |
|
|
359 | (4) |
|
15.6.1 Basic SDRAM organization |
|
|
359 | (1) |
|
|
359 | (3) |
|
15.6.3 ICSI IS42S16400 SDRAM device |
|
|
362 | (1) |
|
15.7 SDRAM controller and PLL |
|
|
363 | (4) |
|
15.7.1 Basic SDRAM controller |
|
|
363 | (1) |
|
15.7.2 SDRAM controller IP core |
|
|
364 | (1) |
|
|
365 | (2) |
|
|
367 | (8) |
|
15.8.1 Testing hardware configuration |
|
|
367 | (5) |
|
|
372 | (3) |
|
|
375 | (1) |
|
15.10 Suggested experiments |
|
|
375 | (2) |
|
15.10.1 SRAM controller without I/O register |
|
|
375 | (1) |
|
15.10.2 SRAM controller speed test |
|
|
375 | (1) |
|
15.10.3 SRAM controller with Avalon MM tristate interface |
|
|
376 | (1) |
|
15.10.4 SDRAM controller clock skew test |
|
|
376 | (1) |
|
15.10.5 Memory performance comparison |
|
|
376 | (1) |
|
15.10.6 Effect of cache memory |
|
|
376 | (1) |
|
15.10.7 SDRAM controller from scratch |
|
|
376 | (1) |
|
15.11 Complete program listing |
|
|
377 | (2) |
|
16 PS2 Keyboard and Mouse |
|
|
379 | (52) |
|
|
379 | (1) |
|
16.2 PS2 receiving subsystem |
|
|
380 | (4) |
|
16.2.1 PS2-device-to-host communication protocol |
|
|
380 | (1) |
|
|
381 | (3) |
|
16.3 PS2 transmitting subsystem |
|
|
384 | (5) |
|
16.3.1 Host-to-PS2-device communication protocol |
|
|
384 | (1) |
|
|
385 | (4) |
|
|
389 | (2) |
|
16.5 PS2 controller IP core development |
|
|
391 | (3) |
|
|
391 | (1) |
|
|
391 | (1) |
|
16.5.3 Wrapped PS2 system |
|
|
392 | (1) |
|
16.5.4 SOPC component creation |
|
|
393 | (1) |
|
|
394 | (2) |
|
|
394 | (1) |
|
|
394 | (1) |
|
|
394 | (2) |
|
|
396 | (5) |
|
16.7.1 Overview of the scan code |
|
|
396 | (1) |
|
16.7.2 Interaction with host |
|
|
397 | (1) |
|
|
397 | (4) |
|
|
401 | (4) |
|
16.8.1 Overview of PS2 mouse protocol |
|
|
401 | (1) |
|
16.8.2 Interaction with host |
|
|
402 | (1) |
|
|
403 | (2) |
|
|
405 | (2) |
|
16.10 Use of book's custom IP cores |
|
|
407 | (8) |
|
|
407 | (1) |
|
16.10.2 Comprehensive Nios II testing system |
|
|
408 | (7) |
|
16.11 Bibliographic notes |
|
|
415 | (1) |
|
16.12 Suggested experiments |
|
|
415 | (2) |
|
16.12.1 PS2 receiving subsystem with watchdog timer |
|
|
415 | (1) |
|
16.12.2 Software receiving FIFO |
|
|
415 | (1) |
|
16.12.3 Software PS2 controller |
|
|
415 | (1) |
|
16.12.4 Keyboard-controlled LED flashing circuit |
|
|
416 | (1) |
|
16.12.5 Enhanced keyboard driver routine I |
|
|
416 | (1) |
|
16.12.6 Enhanced keyboard driver routine II |
|
|
416 | (1) |
|
16.12.7 Remote-mode mouse driver |
|
|
416 | (1) |
|
16.12.8 Scroll-wheel mouse driver |
|
|
416 | (1) |
|
16.13 Complete program listing |
|
|
417 | (14) |
|
|
431 | (80) |
|
|
431 | (4) |
|
17.1.1 Basic operation of a CRT |
|
|
431 | (2) |
|
17.1.2 VGA port of the DE1 board |
|
|
433 | (1) |
|
|
434 | (1) |
|
|
435 | (6) |
|
17.2.1 Horizontal synchronization |
|
|
436 | (1) |
|
17.2.2 Vertical synchronization |
|
|
437 | (1) |
|
17.2.3 Timing calculation of VGA synchronization signals |
|
|
438 | (1) |
|
17.2.4 HDL implementation |
|
|
438 | (3) |
|
17.3 SRAM-based video RAM controller |
|
|
441 | (9) |
|
17.3.1 Overview of video memory |
|
|
441 | (1) |
|
17.3.2 Memory consideration of DE1 board |
|
|
442 | (1) |
|
17.3.3 Ad hoc SRAM controller |
|
|
442 | (4) |
|
|
446 | (4) |
|
|
450 | (1) |
|
17.5 Video controller IP core development |
|
|
451 | (3) |
|
17.5.1 Complete video controller |
|
|
451 | (1) |
|
|
451 | (1) |
|
|
451 | (1) |
|
17.5.4 Wrapped video controller |
|
|
452 | (2) |
|
17.5.5 SOPC component creation |
|
|
454 | (1) |
|
|
454 | (9) |
|
17.6.1 Video memory access routines |
|
|
454 | (2) |
|
17.6.2 Geometrical model routine |
|
|
456 | (1) |
|
17.6.3 Bitmap processing routines |
|
|
457 | (3) |
|
17.6.4 Bit-mapped text routines |
|
|
460 | (3) |
|
17.7 Mouse processing routines |
|
|
463 | (1) |
|
|
464 | (7) |
|
17.8.1 Chart plotting routine |
|
|
465 | (2) |
|
17.8.2 General plotting functions |
|
|
467 | (2) |
|
17.8.3 Strip swapping routine |
|
|
469 | (1) |
|
17.8.4 Mouse demonstration routine |
|
|
469 | (1) |
|
17.8.5 Bit-mapped text routine |
|
|
470 | (1) |
|
17.9 Bitmap file processing |
|
|
471 | (8) |
|
17.9.1 BMP format overview |
|
|
471 | (1) |
|
17.9.2 Generation of BMP file |
|
|
472 | (1) |
|
17.9.3 Sprite-based design |
|
|
472 | (1) |
|
|
473 | (1) |
|
17.9.5 Host-based file system |
|
|
474 | (2) |
|
17.9.6 Bitmap file retrieval routines |
|
|
476 | (3) |
|
17.10 Bibliographic notes |
|
|
479 | (1) |
|
17.11 Suggested experiments |
|
|
480 | (2) |
|
17.11.1 PLL-based VGA controller |
|
|
480 | (1) |
|
17.11.2 VGA controller with 16-bit memory configuration |
|
|
480 | (1) |
|
17.11.3 VGA controller with 3-bit color depth |
|
|
480 | (1) |
|
17.11.4 VGA controller with 1-bit color depth |
|
|
480 | (1) |
|
17.11.5 VGA controller with double buffering |
|
|
480 | (1) |
|
17.11.6 VGA controller with 320-by-240 resolution |
|
|
480 | (1) |
|
17.11.7 VGA controller with vertical mode operation |
|
|
481 | (1) |
|
17.11.8 Geometrical model functions |
|
|
481 | (1) |
|
17.11.9 Bitmap manipulation functions |
|
|
481 | (1) |
|
17.11.10 Simulated "Etch A Sketch" toy |
|
|
481 | (1) |
|
17.11.11 Palette lookup table circuit |
|
|
481 | (1) |
|
17.11.12 Virtual LED flashing system panel |
|
|
481 | (1) |
|
17.11.13 Virtual analog wall clock |
|
|
482 | (1) |
|
|
482 | (2) |
|
17.12.1 Configurable VGA controller |
|
|
482 | (1) |
|
17.12.2 VGA controller using system SDRAM |
|
|
482 | (1) |
|
|
482 | (1) |
|
|
483 | (1) |
|
17.13 Complete program listing |
|
|
484 | (27) |
|
18 Audio Codec Controller |
|
|
511 | (46) |
|
|
511 | (5) |
|
|
511 | (1) |
|
18.1.2 Overview of WM8731 device |
|
|
512 | (1) |
|
18.1.3 Registers of WM8731 device |
|
|
513 | (3) |
|
|
516 | (8) |
|
18.2.1 Overview of I2C interface |
|
|
516 | (2) |
|
18.2.2 HDL implementation |
|
|
518 | (6) |
|
18.3 Codec data access controller |
|
|
524 | (3) |
|
18.3.1 Overview of digital audio interface |
|
|
524 | (1) |
|
18.3.2 HDL implementation |
|
|
525 | (2) |
|
18.4 Audio codec controller IP core development |
|
|
527 | (6) |
|
18.4.1 Complete audio codec controller |
|
|
527 | (2) |
|
|
529 | (1) |
|
|
530 | (1) |
|
18.4.4 Wrapped audio codec controller |
|
|
531 | (2) |
|
18.4.5 SOPC component creation |
|
|
533 | (1) |
|
|
533 | (3) |
|
18.5.1 I2C command routines |
|
|
533 | (1) |
|
18.5.2 Data source select routine |
|
|
534 | (1) |
|
18.5.3 Device initialization routine |
|
|
534 | (1) |
|
18.5.4 Audio data access routines |
|
|
535 | (1) |
|
|
536 | (3) |
|
18.7 Audio file processing |
|
|
539 | (4) |
|
18.7.1 WAV format overview |
|
|
539 | (1) |
|
18.7.2 Audio format conversion program |
|
|
540 | (1) |
|
18.7.3 Audio data retrieval routine |
|
|
541 | (2) |
|
|
543 | (1) |
|
18.9 Suggested experiments |
|
|
543 | (2) |
|
18.9.1 Software I2C controller |
|
|
543 | (1) |
|
18.9.2 Hardware data access controller using master clocking mode |
|
|
543 | (1) |
|
18.9.3 Software data access controller using slave clocking mode |
|
|
543 | (1) |
|
18.9.4 Software data access controller using master clocking mode |
|
|
543 | (1) |
|
18.9.5 Configurable data access controller |
|
|
544 | (1) |
|
|
544 | (1) |
|
18.9.7 Real-time sinusoidal wave generator |
|
|
544 | (1) |
|
18.9.8 Real-time audio wave display |
|
|
544 | (1) |
|
|
544 | (1) |
|
|
545 | (1) |
|
18.10.1 Full-fledged I2C controller |
|
|
545 | (1) |
|
18.10.2 Digital equalizer |
|
|
545 | (1) |
|
18.10.3 Digital audio oscilloscope |
|
|
545 | (1) |
|
18.11 Complete program listing |
|
|
546 | (11) |
|
|
557 | (62) |
|
|
557 | (1) |
|
|
558 | (4) |
|
19.2.1 Overview of SPI interface |
|
|
558 | (1) |
|
19.2.2 HDL implementation |
|
|
559 | (3) |
|
19.3 SPI controller IP core development |
|
|
562 | (2) |
|
|
562 | (1) |
|
|
562 | (1) |
|
19.3.3 Wrapped SPI controller |
|
|
563 | (1) |
|
19.3.4 SOPC component creation |
|
|
564 | (1) |
|
|
564 | (5) |
|
19.4.1 SD card command and response formats |
|
|
564 | (2) |
|
19.4.2 Initialization and identification process |
|
|
566 | (1) |
|
19.4.3 Data read and write process |
|
|
567 | (2) |
|
19.5 SPI and SD card driver |
|
|
569 | (6) |
|
19.5.1 SPI driver routines |
|
|
569 | (1) |
|
19.5.2 SD card driver routines |
|
|
570 | (5) |
|
|
575 | (13) |
|
19.6.1 Overview of FAT16 structure |
|
|
576 | (5) |
|
19.6.2 Read-only FAT16 file access driver routines |
|
|
581 | (7) |
|
|
588 | (4) |
|
19.8 Performance of SD card data transfer |
|
|
592 | (1) |
|
|
593 | (1) |
|
19.10 Suggested experiments |
|
|
593 | (2) |
|
19.10.1 SD card data transfer performance test |
|
|
593 | (1) |
|
19.10.2 Robust SD card driver routines |
|
|
593 | (1) |
|
19.10.3 Dedicated processor for SD card access |
|
|
594 | (1) |
|
19.10.4 Hardware-based SD card read and write operation |
|
|
594 | (1) |
|
19.10.5 SD card information retrieval |
|
|
594 | (1) |
|
|
594 | (1) |
|
19.10.7 Multiple sector read and write operation |
|
|
594 | (1) |
|
19.10.8 SD card driver routines with CRC checking |
|
|
595 | (1) |
|
19.10.9 Digital music player |
|
|
595 | (1) |
|
19.10.10 Digital picture frame |
|
|
595 | (1) |
|
19.10.11 Additional FAT functionalities |
|
|
595 | (1) |
|
|
595 | (1) |
|
19.11.1 HAL API file access integration |
|
|
595 | (1) |
|
19.12 Complete program listing |
|
|
596 | (23) |
|
PART IV HARDWARE ACCELERATOR CASE STUDIES |
|
|
|
|
619 | (18) |
|
|
619 | (1) |
|
20.2 Software implementation |
|
|
620 | (1) |
|
20.3 Hardware implementation |
|
|
621 | (3) |
|
|
621 | (1) |
|
20.3.2 HDL implementation |
|
|
621 | (3) |
|
|
624 | (1) |
|
20.4.1 HAL time stamp driver |
|
|
624 | (1) |
|
20.4.2 Custom hardware counter |
|
|
624 | (1) |
|
20.5 GCD accelerator IP core development |
|
|
625 | (2) |
|
|
625 | (1) |
|
|
625 | (1) |
|
20.5.3 Wrapped GCD accelerator |
|
|
625 | (2) |
|
|
627 | (2) |
|
|
627 | (2) |
|
|
629 | (1) |
|
20.7 Performance comparison |
|
|
629 | (1) |
|
|
630 | (1) |
|
20.9 Suggested experiments |
|
|
630 | (2) |
|
20.9.1 Performance with other processor configuration |
|
|
630 | (1) |
|
20.9.2 GCD accelerator with minimal size |
|
|
630 | (1) |
|
20.9.3 GCD accelerator with trailing zero circuit |
|
|
631 | (1) |
|
20.9.4 GCD accelerator with 64-bit data |
|
|
631 | (1) |
|
20.9.5 GCD accelerator with 128-bit data |
|
|
631 | (1) |
|
20.9.6 GCD by Euclid's algorithm |
|
|
631 | (1) |
|
20.10 Complete program listing |
|
|
632 | (5) |
|
21 Mandelbrot Set Fractal Accelerator |
|
|
637 | (34) |
|
|
637 | (6) |
|
21.1.1 Overview of the Mandelbrot set |
|
|
639 | (1) |
|
21.1.2 Determination of a Mandelbrot set point |
|
|
639 | (1) |
|
|
640 | (1) |
|
21.1.4 Generation of a fractal image |
|
|
641 | (2) |
|
21.2 Fixed-point arithmetic |
|
|
643 | (1) |
|
21.3 Software implementation of calc_frac_point() |
|
|
644 | (1) |
|
21.4 Hardware implementation of calc_frac_point() |
|
|
645 | (3) |
|
|
645 | (1) |
|
21.4.2 HDL implementation |
|
|
645 | (3) |
|
21.5 Mandelbrot set fractal accelerator IP core development |
|
|
648 | (2) |
|
|
648 | (1) |
|
|
648 | (1) |
|
21.5.3 Wrapped Mandelbrot set fractal accelerator |
|
|
648 | (2) |
|
|
650 | (6) |
|
21.6.1 Fractal graphic user interface |
|
|
650 | (1) |
|
21.6.2 Fractal hardware accelerator engine control routine |
|
|
651 | (1) |
|
21.6.3 Fractal drawing routine |
|
|
652 | (1) |
|
21.6.4 Text panel display routines |
|
|
653 | (1) |
|
21.6.5 Mouse processing routine |
|
|
654 | (2) |
|
|
656 | (1) |
|
|
656 | (1) |
|
|
657 | (1) |
|
21.9 Suggested experiments |
|
|
657 | (2) |
|
21.9.1 Hardware accelerator with one multiplier |
|
|
657 | (1) |
|
21.9.2 Hardware accelerator with modified escape condition |
|
|
658 | (1) |
|
21.9.3 Hardware accelerator with Q4.12 format |
|
|
658 | (1) |
|
21.9.4 Hardware accelerator with multiple fractal engines |
|
|
658 | (1) |
|
21.9.5 "Burning-ship" fractal |
|
|
658 | (1) |
|
21.9.6 Enhanced testing program |
|
|
658 | (1) |
|
|
659 | (1) |
|
21.10.1 Floating-point hardware accelerator |
|
|
659 | (1) |
|
21.10.2 General fractal drawing platform |
|
|
659 | (1) |
|
21.11 Complete program listing |
|
|
660 | (11) |
|
22 Direct Digital Frequency Synthesis |
|
|
671 | (26) |
|
|
671 | (1) |
|
22.2 Design and implementation |
|
|
671 | (6) |
|
22.2.1 Direct synthesis of a digital waveform |
|
|
672 | (1) |
|
22.2.2 Direct synthesis of an unmodulated analog waveform |
|
|
673 | (1) |
|
22.2.3 Direct synthesis of a modulated analog waveform |
|
|
674 | (1) |
|
22.2.4 HDL implementation |
|
|
674 | (3) |
|
22.3 DDFS IP core development |
|
|
677 | (3) |
|
|
677 | (1) |
|
|
678 | (1) |
|
22.3.3 Wrapped DDFS circuit |
|
|
678 | (1) |
|
22.3.4 Codec DAC integration |
|
|
679 | (1) |
|
|
680 | (1) |
|
22.4.1 Configuration routines |
|
|
680 | (1) |
|
22.4.2 Initialization routine |
|
|
681 | (1) |
|
|
681 | (6) |
|
22.5.1 Overview of music notes and synthesis |
|
|
682 | (1) |
|
|
683 | (4) |
|
|
687 | (1) |
|
22.7 Suggested experiments |
|
|
687 | (1) |
|
22.7.1 Quadrature phase carrier generation |
|
|
687 | (1) |
|
22.7.2 Reduced-size phase-to-amplitude lookup table |
|
|
687 | (1) |
|
22.7.3 Synthetic music player |
|
|
687 | (1) |
|
|
688 | (1) |
|
|
688 | (1) |
|
22.7.6 Hardware envelope generator |
|
|
688 | (1) |
|
22.7.7 Additive harmonic synthesis |
|
|
688 | (1) |
|
22.7.8 Sample-based synthesis |
|
|
688 | (1) |
|
|
688 | (2) |
|
|
688 | (1) |
|
22.8.2 Function generator |
|
|
689 | (1) |
|
22.8.3 Full-fledged electric synthesizer |
|
|
689 | (1) |
|
22.9 Complete program listing |
|
|
690 | (7) |
References |
|
697 | (4) |
Topic Index |
|
701 | |