| # Copyright 2022 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 the Kelvin core using kelvin_sim external CPU library |
| |
| |
| mach create "kelvin" |
| |
| include @sim/config/shodan_infrastructure/KelvinCPU.cs |
| EnsureTypeIsLoaded "Antmicro.Renode.Peripherals.CPU.KelvinCPU" |
| EnsureTypeIsLoaded "Antmicro.Renode.Peripherals.CPU.MlTopControlBlock" |
| |
| $platformfile?=@sim/config/platforms/kelvin.repl |
| |
| machine LoadPlatformDescription $platformfile |
| |
| $bin?=@out/kelvin/sw/bazel_out/hello_world.bin |
| $cpuLibrary?=@out/kelvin/sim/librenode_kelvin.so |
| |
| sysbus.cpu2 IsHalted true |
| |
| sysbus.cpu2 CpuLibraryPath $cpuLibrary |
| |
| macro reset |
| """ |
| sysbus LoadBinary $bin 0x5A000000 |
| # Start the vector core at address 0 of its TCM and halt / reset it. |
| sysbus.ml_top_controlblock WriteDoubleWord 0xc 3 |
| """ |
| runMacro $reset |
| |
| |
| logLevel 0 sysbus.cpu2 |
| logLevel -1 sysbus.ml_top_controlblock |