rename to snarled

performance_testing
Jan Petykiewicz 2 years ago
parent ffa5bfa96c
commit 4d7709d615

@ -1,15 +1,15 @@
snarl README snarled README
============ ============
Layout connectivity checker. Layout connectivity checker.
`snarl` is a python package for checking electrical connectivity in multi-layer layouts. `snarled` is a python package for checking electrical connectivity in multi-layer layouts.
It is intended to be "poor-man's LVS" (layout-versus-schematic), for when poverty It is intended to be "poor-man's LVS" (layout-versus-schematic), for when poverty
has deprived the man of both a schematic and a better connectivity tool. has deprived the man of both a schematic and a better connectivity tool.
- [Source repository](https://mpxd.net/code/jan/snarl) - [Source repository](https://mpxd.net/code/jan/snarled)
- [PyPI](https://pypi.org/project/snarl) - [PyPI](https://pypi.org/project/snarled)
## Installation ## Installation
@ -21,12 +21,12 @@ Requirements:
Install with pip: Install with pip:
```bash ```bash
pip3 install snarl pip3 install snarled
``` ```
Alternatively, install from git Alternatively, install from git
```bash ```bash
pip3 install git+https://mpxd.net/code/jan/snarl.git@release pip3 install git+https://mpxd.net/code/jan/snarled.git@release
``` ```
## Example ## Example
@ -35,8 +35,8 @@ See `examples/check.py`. Note that the example uses `masque` to load data.
```python3 ```python3
from pprint import pformat from pprint import pformat
from masque.file import gdsii, oasis from masque.file import gdsii, oasis
import snarl import snarled
import snarl.interfaces.masque import snarled.interfaces.masque
# Layer definitions # Layer definitions
connectivity = { connectivity = {
@ -49,8 +49,8 @@ connectivity = {
cells, props = oasis.readfile('connectivity.oas') cells, props = oasis.readfile('connectivity.oas')
topcell = cells['top'] topcell = cells['top']
polys, labels = snarl.interfaces.masque.read_cell(topcell, connectivity) polys, labels = snarled.interfaces.masque.read_cell(topcell, connectivity)
nets_info = snarl.trace_connectivity(polys, labels, connectivity) nets_info = snarled.trace_connectivity(polys, labels, connectivity)
print('\nFinal nets:') print('\nFinal nets:')
print([kk for kk in nets_info.nets if isinstance(kk.name, str)]) print([kk for kk in nets_info.nets if isinstance(kk.name, str)])
@ -103,7 +103,7 @@ Open nets:
## Code organization ## Code organization
- The main functionality is in `trace_connectivity`. - The main functionality is in `trace_connectivity`.
- Useful classes, namely `NetsInfo` and `NetName`, are in `snarl.tracker`. - Useful classes, namely `NetsInfo` and `NetName`, are in `snarled.tracker`.
- `snarl.interfaces` contains helper code for interfacing with other packages. - `snarled.interfaces` contains helper code for interfacing with other packages.

@ -1,13 +1,13 @@
""" """
Example code for checking connectivity in a layout by using Example code for checking connectivity in a layout by using
`snarl` and `masque`. `snarled` and `masque`.
""" """
from pprint import pformat from pprint import pformat
from masque.file import gdsii, oasis from masque.file import gdsii, oasis
import snarl import snarled
import snarl.interfaces.masque import snarled.interfaces.masque
connectivity = { connectivity = {
@ -21,8 +21,8 @@ connectivity = {
cells, props = oasis.readfile('connectivity.oas') cells, props = oasis.readfile('connectivity.oas')
topcell = cells['top'] topcell = cells['top']
polys, labels = snarl.interfaces.masque.read_cell(topcell, connectivity) polys, labels = snarled.interfaces.masque.read_cell(topcell, connectivity)
nets_info = snarl.trace_connectivity(polys, labels, connectivity) nets_info = snarled.trace_connectivity(polys, labels, connectivity)
print('\nFinal nets:') print('\nFinal nets:')
print([kk for kk in sorted(nets_info.nets.keys()) if isinstance(kk.name, str)]) print([kk for kk in sorted(nets_info.nets.keys()) if isinstance(kk.name, str)])

@ -6,20 +6,20 @@ from setuptools import setup, find_packages
with open('README.md', 'rt') as f: with open('README.md', 'rt') as f:
long_description = f.read() long_description = f.read()
with open('snarl/VERSION.py', 'rt') as f: with open('snarled/VERSION.py', 'rt') as f:
version = f.readlines()[2].strip() version = f.readlines()[2].strip()
setup(name='snarl', setup(name='snarled',
version=version, version=version,
description='CAD layout electrical connectivity checker', description='CAD layout electrical connectivity checker',
long_description=long_description, long_description=long_description,
long_description_content_type='text/markdown', long_description_content_type='text/markdown',
author='Jan Petykiewicz', author='Jan Petykiewicz',
author_email='jan@mpxd.net', author_email='jan@mpxd.net',
url='https://mpxd.net/code/jan/snarl', url='https://mpxd.net/code/jan/snarled',
packages=find_packages(), packages=find_packages(),
package_data={ package_data={
'snarl': ['py.typed', 'snarled': ['py.typed',
] ]
}, },
install_requires=[ install_requires=[

@ -1,17 +1,17 @@
""" """
snarl snarled
===== =====
Layout connectivity checker. Layout connectivity checker.
`snarl` is a python package for checking electrical connectivity in multi-layer layouts. `snarled` is a python package for checking electrical connectivity in multi-layer layouts.
It is intended to be "poor-man's LVS" (layout-versus-schematic), for when poverty It is intended to be "poor-man's LVS" (layout-versus-schematic), for when poverty
has deprived the man of both a schematic and a better connectivity tool. has deprived the man of both a schematic and a better connectivity tool.
The main functionality is in `trace_connectivity`. The main functionality is in `trace_connectivity`.
Useful classes, namely `NetsInfo` and `NetName`, are in `snarl.tracker`. Useful classes, namely `NetsInfo` and `NetName`, are in `snarled.tracker`.
`snarl.interfaces` contains helper code for interfacing with other packages. `snarled.interfaces` contains helper code for interfacing with other packages.
""" """
from .main import trace_connectivity from .main import trace_connectivity
from .tracker import NetsInfo, NetName from .tracker import NetsInfo, NetName

@ -24,18 +24,18 @@ def read_cell(
""" """
Extract `polys` and `labels` from a `masque.Pattern`. Extract `polys` and `labels` from a `masque.Pattern`.
This function extracts the data needed by `snarl.trace_connectivity`. This function extracts the data needed by `snarled.trace_connectivity`.
Args: Args:
cell: A `masque` `Pattern` object. Usually your topcell. cell: A `masque` `Pattern` object. Usually your topcell.
connectivity: A sequence of 3-tuples specifying the layer connectivity. connectivity: A sequence of 3-tuples specifying the layer connectivity.
Same as what is provided to `snarl.trace_connectivity`. Same as what is provided to `snarled.trace_connectivity`.
label_mapping: A mapping of `{label_layer: metal_layer}`. This allows labels label_mapping: A mapping of `{label_layer: metal_layer}`. This allows labels
to refer to nets on metal layers without the labels themselves being on to refer to nets on metal layers without the labels themselves being on
that layer. that layer.
Returns: Returns:
`polys` and `labels` data structures, to be passed to `snarl.trace_connectivity`. `polys` and `labels` data structures, to be passed to `snarled.trace_connectivity`.
""" """
metal_layers, via_layers = connectivity2layers(connectivity) metal_layers, via_layers = connectivity2layers(connectivity)
@ -80,7 +80,7 @@ def load_polys(
layers: Sequence[layer_t], layers: Sequence[layer_t],
) -> defaultdict[layer_t, List[NDArray[numpy.float64]]]: ) -> defaultdict[layer_t, List[NDArray[numpy.float64]]]:
""" """
Given a *flat* `masque.Pattern`, extract the polygon info into the format used by `snarl`. Given a *flat* `masque.Pattern`, extract the polygon info into the format used by `snarled`.
Args: Args:
cell: The `Pattern` object to extract from. cell: The `Pattern` object to extract from.
@ -88,7 +88,7 @@ def load_polys(
Returns: Returns:
`{layer0: [poly0, [(x0, y0), (x1, y1), ...], poly2, ...]}` `{layer0: [poly0, [(x0, y0), (x1, y1), ...], poly2, ...]}`
`polys` structure usable by `snarl.trace_connectivity`. `polys` structure usable by `snarled.trace_connectivity`.
""" """
polys = defaultdict(list) polys = defaultdict(list)
for ss in cell.shapes: for ss in cell.shapes:

@ -1,5 +1,5 @@
""" """
Main connectivity-checking functionality for `snarl` Main connectivity-checking functionality for `snarled`
""" """
from typing import Tuple, List, Dict, Set, Optional, Union, Sequence, Mapping from typing import Tuple, List, Dict, Set, Optional, Union, Sequence, Mapping
from collections import defaultdict from collections import defaultdict
@ -29,7 +29,7 @@ def trace_connectivity(
""" """
Analyze the electrical connectivity of the layout. Analyze the electrical connectivity of the layout.
This is the primary purpose of `snarl`. This is the primary purpose of `snarled`.
The resulting `NetsInfo` will contain only disjoint `nets`, and its `net_aliases` can be used to The resulting `NetsInfo` will contain only disjoint `nets`, and its `net_aliases` can be used to
understand which nets are shorted (and therefore known by more than one name). understand which nets are shorted (and therefore known by more than one name).
Loading…
Cancel
Save