- Start by using this template, not cloning it. This will create a copy that you own.
- Then, clone your copy into the
workspacefolder. In other words, make sure you are in~/workspace, and thengit clone <your forked copy.git>
In this lab, you will take your accelerator design from lab 1 and take it from design (RTL) to manufacturable chip (GDSII) using the OpenLane toolflow. You will then run post-layout simulation to ensure your laid out chip matches your behavioral verilog.
Openlane contains every tool needed to take your system verilog to a completed chip, provided you configure it with a json or yaml file. Create a config.json or config.yaml. (Most documentation is in json, but yaml allows comments). Here is an example:
| Json | Yaml |
{
"DESIGN_NAME": "name",
"VERILOG_FILES": "dir::rtl/*.sv",
"CLOCK_PERIOD": 10,
"CLOCK_PORT": "clk",
"FP_PDN_VOFFSET": 7,
"FP_PDN_HOFFSET": 7,
"FP_PDN_SKIPTRIM": true,
"RUN_POST_GRT_RESIZER_TIMING": true,
"RUN_POST_GRT_DESIGN_REPAIR": true
} |
---
DESIGN_NAME: name
VERILOG_FILES: dir::rtl/*.sv
CLOCK_PERIOD: 10
CLOCK_PORT: clk
# Power Distribution Stuff
FP_PDN_VOFFSET: 7
FP_PDN_HOFFSET: 7
FP_PDN_SKIPTRIM: true
RUN_POST_GRT_RESIZER_TIMING: true
RUN_POST_GRT_DESIGN_REPAIR: true |
For a more complete example, check out Openlane's Example config.json
Verilog Files can be discretely named one by one as a list.
"VERILOG_FILES": ["rtl/file1.sv",
"rtl/file2.sv"], |
VERILOG_FILES:
- rtl/file1.sv
- rtl/file2.sv |
We can also use the dir:: preprocessor command to use wildcard matching. For example, dir::rtl/*.sv goes into the rtl directory and matches all files ending in .sv. Only use this if you have a flat directory structure, meaning all of your verilog files are in one folder.
"VERILOG_FILES": "dir::rtl/*.sv", |
VERILOG_FILES: dir::rtl/*.sv |
The CLOCK_PERIOD variable controls the speed target of your design by setting the target period in nanoseconds.
- For the Skywater 130nm PDK, a typical starting value would be between 100 and 10 ns, or between 10 and 100 MHz.
- Start your clock period conservatively and lower it until you find your maximum frequency, the frequency at which you start to get warnings about setup time.
When configuring the openlane flow, nearly everything is configurable.
- Common Variables
- Most Common Variables
- PDK-Specific Variables
- Some variables are specific to the PDK being used (Skywater 130, Global Foundries 180, etc.)
- All of the Variables
- Can't find a variable? It is probably described here
With your configuration done, it is time to run the tools.
openlane --flow Classic <config.json or config.yaml>
Or using the provided Makefile:
make openlane
- The makefile creates a link to the most recent run in
runs/recentto make results easier to find.
- Openlane outputs the results of the flow in the
runsinto a folder tagged with the time/date - Each step of the flow is numbered
runs/<runDate>/01-verilator-linthas the results from the first step, linting with verilator
- A sucessful flow will create a
finaldirectory with output resultsruns/<runDate>/error.logshould be emptyruns/<runDate>/warning.logideally should be empty, but often is not- The most important warnings are timing violations. Keep your eyes out for
Setup violations foundor similar.
- The most important warnings are timing violations. Keep your eyes out for
- A failure will populate the aformentioned
error.log, and nofinaldirectory will be- Check the last (highest-numbered) step for more specific logs to see where things went wrong.
There are many ways to view your design, including:
make openroadto auto view your last designopenroad: launch withopenroad -guiand openruns/<run>/final/odb/<design>.odbmagic runs/<run>/final/mag/<design>.magto launch magic- Select your design by drawing a box around it. Then type
expand allin the magic console to see all the cells.
- Select your design by drawing a box around it. Then type
klayout runs/<run>/final/klayout_gds/<design>.klayout.gdsto view in KLayout
- Create the variable
SYNTH_AUTONAMEand set it to true to your config. Then Re-Run the flow.- This ensures logic and wires are named based on your verilog instead of arbitrarily numbered.
- Important for when we start tracing out timing paths.
- Not recomended to have this turned on all the time, can cause instability in large designs.
- Re-Run the flow (
make openlaneor likewise) - Open the timing results:
openroad-staprepnr(step 12) has before-layout timingopenroad-stapostpnr(step 56) has after-layout timing- Within each,
summary.rpthas a summary of the worst slack (WS) and total negative slack (TNS)
Note
Timing analysis uses corners to cover the slowest and fastest possible performance of your chip, based on fabrication variation and conditions.
| Process Variation | Temperature | Voltage |
|---|---|---|
| ss (slow) | 100 C | 1.6 V |
| tt (typical) | 40 C | 1.8 V |
| ff (fast) | 25 C | 1.95 V |
- Setup Violations occur when your chip's logic is too slow to meet the target frequency
- Most likely in slowest corner,
ss_100C_1.6V - Concerned with "Maxs Paths", longest and slowest paths between registers
- Most likely in slowest corner,
- Hold Violations occur when your chip's logic is too fast, causing a register's input not to be stable.
- Most likely in fastest corner,
ff_25C_1.95V - Concerned with "Min Paths", shortest and fastest paths between registers
- Most likely in fastest corner,
-
View the Max Path results in the slowest corner
runs/<run>/56-openroad-stapostpnr/max_ss_100C_1v60/max.rptshows the worst max paths.
-
Open your design in
openroadto visually view the worst max paths.make openroadwill launch openroad with timing on your most recent run.- Navigate to the timing report tab on the right and then click update.
- Click on your worst paths to see them visualized on your laid out chip.
- To use openroad manually, launch
openroadfrom the command line and input the following commands:
read_db runs/recent/final/odb/<name>.odb read_lib /foss/pdks/sky130A/libs.ref/sky130_fd_sc_hd/lib/sky130_fd_sc_hd__ss_100C_1v60.lib read_sdc runs/recent/final/sdc/<name>.sdc gui::show
Once your design has completed through the flow (or at the very least passed synthesis), you will receive a gate-level netlist, which is a verilog file of your design using only standard cell gates.
- It can be found in the
pnlfolder of your final results - In other words, look in
runs/recent/final/pnl/
This file provides a more accurate model of your design as it exists on hardware. It is important to make sure our designs work not just in the simulator but also after synthesis, which is why we often re-run our tests against the gate-level netlist model, called gate-level simulation. For gate-level simulation, we have to use Icarus (iverilog) instead of verilator, since verilator does not support certain gate-level features.
This model also needs to be powered to function correctly. Add the following to the global scope all of your testbenches, so that Power and Ground wires are added when necessary.
`ifdef USE_POWER_PINS
wire VPWR;
wire VGND;
assign VPWR=1;
assign VGND=0;
`endif
To automatically run all tests against your most recent openlane run's gate-level model, use:
make gl_tests
After running this, you may run a specific test with
GL=1 make tests/<testname>
To manually run tests against your gate-level model:
- Create a directory called
gl(trymkdir gl) and copy your model file<design>.pnl.vinto that folder. - Then, add the following line to the top of the netlist (
<design>.pnl.v):
`define UNIT_DELAY #1
`define USE_POWER_PINS
`define FUNCTIONAL
`include "libs.ref/sky130_fd_sc_hd/verilog/primitives.v"
`include "libs.ref/sky130_fd_sc_hd/verilog/sky130_fd_sc_hd.v"- This tells the simulator where to look for definitions of standard cells.
- Finally, run tests using
GL=1 make testsorGL=1 make tests/<testname>
With your design successfully passed through the OpenLane flow, it is time to find some important statistics. Find and format a report on the following:
- Design Pictures
- Maximum Frequency
- Iterate over your design, lowering period until you start to hit timing warnings.
- Critical Path
- After inspecting the post place-and-route (pnr) timing analysis (sta), what signals were involved in your critical path?
- What line(s) of your verilog code created this critical path? This may take some thinking.
- Gate Level Tests
- In-lab demo of successful tests
- Design Area and Core Area
- Check the
final/metrics.jsonof your run. Note the units are square microns / square um. - What % of a Tiny Tapeout tile is this? Look for dimensions in
um. - What % of an Efabless Chipignite die is this? Look for area in
sq mm.
- Check the

