Skip to content
Open
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
31 changes: 21 additions & 10 deletions .github/workflows/tests.yaml
Original file line number Diff line number Diff line change
@@ -1,6 +1,3 @@
# This workflow will install Python dependencies, run tests and lint with a variety of Python versions
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions

name: tests

on:
Expand All @@ -14,7 +11,7 @@ jobs:
strategy:
fail-fast: false
matrix:
python-version: ["3.7", "3.8", "3.9", "3.10", "3.11"]
python-version: ["3.7", "3.8", "3.9", "3.10", "3.11", "3.12"]

steps:
- name: Checkout VLSIR Repo
Expand All @@ -26,9 +23,17 @@ jobs:
apt-get install -y python${{ matrix.python-version }}
apt-get install -y python${{ matrix.python-version }}-dev
apt-get install -y python${{ matrix.python-version }}-venv
apt-get install -y python${{ matrix.python-version }}-distutils

#! The bizarre insanity of ". ./venv/..." is an Ubuntu sh translation of
# Only install distutils for Python versions below 3.12
if [[ "${{ matrix.python-version }}" < "3.12" ]]; then
apt-get install -y python${{ matrix.python-version }}-distutils || true
fi
# For Python 3.12, install setuptools which replaces distutils functionality
if [[ "${{ matrix.python-version }}" > "3.11" ]]; then
python${{ matrix.python-version }} -m ensurepip --upgrade || true
python${{ matrix.python-version }} -m pip install setuptools
fi

#! ". ./venv/..." is an Ubuntu sh translation of
#! "source venv/..." seen in most Python documentation
- name: pytest `bindings/python`
run: |
Expand Down Expand Up @@ -82,17 +87,23 @@ jobs:
with:
python-version: "3.10"

- name: Install 2to3, protobuf and black
run: pip3 install 2to3 protobuf black
- name: Install 2to3, protobuf, black and ruff
run: pip3 install 2to3 protobuf black ruff

- name: Setup node
uses: actions/setup-node@v3
with:
node-version: 22

- name: Install Yarn
run: npm install -g yarn

- name: Install TypeScript Dependencies
run: yarn
working-directory: bindings/ts/

- name: Make scripts executable
run: chmod +x scripts/*.sh

- name: Run build script
run: scripts/build_all_recipes.sh
run: scripts/build_all_recipes.sh
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
settings.json
.pytest_cache
*.code-workspace
*.code-workspace
.ruff_cache/
2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
BSD 3-Clause License

Copyright (c) 2021, Dan Fritchman
Copyright (c) 2021-24, Dan Fritchman
All rights reserved.

Redistribution and use in source and binary forms, with or without
Expand Down
2 changes: 1 addition & 1 deletion SpiceCmp/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
readme = here / "readme.md"
long_description = "" if not readme.exists() else readme.read_text(encoding="utf-8")

VLSIR_VERSION = "7.0.0.dev1"
VLSIR_VERSION = "7.0.0"

setup(
name="spicecmp",
Expand Down
4 changes: 2 additions & 2 deletions SpiceCmp/spicecmp/__init__.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
"""
# SpiceCmp
# SpiceCmp
"""

__version__ = "7.0.0.dev1" # VLSIR_VERSION
__version__ = "7.0.0" # VLSIR_VERSION

# Local Imports
from .errormode import ErrorMode
Expand Down
6 changes: 3 additions & 3 deletions SpiceCmp/spicecmp/compare_me.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
"""
"""
# The Stuff Ultimately Being *Compared* in `spicecmp`

Pairs of Pdk + Simulator Combos, and associated functions to run
their test-cases and collect resultant measurement results.
Pairs of Pdk + Simulator Combos, and associated functions to run
their test-cases and collect resultant measurement results.

"""

Expand Down
2 changes: 1 addition & 1 deletion SpiceCmp/tests/test_spicecmp.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,4 @@


def test_version():
assert __version__ == "7.0.0.dev1" # VLSIR_VERSION
assert __version__ == "7.0.0" # VLSIR_VERSION
1 change: 0 additions & 1 deletion VlsirDev/LICENSE

This file was deleted.

29 changes: 29 additions & 0 deletions VlsirDev/LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
BSD 3-Clause License

Copyright (c) 2021-24, Dan Fritchman
All rights reserved.

Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:

1. Redistributions of source code must retain the above copyright notice, this
list of conditions and the following disclaimer.

2. Redistributions in binary form must reproduce the above copyright notice,
this list of conditions and the following disclaimer in the documentation
and/or other materials provided with the distribution.

3. Neither the name of the copyright holder nor the names of its
contributors may be used to endorse or promote products derived from
this software without specific prior written permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
2 changes: 1 addition & 1 deletion VlsirDev/pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[project]
name = "vlsirdev"
description = "VLSIR Development Dependencies"
version = "7.0.0.dev1" # VLSIR_VERSION
version = "7.0.0" # VLSIR_VERSION
dependencies = [ # <= This right here is the whole point of this package!
"pytest==7.1",
"coverage",
Expand Down
10 changes: 5 additions & 5 deletions VlsirDev/vlsirdev/__init__.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
"""
# VLSIR Dev
"""
# VLSIR Dev

Not a real package in the sense of doing anything.
Not a real package in the sense of doing anything.
Really just a container for development dependencies.
Including sync'ing all their versions.
Including sync'ing all their versions.
"""

__version__ = "7.0.0.dev1" # VLSIR_VERSION
__version__ = "7.0.0" # VLSIR_VERSION
2 changes: 1 addition & 1 deletion VlsirTools/LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
BSD 3-Clause License

Copyright (c) 2021, Dan Fritchman
Copyright (c) 2021-24, Dan Fritchman
All rights reserved.

Redistribution and use in source and binary forms, with or without
Expand Down
15 changes: 7 additions & 8 deletions VlsirTools/conftest.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
"""
# VlsirTools Pytest Utilities
# VlsirTools Pytest Utilities

Primarily adds and parses the command-line options for enabling and disabling `vlsirtools.spice` simulators.
Primarily adds and parses the command-line options for enabling and disabling `vlsirtools.spice` simulators.
To use these utilities, add the following to your `conftest.py`:

```python
Expand All @@ -12,31 +12,30 @@
)
```

See VlsirTools' own `conftest.py` for an example.
With these functions included, by those names, in `conftest.py`, invocations of `pytest` can use:
See VlsirTools' own `conftest.py` for an example.
With these functions included, by those names, in `conftest.py`, invocations of `pytest` can use:

* The `--simulator_test_mode` command-line option
* The `--simulator_test_mode` command-line option
* Values are `required`, `if_available`, or `disabled`
* Markers for each supported simulator
* `spectre`, `xyce`, and `ngspice` are currently supported
* Command-line options for each supported simulator, to override `simulator_test_mode`


Examples:
Examples:

```
pytest --simulator_test_mode disabled # Disables all simulation tests
pytest --simulator_test_mode required # Requires all simulation tests
pytest --simulator_test_mode if_available # Runs tests on available simulators

pytest --simulator_test_mode if_available --ngspice required # Requires ngspice, tests all others available
pytest --simulator_test_mode if_available --ngspice required # Requires ngspice, tests all others available
pytest --simulator_test_mode required --xyce disabled # Disables xyce, requires all others
pytest --simulator_test_mode disabled --spectre required # Requires spectre, disables all others
```

"""


from vlsirtools.pytest import (
pytest_configure,
pytest_addoption,
Expand Down
8 changes: 4 additions & 4 deletions VlsirTools/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
readme = here / "readme.md"
long_description = "" if not readme.exists() else readme.read_text(encoding="utf-8")

VLSIR_VERSION = "7.0.0.dev1"
VLSIR_VERSION = "7.0.0"

setup(
name="vlsirtools",
Expand All @@ -27,11 +27,11 @@
author="Dan Fritchman",
author_email="[email protected]",
packages=find_packages(),
python_requires=">=3.7, <3.12",
python_requires=">=3.7, <3.13",
install_requires=[
f"vlsir=={VLSIR_VERSION}", # VLSIR Core Python Bindings
"numpy~=1.21", # For `sim_data` simulation results
"pandas~=1.3", # For CSV reading
"numpy", # For `sim_data` simulation results
"pandas", # For CSV reading
],
extras_require={"dev": ["vlsirdev"]},
)
2 changes: 1 addition & 1 deletion VlsirTools/tests/test_vlsirtools.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ def _prim(name: str) -> Reference:


def test_version():
assert vlsirtools.__version__ == "7.0.0.dev1" # VLSIR_VERSION
assert vlsirtools.__version__ == "7.0.0" # VLSIR_VERSION


def test_verilog_netlist1():
Expand Down
2 changes: 1 addition & 1 deletion VlsirTools/vlsirtools/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# Vlsir Tools
"""

__version__ = "7.0.0.dev1" # VLSIR_VERSION
__version__ = "7.0.0" # VLSIR_VERSION

# Python module namespaces
from . import spice
Expand Down
2 changes: 1 addition & 1 deletion VlsirTools/vlsirtools/cli/__main__.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
"""
# VlsirTools CLI
# VlsirTools CLI
"""

# Std-Lib Imports
Expand Down
4 changes: 2 additions & 2 deletions VlsirTools/vlsirtools/netlist/__init__.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
"""
Vlsir Netlisting
"""
Vlsir Netlisting

Exports `vlsir.circuit.Package` and `vlsir.netlist.NetlistInput` to a netlist format.
"""
Expand Down
5 changes: 3 additions & 2 deletions VlsirTools/vlsirtools/netlist/base.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
"""
Netlister Base Class
Netlister Base Class
"""

# Std-Lib Imports
Expand Down Expand Up @@ -30,7 +30,8 @@ class ResolvedModule:
@dataclass
class SpiceBuiltin:
"""# Reference to a SPICE built-in element, e.g. the ideal resistor, capacitor, or voltage source.
Many formats include special syntax for defining these, e.g. parameter specifications that work for no other instance."""
Many formats include special syntax for defining these, e.g. parameter specifications that work for no other instance.
"""

module: vckt.ExternalModule
# External module definition, generally from `vlsir.primitives`. Largely used for ports and parameters.
Expand Down
2 changes: 1 addition & 1 deletion VlsirTools/vlsirtools/netlist/fmt.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
"""
"""
Netlist Formats
"""

Expand Down
4 changes: 2 additions & 2 deletions VlsirTools/vlsirtools/netlist/main.py
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
"""
Vlsir Netlisting
"""
Vlsir Netlisting
The main `netlist` function(s).
"""

Expand Down
40 changes: 20 additions & 20 deletions VlsirTools/vlsirtools/netlist/spice.py
Original file line number Diff line number Diff line change
@@ -1,34 +1,34 @@
"""
"""
Spice Format Netlisting

"Spice-format" is a bit of a misnomer in netlist-world.
Of the countless Spice-class simulators have been designed the past half-century,
most have a similar general netlist format, including:
"Spice-format" is a bit of a misnomer in netlist-world.
Of the countless Spice-class simulators have been designed the past half-century,
most have a similar general netlist format, including:

* Simulation input comprises a file-full of:
* Simulation input comprises a file-full of:
* (a) Circuit elements, arranged in `vlsir.Module`s, and
* (b) Simulator control "cards", such as analysis statements, global parameters, measurements, probes, and the like.
* Circuit-specification is aided by hierarchy, generally in the form of "sub-circuits", denoted `SUBCKT`.
* Sub-circuits can commonly be parameterized, and can use a limited set of "parameter programming" to maniupulate their own parameter-values into those of their child-instances.
* Circuit-specification is aided by hierarchy, generally in the form of "sub-circuits", denoted `SUBCKT`.
* Sub-circuits can commonly be parameterized, and can use a limited set of "parameter programming" to maniupulate their own parameter-values into those of their child-instances.
* For example, an instance might be declared as: `xdiode p n area=`width*length``, where `width` and `length` are parameters or its parent.
* `Signal`s are all scalar nets, which are created "out of thin air" whenever referenced.
* "Typing" performed by instance-name prefixes, e.g. instances named `r1` being interpreted as resistors.
* Many other subtleties, such as the typical case-insensitivity of netlist content (e.g. `V1` and `v1` are the same net).
* `Signal`s are all scalar nets, which are created "out of thin air" whenever referenced.
* "Typing" performed by instance-name prefixes, e.g. instances named `r1` being interpreted as resistors.
* Many other subtleties, such as the typical case-insensitivity of netlist content (e.g. `V1` and `v1` are the same net).

However each simulator also differs in ways large and small.
Common differences manifest in the areas of:
However each simulator also differs in ways large and small.
Common differences manifest in the areas of:

* How sub-circuits parameters are declared, and correspondingly how instance-parameter values are set.
* Sandia Lab's *Xyce* differs in a prominent fashion, adding a `PARAMS:` keyword where declarations and values begin.
* How sub-circuits parameters are declared, and correspondingly how instance-parameter values are set.
* Sandia Lab's *Xyce* differs in a prominent fashion, adding a `PARAMS:` keyword where declarations and values begin.
* How arithmetic expressions are specified, and what functions and expressions are available.
* Common methods include back-ticks (Hspice) and squiggly-brackets (NgSpice).
* Notably the asterisk-character (`*`) is the comment-character in many of these formats, and must be wrapped in an expression to perform multiplication.
* The types and locations of *comments* that are supported.
* Notably the asterisk-character (`*`) is the comment-character in many of these formats, and must be wrapped in an expression to perform multiplication.
* The types and locations of *comments* that are supported.
* Some include the fun behavior that comments beginning mid-line require *different* comment-characters from those starting at the beginning of a line.
* While not an HDL attribute, they often differ even more in how simulation control is specified, particularly in analysis and saving is specified.
* While not an HDL attribute, they often differ even more in how simulation control is specified, particularly in analysis and saving is specified.

"Spice" netlisting therefore requires a small family of "Spice Dialects",
heavily re-using a central `SpiceNetlister` class, but requiring simulator-specific implementation details.
"Spice" netlisting therefore requires a small family of "Spice Dialects",
heavily re-using a central `SpiceNetlister` class, but requiring simulator-specific implementation details.

"""

Expand Down Expand Up @@ -182,7 +182,7 @@ def write_model_instance(self, pinst: vckt.Instance, ref: SpiceModelRef) -> None
def write_subckt_instance(
self, pinst: vckt.Instance, rmodule: ResolvedModule
) -> None:
""" Write a subcircuit instance.
"""Write a subcircuit instance.
While sub-classes may modify this behavior, the default is to produce netlist-content
very similar to that of `write_model_instance`, hence the sharing via `write_instance_inner`.
"""
Expand Down
3 changes: 2 additions & 1 deletion VlsirTools/vlsirtools/netlist/verilog.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
"""
Verilog-Format Netlister
Verilog-Format Netlister
"""

# Local Imports
import vlsir
import vlsir.circuit_pb2 as vckt
Expand Down
2 changes: 1 addition & 1 deletion VlsirTools/vlsirtools/primitives.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
"""
"""
# Vlsir(Tools) Primitives

Defines the `vlsir.circuit.Package`-worth of the primitive elements
Expand Down
Loading
Loading