Kaspar
-- (this is a VHDL comment)-- import std_logic from the IEEE librarylibrary IEEE;use IEEE.std_logic_1164.all;-- this is the entityentity ANDGATE is port ( I1 : in std_logic; I2 : in std_logic; O : out std_logic);end entity ANDGATE;-- this is the architecturearchitecture RTL of ANDGATE isbegin O <= I1 and I2;end architecture RTL;
//Verilog-A (1993) and Verilog-AMS (2000)`include "constants.vams"`include "disciplines.vams"// Simple ADC modelmodule adc_simple(clk, dout, vref, vin); // Parameters parameter integer bits = 4 from[1:24]; // Number of bits parameter integer td = 1 from[0:inf); // Processing delay of the ADC // Define input/output input clk, vin, vref; output [bits-1:0] dout; electrical vref, vin; logic clk; reg [bits-1:0] dout; // Internal variables real ref, sample; integer i; ...
-- VHDL-AMS-- IEEE 1076.1-1999library IEEE;use IEEE.math_real.all;use IEEE.electrical_systems.all;entity DIODE is generic (iss : current := 1.0e-14; -- Saturation current af : real := 1.0; -- Flicker noise coefficient kf : real := 0.0); -- Flicker noise exponent port (terminal anode, cathode : electrical);end entity DIODE;architecture IDEAL of DIODE is quantity v across i through anode to cathode; constant vt : voltage := 0.0258; -- Thermal voltage at 300 Kbegin i == iss * (exp(v/vt) - 1.0);end architecture IDEAL;
/* PHDL - PCB hardware description language (Brent Nelson, 2011)*/// A surface mount resistordevice resistor { attr REFPREFIX = "R"; attr FOOTPRINT = "R0805"; attr LIBRARY = "rcl-smd"; attr VALUE = "1k"; pin a = {1}; pin b = {2};}design top { net vcc, vout, gnd; inst r1 of resistor { a = vcc; b = vout; } inst r2 of resistor { a = vout; b = gnd; }}
from skidl import *gnd = Net('gnd') # Ground reference.vin = Net('vin') # Input voltage to the divider.vout = Net('vout') # Output voltage from the divider.r1, r2 = 2 * Part('device', 'R', TEMPLATE) # Create two resistors.r1.value, r1.footprint = '1K', 'Resistors_SMD:R_0805' # Set resistor valuesr2.value, r2.footprint = '500', 'Resistors_SMD:R_0805' # and footprints.r1[1] += vin # Connect the input to the first resistor.r2[2] += gnd # Connect the second resistor to ground.vout += r1[2], r2[1] # Output comes from the connection of the two resistors.generate_netlist()
from pycircuit import *Footprint('R0805', 'R', '0805', Map(1, '1'), Map(2, '2'))@circuit('TOP')def top(): Node('R1', 'R') Node('R2', 'R') Ref('R1')['1'] + Net('VCC') Ref('R1')['2'] + Net('Vout') Ref('R2')['1'] + Net('Vout') Ref('R2')['2'] + Net('GND')
> let {parse} = require('electro-grammar')> parse('100nF 0603 C0G 10% 25V'){ type: 'capacitor', capacitance: 1e-7, size: '0603', characteristic: 'C0G', tolerance: 10, voltage_rating: 25 }> parse('1k 0805 5% 125mW'){ type: 'resistor', resistance: 1000, size: '0805', tolerance: 5, power_rating: 0.125 }> parse('green led 1206'){ type: 'led', color: 'green', size: '1206' }
let {Resistor, Nets, Circuit} = require('replicad')let r1 = Resistor('1k 0603')let r2 = r1.copy()let [vcc, vout, gnd] = Nets(3)let circuit = Circuit()circuit.connect_through(vcc, r1, vout, r2, gnd)export circuit
KicadModTree: a Python DSL for KiCad footprints
PyCircuit: DSL for footprints, experimental layout and routing using SMT solvers
Footwork: very experimental and also stagnated KiCad footprint (text) editor combining Racket (Scheme) and the KiCad s-expression format
Fast build to test iteration cycles
Use programming constructs for a faster/better design process
Modularity and re-usability
Kaspar
Keyboard shortcuts
↑, ←, Pg Up, k | Go to previous slide |
↓, →, Pg Dn, Space, j | Go to next slide |
Home | Go to first slide |
End | Go to last slide |
Number + Return | Go to specific slide |
b / m / f | Toggle blackout / mirrored / fullscreen mode |
c | Clone slideshow |
p | Toggle presenter mode |
t | Restart the presentation timer |
?, h | Toggle this help |
Esc | Back to slideshow |