5.9. Sky130 + OpenROAD Tutorial
vlsi folder of this repository contains an example Hammer flow with the TinyRocketConfig from Chipyard. This example tutorial uses the built-in Sky130 technology plugin and OpenROAD tool plugin.
5.9.1. Project Structure
This example gives a suggested file structure and build system. The
vlsi/ folder will eventually contain the following files and folders:
Integration of Hammer’s build system into Chipyard and abstracts away some Hammer commands.
Hammer output directory. Can be changed with the
Will contain subdirectories such as
inputs.ymldenoting the top module and input Verilog files.
Entry point to Hammer. Contains example placeholders for hooks.
Hammer IR for this tutorial.
Hammer IR not used for this tutorial but provided as templates.
All of the elaborated Chisel and FIRRTL.
Core repository, and open-source tool and technology plugins.
5.9.3. Initial Setup
In the Chipyard root, run:
./scripts/init-vlsi.sh sky130 openroad
to pull the Hammer submodule. Note that for technologies other than
asap7, the tech plugin submodule is cloned into the
and for the commercial tool flow (set up by omitting the
openroad argument), the tool plugin submodules are cloned into the
Pull the Hammer environment into the shell:
cd vlsi export HAMMER_HOME=$PWD/hammer source $HAMMER_HOME/sourceme.sh
5.9.4. Building the Design
To elaborate the
TinyRocketConfig and set up all prerequisites for the build system to push the design and SRAM macros through the flow:
make buildfile tutorial=sky130-openroad
make buildfile generates a set of Make targets in
It needs to be re-run if environment variables are changed.
It is recommended that you edit these variables directly in the Makefile rather than exporting them to your shell environment.
For the purpose of brevity, in this tutorial we will set the Make variable
which will cause additional variables to be set in
tutorial.mk, a few of which are summarized as follows:
CONFIG=TinyRocketConfigselects the target generator config in the same manner as the rest of the Chipyard framework. This elaborates a stripped-down Rocket Chip in the interest of minimizing tool runtime.
tech_name=sky130sets a few more necessary paths in the
Makefile, such as the appropriate Hammer plugin
TECH_CONFselect the approproate YAML configuration files,
example-sky130.yml, which are described below
EXTRA_CONFSallow for additonal design-specific overrides of the Hammer IR in
VLSI_OBJ_DIR=build-sky130-openroadgives the build directory a unique name to allow running multiple flows in the same repo. Note that for the rest of the tutorial we will still refer to this directory in file paths as
build, again for brevity.
VLSI_TOPis by default
ChipTop, which is the name of the top-level Verilog module generated in the Chipyard SoC configs. By instead setting
VLSI_TOP=Rocket, we can use the Rocket core as the top-level module for the VLSI flow, which consists only of a single RISC-V core (and no caches, peripherals, buses, etc). This is useful to run through this tutorial quickly, and does not rely on any SRAMs.
5.9.5. Running the VLSI Flow
This is the entry script with placeholders for hooks. In the
ExampleDriver class, a list of hooks is passed in the
get_extra_par_hooks. Hooks are additional snippets of python and TCL (via
x.append()) to extend the Hammer APIs. Hooks can be inserted using the
make_pre/post/replacement_hook methods as shown in this example. Refer to the Hammer documentation on hooks for a detailed description of how these are injected into the VLSI flow.
This contains the Hammer configuration for this example project. Example clock constraints, power straps definitions, placement constraints, and pin constraints are given. Additional configuration for the extra libraries and tools are at the bottom.
technology.sky130.<sky130A, openram_lib> to the absolute path of the respective directories containing the Sky130 PDK and SRAM files. See the
Sky130 Hammer plugin README
for details about the PDK setup.
This contains the Hammer configuration for the OpenROAD tool flow. It selects tools for synthesis (Yosys), place and route (OpenROAD), DRC (Magic), and LVS (NetGen).
make syn tutorial=sky130-openroad
Post-synthesis logs and collateral are in
make par tutorial=sky130-openroad
After completion, the final database can be opened in an interactive OpenROAD session.
cd ./build/par-rundir ./generated-scripts/open_chip
Below is the post-PnR layout for the TinyRocketConfig in Sky130 generated by OpenROAD.
Intermediate databases are written in
build/par-rundir between each step of the
par action. These databases can be restored in an interactive OpenROAD session as desired for debugging purposes.
openroad # launch OpenROAD tool openroad> read_db pre_global_route
18.104.22.168. DRC & LVS
To run DRC & LVS:
make drc tutorial=sky130-openroad make lvs tutorial=sky130-openroad
Some DRC errors are expected from this PDK, especially with regards to the SRAMs, as explained in the Sky130 Hammer plugin README.
22.214.171.124. VLSI Flow Control
Firt, refer to the VLSI Flow Control documentation. The below examples use the
redo-par Make target to re-run only place-and-route.
redo- may be prepended to any of the VLSI flow actions to re-run only that action.
# the following two statements are equivalent because the # extraction step immediately precedes the write_design step make redo-par HAMMER_EXTRA_ARGS="--start_after_step extraction" make redo-par HAMMER_EXTRA_ARGS="--start_before_step write_design" # example of re-running only floorplanning to test out a new floorplan configuration make redo-par HAMMER_EXTRA_ARGS="--only_step floorplan_design -p example-sky130.yml"
See the OpenROAD tool plugin for the full list of OpenROAD tool steps and their implementations.
For more information about Hammer’s underlying implementation, visit the Hammer documentation website.