| # Copyright 2025 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 |
| # |
| # https://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. |
| |
| import cocotb |
| import numpy as np |
| |
| from bazel_tools.tools.python.runfiles import runfiles |
| from kelvin_test_utils.core_mini_axi_interface import CoreMiniAxiInterface |
| |
| @cocotb.test() |
| async def core_mini_axi_tutorial(dut): |
| """Testbench to run your Kelvin program.""" |
| # Test bench setup |
| core_mini_axi = CoreMiniAxiInterface(dut) |
| await core_mini_axi.init() |
| await core_mini_axi.reset() |
| cocotb.start_soon(core_mini_axi.clock.start()) |
| |
| # TODO: Load your program into ITCM with "load_elf" |
| |
| # TODO: Write your program inputs |
| |
| # TODO: Run your program and wait for halted |
| |
| # TODO: Read your program outputs and print the result |