3. Write the memory contents.
Each table row contains one (16 bit wide) memory cell.
-The two text fields labeled "Address" and "Number of cells" only refer to the cells displayed simultaneously in the editor. The editor internally retains all 65536 addressable cells.
-Don't use the "Set active" button. (TODO: remove it)
+The two text fields labeled "Address" and "Number of cells" only refer to the cells displayed simultaneously in the editor. The editor internally retains all 65536 addressable cells.
## Open the views "Simulation", "Debug", "Memory" and "Registers"
4. If you don't have a MEM file, leave the according field blank. This causes the memory to be initialized with 0.
5. Click "Run". The Simulation view now should contain a rectangle containing either the text "Am2900" in a very small font or a huge mess of smaller rectangles connected by colored lines.
-The machine doesn't start running yet since it starts paused. (TODO: make a checkbox for this)
+The machine doesn't start running yet since it starts paused.
## Set up and get used to the views
Using the slider or by directly entering a number in the text field, the machine can be slowed down or sped up.
-Also, a "step by step execution" mode can be enabled. (TODO: use "Step over" instead)
+Also, a "step by step execution" mode can be enabled.
Step by step execution means that the machine is automatically paused on each rising edge of the clock.
At the bottom of the Simulation view, a single instruction table row is displayed. This row contains the instruction currently being executed.
1. Expand the pseudo register group.
It should contain the registers R0-R15 as well as the Q register.
-All of them should be 0, displayed as a bitstring (TODO: view in hex).
+All of them should be 0, displayed as a bitstring
-It is possible to change the register contents via this view by clicking on the old value and entering a new bitstring (TODO: a hex integer). It is not recommended to use `Z` in these bitstrings.
+It is possible to change the register contents via this view by clicking on the old value and entering a new bitstring. It is not recommended to use `Z` in these bitstrings.
### Debug view
import org.eclipse.swt.graphics.Font;
import org.eclipse.swt.layout.GridData;
import org.eclipse.swt.layout.GridLayout;
-import org.eclipse.swt.widgets.Button;
import org.eclipse.swt.widgets.Composite;
import org.eclipse.swt.widgets.Control;
import org.eclipse.swt.widgets.Label;
});
amountText.setText("100");// do this after registering the ModifyListener
new RadixSelector(parent, displaySettings);
-
- addActivationButton(parent);
- }
-
- private void addActivationButton(Composite parent)
- {
- Button activationButton = new Button(parent, SWT.PUSH);
- activationButton.setText("Set Active");
- activationButton.addListener(SWT.Selection, e -> context.getActiveMachine().ifPresent(m -> m.getMainMemory().bind(memory)));
}
private void createViewer(Composite parent)
{
IFileEditorInput fileInput = (IFileEditorInput) input;
context = ProjectMachineContext.getMachineContextOf(fileInput.getFile().getProject());
- context.activateMachine();
setPartName(fileInput.getName());
try
memFile = Optional.of(project.getFile(initialRAMFileName));
}
MachineDebugTarget debugTarget = new MachineDebugTarget(launch, mpmFile, memFile, machineDefinition);
+ // TODO make selectable whether the machine starts paused or not
debugTarget.suspend();
debugTarget.setExecutionSpeed(1);
machine = debugTarget.getMachine();
public String getValueString()
{
+ // TODO view in hex
return getMachine().getRegister(machineRegister).toString();
}
@Override
public void setValue(String expression) throws DebugException
{
+ // TODO support hex
// TODO exception handling
getMachine().setRegister(machineRegister, BitVector.parse(expression));
}
{
controlsToDisableWhenNoMachinePresent = new HashSet<>();
memCellListener = a -> instPreview.refresh();
- // TODO could this be a breakpoint?
+ // TODO use Step Over instead
clockObserver = o ->
{
if (((CoreClock) o).isOn())
simSpeedScale.addListener(SWT.Selection, e ->
{
double speed = Math.pow(SIM_SPEED_SCALE_STEP_FACTOR, simSpeedScale.getSelection() - SIM_SPEED_SCALE_STEPS);
- // TODO: disable when debugTarget is not set
debugTarget.setExecutionSpeed(speed);
});