stackup module#

Design Stackup#

This module provides classes for defining board layer stackups, including materials, dielectrics, and conductors.

class Stackup[source]#

Bases: Critical

Stackups are determined by introspection, layers will be declared in the order they are specified in the stackup. Can be specified by an ordered set of attributes, or containers such as lists, or a combination thereof.

>>> class SoldermaskLayer(Dielectric):
...     dielectric_coefficient = 1.5
...     loss_tangent = 0.01
>>> class FR4(Dielectric):
...     dielectric_coefficient = 4.5
...     loss_tangent = 0.02
>>> class Copper(Conductor):
...     roughness = 0.01
>>> copper1oz = Copper(thickness=0.035)
>>> class ProjectStackup(Stackup):  # using names
...     top_surface = SoldermaskLayer(thickness=0.1)
...     top = copper1oz
...     inner = FR4(thickness=0.55)
...     bottom = copper1oz
...     bottom_surface = SoldermaskLayer(thickness=0.1)
>>> class ProjectStackup2(Stackup):  # or equivalent
...     top_surface = Layer(Dielectric(), thickness=0.1)
...     layers = [
...         Copper(),
...         FR4(thickness=0.55),
...         Copper(),
...     ]
...     bottom_surface = Layer(Dielectric(), thickness=0.1)
name: str | None = None#
property conductors: Sequence[Conductor]#

The conductors in this stackup.

class Symmetric[source]#

Bases: Stackup

Base class to generate a symmetric stackup. The last layer in the stackup will become the innermost dielectric layer in the final result.

>>> class ProjectStackup(Symmetric):
...     outer = Dielectric(thickness=0.1)
...     top = Conductor(thickness=0.2)
...     core = FR4(thickness=0.55)
>>> len([layer for layer in decompose(ProjectStackup(), Material)])
5
>>> len(ProjectStackup().conductors)
2
bottom = None#

The bottom of the stackup, will be filled in by the stackup generator.

class Material(*, name=None, thickness=None)[source]#

Bases: Critical

Base class for layer materials. Do not subclass this directly, subclass Dielectric or Conductor instead. A material subclass represents a new material, an instantiated material represents a layer of that material in the stackup.

Parameters:
  • name (str | None)

  • thickness (float | None)

material_name: ClassVar[str | None] = None#

Name of the material. If not specified, the name of the class is used.

thickness: float | None = None#

Thickness of the layer in mm. Is ideally specified as a class attribute. If no thickness is declared for this material, a thickness must be specified in the constructor.

name: str | None = None#

Name of the layer. If not specified, the name of the field in the stackup is used.

class Dielectric(*, name=None, thickness=None)[source]#

Bases: Material

A dielectric material. Subclass this to create a new dielectric material, setting the dielectric coefficient and loss tangent as appropriate as a class attributes. If the name of the class is insufficient to identify the material, set the material_name class attribute as well.

>>> class FR4(Dielectric):
...     "Material description goes in the docstring."
...     dielectric_coefficient = 4.4
...     loss_tangent = 0.0168
>>> class FR4Prepreg(FR4):
...     thickness = 0.21
>>> class FR4Core(FR4):
...     thickness = 1.065
Parameters:
  • name (str | None)

  • thickness (float | None)

dielectric_coefficient: ClassVar[float | None] = None#
loss_tangent: ClassVar[float | None] = None#
class Conductor(*, name=None, thickness=None)[source]#

Bases: Material

A conductive material. Subclass this to create a new conductive material, setting the roughness as appropriate as a class attribute. If the name of the class is insufficient to identify the material, set the material_name class attribute as well.

>>> class Copper1oz(Conductor):
...     "Material description for our 1oz copper goes in the docstring."
...     material_name = "Copper 1oz"
...     thickness = 0.035
Parameters:
  • name (str | None)

  • thickness (float | None)

roughness: ClassVar[float | None] = None#