Preparation of Papers in Two-Column Format
Total Page:16
File Type:pdf, Size:1020Kb
Implementing Dynamic Web Page Interactions with a Java Processor Core on FPGA Xiang Shen, Xu Wang, Yongxin Zhu, Tian Huang, Xue Kong School of Microelectronics Shanghai Jiao Tong University Shanghai, China [email protected], [email protected], [email protected], [email protected], [email protected] computation, storage and resources in embedded web servers Abstract- In the era of cloud computing, web servers as the are restricted [2]. To meet these conflicting requirements, major channel in cloud computing need to be redesigned to meet many researchers are working toward implementing a performance and power constraints. Considerable efforts have functionally minimized Web server on silicon—WebChip [3], been invested in web server distribution and web caching or even FPGA [4]. Also, embedded web server should be a strategies, but very few efforts have been paid to improve system on a chip that is capable of serving dynamic web pages hardware-favored web services. In this paper, we implement a Field Programmable Gate Array (FPGA) based embedded web [5]. server that can process simple dynamic web page in hardware. In At present, major dynamic web page technologies are our design, a light weight web server Lightweight IP (LwIP) is Active Server Page (ASP), Java Server Pages (JSP) and adopted as the basic implementation of TCP/IP networking stack. Hypertext Preprocessor (PHP). Compared with the other two More importantly, we implement a Java Optimized Processor technologies, JSP technology has a greater advantage. A JSP (JOP) as the hard core processor to directly support calculation page contains standard markup language elements, such as required by dynamic web page interactions. The JOP processor HTML tags. However, a JSP page also contains special JSP is tightly coupled with the LwIP running on a soft core MicroBlaze elements that allow the server to insert dynamic content in the to accelerate dynamic web page processing. We page. JSP elements can be used for a variety of purposes, such implement dynamic web pages to process matrix multiplication requests which are actually handled either by JOP or MicroBlaze as retrieving information from a database or registering users. as our testing case. In our experiment, the execution time by JOP When a user asks for a JSP page, the server executes the JSP is about one tenth of the time taken by MicroBlaze. As probably elements, merges the results with the static parts of the page, the first dynamic web page processing based on JOP in cloud and sends the dynamically composed page back to the browser computing domain, our implementation would be an interesting [6]. To process JSP pages, a JSP container, responsible for milestone to further improve efficiency of cloud computing. intercepting requests for JSP pages, is needed by the server. The container first turns the JSP page into a servlet, a piece of Keywords- Dynamic web page; JOP; LwIP; FPGA;JVM code that adds new functionality to a server, and then converts all JSP elements to Java code that implements the I. INTRODUCTION corresponding dynamic behavior [6]. Next, the container compiles the servlet class to generate Java bytecode which is The exponential growth of the Internet, coupled with the executed by Java Virtual Machine (JVM) [7, 8]. increasing popularity of dynamically generated content on the According to above introduction of JSP processing, a JSP World Wide Web, has created the need for more and faster container which is often implemented as a servlet that is Web servers serving a soaring number of Internet users [1]. configured to handle all requests for JSP pages, is a complex Web pages, the basic elements of website, are closer to and nearly impossible implementation in hardware systems. people’s lives and need to meet higher demands. Traditional Fortunately, JSP that embeds special active elements into static web pages cannot perfectly meet people’s demands, and HTML page, separates static content and dynamic content to dynamic web pages which are based on database and change achieve the separation of content and presentation. These their content or layout with the users, have been growing very active elements which are actually componentized Java rapidly. Web servers need to store numerous data submitted programs that the server executes when a user requests the by users and give a quick response to clients. As people’s page look similar to HTML elements. Therefore, we propose a living standards continue to rise, web-enabled systems are FPGA based embedded web server to realize dynamic web applied more and more widely, and embedded web servers page by HTML page with active elements and without JSP come into being. However, in most cases embedded web elements. The dynamic requests from users are resolved by servers have to be able to receive requests and commands MicroBlaze [9] and implemented by Java Optimized Processor from a remote Hypertext Transfer Protocol (HTTP) web client (JOP) [10, 11, 12] with Java programs. and also have to be able to send the control signals and JOP, an implementation of the Java virtual machine targeted management interface of the web-enabled device in the form for small embedded systems in hardware, is intended for of Hypertext Markup Language (HTML) pages. The applications in embedded real-time systems. The primary and Transmission Control Protocol (TCP) [19], which are technology for JOP in hardware is implemented on FPGA [13]. needed in our embedded web server. In the following parts, a Compared with software based JVM on a standard PC, JOP is brief overview of the architecture of JOP and LwIP is given. much faster than an interpreting JVM on a standard processor for an embedded system [14]. Since embedded applications A. JOP are multi-threaded systems, the performance can easily be This part gives an overview of JOP architecture. Fig.1 [20] enhanced using a multi-processor solution. The authors of [15, shows JOP’s major function units. A typical configuration of 16] propose a Chip-MultiProcessor (CMP) architecture JOP contains the processor core (CPU), a memory interface composed of multiple JOP cores and a shared memory and and I/O interface. The I/O interface, memory interface and compare the performance and size of JopCMP with a complex scratchpad memory are connected to memory controller which Java processor. Chip multiprocessing design is an emerging is the interface of processor core via SimpCon bus [21] by a trend for embedded systems. multiplexer. SimpCon is an interconnection interface standard. The author of [17] describes an embedded system example Scratchpad memory is used with a mapping to a Real-Time design of a Web server running on the MicroBlaze soft Specification for Java (RTSJ) style scoped memory [22]. processor with the Embedded Development Kit (EDK). Recently, Lightweight IP (lwIP) [18], an open source TCP/IP %XV\ 6LPS&RQ %&$GGU 0HPRU\ 0HPRU\ networking stack for embedded systems, is implemented on &RUHSLSHOLQH %&'DWD FRQWUROOHU LQWHUIDFH Xilinx XUPV5_LX110T board. The application example %\WHFRGHIHWFK 0HWKRG describes how to add networking capability to an embedded FDFKH 6LPS&RQ system. LwIP can be utilized to develop the application of web 726 6LPS&RQ server. 0LFURFRGH)HWFK 'DWD &RQWURO 126 In this paper, we propose an embedded web server ([WHQVLRQ 'HFRGH &RQWURO 6FUDWFKSDG ,2 architecture composed of JOP processor core and LwIP which PHPRU\ LQWHUIDFH is the basic implementation of TCP/IP networking stack, and 'DWD 0XOWLSOLHU implement it on FPGA. Dynamic web page will store lots of 6WDFN ,QWHUUXSW data submitted by user, so this system will often read data &38 from memory and write data to memory. The problem of -23 limited computation and storage resources in embedded web Fig.1 Block diagram of JOP server is really difficult to solve. Therefore, we focus on the The processor core contains three pipeline stages of operations to memory and the computation capability of the microcode fetch, decode and execute (stack) as well as an embedded web server system. We choose matrix additional translation stage of bytecode fetch, memory multiplication which is compute-intensive with low controller and multiplier. The ports of core pipeline to the synchronization overhead as our application. The application other modules are Top-Of-Stack (TOS), Next-Of-Stack (NOS), poses a challenge to computation and storage. We implement input to the stack (Data), bytecode cache address and data, and a dynamic web page to submit matrix multiplication request some control signals. The memory controller with method which is actually handled either by JOP or Microblaze as our cache [23] implements the simple memory load and store testing case. In our experiment, the execution time by JOP is operations, and the field and array access bytecodes. The about one tenth of the time taken by MicroBlaze. memory interface provides a connection between the main The rest of the paper is structured as follows. Section II memory and the memory controller. The extension module presents related work and delivers an insight into LwIP and controls data read and write. The busy signal is used to JOP. In Section III, we describe design and implementation of synchronize the processor core with the memory unit. dynamic web page processing on FPGA, including system The I/O interface contains peripheral devices, such as the architecture of our embedded web server, micro-architecture system timer, timer interrupt for real-time thread scheduling, a of SW/HW partitions inside FPGA and dynamic web page serial interface and application-specific devices. Read and processing. Section IV presents the experimental setup for our write to and from this module are controlled by the memory system. In section V, we show the results of our experiment controller. and make a simple analysis. Finally, Section VI concludes the The division of the processor into those modules greatly paper and provides guidelines for future work.