Giter VIP home page Giter VIP logo

spira's Introduction

Version Contributors

MIT License


Logo

Quantum Layout Design Environment

The next-generation object-oriented script-based PCell design environment.
Explore the docs »

Report Bug · Request Feature

Table of Contents

About The Project

phidl example image

SPiRA is the next-generation object-oriented script-based PCell design environment. The framework leverages the Python programming language to effectively generate circuit layouts, while simultaneously checking for design violations, through a novel methodology called validate-by-design. Creating PCells and extracting a model from a layout requires data from the fabrication process. A new PDK scheme is introduced, called the Rule Deck Database (RDD), that effectively connects process data to the SPiRA framework. The design of the RDD revolves around the principle that a PDK cannot be created, but rather that it evolves as our understanding of physical layout design evolves.

Benefits of using SPiRA

  • Create a PCell framework that is easy to use by designers with the focus falling on Superconducting and Quantum Integrated Circuits.
  • Effectively connect process data to layout elements in a generic process-independent fashion.
  • No specific programming knowledge is required.
  • Easily share designs between colleagues.
  • Created PCells can easily be included in a hand-designed layout.

Features

  • Define layout elements in a templated environment.
  • Ability to leverage object-oriented inheritance to simply complex designs.
  • Comprehensive set of commands for shape generation.
  • Use port objects to connect different layout elements.
  • Use routing algorithms to generate polygonal paths between devices.
  • Meticulously define a technology process using Python.

A list of used resources that was helpful in the development of the SPiRA framework.

Built With

Love

Getting Started

This is an example of how you may give instructions on setting up your project locally. To get a local copy up and running follow these simple example steps.

Prerequisites

This is an example of how to list things you need to use the software and how to install them in Fedora:

sudo dnf install redhat-rpm-config
sudo dnf install gcc-c++
sudo dnf install python3-devel
sudo dnf install tkinter
sudo dnf install gmsh

Installation

You can install SPiRA directly from the Python package manager pip using and remember to create a virtual environment:

python3 -m venv env
source env/bin/activate

# Install requirements
pip install -r requirements.txt

# Normal install
pip install .

# Developer install
pip install -e .

Usage

For examples, please refer to the Documentation

All examples can be ran from the environment directory, which is the home directory of your spira folder. For the basic tutorial samples:

python tutorials/basic/_9_stretch_1.py

For the more advanced example with their own defined Rule Deck Database, as explained here.

python spira/technologies/default/circuits/ytron_circuit.py

Roadmap

See the open issues for a list of proposed features (and known issues). As a short overview here is the project focus over the next 12 month:

  • Complete netlist extraction and device detection from a native GDSII layout.
  • Add graph isomorphic checks for differences between the extracted layout netlist and that of the designed SPICE netlist.
  • Implement DRC algorithms and integration support with parameter extraction engines.

Contribute

Contributions are what make the open source community such an amazing place to be learn, inspire, and create. Any contributions you make are greatly appreciated.

  1. Fork the Project
  2. Create your Feature Branch (git checkout -b feature/AmazingFeature)
  3. Commit your Changes (git commit -m 'Add some AmazingFeature')
  4. Push to the Branch (git push origin feature/AmazingFeature)
  5. Open a Pull Request

License

Distributed under the MIT License. See LICENSE for more information.

Contact

Acknowledgements

History of changes

Version 0.2.0 (October 4, 2019)

  • Added layout netlist extraction and viewing.
  • Added electrical rule checking (ERC).
  • Added filters for advanced layout manipulation.
  • Updated ports for more information descriptions. Terminals can now be separated from port definitions.
  • A new concept, called virtual modeling (VModel) is introduced. This allows you to create multiple, virtual versions of a single layout for either debugging or fabrication purposes.
  • Routing algorithms have been updated to leverage speed improvements made in the Gdspy library.
  • The GDSII parser has been updated for better code structure and faster read/write operations.

Version 0.1.1 (July 16, 2019)

  • Updated the advanced tutorial documentation.
  • Added developers documentations.
  • Updated the expand transform algorithms, which fixes a lot of known issues.
  • Updated the GDSII input parser to use new transformation parameters.
  • Changed the ref parameter to reference in SRef.

Version 0.1.0 (July 10, 2019)

  • Added first version of documentation.
  • Renamed Fields to Parameters to overcome confusion.
  • Renamed elemental to elements, since spira.Cell does not inherit from gdspy.Cell anymore.
  • Added parameter restrictions and preprocessing capabilities.
  • Updated parameters to accept an extra restriction argument.
  • Introduces Vector, Line, and Coord classes.
  • Depricated locked ports. Instead different port purposes can now be defined.
  • Introduces process and purpose parameters to layer elements.
  • Introduces derived layers to allow for layer boolean operations. This makes the RDD more flexible for future technology changes.
  • Updated the edge generation algorithms to include both an outside and inside edge.
  • Updated the routing algorithms to use new gdspy features.
  • Added stretching operations.
  • Extended the RDD to include display resources.
  • Fix issues with writing to a GDSII file.
  • Added snap to grid functionality.
  • Implemented parameters caching.
  • Added port alignment operations.
  • Added PortList class for special port filtering functionality.
  • Created layer mappers.
  • Changed the default coordinate system to improve port transformations.
  • Updates shapes and polygons to only include single polygons. Multiple polygons are now moved to the PolygonGroup class.
  • Updated ports to extend from the Vector.
  • Added a custom LayerList class that compares already added layers.
  • Updated mixins to a single MixinBowl meta-configuration.
  • Updated the datatype parameter of ports that represents primitive connects.
  • Added NumberParameter which supports 'int' and 'float' parameters.
  • Added ComplexParameter which supports 'int', 'float' and 'complex' parameters.
  • Added automatic docstring generation.

Version 0.0.3 (March 12, 2019)

  • Added Dummy ports for crossing nodes in netlist.
  • Automatically generate terminal edges for metal polygons.
  • Added shape for yTron.
  • Added path routing between two terminals.
  • Define a route using a list of terminals.
  • Device cell detection (Junction, Via, etc).
  • Basic LVS implementation.

Version 0.0.2 (Jan 11, 2019)

  • Implemented Manhattan routing between terminals.
  • Integrated circleci.
  • Started adding unit tests using pytest.
  • Updated auto doc generation for classes.
  • Added MidPointField for port and terminal midpoints.
  • Introduces the Shape class that allows for complex point manipulations.
  • Introduces term which is a vertical connection port.
  • Routes are defined as a Shape with two connected terminal ports.

Version 0.0.1 (Dec 01, 2018)

  • Initial release.

spira's People

Contributors

jcoetzee123 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

spira's Issues

spira.Port does not connect to correct process, without process parameter

Title

spira.Port does not connect to correct process, without process parameter

Steps to reproduce:

import spira and desired RDD

import spira.all as spira
from spira.technologies.mit.process.database import RDD

create a class of type PCell, desired box element and ports

class Resistor(spira.PCell):

    width = spira.NumberParameter(default=spira.NUMBER(2))
    length = spira.NumberParameter(default=spira.NUMBER(5), doc='Length of the shunt resistance.')

    def validate_parameters(self):
        if self.width > self.length:
            raise ValueError('`Width` cannot be larger than `length`.')
        return True

    def create_elements(self, elems):
        elems += spira.Box(width=self.length, height=self.width, center=(0,0), layer=spira.RDD.PLAYER.R5.METAL)
        return elems
    def create_ports(self, ports):
        w, l = self.width, self.length
        ports += spira.Port(name='P1_R5', midpoint=(-l/2,0), orientation=180, width=self.width)
        ports += spira.Port(name='P2', midpoint=(l/2,0), orientation=0, width=self.width, process=spira.RDD.PROCESS.R5)
        return ports

D = Resistor()

####Expected behavior:
Script should execute without errors as naming convention of ports should connect P1 to the R5 process

####Current behavior (incorrect):

[SPiRA] Version 0.1.1-Auron [Beta] - MIT License
---------------------------------------------
Traceback (most recent call last):
  File "tests/testpy.py", line 24, in <module>
    D.gdsii_output("tests/testpy")
  File "/home/johannes/Documents/spira-next/env/lib/python3.7/site-packages/spira/yevon/aspects/output.py", line 34, in gdsii_output
    D = deepcopy(self)
  File "/usr/lib/python3.7/copy.py", line 161, in deepcopy
    y = copier(memo)
  File "/home/johannes/Documents/spira-next/env/lib/python3.7/site-packages/spira/yevon/gdsii/cell.py", line 185, in __deepcopy__
    ports=deepcopy(self.ports)
  File "/home/johannes/Documents/spira-next/env/lib/python3.7/site-packages/spira/core/parameters/descriptor.py", line 96, in __get__
    value = self.call_param_function(obj)
  File "/home/johannes/Documents/spira-next/env/lib/python3.7/site-packages/spira/yevon/geometry/ports/port_list.py", line 234, in call_param_function
    value = f(self.__type__())
  File "/home/johannes/Documents/spira-next/env/lib/python3.7/site-packages/spira/yevon/aspects/port.py", line 37, in __create_ports__
    return self.create_ports(ports)
  File "tests/testpy.py", line 19, in create_ports
    ports += spira.Port(name='P1_R5', midpoint=(-l/2,0), orientation=180, width=self.width)
  File "/home/johannes/Documents/spira-next/env/lib/python3.7/site-packages/spira/yevon/geometry/ports/base.py", line 124, in __call__
    name, process = cls._bind_process_to_name(kwargs)
  File "/home/johannes/Documents/spira-next/env/lib/python3.7/site-packages/spira/yevon/geometry/ports/base.py", line 84, in _bind_process_to_name
    raise ValueError(error_message.format(port_data['name']))
ValueError: Cannot connect port 'P1_R5' to a process.

Preprocessor not parsing values correctly

Title

Preprocessor not parsing values correctly

Steps to reproduce

  1. Import the SPiRA framework
import spira.all as spira
  1. Create a class accepting spira.ParameterInitializer and initialize simple integer parameter
class Layer(spira.ParameterInitializer):
    integer = spira.IntegerParameter(default="1.2", preprocess=spira.ProcessorInt())
  1. Instantiate a layer class to be called in your main script
layer =  Layer()
print(layer.integer)
  1. Execute the script in bash

Expected Behavior (correct)

Paramater should print out as a rounded integer (~1)

Current Behavior (incorrect)

Traceback (most recent call last):
File "tests/createlayer.py", line 25, in
layer.interger = "1.2"
File "/home/johannes/Documents/latestspira 17jul/spira-master/spira/core/parameters/descriptor.py", line 133, in set
v = self.preprocess(value, obj)
File "/home/johannes/Documents/latestspira 17jul/spira-master/spira/core/parameters/processors.py", line 34, in call
return self.process(value, obj)
File "/home/johannes/Documents/latestspira 17jul/spira-master/spira/core/parameters/processors.py", line 93, in process
return self.cast_type(value)
ValueError: invalid literal for int() with base 10: '1.2'

spira.yevon.geometry.ports.port_list.PortList not populating correctly

Title

spira.yevon.geometry.ports.port_list.PortList not populating correctly

Steps to reproduce

Import SPiRA framework and desired tech RDD

import spira.all as spira
from spira.technologies.mit.process.database import RDD

Create a pcell class with desired geometry on a metal layer:

class jjs200(spira.PCell):
   def create_elements(self,elems): 
   elems += spira.Rectangle(p1 = (-1.175,-1.175),p2 = (1.175,2.625), layer =spira.RDD.PLAYER.M6.METAL)

Expected behavior:

D = jjs200()
print(D.element) #ensure the element name is "M6" that we want to access the ports of
print(D.element['M6'].ports)
print(D.element['M6'].ports['E1_M6'])

Output:
List of 4 EDGE ports generated (E1_M6... E4_E6)

Current behavior (incorrect)

[SPiRA] Version 0.1.1-Auron [Beta] - MIT License

PortList is empty
None

default paramater of Float/IntegerParamter can be initialized incorrectly

Title

default paramater of Float/IntegerParameter can be initialized incorrectly

Steps to reproduce

  1. Import the SPiRA framework
import spira.all as spira
  1. Create a class accepting a spira.ParameterInitializer and create a simple integer parameter
class Layer(spira.ParameterInitializer):
   integer = spira.IntegerParameter(default="abcd", preprocess=spira.ProcessorInt())
  1. Create a Layer class to be called in the script
layer = Layer()

Current behavior (incorrect)

[SPiRA] Version 0.1.1-Auron [Beta] - MIT License

Expected behavior (correct)

Traceback (most recent call last):
File "tests/createlayer.py", line 25, in
layer.interger = "1.2"
File "/home/johannes/Documents/latestspira 17jul/spira-master/spira/core/parameters/descriptor.py", line 133, in set
v = self.preprocess(value, obj)
File "/home/johannes/Documents/latestspira 17jul/spira-master/spira/core/parameters/processors.py", line 34, in call
return self.process(value, obj)
File "/home/johannes/Documents/latestspira 17jul/spira-master/spira/core/parameters/processors.py", line 93, in process
return self.cast_type(value)
ValueError: invalid literal for int() with base 10: 'abcd'

RestrictionRange not working as intended

Title

spira.core.parameters.restrictions not working as intended

Steps to reproduce:

  1. Import required parts of the SPiRA framework
import spira.all as spira
  1. Create a class excepting a spira.ParameterInitializer parameter and a range restriction
class Layer(spira.ParameterInitializer):
    range_int = spira.IntegerParameter(restriction=spira.RestrictRange(lower=1, upper=5))
  1. Initialize Layer class in main script and assign invalid value
layer = Layer()
layer.range_int  = 11

Expected behavior (correct)

Error: ValueError, 11 not in range of 5

Current behavior (incorrect)

[SPiRA] Version 0.1.1-Auron [Beta] - MIT License

Possible fixes

Changes made to variables.py to correct logic error.

Slow performance when generating cells

When running a simple DCSFQ script the generation of the GDS file (nothing more) takes 2min. This is longer than the InductEx extraction which takes 40s.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.