Does SKiDL work with AI?

A new thread, split off from: SKiDL: a Python-based schematic design language

To OP / @JustTryingToWork
It’s forum policy here to rather start a new thread then digging up old threads. KiCad changes a lot quite quickly, and a 7 year old thread rarely has enough overlap. In this case the question seems to be usefulness of SKiDL related to AI, which is very much different subject then the introduction of the SKiDL plugin itself. Reading though a long thread before getting to a question of a different person is also not efficient. Referring to an old thread for context can be a good idea.

@Claudio.Lorini, @RaptorUK
JustTryingToWork has been here for a year but does not have much activity according to his profile. Not everyone is aware of forum policy. It’s also forum policy “to be nice” (I am also struggling with this a bit myself every now and then). Closing a topic without explaining why or splitting it off is a bit blunt. It’s quite easy to split off a topic. Have you ever attempted this?


I’ve just found out about SKiDL, and I think it may be the perfect solution for allowing ChatGPT or any other AI to finally be able to produce an intelligible schematic.

At the moment ChatGPT offers to show me what a schematic of a particular circuit might look like, and it just outputs a crappy image of a block diagram… Gee thanks I guess.

But then today it actually produced a SKiDL file and tried to run it only to find it didn’t have the SKiDL library installed. Well now I have it installed, so let’s see how far we can take this. I’m only just getting started with SKiDL, but if anyone who already knows it is motivated to make a KiCAD plugin that can import SKiDL files directly, I think that would be amazing.

Anyway, if you’re curious to see what AI can do with schematics, I think this could be a way to test it out.

PS, save the AI hate. I don’t care if you don’t like AI, to each their own. I find my productivity has increased quite a lot. I learn new skills so much faster when the teacher knows how to properly explain something and never gets frustrated with me when I don’t get something right away. Beats the pants off the gatekeeping ego-maniacal jerks at stackoverflow etc.

Please ask AI what thinks about reopening a seven year old thread.

If you’re interested in the answer, ask it yourself.

It seems your opinion is that replying to an existing thread is less useful than starting a new post.

My opinion is that if everyone went around making a new post every time they wanted to talk to people interested in the same topics, there’d be no threads, only a bajillion new posts with no replies.

What’s it to you if I reply to an old thread? You weren’t subscribed to receive notifications of replies to the thread were you? You never commented in this thread before, so why now with a completely asinine off topic response? If you’re not interested, jog on. No one needs your negative ego jamming everything up. I’m not interested in your response and I doubt anyone else is. How is it helpful at all? Go to stack overflow or where ever your ilk get their kicks.

EDIT:

God I hate trolls. But I actually have an update that is ON TOPIC:

I managed to install SKiDL 2.0.1, but I also currently have KiCAD 9.0.2 installed, and the two do not especially play well together. I might have to update the generate_schematic() function since KiCAD 9 doesn’t seem able to import netlists into the schematic editor anymore. (yeah I could probably install KiCAD 5 and make everything easier)

Furthermore I’m having a little trouble with the library/symbol files as well since KiCAD 9 uses a different format, it seems, than from what SKiDL is expecting. Names aren’t quite lining up, and though I can pull library names, device names, and even the pinout list from the symbol editor, it’s a lot of manual work getting things to line up. so vibe coding it through the AI does help make that easier. Copy paste a pinout table, and the SKiDL code is all updated. That’s nice.

I’ll keep at it off and on and see how far I can get. I managed to get some parts imported into the PCB editor from the netlist, but some parts threw errors, and I was hoping for a schematic more than a bunch of parts on a new PCB. Fun fun.

Edit 2: So I managed to get everything working well, and I can get the parts imported into a new PCB through netlist importing. The connections are all mapped out, but at the moment ChatGPT o4, at least, isn’t very good at making circuits. It’s first attempt only included an opamp and an analog switch with a half a dozen resistors. I suggested capacitors, and it added them. I haven’t inspected the circuit at all, because I don’t expect it to be correct, but the interesting part is that this seems to be working. Convert enough kicad projects to skidl and we could train an AI to make actual functioning circuits. I think that’s amazing. Here’s the progress I got so far. I only started this today, and I didn’t have to write a single line of skidl myself, though I did correct a few mistakes early on. The rest got vibe coded. Run the software, copy paste errors, the AI fixes them, and then run the software again. Rinse and repeat. Here’s the code for a synthesizer module the AI thought up and attempted to make a circuit for. If I really wanted to build it, I’d probably have to do it myself or basically teach it how to build the circuit. Still this has been very interesting. Thanks for developing SKiDL. I’m going to have a lot of fun with this.

# SKiDL Script for Dual VCA Switcher (TL074 + CD4053)

from skidl import *

# Setup
import os
os.environ['KICAD_SYMBOL_DIR'] = r'C:\Program Files\KiCad\9.0\share\kicad\symbols'
set_default_tool(KICAD7)

# Power and Reference Nets
vcc = Net('+12V')
vee = Net('-12V')
gnd = Net('GND')
vref = Net('VREF')

# Signal and Control Nets
signal_in = Net('Signal_In')
signal_out = Net('Signal_Out')
cv_a = Net('CV_A')
cv_b = Net('CV_B')

# Create Opamp (TL074)
tl074 = Part('Amplifier_Operational', 'TL074', footprint='Package_DIP:DIP-14_W7.62mm')

# VCA A: U1A
u1a_out = Net('U1A_OUT')
r1 = Part('Device', 'R', footprint='Resistor_SMD:R_0603_1608Metric_Pad0.98x0.95mm_HandSolder')
r2 = Part('Device', 'R', footprint='Resistor_SMD:R_0603_1608Metric_Pad0.98x0.95mm_HandSolder')
r6 = Part('Device', 'R', footprint='Resistor_SMD:R_0603_1608Metric_Pad0.98x0.95mm_HandSolder')

signal_in += r1[1]
r1[2] += tl074[3]   # Signal to non-inverting input
cv_a += r2[1]
r2[2] += tl074[2]   # CV to inverting input
u1a_out += tl074[1] # Output
r6[1] += tl074[1]
r6[2] += tl074[2]   # Feedback

# VCA B: U1B
u1b_out = Net('U1B_OUT')
r3 = Part('Device', 'R', footprint='Resistor_SMD:R_0603_1608Metric_Pad0.98x0.95mm_HandSolder')
r5 = Part('Device', 'R', footprint='Resistor_SMD:R_0603_1608Metric_Pad0.98x0.95mm_HandSolder')
r7 = Part('Device', 'R', footprint='Resistor_SMD:R_0603_1608Metric_Pad0.98x0.95mm_HandSolder')

signal_in += r3[1]
r3[2] += tl074[5]   # Signal to non-inverting input
cv_b += r5[1]
r5[2] += tl074[6]   # CV to inverting input
u1b_out += tl074[7] # Output
r7[1] += tl074[7]
r7[2] += tl074[6]   # Feedback

# Analog Switch: CD4053
cd4053 = Part('Analog_Switch', 'CD4053B', footprint='Package_DIP:DIP-16_W7.62mm')

r4 = Part('Device', 'R', footprint='Resistor_SMD:R_0603_1608Metric_Pad0.98x0.95mm_HandSolder')
r8 = Part('Device', 'R', footprint='Resistor_SMD:R_0603_1608Metric_Pad0.98x0.95mm_HandSolder')

u1a_out += r4[1]
r4[2] += cd4053['A0']
u1b_out += cd4053['B0']

# Output Buffer: U1C
r8[1] += cd4053['A']
r8[2] += tl074[8]     # Buffer input
signal_out += tl074[14]  # Buffer output

# Power Connections
vcc += tl074['4'], cd4053['16']
vee += tl074['11'], cd4053['8']
gnd += cd4053['7']

# Power Supply Decoupling Capacitors
# TL074 (pin 4 = VCC, pin 11 = VEE)
c_tl074_vcc = Part('Device', 'C', value='100n', footprint='Capacitor_SMD:C_0603_1608Metric')
c_tl074_vee = Part('Device', 'C', value='100n', footprint='Capacitor_SMD:C_0603_1608Metric')
c_tl074_bulk_vcc = Part('Device', 'C', value='10u', footprint='Capacitor_SMD:C_1206_3216Metric')
c_tl074_bulk_vee = Part('Device', 'C', value='10u', footprint='Capacitor_SMD:C_1206_3216Metric')

vcc += c_tl074_vcc[1], c_tl074_bulk_vcc[1]
gnd += c_tl074_vcc[2], c_tl074_bulk_vcc[2]
vee += c_tl074_vee[1], c_tl074_bulk_vee[1]
gnd += c_tl074_vee[2], c_tl074_bulk_vee[2]

# CD4053 (pin 16 = VDD, pin 8 = VSS, pin 7 = VEE)
c_cd4053_vdd = Part('Device', 'C', value='100n', footprint='Capacitor_SMD:C_0603_1608Metric')
c_cd4053_vss = Part('Device', 'C', value='100n', footprint='Capacitor_SMD:C_0603_1608Metric')
c_cd4053_bulk_vdd = Part('Device', 'C', value='10u', footprint='Capacitor_SMD:C_1206_3216Metric')
c_cd4053_bulk_vss = Part('Device', 'C', value='10u', footprint='Capacitor_SMD:C_1206_3216Metric')

vcc += c_cd4053_vdd[1], c_cd4053_bulk_vdd[1]
gnd += c_cd4053_vdd[2], c_cd4053_bulk_vdd[2]
gnd += c_cd4053_vss[1], c_cd4053_bulk_vss[1]
c_cd4053_vss[2] += cd4053['8']
c_cd4053_bulk_vss[2] += cd4053['8']

# INH pin (6) tied low to enable switching
cd4053['6'] += gnd

# Generate netlist
generate_netlist()

Thank you very much Paul. I searched for topics regarding SKiDL, and this topic seemed most appropriate at the time, and I did not notice the age of the post.

I have also searched for the rules regarding posting in old threads, and I could not find a rule regarding this or even rules for the forum at all. Most things that mention new members (where I supposed that information might be found) was primarily concerned with how to use KiCAD. I do not have many of those types of questions, but I gave them a quick browse.

I was quite ready to avoid these forums altogether after the thread was locked. It seems to me that if there were an official rule forbidding posting in old threads, those threads would be locked so that no one could post in them. The thread was not locked at the time I posted in it. So it seemed there was no such official rule. I apologize and will avoid posting in old threads in the future.

This also happens quite often to people reading a post. I’ve quite often read a relatively long old thread, only to discover afterwards that someone posted a new question in an old thread, which completely changes the context.

A few years ago (3 to 5) this was implemented. All new threads created after that date get closed automatically after three months, but older threads do not close automatically.

You’re probably right. I guess it’s not written down anywhere.

1 Like

Your interests might be better served on the SKiDL discussion forum. We already have one member that’s done work on integrating LLMs into SKiDL.

1 Like

Indeed:

Thanks devbisme! I did visit the github briefly while researching SKiDL after ChatGPT began attempting to use it, but since PIP installed everything automatically, I quickly got distracted.

In fact, this is the first time I’ve ever heard of anyone using discussion groups on github other than issue reports. I’ll be joining the discussion soon.