Merge "sim/config: Virtualize WMMU addresses."
diff --git a/platforms/shodan.repl b/platforms/shodan.repl
index 6431e45..cae484b 100644
--- a/platforms/shodan.repl
+++ b/platforms/shodan.repl
@@ -32,7 +32,7 @@
     mmuNumWindows: 6 // See: go/shodan-vc-memory
     mmuVirtualWindowSize: 0x1000000
     mmuMemorySize: 0x1000000
-    mmuRangeStart: 0x34000000
+    mmuRangeStart: 0x80000000
     HostReqIRQ -> smc_plic@13           // kTopMatchaPlicIrqIdVcTopHostReq @ top_matcha.h
     FinishIRQ -> smc_plic@14            // kTopMatchaPlicIrqIdVcTopFinish @ top_matcha.h
     InstructionFaultIRQ -> smc_plic@15  // kTopMatchaPlicIrqIdVcTopInstructionFault @ top_matcha.h
diff --git a/shodan.resc b/shodan.resc
index 3f2c26d..e22df1d 100644
--- a/shodan.resc
+++ b/shodan.resc
@@ -51,7 +51,7 @@
 sysbus.cpu0 PC 0x8090
 
 # Start the vector core at address 0 of its instruction TCM.
-sysbus.cpu2 PC 0x30000000
+sysbus.cpu2 PC 0x80000000
 # Set the vector core to be less interactive to IO for faster execution
 $vector_core_mips ?= 1000
 sysbus.cpu2 PerformanceInMips $vector_core_mips
@@ -61,6 +61,7 @@
 $gdb_port?=3333
 machine StartGdbServer $gdb_port false cpu0
 machine StartGdbServer $gdb_port false cpu1
+machine StartGdbServer $gdb_port false cpu2
 
 cpu0 IsHalted true
 cpu1 IsHalted true
diff --git a/shodan_infrastructure/SpringbokRiscV32.cs b/shodan_infrastructure/SpringbokRiscV32.cs
index b5faf0a..fcfb791 100644
--- a/shodan_infrastructure/SpringbokRiscV32.cs
+++ b/shodan_infrastructure/SpringbokRiscV32.cs
@@ -108,7 +108,7 @@
                             return;
                     }
 
-                    uint messagePtr = (uint)(X[rs1].RawValue);
+                    uint messagePtr = (uint)this.TranslateAddress((uint)(X[rs1].RawValue), MpuAccess.Read);
                     uint number = (uint)(X[rs2].RawValue);
 
                     byte[] messageArray = new byte[256];
@@ -211,8 +211,6 @@
             this.mmuMemorySize = mmuMemorySize;
             this.mmuVirtualWindowSize = mmuVirtualWindowSize;
 
-            Core.EnableExternalWindowMmu(true);
-
             Mmu = InitMmu(mmuRangeStart, mmuMemorySize, mmuNumWindows, mmuVirtualWindowSize);
 
             HostReqIRQ = new GPIO();
@@ -428,10 +426,6 @@
                         Mmu.SetWindowEnd(window, windowEnd); // windowLength
                         return;
                     case 8:
-                        if (value > 3)
-                        {
-                            this.Log(LogLevel.Noisy, "Window permission value {0} out of range", value);
-                        }
                         Mmu.SetWindowPrivileges(window, value);
                         return;
                     }