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

refactor folder structure in blocks directory #334

Merged
merged 2 commits into from
Aug 30, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions .github/scripts/test_glayout_ci.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,11 @@
__import__('glayout')
except ImportError:
sys.path.append(os.path.abspath(os.path.join(os.path.dirname(__file__), '..', '..')))
from glayout.flow.blocks.opamp import opamp
from glayout.flow.blocks.diff_pair import diff_pair
from glayout.flow.blocks.composite.opamp import opamp
from glayout.flow.blocks.elementary.diff_pair import diff_pair
from glayout.flow.primitives.fet import nmos, pmos
from glayout.flow.pdk.sky130_mapped import sky130_mapped_pdk
from glayout.flow.blocks.current_mirror import current_mirror
from glayout.flow.blocks.elementary.current_mirror import current_mirror
import json
import numpy as np
import shutil
Expand Down
6 changes: 3 additions & 3 deletions docs/source/notebooks/glayout/GLayout_Cells.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -409,7 +409,7 @@
},
"outputs": [],
"source": [
"from glayout.flow.blocks.diff_pair import diff_pair\n",
"from glayout.flow.blocks.elementary.diff_pair import diff_pair\n",
"# Used to display the results in a grid (notebook only)\n",
"left = widgets.Output()\n",
"leftSPICE = widgets.Output()\n",
Expand Down Expand Up @@ -455,7 +455,7 @@
},
"outputs": [],
"source": [
"from glayout.flow.blocks.differential_to_single_ended_converter import differential_to_single_ended_converter\n",
"from glayout.flow.blocks.composite.differential_to_single_ended_converter import differential_to_single_ended_converter\n",
"# Used to display the results in a grid (notebook only)\n",
"left = widgets.Output()\n",
"leftSPICE = widgets.Output()\n",
Expand Down Expand Up @@ -532,7 +532,7 @@
},
"outputs": [],
"source": [
"from glayout.flow.blocks.opamp import opamp\n",
"from glayout.flow.blocks.composite.opamp import opamp\n",
"\n",
"# Select which PDK to use\n",
"pdk = sky130\n",
Expand Down
2 changes: 1 addition & 1 deletion docs/source/notebooks/glayout/glayout_opamp.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -487,7 +487,7 @@
},
"outputs": [],
"source": [
"from glayout.flow.blocks.opamp import opamp\n",
"from glayout.flow.blocks.composite.opamp import opamp\n",
"\n",
"# Select which PDK to use\n",
"pdk = sky130\n",
Expand Down
2 changes: 2 additions & 0 deletions openfasoc/generators/glayout/glayout/flow/blocks/__init__.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
from glayout.flow.blocks.composite import *
from glayout.flow.blocks.elementary import *
Empty file.
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
from glayout.flow.placement.two_transistor_interdigitized import two_nfet_interdigitized
from glayout.flow.placement.four_transistor_interdigitized import generic_4T_interdigitzed
from glayout.flow.placement.two_transistor_interdigitized import two_pfet_interdigitized
from glayout.flow.blocks.diff_pair import diff_pair_generic
from glayout.flow.blocks.elementary.diff_pair import diff_pair_generic
from glayout.flow.routing.smart_route import smart_route
from glayout.flow.routing.L_route import L_route
from glayout.flow.routing.c_route import c_route
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
from .differential_to_single_ended_converter import differential_to_single_ended_converter, differential_to_single_ended_converter_netlist
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
from gdsfactory.components.rectangle import rectangle
from glayout.flow.pdk.mappedpdk import MappedPDK
from typing import Optional, Union
from glayout.flow.blocks.diff_pair import diff_pair
from glayout.flow.blocks.elementary.diff_pair.diff_pair import diff_pair
from glayout.flow.primitives.fet import nmos, pmos, multiplier
from glayout.flow.primitives.guardring import tapring
from glayout.flow.primitives.mimcap import mimcap_array, mimcap
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
from .diff_pair_cmirrorbias import diff_pair_ibias, diff_pair_ibias_netlist
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
from gdsfactory.components.rectangle import rectangle
from glayout.flow.pdk.mappedpdk import MappedPDK
from typing import Optional, Union
from glayout.flow.blocks.diff_pair import diff_pair
from glayout.flow.blocks.elementary.diff_pair import diff_pair
from glayout.flow.primitives.fet import nmos, pmos, multiplier
from glayout.flow.primitives.guardring import tapring
from glayout.flow.primitives.mimcap import mimcap_array, mimcap
Expand Down Expand Up @@ -36,7 +36,7 @@
from pydantic import validate_arguments
from glayout.flow.placement.two_transistor_interdigitized import two_nfet_interdigitized
from glayout.flow.spice import Netlist
from glayout.flow.blocks.current_mirror import current_mirror_netlist
from glayout.flow.blocks.elementary.current_mirror import current_mirror_netlist

def diff_pair_ibias_netlist(center_diffpair: Component, current_mirror: Component, antenna_diode: Optional[Component] = None) -> Netlist:
netlist = Netlist(
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
from glayout.flow.blocks.composite.opamp.opamp import opamp, opamp_netlist
from glayout.flow.blocks.composite.opamp.diff_pair_stackedcmirror import diff_pair_stackedcmirror
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
from gdsfactory.components.rectangle import rectangle
from glayout.flow.pdk.mappedpdk import MappedPDK
from typing import Optional, Union
from glayout.flow.blocks.diff_pair import diff_pair
from glayout.flow.blocks.elementary.diff_pair import diff_pair
from glayout.flow.primitives.fet import nmos, pmos, multiplier
from glayout.flow.primitives.guardring import tapring
from glayout.flow.primitives.mimcap import mimcap_array, mimcap
Expand All @@ -19,10 +19,10 @@
from pydantic import validate_arguments
from glayout.flow.placement.two_transistor_interdigitized import two_nfet_interdigitized

from glayout.flow.blocks.diffpair_cmirror_bias import diff_pair_ibias
from glayout.flow.blocks.stacked_current_mirror import stacked_nfet_current_mirror
from glayout.flow.blocks.differential_to_single_ended_converter import differential_to_single_ended_converter
from glayout.flow.blocks.opamp.row_csamplifier_diff_to_single_ended_converter import row_csamplifier_diff_to_single_ended_converter
from glayout.flow.blocks.composite.diffpair_cmirror_bias import diff_pair_ibias
from glayout.flow.blocks.composite.stacked_current_mirror import stacked_nfet_current_mirror
from glayout.flow.blocks.composite.differential_to_single_ended_converter import differential_to_single_ended_converter
from glayout.flow.blocks.composite.opamp.row_csamplifier_diff_to_single_ended_converter import row_csamplifier_diff_to_single_ended_converter


@validate_arguments
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
from glayout.flow.pdk.mappedpdk import MappedPDK
from typing import Optional, Union
from glayout.flow.primitives.fet import nmos, pmos, multiplier
from glayout.flow.blocks.diff_pair import diff_pair
from glayout.flow.blocks.elementary.diff_pair import diff_pair
from glayout.flow.primitives.guardring import tapring
from glayout.flow.primitives.mimcap import mimcap_array, mimcap
from glayout.flow.routing.L_route import L_route
Expand All @@ -20,8 +20,8 @@
from glayout.flow.placement.two_transistor_interdigitized import two_nfet_interdigitized
from glayout.flow.spice import Netlist

from glayout.flow.blocks.opamp.opamp_twostage import opamp_twostage
from glayout.flow.blocks.current_mirror import current_mirror_netlist
from glayout.flow.blocks.composite.opamp.opamp_twostage import opamp_twostage
from glayout.flow.blocks.elementary.current_mirror import current_mirror_netlist

def opamp_output_stage_netlist(pdk: MappedPDK, output_amp_fet_ref: ComponentReference, biasParams: list) -> Netlist:
bias_netlist = current_mirror_netlist(pdk, biasParams[0], biasParams[1], biasParams[2])
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
from glayout.flow.pdk.mappedpdk import MappedPDK
from typing import Optional, Union
from glayout.flow.primitives.fet import nmos, pmos, multiplier
from glayout.flow.blocks.diff_pair import diff_pair
from glayout.flow.blocks.elementary.diff_pair import diff_pair
from glayout.flow.primitives.guardring import tapring
from glayout.flow.primitives.mimcap import mimcap_array, mimcap
from glayout.flow.routing.L_route import L_route
Expand All @@ -19,13 +19,13 @@
from pydantic import validate_arguments
from glayout.flow.placement.two_transistor_interdigitized import two_nfet_interdigitized

from glayout.flow.blocks.diffpair_cmirror_bias import diff_pair_ibias
from glayout.flow.blocks.stacked_current_mirror import stacked_nfet_current_mirror
from glayout.flow.blocks.differential_to_single_ended_converter import differential_to_single_ended_converter
from glayout.flow.blocks.opamp.row_csamplifier_diff_to_single_ended_converter import row_csamplifier_diff_to_single_ended_converter
from glayout.flow.blocks.opamp.diff_pair_stackedcmirror import diff_pair_stackedcmirror
from glayout.flow.blocks.composite.diffpair_cmirror_bias import diff_pair_ibias
from glayout.flow.blocks.composite.stacked_current_mirror import stacked_nfet_current_mirror
from glayout.flow.blocks.composite.differential_to_single_ended_converter import differential_to_single_ended_converter
from glayout.flow.blocks.composite.opamp.row_csamplifier_diff_to_single_ended_converter import row_csamplifier_diff_to_single_ended_converter
from glayout.flow.blocks.composite.opamp.diff_pair_stackedcmirror import diff_pair_stackedcmirror
from glayout.flow.spice import Netlist
from glayout.flow.blocks.current_mirror import current_mirror_netlist
from glayout.flow.blocks.elementary.current_mirror import current_mirror_netlist

@validate_arguments
def __create_and_route_pins(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
from glayout.flow.pdk.mappedpdk import MappedPDK
from typing import Optional, Union
from glayout.flow.primitives.fet import nmos, pmos, multiplier
from glayout.flow.blocks.diff_pair import diff_pair
from glayout.flow.blocks.elementary.diff_pair import diff_pair
from glayout.flow.primitives.guardring import tapring
from glayout.flow.primitives.mimcap import mimcap_array, mimcap
from glayout.flow.routing.L_route import L_route
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
from .stacked_current_mirror import stacked_nfet_current_mirror
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
from glayout.flow.pdk.mappedpdk import MappedPDK
from typing import Optional, Union
from glayout.flow.primitives.fet import nmos, pmos, multiplier
from glayout.flow.blocks.diff_pair import diff_pair
from glayout.flow.blocks.elementary.diff_pair import diff_pair
from glayout.flow.primitives.guardring import tapring
from glayout.flow.primitives.mimcap import mimcap_array, mimcap
from glayout.flow.routing.L_route import L_route
Expand Down

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

Empty file.
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
from glayout.flow.blocks.elementary.current_mirror.current_mirror import current_mirror, current_mirror_netlist
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
from glayout.flow.blocks.elementary.diff_pair.diff_pair import diff_pair, diff_pair_generic, diff_pair_netlist

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -17,3 +17,4 @@ def check_and_download_nltk_data(data_name):


check_and_download_nltk_data("punkt")
check_and_download_nltk_data("punkt_tab")
Original file line number Diff line number Diff line change
Expand Up @@ -716,7 +716,7 @@ def __init__(self, toplvl_name: str):
two_pfet_interdigitized_aliases = list_cartesian_product(["interdigitized","interdigitated"],["pmos","pfet"],True)
self.update_import_table(two_pfet_interdigitized_aliases,"two_pfet_interdigitized","glayout.flow.placement.two_transistor_interdigitized")
self.update_import_table(["common centroid"],"common_centroid_ab_ba","glayout.flow.placement.common_centroid_ab_ba")
self.update_import_table(["diff pair","diff_pair","differential pair","differential pairs","differential transistor"],"diff_pair_generic","glayout.flow.blocks.diff_pair")
self.update_import_table(["diff pair","diff_pair","differential pair","differential pairs","differential transistor"],"diff_pair_generic","glayout.flow.blocks.elementary.diff_pair")
# import routing funcs
self.update_import_table(["smart route","smart","smart_route"],"smart_route","glayout.flow.routing.smart_route")
self.update_import_table(["L route","L_route","l route","l_route"],"L_route","glayout.flow.routing.L_route")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@
from glayout.flow.pdk.util.port_utils import add_ports_perimeter, print_ports
from gdsfactory.component import Component
from glayout.flow.pdk.mappedpdk import MappedPDK
from glayout.flow.blocks.opamp import opamp
from glayout.flow.blocks.composite.opamp import opamp
from glayout.flow.routing.L_route import L_route
from glayout.flow.routing.straight_route import straight_route
from glayout.flow.routing.c_route import c_route
Expand Down