forked from The-OpenROAD-Project/OpenROAD
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
73 changed files
with
2,275,154 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Submodule OpenRCX
deleted from
157b3b
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
################################################################################ | ||
## BSD 3-Clause License | ||
## | ||
## Copyright (c) 2020, OpenRoad Project UCSD | ||
## All rights reserved. | ||
## | ||
## Redistribution and use in source and binary forms, with or without | ||
## modification, are permitted provided that the following conditions are met: | ||
## | ||
## * Redistributions of source code must retain the above copyright notice, this | ||
## list of conditions and the following disclaimer. | ||
## | ||
## * Redistributions in binary form must reproduce the above copyright notice, | ||
## this list of conditions and the following disclaimer in the documentation | ||
## and#or other materials provided with the distribution. | ||
## | ||
## * Neither the name of the copyright holder nor the names of its | ||
## contributors may be used to endorse or promote products derived from | ||
## this software without specific prior written permission. | ||
## | ||
## THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" | ||
## AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE | ||
## IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE | ||
## ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE | ||
## LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR | ||
## CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF | ||
## SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS | ||
## INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN | ||
## CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) | ||
## ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE | ||
## POSSIBILITY OF SUCH DAMAGE. | ||
################################################################################ | ||
|
||
cmake_minimum_required(VERSION 3.1...3.15) | ||
|
||
project(OpenRCX VERSION 0.0.1 | ||
LANGUAGES CXX) | ||
|
||
add_subdirectory(src) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
FROM centos:centos7 AS base-dependencies | ||
LABEL maintainer "Abdelrahman Hosny <abdelrahman_hosny@brown.edu>" | ||
|
||
# Install Development Environment | ||
RUN yum group install -y "Development Tools" | ||
RUN yum install -y wget git | ||
RUN yum -y install centos-release-scl && \ | ||
yum -y install devtoolset-8 devtoolset-8-libatomic-devel | ||
RUN wget https://cmake.org/files/v3.14/cmake-3.14.0-Linux-x86_64.sh && \ | ||
chmod +x cmake-3.14.0-Linux-x86_64.sh && \ | ||
./cmake-3.14.0-Linux-x86_64.sh --skip-license --prefix=/usr/local | ||
|
||
# Install epel repo | ||
RUN wget https://dl.fedoraproject.org/pub/epel/epel-release-latest-7.noarch.rpm | ||
RUN yum install -y epel-release-latest-7.noarch.rpm | ||
|
||
# Install dev and runtime dependencies | ||
RUN yum install -y tcl-devel qt3-devel itcl-devel tcl tk ksh libstdc++ qt3 \ | ||
itcl iwidgets blt tcllib bwidget boost-devel | ||
|
||
# Install python dev | ||
RUN yum install -y https://centos7.iuscommunity.org/ius-release.rpm && \ | ||
yum update -y && \ | ||
yum install -y python36u python36u-libs python36u-devel python36u-pip | ||
|
||
RUN mkdir /.local && chmod 777 /.local && chmod 777 /usr/lib/python3.6/site-packages/ | ||
|
||
FROM base-dependencies AS builder | ||
|
||
|
||
COPY . /OpenDB | ||
WORKDIR /OpenDB | ||
|
||
# Build | ||
RUN mkdir build | ||
RUN cd build && cmake .. && make |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
pipeline { | ||
agent any | ||
stages { | ||
stage('Build') { | ||
steps { | ||
sh './jenkins/build.sh' | ||
} | ||
} | ||
stage('Test') { | ||
steps { | ||
sh './jenkins/test.sh' | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,191 @@ | ||
# OpenRCX | ||
[![Standard](https://img.shields.io/badge/C%2B%2B-17-blue)](https://en.wikipedia.org/wiki/C%2B%2B#Standardization) | ||
[![License](https://img.shields.io/badge/License-BSD%203--Clause-blue.svg)](https://opensource.org/licenses/BSD-3-Clause) | ||
|
||
OpenRCX is an parasitics Extraction tool that works on OpenDB design APIs. | ||
It extracts routed designs based on the LEF/DEF model. | ||
|
||
It extracts both Resistance and Capacitance for wires, based on coupling | ||
distance to the nearest wire and the context over and/or under and cell abstracts. | ||
The capacitance and resistance measurements are based on equations of | ||
coupling distance interpolated on exact measurements from a calibration file, | ||
called Extraction Rules File. The Extraction Rules file (RC technology file) is | ||
generated once for every process node and corner automatically. | ||
|
||
OpenRCX stores resistance, coupling capacitance and ground capacitance on OpenDB objects with direct pointers to the associated wire and via db objects | ||
and optionally can generate a .spef file. | ||
|
||
|
||
#### Tests | ||
There is a set of regression tests in /test. | ||
|
||
``` | ||
./test/regression | ||
``` | ||
|
||
#### Extraction Rules File Generation | ||
|
||
This flow generates an Extraction Rules file (RC tech file/RC Table) for OpenRCX. This file provides | ||
resistance and capacitance tables used for RC extraction for a specific process | ||
corner. | ||
|
||
The Extraction Rules file (RC technology file) is | ||
generated once for every process node and corner automatically. | ||
|
||
The detailed documentation can be found [here](doc/calibration.txt) | ||
|
||
#### Extract Parasitics | ||
|
||
``` | ||
extract_parasitics | ||
[-ext_model_file filename] pointer to The Extraction Rules file | ||
[-corner_cnt count] process corner count | ||
[-max_res ohms] combine resistors in series up to | ||
<max_res> value in OHMS | ||
[-coupling_threshold fF] coupling below the threshold is grounded | ||
[-lef_res] use per-unit RC defined in LEF | ||
[-cc_model track] calculate coupling within | ||
<cc_model> distance | ||
[-context_depth depth] caculate upper/lower coupling from | ||
<depth> level away | ||
``` | ||
|
||
The `extract_parasitics` command performs parastic extraction based on the | ||
routed design. If there are no routed design information no parasitics are | ||
added. Use `ext_model_file` to specify the Extraction Rules file used for the | ||
extraction. | ||
|
||
The `cc_model` is used to specify the maximium number of tracks on same routing level. | ||
The default value is 10. | ||
The `context_depth` option is used to specify the levels that OpenRCX needs to consider | ||
The default value is 5. | ||
for the over/under context overlap for capacitance calculation. | ||
The `max_res` command combines resistors in series up to the threshold values. | ||
|
||
The `corner_cnt` defines the number of corners used during the parastic | ||
extractions. | ||
|
||
#### Write SPEF | ||
|
||
``` | ||
write_spef | ||
[-net_id net_id] output the parasitics info for spesific nets | ||
[filename] the output filename | ||
``` | ||
|
||
The `write_spef` command writes the .spef output of the parasitics stored in the | ||
database. Use `net_id` command to write the output for spesific nets. | ||
|
||
#### Scale RC | ||
|
||
``` | ||
adjust_rc | ||
[-res_factor res] scale the res value | ||
[-cc_factor cc] scale the coupling capacitance value | ||
[-gndc_factor gndc] scale the ground cap value | ||
``` | ||
|
||
Use the `adjust_rc` command to scale the the resistance, ground, and coupling | ||
capacitance. The `res_factor` specifies the scale factor for resistance. The | ||
`cc_factor` specifies the scale factor for coupling cap. The `gndc_factor` | ||
specifies the scale factor for ground cap. | ||
|
||
#### Comparing SPEF files | ||
|
||
``` | ||
diff_spef | ||
[-file filename] specifies the input .spef filename | ||
``` | ||
|
||
`diff_spef` command compares the parasitics in the database with the parasitic | ||
information from `<file>.spef`. The output of this command is `diff_spef.out` and | ||
contains the RC numbers from the parasitics in the databse and the `<file>.spef`, | ||
and the percentage RC difference of the two data. | ||
|
||
#### Extraction Rules File Generation | ||
|
||
``` | ||
bench_wires | ||
[-cnt count] specify the metal count | ||
per pattern | ||
[-len wire_len] specify the wire length | ||
in the pattern | ||
[-s_list space_multiplier_list] list of wire spacing multiplier | ||
[-all] generate all patterns | ||
``` | ||
|
||
`bench_wires` command produces a layout which contains various patterns that | ||
are used to characterize per-unit RC. The generated patterns model the | ||
lateral, vertical, and diagonal coupling capacitance, and the ground capacitance | ||
effects. This command generates a .def file. | ||
|
||
The `cnt` command determines the number of wires in each pattern, the default | ||
values is 5. Use `len` command to change the wire length in the pattern. `all` | ||
option is used to specify all diffrent pattern geometries (over, under, | ||
over_under, and digonal). The option `all` is required. | ||
|
||
The `s_list` option specifies the lists of wire spacing multipliers from the | ||
minimum spacing defined in the LEF. The list will be the input index on the | ||
OpenRCX RC table (Extraction Rules file). | ||
|
||
This command is specifically intended for the Extraction Rules file generation | ||
only. | ||
|
||
``` | ||
bench_verilog | ||
[filename] the output verilog filename | ||
``` | ||
|
||
`bench_verilog` is used after the `bench_wires` command. This command generates | ||
verilog netlist of the generated pattern layout by the `bench_wires` | ||
command. | ||
|
||
This command is optional when running the Extraction Rules generation flow. This | ||
step is required if the favorite extraction tool (i.e., reference extractor) | ||
requires a netlist to extract parasitics of the pattern layout. | ||
|
||
``` | ||
bench_read_spef | ||
[filename] the input .spef filename | ||
``` | ||
|
||
`bench_read_spef` command reads a `<filename>.spef` file and stores the | ||
parasitics into the database. | ||
|
||
``` | ||
write_rules | ||
[-file filename] output file name | ||
[-db] read parasitics from the databse | ||
``` | ||
|
||
`write_rules` command writes the Extraction Rules file (RC technology file) | ||
for OpenRCX. It processes the parasitics data from the pattern layout generated from | ||
`bench_wires` command, and writes the Extraction Rules file with `<file>` as | ||
the output file. | ||
|
||
`db` command instructs OpenRCX to write the Extraction Rules file from | ||
the parasitics stored in the database. This option is required. | ||
|
||
This command is specifically intended for the Extraction Rules file generation | ||
purpose. | ||
|
||
### Example Scripts | ||
|
||
Example scripts demonstrating how to run OpenRCX in the OpenROAD environment on sample designs | ||
that can be found in /test. Flow tests taking sample designs from synthesis | ||
verilog to routed design in the open source technologies | ||
Sky130 is shown below. | ||
|
||
``` | ||
gcd.tcl | ||
``` | ||
|
||
Example scripts demonstrating how to run the Extraction Rules File generation | ||
can be found in this [directory](calibration/script). | ||
|
||
``` | ||
generate_patterns.tcl # generate patterns | ||
generate_rules.tcl # generate the Extraction Rules | ||
# file | ||
ext_patterns.tcl # check the accuracy of OpenRCX | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
# Clean up directory | ||
rm -rf work | ||
mkdir -p data | ||
mkdir -p work | ||
cd work | ||
|
||
# Create a soft link to openroad executable | ||
ln -s ../../../../build/src/openroad | ||
|
||
# Step A: Generate Patterns Layout that models | ||
# various capacitance and resistance | ||
# models. | ||
./openroad ../script/generate_patterns.tcl | ||
|
||
# Step B: Perform extraction using reference extractor. | ||
# The output parasitics file should placed in the | ||
# directory below. | ||
cd ./EXT | ||
|
||
################################## | ||
# Running the reference Extractor | ||
# #Put Command below | ||
################################## | ||
|
||
################################ | ||
cd .. | ||
|
||
# Step C: Generate OpenRCX tech file | ||
# (OpenRCX RC table) by converting | ||
# the parasitics extracted from the | ||
# reference extractor to a RC table. | ||
./openroad ../script/generate_rules.tcl | ||
|
||
# Step D: Perform parasitic extraction on the | ||
# pattern geometries, and compare the | ||
# parasitic result with the golden parasitics | ||
# calculated by reference extractor to evaluate | ||
# the accuracy of the OpenRCX using the generated | ||
# RC table (Extraction Rule file). | ||
./openroad ../script/ext_patterns.tcl |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
source ../script/user_env.tcl | ||
|
||
set golden_spef ../../test/generate_pattern.spefok | ||
|
||
read_lef $TECH_LEF | ||
|
||
read_def EXT/patterns.def | ||
|
||
define_process_corner -ext_model_index 0 X | ||
extract_parasitics -ext_model_file $extRules \ | ||
-cc_model 12 -max_res 0 -context_depth 10 \ | ||
-coupling_threshold 0.1 | ||
|
||
write_spef ext_patterns.spef | ||
|
||
diff_spef -file $golden_spef | ||
|
||
exit |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
################################################# | ||
# Desc: This script is used to generate patterns | ||
# geometries that model various capacitance | ||
# and resistance models | ||
# Input: tech_Lef | ||
# Output: patterns.def | ||
# patterns.v | ||
################################################# | ||
|
||
source ../script/user_env.tcl | ||
|
||
set ext_dir EXT | ||
exec mkdir -p $ext_dir | ||
|
||
# Read Technology LEF | ||
read_lef $TECH_LEF | ||
|
||
# Creates the patterns and | ||
# store it in the database | ||
bench_wires -len 100 -all | ||
|
||
# Writes the verilog netlist | ||
# of the patterns | ||
bench_verilog $ext_dir/patterns.v | ||
|
||
write_def $ext_dir/patterns.def | ||
|
||
exit |
Oops, something went wrong.