Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Schematic notebook demo #920

Merged
merged 16 commits into from Nov 29, 2022
Merged

Conversation

tvt173
Copy link
Collaborator

@tvt173 tvt173 commented Nov 29, 2022

Hi all,

This PR puts forth a proposed way to make a schematic editor in a Jupyter notebook, which can be used to build a Schematic-Driven Layout flow. There are three main developments here

  1. A new schematic format *.schem.yml with
    • instances (same as layout)
    • nets (new, for logical connections)
    • ports (same as layout)
    • schematic_placements (new, for placements of instances in the schematic)
  2. A way to edit a schematic, taking advantage of Jupyter notebooks to combine the benefits of GUI and code-driven flows. The notebook has grid-like editors we can use to quickly populate our instances and nets, but then we can freely edit settings or do anything else to our schematic in python inline in the notebook as well. Since the notebook syncs with a *.schem.yml file, it can be reloaded/rerun later on and reproduce exactly the same results. The schematic is then displayed in a bokeh widget, which we can use to freely move around our instances to our pleasing. Again, adjustments here are also instantly synced to disk.
  3. Layout instantiation from the schematic. For now, I do this fairly simply (see the notebook), by generating a preliminary *.pic.yml from the schematic. We could consider allowing for partially-defined "layout implementations" also, which use the schematic instances as-is. For now, I think this is probably good enough though, and we can add checking later on to cross-check the two.

I've played around with it a bit, and I find it to be a pretty nice, simple way to build up a netlist and schematic. I like that the format is already very close to our *.pic.yml syntax and the two can be used almost interchangeably. As with the pic yaml syntax, the schematic yaml is also very clean, concise, and readable. I also like that you can combine GUI and code driven flows in a single document, and leverage the full python/jupyter ecosystem. Let me know what you think!

Addresses #516

@joamatab
@flaport
@skychil
@thomasdorch
@HelgeGehring

@codecov
Copy link

codecov bot commented Nov 29, 2022

Codecov Report

Merging #920 (65b65f6) into master (534b0d1) will decrease coverage by 1.57%.
The diff coverage is 24.09%.

@@            Coverage Diff             @@
##           master     #920      +/-   ##
==========================================
- Coverage   75.65%   74.08%   -1.58%     
==========================================
  Files         426      429       +3     
  Lines       21010    21670     +660     
  Branches     2819     2931     +112     
==========================================
+ Hits        15896    16055     +159     
- Misses       4231     4731     +500     
- Partials      883      884       +1     
Impacted Files Coverage Δ
gdsfactory/schematic_editor.py 15.89% <15.89%> (ø)
gdsfactory/circuitviz.py 16.05% <16.05%> (ø)
gdsfactory/picmodel.py 67.96% <67.96%> (ø)

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

@joamatab
Copy link
Contributor

amazing! Thank you Troy

this combined with netlist extraction will allow us to run LVS on gdsfactory flow

@simbilod
@sebastian-goeldi
@damienbonneau
@growly
@dan-fritchman
@proppy
@SkandanC

@tvt173
Copy link
Collaborator Author

tvt173 commented Nov 29, 2022

added the capability to add nets programmatically... i haven't yet implemented removal of nets or addition of ports, though it's fairly easy to just edit the netlist by hand for now and reload the notebook. would be nice improvements for the future...

@joamatab joamatab merged commit 8b4842a into gdsfactory:master Nov 29, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants