Bennett/General User Manual: Difference between revisions

From Engineering Wiki
Jump to navigation Jump to search
gravatar Mmapxam5 [userbureaucrateditorinterface-adminsysopPHRhYmxlIGNsYXNzPSJ0d3BvcHVwIj48dHI+PHRkIGNsYXNzPSJ0d3BvcHVwLWVudHJ5dGl0bGUiPkdyb3Vwczo8L3RkPjx0ZD51c2VyPGJyIC8+YnVyZWF1Y3JhdDxiciAvPmVkaXRvcjxiciAvPmludGVyZmFjZS1hZG1pbjxiciAvPnN5c29wPGJyIC8+PC90ZD48L3RyPjwvdGFibGU+] (talk | contribs)
gravatar Mmapxam5 [userbureaucrateditorinterface-adminsysopPHRhYmxlIGNsYXNzPSJ0d3BvcHVwIj48dHI+PHRkIGNsYXNzPSJ0d3BvcHVwLWVudHJ5dGl0bGUiPkdyb3Vwczo8L3RkPjx0ZD51c2VyPGJyIC8+YnVyZWF1Y3JhdDxiciAvPmVkaXRvcjxiciAvPmludGVyZmFjZS1hZG1pbjxiciAvPnN5c29wPGJyIC8+PC90ZD48L3RyPjwvdGFibGU+] (talk | contribs)
(Grammar and spelling)
Line 2: Line 2:


== Bennett ==
== Bennett ==
Bennett is a hardware monitor tool. It's purpose is to make expose the controls to a processor and allow the Bennett user to operate on the memory of the system.
Bennett is a hardware monitor tool. Its purpose is to expose the controls to a processor and allow the Bennett user to operate on the memory of the system.


== Bennett User Guide ==
== Bennett User Guide ==


Bennett has several backend modules, for example MU0 and RISC-V. The screenshots and examples in this guide use a variety of backends, so the exact interface / register banks may differ slightly depending on which course unit you are studying. Currently Bennett is used in [[Bennett/Bennett_COMP12111|COMP12111]], [[Bennett/Bennett_COMP15111|COMP15111]], [[Bennett/Bennett_COMP22111|COMP22111]], [[Bennett/Bennett_COMP32211|COMP32211]], [[Bennett/Bennett_COMP22711|COMP22711]]
Bennett has several backend modules, for example, MU0 and RISC-V. The screenshots and examples in this guide use a variety of backends, so the exact interface/register banks may differ slightly depending on which course unit you are studying. Currently Bennett is used in [[Bennett/Bennett_COMP12111|COMP12111]], [[Bennett/Bennett_COMP15111|COMP15111]], [[Bennett/Bennett_COMP22111|COMP22111]], [[Bennett/Bennett_COMP32211|COMP32211]], [[Bennett/Bennett_COMP22711|COMP22711]]


=== Starting Bennett ===
=== Starting Bennett ===
Line 40: Line 40:
much easier to debug code.
much easier to debug code.


A breakpoint is set by double clicking the memory address in one of the memory windows –
A breakpoint is set by double-clicking the memory address in one of the memory windows –
a green circle will appear. The row header (e.g 0x001) must be clicked, the part in light grey
A green circle will appear. The row header (e.g 0x001) must be clicked, the part in light grey, not the memory value cell itself.
not the memory value cell itself.


Setting breakpoints is only possible when viewing in the Source or Disassembly formats in
Setting breakpoints is only possible when viewing in the Source or Disassembly formats in the memory view window.
the memory view window.


When a breakpoint is set and the program run, the execution will automatically pause at the
When a breakpoint is set and the program is run, the execution will automatically pause at the
address with the breakpoint. To continue execution simply press the Play button. To remove
address with the breakpoint. To continue execution, simply press the Play button. To remove
a breakpoint simply click on the address where a breakpoint is currently set.
a breakpoint, simply click on the address where a breakpoint is currently set.
It is possible to have more than one breakpoint in your code. Up to a maximum of 32.
It is possible to have more than one breakpoint in your code. Up to a maximum of 32.


Line 58: Line 56:
From the register view window, you can see the contents of the system registers
From the register view window, you can see the contents of the system registers


For COMP12111, the accumulator, and the PC, as well as the status of the flags, Z and N. These values are fixed.
For COMP12111, the accumulator, the PC, as well as the status of the flags, Z and N. These values are fixed.
A depressed button indicates that the bit representing that flag is 1.
A depressed button indicates that the bit representing that flag is 1.


Line 68: Line 66:
==== Windows ====
==== Windows ====


Allows you to add additional memory and register windows, for viewing multiple areas of memory at the same time.
Allows you to add additional memory and register windows for viewing multiple areas of memory at the same time.


==== Comms ====
==== Comms ====


Gives options to control how many steps are step forward at a time, an ability to turn of communications with the underlying system and set the speed of the walk feature. This is a more advanced feature and mostly likely not required often.
Gives options to control how many steps are step forward at a time, an ability to turn off communications with the underlying system, and set the speed of the walk feature. This is a more advanced feature and is most likely not required often.


==== Assembly and Loading ====
==== Assembly and Loading ====


Allows you to select a file to assemble, and a list of recently assembled files which can be reassembled quickly. See the section on file loading for further details.
Allows you to select a file to assemble, and a list of recently assembled files that can be reassembled quickly. See the section on file loading for further details.


=== (D) Controls ===
=== (D) Controls ===
Line 82: Line 80:
==== Run ====
==== Run ====


Bennett will tell the underlying processor to start running forward. The speed of this depends on the underlying system. Please consult your lab manual / lecture notes or ask a member of staff in labs about specifics for your module.
Bennett will tell the underlying processor to start running forward. The speed of this depends on the underlying system. Please consult your lab manual/lecture notes or ask a member of staff in labs about specifics for your module.


==== Stop ====
==== Stop ====
Line 90: Line 88:
==== Single Step ====
==== Single Step ====


Bennett will request the underlying system executes a single instruction. This is bound to key F5.
Bennett will request that the underlying system execute a single instruction. This is bound to key F5.


==== Walk ====
==== Walk ====


Performs a single step ever second. A slow motion run, however, walk will step off and over breakpoints.  
Performs a single step every second. A slow-motion run, however, a walk will step off and over breakpoints.  


ECALL routines in COMP15111 will not operate as expected in this state.
ECALL routines in COMP15111 will not operate as expected in this state.
Line 100: Line 98:
==== Reset ====
==== Reset ====


Bennett will request the processor resets. In most systems this will reset the program counter and internal state of the processor, but will not reset the memory or register values. Please consult your lab manual / lecture notes for details or ask a member of academic staff.
Bennett will request the processor resets. In most systems, this will reset the program counter and internal state of the processor, but will not reset the memory or register values. Please consult your lab manual/lecture notes for details or ask a member of academic staff.


==== Load Program ====
==== Load Program ====
Line 106: Line 104:
Bennett will offer to load a program from disk. If an assembly file is given, Bennett will attempt to assemble it first.
Bennett will offer to load a program from disk. If an assembly file is given, Bennett will attempt to assemble it first.


Other file formats supported include KMD, PNG, JPEG, HEX and Bin. See [[Bennett loading file formats]] for more details.
Other file formats supported include KMD, PNG, JPEG, HEX, and Bin. See [[Bennett loading file formats]] for more details.


==== Reload Program ====
==== Reload Program ====
Line 114: Line 112:
=== (E) Status Message  ===
=== (E) Status Message  ===


The status message will let you know the current state of the system. This could be running, stopped, stopped due to a hardware issue etc.
The status message will let you know the current state of the system. This could be running, stopped, stopped due to a hardware issue, etc.




=== Expression evaluation ===
=== Expression evaluation ===


Anywhere in Bennett that values can be entered, you may enter an expression. General mathematic expressions are valid, and Bennett will treat register names as variable holding the value of the register.
Anywhere in Bennett where values can be entered, you may enter an expression. General mathematical expressions are valid, and Bennett will treat register names as variables holding the value of the register.


Some examples:
Some examples:
Line 136: Line 134:
Bennett provides a terminal interface. The terminal can be opened in the File Menu -> Windows -> New Terminal Window. Clicking this button, a new terminal window will be appended to the lower part of the Bennett GUI.
Bennett provides a terminal interface. The terminal can be opened in the File Menu -> Windows -> New Terminal Window. Clicking this button, a new terminal window will be appended to the lower part of the Bennett GUI.


This is not a host system terminal, it is connected to the input and output of the backend module. For COMP15111, this is the emulated IO, and so you won't be able to type into the terminal and see output unless an appropriate program is driving the IO. Please see your lab manual for further details.
This is not a host system terminal; it is connected to the input and output of the backend module. For COMP15111, this is the emulated IO, and so you won't be able to type into the terminal and see output unless an appropriate program is driving the IO. Please see your lab manual for further details.


[[File:Bennett terminal.png|600px|thumb|Example of the Bennett terminal, having printed out the number 42.]]
[[File:Bennett terminal.png|600px|thumb|Example of the Bennett terminal, having printed out the number 42.]]

Revision as of 13:54, 4 September 2025

If anything is unclear in this manual, please contact cadtools@manchester.ac.uk

Bennett

Bennett is a hardware monitor tool. Its purpose is to expose the controls to a processor and allow the Bennett user to operate on the memory of the system.

Bennett User Guide

Bennett has several backend modules, for example, MU0 and RISC-V. The screenshots and examples in this guide use a variety of backends, so the exact interface/register banks may differ slightly depending on which course unit you are studying. Currently Bennett is used in COMP12111, COMP15111, COMP22111, COMP32211, COMP22711

Starting Bennett

Please reference the specific notes for your course units (COMP12111, COMP15111, COMP22111, COMP32211, COMP22711) or the Lab manual on how to start Bennett for your course unit.

GUI Overview

The figure below outlines the main elements of the Bennett GUI.

Main window.png

(A) Memory Window

Usage of the memory display and loading a program. Using the COMP15111 emulator as an example

The memory window displays the current values of the given memory for the underlying system.

Example of MU0 Memory window

In the top right corner of the memory panel, you can select to change the view of the memory.

  1. Source - Shows the source against the memory values
  2. Source (Expanded) - Shows empty white space and multiline comments
  3. Bytes - Shows the memory as bytes
  4. Halfword - Shows the memory as halfwords
  5. Other modes are available. Not all modes are available for every backend module. (MU0 isn't byte addressable for example)

At the top of the memory panel, there is a box in which you can enter expressions. This expression will move the memory view around the whole memory. For example, if you put "PC", the memory pane will follow the value of the program counter as the processor executes instructions.

Breakpoints

Breakpoint example gif.gif

Breakpoints are positions in the code where you would like execution to halt; this makes it much easier to debug code.

A breakpoint is set by double-clicking the memory address in one of the memory windows – A green circle will appear. The row header (e.g 0x001) must be clicked, the part in light grey, not the memory value cell itself.

Setting breakpoints is only possible when viewing in the Source or Disassembly formats in the memory view window.

When a breakpoint is set and the program is run, the execution will automatically pause at the address with the breakpoint. To continue execution, simply press the Play button. To remove a breakpoint, simply click on the address where a breakpoint is currently set. It is possible to have more than one breakpoint in your code. Up to a maximum of 32.

Example of MU0 with two breakpoints, one of which has been hit

(B) Registers / Breakpoints

From the register view window, you can see the contents of the system registers

For COMP12111, the accumulator, the PC, as well as the status of the flags, Z and N. These values are fixed. A depressed button indicates that the bit representing that flag is 1.

For COMP15111/COMP22712 the full RISC-V registers are visible.

(C) File Menu

The file menu offers several more advanced options.

Windows

Allows you to add additional memory and register windows for viewing multiple areas of memory at the same time.

Comms

Gives options to control how many steps are step forward at a time, an ability to turn off communications with the underlying system, and set the speed of the walk feature. This is a more advanced feature and is most likely not required often.

Assembly and Loading

Allows you to select a file to assemble, and a list of recently assembled files that can be reassembled quickly. See the section on file loading for further details.

(D) Controls

Run

Bennett will tell the underlying processor to start running forward. The speed of this depends on the underlying system. Please consult your lab manual/lecture notes or ask a member of staff in labs about specifics for your module.

Stop

Bennett will ask the underlying system to stop.

Single Step

Bennett will request that the underlying system execute a single instruction. This is bound to key F5.

Walk

Performs a single step every second. A slow-motion run, however, a walk will step off and over breakpoints.

ECALL routines in COMP15111 will not operate as expected in this state.

Reset

Bennett will request the processor resets. In most systems, this will reset the program counter and internal state of the processor, but will not reset the memory or register values. Please consult your lab manual/lecture notes for details or ask a member of academic staff.

Load Program

Bennett will offer to load a program from disk. If an assembly file is given, Bennett will attempt to assemble it first.

Other file formats supported include KMD, PNG, JPEG, HEX, and Bin. See Bennett loading file formats for more details.

Reload Program

Bennett will attempt to reload the last program that was loaded into the system memory.

(E) Status Message

The status message will let you know the current state of the system. This could be running, stopped, stopped due to a hardware issue, etc.


Expression evaluation

Anywhere in Bennett where values can be entered, you may enter an expression. General mathematical expressions are valid, and Bennett will treat register names as variables holding the value of the register.

Some examples:

  1. 0xfff - 123 (Evaluates to a fixed number)
  2. PC -4 (Evaluating to the program counter - 4, good for following the PC)
  3. ACC * 2 (Evaluating to twice the accumulator)
  4. x0 * x12 (Another expressions that could be used in COMP15111)

If these expressions are entered in the memory window search bar, they will update continuously, allowing for live following of expressions.

Peripherals

Terminal

Bennett provides a terminal interface. The terminal can be opened in the File Menu -> Windows -> New Terminal Window. Clicking this button, a new terminal window will be appended to the lower part of the Bennett GUI.

This is not a host system terminal; it is connected to the input and output of the backend module. For COMP15111, this is the emulated IO, and so you won't be able to type into the terminal and see output unless an appropriate program is driving the IO. Please see your lab manual for further details.

Example of the Bennett terminal, having printed out the number 42.

Trouble shooting

See Bennett/Troubleshooting