| # Copyright lowRISC contributors. |
| # Licensed under the Apache License, Version 2.0, see LICENSE for details. |
| # SPDX-License-Identifier: Apache-2.0 |
| # Build a chip-level verilator simulation |
| # Expects three arguments: the toplevel to build, the fusesoc core and |
| # the intermediate Verilated binary name |
| echo >&2 "Usage: build-chip-verilator.sh <toplevel>" |
| fusesoc_core=lowrisc:dv:chip_verilator_sim |
| fusesoc_core=lowrisc:systems:chip_englishbreakfast_verilator |
| vname=Vchip_englishbreakfast_verilator |
| util/topgen-fusesoc.py --files-root=. --topname=top_englishbreakfast |
| echo >&2 "Unknown toplevel: $tl" |
| cd $(git rev-parse --show-toplevel) |
| mkdir -p "$BIN_DIR/hw/top_${tl}" |
| run --flag=$fileset --target=sim --setup --build \ |
| --build-root="$OBJ_DIR/hw" \ |
| --verilator_options="--threads 4" |
| cp "$OBJ_DIR/hw/sim-verilator/${vname}" \ |
| "$BIN_DIR/hw/top_${tl}/Vchip_${tl}_verilator" |