public static void LoadPeripheralsFromJSONFile(this Machine machine, String fileName)
 {
     if (!File.Exists(fileName))
     {
         throw new RecoverableException("Cannot load devices configuration from file {0} as it does not exist.".FormatWith(fileName));
     }
     new DevicesConfig(File.ReadAllText(fileName), machine);
 }
Пример #2
0
 public PowerPc(string cpuType, Machine machine, Endianess endianness = Endianess.BigEndian) : base(cpuType, machine,
                                                                                                    /* hardcoded to big endian, controlable via TlibSetLittleEndianMode */ Endianess.BigEndian)
 {
     initialEndianess = endianness;
     irqSync          = new object();
     machine.ClockSource.AddClockEntry(
         new ClockEntry(long.MaxValue / 2, ClockEntry.FrequencyToRatio(this, 128000000), DecrementerHandler, this, String.Empty, false, Direction.Descending));
     TlibSetLittleEndianMode(initialEndianess == Endianess.LittleEndian ? 1u : 0u);
 }
Пример #3
0
        public CortexM(string cpuType, Machine machine, NVIC nvic, Endianess endianness = Endianess.LittleEndian) : base(cpuType, machine, endianness)
        {
            if (nvic == null)
            {
                throw new RecoverableException(new ArgumentNullException("nvic"));
            }

            this.nvic = nvic;
            nvic.AttachCPU(this);
        }
Пример #4
0
 public PowerPc(string cpuType, Machine machine, Endianess endianness = Endianess.BigEndian) : base(cpuType, machine, endianness)
 {
     irqSync = new object();
     machine.ObtainClockSource().AddClockEntry(
         new ClockEntry(long.MaxValue / 2, ClockEntry.FrequencyToRatio(this, 128000000), DecrementerHandler, false, Direction.Descending));
 }
 public static void LoadPeripheralsFromJSONString(this Machine machine, String text)
 {
     new DevicesConfig(text, machine);
 }
        public static Dictionary <PeripheralTreeEntry, IEnumerable <IRegistrationPoint> > GetPeripheralsWithAllRegistrationPoints(this Machine machine)
        {
            var result = new Dictionary <PeripheralTreeEntry, IEnumerable <IRegistrationPoint> >();

            var peripheralEntries = machine.GetRegisteredPeripherals().ToArray();

            foreach (var entryList in peripheralEntries.OrderBy(x => x.Name).GroupBy(x => x.Peripheral))
            {
                var uniqueEntryList = entryList.DistinctBy(x => x.RegistrationPoint).ToArray();
                var entry           = uniqueEntryList.FirstOrDefault();
                if (entry != null)
                {
                    result.Add(entry, uniqueEntryList.Select(x => x.RegistrationPoint).ToList());
                }
            }

            return(result);
        }