public static void CFIFlashFromFile(this Machine machine, string fileName, long whereToRegister, string name, BusWidth busWidth = BusWidth.Bits32, bool nonPersistent = false, int? size = null) { CFIFlash flash; try { flash = new CFIFlash(fileName, size ?? (int)new FileInfo(fileName).Length, busWidth, nonPersistent); } catch(Exception e) { throw new ConstructionException(String.Format("Could not create object of type {0}", typeof(CFIFlash).Name), e); } machine.SystemBus.Register(flash, new BusPointRegistration(whereToRegister)); machine.SetLocalName(flash, name); }
public static void CFIFlashFromFile(this Machine machine, string fileName, long whereToRegister, string name, BusWidth busWidth = BusWidth.Bits32, bool nonPersistent = false, int?size = null) { CFIFlash flash; try { flash = new CFIFlash(fileName, size ?? (int)new FileInfo(fileName).Length, busWidth, nonPersistent); } catch (Exception e) { throw new ConstructionException(String.Format("Could not create object of type {0}", typeof(CFIFlash).Name), e); } machine.SystemBus.Register(flash, new BusPointRegistration(whereToRegister)); machine.SetLocalName(flash, name); }