Embedded System Design - Bubble Sort Algorithm, Embedded System Implementation

Embed Size (px)

DESCRIPTION

Embedded System Design, RMIT University, Wilson Castillo:An embedded system is a special-purpose system in which the computer is completely encapsulated by the device it controls. Unlike a general-purpose computer, such as a personal computer, an embedded system performs one or a few pre-defined tasks, usually with very specific requirements. Since the system is dedicated to specific tasks, design engineers can optimize it, reducing the size and cost of the product.(www.en.wikipedia.org, 2006/11/17). The development of a development system can be classified depending of the technology; Full-custom/VLSI, Semi-Custom ASIC and FPGA/PLD (Beckett P, 2006). This project has to do with the development of a embedded system using a FPGA development system.

Text of Embedded System Design - Bubble Sort Algorithm, Embedded System Implementation

EEET2039 Embedded Systems Design

Final Project Report

Professor: Paul Beckett (paul.beckett@rmit.edu.au) Tutor: Surendran Devadoss (surendran_80@ieee.org)

Student: Wilson Castillo Bautista s3143667@student.rmit.edu.au Email: Subject Code: EEET2039 Embedded Systems Design

Melbourne, November 17th, 2006

EEET2039 Embedded Systems Design Final Project Report Laboratory Report

Complete Bubblesort Embedded System Implementation Student: Wilson Castillo (s3143667)

Table of Contents1 2 3 Introduction ......................................................................................................................................4 Aim......................................................................................................................................................4 Methodology....................................................................................................................................4 3.1 Project Design ........................................................................................................................5 3.1.1 Clock of the System .........................................................................................................6 3.1.2 PS/2 Keyboard Reader ....................................................................................................6 3.1.3 RS-232 Transmitter .............................................................................................................7 3.1.4 Memory of the system .....................................................................................................7 3.1.5 Assembly Code .................................................................................................................8 Complete System ............................................................................................................................8 Testing the System ...........................................................................................................................9 Annex ...............................................................................................................................................10 Conclusions .....................................................................................................................................26 References ......................................................................................................................................27

4 5 6 7 8

RMIT University 2006 School of Electrical and Computer Engineering

2 of 27 Melbourne, 17th November, 2006

EEET2039 Embedded Systems Design Final Project Report Laboratory Report

Complete Bubblesort Embedded System Implementation Student: Wilson Castillo (s3143667)

Table of FiguresFigure 1: Architecture of the system implemented ..........................................................................5 Figure 2: VHDL Symbol for clock generator........................................................................................6 Figure 3: Clock signals generated by VHDL Clock generator code. ............................................6 Figure 4: VHDL Symbol for PS/2 Reader...............................................................................................6 Figure 5: VHDL Symbol for RS-232 transmitter .....................................................................................7 Figure 6: Memory of the system ............................................................................................................8 Figure 7: Multiplexer 16 x 8 .....................................................................................................................8 Figure 8: System Flow ..............................................................................................................................9 Figure 9: Flow Diagram of the System when it is working (user point of view) ..........................10 Figure 10: VHDL Code for clock generator ......................................................................................11 Figure 11: VHDL code for RS-232 transmitter ....................................................................................12 Figure 13: VHDL code for PS/2 Reader ..............................................................................................15 Figure 14: VHDL Symbol for devices handler....................................................................................15 Figure 15: VHDL Code for Devices handler ......................................................................................21 Figure 16: Bubble Sort Algorithm Implemented in the HC11 VHDL Core....................................22 Figure 17: Test Bench VHDL Code for testing the design...............................................................25

RMIT University 2006 School of Electrical and Computer Engineering

3 of 27 Melbourne, 17th November, 2006

EEET2039 Embedded Systems Design Final Project Report Laboratory Report

Complete Bubblesort Embedded System Implementation Student: Wilson Castillo (s3143667)

Embedded System Design1 Introduction

An embedded system is a special-purpose system in which the computer is completely encapsulated by the device it controls. Unlike a general-purpose computer, such as a personal computer, an embedded system performs one or a few pre-defined tasks, usually with very specific requirements. Since the system is dedicated to specific tasks, design engineers can optimize it, reducing the size and cost of the product. (www.en.wikipedia.org, 2006/11/17). The development of a development system can be classified depending of the technology; Full-custom/VLSI, Semi-Custom ASIC and FPGA/PLD (Beckett P, 2006). This project has to do with the development of a embedded system using a FPGA development system.

2

Aim

The purpose of this project is to design a complete embedded system to implement the bubble sort algorithm that was tested in laboratory 3. This includes the use of a FPGA development system, which is the VIRTEX-II Microblaze Development Kit board. This project includes both hardware and software design and encompasses some of key aspects covered by the course of Embedded System Design (EEET2039).

3

Methodology

RMIT University 2006 School of Electrical and Computer Engineering

4 of 27 Melbourne, 17th November, 2006

EEET2039 Embedded Systems Design Final Project Report Laboratory Report

Complete Bubblesort Embedded System Implementation Student: Wilson Castillo (s3143667)

Figure 1: Architecture of the system implemented

As can be seen in Figure 1, the system is divided into three different sections: 1) Keyboard Receiver, HC11 Core and RS-232 transmitter. The schematic of the design can be seen at the end of this document in the annex part of this document.

In the hardware design part, the system uses the CPU core (68HC11, http://www.gmvhdl.com/hc11core.html, 2006/09/13), a PS2 interface and RS232 code VHDL interfaces. The development of the system will be using the software from Xilinx (Xilinx ISE 8.1i, www.xilinx.com, 2006/09/01) development tools and ModelSim for simulation. Xilinx ISE is a fully featured FPGA development environment that enables designs to be entered as schematics, state charts, or VHDL. Additionally, ModelSim which can be integrated with Xilinx ISE to simulate the design. In the software design part this project includes the Bubble Sort algorithm implemented using assembly language and then convert it to the machine code to embed it to the ROM system.

3.1

Project Design

The design of the project could be described by the following steps: 1. Design the CPU core part. This part based on laboratory 3 (68HC11 core VHDL code) and with additional components such as RAM, ROM and peripherals to create a fully CPU core.) 2. Design the PS2 Interface. 3. Design the RS232 Interface. 4. Design the Bubble Sort program and embed it to the ROM. 5. Simulate the system. 6. Synthesize the whole system.

RMIT University 2006 School of Electrical and Computer Engineering

5 of 27 Melbourne, 17th November, 2006

EEET2039 Embedded Systems Design Final Project Report Laboratory Report

Complete Bubblesort Embedded System Implementation Student: Wilson Castillo (s3143667)

7. 8.

Download the system to the FPGA on the VIRTEX-II board. Test the system.

The following will describe the main components of the system. It is clear that the HC11 is working and it is not necessary to offer any additional explanation about it.

3.1.1

Clock of the System

The purpose of this block is to generate the necessary signals for the system. As can be seen in Figure 3, the block delivers the signals as, E, ph1, ph2 and clk_9600. The last one is used for the RS_232_W block to write serial data to the dummy terminal. This block is based on the fact that the Microblaze system has a 24Mhz crystal generator. The code for this block could be seen in the annex of this document.

Figure 2: VHDL Symbol for clock generator

Figure 3: Clock signals generated by VHDL Clock generator code.

3.1.2

PS/2 Keyboard Reader

Figure 4: VHDL Symbol for PS/2 Reader

RMIT University 2006 School of Electrical and Computer Engineering

6 of 27 Melbourne, 17th November, 2006

EEET2039 Embedded Systems Design Final Project Report Laboratory Report

Complete Bubblesort Embedded System Implementation Student: Wilson Castillo (s3143667)

The basic code for the keyboard reader is based on rapid prototyping of digital systems (Hamblen J O, Hall T S and Furman, 2006). Basically this block uses a digital filter to avoid noise. Using the