Skip to content

Priyanshu5437/iiitb_pipo

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

15 Commits
 
 
 
 

Repository files navigation

iiitb_pipo -- johnson counter

Descripton

A Johnson counter is a type of synchronous counter used in digital circuits that uses feedback to create a ring structure. It consists of a series of flip-flops with the complemented output of the last flip-flop connected to the input of the first flip-flop. This creates a circular shift register that cycles through all possible binary states before repeating itself. Johnson counters are used in applications such as frequency division, sequence generation, and digital signal processing. They are also known by several other names, including creeping counter, twisted ring counter, walking counter, mobile counter, and switch tail counter.

Tools Used

Layout

OpenLane and Magic Tool Installation

Installation of Python3
$ sudo apt install -y build-essential python3 python3-venv python3-pip
Installation of Docker
$ sudo apt-get remove docker docker-engine docker.io containerd runc (removes older version of docker if installed)
$ sudo apt-get update
$ sudo apt-get install \
    ca-certificates \
    curl \
    gnupg \
    lsb-release    
$ sudo mkdir -p /etc/apt/keyrings
$ curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /etc/apt/keyrings/docker.gpg
$ echo \
  "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.gpg] https://download.docker.com/linux/ubuntu \
  $(lsb_release -cs) stable" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null  
$ sudo apt-get update
$ sudo apt-get install docker-ce docker-ce-cli containerd.io docker-compose-plugin
$ apt-cache madison docker-ce (copy the version string you want to install)
$ sudo apt-get install docker-ce=<VERSION_STRING> docker-ce-cli=<VERSION_STRING> containerd.io docker-compose-plugin (paste the version string copies in place of <VERSION_STRING>)
$ sudo docker run hello-world (If the docker is successfully installed u will get a success message here)
Installation of OpenLane on ubuntu
$ git clone https://github.com/The-OpenROAD-Project/OpenLane.git
$ cd OpenLane/
$ make
$ make test
Installation of magic on ubuntu

Additional packages to be installed as a part of system requirements to compile magic before magic installation.

Installing M4 preprocessor
$ sudo apt-get install m4
Installing tcsh shell
$ sudo apt-get install tcsh
Installing csh shell
$ sudo apt-get install csh 
Installing Xlib.h
$ sudo apt-get install libx11-dev
Installing Tcl/Tk
$ sudo apt-get install tcl-dev tk-dev
Installing Cairo
$ sudo apt-get install libcairo2-dev
Installing OpenGL
$ sudo apt-get install mesa-common-dev libglu1-mesa-dev
Installing ncurses
$ sudo apt-get install libncurses-dev
Installing Magic
$ git clone https://github.com/RTimothyEdwards/magic
$ cd magic
$ ./configure
$ make
$ make install
Installing Klayout
$ sudo apt-get install klayout

PreSynthesis

To clone the repository, download the netlist files and simulate the results, Enter the following commands in your terminal:

 $ git clone https://github.com/Priyanshu5437/iiitb_pipo

 $ cd iiitb_pipo
 
 $ iverilog -o iiitb_pipo_out.out iiitb_pipo.v iiitb_pipo_tb.v
 
 $ ./iiitb_pipo_out.out
 
 $ gtkwave iiitb_pipo_vcd.vcd

Screenshot from 2023-02-25 18-37-18

The spice netlist has to be edited to add the libraries we are using, The final spice netlist should look like the following:

* SPICE3 file created from sky130_inv.ext - technology: sky130A

.option scale=0.01u
.include ./libs/pshort.lib
.include ./libs/nshort.lib



M1001 Y A VGND VGND nshort_model.0 ad=1435 pd=152 as=1365 ps=148 w=35 l=23
M1000 Y A VPWR VPWR pshort_model.0 ad=1443 pd=152 as=1517 ps=156 w=37 l=23
VDD VPWR 0 3.3V
VSS VGND 0 0V
Va A VGND PULSE(0V 3.3V 0 0.1ns 0.1ns 2ns 4ns)
C0 Y VPWR 0.08fF
C1 A Y 0.02fF
C2 A VPWR 0.08fF
C3 Y VGND 0.18fF
C4 VPWR VGND 0.74fF


.tran 1n 20n
.control
run
.endc
.end

Open the terminal in the directory where ngspice is stored and type the following command, ngspice console will open:

$ ngspice sky130_inv.spice 

Layout

Preparation

The layout is generated using OpenLane. To run a custom design on openlane, Navigate to the openlane folder and run the following commands:

$ cd designs

$ mkdir iiitb_pipo

$ cd iiitb_pipo

$ mkdir src

$ touch config.json

$ cd src

$ touch iiitb_pipo.v

The iiitb_pipo.v file should contain the verilog RTL code you have used and got the post synthesis simulation for.

Copy sky130_fd_sc_hd__fast.lib, sky130_fd_sc_hd__slow.lib, sky130_fd_sc_hd__typical.lib and sky130_vsdinv.lef files to src folder in your design.

The final src folder should look like this:
Screenshot from 2023-02-18 13-26-36

The contents of the config.json are as follows. this can be modified specifically for your design as and when required.

{ 
   {
  "DESIGN_NAME": "iiitb_pipo",
  "VERILOG_FILES": "dir::src/iiitb_pipo.v",
  "CLOCK_PORT": "clk",
  "CLOCK_NET": "clk",
  "FP_SIZING": "absolute",
  "DIE_AREA": "0 0 60 60",
  "PL_RANDOM_PLACEMENT": 1,
  "LIB_SYNTH" : "dir::src/sky130_fd_sc_hd__typical.lib",
  "LIB_FASTEST" : "dir::src/sky130_fd_sc_hd__fast.lib",
  "LIB_SLOWEST" : "dir::src/sky130_fd_sc_hd__slow.lib",
  "LIB_TYPICAL":"dir::src/sky130_fd_sc_hd__typical.lib",
  "TEST_EXTERNAL_GLOB":"dir::../iiitb_pipo/src/*",
  "SYNTH_DRIVING_CELL":"sky130_vsdinv",
  "pdk::sky130*": {
    "FP_CORE_UTIL": 35,
    "CLOCK_PERIOD": 24,
    "scl::sky130_fd_sc_hd": {
      "FP_CORE_UTIL": 30
    }
  }
}
}

Creating a Custom Inverter Cell

Open Terminal in the folder you want to create the custom inverter cell.

$ git clone https://github.com/nickson-jose/vsdstdcelldesign.git

$ cd vsdstdcelldesign

$  cp ./libs/sky130A.tech sky130A.tech

$ magic -T sky130A.tech sky130_inv.mag &

Screenshot from 2023-02-25 11-10-56 Screenshot from 2023-02-25 11-50-15 Screenshot from 2023-02-25 11-51-14

1.Rise time:

Screenshot from 2023-02-25 12-28-37 Screenshot from 2023-02-25 12-34-34 Rise time = (2.2000ns - 2.1567ns) = 43.3ps

2.Fall time:

Screenshot from 2023-02-25 12-35-53 Screenshot from 2023-02-25 12-38-19 Fall time = (4.06756ns - 4.0401ns) = 27.46ps

3.Cell rise delay

Screenshot from 2023-02-25 12-42-54 Cell rise delay = ( 2.18198ns -2.15011ns) =31.7ps

4.Cell fall delay

Screenshot from 2023-02-25 13-00-23 Cell fall delay = (4.05365 ns- 4.04999ns) = 3.66ps

Saving changes done and Navigate to the openlane folder in terminal and give command :

$ make mount

Screenshot from 2023-02-24 23-08-33 After entering the openlane container give the following command:

$ ./flow.tcl -interactive

Screenshot from 2023-02-24 23-08-48 In tcl console we need to enter command

% package require openlane 0.9

Screenshot from 2023-02-24 23-09-43

% prep -design iiitb_pipo

Screenshot from 2023-02-24 23-09-55 The following commands are to merge external the lef files to the merged.nom.lef. In our case sky130_vsdiat is getting merged to the lef file

set lefs [glob $::env(DESIGN_DIR)/src/*.lef]
add_lefs -src $lefs

Screenshot from 2023-02-24 23-10-49 The contents of the merged.nom.lef file should contain the Macro definition of sky130_vsdinv

Screenshot from 2023-02-24 23-16-00

Synthesis

% run_synthesis

Screenshot from 2023-02-24 23-16-58

Synthesis Reports

Details of the gates used

Screenshot from 2023-02-24 23-19-31 Setup and Hold Slack after synthesis

Screenshot from 2023-02-24 23-21-11

Flop Ratio = Ratio of total number of flip flops / Total number of cells present in the design = 8/71 = 0.1125

Floorplan

% run_floorplan

Screenshot from 2023-02-24 23-22-10

Floorplan Reports

Die Area and core area
Screenshot from 2023-02-24 23-24-06 Navigate to results->floorplan and type the Magic command in terminal to open the floorplan

$ magic -T /home/priyanshu/OpenLane/OpenLane/pdks/sky130A/libs.tech/magic/sky130A.tech read ../../tmp/merged.nom.lef def read iiitb_pipo.def &

Screenshot from 2023-02-24 23-30-39
Floorplan view
Screenshot from 2023-02-24 23-30-58 All the cells are placed in the left corner of the floorplan

Placement

% run_placement

Screenshot from 2023-02-24 23-32-51

Placement Reports

Navigate to results->placement and type the Magic command in terminal to open the placement view

$ magic -T /home/priyanshu/OpenLane/OpenLane/pdks/sky130A/libs.tech/magic/sky130A.tech read ../../tmp/merged.nom.lef def read iiitb_pipo.def &

Screenshot from 2023-02-24 23-34-00 Screenshot from 2023-02-24 23-35-37

Clock Tree Synthesis

% run_cts

Screenshot from 2023-02-24 23-37-33

Routing

% run_routing

Screenshot from 2023-02-24 23-38-14

Routing Reports

Navigate to results->routing and type the Magic command in terminal to open the routing view

$ magic -T /home/priyanshu/OpenLane/OpenLane/pdks/sky130A/libs.tech/magic/sky130A.tech read ../../tmp/merged.nom.lef def read iiitb_pipo.def &

Screenshot from 2023-02-24 23-40-03 Routing View

Screenshot from 2023-02-24 23-40-17 Screenshot from 2023-02-24 23-41-14 Screenshot from 2023-02-24 23-44-00

Area Report by MAGIC :

Screenshot from 2023-02-24 23-44-56 We can also run the whole flow at once instead of step by step process by giving the following command in openlane container

$ ./flow.tcl -design iiitb_pipo

Screenshot from 2023-02-24 23-45-51 Screenshot from 2023-02-24 23-52-01 Screenshot from 2023-02-24 23-52-10 Screenshot from 2023-02-24 23-52-21

Results post-layout

1. Post Layout synthesis gate count

Screenshot from 2023-02-25 00-08-56 Gate Count =8

2. Area (box command)

Screenshot from 2023-02-24 23-44-56

Area =3600 um2

3. Flop/standard cell ratio

Screenshot from 2023-02-25 00-08-56 Flop Ratio = Ratio of total number of flip flops / Total number of cells present in the design = 5/8 = 0.625

4. Power (internal, switching, leakage and total)

Screenshot from 2023-02-25 00-11-02 Internal Power = 30.92 uW (84.2%)
Switching Power = 5.82uW (15.8%)
Leakage Power = 0.209 nW (0.00%)
Total Power = 36.7 uW (100%)

5.PERFORMANCE

Screenshot from 2023-02-25 13-43-33 Screenshot from 2023-02-25 13-43-37

Performance = 1/(clock period - slack) = 1/(24 - 18.40)ns = 175.571Mhz

Reference

Author

  • Priyanshu

Contributors

  • Priyanshu
  • Dantu Nandini Devi
  • Kunal Ghosh

Acknowledgement

  • Kunal Ghosh, VSD Corp. Pvt. Ltd.
  • Nanditha Rao, Professor, IIITB
  • Madhav Rao, Professor, IIITB
  • Efabless Corporation
  • Skywater Foundry
  • Open Road
  • Google

Contact Information

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published