[ < ] [ > ]   [ << ] [ Up ] [ >> ]         [Top] [Contents] [Index] [ ? ]

4. Display Coprocesses

This chapter documents the protocol that simulavr uses to pass register and memory information to a display coprocess.

A display coprocess is a separate program started by simulavr for the sole purpose of displaying register and memory information while an AVR program is running in the simulator. Using a separate program and a standardized communication protocol, keeps the simulavr code simpler and allows for a variety of display programs to be used.

When the user asks simulavr to display register and memory information during execution, simulavr will start a coprocess to perform the display work. A pipe will be opened in simulavr into which the data will be written using the following commands:

q

Quit.

r<reg>:<val>

Set register to val.

p<val>

Set program counter to val.

i<reg>:<val>

Set io register to val.

I<reg>:<name>

Set io register name.

s<addr>,<len>:XX

Set sram addrs to values (one XX pair per addr).

e<addr>,<len>:XX

Set eeprom addrs to values (one XX pair per addr).

f<addr>,<len>:XXXX

Set flash addrs to values (one XXXX quad per addr).

n<clock_ticks>

Update the number of clock ticks.

All values are hexidecimal numbers, except for <name> which is a string.

In order for the display process to know which pipe to read the information, it must handle either the ‘--pfd <fd>’ option or check the SIM_PIPE_FD enviroment variable. The value passed using either method will be the file descriptor number of the pipe from which the display prgram will read the informtion.

Simulavr will start all display programs like so (sizes are decimal numbers of bytes and sram_start is just the decimal address of the first byte of sram, usually 0x60 [96] or 0x100 [256]):

<prog> --pfd <fd> <flash_size> <sram_size> <sram_start> <eeprom_size>

The user can specify the display program to use via the ‘--disp-prog’ option to simulavr or using the SIM_DISP_PROG environment variable. If both are not specified, then no display will be used.


[ < ] [ > ]   [ << ] [ Up ] [ >> ]

This document was generated by eweddington on November, 7 2008 using texi2html 1.78.