use of de.neemann.digital.core.memory.ROM in project Digital by hneemann.
the class TestProcessor method createProcessor.
private ToBreakRunner createProcessor(String program, String processor) throws IOException, PinException, NodeException, ElementNotFoundException {
ToBreakRunner runner = new ToBreakRunner(processor, false);
Model model = runner.getModel();
ROM rom = null;
for (ROM r : model.findNode(ROM.class)) {
if (r.isProgramMemory())
rom = r;
}
assertNotNull(rom);
rom.setData(new DataField(new File(Resources.getRoot(), program)));
runner.getModel().init(true);
return runner;
}
use of de.neemann.digital.core.memory.ROM in project Digital by hneemann.
the class RomLoader method preInit.
@Override
public void preInit(Model model) throws NodeException {
List<ROM> roms = model.findNode(ROM.class, ROM::isProgramMemory);
if (roms.isEmpty())
throw new NodeException(Lang.get("msg_noRomFound"));
if (roms.size() > 1)
throw new NodeException(Lang.get("msg_moreThenOneRomFound"));
try {
roms.get(0).setData(new DataField(romHex));
roms.get(0).provideRomAdress(model);
} catch (IOException e) {
throw new NodeException(e.getMessage());
}
}
Aggregations