Dynamic Binary Translation Delivers Program Portability

Dec. 3, 2001
Program portability is coming to an embedded processor near you, courtesy of Transitive Technologies' dynamic binary translation software, Dynamite. This San Diego company has demonstrated Dynamite x86 application code on a MIPS processor. The...

Program portability is coming to an embedded processor near you, courtesy of Transitive Technologies' dynamic binary translation software, Dynamite. This San Diego company has demonstrated Dynamite x86 application code on a MIPS processor. The technology will be available in 2002, including support for most source and host processor architectures.

Dynamic binary translation is promising because it lets designers transition applications to new environments and faster processors. It also can preserve investments in existing code. Product delivery times can be shortened by enabling existing applications to be used on new platforms. These applications may be recoded for the new platform if warranted, but Dynamite would permit more time for this to occur. Also, Dynamite is useful where application source code is not available.

Dynamite takes an incremental approach similar to that used by Transmeta with its Cruso line of x86 processors. There are a number of significant differences, though. First, Dynamite doesn't require a custom very-long-instruction-word (VLIW) processor. Second, Transmeta's translation is a one-step process, while Transitive uses a two-step process. Third, Dynamite allows individual applications to run on a host processor in conjunction with native applications, whereas Cruso completely hides the underlying VLIW architecture from even the operating system. Finally, Transitive is targeting a range of source and host processor architectures, not just one set.

The Dynamite software actually targets a different environment than Cruso. While Cruso is an x86-compatible processor, Dynamite permits a foreign application or operating system to run on the host processor in addition to native applications and operating systems. This lets existing applications run on new embedded systems.

Dynamite starts first when a foreign application is run on a host processor. It creates two caches (see the figure): one for intermediate code blocks, and one for executable code blocks. Blocks are sequential collections of source instructions that end in a jump. These are translated to an intermediate code block that is placed in the first cache as the application begins to run. The intermediate code is then translated to native host code and placed in the second cache, where application execution actually occurs.

Dynamite uses the same intermediate code on all platforms. This allows the same front-end translator for a particular source architecture to be used on any platform. Likewise, a single native code translator is needed for a particular host platform. Dynamite applies conventional compiler optimizations to the front- and back-end translations.

Dynamite monitors block execution patterns and frequency so it can identify a group of blocks that would benefit from additional optimizations. It then assigns these blocks to a background task that takes the intermediate code blocks and generates a new optimized code block. In theory and in practice, the new block executes faster.

Then, Dynamite adjusts its configuration to use the new block and frees the old blocks in both caches. The application is only interrupted during the transition from using the old and new code. The intermediate cache eliminates the need to regenerate intermediate code for subsequent optimizations.

Blocks are also removed from the cache when the cache is full and a new block must be executed. The least recently used blocks are removed to make room for the new block. Blocks are actually removed in pairs, one from each cache, since an intermediate code block is always needed for an executable code block should subsequent optimizations be required.

Typically, Dynamite performs translation on demand. But it is possible to do some of this work before an application is started. This minimizes startup latency and is important for real-time embedded applications.

Application-code translation is just part of the job. The other part is providing an interface between the source and the host services. For example, an application normally needs access to a file system or network interface that is normally provided by the operating system that runs the application. Transitive's FUSE (flexible user system environment) technology makes this happen. Transitive has FUSE definitions for Linux, and developers can write new definitions for other environments.

Transitive is taking a number of different approaches to incorporating Dynamite into an embedded environment. One way is to make Dynamite part of the host services and identify foreign applications that Dynamite must process. Another alternative is to encapsulate Dynamite in a host executable file that also includes the desired foreign application.

More information about Dynamite can be found at www.transitives.com.

About the Author

William G. Wong | Senior Content Director - Electronic Design and Microwaves & RF

I am Editor of Electronic Design focusing on embedded, software, and systems. As Senior Content Director, I also manage Microwaves & RF and I work with a great team of editors to provide engineers, programmers, developers and technical managers with interesting and useful articles and videos on a regular basis. Check out our free newsletters to see the latest content.

You can send press releases for new products for possible coverage on the website. I am also interested in receiving contributed articles for publishing on our website. Use our template and send to me along with a signed release form. 

Check out my blog, AltEmbedded on Electronic Design, as well as his latest articles on this site that are listed below. 

You can visit my social media via these links:

I earned a Bachelor of Electrical Engineering at the Georgia Institute of Technology and a Masters in Computer Science from Rutgers University. I still do a bit of programming using everything from C and C++ to Rust and Ada/SPARK. I do a bit of PHP programming for Drupal websites. I have posted a few Drupal modules.  

I still get a hand on software and electronic hardware. Some of this can be found on our Kit Close-Up video series. You can also see me on many of our TechXchange Talk videos. I am interested in a range of projects from robotics to artificial intelligence. 

Sponsored Recommendations

Comments

To join the conversation, and become an exclusive member of Electronic Design, create an account today!