This repository is a fork of chipyard, which implements a BOOM fork (boom stc) that adds support for the RISC-V Vector extension.
It currently only supports building with vcs, while the verilator build scripts exists from the original BOOM, they don't work with the modified one.
What do I need to change to make a verilator build possible?
Assistant
Other models, same or similar prompt
Responses were produced in different, uncontrolled contexts (system prompts, settings, prior turns). This is not a benchmark.
To enable a Verilator build for your fork of the Chipyard project with the BOOM STC (scalable thread core) that adds support for the RISC-V Vector extension, you'll need to make several modifications to the existing build scripts. The following steps will guide you through the necessary changes:
1. Modify the build-util.sh Script
The build-util.sh script is responsible for managing the build process for different modules. You may need to ensure that the Verilator build process is correctly set up for your modified BOOM. Here’s what to look for:
Check Configuration: Ensure that the configuration for using Verilator is properly set. Look for sections in the script that specify the build target for Verilator, such as:
bash
module_make() ( # <submodule> [configure-arg..]
# Ensure this is set to use Verilator
"${MAKE}" -C "${SRCDIR}/${1}" verilator
)
Custom Targets: If your modified BOOM has specific make targets for Verilator, ensure these are included in the script. You might need to add conditions to handle your custom build steps for the BOOM STC.
2. Update the Makefile
Ensure the Makefile for your BOOM STC implementation has the necessary targets for Verilator. You may need to derive these targets from the original BOOM implementation and modify them to accommodate any changes in your fork.
Add Verilator Targets: If they are not already present, include appropriate targets in the Makefile. For instance:
Dependencies: Ensure that all dependencies, including the RISC-V vector extensions, are included in the build process. This might mean updating file paths or including additional source files.
3. Update do-rtl-build.sh
The do-rtl-build.sh script manages the RTL build for both simulation and FPGA targets. You might need to modify it to accommodate the Verilator build setup for your fork:
Add Verilator Support: You can add a new case for handling the Verilator build:
bash
case $1 in
"verilator")
# Set the appropriate environment variables for Verilator
export VERILATOR_ROOT=<path-to-verilator>
# Call the make command for the Verilator build
run "make -C $REMOTE_MAKE_DIR verilator"
;;
esac
Path Adjustments: Ensure that paths to your modified BOOM files are correctly referenced in the build process.
4. Adjust ChipTop and Configurations
If there are any modifications in how the ChipTop or configurations are set up in your fork, ensure that these are compatible with the Verilator build process:
Clock and Reset Handling: Verify that clock and reset configurations in ChipTop.scala are compatible with Verilator. This might include ensuring that the correct clock domain configurations are passed during the build.
5. Verify Dependencies
Make sure that all dependencies required for a Verilator build are satisfied. This includes ensuring that:
RISC-V Toolchain: The RISC-V toolchain is correctly set up in your environment.
Verilator Installation: Verilator is correctly installed and its path is accessible.
6. Testing and Validation
Once the modifications are made, you should test the build process:
Run the Build: Execute the modified build scripts to ensure that the Verilator build completes successfully.
Debug Errors: If errors occur, review the logs to identify missing dependencies or incorrect paths.
Example Implementation
Here’s an illustrative example of what changes could look like in do-rtl-build.sh for adding Verilator support:
bash
case $1 in
"verilator")
run "export RISCV=\"$TOOLS_DIR\"; \
export LD_LIBRARY_PATH=\"$LD_LIB_DIR\"; \
export PATH=\"$REMOTE_VERILATOR_DIR/bin:\$PATH\"; \
make -C $REMOTE_MAKE_DIR verilator"
;;
esac
Conclusion
By carefully modifying the build scripts and ensuring that all paths and dependencies are correctly set, you should be able to successfully implement a Verilator build for your BOOM STC fork. After making these changes, run the build process and monitor for any issues that may arise, making adjustments as necessary.