• Stars
    star
    1,037
  • Rank 44,435 (Top 0.9 %)
  • Language
    Jupyter Notebook
  • License
    MIT License
  • Created about 8 years ago
  • Updated 3 months ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

SKiDL is a module that extends Python with the ability to design electronic circuits.

skidl

The SKiDL Python package lets you compactly describe the interconnection of electronic circuits and components. The resulting Python program performs electrical rules checking for common mistakes and outputs a netlist that serves as input to a PCB layout tool.

Features

  • Has a powerful, flexible syntax (because it is Python).
  • Permits compact descriptions of electronic circuits (think about not tracing signals through a multi-page schematic).
  • Allows textual descriptions of electronic circuits (think about using diff and git for circuits).
  • Performs electrical rules checking (ERC) for common mistakes (e.g., unconnected device I/O pins).
  • Supports linear / hierarchical / mixed descriptions of electronic designs.
  • Fosters design reuse (think about using PyPi and Github to distribute electronic designs).
  • Makes possible the creation of smart circuit modules whose behavior / structure are changed parametrically (think about filters whose component values are automatically adjusted based on your desired cutoff frequency).
  • Can work with any ECAD tool (only two methods are needed: one for reading the part libraries and another for outputing the correct netlist format).
  • Can perform SPICE simulations (Python 3 only).
  • Takes advantage of all the benefits of the Python ecosystem (because it is Python).

As a very simple example (see more in the blog), the SKiDL program below describes a two-input AND gate built from discrete transistors:

https://raw.githubusercontent.com/nturley/netlistsvg/master/doc/and.svg?sanitize=true

from skidl import *

# Create part templates.
q = Part("Device", "Q_PNP_CBE", dest=TEMPLATE)
r = Part("Device", "R", dest=TEMPLATE)

# Create nets.
gnd, vcc = Net("GND"), Net("VCC")
a, b, a_and_b = Net("A"), Net("B"), Net("A_AND_B")

# Instantiate parts.
gndt = Part("power", "GND")             # Ground terminal.
vcct = Part("power", "VCC")             # Power terminal.
q1, q2 = q(2)                           # Two transistors.
r1, r2, r3, r4, r5 = r(5, value="10K")  # Five 10K resistors.

# Make connections between parts.
a & r1 & q1["B C"] & r4 & q2["B C"] & a_and_b & r5 & gnd
b & r2 & q1["B"]
q1["C"] & r3 & gnd
vcc += q1["E"], q2["E"], vcct
gnd += gndt

generate_netlist()

And this is the output that can be fed to a program like KiCad's PCBNEW to create the physical PCB:

(export (version D)
  (design
    (source "/media/devb/Main/devbisme/KiCad/tools/skidl/skidl/circuit.py")
    (date "05/11/2021 10:40 AM")
    (tool "SKiDL (1.0.0)"))
  (components
    (comp (ref #PWR1)
      (value GND)
      (footprint "No Footprint")
      (fields
        (field (name F0) #PWR)
        (field (name F1) GND))
      (libsource (lib power) (part GND))
      (sheetpath (names /top/16948080335112909674) (tstamps /top/16948080335112909674)))
    (comp (ref #PWR2)
      (value VCC)
      (footprint "No Footprint")
      (fields
        (field (name F0) #PWR)
        (field (name F1) VCC))
      (libsource (lib power) (part VCC))
      (sheetpath (names /top/10777333099431236833) (tstamps /top/10777333099431236833)))
    (comp (ref Q1)
      (value Q_PNP_CBE)
      (footprint "No Footprint")
      (fields
        (field (name F0) Q)
        (field (name F1) Q_PNP_CBE))
      (libsource (lib Device) (part Q_PNP_CBE))
      (sheetpath (names /top/5605641708446153824) (tstamps /top/5605641708446153824)))
    (comp (ref Q2)
      (value Q_PNP_CBE)
      (footprint "No Footprint")
      (fields
        (field (name F0) Q)
        (field (name F1) Q_PNP_CBE))
      (libsource (lib Device) (part Q_PNP_CBE))
      (sheetpath (names /top/3991298653620578089) (tstamps /top/3991298653620578089)))
    (comp (ref R1)
      (value 10K)
      (footprint "No Footprint")
      (fields
        (field (name F0) R)
        (field (name F1) R))
      (libsource (lib Device) (part R))
      (sheetpath (names /top/17650585640079795295) (tstamps /top/17650585640079795295)))
    (comp (ref R2)
      (value 10K)
      (footprint "No Footprint")
      (fields
        (field (name F0) R)
        (field (name F1) R))
      (libsource (lib Device) (part R))
      (sheetpath (names /top/11461493733231665754) (tstamps /top/11461493733231665754)))
    (comp (ref R3)
      (value 10K)
      (footprint "No Footprint")
      (fields
        (field (name F0) R)
        (field (name F1) R))
      (libsource (lib Device) (part R))
      (sheetpath (names /top/1249286041592970488) (tstamps /top/1249286041592970488)))
    (comp (ref R4)
      (value 10K)
      (footprint "No Footprint")
      (fields
        (field (name F0) R)
        (field (name F1) R))
      (libsource (lib Device) (part R))
      (sheetpath (names /top/7242640812520981502) (tstamps /top/7242640812520981502)))
    (comp (ref R5)
      (value 10K)
      (footprint "No Footprint")
      (fields
        (field (name F0) R)
        (field (name F1) R))
      (libsource (lib Device) (part R))
      (sheetpath (names /top/9932266607871614386) (tstamps /top/9932266607871614386))))
  (nets
    (net (code 1) (name A)
      (node (ref R1) (pin 1)))
    (net (code 2) (name A_AND_B)
      (node (ref Q2) (pin 1))
      (node (ref R5) (pin 1)))
    (net (code 3) (name B)
      (node (ref R2) (pin 1)))
    (net (code 4) (name GND)
      (node (ref #PWR1) (pin 1))
      (node (ref R3) (pin 2))
      (node (ref R5) (pin 2)))
    (net (code 5) (name N$1)
      (node (ref Q1) (pin 2))
      (node (ref R1) (pin 2))
      (node (ref R2) (pin 2)))
    (net (code 6) (name N$2)
      (node (ref Q1) (pin 1))
      (node (ref R3) (pin 1))
      (node (ref R4) (pin 1)))
    (net (code 7) (name N$3)
      (node (ref Q2) (pin 2))
      (node (ref R4) (pin 2)))
    (net (code 8) (name VCC)
      (node (ref #PWR2) (pin 1))
      (node (ref Q1) (pin 3))
      (node (ref Q2) (pin 3))))
)

More Repositories

1

kicad-3rd-party-tools

Software tools/utilities made by others to augment the KiCad PCB EDA suite.
745
star
2

RPi_Hat_Template

KiCad template for a Raspberry Pi B+ Hat PCB.
HTML
212
star
3

KiPart

Python package for generating multi-unit schematic symbols for KiCad from a CSV file.
Python
174
star
4

myhdl-resources

A collection of awesome MyHDL tutorials, projects and third-party tools.
92
star
5

KiCad-Schematic-Symbol-Libraries

Schematic symbol libraries for FPGAs & microcontrollers.
Python
88
star
6

HierPlace

KiCad PCBNEW plugin that arranges parts into groups that reflect the design hierarchy.
Python
81
star
7

WireIt

KiCad PCBNEW plugin that lets you add wires between pads on a PCB, delete them, and swap wires between pads.
Python
80
star
8

KiField

Edit/insert/delete part fields in KiCad schematics or libraries using a spreadsheet.
Python
70
star
9

FpgasNowWhat

Source for the "FPGAs?! Now What?" Book
VHDL
61
star
10

CAT-Board

The CAT Board is a Raspberry Pi HAT with a Lattice iCE40HX FPGA.
Jupyter Notebook
59
star
11

myhdlpeek

Monitor and display signal waveforms from your MyHDL/nMigen digital design in a Jupyter notebook.
Python
39
star
12

PadPainter

PCBNEW plugin that highlights pads on a PCB that meet specified criteria (part, unit, number, name, and function).
Python
24
star
13

kinparse

A Parser for KiCad EESCHEMA netlists.
Python
22
star
14

DRMgr

A PCBNEW plugin that saves and restores design rules for a KiCad PCB.
Python
22
star
15

pygmyhdl

MyHDL hardware design language encased in the tasty PygMyHDL wrapper.
Python
19
star
16

circuitsascode

CSS
15
star
17

tang_nano_user

User-centered experiments with the Sipeed Tang Nano FPGA Board.
GLSL
13
star
18

RPi_Hat.pretty

Module containing components footprints used in the KiCad template for the Raspberry Pi B+ Hat.
12
star
19

kinet2pcb

Utility to convert a KiCad netlist into a PCBNEW .kicad_pcb file.
Python
12
star
20

kinjector

Inject/eject JSON data to/from KiCad files.
Python
12
star
21

RepoRecon

Gather and display information on Github repositories that match a given topic.
11
star
22

Hardware-Sorters

Jupyter notebook describing, simulating, and comparing two hardware-based circuits for sorting a list of numbers.
Jupyter Notebook
9
star
23

zyc

GUI utility for searching and selecting parts and footprints for use with SKiDL.
Python
9
star
24

docker_kicad

Building a Docker image to run KiCad 5, 6, 7, ...
8
star
25

Awesome-Stochastic-Computing

A curated collection of papers, books and repositories about stochastic computing.
7
star
26

hackspace_kicad_tutorials

A compilation of KiCad tutorials originally published by HackSpace magazine.
Shell
5
star
27

pynqer

Unskilled experimentation with the XILINX PYNQ board.
Jupyter Notebook
4
star
28

Maker-s-Toolbox

Design files for a postcard with information about analog and digital electronic design.
Python
4
star
29

Coulda-Been-a-Tweet

Short entries arranged chronologically about stuff I've seen.
4
star
30

KiCon

My KiCon presentations.
JavaScript
4
star
31

Maker-Faire

Source code for Maker Faire projects
VHDL
3
star
32

bayes-pool-ball

Python notebook showing the use of Baye's Rule to estimate the position of an unseen cue ball on a pool table.
Jupyter Notebook
2
star
33

mighty85_demo

A demonstration of how to bring up and use the Mighty85 using the Arduino IDE.
2
star
34

psswrd

Simple script with a GUI that generates pronounceable passwords and places them on the clipboard.
Python
2
star
35

nutrinews

Use OpenAI's GPT to remove bias from news articles.
Python
2
star
36

discosuck

Suck the posts out of a Discourse forum.
Python
1
star
37

birthday_bromides

A bromide for every year I've been alive!
1
star
38

litterbox

A set of tools to manage all the crap for the CAT Board.
Python
1
star
39

locknotey

Simple script that stores encrypted data within itself and allows you to modify it using any editor.
Python
1
star