1# The following lines are not interpreted.
2:name: Quark C1000
3:description: This script runs Zephyr shell example on Quark C1000 (32-bit x86).
4
5# The `using` command allows the user to omit a prefix when referring to a peripheral.
6# E.g. `using sysbus` allows to refer to the CPU device with `cpu` instead of `sysbus.cpu`.
7using sysbus
8# The ?= notation indicates a default value if the variable is not set.
9$name?="Quark-C1000"
10# Create a new machine and set the Monitor's context accordingly.
11mach create $name
12
13# Load the hardware description from the REPL file.
14machine LoadPlatformDescription @platforms/boards/arduino_101-shield.repl
15
16# This is a sample shell binary:
17$bin ?= @https://dl.antmicro.com/projects/renode/zephyr_shell.elf-s_398140-ed6b1a68e94b1cb8ac3cc7d80fb4d36e36a22766
18# This is a default bootloader:
19$boot ?= @https://dl.antmicro.com/projects/renode/quark_se_rom.bin-s_8192-b688c8b9380014d7deb2bd42dc218fc5ee8d1abf
20
21# Open a window for the `sysbus.uartB` device - which, in this case, is a default UART for user interaction.
22showAnalyzer uartB
23
24# The following series of commands is executed everytime the machine is reset.
25macro reset
26"""
27    # Set the WAIT_FOR_JTAG GPIO pin. The bootloader stalls if it's set to low.
28    gpio OnGPIO 15 true
29
30    # Load the bootloader. The address has to be specified as the binary files do not contain
31    # any addressing information.
32    sysbus LoadBinary $boot 0xffffe000
33    # The ELF files already contain information on where to load each part. They also provide symbols, which
34    # can be used for execution tracing.
35    sysbus LoadELF $bin
36
37    # By default, the initial PC is set to the ELF entry point. Since the bootloader has to be started before the target application,
38    # the PC needs to be set manually to the correct value.
39    sysbus.cpu PC 0xfffffff0
40"""
41
42# Run this macro once to load the binaries.
43runMacro $reset
44
45