コード例 #1
0
ファイル: TranslationCPU.cs プロジェクト: bhuvanchandra/emul8
        protected TranslationCPU(string cpuType, Machine machine, EndiannessEnum endianness)
        {
            if(cpuType == null)
            {
                throw new RecoverableException(new ArgumentNullException("cpuType"));
            }

            Endianness = endianness;
            PerformanceInMips = 100;
            currentCountThreshold = 5000;
            this.cpuType = cpuType;
            ClockSource = new BaseClockSource();
            ClockSource.NumberOfEntriesChanged += (oldValue, newValue) =>
            {
                if(oldValue > newValue)
                {
                    Misc.Swap(ref oldValue, ref newValue);
                }
                if(oldValue == 0 && newValue != 0)
                {
                    ClearTranslationCache();
                }
            };
            this.translationCacheSize = DefaultTranslationCacheSize;
            this.machine = machine;
            started = false;
            isHalted = false;
            translationCacheSync = new object();
            pumpingModeSync = new object();
            InitializeRegisters();
            InitInterruptEvents();
            Init();
            InitDisas();
        }
コード例 #2
0
 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);
 }
コード例 #3
0
ファイル: CortexM.cs プロジェクト: emul8/emul8
        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);
            Init();
        }
コード例 #4
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);
            Init();
        }
コード例 #5
0
ファイル: TranslationCPU.cs プロジェクト: rte-se/emul8
        protected TranslationCPU(string cpuType, Machine machine, Endianess endianness)
        {
            if(cpuType == null)
            {
                throw new RecoverableException(new ArgumentNullException("cpuType"));
            }

            oldMaximumBlockSize = -1;

            Endianness = endianness;
            PerformanceInMips = 100;
            currentCountThreshold = 5000;
            this.cpuType = cpuType;
            DisableInterruptsWhileStepping = true;
            ClockSource = new BaseClockSource();
            ClockSource.NumberOfEntriesChanged += (oldValue, newValue) =>
            {
                if(oldValue > newValue)
                {
                    Misc.Swap(ref oldValue, ref newValue);
                }
                if(oldValue == 0 && newValue != 0)
                {
                    ClearTranslationCache();
                }
            };
            this.translationCacheSize = DefaultTranslationCacheSize;
            this.machine = machine;
            started = false;
            isHalted = false;
            translationCacheSync = new object();
            pagesAccessedByIo = new HashSet<long>();
            pauseGuard = new CpuThreadPauseGuard(this);
            InitializeRegisters();
            InitInterruptEvents();
            Init();
            InitDisas();
        }
コード例 #6
0
ファイル: PowerPc.cs プロジェクト: AntonKrug/emul8-modded
 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));
 }
コード例 #7
0
ファイル: MachineExtensions.cs プロジェクト: rasomc/emul8
 public static void LoadPeripherals(this Machine machine, String fileName)
 {
     new DevicesConfig(fileName, machine);
 }
コード例 #8
0
ファイル: MachineExtensions.cs プロジェクト: rasomc/emul8
        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);
        }
コード例 #9
0
ファイル: PowerPc.cs プロジェクト: rte-se/emul8
 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));
 }
コード例 #10
0
 public static void LoadPeripheralsFromJSONString(this Machine machine, String text)
 {
     new DevicesConfig(text, machine);
 }