Creating Transmission Gate circuit with ESim and simulation it with Spice and Skywater130


Procedure

- Selecting a simple and minimal circuit that has only components supported by Skywater130.

- Finalizing circuit and researching on it.
Download and install ESim and draw the schematic of the circuit in the designer window.

- Annotate the circuit components and check the electrical connections.

- Generate the netlist file with default spice formate and save it.

- Convert the file with KiCad to the Ngspice tool with appropriate details like transient, source, component libraries, etc.

- After successful conversion run simulation. It will show the NgSpice window with graphs as mentioned in your circuit. Along with that a Python Plot window appears with a customizable graph.

- After successful design and simulation with ESim, we need to do the same with Skywater130 components.

- Open your esim workspace and navigate to your project folder. There will be a file with the name of your project and .cir extension, for e.g. example.cir. Open it with Notepad.

- After opening file in notepad add following line below the header. 
.lib "sky130_fd_pr/models/sky130.lib.spice" tt 
Also, ensure that your sky130_fd_pr folder is in the same directory.

- Now add x at the beginning of skywater130 components.

- After that replace esim MOSFETs with the following code.
For PMOS sky130_fd_pr__pfet_01v8 W=1 L=.5
For NMOS sky130_fd_pr__nfet_01v8 W=.42 L=.5

- Add code for transient and plotting the graphs.

- After file modifications save and close it.

- Open the command line with cmd in windows search. Navigate to your project folder in the command prompt with the cd command. 

- Now run Ngspice simulation with the following command for file example.cir.
ngspice example.cir

- Press Enter. If there is no error in the file, the spice will show graphs for simulation, or else it will show output with the respective error in the spice window.

- These are the complete steps to create a circuit with ESim and simulating with Skywater130 and Ngspice.






Difficulties

- The first and the biggest problem was to find a good circuit and an excellent research paper with the correct circuit diagram.

- It was difficult to understand the esim interface at the first glance but the spoken tutorials helped a lot.

- On running simulations in esim, there were many difficulties with the output of the transmission gate. After altering a lot with the width and length of NMOSand PMOS, the desired waveform was available at the output.

- At the beginning of stage 2, I was very nervous as I didn't have any prior knowledge of Skywater130 and Spice. But thanks to the course provided by Kunal Sir, it helped to get through it and cleared almost all doubts.

- On modifying the file with skywater130 components the waveforms changed completely and again I research more skywater130 Mosfet characteristics. After altering width and length a lot I found a perfect waveform at W=.5 and L=.5 of PMOS with W=.42 and L=.5 of NMOS.

- After much research and work, I am now able to run simulations with Skywater130 and Ngspice. 



I am delighted to get a chance to take part in the ESim marathon and learn so much and get an experience of designing circuits on the real-world foundry.

Special Thanks to Fossee for organizing such a wonderful event and Mr. Kunal Ghosh and Mr. Sumanto Kar for guiding and assisting throughout the marathon