computer structure lab - taumarko/complab_f_16/monitor.pdf1 1 orientation the resa b1 monitor...

23
Computer Structure Lab RESA b1MONITOR PROGRAM USER GUIDE Department of Systems School of Electrical Engineering, Tel Aviv University 2005 Compiler Simulator Hardware Monitor FPGA Text Editor Graph Generator Hardware interface Software-hardware communication protocol

Upload: doantuong

Post on 21-Apr-2018

214 views

Category:

Documents


1 download

TRANSCRIPT

Computer Structure Lab

RESA b1MONITOR PROGRAM USER GUIDE

Department of Systems School of Electrical Engineering, Tel Aviv University

2005

Compiler

SimulatorHardware Monitor

FPGA

Text Editor

GraphGenerator

Hardware interface

Software-hardware communication protocol

ii

1 Orientation...................................................................................................................... 1 2 Text editor....................................................................................................................... 2

2.1 Orientation ................................................................................................................ 2 2.2 The Editor screen ...................................................................................................... 2

2.2.1 Auto Syntax Colorizing and Stylizing ............................................................... 2 2.2.2 Label completion ............................................................................................... 2 2.2.3 Line numbering.................................................................................................. 3

2.3 The Results screen .................................................................................................... 3 2.3.1 Compilation succeeded ...................................................................................... 3 2.3.2 Compilation failed ............................................................................................. 3

2.4 User options .............................................................................................................. 3 2.5 The assembly language rules .................................................................................... 4 2.6 Assembly program example ..................................................................................... 4

2.6.1 Source code........................................................................................................ 4 2.6.2 Compilation results (dump file) ......................................................................... 5

3 Simulator ........................................................................................................................ 7 3.1. Orientation ............................................................................................................... 7 3.2. Use of the simulator ................................................................................................. 7

3.2.1 Run the simulator............................................................................................... 7 3.2.2 Load programs (source or cod) into the simulator............................................. 7 3.2.3 Screen areas of the simulator. ............................................................................ 8 3.2.4 Run functions of the simulator........................................................................... 8 3.2.5 Memory watch and Memory dump options....................................................... 9 3.2.6 Save memory values into a file.......................................................................... 9 3.2.7 Change memory values during simulation ........................................................ 9 3.2.7 Change register values during simulation........................................................ 10 3.2.8 Reset the simulator........................................................................................... 10 3.2.9 Jump to address (change PC) function............................................................. 10 3.2.10 Save the simulator screen into a file .............................................................. 10 3.2.11 Print the simulator screen............................................................................... 10

4. Hardware monitor ...................................................................................................... 11 4.1 Orientation .............................................................................................................. 11 4.2 The Configuration Wizard ...................................................................................... 11

4.2.1 Lab selection screen......................................................................................... 11 4.2.2 Labels Configuration ....................................................................................... 12 4.2.3 FPGA Configuration........................................................................................ 13 4.2.4 Memory Configuration .................................................................................... 13

4.3 The Hardware monitor main window..................................................................... 13 4.3.1 Slave and memory labels ................................................................................. 14 4.3.2 Memory Dump................................................................................................. 14 4.3.3 Registers........................................................................................................... 14 4.3.4 Commands ....................................................................................................... 14 4.3.5 Buttons and controls ........................................................................................ 14

4.4 Menus...................................................................................................................... 15 4.4.1 Configuration ................................................................................................... 15

iii

4.4.2 Graphics ........................................................................................................... 16 4.4.3 Run................................................................................................................... 16 4.4.4 Test................................................................................................................... 16

5. Graph Generator ........................................................................................................ 17 5.1 Orientation .............................................................................................................. 17 5.2 Modes...................................................................................................................... 17 5.3 Screens .................................................................................................................... 17

5.3.1 A sample screen shot ....................................................................................... 17 5.3.2 Table Entry....................................................................................................... 17 5.3.3 Measure line and measured values .................................................................. 18 5.3.4 Selecting signals............................................................................................... 18 5.3.5 Changing the order of signals .......................................................................... 19 5.3.6 Combining signals ........................................................................................... 19 5.3.7 Spreading a bus ................................................................................................ 19 5.3.8 Reversing a bus ................................................................................................ 19 5.3.9 Zooming in and out.......................................................................................... 19 5.3.10 Toggling grid ................................................................................................. 20 5.3.11 Changing a signal name ................................................................................. 20

5.4 Naming the Graph................................................................................................... 20 5.5 Printing the Graph................................................................................................... 20 5.6 Load/Save option .................................................................................................... 20

1

1 Orientation The RESA B1 monitor program is a suite of programs. Student use them to write, compile and simulate programs in assembly language, setup the RESA-2 and debug hardware projects, designed by Xilinx ISE Foundation software. Block diagram of the program is presented on figure 1.1. The main parts of the RESA B1 program are: Text editor with compiler, DLX simulator, Hardware monitor with graph generator.

Figure 1.1 Block diagram of RESA b1 program.

2

2 Text editor 2.1 Orientation The text editor/compiler screen consists of 2 main parts: the editor, and the results. The editor screen is the place the user should write the DLX assembly program in; it provides the user with all the necessary functionality (which will be described). The results screen is where the user, after compiling a program, sees the results of the compiling process, including errors and their locations.

2.2 The Editor screen

The editor is used to enter the DLX assembly program into. The user can click on the window and start writing the DLX assembly program. The editor supports 2.2.1 Auto Syntax Colorizing and Stylizing

The editor will colorize and stylize the program, while the user is writing it: • Legal line labels will be automatically colored blue and bold • Legal line labels, that are defined more than once, will be colored purple

and bold • Illegal line labels will be colored red and bold • Lines that contain a syntax error will be colored red and underlined • Remarks will be colored green • Labels inside commands, which point to a specific line label in the

program, will be colored red, blue or purple: red if they point to a label which does not currently exist, blue if they point to an existing and valid line label, and purple if they point to a label which is defined more than once.

2.2.2 Label completion

The user can right click the text editor screen, and select a label from a list of existing line labels. The selection causes the label to be inserted into the text.

3

2.2.3 Line numbering The line number is always shown in the status bar (bottom of window).

2.3 The Results screen

After the user selects the “Compile” option (using the button or the menu option), the compiling results screen will show the results of the compiling process. The screen will show either the “Compilation succeeded” message followed by a list of used labels, or the “Compilation failed” message followed by a list of errors.

2.3.1 Compilation succeeded

If the compilation succeeded, the .cod and .lst files will be created at the same directory of the .s file the user is working on. List of used labels is added at the end of .lst file and includes name of the label, line of definition and destination lines.

2.3.2 Compilation failed

If the Compilation failed no .cod and .lst files will be created. List of errors is presented. Each error includes the line number in which it occurred, and the error reason – double clicking an error will scroll the text editor to the line the error occurred in. The user should fix all errors and re-compile.

2.4 User options

• File->Open/Save: Opens and saves .s files. Last saved location of .s file will be the location of the compiled .lst and .cod files

• File->Compile: Compiles the file, creating the .lst and .cod files if compilation succeeded, and displaying the compilation errors list if compilation failed. Double click an error to scroll directly to it.

• Options->Colorizing: Check/uncheck this box in order to enable/disable syntax highlighting and colorizing. It is better to disable

4

colorizing when viewing large .s files, such as the EPROM program, which don’t require corrections

2.5 The assembly language rules

1. Everything that appears in a line after a "*" is a comment. 2. The line pc= 0x12345 means that next translated line will be mapped to

address 0x12345. 3. A label is defined by placing its name at the beginning of a line followed by a

":". (in the example: adr1:). A label is a shortcut for an address. The address that corresponds to a label is the address of the line in which it is defined. Every occurrence of a label (even before the place in which the label is defined) is replaced with the address that corresponds to the label.

4. dc x means “place the constant x in the address that corresponds to the current line”.

5. ds y means "reserve y words in memory". The address of the next line is y plus the address of the current line.

6. Instructions are given the mnemonics used in the description of the instruction sets.

7. Do not to use TAB button in order to align your programs. If you do so, remember to end every field with space.

2.6 Assembly program example

2.6.1 Source code

pc = 0x0 * address of the program in main memory *Instructions start: lw R1 R0 data1 *R1=M(data1)=0x1 lw R2 R0 data2 *R2=M(data2)=0x1234567 lw R3 R0 data3 *R3=M(data3)=0xfedec987 lw R4 R0 data4 *R4=M(data4)=0xabcdef01 sw R1 R0 adr1 *M(adr1)=R1 sw R2 R0 adr2 *M(adr2)=R2 sw R3 R0 adr3 *M(adr3)=R3

5

sw R4 R0 adr4 *M(adr4)=R4 sw R4 R0 adr1 *M(adr1)=R4 sw R3 R0 adr2 *M(adr2)=R3 sw R2 R0 adr3 *M(adr3)=R2 sw R1 R0 adr4 *M(adr4)=R1 halt *HALT instruction * destination area adr1: ds 1 adr2: ds 1 adr3: ds 1 adr4: ds 1 * constant data data1: dc 0x1 data2: dc 0x1234567 data3: dc 0xfedec987 data4: dc 0xabcdef01

2.6.2 Compilation results (dump file) *Instructions

0x00000000: 0x8C010011 start: lw R1 R0 data1 *R1=M(data1)=0x1 0x00000001: 0x8C020012 lw R2 R0 data2 *R2=M(data2)=0x1234567 0x00000002: 0x8C030013 lw R3 R0 data3 *R3=M(data3)=0xfedec987 0x00000003: 0x8C040014 lw R4 R0 data4 *R4=M(data4)=0xabcdef01

0x00000004: 0xAC01000D sw R1 R0 adr1 *M(adr1)=R1 0x00000005: 0xAC02000E sw R2 R0 adr2 *M(adr2)=R2 0x00000006: 0xAC03000F sw R3 R0 adr3 *M(adr3)=R3 0x00000007: 0xAC040010 sw R4 R0 adr4 *M(adr4)=R4 0x00000008: 0xAC04000D sw R4 R0 adr1 *M(adr1)=R4 0x00000009: 0xAC03000E sw R3 R0 adr2 *M(adr2)=R3 0x0000000A: 0xAC02000F sw R2 R0 adr3 *M(adr3)=R2 0x0000000B: 0xAC010010 sw R1 R0 adr4 *M(adr4)=R1 0x0000000C: 0xFC000000 halt *HALT instruction * destination area 0x0000000D: 0x00000000 adr1: ds 1 0x0000000E: 0x00000000 adr2: ds 1 0x0000000F: 0x00000000 adr3: ds 1

6

0x00000010: 0x00000000 adr4: ds 1 * constant data 0x00000011: 0x00000001 data1: dc 0x1 0x00000012: 0x01234567 data2: dc 0x1234567 0x00000013: 0xFEDEC987 data3: dc 0xfedec987 0x00000014: 0xABCDEF01 data4: dc 0xabcdef01 Label Report: start: 4 D: adr1: 24 D: 9, 15 adr2: 25 D: 10, 16 adr3: 26 D: 11, 17 adr4: 27 D: 12, 18 data1: 30 D: 4 data2: 31 D: 5 data3: 32 D: 6 data4: 33 D: 7

7

3 Simulator 3.1. Orientation The simulator is a software tool that simulates the DLX. Using the simulator the user can see how the DLX should behave on different DLX programs. The simulator knows to read the programs from 2 different file types: .s: A file that contain a program in the DLX assembly language. If the program is not a legal DLX assembly program the simulator will give an error message. The simulator will not tell you where the error is and is not a tool to check your programs. For this you should use the DLX assembly text editor. .cod: This file contains the DLX program in a code format. It is your responsibility to give the simulator a legal code file. The output of the compiler is a code file. So you can use it in the simulator.

It is possible to load several files into the simulator one after the other. If there is aliasing in some memory address the last program loaded value will be the value in this address.

3.2. Use of the simulator The simulator is very easy to use and can be learnt simply by using it. But here is some overview on its different options

3.2.1 Run the simulator Run the main program and in the opening window choose the simulator view. If the main program is already running, you can open the simulator by clicking "file->new" in the menu and choose simulator view.

3.2.2 Load programs (source or cod) into the simulator .s: After the simulator view is open, in the menu click "file->Open Source..." and chooses the wanted text file. .cod: After the simulator view is open, in the menu click "file->Open Code…" and chooses the wanted code file.

8

3.2.3 Screen areas of the simulator. In the simulator screen there are 3 areas: Commands area: In this area the current place in the program is shown. Command, to be executed next, is marked by a yellow arrow. You see also the 4 commands in addresses before the current command and 5 commands in addresses after the current command. For each command 3 fields are shown: Its address, its binary value and its disassembly command. Registers area:

In this area you can see and change the value of each of the 32 registers. Memory watch area:

In this area you can see the address and see and change the value of selected memory addresses.

3.2.4 Run functions of the simulator The simulator gives several running options: Single step: The simulator will run one command and will stop at the next command address. In the menu click "Run->Step" or press the "Step" button. Run N steps: Run selected number of commands and stops in the next command address. In the menu click "Run->Run N steps..." and in the opened window click the wanted number of steps. Run until PC condition: Run until PC (the current address) has the selected address. In the menu click "Run->Run until PC=..." and in the opened window click the wanted stop PC value. Run until register condition: Run until the selected register has the selected value. In the menu click "Run->Run until Reg=..." and in the opened window click the register num and the wanted stop value. Run until memory condition: Run until the selected memory address has the selected value. In the menu click "Run->Run until Memory=..." and in the opened window click the memory address and the wanted stop value.

9

Run until HALT: Run until the DLX is in halt state. In the menu click "Run->Run until Halt". Note that in every one of the functions "run until", if the defined condition is not reached within number of steps, predefined in the parameters file, you will get message with choice to stop the running or continue.

3.2.5 Memory watch and Memory dump options. The simulator tool gives you 2 different ways to monitor the memory: Memory watch: In order to bring a selected address into the memory watch area click "Simulator->Add Watch..." and write the selected address. The memory value of this value will be updated after every command. Memory Dump: In order to watch the values of range of memory addresses click "Simulator->Memory Dump..." and select the wanted range. In the opened dialog you will see the addresses and values of the selected memory area.

3.2.6 Save memory values into a file In the opened dialog of the memory dump you can click the "Save to Dump File…" button and select the file to save the memory range into. The file is type .txt with simple Structure as follows: " Address Value(address) Address Value(address) … "

3.2.7 Change memory values during simulation Using the memory area you can watch an address and change its value simply by

clicking another value in its textbox. In order to set the same value to a range of addresses you can click "Simulator->set memory->With Value…" and select the range and the value. You can load the memory to values from DLX assembly program or from code file like was explained before. You can also load it from text file with the structure of the "Memory dump saved file":

10

" Address Value(address) Address Value(address) … " You can do that by click "Simulator->set memory->From Dump File…" And select the wanted file.

3.2.7 Change register values during simulation Using the register area you can watch an address and change its value simply by

clicking another value in its textbox. 3.2.8 Reset the simulator Reset will bring the current PC address to 0x0 and will exit every DLX state including halt state. Click "Simulator->Reset".

3.2.9 Jump to address (change PC) function Click "Simulator->Jump To…" and write the target address. The simulator also will exit halt state.

3.2.10 Save the simulator screen into a file Click "File->Save State..." and select file to save into.

3.2.11 Print the simulator screen Click "File->Print…" and the print dialog will be open.The print preview option is also available. Remark: In all dialog in the simulator and in all text box you can write values in decimal or hexadecimal format.

11

4. Hardware monitor 4.1 Orientation

The Hardware Monitor screen is the main window the user will interact with, while using the program. This screen supplies all the necessary functionality to communicate with the RESA-2 hardware, and provides the information in a convenient way. The Hardware Monitor screen is based on 2 stages – the Configuration Wizard, in which the user sets all parameters needed for the lab work he is going to do, and the main window which displays all information from the hardware and allows communication with it. The user must configure the program using the wizard before starting the lab work (through the main window).

4.2 The Configuration Wizard

The wizard consists of 4 stages: Lab selection, Labels configuration, FPGA configuration and Memory configuration. Every stage is represented by a screen in the configuration wizard. The user passes through all these screens when activating the wizard, using the "next" and "previous" buttons.

4.2.1 Lab selection screen

Here the user must choose the lab he is currently working on: • "A simple slave device" • "Built in self monitoring" • "A Read/Write Machine" • "A load store machine + A simplified DLX" The lab that the user chooses affects the actions he can take later, and the information

that the program displays. For example, if the user is doing the "Built in self monitoring" lab, he will not be able to upload a .COD file to memory, and the program will not display the commands disassembly.

12

4.2.2 Labels Configuration In this screen the user sets up "labels": constant addresses that the user wants to monitor during the lab work. Each label consists of a name and an address that will be read in order to get the label's value. There are 3 types of labels:

• Slave labels: Addresses that belong to the slave address space and will appear on the main Hardware Monitor screen. There are a few slave labels that are required in order for some monitoring functions to work, described later.

• Graphics labels: These are labels that represent a bit index which goes into the monitor RAM – therefore, they are between 0x0 and 0x1f. These labels are used inside the "Graphics Signals" window to describe the various signals.

• Memory labels: Addresses that belong to the RAM memory address space, and will appear on the main Monitor screen. These are used only on labs that read/write from the RAM: Read/Write machine, Load/Store machine and the simplified DLX.

In addition to labels, this screen allows the user to enter the start addresses of the

GPR and the LA RAM, required so the main program will know what addresses to read for register display and graphic display. These addresses are required if the user wants the appropriate display, and the program will notify the user if he attempts to continue to the next stage without entering the addresses. The addresses must also be dividable by 0x20 (32 decimal), and the program will correct unaligned addresses (and notify the user about it).

The user can enter a label name and address using the appropriate fields: Name, Address and Label Type. After the user enters the label's details, pressing "Insert/Edit label" will insert the label to the correct list.

The user can also select an existing label from one of the lists, change its address and press the "Insert/Edit label" to update the address.

In order to delete an existing label, the user should select it and press the appropriate "Delete Selected Label" button.

The program checks all entered labels' addresses, and makes sure they are in the correct range (for their type). The address ranges are defined in the XML settings file (described later). The user can save and load .lbl files using the "Load labels from file" / "Save labels to file" buttons. The files include all the labels that the user created, as well as the 2 addresses.

As said before, there are several special labels which must be defined in order for specific monitoring functions to work (of course this depends on the lab that was chosen). These include (in capital letters):

13

• PC – this label should indicate the address of the DLX PC counter, and is required in order for the “commands” part to work

• STATUS – this label should contain, after each slave operation, the number of clock cycles that the LA RAM had monitored and captured. This is required for the graphics window.

• COMMAND – this label is not required for any specific function in the main Hardware Monitor Window, but is special because it is the only label a “write” function is permitted into.

4.2.3 FPGA Configuration

This screen allows the user to configure the RESA hardware with a specific .bit file, containing a design for the FPGA. The user should press the "Browse…" button, select the .bit file (created by Xilinx) and continue. The lab administrator can prevent the user from uploading a file by entering the correct option in the XML settings file.

4.2.4 Memory Configuration

This screen allows the user to configure the RESA-2 hardware with a specific .cod file, containing memory segments to upload to the RAM. The user should press the "Browse…" button, select the .cod file (assembled by the text editor) and then "Finish". This option will only be available on labs that upload commands to the RAM.

4.3 The Hardware monitor main window After the user has passed through all 4 wizard stages, the program does some preliminary actions and then presents the user with the main Hardware Monitor window. These actions are:

• Configuring the RESA with the .bit file (if entered) • Uploading the .cod file to the RAM memory • Reading all required addresses for the first time

The main Hardware Monitor window (named "the main window" from now on) contains several important parts. Not all parts always appear – it depends on the lab the user had chosen in the first wizard screen (for example, the memory dump part will not appear in the "simple slave device" lab.

14

The main parts of the main window are:

4.3.1 Slave and memory labels Display the labels that were defined in the "label configuration" part of the

wizard, and the value that was read from the label's address (that was read from the hardware)

4.3.2 Memory Dump In this part are displayed 32 addresses, read from the RAM memory. The user can

choose what addresses to watch using the "Mem dump from:" edit box. The address will be aligned to the closest address divisible by 0x8, and the 4 lines will display 32 addresses starting for the (aligned) address the user has entered.

4.3.3 Registers This window displays the first 32 addresses starting from the “GPR Start

Address” that was specified in the labels configuration screen in the configuration wizard, with appropriate register numbers (R0-R31). This can be used to watch data of any 32x32 RAM. In the Load/Store and DLX labs is used to watch and debug results of DLX assembly commands that relate to registers. This part requires the GPR address to be set in the label configuration part of the configuration wizard, or else registers will not be displayed.

4.3.4 Commands This window is active in the Load/Store and DLX labs only and displays values in

3 columns – Address, Hexadecimal value and disassembly of the DLX commands. These are displayed for the current command, which will be executed in the next step (its address taken from the value of the program counter, read from the PC label), and for a few commands before and after the current one. If a value does not disassemble (this can happen, for example, when the monitor tries to disassemble a value which is part of a data segment and not a code segment), “no disassembly” will be shown in that specific line. This part requires the PC label to be set in the slave labels list, in the label configuration part of the configuration wizard, or else commands will not be displayed.

4.3.5 Buttons and controls The user can interact with the hardware using 2 methods: the buttons on the Hardware

Monitor window, or the commands inside the menus. An error might occur when issuing any command (due to an incorrect design, or a hardware failure). In case of an error, a message box with details about it will open.

15

• Step – gives the hardware 1 STEP_EN signal, and refreshes the display (re-reads all necessary addresses).

• Reset – this button has 2 modes. When “RESET=1” is displayed, pressing this button will move the RESET signal to high. When “RESET=0” is displayed, pressing this button will move the RESET signal to low and refresh the display.

• Refresh Data – this button will re-read all addresses displayed on screen (including labels, memory dump, registers and commands views). In case of an error in a read from a specific address, a message box with the failed address will be displayed and the user will have an option to stop reading addresses (causing all failed addresses to display 0xeeeeeeee)

• Continuous Mode / Stop – this button has 2 modes. When “Continuous mode” is displayed, pressing this button will cause the STEP_EN signal to be high and the button to change to “Stop”, until one of 2 things have happened: the “Stop” button has been pressed, or the DLX processor has reached the “halt” state (in this case a message box will pop informing the user about it). When one of these happens the button will return to be “Continuous mode” and the display will be refreshed. Notice that when in continuous mode, the user can’t press any of the other buttons (to prevent interruptions to the DLX).

• Write to selected label – This text box and “Write” button allow the user to select a memory label from the memory labels list, enter a value and then request the Hardware to write that value to the address of that label. Notice that you can’t write to a slave label, with the special exception of the COMMAND label.

• Signals Waveforms – this opens the ACTIVE signal waveforms window, described in the “Graphics” section. There is always just 1 active graphics window which is updated when the display is “refreshed”. The activation of the active signal waveforms window required the STATUS label to be defined and its value in the 8 LSB to be legal (0x0 – 0x1f).

4.4 Menus (default Windows menus not described)

4.4.1 Configuration This menu allows the user to re-start the entire lab setup process by reactivating

the configuration wizard, or to configure specific things by accessing single stages from inside the wizard. These include: - Labels config: allows the user to change the labels configuration; add/delete labels, change names and addresses etc. - FPGA config: allows the user to configure the hardware with a new .bit file - Memory config: allows the user to upload a new .cod file into the Hardware’s RAM memory

16

4.4.2 Graphics This menu allows the user to open the active signal waveforms window (same as

the “Signal Waveforms” button), and to open a reference signal waveforms window which can only be used to load previously saved waveform files

4.4.3 Run This menu gives the user various run options (when running the load/store

machine, or the simplified DLX). If a run condition hasn’t been met and a specific number of steps had passed (that number is set in the XML settings file), the user will get a message asking whether to continue waiting). The run options are:

- Step: same as the “Step” button - Run N steps: opens a dialog window which asks for number of steps (N), and then issues N step commands. - Run until PC= : opens a dialog window which asks for a specific PC register value, then runs in step mode until the PC reaches that value - Run until Reg= : opens a dialog window which asks for a specific Register number (0-31), and a register value, then runs in step mode until that specific register reaches that value. - Run until Memory= : opens a dialog window which asks for a specific memory address, and a value, then runs step mode until the value stored in the entered memory address reaches that value - Run until halt: activates the continuous mode until the processor reaches the halt state.

Note that in every one of the run functions except “Run until halt”, if the defined

condition is not reached within number of steps, predefined in the parameters file, you will get message with choice to stop the running or continue. In the “Run until halt” function you will get this message, if 30 seconds after activating the continuous mode the halt state is not reached.

4.4.4 Test - Test Port: tests the FPGA, if it’s configuration includes valid IO_LOGIC - Test FPGA: executes the GXSTEST program of XESS - Test Board: configures the RESA-2 with a valid DLX file, then runs a flying bit test on the parallel bus and address to data memory test on first page of the RAM. The range of read/write address is set in the XML configuration file. If the RAM test is successful, a test .cod file is uploaded to memory and is run until the DLX reaches halt. The user get a message notifying that all the tests were done and passed successfully, except the test .cod file test – the user needs to check the PC value after the run of the test program in order to see whether the DLX has reached the correct address.

17

5. Graph Generator

5.1 Orientation The Graph Generator module is purely UI: it has no background computation and

is strictly about graphical representation of externally computed information. A graph displays the waveforms of binary signal passed to it from the RESA-2 hardware through the Hardware Monitor. Signals can be displayed separately (as binary signals) or combined to a bus with hexadecimal value. Communication with the user is done through buttons, keyboard and mouse.

5.2 Modes The Graph Generator module has two modes of work: active and reference.

Active mode is open from the “Signal Waveforms” button or graphic menu of the Hardware monitor. In this mode data for the graphics are received from the Hardware monitor and every step updates them. Reference mode can be open only from the graphic menu of the Hardware monitor. In this mode the Graph Generator works as graph editor only on previously saved .wf files

5.3 Screens This module has only one screen, on which the waveforms are displayed.

5.3.1 A sample screen shot A sample screen shot is presented on figure 5.1.The screen consists of two main areas:

1.The top area is the toolbar. It contains the buttons that handle most of the actions that can be performed by the user in this module.

2.The bottom area is a table of entries, each of them displays one signal.

5.3.2 Table Entry A table entry displays one signal on the screen. It consists of the signal's name

(leftmost box), the signal's measured value (middle box), and the waveforms, which show the signal's values in every step. Steps are numbered at the top and at the bottom of the table. A signal in an entry can be either binary or bus. Binary signal appear as a square wave, which is high when the value is 1, and low when the value is 0. Bus signals are displayed as two horizontal line that cross whenever the buses value changes. Bus signals have their values explicitly stated on the graph.

18

Figure 5.1 A sample screen shot

5.3.3 Measure line and measured values The measure line (see screen shot) is a vertical line that can be placed anywhere

on the graph by clicking the left mouse button in the desired place, above or beneath the table. The line will cross all the entries in a specific step, causing their value at that step to appear in the box beside their name (see screen shot).

5.3.4 Selecting signals Left-clicking an (unmarked) entry will cause it to be marked in black (see screen

shot). A marked signal is a selected signal. Selecting a signal this way will automatically unselect all previously selected signals. Holding the Ctrl button while selecting will

19

disable the automatic unselection, and therefore can be used to select a group of signals, one by one. Holding Ctrl while clicking a selected signal will unselect it. The Shift button can be used to select a group of adjacent signals by clicking the first signal in the group, and then clicking the last signal in the group while holding it down.

5.3.5 Changing the order of signals Selecting a signal and then pressing the up and down arrows will move it up and

down in the table. This only works if exactly one signal is selected.

5.3.6 Combining signals Selecting a group of binary signals and pressing the Combine button (second icon

from the left), will remove all selected signals from the table, and add a new bus signal to the table. The order in which the signals appeared in the table is the order that is used to compute the bus' values in every step. For example, for a bus made of 4 signals, that have the following values in a certain step, in the following order (MSB to LSB): 1, 0, 1, 0 – the bus' value in that step will be: 0xA. The bus' position in the table will be at the index of the first (highest in the table) signal that was used to create it (the bus). A bus will get a default name, which can be changed by the user with the change name button (see further).

5.3.7 Spreading a bus Spreading is an action opposite to combining. When pressing the Spread button

(third icon from the left) the selected bus (there must be exactly one selected bus) will be removed from the table, replaced by all the binary signals it was made of. The signals will appear at the bus' index, in the same order they had in the bus.

5.3.8 Reversing a bus Selecting a bus and pressing the Reverse button (arrows icon) will reverse the

order bits in the computation of the bus' values. For example, suppose a bus of size 4 has the value of 0xA in a certain step, which means its bits are 1, 0, 1, 0, then after pressing reverse the order of the bits is 0, 1, 0, 1, which is 0x5, the new value of the bus for that certain step.

5.3.9 Zooming in and out The fifth and the sixth buttons from the left are the zoom in/zoom out buttons (+

for zoom in, - for zoom out). Pressing them will change the size of the graph. Zooming in and out is not unlimited, and when reaching maximum or minimum size the will have no effect.

20

5.3.10 Toggling grid The grid is a gray net of squares that appear in the area of the signals' values (not

measured values). They mark the boundaries of steps and entries. Pressing the Toggle grid button (the # icon) will turn the grid on and off.

5.3.11 Changing a signal name Pressing the Change Signal Name icon on the toolbar will cause a dialog box to

appear prompting the user to insert a new name for a selected signal (exactly one signal must be selected). Once the name is inserted the new name will appear in the spot for signal name in the signal's entry.

5.4 Naming the Graph While choosing to change the name (p. 5.3.11), but no signal is marked, the function name the graph is activated. Edit name function can’t be performed. Every new name overwrites the old one.

5.5 Printing the Graph Printing the graph can done by pressing the printer icon in the toolbar.

Before accept printer options have to be set.

5.6 Load/Save option Buttons in the toolbar handle loading and saving of the graph.

Save to file can be done only in the active mode, it’s a text file and his extension is .wf. Only signal information and graph name is saved to the file. Load file can be performed only in reference mode. After that all the screen functions can be done, but they not change the file data.