Beruflich Dokumente
Kultur Dokumente
Antenna GPS Embedded SMA sku: GPS-00177 Description: Embedded antenna for small, mobile applications. Basic unpackaged antenna with LNA. 5inch cable terminated with standard male SMA connector. Match it with an SMA interface cable to create a trul small !"S protot pe#
$his unit works %er well out of the bo&, but the full packaged antennas ha%e better strain relief where the SMA cable meets the antenna housing. 'f ou plan on using this antenna in a %ibration intensi%e application, we recommend ou reinforce the connection with epo& or Shoe !oo. Features:
!ain ()dB *S+, -(.. *oltage /./* 012 ..5* 3urrent 4(mA +eight 45g
Mobile and embedded computer-based devices are becoming integral components of business and mission-critical systems. As a result, device-
RTI Attribute
ff-T!e-S!elf
Turnkey messaging infrastructure Tracks the latest operating system and development environment releases
#aves time and costs otherwise re!uired for internal middleware development, porting, integration, maintenance and support
0asily evaluated against re!uirements1 an in-house solution s capabilities, performance and scalability can not be known until it is complete
/rovides time and costcertainty1 eliminates risk that middleware development will take longer than e.pected
Standards com$liant
5amiliar, well-documented interfaces and readily available training improve productivity of application developers %middleware users'
/ortability and interoperability provide vendor independence and ease integration of independently developed components
Robust
set
Meets current and future re!uirements, eliminating the risk that time-consuming and costly re-
Eases integration
Individual components can be added or upgraded without impacting already running software
Reliable
%eatures of RTI&s real-time messaging infrastructure Available for embedded' mobile and real-time o$erating systems
RTI is continually adding support for new platforms, including separation kernels based on the Multiple Independent 4evels of #ecurity %MI4#' architecture. Eases a$$lication integration RTI eases integration of embedded and mobile applications with each other, with enterprise applications, and into a #ervice-&riented Architecture %#&A'.
&ut-of-the bo. support for 4A,, +A,, secure %T4#', satellite and
wireless communication over I/v: and I/v9
Reliable multicast for efficient broad data distribution #hared memory transport for high-performance inter-process
communication between components running on the same node /luggable interface for integration with other transports, including backplanes and switched fabrics, even those without I/ support *ell-suited for mission-critical systems RTI meets the re!uirements of the most demanding business and missioncritical applications"
Embedded & Mobile Systems operates as a developer o data!ase a"d e#!edded s$st sol%t&o"s t'at retre&ve data ro# dev&(es )e#!edded s$ste#s* !ar (ode s(a""ers* #o!&le se(%rel$ ro%te &" or#at&o" &"to t'e e"terpr&se or #as',%ps* a"al$s&s* das'!oards a"d d #a-&"./E#!edded 0 Mo!&le S$ste#s Data!ase sol%t&o"s o(%s o" data e1tra(t&o"* tra" load&". )ET2+ a"d report&"./ T'&s data!ase e#p'as&s &"(l%des (%sto# appl&(at&o"s or
E1(el* a"d M$S42 %s&". S42* 5BA* a"d Perl la".%a.es (o#!&"ed 6&t' (o"vers&o"s or#ats/ Mo!&le dev&(e data!ases* Bar(ode &"p%t* a"d &"spe(t&o" or# !ased data!ase s o%r spe(&alt&es/ E#!edded 0 Mo!&le S$ste#s e#!edded s$ste#s develop#e"t e#p'as&7es !r&"., %p a"d start%p o e#!edded s$ste#s : test!e"(' (ode* d&a."ost&(s* !ootloaders* a"d a%to#at&o" s(r&pts/ E#!edded plat or#s &"(l%de 2&"%1* %,!oot* Po6erT5 set,tops* a"d 8&"do6s 9E %s&". :"% tool('a&"s or 9;;<9* =ort'* a"d >?6 Asse#!ler/ 8e re#a&" (o# orta!le 6&t' lo6,level e#!edded de!%. tools l&-e @s(opes* a"al$7ers* a"d HD2 s&#%lators/ E#!edded 0 Mo!&le S$ste#s A"(/ proBe(ts !e.&" 6&t' (%sto#er reC%&re#e"ts a"d a C%otat&o" 'av&". a" &" or#al s('ed%le/ Bot' data!ase a"d e#!edded s$ste# develop#e"t e orts (o##e"(e 6&t' a #%t%all$ a.reea!le proBe(t pla" pro(ess t$p&(all$ (o"s&st&". o reC%&re#e"ts* develop#e"t* test&".* deplo$#e"t* #a&"te"a"(e* a"d (o"t&"%&t$<tra"s&t&o"/ 8'e" $o% 'ave a data!ase or e#!edded s$ste# "eed* please (o"ta(t %s/ GPS T'e Global Positioning System )GPS+ &s a U/S/ spa(e,!ased .lo!al "av&.at&o" s$ste#/ At prov&des rel&a!le pos&t&o"&".* "av&.at&o"* a"d t&#&". serv&(es to 6orld6&de %sers o" a (o"t&"%o%s !as&s &" all 6eat'er* da$ a"d "&.'t* a"$6'ere o" or "ear t'e Eart'/ :PS &s #ade %p o t'ree parts: !et6ee" 24 a"d 32 satell&tes or!&t&". t'e Eart'* o%r (o"trol a"d #o"&tor&". stat&o"s o" Eart'* a"d t'e :PS re(e&ver o6"ed !$ %sers/ :PS satell&tes !road(ast s&."als ro# spa(e t'at are %sed !$ :PS re(e&vers to prov&de t'ree,d&#e"s&o"al lo(at&o" )lat&t%de* lo".&t%de* a"d alt&t%de+ pl%s t'e t&#e/ :PS 'as !e(o#e a 6&del$ %sed "av&.at&o" 6orld6&de* a"d a %se %l tool or (arto.rap'$* s%rve$&". * (o##er(e* s(&e"t& &( %ses* tra(-&". a"d s%rve&lla"(e/ &"(l%d&". t'e s(&e"t& &( st%d$ o eart'C%a-es a"d as a t&#e s$"('ro"&7at&o" so%r(e or (ell%lar "et6or- proto(ols/ :PS 'as !e(o#e a #a&"sta$ o tra"sportat&o" s$ste#s 6orld6&de* prov&d&". "av&.at&o" or av&at&o"* .ro%"d* a"d #ar&t&#e operat&o"s/ D&saster rel&e a"d e#er.e"($ serv&(es depe"d %po" :PS or lo(at&o" a"d t&#&". (apa!&l&t&es &" t'e&r l& e,sav&". #&ss&o"s/ Ever$da$ a(t&v&t&es s%(' as !a"-&".* #o!&le p'o"e operat&o"s* a"d eve" t'e (o"trol o po6er .r&ds* are a(&l&tated !$ t'e a((%rate t&#&". prov&ded !$ :PS/ =ar#ers* s%rve$ors* .eolo.&sts a"d (o%"tless ot'ers per or# t'e&r 6or#ore e &(&e"tl$* sa el$* e(o"o#&(all$* a"d a((%ratel$ %s&". t'e ree a"d ope" :PS s&."als/
Software architecture definition Co design Defining software subsystems Feature design Task design
Soft&are +rchitecture )efinition This is the first stage of Realtime Software design. Here the software team understands the system that is being designed. The team also reviews at the proposed hardware architecture and develops a very basic software architecture. This architecture definition will be further refined in Co-Design. Use Cases are also used in this stage to analyze the system. Use cases are used to understand the interactions between the system and its users. For example, use cases for a telephone exchange would specify the interactions between the telephone exchange, its subscribers and the operators which maintain the exchange. 6o.)esign Once the software architecture has been defined, the hardware and software teams should work together to associate software functionality to hardware modules. The software handling is partitioned between different processors and other hardware resources with the following key considerations:
The software functionality should be partitioned in such a fashion that processors and links in the system do not get overloaded when the system is operating at peak capacity. This involves simulating the system with the proposed software and hardware architecture. The system should be designed for future growth by considering a scalable architecture, i.e. system capacity can be increased by adding new hardware modules. The system will not scale very well if some hardware or software module becomes a bottleneck in increasing system capacity.
1F
Software modules that interact very closely with each other should be placed on the same processor, this will reduce delays in the system. Higher system performance can be achieved by this approach as inter-processor message communication taxes the CPU as well as link resources. This stage is sometimes referred to as Co-Design as the hardware and software teams work together to define the final system architecture. This is an iterative process. Changes in system architecture might result in changes in hardware and/or software architecture. The next step in Realtime system design is the careful analysis of the system to define the software modules. )efining Soft&are Subsystems 1. Determine all the features that the system needs to support. 2. Group the various features based on the type of work they perform. Identify various sub-systems by assigning one subsystem for one type of features. Identify the tasks that will implement the software features. Clearly define the role of each task in its subsystem. 3. Within each subsystem, classify and group the features appropriately and associate the various tasks constituting the subsystem. For example, the Call Handling subsystem in Xenon would support features like: o V5.2 Originating to ISUP Outgoing Call o V5.2 Originating to V5.2 Terminating Call o Conference Call o Toll free call 3eature )esign A typical Realtime system is composed of various task entities distributed across different processors and all the inter-processor communication takes place mainly through messages. Feature Design defines the software features in terms of message interactions between tasks. This involves detailed specification of message interfaces. The feature design is generally carried out in the following steps:
11
Keep the design simple and provide a clear definition of the system composition. Do not involve too many tasks in a feature. Disintegrate big and complex features into small sub features. Draw message sequence charts for a feature carefully. Classify the legs of a scenario for a feature in such a way that similar message exchanges are performed by taking the common leg. Provide a clear and complete definition of each message interface. To check possible message loss, design timer based message exchanges. Always consider recovery and rollback cases at each stage of feature design. One way of doing this is to keep a timer for each feature at the task that controls the mainline activity of the feature. And then insert the timeout leg in the message sequence charts of the feature. To avoid overloading of message links choose design alternatives that include fewer message exchanges. Tas2 )esign Designing a task requires that all the interfaces that the task needs to support should be very well defined. Make sure all the message parameters and timer values have been finalized. Selecting t!e Tas) Ty$e Once the external interfaces are frozen, select the type of task/tasks that would be most appropriate to handle the interfaces:
12
SingleStateMachine: The tasks functionality can be implemented in a single state machine. The v5.2 call task in Xenon is a good example of a task of this type. MultipleStateMachines:The task manages multiple state machines. Such tasks would typically include a dispatcher to distribute the received messages to an appropriate state machine. Such tasks would create and delete state machine objects as and when required. MultipleTasks: This type of tasks are similar to the multiple state machine tasks discussed above. The main difference is that the task now manages multiple tasks. Each of the managed tasks implements a single state machine. The manager task is also responsible for creating and deleting the single state machine tasks. ComplexTask: This type of task would be required in really complex scenarios. Here the manager task manages other tasks which might be managing multiple state machines. Selecting t!e State Mac!ine Design After choosing the type of task, the designer should consider dividing the message interface handling into a sequence of state transitions. Two different type of state machines can be supported:
Flat State Machines: This is the most frequently used type of state transition. For example, the states of a call would be "Awaiting Digits", "Awaiting Connect", "Awaiting Release", "Awaiting On-hook" etc. This type of state division does not scale very well with increasing complexity. For a complex system this technique results in a state explosion, with the task requiring hundreds of states. HierarchicalStateMachines:Here the states are viewed as a hierarchy. For example the states covered above would map to "Originating : Awaiting Digits", "Originating: Awaiting Connect", "Releasing : Awaiting Release", "Releasing : Awaiting On-hook". The total number of states is the same here, but the main difference is that some states inherit from an "Originating" base state and others inherit from "Releasing" base state. The total number of message handlers in each state would be reduced drastically, as all the messages that have common handling in all the originating states would be just handled in the "Originating"
13
Do not complicate the design by introducing too many states. Such designs are very difficult to understand. Follow a simple rule of thumb, if you are having difficulty choosing the name of state, you may have identified the wrong state. Do not complicate the design by having too few states. If all the states in the system have not been captured in the state machine design, you will end up with lot of flags and strange looking variables which will be needed to control the message flow in the jumbo states. Keep the data-structure definitions simple. See if a simpler data-structure would do the same job just as well. Out of memory conditions should be handled. Tasks can and will run out of memory. So handle the out of memory conditions gracefully. This can lead to a lot of "if clutter" so consider exception handling as an option. All of the legs of the defined scenarios should be handled. This is easier said than done. Many times all the scenario legs identified in the feature design stage may not cover all the possible error scenarios for your task. Make sure that all the allocated resources are deallocated at the end. Again it is very easy to miss out on this one. Many times designers forget to release resources in the error legs. Consider using a hierarchical state machine to simplify the state machine design. Consider using Object Oriented programming languages like C++. Contrary to popular belief, languages like C++ might turn out to be more efficient in runtime performance because of better locality of reference. (Most objects would be referring to data that is contained in the same object, thus improving the locality of reference)
T'e #a&" o!Be(t&ve o t'e proBe(t &s to develop t'e e"a!l&". te('"olo.$ a"d &" rastr%(t%re reC%&red to e e(t&vel$ %se t'e #ost adva"(ed te('"&C%es developed or real,t&#e appl&(at&o"s 6&t' le1&!le s('ed%l&". reC%&re#e"ts* &" e#!edded s$ste#s des&." #et'odolo.&es a"d tools* prov&d&". t'e "e(essar$ ele#e"ts to tar.et re(o" &.%ra!le pro(ess&". #od%les a"d re(o" &.%ra!le d&str&!%ted ar('&te(t%res/
14
15
16
13
1?
1K
,age "Your intelligent car develops an engine problem, but instead of flashing you a warning light it sends a message directly to the manufacturer over a wireless connection to the network. The manufacturer's systems diagnose the problem and transmit a fix back to the electronics complex in your car. In fact, that corrective fix is transmitted to all models everywhere in the world, without ever having to notify the owners. .... Instant information on performance is captured and sent immediately into product development and manufacturing. " The recently announced Cisco Internet Home, a 170 square-meter living space, has almost all house appliances (refrigerator, microwave oven, internet-based phone, television, computer, Web cams, wireless touch-pads, health maintenance devices, ...) connected to Internet through a Residential Gateway. Cisco Systems Inc. wants to prove that "... the Internet is the next utility in the home, and, within three to five years, will be as pervasive as gas, water or electricity." Electric servo appliances are a good example of pervasive technology [4], [6]. The average North American home contains two dozen or more electric motors. A multitude of sensors is gathering the information needed to control them. As all these are buried inside many appliances (vacuum cleaners, microwave ovens, refrigerators, VCRs, etc.) we have difficulty identifying them and we actually don't care where and how many they are as long as they are doing their job. In the future, the same will be true with computers, most of which will be hidden in information appliances [22]. These new appliances are "smart devices" embedded with microprocessors that allow users to plug into intelligent networks and gain direct, simple, and secure access to both relevant information and services. These devices are as simple to use as calculators, telephones or kitchen toasters. Pervasive Computing envisions the " networked home" where domestic devices can interact seamlessly with each other and with in-home and external networks. Using the existing home infrastructure based on open industry standards, a person will be able to integrate the home network with external networks to easily manage home devices, both locally and remotely. Recent progress in computer, integrated circuit, and communications technologies allows the use of complex algorithms from various domains (such as signal and image processing, system identification, modelling, control, and AI). It becomes also possible to implement user friendly virtual environments for the development of an ever growing diversity of real-time intelligent sensing applications ranging from Computer Integrated Manufacturing (CIM) to smart homes and offices [15], [18], [23]. Early digital and computer-based instrumentation architectures and communications standards
2F
,age .
environments to be used in a broader selection of applications involving loosely coupled, eventdriven, heterogeneous information appliances. The aim of this paper is to discuss development scenarios for intelligent sensor environments and pervasive computer architectures able to support a new generation of information appliances for distributed heterogeneous real-time applications. 2. Sensor-based information appliances While the smart networked home is a very good first example, the development of intelligent sensing agents and sensor-based information appliances will spread the pervasive technology ideas to a multitude of human activities such as mining and manufacturing, security industry, transportation, training and health etc. It is not exaggerate to claim that this technology, when integrated with the emerging global information infrastructure, will have a profound impact on our personal and professional activities, and will open business opportunities, of a similar or even higher scale than what we are experiencing presently with the Internet. As their perception, intelligence and networking abilities grow, the electric appliances are evolving into information appliances representing the next, information-intensive, evolutionary stage for the pervasive computing paradigm. Donald Norman makes a compelling argument in [22] for the information appliance paradigm that he sees as being "the natural successor to today's [computer] complexity ... through the user-centered, human-centered, humane technology of appliances where the technology of the computer disappears behind the scenes into taskspecific devices that maintain all the power without the difficulties." The business model for this disruptive technology shifts from the technology-driven computer industry to the consumerdriven model of the consumer appliance industry. Lower profit margins are to be expected from high volumes of consumable devices, services and content. The nature of pervasive information appliances requires that the developed architectures should distributed rather than centralized. These appliances will provide a seamless intelligent connection of the perception to action, [7]. These new developments point to a new type of intelligent control based on a multisensory perception of the state of the controlled process and its environment [7], [10]. The use of multiple sensors is beneficial in improving the accuracy, the cost and robustness of the perception process. World models, built and maintained from information gathered by a multitude of sensors, provide a common abstract representation of the state of the environment. At the perception level, the world model is analyzed to infer relationships between different objects. Sensor architectures integrating both proprioceptors (sensors monitoring the internal state of information appliances) and exteroceptors (sensors monitoring the state of the environment outside the information appliance) using sensor-models and world-models will provide superior modularity, interchangeability ("plug and play") and transparence. All these will eventually allow for easier sensor fusion and knowledge extraction.
,age /
Intelligent task-directed information gathering features will allow for a more elastic and efficient use of the inherently limited sensing and processing capabilities of each sensor. Each task a sensor has to carry out determines the nature and the level of the information that is actually needed. Sensors should be able of selective environment perception that focuses on parameters important for the specific task at hand and avoid wasting effort to process irrelevant data. A task-specific decision making process will guide the incremental refinement of the environment model. Information appliance should be able to learn and adapt their behavior to changes in their working environment including other appliances as well as human users. Such adaptability is already provided by the smart habitat controls of some cars which offer an automatic adjustment of the seat, mirrors, and drive wheel's column tilt to accommodate every driver's preference. These appliances should also be able to deal with multiple redundant communication carriers
21
,age 0
and intelligent sensing systems are called to work together as symbionts, each contributing the best of their specific abilities, as illustrated in Figure 1. A proper control of these operations cannot be accomplished without some telepresence capability allowing the human operator to experience the feeling that he/she is virtually immersed in the working environment. Figure 1: Human operators and sensor-based appliances work together as symbionts, each contributing the best of their specific abilities. HCI (Human Computer Interaction) interfaces provide a telepresence capability allowing the human operator to experience the feeling that he/she is virtually immersed in the working environment. Appropriate geometric-, force-, and touch-domain human-feedback devices will have to be developed in addition to the currently available visual and sound HCI devices.
,age 1
In order to find efficient solutions to the complex perception tasks, these symbiont intelligent appliances will have to combine their intrinsic reactive-behavior with higher-order world model representations of the immersive virtual reality systems. 4. Management of heterogeneous functions for a large diversity of information appliances Pervasive computing environments involve both human-machine and machine-machine interaction and cooperation paradigms. The discussion will concentrate on machine-machine aspects. We are all familiar with human-to-human communication and cooperation, which require a common language and an underlying system of shared knowledge and common values. In order to achieve a similar degree of machine-machine interaction and cooperation, a framework should be developed to allow for the management of heterogeneous functions and knowledge for a large diversity of pervasive computing devices. Such a framework should address the communication needs of pervasive devices at a higher level than the classical communication network protocols and even distributed computing frameworks such as CORBA (Common Object Request Broker Architecture) which provide mainly distribution transparency. Heterogeneous pervasive computing devices cannot realistically be expected to talk exactly the same language. However, these devices will share domain-specific knowledge, which may be expressed by each of them in different format/dialect. Accordingly, the proposed management framework should define a domain specific semantic for
22
,age 2
Figure 2: Information appliances should interact in an unobtrusive way with humans, other appliances and the rest of the world while carrying on their specific task in their physical environment. World models, built and maintained from information gathered by a multitude of sensors, provide a common abstract representation of the state of the environment. A hybrid deliberative/reactive architecture integrates the deliberative reasoning and behavior-based control functions. A distributed computing frameworks together with high level information exchange mechanisms provide a flexible extensible open framework allowing for the information appliances interoperability. Special communication mechanisms will allow the information appliance to handle a variety of redundant and complementary information channels. 5. Networking technologies for pervasive information appliances. As a very large number of devices will be connected through infrared and radio wireless and wire-line global networks infrastructure, existing technologies will be rendered inefficient; new solutions have to be invented. Bandwidth and resource limitations of the wireless medium require that information content is compressed as much as possible, in order to consume the least amount of resource possible.
,age 3
However, such low redundancy makes the information vulnerable, especially in an error-prone environment such as wireless channels and networks. Personal Area Network (IEEE 802.15) and existing Local and Wide Area Network (e.g. IEEE 802.11), Internet Protocols (Mobile IP, IPv6, RTP/RTCP, RSVP, XTP etc.), Wireless Application Protocol (WAP) are already available. However, it is expected that the size and complexity of the problem would require the development of new technologies and standards when developing a new Distributed Networks Architectures (DNA) suitable for the support of pervasive computing at a large scale. The development should address wired and wireless networking issues looking for the development of cost-effective solutions for environments where deployment of advanced networking infrastructure could be unjustifiably costly. The following appear to be of an immediate interest: Service admission control and connection establishment policies, as well as resource allocation and resource adaptation algorithms for the support of pervasive devices. Quality of Service capable, error-resilient and resource allocation-efficient multiple-access protocols for the efficient transportation of sensor traffic. Intelligent networking infrastructure and definition of suitable architectures of distributed nature. Cost -effective network solutions for environments where there is no advanced networking
23
,age 4
10. B.V. Dasarathy, "Sensor Fusion Potential Exploitation Innovative Architectures and Illustrative Applications," Proc. IEEE, Vol. 85, No. 1, pp. 24-38, Jan. 1997 11. M.L.Dertouzos, "The Future of Computing", Scientific American, 52, pp.52-55, Aug. 1999 12. Electrolux Inc., "Electrolux screen Fridge", http://www.wired.com/news/news/email/explode-infobeat/technology/story/%17894.html, 1999 13. L.M. Garshol, "Introduction to XML," http://www.stud.ifi.uio.no/lmariusg/download/xml/xml_eng.html 14. L. Gerstner, "Pervasive Computing" , Keynote -CeBIT 98, http://195.27.241.3/news/news1/ns-3975.html 15. M. Hardwick, D.L. Spooner, T. Rando, K.C. Morris, "Data Protocols for the Industrial Virtual Enterprise," IEEE Internet Computing, vol. 1, no. 1, pp. 20-29, Jan-Feb. 1997 16. A.C. Huang, B. Ling, S. Ponnekanti, and A. Fox. "Pervasive Computing: What Is It Good For?" Workshop on Mobile Data Management (MobiDE) in conjunction with ACM MobiCom 99 17. IBM, "What is Pervasive Computing", http://www-3.ibm.com/pvc/pervasive.html 18. R. Itschner, C. Pommerell, M. Rutishausser, "Glass: Remote Monitoring of Embedded Systems in Power Engineering," IEEE Internet Computing, vol. 2, no. 3, pp. 46-52, MayJune. 1998 19. S. Mann, "Wearable Computing: A First Step Toward Personal Imaging", IEEE Computer, 30 (2), Feb. 1997 20. S. Mann, "Humanistic Computing: WearComp as a New Framework and Application for Intelligent Signal Processing," Proc. IEEE, Vol. 86, No. 11, pp. 2123-2151, Nov. 1998 21. NCR Corp., "NCR Microwave Oven / Home Banking," http://www.wired.com/news/news/technology/story/14949.html 22. D.A. Norman, The Invisible Computer: Why Good Products Can Fail, the Personal Computer Is so Complex, and Information Appliances Are the Solution, The MIT Press, 1999. 23. C.M. Pancerella, N.M. Berry, "Adding Intelligent Agents to Existing EI Frameworks ," IEEE Internet Computing, vol. 3, no. 5,pp. 60-61, Sept-Oct. 1999 24. R.W. Picard, "Human-Computer Coupling," Proc. IEEE, Vol. 86, No. 8, pp. 1803-1807, Aug. 1998 25. B. Rhodes, "Context-Aware Computing (or, why context needs wearables and wearables need context)," http://wearables.www.media.mit.edu/projects/wearables/context.html 26. World Wide Web Consortium (W3C), "Extensible Markup Language (XML) 1.0," http://www.w3.org/TR/REC-xml
24
EMBEDDED SYSTEM :DEEPAK MATHUR T%tor&al: Des&."&". real,t&#e a"d sa et$,(r&t&(al e#!edded Nava appl&(at&o"s , Part 2 So t Real,T&#e Nava Develop#e"t :%&del&"es
B$ Kelv&" E&lse"* Ao"&1 E#!edded/(o# )F6<23<F6* 12:55:FF PM EDT+ As de &"ed &" t'e Real T&#e Spe(& &(at&o" or Nava )RTSN+* so t real t&#e des(r&!es s$ste#s &" 6'&(' a" a(t&o" per or#ed at t'e 6ro". t&#e )e&t'er too earl$ or too late+ 'as so#e pos&t&ve val%e eve" t'o%.' &t 6o%ld 'ave 'ad .reater val%e & per or#ed at t'e proper t&#e/ T'e d& ere"(e !et6ee" 'ard real,t&#e a"d so t real,t&#e does "ot depe"d o" t'e t&#e ra".es spe(& &ed or deadl&"es or per&od&( tas-s/ =or e1a#ple* a so t real,t&#e s$ste# #&.'t 'ave a deadl&"e o 1FF Os* 6'&le a 'ard real,t&#e s$ste# #a$ 'ave a deadl&"e o 3 se(o"ds/ To 'elp developers 6'o 6&s' to avo&d t'e %se o trad&t&o"al Nava@s a%to#at&( .ar!a.e (olle(t&o" a"d &"stead %se t'e s(oped #e#or$ a!stra(t&o"s &"trod%(ed !$ t'e Real T&#e Spe(& &(at&o" or Nava )RTSN+* t'e Dpe" :ro%p@s Real,T&#e a"d E#!edded =or%# &s develop&". a set o .%&del&"es !ased o" #a-&". e e(t&ve %se o t'e trad&t&o"al sta"dard ed&t&o" Nava &" (o#!&"at&o" 6&t' appropr&ate pro &les o t'e Real,T&#e Spe(& &(at&o" or Nava/ =ollo6&". are te" !as&( r%les or e e(t&ve so t real,t&#e Nava develop#e"t:
25
EMBEDDED SYSTEM :DEEPAK MATHUR Rule () *se the +a'a Standard Edition platform T'e !e"e &ts t'at Nava !r&".s to so t real,t&#e #&ss&o",(r&t&(al s$ste#s are #ost releva"t to lar.e* (o#ple1* d$"a#&( appl&(at&o"s/ S&"(e t'e N2ME plat or# represe"ts a" &"(o#pat&!le s%!set o %ll NSE* &t does "ot prov&de a((ess to NSE,sta"dard 9DTS l&!rar$ (o#po"e"ts/ A appl&(at&o"s reC%&re e"terpr&se ed&t&o" (apa!&l&t&es* o!ta&" t'e spe(& &( e"terpr&se ed&t&o" l&!rar&es t'at are reC%&red a"d r%" t'e# o" a so t real,t&#e NSE plat or#/ Alter"at&vel$* r%" t'e reC%&red e"terpr&se ed&t&o" %"(t&o"al&t$ o" trad&t&o"al )"o" real,t&#e+ N5M plat or#s 6'&(' (o##%"&(ate 6&t' t'e so t real,t&#e N5M #a('&"es %s&". RMA or ot'er "et6or-&". proto(ols/ Rule ,) $aseline a particular 'ersion of the +SE libraries =or a"$ .&ve" develop#e"t proBe(t* &t &s &#porta"t to sta"dard&7e o" a part&(%lar vers&o" o t'e NSE l&!rar&es/ As Sta"dard Ed&t&o" Nava 'as evolved* ea(' "e6 release adds "e6 (apa!&l&t&es a"d e1pa"ds #e#or$ ootpr&"t reC%&re#e"ts/ Ea(' "e6 release also depre(ates )or re#oves+ (erta&" (apa!&l&t&es 6'&(' are repla(ed 6&t' "e6er sol%t&o"s/ A $o% are 6or-&". o" a lar.e proBe(t or 6'&(' so t6are #a&"te"a"(e #%st spa" #a"$ $ears* $o% pro!a!l$ 6a"t to sele(t a (erta&" Sta"dard Ed&t&o" plat or# a"d ree7e t'at ('o&(e/ Dt'er6&se* $o% 6&ll e"d %p #a-&". #a"$ %""e(essar$ ('a".es to $o%r (ode !ase B%st to #a&"ta&" (o#pat&!&l&t$ 6&t' t'e ever ('a".&". de &"&t&o" o t'e Nava plat or#/ Do(%#e"t t'&s de(&s&o" to all developers a"d #a"a.ers/ Rule -) .ollow /best practices/ recommendations for +a'a de'elopment T'e so t6are C%al&t$ #eas%res are ver$ s&#&lar or so t real, t&#e Nava a"d trad&t&o"al Nava/ U"less spe(& &ed to t'e (o"trar$* ollo6 t'e a((epted .%&del&"es or 6r&t&". porta!le a"d #a&"ta&"a!le NSE (ode/ 26
EMBEDDED SYSTEM :DEEPAK MATHUR Rule 0) *se +.ace and S1" for graphical user interfaces Most #&ss&o",(r&t&(al so t6are does "ot reC%&re .rap'&(al %ser &"ter a(es/ A so t real,t&#e s$ste#s do reC%&re .rap'&(al %ser &"ter a(es* %se t'e ope",so%r(e S8T a"d N=a(e l&!rar&es &"stead o t'e propr&etar$ A8T a"d S6&". (o#po"e"ts/ S8T a"d N=a(e r%" &" less #e#or$ a"d r%" aster t'a" S8T a"d S6&"./ Rule 2) *se cooperating hard real-time components to interface with nati'e code T'e NEA proto(ol &"trod%(es s&."& &(a"t data #ars'all&". over'ead 6'e" o!Be(ts are s'ared !et6ee" t'e Nava a"d "at&ve e"v&ro"#e"t/ =%rt'er#ore* t'e s'ar&". proto(ols #a$ e1pose Nava o!Be(ts a"d Ipr&vateI v&rt%al #a('&"e data str%(t%res to %"d&s(&pl&"ed 9 (o#po"e"ts* &"trod%(&". t'e r&s- t'at #&s!e'av&". 9 (ode 6&ll (o#pro#&se t'e &"te.r&t$ o t'e v&rt%al #a('&"e e"v&ro"#e"t/ E1per&e"(e o e1&st&". (%sto#ers &" several real proBe(ts &"volv&". '%"dreds o #a" $ears o develop#e"t do(%#e"t t'at t'ese r&s-s are real* 'av&". (ost develop#e"t tea#s s&."& &(a"t e ort a"d (ale"dar t&#e to (orre(t errors &"trod%(ed &"to t'e Nava e"v&ro"#e"t !$ 9 developers 6r&t&". NEA (o#po"e"ts/ Better per or#a"(e a"d stro".er separat&o" o (o"(er"s &s real&7ed !$ &#ple#e"t&". all &"ter a(es to "at&ve (ode as (ooperat&". 'ard real,t&#e (o#po"e"ts as de &"ed !$ t'e 'ard real,t&#e RTSN pro &le/ Rule 3) *se cooperating hard real-time components with performance-critical code A t'e t'ro%.'p%t o (erta&" so t real,t&#e (o#po"e"ts &s "ot s% &(&e"t to #eet per or#a"(e reC%&re#e"ts* &#ple#e"t t'e reC%&red %"(t&o"al&t$ as (ooperat&". 'ard real,t&#e (o#po"e"ts as de &"ed !$ t'e 'ard real,t&#e RTSN pro &le/ Be(a%se t'e (ode .e"erat&o" #odel or 'ard real,t&#e 23
EMBEDDED SYSTEM :DEEPAK MATHUR (o#po"e"ts does "ot "eed to (oord&"ate 6&t' .ar!a.e (olle(t&o"* t'ese (o#po"e"ts .e"erall$ r%" t6o to t'ree t&#es aster t'a" so t real,t&#e Nava (o#po"e"ts/ Rule 4) *se cooperating hard real-time components to interact with hardware de'ices A t'e so t real,t&#e (o#po"e"t "eeds to (o##%"&(ate d&re(tl$ 6&t' 'ard6are dev&(es 6'&(' are "ot represe"ted !$ operat&". s$ste# dev&(e dr&vers* &#ple#e"t t'e dev&(e dr&ver as a (ooperat&". 'ard real,t&#e (o#po"e"t as de &"ed !$ t'e 'ard real,t&#e RTSN pro &le/ A t'e operat&". s$ste# prov&des a dev&(e dr&ver t'at represe"ts t'&s dev&(e as a &le* %se t'e sta"dard Bava/&o or Bava/"&o l&!rar&es to a((ess t'e dev&(e/ A t'e operat&". s$ste# prov&des a dev&(e dr&ver 6&t' a d& ere"t APA t'a" t'e &le s$ste#* %se a (ooperat&". 'ard real,t&#e (o#po"e"t to &#ple#e"t t'e &"ter a(e to t'e dev&(e dr&ver/ Rule 5) Restrict the use of /ad'anced libraries/ 9erta&" sta"dard Nava l&!rar&es are "ot ava&la!le &" (erta&" e#!edded e"v&ro"#e"ts !e(a%se t'e %"derl$&". operat&". s$ste# or 'ard6are &s #&ss&". des&red (apa!&l&t&es/ A#o". t'e l&!rar&es t'at #a$ "ot !e ava&la!le o" all plat or#s* l&sted &" de(reas&". order o porta!&l&t$ (o"(er"* are: JFace and SWT libraries: T'ese .rap'&(al l&!rar&es are o"l$ ava&la!le o" s$ste#s t'at 'ave .rap'&(al 'ard6are a"d t'e S8T &"te.rat&o" so t6are reC%&red to dr&ve t'e .rap'&(al 'ard6are/ java.nio libraries: Ma"$ e#!edded operat&". s$ste#s do "ot s%pport as$"('ro"o%s A<D/
2?
EMBEDDED SYSTEM :DEEPAK MATHUR java.io libraries: So#e e#!edded tar.ets 'ave "o "ot&o" o std&"* stdo%t* or stderr/ So#e e#!edded tar.ets 'ave "o "ot&o" o "o",volat&le &le stora.e/ java.net libraries: So#e e#!edded tar.ets 'ave "o "et6or(o""e(t&v&t$/ Re(o."&7e t'at t'e %se o t'ese l&!rar&es #a$ l&#&t t'e porta!&l&t$ o (ode a"d #a$ (o"tr&!%te to t'e %t%re #a&"te"a"(e !%rde"/ Rule 6) #solate +7M dependencies E1&st&". so t real,t&#e v&rt%al #a('&"es d& er &" 'o6 t'e$ s%pport (erta&" &#porta"t #&ss&o",(r&t&(al (apa!&l&t&es/ 8rap all N5M depe"de"(&es &" spe(&al (lasses t'at (a" !e .&ve" e1tra atte"t&o" & t'e (ode #%st !e ported to a d& ere"t N5M/ Spe(& &( serv&(es t'at reC%&re t'&s 'a"dl&". &"(l%de: A8 H&.',pre(&s&o" t&#&". serv&(es: o!ta&"&". real,t&#e 6&t' .reater pre(&s&o" t'a" 1 #sP dr& t, ree sleep)+* 6a&t)+* a"d Bo&")+ serv&(es/ $8 9PU,t&#e a((o%"t&".: Ho6 #%(' 9PU t&#e (o"s%#ed !$ ea(' t'readQ Ho6 #%(' 9PU t&#e &s (o"s%#ed at ea(' pr&or&t$ levelQ &8 :ar!a.e (olle(t&o" pa(&".: Ho6 to #o"&tor t'e #e#or$ allo(at&o" !e'av&or o t'e appl&(at&o" so t6are a"d t'e e e(t&ve"ess o :9Q Ho6 to s('ed%le :9 to #a&"ta&" pa(e 6&t' allo(at&o" ratesQ D8 S('ed%l&".: A a v&rt%al #a('&"e o ers '&.',level s('ed%l&". s%pport* s%(' as earl&est,deadl&"e &rst or #a1&#%#
2K
EMBEDDED SYSTEM :DEEPAK MATHUR a((r%ed %t&l&t$ s('ed%l&".* t'e s('ed%l&". a"d s$"('ro"&7at&o" serv&(es s'o%ld !e &solated 6&t'&" a (e"tral&7ed APA/ Rule (9) &arefully select an appropriate soft real-time 'irtual machine D"e o t'e #ost &#porta"t de(&s&o"s &" deter#&"&". t'e s%((ess o a so t real,t&#e Nava develop#e"t e ort &s sele(t&o" o a s%&ta!le N5M/ Ea(' develop#e"t proBe(t 'as %"&C%e reC%&re#e"ts a"d (o"stra&"ts* so &t #a$ !e "e(essar$ to &"depe"de"tl$ eval%ate t'e releva"(e o var&o%s ava&la!le v&rt%al #a('&"e prod%(ts or ea(' develop#e"t e ort/ A" sele(t&". a v&rt%al #a('&"e* (o"s&der at #&"&#%# ea(' o t'e ollo6&". &ss%es: A8 Real,T&#e .ar!a.e (olle(t&o" s'o%ld 'ave a #a1&#%# pree#pt&o" late"($ a"d s'o%ld !e &"(re#e"tal so t'at 6'e" t'e .ar!a.e (olle(tor &s pree#pted !$ '&.'er pr&or&t$ appl&(at&o" t'reads* &t (a" res%#e 6&t' t'e "e1t &"(re#e"t o 6or- 6'e" t'e appl&(at&o" t'read rel&"C%&s'es t'e 9PU/ $8 T'e .ar!a.e (olle(tor s'o%ld de ra.#e"t t'e 'eap &" order to ass%re rel&a!le lo".,r%""&". operat&o" or s'o%ld prov&de so#e alter"at&ve #e('a"&s# to avo&d rel&a!&l&t$ pro!le#s res%lt&". ro# ra.#e"tat&o" o t'e 'eap/ A"d &t #%st a((%ratel$ re(la&# all dead #e#or$ rat'er t'a" re(la&#&". o"l$ a (o"servat&ve appro1&#at&o" o t'e dead #e#or$/ =&"all$* &t #%st !e pa(ed to ass%re t'at #e#or$ &s re(la&#ed at rates (o"s&ste"t 6&t' t'e appl&(at&o"@s stead$,state de#a"d or "e6 #e#or$ allo(at&o"/ &8 All s$"('ro"&7at&o" lo(-s #%st &#ple#e"t pr&or&t$ &"'er&ta"(e/ All 6a&t C%e%es #%st !e ordered a((ord&". to t'read pr&or&t&es/
3F
EMBEDDED SYSTEM :DEEPAK MATHUR D8 T'e v&rt%al #a('&"e "eeds to prov&de #o"&tor&". a(&l&t&es to allo6 s%perv&sor$ t'reads to o!serve a"d #eas%re t'e real, t&#e reso%r(e reC%&re#e"ts o &"d&v&d%al (o#po"e"ts/ A#o". reC%&red (apa!&l&t&es are t'e a!&l&t$ to deter#&"e 'o6 #%(' 9PU t&#e &s (o"s%#ed !$ part&(%lar t'reads* 'o6 #%(' 9PU t&#e &s (o"s%#ed !$ t'e .ar!a.e (olle(t&o" t'read)s+* t'e rates at 6'&(' part&(%lar t'reads are allo(at&". #e#or$* a"d t'e total a#o%"t o #e#or$ !e&". reta&"ed as l&ve/ E8 Deter#&"e t'e release level o t'e N2SE l&!rar&es reC%&red or a part&(%lar proBe(t a"d ass%re t'at t'e ve"dor &s a!le to s%pport t'e des&red l&!rar$ vers&o" t'ro%.'o%t t'e d%rat&o" o $o%r develop#e"t proBe(t/ .8 Ass%re t'at t'e v&rt%al #a('&"e prov&des l&!rar&es or '&.', pre(&s&o" t&#e #eas%re#e"ts* a"d or dr& t, ree 6a&t)+* Bo&")+* a"d sleep)+ serv&(es/ G8 Ass%re t'at t'e v&rt%al #a('&"e &s s%pported !$ appropr&ate A'ead,o ,T&#e (o#p&lat&o" a"d l&"-&". tools & t'e s$ste# &s stat&(all$ (o#p&led a"d loaded/ :8 A t'e s$ste# #%st d$"a#&(all$ load (o#po"e"ts* ass%re t'at t'e d$"a#&( (lass loader (a" !e (o" &.%red to r%" at lo6er pr&or&t$ t'a" t'e o".o&". real,t&#e appl&(at&o" 6or-load/ #8 A t'e d$"a#&( (lass loader #%st per or# NAT (o#p&lat&o"* ass%re t'at t'e NAT (o#p&ler (a" !e (o" &.%red to s%pport ea.er l&"-&". a"d tra"slat&o"* #ea"&". t'at all (o#po"e"ts are %ll$ resolved a"d tra"slated 6'e" t'e &rst o t'e &"terdepe"de"t #od%les &s loaded* rat'er t'a" de err&". NAT tra"slat&o" %"t&l t'e #o#e"t ea(' (ode #od%le &s &rst e1e(%ted/ So#e s$ste#s "eed to d$"a#&(all$ load (o#po"e"ts 6'&(' 6ere t'e#selves a'ead,o ,t&#e (o#p&led/ 5er& $ t'&s 31
EMBEDDED SYSTEM :DEEPAK MATHUR (apa!&l&t$ &s s%pported & releva"t to $o%r proBe(t reC%&re#e"ts/ +8 Ass%re t'at t'e v&rt%al #a('&"e &"(l%des "e(essar$ develop#e"t tools* &"(l%d&". s$#!ol&( de!%..&". o !ot' &"terpreted a"d (o#p&led (ode a"d r%",t&#e per or#a"(e a"d #e#or$ %sa.e pro &l&"./ ;8 Ass%re t'at t'e v&rt%al #a('&"e &"(l%des s%pport or (ooperat&". 'ard real,t&#e Nava (o#po"e"ts & t'e pla""ed develop#e"t proBe(t #a$ reC%&re &"te.rat&o" 6&t' (ooperat&". 'ard real,t&#e (o#po"e"ts/
Embedded Java
by Vincent Perrier 08/15/2001 Java's strong appeal for embedded applications is sometimes offset by concerns about its speed and its memory requirements !o"ever# t$ere are tec$niques t$at you can use to boost Java performance and reduce memory needs# and of course t$e Java virtual mac$ine you c$oose affects Java performance# too %ou can ma&e better'informed decisions about using Java by understanding t$e factors t$at affect its performance and selecting meaningful benc$mar&s for embedded applications
(ec$niques for improving application e)ecution and c$oosing t$e rig$t Java virtual mac$ine *JV+, address only a fe" aspects of system arc$itecture t$at affect overall Java performance -$en selecting an embedded Java platform# you must ta&e into account a $ost of ot$er factors# beyond t$e scope of t$is article# t$at $ave an impact on performance .mong t$em are $ard"are processor selection# Java compatibility and supported .P/s# application reliability and scalability# t$e c$oice of a real'time operating system *0(12, "it$ associated native libraries and drivers# t$e availability of Java development tool &its and middle"are# grap$ics support# and t$e ability to put t$e application code into 01+
1nce you've selected a $ard"are and soft"are development platform# t$ere are a variety of factors to consider t$at "ill $elp you c$oose t$e best'performing Java virtual mac$ine *JV+, for your application
32
Various approac$es are available for boosting bytecode e)ecution speed ($ey include using a <ust'in'time *J/(, compiler# an a$ead'of'time compiler# or a dynamic adaptive compiler= putting t$e Java application code into 01+ *701+i6ing7 it,= re"riting t$e JV+'s bytecode interpretation loop in assembly language= and using a Java $ard"are accelerator
Consider Compilers
%ou can impliment grap$ics above t$e $ard"are level "it$ Java's $eavy "eig$t grap$ical tool &it *left, or t$e lig$t"eig$t version *rig$t, ($e lig$t"eig$t version runs faster and $as a smaller memory footprint# but "riting an implementaion is $arder and slo"er
J/( compilers# "$ic$ compile bytecode on t$e fly during e)ecution# generally aren't suitable for embedded applications# t$oug$ ($ey produce e)cellent performance improvements in des&top Java applications but typically require 1> to ;2 +? of 0.+ in addition to t$e application's requirements ($e large memory requirement places J/( compilers out of reac$ for many categories of embedded applications
.$ead'of'time compilers rival J/( compilers in increasing Java e)ecution speed @nli&e J/( compilers# t$ey're used before t$e application is loaded onto t$e target device# as t$eir name indicates ($at eliminates t$e need for e)tra 0.+# but it creates t$e need for more 01+ or flas$ memory *t$at is# storage static memory,# because compiled mac$ine code requires four to five times t$e memory of Java bytecode 3ompiling a$ead of time tends to undermine one of t$e great benefits of t$e Java platform because a measure of dynamic e)tensibility can be lost# since it may not be possible to do"nload ne" versions of compiled classes .dditionally# any dynamically loaded code# li&e an applet# "on't benefit from a$ead'of'time compilation and "ill e)ecute more slo"ly t$an resident compiled code
Profiling Java code# alt$oug$ some"$at comple)# can $elp minimi6e code e)pansion "$en you're using an a$ead'of' time compiler . good goal is to compile only t$at 20 percent of t$e Java classes in "$ic$ t$e application spends 80 percent or more of its time
9ynamic adaptive compilers offer a good compromise bet"een J/( and a$ead'of'time compilers *see (able 1, ($ey're similar to J/( compilers in t$at t$ey translate bytecode into mac$ine code on t$e fly 9ynamic adaptive compilers# $o"ever# perform statistical analysis on t$e application code to determine "$ere t$e code merits compiling and "$ere it's better to let t$e JV+ interpret t$e bytecode ($e memory used by t$is type of compiler is user'configurable# so you can evaluate t$e trade'off bet"een memory and speed and decide $o" muc$ memory to allocate to t$e compiler
33
Placing t$e bytecode into 01+ can contribute to faster application performance /t doesn't ma&e t$e code run faster /t does# $o"ever# translate t$e code into a format t$at t$e JV+ can e)ecute directly from 01+# causing t$e code to load faster by eliminating class loading and code verification# tas&s normally performed by t$e JV+
.not$er "ay to speed up bytecode e)ecution "it$out using a$ead'of'time or dynamic compilation tec$niques is to re"rite t$e bytecode interpreter in t$e JV+ ?ecause t$e interpreter is a large 3 program# you can ma&e it run faster by re"riting it in assembly language
Java $ard"are accelerators# or Java c$ips# are t$e ultimate option for speeding up code e)ecution ($ey're emerging in t"o fundamental configurations 3$ips of t$e first type# suc$ as 3$icory 2ystems' !ot2$ot and Aa6omi 3ommunications' J2(.0# operate as Java coprocessors in con<unction "it$ a general'purpose microprocessor# in muc$ t$e same "ay t$at grap$ics accelerators are used Java c$ips in t$e ot$er category# li&e Patriot 2cientific's P231000 and aJile's aJ'100# replace t$e general'purpose 3P@
3learly# t$e latter are limited to applications t$at can be "ritten entirely in Java .s for t$e first type# adding components of course raises costs# so t$is type offers a viable option only "$en t$e cost is acceptable /ndeed# t$e price of Java c$ips $as been $ig$ because of relatively lo" production volumes . $ig$'volume solution# $o"ever# may be fort$coming in t$e form of t$e .0+:B0 general processor "it$ an integrated Java accelerator# called Ja6elle
Memory Requirements
($e Prec$elt study determined t$at t$e average memory requirement of a program "ritten in Java is t"o to t$ree times greater t$an for one "ritten in 3/344 8ven t$e compact nature of bytecode# usually about 50 percent smaller t$an compiled 3/344 mac$ine code# can't offset t$at over$ead 0ecogni6ing t$at trying to drop Java in its original# des&top'oriented form into embedded systems "on't "or&# 2un +icrosystems# Java's originator# too& t$e language t$roug$ several evolutionary steps in an effort to tailor it to t$e embedded environment (oday# t$e Java 2 Platform# +icro 8dition *J2+8,# represents t$e latest# most evolved# and slimmest version of Java for t$e embedded space
34
2electing a $ig$ly scalable operating system and 3 run'time pac&age allo"s you to tune t$ese soft"are components for optimal memory efficiency 2caling 2$are some of t$e tec$niques t$at you use in designing embedded Java t$e Java environment can be comple)# $o"ever systems Post your omments @sually# a t"o'stage process is involved Cirst# you can use t$e command line verbose option# <ava 'v# to see t$e classes an application uses and t$en manually e)tract t$e needed libraries and classes /f t$is process doesn't save sufficient space# you can use filtering tools# li&e JavaCilter from 2un's 8mbeddedJava platform
/f you're using Java# you s$ould e)pect to increase memory and 3P@ resources compared "it$ using 3/344 *see (able 2,
8mbedded JV+s are $ig$ly user'configurable to matc$ different embedded system requirements# but "$ic$ embedded JV+ s$ould you useD Java benc$mar&s are meant to $elp you evaluate JV+s and Java performance# but you need to be careful about "$ic$ ones you use and about t$e conclusions you dra" from t$em . good benc$mar& score for a particular JV+ doesn't necessarily mean t$at using it "ill ma&e your application go faster
3onsequently# before evaluating a JV+# you $ave to evaluate any benc$mar& to determine $o" meaningful it may be to your application# ta&ing into account t$e "$ole Java environment t$at's associated "it$ it 2ome benc$mar&s are very application'specific *a c$at server benc$mar& li&e Volano+ar&# for instance, and may not apply to t$e &ind of Java applications you're developing .dditionally# because JV+ vendors commonly optimi6e t$eir products to ac$ieve good benc$mar& scores# t$e scores can be misleading about $o" muc$ a given JV+ "ill improve t$e performance of your particular application 3onversely# if your application $as specific problems in certain areas# an environment t$at's optimi6ed to improve general processing "on't solve t$ose specific processing problems
35
2orting t$roug$ Java benc$mar&s to find t$e ones t$at are relevant for embedded applications can be confusing 2pecJV+:8# for e)ample# provides a relatively complete set of benc$mar&s t$at test diverse aspects of t$e JV+ 2ounds good '' but 2pec'JV+':8 runs in a client/server environment and requires a minimum of B8 +? of 0.+ on t$e client side for t$e JV+ ($at e)cludes it from any relevance to most embedded applications /n addition# it can't be used "it$ precompiled classes
1t$er benc$mar&s $ave different pitfalls Volano+ar&# for e)ample# is a c$at server implementation and is t$erefore relevant only for benc$mar&ing applications "it$ t$e same set of requirements as c$at servers ($e J+ar& benc$mar& assumes t$at t$e application includes t$e applet vie"er and a full implementation of Java's .bstract -indo"ing (ool&it *.-(, ($is benc$mar& can be irrelevant for t$e many embedded applications t$at $ave no grap$ics or $ave limited grap$ics t$at don't require full .-( support# suc$ as devices running a PersonalJava minimal'.-( implementation
8mbedded 3affeine+ar& *83+,# t$e embedded version of t$e 3affeine+ar& benc$mar& from Pendragon 2oft"are *it $as no grap$ics tests,# is easy to run on any embedded JV+# since it requires support for basic Java core classes only# and it doesn't require a large amount of memory +ore importantly# t$ere's a $ig$ correlation bet"een good scores on t$is benc$mar& and improved bytecode performance in embedded applications
(o get t$e most meaningful results from 83+# you must use e)actly t$e same $ard"are "$en testing different JV+s %ou must also pay attention to implementation differences among t$e JV+s you're testing /f# for e)ample# you're comparing a JV+ "it$ a J/( compiler against a JV+ "it$out one# it's important to run t$e JV+ t$at $as t$e J/( "it$ t$e <ava
83+ "ill typically ma&e any JV+ using compilation loo& good# no matter t$e type of compilation# because it includes a very small set of classes and al"ays repeats t$e same small set of instructions 9ynamic compilers <ust cac$e t$e complete translation of t$e Java code in 0.+ and e)ecute ne)t iterations of t$e tests in native code .$ead'of'time compilers can easily optimi6e t$e loops and algorit$ms used in 83+# too
.lt$oug$ t$e industry abounds "it$ ot$er Java benc$mar&s# li&e Java Frande# 2ci+ar&# <?%(8mar&# 9$rystone benc$mar& in Java# and @329 ?enc$mar&s for Java# t$ere is no 7ultimate7 benc$mar& t$at can give you certainty about Java and JV+ performance in embedded applications ($e best strategy is to identify a suite of benc$mar&s t$at seem most relevant to your application and use t$e combined results of t$ose benc$mar&s to $elp predict Java performance in a particular system environment
Curt$ermore# t$e e)isting benc$mar&s may not measure ot$er aspects of your application code (uning Java applications to meet performance goals may require addressing many program functions besides bytecode e)ecution 2ome of t$ose functions '' for e)ample# t$read management# sync$roni6ation# met$od'to'met$od calls# class resolution# ob<ect allocation and $eap management *including garbage collection,# calls to native met$ods# bytecode verification# and e)ception $andling '' occur "it$in t$e JV+ ?ecause fe" if any benc$mar&s address suc$ functions# it falls to you to conduct an in'dept$ study of a JV+'s internals to understand $o" its design may affect crucial aspects of your application -riting special programs t$at e)ercise critical aspects of a JV+ can $elp you evaluate it for t$e application /f# for e)ample# your application uses a $eavy mi) of Java and 3 code# you can benefit by "riting a program t$at tests native met$od call performance 1t$er functions# including native code e)ecution and suc$ factors as net"or& latency# may occur outside t$e JV+
"raphi s Performan e
-$at if your application includes grap$icsD (o start# t$ere are t"o ma<or factors t$at affect grap$ics performance in Java applicationsE 9oes t$e application's grap$ics display driver use grap$ics coprocessor $ard"are accelerationD /s t$e application configured "it$ a lig$t"eig$t *faster, or a $eavy"eig$t *slo"er, implementation of t$e .bstract -indo"ing (ool&itD *2ee t$e figure , /n addition# li&e any ot$er $ig$'level Java service# grap$ics performance is affected by t$e "ay t$at t$e grap$ics services integrate "it$ lo"er'level native libraries
36
Real#$orld Performan e
Cinally# you need to consider t$e performance of your 3P@ (o $elp you identify 3P@'bound performance# you s$ould supplement simple benc$mar&s by running real'"orld applications t$at e)ercise large amounts of different# comple) Java code 2uc$ test code must meet a number of requirementsE /t s$ould contain a large number of classes t$at reflect an estimate of t$e real application *20'plus is a good ballpar&, /t must also be large *t$ousands of lines# at least, and $ave no file system access and no grap$ics 2ome e)isting programs meet all t$ose criteria ($e FA@ regular e)pression pac&age# rege)p# for e)ample# comprises about ;#000 lines of code and more t$an 21 classes# providing a large number of e)pressions to parse and matc$ .not$er program# t$e ?ean 2$ell interpreter# is a simple prime number sieve t$at $as G0 classes and several t$ousand lines of code Java3ode3ompact# 2un's PersonalJava 01+i6ing tool# also "ould ma&e a good test program
($e result of running t$ese programs as test cases illustrates t$e "ide variance in t$e meaning of benc$mar& scores Cor e)ample# a JV+ using a J/( compiler may run 8mbedded 3affeine+ar& up to ;0 times faster t$an "$en t$e no<it option is turned on *t$us running in pure interpretation mode,# but t$e same JV+ runs t$e ?ean 2$ell and rege)p tests only about one and a $alf times faster "$en using t$e J/( compiler *($e apparently impressive t$irtyfold speedup on a simple benc$mar& li&e 8mbedded 3affeine+ar& is ac$ieved t$roug$ cac$ing tec$niques t$at t$e compiler uses on t$e small amount of code and classes in 83+ , ($e difference in results clearly demonstrates t$at $ig$ benc$mar& scores may not translate into a commensurate level of performance improvement in real'"orld applications
.ctually# 2pecJV+:8 and J+ar& yield results t$at most closely appro)imate t$ose for real'"orld applications ($ey do suffer# t$oug$# from t$e limitations discussed above /n particular# t$e usefulness of t$e former in t$e embedded space depends greatly on your ability to overcome t$e problems associated "it$ your test infrastructure requirements
33