public void Write_AddressBus_NoErrors() { var mem = MemoryTestExtensions.NewRom(new byte[] { Value }); var addressBus = mem.Address.CreateConnection(); addressBus.IsEnabled = true; addressBus.Write(new BusData16(0)); }
public void Write_DigitalSignals_NoErrors() { var mem = MemoryTestExtensions.NewRom(new byte[] { Value }); var ceProv = mem.ChipEnable.CreateConnection(); var oeProv = mem.OutputEnable.CreateConnection(); ceProv.Write(DigitalLevel.Low); oeProv.Write(DigitalLevel.Low); }
public void Read_NextAddress_CorrectValue() { var mem = MemoryTestExtensions.NewRom(new byte[] { 0, Value }); var addressBus = mem.Address.CreateConnection(); var dataBus = mem.Data.CreateConnection(); var ceProv = mem.ChipEnable.CreateConnection(); var oeProv = mem.OutputEnable.CreateConnection(); // enable chip and output ceProv.Write(DigitalLevel.Low); oeProv.Write(DigitalLevel.Low); // set address addressBus.IsEnabled = true; addressBus.Write(new BusData16(1)); // read data dataBus.Value.Equals(new BusData8(Value)).Should().BeTrue(); }
public void DisableAfterRead_DataBus_IsFloating() { var mem = MemoryTestExtensions.NewRom(new byte[] { Value }); var ceProv = mem.ChipEnable.CreateConnection(); var oeProv = mem.OutputEnable.CreateConnection(); var addressBus = mem.Address.CreateConnection(); var dataBus = mem.Data.CreateConnection(); ceProv.Write(DigitalLevel.Low); oeProv.Write(DigitalLevel.Low); addressBus.IsEnabled = true; addressBus.Write(new BusData16(0)); // disable oeProv.Write(DigitalLevel.High); dataBus.Value.IsFloating.Should().Be(true); }
public void Read_Inactive_NoValue() { var mem = MemoryTestExtensions.NewRom(new byte[] { Value }); var addressBus = mem.Address.CreateConnection(); var dataBus = mem.Data.CreateConnection(); var ceProv = mem.ChipEnable.CreateConnection(); var oeProv = mem.OutputEnable.CreateConnection(); // do not enable chip ceProv.Write(DigitalLevel.High); oeProv.Write(DigitalLevel.Low); // set address addressBus.IsEnabled = true; addressBus.Write(new BusData16(0)); // read data dataBus.Value.Equals(new BusData8()).Should().BeTrue(); }
public void Write_Rom_Throws() { var mem = MemoryTestExtensions.NewRom(new byte[] { Value }); var addressBus = mem.Address.CreateConnection(); var dataBus = mem.Data.Slave.CreateConnection(); var ceProv = mem.ChipEnable.CreateConnection(); var oeProv = mem.OutputEnable.CreateConnection(); ceProv.Write(DigitalLevel.Low); oeProv.Write(DigitalLevel.Low); // set address addressBus.IsEnabled = true; addressBus.Write(new BusData16(0)); Action fn = () => dataBus.Write(new BusData8(0)); fn.ShouldThrow <InvalidOperationException>(); }
public void Initialize_NoErrors() { var mem = MemoryTestExtensions.NewRom(new byte[] { Value }); mem.Should().NotBeNull(); }