SIMULATOR

This addendum contains the following sections:

Introduction
Executable Name
Supported Features
Mapping Memory
State Counter
Coverage
Interrupt Simulation
Peripheral Support
Restrictions

1 Introduction

This addendum contains information specific to the simulator version of CrossView Pro for the XA.

2 Executable Name

The following CrossView Pro executable is delivered with the package (for PC with .exe extension):

    xfwxa CrossView Pro Debugger Simulator.

3 Supported Features

Except for the restrictions mentioned in the next section, the simulator version of the debugger cleanly supports all the standard features of CrossView Pro, including single stepping, code breakpoints, data breakpoints, trace support, C expression evaluation, code and data coverage and record/playback capability. With respect to setting breakpoints the simulator version of the debugger is capable of supporting all breakpoint types, including separate data-read and data-write breakpoints. Each of these breakpoints can be placed on any of the memory addresses.

All instructions listed in the Appendix XA Instruction Set Table of the XA Cross-Assembler User's Guide are supported. The granularity for timing measurements is one instruction state.

Because this is a simulator version, you do not have to setup a serial communication at startup, as with an emulator.

3.1 Mapping Memory

When locating your application on a UNIX host, you specify a so-called locator description file. The default file used is etc/xa.dsc, which includes a CPU description file (etc/xa.cpu) and a memory description file (etc/xa.mem). This way the locator knows how much target memory is available and how it is mapped.

The simulator version of the debugger uses the same locator description file (thus etc/xa.cpu and etc/xa.mem) to determine how much memory must be allocated from the system and how logical addresses are mapped to physical addresses. So, all the memory mappings of your application are automatically done by the simulator! Please note, that you therefore should use the same locator description file during debugging as you used to locate your application. If you have used another locator description file during locating than the one located in the etc directory, you must use the CrossView Pro -dsc option to specify the description file.

You can also specify the locator description file through the CrossView Startup dialog.

When you use EDE, you can make all memory selections in the Memory tab of the Linker/Locator Options menu item.

3.2 State Counter

In addition to the standard features of CrossView Pro, the simulator version executes the XA instruction set and can perform state counting. For this purpose the simulator has a state counter, which can be monitored. The first one is the regular 'state counter', this counter can be monitored in the register window where it is shown as 'SCNT' and it can also be accessed through the register $scnt.

3.3 Coverage

The simulator traces all memory access performed during program execution. This feature can be switched on or off. If you are not interested in coverage information you should turn off this feature because gathering coverage data will slow down the execution speed of the simulator. The simulator differentiates between data read, data write and instruction fetch. CrossView Pro shows the gathered coverage data through various windows and dialogs.

3.4 Interrupt Simulation

The execution engine handles all interrupts defined in the XA data handbook. Nested interrupts are allowed and are serviced using the priority scheme described in the data handbook. This implies that you should configure the interrupt related special function registers if your program deals with interrupts.

Exception interrupts like breakpoint, trace, stack overflow, divide by zero, user RETI, NMI, and reset are serviced. However, it is not possible to trigger the external signals that cause a NMI through the CrossView Pro user interface. Since exception interrupts are by definition not maskable, they must always be serviced immediately, regardless of the priority level of the currently executing code, as defined by the IM bits in the PSW.

Event interrupts are typically related to on-chip or off-chip peripheral devices and interrupt input pins. Events interrupts may be globally disabled/enabled via the EA bit in the IE register and individually masked by specific bits in the IE register. The interrupt priorities are defined by the values in the IPAx registers. It is not possible to trigger external interrupt pins through the CrossView Pro user interface. Reading and writing to the Peripheral SFRs related to parallel ports, timers, and UARTs are not fully simulated in the simulator. However, the following SFRs addresses and bits in XA_G3 are related to interrupts, an interrupt is triggered when the value one is written to an sfrbit.

Bit:    7   6   5   4   3   2   1   0
    -------------------------------
420H(S0CON):  X   X   X   X   X   X  TI0 RI0 
424H(S1CON):  X   X   X   X   X   X  TI1 RI1  
418H(T2CON):  TF2 X   X   X   X   X   X   X   
410H(TCON):  TF1 X  TF0  X  IE1  X  IE0  X   

Software interrupts are serviced immediately after finishing the instruction that writes to the SWR special function register, i.e. the SFR bus does not introduce a delay. Use special function registers SWE (software interrupt enable) and SWR (software interrupt request) to trigger and handle software interrupts.

Trap interrupts are serviced immediately after finishing the trap instruction.

3.5 Peripheral Support

The simulator has been extended with support for 3 timers. Implementation of these timers is conform the implementation on the real XA-G3. All modes including the enhanced mode 0 have been implemented. Using the timers in the simulator does not require any additional programming. A program using timers that runs on a real processor should run the same way on the simulator. This includes the handling of interrupts on timer overflows.

4 Restrictions

Facilities for background mode are absent in the simulator version of CrossView Pro. As a consequence, the CrossView Pro commands CB, st, u, and wt for background mode, are not available. Because the debugger and the simulator have been integrated into one executable program, the >& command to record target communication and the o command for transparency mode are not available. Virtual I/O is not supported. Also, the simulator version of the debugger does not support command line function calling.


Copyright © 2000 TASKING, Inc.