blob: 4aea9c1e75a488c7c25fb779f47b8c50fd8c0452 [file] [log] [blame]
Jon Tateed4b3302023-06-29 23:45:26 +00001# Copyright 2022 Google LLC
2#
3# Licensed under the Apache License, Version 2.0 (the "License");
4# you may not use this file except in compliance with the License.
5# You may obtain a copy of the License at
6#
7# http:#www.apache.org/licenses/LICENSE-2.0
8#
9# Unless required by applicable law or agreed to in writing, software
10# distributed under the License is distributed on an "AS IS" BASIS,
11# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12# See the License for the specific language governing permissions and
13# limitations under the License.
14
Cindy Liuf79ac9a2023-09-11 20:12:49 -070015# Renode script for testing the Kelvin core using kelvin_sim external CPU library
16
Jon Tateed4b3302023-06-29 23:45:26 +000017
18mach create "kelvin"
19
Cindy Liuf79ac9a2023-09-11 20:12:49 -070020include @sim/config/shodan_infrastructure/KelvinCPU.cs
21EnsureTypeIsLoaded "Antmicro.Renode.Peripherals.CPU.KelvinCPU"
22EnsureTypeIsLoaded "Antmicro.Renode.Peripherals.CPU.MlTopControlBlock"
23
Cindy Liue28b8ce2023-09-14 14:52:28 -070024$platformfile?=@sim/config/platforms/kelvin.repl
Jon Tateed4b3302023-06-29 23:45:26 +000025
26machine LoadPlatformDescription $platformfile
27
28$bin?=@out/kelvin/sw/bazel_out/hello_world.bin
Cindy Liuf79ac9a2023-09-11 20:12:49 -070029$cpuLibrary?=@out/kelvin/sim/librenode_kelvin.so
Jon Tateed4b3302023-06-29 23:45:26 +000030
Cindy Liuf79ac9a2023-09-11 20:12:49 -070031sysbus.cpu2 IsHalted true
32
33sysbus.cpu2 CpuLibraryPath $cpuLibrary
Jon Tateed4b3302023-06-29 23:45:26 +000034
35macro reset
36"""
Cindy Liu0b809222023-09-11 11:14:57 -070037 sysbus LoadBinary $bin 0x5A000000
Jon Tatefc2529c2023-07-10 18:10:40 +000038 # Start the vector core at address 0 of its TCM and halt / reset it.
Cindy Liuf79ac9a2023-09-11 20:12:49 -070039 sysbus.ml_top_controlblock WriteDoubleWord 0xc 3
Jon Tateed4b3302023-06-29 23:45:26 +000040"""
41runMacro $reset
Jon Tatefc2529c2023-07-10 18:10:40 +000042
Jon Tatefc2529c2023-07-10 18:10:40 +000043
Cindy Liuf79ac9a2023-09-11 20:12:49 -070044logLevel 0 sysbus.cpu2
45logLevel -1 sysbus.ml_top_controlblock