public ReadLoggingWrapper(IBusPeripheral peripheral, Func <long, T> originalMethod) :
     base(peripheral, originalMethod)
 {
     mapper  = new RegisterMapper(peripheral.GetType());
     machine = peripheral.GetMachine();
     needsByteSwapForDisplay = !peripheral.IsHostEndian();
 }
        private static void LogNotTranslated(IBusPeripheral peripheral, SysbusAccessWidth operationWidth, long address, uint?value = null)
        {
            var strBldr = new StringBuilder();

            strBldr.AppendFormat("Attempt to {0} {1} from peripheral that doesn't support {1} interface.", value.HasValue ? "write" : "read", operationWidth);
            strBldr.AppendFormat(" Offset 0x{0:X}", address);
            if (value.HasValue)
            {
                strBldr.AppendFormat(", value 0x{0:X}", value.Value);
            }
            strBldr.Append(".");

            peripheral.Log(LogLevel.Warning, peripheral.GetMachine().SystemBus.DecorateWithCPUNameAndPC(strBldr.ToString()));
        }
Beispiel #3
0
 public ReadLoggingWrapper(IBusPeripheral peripheral, Func <long, T> originalMethod) :
     base(peripheral, originalMethod)
 {
     mapper  = new RegisterMapper(peripheral.GetType());
     machine = peripheral.GetMachine();
 }
Beispiel #4
0
 public WriteLoggingWrapper(IBusPeripheral peripheral, Action <long, T> originalMethod) : base(peripheral, originalMethod, null, null)
 {
     mapper  = new RegisterMapper(peripheral.GetType());
     machine = peripheral.GetMachine();
 }