+ String initialRAMFileName = configuration.getAttribute(INITIAL_RAM_FILE_ATTR, "");
+ MainMemory mem;
+ if (!"".equals(initialRAMFileName))
+ {
+ IFile initialRAMFile = project.getFile(initialRAMFileName);
+ try (InputStream initialRAMStream = initialRAMFile.getContents())
+ {
+ mem = MainMemoryParser.parseMemory(mainMemDef, initialRAMStream);
+ }
+ catch (IOException e)
+ {
+ throw new CoreException(
+ new Status(IStatus.ERROR, MograsimActivator.PLUGIN_ID, "Unexpected IO exception reading initial RAM file", e));
+ }
+ } else
+ mem = null;
+
+ MachineLaunchParams params = new MachineLaunchParams(projName, mpmName, initialRAMFileName);
+ MachineDebugTarget debugTarget = new MachineDebugTarget(launch, params, machineDefinition);
+ debugTarget.suspend();
+ debugTarget.setExecutionSpeed(1);
+ machine = debugTarget.getMachine();
+ assignMicroInstructionMemory();
+ if (mem != null)
+ machine.getMainMemory().bind(mem);
+ machine.reset();
+ }
+
+ private void assignMicroInstructionMemory() throws CoreException
+ {