Home

Awesome

OpenTimer <img align="right" width="10%" src="image/logo.png">

Build Status Standard Download Version AskMe Wiki License: MIT

A High-Performance Timing Analysis Tool for VLSI Systems

Why OpenTimer?

<img align="right" width="30%" src="image/critical_path.jpg">

OpenTimer is a new static timing analysis (STA) tool to help IC designers quickly verify the circuit timing. It is developed completely from the ground up using C++17 to efficiently support parallel and incremental timing. Key features are:

Get Started with OpenTimer

The easiest way to start using OpenTimer is to use OpenTimer shell. OpenTimer shell is a powerful tool for interactive analysis and the simplest way to learn core functionalities. Compile OpenTimer and launch the shell program ot-shell under the bin directory.

~$ ./bin/ot-shell
  ____              _______              
 / __ \___  ___ ___/_  __(_)_ _  ___ ____
/ /_/ / _ \/ -_) _ \/ / / /  ' \/ -_) __/
\____/ .__/\__/_//_/_/ /_/_/_/_/\__/_/       v2
    /_/                                     
MIT License: type "license" to see more details.
For help, type "help".
For bug reports, issues, and manual, please see:
<https://github.com/OpenTimer/OpenTimer>.
ot> 

We have provided a simple design which consists of five gates (one NAND, one NOR, two INV, one FF) and one clock. Move to the folder and read this simple design.

<img align="right" src="image/simple_schematic.jpg" width="55%">
ot> cd example/simple
ot> read_celllib osu018_stdcells.lib
ot> read_verilog simple.v   
ot> read_sdc simple.sdc

Report the timing to show the most critical path.

ot> report_timing      # report the most critical path
Startpoint    : inp1
Endpoint      : f1:D
Analysis type : min
------------------------------------------------------
       Type       Delay        Time   Dir  Description
------------------------------------------------------
       port       0.000       0.000  fall  inp1
        pin       0.000       0.000  fall  u1:A (NAND2X1)
        pin       2.786       2.786  rise  u1:Y (NAND2X1)
        pin       0.000       2.786  rise  u4:A (NOR2X1)
        pin       0.181       2.967  fall  u4:Y (NOR2X1)
        pin       0.000       2.967  fall  f1:D (DFFNEGX1)
    arrival                   2.967        data arrival time

related pin      25.000      25.000  fall  f1:CLK (DFFNEGX1)
 constraint       1.518      26.518        library hold_falling
   required                  26.518        data required time
------------------------------------------------------
      slack                 -23.551        VIOLATED

The critical path originates from the primary input inp1 and feed into the data pin f1:D of the flip-flop DFFNEGX1.

Compile OpenTimer

System Requirements

OpenTimer is very self-contained and has very few dependencies. To compile OpenTimer, you need a C++17 compiler. We currently support:

In addition, you need a tcl shell interpreter:

OpenTimer has been tested to run well on Linux distributions and MAC OSX.

Build through CMake

We use CMake to manage the source and tests. We recommend using out-of-source build.

~$ git clone https://github.com/OpenTimer/OpenTimer.git
~$ cd OpenTimer
~$ mkdir build
~$ cd build
~$ cmake ../
~$ make 

After successful build, you can find binaries and libraries in the folders bin and lib, respectively.

Run Tests

OpenTimer uses Doctest for unit tests and TAU15 benchmarks for integration/regression tests. These benchmarks are generated by an industry standard timer and are being used by many EDA researchers.

~$ make test

Design Philosophy

OpenTimer has a unique software architecture to efficiently enable parallel incremental timing. We draw two levers on performance and useability by grouping each timing operation to one of the three categories, builder, action, and accessor.

TypeDescriptionExampleTime Complexity
Buildercreate lazy tasks to build an analysis frameworkread_celllib, insert_gate, set_slewO(1)
Actioncarry out builder operations to update the timingupdate_timing, report_timing, report_slackAlgorithm-dependent
Accessorsinspect the timer without changing any internal data structuresdump_timer, dump_slack, dump_net_loadOperation-dependent

Builder: OpenTimer Lineage

OpenTimer maintains a lineage graph of builder operations to create a task execution plan (TEP). A TEP starts with no dependency and keeps adding tasks to the lineage graph every time you call a builder operation. It records what transformations need to be executed when an action has been called.

The above figure shows an example lineage graph of a sequence of builder operations. The cyan path is the main lineage line with additional tasks attached to enable parallel execution. OpenTimer use Cpp-Taskflow to create dependency graphs.

Action: Update Timing

A TEP is materialized and executed when the timer is requested to perform an action operation. Each action operation triggers timing update from the earliest task to the one that produces the result of the action call. Internally, OpenTimer creates task dependency graph to update timing in parallel, including forward (slew, arrival time) and backward (required arrival time) propagations.

The figure above shows the dependency graph (forward in white, backward in cyan) to update the timing of the simple design. When an action call finishes, it cleans out the lineage graph with all timing up-to-date.

Accessor: Inspect OpenTimer

The accessor operations let you inspect the timer status and dump timing information. All accessor operations are declared as const methods in the timer class. Calling them promises not to alter any internal members. For example, you can dump the timing graph into a DOT format and use tools like GraphViz for visualization.

<img align="right" src="image/simple_graph_raw.png" width="70%">
ot> dump_graph  
digraph TimingGraph {
  "inp1";
  ...  # skip for short
  "f1:CLK" -> "f1:Q";
  "u1:B" -> "u1:Y";
  "u1:A" -> "u1:Y";
}

OpenTimer Shell

OpenTimer shell is a powerful command line tool to perform interactive analysis. It is also the easiest way to get your first timing report off the ground. The program ot-shell can be found in the folder bin/ after you Compile OpenTimer.

Commands

The table below shows a list of commonly used commands.

CommandtypeArgumentsDescriptionExample
read_celllibbuilder[-min | -max] fileread the cell library for early and late splitsread_celllib mylib.lib
read_verilogbuilderfileread the verilog netlistread_verilog mynetlist.v
read_spefbuilderfileread parasitics in SPEFread_spef myparasitics.spef
read_sdcbuilderfileread a Synopsys Design Constraint fileread_sdc myrule.sdc
update_timingactionnoneupdate the timingupdate_timing
report_timingaction[-num_paths k]report the critical pathsreport_timing -num_paths 10
report_tnsactionnonereport the total negative slackreport_tns
report_wnsactionnonereport the worst negative slackreport_wns
dump_graphaccessor[-o file]dump the timing graph to a DOT formatdump_graph
dump_timeraccessor[-o file]dump the design statisticsdump_timer

To see the full command list, visit OpenTimer Wiki.

Integrate OpenTimer to your Project

There are a number of ways to develop your project on top of OpenTimer.

Option 1: Add OpenTimer Subproject

The easiest way to build an OpenTimer application is to include it as a subproject using CMake add_subdirectory. Copy OpenTimer to your project root directory and configure your CMakeLists as follows:

cmake_minimum_required (VERSION 3.9)                  # CMake minimum version
project(app)                                          # your OpenTimer application
add_subdirectory(OpenTimer)                           # add OpenTimer project
include_directories(${PROJECT_SOURCE_DIR}/OpenTimer)  # add OpenTimer include

set(CMAKE_CXX_STANDARD 17)                            # enable c++17
set(CMAKE_CXX_STANDARD_REQUIRED ON)

find_package(Threads REQUIRED)                        # thread library (pthread)

add_executable(app app.cpp)                           # link to your app.cpp
target_link_libraries(app OpenTimer Threads::Threads stdc++fs)

Option 2: Install OpenTimer

Our project CMakeLists.txt has defined the required files to install when you hit make install. The installation paths are <prefix>/include, <prefix>/lib, and <prefix>/bin for the hpp files, library, and executable where <prefix> can be configured through the cmake variable CMAKE_INSTALL_PREFIX. The following example installs OpenTimer to /tmp.

~$ cd build/
~$ cmake ../ -DCMAKE_INSTALL_PREFIX=/tmp
~$ make 
~$ make install
~$ cd /tmp            # install OpenTimer to /tmp
~$ ls
bin/  include/  lib/  # OpenTimer headers, libraries, and binaries

To build your application on top of the OpenTimer headers and library, you need -std=c++1z and -lstdc++fs flags to enable C++17 standard and filesystem libraries.

~$ g++ app.cpp -std=c++1z -O2 -I include -L lib -lOpenTimer -lpthread -o app.out "-lstdc++fs "
~$ ./app.out

OpenTimer C++ API

The class Timer is the main entry you need to call OpenTimer in your project. The table below summarizes a list of commonly used methods.

MethodTypeArgumentReturnDescription
read_celllibbuilderpath, splitselfread the cell library for early and late splits
read_verilogbuilderpathselfread a verilog netlist
read_spefbuilderpathselfread parasitics in SPEF
read_sdcbuilderpathselfread a Synopsys Design Constraint file
update_timingactionvoidvoidupdate the timing; all timing values are up-to-date upon return
tnsactionvoidoptional of floatupdate the timing and return the total negative slack if exists
wnsactionvoidoptional of floatupdate the timing and return the worst negative slack if exists
dump_graphaccessorostreamvoiddump the timing graph in DOT format to an output stream
dump_timeraccessorostreamvoiddump the design statistics to an output stream

All public methods are thread-safe as a result of OpenTimer lineage. The example below shows an OpenTimer application and the use of builder, action, and accessor API.

#include <ot/timer/timer.hpp>                     // top-level header to include

int main(int argc, char *argv[]) {
  
  ot::Timer timer;                                // create a timer instance (thread-safe)
  
  timer.read_celllib("simple.lib", std::nullopt)  // read the library (O(1) builder)
       .read_verilog("simple.v")                  // read the verilog netlist (O(1) builder)
       .read_spef("simple.spef")                  // read the parasitics (O(1) builder)
       .read_sdc("simple.sdc")                    // read the design constraints (O(1) builder)
       .update_timing();                          // update timing (O(1) builder)

  if(auto tns = timer.report_tns(); tns) std::cout << "TNS: " << *tns << '\n';  // (O(N) action)
  if(auto wns = timer.report_wns(); wns) std::cout << "WNS: " << *wns << '\n';  // (O(N) action)
  
  timer.dump_timer(std::cout);                    // dump the timer details (O(1) accessor)
  
  return 0;
}

To see the full API list, visit OpenTimer Wiki.

Examples

The folder example contains several examples and is a great place to learn how to use OpenTimer.

ExampleDescriptionLibrary
simpleA timing report example on a sequential circuit design.OSU Free PDK 45nm
incrementalAn incremental timing example to create a sequential design from the ground up using OpenTimer's C++ APIOSU Free PDK 45nm
unitA dimensional analysis example with different time unit conversions.OSU Free PDK 45nm
sizerA gate-sizing example on a design with six NAND2 cells.NanGate 45nm Open Cell Library
optimizerA timing-driven optimization example plus incremental timing update.TAU15 contest library

The folder benchmark contains more designs and they are mainly used for internal regression and integration tests.

Who is Using OpenTimer?

OpenTimer is an award-winning tools. It won ACM TAU Timing Analysis Contests multiple times (1st Place in 2014, 2nd Place in 2015, and 1st Place in 2016), the Special Price in the 2016 LibreCores Design Contest, and the Best Tool Winner in the 2018 WOSET at ICCAD. Many industry and academic people are using OpenTimer in their projects:

<img src="image/tau16.png" width="100px"><img src="image/tau17.png" width="100px"><img src="image/tau18.png" width="100px"><img src="image/tau19.png" width="100px"><img src="image/CAD-contest.png" width="100px"><img src="image/vsd.jpg" width="100px"><img src="image/ophidian.png" width="100px"><img src="image/cloudv.png" width="100px"><img src="image/lgraph.png" width="100px"><img src="image/qflow.png" width="100px">

Please don't hesitate to let me know if I forgot your project!

Get Involved

Contributors & Acknowledgment

OpenTimer is being actively developed and contributed by the following people:

<!-- | [<img src="image/twhuang.jpg" width="100px">][Tsung-Wei Huang] | [<img src="image/mdfwong.jpg" width="100px">][Martin Wong] | [<img src="image/cxlin.jpg" width="100px">][Chun-Xun Lin] | [<img src="image/kunal_ghosh.jpg" width="100px">][Kunal Ghosh] | [<img src="image/pei_yu_lee.jpg" width="100px">][Pei-Yu Lee] | [<img src="image/jin_hu.jpg" width="100px">][Jin Hu] | [<img src="image/myung_chul_kim.jpg" width="100px">][Myung-Chul Kim] | | :---: | :---: | :---: | :---: | :---: | :---: | :---: | | [<img src="image/george_chen.jpg" width="100px">][George Chen]| [<img src="image/poyi.jpg" width="100px">][Pao-I Chen] | -->

Meanwhile, we appreciate the support from many organizations for our development of OpenTimer. Please don't hesitate to let me know if I forgot you!

<img src="image/uiuc.png" width="100px"><img src="image/csl.png" width="100px"><img src="image/nsf.png" width="100px"><img src="image/darpa.png" width="100px"><img src="image/vsd.jpg" width="100px">

License

<img align="right" src="http://opensource.org/trademarks/opensource/OSI-Approved-License-100x137.png">

OpenTimer is licensed under the MIT License:

Copyright © 2018 Dr. Tsung-Wei Huang and Dr. Martin Wong

The University of Illinois at Urbana-Champaign, IL, USA

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.


The core of OpenTimer is under MIT license. However, it is built, tested, and documented using several third-party tools and services. Thanks a lot!

You can find a copy of these licenses under the folder licenses.