30.01.2013 Views

TotalView Users Guide - CI Wiki

TotalView Users Guide - CI Wiki

TotalView Users Guide - CI Wiki

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

Figure 103: Register Union<br />

Debugging IBM Cell Broadband Engine Programs<br />

When you exit from your program or when you manually save breakpoints,<br />

<strong>TotalView</strong> writes breakpoints for each SPU thread share group. The next<br />

time your program loads an SPU executable into an SPU context, these<br />

breakpoints are read back in.<br />

Within the CLI your focus determines if the breakpoint is shared on<br />

unshared. For example::<br />

Focus Type of Breakpoint<br />

dfocus t 1.-1 dbreakpoint main Unshared breakpoint<br />

dfocus p 1.-1 dbreakpoint main Unshared breakpoint<br />

dfocus d 1.-1 dbreakpoint main Shared breakpoint<br />

dfocus g 1.-1 dbreakpoint main Shared breakpoint<br />

Registers, Unions, and Casting<br />

SPU registers are 128-bits wide. In most cases, you'll be loading data into<br />

the registers in different ways. For example, you might be using the SPU as<br />

a vector processor and be loading 4 32-bit values into a register.<br />

<strong>TotalView</strong> defines a union that helps you see this data in seven different<br />

ways, as is shown in the following figure.<br />

This picture shows how <strong>TotalView</strong> displays register R0. <strong>TotalView</strong> defines<br />

the data type of this register as union $spu_vec128. If you dive (doubleclick)<br />

on a member in the union, <strong>TotalView</strong> shows the contents of the register<br />

as if they were defined in this way. For example, diving in v4_float tells<br />

<strong>TotalView</strong> to display this information as an array of four floating point numbers.<br />

After diving on a union member, the displayed values can be edited and<br />

stored back into memory.<br />

If this union doesn't describe your data, you can tell the <strong>TotalView</strong> to display<br />

it in the way you want by altering the information in this window's Type<br />

field. However, casting the value into a data type smaller than 128-bits<br />

pulls the value from the preferred slot of the register that is appropriate for<br />

the type’s size.<br />

<strong>TotalView</strong> Reference <strong>Guide</strong>: version 8.7 143

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!