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

fix write_drc #428

Merged
merged 1 commit into from
Jun 20, 2024
Merged
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
9 changes: 6 additions & 3 deletions gplugins/klayout/drc/write_drc.py
Original file line number Diff line number Diff line change
Expand Up @@ -283,8 +283,12 @@ def write_layer_definition(layers: dict[str, Layer]) -> list[str]:
layers: layer definitions can be dict, dataclass or pydantic BaseModel.
"""
layers = asdict(layers) if is_dataclass(layers) else layers
layers = dict(layers)
return [f"{key} = input({value[0]}, {value[1]})" for key, value in layers.items()]
out = []
for layer in layers:
layer_name = str(layer)
layer_tuple = tuple(layer)
out += [f"{layer_name} = input({layer_tuple[0]}, {layer_tuple[1]})"]
return out


def get_drc_script(
Expand Down Expand Up @@ -455,7 +459,6 @@ def write_drc_deck_macro(
]

layers = LAYER
layers["WG_PIN"] = (1, 10)
drc_check_deck = write_drc_deck_macro(rules=rules, layers=layers, mode="tiled")
script = get_drc_script(rules=rules, layers=layers, mode="tiled")
print(script)
Loading