SKI HOW TO
INTRODUCTION
ski is a simulator for the
IA-64 architecture. It has several versions:
- xski, which works with X Windows (Motif only, and not built by default)
- ski, which works with curses inside of a terminal window
- bski, which works in batch mode
All three versions use common code and, in fact, a common binary.
Normally, the three binaries are linked together and the name used to invoke it
determines which interface to use. For a copy of the user manual, see the file ski-manual-v1.0.pdf in /usr/share/doc/ski.
The original ski was written for HP-UX by HP R&D personnel.
It was ported to Linux by David Mosberger of HP Labs. Dan Magenheimer of HP Labs added significant functionality.
NEW FEATURES IN SKI
Following is a list of features in ski added in September 2001:
- Multiple symbol tables may be simultaneously loaded.
- Symbol names are not truncated in the program window if the window is wide
enough.
- The "-sock nnnn" command line option will cause ski to
link to another program (e.g., spk_console) via a socket
instead of launching a console of its own.
- The "bsl <rid> <vaddr>" command will set a
breakpoint at an 85-bit address.
- Nested interrupts are now flagged. If the psr.ic bit is off when an
interruption is taken, the simulation will be stopped (prior to the
branch to the ivt) and an informative message is printed. This feature
can be turned off/on by setting the $nest$ internal variable (e.g. the
"= $nest$ 0" turns it off). The default is on.
- Source lines in the program window are now highlighted to make it easier
to visually distinguish/ignore them. This feature is controlled
by the $srcemph$ internal variable. If set to 0, the feature is turned
off. If set to 1, source lines are underlined. If set to 2,
inverted video is used.
- The "Step" command (which can be abbreviated to "S")
is a poor-man's version of "step over". It will step until
the ip is pointing at the next bundle after the current one. This
works great for "stepping over" function calls. However, if
you "Step" over a bundle that contains an unconditional branch, it
is essentially the same as a "continue"... it's not smart enough
to parse the instruction bundle.
- The "Up" command attempts to step until the current routine
returns to its caller. It does this by taking the value of the b0
register at the time you invoke the "Up" command and stepping
until ip is pointing to this address. The "Up" command can
also take an argument (register or expression-with-no-spaces), so if b0 has
been squirreled away in r42 while making another call, use the command
"Up r42". Judicious use of "step",
"Step", and "Up" will cover most of your stepping needs,
but if you are inclined to just repeatedly hitting "Step", your
mileage may vary.
- The "cmdhist" command will give you a history of the last 20 or
so commands. The "cmdrep n" command (where n
is a number printed next to a command by "cmdhist") will repeat
that command. The $cmdhist$ internal symbol will adjust the length of
the history list but this isn't implemented yet and may not be unless there
is sufficient demand.
- The curses version (ski) now properly handles source lines that contain
CR-LF (because they were written in Windows). Interestingly, curses
interprets CR (aka '\r') as a line delete character so, prior to this fix,
ski was showing these lines as blank lines.
- Poor man's symbol completion. If you type the first few characters
of a symbol, you can now avoid the annoying "Illegal expression"
message. By default, ski will now do an exhaustive symbol table
search to try to match a symbol that has what you typed as a prefix.
If there is more than one, the first one (essentially a random one) will be
chosen. To match only if there is exactly one symbol that matches (and
get the dreaded "Illegal expression" message otherwise), set the $symcompl$
variable to 1. To turn this feature off entirely, set it to 0.
To go back to the default, set it to 2.
- Shorthand for long addresses. To type an address where the top three
bits in the address (the ones that select the region register) are non-zero
used to take a lot of counting and typing of zeroes. Now the first
character of a long address followed by a single-quote and the rest of the
address will set the high nibble and save all of those zeroes. So
instead of typing e000000000001234, just type e'1234.
Following is a list of features in ski between October 2001 and
February 2003:
- New command line options to initialize various
implementation-specific options (e.g., number of TLB entries) appropriately.
- "step until privilege level = n" command (e.g. "supl
2" steps until psr.cpl = 2)
- "symload" command loads symbols from a binary
- "show TLB line" (sdtl/sitl) commands show a single TLB entry
that matches a virtual address
- New command line option (-mi xx) to initialize memory to a non-zero
value.
- New command line option to change the size of the TLB
- The "U" command (previously called "Up", but a better
name is "Until") now takes two arguments and instructions execute
until ip is in the range specified. (Works great for catching the next
time an exception causes code in the ivt to execute.)
- New "dr" command to show the dirty registers. The
"rd" (register dump) command now also dumps the dirty registers.
- New "step until memory matches" (summ) command executes until a
physical memory location changes.
- Labels (syntax: ":label") now work in a command files, which
means goto's now work, which means command files are now useful for
complicated tests/programs.
- New "linuxatpp" command dumps out Linux virtual memory
structures. (Only works on native IA-64 when simulating Linux/ia64.)
- New "evaltofile" command which, when used in a loop in a command
file, allows easy data collection.
- MP support via shared memory. (Not yet complete and only works on
Linux as of now.)
OTHER USEFUL TIPS AND TRICKS
-
Backspace doesn't work in some versions of ski
when running on Linux. To fix this, first make sure you have the Linux
version of the XSki app-defaults file in your home directory.
You have the Linux version if there is a line near the end of the
file which says:
*defaultVirtualBindings:
\
Add the following line, immediately after this line.
Ensure you use the exact capitalization and punctuation:
osfBackSpace:
<Key>BackSpace\n\
- Use the eval command to see the value of a symbol or expression. E.g.
"eval f0f0+e<<3c". Note that no spaces are allowed,
else the parser gets screwed up.
- The * character adds a level of indirection just as in C. E.g. "= r13
*r14" will use r14 as an address of an eight-byte pointer and assign
this to r13.
- The ; character can be used to separate commands. This is especially
useful if you are repeating multiple commands, e.g. "s 100; sit"
is a quick way to step 100 times, then look at the instruction tlb. Then to
repeat, just hit Enter.
- The SKI_USE_FAKE_XTERM environment variable has been added.
If this environment variable is set (the value is unimportant),
the ski-fake-xterm utility will be used for output to stdout,
instead of xterm. This will result in a temporary file created
in the current working directory with a name of the form "ski.XXXXXX",
where "XXXXXX" can be any six characters.