| # Copyright 2024 Google LLC. |
| # Licensed under the Apache License, Version 2.0, see LICENSE for details. |
| # SPDX-License-Identifier: Apache-2.0 |
| |
| """Support rules for building target specific verilated simulators""" |
| |
| load( |
| "@lowrisc_opentitan//rules:fusesoc.bzl", |
| "fusesoc_build", |
| ) |
| |
| def target_fusesoc_build(name, output_groups): |
| """A helper macro for building verilator targets. |
| |
| Args: |
| name: The name of the top level target. |
| output_groups: Verilator testbench passed to fusesoc_build. |
| """ |
| |
| fusesoc_build( |
| name = "{}_verilator_real".format(name), |
| srcs = [ |
| ":all_files", |
| "//hw/top_{}:all_files".format(name), |
| "//hw/top_{}/dv/verilator:all_files".format(name), |
| ], |
| cores = [ |
| "//:cores", |
| "//hw/ip:BUILD", |
| "//hw/top_{}:BUILD".format(name), |
| ], |
| data = ["@lowrisc_opentitan//hw/ip/otbn:all_files"], |
| make_options = ":make_options", |
| output_groups = output_groups, |
| systems = ["lowrisc:dv:{}_verilator_sim".format(name)], |
| tags = [ |
| "manual", |
| "verilator", |
| ], |
| target = "sim", |
| ) |