From 39a9cc869cbf3e1c7fc3a61ea6552d5d078e1d66 Mon Sep 17 00:00:00 2001 From: Daniel Kirschten Date: Mon, 7 Oct 2019 12:09:52 +0200 Subject: [PATCH] Moved TODOs from getting_started.md to the source code --- docs/getting_started.md | 11 +++++------ .../src/net/mograsim/plugin/editors/MemoryEditor.java | 11 ----------- .../plugin/launch/MachineLaunchConfigType.java | 1 + .../net/mograsim/plugin/launch/MachineRegister.java | 2 ++ .../src/net/mograsim/plugin/views/SimulationView.java | 3 +-- 5 files changed, 9 insertions(+), 19 deletions(-) diff --git a/docs/getting_started.md b/docs/getting_started.md index 7f62acc9..f8ee36ac 100644 --- a/docs/getting_started.md +++ b/docs/getting_started.md @@ -50,8 +50,7 @@ Every cell differing from the default value is highlighted with a cursive font a 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" @@ -68,7 +67,7 @@ It is recommended to move the Simulation view to the Editor pane. 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 @@ -79,7 +78,7 @@ Zoom in and out by either scrolling up or down or by dragging down and up with t 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. @@ -97,9 +96,9 @@ The table now displays the contents of the currently running machine. At this mo 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 diff --git a/plugins/net.mograsim.plugin.core/src/net/mograsim/plugin/editors/MemoryEditor.java b/plugins/net.mograsim.plugin.core/src/net/mograsim/plugin/editors/MemoryEditor.java index c1268fec..cddc880d 100644 --- a/plugins/net.mograsim.plugin.core/src/net/mograsim/plugin/editors/MemoryEditor.java +++ b/plugins/net.mograsim.plugin.core/src/net/mograsim/plugin/editors/MemoryEditor.java @@ -16,7 +16,6 @@ import org.eclipse.swt.SWT; 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; @@ -133,15 +132,6 @@ public class MemoryEditor extends EditorPart }); 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) @@ -223,7 +213,6 @@ public class MemoryEditor extends EditorPart { IFileEditorInput fileInput = (IFileEditorInput) input; context = ProjectMachineContext.getMachineContextOf(fileInput.getFile().getProject()); - context.activateMachine(); setPartName(fileInput.getName()); try diff --git a/plugins/net.mograsim.plugin.core/src/net/mograsim/plugin/launch/MachineLaunchConfigType.java b/plugins/net.mograsim.plugin.core/src/net/mograsim/plugin/launch/MachineLaunchConfigType.java index 9e944546..286975a6 100644 --- a/plugins/net.mograsim.plugin.core/src/net/mograsim/plugin/launch/MachineLaunchConfigType.java +++ b/plugins/net.mograsim.plugin.core/src/net/mograsim/plugin/launch/MachineLaunchConfigType.java @@ -120,6 +120,7 @@ public class MachineLaunchConfigType extends LaunchConfigurationDelegate 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(); diff --git a/plugins/net.mograsim.plugin.core/src/net/mograsim/plugin/launch/MachineRegister.java b/plugins/net.mograsim.plugin.core/src/net/mograsim/plugin/launch/MachineRegister.java index f8d343f4..d2a23128 100644 --- a/plugins/net.mograsim.plugin.core/src/net/mograsim/plugin/launch/MachineRegister.java +++ b/plugins/net.mograsim.plugin.core/src/net/mograsim/plugin/launch/MachineRegister.java @@ -95,12 +95,14 @@ public class MachineRegister extends PlatformObject implements IRegister 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)); } diff --git a/plugins/net.mograsim.plugin.core/src/net/mograsim/plugin/views/SimulationView.java b/plugins/net.mograsim.plugin.core/src/net/mograsim/plugin/views/SimulationView.java index d1a90418..f81fb4b0 100644 --- a/plugins/net.mograsim.plugin.core/src/net/mograsim/plugin/views/SimulationView.java +++ b/plugins/net.mograsim.plugin.core/src/net/mograsim/plugin/views/SimulationView.java @@ -65,7 +65,7 @@ public class SimulationView extends ViewPart { controlsToDisableWhenNoMachinePresent = new HashSet<>(); memCellListener = a -> instPreview.refresh(); - // TODO could this be a breakpoint? + // TODO use Step Over instead clockObserver = o -> { if (((CoreClock) o).isOn()) @@ -148,7 +148,6 @@ public class SimulationView extends ViewPart 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); }); -- 2.17.1