Copy, Paste, and Run with Google Colab

Published: May 23, 2024 by Kwantae Kim

Top


Open Source Chip Design

Getting Started

Install Open Source Tools

Try It Out

Initial version: May 1, 2023

Verified with Windows
Verified with MacOS






Let’s just do whatever available in the open-source circuit design world. Very luckily, some clever people
(credit to Mehdi Saligane from University of Michigan )
made all-in-one example script that we can run.

After setting up the Google Colab, you can just copy & paste the code and run it on your Google Colab environment.



Setup Google Colab

  • Search Google Colab in Google
  • Open Google Colab webpage
  • Login with your Google account
    I suggest opening a separate working account if you prefer not using the private account
  • Open a new notebook

  • Run any code

    For running the cell, use Ctrl + Enter
  • Save the code
    Use ⌘ + S for MacOS or Ctrl + S for Windows
  • Navigate to Google Drive β†’ Colab Notebooks, then you can find your code file, which is .ipynb format
    (The words were broken in the below screenshots .. due to incorrect language setting on my side πŸ˜…)



Copy and Paste an Example Code

  • Move to OpenFASoC Github, move down, find temperature sensor, and open Open in Colab link
  • Copy and paste this example code in a cell-by-cell way into your new notebook
    In the very first cell, you may figure out that it is meant to be for the tool installation.
    As shown in the above video, you have to edit one line to make sure it works.
!python -m pip install pyyaml click
!python -m pip install gdstk
  • If you do not make this change, it shows the following error ..
    It seems to be something related to installing gdstk using Python pip command, but I have no idea why it is not working on my side (it will be appreciated if any of you let me know the reason for this )
  • Anyway, if you fix the first cell, any other cells are working all fine even with blindly copying and pasting



Generate Temperature Sensor

Floorplan

Placement

Clock-Tree Synthesis (CTS)

Routing

Yes, it looks like something is happening! Of course, you can also run the DRC & LVS of this circuit!



Generate LDO Regulator

Similarly, you can also generate Low-Dropout (LDO) Regulator by using link in the same OpenFASoC Github page.



As above, the layout is generated and you can also get the .gds file!



So What is Next?

Yeah, those things are really cool. We are managing the circuit by using Python scripts!

But it is not easy figure out what are these codes exactly meaning for. As an Analog Circuit Designer, we are mostly more familiar with Cadence Virtuoso environment, we cannot catch the flow easily by just blindly running the code, of course.

What I am mostly interested in is, how to easily deal with these open-source tools with an Analog Circuit Designer’s point of view, and write a tutorial for it.




Acknowledgments
Thanks to Sheng Zhou for helping me to verify the tutorial flow!