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.
$ sudo apt install -y build-essential python3 python3-venv python3-pip
$ 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)
$ git clone https://github.com/The-OpenROAD-Project/OpenLane.git
$ cd OpenLane/
$ make
$ make test
Additional packages to be installed as a part of system requirements to compile magic before magic installation.
$ sudo apt-get install m4
$ sudo apt-get install tcsh
$ sudo apt-get install csh
$ sudo apt-get install libx11-dev
$ sudo apt-get install tcl-dev tk-dev
$ sudo apt-get install libcairo2-dev
$ sudo apt-get install mesa-common-dev libglu1-mesa-dev
$ sudo apt-get install libncurses-dev
$ git clone https://github.com/RTimothyEdwards/magic
$ cd magic
$ ./configure
$ make
$ make install
$ sudo apt-get install klayout
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
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
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:
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
}
}
}
}
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 &
Rise time = (2.2000ns - 2.1567ns) = 43.3ps
Fall time = (4.06756ns - 4.0401ns) = 27.46ps
Cell rise delay = ( 2.18198ns -2.15011ns) =31.7ps
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
After entering the openlane container give the following command:
$ ./flow.tcl -interactive
In tcl console we need to enter command
% package require openlane 0.9
% prep -design iiitb_pipo
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
The contents of the merged.nom.lef file should contain the Macro definition of sky130_vsdinv
% run_synthesis
Details of the gates used
Setup and Hold Slack after synthesis
Flop Ratio = Ratio of total number of flip flops / Total number of cells present in the design = 8/71 = 0.1125
% run_floorplan
Die Area and core area
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 &
Floorplan view
All the cells are placed in the left corner of the floorplan
% run_placement
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 &
% run_cts
% run_routing
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 &
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
Area =3600 um2
Flop Ratio = Ratio of total number of flip flops / Total number of cells present in the design = 5/8 = 0.625
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%)
Performance = 1/(clock period - slack) = 1/(24 - 18.40)ns = 175.571Mhz
- Priyanshu
- Priyanshu
- Dantu Nandini Devi
- Kunal Ghosh
- Kunal Ghosh, VSD Corp. Pvt. Ltd.
- Nanditha Rao, Professor, IIITB
- Madhav Rao, Professor, IIITB
- Efabless Corporation
- Skywater Foundry
- Open Road
- Priyanshu, Mtech Student, IIITB, priyanshusingh0402.ps@gmail.com
- Kunal Ghosh, Director, VSD Corp. Pvt. Ltd. kunalghosh@gmail.com
- Nanditha Rao, nanditha.rao@iiitb.ac.in
- Madhav Rao, mr@iiitb.ac.in