2 Week digital VLSI SoC design and planning workshop with complete RTL2GDSII flow organised by VSD in collaboration with NASSCOM
Expand or Collapse
- 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.
- 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.
- 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.
- 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.
- 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.
- 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.
- For the above stopwatch the following are the input and output of the compiler and assembler.
- 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.
- There are mainly 3 different parts in this course. They are:
- RISC-V ISA
- RTL and synthesis of RISC-V based CPU core - picorv32
- Physical design implementation of picorv32
- For open-source ASIC design implemantation, we require the following enablers to be readily available as open-source versions. They are:-
- RTL Designs
- EDA Tools
- 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.
- 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.
- 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.
- 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.
- 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.
- Chip Floor Planning
- Macro Floor Planning
- 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.
- Placement
- 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)
- Clock Tree Synthesis
- Clock skew is the time difference in arrival of clock at different components.
- Routing
- 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.
- Global and Detailed Routing
- 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.
Section 1 tasks:-
- Run 'picorv32a' design synthesis using OpenLANE flow and generate necessary outputs.
- Calculate the flop ratio.
- All section 1 logs, reports and results can be found in following run folder:
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
Screenshots of synthesis statistics report file with required values highlighted
Calculation of Flop Ratio and DFF % from synthesis statistics report file
Section 2 - Good floorplan vs bad floorplan and introduction to library cells (16/03/2024 - 17/03/2024)
Section 2 tasks:-
- Run 'picorv32a' design floorplan using OpenLANE flow and generate necessary outputs.
- Calculate the die area in microns from the values in floorplan def.
- Load generated floorplan def in magic tool and explore the floorplan.
- Run 'picorv32a' design congestion aware placement using OpenLANE flow and generate necessary outputs.
- Load generated placement def in magic tool and explore the placement.
- All section 2 logs, reports and results can be found in following run folder:
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
Screenshot of contents of floorplan def
According to floorplan def
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
Equidistant placement of ports
Port layer as set through config.tcl
Decap Cells and Tap Cells
Diogonally equidistant Tap cells
Unplaced standard cells at the origin
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
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
Standard cells legally placed
Commands to exit from current run
# Exit from OpenLANE flow
exit
# Exit from OpenLANE flow docker sub-system
exit
Section 3 - Design library cell using Magic Layout and ngspice characterization (16/03/2024 - 21/03/2024)
- Section 3 tasks:-
- Clone custom inverter standard cell design from github repository: Standard cell design and characterization using OpenLANE flow.
- Load the custom inverter layout in magic and explore.
- Spice extraction of inverter in magic.
- Editing the spice model file for analysis through simulation.
- Post-layout ngspice simulations.
- Find problem in the DRC section of the old magic tech file for the skywater process and fix them.
- Section 3 - Tasks 1 to 5 files, reports and logs can be found in the following folder:
Section 3 - Tasks 1 to 5 (vsdstdcelldesign)
- Section 3 - Task 6 files, reports and logs can be found in the following folder:
Section 3 - Task 6 (drc_tests)
# 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
Screenshot of custom inverter layout in magic
NMOS and PMOS identified
Output Y connectivity to PMOS and NMOS drain verified
PMOS source connectivity to VDD (here VPWR) verified
NMOS source connectivity to VSS (here VGND) verified
Deleting necessary layout part to see DRC error
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
Screenshot of created spice file
Measuring unit distance in layout grid
Final edited spice file ready for ngspice simulation
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
Screenshot of generated plot
Rise transition time calculation
20% Screenshots
80% Screenshots
Fall transition time calculation
20% Screenshots
80% Screenshots
Rise Cell Delay Calculation
50% Screenshots
Fall Cell Delay Calculation
50% Screenshots
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
Screenshot of .magicrc file
Incorrectly implemented poly.9 simple rule correction
Screenshot of poly rules
Incorrectly implemented poly.9 rule no drc violation even though spacing < 0.48u
New commands inserted in sky130A.tech file to update drc
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
Incorrectly implemented difftap.2 simple rule correction
Screenshot of difftap rules
Incorrectly implemented difftap.2 rule no drc violation even though spacing < 0.42u
New commands inserted in sky130A.tech file to update drc
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
Incorrectly implemented nwell.4 complex rule correction
Screenshot of nwell rules
Incorrectly implemented nwell.4 rule no drc violation even though no tap present in nwell
New commands inserted in sky130A.tech file to update drc
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
- Section 4 tasks:-
- Fix up small DRC errors and verify the design is ready to be inserted into our flow.
- Save the finalized layout with custom name and open it.
- Generate lef from the layout.
- Copy the newly generated lef and associated required lib files to 'picorv32a' design 'src' directory.
- Edit 'config.tcl' to change lib file and add the new extra lef into the openlane flow.
- Run openlane flow synthesis with newly inserted custom inverter cell.
- Remove/reduce the newly introduced violations with the introduction of custom inverter cell by modifying design parameters.
- Once synthesis has accepted our custom inverter we can now run floorplan and placement and verify the cell is accepted in PnR flow.
- Do Post-Synthesis timing analysis with OpenSTA tool.
- Make timing ECO fixes to remove all violations.
- Replace the old netlist with the new netlist generated after timing ECO fix and implement the floorplan, placement and cts.
- Post-CTS OpenROAD timing analysis.
- 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 - Tasks 1 to 4 files, reports and logs can be found in the following folder:
Section 4 - Tasks 1 to 4 (vsdstdcelldesign)
- Section 4 - Task 4 files, reports and logs can be found in the following folder:
- Section 4 - Task 5 files, reports and logs can be found in the following folder:
Section 4 - Task 5 (picorv32a)
- Section 4 - Tasks 6 to 8 & 11 to 13 logs, reports and results can be found in following run folder:
Section 4 - Tasks 6 to 8 & 11 to 13 Run (24-03_10-03)
- Section 4 - Tasks 9 to 11 logs, reports and results can be found in following run folder:
Section 4 - Tasks 9 to 11 Run (25-03_18-52)
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
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
Condition 1 verified
Condition 2 verified
Condition 3 verified
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
Command for tkcon window to write lef
# lef command
lef write
Screenshot of command run
Screenshot of newly created lef file
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
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
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
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
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
Screenshots of commands run
Comparing to previously noted run values area has increased and worst negative slack has become 0
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
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
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
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/24-03_10-03/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
Screenshot of custom inverter inserted in placement def with proper abutment
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
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
Newly created pre_sta.conf
for STA analysis in openlane
directory
Newly created my_base.sdc
for STA analysis in openlane/designs/picorv32a/src
directory based on the file openlane/scripts/base.sdc
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
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 run final screenshot
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
OR gate of drive strength 2 is driving 4 fanouts
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
OR gate of drive strength 2 is driving 4 fanouts
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
OR gate of drive strength 2 driving OA gate has more delay
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
OR gate of drive strength 2 driving OA gate has more delay
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
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
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/25-03_18-52/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
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
Verified that the netlist is overwritten by checking that instance _14506_
is replaced with sky130_fd_sc_hd__or4_4
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
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
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
- Section 5 tasks:-
- Perform generation of Power Distribution Network (PDN) and explore the PDN layout.
- Perfrom detailed routing using TritonRoute.
- Post-Route parasitic extraction using SPEF extractor.
- 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:
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
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
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
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
Screenshot of fast route guide present in openlane/designs/picorv32a/runs/26-03_08-45/tmp/routing
directory
Commands for SPEF extraction using external tool
# Change directory
cd Desktop/work/tools/SPEF_EXTRACTOR
# Command extract spef
python3 main.py /home/vsduser/Desktop/work/tools/openlane_working_dir/openlane/designs/picorv32a/runs/26-03_08-45/tmp/merged.lef /home/vsduser/Desktop/work/tools/openlane_working_dir/openlane/designs/picorv32a/runs/26-03_08-45/results/routing/picorv32a.def
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