Chapter 2 User Interface


The BSVC graphical user interface provides friendly access to the otherwise character-based simulators developed using the BSVC simulation framework. This chapter discusses the various features of the user interface.


Invoking BSVC

If you are using Unix the BSVC user interface is invoked by typing the following command:

bsvc

If you are using Windows then you should select BSVC from the Start menu. Once invoked, the BSVC user interface should appear as shown in Figure 2-1. At this point the only options available are the drop down menus. These menus and other features of the user interface are discussed in the following sections of this chapter.

Undisplayed Graphic

FIGURE 2-1 BSVC User Interface at Start-Up


File Menu

This menu allows you to create a new setup, open an existing setup, save the current setup, load a program, and quit BSVC. A simulator setup consists of a simulator and a list of devices attached to the simulator. Once BSVC is invoked the first step is to load an existing setup or create a new setup.

Undisplayed Graphic

Creating a New Setup Opening an Existing Setup Saving a Setup Loading a Program Quitting BSVC
Edit Menu

This menu allows you to modify the simulator's device setup by attaching or detaching devices.

Undisplayed Graphic

Editing the Device Setup
Device Management

Whenever a setup is created or edited the dialog in Figure 2-2 is displayed. Using this dialog devices can be attached and detached from the simulator.

Undisplayed Graphic

FIGURE 2-2 Device Setup Dialog

Attaching a Device Detaching a Device

Undisplayed Graphic

FIGURE 2-3 Ram Setup Dialog

Detaching all Devices
Window Menu

In addition to the main BSVC window that appears upon executing BSVC there are two other windows that are very useful. This menu allows you to open the memory viewer and the program listing windows.

Undisplayed Graphic

Viewing the Simulator's Memory Source Level Debugging
Memory Viewer

After the "Memory Viewer" option from the "Window" menu has been selected the memory viewer utility will appear as shown in Figure 2-4. This utility allows the simulator's memory to be dumped to a file, altered, and viewed.

Undisplayed Graphic

FIGURE 2-4 Memory Viewer

File Menu

This menu allows you to dump memory to a file and close the memory viewer.

Undisplayed Graphic

Dumping Memory to a File Closing the Memory Viewer Edit Menu

This menu allows you to modify a single memory location or a block of memory.

Undisplayed Graphic

Changing a Memory Location

There are two ways to change a memory location. The first way is to:

The second way is to:

Filling a Memory Block View Menu

This menu allows you to specify the starting address for the memory display.

Undisplayed Graphic

Viewing from a Specified Address Viewing from the Start of Memory Viewing from the Value of a Register Scrolling through Memory

The arrow icons in the upper right hand corner of the window can be used to scroll through memory a line or a screen at a time.

The up-arrow, down-arrow, page-up and page-down keys can also be used to scroll through memory.

Notes
  1. In general it's a bad idea to view memory mapped I/O devices because some devices do things depending on how many times a register has been read or written. If the Memory Viewer is used to view one of these registers it could interfere with the simulation.
  2. Addresses that do not map to a device will appear as "xx".
  3. Having the memory viewer open while single-stepping through a program will cause the simulation to run slower.

Program Listing

After you select the "Program Listing" option from the "Window" menu the window in Figure 2-5 should appear. This utility allows assembly listing files generated by an assembler to be loaded and viewed. While you single-step through a program the program listing will be automatically repositioned according to the current value of the program counter. This can be really useful when debugging a program. You can also set and clear breakpoints by clicking on a source code line with the left mouse button.

Undisplayed Graphic

FIGURE 2-5 Program Listing

File Menu

This menu allows you to load an assembler listing and to close the program listing.

Undisplayed Graphic

Loading a Listing

Since the program listing is automatically loaded whenever you load a program you should not need to use this option. However, if you do then:

Closing the Program Listing Edit Menu

This menu allows you to find a string and to clear all the breakpoints that have been set.

Undisplayed Graphic

Finding a String Clearing All Breakpoints Notes
  1. Having the Program Listing dialog open while single-stepping through a program will slow down the simulation.
  2. Sometimes an incorrect line will be highlighted.

Register Manipulation

Once a simulator is executing the register list will appear as shown in Figure 2-6. The values of the registers will be updated as you execute a program.

Modifying a Register's Value Clearing all the Registers

Undisplayed Graphic

FIGURE 2-6 Register List


Simulator Statistics

Some simulators keep simulation statistics. These statistics might include the number of instructions executed, the number of reads and writes to memory, and any other statistics the simulator designer wants. If a simulator keeps statistics they will be displayed in the statistics list as shown in Figure 2-7.

Clearing Statistics

Undisplayed Graphic

FIGURE 2-7 Hector 1600 Simulator Statistics


Program Execution and Control

The program execution and control area of the user interface is shown in Figure 2-8. These controls allow setting breakpoints, single stepping, running, and system resetting.

Undisplayed Graphic

FIGURE 2-8 Execution Control Area

Breakpoints

Breakpoints can be set or cleared using the breakpoint dialog displayed when the "Breakpoints" button is pressed. The breakpoint dialog is shown in Figure 2-9. In general it's much easier to use the breakpoint facility in the program listing utility than to use this approach.

Adding Breakpoints Removing Breakpoints

Undisplayed Graphic

FIGURE 2-9 Breakpoint Dialog

Single Stepping Running Stopping Execution Reset
Trace Window

Every time an instruction is executed using the single step button a trace record will be displayed in the trace window. The actual contents of a trace record are simulator specific. The trace window is shown in Figure 2-10.

Undisplayed Graphic

FIGURE 2-10 Trace Window

Saving Contents Clearing Contents Inserting Registers Inserting Statistics Setting Trace Preferences
Bugs

Although the user interface has been designed to handle most errors it's not foolproof.

  1. If the simulator process dies for some reason the user interface will freeze up. This will hopefully be fixed in a future release.
  2. If a program that never does any output is ran as a simulator the user interface will lockup (e.g., 'cat' instead of 'Sim68000').
  3. Not all of the Tcl/Tk errors are trapped by the user interface in its current incarnation. Therefore the default Tcl/Tk error dialog will be displayed.

This document was produced using an evaluation version of HTML Transit