Skip to content

Latest commit

 

History

History

Folders and files

NameName
Last commit message
Last commit date

parent directory

..
 
 
 
 
 
 
 
 

README.md

Physical Design Labs using OpenLANE and Sky130 PDK

Objective

To perform hands-on Physical Design labs using a pre-configured VDI image and understand the complete hierarchy of digital and mixed-signal design implementation — from standard cell design to DRC and STA validation.

alt text

Table of Contents

1. Inception of open-source EDA, OpenLANE and Sky130 PDK

Theory

Click to expand

Package

  • In any embedded board we have seen, the part of the board we consider as the chip is only the PACKAGE of the chip which is nothing but a protective layer or packet bound over the actual chip and the actual manufatured chip is usually present at the center of a package wherein, the connections from package is fed to the chip by WIRE BOUND method which is none other than basic wired connection.

alt text alt text alt text

Chip

  • Now, taking a look inside the chip, all the signals from the external world to the chip and vice versa is passed through PADS. The area bound by the pads is CORE where all the digital logic of the chip is placed. Both the core and pads make up the DIE which is the basic manufacturing unit in regards to semiconductor chips. alt text

  • FOUNDRY is the place where the semiconductor chips are manufactured and FOUNDRY IP's are Intellectual Properties based on a specific foundry and these IP's require a specific level of intelligence to be produced whereas, repeatable digital logic blocks are called MACROS. alt text

ISA (Intruction Set Architecture)

  • A C program which has to be run on a specific hardware layout which is the interior of a chip in your laptop, there is certain flow to be followed.
  • Initially, this particular C program is compiled in it's assembly language program which is nothing but RISC-V ISA (Reduced Instruction Set Compting - V Intruction Set Architecture).
  • Following this, the assembly language program is then converted to machine language program which is the binary language logic 0 and 1 which is understood by the hardware of the computer.
  • Directly after this, we've to implement this RISC-V specification using some RTL (a Hardware Description Language). Finally, from the RTL to Layout it is a standard PnR or RTL to GDSII flow.

alt text

  • For an application software to be run on a hardware there are several processes taking place. To begin with, the apps enters into a block called system software and it converts the application program to binary language. There are various layers in system software in which the major layers or components are OS (Operating System), Compiler and Assembler.
  • At first the OS outputs are small function in C, C++, VB or Java language which are taken by the respective compiler and converted into instructions and the syntax of these instructions varies with the hardware architecture on which the system is implemented.
  • Then, the job of the assembler is to take these instructions and convert it into it's binary format which is basically called as a machine language program. Finally, this binary language is fed to the hardware and it understands the specific functions it has to perform based on the binary code it receives.

alt text

  • For example, if we take a stopwatch app on RISC-V core, then the output of the OS could be a small C function which enters into the compiler and we get output RISC-V instructions following this, the output of the assembler will be the binary code which enters into your chip layout.

alt text

  • For the above stopwatch the following are the input and output of the compiler and assembler.

alt text

  • The output of the compiler are instructions and the output of the assembler is the binary pattern. Now, we need some RTL (a Hardware Description Language) which understands and implements the particular instructions. Then, this RTL is synthesised into a netlist in form of gates which is fabricated into the chip through a physical design implementation.

alt text

  • There are mainly 3 different parts in this course. They are:
  1. RISC-V ISA
  2. RTL and synthesis of RISC-V based CPU core - picorv32
  3. Physical design implementation of picorv32

alt text

Open-source Implementation

  • For open-source ASIC design implemantation, we require the following enablers to be readily available as open-source versions. They are:-
  1. RTL Designs
  2. EDA Tools
  3. PDK Data
  • Initially in the early ages, the design and fabrication of IC's were tightly coupled and were only practiced by very few companies like TI, Intel, etc.
  • In 1979, Lynn Conway and Carver Mead came up with an idea to saperate the design from the fabrication and to do this they inroduced structured design methodologies based on the λ-based design rules and published the first VLSI book "Introduction to VLSI System" which started the VLSI education.
  • This methodology resulted in the emergence of the design only companies or "Fabless Companies" and fabrication only companies that we usually refer to as "Pure Play Fabs".
  • The inteface between the designers and the fab by now became a set of data files and documents, that are reffered to as the "Process Design Kits (PDKs)".
  • The PDK include but not limited to Device Models, Technology Information, Design Rules, Digital Standard Cell Libraries, I/O Libraries and many more.
  • Since, the PDK contained variety of informations, and so they were distributed only under NDAs (Non-Disclosure Agreements) which made it in-accessible to the public.
  • Recently, Google worked out an agreement with skywater to open-source the PDK for the 130nm process by skywater Technology, as a result on 30 June 2020 Google released the first ever open-source PDK.

alt text

  • ASIC design is a complex step that involves tons of steps, various methodologies and respective EDA tools which are all required for successful ASIC implementation which is achieved though an ASIC flow which is nothing but a piece of software that pulls different tools togather to carry out the design process.

alt text

OpenLANE Open-source ASIC Design Implementation Flow

  • The main objective of the ASIC Design Flow is to take the design from the RTL (Register Transfer Level) all the way to the GDSII, which is the format used for the final fabrication layout.

alt text

  • Synthesis is the process of convertion or translation of design RTL into circuits made out of Standard Cell Libraries (SCL) the resultant circuit is described in HDL and is usually reffered to as the Gate-Level Netlist.
  • Gate-Level Netlist is functionally equivalent to the RTL.

alt text

  • The fundemental building blocks which are the standard cells have regular layouts.
  • Each cell has different views/models which are utilised by different EDA tools like liberty view with electrical models of the cells, HDL behavioral models, SPICE or CDL views of the cells, Layout view which include GDSII view which is the detailed view and LEF view which is the abstract view.

alt text

  • Chip Floor Planning

alt text

  • Macro Floor Planning

alt text

  • Power Planning typically uses upper metal layers for power distribution since thay are thicker than lower metal layers and so have lower resistance and PP is done to avoid electron migration and IR drops.

alt text

  • Placement

alt text

  • Global placement provide approximate locations for all cells based on connectivity but in this stage the cells may be overlapped on each other and in detailed placement the positions obtained from global placements are minimally altered to make it legal (non-overlapping and in site-rows)

alt text

  • Clock Tree Synthesis

alt text

  • Clock skew is the time difference in arrival of clock at different components.
  • Routing

alt text

  • skywater PDK has 6 routing layers in which the lowest layer is called the local interconnect layer which is a Titanium Nitride layer the following 5 layers are all Aluminium layers.

alt text

  • Global and Detailed Routing

alt text

  • Once done with the routing the final layout can be generated which undergoes various Sign-Off checks.
  • Design Rules Checking (DRC) which verifies that the final layout honours all design fabrication rules.
  • Layout Vs Schematic (LVS) which verifies that the final layout functionality matches the gate-level netlist that we started with.
  • Static Timing Analysis (STA) to verify that the design runs at the designated clock frequency.

alt text alt text alt text alt text alt text alt text alt text alt text alt text alt text alt text alt text alt text alt text alt text alt text alt text alt text alt text alt text alt text alt text alt text alt text alt text alt text alt text alt text alt text alt text alt text alt text

Implementation

Section 1 tasks:-

  1. Run 'picorv32a' design synthesis using OpenLANE flow and generate necessary outputs.
  2. Calculate the flop ratio.
$$Flop\ Ratio = \frac{Number\ of\ D\ Flip\ Flops}{Total\ Number\ of\ Cells}$$ $$Percentage\ of\ DFF's = Flop\ Ratio * 100$$
  • All section 1 logs, reports and results can be found in following run folder: 27-10_17-46

1. Run 'picorv32a' design synthesis using OpenLANE flow and generate necessary outputs

Commands to invoke the OpenLANE flow and perform synthesis

# Change directory to openlane flow directory
cd Desktop/work/tools/openlane_working_dir/openlane

# alias docker='docker run -it -v $(pwd):/openLANE_flow -v $PDK_ROOT:$PDK_ROOT -e PDK_ROOT=$PDK_ROOT -u $(id -u $USER):$(id -g $USER) efabless/openlane:v0.21'
# Since we have aliased the long command to 'docker' we can invoke the OpenLANE flow docker sub-system by just running this command
docker
# Now that we have entered the OpenLANE flow contained docker sub-system we can invoke the OpenLANE flow in the Interactive mode using the following command
./flow.tcl -interactive

# Now that OpenLANE flow is open we have to input the required packages for proper functionality of the OpenLANE flow
package require openlane 0.9

# Now the OpenLANE flow is ready to run any design and initially we have to prep the design creating some necessary files and directories for running a specific design which in our case is 'picorv32a'
prep -design picorv32a

# Now that the design is prepped and ready, we can run synthesis using following command
run_synthesis

# Exit from OpenLANE flow
exit

# Exit from OpenLANE flow docker sub-system
exit

Screenshots of running each commands

alt text alt text alt text alt text

2. Calculate the flop ratio

Screenshots of synthesis statistics report file with required values highlighted

alt text alt text alt text

Calculation of Flop Ratio and DFF % from synthesis statistics report file

$$Flop\ Ratio = \frac{1613}{14876} = 0.108429685$$ $$Percentage\ of\ DFF's = 0.108429685 * 100 = 10.84296854\ \%$$

alt text

Section 2 - Good floorplan vs bad floorplan and introduction to library cells

Theory

Click to expand

alt text alt text alt text alt text alt text alt text alt text alt text alt text alt text alt text alt text alt text alt text alt text alt text alt text alt text alt text alt text alt text alt text alt text alt text alt text alt text alt text alt text alt text alt text alt text alt text alt text alt text alt text alt text alt text alt text alt text alt text alt text alt text alt text alt text alt text alt text alt text

Implementation

Section 2 tasks:-

  1. Run 'picorv32a' design floorplan using OpenLANE flow and generate necessary outputs.
  2. Calculate the die area in microns from the values in floorplan def.
  3. Load generated floorplan def in magic tool and explore the floorplan.
  4. Run 'picorv32a' design congestion aware placement using OpenLANE flow and generate necessary outputs.
  5. Load generated placement def in magic tool and explore the placement.
$$Area\ of\ die\ in\ microns = Die\ width\ in\ microns * Die\ height\ in\ microns$$
  • All logs, reports and results can be found in following run folder: 30-10_16-34

1. Run 'picorv32a' design floorplan using OpenLANE flow and generate necessary outputs.

Commands to invoke the OpenLANE flow and perform floorplan

# Change directory to openlane flow directory
cd Desktop/work/tools/openlane_working_dir/openlane

# alias docker='docker run -it -v $(pwd):/openLANE_flow -v $PDK_ROOT:$PDK_ROOT -e PDK_ROOT=$PDK_ROOT -u $(id -u $USER):$(id -g $USER) efabless/openlane:v0.21'
# Since we have aliased the long command to 'docker' we can invoke the OpenLANE flow docker sub-system by just running this command
docker
# Now that we have entered the OpenLANE flow contained docker sub-system we can invoke the OpenLANE flow in the Interactive mode using the following command
./flow.tcl -interactive

# Now that OpenLANE flow is open we have to input the required packages for proper functionality of the OpenLANE flow
package require openlane 0.9

# Now the OpenLANE flow is ready to run any design and initially we have to prep the design creating some necessary files and directories for running a specific design which in our case is 'picorv32a'
prep -design picorv32a

# Now that the design is prepped and ready, we can run synthesis using following command
run_synthesis

# Now we can run floorplan
run_floorplan

Screenshot of floorplan run

alt text alt text alt text alt text

2. Calculate the die area in microns from the values in floorplan def

Screenshot of contents of floorplan def alt text alt text

According to floorplan def

$$1000\ Unit\ Distance = 1\ Micron$$ $$Die\ width\ in\ unit\ distance = 660685 - 0 = 660685$$ $$Die\ height\ in\ unit\ distance = 671405 - 0 = 671405$$ $$Distance\ in\ microns = \frac{Value\ in\ Unit\ Distance}{1000}$$ $$Die\ width\ in\ microns = \frac{660685}{1000} = 660.685\ Microns$$ $$Die\ height\ in\ microns = \frac{671405}{1000} = 671.405\ Microns$$ $$Area\ of\ die\ in\ microns = 660.685 * 671.405 = 443587.212425\ Square\ Microns$$

3. Load generated floorplan def in magic tool and explore the floorplan

Commands to load floorplan def in magic in another terminal

# Change directory to path containing generated floorplan def
cd Desktop/work/tools/openlane_working_dir/openlane/designs/picorv32a/runs/17-03_12-06/results/floorplan/

# Command to load the floorplan def in magic tool
magic -T /home/vsduser/Desktop/work/tools/openlane_working_dir/pdks/sky130A/libs.tech/magic/sky130A.tech lef read ../../tmp/merged.lef def read picorv32a.floorplan.def &

Screenshots of floorplan def in magic alt text

Equidistant placement of ports alt text

Port layer as set through config.tcl alt text alt text alt text

Decap Cells and Tap Cells alt text alt text

Diogonally equidistant Tap cells alt text

Unplaced standard cells at the origin alt text alt text

4. Run 'picorv32a' design congestion aware placement using OpenLANE flow and generate necessary outputs

Command to run placement

# Congestion aware placement by default
run_placement

Screenshots of placement run alt text alt text

5. Load generated placement def in magic tool and explore the placement

Commands to load placement def in magic in another terminal

# Change directory to path containing generated placement def
cd Desktop/work/tools/openlane_working_dir/openlane/designs/picorv32a/runs/17-03_12-06/results/placement/

# Command to load the placement def in magic tool
magic -T /home/vsduser/Desktop/work/tools/openlane_working_dir/pdks/sky130A/libs.tech/magic/sky130A.tech lef read ../../tmp/merged.lef def read picorv32a.placement.def &

Screenshots of floorplan def in magic alt text

Standard cells legally placed alt text alt text alt text alt text alt text

Commands to exit from current run

# Exit from OpenLANE flow
exit

# Exit from OpenLANE flow docker sub-system
exit

3. Design library cell using Magic Layout and ngspice characterization

Theory

Click to expand

alt text alt text alt text alt text alt text alt text alt text alt text alt text alt text alt text alt text alt text alt text alt text alt text alt text alt text alt text alt text alt text alt text alt text alt text alt text alt text alt text alt text alt text alt text alt text alt text alt text alt text alt text alt text alt text alt text alt text alt text alt text alt text alt text alt text alt text alt text alt text alt text alt text alt text alt text alt text alt text alt text alt text alt text alt text alt text alt text alt text alt text alt text alt text alt text alt text alt text alt text alt text alt text alt text alt text alt text alt text alt text alt text alt text alt text alt text alt text alt text alt text alt text alt text alt text alt text alt text alt text alt text alt text alt text alt text alt text alt text alt text alt text alt text alt text alt text alt text alt text alt text alt text alt text alt text alt text alt text alt text alt text alt text alt text alt text alt text alt text alt text alt text alt text alt text alt text alt text alt text alt text alt text alt text alt text alt text alt text alt text alt text alt text alt text alt text alt text alt text alt text alt text alt text alt text alt text alt text alt text alt text alt text alt text alt text alt text alt text alt text alt text alt text alt text alt text alt text

Implementation

  • Section 3 tasks:-
  1. Clone custom inverter standard cell design from github repository: Standard cell design and characterization using OpenLANE flow.
  2. Load the custom inverter layout in magic and explore.
  3. Spice extraction of inverter in magic.
  4. Editing the spice model file for analysis through simulation.
  5. Post-layout ngspice simulations.
  6. Find problem in the DRC section of the old magic tech file for the skywater process and fix them.

1. Clone custom inverter standard cell design from github repository

# Change directory to openlane
cd Desktop/work/tools/openlane_working_dir/openlane

# Clone the repository with custom inverter design
git clone https://github.com/nickson-jose/vsdstdcelldesign

# Change into repository directory
cd vsdstdcelldesign

# Copy magic tech file to the repo directory for easy access
cp /home/vsduser/Desktop/work/tools/openlane_working_dir/pdks/sky130A/libs.tech/magic/sky130A.tech .

# Check contents whether everything is present
ls

# Command to open custom inverter layout in magic
magic -T sky130A.tech sky130_inv.mag &

Screenshot of commands run alt text

2. Load the custom inverter layout in magic and explore

Screenshot of custom inverter layout in magic alt text

NMOS and PMOS identified alt text alt text

Output Y connectivity to PMOS and NMOS drain verified alt text

PMOS source connectivity to VDD (here VPWR) verified alt text

NMOS source connectivity to VSS (here VGND) verified alt text

Deleting necessary layout part to see DRC error alt text

3. Spice extraction of inverter in magic

Commands for spice extraction of the custom inverter layout to be used in tkcon window of magic

# Check current directory
pwd

# Extraction command to extract to .ext format
extract all

# Before converting ext to spice this command enable the parasitic extraction also
ext2spice cthresh 0 rthresh 0

# Converting to ext to spice
ext2spice

Screenshot of tkcon window after running above commands alt text

Screenshot of created spice file alt text

4. Editing the spice model file for analysis through simulation

Measuring unit distance in layout grid alt text

Final edited spice file ready for ngspice simulation alt text

5. Post-layout ngspice simulations

Commands for ngspice simulation

# Command to directly load spice file for simulation to ngspice
ngspice sky130_inv.spice

# Now that we have entered ngspice with the simulation spice file loaded we just have to load the plot
plot y vs time a

Screenshots of ngspice run alt text

Screenshot of generated plot alt text

Rise transition time calculation

$$Rise\ transition\ time = Time\ taken\ for\ output\ to\ rise\ to\ 80\% - Time\ taken\ for\ output\ to\ rise\ to\ 20\%$$ $$20\%\ of\ output = 660\ mV$$ $$80\%\ of\ output = 2.64\ V$$

20% Screenshots alt text alt text alt text

80% Screenshots alt text alt text

$$Rise\ transition\ time = 2.24638 - 2.18242 = 0.06396\ ns = 63.96\ ps$$

Fall transition time calculation

$$Fall\ transition\ time = Time\ taken\ for\ output\ to\ fall\ to\ 20\% - Time\ taken\ for\ output\ to\ fall\ to\ 80\%$$ $$20\%\ of\ output = 660\ mV$$ $$80\%\ of\ output = 2.64\ V$$

20% Screenshots

alt text

80% Screenshots

alt text alt text

$$Fall\ transition\ time = 4.0957 - 4.0207 = 0.075\ ns = 75\ ps$$

Rise Cell Delay Calculation

$$Rise\ Cell\ Delay = Time\ taken\ for\ output\ to\ rise\ to\ 50\% - Time\ taken\ for\ input\ to\ fall\ to\ 50\%$$ $$50\%\ of\ 3.3\ V = 1.65\ V$$

50% Screenshots alt text

$$Rise\ Cell\ Delay = 2.21157 - 2.15005 = 0.06152\ ns = 61.52\ ps$$

Fall Cell Delay Calculation

$$Fall\ Cell\ Delay = Time\ taken\ for\ output\ to\ fall\ to\ 50\% - Time\ taken\ for\ input\ to\ rise\ to\ 50\%$$ $$50\%\ of\ 3.3\ V = 1.65\ V$$

50% Screenshots alt text

$$Fall\ Cell\ Delay = 4.07 - 4.05 = 0.02\ ns = 20\ ps$$

6. Find problem in the DRC section of the old magic tech file for the skywater process and fix them

Link to Sky130 Periphery rules: https://skywater-pdk.readthedocs.io/en/main/rules/periphery.html

Commands to download and view the corrupted skywater process magic tech file and associated files to perform drc corrections

# Change to home directory
cd

# Command to download the lab files
wget http://opencircuitdesign.com/open_pdks/archive/drc_tests.tgz

# Since lab file is compressed command to extract it
tar xfz drc_tests.tgz

# Change directory into the lab folder
cd drc_tests

# List all files and directories present in the current directory
ls -al

# Command to view .magicrc file
gvim .magicrc

# Command to open magic tool in better graphics
magic -d XR &

Screenshots of commands run alt text alt text

Screenshot of .magicrc file alt text

  • Incorrectly implemented poly.9 simple rule correction

Screenshot of poly rules alt text alt text alt text alt text alt text alt text alt text alt text alt text alt text alt text alt text alt text alt text alt text

Incorrectly implemented poly.9 rule no drc violation even though spacing < 0.48u alt text alt text alt text alt text alt text alt text

New commands inserted in sky130A.tech file to update drc alt text alt text alt text alt text

Commands to run in tkcon window

# Loading updated tech file
tech load sky130A.tech

# Must re-run drc check to see updated drc errors
drc check

# Selecting region displaying the new errors and getting the error messages 
drc why

Screenshot of magic window with rule implemented alt text alt text alt text alt text

  • Incorrectly implemented nwell.4 complex rule correction

Screenshot of nwell rules alt text alt text alt text

Incorrectly implemented nwell.4 rule no drc violation even though no tap present in nwell alt text alt text alt text

New commands inserted in sky130A.tech file to update drc alt text alt text alt text alt text alt text alt text alt text alt text alt text

Commands to run in tkcon window

# Loading updated tech file
tech load sky130A.tech

# Change drc style to drc full
drc style drc(full)

# Must re-run drc check to see updated drc errors
drc check

# Selecting region displaying the new errors and getting the error messages 
drc why

Screenshot of magic window with rule implemented alt text alt text alt text

4. Pre-layout timing analysis and importance of good clock tree

Theory

Click to expand

alt text alt text alt text alt text alt text alt text alt text alt text alt text alt text alt text alt text alt text alt text alt text alt text alt text alt text alt text alt text alt text alt text alt text alt text alt text alt text alt text alt text alt text alt text alt text alt text

Implementation

  • Section 4 tasks:-
  1. Fix up small DRC errors and verify the design is ready to be inserted into our flow.
  2. Save the finalized layout with custom name and open it.
  3. Generate lef from the layout.
  4. Copy the newly generated lef and associated required lib files to 'picorv32a' design 'src' directory.
  5. Edit 'config.tcl' to change lib file and add the new extra lef into the openlane flow.
  6. Run openlane flow synthesis with newly inserted custom inverter cell.
  7. Remove/reduce the newly introduced violations with the introduction of custom inverter cell by modifying design parameters.
  8. Once synthesis has accepted our custom inverter we can now run floorplan and placement and verify the cell is accepted in PnR flow.
  9. Do Post-Synthesis timing analysis with OpenSTA tool.
  10. Make timing ECO fixes to remove all violations.
  11. Replace the old netlist with the new netlist generated after timing ECO fix and implement the floorplan, placement and cts.
  12. Post-CTS OpenROAD timing analysis.
  13. Explore post-CTS OpenROAD timing analysis by removing 'sky130_fd_sc_hd__clkbuf_1' cell from clock buffer list variable 'CTS_CLK_BUFFER_LIST'.
  • Section 4 - reports and logs can be found in the following folder:

Section 4 - (vsdstdcelldesign)

  • Section 4 - reports and logs can be found in the following folder:

Section 4 - (src)

  • Section 4 - Task 5 files, reports and logs can be found in the following folder:

Section 4 - (picorv32a)

  • Section 4 - logs, reports and results can be found in following run folder:

Section 4 - (11-11_13-20)

  • Section 4 - Tasks 9 to 11 logs, reports and results can be found in following run folder:

Section 4 - (11-11_14-29)

1. Fix up small DRC errors and verify the design is ready to be inserted into our flow

Conditions to be verified before moving forward with custom designed cell layout:

  • Condition 1: The input and output ports of the standard cell should lie on the intersection of the vertical and horizontal tracks.
  • Condition 2: Width of the standard cell should be odd multiples of the horizontal track pitch.
  • Condition 3: Height of the standard cell should be even multiples of the vertical track pitch.

Commands to open the custom inverter layout

# Change directory to vsdstdcelldesign
cd Desktop/work/tools/openlane_working_dir/openlane/vsdstdcelldesign

# Command to open custom inverter layout in magic
magic -T sky130A.tech sky130_inv.mag &

Screenshot of tracks.info of sky130_fd_sc_hd alt text

Commands for tkcon window to set grid as tracks of locali layer

# Get syntax for grid command
help grid

# Set grid values accordingly
grid 0.46um 0.34um 0.23um 0.17um

Screenshot of commands run alt text

Condition 1 verified alt text

Condition 2 verified alt text

$$Horizontal\ track\ pitch = 0.46\ um$$ $$Width\ of\ standard\ cell = 1.38\ um = 0.46 * 3$$

Condition 3 verified

$$Vertical\ track\ pitch = 0.34\ um$$

alt text

$$Height\ of\ standard\ cell = 2.72\ um = 0.34 * 8$$

2. Save the finalized layout with custom name and open it

Command for tkcon window to save the layout with custom name

# Command to save as
save sky130_vsdinv.mag

Command to open the newly saved layout

# Command to open custom inverter layout in magic
magic -T sky130A.tech sky130_vsdinv.mag &

Screenshot of newly saved layout alt text alt text alt text

3. Generate lef from the layout

Command for tkcon window to write lef

# lef command
lef write

Screenshot of command run alt text alt text

Screenshot of newly created lef file alt text alt text alt text alt text

4. Copy the newly generated lef and associated required lib files to 'picorv32a' design 'src' directory

Commands to copy necessary files to 'picorv32a' design 'src' directory

# Copy lef file
cp sky130_vsdinv.lef ~/Desktop/work/tools/openlane_working_dir/openlane/designs/picorv32a/src/

# List and check whether it's copied
ls ~/Desktop/work/tools/openlane_working_dir/openlane/designs/picorv32a/src/

# Copy lib files
cp libs/sky130_fd_sc_hd__* ~/Desktop/work/tools/openlane_working_dir/openlane/designs/picorv32a/src/

# List and check whether it's copied
ls ~/Desktop/work/tools/openlane_working_dir/openlane/designs/picorv32a/src/

Screenshot of commands run alt text

5. Edit 'config.tcl' to change lib file and add the new extra lef into the openlane flow

Commands to be added to config.tcl to include our custom cell in the openlane flow

set ::env(LIB_SYNTH) "$::env(OPENLANE_ROOT)/designs/picorv32a/src/sky130_fd_sc_hd__typical.lib"
set ::env(LIB_FASTEST) "$::env(OPENLANE_ROOT)/designs/picorv32a/src/sky130_fd_sc_hd__fast.lib"
set ::env(LIB_SLOWEST) "$::env(OPENLANE_ROOT)/designs/picorv32a/src/sky130_fd_sc_hd__slow.lib"
set ::env(LIB_TYPICAL) "$::env(OPENLANE_ROOT)/designs/picorv32a/src/sky130_fd_sc_hd__typical.lib"

set ::env(EXTRA_LEFS) [glob $::env(OPENLANE_ROOT)/designs/$::env(DESIGN_NAME)/src/*.lef]

Edited config.tcl to include the added lef and change library to ones we added in src directory alt text

6. Run openlane flow synthesis with newly inserted custom inverter cell

  • Commands to invoke the OpenLANE flow include new lef and perform synthesis
# Change directory to openlane flow directory
cd Desktop/work/tools/openlane_working_dir/openlane

# alias docker='docker run -it -v $(pwd):/openLANE_flow -v $PDK_ROOT:$PDK_ROOT -e PDK_ROOT=$PDK_ROOT -u $(id -u $USER):$(id -g $USER) efabless/openlane:v0.21'
# Since we have aliased the long command to 'docker' we can invoke the OpenLANE flow docker sub-system by just running this command
docker
# Now that we have entered the OpenLANE flow contained docker sub-system we can invoke the OpenLANE flow in the Interactive mode using the following command
./flow.tcl -interactive

# Now that OpenLANE flow is open we have to input the required packages for proper functionality of the OpenLANE flow
package require openlane 0.9

# Now the OpenLANE flow is ready to run any design and initially we have to prep the design creating some necessary files and directories for running a specific design which in our case is 'picorv32a'
prep -design picorv32a

# Adiitional commands to include newly added lef to openlane flow
set lefs [glob $::env(DESIGN_DIR)/src/*.lef]
add_lefs -src $lefs

# Now that the design is prepped and ready, we can run synthesis using following command
run_synthesis

Screenshots of commands run alt text alt text alt text alt text alt text alt text

7. Remove/reduce the newly introduced violations with the introduction of custom inverter cell by modifying design parameters

Noting down current design values generated before modifying parameters to improve timing alt text alt text alt text alt text

Commands to view and change parameters to improve timing and run synthesis

# Now once again we have to prep design so as to update variables
prep -design picorv32a -tag 24-03_10-03 -overwrite

# Addiitional commands to include newly added lef to openlane flow merged.lef
set lefs [glob $::env(DESIGN_DIR)/src/*.lef]
add_lefs -src $lefs

# Command to display current value of variable SYNTH_STRATEGY
echo $::env(SYNTH_STRATEGY)

# Command to set new value for SYNTH_STRATEGY
set ::env(SYNTH_STRATEGY) "DELAY 3"

# Command to display current value of variable SYNTH_BUFFERING to check whether it's enabled
echo $::env(SYNTH_BUFFERING)

# Command to display current value of variable SYNTH_SIZING
echo $::env(SYNTH_SIZING)

# Command to set new value for SYNTH_SIZING
set ::env(SYNTH_SIZING) 1

# Command to display current value of variable SYNTH_DRIVING_CELL to check whether it's the proper cell or not
echo $::env(SYNTH_DRIVING_CELL)

# Now that the design is prepped and ready, we can run synthesis using following command
run_synthesis

Screenshot of merged.lef in tmp directory with our custom inverter as macro

alt text

Screenshots of commands run alt text alt text alt text alt text

Comparing to previously noted run values area has increased and worst negative slack has become 0 alt text alt text

8. Once synthesis has accepted our custom inverter we can now run floorplan and placement and verify the cell is accepted in PnR flow

Now that our custom inverter is properly accepted in synthesis we can now run floorplan using following command

# Now we can run floorplan
run_floorplan

Screenshots of command run alt text alt text

Since we are facing unexpected un-explainable error while using run_floorplan command, we can instead use the following set of commands available based on information from Desktop/work/tools/openlane_working_dir/openlane/scripts/tcl_commands/floorplan.tcl and also based on Floorplan Commands section in Desktop/work/tools/openlane_working_dir/openlane/docs/source/OpenLANE_commands.md

# Follwing commands are alltogather sourced in "run_floorplan" command
init_floorplan
place_io
tap_decap_or

Screenshots of commands run alt text alt text alt text alt text

Now that floorplan is done we can do placement using following command

# Now we are ready to run placement
run_placement

Screenshots of command run alt text alt text alt text

Commands to load placement def in magic in another terminal

# Change directory to path containing generated placement def
cd Desktop/work/tools/openlane_working_dir/openlane/designs/picorv32a/runs/11-11_/results/placement/

# Command to load the placement def in magic tool
magic -T /home/vsduser/Desktop/work/tools/openlane_working_dir/pdks/sky130A/libs.tech/magic/sky130A.tech lef read ../../tmp/merged.lef def read picorv32a.placement.def &

Screenshot of placement def in magic alt text alt text

Screenshot of custom inverter inserted in placement def with proper abutment alt text

Command for tkcon window to view internal layers of cells

# Command to view internal connectivity layers
expand

Abutment of power pins with other cell from library clearly visible alt text alt text alt text

9. Do Post-Synthesis timing analysis with OpenSTA tool

Since we are having 0 wns after improved timing run we are going to do timing analysis on initial run of synthesis which has lots of violations and no parameters were added to improve timing

Commands to invoke the OpenLANE flow include new lef and perform synthesis:

# Change directory to openlane flow directory
cd Desktop/work/tools/openlane_working_dir/openlane

# alias docker='docker run -it -v $(pwd):/openLANE_flow -v $PDK_ROOT:$PDK_ROOT -e PDK_ROOT=$PDK_ROOT -u $(id -u $USER):$(id -g $USER) efabless/openlane:v0.21'
# Since we have aliased the long command to 'docker' we can invoke the OpenLANE flow docker sub-system by just running this command
docker
# Now that we have entered the OpenLANE flow contained docker sub-system we can invoke the OpenLANE flow in the Interactive mode using the following command
./flow.tcl -interactive

# Now that OpenLANE flow is open we have to input the required packages for proper functionality of the OpenLANE flow
package require openlane 0.9

# Now the OpenLANE flow is ready to run any design and initially we have to prep the design creating some necessary files and directories for running a specific design which in our case is 'picorv32a'
prep -design picorv32a

# Adiitional commands to include newly added lef to openlane flow
set lefs [glob $::env(DESIGN_DIR)/src/*.lef]
add_lefs -src $lefs

# Command to set new value for SYNTH_SIZING
set ::env(SYNTH_SIZING) 1

# Now that the design is prepped and ready, we can run synthesis using following command
run_synthesis

Commands run final screenshot alt text alt text alt text

Newly created pre_sta.conf for STA analysis in openlane directory alt text

Newly created my_base.sdc for STA analysis in openlane/designs/picorv32a/src directory based on the file openlane/scripts/base.sdc alt text

  • Commands to run STA in another terminal
# Change directory to openlane
cd Desktop/work/tools/openlane_working_dir/openlane

# Command to invoke OpenSTA tool with script
sta pre_sta.conf

Screenshots of commands run alt text alt text

Since more fanout is causing more delay we can add parameter to reduce fanout and do synthesis again

  • Commands to include new lef and perform synthesis:
# Now the OpenLANE flow is ready to run any design and initially we have to prep the design creating some necessary files and directories for running a specific design which in our case is 'picorv32a'
prep -design picorv32a -tag 25-03_18-52 -overwrite

# Adiitional commands to include newly added lef to openlane flow
set lefs [glob $::env(DESIGN_DIR)/src/*.lef]
add_lefs -src $lefs

# Command to set new value for SYNTH_SIZING
set ::env(SYNTH_SIZING) 1

# Command to set new value for SYNTH_MAX_FANOUT
set ::env(SYNTH_MAX_FANOUT) 4

# Command to display current value of variable SYNTH_DRIVING_CELL to check whether it's the proper cell or not
echo $::env(SYNTH_DRIVING_CELL)

# Now that the design is prepped and ready, we can run synthesis using following command
run_synthesis

Commands to run STA in another terminal

# Change directory to openlane
cd Desktop/work/tools/openlane_working_dir/openlane

# Command to invoke OpenSTA tool with script
sta pre_sta.conf

Screenshots of commands run alt text alt text alt text

10. Make timing ECO fixes to remove all violations

OR gate of drive strength 2 is driving 4 fanouts alt text

Commands to perform analysis and optimize timing by replacing with OR gate of drive strength 4

# Reports all the connections to a net
report_net -connections _11672_

# Checking command syntax
help replace_cell

# Replacing cell
replace_cell _14510_ sky130_fd_sc_hd__or3_4

# Generating custom timing report
report_checks -fields {net cap slew input_pins} -digits 4

Result - slack reduced alt text alt text alt text

OR gate of drive strength 2 is driving 4 fanouts alt text

Commands to perform analysis and optimize timing by replacing with OR gate of drive strength 4

# Reports all the connections to a net
report_net -connections _11675_

# Replacing cell
replace_cell _14514_ sky130_fd_sc_hd__or3_4

# Generating custom timing report
report_checks -fields {net cap slew input_pins} -digits 4

Result - slack reduced alt text alt text alt text

OR gate of drive strength 2 driving OA gate has more delay alt text

Commands to perform analysis and optimize timing by replacing with OR gate of drive strength 4

# Reports all the connections to a net
report_net -connections _11643_

# Replacing cell
replace_cell _14481_ sky130_fd_sc_hd__or4_4

# Generating custom timing report
report_checks -fields {net cap slew input_pins} -digits 4

Result - slack reduced alt text alt text

OR gate of drive strength 2 driving OA gate has more delay alt text

Commands to perform analysis and optimize timing by replacing with OR gate of drive strength 4

# Reports all the connections to a net
report_net -connections _11668_

# Replacing cell
replace_cell _14506_ sky130_fd_sc_hd__or4_4

# Generating custom timing report
report_checks -fields {net cap slew input_pins} -digits 4

Result - slack reduced alt text alt text

Commands to verify instance _14506_ is replaced with sky130_fd_sc_hd__or4_4

# Generating custom timing report
report_checks -from _29043_ -to _30440_ -through _14506_

Screenshot of replaced instance alt text

  • We started ECO fixes at wns -23.9000 and now we stand at wns -22.6173 we reduced around 1.2827 ns of violation

11. Replace the old netlist with the new netlist generated after timing ECO fix and implement the floorplan, placement and cts

Now to insert this updated netlist to PnR flow and we can use write_verilog and overwrite the synthesis netlist but before that we are going to make a copy of the old old netlist

Commands to make copy of netlist

# Change from home directory to synthesis results directory
cd Desktop/work/tools/openlane_working_dir/openlane/designs/picorv32a/runs/11-11_14-29/results/synthesis/

# List contents of the directory
ls

# Copy and rename the netlist
cp picorv32a.synthesis.v picorv32a.synthesis_old.v

# List contents of the directory
ls

Screenshot of commands run alt text

Commands to write verilog

# Check syntax
help write_verilog

# Overwriting current synthesis netlist
write_verilog /home/vsduser/Desktop/work/tools/openlane_working_dir/openlane/designs/picorv32a/runs/25-03_18-52/results/synthesis/picorv32a.synthesis.v

# Exit from OpenSTA since timing analysis is done
exit

Screenshot of commands run alt text

Verified that the netlist is overwritten by checking that instance _14506_ is replaced with sky130_fd_sc_hd__or4_4 alt text

Since we confirmed that netlist is replaced and will be loaded in PnR but since we want to follow up on the earlier 0 violation design we are continuing with the clean design to further stages

  • Commands load the design and run necessary stages
# Now once again we have to prep design so as to update variables
prep -design picorv32a -tag 24-03_10-03 -overwrite

# Addiitional commands to include newly added lef to openlane flow merged.lef
set lefs [glob $::env(DESIGN_DIR)/src/*.lef]
add_lefs -src $lefs

# Command to set new value for SYNTH_STRATEGY
set ::env(SYNTH_STRATEGY) "DELAY 3"

# Command to set new value for SYNTH_SIZING
set ::env(SYNTH_SIZING) 1

# Now that the design is prepped and ready, we can run synthesis using following command
run_synthesis

# Follwing commands are alltogather sourced in "run_floorplan" command
init_floorplan
place_io
tap_decap_or

# Now we are ready to run placement
run_placement

# Incase getting error
unset ::env(LIB_CTS)

# With placement done we are now ready to run CTS
run_cts

Screenshots of commands run alt text alt text alt text alt text alt text alt text alt text alt text alt text alt text

12. Post-CTS OpenROAD timing analysis

  • Commands to be run in OpenLANE flow to do OpenROAD timing analysis with integrated OpenSTA in OpenROAD
# Command to run OpenROAD tool
openroad

# Reading lef file
read_lef /openLANE_flow/designs/picorv32a/runs/24-03_10-03/tmp/merged.lef

# Reading def file
read_def /openLANE_flow/designs/picorv32a/runs/24-03_10-03/results/cts/picorv32a.cts.def

# Creating an OpenROAD database to work with
write_db pico_cts.db

# Loading the created database in OpenROAD
read_db pico_cts.db

# Read netlist post CTS
read_verilog /openLANE_flow/designs/picorv32a/runs/24-03_10-03/results/synthesis/picorv32a.synthesis_cts.v

# Read library for design
read_liberty $::env(LIB_SYNTH_COMPLETE)

# Link design and library
link_design picorv32a

# Read in the custom sdc we created
read_sdc /openLANE_flow/designs/picorv32a/src/my_base.sdc

# Setting all cloks as propagated clocks
set_propagated_clock [all_clocks]

# Check syntax of 'report_checks' command
help report_checks

# Generating custom timing report
report_checks -path_delay min_max -fields {slew trans net cap input_pins} -format full_clock_expanded -digits 4

# Exit to OpenLANE flow
exit

Screenshots of commands run and timing report generated alt text alt text alt text alt text alt text alt text

13. Explore post-CTS OpenROAD timing analysis by removing 'sky130_fd_sc_hd__clkbuf_1' cell from clock buffer list variable 'CTS_CLK_BUFFER_LIST'

  • Commands to be run in OpenLANE flow to do OpenROAD timing analysis after changing CTS_CLK_BUFFER_LIST
# Checking current value of 'CTS_CLK_BUFFER_LIST'
echo $::env(CTS_CLK_BUFFER_LIST)

# Removing 'sky130_fd_sc_hd__clkbuf_1' from the list
set ::env(CTS_CLK_BUFFER_LIST) [lreplace $::env(CTS_CLK_BUFFER_LIST) 0 0]

# Checking current value of 'CTS_CLK_BUFFER_LIST'
echo $::env(CTS_CLK_BUFFER_LIST)

# Checking current value of 'CURRENT_DEF'
echo $::env(CURRENT_DEF)

# Setting def as placement def
set ::env(CURRENT_DEF) /openLANE_flow/designs/picorv32a/runs/24-03_10-03/results/placement/picorv32a.placement.def

# Run CTS again
run_cts

# Checking current value of 'CTS_CLK_BUFFER_LIST'
echo $::env(CTS_CLK_BUFFER_LIST)

# Command to run OpenROAD tool
openroad

# Reading lef file
read_lef /openLANE_flow/designs/picorv32a/runs/24-03_10-03/tmp/merged.lef

# Reading def file
read_def /openLANE_flow/designs/picorv32a/runs/24-03_10-03/results/cts/picorv32a.cts.def

# Creating an OpenROAD database to work with
write_db pico_cts1.db

# Loading the created database in OpenROAD
read_db pico_cts.db

# Read netlist post CTS
read_verilog /openLANE_flow/designs/picorv32a/runs/24-03_10-03/results/synthesis/picorv32a.synthesis_cts.v

# Read library for design
read_liberty $::env(LIB_SYNTH_COMPLETE)

# Link design and library
link_design picorv32a

# Read in the custom sdc we created
read_sdc /openLANE_flow/designs/picorv32a/src/my_base.sdc

# Setting all cloks as propagated clocks
set_propagated_clock [all_clocks]

# Generating custom timing report
report_checks -path_delay min_max -fields {slew trans net cap input_pins} -format full_clock_expanded -digits 4

# Report hold skew
report_clock_skew -hold

# Report setup skew
report_clock_skew -setup

# Exit to OpenLANE flow
exit

# Checking current value of 'CTS_CLK_BUFFER_LIST'
echo $::env(CTS_CLK_BUFFER_LIST)

# Inserting 'sky130_fd_sc_hd__clkbuf_1' to first index of list
set ::env(CTS_CLK_BUFFER_LIST) [linsert $::env(CTS_CLK_BUFFER_LIST) 0 sky130_fd_sc_hd__clkbuf_1]

# Checking current value of 'CTS_CLK_BUFFER_LIST'
echo $::env(CTS_CLK_BUFFER_LIST)

Screenshots of commands run and timing report generated alt text alt text alt text alt text alt text alt text alt text alt text

5. Final steps for RTL2GDS using tritonRoute and openSTA

Theory

Click to expand

alt text alt text alt text alt text alt text alt text alt text alt text alt text alt text alt text alt text alt text alt text alt text alt text alt text

Implementation

  • Section 5 tasks:-
  1. Perform generation of Power Distribution Network (PDN) and explore the PDN layout.
  2. Perfrom detailed routing using TritonRoute.
  3. Post-Route parasitic extraction using SPEF extractor.
  4. Post-Route OpenSTA timing analysis with the extracted parasitics of the route.
  • All section 5 logs, reports and results can be found in following run folder:

1. Perform generation of Power Distribution Network (PDN) and explore the PDN layout

Commands to perform all necessary stages up until now

# Change directory to openlane flow directory
cd Desktop/work/tools/openlane_working_dir/openlane

# alias docker='docker run -it -v $(pwd):/openLANE_flow -v $PDK_ROOT:$PDK_ROOT -e PDK_ROOT=$PDK_ROOT -u $(id -u $USER):$(id -g $USER) efabless/openlane:v0.21'
# Since we have aliased the long command to 'docker' we can invoke the OpenLANE flow docker sub-system by just running this command
docker
# Now that we have entered the OpenLANE flow contained docker sub-system we can invoke the OpenLANE flow in the Interactive mode using the following command
./flow.tcl -interactive

# Now that OpenLANE flow is open we have to input the required packages for proper functionality of the OpenLANE flow
package require openlane 0.9

# Now the OpenLANE flow is ready to run any design and initially we have to prep the design creating some necessary files and directories for running a specific design which in our case is 'picorv32a'
prep -design picorv32a

# Addiitional commands to include newly added lef to openlane flow merged.lef
set lefs [glob $::env(DESIGN_DIR)/src/*.lef]
add_lefs -src $lefs

# Command to set new value for SYNTH_STRATEGY
set ::env(SYNTH_STRATEGY) "DELAY 3"

# Command to set new value for SYNTH_SIZING
set ::env(SYNTH_SIZING) 1

# Now that the design is prepped and ready, we can run synthesis using following command
run_synthesis

# Following commands are alltogather sourced in "run_floorplan" command
init_floorplan
place_io
tap_decap_or

# Now we are ready to run placement
run_placement

# Incase getting error
unset ::env(LIB_CTS)

# With placement done we are now ready to run CTS
run_cts

# Now that CTS is done we can do power distribution network
gen_pdn 

Screenshots of power distribution network run alt text alt text alt text

Commands to load PDN def in magic in another terminal

# Change directory to path containing generated PDN def
cd Desktop/work/tools/openlane_working_dir/openlane/designs/picorv32a/runs/26-03_08-45/tmp/floorplan/

# Command to load the PDN def in magic tool
magic -T /home/vsduser/Desktop/work/tools/openlane_working_dir/pdks/sky130A/libs.tech/magic/sky130A.tech lef read ../../tmp/merged.lef def read 14-pdn.def &

Screenshots of PDN def alt text alt text alt text alt text

2. Perfrom detailed routing using TritonRoute and explore the routed layout

Command to perform routing

# Check value of 'CURRENT_DEF'
echo $::env(CURRENT_DEF)

# Check value of 'ROUTING_STRATEGY'
echo $::env(ROUTING_STRATEGY)

# Command for detailed route using TritonRoute
run_routing

Screenshots of routing run alt text alt text alt text alt text alt text alt text alt text alt text alt text alt text

Commands to load routed def in magic in another terminal

# Change directory to path containing routed def
cd Desktop/work/tools/openlane_working_dir/openlane/designs/picorv32a/runs/26-03_08-45/results/routing/

# Command to load the routed def in magic tool
magic -T /home/vsduser/Desktop/work/tools/openlane_working_dir/pdks/sky130A/libs.tech/magic/sky130A.tech lef read ../../tmp/merged.lef def read picorv32a.def &

Screenshots of routed def alt text alt text alt text alt text alt text alt text alt text

Screenshot of fast route guide present in openlane/designs/picorv32a/runs/11-11_15_47/tmp/routing directory alt text

3. Post-Route OpenSTA timing analysis with the extracted parasitics of the route

Commands to be run in OpenLANE flow to do OpenROAD timing analysis with integrated OpenSTA in OpenROAD

# Command to run OpenROAD tool
openroad

# Reading lef file
read_lef /openLANE_flow/designs/picorv32a/runs/26-03_08-45/tmp/merged.lef

# Reading def file
read_def /openLANE_flow/designs/picorv32a/runs/26-03_08-45/results/routing/picorv32a.def

# Creating an OpenROAD database to work with
write_db pico_route.db

# Loading the created database in OpenROAD
read_db pico_route.db

# Read netlist post CTS
read_verilog /openLANE_flow/designs/picorv32a/runs/26-03_08-45/results/synthesis/picorv32a.synthesis_preroute.v

# Read library for design
read_liberty $::env(LIB_SYNTH_COMPLETE)

# Link design and library
link_design picorv32a

# Read in the custom sdc we created
read_sdc /openLANE_flow/designs/picorv32a/src/my_base.sdc

# Setting all cloks as propagated clocks
set_propagated_clock [all_clocks]

# Read SPEF
read_spef /openLANE_flow/designs/picorv32a/runs/26-03_08-45/results/routing/picorv32a.spef

# Generating custom timing report
report_checks -path_delay min_max -fields {slew trans net cap input_pins} -format full_clock_expanded -digits 4

# Exit to OpenLANE flow
exit

Screenshots of commands run and timing report generated alt text alt text alt text

Acknowledgements