Академический Документы
Профессиональный Документы
Культура Документы
Search
Collections
Journals
About
Contact us
My IOPscience
This content has been downloaded from IOPscience. Please scroll down to see the full text.
2011 IOP Conf. Ser.: Mater. Sci. Eng. 17 012049
(http://iopscience.iop.org/1757-899X/17/1/012049)
View the table of contents for this issue, or go to the journal homepage for more
Download details:
IP Address: 109.163.166.146
This content was downloaded on 10/07/2015 at 15:06
CAMAN
IOP Conf. Series: Materials Science and Engineering 17 (2011) 012049
IOP Publishing
doi:10.1088/1757-899X/17/1/012049
Ahmad Fairuz Muhd Amin , 2Ishak Aris , 3Raja Syamsul Azmir Raja Abdullah
and 3Ratna Kalos Zakiah Sahbudin
1
Email: rsa@eng.upm.edu.my
Abstract Embedded systems are taking on more complicated tasks as the processors involved
become more powerful. The embedded systems have been widely used in many areas such as
in industries, automotives, medical imaging, communications, speech recognition and
computer vision. The complexity requirements in hardware and software nowadays need a
flexibility system for further enhancement in any design without adding new hardware.
Therefore, any changes in the design system will affect the processor that need to be changed.
To overcome this problem, a System On Programmable Chip (SOPC) has been designed and
developed using Field Programmable Gate Array (FPGA). A softcore processor, NIOS II 32bit RISC, which is the microprocessor core was utilized in FPGA system together with the
embedded operating system(OS), Clinux. In this paper, an example of web server is
explained and demonstrated
1. Introduction
Many embedded system designs have been implemented in a variety of applications such as mobile
phones, automotive, aircraft and others electronic gadgets. These embedded system can be grouped
together and communicate over a network either using wired or wireless systems.
The processor used in this embedded system is based on a Softcore processor which is implemented
in FPGA [1, 2]. The two major FPGA manufacturers provide commercial softcore processors namely,
Xilinx offers its MicroBlaze processor [3] while Altera Nios II processor [7].
The softcore processor can be adapted and enhanced to the requirement. Many components can be
added or removed without any problem such as I2C, UART, Ethernet and USB. The FPGA will be
reconfigured with the new softcore processor which increases the flexibility and easy to
maintain. A softcore processor is a microprocessor fully described in software, usually in hardware
description language (HDL), which can be synthesized in programmable hardware, such as FPGA.
Published under licence by IOP Publishing Ltd
CAMAN
IOP Conf. Series: Materials Science and Engineering 17 (2011) 012049
IOP Publishing
doi:10.1088/1757-899X/17/1/012049
In this paper, DE2 Education and Development Board which developed by Terasic
Technologies [4] was used. This board has Cyclone II EP2C35F672C6 FPGA, 8MB SDRAM,
512KB RAM and 1MB Flash and its sufficiently powerful to support general-purpose
operating system. The Ethernet is used for the communication and a web server is implemented
on the embedded system.
This paper deals with the implementation of CLinux OS to the Embedded System on
FPGA board to monitor the status of the peripherals input or output of the board system over a
network. This embedded system is connected to the network using Ethernet interface which
available on the board and setup a web server as shown in Figure 1.
Internet
DE2 Board
With Nios II
Processor
CAMAN
IOP Conf. Series: Materials Science and Engineering 17 (2011) 012049
IOP Publishing
doi:10.1088/1757-899X/17/1/012049
CAMAN
IOP Conf. Series: Materials Science and Engineering 17 (2011) 012049
IOP Publishing
doi:10.1088/1757-899X/17/1/012049
Feature
SOPC
Fixed-
Processor
ASIC
Performance
Production cost
Power efficiency
Software Flexibility
Hardware
Flexibility
Reconfigurability
Development
Time/Cost
Peripheral
equipment
cost
The strengths of SOPC design are reconfigurable, flexible nature and short development cycle.
However, the disadvantages include
lower maximum performance, higher unit costs in
production and relatively high power consumption [10].
In Figure 2, the system contains PIOs which connected to the input e.g. switches and output e.g.
LEDs and LCD. These PIOs are implemented using QUARTUS II and Nios II IDE for
hardware and software development tools respectively as well as the FPGA component Cyclone
II 2C35 using DE2 Development Board [4] is selected. The following IP cores are attached to
this project under SOPC builder:
All the peripherals above are connected over the Avalon buses at the processor and each of
peripheral, address are assigned in order to access it via the software. Nios II IDE offers a
function to write an application.
CAMAN
IOP Conf. Series: Materials Science and Engineering 17 (2011) 012049
IOP Publishing
doi:10.1088/1757-899X/17/1/012049
The design of the hardware in Quartus II and SOPC builder is shown in Figure 3.
The Ethernet and the serial port are used to allow communication between the softcore and
external interfaces. The JTAG debug module allows making hardware debugging on any signal
inside FPGA using Quartus II tool SignalTap which transform the host computer to a logic
analyzer.
3. Software
Currently, most of the embedded operating systems (OS) are stable and found in most
embedded systems. Many operating systems for embedded operating systems are available as
shown in Table 2. WinCE requires more resources which at least 32M of RAM and 100 MHz
processor. eCos, C/OS-II and CLinux are three of the most popular OS choices available for
the NIos II processor. They can also have much smaller footprints, as little as 1 MB image that
requires less than 4 MB of RAM So in this project, CLinux is preferred compared to others
OS based on open-source and more flexible [11]. Compared to other system, e.g. the C/OS-II,
CLinux provides higher compilation speed and has a wide set of compilation libraries. The
original CLinux has been used since it is a stable version continuously updated and presently it
has kernels up to 2.6 version [12]
Table 2. OS support for the Nios II Processor [11]
OS
WinCE
eCos
RTOS
C/OS-II
emboss
osCAN
CLinux
RTOS
OS Type
Yes
Yes
Yes
Yes
Yes
Yes
-
Commercial
Open
Source
Commercial
Commercial
Commercial
Commercial
Open
Source
Nios
II
IDE
Plug-in
-
-
-
Yes
-
-
Yes
There are many different application types for CLinux [13] in industrial facilities range from
controlling terminal e.g. mobile, stationary or measuring system with Internet connection, and
quality control system. Its characteristic covers high stability, system reliability, hard real time
ability, internet ability and excellent file system which make CLinux attractive for the
technical side for industrial applications. Applications on the host computer makes it easy to
customize CLinux based on any development board listed.
5
CAMAN
IOP Conf. Series: Materials Science and Engineering 17 (2011) 012049
IOP Publishing
doi:10.1088/1757-899X/17/1/012049
/>
CAMAN
IOP Conf. Series: Materials Science and Engineering 17 (2011) 012049
IOP Publishing
doi:10.1088/1757-899X/17/1/012049
CLinux starts booting immediately and the series of messages are shown in Figure 4.
5. Application Software
In a beginning stage of the development, a serial port acts as a console and an Ethernet device
used for telnet, file transfer protocol (ftp) and hyper text transfer protocol (http) services. The
code is a standard c code compiled with cross platform gcc compiler. There are two possibilities
how to use the code. Firstly, after compilation, the binary is uploaded via ftp to the NIOS II
processor but after shutdown the system will lose the memory of the code. Secondly, is to
embed the code inside the Linux image or store it in the flash memory which always available.
#include <stdio.h>
#include <unistd.h>
#include "nios2.h"
int main()
{
volatile unsigned *led_id = ((volatile
unsigned *)(na_newLED));
*led_id = 0;
while (1)
{
*led_id = 24; //LED 4 and 5 blinks
sleep(1); // delay 1 second
*led_id = 0; // no LED blinks
}
return 0;
}
We use the port address of the devices defined in SOPC builder for IO programming to control
the peripherals which is flexibility of soft core processor of FPGA. A file nios2.h contains the
addresses of the peripherals. The example to control the LEDs is shown in the Figure 6.
Other applications can be developed to control the LCD, PIOs or Seven Segments display as
well as the input e.g. buttons or switches.
The web server is another powerful mechanism which control and monitor the peripherals over
the network. In the Figure 6 shows the web control page to display the outputs on LCD, LEDs
or Seven Segment Displays. It also can monitor the status of the input of the switches or buttons
and display the result on the web page. The Common Gateway Interface (CGI) [15] takes the
data exchange between web server, e.g. embedded PC and the client, e.g. host PC.
6.
Results
CAMAN
IOP Conf. Series: Materials Science and Engineering 17 (2011) 012049
IOP Publishing
doi:10.1088/1757-899X/17/1/012049
Figure 6. CGI Webpage with full control over all Peripheral Input/Output devices
From the test results, it shows that the system is successfully monitored and controlled using the
embedded system based on FPGA which is small and easy to maintain.
Comparison performance with other embedded system without MMU based on ASICs, the
embedded system based on FPGAs offer the same functions by porting uCLinux system except
the performance of processor. This is because of the slower clock rate, softcore processor offers
a lower performance and consumes more power than ASICs. However, the softcore processor
has more flexibility and is reconfigurable IP core, which can reduce the design cycle which can
be a key factor for consumer electronic industry. The peripherals can easily added to the
hardware system with less confinement according to the requirement of customers.
Furthermore, the designer can build multi-processor in one FPGA, which will enhance the
performance of embedded system.
7. Conclusion
The whole embedded system based on Nios II softcore processor designed using an operating
system, Clinux on a DE2 Altera board has been presented. It demonstrated the input/output
web control as one of the application. We found that the software provides the flexibility to
change the source code easily for the new requirements.
The hardware, however, is a rigid system. If new requirement are set, the entire embedded
system must be changed and integrated in the total system. This is very expensive and makes
the maintenance very difficult. To overcome this problem, with the help of the hardware
description language, completely new processors and peripherals can be integrated in the FPGA
without removing the platform from the total system.
Clinux is a powerful tool that has been applied to a number of commercial applications.
The kernel is flexible and can be enhanced by embedded developers. It functions is very much
like a regular Linux Operating system and is easy to boot and running.
Acknowledgements
The authors wish to thank to the staff of Institute of Advanced Technology for providing the
facilities and resources to complete the above project successfully.
References
[1] S. Kilts, Advanced FPGA Design: Architecture, implementation, and optimization,
Hoboken,
N.J.: Wiley : IEEE, 2007.
[2] W. Wayne, FPGA-Based: System Design: New Jersey : Prentice Hall PTR, 2004.
[3]
Xilinx Inc, FPGA and CPLD Solutions, [online], (Date 16th March 2009), Available
http://www.xilink.com.
[4] Terasic Corporation, DE2 Education and Development Board, in, Taiwan, 2006,
[updated cited 20th Jan 2009] Accession no. Accession Number| Available rom Database
Provider|.
[5] N. Botros, HDL Programming Fundamentals: VHDL and Verilog, Hingham, Mass.: Da
Vinci Engineering Press, 2006.
[6] GNU, General Public License, Gnu Operation System, [online], (Date: 14th Feb 2009),
Available http://www.gnu.org/licenses/gpl.html.
[7] Altera Corporation, Avalon Bus Specification Reference Manual, Journal, [online],
(Date 12th January 2009), Available: http://www.altera.com/literature/manual/mnl-avalon
spec.pdf.
[8] Altera Corporation, SOPC Builder Support, [online], (Date: 14th January 2009),
Available: http://www.altera.com/support/software/system/sopc/sof-sopc_builder.html.
8
CAMAN
IOP Conf. Series: Materials Science and Engineering 17 (2011) 012049
[9]
[10]
[11]
[12]
[13]
[14]
[15]
[16]
[17]
IOP Publishing
doi:10.1088/1757-899X/17/1/012049