public STM32F7_USART(Machine machine) { sync = new object(); this.machine = machine; IRQ = new GPIO(); receiveQueue = new Queue<byte>(); var controlRegister1 = new DoubleWordRegister(this); enabled = controlRegister1.DefineFlagField(0, name: "UE"); receiveEnabled = controlRegister1.DefineFlagField(2, name: "RE"); transmitEnabled = controlRegister1.DefineFlagField(3, name: "TE"); receiveInterruptEnabled = controlRegister1.DefineFlagField(5, name: "RXNEIE"); transmitQueueEmptyInterruptEnabled = controlRegister1.DefineFlagField(7, name: "TXEIE", writeCallback: delegate { RefreshInterrupt(); } ); controlRegister1.DefineFlagField(8, name: "PEIE"); paritySelection = controlRegister1.DefineFlagField(9, name: "PS"); parityControlEnabled = controlRegister1.DefineFlagField(10, name: "PCE"); var controlRegister2 = new DoubleWordRegister(this); stopBits = controlRegister2.DefineValueField(12, 2); registers = new DoubleWordRegisterCollection(this, new Dictionary<long, DoubleWordRegister> { { (long)Register.ControlRegister1, controlRegister1 }, { (long)Register.ControlRegister2, controlRegister2 }, { (long)Register.ControlRegister3, new DoubleWordRegister(this).WithFlag(0, name: "EIE") }, { (long)Register.InterruptAndStatus, new DoubleWordRegister(this, 0x200000C0) .WithFlag(5, FieldMode.Read, name: "RXNE", valueProviderCallback: delegate { return receiveQueue.Count > 0; }) .WithFlag(6, FieldMode.Read, name: "TC").WithFlag(7, FieldMode.Read, name: "TXE") .WithFlag(21, FieldMode.Read, name: "TEACK", valueProviderCallback: delegate { return transmitEnabled.Value; }) .WithFlag(22, FieldMode.Read, name: "REACK", valueProviderCallback: delegate { return receiveEnabled.Value; }) .WithValueField(23, 8, FieldMode.Read, name: "Reserved") } }); }
public TegraTimer(Machine machine) { IRQ = new GPIO(); sync = new object(); clockSource = machine.ObtainClockSource(); Reset(); }
public PL031(Machine machine) { this.machine = machine; IRQ = new GPIO(); epoch = new DateTime(1970, 1, 1); Reset(); }
public STM32LTDC(Machine machine) : base(machine) { Reconfigure(format: PixelFormat.RGBX8888); IRQ = new GPIO(); this.machine = machine; internalLock = new object(); var activeWidthConfigurationRegister = new DoubleWordRegister(this); accumulatedActiveHeightField = activeWidthConfigurationRegister.DefineValueField(0, 11, FieldMode.Read | FieldMode.Write, name: "AAH"); accumulatedActiveWidthField = activeWidthConfigurationRegister.DefineValueField(16, 12, FieldMode.Read | FieldMode.Write, name: "AAW", writeCallback: (_, __) => HandleActiveDisplayChange()); var backPorchConfigurationRegister = new DoubleWordRegister(this); accumulatedVerticalBackPorchField = backPorchConfigurationRegister.DefineValueField(0, 11, FieldMode.Read | FieldMode.Write, name: "AVBP"); accumulatedHorizontalBackPorchField = backPorchConfigurationRegister.DefineValueField(16, 12, FieldMode.Read | FieldMode.Write, name: "AHBP", writeCallback: (_, __) => HandleActiveDisplayChange()); var backgroundColorConfigurationRegister = new DoubleWordRegister(this); backgroundColorBlueChannelField = backgroundColorConfigurationRegister.DefineValueField(0, 8, FieldMode.Read | FieldMode.Write, name: "BCBLUE"); backgroundColorGreenChannelField = backgroundColorConfigurationRegister.DefineValueField(8, 8, FieldMode.Read | FieldMode.Write, name: "BCGREEN"); backgroundColorRedChannelField = backgroundColorConfigurationRegister.DefineValueField(16, 8, FieldMode.Read | FieldMode.Write, name: "BCRED", writeCallback: (_, __) => HandleBackgroundColorChange()); var interruptEnableRegister = new DoubleWordRegister(this); lineInterruptEnableFlag = interruptEnableRegister.DefineFlagField(0, FieldMode.Read | FieldMode.Write, name: "LIE"); var interruptClearRegister = new DoubleWordRegister(this); interruptClearRegister.DefineFlagField(0, FieldMode.Write, name: "CLIF", writeCallback: (old, @new) => { if(@new) IRQ.Unset(); }); interruptClearRegister.DefineFlagField(3, FieldMode.Write, name: "CRRIF", writeCallback: (old, @new) => { if(@new) IRQ.Unset(); }); lineInterruptPositionConfigurationRegister = new DoubleWordRegister(this).WithValueField(0, 11, FieldMode.Read | FieldMode.Write, name: "LIPOS"); var registerMappings = new Dictionary<long, DoubleWordRegister> { { (long)Register.BackPorchConfigurationRegister, backPorchConfigurationRegister }, { (long)Register.ActiveWidthConfigurationRegister, activeWidthConfigurationRegister }, { (long)Register.BackgroundColorConfigurationRegister, backgroundColorConfigurationRegister }, { (long)Register.InterruptEnableRegister, interruptEnableRegister }, { (long)Register.InterruptClearRegister, interruptClearRegister }, { (long)Register.LineInterruptPositionConfigurationRegister, lineInterruptPositionConfigurationRegister } }; localLayerBuffer = new byte[2][]; layer = new Layer[2]; for(var i = 0; i < layer.Length; i++) { layer[i] = new Layer(this, i); var offset = 0x80 * i; registerMappings.Add(0x84 + offset, layer[i].ControlRegister); registerMappings.Add(0x88 + offset, layer[i].WindowHorizontalPositionConfigurationRegister); registerMappings.Add(0x8C + offset, layer[i].WindowVerticalPositionConfigurationRegister); registerMappings.Add(0x94 + offset, layer[i].PixelFormatConfigurationRegister); registerMappings.Add(0x98 + offset, layer[i].ConstantAlphaConfigurationRegister); registerMappings.Add(0xAC + offset, layer[i].ColorFrameBufferAddressRegister); } registers = new DoubleWordRegisterCollection(this, registerMappings); registers.Reset(); HandlePixelFormatChange(); }
public LEUART(Machine machine) { this.machine = machine; queueLock = new object(); IRQ = new GPIO(); Reset(); }
public PL190 () { Masks = new uint[NumOfPrio + 1]; Reset(); IRQ = new GPIO(); FIQ = new GPIO(); }
public NS16550(Machine machine, bool wideRegisters = false) { this.machine = machine; mode32 = wideRegisters; IRQ = new GPIO(); Reset(); }
public SunxiHighSpeedTimer(Machine machine, long frequency) { irqEnableRegister = new DoubleWordRegister(this); irqStatusRegister = new DoubleWordRegister(this); timers = new SunxiHighSpeedTimerUnit[4]; interruptFlags = new IFlagRegisterField[4]; enableFlags = new IFlagRegisterField[4]; for(var i = 0; i < 4; ++i) { var j = i; timers[i] = new SunxiHighSpeedTimerUnit(machine, frequency); timers[i].LimitReached += () => OnTimerLimitReached(j); interruptFlags[i] = irqStatusRegister.DefineFlagField(i, FieldMode.WriteOneToClear, name: "Tx_IRQ_PEND"); enableFlags[i] = irqEnableRegister.DefineFlagField(i, name: "Tx_INT_EN"); } var innerConnections = new Dictionary<int, IGPIO>(); for(var i = 0; i < 4; ++i) { innerConnections[i] = new GPIO(); } Connections = new ReadOnlyDictionary<int, IGPIO>(innerConnections); }
public STM32_UART(Machine machine) { this.machine = machine; IRQ = new GPIO(); charFifo = new Queue<byte>(); Reset(); }
public GaislerMIC(Machine machine, uint totalNumberCPUs = 1) { this.numberOfProcessors = totalNumberCPUs; if(totalNumberCPUs > maxNumberOfProcessors) { this.Log(LogLevel.Warning, "Registration with unsupported number of CPUs, defaulting to maximum {0:X]", maxNumberOfProcessors); this.numberOfProcessors = maxNumberOfProcessors; } registers = new deviceRegisters(); registers.MultiprocessorStatus |= (((numberOfProcessors-1) << 28) & 0xF0000000); // Set Broadcast Available bit in MultiprocessorStatus register if ncpu > 1 if(this.numberOfProcessors > 1) { registers.MultiprocessorStatus |= (1u << 27); } irqs = new GPIO[numberOfProcessors]; resets = new GPIO[numberOfProcessors]; runs = new GPIO[numberOfProcessors]; set_nmi_interrupt = new bool[numberOfProcessors]; for(var i = 0; i < numberOfProcessors; i++) { irqs[i] = new GPIO(); resets[i] = new GPIO(); runs[i] = new GPIO(); interrupts[i] = new Dictionary<int, int>(); set_nmi_interrupt[i] = false; } Connections = new IGPIORedirector((int)numberOfProcessors, HandleIRQConnect); Reset(); }
public SynopsysEthernetMAC(Machine machine) : base(machine) { MAC = EmulationManager.Instance.CurrentEmulation.MACRepository.GenerateUniqueMAC(); IRQ = new GPIO(); Link = new NetworkLink(this); Reset(); }
public FT5336(Machine machine, bool isRotated = false) { this.machine = machine; this.isRotated = isRotated; IRQ = new GPIO(); Reset(); }
public GIC(int numberOfCPUs = 1, int itLinesNumber = 10) { this.numberOfCPUs = numberOfCPUs; this.itLinesNumber = itLinesNumber; var innerConnections = new Dictionary<int, IGPIO>(); for(var i = 0; i < numberOfCPUs; i++) { innerConnections[i] = new GPIO(); } Connections = new ReadOnlyDictionary<int, IGPIO>(innerConnections); privateInterrupts = new IRQState[numberOfCPUs][]; for(var i = 0; i < privateInterrupts.Length; i++) { privateInterrupts[i] = new IRQState[32]; } publicInterrupts = new IRQState[991]; privatePriorities = new byte[numberOfCPUs][]; for(var i = 0; i < privatePriorities.Length; i++) { privatePriorities[i] = new byte[32]; } publicPriorities = new byte[991]; runningPriorities = new byte[numberOfCPUs]; priorityMasks = new byte[numberOfCPUs]; enabled = new bool[numberOfCPUs]; localReceivers = new LocalGPIOReceiver[numberOfCPUs]; for(var i = 0; i < localReceivers.Length; i++) { localReceivers[i] = new LocalGPIOReceiver(i, this); } Reset(); }
public CadenceUart(Machine machine) { this.machine = machine; buffer = new Queue<byte>(); Reset(); IRQ = new GPIO(); }
public AINTC() { IRQ = new GPIO(); FIQ = new GPIO(); interrupts = new InterruptStatus[64]; SetupRegisters(); Reset(); }
public PL011(Machine machine, int size = 0x1000) { this.machine = machine; this.size = size; IRQ = new GPIO(); Reset(); idHelper = new PrimeCellIDHelper(size, new byte[] { 0x11, 0x10, 0x14, 0x00, 0x0D, 0xF0, 0x05, 0xB1 }, this); }
public GaislerUART(Machine machine) { this.machine = machine; buffer = new Queue<byte>(); IRQ = new GPIO(); registers = new register(); Reset(); }
public SMC91X(Machine machine) { this.machine = machine; MAC = EmulationManager.Instance.CurrentEmulation.MACRepository.GenerateUniqueMAC(); IRQ = new GPIO(); Link = new NetworkLink(this); Reset(); }
public UDMA(Machine machine) { engine = new DmaEngine(machine); SystemBus = machine.SystemBus; channels = new Channel[32]; IRQ = new GPIO(); Reset(); }
public MPC5567_INTC() { sync = new object(); IRQ = new GPIO(); priorities = new byte[NumberOfInterrupts]; pendingInterrupts = new bool[NumberOfInterrupts]; acknowledgedInterrupts = new Stack<int>(); }
public void ShouldPropagateConnected() { var source = new GPIO(); var destination = new MockReceiver(); source.Connect(destination, 2); var endpoint = source.Endpoint; Assert.AreEqual(2, endpoint.Number); Assert.AreEqual(destination, endpoint.Receiver); }
public MockGPIOByNumberConnectorPeripheral(int gpios) { var innerConnections = new Dictionary<int, IGPIO>(); for(int i = 0; i < gpios; i++) { innerConnections[i] = new GPIO(); } Connections = new ReadOnlyDictionary<int, IGPIO>(innerConnections); }
public CortexAGenericTimer(Machine machine, GIC gic, long genericTimerCompareValue) { var receiver = gic.GetLocalReceiver(0); irq = new GPIO(); irq.Connect(receiver, 0x01); physicalTimer1 = new CortexAGenericTimerUnit(machine, irq, genericTimerCompareValue); physicalTimer2 = new CortexAGenericTimerUnit(machine, irq, genericTimerCompareValue); virtualTimer = new CortexAGenericTimerUnit(machine, irq, genericTimerCompareValue); virtualTimer.Enabled = true; }
public OmapDma () { channels = new Channel[32]; for(int i=0;i<32;i++) { channels[i] = new Channel(); channels[i].InterruptControl = (1u<<13) | (1u<<10) | (1u<<9); } IRQ = new GPIO(); }
public CadenceGEM(Machine machine) : base(machine) { registers = new regs(); IRQ = new GPIO(); Link = new NetworkLink(this); //crc = new Crc16(); MAC = EmulationManager.Instance.CurrentEmulation.MACRepository.GenerateUniqueMAC(); sync = new object(); Reset(); }
public CortexAGlobalTimer(Machine machine, long frequency) : base(machine, frequency, long.MaxValue, long.MaxValue) { sysbus = machine.SystemBus; IRQ = new GPIO(); controlRegister = new DoubleWordRegister(this); controlRegister.DefineFlagField(0, name: "Timer enable", writeCallback: (oldValue, newValue) => Enabled = newValue, valueProviderCallback: (oldValue) => Enabled); comparatorEnabled = controlRegister.DefineFlagField(1); interruptEnabled = controlRegister.DefineFlagField(2); autoIncrementEnabled = controlRegister.DefineFlagField(3); }
public KS8851(Machine machine) { this.machine = machine; MAC = EmulationManager.Instance.CurrentEmulation.MACRepository.GenerateUniqueMAC(); currentLength = 4; request = new byte[10240]; response = new byte[10240]; packetQueue = new Queue<EthernetFrame>(); IRQ = new GPIO(); Link = new NetworkLink(this); }
public SIC() { parent = Enumerable.Range(0, 32).ToArray(); var innerConnections = new Dictionary<int, IGPIO>(); for(var i = 0; i < 32; i++) { innerConnections[i] = new GPIO(); } Connections = new ReadOnlyDictionary<int, IGPIO>(innerConnections); irq = 31; }
public SEMA4(Machine machine) { sysbus = machine.SystemBus; irqLock = new object(); locks = new Lock[NumberOfEntries]; for(var i = 0; i < locks.Length; i++) { locks[i] = new Lock(this, i); } CPU0 = new GPIO(); CPU1 = new GPIO(); }
public VybridDma(Machine mach) { machine = mach; engine = new DmaEngine(machine); channels = new Channel[32]; for (var i = 0; i < 32; i++) { channels[i] = new Channel(this, i); } IRQ = new GPIO(); }