sencha: add standalone cheriot support
This lets you run a cheriot firmware image directly in renode with
something like:
cd $ROOTDIR
renode -e "i @sim/config/cheriot.resc; start" --disable-xwt --console
(and/or passing the pathname to the ELF file as $bin).
Change-Id: I9409b438243b270b8f3b99aa5b9ae92fcbbe803d
diff --git a/cheriot.resc b/cheriot.resc
new file mode 100644
index 0000000..91e2d4e
--- /dev/null
+++ b/cheriot.resc
@@ -0,0 +1,45 @@
+# Copyright 2024 Google LLC
+#
+# Licensed under the Apache License, Version 2.0 (the "License");
+# you may not use this file except in compliance with the License.
+# You may obtain a copy of the License at
+#
+# http:#www.apache.org/licenses/LICENSE-2.0
+#
+# Unless required by applicable law or agreed to in writing, software
+# distributed under the License is distributed on an "AS IS" BASIS,
+# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+# See the License for the specific language governing permissions and
+# limitations under the License.
+
+# Renode script for testing just the Cheriot SMC core using the external CPU library
+
+mach create "cheriot"
+
+include @sim/config/shodan_infrastructure/MpactCheriotCPU.cs
+EnsureTypeIsLoaded "Antmicro.Renode.Peripherals.MpactCPU.MpactCheriotCPU"
+EnsureTypeIsLoaded "Antmicro.Renode.Peripherals.MpactCPU.MpactCheriotPeripheral"
+include @sim/config/shodan_infrastructure/SmcCheriotCPU.cs
+
+$platformfile?=@sim/config/platforms/sencha_smc.repl
+
+machine LoadPlatformDescription $platformfile
+
+$cheriotLibrary ?= @out/cheriot/sim/librenode_mpact_cheriot.so
+sysbus.cpu1 IsHalted true
+sysbus.cpu1 CpuLibraryPath $cheriotLibrary
+
+# Override cli_port to enable the command line interface on the specified port.
+$cli_port?= -1
+sysbus.cpu1 CLIPort $cli_port
+sysbus.cpu1 WaitForCLI false
+
+logLevel 0 sysbus.cpu1
+
+#$bin?=@out/matcha/hw/boot_rom.elf
+$bin?=@out/cheriot/sencha/release/cheriot/cheriot/release/soundstream-firmware
+#$bin?=@sw/cheriot-rtos/examples/01.hello_world/build/cheriot/cheriot/release/hello_world
+# Load the ELF file (useVirtualAddress = false, allowLoadsOnlyToMemory = false)
+sysbus LoadELF $bin false false
+
+sysbus.cpu1 IsHalted false