-
Notifications
You must be signed in to change notification settings - Fork 124
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Refactor netlist generation #243
Conversation
I pulled this into a new branch called I moved your example into |
Maybe you exported the netlist in a non-default format? I just checked out the branch you made and it seems to work well for me. Can you try generating the netlist to test with the command line tool? For me that is running:
I made a 2 updates to this PR and this feature should be ready now: I can succesfully export a Kicad project netlist, import it to a SKiDL based project folder, then run the SKiDL code to produce a netlist which does not change the original Kicad PCB connections. See report.txt for the import report. |
I tried those commands (except the KiCad project is in directory |
Can you post the poblematic netlist file? It sounds like there's an edge case that isn't handled properly. |
I attached the netlist file I generated using kicad-cli. (I changed the file extension to .txt so Github would take it.) Are we both using the same version of KiCad (8.0.8)? A
|
That file works fine on my machine. Here's my setup: Kicad v8.0.6 Then I updated to Kicad 8.0.8 to see if that made a difference. I ran the kicad_to_netlist command as before, then parsed the resulting
Interestingly, I don't find |
Ah, that's embarassing: I had an old version of |
Awesome! Let me know if there's any changes or tests you'd like implemented before finishing off this feature. |
I made some comments about the issue of tagging components in issue #238, but there isn't a need to address this right now since the old code has the same problem. I probably need to add a test for the new code before merging everything into the |
There is already a |
Are you ok with making the tests? I've turned my attention towards Kicad 8 schematic generation but I'd like to finish off this feature since it could be really valuable to use along with the LLM code. |
I'll merge the |
I've merged I also merged |
There shouldn't be much overlapping changes so merge the branches however you think best and I'll keep working off my schematic generation feature branch I have going |
Testing on |
I pushed the updated |
Ok, good news: I made a script that can take a kicad_sch, turn it into a netlist file, then turn the netlist file into a SKIDL project, then analyze the circuit with the LLM logic: Terminal output:
|
Bad news: this logic doesn't work on my custom project.
Then SKIDL can't parse these components properly since they are invalid python code
I'm guessing there's a few other edge cases. I'll start working on these edge case solutions this week. |
I can add that to the
Is it just a matter of adding quotes on the
Just add a |
I'll take a shot at fixing the 2nd and 3rd point if you want to do the |
The new 1.2.3 version of |
Confirmed the new change is working to parse kicad netlists without error. Thank you! I had to go back and work on the |
The only changes are to
src/skidl/scripts/netlist_to_skidl_main.py
and tosrc/skidl/netlist_to_skidl.py
. Other files include an example kicad project, netlists from kicad and skidl, and the output folder containing generated skidl python filesThis logic changes the Kicad netlist to SKiDL logic so that the SKiDL project is generated in hierarchical fashion mirroring the KiCAD schematic. Take a look at
example_kicad_project_SKIDL
directory for the output fromexample_kicad_project.net
, which is the Kicad export from the project inexample_kicad_project/
.main.net
is the SKiDL exported netlist that succesfully imports to Kicad and has the same connections as the based project.Here is how you can try this logic:
The core logic works as expected connection wise and could be used with the LLM logic as is. But there's still a bit of work to do to make a completely transparent Kicad > Skidl > Kicad loop. I'll try merging in this fix tomorrow to fix the component reference issue. I also need to tweak the output net names I believe.