The universal shift register features parallel load, left-shift and right-shift serial input, and synchronous active high reset. The registers have 4 modes of operation out of which 1 is operational according to the select lines. The 4 modes of operation are:
- Shift left
- Shift right
- Parallel load
- Temporary storage
Parallel synchronous loading is accomplished by applying the four bits of data and taking S0 low and S1 high. The data is loaded into the associated flip-flops and appears at the outputs after the positive transition of the clock input. Shift right is accomplished synchronously with the rising edge of the clock pulse when S0 is high and S1 is low. Serial data for this mode is entered at the shift-right data input. When both S0 and S1 are low, data shifts left synchronously and new data is entered at the shift-left serial inputs. When both S0 and S1 are high, the data inside the bidirectional shift register does not change. Synchronous active high clear signal is used to reset the bidirectional shift register.
Input signals include:
- 2 bit select signal
- 1 bit clock signal
- 1 bit reset signal
- 1 bit shift left serial signal
- 1 bit shift right serial signal
- 8 bit input signal
Output signals include:
- 8 bit output signal
Icarus Verilog is a Verilog simulation and synthesis tool. It operates as a compiler, compiling source code written in Verilog (IEEE-1364) into some target format. For batch simulation, the compiler can generate an intermediate form called vvp assembly. This intermediate form is executed by the vvp
command. For synthesis, the compiler generates netlists in the desired format.
GTKWave is a fully featured GTK+ based wave viewer for Unix, Win32, and Mac OSX which reads LXT, LXT2, VZT, FST, and GHW files as well as standard Verilog VCD/EVCD files and allows their viewing.
Yosys is a framework for Verilog RTL synthesis. It currently has extensive Verilog-2005 support and provides a basic set of synthesis algorithms for various application domains. Selected features and typical applications:
- Process almost any synthesizable Verilog-2005 design
- Built-in formal methods for checking properties and equivalence
- Mapping to ASIC standard cell libraries (in Liberty File Format)
- Mapping to Xilinx 7-Series and Lattice iCE40 and ECP5 FPGAs
Open your terminal and type the following to install iverilog and GTKWave
$ sudo apt get update
$ sudo apt get install iverilog gtkwave
read_verilog iiitb_usr.v
synth -top iiitb_usr
dfflibmap -liberty /home/rakshit/iiitb_usr/lib/sky130_fd_sc_hd__tt_025C_1v80.lib
abc -liberty /home/rakshit/iiitb_usr/lib/sky130_fd_sc_hd__tt_025C_1v80.lib -script +strash;scorr;ifraig;retime,{D};strash;dch,-f;map,-M,1,{D}
clean
flatten
# write synthesized design
write_verilog -noattr iiitb_usr_synth.v
stat
-
a31oi: 3-input AND into first input of 2-input NOR.
Y = !((A1 & A2 & A3) | B1)
-
dfxtp: Delay flop, single output.
-
nand2: 2-input NAND.
-
nand3b: 3-input NAND, first input inverted.
-
nor2: 2-input NOR.
-
o21ai: 2-input OR into first input of 2-input NAND.
Y = !((A1 | A2) & B1)
-
o21bai: 2-input OR into first input of 2-input NAND, 2nd input inverted.
Y = !((A1 | A2) & !B1_N)
The gate level simulation waveform matches with the RTL simulation waveform.
OpenLane is an automated RTL to GDSII flow based on several components including OpenROAD, Yosys, Magic, Netgen, CVC, SPEF-Extractor, CU-GR, Klayout and a number of custom scripts for design exploration and optimization. The flow performs full ASIC implementation steps from RTL all the way down to GDSII.
$ apt install -y build-essential python3 python3-venv python3-pip
Docker installation process: https://docs.docker.com/engine/install/ubuntu/
Now clone the OpenLane git repository:
$ git clone https://github.com/The-OpenROAD-Project/OpenLane.git
$ cd OpenLane/
$ sudo make
$ sudo make test
Magic is a venerable VLSI layout tool, written in the 1980's at Berkeley by John Ousterhout, now famous primarily for writing the scripting interpreter language Tcl. Due largely in part to its liberal Berkeley open-source license, magic has remained popular with universities and small companies. The open-source license has allowed VLSI engineers with a bent toward programming to implement clever ideas and help magic stay abreast of fabrication technology. However, it is the well thought-out core algorithms which lend to magic the greatest part of its popularity. Magic is widely cited as being the easiest tool to use for circuit layout, even for people who ultimately rely on commercial tools for their product design flow.
In order to compile Magic on a vanilla installation of Ubuntu, the following additional packages are needed (at a minimum):
$ 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
To install magic
$ git clone https://github.com/RTimothyEdwards/magic
$ cd magic/
$ ./configure
$ sudo make
$ sudo make install
Our objective is to extract LEF from the given layout of inverter in standard format. To do so follow the following steps:
- Clone the vsdstdcelldesign github using the following command
$ git clone https://github.com/nickson-jose/vsdstdcelldesign)
-
Copy the sky130A.tech from the folder /home/rakshit/OpenLane/pdks/sky130A/libs.tech/magic and paste it into the cloned directory.
-
Open the inverter magic layout using the command
$ magic -T sky130A.tech sky130_inv.mag
-
For every layer of inverter which needs to be turned into a port, select that particular layer by pressing s key on keyboard and then select Edit >> Text.
-
Select the sticky checkbox in attach to layer option, uncheck default option and enter locali layer for input and output ports. Also select the enable checkbox and enter 0 and 1 as portnumber for input and output port respectively.
- For power and ground ports, enter metal1 layer and enter 0 and 3 as portnumber for power and ground ports respectively.
- Define the purpose of each port
Select port A in magic and write the following commands in tkcon:
port class input
port use signal
Select Y area in magic and write the following commands in tkcon:
port class output
port use signal
Select VPWR area in magic and write the following commands in tkcon:
port class inout
port use power
Select VGND area in magic and write the following commands in tkcon:
port class inout
port use ground
- Generate the lef file by typing the following command in tkcon:
lef write
This generates sky130_vsdinv.lef file.
To run the design in OpenLane:
-
Create a folder named iiitb_usr in designs folder of OpenLane.
-
Create a src folder inside the iiitb_usr folder.
-
Copy the verilog file (iiitb_usr.v) , extracted lef file of inverter (sky130_vsdinv) and the library files (sky130_fd_sc_hd__fast.lib, sky130_fd_sc_hd__slow.lib, sky130_fd_sc_hd__typical.lib) inside the folder 'OpenLane/designs/iiitb_usr/src'.
-
Then go to OpenLane folder and type the following commands to run OpenLane
$ sudo make mount
$ ./flow.tcl -interactive
% prep -design iiitb_usr
% set lefs [glob $::env(DESIGN_DIR)/src/*.lef]
% add_lefs -src $lefs
- To run synthesis, type the following command
% run_synthesis
The synthesized netlist can be seen in the folder '/home/rakshit/OpenLane/designs/iiitb_usr/runs/RUN_2022.08.30_09.15.49/results/synthesis'
The following cells were mapped from the library.
The inverter sky130_vsdinv
is present in the generated netlist.
- To run the floorplan and the placement, type the following commands
% run_floorplan
% run_placement
To view the floorplan, type the following command in the folder '/home/rakshit/OpenLane/designs/iiitb_usr/runs/RUN_2022.08.30_09.15.49/results/floorplan'
$ magic -T /home/rakshit/OpenLane/pdks/sky130A/libs.tech/magic/sky130A.tech lef read ../../tmp/merged.nom.lef def read iiitb_usr.def &
To view the placement, type the following command in the folder '/home/rakshit/OpenLane/designs/iiitb_usr/runs/RUN_2022.08.30_09.15.49/results/placement'
$ magic -T /home/rakshit/OpenLane/pdks/sky130A/libs.tech/magic/sky130A.tech lef read ../../tmp/merged.nom.lef def read iiitb_usr.def &
- To run the clock tree synthesis, type the following command
% run_cts
The netlist with clock buffers can be seen in the folder '/home/rakshit/OpenLane/designs/iiitb_usr/runs/RUN_2022.08.30_09.15.49/results/cts'
- To run the routing, type the following command
% run_routing
To clone the repository and download the netlist files for simulation, enter the following commands in your terminal:
$ sudo apt install git
$ git clone https://github.com/rakshit-23/iiitb_usr
$ cd iiitb_usr/
$ iverilog iiitb_usr.v iiitb_usr_tb.v
$ ./a.out
$ gtkwave iiitb_usr_out.vcd
The netlist produced after the clock tree synthesis is taken into account to determine the chip's performance. The netlist contains 8 flip-flops. Using the OpenSTA tool, the slack for each register to register path is calculated and the path with worst slack is used to calculated the performance of the design.
To invoke OpenSTA type the following commands in the terminal opened in the OpenLANE directory
$ sudo make mount
sta
Type the following commands to calculate the performance of the design in OpenSTA
read_liberty -min /home/rakshit/OpenLane/pdks/sky130A/libs.ref/sky130_fd_sc_hd/lib/sky130_fd_sc_hd__ff_n40C_1v56.lib
read_liberty -max /home/rakshit/OpenLane/pdks/sky130A/libs.ref/sky130_fd_sc_hd/lib/sky130_fd_sc_hd__ff_n40C_1v56.lib
read_verilog /home/rakshit/OpenLane/pdks/sky130A/libs.ref/sky130_fd_sc_hd/iiitb_usr.v
link_design iiitb_usr
read_sdc /home/rakshit/OpenLane/pdks/sky130A/libs.ref/sky130_fd_sc_hd/iiitb_usr.sdc
read_spef /home/rakshit/OpenLane/pdks/sky130A/libs.ref/sky130_fd_sc_hd/iiitb_usr.spef
create_clock -name clock -period 10 {clock}
set_propagated_clock clock
report_checks -from _71_ -to _70_
The library setup time is 0.09 ns and the data arrival time (delay) is 1.58 ns. The minimum slack of the design for clock period of 10 ns is 8.56 ns. Therefore the maximum clock frequency of the design is 1/(10-8.56)=694.44 MHz.
Flop ratio = Number of D Flip flops
______________________
Total Number of cells
Number of flip-flops in the design = 8
Number of cells in the design = 45
Flip-flop to Standard cell ratio = 8/45 = 0.1778 = 17.78%
The total power consumed by the design is 4.11 micro Watts
- Internal Power = 2.31 micro Watt
- Switching Power = 1.8 micro Watt
- Leakage Power = 0.188 nano Watt
- Rakshit Bhatia, M.Tech student at IIIT Bangalore.
- Kunal Ghosh, Director, VSD Corp. Pvt. Ltd.
- Madhav Rao, Associate Professor, IIIT Bangalore
- Rakshit Bhatia- rakshit2325@gmail.com
- Kunal Ghosh- kunalghosh@gmail.com
- Madhav Rao- mr@iiitb.ac.in
-
GeeksforGeeks, "Universal Shift Register" https://www.geeksforgeeks.org/universal-shift-register-in-digital-logic/#:~:text=A%20bidirectional%20shift%20register%20is,register%20with%20parallel%20load%20provision.&text=A%20n%2Dbit%20universal%20shift,n%204%C3%971%20multiplexers.
-
Yosys Open Synthesis Suite https://yosyshq.net/yosys/
-
SkyWater, "SKY130 PDK DOCUMENTATION" https://skywater-pdk.readthedocs.io/en/main/
-
Open Circuit Design, "Magic install" http://opencircuitdesign.com/magic/install.html
-
GTKWave http://gtkwave.sourceforge.net/
-
Icarus Verilog http://iverilog.icarus.com/
-
The OpenRoad Project, "OpenLane" https://github.com/The-OpenROAD-Project/OpenLane