Jon Tate | ed4b330 | 2023-06-29 23:45:26 +0000 | [diff] [blame] | 1 | # 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 Liu | f79ac9a | 2023-09-11 20:12:49 -0700 | [diff] [blame] | 15 | # Renode script for testing the Kelvin core using kelvin_sim external CPU library |
| 16 | |
Jon Tate | ed4b330 | 2023-06-29 23:45:26 +0000 | [diff] [blame] | 17 | |
| 18 | mach create "kelvin" |
| 19 | |
Cindy Liu | f79ac9a | 2023-09-11 20:12:49 -0700 | [diff] [blame] | 20 | include @sim/config/shodan_infrastructure/KelvinCPU.cs |
| 21 | EnsureTypeIsLoaded "Antmicro.Renode.Peripherals.CPU.KelvinCPU" |
| 22 | EnsureTypeIsLoaded "Antmicro.Renode.Peripherals.CPU.MlTopControlBlock" |
| 23 | |
Cindy Liu | e28b8ce | 2023-09-14 14:52:28 -0700 | [diff] [blame] | 24 | $platformfile?=@sim/config/platforms/kelvin.repl |
Jon Tate | ed4b330 | 2023-06-29 23:45:26 +0000 | [diff] [blame] | 25 | |
| 26 | machine LoadPlatformDescription $platformfile |
| 27 | |
| 28 | $bin?=@out/kelvin/sw/bazel_out/hello_world.bin |
Cindy Liu | f79ac9a | 2023-09-11 20:12:49 -0700 | [diff] [blame] | 29 | $cpuLibrary?=@out/kelvin/sim/librenode_kelvin.so |
Jon Tate | ed4b330 | 2023-06-29 23:45:26 +0000 | [diff] [blame] | 30 | |
Cindy Liu | f79ac9a | 2023-09-11 20:12:49 -0700 | [diff] [blame] | 31 | sysbus.cpu2 IsHalted true |
| 32 | |
| 33 | sysbus.cpu2 CpuLibraryPath $cpuLibrary |
Jon Tate | ed4b330 | 2023-06-29 23:45:26 +0000 | [diff] [blame] | 34 | |
| 35 | macro reset |
| 36 | """ |
Cindy Liu | 0b80922 | 2023-09-11 11:14:57 -0700 | [diff] [blame] | 37 | sysbus LoadBinary $bin 0x5A000000 |
Jon Tate | fc2529c | 2023-07-10 18:10:40 +0000 | [diff] [blame] | 38 | # Start the vector core at address 0 of its TCM and halt / reset it. |
Cindy Liu | f79ac9a | 2023-09-11 20:12:49 -0700 | [diff] [blame] | 39 | sysbus.ml_top_controlblock WriteDoubleWord 0xc 3 |
Jon Tate | ed4b330 | 2023-06-29 23:45:26 +0000 | [diff] [blame] | 40 | """ |
| 41 | runMacro $reset |
Jon Tate | fc2529c | 2023-07-10 18:10:40 +0000 | [diff] [blame] | 42 | |
Jon Tate | fc2529c | 2023-07-10 18:10:40 +0000 | [diff] [blame] | 43 | |
Cindy Liu | f79ac9a | 2023-09-11 20:12:49 -0700 | [diff] [blame] | 44 | logLevel 0 sysbus.cpu2 |
| 45 | logLevel -1 sysbus.ml_top_controlblock |