Gamasutra - Feature - "Programming the Cell Broadband Engine"
It's free to join Gamasutra!|Have a question? Want to know who runs this site? Here you go.|Targeting the game development market with your product or service? Get info on advertising here.||For altering your contact information or changing email subscription preferences.
Registered members can log in here.Back to the home page.

Search articles, jobs, buyers guide, and more.

By Alex Chunghen Chow
[Author's Bio]

Gamasutra
July 21, 2006

Programming the Cell Broadband Engine

Introduction
The Role of a Symbol
Inter-Architectural
CESOF Linkable
CESOF Example
Conclusion

 


Change Login/Pwd
Post A Job
Post A Project
Post Resume
Post An Event
Post A Contractor
Post A Product
Write An Article
Get In Art Gallery
Submit News

 


 


Latest Letters to the Editor:
Perpetual Layoffs by Alexander Brandon [09.21.2007]

Casual friendliness in MMO's by Colby Poulson [09.20.2007]

Scrum deals and 'What is Scrum?' by Tom Plunket [08.29.2007]


[Submit Letter]

[View All...]
  


Features

Programming the Cell Broadband Engine

Structure of CESOF Linkable

By representing logical dependencies with the use of PPE symbols, the PPE linker can resolve the symbol dependencies and bind the references for the programmer.

CESOF defines how a programmer can wrap an SPE executable into a PPE linkable with the additional PPE symbols representing the inter-architectural dependency. In order to allow the PPE linker to handle such objects, CESOF must be compatible with the existing Tool Interface Standard (TIS) Executable and Linking Format (ELF) Specification for PPE architecture. Thus, once wrapped, the new linkable is the same as any other PPE linkables that the PPE linker can properly link into a CBE executable image.

Figures 5 and 6 illustrate how the CESOF linkable allows an embedded SPE executable to participate in the PPE linking process, and, subsequently, piggyback on the loading process of the entire CBE executable image into the effective-address memory.

In Figure 5, a tool called embedspu wraps an SPE executable file into a CESOF linkable file. The CESOF file contains the image of the original SPE executable plus additional PPE symbol information representing the two types of inter-architectural interactions previously discussed.

The CESOF linkable, which is itself a PPE linkable, can now be linked with other PPE linkables to form a PPE executable as shown in Figure 6. The PPE executable image contains not only the PPE code modules but also the embedded SPE executable image. I'll call a PPE executable with embedded SPE executable images a CBE executable. The PPE loader can load the CBE executable including the embedded SPE executable image(s) just like any other PPE executable into the effective-address space. From there, an SPE loader can load the SPE executable image into the target local store.

Elements in a CESOF Linkable

A CESOF file is an ELF file targeted for PPE architecture and is itself a PPE linkable. It uses several ELF sections to include the embedded SPE executable image with additional PPE symbol information.

Figure 7 shows the structure of a CESOF linkable, including the three CESOF elements created by embedspu.

 

1. Embedded SPE ELF image: A special section called .spe.elf contains a whole copy of the SPE ELF image (an executable image) that can be loaded by an SPE loader into an SPE local store for execution. This SPE ELF image is generated by the SPE linker. The embedspu utility creates a PPE symbol to represent this .spe.elf section. This part represents the first type of inter-architectural interaction previously mentioned.

Because the SPE executable image might be shared by several CBE applications running on the same machine, this section is marked read-only and, if shared, the operating system should keep only one copy of the CESOF linkable image in the system memory.

2. Shadow SPE toe area: CESOF uses this shadow area to represent the second type of interaction. Because the effective-address symbols are not applicable to the SPE programming space, instead of using a real effective-address symbol in the SPE code, the SPE programmer declares a special structure variable to hold a 64-bit effective-address value. Recall that such a variable is called an effective-address reference (EAR). These EARs are collected in a special section named .toe (table of EARs) section. When the SPE linkables are eventually linked into an SPE executable image, all .toe sections are tiled into the TOE segment of an SPE executable.

The Shadow SPE toe area is a space mirroring the TOE segment of the embedded SPE executable. For each EAR in the TOE segment, embedspu creates a matching PPE symbol reference in the shadow area. The PPE linker resolves and binds these PPE symbol references in the shadow area when the CESOF linkable is linked with the other PPE linkables.

To execute the embedded SPE executable image, the SPE loader first loads the SPE executable image into the local store. Then, it copies the resolved shadow area into the local store over the SPE TOE segment. This copy operation effectively binds all the EARs in the SPE program with the matching effective-address values.

Different processes may have different effective-address mappings for the same effective-address symbol. The shadow area must be included in a .data section that each process has that's not shared with other processes. The linker should not bind the values directly into an SPE executable image because the same image is shared by different processes running on the same system.

3. SPE program handle: CESOF provides a run-time data structure to keep the related CESOF information together. This data structure contains two pointers. One points to the section containing the embedded SPE executable image and the other points to the shadow area. These two pointer values are only resolved when the PPE linker links the CESOF linkable into the final executable image.

The embedspu tool also defines a symbol for this handle structure. The programmer can pass the handle to the SPE loader that will need the embedded SPE program image and the shadow area with the resolved EAR values.

Next: CESOF Programming Example

 


join | contact us | advertise | write | my profile
news | features | companies | jobs | resumes | education | product guide | projects | store



Copyright © 2005 CMP Media LLC

privacy policy
| terms of service