blob: 8b6b07aece2d9c005c711026d7592be197e6c2c2 [file] [log] [blame]
// Copyright lowRISC contributors.
// Licensed under the Apache License, Version 2.0, see LICENSE for details.
// SPDX-License-Identifier: Apache-2.0
{
// Name of the sim cfg - typically same as the name of the DUT.
name:
otbn
// Top level dut name (sv module).
dut: otbn
// Top level testbench name (sv module).
tb: tb
// Simulator used to sign off this block
tool: vcs
// Fusesoc core file used for building the file list.
fusesoc_core: lowrisc:dv:otbn_sim:0.1
// Testplan hjson file.
testplan: "{proj_root}/hw/ip/otbn/data/otbn_testplan.hjson"
exports: [
{ REPO_TOP: "{proj_root}" },
]
// Import additional common sim cfg files.
// TODO: remove imported cfgs that do not apply.
import_cfgs: [
// Project wide common sim cfg file
"{proj_root}/hw/dv/tools/dvsim/common_sim_cfg.hjson",
// Config files to get the correct flags for otbn_memutil and otbn_tracer
"{proj_root}/hw/ip/otbn/dv/memutil/otbn_memutil_sim_opts.hjson",
"{proj_root}/hw/ip/otbn/dv/tracer/otbn_tracer_sim_opts.hjson",
// Common CIP test lists
"{proj_root}/hw/dv/tools/dvsim/tests/csr_tests.hjson",
"{proj_root}/hw/dv/tools/dvsim/tests/mem_tests.hjson",
"{proj_root}/hw/dv/tools/dvsim/tests/intr_test.hjson",
"{proj_root}/hw/dv/tools/dvsim/tests/tl_access_tests.hjson"
]
// Add options needed to compile against otbn_memutil and otbn_tracer
en_build_modes: ["{tool}_otbn_memutil_build_opts",
"{tool}_otbn_tracer_build_opts"]
// Add additional tops for simulation.
sim_tops: ["otbn_bind"]
// Default iterations for all tests - each test entry can override this.
reseed: 50
// Default UVM test and seq class name.
uvm_test: otbn_base_test
uvm_test_seq: otbn_base_vseq
// The default place to find and build ELF binaries. If you have
// some pre-built binaries, you can run the simulation with them by using
// --run-opts to override the otbn_elf_dir plusarg in run_opts.
otbn_elf_dir: "{run_dir}/otbn-binaries"
run_opts: ["+otbn_elf_dir={otbn_elf_dir}"]
// A default build mode, used for the tests explicitly listed below. This
// runs meson to set up a .env file, needed by gen-binaries.py to find a
// toolchain. This isn't needed for things like the automated CSR tests, and
// they won't use it because they build in a different mode anyway.
//
// This step could run either as a pre-build command or a post-build command.
// Since it's much quicker than the SV build, we do it first so that you get
// a quick result if something has gone wrong.
build_modes: [
{
name: default
pre_build_cmds: ["cd {proj_root} && BUILD_ROOT={build_dir} ./meson_init.sh"]
}
]
otbn_obj_dir: "{build_dir}/build-out"
gen_binaries_py: "{proj_root}/hw/ip/otbn/dv/uvm/gen-binaries.py"
gen_binary: "{gen_binaries_py} --count 1 --obj-dir {otbn_obj_dir}"
gen_binaries: "{gen_binaries_py} --count 10 --obj-dir {otbn_obj_dir}"
run_modes: [
// Run the random instruction generator and builds the one resulting binary
// in {otbn_elf_dir}. If you override the otbn_elf_dir plusarg with
// --run-opts, we'll still build the binary (but will ignore it).
{
name: build_otbn_rig_binary_mode
pre_run_cmds: [
"{gen_binary} --no-smoke --seed {seed} {otbn_elf_dir}"
]
}
// Build the smoke test in {otbn_elf_dir}.
{
name: build_otbn_smoke_binary_mode
pre_run_cmds: [
"{gen_binary} {otbn_elf_dir}"
]
}
// Run the random instruction generator several times and build the
// resulting binaries in {otbn_elf_dir}.
{
name: build_otbn_rig_binaries_mode
pre_run_cmds: [
"{gen_binaries} --no-smoke --seed {seed} {otbn_elf_dir}"
]
}
]
// List of test specifications.
tests: [
{
name: "otbn_smoke"
uvm_test_seq: "otbn_smoke_vseq"
en_run_modes: ["build_otbn_smoke_binary_mode"]
// Run just one smoke test: it's a fixed binary and there's not much
// interaction with the environment so there's probably not much point
// in running it loads of times.
reseed: 1
}
{
name: "otbn_single"
uvm_test_seq: "otbn_single_vseq"
en_run_modes: ["build_otbn_rig_binary_mode"]
reseed: 50
}
// This test runs 10 binaries each time, so we give it a reseed value
// that's about a tenth of the value for otbn_single: these tests should
// equally good at catching errors within a program, so there's no need to
// run it more.
{
name: "otbn_multi"
uvm_test_seq: "otbn_multi_vseq"
en_run_modes: ["build_otbn_rig_binaries_mode"]
reseed: 5
}
{
name: "otbn_reset"
uvm_test_seq: "otbn_reset_vseq"
en_run_modes: ["build_otbn_rig_binary_mode"]
reseed: 5
}
]
// List of regressions.
regressions: [
{
name: smoke
tests: ["otbn_smoke"]
}
]
}