A Step-by-Step Guide to Installing and Running OpenSTA in a Docker Environment for Static Timing Analysis
Introduction
OpenSTA (Open Source Static Timing Analyzer) is a powerful tool used in digital design to analyze and verify the timing performance of digital circuits at the gate level. Whether you are a VLSI enthusiast or a professional looking to dive into static timing analysis, setting up OpenSTA can sometimes be a challenge, especially in a Docker environment. This guide will walk you through the process of installing OpenSTA, copying files into the Docker container, and running a sample timing analysis.
Prerequisites
Before we dive into the installation, ensure you have the following installed on your system:
- Docker: Docker allows you to create containers that encapsulate all the software dependencies and libraries needed to run OpenSTA.
- OpenSTA Dependencies: You need to ensure that the Docker container has all the necessary tools and libraries, including
cmake
,gcc
,clang
,tcl
,swig
,bison
, andflex
.
Step 1: Setting Up the Docker Container
# Use an official Ubuntu as a parent image
FROM ubuntu:20.04
# Set environment variables to non-interactive
ENV DEBIAN_FRONTEND=noninteractive
# Install necessary packages
RUN apt-get update && apt-get install -y \
build-essential \
cmake \
tcl-dev \
swig \
bison \
flex \
git \
libeigen3-dev \
libgmp-dev \
wget \
libtool \
&& rm -rf /var/lib/apt/lists/*
# Install Automake 1.14
RUN wget https://ftp.gnu.org/gnu/automake/automake-1.14.tar.gz && \
tar -zxvf automake-1.14.tar.gz && \
cd automake-1.14 && \
./configure && \
make && \
make install
# Install CUDD library
RUN git clone https://github.com/ivmai/cudd.git /cudd && \
cd /cudd && \
./configure && \
make && \
make install
# Clone the OpenSTA repository
RUN git clone https://github.com/The-OpenROAD-Project/OpenSTA.git /OpenSTA
# Create a build directory and compile OpenSTA
RUN cd /OpenSTA && \
mkdir build && \
cd build && \
cmake -DEigen3_DIR=/usr/include/eigen3 .. && \
make -j$(nproc)
# Set OpenSTA as the default command
CMD ["/OpenSTA/build/sta"]
Build and run your Docker image:
docker build -t opensta .
docker run -it opensta /bin/bash
Step 2: Running OpenSTA Inside the Docker Container
Once inside the Docker container, navigate to the directory where the sta
binary is located:
cd /OpenSTA/app
To run OpenSTA
./sta
If the installation was successful, the OpenSTA tool interface should launch without any errors or issues source test.tcl This command executes the commands specified in the “test.tcl” script file below.
read_liberty NangateOpenCellLibrary_typical.lib
read_verilog top.v
link_design top
read_sdc top.sdc
report_checks -path_delay max -format full
report_checks -path_delay min -format full
source test.tcl
Define SDC Commands (top.sdc):
create_clock -name CLK -period 1000 [get_ports clk]
set_input_delay 5 -clock CLK [get_ports a]
set_input_delay 5 -clock CLK [get_ports b]
set_output_delay 5 -clock CLK [get_ports out]
Define Netlist file (top.v)
module top(a, b, clk, reset, out);
input a, b, clk, reset;
output out;
wire y;
wire y1;
wire y2;
INV I1 ( .I(b), .ZN(y1));
DFFRNQ F1 ( .CLK(clk), .D(y1), .Q(y2), .RN(reset));
INV I2 ( .I(y2), .ZN(y3));
BUF B1 ( .I(y3), .Z(y4));
NAND2 N1( .A1(a), .A2(y4), .ZN(y5));
INV I3 ( .I(y5), .ZN(y6));
DFFRNQ F2 ( .CLK(clk), .D(y6), .Q(y7), .RN(reset));
DFFRNQ F3 ( .CLK(clk), .D(y7), .Q(y8), .RN(reset));
BUF B2 ( .I(y8), .Z(out));
endmodule
Technology Library: NangateOpenCellLibrary_typical.lib. This library file is available at
https://github.com/The-OpenROAD-Project/alpha-release/blob/master/flow/platforms/nangate45/NangateOpenCellLibrary_typical.lib
Step 3: Analyzing the Output
The image provided shows a digital circuit that includes a combination of logic gates, flip-flops, and inverters. This design is a sequential logic circuit, which is typically analyzed for timing constraints using Static Timing Analysis (STA)
After running OpenSTA, you should see a series of reports that detail the timing checks for your design. These reports are crucial for understanding whether your design meets its timing constraints. If you used the command report_checks -path_delay max > reports.txt
, the results would be saved to reports.txt
. for setup timing and report_checks -path_delay min > reports.txt
command for hold timing analysis.
Setup Timing Check
Hold Timing Check
Conclusion
Running OpenSTA in a Docker container streamlines the setup process and ensures a consistent environment for timing analysis. By following this guide, you should be able to install OpenSTA, run it within Docker, and perform static timing analysis on your digital designs. Whether you are working on a small project or a large-scale VLSI design, OpenSTA provides the tools you need to verify timing performance effectively.