In our company’s requirement, we need to have at least one test point for each net, so I always have to check the relationship between them.
But currently there is no fast way to do it. I always have to export netlist first and then check the netlist line by line, if the schematcs have many nets, this work will cost me much time.
Could anyone tell me a way, or have a python script for me, to export a list to show the relationship between nets and testpoint.
And you will see that the net contains a lot of component, one of them shall be a test point.
I want to do is to figure out which net contains 1 ore more test point( the designator begins with TP), , and which net doesn’t contain any test point, and then add test point to the net which has no test point.
You don’t use netlist in Kicad format instead of xml ?
I’ve just made a quick small script that use a Kicad format netlist parser, but I can parse XML too if it’s usual for you to use this format.
I’m finalizing the script, he will be able to parse kical netlist format and xml netlist format.
Are you at ease with python environnement or do you prefer an executable file ?
I can easily make a .exe application.
@xzf16 Here is the Github repo address : https://github.com/Peboli/kicad_netlist_tp_parser
Let me know if everything is OK for you with this.
In a first time, despite what I said earlier, the script only manage xml format netlist.
I’ve tried with a third party module to parse netlist in .net Kicad format but it’s rather slow compared to the XML format.
Btw this is something suitable to be pcbnew action plugin. It would be much easier to use if it were just a button in the toolbar instead of manually generating netlist file and then feeding it to a python script.
Yes indeed, you’re right.
But this was just to answer to a ponctual request, I’ve made something quick and simple.
I still haven’t yet had a look at the Kicad API, but will do soon in my spare time.
If you want to do it more in the future, we can discuss the entire requirement for it.
I think we can have a summary section first like this:
======Summary=======
Total connected nets:100
Connected Net with TestPoint:96
Connected Net without TestPoint:4
Unconnected Nets:10
Test point coverage:96%
======Summary=======
And then, we can have a list for nets and test points, like this:
======Connected nets without test point=======
Net_1
Net_2
Net_3
...
======1 test point connected nets=======
Net_11 TP101
Net_12 TP102
Net_13 TP103
...
======More than 1 test point connected nets=======
Net_21 TP201 TP301 TP302
Net_22 TP202 TP210
Net_23 TP203 TP211 TP212 TP213 TP214
...
======Unconnected nets=======
Unconnected_Net01
Unconnected_Net02
...
If we have done so, this plugin will be a very good plugin analysis test point for KiCAD schematics.
Of coure, this is just a requirement discussion, if you think it’s too complex to achieve or it will cost you much time, we can left it open and maybe somebody else will achieve it.
And next step, I think we should consider how to integrate it into KiCAD.
In KiCAD schematic editor, I haven’t found any external plugin menu, maybe it haven’t support external plugin. So, if we want to integrate this script into KiCAD, I think using BOM generate function is a good idea.
The main idea I have considered is to modify this script as a bom generation script, when we press the generate button, it shall do the things like this:
1.Using KiCAD internal xml generation command to generate xml file(just like the other BOM generation script)
2.Using the script we have done to read the xml file to get the test point list
3.export the list to a text file.
Yes, this is the next step, but for this I need to dive into Kicad scripting and understand how it works.
I don’t promise I’ll do that in the next days, but I’ll have a look at it soon.