nexus: Duplicate shodan platform to nexus
Change-Id: I9b8c31ced314c01e49839c0d32bca2a085087e51
diff --git a/platforms/nexus-debug.repl b/platforms/nexus-debug.repl
new file mode 100644
index 0000000..ae7578c
--- /dev/null
+++ b/platforms/nexus-debug.repl
@@ -0,0 +1,13 @@
+// A renode platform file used by debug config
+using "sim/config/platforms/nexus.repl"
+
+
+// Override the memory size for debug workloads
+
+// RAM_SEC [‘h1000_0000 - ‘h1001_FFFF) 16M RAM for Security Core (debugging size)
+ram_sec:
+ size: 0x01000000
+
+// eFLASH [‘h2000_0000 - ‘h20FF_FFFF) 16MB eFlash for Security Core (debugging size)
+eflash:
+ size: 0x01000000
diff --git a/platforms/nexus.repl b/platforms/nexus.repl
new file mode 100644
index 0000000..243d75f
--- /dev/null
+++ b/platforms/nexus.repl
@@ -0,0 +1,43 @@
+using "sim/config/platforms/smc.repl"
+using "sim/config/platforms/secure.repl"
+using "sim/config/platforms/ml_core.repl"
+
+// To model the TLUL mailbox spec, we need a Renode peripheral that listens
+// to address ranges for both endpoints of the mailbox. This is the current
+// best way to do that, per Renode dev's recommendations.
+
+mailbox : Mailbox @ {
+ sysbus new Bus.BusMultiRegistration {
+ address: 0x40800000; // TOP_MATCHA_MAILBOX_SEC_BASE_ADDR
+ size: 0x28;
+ region: "endpoint_a"
+ };
+ sysbus new Bus.BusMultiRegistration {
+ address: 0x540F1000; // TOP_MATCHA_MAILBOX_SMC_BASE_ADDR
+ size: 0x28;
+ region: "endpoint_b"
+ }
+ }
+ endpoint_a_name: "SEC"
+ endpoint_b_name: "SMC"
+ wtirq_A -> plic@187 // kTopMatchaPlicIrqIdMailboxSecWtirq
+ rtirq_A -> plic@188 // kTopMatchaPlicIrqIdMailboxSecRtirq
+ eirq_A -> plic@189 // kTopMatchaPlicIrqIdMailboxSecEirq
+ wtirq_B -> smc_plic@10 // kTopMatchaPlicIrqIdMailboxSmcWtirq
+ rtirq_B -> smc_plic@11 // kTopMatchaPlicIrqIdMailboxSmcRtirq
+ eirq_B -> smc_plic@12 // kTopMatchaPlicIrqIdMailboxSmcEirq
+
+vec_controlblock : CPU.SpringbokRiscV32_ControlBlock @ sysbus 0x47000000
+ core: cpu2
+ mmuNumWindows: 6 // See: go/shodan-vc-memory
+ mmuVirtualWindowSize: 0x1000000
+ mmuMemorySize: 0x1000000
+ 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
+ DataFaultIRQ -> smc_plic@16 // kTopMatchaPlicIrqIdVcTopDataFault @ top_matcha.h
+
+// ISP [‘h4200_0000 - ‘h4200_FFFF) 64KB ISP registers
+// DMA Ctrl [‘h4201_0000 - ‘h4201_FFFF) 64KB DMA control interface
+// DSP Ctrl [‘h4202_0000 - ‘h4202_FFFF) 64KB Audio DSP control interface
diff --git a/shodan.resc b/shodan.resc
index 810768a..998f3fa 100644
--- a/shodan.resc
+++ b/shodan.resc
@@ -9,6 +9,9 @@
include @sim/config/shodan_infrastructure/SpringbokRiscV32.cs
EnsureTypeIsLoaded "Antmicro.Renode.Peripherals.CPU.SpringbokRiscV32"
EnsureTypeIsLoaded "Antmicro.Renode.Peripherals.CPU.SpringbokRiscV32_ControlBlock"
+include @sim/config/shodan_infrastructure/KelvinRiscV32.cs
+EnsureTypeIsLoaded "Antmicro.Renode.Peripherals.CPU.KelvinRiscV32"
+EnsureTypeIsLoaded "Antmicro.Renode.Peripherals.CPU.KelvinRiscV32_ControlBlock"
include @sim/config/shodan_infrastructure/SmcRiscV32.cs
include @sim/config/shodan_infrastructure/Mailbox.cs
include @sim/renode/tools/sel4_extensions/seL4Extensions.cs